export type UpdateApiDashboardsDashboardIdContactsPhoneNumberConversationsArchiveArgs = {dashboard_id: number, phone_number: string}; export type UpdateApiDashboardsDashboardIdContactsPhoneNumberConversationsArchiveOptions = {baseUrl?: string | undefined, ApiKeyAuth?: string | undefined, fetch?: typeof fetch | undefined}; /** * Archive a Conversation * * PUT /dashboards/{dashboard_id}/contacts/{phone_number}/conversations/archive */ export const updateApiDashboardsDashboardIdContactsPhoneNumberConversationsArchive = async (args: UpdateApiDashboardsDashboardIdContactsPhoneNumberConversationsArchiveArgs, options?: UpdateApiDashboardsDashboardIdContactsPhoneNumberConversationsArchiveOptions) => { const {baseUrl = "https://api.textrequest.com/api/v3", fetch: fetchFn = fetch, ApiKeyAuth} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (ApiKeyAuth !== undefined) headers.set("x-api-key", ApiKeyAuth) const url = `${baseUrl.replace(/\/+$/, '')}/dashboards/${encodeURIComponent(String(args.dashboard_id))}/contacts/${encodeURIComponent(String(args.phone_number))}/conversations/archive${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "PUT", headers}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return undefined };