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.



16264
16265
16266
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16264

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

Instance Attribute Details

#valueObject (readonly)

Returns the value of attribute value.



16262
16263
16264
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16262

def value
  @value
end

Class Method Details

.ALLObject



16284
16285
16286
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16284

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



16269
16270
16271
16272
16273
16274
16275
16276
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16269

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.



16299
16300
16301
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16299

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



16279
16280
16281
16282
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16279

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



16289
16290
16291
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16289

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

.shippedObject

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



16294
16295
16296
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16294

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

Instance Method Details

#to_hashObject



16303
16304
16305
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16303

def to_hash
  value
end