Class: ThePlaidApi::CraBankIncomeCause
- Inherits:
-
BaseModel
- Object
- CoreLibrary::BaseModel
- BaseModel
- ThePlaidApi::CraBankIncomeCause
- Defined in:
- lib/the_plaid_api/models/cra_bank_income_cause.rb
Overview
An error object and associated ‘item_id` used to identify a specific Item and error when a batch operation operating on multiple Items has encountered an error in one of the Items.
Instance Attribute Summary collapse
-
#display_message ⇒ String
A user-friendly representation of the error code.
-
#error_code ⇒ String
We use standard HTTP response codes for success and failure notifications, and our errors are further classified by ‘error_type`.
-
#error_message ⇒ String
A developer-friendly representation of the error code.
-
#error_type ⇒ CreditBankIncomeErrorType
A broad categorization of the error.
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(error_type:, error_code:, error_message:, display_message:, additional_properties: nil) ⇒ CraBankIncomeCause
constructor
A new instance of CraBankIncomeCause.
-
#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(error_type:, error_code:, error_message:, display_message:, additional_properties: nil) ⇒ CraBankIncomeCause
Returns a new instance of CraBankIncomeCause.
57 58 59 60 61 62 63 64 65 66 67 |
# File 'lib/the_plaid_api/models/cra_bank_income_cause.rb', line 57 def initialize(error_type:, error_code:, error_message:, display_message:, additional_properties: nil) # Add additional model properties to the instance additional_properties = {} if additional_properties.nil? @error_type = error_type @error_code = error_code @error_message = @display_message = @additional_properties = additional_properties end |
Instance Attribute Details
#display_message ⇒ String
A user-friendly representation of the error code. null if the error is not related to user action. This may change over time and is not safe for programmatic use.
35 36 37 |
# File 'lib/the_plaid_api/models/cra_bank_income_cause.rb', line 35 def @display_message end |
#error_code ⇒ String
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.
24 25 26 |
# File 'lib/the_plaid_api/models/cra_bank_income_cause.rb', line 24 def error_code @error_code end |
#error_message ⇒ String
A developer-friendly representation of the error code. This may change over time and is not safe for programmatic use.
29 30 31 |
# File 'lib/the_plaid_api/models/cra_bank_income_cause.rb', line 29 def @error_message end |
#error_type ⇒ CreditBankIncomeErrorType
A broad categorization of the error. Safe for programmatic use.
16 17 18 |
# File 'lib/the_plaid_api/models/cra_bank_income_cause.rb', line 16 def error_type @error_type end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
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/the_plaid_api/models/cra_bank_income_cause.rb', line 70 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. error_type = hash.key?('error_type') ? hash['error_type'] : nil error_code = hash.key?('error_code') ? hash['error_code'] : nil = hash.key?('error_message') ? hash['error_message'] : nil = hash.key?('display_message') ? hash['display_message'] : nil # 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. CraBankIncomeCause.new(error_type: error_type, error_code: error_code, error_message: , display_message: , additional_properties: additional_properties) end |
.names ⇒ Object
A mapping from model property names to API property names.
38 39 40 41 42 43 44 45 |
# File 'lib/the_plaid_api/models/cra_bank_income_cause.rb', line 38 def self.names @_hash = {} if @_hash.nil? @_hash['error_type'] = 'error_type' @_hash['error_code'] = 'error_code' @_hash['error_message'] = 'error_message' @_hash['display_message'] = 'display_message' @_hash end |
.nullables ⇒ Object
An array for nullable fields
53 54 55 |
# File 'lib/the_plaid_api/models/cra_bank_income_cause.rb', line 53 def self.nullables [] end |
.optionals ⇒ Object
An array for optional fields
48 49 50 |
# File 'lib/the_plaid_api/models/cra_bank_income_cause.rb', line 48 def self.optionals [] end |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
104 105 106 107 108 109 |
# File 'lib/the_plaid_api/models/cra_bank_income_cause.rb', line 104 def inspect class_name = self.class.name.split('::').last "<#{class_name} error_type: #{@error_type.inspect}, error_code: #{@error_code.inspect},"\ " error_message: #{@error_message.inspect}, display_message: #{@display_message.inspect},"\ " additional_properties: #{@additional_properties}>" end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
96 97 98 99 100 101 |
# File 'lib/the_plaid_api/models/cra_bank_income_cause.rb', line 96 def to_s class_name = self.class.name.split('::').last "<#{class_name} error_type: #{@error_type}, error_code: #{@error_code}, error_message:"\ " #{@error_message}, display_message: #{@display_message}, additional_properties:"\ " #{@additional_properties}>" end |