class Io::Flow::V0::Models::TradeAgreementCertifier

Person or organization responsible for certifying an item complies with a trade agreement.

Attributes

address[R]
contact[R]
exporter_of_record[R]
key[R]
name[R]
signature_url[R]

Public Class Methods

new(incoming={}) click to toggle source
# File lib/flow_commerce/flow_api_v0_client.rb, line 71776
def initialize(incoming={})
  opts = HttpClient::Helper.symbolize_keys(incoming)
  HttpClient::Preconditions.require_keys(opts, [:key, :name, :exporter_of_record], 'TradeAgreementCertifier')
  @key = HttpClient::Preconditions.assert_class('key', opts.delete(:key), String)
  @name = HttpClient::Preconditions.assert_class('name', opts.delete(:name), String)
  @exporter_of_record = (x = opts.delete(:exporter_of_record); x.is_a?(::Io::Flow::V0::Models::ExporterOfRecord) ? x : ::Io::Flow::V0::Models::ExporterOfRecord.apply(x))
  @contact = (x = opts.delete(:contact); x.nil? ? nil : (x = x; x.is_a?(::Io::Flow::V0::Models::Contact) ? x : ::Io::Flow::V0::Models::Contact.new(x)))
  @address = (x = opts.delete(:address); x.nil? ? nil : (x = x; x.is_a?(::Io::Flow::V0::Models::Address) ? x : ::Io::Flow::V0::Models::Address.new(x)))
  @signature_url = (x = opts.delete(:signature_url); x.nil? ? nil : HttpClient::Preconditions.assert_class('signature_url', x, String))
end

Public Instance Methods

copy(incoming={}) click to toggle source
# File lib/flow_commerce/flow_api_v0_client.rb, line 71791
def copy(incoming={})
  TradeAgreementCertifier.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 71795
def to_hash
  {
    :key => key,
    :name => name,
    :exporter_of_record => exporter_of_record.value,
    :contact => contact.nil? ? nil : contact.to_hash,
    :address => address.nil? ? nil : address.to_hash,
    :signature_url => signature_url
  }
end
to_json() click to toggle source
# File lib/flow_commerce/flow_api_v0_client.rb, line 71787
def to_json
  JSON.dump(to_hash)
end