Class: ThePlaidApi::CraCheckReportCreateRequest

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

Overview

CraCheckReportCreateRequest defines the request schema for ‘/cra/check_report/create`.

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(webhook:, days_requested:, consumer_report_permissible_purpose:, client_id: SKIP, secret: SKIP, user_id: SKIP, user_token: SKIP, days_required: SKIP, client_report_id: SKIP, products: SKIP, base_report: SKIP, cashflow_insights: SKIP, partner_insights: SKIP, lend_score: SKIP, network_insights: SKIP, include_investments: SKIP, income_insights: SKIP, additional_properties: nil) ⇒ CraCheckReportCreateRequest

Returns a new instance of CraCheckReportCreateRequest.



192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
# File 'lib/the_plaid_api/models/cra_check_report_create_request.rb', line 192

def initialize(webhook:, days_requested:,
               consumer_report_permissible_purpose:, client_id: SKIP,
               secret: SKIP, user_id: SKIP, user_token: SKIP,
               days_required: SKIP, client_report_id: SKIP, products: SKIP,
               base_report: SKIP, cashflow_insights: SKIP,
               partner_insights: SKIP, lend_score: SKIP,
               network_insights: SKIP, include_investments: SKIP,
               income_insights: 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_id = user_id unless user_id == SKIP
  @user_token = user_token unless user_token == SKIP
  @webhook = webhook
  @days_requested = days_requested
  @days_required = days_required unless days_required == SKIP
  @client_report_id = client_report_id unless client_report_id == SKIP
  @products = products unless products == SKIP
  @base_report = base_report unless base_report == SKIP
  @cashflow_insights = cashflow_insights unless cashflow_insights == SKIP
  @partner_insights = partner_insights unless partner_insights == SKIP
  @lend_score = lend_score unless lend_score == SKIP
  @network_insights = network_insights unless network_insights == SKIP
  @include_investments = include_investments unless include_investments == SKIP
  @income_insights = income_insights unless income_insights == SKIP
  @consumer_report_permissible_purpose = consumer_report_permissible_purpose
  @additional_properties = additional_properties
end

Instance Attribute Details

#base_reportCraCheckReportCreateBaseReportOptions

Defines configuration options to generate a Base Report



71
72
73
# File 'lib/the_plaid_api/models/cra_check_report_create_request.rb', line 71

def base_report
  @base_report
end

#cashflow_insightsCraCheckReportCashflowInsightsGetOptions

Defines configuration options to generate Cashflow Insights



75
76
77
# File 'lib/the_plaid_api/models/cra_check_report_create_request.rb', line 75

def cashflow_insights
  @cashflow_insights
end

#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/cra_check_report_create_request.rb', line 17

def client_id
  @client_id
end

#client_report_idString

Client-generated identifier, which can be used by lenders to track loan applications.

Returns:

  • (String)


57
58
59
# File 'lib/the_plaid_api/models/cra_check_report_create_request.rb', line 57

def client_report_id
  @client_report_id
end

#consumer_report_permissible_purposeConsumerReportPermissiblePurpose

Describes the reason you are generating a Consumer Report for this user. When calling ‘/link/token/create`, this field is required when using Plaid Check (CRA) products; invalid if not using Plaid Check (CRA) products. `ACCOUNT_REVIEW_CREDIT`: In connection with a consumer credit transaction for the review or collection of an account pursuant to FCRA Section 604(a)(3)(A). `ACCOUNT_REVIEW_NON_CREDIT`: For a legitimate business need of the information to review a non-credit account provided primarily for personal, family, or household purposes to determine whether the consumer continues to meet the terms of the account pursuant to FCRA Section 604(a)(3)(F)(2). `EXTENSION_OF_CREDIT`: In connection with a credit transaction initiated by and involving the consumer pursuant to FCRA Section 604(a)(3)(A). `LEGITIMATE_BUSINESS_NEED_TENANT_SCREENING`: For a legitimate business need in connection with a business transaction initiated by the consumer primarily for personal, family, or household purposes in connection with a property rental assessment pursuant to FCRA Section 604(a)(3)(F)(i). `LEGITIMATE_BUSINESS_NEED_OTHER`: For a legitimate business need in connection with a business transaction made primarily for personal, family, or household initiated by the consumer pursuant to FCRA Section 604(a)(3)(F)(i). `WRITTEN_INSTRUCTION_PREQUALIFICATION`: In accordance with the written instructions of the consumer pursuant to FCRA Section 604(a)(2), to evaluate an application’s profile to make an offer to the consumer. `WRITTEN_INSTRUCTION_OTHER`: In accordance with the written instructions of the consumer pursuant to FCRA Section 604(a)(2), such as when an individual agrees to act as a guarantor or assumes personal liability for a consumer, business, or commercial loan. `ELIGIBILITY_FOR_GOVT_BENEFITS`: In connection with an eligibility determination for a government benefit where the entity is required to consider an applicant’s financial status pursuant to FCRA Section 604(a)(3)(D).



131
132
133
# File 'lib/the_plaid_api/models/cra_check_report_create_request.rb', line 131

def consumer_report_permissible_purpose
  @consumer_report_permissible_purpose
end

#days_requestedInteger

The number of days of data to request for the report. Default value is 365; maximum is 731; minimum is 180. If a value lower than 180 is provided, a minimum of 180 days of history will be requested.

Returns:

  • (Integer)


47
48
49
# File 'lib/the_plaid_api/models/cra_check_report_create_request.rb', line 47

def days_requested
  @days_requested
end

#days_requiredInteger

The minimum number of days of data required for the report to be successfully generated.

Returns:

  • (Integer)


52
53
54
# File 'lib/the_plaid_api/models/cra_check_report_create_request.rb', line 52

def days_required
  @days_required
end

#include_investmentsTrueClass | FalseClass

Indicates that investment data should be extracted from the linked account(s).

Returns:

  • (TrueClass | FalseClass)


92
93
94
# File 'lib/the_plaid_api/models/cra_check_report_create_request.rb', line 92

def include_investments
  @include_investments
end

#income_insightsCraCheckReportIncomeInsightsGetOptions

Defines configuration options to generate Income Insights.



96
97
98
# File 'lib/the_plaid_api/models/cra_check_report_create_request.rb', line 96

def income_insights
  @income_insights
end

#lend_scoreCraCheckReportLendScoreGetOptions

Defines configuration options to generate the LendScore



83
84
85
# File 'lib/the_plaid_api/models/cra_check_report_create_request.rb', line 83

def lend_score
  @lend_score
end

#network_insightsCraCheckReportNetworkInsightsGetOptions

Defines configuration options to generate Network Insights



87
88
89
# File 'lib/the_plaid_api/models/cra_check_report_create_request.rb', line 87

def network_insights
  @network_insights
end

#partner_insightsCraCheckReportCreatePartnerInsightsOptions

Defines configuration to generate Partner Insights.



79
80
81
# File 'lib/the_plaid_api/models/cra_check_report_create_request.rb', line 79

def partner_insights
  @partner_insights
end

#productsArray[Products]

Specifies a list of products that will be eagerly generated when creating the report (in addition to the Base Report, which is always eagerly generated). These products will be made available before a success webhook is sent. Use this option to minimize response latency for product ‘/get` endpoints. Note that specifying `cra_partner_insights` in this field will trigger a billable event. Other products are not billed until the respective reports are fetched via product-specific `/get` endpoints.

Returns:



67
68
69
# File 'lib/the_plaid_api/models/cra_check_report_create_request.rb', line 67

def products
  @products
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/cra_check_report_create_request.rb', line 22

def secret
  @secret
end

#user_idString

A unique user identifier, created by ‘/user/create`. Integrations that began using `/user/create` after December 10, 2025 use this field to identify a user instead of the `user_token`. For more details, see [new user APIs](plaid.com/docs/api/users/user-apis).

Returns:

  • (String)


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

def user_id
  @user_id
end

#user_tokenString

The user token associated with the User data is being requested for. This field is used only by customers with pre-existing integrations that already use the ‘user_token` field. All other customers should use the `user_id` instead. For more details, see [New User APIs](plaid.com/docs/api/users/user-apis).

Returns:

  • (String)


37
38
39
# File 'lib/the_plaid_api/models/cra_check_report_create_request.rb', line 37

def user_token
  @user_token
end

#webhookString

The destination URL to which webhooks will be sent

Returns:

  • (String)


41
42
43
# File 'lib/the_plaid_api/models/cra_check_report_create_request.rb', line 41

def webhook
  @webhook
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
# File 'lib/the_plaid_api/models/cra_check_report_create_request.rb', line 224

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  webhook = hash.key?('webhook') ? hash['webhook'] : nil
  days_requested =
    hash.key?('days_requested') ? hash['days_requested'] : nil
  consumer_report_permissible_purpose =
    hash.key?('consumer_report_permissible_purpose') ? hash['consumer_report_permissible_purpose'] : nil
  client_id = hash.key?('client_id') ? hash['client_id'] : SKIP
  secret = hash.key?('secret') ? hash['secret'] : SKIP
  user_id = hash.key?('user_id') ? hash['user_id'] : SKIP
  user_token = hash.key?('user_token') ? hash['user_token'] : SKIP
  days_required = hash.key?('days_required') ? hash['days_required'] : SKIP
  client_report_id =
    hash.key?('client_report_id') ? hash['client_report_id'] : SKIP
  products = hash.key?('products') ? hash['products'] : SKIP
  base_report = CraCheckReportCreateBaseReportOptions.from_hash(hash['base_report']) if
    hash['base_report']
  if hash['cashflow_insights']
    cashflow_insights = CraCheckReportCashflowInsightsGetOptions.from_hash(hash['cashflow_insights'])
  end
  if hash['partner_insights']
    partner_insights = CraCheckReportCreatePartnerInsightsOptions.from_hash(hash['partner_insights'])
  end
  lend_score = CraCheckReportLendScoreGetOptions.from_hash(hash['lend_score']) if
    hash['lend_score']
  if hash['network_insights']
    network_insights = CraCheckReportNetworkInsightsGetOptions.from_hash(hash['network_insights'])
  end
  include_investments =
    hash.key?('include_investments') ? hash['include_investments'] : SKIP
  income_insights = CraCheckReportIncomeInsightsGetOptions.from_hash(hash['income_insights']) if
    hash['income_insights']

  # 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.
  CraCheckReportCreateRequest.new(webhook: webhook,
                                  days_requested: days_requested,
                                  consumer_report_permissible_purpose: consumer_report_permissible_purpose,
                                  client_id: client_id,
                                  secret: secret,
                                  user_id: user_id,
                                  user_token: user_token,
                                  days_required: days_required,
                                  client_report_id: client_report_id,
                                  products: products,
                                  base_report: base_report,
                                  cashflow_insights: cashflow_insights,
                                  partner_insights: partner_insights,
                                  lend_score: lend_score,
                                  network_insights: network_insights,
                                  include_investments: include_investments,
                                  income_insights: income_insights,
                                  additional_properties: additional_properties)
end

.namesObject

A mapping from model property names to API property names.



134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
# File 'lib/the_plaid_api/models/cra_check_report_create_request.rb', line 134

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['client_id'] = 'client_id'
  @_hash['secret'] = 'secret'
  @_hash['user_id'] = 'user_id'
  @_hash['user_token'] = 'user_token'
  @_hash['webhook'] = 'webhook'
  @_hash['days_requested'] = 'days_requested'
  @_hash['days_required'] = 'days_required'
  @_hash['client_report_id'] = 'client_report_id'
  @_hash['products'] = 'products'
  @_hash['base_report'] = 'base_report'
  @_hash['cashflow_insights'] = 'cashflow_insights'
  @_hash['partner_insights'] = 'partner_insights'
  @_hash['lend_score'] = 'lend_score'
  @_hash['network_insights'] = 'network_insights'
  @_hash['include_investments'] = 'include_investments'
  @_hash['income_insights'] = 'income_insights'
  @_hash['consumer_report_permissible_purpose'] =
    'consumer_report_permissible_purpose'
  @_hash
end

.nullablesObject

An array for nullable fields



178
179
180
181
182
183
184
185
186
187
188
189
190
# File 'lib/the_plaid_api/models/cra_check_report_create_request.rb', line 178

def self.nullables
  %w[
    client_report_id
    products
    base_report
    cashflow_insights
    partner_insights
    lend_score
    network_insights
    include_investments
    income_insights
  ]
end

.optionalsObject

An array for optional fields



158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
# File 'lib/the_plaid_api/models/cra_check_report_create_request.rb', line 158

def self.optionals
  %w[
    client_id
    secret
    user_id
    user_token
    days_required
    client_report_id
    products
    base_report
    cashflow_insights
    partner_insights
    lend_score
    network_insights
    include_investments
    income_insights
  ]
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



302
303
304
305
306
307
308
309
310
311
312
313
314
# File 'lib/the_plaid_api/models/cra_check_report_create_request.rb', line 302

def inspect
  class_name = self.class.name.split('::').last
  "<#{class_name} client_id: #{@client_id.inspect}, secret: #{@secret.inspect}, user_id:"\
  " #{@user_id.inspect}, user_token: #{@user_token.inspect}, webhook: #{@webhook.inspect},"\
  " days_requested: #{@days_requested.inspect}, days_required: #{@days_required.inspect},"\
  " client_report_id: #{@client_report_id.inspect}, products: #{@products.inspect},"\
  " base_report: #{@base_report.inspect}, cashflow_insights: #{@cashflow_insights.inspect},"\
  " partner_insights: #{@partner_insights.inspect}, lend_score: #{@lend_score.inspect},"\
  " network_insights: #{@network_insights.inspect}, include_investments:"\
  " #{@include_investments.inspect}, income_insights: #{@income_insights.inspect},"\
  " consumer_report_permissible_purpose: #{@consumer_report_permissible_purpose.inspect},"\
  " additional_properties: #{@additional_properties}>"
end

#to_sObject

Provides a human-readable string representation of the object.



288
289
290
291
292
293
294
295
296
297
298
299
# File 'lib/the_plaid_api/models/cra_check_report_create_request.rb', line 288

def to_s
  class_name = self.class.name.split('::').last
  "<#{class_name} client_id: #{@client_id}, secret: #{@secret}, user_id: #{@user_id},"\
  " user_token: #{@user_token}, webhook: #{@webhook}, days_requested: #{@days_requested},"\
  " days_required: #{@days_required}, client_report_id: #{@client_report_id}, products:"\
  " #{@products}, base_report: #{@base_report}, cashflow_insights: #{@cashflow_insights},"\
  " partner_insights: #{@partner_insights}, lend_score: #{@lend_score}, network_insights:"\
  " #{@network_insights}, include_investments: #{@include_investments}, income_insights:"\
  " #{@income_insights}, consumer_report_permissible_purpose:"\
  " #{@consumer_report_permissible_purpose}, additional_properties:"\
  " #{@additional_properties}>"
end