export type UpdateApiDashboardsDashboardIdContactsPhoneNumberConversationsUnarchiveArgs = {dashboard_id: number, phone_number: string}; export type UpdateApiDashboardsDashboardIdContactsPhoneNumberConversationsUnarchiveOptions = {baseUrl?: string | undefined, ApiKeyAuth?: string | undefined, fetch?: typeof fetch | undefined}; /** * Unarchive a Conversation * * PUT /dashboards/{dashboard_id}/contacts/{phone_number}/conversations/unarchive */ export const updateApiDashboardsDashboardIdContactsPhoneNumberConversationsUnarchive = async (args: UpdateApiDashboardsDashboardIdContactsPhoneNumberConversationsUnarchiveArgs, options?: UpdateApiDashboardsDashboardIdContactsPhoneNumberConversationsUnarchiveOptions) => { 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/unarchive${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 };