Class: WhopSDK::Resources::Entries

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

Overview

Entries

Instance Method Summary collapse

Constructor Details

#initialize(client:) ⇒ Entries

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

Parameters:



139
140
141
# File 'lib/whop_sdk/resources/entries.rb', line 139

def initialize(client:)
  @client = client
end

Instance Method Details

#approve(id, request_options: {}) ⇒ WhopSDK::Models::EntryApproveResponse

Approve a pending waitlist entry, triggering the checkout process to grant the user access to the plan.

Required permissions:

  • ‘plan:waitlist:manage`

Parameters:

  • id (String)

    The unique identifier of the waitlist entry to approve.

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

Returns:

See Also:



100
101
102
103
104
105
106
107
# File 'lib/whop_sdk/resources/entries.rb', line 100

def approve(id, params = {})
  @client.request(
    method: :post,
    path: ["entries/%1$s/approve", id],
    model: WhopSDK::Models::EntryApproveResponse,
    options: params[:request_options]
  )
end

#deny(id, request_options: {}) ⇒ WhopSDK::Models::Entry

Deny a pending waitlist entry, preventing the user from gaining access to the plan.

Required permissions:

  • ‘plan:waitlist:manage`

  • ‘plan:basic:read`

  • ‘member:email:read`

Parameters:

  • id (String)

    The unique identifier of the waitlist entry to deny.

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

Returns:

See Also:



127
128
129
130
131
132
133
134
# File 'lib/whop_sdk/resources/entries.rb', line 127

def deny(id, params = {})
  @client.request(
    method: :post,
    path: ["entries/%1$s/deny", id],
    model: WhopSDK::Entry,
    options: params[:request_options]
  )
end

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

Returns a paginated list of waitlist entries for a company, with optional filtering by product, plan, status, and creation date.

Required permissions:

  • ‘plan:waitlist:read`

  • ‘member:email:read`

Parameters:

  • company_id (String)

    The unique identifier of the company to list waitlist entries 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)

    Only return entries created after this timestamp.

  • created_before (Time, nil)

    Only return entries created before this timestamp.

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

  • order (Symbol, WhopSDK::Models::EntryListParams::Order, nil)

    Which columns can be used to sort.

  • plan_ids (Array<String>, nil)

    Filter entries to only those for specific plans.

  • product_ids (Array<String>, nil)

    Filter entries to only those for specific products.

  • statuses (Array<Symbol, WhopSDK::Models::EntryStatus>, nil)

    Filter entries by their current status.

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

Returns:

See Also:



71
72
73
74
75
76
77
78
79
80
81
82
# File 'lib/whop_sdk/resources/entries.rb', line 71

def list(params)
  parsed, options = WhopSDK::EntryListParams.dump_request(params)
  query = WhopSDK::Internal::Util.encode_query_params(parsed)
  @client.request(
    method: :get,
    path: "entries",
    query: query,
    page: WhopSDK::Internal::CursorPage,
    model: WhopSDK::Models::EntryListResponse,
    options: options
  )
end

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

Retrieves the details of an existing waitlist entry.

Required permissions:

  • ‘plan:waitlist:read`

  • ‘member:email:read`

Parameters:

  • id (String)

    The unique identifier of the waitlist entry to retrieve.

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

Returns:

See Also:



23
24
25
26
27
28
29
30
# File 'lib/whop_sdk/resources/entries.rb', line 23

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