Class: Lithic::Resources::FinancialAccounts::Statements

Inherits:
Object
  • Object
show all
Defined in:
lib/lithic/resources/financial_accounts/statements.rb,
lib/lithic/resources/financial_accounts/statements/line_items.rb

Defined Under Namespace

Classes: LineItems

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(client:) ⇒ Statements

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

Parameters:



78
79
80
81
# File 'lib/lithic/resources/financial_accounts/statements.rb', line 78

def initialize(client:)
  @client = client
  @line_items = Lithic::Resources::FinancialAccounts::Statements::LineItems.new(client: client)
end

Instance Attribute Details

#line_itemsLithic::Resources::FinancialAccounts::Statements::LineItems (readonly)



8
9
10
# File 'lib/lithic/resources/financial_accounts/statements.rb', line 8

def line_items
  @line_items
end

Instance Method Details

#list(financial_account_token, begin_: nil, end_: nil, ending_before: nil, include_initial_statements: nil, page_size: nil, starting_after: nil, request_options: {}) ⇒ Lithic::Internal::CursorPage<Lithic::Models::FinancialAccounts::Statement>

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

List the statements for a given financial account.

Parameters:

  • financial_account_token (String)

    Globally unique identifier for financial account.

  • begin_ (Date)

    Date string in RFC 3339 format. Only entries created after the specified date wi

  • end_ (Date)

    Date string in RFC 3339 format. Only entries created before the specified date w

  • ending_before (String)

    A cursor representing an item’s token before which a page of results should end.

  • include_initial_statements (Boolean)

    Whether to include the initial statement. It is not included by default.

  • page_size (Integer)

    Page size (for pagination).

  • starting_after (String)

    A cursor representing an item’s token after which a page of results should begin

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

Returns:

See Also:



63
64
65
66
67
68
69
70
71
72
73
# File 'lib/lithic/resources/financial_accounts/statements.rb', line 63

def list(, params = {})
  parsed, options = Lithic::FinancialAccounts::StatementListParams.dump_request(params)
  @client.request(
    method: :get,
    path: ["v1/financial_accounts/%1$s/statements", ],
    query: parsed.transform_keys(begin_: "begin", end_: "end"),
    page: Lithic::Internal::CursorPage,
    model: Lithic::FinancialAccounts::Statement,
    options: options
  )
end

#retrieve(statement_token, financial_account_token:, request_options: {}) ⇒ Lithic::Models::FinancialAccounts::Statement

Get a specific statement for a given financial account.

Parameters:

  • statement_token (String)

    Globally unique identifier for statements.

  • financial_account_token (String)

    Globally unique identifier for financial account.

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

Returns:

See Also:



23
24
25
26
27
28
29
30
31
32
33
34
35
# File 'lib/lithic/resources/financial_accounts/statements.rb', line 23

def retrieve(statement_token, params)
  parsed, options = Lithic::FinancialAccounts::StatementRetrieveParams.dump_request(params)
   =
    parsed.delete(:financial_account_token) do
      raise ArgumentError.new("missing required path argument #{_1}")
    end
  @client.request(
    method: :get,
    path: ["v1/financial_accounts/%1$s/statements/%2$s", , statement_token],
    model: Lithic::FinancialAccounts::Statement,
    options: options
  )
end