Class: Increase::Resources::Exports

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

Instance Method Summary collapse

Constructor Details

#initialize(client:) ⇒ Exports

Returns a new instance of Exports.



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

def initialize(client:)
  @client = client
end

Instance Method Details

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

Create an Export

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

  • :category (Symbol)

    The type of Export to create.

  • :account_statement_ofx (AccountStatementOfx)

    Options for the created export. Required if category is equal to account_statement_ofx.

  • :balance_csv (BalanceCsv)

    Options for the created export. Required if category is equal to balance_csv.

  • :bookkeeping_account_balance_csv (BookkeepingAccountBalanceCsv)

    Options for the created export. Required if category is equal to bookkeeping_account_balance_csv.

  • :entity_csv (EntityCsv)

    Options for the created export. Required if category is equal to entity_csv.

  • :transaction_csv (TransactionCsv)

    Options for the created export. Required if category is equal to transaction_csv.

  • :vendor_csv (Object)

    Options for the created export. Required if category is equal to vendor_csv.

Returns:



28
29
30
31
32
33
34
35
# File 'lib/increase/resources/exports.rb', line 28

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

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

List Exports

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

  • :category (Category)
  • :created_at (CreatedAt)
  • :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.

  • :status (Status)

Returns:



68
69
70
71
72
73
74
75
76
# File 'lib/increase/resources/exports.rb', line 68

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

#retrieve(export_id, opts = {}) ⇒ Increase::Models::Export

Retrieve an Export

Parameters:

  • export_id (String)

    The identifier of the Export to retrieve.

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

    Options to specify HTTP behaviour for this request.

Returns:



43
44
45
46
47
48
49
# File 'lib/increase/resources/exports.rb', line 43

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