class Io::Flow::V0::Models::HarmonizedLandedCostItem

Duty and tax information for a given item. Note that the internal implementation supports multiple countries of origin.

Attributes

customs_description[R]
duty[R]
hs_code[R]
item[R]
origin[R]
source_address[R]
tariff_code[R]
tax[R]
tax_applicability[R]

Public Class Methods

new(incoming={}) click to toggle source
# File lib/flow_commerce/flow_api_v0_client.rb, line 44829
def initialize(incoming={})
  opts = HttpClient::Helper.symbolize_keys(incoming)
  HttpClient::Preconditions.require_keys(opts, [:item, :duty, :tax], 'HarmonizedLandedCostItem')
  @item = (x = opts.delete(:item); x.is_a?(::Io::Flow::V0::Models::HarmonizedItemReference) ? x : ::Io::Flow::V0::Models::HarmonizedItemReference.new(x))
  @duty = (x = opts.delete(:duty); x.is_a?(::Io::Flow::V0::Models::Duty) ? x : ::Io::Flow::V0::Models::Duty.new(x))
  @tax = (x = opts.delete(:tax); x.is_a?(::Io::Flow::V0::Models::Tax) ? x : ::Io::Flow::V0::Models::Tax.new(x))
  @tax_applicability = (x = opts.delete(:tax_applicability); x.nil? ? nil : (x = x; x.is_a?(::Io::Flow::V0::Models::TaxApplicability) ? x : ::Io::Flow::V0::Models::TaxApplicability.apply(x)))
  @origin = (x = opts.delete(:origin); x.nil? ? nil : HttpClient::Preconditions.assert_class('origin', x, String))
  @hs_code = (x = opts.delete(:hs_code); x.nil? ? nil : HttpClient::Preconditions.assert_class('hs_code', x, String))
  @tariff_code = (x = opts.delete(:tariff_code); x.nil? ? nil : HttpClient::Preconditions.assert_class('tariff_code', x, String))
  @customs_description = (x = opts.delete(:customs_description); x.nil? ? nil : HttpClient::Preconditions.assert_class('customs_description', x, String))
  @source_address = (x = opts.delete(:source_address); x.nil? ? nil : (x = x; x.is_a?(::Io::Flow::V0::Models::Address) ? x : ::Io::Flow::V0::Models::Address.new(x)))
end

Public Instance Methods

copy(incoming={}) click to toggle source
# File lib/flow_commerce/flow_api_v0_client.rb, line 44847
def copy(incoming={})
  HarmonizedLandedCostItem.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 44851
def to_hash
  {
    :item => item.to_hash,
    :duty => duty.to_hash,
    :tax => tax.to_hash,
    :tax_applicability => tax_applicability.nil? ? nil : tax_applicability.value,
    :origin => origin,
    :hs_code => hs_code,
    :tariff_code => tariff_code,
    :customs_description => customs_description,
    :source_address => source_address.nil? ? nil : source_address.to_hash
  }
end
to_json() click to toggle source
# File lib/flow_commerce/flow_api_v0_client.rb, line 44843
def to_json
  JSON.dump(to_hash)
end