Class: ThePlaidApi::TransferUserInRequest

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

Overview

The legal name and other information for the account holder.

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

Returns a new instance of TransferUserInRequest.



55
56
57
58
59
60
61
62
63
64
65
# File 'lib/the_plaid_api/models/transfer_user_in_request.rb', line 55

def initialize(legal_name:, 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
  @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

#addressTransferUserAddressInRequest

The address associated with the account holder.



29
30
31
# File 'lib/the_plaid_api/models/transfer_user_in_request.rb', line 29

def address
  @address
end

#email_addressString

The user’s email address.

Returns:

  • (String)


25
26
27
# File 'lib/the_plaid_api/models/transfer_user_in_request.rb', line 25

def email_address
  @email_address
end

The user’s legal name.

Returns:

  • (String)


14
15
16
# File 'lib/the_plaid_api/models/transfer_user_in_request.rb', line 14

def legal_name
  @legal_name
end

#phone_numberString

The user’s phone number. Phone number input may be 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)


21
22
23
# File 'lib/the_plaid_api/models/transfer_user_in_request.rb', line 21

def phone_number
  @phone_number
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
# File 'lib/the_plaid_api/models/transfer_user_in_request.rb', line 68

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  legal_name = hash.key?('legal_name') ? hash['legal_name'] : nil
  phone_number = hash.key?('phone_number') ? hash['phone_number'] : SKIP
  email_address = hash.key?('email_address') ? hash['email_address'] : SKIP
  address = TransferUserAddressInRequest.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.
  TransferUserInRequest.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.



32
33
34
35
36
37
38
39
# File 'lib/the_plaid_api/models/transfer_user_in_request.rb', line 32

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



51
52
53
# File 'lib/the_plaid_api/models/transfer_user_in_request.rb', line 51

def self.nullables
  []
end

.optionalsObject

An array for optional fields



42
43
44
45
46
47
48
# File 'lib/the_plaid_api/models/transfer_user_in_request.rb', line 42

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

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



101
102
103
104
105
106
# File 'lib/the_plaid_api/models/transfer_user_in_request.rb', line 101

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.



93
94
95
96
97
98
# File 'lib/the_plaid_api/models/transfer_user_in_request.rb', line 93

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