Class: ThePlaidApi::CreditSessionError
- Inherits:
-
BaseModel
- Object
- CoreLibrary::BaseModel
- BaseModel
- ThePlaidApi::CreditSessionError
- Defined in:
- lib/the_plaid_api/models/credit_session_error.rb
Overview
The details of a Link error.
Instance Attribute Summary collapse
-
#display_message ⇒ String
A user-friendly representation of the error code.
-
#error_code ⇒ String
The particular error code.
-
#error_message ⇒ String
A developer-friendly representation of the error code.
-
#error_type ⇒ String
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: SKIP, error_code: SKIP, error_message: SKIP, display_message: SKIP, additional_properties: nil) ⇒ CreditSessionError
constructor
A new instance of CreditSessionError.
-
#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: SKIP, error_code: SKIP, error_message: SKIP, display_message: SKIP, additional_properties: nil) ⇒ CreditSessionError
Returns a new instance of CreditSessionError.
56 57 58 59 60 61 62 63 64 65 66 |
# File 'lib/the_plaid_api/models/credit_session_error.rb', line 56 def initialize(error_type: SKIP, error_code: SKIP, error_message: SKIP, display_message: SKIP, additional_properties: nil) # Add additional model properties to the instance additional_properties = {} if additional_properties.nil? @error_type = error_type unless error_type == SKIP @error_code = error_code unless error_code == SKIP @error_message = unless == SKIP @display_message = unless == SKIP @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.
27 28 29 |
# File 'lib/the_plaid_api/models/credit_session_error.rb', line 27 def @display_message end |
#error_code ⇒ String
The particular error code.
18 19 20 |
# File 'lib/the_plaid_api/models/credit_session_error.rb', line 18 def error_code @error_code end |
#error_message ⇒ String
A developer-friendly representation of the error code.
22 23 24 |
# File 'lib/the_plaid_api/models/credit_session_error.rb', line 22 def @error_message end |
#error_type ⇒ String
A broad categorization of the error.
14 15 16 |
# File 'lib/the_plaid_api/models/credit_session_error.rb', line 14 def error_type @error_type end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 |
# File 'lib/the_plaid_api/models/credit_session_error.rb', line 69 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. error_type = hash.key?('error_type') ? hash['error_type'] : SKIP error_code = hash.key?('error_code') ? hash['error_code'] : SKIP = hash.key?('error_message') ? hash['error_message'] : SKIP = hash.key?('display_message') ? hash['display_message'] : SKIP # 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. CreditSessionError.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.
30 31 32 33 34 35 36 37 |
# File 'lib/the_plaid_api/models/credit_session_error.rb', line 30 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
50 51 52 53 54 |
# File 'lib/the_plaid_api/models/credit_session_error.rb', line 50 def self.nullables %w[ display_message ] end |
.optionals ⇒ Object
An array for optional fields
40 41 42 43 44 45 46 47 |
# File 'lib/the_plaid_api/models/credit_session_error.rb', line 40 def self.optionals %w[ error_type error_code error_message display_message ] end |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
103 104 105 106 107 108 |
# File 'lib/the_plaid_api/models/credit_session_error.rb', line 103 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.
95 96 97 98 99 100 |
# File 'lib/the_plaid_api/models/credit_session_error.rb', line 95 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 |