Class: ThePlaidApi::BeaconUserRequestData
- Inherits:
-
BaseModel
- Object
- CoreLibrary::BaseModel
- BaseModel
- ThePlaidApi::BeaconUserRequestData
- Defined in:
- lib/the_plaid_api/models/beacon_user_request_data.rb
Overview
A Beacon User’s data which is used to check against duplicate records and the Beacon Fraud Network. In order to create a Beacon User, in addition to the ‘name`, either the `date_of_birth` or the `depository_accounts` field must be provided.
Instance Attribute Summary collapse
-
#address ⇒ BeaconUserRequestAddress
Home address for the associated user.
-
#date_of_birth ⇒ Date
A date in the format YYYY-MM-DD (RFC 3339 Section 5.6).
-
#depository_accounts ⇒ Array[BeaconUserRequestDepositoryAccount]
Provide a list of bank accounts that are associated with this Beacon User.
-
#email_address ⇒ String
A valid email address.
-
#id_number ⇒ BeaconUserIdNumber
The ID number associated with a Beacon User.
-
#ip_address ⇒ String
An IPv4 or IPV6 address.
-
#name ⇒ BeaconUserName
The full name for a given Beacon User.
-
#phone_number ⇒ String
A phone number in E.164 format.
Class Method Summary collapse
-
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
-
.names ⇒ Object
A mapping from model property names to API property names.
-
.nullables ⇒ Object
An array for nullable fields.
-
.optionals ⇒ Object
An array for optional fields.
Instance Method Summary collapse
-
#initialize(name:, date_of_birth: SKIP, address: SKIP, email_address: SKIP, phone_number: SKIP, id_number: SKIP, ip_address: SKIP, depository_accounts: SKIP, additional_properties: nil) ⇒ BeaconUserRequestData
constructor
A new instance of BeaconUserRequestData.
-
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
-
#to_s ⇒ Object
Provides a human-readable string representation of the object.
Methods inherited from BaseModel
#check_for_conflict, #process_additional_properties, #process_array, #process_basic_value, #process_hash, #to_hash, #to_json
Constructor Details
#initialize(name:, date_of_birth: SKIP, address: SKIP, email_address: SKIP, phone_number: SKIP, id_number: SKIP, ip_address: SKIP, depository_accounts: SKIP, additional_properties: nil) ⇒ BeaconUserRequestData
Returns a new instance of BeaconUserRequestData.
93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 |
# File 'lib/the_plaid_api/models/beacon_user_request_data.rb', line 93 def initialize(name:, date_of_birth: SKIP, address: SKIP, email_address: SKIP, phone_number: SKIP, id_number: SKIP, ip_address: SKIP, depository_accounts: SKIP, additional_properties: nil) # Add additional model properties to the instance additional_properties = {} if additional_properties.nil? @date_of_birth = date_of_birth unless date_of_birth == SKIP @name = name @address = address unless address == SKIP @email_address = email_address unless email_address == SKIP @phone_number = phone_number unless phone_number == SKIP @id_number = id_number unless id_number == SKIP @ip_address = ip_address unless ip_address == SKIP @depository_accounts = depository_accounts unless depository_accounts == SKIP @additional_properties = additional_properties end |
Instance Attribute Details
#address ⇒ BeaconUserRequestAddress
Home address for the associated user. For more context on this field, see [Input Validation by Country](plaid.com/docs/identity-verification/hybrid-input-validat ion/#input-validation-by-country).
28 29 30 |
# File 'lib/the_plaid_api/models/beacon_user_request_data.rb', line 28 def address @address end |
#date_of_birth ⇒ Date
A date in the format YYYY-MM-DD (RFC 3339 Section 5.6).
17 18 19 |
# File 'lib/the_plaid_api/models/beacon_user_request_data.rb', line 17 def date_of_birth @date_of_birth end |
#depository_accounts ⇒ Array[BeaconUserRequestDepositoryAccount]
Provide a list of bank accounts that are associated with this Beacon User. These accounts will be scanned across the Beacon Network and used to find duplicate records. Note: These accounts will not have Bank Account Insights. To receive Bank Account Insights please supply ‘access_tokens`.
54 55 56 |
# File 'lib/the_plaid_api/models/beacon_user_request_data.rb', line 54 def depository_accounts @depository_accounts end |
#email_address ⇒ String
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).
34 35 36 |
# File 'lib/the_plaid_api/models/beacon_user_request_data.rb', line 34 def email_address @email_address end |
#id_number ⇒ BeaconUserIdNumber
The ID number associated with a Beacon User.
42 43 44 |
# File 'lib/the_plaid_api/models/beacon_user_request_data.rb', line 42 def id_number @id_number end |
#ip_address ⇒ String
An IPv4 or IPV6 address.
46 47 48 |
# File 'lib/the_plaid_api/models/beacon_user_request_data.rb', line 46 def ip_address @ip_address end |
#name ⇒ BeaconUserName
The full name for a given Beacon User.
21 22 23 |
# File 'lib/the_plaid_api/models/beacon_user_request_data.rb', line 21 def name @name end |
#phone_number ⇒ String
A phone number in E.164 format.
38 39 40 |
# File 'lib/the_plaid_api/models/beacon_user_request_data.rb', line 38 def phone_number @phone_number end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
112 113 114 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 |
# File 'lib/the_plaid_api/models/beacon_user_request_data.rb', line 112 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. name = BeaconUserName.from_hash(hash['name']) if hash['name'] date_of_birth = hash.key?('date_of_birth') ? hash['date_of_birth'] : SKIP address = BeaconUserRequestAddress.from_hash(hash['address']) if hash['address'] email_address = hash.key?('email_address') ? hash['email_address'] : SKIP phone_number = hash.key?('phone_number') ? hash['phone_number'] : SKIP id_number = BeaconUserIdNumber.from_hash(hash['id_number']) if hash['id_number'] ip_address = hash.key?('ip_address') ? hash['ip_address'] : SKIP # Parameter is an array, so we need to iterate through it depository_accounts = nil unless hash['depository_accounts'].nil? depository_accounts = [] hash['depository_accounts'].each do |structure| depository_accounts << (BeaconUserRequestDepositoryAccount.from_hash(structure) if structure) end end depository_accounts = SKIP unless hash.key?('depository_accounts') # 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. BeaconUserRequestData.new(name: name, date_of_birth: date_of_birth, address: address, email_address: email_address, phone_number: phone_number, id_number: id_number, ip_address: ip_address, depository_accounts: depository_accounts, additional_properties: additional_properties) end |
.names ⇒ Object
A mapping from model property names to API property names.
57 58 59 60 61 62 63 64 65 66 67 68 |
# File 'lib/the_plaid_api/models/beacon_user_request_data.rb', line 57 def self.names @_hash = {} if @_hash.nil? @_hash['date_of_birth'] = 'date_of_birth' @_hash['name'] = 'name' @_hash['address'] = 'address' @_hash['email_address'] = 'email_address' @_hash['phone_number'] = 'phone_number' @_hash['id_number'] = 'id_number' @_hash['ip_address'] = 'ip_address' @_hash['depository_accounts'] = 'depository_accounts' @_hash end |
.nullables ⇒ Object
An array for nullable fields
84 85 86 87 88 89 90 91 |
# File 'lib/the_plaid_api/models/beacon_user_request_data.rb', line 84 def self.nullables %w[ address phone_number id_number ip_address ] end |
.optionals ⇒ Object
An array for optional fields
71 72 73 74 75 76 77 78 79 80 81 |
# File 'lib/the_plaid_api/models/beacon_user_request_data.rb', line 71 def self.optionals %w[ date_of_birth address email_address phone_number id_number ip_address depository_accounts ] end |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
163 164 165 166 167 168 169 170 |
# File 'lib/the_plaid_api/models/beacon_user_request_data.rb', line 163 def inspect class_name = self.class.name.split('::').last "<#{class_name} date_of_birth: #{@date_of_birth.inspect}, name: #{@name.inspect}, address:"\ " #{@address.inspect}, email_address: #{@email_address.inspect}, phone_number:"\ " #{@phone_number.inspect}, id_number: #{@id_number.inspect}, ip_address:"\ " #{@ip_address.inspect}, depository_accounts: #{@depository_accounts.inspect},"\ " additional_properties: #{@additional_properties}>" end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
154 155 156 157 158 159 160 |
# File 'lib/the_plaid_api/models/beacon_user_request_data.rb', line 154 def to_s class_name = self.class.name.split('::').last "<#{class_name} date_of_birth: #{@date_of_birth}, name: #{@name}, address: #{@address},"\ " email_address: #{@email_address}, phone_number: #{@phone_number}, id_number:"\ " #{@id_number}, ip_address: #{@ip_address}, depository_accounts: #{@depository_accounts},"\ " additional_properties: #{@additional_properties}>" end |