Class: Increase::Resources::BookkeepingEntrySets

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

Instance Method Summary collapse

Constructor Details

#initialize(client:) ⇒ BookkeepingEntrySets

Returns a new instance of BookkeepingEntrySets.



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

def initialize(client:)
  @client = client
end

Instance Method Details

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

Create a Bookkeeping Entry Set

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):

  • :entries (Array<Entry>)

    The bookkeeping entries.

  • :date (String)

    The date of the transaction. Optional if transaction_id is provided, in which case we use the date of that transaction. Required otherwise.

  • :transaction_id (String)

    The identifier of the Transaction related to this entry set, if any.

Returns:



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

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

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

List Bookkeeping Entry Sets

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.

  • :transaction_id (String)

    Filter to the Bookkeeping Entry Set that maps to this Transaction.

Returns:



59
60
61
62
63
64
65
66
67
# File 'lib/increase/resources/bookkeeping_entry_sets.rb', line 59

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

#retrieve(bookkeeping_entry_set_id, opts = {}) ⇒ Increase::Models::BookkeepingEntrySet

Retrieve a Bookkeeping Entry Set

Parameters:

  • bookkeeping_entry_set_id (String)

    The identifier of the Bookkeeping Entry Set.

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

    Options to specify HTTP behaviour for this request.

Returns:



36
37
38
39
40
41
42
# File 'lib/increase/resources/bookkeeping_entry_sets.rb', line 36

def retrieve(bookkeeping_entry_set_id, opts = {})
  req = {}
  req[:method] = :get
  req[:path] = "/bookkeeping_entry_sets/#{bookkeeping_entry_set_id}"
  req[:model] = Increase::Models::BookkeepingEntrySet
  @client.request(req, opts)
end