Class: Io::Flow::V0::Models::TaxRegistration
- Inherits:
-
Object
- Object
- Io::Flow::V0::Models::TaxRegistration
- Defined in:
- lib/flow_commerce/flow_api_v0_client.rb
Overview
Result of looking up a specific tax registration number. Indicates validity of a number for a specific country and (if valid) the associated person/company.
Instance Attribute Summary collapse
-
#address ⇒ Object
readonly
Returns the value of attribute address.
-
#company_name ⇒ Object
readonly
Returns the value of attribute company_name.
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#key ⇒ Object
readonly
Returns the value of attribute key.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#number ⇒ Object
readonly
Returns the value of attribute number.
-
#result ⇒ Object
readonly
Returns the value of attribute result.
-
#result_reason ⇒ Object
readonly
Returns the value of attribute result_reason.
-
#timestamp ⇒ Object
readonly
Returns the value of attribute timestamp.
Instance Method Summary collapse
- #copy(incoming = {}) ⇒ Object
-
#initialize(incoming = {}) ⇒ TaxRegistration
constructor
A new instance of TaxRegistration.
- #to_hash ⇒ Object
- #to_json ⇒ Object
Constructor Details
#initialize(incoming = {}) ⇒ TaxRegistration
Returns a new instance of TaxRegistration.
62082 62083 62084 62085 62086 62087 62088 62089 62090 62091 62092 62093 62094 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 62082 def initialize(incoming={}) opts = HttpClient::Helper.symbolize_keys(incoming) HttpClient::Preconditions.require_keys(opts, [:id, :key, :number, :timestamp, :result], 'TaxRegistration') @id = HttpClient::Preconditions.assert_class('id', opts.delete(:id), String) @key = HttpClient::Preconditions.assert_class('key', opts.delete(:key), String) @number = HttpClient::Preconditions.assert_class('number', opts.delete(:number), String) = HttpClient::Preconditions.assert_class('timestamp', HttpClient::Helper.to_date_time_iso8601(opts.delete(:timestamp)), DateTime) @result = (x = opts.delete(:result); x.is_a?(::Io::Flow::V0::Models::TaxVerificationResult) ? x : ::Io::Flow::V0::Models::TaxVerificationResult.apply(x)) @result_reason = (x = opts.delete(:result_reason); x.nil? ? nil : HttpClient::Preconditions.assert_class('result_reason', x, String)) @name = (x = opts.delete(:name); x.nil? ? nil : HttpClient::Preconditions.assert_class('name', x, String)) @address = (x = opts.delete(:address); x.nil? ? nil : HttpClient::Preconditions.assert_class('address', x, String)) @company_name = (x = opts.delete(:company_name); x.nil? ? nil : HttpClient::Preconditions.assert_class('company_name', x, String)) end |
Instance Attribute Details
#address ⇒ Object (readonly)
Returns the value of attribute address.
62080 62081 62082 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 62080 def address @address end |
#company_name ⇒ Object (readonly)
Returns the value of attribute company_name.
62080 62081 62082 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 62080 def company_name @company_name end |
#id ⇒ Object (readonly)
Returns the value of attribute id.
62080 62081 62082 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 62080 def id @id end |
#key ⇒ Object (readonly)
Returns the value of attribute key.
62080 62081 62082 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 62080 def key @key end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
62080 62081 62082 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 62080 def name @name end |
#number ⇒ Object (readonly)
Returns the value of attribute number.
62080 62081 62082 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 62080 def number @number end |
#result ⇒ Object (readonly)
Returns the value of attribute result.
62080 62081 62082 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 62080 def result @result end |
#result_reason ⇒ Object (readonly)
Returns the value of attribute result_reason.
62080 62081 62082 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 62080 def result_reason @result_reason end |
#timestamp ⇒ Object (readonly)
Returns the value of attribute timestamp.
62080 62081 62082 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 62080 def end |
Instance Method Details
#copy(incoming = {}) ⇒ Object
62100 62101 62102 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 62100 def copy(incoming={}) TaxRegistration.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming))) end |
#to_hash ⇒ Object
62104 62105 62106 62107 62108 62109 62110 62111 62112 62113 62114 62115 62116 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 62104 def to_hash { :id => id, :key => key, :number => number, :timestamp => , :result => result.value, :result_reason => result_reason, :name => name, :address => address, :company_name => company_name } end |
#to_json ⇒ Object
62096 62097 62098 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 62096 def to_json JSON.dump(to_hash) end |