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, external_id: 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, external_id: 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.
192 193 194 |
# File 'lib/modern_treasury/resources/ledger_accounts.rb', line 192 def initialize(client:) @client = client end |
Instance Method Details
#create(currency:, ledger_id:, name:, normal_balance:, currency_exponent: nil, description: nil, external_id: 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.
40 41 42 43 44 45 46 47 48 49 |
# File 'lib/modern_treasury/resources/ledger_accounts.rb', line 40 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.
180 181 182 183 184 185 186 187 |
# File 'lib/modern_treasury/resources/ledger_accounts.rb', line 180 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.
156 157 158 159 160 161 162 163 164 165 166 167 |
# File 'lib/modern_treasury/resources/ledger_accounts.rb', line 156 def list(params = {}) parsed, = ModernTreasury::LedgerAccountListParams.dump_request(params) query = ModernTreasury::Internal::Util.encode_query_params(parsed) @client.request( method: :get, path: "api/ledger_accounts", query: query, 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.
67 68 69 70 71 72 73 74 75 76 77 |
# File 'lib/modern_treasury/resources/ledger_accounts.rb', line 67 def retrieve(id, params = {}) parsed, = ModernTreasury::LedgerAccountRetrieveParams.dump_request(params) query = ModernTreasury::Internal::Util.encode_query_params(parsed) @client.request( method: :get, path: ["api/ledger_accounts/%1$s", id], query: query, model: ModernTreasury::LedgerAccount, options: ) end |
#update(id, description: nil, external_id: 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.
101 102 103 104 105 106 107 108 109 110 |
# File 'lib/modern_treasury/resources/ledger_accounts.rb', line 101 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 |