export type PatchApiApiV1WorkspacesSlugEmailMailboxesIdNameArgs = {id: string}; export type PatchApiApiV1WorkspacesSlugEmailMailboxesIdNameOptions = {baseUrl?: string | undefined, fetch?: typeof fetch | undefined}; /** * PATCH /api/v1/workspaces/{slug}/email-mailboxes/{id}/name */ export const patchApiApiV1WorkspacesSlugEmailMailboxesIdName = async (args: PatchApiApiV1WorkspacesSlugEmailMailboxesIdNameArgs, options?: PatchApiApiV1WorkspacesSlugEmailMailboxesIdNameOptions) => { const {baseUrl = "https://api.trybrein.com", fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() const url = `${baseUrl.replace(/\/+$/, '')}/api/v1/workspaces/${encodeURIComponent(String(args.slug))}/email-mailboxes/${encodeURIComponent(String(args.id))}/name${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "PATCH", headers}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return undefined };