class Io::Flow::V0::Models::DutyItemApproval
Attributes
certifier[R]
effective_at[R]
producer[R]
status[R]
trade_agreement[R]
Public Class Methods
new(incoming={})
click to toggle source
# File lib/flow_commerce/flow_api_v0_client.rb, line 40457 def initialize(incoming={}) opts = HttpClient::Helper.symbolize_keys(incoming) HttpClient::Preconditions.require_keys(opts, [:status, :trade_agreement, :certifier, :producer, :effective_at], 'DutyItemApproval') @status = (x = opts.delete(:status); x.is_a?(::Io::Flow::V0::Models::DutyItemApprovalStatus) ? x : ::Io::Flow::V0::Models::DutyItemApprovalStatus.apply(x)) @trade_agreement = (x = opts.delete(:trade_agreement); x.is_a?(::Io::Flow::V0::Models::TradeAgreement) ? x : ::Io::Flow::V0::Models::TradeAgreement.new(x)) @certifier = (x = opts.delete(:certifier); x.is_a?(::Io::Flow::V0::Models::TradeAgreementCertifier) ? x : ::Io::Flow::V0::Models::TradeAgreementCertifier.new(x)) @producer = (x = opts.delete(:producer); x.is_a?(::Io::Flow::V0::Models::DutyItemProducer) ? x : ::Io::Flow::V0::Models::DutyItemProducer.new(x)) @effective_at = HttpClient::Preconditions.assert_class('effective_at', HttpClient::Helper.to_date_time_iso8601(opts.delete(:effective_at)), DateTime) end
Public Instance Methods
copy(incoming={})
click to toggle source
# File lib/flow_commerce/flow_api_v0_client.rb, line 40471 def copy(incoming={}) DutyItemApproval.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 40475 def to_hash { :status => status.value, :trade_agreement => trade_agreement.to_hash, :certifier => certifier.to_hash, :producer => producer.to_hash, :effective_at => effective_at } end
to_json()
click to toggle source
# File lib/flow_commerce/flow_api_v0_client.rb, line 40467 def to_json JSON.dump(to_hash) end