export type DeleteApiScimV2UsersUserIdArgs = {user_id: string, authorization?: (string | null) | undefined}; export type DeleteApiScimV2UsersUserIdOptions = {baseUrl: string, fetch?: typeof fetch | undefined}; /** * Delete User * * DELETE /scim/v2/Users/{user_id} */ export const deleteApiScimV2UsersUserId = async (args: DeleteApiScimV2UsersUserIdArgs, options: DeleteApiScimV2UsersUserIdOptions) => { const {baseUrl, fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (args.authorization != null) headers.set("authorization", String(args.authorization)) const url = `${baseUrl.replace(/\/+$/, '')}/scim/v2/Users/${encodeURIComponent(String(args.user_id))}${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "DELETE", headers}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return undefined };