Class: Io::Flow::V0::Models::NoInventoryReservationError
- Inherits:
-
ReservationError
- Object
- ReservationError
- Io::Flow::V0::Models::NoInventoryReservationError
- Defined in:
- lib/flow_commerce/flow_api_v0_client.rb
Instance Attribute Summary collapse
-
#items ⇒ Object
readonly
Returns the value of attribute items.
-
#messages ⇒ Object
readonly
Returns the value of attribute messages.
Attributes inherited from ReservationError
Instance Method Summary collapse
- #copy(incoming = {}) ⇒ Object
-
#initialize(incoming = {}) ⇒ NoInventoryReservationError
constructor
A new instance of NoInventoryReservationError.
- #subtype_to_hash ⇒ Object
- #to_json ⇒ Object
Methods inherited from ReservationError
Constructor Details
#initialize(incoming = {}) ⇒ NoInventoryReservationError
Returns a new instance of NoInventoryReservationError.
24479 24480 24481 24482 24483 24484 24485 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 24479 def initialize(incoming={}) super(:code => ReservationError::Types::NO_INVENTORY_RESERVATION_ERROR) opts = HttpClient::Helper.symbolize_keys(incoming) HttpClient::Preconditions.require_keys(opts, [:messages, :items], 'NoInventoryReservationError') = HttpClient::Preconditions.assert_class('messages', opts.delete(:messages), Array).map { |v| HttpClient::Preconditions.assert_class('messages', v, String) } @items = HttpClient::Preconditions.assert_class('items', opts.delete(:items), Array).map { |v| (x = v; x.is_a?(::Io::Flow::V0::Models::NoInventoryReservationErrorItem) ? x : ::Io::Flow::V0::Models::NoInventoryReservationErrorItem.new(x)) } end |
Instance Attribute Details
#items ⇒ Object (readonly)
Returns the value of attribute items.
24477 24478 24479 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 24477 def items @items end |
#messages ⇒ Object (readonly)
Returns the value of attribute messages.
24477 24478 24479 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 24477 def end |
Instance Method Details
#copy(incoming = {}) ⇒ Object
24491 24492 24493 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 24491 def copy(incoming={}) NoInventoryReservationError.new(subtype_to_hash.merge(HttpClient::Helper.symbolize_keys(incoming))) end |
#subtype_to_hash ⇒ Object
24495 24496 24497 24498 24499 24500 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 24495 def subtype_to_hash { :messages => , :items => items.map { |o| o.to_hash } } end |
#to_json ⇒ Object
24487 24488 24489 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 24487 def to_json JSON.dump(to_hash) end |