Class: ModernTreasury::ReceivingAccount1
- Inherits:
-
BaseModel
- Object
- CoreLibrary::BaseModel
- BaseModel
- ModernTreasury::ReceivingAccount1
- Defined in:
- lib/modern_treasury/models/receiving_account1.rb
Overview
Either ‘receiving_account` or `receiving_account_id` must be present. When using `receiving_account_id`, you may pass the id of an external account or an internal account.
Instance Attribute Summary collapse
-
#account_details ⇒ Array[AccountDetail1]
A nickname for the external account.
-
#account_type ⇒ AccountType
Can be ‘checking`, `savings` or `other`.
-
#contact_details ⇒ Array[ContactDetailCreateRequest]
If you’ve enabled the Modern Treasury + Plaid integration in your Plaid account, you can pass the processor token in this field.
-
#ledger_account ⇒ LedgerAccountCreateRequest
If this value isn’t provided, it will be inherited from the counterparty’s name.
-
#metadata ⇒ Hash[String, String]
Additional data represented as key-value pairs.
-
#name ⇒ String
A nickname for the external account.
-
#party_address ⇒ AddressRequest
Either ‘individual` or `business`.
-
#party_identifier ⇒ String
If this value isn’t provided, it will be inherited from the counterparty’s name.
-
#party_name ⇒ String
If this value isn’t provided, it will be inherited from the counterparty’s name.
-
#party_type ⇒ PartyType
Either ‘individual` or `business`.
-
#plaid_processor_token ⇒ String
If you’ve enabled the Modern Treasury + Plaid integration in your Plaid account, you can pass the processor token in this field.
-
#routing_details ⇒ Array[RoutingDetail1]
A nickname for the external account.
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(account_type: SKIP, party_type: SKIP, party_address: SKIP, name: SKIP, account_details: SKIP, routing_details: SKIP, metadata: SKIP, party_name: SKIP, party_identifier: SKIP, ledger_account: SKIP, plaid_processor_token: SKIP, contact_details: SKIP, additional_properties: nil) ⇒ ReceivingAccount1
constructor
A new instance of ReceivingAccount1.
-
#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(account_type: SKIP, party_type: SKIP, party_address: SKIP, name: SKIP, account_details: SKIP, routing_details: SKIP, metadata: SKIP, party_name: SKIP, party_identifier: SKIP, ledger_account: SKIP, plaid_processor_token: SKIP, contact_details: SKIP, additional_properties: nil) ⇒ ReceivingAccount1
Returns a new instance of ReceivingAccount1.
115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 |
# File 'lib/modern_treasury/models/receiving_account1.rb', line 115 def initialize(account_type: SKIP, party_type: SKIP, party_address: SKIP, name: SKIP, account_details: SKIP, routing_details: SKIP, metadata: SKIP, party_name: SKIP, party_identifier: SKIP, ledger_account: SKIP, plaid_processor_token: SKIP, contact_details: SKIP, additional_properties: nil) # Add additional model properties to the instance additional_properties = {} if additional_properties.nil? @account_type = account_type unless account_type == SKIP @party_type = party_type unless party_type == SKIP @party_address = party_address unless party_address == SKIP @name = name unless name == SKIP @account_details = account_details unless account_details == SKIP @routing_details = routing_details unless routing_details == SKIP @metadata = unless == SKIP @party_name = party_name unless party_name == SKIP @party_identifier = party_identifier unless party_identifier == SKIP @ledger_account = ledger_account unless ledger_account == SKIP @plaid_processor_token = plaid_processor_token unless plaid_processor_token == SKIP @contact_details = contact_details unless contact_details == SKIP @additional_properties = additional_properties end |
Instance Attribute Details
#account_details ⇒ Array[AccountDetail1]
A nickname for the external account. This is only for internal usage and won’t affect any payments
34 35 36 |
# File 'lib/modern_treasury/models/receiving_account1.rb', line 34 def account_details @account_details end |
#account_type ⇒ AccountType
Can be ‘checking`, `savings` or `other`.
16 17 18 |
# File 'lib/modern_treasury/models/receiving_account1.rb', line 16 def account_type @account_type end |
#contact_details ⇒ Array[ContactDetailCreateRequest]
If you’ve enabled the Modern Treasury + Plaid integration in your Plaid account, you can pass the processor token in this field.
69 70 71 |
# File 'lib/modern_treasury/models/receiving_account1.rb', line 69 def contact_details @contact_details end |
#ledger_account ⇒ LedgerAccountCreateRequest
If this value isn’t provided, it will be inherited from the counterparty’s name.
59 60 61 |
# File 'lib/modern_treasury/models/receiving_account1.rb', line 59 def ledger_account @ledger_account end |
#metadata ⇒ Hash[String, String]
Additional data represented as key-value pairs. Both the key and value must be strings.
44 45 46 |
# File 'lib/modern_treasury/models/receiving_account1.rb', line 44 def @metadata end |
#name ⇒ String
A nickname for the external account. This is only for internal usage and won’t affect any payments
29 30 31 |
# File 'lib/modern_treasury/models/receiving_account1.rb', line 29 def name @name end |
#party_address ⇒ AddressRequest
Either ‘individual` or `business`.
24 25 26 |
# File 'lib/modern_treasury/models/receiving_account1.rb', line 24 def party_address @party_address end |
#party_identifier ⇒ String
If this value isn’t provided, it will be inherited from the counterparty’s name.
54 55 56 |
# File 'lib/modern_treasury/models/receiving_account1.rb', line 54 def party_identifier @party_identifier end |
#party_name ⇒ String
If this value isn’t provided, it will be inherited from the counterparty’s name.
49 50 51 |
# File 'lib/modern_treasury/models/receiving_account1.rb', line 49 def party_name @party_name end |
#party_type ⇒ PartyType
Either ‘individual` or `business`.
20 21 22 |
# File 'lib/modern_treasury/models/receiving_account1.rb', line 20 def party_type @party_type end |
#plaid_processor_token ⇒ String
If you’ve enabled the Modern Treasury + Plaid integration in your Plaid account, you can pass the processor token in this field.
64 65 66 |
# File 'lib/modern_treasury/models/receiving_account1.rb', line 64 def plaid_processor_token @plaid_processor_token end |
#routing_details ⇒ Array[RoutingDetail1]
A nickname for the external account. This is only for internal usage and won’t affect any payments
39 40 41 |
# File 'lib/modern_treasury/models/receiving_account1.rb', line 39 def routing_details @routing_details end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 |
# File 'lib/modern_treasury/models/receiving_account1.rb', line 139 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. account_type = hash.key?('account_type') ? hash['account_type'] : SKIP party_type = hash.key?('party_type') ? hash['party_type'] : SKIP party_address = AddressRequest.from_hash(hash['party_address']) if hash['party_address'] name = hash.key?('name') ? hash['name'] : SKIP # Parameter is an array, so we need to iterate through it account_details = nil unless hash['account_details'].nil? account_details = [] hash['account_details'].each do |structure| account_details << (AccountDetail1.from_hash(structure) if structure) end end account_details = SKIP unless hash.key?('account_details') # Parameter is an array, so we need to iterate through it routing_details = nil unless hash['routing_details'].nil? routing_details = [] hash['routing_details'].each do |structure| routing_details << (RoutingDetail1.from_hash(structure) if structure) end end routing_details = SKIP unless hash.key?('routing_details') = hash.key?('metadata') ? hash['metadata'] : SKIP party_name = hash.key?('party_name') ? hash['party_name'] : SKIP party_identifier = hash.key?('party_identifier') ? hash['party_identifier'] : SKIP ledger_account = LedgerAccountCreateRequest.from_hash(hash['ledger_account']) if hash['ledger_account'] plaid_processor_token = hash.key?('plaid_processor_token') ? hash['plaid_processor_token'] : SKIP # Parameter is an array, so we need to iterate through it contact_details = nil unless hash['contact_details'].nil? contact_details = [] hash['contact_details'].each do |structure| contact_details << (ContactDetailCreateRequest.from_hash(structure) if structure) end end contact_details = SKIP unless hash.key?('contact_details') # 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. ReceivingAccount1.new(account_type: account_type, party_type: party_type, party_address: party_address, name: name, account_details: account_details, routing_details: routing_details, metadata: , party_name: party_name, party_identifier: party_identifier, ledger_account: ledger_account, plaid_processor_token: plaid_processor_token, contact_details: contact_details, additional_properties: additional_properties) end |
.names ⇒ Object
A mapping from model property names to API property names.
72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 |
# File 'lib/modern_treasury/models/receiving_account1.rb', line 72 def self.names @_hash = {} if @_hash.nil? @_hash['account_type'] = 'account_type' @_hash['party_type'] = 'party_type' @_hash['party_address'] = 'party_address' @_hash['name'] = 'name' @_hash['account_details'] = 'account_details' @_hash['routing_details'] = 'routing_details' @_hash['metadata'] = 'metadata' @_hash['party_name'] = 'party_name' @_hash['party_identifier'] = 'party_identifier' @_hash['ledger_account'] = 'ledger_account' @_hash['plaid_processor_token'] = 'plaid_processor_token' @_hash['contact_details'] = 'contact_details' @_hash end |
.nullables ⇒ Object
An array for nullable fields
108 109 110 111 112 113 |
# File 'lib/modern_treasury/models/receiving_account1.rb', line 108 def self.nullables %w[ party_type name ] end |
.optionals ⇒ Object
An array for optional fields
90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 |
# File 'lib/modern_treasury/models/receiving_account1.rb', line 90 def self.optionals %w[ account_type party_type party_address name account_details routing_details metadata party_name party_identifier ledger_account plaid_processor_token contact_details ] end |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
221 222 223 224 225 226 227 228 229 230 |
# File 'lib/modern_treasury/models/receiving_account1.rb', line 221 def inspect class_name = self.class.name.split('::').last "<#{class_name} account_type: #{@account_type.inspect}, party_type: #{@party_type.inspect},"\ " party_address: #{@party_address.inspect}, name: #{@name.inspect}, account_details:"\ " #{@account_details.inspect}, routing_details: #{@routing_details.inspect}, metadata:"\ " #{@metadata.inspect}, party_name: #{@party_name.inspect}, party_identifier:"\ " #{@party_identifier.inspect}, ledger_account: #{@ledger_account.inspect},"\ " plaid_processor_token: #{@plaid_processor_token.inspect}, contact_details:"\ " #{@contact_details.inspect}, additional_properties: #{@additional_properties}>" end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
210 211 212 213 214 215 216 217 218 |
# File 'lib/modern_treasury/models/receiving_account1.rb', line 210 def to_s class_name = self.class.name.split('::').last "<#{class_name} account_type: #{@account_type}, party_type: #{@party_type}, party_address:"\ " #{@party_address}, name: #{@name}, account_details: #{@account_details}, routing_details:"\ " #{@routing_details}, metadata: #{@metadata}, party_name: #{@party_name}, party_identifier:"\ " #{@party_identifier}, ledger_account: #{@ledger_account}, plaid_processor_token:"\ " #{@plaid_processor_token}, contact_details: #{@contact_details}, additional_properties:"\ " #{@additional_properties}>" end |