Class: ThePlaidApi::IncomeVerificationPrecheckRequest

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

Overview

IncomeVerificationPrecheckRequest defines the request schema for ‘/income/verification/precheck`

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(client_id: SKIP, secret: SKIP, user: SKIP, employer: SKIP, payroll_institution: SKIP, transactions_access_token: SKIP, transactions_access_tokens: SKIP, us_military_info: SKIP, additional_properties: nil) ⇒ IncomeVerificationPrecheckRequest

Returns a new instance of IncomeVerificationPrecheckRequest.



91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
# File 'lib/the_plaid_api/models/income_verification_precheck_request.rb', line 91

def initialize(client_id: SKIP, secret: SKIP, user: SKIP, employer: SKIP,
               payroll_institution: SKIP, transactions_access_token: SKIP,
               transactions_access_tokens: SKIP, us_military_info: SKIP,
               additional_properties: nil)
  # Add additional model properties to the instance
  additional_properties = {} if additional_properties.nil?

  @client_id = client_id unless client_id == SKIP
  @secret = secret unless secret == SKIP
  @user = user unless user == SKIP
  @employer = employer unless employer == SKIP
  @payroll_institution = payroll_institution unless payroll_institution == SKIP
  unless transactions_access_token == SKIP
    @transactions_access_token =
      transactions_access_token
  end
  unless transactions_access_tokens == SKIP
    @transactions_access_tokens =
      transactions_access_tokens
  end
  @us_military_info = us_military_info unless us_military_info == SKIP
  @additional_properties = additional_properties
end

Instance Attribute Details

#client_idString

Your Plaid API ‘client_id`. The `client_id` is required and may be provided either in the `PLAID-CLIENT-ID` header or as part of a request body.

Returns:

  • (String)


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

def client_id
  @client_id
end

#employerIncomeVerificationPrecheckEmployer

Information about the end user’s employer



30
31
32
# File 'lib/the_plaid_api/models/income_verification_precheck_request.rb', line 30

def employer
  @employer
end

#payroll_institutionIncomeVerificationPrecheckPayrollInstitution

Information about the end user’s payroll institution



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

def payroll_institution
  @payroll_institution
end

#secretString

Your Plaid API ‘secret`. The `secret` is required and may be provided either in the `PLAID-SECRET` header or as part of a request body.

Returns:

  • (String)


22
23
24
# File 'lib/the_plaid_api/models/income_verification_precheck_request.rb', line 22

def secret
  @secret
end

#transactions_access_tokenString

Information about the end user’s payroll institution

Returns:

  • (String)


38
39
40
# File 'lib/the_plaid_api/models/income_verification_precheck_request.rb', line 38

def transactions_access_token
  @transactions_access_token
end

#transactions_access_tokensArray[String]

An array of access tokens corresponding to Items belonging to the user whose eligibility is being checked. Note that if the Items specified here are not already initialized with ‘transactions`, providing them in this field will cause these Items to be initialized with (and billed for) the Transactions product.

Returns:

  • (Array[String])


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

def transactions_access_tokens
  @transactions_access_tokens
end

#us_military_infoIncomeVerificationPrecheckMilitaryInfo

Data about military info in the income verification precheck.



50
51
52
# File 'lib/the_plaid_api/models/income_verification_precheck_request.rb', line 50

def us_military_info
  @us_military_info
end

#userIncomeVerificationPrecheckUser

Information about the user whose eligibility is being evaluated.



26
27
28
# File 'lib/the_plaid_api/models/income_verification_precheck_request.rb', line 26

def user
  @user
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



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

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  client_id = hash.key?('client_id') ? hash['client_id'] : SKIP
  secret = hash.key?('secret') ? hash['secret'] : SKIP
  user = IncomeVerificationPrecheckUser.from_hash(hash['user']) if hash['user']
  employer = IncomeVerificationPrecheckEmployer.from_hash(hash['employer']) if
    hash['employer']
  if hash['payroll_institution']
    payroll_institution = IncomeVerificationPrecheckPayrollInstitution.from_hash(hash['payroll_institution'])
  end
  transactions_access_token =
    hash.key?('transactions_access_token') ? hash['transactions_access_token'] : SKIP
  transactions_access_tokens =
    hash.key?('transactions_access_tokens') ? hash['transactions_access_tokens'] : SKIP
  if hash['us_military_info']
    us_military_info = IncomeVerificationPrecheckMilitaryInfo.from_hash(hash['us_military_info'])
  end

  # 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.
  IncomeVerificationPrecheckRequest.new(client_id: client_id,
                                        secret: secret,
                                        user: user,
                                        employer: employer,
                                        payroll_institution: payroll_institution,
                                        transactions_access_token: transactions_access_token,
                                        transactions_access_tokens: transactions_access_tokens,
                                        us_military_info: us_military_info,
                                        additional_properties: additional_properties)
end

.namesObject

A mapping from model property names to API property names.



53
54
55
56
57
58
59
60
61
62
63
64
# File 'lib/the_plaid_api/models/income_verification_precheck_request.rb', line 53

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['client_id'] = 'client_id'
  @_hash['secret'] = 'secret'
  @_hash['user'] = 'user'
  @_hash['employer'] = 'employer'
  @_hash['payroll_institution'] = 'payroll_institution'
  @_hash['transactions_access_token'] = 'transactions_access_token'
  @_hash['transactions_access_tokens'] = 'transactions_access_tokens'
  @_hash['us_military_info'] = 'us_military_info'
  @_hash
end

.nullablesObject

An array for nullable fields



81
82
83
84
85
86
87
88
89
# File 'lib/the_plaid_api/models/income_verification_precheck_request.rb', line 81

def self.nullables
  %w[
    user
    employer
    payroll_institution
    transactions_access_token
    us_military_info
  ]
end

.optionalsObject

An array for optional fields



67
68
69
70
71
72
73
74
75
76
77
78
# File 'lib/the_plaid_api/models/income_verification_precheck_request.rb', line 67

def self.optionals
  %w[
    client_id
    secret
    user
    employer
    payroll_institution
    transactions_access_token
    transactions_access_tokens
    us_military_info
  ]
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



165
166
167
168
169
170
171
172
173
# File 'lib/the_plaid_api/models/income_verification_precheck_request.rb', line 165

def inspect
  class_name = self.class.name.split('::').last
  "<#{class_name} client_id: #{@client_id.inspect}, secret: #{@secret.inspect}, user:"\
  " #{@user.inspect}, employer: #{@employer.inspect}, payroll_institution:"\
  " #{@payroll_institution.inspect}, transactions_access_token:"\
  " #{@transactions_access_token.inspect}, transactions_access_tokens:"\
  " #{@transactions_access_tokens.inspect}, us_military_info: #{@us_military_info.inspect},"\
  " additional_properties: #{@additional_properties}>"
end

#to_sObject

Provides a human-readable string representation of the object.



156
157
158
159
160
161
162
# File 'lib/the_plaid_api/models/income_verification_precheck_request.rb', line 156

def to_s
  class_name = self.class.name.split('::').last
  "<#{class_name} client_id: #{@client_id}, secret: #{@secret}, user: #{@user}, employer:"\
  " #{@employer}, payroll_institution: #{@payroll_institution}, transactions_access_token:"\
  " #{@transactions_access_token}, transactions_access_tokens: #{@transactions_access_tokens},"\
  " us_military_info: #{@us_military_info}, additional_properties: #{@additional_properties}>"
end