Class: Io::Flow::V0::Models::DutyItemForm
- Inherits:
-
Object
- Object
- Io::Flow::V0::Models::DutyItemForm
- Defined in:
- lib/flow_commerce/flow_api_v0_client.rb
Instance Attribute Summary collapse
-
#customs_description ⇒ Object
readonly
Returns the value of attribute customs_description.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#number ⇒ Object
readonly
Returns the value of attribute number.
-
#origin_criteria ⇒ Object
readonly
Returns the value of attribute origin_criteria.
-
#product_id ⇒ Object
readonly
Returns the value of attribute product_id.
-
#sku ⇒ Object
readonly
Returns the value of attribute sku.
Instance Method Summary collapse
- #copy(incoming = {}) ⇒ Object
-
#initialize(incoming = {}) ⇒ DutyItemForm
constructor
A new instance of DutyItemForm.
- #to_hash ⇒ Object
- #to_json ⇒ Object
Constructor Details
#initialize(incoming = {}) ⇒ DutyItemForm
Returns a new instance of DutyItemForm.
40525 40526 40527 40528 40529 40530 40531 40532 40533 40534 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 40525 def initialize(incoming={}) opts = HttpClient::Helper.symbolize_keys(incoming) HttpClient::Preconditions.require_keys(opts, [:number, :name, :customs_description], 'DutyItemForm') @number = HttpClient::Preconditions.assert_class('number', opts.delete(:number), String) @name = (x = opts.delete(:name); x.is_a?(::Io::Flow::V0::Models::TradeAgreementName) ? x : ::Io::Flow::V0::Models::TradeAgreementName.apply(x)) @product_id = (x = opts.delete(:product_id); x.nil? ? nil : HttpClient::Preconditions.assert_class('product_id', x, String)) @sku = (x = opts.delete(:sku); x.nil? ? nil : HttpClient::Preconditions.assert_class('sku', x, String)) @customs_description = HttpClient::Preconditions.assert_class('customs_description', opts.delete(:customs_description), String) @origin_criteria = (x = opts.delete(:origin_criteria); x.nil? ? nil : HttpClient::Preconditions.assert_class('origin_criteria', x, String)) end |
Instance Attribute Details
#customs_description ⇒ Object (readonly)
Returns the value of attribute customs_description.
40523 40524 40525 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 40523 def customs_description @customs_description end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
40523 40524 40525 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 40523 def name @name end |
#number ⇒ Object (readonly)
Returns the value of attribute number.
40523 40524 40525 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 40523 def number @number end |
#origin_criteria ⇒ Object (readonly)
Returns the value of attribute origin_criteria.
40523 40524 40525 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 40523 def origin_criteria @origin_criteria end |
#product_id ⇒ Object (readonly)
Returns the value of attribute product_id.
40523 40524 40525 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 40523 def product_id @product_id end |
#sku ⇒ Object (readonly)
Returns the value of attribute sku.
40523 40524 40525 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 40523 def sku @sku end |
Instance Method Details
#copy(incoming = {}) ⇒ Object
40540 40541 40542 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 40540 def copy(incoming={}) DutyItemForm.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming))) end |
#to_hash ⇒ Object
40544 40545 40546 40547 40548 40549 40550 40551 40552 40553 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 40544 def to_hash { :number => number, :name => name.value, :product_id => product_id, :sku => sku, :customs_description => customs_description, :origin_criteria => origin_criteria } end |
#to_json ⇒ Object
40536 40537 40538 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 40536 def to_json JSON.dump(to_hash) end |