Class: Io::Flow::V0::Models::ShipmentIntegrationType

Inherits:
Object
  • Object
show all
Defined in:
lib/flow_commerce/flow_api_v0_client.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(value) ⇒ ShipmentIntegrationType

Returns a new instance of ShipmentIntegrationType.



11124
11125
11126
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 11124

def initialize(value)
  @value = HttpClient::Preconditions.assert_class('value', value, String)
end

Instance Attribute Details

#valueObject (readonly)

Returns the value of attribute value.



11122
11123
11124
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 11122

def value
  @value
end

Class Method Details

.ALLObject



11144
11145
11146
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 11144

def ShipmentIntegrationType.ALL
  @@all ||= [ShipmentIntegrationType.direct, ShipmentIntegrationType.information, ShipmentIntegrationType.preadvice]
end

.apply(value) ⇒ Object

Returns the instance of ShipmentIntegrationType for this value, creating a new instance for an unknown value



11129
11130
11131
11132
11133
11134
11135
11136
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 11129

def ShipmentIntegrationType.apply(value)
  if value.instance_of?(ShipmentIntegrationType)
    value
  else
    HttpClient::Preconditions.assert_class_or_nil('value', value, String)
    value.nil? ? nil : (from_string(value) || ShipmentIntegrationType.new(value))
  end
end

.directObject

Always generate a label for the chosen delivery option.



11149
11150
11151
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 11149

def ShipmentIntegrationType.direct
  @@_direct ||= ShipmentIntegrationType.new('direct')
end

.from_string(value) ⇒ Object

Returns the instance of ShipmentIntegrationType for this value, or nil if not found



11139
11140
11141
11142
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 11139

def ShipmentIntegrationType.from_string(value)
  HttpClient::Preconditions.assert_class('value', value, String)
  ShipmentIntegrationType.ALL.find { |v| v.value == value }
end

.informationObject

Booking and label generation is not available. Just use Flow to calculate delivery window estimates and shipment prices to display.



11155
11156
11157
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 11155

def ShipmentIntegrationType.information
  @@_information ||= ShipmentIntegrationType.new('information')
end

.preadviceObject

A generic label will be provided by the client organization when available as pre-advice shipment notification to carrier partner.



11161
11162
11163
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 11161

def ShipmentIntegrationType.preadvice
  @@_preadvice ||= ShipmentIntegrationType.new('preadvice')
end

Instance Method Details

#to_hashObject



11165
11166
11167
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 11165

def to_hash
  value
end