Class: Increase::Resources::AccountTransfers

Inherits:
Object
  • Object
show all
Defined in:
lib/increase/resources/account_transfers.rb,
sig/increase/resources/account_transfers.rbs

Instance Method Summary collapse

Constructor Details

#initialize(client:) ⇒ AccountTransfers

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



147
148
149
# File 'lib/increase/resources/account_transfers.rb', line 147

def initialize(client:)
  @client = client
end

Instance Method Details

#approve(account_transfer_id, request_options: {}) ⇒ Increase::Models::AccountTransfer

Approves an Account Transfer in status pending_approval.



115
116
117
118
119
120
121
122
# File 'lib/increase/resources/account_transfers.rb', line 115

def approve(, params = {})
  @client.request(
    method: :post,
    path: ["account_transfers/%1$s/approve", ],
    model: Increase::AccountTransfer,
    options: params[:request_options]
  )
end

#cancel(account_transfer_id, request_options: {}) ⇒ Increase::Models::AccountTransfer

Cancels an Account Transfer in status pending_approval.



135
136
137
138
139
140
141
142
# File 'lib/increase/resources/account_transfers.rb', line 135

def cancel(, params = {})
  @client.request(
    method: :post,
    path: ["account_transfers/%1$s/cancel", ],
    model: Increase::AccountTransfer,
    options: params[:request_options]
  )
end

#create(account_id:, amount:, description:, destination_account_id:, require_approval: nil, request_options: {}) ⇒ Increase::Models::AccountTransfer

Create an Account Transfer



33
34
35
36
37
38
39
40
41
42
# File 'lib/increase/resources/account_transfers.rb', line 33

def create(params)
  parsed, options = Increase::AccountTransferCreateParams.dump_request(params)
  @client.request(
    method: :post,
    path: "account_transfers",
    body: parsed,
    model: Increase::AccountTransfer,
    options: options
  )
end

#list(account_id: nil, created_at: nil, cursor: nil, idempotency_key: nil, limit: nil, request_options: {}) ⇒ Increase::Internal::Page<Increase::Models::AccountTransfer>

List Account Transfers



91
92
93
94
95
96
97
98
99
100
101
102
# File 'lib/increase/resources/account_transfers.rb', line 91

def list(params = {})
  parsed, options = Increase::AccountTransferListParams.dump_request(params)
  query = Increase::Internal::Util.encode_query_params(parsed)
  @client.request(
    method: :get,
    path: "account_transfers",
    query: query,
    page: Increase::Internal::Page,
    model: Increase::AccountTransfer,
    options: options
  )
end

#retrieve(account_transfer_id, request_options: {}) ⇒ Increase::Models::AccountTransfer

Retrieve an Account Transfer



55
56
57
58
59
60
61
62
# File 'lib/increase/resources/account_transfers.rb', line 55

def retrieve(, params = {})
  @client.request(
    method: :get,
    path: ["account_transfers/%1$s", ],
    model: Increase::AccountTransfer,
    options: params[:request_options]
  )
end