export type DeleteApiUserProfileV1UsersIdArgs = {id: string, 'privacy-notice'?: string | undefined}; export type DeleteApiUserProfileV1UsersIdOptions = {baseUrl: string, fetch?: typeof fetch | undefined}; /** * Delete an existing user. * * DELETE /user-profile/v1/users/{id} */ export const deleteApiUserProfileV1UsersId = async (args: DeleteApiUserProfileV1UsersIdArgs, options: DeleteApiUserProfileV1UsersIdOptions) => { const {baseUrl, fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (args['privacy-notice'] != null) query.append("privacy-notice", String(args['privacy-notice'])) const url = `${baseUrl.replace(/\/+$/, '')}/user-profile/v1/users/${encodeURIComponent(String(args.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 };