Class: Cadenya::Resources::WorkspaceAdmin::Profiles

Inherits:
Object
  • Object
show all
Defined in:
lib/cadenya/resources/workspace_admin/profiles.rb

Overview

Administer workspaces across the account: create and archive workspaces and manage their membership. These operations are account-scoped and require the admin role (a token whose profile holds the WorkOS admin role); they live under /v1/account/workspaces rather than the workspace-scoped /v1/workspaces tree so an admin can manage any workspace in the account, including ones they are not themselves a member of.

Instance Method Summary collapse

Constructor Details

#initialize(client:) ⇒ Profiles

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

Parameters:



48
49
50
# File 'lib/cadenya/resources/workspace_admin/profiles.rb', line 48

def initialize(client:)
  @client = client
end

Instance Method Details

#list(cursor: nil, limit: nil, query: nil, request_options: {}) ⇒ Cadenya::Internal::CursorPagination<Cadenya::Models::Profile>

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

Searches the account’s profiles for a member picker, with free-form name/email search and an optional type filter. Account-scoped; admin only.

Parameters:

  • cursor (String)

    Pagination cursor from previous response

  • limit (Integer)

    Maximum number of results to return

  • query (String)

    Free-form search over profile name and email. Case-insensitive substring

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

Returns:

See Also:



32
33
34
35
36
37
38
39
40
41
42
43
# File 'lib/cadenya/resources/workspace_admin/profiles.rb', line 32

def list(params = {})
  parsed, options = Cadenya::WorkspaceAdmin::ProfileListParams.dump_request(params)
  query = Cadenya::Internal::Util.encode_query_params(parsed)
  @client.request(
    method: :get,
    path: "v1/account/profiles",
    query: query,
    page: Cadenya::Internal::CursorPagination,
    model: Cadenya::Profile,
    options: options
  )
end