export type PatchApiV3AdminUsersIdArgs = {id: string, body: {status?: (1 | 0 | -1) | undefined, beta?: boolean | undefined, fullname?: string | undefined, jobtitle?: string | undefined, lang?: string | undefined, roles?: Array | undefined}}; export type PatchApiV3AdminUsersIdOptions = {baseUrl?: string | undefined, ApiKeyAuth?: string | undefined, fetch?: typeof fetch | undefined}; /** * Update a user * * PATCH /v3/admin/users/{id} */ export const patchApiV3AdminUsersId = async (args: PatchApiV3AdminUsersIdArgs, options?: PatchApiV3AdminUsersIdOptions) => { const {baseUrl = "https://api.rhinoartisan.com", fetch: fetchFn = fetch, ApiKeyAuth} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "application/json") if (ApiKeyAuth !== undefined) headers.set("apikey", ApiKeyAuth) const url = `${baseUrl.replace(/\/+$/, '')}/v3/admin/users/${encodeURIComponent(String(args.id))}${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "PATCH", 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 };