Class: ThePlaidApi::BeaconUser

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

Overview

A Beacon User represents an end user that has been scanned against the Beacon Network.

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(item_ids:, id:, version:, created_at:, updated_at:, status:, program_id:, client_user_id:, user:, audit_trail:, additional_properties: nil) ⇒ BeaconUser

Returns a new instance of BeaconUser.



95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
# File 'lib/the_plaid_api/models/beacon_user.rb', line 95

def initialize(item_ids:, id:, version:, created_at:, updated_at:, status:,
               program_id:, client_user_id:, user:, audit_trail:,
               additional_properties: nil)
  # Add additional model properties to the instance
  additional_properties = {} if additional_properties.nil?

  @item_ids = item_ids
  @id = id
  @version = version
  @created_at = created_at
  @updated_at = updated_at
  @status = status
  @program_id = program_id
  @client_user_id = client_user_id
  @user = user
  @audit_trail = audit_trail
  @additional_properties = additional_properties
end

Instance Attribute Details

#audit_trailBeaconAuditTrail

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

Returns:



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

def audit_trail
  @audit_trail
end

#client_user_idString

A unique ID that identifies the end user in your system. Either a ‘user_id` or the `client_user_id` must be provided. This ID can also be used to associate user-specific data from other Plaid products. Financial Account Matching requires this field and the `/link/token/create` `client_user_id` to be consistent. Personally identifiable information, such as an email address or phone number, should not be used in the `client_user_id`.

Returns:

  • (String)


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

def client_user_id
  @client_user_id
end

#created_atDateTime

An ISO8601 formatted timestamp.

Returns:

  • (DateTime)


30
31
32
# File 'lib/the_plaid_api/models/beacon_user.rb', line 30

def created_at
  @created_at
end

#idString

ID of the associated Beacon User.

Returns:

  • (String)


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

def id
  @id
end

#item_idsArray[String]

An array of Plaid Item IDs corresponding to the Accounts associated with this Beacon User.

Returns:

  • (Array[String])


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

def item_ids
  @item_ids
end

#program_idString

ID of the associated Beacon Program.

Returns:

  • (String)


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

def program_id
  @program_id
end

#statusBeaconUserStatus

A status of a Beacon User. ‘rejected`: The Beacon User has been rejected for fraud. Users can be automatically or manually rejected. `pending_review`: The Beacon User has been marked for review. `cleared`: The Beacon User has been cleared of fraud.

Returns:



43
44
45
# File 'lib/the_plaid_api/models/beacon_user.rb', line 43

def status
  @status
end

#updated_atDateTime

An ISO8601 formatted timestamp. This field indicates the last time the resource was modified.

Returns:

  • (DateTime)


35
36
37
# File 'lib/the_plaid_api/models/beacon_user.rb', line 35

def updated_at
  @updated_at
end

#userBeaconUserData

A Beacon User’s data and resulting analysis when checked against duplicate records and the Beacon Fraud Network.

Returns:



62
63
64
# File 'lib/the_plaid_api/models/beacon_user.rb', line 62

def user
  @user
end

#versionInteger

The ‘version` field begins with 1 and increments each time the user is updated.

Returns:

  • (Integer)


26
27
28
# File 'lib/the_plaid_api/models/beacon_user.rb', line 26

def version
  @version
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
# File 'lib/the_plaid_api/models/beacon_user.rb', line 115

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  item_ids = hash.key?('item_ids') ? hash['item_ids'] : nil
  id = hash.key?('id') ? hash['id'] : nil
  version = hash.key?('version') ? hash['version'] : nil
  created_at = if hash.key?('created_at')
                 (DateTimeHelper.from_rfc3339(hash['created_at']) if hash['created_at'])
               end
  updated_at = if hash.key?('updated_at')
                 (DateTimeHelper.from_rfc3339(hash['updated_at']) if hash['updated_at'])
               end
  status = hash.key?('status') ? hash['status'] : nil
  program_id = hash.key?('program_id') ? hash['program_id'] : nil
  client_user_id =
    hash.key?('client_user_id') ? hash['client_user_id'] : nil
  user = BeaconUserData.from_hash(hash['user']) if hash['user']
  audit_trail = BeaconAuditTrail.from_hash(hash['audit_trail']) if hash['audit_trail']

  # 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.
  BeaconUser.new(item_ids: item_ids,
                 id: id,
                 version: version,
                 created_at: created_at,
                 updated_at: updated_at,
                 status: status,
                 program_id: program_id,
                 client_user_id: client_user_id,
                 user: user,
                 audit_trail: audit_trail,
                 additional_properties: additional_properties)
end

.namesObject

A mapping from model property names to API property names.



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

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['item_ids'] = 'item_ids'
  @_hash['id'] = 'id'
  @_hash['version'] = 'version'
  @_hash['created_at'] = 'created_at'
  @_hash['updated_at'] = 'updated_at'
  @_hash['status'] = 'status'
  @_hash['program_id'] = 'program_id'
  @_hash['client_user_id'] = 'client_user_id'
  @_hash['user'] = 'user'
  @_hash['audit_trail'] = 'audit_trail'
  @_hash
end

.nullablesObject

An array for nullable fields



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

def self.nullables
  []
end

.optionalsObject

An array for optional fields



86
87
88
# File 'lib/the_plaid_api/models/beacon_user.rb', line 86

def self.optionals
  []
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



174
175
176
177
178
179
180
181
# File 'lib/the_plaid_api/models/beacon_user.rb', line 174

def inspect
  class_name = self.class.name.split('::').last
  "<#{class_name} item_ids: #{@item_ids.inspect}, id: #{@id.inspect}, version:"\
  " #{@version.inspect}, created_at: #{@created_at.inspect}, updated_at:"\
  " #{@updated_at.inspect}, status: #{@status.inspect}, program_id: #{@program_id.inspect},"\
  " client_user_id: #{@client_user_id.inspect}, user: #{@user.inspect}, audit_trail:"\
  " #{@audit_trail.inspect}, additional_properties: #{@additional_properties}>"
end

#to_custom_created_atObject



156
157
158
# File 'lib/the_plaid_api/models/beacon_user.rb', line 156

def to_custom_created_at
  DateTimeHelper.to_rfc3339(created_at)
end

#to_custom_updated_atObject



160
161
162
# File 'lib/the_plaid_api/models/beacon_user.rb', line 160

def to_custom_updated_at
  DateTimeHelper.to_rfc3339(updated_at)
end

#to_sObject

Provides a human-readable string representation of the object.



165
166
167
168
169
170
171
# File 'lib/the_plaid_api/models/beacon_user.rb', line 165

def to_s
  class_name = self.class.name.split('::').last
  "<#{class_name} item_ids: #{@item_ids}, id: #{@id}, version: #{@version}, created_at:"\
  " #{@created_at}, updated_at: #{@updated_at}, status: #{@status}, program_id:"\
  " #{@program_id}, client_user_id: #{@client_user_id}, user: #{@user}, audit_trail:"\
  " #{@audit_trail}, additional_properties: #{@additional_properties}>"
end