Class: ThePlaidApi::CreditSessionBankIncomeResult

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

Overview

The details of a bank income verification in Link

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(status: SKIP, item_id: SKIP, institution_id: SKIP, additional_properties: nil) ⇒ CreditSessionBankIncomeResult

Returns a new instance of CreditSessionBankIncomeResult.



57
58
59
60
61
62
63
64
65
66
# File 'lib/the_plaid_api/models/credit_session_bank_income_result.rb', line 57

def initialize(status: SKIP, item_id: SKIP, institution_id: SKIP,
               additional_properties: nil)
  # Add additional model properties to the instance
  additional_properties = {} if additional_properties.nil?

  @status = status unless status == SKIP
  @item_id = item_id unless item_id == SKIP
  @institution_id = institution_id unless institution_id == SKIP
  @additional_properties = additional_properties
end

Instance Attribute Details

#institution_idString

The Plaid Institution ID associated with the Item.

Returns:

  • (String)


32
33
34
# File 'lib/the_plaid_api/models/credit_session_bank_income_result.rb', line 32

def institution_id
  @institution_id
end

#item_idString

The Plaid Item ID. The ‘item_id` is always unique; linking the same account at the same institution twice will result in two Items with different `item_id` values. Like all Plaid identifiers, the `item_id` is case-sensitive.

Returns:

  • (String)


28
29
30
# File 'lib/the_plaid_api/models/credit_session_bank_income_result.rb', line 28

def item_id
  @item_id
end

#statusCreditSessionBankIncomeStatus

Status of the Bank Income Link session. ‘APPROVED`: User has approved and verified their income `NO_DEPOSITS_FOUND`: We attempted, but were unable to find any income in the connected account. `USER_REPORTED_NO_INCOME`: The user explicitly indicated that they don’t receive income in the connected account. ‘STARTED`: The user began the bank income portion of the link flow. `INTERNAL_ERROR`: The user encountered an internal error.



21
22
23
# File 'lib/the_plaid_api/models/credit_session_bank_income_result.rb', line 21

def status
  @status
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
# File 'lib/the_plaid_api/models/credit_session_bank_income_result.rb', line 69

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  status = hash.key?('status') ? hash['status'] : SKIP
  item_id = hash.key?('item_id') ? hash['item_id'] : SKIP
  institution_id =
    hash.key?('institution_id') ? hash['institution_id'] : 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.
  CreditSessionBankIncomeResult.new(status: status,
                                    item_id: item_id,
                                    institution_id: institution_id,
                                    additional_properties: additional_properties)
end

.namesObject

A mapping from model property names to API property names.



35
36
37
38
39
40
41
# File 'lib/the_plaid_api/models/credit_session_bank_income_result.rb', line 35

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['status'] = 'status'
  @_hash['item_id'] = 'item_id'
  @_hash['institution_id'] = 'institution_id'
  @_hash
end

.nullablesObject

An array for nullable fields



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

def self.nullables
  []
end

.optionalsObject

An array for optional fields



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

def self.optionals
  %w[
    status
    item_id
    institution_id
  ]
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



100
101
102
103
104
# File 'lib/the_plaid_api/models/credit_session_bank_income_result.rb', line 100

def inspect
  class_name = self.class.name.split('::').last
  "<#{class_name} status: #{@status.inspect}, item_id: #{@item_id.inspect}, institution_id:"\
  " #{@institution_id.inspect}, additional_properties: #{@additional_properties}>"
end

#to_sObject

Provides a human-readable string representation of the object.



93
94
95
96
97
# File 'lib/the_plaid_api/models/credit_session_bank_income_result.rb', line 93

def to_s
  class_name = self.class.name.split('::').last
  "<#{class_name} status: #{@status}, item_id: #{@item_id}, institution_id:"\
  " #{@institution_id}, additional_properties: #{@additional_properties}>"
end