Class: ModernTreasury::InternalAccountCreateRequest
- Inherits:
-
BaseModel
- Object
- CoreLibrary::BaseModel
- BaseModel
- ModernTreasury::InternalAccountCreateRequest
- Defined in:
- lib/modern_treasury/models/internal_account_create_request.rb
Overview
InternalAccountCreateRequest Model.
Instance Attribute Summary collapse
-
#connection_id ⇒ String
The identifier of the financial institution the account belongs to.
-
#counterparty_id ⇒ String
The Counterparty associated to this account.
-
#currency ⇒ Currency1
Either “USD” or “CAD”.
-
#name ⇒ String
The nickname of the account.
-
#parent_account_id ⇒ String
The parent internal account of this new account.
-
#party_address ⇒ PartyAddress
The address associated with the owner or null.
-
#party_name ⇒ String
The legal name of the entity which owns the account.
-
#vendor_attributes ⇒ Hash[String, String]
A hash of vendor specific attributes that will be used when creating the account at the vendor specified by the given connection.
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(connection_id:, name:, party_name:, currency:, party_address: SKIP, vendor_attributes: SKIP, parent_account_id: SKIP, counterparty_id: SKIP, additional_properties: nil) ⇒ InternalAccountCreateRequest
constructor
A new instance of InternalAccountCreateRequest.
-
#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(connection_id:, name:, party_name:, currency:, party_address: SKIP, vendor_attributes: SKIP, parent_account_id: SKIP, counterparty_id: SKIP, additional_properties: nil) ⇒ InternalAccountCreateRequest
Returns a new instance of InternalAccountCreateRequest.
75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 |
# File 'lib/modern_treasury/models/internal_account_create_request.rb', line 75 def initialize(connection_id:, name:, party_name:, currency:, party_address: SKIP, vendor_attributes: SKIP, parent_account_id: SKIP, counterparty_id: SKIP, additional_properties: nil) # Add additional model properties to the instance additional_properties = {} if additional_properties.nil? @connection_id = connection_id @name = name @party_name = party_name @party_address = party_address unless party_address == SKIP @currency = currency @vendor_attributes = vendor_attributes unless vendor_attributes == SKIP @parent_account_id = parent_account_id unless parent_account_id == SKIP @counterparty_id = counterparty_id unless counterparty_id == SKIP @additional_properties = additional_properties end |
Instance Attribute Details
#connection_id ⇒ String
The identifier of the financial institution the account belongs to.
14 15 16 |
# File 'lib/modern_treasury/models/internal_account_create_request.rb', line 14 def connection_id @connection_id end |
#counterparty_id ⇒ String
The Counterparty associated to this account.
44 45 46 |
# File 'lib/modern_treasury/models/internal_account_create_request.rb', line 44 def counterparty_id @counterparty_id end |
#currency ⇒ Currency1
Either “USD” or “CAD”. Internal accounts created at Increase only supports “USD”.
31 32 33 |
# File 'lib/modern_treasury/models/internal_account_create_request.rb', line 31 def currency @currency end |
#name ⇒ String
The nickname of the account.
18 19 20 |
# File 'lib/modern_treasury/models/internal_account_create_request.rb', line 18 def name @name end |
#parent_account_id ⇒ String
The parent internal account of this new account.
40 41 42 |
# File 'lib/modern_treasury/models/internal_account_create_request.rb', line 40 def parent_account_id @parent_account_id end |
#party_address ⇒ PartyAddress
The address associated with the owner or null.
26 27 28 |
# File 'lib/modern_treasury/models/internal_account_create_request.rb', line 26 def party_address @party_address end |
#party_name ⇒ String
The legal name of the entity which owns the account.
22 23 24 |
# File 'lib/modern_treasury/models/internal_account_create_request.rb', line 22 def party_name @party_name end |
#vendor_attributes ⇒ Hash[String, String]
A hash of vendor specific attributes that will be used when creating the account at the vendor specified by the given connection.
36 37 38 |
# File 'lib/modern_treasury/models/internal_account_create_request.rb', line 36 def vendor_attributes @vendor_attributes end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 |
# File 'lib/modern_treasury/models/internal_account_create_request.rb', line 94 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. connection_id = hash.key?('connection_id') ? hash['connection_id'] : nil name = hash.key?('name') ? hash['name'] : nil party_name = hash.key?('party_name') ? hash['party_name'] : nil currency = hash.key?('currency') ? hash['currency'] : nil party_address = PartyAddress.from_hash(hash['party_address']) if hash['party_address'] vendor_attributes = hash.key?('vendor_attributes') ? hash['vendor_attributes'] : SKIP parent_account_id = hash.key?('parent_account_id') ? hash['parent_account_id'] : SKIP counterparty_id = hash.key?('counterparty_id') ? hash['counterparty_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. InternalAccountCreateRequest.new(connection_id: connection_id, name: name, party_name: party_name, currency: currency, party_address: party_address, vendor_attributes: vendor_attributes, parent_account_id: parent_account_id, counterparty_id: counterparty_id, additional_properties: additional_properties) end |
.names ⇒ Object
A mapping from model property names to API property names.
47 48 49 50 51 52 53 54 55 56 57 58 |
# File 'lib/modern_treasury/models/internal_account_create_request.rb', line 47 def self.names @_hash = {} if @_hash.nil? @_hash['connection_id'] = 'connection_id' @_hash['name'] = 'name' @_hash['party_name'] = 'party_name' @_hash['party_address'] = 'party_address' @_hash['currency'] = 'currency' @_hash['vendor_attributes'] = 'vendor_attributes' @_hash['parent_account_id'] = 'parent_account_id' @_hash['counterparty_id'] = 'counterparty_id' @_hash end |
.nullables ⇒ Object
An array for nullable fields
71 72 73 |
# File 'lib/modern_treasury/models/internal_account_create_request.rb', line 71 def self.nullables [] end |
.optionals ⇒ Object
An array for optional fields
61 62 63 64 65 66 67 68 |
# File 'lib/modern_treasury/models/internal_account_create_request.rb', line 61 def self.optionals %w[ party_address vendor_attributes parent_account_id counterparty_id ] end |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
139 140 141 142 143 144 145 146 |
# File 'lib/modern_treasury/models/internal_account_create_request.rb', line 139 def inspect class_name = self.class.name.split('::').last "<#{class_name} connection_id: #{@connection_id.inspect}, name: #{@name.inspect},"\ " party_name: #{@party_name.inspect}, party_address: #{@party_address.inspect}, currency:"\ " #{@currency.inspect}, vendor_attributes: #{@vendor_attributes.inspect}, parent_account_id:"\ " #{@parent_account_id.inspect}, counterparty_id: #{@counterparty_id.inspect},"\ " additional_properties: #{@additional_properties}>" end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
130 131 132 133 134 135 136 |
# File 'lib/modern_treasury/models/internal_account_create_request.rb', line 130 def to_s class_name = self.class.name.split('::').last "<#{class_name} connection_id: #{@connection_id}, name: #{@name}, party_name:"\ " #{@party_name}, party_address: #{@party_address}, currency: #{@currency},"\ " vendor_attributes: #{@vendor_attributes}, parent_account_id: #{@parent_account_id},"\ " counterparty_id: #{@counterparty_id}, additional_properties: #{@additional_properties}>" end |