export type CreateApiV20UsersUserIdRemoverolefromuserArgs = {Accept?: ('application/json' | 'application/hal+json' | 'application/xml' | 'text/xml' | 'text/csv') | undefined, userId: string, body: {role?: ('admin' | 'apiKeys' | 'base_role' | 'basicSupportUser' | 'fullSupportUser' | 'liveAgentAdmin' | 'liveAgentAgent' | 'liveAgentSupervisor' | 'odata' | 'projectAssigner' | 'projectManager' | 'userManager' | 'userDetailsViewer' | 'voiceGatewayUser' | 'opsCenterUser') | undefined}}; export type CreateApiV20UsersUserIdRemoverolefromuserOptions = {baseUrl?: string | undefined, APIKeyHeader?: string | undefined, fetch?: typeof fetch | undefined}; /** * Unassign a Global Role * * POST /v2.0/users/{userId}/removerolefromuser * * Also accepts auth: APIKeyQueryParam, CXoneTokenHeader, OAuth2 */ export const createApiV20UsersUserIdRemoverolefromuser = async (args: CreateApiV20UsersUserIdRemoverolefromuserArgs, options?: CreateApiV20UsersUserIdRemoverolefromuserOptions) => { const {baseUrl = "https://api-trial.cognigy.ai/testing", fetch: fetchFn = fetch, APIKeyHeader} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "application/json") if (args.Accept != null) headers.set("Accept", String(args.Accept)) if (APIKeyHeader !== undefined) headers.set("X-API-Key", APIKeyHeader) const url = `${baseUrl.replace(/\/+$/, '')}/v2.0/users/${encodeURIComponent(String(args.userId))}/removerolefromuser${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "POST", headers, body: JSON.stringify(args.body)}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return undefined };