Class: ModernTreasury::Resources::LedgerAccounts
- Inherits:
-
Object
- Object
- ModernTreasury::Resources::LedgerAccounts
- Defined in:
- lib/modern_treasury/resources/ledger_accounts.rb
Instance Method Summary collapse
-
#create(currency: , ledger_id: , name: , normal_balance: , currency_exponent: nil, description: nil, ledger_account_category_ids: nil, ledgerable_id: nil, ledgerable_type: nil, metadata: nil, request_options: {}) ⇒ ModernTreasury::Models::LedgerAccount
Some parameter documentations has been truncated, see Models::LedgerAccountCreateParams for more details.
-
#delete(id, request_options: {}) ⇒ ModernTreasury::Models::LedgerAccount
Delete a ledger account.
-
#initialize(client:) ⇒ LedgerAccounts
constructor
private
A new instance of LedgerAccounts.
-
#list(id: nil, after_cursor: nil, available_balance_amount: nil, balances: nil, created_at: nil, currency: nil, external_id: nil, ledger_account_category_id: nil, ledger_id: nil, metadata: nil, name: nil, normal_balance: nil, pending_balance_amount: nil, per_page: nil, posted_balance_amount: nil, updated_at: nil, request_options: {}) ⇒ ModernTreasury::Internal::Page<ModernTreasury::Models::LedgerAccount>
Some parameter documentations has been truncated, see Models::LedgerAccountListParams for more details.
-
#retrieve(id, balances: nil, request_options: {}) ⇒ ModernTreasury::Models::LedgerAccount
Some parameter documentations has been truncated, see Models::LedgerAccountRetrieveParams for more details.
-
#update(id, description: nil, metadata: nil, name: nil, request_options: {}) ⇒ ModernTreasury::Models::LedgerAccount
Some parameter documentations has been truncated, see Models::LedgerAccountUpdateParams for more details.
Constructor Details
#initialize(client:) ⇒ LedgerAccounts
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 LedgerAccounts.
186 187 188 |
# File 'lib/modern_treasury/resources/ledger_accounts.rb', line 186 def initialize(client:) @client = client end |
Instance Method Details
#create(currency: , ledger_id: , name: , normal_balance: , currency_exponent: nil, description: nil, ledger_account_category_ids: nil, ledgerable_id: nil, ledgerable_type: nil, metadata: nil, request_options: {}) ⇒ ModernTreasury::Models::LedgerAccount
Some parameter documentations has been truncated, see Models::LedgerAccountCreateParams for more details.
Create a ledger account.
38 39 40 41 42 43 44 45 46 47 |
# File 'lib/modern_treasury/resources/ledger_accounts.rb', line 38 def create(params) parsed, = ModernTreasury::LedgerAccountCreateParams.dump_request(params) @client.request( method: :post, path: "api/ledger_accounts", body: parsed, model: ModernTreasury::LedgerAccount, options: ) end |
#delete(id, request_options: {}) ⇒ ModernTreasury::Models::LedgerAccount
Delete a ledger account.
174 175 176 177 178 179 180 181 |
# File 'lib/modern_treasury/resources/ledger_accounts.rb', line 174 def delete(id, params = {}) @client.request( method: :delete, path: ["api/ledger_accounts/%1$s", id], model: ModernTreasury::LedgerAccount, options: params[:request_options] ) end |
#list(id: nil, after_cursor: nil, available_balance_amount: nil, balances: nil, created_at: nil, currency: nil, external_id: nil, ledger_account_category_id: nil, ledger_id: nil, metadata: nil, name: nil, normal_balance: nil, pending_balance_amount: nil, per_page: nil, posted_balance_amount: nil, updated_at: nil, request_options: {}) ⇒ ModernTreasury::Internal::Page<ModernTreasury::Models::LedgerAccount>
Some parameter documentations has been truncated, see Models::LedgerAccountListParams for more details.
Get a list of ledger accounts.
151 152 153 154 155 156 157 158 159 160 161 |
# File 'lib/modern_treasury/resources/ledger_accounts.rb', line 151 def list(params = {}) parsed, = ModernTreasury::LedgerAccountListParams.dump_request(params) @client.request( method: :get, path: "api/ledger_accounts", query: parsed, page: ModernTreasury::Internal::Page, model: ModernTreasury::LedgerAccount, options: ) end |
#retrieve(id, balances: nil, request_options: {}) ⇒ ModernTreasury::Models::LedgerAccount
Some parameter documentations has been truncated, see Models::LedgerAccountRetrieveParams for more details.
Get details on a single ledger account.
65 66 67 68 69 70 71 72 73 74 |
# File 'lib/modern_treasury/resources/ledger_accounts.rb', line 65 def retrieve(id, params = {}) parsed, = ModernTreasury::LedgerAccountRetrieveParams.dump_request(params) @client.request( method: :get, path: ["api/ledger_accounts/%1$s", id], query: parsed, model: ModernTreasury::LedgerAccount, options: ) end |
#update(id, description: nil, metadata: nil, name: nil, request_options: {}) ⇒ ModernTreasury::Models::LedgerAccount
Some parameter documentations has been truncated, see Models::LedgerAccountUpdateParams for more details.
Update the details of a ledger account.
96 97 98 99 100 101 102 103 104 105 |
# File 'lib/modern_treasury/resources/ledger_accounts.rb', line 96 def update(id, params = {}) parsed, = ModernTreasury::LedgerAccountUpdateParams.dump_request(params) @client.request( method: :patch, path: ["api/ledger_accounts/%1$s", id], body: parsed, model: ModernTreasury::LedgerAccount, options: ) end |