Class: Io::Flow::V0::Models::PfsInventoryCheckResponseItem

Inherits:
Object
  • Object
show all
Defined in:
lib/flow_commerce/flow_api_v0_client.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(incoming = {}) ⇒ PfsInventoryCheckResponseItem

Returns a new instance of PfsInventoryCheckResponseItem.



33335
33336
33337
33338
33339
33340
33341
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 33335

def initialize(incoming={})
  opts = HttpClient::Helper.symbolize_keys(incoming)
  HttpClient::Preconditions.require_keys(opts, [:number, :ats, :in_stock], 'PfsInventoryCheckResponseItem')
  @number = HttpClient::Preconditions.assert_class('number', opts.delete(:number), String)
  @ats = HttpClient::Preconditions.assert_class('ats', opts.delete(:ats), Integer)
  @in_stock = HttpClient::Preconditions.assert_boolean('in_stock', opts.delete(:in_stock))
end

Instance Attribute Details

#atsObject (readonly)

Returns the value of attribute ats.



33333
33334
33335
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 33333

def ats
  @ats
end

#in_stockObject (readonly)

Returns the value of attribute in_stock.



33333
33334
33335
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 33333

def in_stock
  @in_stock
end

#numberObject (readonly)

Returns the value of attribute number.



33333
33334
33335
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 33333

def number
  @number
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



33347
33348
33349
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 33347

def copy(incoming={})
  PfsInventoryCheckResponseItem.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming)))
end

#to_hashObject



33351
33352
33353
33354
33355
33356
33357
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 33351

def to_hash
  {
    :number => number,
    :ats => ats,
    :in_stock => in_stock
  }
end

#to_jsonObject



33343
33344
33345
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 33343

def to_json
  JSON.dump(to_hash)
end