Class: WhopSDK::Resources::Entries

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

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:



130
131
132
# File 'lib/whop_sdk/resources/entries.rb', line 130

def initialize(client:)
  @client = client
end

Instance Method Details

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

Approve an entry

Required permissions:

  • ‘plan:waitlist:manage`

Parameters:

  • id (String)

    The ID of the entry to approve.

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

Returns:

See Also:



92
93
94
95
96
97
98
99
# File 'lib/whop_sdk/resources/entries.rb', line 92

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 an entry

Required permissions:

  • ‘plan:waitlist:manage`

  • ‘plan:basic:read`

  • ‘member:email:read`

Parameters:

Returns:

See Also:



118
119
120
121
122
123
124
125
# File 'lib/whop_sdk/resources/entries.rb', line 118

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, direction: nil, first: nil, last: nil, order: nil, plan_ids: nil, product_ids: nil, statuses: nil, request_options: {}) ⇒ WhopSDK::Internal::CursorPage<WhopSDK::Models::EntryListResponse>

Lists entries for a company

Required permissions:

  • ‘plan:waitlist:read`

  • ‘member:email:read`

Parameters:

  • company_id (String)

    The ID of the company

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

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

    The plan IDs to filter the entries by

  • product_ids (Array<String>, nil)

    The product IDs to filter the entries by

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

    The statuses to filter the entries by

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

Returns:

See Also:



65
66
67
68
69
70
71
72
73
74
75
# File 'lib/whop_sdk/resources/entries.rb', line 65

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

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

Retrieves an entry by ID

Required permissions:

  • ‘plan:waitlist:read`

  • ‘member:email:read`

Parameters:

Returns:

See Also:



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

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