Class: ThePlaidApi::WalletTransactionCounterparty
- Inherits:
-
BaseModel
- Object
- CoreLibrary::BaseModel
- BaseModel
- ThePlaidApi::WalletTransactionCounterparty
- Defined in:
- lib/the_plaid_api/models/wallet_transaction_counterparty.rb
Overview
An object representing the e-wallet transaction’s counterparty
Instance Attribute Summary collapse
-
#address ⇒ PaymentInitiationAddress
The optional address of the payment recipient’s bank account.
-
#date_of_birth ⇒ Date
The counterparty’s birthdate, in [ISO 8601](wikipedia.org/wiki/ISO_8601) (YYYY-MM-DD) format.
-
#name ⇒ String
The name of the counterparty.
-
#numbers ⇒ WalletTransactionCounterpartyNumbers
The counterparty’s bank account numbers.
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:, numbers:, address: SKIP, date_of_birth: SKIP, additional_properties: nil) ⇒ WalletTransactionCounterparty
constructor
A new instance of WalletTransactionCounterparty.
-
#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:, numbers:, address: SKIP, date_of_birth: SKIP, additional_properties: nil) ⇒ WalletTransactionCounterparty
Returns a new instance of WalletTransactionCounterparty.
57 58 59 60 61 62 63 64 65 66 67 |
# File 'lib/the_plaid_api/models/wallet_transaction_counterparty.rb', line 57 def initialize(name:, numbers:, address: SKIP, date_of_birth: SKIP, additional_properties: nil) # Add additional model properties to the instance additional_properties = {} if additional_properties.nil? @name = name @numbers = numbers @address = address unless address == SKIP @date_of_birth = date_of_birth unless date_of_birth == SKIP @additional_properties = additional_properties end |
Instance Attribute Details
#address ⇒ PaymentInitiationAddress
The optional address of the payment recipient’s bank account. Required by most institutions outside of the UK.
24 25 26 |
# File 'lib/the_plaid_api/models/wallet_transaction_counterparty.rb', line 24 def address @address end |
#date_of_birth ⇒ Date
The counterparty’s birthdate, in [ISO 8601](wikipedia.org/wiki/ISO_8601) (YYYY-MM-DD) format.
29 30 31 |
# File 'lib/the_plaid_api/models/wallet_transaction_counterparty.rb', line 29 def date_of_birth @date_of_birth end |
#name ⇒ String
The name of the counterparty
14 15 16 |
# File 'lib/the_plaid_api/models/wallet_transaction_counterparty.rb', line 14 def name @name end |
#numbers ⇒ WalletTransactionCounterpartyNumbers
The counterparty’s bank account numbers. Exactly one of IBAN or BACS data is required.
19 20 21 |
# File 'lib/the_plaid_api/models/wallet_transaction_counterparty.rb', line 19 def numbers @numbers end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 |
# File 'lib/the_plaid_api/models/wallet_transaction_counterparty.rb', line 70 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. name = hash.key?('name') ? hash['name'] : nil numbers = WalletTransactionCounterpartyNumbers.from_hash(hash['numbers']) if hash['numbers'] address = PaymentInitiationAddress.from_hash(hash['address']) if hash['address'] date_of_birth = hash.key?('date_of_birth') ? hash['date_of_birth'] : 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. WalletTransactionCounterparty.new(name: name, numbers: numbers, address: address, date_of_birth: date_of_birth, additional_properties: additional_properties) end |
.names ⇒ Object
A mapping from model property names to API property names.
32 33 34 35 36 37 38 39 |
# File 'lib/the_plaid_api/models/wallet_transaction_counterparty.rb', line 32 def self.names @_hash = {} if @_hash.nil? @_hash['name'] = 'name' @_hash['numbers'] = 'numbers' @_hash['address'] = 'address' @_hash['date_of_birth'] = 'date_of_birth' @_hash end |
.nullables ⇒ Object
An array for nullable fields
50 51 52 53 54 55 |
# File 'lib/the_plaid_api/models/wallet_transaction_counterparty.rb', line 50 def self.nullables %w[ address date_of_birth ] end |
.optionals ⇒ Object
An array for optional fields
42 43 44 45 46 47 |
# File 'lib/the_plaid_api/models/wallet_transaction_counterparty.rb', line 42 def self.optionals %w[ address date_of_birth ] end |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
102 103 104 105 106 107 |
# File 'lib/the_plaid_api/models/wallet_transaction_counterparty.rb', line 102 def inspect class_name = self.class.name.split('::').last "<#{class_name} name: #{@name.inspect}, numbers: #{@numbers.inspect}, address:"\ " #{@address.inspect}, date_of_birth: #{@date_of_birth.inspect}, additional_properties:"\ " #{@additional_properties}>" end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
95 96 97 98 99 |
# File 'lib/the_plaid_api/models/wallet_transaction_counterparty.rb', line 95 def to_s class_name = self.class.name.split('::').last "<#{class_name} name: #{@name}, numbers: #{@numbers}, address: #{@address}, date_of_birth:"\ " #{@date_of_birth}, additional_properties: #{@additional_properties}>" end |