export type Archivo = {height?: number | undefined, timestamp?: string | undefined, uri?: (string | null) | undefined, fileName?: (string | null) | undefined, data?: (string | null) | undefined}; export type EnvioMailsLotesRqs = {listaPaises?: (Array | null) | undefined, listaAccounts?: (Array | null) | undefined, listaStores?: (Array | null) | undefined, asunto?: (string | null) | undefined, imagen?: Archivo | undefined, link?: (string | null) | undefined}; export type CreateApiV1ApiCommunicationsSendMailMasivosArgs = {body: EnvioMailsLotesRqs}; export type CreateApiV1ApiCommunicationsSendMailMasivosOptions = {baseUrl: string, Bearer?: string | undefined, fetch?: typeof fetch | undefined}; /** * POST /v1/api/Communications/SendMailMasivos */ export const createApiV1ApiCommunicationsSendMailMasivos = async (args: CreateApiV1ApiCommunicationsSendMailMasivosArgs, options: CreateApiV1ApiCommunicationsSendMailMasivosOptions) => { const {baseUrl, fetch: fetchFn = fetch, Bearer} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "application/json") if (Bearer !== undefined) headers.set("Authorization", Bearer) const url = `${baseUrl.replace(/\/+$/, '')}/v1/api/Communications/SendMailMasivos${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 };