Class: Plaid::IncomeVerificationTaxformsGetResponse
- Inherits:
-
BaseModel
- Object
- CoreLibrary::BaseModel
- BaseModel
- Plaid::IncomeVerificationTaxformsGetResponse
- Defined in:
- lib/plaid/models/income_verification_taxforms_get_response.rb
Overview
IncomeVerificationTaxformsGetResponse defines the response schema for ‘/income/verification/taxforms/get`
Instance Attribute Summary collapse
-
#document_metadata ⇒ Array[DocumentMetadata]
A list of taxforms.
-
#error ⇒ Error
We use standard HTTP response codes for success and failure notifications, and our errors are further classified by ‘error_type`.
-
#request_id ⇒ String
A unique identifier for the request, which can be used for troubleshooting.
-
#taxforms ⇒ Array[Taxform]
A list of taxforms.
Class Method Summary collapse
-
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
-
.names ⇒ Object
A mapping from model property names to API property names.
-
.nullables ⇒ Object
An array for nullable fields.
-
.optionals ⇒ Object
An array for optional fields.
Instance Method Summary collapse
-
#initialize(taxforms:, document_metadata:, request_id: SKIP, error: SKIP, additional_properties: nil) ⇒ IncomeVerificationTaxformsGetResponse
constructor
A new instance of IncomeVerificationTaxformsGetResponse.
-
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
-
#to_s ⇒ Object
Provides a human-readable string representation of the object.
Methods inherited from BaseModel
#check_for_conflict, #process_additional_properties, #process_array, #process_basic_value, #process_hash, #to_hash, #to_json
Constructor Details
#initialize(taxforms:, document_metadata:, request_id: SKIP, error: SKIP, additional_properties: nil) ⇒ IncomeVerificationTaxformsGetResponse
Returns a new instance of IncomeVerificationTaxformsGetResponse.
58 59 60 61 62 63 64 65 66 67 68 |
# File 'lib/plaid/models/income_verification_taxforms_get_response.rb', line 58 def initialize(taxforms:, document_metadata:, request_id: SKIP, error: SKIP, additional_properties: nil) # Add additional model properties to the instance additional_properties = {} if additional_properties.nil? @request_id = request_id unless request_id == SKIP @taxforms = taxforms @document_metadata = @error = error unless error == SKIP @additional_properties = additional_properties end |
Instance Attribute Details
#document_metadata ⇒ Array[DocumentMetadata]
A list of taxforms.
25 26 27 |
# File 'lib/plaid/models/income_verification_taxforms_get_response.rb', line 25 def @document_metadata end |
#error ⇒ Error
We use standard HTTP response codes for success and failure notifications, and our errors are further classified by ‘error_type`. In general, 200 HTTP codes correspond to success, 40X codes are for developer- or user-related failures, and 50X codes are for Plaid-related issues. Error fields will be `null` if no error has occurred.
33 34 35 |
# File 'lib/plaid/models/income_verification_taxforms_get_response.rb', line 33 def error @error end |
#request_id ⇒ String
A unique identifier for the request, which can be used for troubleshooting. This identifier, like all Plaid identifiers, is case sensitive.
17 18 19 |
# File 'lib/plaid/models/income_verification_taxforms_get_response.rb', line 17 def request_id @request_id end |
#taxforms ⇒ Array[Taxform]
A list of taxforms.
21 22 23 |
# File 'lib/plaid/models/income_verification_taxforms_get_response.rb', line 21 def taxforms @taxforms end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 |
# File 'lib/plaid/models/income_verification_taxforms_get_response.rb', line 71 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. # Parameter is an array, so we need to iterate through it taxforms = nil unless hash['taxforms'].nil? taxforms = [] hash['taxforms'].each do |structure| taxforms << (Taxform.from_hash(structure) if structure) end end taxforms = nil unless hash.key?('taxforms') # Parameter is an array, so we need to iterate through it = nil unless hash['document_metadata'].nil? = [] hash['document_metadata'].each do |structure| << (DocumentMetadata.from_hash(structure) if structure) end end = nil unless hash.key?('document_metadata') request_id = hash.key?('request_id') ? hash['request_id'] : SKIP error = Error.from_hash(hash['error']) if hash['error'] # Create a new hash for additional properties, removing known properties. new_hash = hash.reject { |k, _| names.value?(k) } additional_properties = APIHelper.get_additional_properties( new_hash, proc { |value| value } ) # Create object from extracted values. IncomeVerificationTaxformsGetResponse.new(taxforms: taxforms, document_metadata: , request_id: request_id, error: error, additional_properties: additional_properties) end |
.names ⇒ Object
A mapping from model property names to API property names.
36 37 38 39 40 41 42 43 |
# File 'lib/plaid/models/income_verification_taxforms_get_response.rb', line 36 def self.names @_hash = {} if @_hash.nil? @_hash['request_id'] = 'request_id' @_hash['taxforms'] = 'taxforms' @_hash['document_metadata'] = 'document_metadata' @_hash['error'] = 'error' @_hash end |
.nullables ⇒ Object
An array for nullable fields
54 55 56 |
# File 'lib/plaid/models/income_verification_taxforms_get_response.rb', line 54 def self.nullables [] end |
.optionals ⇒ Object
An array for optional fields
46 47 48 49 50 51 |
# File 'lib/plaid/models/income_verification_taxforms_get_response.rb', line 46 def self.optionals %w[ request_id error ] end |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
122 123 124 125 126 127 |
# File 'lib/plaid/models/income_verification_taxforms_get_response.rb', line 122 def inspect class_name = self.class.name.split('::').last "<#{class_name} request_id: #{@request_id.inspect}, taxforms: #{@taxforms.inspect},"\ " document_metadata: #{@document_metadata.inspect}, error: #{@error.inspect},"\ " additional_properties: #{@additional_properties}>" end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
114 115 116 117 118 119 |
# File 'lib/plaid/models/income_verification_taxforms_get_response.rb', line 114 def to_s class_name = self.class.name.split('::').last "<#{class_name} request_id: #{@request_id}, taxforms: #{@taxforms}, document_metadata:"\ " #{@document_metadata}, error: #{@error}, additional_properties:"\ " #{@additional_properties}>" end |