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.



12627
12628
12629
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12627

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

Instance Attribute Details

#valueObject (readonly)

Returns the value of attribute value.



12625
12626
12627
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12625

def value
  @value
end

Class Method Details

.ALLObject



12647
12648
12649
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12647

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



12632
12633
12634
12635
12636
12637
12638
12639
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12632

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.



12662
12663
12664
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12662

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



12642
12643
12644
12645
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12642

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



12652
12653
12654
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12652

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

.shippedObject

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



12657
12658
12659
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12657

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

Instance Method Details

#to_hashObject



12666
12667
12668
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12666

def to_hash
  value
end