export type DeleteApiScimUsersUserUidArgs = {userUid: string}; export type DeleteApiScimUsersUserUidOptions = {baseUrl?: string | undefined, scimToken?: string | undefined, fetch?: typeof fetch | undefined}; /** * Delete user * * DELETE /scim/Users/{userUid} */ export const deleteApiScimUsersUserUid = async (args: DeleteApiScimUsersUserUidArgs, options?: DeleteApiScimUsersUserUidOptions) => { const {baseUrl = "https://eu.phrase.com/control-hub", fetch: fetchFn = fetch, scimToken} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (scimToken !== undefined) headers.set('authorization', `Bearer ${scimToken}`) const url = `${baseUrl.replace(/\/+$/, '')}/scim/Users/${encodeURIComponent(String(args.userUid))}${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 };