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.



16624
16625
16626
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16624

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

Instance Attribute Details

#valueObject (readonly)

Returns the value of attribute value.



16622
16623
16624
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16622

def value
  @value
end

Class Method Details

.ALLObject



16644
16645
16646
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16644

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



16629
16630
16631
16632
16633
16634
16635
16636
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16629

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.



16659
16660
16661
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16659

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



16639
16640
16641
16642
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16639

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



16649
16650
16651
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16649

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

.shippedObject

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



16654
16655
16656
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16654

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

Instance Method Details

#to_hashObject



16663
16664
16665
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16663

def to_hash
  value
end