Class: Increase::Resources::BookkeepingAccounts

Inherits:
Object
  • Object
show all
Defined in:
lib/increase/resources/bookkeeping_accounts.rb

Instance Method Summary collapse

Constructor Details

#initialize(client:) ⇒ BookkeepingAccounts

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 BookkeepingAccounts.

Parameters:



115
116
117
# File 'lib/increase/resources/bookkeeping_accounts.rb', line 115

def initialize(client:)
  @client = client
end

Instance Method Details

#balance(bookkeeping_account_id, at_time: nil, request_options: {}) ⇒ Increase::Models::BookkeepingBalanceLookup

Retrieve a Bookkeeping Account Balance

Parameters:

  • bookkeeping_account_id (String)

    The identifier of the Bookkeeping Account to retrieve.

  • at_time (Time)

    The moment to query the balance at. If not set, returns the current balances.

  • request_options (Increase::RequestOptions, Hash{Symbol=>Object}, nil)

Returns:

See Also:



101
102
103
104
105
106
107
108
109
110
# File 'lib/increase/resources/bookkeeping_accounts.rb', line 101

def balance(, params = {})
  parsed, options = Increase::BookkeepingAccountBalanceParams.dump_request(params)
  @client.request(
    method: :get,
    path: ["bookkeeping_accounts/%1$s/balance", ],
    query: parsed,
    model: Increase::BookkeepingBalanceLookup,
    options: options
  )
end

#create(name: , account_id: nil, compliance_category: nil, entity_id: nil, request_options: {}) ⇒ Increase::Models::BookkeepingAccount

Create a Bookkeeping Account

Parameters:

Returns:

See Also:



23
24
25
26
27
28
29
30
31
32
# File 'lib/increase/resources/bookkeeping_accounts.rb', line 23

def create(params)
  parsed, options = Increase::BookkeepingAccountCreateParams.dump_request(params)
  @client.request(
    method: :post,
    path: "bookkeeping_accounts",
    body: parsed,
    model: Increase::BookkeepingAccount,
    options: options
  )
end

#list(cursor: nil, idempotency_key: nil, limit: nil, request_options: {}) ⇒ Increase::Internal::Page<Increase::Models::BookkeepingAccount>

Some parameter documentations has been truncated, see Models::BookkeepingAccountListParams for more details.

List Bookkeeping Accounts

Parameters:

  • cursor (String)

    Return the page of entries after this one.

  • idempotency_key (String)

    Filter records to the one with the specified ‘idempotency_key` you chose for tha

  • limit (Integer)

    Limit the size of the list that is returned. The default (and maximum) is 100 ob

  • request_options (Increase::RequestOptions, Hash{Symbol=>Object}, nil)

Returns:

See Also:



76
77
78
79
80
81
82
83
84
85
86
# File 'lib/increase/resources/bookkeeping_accounts.rb', line 76

def list(params = {})
  parsed, options = Increase::BookkeepingAccountListParams.dump_request(params)
  @client.request(
    method: :get,
    path: "bookkeeping_accounts",
    query: parsed,
    page: Increase::Internal::Page,
    model: Increase::BookkeepingAccount,
    options: options
  )
end

#update(bookkeeping_account_id, name: , request_options: {}) ⇒ Increase::Models::BookkeepingAccount

Update a Bookkeeping Account

Parameters:

  • bookkeeping_account_id (String)

    The bookkeeping account you would like to update.

  • name (String)

    The name you choose for the account.

  • request_options (Increase::RequestOptions, Hash{Symbol=>Object}, nil)

Returns:

See Also:



47
48
49
50
51
52
53
54
55
56
# File 'lib/increase/resources/bookkeeping_accounts.rb', line 47

def update(, params)
  parsed, options = Increase::BookkeepingAccountUpdateParams.dump_request(params)
  @client.request(
    method: :patch,
    path: ["bookkeeping_accounts/%1$s", ],
    body: parsed,
    model: Increase::BookkeepingAccount,
    options: options
  )
end