Class: ModernTreasury::AccountCollectionFlowController
- Inherits:
-
BaseController
- Object
- BaseController
- ModernTreasury::AccountCollectionFlowController
- Defined in:
- lib/modern_treasury/controllers/account_collection_flow_controller.rb
Overview
AccountCollectionFlowController
Constant Summary
Constants inherited from BaseController
Instance Attribute Summary
Attributes inherited from BaseController
Instance Method Summary collapse
-
#create_account_collection_flow(idempotency_key: nil, body: nil) ⇒ AccountCollectionFlow
TODO: type endpoint description here something unique, preferably something like an UUID.
-
#get_account_collection_flow(id, idempotency_key: nil) ⇒ AccountCollectionFlow
TODO: type endpoint description here something unique, preferably something like an UUID.
-
#list_account_collection_flows(per_page: nil, client_token: nil, status: nil, counterparty_id: nil, external_account_id: nil, after_cursor: nil) ⇒ Array[AccountCollectionFlow]
TODO: type endpoint description here here here here description here here.
-
#update_account_collection_flow(id, idempotency_key: nil, body: nil) ⇒ AccountCollectionFlow
TODO: type endpoint description here something unique, preferably something like an UUID.
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
#create_account_collection_flow(idempotency_key: nil, body: nil) ⇒ AccountCollectionFlow
TODO: type endpoint description here something unique, preferably something like an UUID. type description here
53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 |
# File 'lib/modern_treasury/controllers/account_collection_flow_controller.rb', line 53 def create_account_collection_flow(idempotency_key: nil, body: nil) @api_call .request(new_request_builder(HttpMethodEnum::POST, '/api/account_collection_flows', Server::DEFAULT) .header_param(new_parameter('application/json', key: 'Content-Type')) .header_param(new_parameter(idempotency_key, key: 'Idempotency-Key')) .body_param(new_parameter(body)) .header_param(new_parameter('application/json', key: 'accept')) .body_serializer(proc do |param| param.to_json unless param.nil? end) .auth(Single.new('basic_auth'))) .response(new_response_handler .deserializer(APIHelper.method(:custom_type_deserializer)) .deserialize_into(AccountCollectionFlow.method(:from_hash)) .local_error('422', 'unsuccessful', ErrorMessageException)) .execute end |
#get_account_collection_flow(id, idempotency_key: nil) ⇒ AccountCollectionFlow
TODO: type endpoint description here something unique, preferably something like an UUID.
79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 |
# File 'lib/modern_treasury/controllers/account_collection_flow_controller.rb', line 79 def get_account_collection_flow(id, idempotency_key: nil) @api_call .request(new_request_builder(HttpMethodEnum::GET, '/api/account_collection_flows/{id}', Server::DEFAULT) .template_param(new_parameter(id, key: 'id') .should_encode(true)) .header_param(new_parameter(idempotency_key, key: 'Idempotency-Key')) .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(AccountCollectionFlow.method(:from_hash))) .execute end |
#list_account_collection_flows(per_page: nil, client_token: nil, status: nil, counterparty_id: nil, external_account_id: nil, after_cursor: nil) ⇒ Array[AccountCollectionFlow]
TODO: type endpoint description here here here here description here here
22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 |
# File 'lib/modern_treasury/controllers/account_collection_flow_controller.rb', line 22 def list_account_collection_flows(per_page: nil, client_token: nil, status: nil, counterparty_id: nil, external_account_id: nil, after_cursor: nil) @api_call .request(new_request_builder(HttpMethodEnum::GET, '/api/account_collection_flows', Server::DEFAULT) .query_param(new_parameter(per_page, key: 'per_page')) .query_param(new_parameter(client_token, key: 'client_token')) .query_param(new_parameter(status, key: 'status')) .query_param(new_parameter(counterparty_id, key: 'counterparty_id')) .query_param(new_parameter(external_account_id, key: 'external_account_id')) .query_param(new_parameter(after_cursor, key: 'after_cursor')) .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(AccountCollectionFlow.method(:from_hash)) .is_response_array(true)) .execute end |
#update_account_collection_flow(id, idempotency_key: nil, body: nil) ⇒ AccountCollectionFlow
TODO: type endpoint description here something unique, preferably something like an UUID. type description here
103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 |
# File 'lib/modern_treasury/controllers/account_collection_flow_controller.rb', line 103 def update_account_collection_flow(id, idempotency_key: nil, body: nil) @api_call .request(new_request_builder(HttpMethodEnum::PATCH, '/api/account_collection_flows/{id}', Server::DEFAULT) .template_param(new_parameter(id, key: 'id') .should_encode(true)) .header_param(new_parameter('application/json', key: 'Content-Type')) .header_param(new_parameter(idempotency_key, key: 'Idempotency-Key')) .body_param(new_parameter(body)) .header_param(new_parameter('application/json', key: 'accept')) .body_serializer(proc do |param| param.to_json unless param.nil? end) .auth(Single.new('basic_auth'))) .response(new_response_handler .deserializer(APIHelper.method(:custom_type_deserializer)) .deserialize_into(AccountCollectionFlow.method(:from_hash)) .local_error('404', 'not found', ErrorMessageException) .local_error('422', 'unsuccessful', ErrorMessageException)) .execute end |