Class: WhopSDK::Resources::AuthorizedUsers

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

Instance Method Summary collapse

Constructor Details

#initialize(client:) ⇒ AuthorizedUsers

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

Parameters:



78
79
80
# File 'lib/whop_sdk/resources/authorized_users.rb', line 78

def initialize(client:)
  @client = client
end

Instance Method Details

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

Lists authorized users

Required permissions:

  • ‘company:authorized_user:read`

  • ‘member:email:read`

Parameters:

  • company_id (String)

    The ID of the company to list authorized users 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

  • first (Integer, nil)

    Returns the first n elements from the list.

  • last (Integer, nil)

    Returns the last n elements from the list.

  • role (Symbol, WhopSDK::Models::AuthorizedUserRoles, nil)

    Possible roles an authorized user can have

  • user_id (String, nil)

    Filter by the user ID to check if the user is an authorized user

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

Returns:

See Also:



63
64
65
66
67
68
69
70
71
72
73
# File 'lib/whop_sdk/resources/authorized_users.rb', line 63

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

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

Retrieves a authorized user by ID

Required permissions:

  • ‘company:authorized_user:read`

  • ‘member:email:read`

Parameters:

  • id (String)

    The ID of the authorized user

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

Returns:

See Also:



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

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