Class: ThePlaidApi::BeaconReportSyndicationOriginalReport

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

Overview

A subset of information from a Beacon Report that has been syndicated to a matching Beacon User in your program. The ‘id` field in the response is the ID of the original report that was syndicated. If the original report was created by your organization, the field will be filled with the ID of the report. Otherwise, the field will be `null` indicating that the original report was created by another Beacon customer.

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(id:, created_at:, type:, fraud_date:, event_date:, additional_properties: nil) ⇒ BeaconReportSyndicationOriginalReport

Returns a new instance of BeaconReportSyndicationOriginalReport.



70
71
72
73
74
75
76
77
78
79
80
81
# File 'lib/the_plaid_api/models/beacon_report_syndication_original_report.rb', line 70

def initialize(id:, created_at:, type:, fraud_date:, event_date:,
               additional_properties: nil)
  # Add additional model properties to the instance
  additional_properties = {} if additional_properties.nil?

  @id = id
  @created_at = created_at
  @type = type
  @fraud_date = fraud_date
  @event_date = event_date
  @additional_properties = additional_properties
end

Instance Attribute Details

#created_atDateTime

An ISO8601 formatted timestamp.

Returns:

  • (DateTime)


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

def created_at
  @created_at
end

#event_dateDate

A date in the format YYYY-MM-DD (RFC 3339 Section 5.6).

Returns:

  • (Date)


44
45
46
# File 'lib/the_plaid_api/models/beacon_report_syndication_original_report.rb', line 44

def event_date
  @event_date
end

#fraud_dateDate

A date in the format YYYY-MM-DD (RFC 3339 Section 5.6).

Returns:

  • (Date)


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

def fraud_date
  @fraud_date
end

#idString

ID of the associated Beacon Report.

Returns:

  • (String)


20
21
22
# File 'lib/the_plaid_api/models/beacon_report_syndication_original_report.rb', line 20

def id
  @id
end

#typeBeaconReportType

The type of Beacon Report. ‘first_party`: If this is the same individual as the one who submitted the KYC. `stolen`: If this is a different individual from the one who submitted the KYC. `synthetic`: If this is an individual using fabricated information. `account_takeover`: If this individual’s account was compromised. ‘data_breach`: If this individual’s data was compromised in a breach. ‘unknown`: If you aren’t sure who committed the fraud.

Returns:



36
37
38
# File 'lib/the_plaid_api/models/beacon_report_syndication_original_report.rb', line 36

def type
  @type
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
# File 'lib/the_plaid_api/models/beacon_report_syndication_original_report.rb', line 84

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  id = hash.key?('id') ? hash['id'] : nil
  created_at = if hash.key?('created_at')
                 (DateTimeHelper.from_rfc3339(hash['created_at']) if hash['created_at'])
               end
  type = hash.key?('type') ? hash['type'] : nil
  fraud_date = hash.key?('fraud_date') ? hash['fraud_date'] : nil
  event_date = hash.key?('event_date') ? hash['event_date'] : nil

  # 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.
  BeaconReportSyndicationOriginalReport.new(id: id,
                                            created_at: created_at,
                                            type: type,
                                            fraud_date: fraud_date,
                                            event_date: event_date,
                                            additional_properties: additional_properties)
end

.namesObject

A mapping from model property names to API property names.



47
48
49
50
51
52
53
54
55
# File 'lib/the_plaid_api/models/beacon_report_syndication_original_report.rb', line 47

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['id'] = 'id'
  @_hash['created_at'] = 'created_at'
  @_hash['type'] = 'type'
  @_hash['fraud_date'] = 'fraud_date'
  @_hash['event_date'] = 'event_date'
  @_hash
end

.nullablesObject

An array for nullable fields



63
64
65
66
67
68
# File 'lib/the_plaid_api/models/beacon_report_syndication_original_report.rb', line 63

def self.nullables
  %w[
    id
    fraud_date
  ]
end

.optionalsObject

An array for optional fields



58
59
60
# File 'lib/the_plaid_api/models/beacon_report_syndication_original_report.rb', line 58

def self.optionals
  []
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



125
126
127
128
129
130
# File 'lib/the_plaid_api/models/beacon_report_syndication_original_report.rb', line 125

def inspect
  class_name = self.class.name.split('::').last
  "<#{class_name} id: #{@id.inspect}, created_at: #{@created_at.inspect}, type:"\
  " #{@type.inspect}, fraud_date: #{@fraud_date.inspect}, event_date: #{@event_date.inspect},"\
  " additional_properties: #{@additional_properties}>"
end

#to_custom_created_atObject



112
113
114
# File 'lib/the_plaid_api/models/beacon_report_syndication_original_report.rb', line 112

def to_custom_created_at
  DateTimeHelper.to_rfc3339(created_at)
end

#to_sObject

Provides a human-readable string representation of the object.



117
118
119
120
121
122
# File 'lib/the_plaid_api/models/beacon_report_syndication_original_report.rb', line 117

def to_s
  class_name = self.class.name.split('::').last
  "<#{class_name} id: #{@id}, created_at: #{@created_at}, type: #{@type}, fraud_date:"\
  " #{@fraud_date}, event_date: #{@event_date}, additional_properties:"\
  " #{@additional_properties}>"
end