Class: Io::Flow::V0::Models::HarmonizedLandedCostForm
- Inherits:
-
Object
- Object
- Io::Flow::V0::Models::HarmonizedLandedCostForm
- Defined in:
- lib/flow_commerce/flow_api_v0_client.rb
Overview
Allows calculation of duty and tax for multiple items in one API call for items going to a specific destination country
Instance Attribute Summary collapse
-
#address ⇒ Object
readonly
Returns the value of attribute address.
-
#item_numbers ⇒ Object
readonly
Returns the value of attribute item_numbers.
Instance Method Summary collapse
- #copy(incoming = {}) ⇒ Object
-
#initialize(incoming = {}) ⇒ HarmonizedLandedCostForm
constructor
A new instance of HarmonizedLandedCostForm.
- #to_hash ⇒ Object
- #to_json ⇒ Object
Constructor Details
#initialize(incoming = {}) ⇒ HarmonizedLandedCostForm
Returns a new instance of HarmonizedLandedCostForm.
17515 17516 17517 17518 17519 17520 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17515 def initialize(incoming={}) opts = HttpClient::Helper.symbolize_keys(incoming) HttpClient::Preconditions.require_keys(opts, [:address, :item_numbers], 'HarmonizedLandedCostForm') @address = (x = opts.delete(:address); x.is_a?(::Io::Flow::V0::Models::Address) ? x : ::Io::Flow::V0::Models::Address.new(x)) @item_numbers = HttpClient::Preconditions.assert_class('item_numbers', opts.delete(:item_numbers), Array).map { |v| HttpClient::Preconditions.assert_class('item_numbers', v, String) } end |
Instance Attribute Details
#address ⇒ Object (readonly)
Returns the value of attribute address.
17513 17514 17515 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17513 def address @address end |
#item_numbers ⇒ Object (readonly)
Returns the value of attribute item_numbers.
17513 17514 17515 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17513 def item_numbers @item_numbers end |
Instance Method Details
#copy(incoming = {}) ⇒ Object
17526 17527 17528 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17526 def copy(incoming={}) HarmonizedLandedCostForm.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming))) end |
#to_hash ⇒ Object
17530 17531 17532 17533 17534 17535 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17530 def to_hash { :address => address.to_hash, :item_numbers => item_numbers } end |
#to_json ⇒ Object
17522 17523 17524 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17522 def to_json JSON.dump(to_hash) end |