Class: ModernTreasury::BalanceReportController

Inherits:
BaseController show all
Defined in:
lib/modern_treasury/controllers/balance_report_controller.rb

Overview

BalanceReportController

Constant Summary

Constants inherited from BaseController

ModernTreasury::BaseController::GLOBAL_ERRORS

Instance Attribute Summary

Attributes inherited from BaseController

#config, #http_call_back

Instance Method Summary collapse

Methods inherited from BaseController

#initialize, #new_parameter, #new_request_builder, #new_response_handler, user_agent

Constructor Details

This class inherits a constructor from ModernTreasury::BaseController

Instance Method Details

#get_balance_report(internal_account_id, id) ⇒ BalanceReport

Get a single balance report for a given internal account. description here balance report or latest for the latest balance report.

Parameters:

  • internal_account_id (String)

    Required parameter: TODO: type

  • id (String)

    Required parameter: Either the unique identifier of the

Returns:



55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
# File 'lib/modern_treasury/controllers/balance_report_controller.rb', line 55

def get_balance_report(,
                       id)
  @api_call
    .request(new_request_builder(HttpMethodEnum::GET,
                                 '/api/internal_accounts/{internal_account_id}/balance_reports/{id}',
                                 Server::DEFAULT)
               .template_param(new_parameter(, key: 'internal_account_id')
                                .should_encode(true))
               .template_param(new_parameter(id, key: 'id')
                                .should_encode(true))
               .header_param(new_parameter('application/json', key: 'accept'))
               .auth(Single.new('basic_auth')))
    .response(new_response_handler
                .deserializer(APIHelper.method(:custom_type_deserializer))
                .deserialize_into(BalanceReport.method(:from_hash))
                .local_error('404',
                             'not found',
                             ErrorMessageException))
    .execute
end

#list_balance_reports(internal_account_id, as_of_date: nil, balance_report_type: nil, after_cursor: nil, per_page: nil) ⇒ Array[BalanceReport]

Get all balance reports for a given internal account. description here report in local time. The specific type of balance report. One of ‘intraday`, `previous_day`, `real_time`, or `other`. here here

Parameters:

  • internal_account_id (String)

    Required parameter: TODO: type

  • as_of_date (Date) (defaults to: nil)

    Optional parameter: The date of the balance

  • balance_report_type (BalanceReportType1Enum) (defaults to: nil)

    Optional parameter:

  • after_cursor (String) (defaults to: nil)

    Optional parameter: TODO: type description

  • per_page (Integer) (defaults to: nil)

    Optional parameter: TODO: type description

Returns:



22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
# File 'lib/modern_treasury/controllers/balance_report_controller.rb', line 22

def list_balance_reports(,
                         as_of_date: nil,
                         balance_report_type: nil,
                         after_cursor: nil,
                         per_page: nil)
  @api_call
    .request(new_request_builder(HttpMethodEnum::GET,
                                 '/api/internal_accounts/{internal_account_id}/balance_reports',
                                 Server::DEFAULT)
               .template_param(new_parameter(, key: 'internal_account_id')
                                .should_encode(true))
               .query_param(new_parameter(as_of_date, key: 'as_of_date'))
               .query_param(new_parameter(balance_report_type, key: 'balance_report_type'))
               .query_param(new_parameter(after_cursor, key: 'after_cursor'))
               .query_param(new_parameter(per_page, key: 'per_page'))
               .header_param(new_parameter('application/json', key: 'accept'))
               .auth(Single.new('basic_auth')))
    .response(new_response_handler
                .deserializer(APIHelper.method(:custom_type_deserializer))
                .deserialize_into(BalanceReport.method(:from_hash))
                .is_response_array(true)
                .local_error('403',
                             'forbidden',
                             ErrorMessageException))
    .execute
end