Class: Io::Flow::V0::Models::DetailedTaxRegistration

Inherits:
Object
  • Object
show all
Defined in:
lib/flow_commerce/flow_api_v0_client.rb

Overview

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(incoming = {}) ⇒ DetailedTaxRegistration

Returns a new instance of DetailedTaxRegistration.



39577
39578
39579
39580
39581
39582
39583
39584
39585
39586
39587
39588
39589
39590
39591
39592
39593
# 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

Instance Attribute Details

#company_name_match_resultObject (readonly)

Returns the value of attribute company_name_match_result.



39575
39576
39577
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 39575

def company_name_match_result
  @company_name_match_result
end

#company_name_match_result_reasonObject (readonly)

Returns the value of attribute company_name_match_result_reason.



39575
39576
39577
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 39575

def company_name_match_result_reason
  @company_name_match_result_reason
end

#consumer_company_nameObject (readonly)

Returns the value of attribute consumer_company_name.



39575
39576
39577
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 39575

def consumer_company_name
  @consumer_company_name
end

#countryObject (readonly)

Returns the value of attribute country.



39575
39576
39577
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 39575

def country
  @country
end

#idObject (readonly)

Returns the value of attribute id.



39575
39576
39577
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 39575

def id
  @id
end

#keyObject (readonly)

Returns the value of attribute key.



39575
39576
39577
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 39575

def key
  @key
end

#numberObject (readonly)

Returns the value of attribute number.



39575
39576
39577
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 39575

def number
  @number
end

#successObject (readonly)

Returns the value of attribute success.



39575
39576
39577
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 39575

def success
  @success
end

#timestampObject (readonly)

Returns the value of attribute timestamp.



39575
39576
39577
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 39575

def timestamp
  @timestamp
end

#vies_company_addressObject (readonly)

Returns the value of attribute vies_company_address.



39575
39576
39577
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 39575

def vies_company_address
  @vies_company_address
end

#vies_company_nameObject (readonly)

Returns the value of attribute vies_company_name.



39575
39576
39577
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 39575

def vies_company_name
  @vies_company_name
end

#vies_resultObject (readonly)

Returns the value of attribute vies_result.



39575
39576
39577
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 39575

def vies_result
  @vies_result
end

#vies_result_reasonObject (readonly)

Returns the value of attribute vies_result_reason.



39575
39576
39577
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 39575

def vies_result_reason
  @vies_result_reason
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



39599
39600
39601
# 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_hashObject



39603
39604
39605
39606
39607
39608
39609
39610
39611
39612
39613
39614
39615
39616
39617
39618
39619
# 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_jsonObject



39595
39596
39597
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 39595

def to_json
  JSON.dump(to_hash)
end