class Io::Flow::V0::Models::DutyItem
Attributes
approvals[R]
customs_description[R]
name[R]
number[R]
origin_criteria[R]
product_id[R]
sku[R]
Public Class Methods
new(incoming={})
click to toggle source
# File lib/flow_commerce/flow_api_v0_client.rb, line 40419 def initialize(incoming={}) opts = HttpClient::Helper.symbolize_keys(incoming) HttpClient::Preconditions.require_keys(opts, [:number, :name, :customs_description], 'DutyItem') @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)) @approvals = (x = opts.delete(:approvals); x.nil? ? nil : HttpClient::Preconditions.assert_class('approvals', x, Array).map { |v| (x = v; x.is_a?(::Io::Flow::V0::Models::DutyItemApproval) ? x : ::Io::Flow::V0::Models::DutyItemApproval.new(x)) }) end
Public Instance Methods
copy(incoming={})
click to toggle source
# File lib/flow_commerce/flow_api_v0_client.rb, line 40435 def copy(incoming={}) DutyItem.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming))) end
to_hash()
click to toggle source
# File lib/flow_commerce/flow_api_v0_client.rb, line 40439 def to_hash { :number => number, :name => name.value, :product_id => product_id, :sku => sku, :customs_description => customs_description, :origin_criteria => origin_criteria, :approvals => approvals.nil? ? nil : approvals.map { |o| o.to_hash } } end
to_json()
click to toggle source
# File lib/flow_commerce/flow_api_v0_client.rb, line 40431 def to_json JSON.dump(to_hash) end