Class: Io::Flow::V0::Models::NoInventoryReservationErrorItem

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 = {}) ⇒ NoInventoryReservationErrorItem

Returns a new instance of NoInventoryReservationErrorItem.



39864
39865
39866
39867
39868
39869
39870
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 39864

def initialize(incoming={})
  opts = HttpClient::Helper.symbolize_keys(incoming)
  HttpClient::Preconditions.require_keys(opts, [:number, :requested_quantity, :available_quantity], 'NoInventoryReservationErrorItem')
  @number = HttpClient::Preconditions.assert_class('number', opts.delete(:number), String)
  @requested_quantity = HttpClient::Preconditions.assert_class('requested_quantity', opts.delete(:requested_quantity), Integer)
  @available_quantity = HttpClient::Preconditions.assert_class('available_quantity', opts.delete(:available_quantity), Integer)
end

Instance Attribute Details

#available_quantityObject (readonly)

Returns the value of attribute available_quantity.



39862
39863
39864
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 39862

def available_quantity
  @available_quantity
end

#numberObject (readonly)

Returns the value of attribute number.



39862
39863
39864
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 39862

def number
  @number
end

#requested_quantityObject (readonly)

Returns the value of attribute requested_quantity.



39862
39863
39864
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 39862

def requested_quantity
  @requested_quantity
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



39876
39877
39878
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 39876

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

#to_hashObject



39880
39881
39882
39883
39884
39885
39886
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 39880

def to_hash
  {
    :number => number,
    :requested_quantity => requested_quantity,
    :available_quantity => available_quantity
  }
end

#to_jsonObject



39872
39873
39874
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 39872

def to_json
  JSON.dump(to_hash)
end