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.



12077
12078
12079
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12077

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

Instance Attribute Details

#valueObject (readonly)

Returns the value of attribute value.



12075
12076
12077
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12075

def value
  @value
end

Class Method Details

.ALLObject



12097
12098
12099
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12097

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



12082
12083
12084
12085
12086
12087
12088
12089
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12082

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.



12112
12113
12114
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12112

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



12092
12093
12094
12095
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12092

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



12102
12103
12104
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12102

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

.shippedObject

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



12107
12108
12109
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12107

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

Instance Method Details

#to_hashObject



12116
12117
12118
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12116

def to_hash
  value
end