Class: ThePlaidApi::BeaconUserGetResponse

Inherits:
BaseModel
  • Object
show all
Defined in:
lib/the_plaid_api/models/beacon_user_get_response.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:, request_id:, additional_properties: nil) ⇒ BeaconUserGetResponse

Returns a new instance of BeaconUserGetResponse.



102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
# File 'lib/the_plaid_api/models/beacon_user_get_response.rb', line 102

def initialize(item_ids:, id:, version:, created_at:, updated_at:, status:,
               program_id:, client_user_id:, user:, audit_trail:,
               request_id:, 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
  @request_id = request_id
  @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_get_response.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_get_response.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_get_response.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_get_response.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_get_response.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_get_response.rb', line 47

def program_id
  @program_id
end

#request_idString

A unique identifier for the request, which can be used for troubleshooting. This identifier, like all Plaid identifiers, is case sensitive.

Returns:

  • (String)


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

def request_id
  @request_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_get_response.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_get_response.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_get_response.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_get_response.rb', line 26

def version
  @version
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



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
155
156
157
158
159
160
161
162
163
164
# File 'lib/the_plaid_api/models/beacon_user_get_response.rb', line 123

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']
  request_id = hash.key?('request_id') ? hash['request_id'] : 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.
  BeaconUserGetResponse.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,
                            request_id: request_id,
                            additional_properties: additional_properties)
end

.namesObject

A mapping from model property names to API property names.



76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
# File 'lib/the_plaid_api/models/beacon_user_get_response.rb', line 76

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['request_id'] = 'request_id'
  @_hash
end

.nullablesObject

An array for nullable fields



98
99
100
# File 'lib/the_plaid_api/models/beacon_user_get_response.rb', line 98

def self.nullables
  []
end

.optionalsObject

An array for optional fields



93
94
95
# File 'lib/the_plaid_api/models/beacon_user_get_response.rb', line 93

def self.optionals
  []
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



185
186
187
188
189
190
191
192
193
# File 'lib/the_plaid_api/models/beacon_user_get_response.rb', line 185

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}, request_id: #{@request_id.inspect}, additional_properties:"\
  " #{@additional_properties}>"
end

#to_custom_created_atObject



166
167
168
# File 'lib/the_plaid_api/models/beacon_user_get_response.rb', line 166

def to_custom_created_at
  DateTimeHelper.to_rfc3339(created_at)
end

#to_custom_updated_atObject



170
171
172
# File 'lib/the_plaid_api/models/beacon_user_get_response.rb', line 170

def to_custom_updated_at
  DateTimeHelper.to_rfc3339(updated_at)
end

#to_sObject

Provides a human-readable string representation of the object.



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

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}, request_id: #{@request_id}, additional_properties:"\
  " #{@additional_properties}>"
end