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

Returns a new instance of BookkeepingAccounts.



6
7
8
# File 'lib/increase/resources/bookkeeping_accounts.rb', line 6

def initialize(client:)
  @client = client
end

Instance Method Details

#balance(bookkeeping_account_id, params = {}, opts = {}) ⇒ Increase::Models::BookkeepingBalanceLookup

Retrieve a Bookkeeping Account Balance

Parameters:

  • bookkeeping_account_id (String)

    The identifier of the Bookkeeping Account to retrieve.

  • params (Hash) (defaults to: {})

    Attributes to send in this request.

  • opts (Hash|RequestOptions) (defaults to: {})

    Options to specify HTTP behaviour for this request.

Options Hash (params):

  • :at_time (String)

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

Returns:



83
84
85
86
87
88
89
90
# File 'lib/increase/resources/bookkeeping_accounts.rb', line 83

def balance(, params = {}, opts = {})
  req = {}
  req[:method] = :get
  req[:path] = "/bookkeeping_accounts/#{}/balance"
  req[:query] = params
  req[:model] = Increase::Models::BookkeepingBalanceLookup
  @client.request(req, opts)
end

#create(params = {}, opts = {}) ⇒ Increase::Models::BookkeepingAccount

Create a Bookkeeping Account

Parameters:

  • params (Hash) (defaults to: {})

    Attributes to send in this request.

  • opts (Hash|RequestOptions) (defaults to: {})

    Options to specify HTTP behaviour for this request.

Options Hash (params):

  • :name (String)

    The name you choose for the account.

  • :account_id (String)

    The entity, if compliance_category is commingled_cash.

  • :compliance_category (Symbol)

    The account compliance category.

  • :entity_id (String)

    The entity, if compliance_category is customer_balance.

Returns:



21
22
23
24
25
26
27
28
# File 'lib/increase/resources/bookkeeping_accounts.rb', line 21

def create(params = {}, opts = {})
  req = {}
  req[:method] = :post
  req[:path] = "/bookkeeping_accounts"
  req[:body] = params
  req[:model] = Increase::Models::BookkeepingAccount
  @client.request(req, opts)
end

#list(params = {}, opts = {}) ⇒ Increase::Page<Increase::Models::BookkeepingAccount>

List Bookkeeping Accounts

Parameters:

  • params (Hash) (defaults to: {})

    Attributes to send in this request.

  • opts (Hash|RequestOptions) (defaults to: {})

    Options to specify HTTP behaviour for this request.

Options Hash (params):

  • :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 that object. This value is unique across Increase and is used to ensure that a request is only processed once. Learn more about idempotency.

  • :limit (Integer)

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

Returns:



63
64
65
66
67
68
69
70
71
# File 'lib/increase/resources/bookkeeping_accounts.rb', line 63

def list(params = {}, opts = {})
  req = {}
  req[:method] = :get
  req[:path] = "/bookkeeping_accounts"
  req[:query] = params
  req[:page] = Increase::Page
  req[:model] = Increase::Models::BookkeepingAccount
  @client.request(req, opts)
end

#update(bookkeeping_account_id, params = {}, opts = {}) ⇒ Increase::Models::BookkeepingAccount

Update a Bookkeeping Account

Parameters:

  • bookkeeping_account_id (String)

    The bookkeeping account you would like to update.

  • params (Hash) (defaults to: {})

    Attributes to send in this request.

  • opts (Hash|RequestOptions) (defaults to: {})

    Options to specify HTTP behaviour for this request.

Options Hash (params):

  • :name (String)

    The name you choose for the account.

Returns:



40
41
42
43
44
45
46
47
# File 'lib/increase/resources/bookkeeping_accounts.rb', line 40

def update(, params = {}, opts = {})
  req = {}
  req[:method] = :patch
  req[:path] = "/bookkeeping_accounts/#{}"
  req[:body] = params
  req[:model] = Increase::Models::BookkeepingAccount
  @client.request(req, opts)
end