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.



44615
44616
44617
44618
44619
44620
44621
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 44615

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.



44613
44614
44615
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 44613

def ats
  @ats
end

#in_stockObject (readonly)

Returns the value of attribute in_stock.



44613
44614
44615
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 44613

def in_stock
  @in_stock
end

#numberObject (readonly)

Returns the value of attribute number.



44613
44614
44615
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 44613

def number
  @number
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



44627
44628
44629
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 44627

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

#to_hashObject



44631
44632
44633
44634
44635
44636
44637
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 44631

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

#to_jsonObject



44623
44624
44625
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 44623

def to_json
  JSON.dump(to_hash)
end