class Io::Flow::V0::Models::DutyItemApprovalForm

Attributes

effective_at[R]
producer_key[R]
status[R]
trade_agreement_certifier_key[R]
trade_agreement_key[R]

Public Class Methods

new(incoming={}) click to toggle source
# File lib/flow_commerce/flow_api_v0_client.rb, line 40491
def initialize(incoming={})
  opts = HttpClient::Helper.symbolize_keys(incoming)
  HttpClient::Preconditions.require_keys(opts, [:status, :trade_agreement_key, :trade_agreement_certifier_key, :producer_key, :effective_at], 'DutyItemApprovalForm')
  @status = (x = opts.delete(:status); x.is_a?(::Io::Flow::V0::Models::DutyItemApprovalStatus) ? x : ::Io::Flow::V0::Models::DutyItemApprovalStatus.apply(x))
  @trade_agreement_key = HttpClient::Preconditions.assert_class('trade_agreement_key', opts.delete(:trade_agreement_key), String)
  @trade_agreement_certifier_key = HttpClient::Preconditions.assert_class('trade_agreement_certifier_key', opts.delete(:trade_agreement_certifier_key), String)
  @producer_key = HttpClient::Preconditions.assert_class('producer_key', opts.delete(:producer_key), String)
  @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 40505
def copy(incoming={})
  DutyItemApprovalForm.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 40509
def to_hash
  {
    :status => status.value,
    :trade_agreement_key => trade_agreement_key,
    :trade_agreement_certifier_key => trade_agreement_certifier_key,
    :producer_key => producer_key,
    :effective_at => effective_at
  }
end
to_json() click to toggle source
# File lib/flow_commerce/flow_api_v0_client.rb, line 40501
def to_json
  JSON.dump(to_hash)
end