Class: WhopSDK::Resources::Transfers
- Inherits:
-
Object
- Object
- WhopSDK::Resources::Transfers
- Defined in:
- lib/whop_sdk/resources/transfers.rb
Instance Method Summary collapse
-
#create(amount: , currency: , destination_id: , origin_id: , idempotence_key: nil, metadata: nil, notes: nil, request_options: {}) ⇒ WhopSDK::Models::Transfer
Some parameter documentations has been truncated, see Models::TransferCreateParams for more details.
-
#initialize(client:) ⇒ Transfers
constructor
private
A new instance of Transfers.
-
#list(after: nil, before: nil, destination_id: nil, direction: nil, first: nil, last: nil, order: nil, origin_id: nil, request_options: {}) ⇒ WhopSDK::Internal::CursorPage<WhopSDK::Models::TransferListResponse>
Some parameter documentations has been truncated, see Models::TransferListParams for more details.
-
#retrieve(id, request_options: {}) ⇒ WhopSDK::Models::Transfer
Retrieves a transfer by ID.
Constructor Details
#initialize(client:) ⇒ Transfers
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 Transfers.
118 119 120 |
# File 'lib/whop_sdk/resources/transfers.rb', line 118 def initialize(client:) @client = client end |
Instance Method Details
#create(amount: , currency: , destination_id: , origin_id: , idempotence_key: nil, metadata: nil, notes: nil, request_options: {}) ⇒ WhopSDK::Models::Transfer
Some parameter documentations has been truncated, see Models::TransferCreateParams for more details.
Creates a new transfer between ledger accounts
Required permissions:
-
‘payout:transfer_funds`
36 37 38 39 40 41 42 43 44 45 |
# File 'lib/whop_sdk/resources/transfers.rb', line 36 def create(params) parsed, = WhopSDK::TransferCreateParams.dump_request(params) @client.request( method: :post, path: "transfers", body: parsed, model: WhopSDK::Transfer, options: ) end |
#list(after: nil, before: nil, destination_id: nil, direction: nil, first: nil, last: nil, order: nil, origin_id: nil, request_options: {}) ⇒ WhopSDK::Internal::CursorPage<WhopSDK::Models::TransferListResponse>
Some parameter documentations has been truncated, see Models::TransferListParams for more details.
Lists transfers
Required permissions:
-
‘payout:transfer:read`
103 104 105 106 107 108 109 110 111 112 113 |
# File 'lib/whop_sdk/resources/transfers.rb', line 103 def list(params = {}) parsed, = WhopSDK::TransferListParams.dump_request(params) @client.request( method: :get, path: "transfers", query: parsed, page: WhopSDK::Internal::CursorPage, model: WhopSDK::Models::TransferListResponse, options: ) end |
#retrieve(id, request_options: {}) ⇒ WhopSDK::Models::Transfer
Retrieves a transfer by ID
Required permissions:
-
‘payout:transfer:read`
62 63 64 65 66 67 68 69 |
# File 'lib/whop_sdk/resources/transfers.rb', line 62 def retrieve(id, params = {}) @client.request( method: :get, path: ["transfers/%1$s", id], model: WhopSDK::Transfer, options: params[:request_options] ) end |