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.



9105
9106
9107
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 9105

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

Instance Attribute Details

#valueObject (readonly)

Returns the value of attribute value.



9103
9104
9105
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 9103

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



9131
9132
9133
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 9131

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

.ALLObject



9125
9126
9127
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 9125

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



9110
9111
9112
9113
9114
9115
9116
9117
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 9110

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



9120
9121
9122
9123
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 9120

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



9136
9137
9138
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 9136

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

Instance Method Details

#to_hashObject



9140
9141
9142
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 9140

def to_hash
  value
end