export type DeleteApiCorporateUserRevokeEmailArgs = {email: string}; export type DeleteApiCorporateUserRevokeEmailOptions = {baseUrl?: string | undefined, apiKey?: string | undefined, fetch?: typeof fetch | undefined}; /** * Revoke an admin user * * DELETE /corporate/user/revoke/{email} * * Also accepts auth: partner-key */ export const deleteApiCorporateUserRevokeEmail = async (args: DeleteApiCorporateUserRevokeEmailArgs, options?: DeleteApiCorporateUserRevokeEmailOptions) => { const {baseUrl = "https://api.brevo.com/v3", fetch: fetchFn = fetch, apiKey} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (apiKey !== undefined) headers.set("api-key", apiKey) const url = `${baseUrl.replace(/\/+$/, '')}/corporate/user/revoke/${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 };