export type DeleteApiV1EmailWorkspacesIdArgs = {id: number, 'x-api-key': string}; export type DeleteApiV1EmailWorkspacesIdOptions = {baseUrl?: string | undefined, fetch?: typeof fetch | undefined}; /** * Delete an email workspace * * DELETE /v1/email_workspaces/{id} */ export const deleteApiV1EmailWorkspacesId = async (args: DeleteApiV1EmailWorkspacesIdArgs, options?: DeleteApiV1EmailWorkspacesIdOptions) => { const {baseUrl = "https://api.mailreach.co/api", fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (args['x-api-key'] != null) headers.set("x-api-key", String(args['x-api-key'])) const url = `${baseUrl.replace(/\/+$/, '')}/v1/email_workspaces/${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 };