Class: ModernTreasury::Resources::InternalAccounts
- Inherits:
-
Object
- Object
- ModernTreasury::Resources::InternalAccounts
- Defined in:
- lib/modern_treasury/resources/internal_accounts.rb,
lib/modern_treasury/resources/internal_accounts/balance_reports.rb
Defined Under Namespace
Classes: BalanceReports
Instance Attribute Summary collapse
Instance Method Summary collapse
-
#create(connection_id:, currency:, name:, party_name:, account_capabilities: nil, account_type: nil, counterparty_id: nil, external_id: nil, legal_entity_id: nil, metadata: nil, parent_account_id: nil, party_address: nil, vendor_attributes: nil, request_options: {}) ⇒ ModernTreasury::Models::InternalAccount
Some parameter documentations has been truncated, see Models::InternalAccountCreateParams for more details.
-
#initialize(client:) ⇒ InternalAccounts
constructor
private
A new instance of InternalAccounts.
-
#list(after_cursor: nil, counterparty_id: nil, currency: nil, external_id: nil, legal_entity_id: nil, metadata: nil, payment_direction: nil, payment_type: nil, per_page: nil, status: nil, request_options: {}) ⇒ ModernTreasury::Internal::Page<ModernTreasury::Models::InternalAccount>
Some parameter documentations has been truncated, see Models::InternalAccountListParams for more details.
-
#request_closure(id, request_options: {}) ⇒ ModernTreasury::Models::InternalAccount
request closure of internal account.
-
#retrieve(id, request_options: {}) ⇒ ModernTreasury::Models::InternalAccount
get internal account.
-
#update(id, contra_ledger_account_id: nil, counterparty_id: nil, external_id: nil, ledger_account_id: nil, metadata: nil, name: nil, parent_account_id: nil, request_options: {}) ⇒ ModernTreasury::Models::InternalAccount
Some parameter documentations has been truncated, see Models::InternalAccountUpdateParams for more details.
-
#update_account_capability(id, internal_account_id:, identifier:, request_options: {}) ⇒ ModernTreasury::Models::InternalAccountUpdateAccountCapabilityResponse
Some parameter documentations has been truncated, see Models::InternalAccountUpdateAccountCapabilityParams for more details.
Constructor Details
#initialize(client:) ⇒ InternalAccounts
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns a new instance of InternalAccounts.
219 220 221 222 |
# File 'lib/modern_treasury/resources/internal_accounts.rb', line 219 def initialize(client:) @client = client @balance_reports = ModernTreasury::Resources::InternalAccounts::BalanceReports.new(client: client) end |
Instance Attribute Details
#balance_reports ⇒ ModernTreasury::Resources::InternalAccounts::BalanceReports (readonly)
7 8 9 |
# File 'lib/modern_treasury/resources/internal_accounts.rb', line 7 def balance_reports @balance_reports end |
Instance Method Details
#create(connection_id:, currency:, name:, party_name:, account_capabilities: nil, account_type: nil, counterparty_id: nil, external_id: nil, legal_entity_id: nil, metadata: nil, parent_account_id: nil, party_address: nil, vendor_attributes: nil, request_options: {}) ⇒ ModernTreasury::Models::InternalAccount
Some parameter documentations has been truncated, see Models::InternalAccountCreateParams for more details.
create internal account
47 48 49 50 51 52 53 54 55 56 |
# File 'lib/modern_treasury/resources/internal_accounts.rb', line 47 def create(params) parsed, = ModernTreasury::InternalAccountCreateParams.dump_request(params) @client.request( method: :post, path: "api/internal_accounts", body: parsed, model: ModernTreasury::InternalAccount, options: ) end |
#list(after_cursor: nil, counterparty_id: nil, currency: nil, external_id: nil, legal_entity_id: nil, metadata: nil, payment_direction: nil, payment_type: nil, per_page: nil, status: nil, request_options: {}) ⇒ ModernTreasury::Internal::Page<ModernTreasury::Models::InternalAccount>
Some parameter documentations has been truncated, see Models::InternalAccountListParams for more details.
list internal accounts
149 150 151 152 153 154 155 156 157 158 159 160 |
# File 'lib/modern_treasury/resources/internal_accounts.rb', line 149 def list(params = {}) parsed, = ModernTreasury::InternalAccountListParams.dump_request(params) query = ModernTreasury::Internal::Util.encode_query_params(parsed) @client.request( method: :get, path: "api/internal_accounts", query: query, page: ModernTreasury::Internal::Page, model: ModernTreasury::InternalAccount, options: ) end |
#request_closure(id, request_options: {}) ⇒ ModernTreasury::Models::InternalAccount
request closure of internal account
173 174 175 176 177 178 179 180 |
# File 'lib/modern_treasury/resources/internal_accounts.rb', line 173 def request_closure(id, params = {}) @client.request( method: :post, path: ["api/internal_accounts/%1$s/request_closure", id], model: ModernTreasury::InternalAccount, options: params[:request_options] ) end |
#retrieve(id, request_options: {}) ⇒ ModernTreasury::Models::InternalAccount
get internal account
69 70 71 72 73 74 75 76 |
# File 'lib/modern_treasury/resources/internal_accounts.rb', line 69 def retrieve(id, params = {}) @client.request( method: :get, path: ["api/internal_accounts/%1$s", id], model: ModernTreasury::InternalAccount, options: params[:request_options] ) end |
#update(id, contra_ledger_account_id: nil, counterparty_id: nil, external_id: nil, ledger_account_id: nil, metadata: nil, name: nil, parent_account_id: nil, request_options: {}) ⇒ ModernTreasury::Models::InternalAccount
Some parameter documentations has been truncated, see Models::InternalAccountUpdateParams for more details.
update internal account
106 107 108 109 110 111 112 113 114 115 |
# File 'lib/modern_treasury/resources/internal_accounts.rb', line 106 def update(id, params = {}) parsed, = ModernTreasury::InternalAccountUpdateParams.dump_request(params) @client.request( method: :patch, path: ["api/internal_accounts/%1$s", id], body: parsed, model: ModernTreasury::InternalAccount, options: ) end |
#update_account_capability(id, internal_account_id:, identifier:, request_options: {}) ⇒ ModernTreasury::Models::InternalAccountUpdateAccountCapabilityResponse
Some parameter documentations has been truncated, see Models::InternalAccountUpdateAccountCapabilityParams for more details.
update account_capability
201 202 203 204 205 206 207 208 209 210 211 212 213 214 |
# File 'lib/modern_treasury/resources/internal_accounts.rb', line 201 def update_account_capability(id, params) parsed, = ModernTreasury::InternalAccountUpdateAccountCapabilityParams.dump_request(params) internal_account_id = parsed.delete(:internal_account_id) do raise ArgumentError.new("missing required path argument #{_1}") end @client.request( method: :patch, path: ["api/internal_accounts/%1$s/account_capabilities/%2$s", internal_account_id, id], body: parsed, model: ModernTreasury::Models::InternalAccountUpdateAccountCapabilityResponse, options: ) end |