Class: ModernTreasury::ConnectionApi

Inherits:
BaseApi
  • Object
show all
Defined in:
lib/modern_treasury/apis/connection_api.rb

Overview

ConnectionApi

Constant Summary

Constants inherited from BaseApi

BaseApi::GLOBAL_ERRORS

Instance Attribute Summary

Attributes inherited from BaseApi

#config, #http_call_back

Instance Method Summary collapse

Methods inherited from BaseApi

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

Constructor Details

This class inherits a constructor from ModernTreasury::BaseApi

Instance Method Details

#list_connections(after_cursor: nil, per_page: nil, vendor_customer_id: nil, entity: nil) ⇒ ApiResponse

Get a list of all connections. here here identifier assigned by the vendor to your organization. vendor (i.e. bank).

Parameters:

  • after_cursor (String) (defaults to: nil)

    Optional parameter: TODO: type description

  • per_page (Integer) (defaults to: nil)

    Optional parameter: TODO: type description

  • vendor_customer_id (UUID | String) (defaults to: nil)

    Optional parameter: An

  • entity (String) (defaults to: nil)

    Optional parameter: A string code representing the

Returns:

  • (ApiResponse)

    Complete http response with raw body and status code.



19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
# File 'lib/modern_treasury/apis/connection_api.rb', line 19

def list_connections(after_cursor: nil,
                     per_page: nil,
                     vendor_customer_id: nil,
                     entity: nil)
  @api_call
    .request(new_request_builder(HttpMethodEnum::GET,
                                 '/api/connections',
                                 Server::DEFAULT)
               .query_param(new_parameter(after_cursor, key: 'after_cursor'))
               .query_param(new_parameter(per_page, key: 'per_page'))
               .query_param(new_parameter(vendor_customer_id, key: 'vendor_customer_id'))
               .query_param(new_parameter(entity, key: 'entity'))
               .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(Connection.method(:from_hash))
                .is_api_response(true)
                .is_response_array(true))
    .execute
end