// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. import { APIResource } from '../core/resource'; import * as AccountsAPI from './accounts/accounts'; import { APIPromise } from '../core/api-promise'; import { PagePromise, PylonSearchPage, type PylonSearchPageParams } from '../core/pagination'; import { RequestOptions } from '../internal/request-options'; import { path } from '../internal/utils/path'; export class Users extends APIResource { /** * Update a user */ update(id: string, body: UserUpdateParams, options?: RequestOptions): APIPromise { return this._client.patch(path`/users/${id}`, { body, ...options }); } /** * Get a list of users */ list(options?: RequestOptions): APIPromise { return this._client.get('/users', options); } /** * Search users */ search(body: UserSearchParams, options?: RequestOptions): PagePromise { return this._client.getAPIList('/users/search', PylonSearchPage, { body, method: 'post', ...options, }); } } export type UsersPylonSearchPage = PylonSearchPage; export interface User { id?: string; avatar_url?: string; email?: string; emails?: Array; name?: string; role_id?: string; status?: 'active' | 'away' | 'out_of_office'; } export interface UserList { data?: Array; pagination?: AccountsAPI.Pagination; request_id?: string; } export interface UserUpdateResponse { data?: User; request_id?: string; } export interface UserUpdateParams { /** * The role_id of the user */ role_id?: string; /** * The new user status for the user */ status?: 'active' | 'away' | 'out_of_office'; } export interface UserSearchParams extends PylonSearchPageParams {} export declare namespace Users { export { type User as User, type UserList as UserList, type UserUpdateResponse as UserUpdateResponse, type UsersPylonSearchPage as UsersPylonSearchPage, type UserUpdateParams as UserUpdateParams, type UserSearchParams as UserSearchParams, }; }