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.
37306 37307 37308 37309 37310 37311 37312 37313 37314 37315 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 37306 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.
37304 37305 37306 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 37304 def customs_description @customs_description end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
37304 37305 37306 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 37304 def name @name end |
#number ⇒ Object (readonly)
Returns the value of attribute number.
37304 37305 37306 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 37304 def number @number end |
#origin_criteria ⇒ Object (readonly)
Returns the value of attribute origin_criteria.
37304 37305 37306 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 37304 def origin_criteria @origin_criteria end |
#product_id ⇒ Object (readonly)
Returns the value of attribute product_id.
37304 37305 37306 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 37304 def product_id @product_id end |
#sku ⇒ Object (readonly)
Returns the value of attribute sku.
37304 37305 37306 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 37304 def sku @sku end |
Instance Method Details
#copy(incoming = {}) ⇒ Object
37321 37322 37323 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 37321 def copy(incoming={}) DutyItemForm.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming))) end |
#to_hash ⇒ Object
37325 37326 37327 37328 37329 37330 37331 37332 37333 37334 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 37325 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
37317 37318 37319 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 37317 def to_json JSON.dump(to_hash) end |