Class: ThePlaidApi::LinkTokenCreateRequestIncomeVerification

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

Overview

Specifies options for initializing Link for use with the Income product. This field is required if ‘income_verification` is included in the `products` array.

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(income_verification_id: SKIP, asset_report_id: SKIP, access_tokens: SKIP, income_source_types: SKIP, bank_income: SKIP, payroll_income: SKIP, stated_income_sources: SKIP, additional_properties: nil) ⇒ LinkTokenCreateRequestIncomeVerification

Returns a new instance of LinkTokenCreateRequestIncomeVerification.



94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
# File 'lib/the_plaid_api/models/link_token_create_request_income_verification.rb', line 94

def initialize(income_verification_id: SKIP, asset_report_id: SKIP,
               access_tokens: SKIP, income_source_types: SKIP,
               bank_income: SKIP, payroll_income: SKIP,
               stated_income_sources: SKIP, additional_properties: nil)
  # Add additional model properties to the instance
  additional_properties = {} if additional_properties.nil?

  @income_verification_id = income_verification_id unless income_verification_id == SKIP
  @asset_report_id = asset_report_id unless asset_report_id == SKIP
  @access_tokens = access_tokens unless access_tokens == SKIP
  @income_source_types = income_source_types unless income_source_types == SKIP
  @bank_income = bank_income unless bank_income == SKIP
  @payroll_income = payroll_income unless payroll_income == SKIP
  @stated_income_sources = stated_income_sources unless stated_income_sources == SKIP
  @additional_properties = additional_properties
end

Instance Attribute Details

#access_tokensArray[String]

An array of access tokens corresponding to Items that a user has previously connected with. Data from these institutions will be cross-referenced with document data received during the Document Income flow to help verify that the uploaded documents are accurate. If the ‘transactions` product was not initialized for these Items during link, it will be initialized after this Link session. This field should only be used with the `payroll` income source type.

Returns:

  • (Array[String])


34
35
36
# File 'lib/the_plaid_api/models/link_token_create_request_income_verification.rb', line 34

def access_tokens
  @access_tokens
end

#asset_report_idString

The ‘asset_report_id` of an asset report associated with the user, as provided by `/asset_report/create`. Providing an `asset_report_id` is optional and can be used to verify the user through a streamlined flow. If provided, the bank linking flow will be skipped.

Returns:

  • (String)


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

def asset_report_id
  @asset_report_id
end

#bank_incomeLinkTokenCreateRequestIncomeVerificationBankIncome

Specifies options for initializing Link for use with Bank Income. This field is required if ‘income_verification` is included in the `products` array and `bank` is specified in `income_source_types`.



46
47
48
# File 'lib/the_plaid_api/models/link_token_create_request_income_verification.rb', line 46

def bank_income
  @bank_income
end

#income_source_typesArray[IncomeVerificationSourceType]

The types of source income data that users will be permitted to share. Options include ‘bank` and `payroll`. Currently you can only specify one of these options.

Returns:



40
41
42
# File 'lib/the_plaid_api/models/link_token_create_request_income_verification.rb', line 40

def income_source_types
  @income_source_types
end

#income_verification_idString

The ‘income_verification_id` of the verification instance, as provided by `/income/verification/create`. Replaced by the user token.

Returns:

  • (String)


17
18
19
# File 'lib/the_plaid_api/models/link_token_create_request_income_verification.rb', line 17

def income_verification_id
  @income_verification_id
end

#payroll_incomeLinkTokenCreateRequestIncomeVerificationPayrollIncome

Specifies options for initializing Link for use with Payroll Income (including Document Income). Further customization options for Document Income, such as customizing which document types may be uploaded, are also available via the [Link Customization pane](dashboard.plaid.com/link) in the Dashboard. (Requires Production enablement.)



55
56
57
# File 'lib/the_plaid_api/models/link_token_create_request_income_verification.rb', line 55

def payroll_income
  @payroll_income
end

#stated_income_sourcesArray[LinkTokenCreateRequestUserStatedIncomeSource]

A list of user stated income sources



59
60
61
# File 'lib/the_plaid_api/models/link_token_create_request_income_verification.rb', line 59

def stated_income_sources
  @stated_income_sources
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
# File 'lib/the_plaid_api/models/link_token_create_request_income_verification.rb', line 112

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  income_verification_id =
    hash.key?('income_verification_id') ? hash['income_verification_id'] : SKIP
  asset_report_id =
    hash.key?('asset_report_id') ? hash['asset_report_id'] : SKIP
  access_tokens = hash.key?('access_tokens') ? hash['access_tokens'] : SKIP
  income_source_types =
    hash.key?('income_source_types') ? hash['income_source_types'] : SKIP
  if hash['bank_income']
    bank_income = LinkTokenCreateRequestIncomeVerificationBankIncome.from_hash(hash['bank_income'])
  end
  if hash['payroll_income']
    payroll_income = LinkTokenCreateRequestIncomeVerificationPayrollIncome.from_hash(hash['payroll_income'])
  end
  # Parameter is an array, so we need to iterate through it
  stated_income_sources = nil
  unless hash['stated_income_sources'].nil?
    stated_income_sources = []
    hash['stated_income_sources'].each do |structure|
      stated_income_sources << (LinkTokenCreateRequestUserStatedIncomeSource.from_hash(structure) if structure)
    end
  end

  stated_income_sources = SKIP unless hash.key?('stated_income_sources')

  # 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.
  LinkTokenCreateRequestIncomeVerification.new(income_verification_id: income_verification_id,
                                               asset_report_id: asset_report_id,
                                               access_tokens: access_tokens,
                                               income_source_types: income_source_types,
                                               bank_income: bank_income,
                                               payroll_income: payroll_income,
                                               stated_income_sources: stated_income_sources,
                                               additional_properties: additional_properties)
end

.namesObject

A mapping from model property names to API property names.



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

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['income_verification_id'] = 'income_verification_id'
  @_hash['asset_report_id'] = 'asset_report_id'
  @_hash['access_tokens'] = 'access_tokens'
  @_hash['income_source_types'] = 'income_source_types'
  @_hash['bank_income'] = 'bank_income'
  @_hash['payroll_income'] = 'payroll_income'
  @_hash['stated_income_sources'] = 'stated_income_sources'
  @_hash
end

.nullablesObject

An array for nullable fields



88
89
90
91
92
# File 'lib/the_plaid_api/models/link_token_create_request_income_verification.rb', line 88

def self.nullables
  %w[
    access_tokens
  ]
end

.optionalsObject

An array for optional fields



75
76
77
78
79
80
81
82
83
84
85
# File 'lib/the_plaid_api/models/link_token_create_request_income_verification.rb', line 75

def self.optionals
  %w[
    income_verification_id
    asset_report_id
    access_tokens
    income_source_types
    bank_income
    payroll_income
    stated_income_sources
  ]
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



169
170
171
172
173
174
175
176
177
# File 'lib/the_plaid_api/models/link_token_create_request_income_verification.rb', line 169

def inspect
  class_name = self.class.name.split('::').last
  "<#{class_name} income_verification_id: #{@income_verification_id.inspect},"\
  " asset_report_id: #{@asset_report_id.inspect}, access_tokens: #{@access_tokens.inspect},"\
  " income_source_types: #{@income_source_types.inspect}, bank_income:"\
  " #{@bank_income.inspect}, payroll_income: #{@payroll_income.inspect},"\
  " stated_income_sources: #{@stated_income_sources.inspect}, additional_properties:"\
  " #{@additional_properties}>"
end

#to_sObject

Provides a human-readable string representation of the object.



159
160
161
162
163
164
165
166
# File 'lib/the_plaid_api/models/link_token_create_request_income_verification.rb', line 159

def to_s
  class_name = self.class.name.split('::').last
  "<#{class_name} income_verification_id: #{@income_verification_id}, asset_report_id:"\
  " #{@asset_report_id}, access_tokens: #{@access_tokens}, income_source_types:"\
  " #{@income_source_types}, bank_income: #{@bank_income}, payroll_income: #{@payroll_income},"\
  " stated_income_sources: #{@stated_income_sources}, additional_properties:"\
  " #{@additional_properties}>"
end