class Io::Flow::V0::Models::NoInventoryReservationError

Attributes

items[R]
messages[R]

Public Class Methods

new(incoming={}) click to toggle source
# File lib/flow_commerce/flow_api_v0_client.rb, line 50630
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')
  @messages = 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

Public Instance Methods

copy(incoming={}) click to toggle source
# File lib/flow_commerce/flow_api_v0_client.rb, line 50642
def copy(incoming={})
  NoInventoryReservationError.new(subtype_to_hash.merge(HttpClient::Helper.symbolize_keys(incoming)))
end
subtype_to_hash() click to toggle source
# File lib/flow_commerce/flow_api_v0_client.rb, line 50646
def subtype_to_hash
  {
    :messages => messages,
    :items => items.map { |o| o.to_hash }
  }
end
to_json() click to toggle source
# File lib/flow_commerce/flow_api_v0_client.rb, line 50638
def to_json
  JSON.dump(to_hash)
end