Class: ThePlaidApi::IncomeVerificationTaxformsGetResponse

Inherits:
BaseModel
  • Object
show all
Defined in:
lib/the_plaid_api/models/income_verification_taxforms_get_response.rb

Overview

IncomeVerificationTaxformsGetResponse defines the response schema for ‘/income/verification/taxforms/get`

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from BaseModel

#check_for_conflict, #process_additional_properties, #process_array, #process_basic_value, #process_hash, #to_hash, #to_json

Constructor Details

#initialize(document_metadata:, taxforms:, request_id: SKIP, error: SKIP, additional_properties: nil) ⇒ IncomeVerificationTaxformsGetResponse

Returns a new instance of IncomeVerificationTaxformsGetResponse.



66
67
68
69
70
71
72
73
74
75
76
# File 'lib/the_plaid_api/models/income_verification_taxforms_get_response.rb', line 66

def initialize(document_metadata:, taxforms:, 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
  @document_metadata = 
  @taxforms = taxforms
  @error = error unless error == SKIP
  @additional_properties = additional_properties
end

Instance Attribute Details

#document_metadataArray[DocumentMetadata]

A unique identifier for the request, which can be used for troubleshooting. This identifier, like all Plaid identifiers, is case sensitive.

Returns:



23
24
25
# File 'lib/the_plaid_api/models/income_verification_taxforms_get_response.rb', line 23

def 
  @document_metadata
end

#errorError

Errors are identified by ‘error_code` and categorized by `error_type`. Use these in preference to HTTP status codes to identify and handle specific errors. HTTP status codes are set and provide the broadest categorization of errors: 4xx codes are for developer- or user-related errors, and 5xx codes are for Plaid-related errors, and the status will be 2xx in non-error cases. An Item with a non-`null` error object will only be part of an API response when calling `/item/get` to view Item status. Otherwise, error fields will be `null` if no error has occurred; if an error has occurred, an error code will be returned instead.

Returns:



39
40
41
# File 'lib/the_plaid_api/models/income_verification_taxforms_get_response.rb', line 39

def error
  @error
end

#request_idString

A unique identifier for the request, which can be used for troubleshooting. This identifier, like all Plaid identifiers, is case sensitive.

Returns:

  • (String)


17
18
19
# File 'lib/the_plaid_api/models/income_verification_taxforms_get_response.rb', line 17

def request_id
  @request_id
end

#taxformsArray[Taxform]

A list of forms.

Returns:



27
28
29
# File 'lib/the_plaid_api/models/income_verification_taxforms_get_response.rb', line 27

def taxforms
  @taxforms
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



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
112
113
114
115
116
117
118
119
# File 'lib/the_plaid_api/models/income_verification_taxforms_get_response.rb', line 79

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
   = 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')
  # 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')
  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(document_metadata: ,
                                            taxforms: taxforms,
                                            request_id: request_id,
                                            error: error,
                                            additional_properties: additional_properties)
end

.namesObject

A mapping from model property names to API property names.



42
43
44
45
46
47
48
49
# File 'lib/the_plaid_api/models/income_verification_taxforms_get_response.rb', line 42

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['request_id'] = 'request_id'
  @_hash['document_metadata'] = 'document_metadata'
  @_hash['taxforms'] = 'taxforms'
  @_hash['error'] = 'error'
  @_hash
end

.nullablesObject

An array for nullable fields



60
61
62
63
64
# File 'lib/the_plaid_api/models/income_verification_taxforms_get_response.rb', line 60

def self.nullables
  %w[
    error
  ]
end

.optionalsObject

An array for optional fields



52
53
54
55
56
57
# File 'lib/the_plaid_api/models/income_verification_taxforms_get_response.rb', line 52

def self.optionals
  %w[
    request_id
    error
  ]
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



130
131
132
133
134
135
# File 'lib/the_plaid_api/models/income_verification_taxforms_get_response.rb', line 130

def inspect
  class_name = self.class.name.split('::').last
  "<#{class_name} request_id: #{@request_id.inspect}, document_metadata:"\
  " #{@document_metadata.inspect}, taxforms: #{@taxforms.inspect}, error: #{@error.inspect},"\
  " additional_properties: #{@additional_properties}>"
end

#to_sObject

Provides a human-readable string representation of the object.



122
123
124
125
126
127
# File 'lib/the_plaid_api/models/income_verification_taxforms_get_response.rb', line 122

def to_s
  class_name = self.class.name.split('::').last
  "<#{class_name} request_id: #{@request_id}, document_metadata: #{@document_metadata},"\
  " taxforms: #{@taxforms}, error: #{@error}, additional_properties:"\
  " #{@additional_properties}>"
end