Class: ThePlaidApi::LinkTokenCreateRequestUser

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

Overview

An object specifying information about the end user who will be linking their account. Required if ‘user_id` isn’t included.

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(client_user_id:, legal_name: SKIP, name: SKIP, phone_number: SKIP, phone_number_verified_time: SKIP, email_address: SKIP, email_address_verified_time: SKIP, ssn: SKIP, date_of_birth: SKIP, address: SKIP, id_number: SKIP, additional_properties: nil) ⇒ LinkTokenCreateRequestUser

Returns a new instance of LinkTokenCreateRequestUser.



151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
# File 'lib/the_plaid_api/models/link_token_create_request_user.rb', line 151

def initialize(client_user_id:, legal_name: SKIP, name: SKIP,
               phone_number: SKIP, phone_number_verified_time: SKIP,
               email_address: SKIP, email_address_verified_time: SKIP,
               ssn: SKIP, date_of_birth: SKIP, address: SKIP,
               id_number: SKIP, additional_properties: nil)
  # Add additional model properties to the instance
  additional_properties = {} if additional_properties.nil?

  @client_user_id = client_user_id
  @legal_name = legal_name unless legal_name == SKIP
  @name = name unless name == SKIP
  @phone_number = phone_number unless phone_number == SKIP
  unless phone_number_verified_time == SKIP
    @phone_number_verified_time =
      phone_number_verified_time
  end
  @email_address = email_address unless email_address == SKIP
  unless email_address_verified_time == SKIP
    @email_address_verified_time =
      email_address_verified_time
  end
  @ssn = ssn unless ssn == SKIP
  @date_of_birth = date_of_birth unless date_of_birth == SKIP
  @address = address unless address == SKIP
  @id_number = id_number unless id_number == SKIP
  @additional_properties = additional_properties
end

Instance Attribute Details

#addressAddress1

To be provided in the format “yyyy-mm-dd”. Can be used to prefill Link fields when used with Identity Verification.

Returns:



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

def address
  @address
end

#client_user_idString

A unique ID representing the end user. Typically this will be a user ID number from your application. Personally identifiable information, such as an email address or phone number, should not be used in the ‘client_user_id`. It is currently used as a means of searching logs for the given user in the Plaid Dashboard.

Returns:

  • (String)


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

def client_user_id
  @client_user_id
end

#date_of_birthDate

To be provided in the format “yyyy-mm-dd”. Can be used to prefill Link fields when used with Identity Verification.

Returns:

  • (Date)


94
95
96
# File 'lib/the_plaid_api/models/link_token_create_request_user.rb', line 94

def date_of_birth
  @date_of_birth
end

#email_addressString

The user’s email address. Can be used to prefill Link fields when used with [Identity Verification](plaid.com/docs/identity-verification).

Returns:

  • (String)


72
73
74
# File 'lib/the_plaid_api/models/link_token_create_request_user.rb', line 72

def email_address
  @email_address
end

#email_address_verified_timeDateTime

The date and time the email address was verified in [ISO 8601](wikipedia.org/wiki/ISO_8601) format (‘YYYY-MM-DDThh:mm:ssZ`). This was previously an optional field used in the [returning user experience](plaid.com/docs/link/returning-user). This field is no longer required to enable the returning user experience.

Only pass a verification time for an email address that you have

verified. If you have performed verification but don’t have the time, you may supply a signal value of the start of the UNIX epoch.

Example: `2020-01-01T00:00:00Z`

Returns:

  • (DateTime)


85
86
87
# File 'lib/the_plaid_api/models/link_token_create_request_user.rb', line 85

def email_address_verified_time
  @email_address_verified_time
end

#id_numberIdNumber

To be provided in the format “yyyy-mm-dd”. Can be used to prefill Link fields when used with Identity Verification.

Returns:



104
105
106
# File 'lib/the_plaid_api/models/link_token_create_request_user.rb', line 104

def id_number
  @id_number
end

The user’s full legal name, used for [micro-deposit based verification flows](plaid.com/docs/auth/coverage/). For a small number of customers on legacy flows, providing this field is required to enable micro-deposit-based flows. For all other customers, this field is optional. Providing the user’s name in this field when using micro-deposit-based verification will streamline the end user experience, as the user will not be prompted to enter their name during the Link flow; Plaid will use the provided legal name instead.

Returns:

  • (String)


31
32
33
# File 'lib/the_plaid_api/models/link_token_create_request_user.rb', line 31

def legal_name
  @legal_name
end

#nameName3

The user’s full legal name, used for [micro-deposit based verification flows](plaid.com/docs/auth/coverage/). For a small number of customers on legacy flows, providing this field is required to enable micro-deposit-based flows. For all other customers, this field is optional. Providing the user’s name in this field when using micro-deposit-based verification will streamline the end user experience, as the user will not be prompted to enter their name during the Link flow; Plaid will use the provided legal name instead.

Returns:



42
43
44
# File 'lib/the_plaid_api/models/link_token_create_request_user.rb', line 42

def name
  @name
end

#phone_numberString

The user’s phone number in [E.164](en.wikipedia.org/wiki/E.164) format. If supplied, will be used when applicable to prefill phone number fields in Link for the [returning user flow](plaid.com/docs/link/returning-user) and the [Identity Verification flow](plaid.com/docs/identity-verification). Phone number input is validated against valid number ranges; number strings that do not match a real-world phone numbering scheme may cause the request to fail, even in the Sandbox test environment.

Returns:

  • (String)


53
54
55
# File 'lib/the_plaid_api/models/link_token_create_request_user.rb', line 53

def phone_number
  @phone_number
end

#phone_number_verified_timeDateTime

The date and time the phone number was verified in [ISO 8601](wikipedia.org/wiki/ISO_8601) format (‘YYYY-MM-DDThh:mm:ssZ`). This was previously an optional field used in the [returning user experience](plaid.com/docs/link/returning-user). This field is no longer required to enable the returning user experience.

Only pass a verification time for a phone number that you have verified.

If you have performed verification but don’t have the time, you may supply a signal value of the start of the UNIX epoch.

Example: `2020-01-01T00:00:00Z`

Returns:

  • (DateTime)


66
67
68
# File 'lib/the_plaid_api/models/link_token_create_request_user.rb', line 66

def phone_number_verified_time
  @phone_number_verified_time
end

#ssnString

Deprecated and not currently used, use the ‘id_number` field instead.

Returns:

  • (String)


89
90
91
# File 'lib/the_plaid_api/models/link_token_create_request_user.rb', line 89

def ssn
  @ssn
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
# File 'lib/the_plaid_api/models/link_token_create_request_user.rb', line 180

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  client_user_id =
    hash.key?('client_user_id') ? hash['client_user_id'] : nil
  legal_name = hash.key?('legal_name') ? hash['legal_name'] : SKIP
  name = Name3.from_hash(hash['name']) if hash['name']
  phone_number = hash.key?('phone_number') ? hash['phone_number'] : SKIP
  phone_number_verified_time = if hash.key?('phone_number_verified_time')
                                 (DateTimeHelper.from_rfc3339(hash['phone_number_verified_time']) if hash['phone_number_verified_time'])
                               else
                                 SKIP
                               end
  email_address = hash.key?('email_address') ? hash['email_address'] : SKIP
  email_address_verified_time = if hash.key?('email_address_verified_time')
                                  (DateTimeHelper.from_rfc3339(hash['email_address_verified_time']) if hash['email_address_verified_time'])
                                else
                                  SKIP
                                end
  ssn = hash.key?('ssn') ? hash['ssn'] : SKIP
  date_of_birth = hash.key?('date_of_birth') ? hash['date_of_birth'] : SKIP
  address = Address1.from_hash(hash['address']) if hash['address']
  id_number = IdNumber.from_hash(hash['id_number']) if hash['id_number']

  # 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.
  LinkTokenCreateRequestUser.new(client_user_id: client_user_id,
                                 legal_name: legal_name,
                                 name: name,
                                 phone_number: phone_number,
                                 phone_number_verified_time: phone_number_verified_time,
                                 email_address: email_address,
                                 email_address_verified_time: email_address_verified_time,
                                 ssn: ssn,
                                 date_of_birth: date_of_birth,
                                 address: address,
                                 id_number: id_number,
                                 additional_properties: additional_properties)
end

.namesObject

A mapping from model property names to API property names.



107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
# File 'lib/the_plaid_api/models/link_token_create_request_user.rb', line 107

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['client_user_id'] = 'client_user_id'
  @_hash['legal_name'] = 'legal_name'
  @_hash['name'] = 'name'
  @_hash['phone_number'] = 'phone_number'
  @_hash['phone_number_verified_time'] = 'phone_number_verified_time'
  @_hash['email_address'] = 'email_address'
  @_hash['email_address_verified_time'] = 'email_address_verified_time'
  @_hash['ssn'] = 'ssn'
  @_hash['date_of_birth'] = 'date_of_birth'
  @_hash['address'] = 'address'
  @_hash['id_number'] = 'id_number'
  @_hash
end

.nullablesObject

An array for nullable fields



140
141
142
143
144
145
146
147
148
149
# File 'lib/the_plaid_api/models/link_token_create_request_user.rb', line 140

def self.nullables
  %w[
    name
    phone_number_verified_time
    email_address_verified_time
    date_of_birth
    address
    id_number
  ]
end

.optionalsObject

An array for optional fields



124
125
126
127
128
129
130
131
132
133
134
135
136
137
# File 'lib/the_plaid_api/models/link_token_create_request_user.rb', line 124

def self.optionals
  %w[
    legal_name
    name
    phone_number
    phone_number_verified_time
    email_address
    email_address_verified_time
    ssn
    date_of_birth
    address
    id_number
  ]
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



247
248
249
250
251
252
253
254
255
256
# File 'lib/the_plaid_api/models/link_token_create_request_user.rb', line 247

def inspect
  class_name = self.class.name.split('::').last
  "<#{class_name} client_user_id: #{@client_user_id.inspect}, legal_name:"\
  " #{@legal_name.inspect}, name: #{@name.inspect}, phone_number: #{@phone_number.inspect},"\
  " phone_number_verified_time: #{@phone_number_verified_time.inspect}, email_address:"\
  " #{@email_address.inspect}, email_address_verified_time:"\
  " #{@email_address_verified_time.inspect}, ssn: #{@ssn.inspect}, date_of_birth:"\
  " #{@date_of_birth.inspect}, address: #{@address.inspect}, id_number: #{@id_number.inspect},"\
  " additional_properties: #{@additional_properties}>"
end

#to_custom_email_address_verified_timeObject



231
232
233
# File 'lib/the_plaid_api/models/link_token_create_request_user.rb', line 231

def to_custom_email_address_verified_time
  DateTimeHelper.to_rfc3339(email_address_verified_time)
end

#to_custom_phone_number_verified_timeObject



227
228
229
# File 'lib/the_plaid_api/models/link_token_create_request_user.rb', line 227

def to_custom_phone_number_verified_time
  DateTimeHelper.to_rfc3339(phone_number_verified_time)
end

#to_sObject

Provides a human-readable string representation of the object.



236
237
238
239
240
241
242
243
244
# File 'lib/the_plaid_api/models/link_token_create_request_user.rb', line 236

def to_s
  class_name = self.class.name.split('::').last
  "<#{class_name} client_user_id: #{@client_user_id}, legal_name: #{@legal_name}, name:"\
  " #{@name}, phone_number: #{@phone_number}, phone_number_verified_time:"\
  " #{@phone_number_verified_time}, email_address: #{@email_address},"\
  " email_address_verified_time: #{@email_address_verified_time}, ssn: #{@ssn}, date_of_birth:"\
  " #{@date_of_birth}, address: #{@address}, id_number: #{@id_number}, additional_properties:"\
  " #{@additional_properties}>"
end