Class: ThePlaidApi::CreditBankIncomeCause

Inherits:
BaseModel
  • Object
show all
Defined in:
lib/the_plaid_api/models/credit_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

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(error_type:, error_code:, error_message:, display_message:, item_id:, additional_properties: nil) ⇒ CreditBankIncomeCause

Returns a new instance of CreditBankIncomeCause.



62
63
64
65
66
67
68
69
70
71
72
73
# File 'lib/the_plaid_api/models/credit_bank_income_cause.rb', line 62

def initialize(error_type:, error_code:, error_message:, display_message:,
               item_id:, 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 = error_message
  @display_message = display_message
  @item_id = item_id
  @additional_properties = additional_properties
end

Instance Attribute Details

#display_messageString

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.

Returns:

  • (String)


35
36
37
# File 'lib/the_plaid_api/models/credit_bank_income_cause.rb', line 35

def display_message
  @display_message
end

#error_codeString

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.

Returns:

  • (String)


24
25
26
# File 'lib/the_plaid_api/models/credit_bank_income_cause.rb', line 24

def error_code
  @error_code
end

#error_messageString

A developer-friendly representation of the error code. This may change over time and is not safe for programmatic use.

Returns:

  • (String)


29
30
31
# File 'lib/the_plaid_api/models/credit_bank_income_cause.rb', line 29

def error_message
  @error_message
end

#error_typeCreditBankIncomeErrorType

A broad categorization of the error. Safe for programmatic use.



16
17
18
# File 'lib/the_plaid_api/models/credit_bank_income_cause.rb', line 16

def error_type
  @error_type
end

#item_idString

The ‘item_id` of the Item associated with this warning.

Returns:

  • (String)


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

def item_id
  @item_id
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



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
# File 'lib/the_plaid_api/models/credit_bank_income_cause.rb', line 76

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
  error_message = hash.key?('error_message') ? hash['error_message'] : nil
  display_message =
    hash.key?('display_message') ? hash['display_message'] : nil
  item_id = hash.key?('item_id') ? hash['item_id'] : 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.
  CreditBankIncomeCause.new(error_type: error_type,
                            error_code: error_code,
                            error_message: error_message,
                            display_message: display_message,
                            item_id: item_id,
                            additional_properties: additional_properties)
end

.namesObject

A mapping from model property names to API property names.



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

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['item_id'] = 'item_id'
  @_hash
end

.nullablesObject

An array for nullable fields



58
59
60
# File 'lib/the_plaid_api/models/credit_bank_income_cause.rb', line 58

def self.nullables
  []
end

.optionalsObject

An array for optional fields



53
54
55
# File 'lib/the_plaid_api/models/credit_bank_income_cause.rb', line 53

def self.optionals
  []
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



112
113
114
115
116
117
# File 'lib/the_plaid_api/models/credit_bank_income_cause.rb', line 112

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},"\
  " item_id: #{@item_id.inspect}, additional_properties: #{@additional_properties}>"
end

#to_sObject

Provides a human-readable string representation of the object.



104
105
106
107
108
109
# File 'lib/the_plaid_api/models/credit_bank_income_cause.rb', line 104

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}, item_id: #{@item_id},"\
  " additional_properties: #{@additional_properties}>"
end