Class: Io::Flow::V0::Models::ManifestType

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) ⇒ ManifestType

Returns a new instance of ManifestType.



8602
8603
8604
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 8602

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

Instance Attribute Details

#valueObject (readonly)

Returns the value of attribute value.



8600
8601
8602
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 8600

def value
  @value
end

Class Method Details

.allObject

Manifest all open shipping labels that are not part of a manifest yet for the organization and carrier service



8628
8629
8630
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 8628

def ManifestType.all
  @@_all ||= ManifestType.new('all')
end

.ALLObject



8622
8623
8624
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 8622

def ManifestType.ALL
  @@all ||= [ManifestType.all, ManifestType.list]
end

.apply(value) ⇒ Object

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



8607
8608
8609
8610
8611
8612
8613
8614
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 8607

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

.from_string(value) ⇒ Object

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



8617
8618
8619
8620
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 8617

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

.listObject

Manifest only the list of specified labels



8633
8634
8635
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 8633

def ManifestType.list
  @@_list ||= ManifestType.new('list')
end

Instance Method Details

#to_hashObject



8637
8638
8639
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 8637

def to_hash
  value
end