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, legal_entity_id: 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, 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, counterparty_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.
208 209 210 211 |
# File 'lib/modern_treasury/resources/internal_accounts.rb', line 208 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, legal_entity_id: 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
43 44 45 46 47 48 49 50 51 52 |
# File 'lib/modern_treasury/resources/internal_accounts.rb', line 43 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, 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
139 140 141 142 143 144 145 146 147 148 149 |
# File 'lib/modern_treasury/resources/internal_accounts.rb', line 139 def list(params = {}) parsed, = ModernTreasury::InternalAccountListParams.dump_request(params) @client.request( method: :get, path: "api/internal_accounts", query: parsed, page: ModernTreasury::Internal::Page, model: ModernTreasury::InternalAccount, options: ) end |
#request_closure(id, request_options: {}) ⇒ ModernTreasury::Models::InternalAccount
request closure of internal account
162 163 164 165 166 167 168 169 |
# File 'lib/modern_treasury/resources/internal_accounts.rb', line 162 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
65 66 67 68 69 70 71 72 |
# File 'lib/modern_treasury/resources/internal_accounts.rb', line 65 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, counterparty_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
98 99 100 101 102 103 104 105 106 107 |
# File 'lib/modern_treasury/resources/internal_accounts.rb', line 98 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
190 191 192 193 194 195 196 197 198 199 200 201 202 203 |
# File 'lib/modern_treasury/resources/internal_accounts.rb', line 190 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 |