Class: ThePlaidApi::IdentityVerificationCreateRequestUser

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

Overview

User information collected outside of Link, most likely via your own onboarding process. Each of the following identity fields are optional: ‘email_address` `phone_number` `date_of_birth` `name` `address` `id_number` Specifically, these fields are optional in that they can either be fully provided (satisfying every required field in their subschema) or omitted from the request entirely by not providing the key or value. Providing these fields via the API will result in Link skipping the data collection process for the associated user. All verification steps enabled in the associated Identity Verification Template will still be run. Verification steps will either be run immediately, or once the user completes the `accept_tos` step, depending on the value provided to the `gave_consent` field. If you are not using the shareable URL feature, you can optionally provide these fields via `/link/token/create` instead; both `/identity_verification/create` and `/link/token/create` are valid ways to provide this information. Note that if you provide a non-`null` user data object via `/identity_verification/create`, any user data fields entered via `/link/token/create` for the same `client_user_id` will be ignored when prefilling Link.

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(email_address: SKIP, phone_number: SKIP, date_of_birth: SKIP, name: SKIP, address: SKIP, id_number: SKIP, client_user_id: SKIP, additional_properties: nil) ⇒ IdentityVerificationCreateRequestUser

Returns a new instance of IdentityVerificationCreateRequestUser.



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

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

  @email_address = email_address unless email_address == SKIP
  @phone_number = phone_number unless phone_number == SKIP
  @date_of_birth = date_of_birth unless date_of_birth == SKIP
  @name = name unless name == SKIP
  @address = address unless address == SKIP
  @id_number = id_number unless id_number == SKIP
  @client_user_id = client_user_id unless client_user_id == SKIP
  @additional_properties = additional_properties
end

Instance Attribute Details

#addressUserAddress

Home address for the user. Supported values are: not provided, address with only country code or full address. For more context on this field, see [Input Validation by Country](plaid.com/docs/identity-verification/hybrid-input-validat ion/#input-validation-by-country).

Returns:



55
56
57
# File 'lib/the_plaid_api/models/identity_verification_create_request_user.rb', line 55

def address
  @address
end

#client_user_idString

Specifying ‘user.client_user_id` is deprecated. Please provide `client_user_id` at the root level instead.

Returns:

  • (String)


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

def client_user_id
  @client_user_id
end

#date_of_birthDate

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

Returns:

  • (Date)


41
42
43
# File 'lib/the_plaid_api/models/identity_verification_create_request_user.rb', line 41

def date_of_birth
  @date_of_birth
end

#email_addressString

A valid email address. Must not have leading or trailing spaces and address must be RFC compliant. For more information, see [RFC 3696](datatracker.ietf.org/doc/html/rfc3696).

Returns:

  • (String)


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

def email_address
  @email_address
end

#id_numberUserIdNumber

ID number submitted by the user, currently used only for the Identity Verification product. If the user has not submitted this data yet, this field will be ‘null`. Otherwise, both fields are guaranteed to be filled.

Returns:



61
62
63
# File 'lib/the_plaid_api/models/identity_verification_create_request_user.rb', line 61

def id_number
  @id_number
end

#nameIdentityVerificationRequestUserName

You can use this field to pre-populate the user’s legal name; if it is provided here, they will not be prompted to enter their name in the identity verification attempt.



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

def name
  @name
end

#phone_numberString

A valid phone number in E.164 format.

Returns:

  • (String)


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

def phone_number
  @phone_number
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



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
# File 'lib/the_plaid_api/models/identity_verification_create_request_user.rb', line 122

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  email_address = hash.key?('email_address') ? hash['email_address'] : SKIP
  phone_number = hash.key?('phone_number') ? hash['phone_number'] : SKIP
  date_of_birth = hash.key?('date_of_birth') ? hash['date_of_birth'] : SKIP
  name = IdentityVerificationRequestUserName.from_hash(hash['name']) if hash['name']
  address = UserAddress.from_hash(hash['address']) if hash['address']
  id_number = UserIdNumber.from_hash(hash['id_number']) if hash['id_number']
  client_user_id =
    hash.key?('client_user_id') ? hash['client_user_id'] : SKIP

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

.namesObject

A mapping from model property names to API property names.



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

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

.nullablesObject

An array for nullable fields



95
96
97
98
99
100
101
102
103
# File 'lib/the_plaid_api/models/identity_verification_create_request_user.rb', line 95

def self.nullables
  %w[
    phone_number
    name
    address
    id_number
    client_user_id
  ]
end

.optionalsObject

An array for optional fields



82
83
84
85
86
87
88
89
90
91
92
# File 'lib/the_plaid_api/models/identity_verification_create_request_user.rb', line 82

def self.optionals
  %w[
    email_address
    phone_number
    date_of_birth
    name
    address
    id_number
    client_user_id
  ]
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



163
164
165
166
167
168
169
170
# File 'lib/the_plaid_api/models/identity_verification_create_request_user.rb', line 163

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

#to_sObject

Provides a human-readable string representation of the object.



154
155
156
157
158
159
160
# File 'lib/the_plaid_api/models/identity_verification_create_request_user.rb', line 154

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