Class: ModernTreasury::Resources::AccountCollectionFlows

Inherits:
Object
  • Object
show all
Defined in:
lib/modern_treasury/resources/account_collection_flows.rb

Instance Method Summary collapse

Constructor Details

#initialize(client:) ⇒ AccountCollectionFlows

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

Parameters:



109
110
111
# File 'lib/modern_treasury/resources/account_collection_flows.rb', line 109

def initialize(client:)
  @client = client
end

Instance Method Details

#create(counterparty_id: , payment_types: , receiving_countries: nil, request_options: {}) ⇒ ModernTreasury::Models::AccountCollectionFlow

create account_collection_flow

Parameters:

Returns:

See Also:



21
22
23
24
25
26
27
28
29
30
# File 'lib/modern_treasury/resources/account_collection_flows.rb', line 21

def create(params)
  parsed, options = ModernTreasury::AccountCollectionFlowCreateParams.dump_request(params)
  @client.request(
    method: :post,
    path: "api/account_collection_flows",
    body: parsed,
    model: ModernTreasury::AccountCollectionFlow,
    options: options
  )
end

#list(after_cursor: nil, client_token: nil, counterparty_id: nil, external_account_id: nil, per_page: nil, status: nil, request_options: {}) ⇒ ModernTreasury::Internal::Page<ModernTreasury::Models::AccountCollectionFlow>

list account_collection_flows

Parameters:

  • after_cursor (String, nil)
  • client_token (String)
  • counterparty_id (String)
  • external_account_id (String)
  • per_page (Integer)
  • status (String)
  • request_options (ModernTreasury::RequestOptions, Hash{Symbol=>Object}, nil)

Returns:

See Also:



94
95
96
97
98
99
100
101
102
103
104
# File 'lib/modern_treasury/resources/account_collection_flows.rb', line 94

def list(params = {})
  parsed, options = ModernTreasury::AccountCollectionFlowListParams.dump_request(params)
  @client.request(
    method: :get,
    path: "api/account_collection_flows",
    query: parsed,
    page: ModernTreasury::Internal::Page,
    model: ModernTreasury::AccountCollectionFlow,
    options: options
  )
end

#retrieve(id, request_options: {}) ⇒ ModernTreasury::Models::AccountCollectionFlow

get account_collection_flow

Parameters:

Returns:

See Also:



43
44
45
46
47
48
49
50
# File 'lib/modern_treasury/resources/account_collection_flows.rb', line 43

def retrieve(id, params = {})
  @client.request(
    method: :get,
    path: ["api/account_collection_flows/%1$s", id],
    model: ModernTreasury::AccountCollectionFlow,
    options: params[:request_options]
  )
end

#update(id, status: , request_options: {}) ⇒ ModernTreasury::Models::AccountCollectionFlow

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

update account_collection_flow

Parameters:

Returns:

See Also:



68
69
70
71
72
73
74
75
76
77
# File 'lib/modern_treasury/resources/account_collection_flows.rb', line 68

def update(id, params)
  parsed, options = ModernTreasury::AccountCollectionFlowUpdateParams.dump_request(params)
  @client.request(
    method: :patch,
    path: ["api/account_collection_flows/%1$s", id],
    body: parsed,
    model: ModernTreasury::AccountCollectionFlow,
    options: options
  )
end