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.



13056
13057
13058
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13056

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

Instance Attribute Details

#valueObject (readonly)

Returns the value of attribute value.



13054
13055
13056
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13054

def value
  @value
end

Class Method Details

.ALLObject



13076
13077
13078
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13076

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



13061
13062
13063
13064
13065
13066
13067
13068
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13061

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.



13091
13092
13093
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13091

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



13071
13072
13073
13074
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13071

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



13081
13082
13083
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13081

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

.shippedObject

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



13086
13087
13088
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13086

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

Instance Method Details

#to_hashObject



13095
13096
13097
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13095

def to_hash
  value
end