Class: Plaid::DepositSwitchTargetUser
- Defined in:
- lib/plaid/models/deposit_switch_target_user.rb
Overview
DepositSwitchTargetUser Model.
Instance Attribute Summary collapse
-
#address ⇒ DepositSwitchAddressData
The user’s address.
-
#email ⇒ String
The email address of the user.
-
#family_name ⇒ String
The family name (last name) of the user.
-
#given_name ⇒ String
The given name (first name) of the user.
-
#phone ⇒ String
The phone number of the user.
-
#tax_payer_id ⇒ String
The taxpayer ID of the user, generally their SSN, EIN, or TIN.
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(given_name:, family_name:, phone:, email:, address: SKIP, tax_payer_id: SKIP, additional_properties: nil) ⇒ DepositSwitchTargetUser
constructor
A new instance of DepositSwitchTargetUser.
-
#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(given_name:, family_name:, phone:, email:, address: SKIP, tax_payer_id: SKIP, additional_properties: nil) ⇒ DepositSwitchTargetUser
Returns a new instance of DepositSwitchTargetUser.
62 63 64 65 66 67 68 69 70 71 72 73 74 |
# File 'lib/plaid/models/deposit_switch_target_user.rb', line 62 def initialize(given_name:, family_name:, phone:, email:, address: SKIP, tax_payer_id: SKIP, additional_properties: nil) # Add additional model properties to the instance additional_properties = {} if additional_properties.nil? @given_name = given_name @family_name = family_name @phone = phone @email = email @address = address unless address == SKIP @tax_payer_id = tax_payer_id unless tax_payer_id == SKIP @additional_properties = additional_properties end |
Instance Attribute Details
#address ⇒ DepositSwitchAddressData
The user’s address.
31 32 33 |
# File 'lib/plaid/models/deposit_switch_target_user.rb', line 31 def address @address end |
#email ⇒ String
The email address of the user.
27 28 29 |
# File 'lib/plaid/models/deposit_switch_target_user.rb', line 27 def email @email end |
#family_name ⇒ String
The family name (last name) of the user.
18 19 20 |
# File 'lib/plaid/models/deposit_switch_target_user.rb', line 18 def family_name @family_name end |
#given_name ⇒ String
The given name (first name) of the user.
14 15 16 |
# File 'lib/plaid/models/deposit_switch_target_user.rb', line 14 def given_name @given_name end |
#phone ⇒ String
The phone number of the user. The endpoint can accept a variety of phone number formats, including E.164.
23 24 25 |
# File 'lib/plaid/models/deposit_switch_target_user.rb', line 23 def phone @phone end |
#tax_payer_id ⇒ String
The taxpayer ID of the user, generally their SSN, EIN, or TIN.
35 36 37 |
# File 'lib/plaid/models/deposit_switch_target_user.rb', line 35 def tax_payer_id @tax_payer_id end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 |
# File 'lib/plaid/models/deposit_switch_target_user.rb', line 77 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. given_name = hash.key?('given_name') ? hash['given_name'] : nil family_name = hash.key?('family_name') ? hash['family_name'] : nil phone = hash.key?('phone') ? hash['phone'] : nil email = hash.key?('email') ? hash['email'] : nil address = DepositSwitchAddressData.from_hash(hash['address']) if hash['address'] tax_payer_id = hash.key?('tax_payer_id') ? hash['tax_payer_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. DepositSwitchTargetUser.new(given_name: given_name, family_name: family_name, phone: phone, email: email, address: address, tax_payer_id: tax_payer_id, additional_properties: additional_properties) end |
.names ⇒ Object
A mapping from model property names to API property names.
38 39 40 41 42 43 44 45 46 47 |
# File 'lib/plaid/models/deposit_switch_target_user.rb', line 38 def self.names @_hash = {} if @_hash.nil? @_hash['given_name'] = 'given_name' @_hash['family_name'] = 'family_name' @_hash['phone'] = 'phone' @_hash['email'] = 'email' @_hash['address'] = 'address' @_hash['tax_payer_id'] = 'tax_payer_id' @_hash end |
.nullables ⇒ Object
An array for nullable fields
58 59 60 |
# File 'lib/plaid/models/deposit_switch_target_user.rb', line 58 def self.nullables [] end |
.optionals ⇒ Object
An array for optional fields
50 51 52 53 54 55 |
# File 'lib/plaid/models/deposit_switch_target_user.rb', line 50 def self.optionals %w[ address tax_payer_id ] end |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
114 115 116 117 118 119 |
# File 'lib/plaid/models/deposit_switch_target_user.rb', line 114 def inspect class_name = self.class.name.split('::').last "<#{class_name} given_name: #{@given_name.inspect}, family_name: #{@family_name.inspect},"\ " phone: #{@phone.inspect}, email: #{@email.inspect}, address: #{@address.inspect},"\ " tax_payer_id: #{@tax_payer_id.inspect}, additional_properties: #{@additional_properties}>" end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
106 107 108 109 110 111 |
# File 'lib/plaid/models/deposit_switch_target_user.rb', line 106 def to_s class_name = self.class.name.split('::').last "<#{class_name} given_name: #{@given_name}, family_name: #{@family_name}, phone: #{@phone},"\ " email: #{@email}, address: #{@address}, tax_payer_id: #{@tax_payer_id},"\ " additional_properties: #{@additional_properties}>" end |