export type SimplePublicObjectId = {id: string}; export type BatchInputSimplePublicObjectId = {inputs: Array}; export type CreateApiCrmV3ObjectsCommunicationsBatchArchiveArgs = {body: BatchInputSimplePublicObjectId}; export type CreateApiCrmV3ObjectsCommunicationsBatchArchiveOptions = {baseUrl?: string | undefined, fetch?: typeof fetch | undefined}; /** * Archive a batch of communications by ID * * POST /crm/v3/objects/communications/batch/archive */ export const createApiCrmV3ObjectsCommunicationsBatchArchive = async (args: CreateApiCrmV3ObjectsCommunicationsBatchArchiveArgs, options?: CreateApiCrmV3ObjectsCommunicationsBatchArchiveOptions) => { const {baseUrl = "https://api.hubapi.com", fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "application/json") const url = `${baseUrl.replace(/\/+$/, '')}/crm/v3/objects/communications/batch/archive${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "POST", 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 };