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.



43968
43969
43970
43971
43972
43973
43974
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 43968

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.



43966
43967
43968
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 43966

def ats
  @ats
end

#in_stockObject (readonly)

Returns the value of attribute in_stock.



43966
43967
43968
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 43966

def in_stock
  @in_stock
end

#numberObject (readonly)

Returns the value of attribute number.



43966
43967
43968
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 43966

def number
  @number
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



43980
43981
43982
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 43980

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

#to_hashObject



43984
43985
43986
43987
43988
43989
43990
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 43984

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

#to_jsonObject



43976
43977
43978
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 43976

def to_json
  JSON.dump(to_hash)
end