export type DeleteApiPublicV1UsersEmailArgs = {email: string}; export type DeleteApiPublicV1UsersEmailOptions = {baseUrl: string, httpAuth?: string | undefined, fetch?: typeof fetch | undefined}; /** * Removes a user from the organization * * DELETE /public/v1/users/{email} */ export const deleteApiPublicV1UsersEmail = async (args: DeleteApiPublicV1UsersEmailArgs, options: DeleteApiPublicV1UsersEmailOptions) => { const {baseUrl, fetch: fetchFn = fetch, httpAuth} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (httpAuth !== undefined) headers.set('authorization', `Bearer ${httpAuth}`) const url = `${baseUrl.replace(/\/+$/, '')}/public/v1/users/${encodeURIComponent(String(args.email))}${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 };