Class: ThePlaidApi::BeaconAuditTrail

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

Overview

Information about the last change made to the parent object specifying what caused the change as well as when it occurred.

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(source:, dashboard_user_id:, timestamp:, additional_properties: nil) ⇒ BeaconAuditTrail

Returns a new instance of BeaconAuditTrail.



60
61
62
63
64
65
66
67
68
69
# File 'lib/the_plaid_api/models/beacon_audit_trail.rb', line 60

def initialize(source:, dashboard_user_id:, timestamp:,
               additional_properties: nil)
  # Add additional model properties to the instance
  additional_properties = {} if additional_properties.nil?

  @source = source
  @dashboard_user_id = dashboard_user_id
  @timestamp = timestamp
  @additional_properties = additional_properties
end

Instance Attribute Details

#dashboard_user_idString

ID of the associated user. To retrieve the email address or other details of the person corresponding to this id, use ‘/dashboard_user/get`.

Returns:

  • (String)


33
34
35
# File 'lib/the_plaid_api/models/beacon_audit_trail.rb', line 33

def dashboard_user_id
  @dashboard_user_id
end

#sourceBeaconAuditTrailSource

A type indicating what caused a resource to be changed or updated. ‘dashboard` - The resource was created or updated by a member of your team via the Plaid dashboard. `api` - The resource was created or updated via the Plaid API. `system` - The resource was created or updated automatically by a part of the Plaid Beacon system. For example, if another business using Plaid Beacon created a fraud report that matched one of your users, your matching user’s status would automatically be updated and the audit trail source would be ‘system`. `bulk_import` - The resource was created or updated as part of a bulk import process. For example, if your company provided a CSV of user data as part of your initial onboarding, the audit trail source would be `bulk_import`.



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

def source
  @source
end

#timestampDateTime

An ISO8601 formatted timestamp.

Returns:

  • (DateTime)


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

def timestamp
  @timestamp
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
# File 'lib/the_plaid_api/models/beacon_audit_trail.rb', line 72

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  source = hash.key?('source') ? hash['source'] : nil
  dashboard_user_id =
    hash.key?('dashboard_user_id') ? hash['dashboard_user_id'] : nil
  timestamp = if hash.key?('timestamp')
                (DateTimeHelper.from_rfc3339(hash['timestamp']) if hash['timestamp'])
              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.
  BeaconAuditTrail.new(source: source,
                       dashboard_user_id: dashboard_user_id,
                       timestamp: timestamp,
                       additional_properties: additional_properties)
end

.namesObject

A mapping from model property names to API property names.



40
41
42
43
44
45
46
# File 'lib/the_plaid_api/models/beacon_audit_trail.rb', line 40

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['source'] = 'source'
  @_hash['dashboard_user_id'] = 'dashboard_user_id'
  @_hash['timestamp'] = 'timestamp'
  @_hash
end

.nullablesObject

An array for nullable fields



54
55
56
57
58
# File 'lib/the_plaid_api/models/beacon_audit_trail.rb', line 54

def self.nullables
  %w[
    dashboard_user_id
  ]
end

.optionalsObject

An array for optional fields



49
50
51
# File 'lib/the_plaid_api/models/beacon_audit_trail.rb', line 49

def self.optionals
  []
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



109
110
111
112
113
114
# File 'lib/the_plaid_api/models/beacon_audit_trail.rb', line 109

def inspect
  class_name = self.class.name.split('::').last
  "<#{class_name} source: #{@source.inspect}, dashboard_user_id:"\
  " #{@dashboard_user_id.inspect}, timestamp: #{@timestamp.inspect}, additional_properties:"\
  " #{@additional_properties}>"
end

#to_custom_timestampObject



97
98
99
# File 'lib/the_plaid_api/models/beacon_audit_trail.rb', line 97

def to_custom_timestamp
  DateTimeHelper.to_rfc3339(timestamp)
end

#to_sObject

Provides a human-readable string representation of the object.



102
103
104
105
106
# File 'lib/the_plaid_api/models/beacon_audit_trail.rb', line 102

def to_s
  class_name = self.class.name.split('::').last
  "<#{class_name} source: #{@source}, dashboard_user_id: #{@dashboard_user_id}, timestamp:"\
  " #{@timestamp}, additional_properties: #{@additional_properties}>"
end