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.



20289
20290
20291
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 20289

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

Instance Attribute Details

#valueObject (readonly)

Returns the value of attribute value.



20287
20288
20289
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 20287

def value
  @value
end

Class Method Details

.ALLObject



20309
20310
20311
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 20309

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



20294
20295
20296
20297
20298
20299
20300
20301
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 20294

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.



20314
20315
20316
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 20314

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



20304
20305
20306
20307
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 20304

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.



20320
20321
20322
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 20320

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.



20326
20327
20328
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 20326

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

Instance Method Details

#to_hashObject



20330
20331
20332
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 20330

def to_hash
  value
end