export type Archivo = {height?: number | undefined, timestamp?: string | undefined, uri?: (string | null) | undefined, fileName?: (string | null) | undefined, data?: (string | null) | undefined}; export type NotificationCountryRequest = {paisID?: number | undefined, accountsIDs?: (Array | null) | undefined, storesIDs?: (Array | null) | undefined, contentID?: (number | null) | undefined, url?: (string | null) | undefined}; export type NewEnvioNotifLotesRqs = {fechaEnvio?: string | undefined, titulo?: (string | null) | undefined, mensaje?: (string | null) | undefined, imagen?: Archivo | undefined, communicationTypeID?: (number | null) | undefined, notificationCountries?: (Array | null) | undefined}; export type CreateApiV1ApiCommunicationsCreateNotificacionesArgs = {body: NewEnvioNotifLotesRqs}; export type CreateApiV1ApiCommunicationsCreateNotificacionesOptions = {baseUrl: string, Bearer?: string | undefined, fetch?: typeof fetch | undefined}; /** * POST /v1/api/Communications/CreateNotificaciones */ export const createApiV1ApiCommunicationsCreateNotificaciones = async (args: CreateApiV1ApiCommunicationsCreateNotificacionesArgs, options: CreateApiV1ApiCommunicationsCreateNotificacionesOptions) => { 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/CreateNotificaciones${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 };