class Io::Flow::V0::Models::DutyItemForm

Attributes

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 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

Public Instance Methods

copy(incoming={}) click to toggle source
# 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() click to toggle source
# 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() click to toggle source
# File lib/flow_commerce/flow_api_v0_client.rb, line 40536
def to_json
  JSON.dump(to_hash)
end