Class: Io::Flow::V0::Models::FulfillmentItemQuantityStatus

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

Returns a new instance of FulfillmentItemQuantityStatus.



20902
20903
20904
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 20902

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

Instance Attribute Details

#valueObject (readonly)

Returns the value of attribute value.



20900
20901
20902
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 20900

def value
  @value
end

Class Method Details

.ALLObject



20922
20923
20924
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 20922

def FulfillmentItemQuantityStatus.ALL
  @@all ||= [FulfillmentItemQuantityStatus.new, FulfillmentItemQuantityStatus.shipped, FulfillmentItemQuantityStatus.cancelled]
end

.apply(value) ⇒ Object

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



20907
20908
20909
20910
20911
20912
20913
20914
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 20907

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

.cancelledObject

Item will not be fulfilled.



20937
20938
20939
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 20937

def FulfillmentItemQuantityStatus.cancelled
  @@_cancelled ||= FulfillmentItemQuantityStatus.new('cancelled')
end

.from_string(value) ⇒ Object

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



20917
20918
20919
20920
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 20917

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

.newObject

Item may be shipped or cancelled



20927
20928
20929
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 20927

def FulfillmentItemQuantityStatus.new
  @@_new ||= FulfillmentItemQuantityStatus.new('new')
end

.shippedObject

Item has been packaged for shipment; can no longer be cancelled.



20932
20933
20934
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 20932

def FulfillmentItemQuantityStatus.shipped
  @@_shipped ||= FulfillmentItemQuantityStatus.new('shipped')
end

Instance Method Details

#to_hashObject



20941
20942
20943
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 20941

def to_hash
  value
end