Class: ThePlaidApi::ProtectReport

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

Overview

A Protect report associated with a user. Contains details about documented incidents, which may include fraud, investigation outcomes, or other risk events.

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_id:, incident_event:, report_confidence:, report_type:, report_source:, bank_account:, ach_return_code:, notes:, created_at:, additional_properties: nil) ⇒ ProtectReport

Returns a new instance of ProtectReport.



140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
# File 'lib/the_plaid_api/models/protect_report.rb', line 140

def initialize(report_id:, incident_event:, report_confidence:,
               report_type:, report_source:, bank_account:,
               ach_return_code:, notes:, created_at:,
               additional_properties: nil)
  # Add additional model properties to the instance
  additional_properties = {} if additional_properties.nil?

  @report_id = report_id
  @incident_event = incident_event
  @report_confidence = report_confidence
  @report_type = report_type
  @report_source = report_source
  @bank_account = 
  @ach_return_code = ach_return_code
  @notes = notes
  @created_at = created_at
  @additional_properties = additional_properties
end

Instance Attribute Details

#ach_return_codeString

ACH return code if the report type is ‘ACH_RETURN` (e.g. `R01`).

Returns:

  • (String)


99
100
101
# File 'lib/the_plaid_api/models/protect_report.rb', line 99

def ach_return_code
  @ach_return_code
end

#bank_accountProtectBankAccount

Bank account information associated with the incident.

Returns:



95
96
97
# File 'lib/the_plaid_api/models/protect_report.rb', line 95

def 
  @bank_account
end

#created_atDateTime

The timestamp when the report was created, in ISO 8601 format (e.g., ‘2020-07-24T03:26:02Z’).

Returns:

  • (DateTime)


108
109
110
# File 'lib/the_plaid_api/models/protect_report.rb', line 108

def created_at
  @created_at
end

#incident_eventProtectIncidentEventResponse

Details about the incident event.



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

def incident_event
  @incident_event
end

#notesString

Additional context or details about the report.

Returns:

  • (String)


103
104
105
# File 'lib/the_plaid_api/models/protect_report.rb', line 103

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.



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

def report_confidence
  @report_confidence
end

#report_idString

A unique identifier representing the submitted report.

Returns:

  • (String)


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

def report_id
  @report_id
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:



91
92
93
# File 'lib/the_plaid_api/models/protect_report.rb', line 91

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:



73
74
75
# File 'lib/the_plaid_api/models/protect_report.rb', line 73

def report_type
  @report_type
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
# File 'lib/the_plaid_api/models/protect_report.rb', line 160

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  report_id = hash.key?('report_id') ? hash['report_id'] : nil
  incident_event = ProtectIncidentEventResponse.from_hash(hash['incident_event']) if
    hash['incident_event']
  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
   = ProtectBankAccount.from_hash(hash['bank_account']) if hash['bank_account']
  ach_return_code =
    hash.key?('ach_return_code') ? hash['ach_return_code'] : nil
  notes = hash.key?('notes') ? hash['notes'] : nil
  created_at = if hash.key?('created_at')
                 (DateTimeHelper.from_rfc3339(hash['created_at']) if hash['created_at'])
               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.
  ProtectReport.new(report_id: report_id,
                    incident_event: incident_event,
                    report_confidence: report_confidence,
                    report_type: report_type,
                    report_source: report_source,
                    bank_account: ,
                    ach_return_code: ach_return_code,
                    notes: notes,
                    created_at: created_at,
                    additional_properties: additional_properties)
end

.namesObject

A mapping from model property names to API property names.



111
112
113
114
115
116
117
118
119
120
121
122
123
# File 'lib/the_plaid_api/models/protect_report.rb', line 111

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['report_id'] = 'report_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['created_at'] = 'created_at'
  @_hash
end

.nullablesObject

An array for nullable fields



131
132
133
134
135
136
137
138
# File 'lib/the_plaid_api/models/protect_report.rb', line 131

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

.optionalsObject

An array for optional fields



126
127
128
# File 'lib/the_plaid_api/models/protect_report.rb', line 126

def self.optionals
  []
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



214
215
216
217
218
219
220
221
222
# File 'lib/the_plaid_api/models/protect_report.rb', line 214

def inspect
  class_name = self.class.name.split('::').last
  "<#{class_name} report_id: #{@report_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}, created_at: #{@created_at.inspect}, additional_properties:"\
  " #{@additional_properties}>"
end

#to_custom_created_atObject



199
200
201
# File 'lib/the_plaid_api/models/protect_report.rb', line 199

def to_custom_created_at
  DateTimeHelper.to_rfc3339(created_at)
end

#to_sObject

Provides a human-readable string representation of the object.



204
205
206
207
208
209
210
211
# File 'lib/the_plaid_api/models/protect_report.rb', line 204

def to_s
  class_name = self.class.name.split('::').last
  "<#{class_name} report_id: #{@report_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}, created_at: #{@created_at}, additional_properties:"\
  " #{@additional_properties}>"
end