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, user_agent_parameters

Constructor Details

This class inherits a constructor from ModernTreasury::BaseController

Instance Method Details

#get_balance_report(internal_account_id, id) ⇒ ApiResponse

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:

  • (ApiResponse)

    Complete http response with raw body and status code.



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

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')
                                .is_required(true)
                                .should_encode(true))
               .template_param(new_parameter(id, key: 'id')
                                .is_required(true)
                                .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))
                .is_api_response(true)
                .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) ⇒ ApiResponse

Get all balance reports for a given internal account. description here report in local time. 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 (BalanceReportType1) (defaults to: nil)

    Optional parameter: The

  • after_cursor (String) (defaults to: nil)

    Optional parameter: TODO: type description

  • per_page (Integer) (defaults to: nil)

    Optional parameter: TODO: type description

Returns:

  • (ApiResponse)

    Complete http response with raw body and status code.



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
48
49
# 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')
                                .is_required(true)
                                .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_api_response(true)
                .is_response_array(true)
                .local_error('403',
                             'forbidden',
                             ErrorMessageException))
    .execute
end