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.



9930
9931
9932
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 9930

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

Instance Attribute Details

#valueObject (readonly)

Returns the value of attribute value.



9928
9929
9930
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 9928

def value
  @value
end

Class Method Details

.ALLObject



9950
9951
9952
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 9950

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



9935
9936
9937
9938
9939
9940
9941
9942
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 9935

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.



9965
9966
9967
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 9965

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



9945
9946
9947
9948
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 9945

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



9955
9956
9957
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 9955

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

.shippedObject

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



9960
9961
9962
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 9960

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

Instance Method Details

#to_hashObject



9969
9970
9971
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 9969

def to_hash
  value
end