export type PatchApiAgentmailV0InboxesInboxIdArgs = {inbox_id: string, body: {display_name?: string | undefined, client_id?: string | undefined}}; export type PatchApiAgentmailV0InboxesInboxIdOptions = {baseUrl?: string | undefined, fetch?: typeof fetch | undefined}; /** * Update an existing inbox display name or client ID. * * PATCH /agentmail/v0/inboxes/{inbox_id} */ export const patchApiAgentmailV0InboxesInboxId = async (args: PatchApiAgentmailV0InboxesInboxIdArgs, options?: PatchApiAgentmailV0InboxesInboxIdOptions) => { const {baseUrl = "https://api.orthogonal.com/mpp", fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "application/json") const url = `${baseUrl.replace(/\/+$/, '')}/agentmail/v0/inboxes/${encodeURIComponent(String(args.inbox_id))}${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "PATCH", headers, body: JSON.stringify(args.body)}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return undefined };