import { APIResource } from "../resource.js"; import * as Core from "../core.js"; import { UsersPage, type UsersPageParams } from "../pagination.js"; export declare class Users extends APIResource { /** * Modify a given `User`. * * Fields not included in the request body will not be modified. */ update(body: UserUpdateParams, options?: Core.RequestOptions): Core.APIPromise; /** * Retrieve a list of `users`. */ list(query?: UserListParams, options?: Core.RequestOptions): Core.PagePromise; list(options?: Core.RequestOptions): Core.PagePromise; /** * Delete a given `user`. */ deactivate(body: UserDeactivateParams, options?: Core.RequestOptions): Core.APIPromise; /** * Invite users to the tenant. This checks if the user is already in the tenant and * if not, creates the user. We will return a list of user emails that were * successfully created (including existing users). */ invite(body: UserInviteParams, options?: Core.RequestOptions): Core.APIPromise; } export declare class ListUsersResponseUsersUsersPage extends UsersPage { } export interface InviteUsersResponse { /** * Details of the errors occurred while inviting users, where keys are the emails * and values are the error messages */ error_details: { [key: string]: string; }; /** * List of emails of the invited users */ invited_user_emails: Array; } export interface ListUsersResponse { /** * List of users */ users: Array; /** * Cursor for the beginning of the next page */ next_cursor?: string | null; } export declare namespace ListUsersResponse { /** * The schema used for listing existing (activated / deactivated) users. */ interface User { id: string; /** * The email of the user */ email: string; /** * The user level roles of the user for agent level roles. */ agent_level_roles?: Array<'AGENT_LEVEL_USER'>; /** * The effective roles of the user. */ effective_roles?: Array<'VISITOR' | 'AGENT_USER' | 'CUSTOMER_USER' | 'CUSTOMER_INTERNAL_USER' | 'CONTEXTUAL_STAFF_USER' | 'CONTEXTUAL_EXTERNAL_STAFF_USER' | 'CONTEXTUAL_INTERNAL_STAFF_USER' | 'TENANT_ADMIN' | 'CUSTOMER_ADMIN' | 'CONTEXTUAL_ADMIN' | 'SUPER_ADMIN' | 'SERVICE_ACCOUNT'>; /** * Flag indicating if the user is a tenant admin */ is_tenant_admin?: boolean; /** * Per agent level roles for the user. If a user is granted any role under * `agent_level_roles`, then the user has that role for all the agents. Only the * roles that need to be updated should be part of this. */ per_agent_roles?: Array; /** * The user level roles of the user. */ roles?: Array<'VISITOR' | 'AGENT_USER' | 'CUSTOMER_USER' | 'CUSTOMER_INTERNAL_USER' | 'CONTEXTUAL_STAFF_USER' | 'CONTEXTUAL_EXTERNAL_STAFF_USER' | 'CONTEXTUAL_INTERNAL_STAFF_USER' | 'TENANT_ADMIN' | 'CUSTOMER_ADMIN' | 'CONTEXTUAL_ADMIN' | 'SUPER_ADMIN' | 'SERVICE_ACCOUNT'>; } namespace User { /** * The schema used to capture agent level roles */ interface PerAgentRole { /** * ID of the agent on which to grant/revoke the role. */ agent_id: string; /** * When set to true, the roles will be granted o/w revoked. */ grant: boolean; /** * The roles that are granted/revoked */ roles: Array<'AGENT_LEVEL_USER'>; } } } /** * The schema used for creating new users or updating existing users. */ export interface NewUser { /** * The email of the user */ email: string; /** * The user level roles of the user for agent level roles. */ agent_level_roles?: Array<'AGENT_LEVEL_USER'>; /** * Flag indicating if the user is a tenant admin */ is_tenant_admin?: boolean; /** * Per agent level roles for the user. If a user is granted any role under * `agent_level_roles`, then the user has that role for all the agents. Only the * roles that need to be updated should be part of this. */ per_agent_roles?: Array; /** * The user level roles of the user. */ roles?: Array<'VISITOR' | 'AGENT_USER' | 'CUSTOMER_USER' | 'CUSTOMER_INTERNAL_USER' | 'CONTEXTUAL_STAFF_USER' | 'CONTEXTUAL_EXTERNAL_STAFF_USER' | 'CONTEXTUAL_INTERNAL_STAFF_USER' | 'TENANT_ADMIN' | 'CUSTOMER_ADMIN' | 'CONTEXTUAL_ADMIN' | 'SUPER_ADMIN' | 'SERVICE_ACCOUNT'>; } export declare namespace NewUser { /** * The schema used to capture agent level roles */ interface PerAgentRole { /** * ID of the agent on which to grant/revoke the role. */ agent_id: string; /** * When set to true, the roles will be granted o/w revoked. */ grant: boolean; /** * The roles that are granted/revoked */ roles: Array<'AGENT_LEVEL_USER'>; } } export type UserUpdateResponse = unknown; export type UserDeactivateResponse = unknown; export interface UserUpdateParams { /** * The email of the user */ email: string; /** * The user level roles of the user for agent level roles. */ agent_level_roles?: Array<'AGENT_LEVEL_USER'>; /** * Flag indicating if the user is a tenant admin */ is_tenant_admin?: boolean; /** * Per agent level roles for the user. If a user is granted any role under * `agent_level_roles`, then the user has that role for all the agents. Only the * roles that need to be updated should be part of this. */ per_agent_roles?: Array; /** * The user level roles of the user. */ roles?: Array<'VISITOR' | 'AGENT_USER' | 'CUSTOMER_USER' | 'CUSTOMER_INTERNAL_USER' | 'CONTEXTUAL_STAFF_USER' | 'CONTEXTUAL_EXTERNAL_STAFF_USER' | 'CONTEXTUAL_INTERNAL_STAFF_USER' | 'TENANT_ADMIN' | 'CUSTOMER_ADMIN' | 'CONTEXTUAL_ADMIN' | 'SUPER_ADMIN' | 'SERVICE_ACCOUNT'>; } export declare namespace UserUpdateParams { /** * The schema used to capture agent level roles */ interface PerAgentRole { /** * ID of the agent on which to grant/revoke the role. */ agent_id: string; /** * When set to true, the roles will be granted o/w revoked. */ grant: boolean; /** * The roles that are granted/revoked */ roles: Array<'AGENT_LEVEL_USER'>; } } export interface UserListParams extends UsersPageParams { /** * When set to true, return deactivated users instead. */ deactivated?: boolean; /** * Query to filter users by email */ search?: string; } export interface UserDeactivateParams { /** * The email of the user */ email: string; } export interface UserInviteParams { /** * List of new users to be invited */ new_users: Array; /** * The short name of the tenant */ tenant_short_name: string; } export declare namespace Users { export { type InviteUsersResponse as InviteUsersResponse, type ListUsersResponse as ListUsersResponse, type NewUser as NewUser, type UserUpdateResponse as UserUpdateResponse, type UserDeactivateResponse as UserDeactivateResponse, ListUsersResponseUsersUsersPage as ListUsersResponseUsersUsersPage, type UserUpdateParams as UserUpdateParams, type UserListParams as UserListParams, type UserDeactivateParams as UserDeactivateParams, type UserInviteParams as UserInviteParams, }; } //# sourceMappingURL=users.d.ts.map