Class: Io::Flow::V0::Models::OrderItemNotAvailableError
- Inherits:
-
OrderError
- Object
- OrderError
- Io::Flow::V0::Models::OrderItemNotAvailableError
- Defined in:
- lib/flow_commerce/flow_api_v0_client.rb
Overview
When creating an order, if a particular item is not available in the country / destination (either because it was restricted or excluded from that country), we return this error to highlight the specific item numbers which are not available.
Instance Attribute Summary collapse
-
#messages ⇒ Object
readonly
Returns the value of attribute messages.
-
#numbers ⇒ Object
readonly
Returns the value of attribute numbers.
Instance Method Summary collapse
- #copy(incoming = {}) ⇒ Object
-
#initialize(incoming = {}) ⇒ OrderItemNotAvailableError
constructor
A new instance of OrderItemNotAvailableError.
- #subtype_to_hash ⇒ Object
- #to_json ⇒ Object
Methods inherited from OrderError
Constructor Details
#initialize(incoming = {}) ⇒ OrderItemNotAvailableError
Returns a new instance of OrderItemNotAvailableError.
13543 13544 13545 13546 13547 13548 13549 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13543 def initialize(incoming={}) super(:name => OrderError::Types::ORDER_ITEM_NOT_AVAILABLE_ERROR) opts = HttpClient::Helper.symbolize_keys(incoming) HttpClient::Preconditions.require_keys(opts, [:messages, :numbers], 'OrderItemNotAvailableError') @messages = HttpClient::Preconditions.assert_class('messages', opts.delete(:messages), Array).map { |v| HttpClient::Preconditions.assert_class('messages', v, String) } @numbers = HttpClient::Preconditions.assert_class('numbers', opts.delete(:numbers), Array).map { |v| HttpClient::Preconditions.assert_class('numbers', v, String) } end |
Instance Attribute Details
#messages ⇒ Object (readonly)
Returns the value of attribute messages.
13541 13542 13543 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13541 def @messages end |
#numbers ⇒ Object (readonly)
Returns the value of attribute numbers.
13541 13542 13543 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13541 def numbers @numbers end |
Instance Method Details
#copy(incoming = {}) ⇒ Object
13555 13556 13557 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13555 def copy(incoming={}) OrderItemNotAvailableError.new(subtype_to_hash.merge(HttpClient::Helper.symbolize_keys(incoming))) end |
#subtype_to_hash ⇒ Object
13559 13560 13561 13562 13563 13564 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13559 def subtype_to_hash { :messages => , :numbers => numbers } end |
#to_json ⇒ Object
13551 13552 13553 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13551 def to_json JSON.dump(to_hash) end |