class Io::Flow::V0::Models::DetailedTaxRegistration

Result of looking up a specific tax registration number. Includes details of both the consumer request and the VIES response.

Attributes

company_name_match_result[R]
company_name_match_result_reason[R]
consumer_company_name[R]
country[R]
id[R]
key[R]
number[R]
success[R]
timestamp[R]
vies_company_address[R]
vies_company_name[R]
vies_result[R]
vies_result_reason[R]

Public Class Methods

new(incoming={}) click to toggle source
# File lib/flow_commerce/flow_api_v0_client.rb, line 39577
def initialize(incoming={})
  opts = HttpClient::Helper.symbolize_keys(incoming)
  HttpClient::Preconditions.require_keys(opts, [:id, :key, :number, :country, :success, :timestamp, :vies_result, :company_name_match_result], 'DetailedTaxRegistration')
  @id = HttpClient::Preconditions.assert_class('id', opts.delete(:id), String)
  @key = HttpClient::Preconditions.assert_class('key', opts.delete(:key), String)
  @consumer_company_name = (x = opts.delete(:consumer_company_name); x.nil? ? nil : HttpClient::Preconditions.assert_class('consumer_company_name', x, String))
  @number = HttpClient::Preconditions.assert_class('number', opts.delete(:number), String)
  @country = HttpClient::Preconditions.assert_class('country', opts.delete(:country), String)
  @success = HttpClient::Preconditions.assert_boolean('success', opts.delete(:success))
  @timestamp = HttpClient::Preconditions.assert_class('timestamp', HttpClient::Helper.to_date_time_iso8601(opts.delete(:timestamp)), DateTime)
  @vies_result = (x = opts.delete(:vies_result); x.is_a?(::Io::Flow::V0::Models::TaxVerificationResult) ? x : ::Io::Flow::V0::Models::TaxVerificationResult.apply(x))
  @vies_result_reason = (x = opts.delete(:vies_result_reason); x.nil? ? nil : HttpClient::Preconditions.assert_class('vies_result_reason', x, String))
  @vies_company_name = (x = opts.delete(:vies_company_name); x.nil? ? nil : HttpClient::Preconditions.assert_class('vies_company_name', x, String))
  @vies_company_address = (x = opts.delete(:vies_company_address); x.nil? ? nil : HttpClient::Preconditions.assert_class('vies_company_address', x, String))
  @company_name_match_result = (x = opts.delete(:company_name_match_result); x.is_a?(::Io::Flow::V0::Models::TaxVerificationResult) ? x : ::Io::Flow::V0::Models::TaxVerificationResult.apply(x))
  @company_name_match_result_reason = (x = opts.delete(:company_name_match_result_reason); x.nil? ? nil : HttpClient::Preconditions.assert_class('company_name_match_result_reason', x, String))
end

Public Instance Methods

copy(incoming={}) click to toggle source
# File lib/flow_commerce/flow_api_v0_client.rb, line 39599
def copy(incoming={})
  DetailedTaxRegistration.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 39603
def to_hash
  {
    :id => id,
    :key => key,
    :consumer_company_name => consumer_company_name,
    :number => number,
    :country => country,
    :success => success,
    :timestamp => timestamp,
    :vies_result => vies_result.value,
    :vies_result_reason => vies_result_reason,
    :vies_company_name => vies_company_name,
    :vies_company_address => vies_company_address,
    :company_name_match_result => company_name_match_result.value,
    :company_name_match_result_reason => company_name_match_result_reason
  }
end
to_json() click to toggle source
# File lib/flow_commerce/flow_api_v0_client.rb, line 39595
def to_json
  JSON.dump(to_hash)
end