Class: WhopSDK::Resources::Members

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

Instance Method Summary collapse

Constructor Details

#initialize(client:) ⇒ Members

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

Parameters:



98
99
100
# File 'lib/whop_sdk/resources/members.rb', line 98

def initialize(client:)
  @client = client
end

Instance Method Details

#list(company_id: , access_level: nil, access_pass_ids: nil, after: nil, before: nil, created_after: nil, created_before: nil, direction: nil, first: nil, last: nil, most_recent_actions: nil, order: nil, plan_ids: nil, promo_code_ids: nil, query: nil, statuses: nil, user_ids: nil, request_options: {}) ⇒ WhopSDK::Internal::CursorPage<WhopSDK::Models::MemberListResponse>

Some parameter documentations has been truncated, see Models::MemberListParams for more details.

List the members of a company

Required permissions:

  • ‘member:basic:read`

  • ‘member:email:read`

  • ‘member:phone:read`

Parameters:

  • company_id (String)

    The ID of the company to list members for

  • access_level (Symbol, WhopSDK::Models::AccessLevel, nil)

    The access level a given user (or company) has to an access pass or company.

  • access_pass_ids (Array<String>, nil)

    The access pass IDs to filter the members by

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

  • most_recent_actions (Array<Symbol, WhopSDK::Models::MemberMostRecentActions>, nil)

    The most recent actions to filter the members by

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

    Which columns can be used to sort.

  • plan_ids (Array<String>, nil)

    The plan IDs to filter the members by

  • promo_code_ids (Array<String>, nil)

    The promo code IDs to filter the members by

  • query (String, nil)

    The name, username, or email to filter the members by. The email filter will onl

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

    The statuses to filter the members by

  • user_ids (Array<String>, nil)

    The user IDs to filter the members by

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

Returns:

See Also:



83
84
85
86
87
88
89
90
91
92
93
# File 'lib/whop_sdk/resources/members.rb', line 83

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

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

Retrieves a member of a company by ID

Required permissions:

  • ‘member:basic:read`

  • ‘member:email:read`

  • ‘member:phone:read`

Parameters:

Returns:

See Also:



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

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