Class: WhopSDK::Resources::Withdrawals

Inherits:
Object
  • Object
show all
Defined in:
lib/whop_sdk/resources/withdrawals.rb

Instance Method Summary collapse

Constructor Details

#initialize(client:) ⇒ Withdrawals

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

Parameters:



74
75
76
# File 'lib/whop_sdk/resources/withdrawals.rb', line 74

def initialize(client:)
  @client = client
end

Instance Method Details

#list(company_id: , after: nil, before: nil, created_after: nil, created_before: nil, direction: nil, first: nil, last: nil, request_options: {}) ⇒ WhopSDK::Internal::CursorPage<WhopSDK::Models::WithdrawalListResponse>

Lists withdrawals

Required permissions:

  • ‘payout:withdrawal:read`

Parameters:

  • company_id (String)

    The ID of the company to list withdrawals for

  • after (String, nil)

    Returns the elements in the list that come after the specified cursor.

  • before (String, nil)

    Returns the elements in the list that come before the specified cursor.

  • created_after (Time, nil)

    The minimum creation date to filter by

  • created_before (Time, nil)

    The maximum creation date to filter by

  • direction (Symbol, WhopSDK::Models::Direction, nil)

    The direction of the sort.

  • first (Integer, nil)

    Returns the first n elements from the list.

  • last (Integer, nil)

    Returns the last n elements from the list.

  • request_options (WhopSDK::RequestOptions, Hash{Symbol=>Object}, nil)

Returns:

See Also:



59
60
61
62
63
64
65
66
67
68
69
# File 'lib/whop_sdk/resources/withdrawals.rb', line 59

def list(params)
  parsed, options = WhopSDK::WithdrawalListParams.dump_request(params)
  @client.request(
    method: :get,
    path: "withdrawals",
    query: parsed,
    page: WhopSDK::Internal::CursorPage,
    model: WhopSDK::Models::WithdrawalListResponse,
    options: options
  )
end

#retrieve(id, request_options: {}) ⇒ WhopSDK::Models::WithdrawalRetrieveResponse

Retrieves a withdrawal by ID

Required permissions:

  • ‘payout:withdrawal:read`

Parameters:

Returns:

See Also:



21
22
23
24
25
26
27
28
# File 'lib/whop_sdk/resources/withdrawals.rb', line 21

def retrieve(id, params = {})
  @client.request(
    method: :get,
    path: ["withdrawals/%1$s", id],
    model: WhopSDK::Models::WithdrawalRetrieveResponse,
    options: params[:request_options]
  )
end