Class: ThePlaidApi::IdentityMatchUser

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

Overview

The user’s legal name, phone number, email address and address used to perform fuzzy match. If Financial Account Matching is enabled in the Identity Verification product, leave this field empty to automatically match against PII collected from the Identity Verification checks.

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(legal_name: SKIP, phone_number: SKIP, email_address: SKIP, address: SKIP, additional_properties: nil) ⇒ IdentityMatchUser

Returns a new instance of IdentityMatchUser.



66
67
68
69
70
71
72
73
74
75
76
# File 'lib/the_plaid_api/models/identity_match_user.rb', line 66

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

  @legal_name = legal_name unless legal_name == SKIP
  @phone_number = phone_number unless phone_number == SKIP
  @email_address = email_address unless email_address == SKIP
  @address = address unless address == SKIP
  @additional_properties = additional_properties
end

Instance Attribute Details

#addressAddressDataNullableNoRequiredFields

Data about the components comprising an address.



34
35
36
# File 'lib/the_plaid_api/models/identity_match_user.rb', line 34

def address
  @address
end

#email_addressString

The user’s email address.

Returns:

  • (String)


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

def email_address
  @email_address
end

The user’s full legal name.

Returns:

  • (String)


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

def legal_name
  @legal_name
end

#phone_numberString

The user’s phone number, in E.164 format: {countrycode}{number}. For example: “14157452130”. Phone numbers provided in other formats will be parsed on a best-effort basis. 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)


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

def phone_number
  @phone_number
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
# File 'lib/the_plaid_api/models/identity_match_user.rb', line 79

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  legal_name = hash.key?('legal_name') ? hash['legal_name'] : SKIP
  phone_number = hash.key?('phone_number') ? hash['phone_number'] : SKIP
  email_address = hash.key?('email_address') ? hash['email_address'] : SKIP
  address = AddressDataNullableNoRequiredFields.from_hash(hash['address']) if hash['address']

  # 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.
  IdentityMatchUser.new(legal_name: legal_name,
                        phone_number: phone_number,
                        email_address: email_address,
                        address: address,
                        additional_properties: additional_properties)
end

.namesObject

A mapping from model property names to API property names.



37
38
39
40
41
42
43
44
# File 'lib/the_plaid_api/models/identity_match_user.rb', line 37

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['legal_name'] = 'legal_name'
  @_hash['phone_number'] = 'phone_number'
  @_hash['email_address'] = 'email_address'
  @_hash['address'] = 'address'
  @_hash
end

.nullablesObject

An array for nullable fields



57
58
59
60
61
62
63
64
# File 'lib/the_plaid_api/models/identity_match_user.rb', line 57

def self.nullables
  %w[
    legal_name
    phone_number
    email_address
    address
  ]
end

.optionalsObject

An array for optional fields



47
48
49
50
51
52
53
54
# File 'lib/the_plaid_api/models/identity_match_user.rb', line 47

def self.optionals
  %w[
    legal_name
    phone_number
    email_address
    address
  ]
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



112
113
114
115
116
117
# File 'lib/the_plaid_api/models/identity_match_user.rb', line 112

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

#to_sObject

Provides a human-readable string representation of the object.



104
105
106
107
108
109
# File 'lib/the_plaid_api/models/identity_match_user.rb', line 104

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