Class: Plaid::IncomeVerificationSummaryGetResponse
- Inherits:
-
BaseModel
- Object
- CoreLibrary::BaseModel
- BaseModel
- Plaid::IncomeVerificationSummaryGetResponse
- Defined in:
- lib/plaid/models/income_verification_summary_get_response.rb
Overview
IncomeVerificationSummaryGetResponse defines the response schema for ‘/income/verification/summary/get`.
Instance Attribute Summary collapse
-
#error ⇒ Error
We use standard HTTP response codes for success and failure notifications, and our errors are further classified by ‘error_type`.
-
#income_summaries ⇒ Array[IncomeSummary]
A list of income summaries.
-
#request_id ⇒ String
A unique identifier for the request, which can be used for troubleshooting.
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(income_summaries:, request_id:, error: SKIP, additional_properties: nil) ⇒ IncomeVerificationSummaryGetResponse
constructor
A new instance of IncomeVerificationSummaryGetResponse.
-
#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(income_summaries:, request_id:, error: SKIP, additional_properties: nil) ⇒ IncomeVerificationSummaryGetResponse
Returns a new instance of IncomeVerificationSummaryGetResponse.
52 53 54 55 56 57 58 59 60 61 |
# File 'lib/plaid/models/income_verification_summary_get_response.rb', line 52 def initialize(income_summaries:, request_id:, error: SKIP, additional_properties: nil) # Add additional model properties to the instance additional_properties = {} if additional_properties.nil? @income_summaries = income_summaries @error = error unless error == SKIP @request_id = request_id @additional_properties = additional_properties end |
Instance Attribute Details
#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.
23 24 25 |
# File 'lib/plaid/models/income_verification_summary_get_response.rb', line 23 def error @error end |
#income_summaries ⇒ Array[IncomeSummary]
A list of income summaries.
15 16 17 |
# File 'lib/plaid/models/income_verification_summary_get_response.rb', line 15 def income_summaries @income_summaries 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.
29 30 31 |
# File 'lib/plaid/models/income_verification_summary_get_response.rb', line 29 def request_id @request_id end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 |
# File 'lib/plaid/models/income_verification_summary_get_response.rb', line 64 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 income_summaries = nil unless hash['income_summaries'].nil? income_summaries = [] hash['income_summaries'].each do |structure| income_summaries << (IncomeSummary.from_hash(structure) if structure) end end income_summaries = nil unless hash.key?('income_summaries') request_id = hash.key?('request_id') ? hash['request_id'] : nil 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. IncomeVerificationSummaryGetResponse.new(income_summaries: income_summaries, request_id: request_id, error: error, additional_properties: additional_properties) end |
.names ⇒ Object
A mapping from model property names to API property names.
32 33 34 35 36 37 38 |
# File 'lib/plaid/models/income_verification_summary_get_response.rb', line 32 def self.names @_hash = {} if @_hash.nil? @_hash['income_summaries'] = 'income_summaries' @_hash['error'] = 'error' @_hash['request_id'] = 'request_id' @_hash end |
.nullables ⇒ Object
An array for nullable fields
48 49 50 |
# File 'lib/plaid/models/income_verification_summary_get_response.rb', line 48 def self.nullables [] end |
.optionals ⇒ Object
An array for optional fields
41 42 43 44 45 |
# File 'lib/plaid/models/income_verification_summary_get_response.rb', line 41 def self.optionals %w[ error ] end |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
103 104 105 106 107 |
# File 'lib/plaid/models/income_verification_summary_get_response.rb', line 103 def inspect class_name = self.class.name.split('::').last "<#{class_name} income_summaries: #{@income_summaries.inspect}, error: #{@error.inspect},"\ " request_id: #{@request_id.inspect}, additional_properties: #{@additional_properties}>" end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
96 97 98 99 100 |
# File 'lib/plaid/models/income_verification_summary_get_response.rb', line 96 def to_s class_name = self.class.name.split('::').last "<#{class_name} income_summaries: #{@income_summaries}, error: #{@error}, request_id:"\ " #{@request_id}, additional_properties: #{@additional_properties}>" end |