class Io::Flow::V0::Models::InventoryBackorder

Enables backorders, setting an optional number of units that we allow for backorder. For example, a backorder w/ quantity 10 will enable selling until the actual inventory quantity is -10.

Attributes

quantity[R]

Public Class Methods

new(incoming={}) click to toggle source
# File lib/flow_commerce/flow_api_v0_client.rb, line 46057
def initialize(incoming={})
  super(:discriminator => InventoryStrategy::Types::INVENTORY_BACKORDER)
  opts = HttpClient::Helper.symbolize_keys(incoming)
  HttpClient::Preconditions.require_keys(opts, [:quantity], 'InventoryBackorder')
  @quantity = HttpClient::Preconditions.assert_class('quantity', opts.delete(:quantity), Integer)
end

Public Instance Methods

copy(incoming={}) click to toggle source
# File lib/flow_commerce/flow_api_v0_client.rb, line 46068
def copy(incoming={})
  InventoryBackorder.new(subtype_to_hash.merge(HttpClient::Helper.symbolize_keys(incoming)))
end
subtype_to_hash() click to toggle source
# File lib/flow_commerce/flow_api_v0_client.rb, line 46072
def subtype_to_hash
  {
    :quantity => quantity
  }
end
to_json() click to toggle source
# File lib/flow_commerce/flow_api_v0_client.rb, line 46064
def to_json
  JSON.dump(to_hash)
end