Class: ThePlaidApi::ProtectReportCreateRequest

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

Overview

Request object for ‘/protect/report/create`. Must provide either `user_id` or at least one of the following identifiers in `incident_event`: `link_session_id`, `idv_session_id`, `protect_event_id`, or `signal_client_transaction_id`.

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(report_confidence:, report_type:, report_source:, client_id: SKIP, secret: SKIP, user_id: SKIP, incident_event: SKIP, bank_account: SKIP, ach_return_code: SKIP, notes: SKIP, additional_properties: nil) ⇒ ProtectReportCreateRequest

Returns a new instance of ProtectReportCreateRequest.



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

def initialize(report_confidence:, report_type:, report_source:,
               client_id: SKIP, secret: SKIP, user_id: SKIP,
               incident_event: SKIP, bank_account: SKIP,
               ach_return_code: SKIP, notes: 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
  @incident_event = incident_event unless incident_event == SKIP
  @report_confidence = report_confidence
  @report_type = report_type
  @report_source = report_source
  @bank_account =  unless  == SKIP
  @ach_return_code = ach_return_code unless ach_return_code == SKIP
  @notes = notes unless notes == SKIP
  @additional_properties = additional_properties
end

Instance Attribute Details

#ach_return_codeString

Must be a valid ACH return code (e.g. ‘R01`), required if `report_type` is `ACH_RETURN`.

Returns:

  • (String)


111
112
113
# File 'lib/the_plaid_api/models/protect_report_create_request.rb', line 111

def ach_return_code
  @ach_return_code
end

#bank_accountProtectBankAccount

Bank account information associated with the incident.

Returns:



106
107
108
# File 'lib/the_plaid_api/models/protect_report_create_request.rb', line 106

def 
  @bank_account
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)


19
20
21
# File 'lib/the_plaid_api/models/protect_report_create_request.rb', line 19

def client_id
  @client_id
end

#incident_eventProtectIncidentEvent

details about the incident event.



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

def incident_event
  @incident_event
end

#notesString

Additional context or details about the report, required if ‘report_type` is `OTHER`.

Returns:

  • (String)


116
117
118
# File 'lib/the_plaid_api/models/protect_report_create_request.rb', line 116

def notes
  @notes
end

#report_confidenceProtectReportConfidence

The confidence level of the incident report. ‘CONFIRMED` indicates the incident has been verified and definitively occurred. `SUSPECTED` indicates the incident is believed to have occurred but has not been fully verified.



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

def report_confidence
  @report_confidence
end

#report_sourceProtectReportSource

The source that identified or reported the incident. ‘INTERNAL_REVIEW` - Incident was identified through internal fraud investigations or review processes. `USER_SELF_REPORTED` - Incident was reported directly by the affected user. `BANK_FEEDBACK` - Incident was identified through bank feedback, including ACH returns and connection revocations. `NETWORK_FEEDBACK` - Incident was identified through card network alerts or chargebacks. `AUTOMATED_SYSTEM` - Incident was detected by automated systems such as fraud models or rule engines. `THIRD_PARTY_ALERT` - Incident was identified through external vendor or consortium alerts. `OTHER` - Incident was identified through a source not covered by other categories.

Returns:



102
103
104
# File 'lib/the_plaid_api/models/protect_report_create_request.rb', line 102

def report_source
  @report_source
end

#report_typeProtectReportType

The type of incident being reported. ‘USER_ACCOUNT_TAKEOVER` - Indicates that a legitimate user’s account was accessed or controlled by an unauthorized party. ‘FALSE_IDENTITY` - Indicates that a user created an account using stolen or fabricated identity information. `STOLEN_IDENTITY` - Indicates that a user created an account using identity information belonging to a real individual without their consent. `SYNTHETIC_IDENTITY` - Indicates that a user created an account using a fake or partially fabricated identity (e.g., combining real and fake information to form a new persona). `MULTIPLE_USER_ACCOUNTS` - Indicates that the same individual is operating multiple accounts in violation of policy. `SCAM_VICTIM` - Indicates that the user was tricked into authorizing or sending funds as part of a scam. `BANK_ACCOUNT_TAKEOVER` - Indicates that a user’s linked bank account was accessed or misused by an unauthorized party. ‘BANK_CONNECTION_REVOKED` - Indicates that a linked bank account connection was revoked by the financial institution, often due to suspected misuse, fraud, or security concerns. `CARD_TESTING` - Indicates that a card was used in small or repeated transactions to test its validity. `UNAUTHORIZED_TRANSACTION` - Indicates that a transaction was made without the user’s consent or authorization. ‘CARD_CHARGEBACK` - Indicates that a card transaction was reversed via a chargeback claim. `ACH_RETURN` - Indicates that an ACH transaction was returned or reversed by the bank. `DISPUTE` - Indicates that a user filed a dispute regarding a transaction or account activity. `FIRST_PARTY_FRAUD` - Indicates that a user intentionally misrepresented themselves or their actions for financial gain. `MISSED_PAYMENT` - Indicates that a user failed to make a required payment on time. `LOAN_STACKING` - Indicates that a user applied for or took out multiple loans simultaneously beyond their ability to repay. `MONEY_LAUNDERING` - Indicates that funds are being moved through accounts to obscure their illicit origin. `NO_FRAUD` - Indicates that an investigation determined no fraudulent activity occurred on user/event (positive label) `OTHER` - Indicates that the case involves fraud or financial risk not covered by other report types. Requires notes describing the report.

Returns:



84
85
86
# File 'lib/the_plaid_api/models/protect_report_create_request.rb', line 84

def report_type
  @report_type
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)


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

def secret
  @secret
end

#user_idString

The Plaid User ID associated with the report.

Returns:

  • (String)


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

def user_id
  @user_id
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



179
180
181
182
183
184
185
186
187
188
189
190
191
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
# File 'lib/the_plaid_api/models/protect_report_create_request.rb', line 179

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  report_confidence =
    hash.key?('report_confidence') ? hash['report_confidence'] : nil
  report_type = hash.key?('report_type') ? hash['report_type'] : nil
  report_source = hash.key?('report_source') ? hash['report_source'] : 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
  incident_event = ProtectIncidentEvent.from_hash(hash['incident_event']) if
    hash['incident_event']
   = ProtectBankAccount.from_hash(hash['bank_account']) if hash['bank_account']
  ach_return_code =
    hash.key?('ach_return_code') ? hash['ach_return_code'] : SKIP
  notes = hash.key?('notes') ? hash['notes'] : 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.
  ProtectReportCreateRequest.new(report_confidence: report_confidence,
                                 report_type: report_type,
                                 report_source: report_source,
                                 client_id: client_id,
                                 secret: secret,
                                 user_id: user_id,
                                 incident_event: incident_event,
                                 bank_account: ,
                                 ach_return_code: ach_return_code,
                                 notes: notes,
                                 additional_properties: additional_properties)
end

.namesObject

A mapping from model property names to API property names.



119
120
121
122
123
124
125
126
127
128
129
130
131
132
# File 'lib/the_plaid_api/models/protect_report_create_request.rb', line 119

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['client_id'] = 'client_id'
  @_hash['secret'] = 'secret'
  @_hash['user_id'] = 'user_id'
  @_hash['incident_event'] = 'incident_event'
  @_hash['report_confidence'] = 'report_confidence'
  @_hash['report_type'] = 'report_type'
  @_hash['report_source'] = 'report_source'
  @_hash['bank_account'] = 'bank_account'
  @_hash['ach_return_code'] = 'ach_return_code'
  @_hash['notes'] = 'notes'
  @_hash
end

.nullablesObject

An array for nullable fields



148
149
150
151
152
153
154
155
# File 'lib/the_plaid_api/models/protect_report_create_request.rb', line 148

def self.nullables
  %w[
    incident_event
    bank_account
    ach_return_code
    notes
  ]
end

.optionalsObject

An array for optional fields



135
136
137
138
139
140
141
142
143
144
145
# File 'lib/the_plaid_api/models/protect_report_create_request.rb', line 135

def self.optionals
  %w[
    client_id
    secret
    user_id
    incident_event
    bank_account
    ach_return_code
    notes
  ]
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



229
230
231
232
233
234
235
236
237
# File 'lib/the_plaid_api/models/protect_report_create_request.rb', line 229

def inspect
  class_name = self.class.name.split('::').last
  "<#{class_name} client_id: #{@client_id.inspect}, secret: #{@secret.inspect}, user_id:"\
  " #{@user_id.inspect}, incident_event: #{@incident_event.inspect}, report_confidence:"\
  " #{@report_confidence.inspect}, report_type: #{@report_type.inspect}, report_source:"\
  " #{@report_source.inspect}, bank_account: #{@bank_account.inspect}, ach_return_code:"\
  " #{@ach_return_code.inspect}, notes: #{@notes.inspect}, additional_properties:"\
  " #{@additional_properties}>"
end

#to_sObject

Provides a human-readable string representation of the object.



219
220
221
222
223
224
225
226
# File 'lib/the_plaid_api/models/protect_report_create_request.rb', line 219

def to_s
  class_name = self.class.name.split('::').last
  "<#{class_name} client_id: #{@client_id}, secret: #{@secret}, user_id: #{@user_id},"\
  " incident_event: #{@incident_event}, report_confidence: #{@report_confidence}, report_type:"\
  " #{@report_type}, report_source: #{@report_source}, bank_account: #{@bank_account},"\
  " ach_return_code: #{@ach_return_code}, notes: #{@notes}, additional_properties:"\
  " #{@additional_properties}>"
end