/* tslint:disable */ /* eslint-disable */ /** * communications/messages * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ import type { Configuration } from '../configuration'; import type { AxiosPromise, AxiosInstance, RawAxiosRequestConfig } from 'axios'; import globalAxios from 'axios'; // Some imports not used depending on template conditions // @ts-ignore import { DUMMY_BASE_URL, assertParamExists, setApiKeyToObject, setBasicAuthToObject, setBearerAuthToObject, setOAuthToObject, setSearchParams, serializeDataIfNeeded, toPathString, createRequestFunction, replaceWithSerializableTypeIfNeeded, } from '../common'; // @ts-ignore import { BASE_PATH, COLLECTION_FORMATS, type RequestArgs, BaseAPI, RequiredError, operationServerMap, } from '../base'; // @ts-ignore import type { CommunicationMessage } from '../models'; // @ts-ignore import type { CommunicationMessageAction } from '../models'; // @ts-ignore import type { CommunicationMessageEnqueueAction } from '../models'; // @ts-ignore import type { CommunicationMessageFilterCriteria } from '../models'; // @ts-ignore import type { CommunicationMessagesSearchSortCriteria } from '../models'; // @ts-ignore import type { ErrorResponse } from '../models'; /** * CommunicationsApi - axios parameter creator */ export const CommunicationsApiAxiosParamCreator = function ( configuration?: Configuration, ) { return { /** * * @summary Resend failed communication message(s) asynchronously by date * @param {CommunicationMessageEnqueueAction} communicationMessageEnqueueAction Resend failed communication message(s) asynchronously by date * @param {string} [idempotencyKey] Key that can be used to support idempotency on this POST. Must be a valid UUID(version 4 is recommended) string and can only be used with the exact same request. Can be used in retry mechanisms to prevent double posting. * @param {*} [options] Override http request option. * @throws {RequiredError} */ enqueueByDate: async ( communicationMessageEnqueueAction: CommunicationMessageEnqueueAction, idempotencyKey?: string, options: RawAxiosRequestConfig = {}, ): Promise => { // verify required parameter 'communicationMessageEnqueueAction' is not null or undefined assertParamExists( 'enqueueByDate', 'communicationMessageEnqueueAction', communicationMessageEnqueueAction, ); const localVarPath = `/communications/messages:resendAsyncByDate`; // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; } const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options, }; const localVarHeaderParameter = {} as any; const localVarQueryParameter = {} as any; // authentication basic required // http basic authentication required setBasicAuthToObject(localVarRequestOptions, configuration); localVarHeaderParameter['Content-Type'] = 'application/json'; localVarHeaderParameter['Accept'] = 'application/vnd.mambu.v2+json'; if (idempotencyKey != null) { localVarHeaderParameter['Idempotency-Key'] = String(idempotencyKey); } setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers, }; localVarRequestOptions.data = serializeDataIfNeeded( communicationMessageEnqueueAction, localVarRequestOptions, configuration, ); return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, /** * * @summary Resend failed communication message(s) asynchronously using keys * @param {CommunicationMessageAction} communicationMessageAction Resend failed communication message(s) asynchronously using keys * @param {string} [idempotencyKey] Key that can be used to support idempotency on this POST. Must be a valid UUID(version 4 is recommended) string and can only be used with the exact same request. Can be used in retry mechanisms to prevent double posting. * @param {*} [options] Override http request option. * @throws {RequiredError} */ enqueueByKeys: async ( communicationMessageAction: CommunicationMessageAction, idempotencyKey?: string, options: RawAxiosRequestConfig = {}, ): Promise => { // verify required parameter 'communicationMessageAction' is not null or undefined assertParamExists( 'enqueueByKeys', 'communicationMessageAction', communicationMessageAction, ); const localVarPath = `/communications/messages:resendAsyncByKeys`; // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; } const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options, }; const localVarHeaderParameter = {} as any; const localVarQueryParameter = {} as any; // authentication basic required // http basic authentication required setBasicAuthToObject(localVarRequestOptions, configuration); localVarHeaderParameter['Content-Type'] = 'application/json'; localVarHeaderParameter['Accept'] = 'application/vnd.mambu.v2+json'; if (idempotencyKey != null) { localVarHeaderParameter['Idempotency-Key'] = String(idempotencyKey); } setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers, }; localVarRequestOptions.data = serializeDataIfNeeded( communicationMessageAction, localVarRequestOptions, configuration, ); return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, /** * * @summary Get communication message * @param {string} encodedKey The encoded key of the message to be returned. * @param {GetByEncodedKeyDetailsLevelEnum} [detailsLevel] The level of details to return: `FULL` means the full details of the object will be returned (custom field values, address, contact info, or any other related objects) and `BASIC` will return only the first level elements of the object. * @param {*} [options] Override http request option. * @throws {RequiredError} */ getByEncodedKey: async ( encodedKey: string, detailsLevel?: GetByEncodedKeyDetailsLevelEnum, options: RawAxiosRequestConfig = {}, ): Promise => { // verify required parameter 'encodedKey' is not null or undefined assertParamExists('getByEncodedKey', 'encodedKey', encodedKey); const localVarPath = `/communications/messages/{encodedKey}`.replace( `{${'encodedKey'}}`, encodeURIComponent(String(encodedKey)), ); // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; } const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options, }; const localVarHeaderParameter = {} as any; const localVarQueryParameter = {} as any; // authentication basic required // http basic authentication required setBasicAuthToObject(localVarRequestOptions, configuration); if (detailsLevel !== undefined) { localVarQueryParameter['detailsLevel'] = detailsLevel; } localVarHeaderParameter['Accept'] = 'application/vnd.mambu.v2+json'; setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers, }; return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, /** * * @summary Resend failed communication message(s) * @param {CommunicationMessageAction} communicationMessageAction Represents a list of failed communication messages to resend. * @param {string} [idempotencyKey] Key that can be used to support idempotency on this POST. Must be a valid UUID(version 4 is recommended) string and can only be used with the exact same request. Can be used in retry mechanisms to prevent double posting. * @param {*} [options] Override http request option. * @throws {RequiredError} */ resend: async ( communicationMessageAction: CommunicationMessageAction, idempotencyKey?: string, options: RawAxiosRequestConfig = {}, ): Promise => { // verify required parameter 'communicationMessageAction' is not null or undefined assertParamExists( 'resend', 'communicationMessageAction', communicationMessageAction, ); const localVarPath = `/communications/messages:resend`; // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; } const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options, }; const localVarHeaderParameter = {} as any; const localVarQueryParameter = {} as any; // authentication basic required // http basic authentication required setBasicAuthToObject(localVarRequestOptions, configuration); localVarHeaderParameter['Content-Type'] = 'application/json'; localVarHeaderParameter['Accept'] = 'application/vnd.mambu.v2+json'; if (idempotencyKey != null) { localVarHeaderParameter['Idempotency-Key'] = String(idempotencyKey); } setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers, }; localVarRequestOptions.data = serializeDataIfNeeded( communicationMessageAction, localVarRequestOptions, configuration, ); return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, /** * * @summary Searching communication messages * @param {Array} communicationMessageFilterCriteria Represents search criteria for communication messages. * @param {number} [offset] Pagination, index to start searching at when retrieving elements, used in combination with limit to paginate results * @param {number} [limit] Pagination, the number of elements to retrieve, used in combination with offset to paginate results * @param {SearchPaginationDetailsEnum} [paginationDetails] Flag specifying whether the pagination details should be provided in response headers. Please note that by default it is disabled (OFF), in order to improve the performance of the APIs * @param {SearchDetailsLevelEnum} [detailsLevel] The level of details to return: `FULL` means the full details of the object will be returned (custom field values, address, contact info, or any other related objects) and `BASIC` will return only the first level elements of the object. * @param {*} [options] Override http request option. * @throws {RequiredError} */ search: async ( communicationMessageFilterCriteria: Array, offset?: number, limit?: number, paginationDetails?: SearchPaginationDetailsEnum, detailsLevel?: SearchDetailsLevelEnum, options: RawAxiosRequestConfig = {}, ): Promise => { // verify required parameter 'communicationMessageFilterCriteria' is not null or undefined assertParamExists( 'search', 'communicationMessageFilterCriteria', communicationMessageFilterCriteria, ); const localVarPath = `/communications/messages:search`; // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; } const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options, }; const localVarHeaderParameter = {} as any; const localVarQueryParameter = {} as any; // authentication basic required // http basic authentication required setBasicAuthToObject(localVarRequestOptions, configuration); if (offset !== undefined) { localVarQueryParameter['offset'] = offset; } if (limit !== undefined) { localVarQueryParameter['limit'] = limit; } if (paginationDetails !== undefined) { localVarQueryParameter['paginationDetails'] = paginationDetails; } if (detailsLevel !== undefined) { localVarQueryParameter['detailsLevel'] = detailsLevel; } localVarHeaderParameter['Content-Type'] = 'application/json'; localVarHeaderParameter['Accept'] = 'application/vnd.mambu.v2+json'; setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers, }; localVarRequestOptions.data = serializeDataIfNeeded( communicationMessageFilterCriteria, localVarRequestOptions, configuration, ); return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, /** * * @summary Searching sorted communication messages * @param {CommunicationMessagesSearchSortCriteria} communicationMessagesSearchSortCriteria Represents search criteria for communication messages. * @param {number} [offset] Pagination, index to start searching at when retrieving elements, used in combination with limit to paginate results * @param {number} [limit] Pagination, the number of elements to retrieve, used in combination with offset to paginate results * @param {Search1PaginationDetailsEnum} [paginationDetails] Flag specifying whether the pagination details should be provided in response headers. Please note that by default it is disabled (OFF), in order to improve the performance of the APIs * @param {Search1DetailsLevelEnum} [detailsLevel] The level of details to return: `FULL` means the full details of the object will be returned (custom field values, address, contact info, or any other related objects) and `BASIC` will return only the first level elements of the object. * @param {*} [options] Override http request option. * @throws {RequiredError} */ search1: async ( communicationMessagesSearchSortCriteria: CommunicationMessagesSearchSortCriteria, offset?: number, limit?: number, paginationDetails?: Search1PaginationDetailsEnum, detailsLevel?: Search1DetailsLevelEnum, options: RawAxiosRequestConfig = {}, ): Promise => { // verify required parameter 'communicationMessagesSearchSortCriteria' is not null or undefined assertParamExists( 'search1', 'communicationMessagesSearchSortCriteria', communicationMessagesSearchSortCriteria, ); const localVarPath = `/communications/messages:searchSorted`; // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; } const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options, }; const localVarHeaderParameter = {} as any; const localVarQueryParameter = {} as any; // authentication basic required // http basic authentication required setBasicAuthToObject(localVarRequestOptions, configuration); if (offset !== undefined) { localVarQueryParameter['offset'] = offset; } if (limit !== undefined) { localVarQueryParameter['limit'] = limit; } if (paginationDetails !== undefined) { localVarQueryParameter['paginationDetails'] = paginationDetails; } if (detailsLevel !== undefined) { localVarQueryParameter['detailsLevel'] = detailsLevel; } localVarHeaderParameter['Content-Type'] = 'application/json'; localVarHeaderParameter['Accept'] = 'application/vnd.mambu.v2+json'; setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers, }; localVarRequestOptions.data = serializeDataIfNeeded( communicationMessagesSearchSortCriteria, localVarRequestOptions, configuration, ); return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, /** * * @summary Send communication message * @param {CommunicationMessage} communicationMessage Communication message to be created. * @param {string} [idempotencyKey] Key that can be used to support idempotency on this POST. Must be a valid UUID(version 4 is recommended) string and can only be used with the exact same request. Can be used in retry mechanisms to prevent double posting. * @param {*} [options] Override http request option. * @throws {RequiredError} */ send: async ( communicationMessage: CommunicationMessage, idempotencyKey?: string, options: RawAxiosRequestConfig = {}, ): Promise => { // verify required parameter 'communicationMessage' is not null or undefined assertParamExists('send', 'communicationMessage', communicationMessage); const localVarPath = `/communications/messages`; // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; } const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options, }; const localVarHeaderParameter = {} as any; const localVarQueryParameter = {} as any; // authentication basic required // http basic authentication required setBasicAuthToObject(localVarRequestOptions, configuration); localVarHeaderParameter['Content-Type'] = 'application/json'; localVarHeaderParameter['Accept'] = 'application/vnd.mambu.v2+json'; if (idempotencyKey != null) { localVarHeaderParameter['Idempotency-Key'] = String(idempotencyKey); } setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers, }; localVarRequestOptions.data = serializeDataIfNeeded( communicationMessage, localVarRequestOptions, configuration, ); return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, }; }; /** * CommunicationsApi - functional programming interface */ export const CommunicationsApiFp = function (configuration?: Configuration) { const localVarAxiosParamCreator = CommunicationsApiAxiosParamCreator(configuration); return { /** * * @summary Resend failed communication message(s) asynchronously by date * @param {CommunicationMessageEnqueueAction} communicationMessageEnqueueAction Resend failed communication message(s) asynchronously by date * @param {string} [idempotencyKey] Key that can be used to support idempotency on this POST. Must be a valid UUID(version 4 is recommended) string and can only be used with the exact same request. Can be used in retry mechanisms to prevent double posting. * @param {*} [options] Override http request option. * @throws {RequiredError} */ async enqueueByDate( communicationMessageEnqueueAction: CommunicationMessageEnqueueAction, idempotencyKey?: string, options?: RawAxiosRequestConfig, ): Promise< (axios?: AxiosInstance, basePath?: string) => AxiosPromise > { const localVarAxiosArgs = await localVarAxiosParamCreator.enqueueByDate( communicationMessageEnqueueAction, idempotencyKey, options, ); const localVarOperationServerIndex = configuration?.serverIndex ?? 0; const localVarOperationServerBasePath = operationServerMap['CommunicationsApi.enqueueByDate']?.[ localVarOperationServerIndex ]?.url; return (axios, basePath) => createRequestFunction( localVarAxiosArgs, globalAxios, BASE_PATH, configuration, )(axios, localVarOperationServerBasePath || basePath); }, /** * * @summary Resend failed communication message(s) asynchronously using keys * @param {CommunicationMessageAction} communicationMessageAction Resend failed communication message(s) asynchronously using keys * @param {string} [idempotencyKey] Key that can be used to support idempotency on this POST. Must be a valid UUID(version 4 is recommended) string and can only be used with the exact same request. Can be used in retry mechanisms to prevent double posting. * @param {*} [options] Override http request option. * @throws {RequiredError} */ async enqueueByKeys( communicationMessageAction: CommunicationMessageAction, idempotencyKey?: string, options?: RawAxiosRequestConfig, ): Promise< (axios?: AxiosInstance, basePath?: string) => AxiosPromise > { const localVarAxiosArgs = await localVarAxiosParamCreator.enqueueByKeys( communicationMessageAction, idempotencyKey, options, ); const localVarOperationServerIndex = configuration?.serverIndex ?? 0; const localVarOperationServerBasePath = operationServerMap['CommunicationsApi.enqueueByKeys']?.[ localVarOperationServerIndex ]?.url; return (axios, basePath) => createRequestFunction( localVarAxiosArgs, globalAxios, BASE_PATH, configuration, )(axios, localVarOperationServerBasePath || basePath); }, /** * * @summary Get communication message * @param {string} encodedKey The encoded key of the message to be returned. * @param {GetByEncodedKeyDetailsLevelEnum} [detailsLevel] The level of details to return: `FULL` means the full details of the object will be returned (custom field values, address, contact info, or any other related objects) and `BASIC` will return only the first level elements of the object. * @param {*} [options] Override http request option. * @throws {RequiredError} */ async getByEncodedKey( encodedKey: string, detailsLevel?: GetByEncodedKeyDetailsLevelEnum, options?: RawAxiosRequestConfig, ): Promise< ( axios?: AxiosInstance, basePath?: string, ) => AxiosPromise > { const localVarAxiosArgs = await localVarAxiosParamCreator.getByEncodedKey( encodedKey, detailsLevel, options, ); const localVarOperationServerIndex = configuration?.serverIndex ?? 0; const localVarOperationServerBasePath = operationServerMap['CommunicationsApi.getByEncodedKey']?.[ localVarOperationServerIndex ]?.url; return (axios, basePath) => createRequestFunction( localVarAxiosArgs, globalAxios, BASE_PATH, configuration, )(axios, localVarOperationServerBasePath || basePath); }, /** * * @summary Resend failed communication message(s) * @param {CommunicationMessageAction} communicationMessageAction Represents a list of failed communication messages to resend. * @param {string} [idempotencyKey] Key that can be used to support idempotency on this POST. Must be a valid UUID(version 4 is recommended) string and can only be used with the exact same request. Can be used in retry mechanisms to prevent double posting. * @param {*} [options] Override http request option. * @throws {RequiredError} */ async resend( communicationMessageAction: CommunicationMessageAction, idempotencyKey?: string, options?: RawAxiosRequestConfig, ): Promise< (axios?: AxiosInstance, basePath?: string) => AxiosPromise > { const localVarAxiosArgs = await localVarAxiosParamCreator.resend( communicationMessageAction, idempotencyKey, options, ); const localVarOperationServerIndex = configuration?.serverIndex ?? 0; const localVarOperationServerBasePath = operationServerMap['CommunicationsApi.resend']?.[ localVarOperationServerIndex ]?.url; return (axios, basePath) => createRequestFunction( localVarAxiosArgs, globalAxios, BASE_PATH, configuration, )(axios, localVarOperationServerBasePath || basePath); }, /** * * @summary Searching communication messages * @param {Array} communicationMessageFilterCriteria Represents search criteria for communication messages. * @param {number} [offset] Pagination, index to start searching at when retrieving elements, used in combination with limit to paginate results * @param {number} [limit] Pagination, the number of elements to retrieve, used in combination with offset to paginate results * @param {SearchPaginationDetailsEnum} [paginationDetails] Flag specifying whether the pagination details should be provided in response headers. Please note that by default it is disabled (OFF), in order to improve the performance of the APIs * @param {SearchDetailsLevelEnum} [detailsLevel] The level of details to return: `FULL` means the full details of the object will be returned (custom field values, address, contact info, or any other related objects) and `BASIC` will return only the first level elements of the object. * @param {*} [options] Override http request option. * @throws {RequiredError} */ async search( communicationMessageFilterCriteria: Array, offset?: number, limit?: number, paginationDetails?: SearchPaginationDetailsEnum, detailsLevel?: SearchDetailsLevelEnum, options?: RawAxiosRequestConfig, ): Promise< ( axios?: AxiosInstance, basePath?: string, ) => AxiosPromise> > { const localVarAxiosArgs = await localVarAxiosParamCreator.search( communicationMessageFilterCriteria, offset, limit, paginationDetails, detailsLevel, options, ); const localVarOperationServerIndex = configuration?.serverIndex ?? 0; const localVarOperationServerBasePath = operationServerMap['CommunicationsApi.search']?.[ localVarOperationServerIndex ]?.url; return (axios, basePath) => createRequestFunction( localVarAxiosArgs, globalAxios, BASE_PATH, configuration, )(axios, localVarOperationServerBasePath || basePath); }, /** * * @summary Searching sorted communication messages * @param {CommunicationMessagesSearchSortCriteria} communicationMessagesSearchSortCriteria Represents search criteria for communication messages. * @param {number} [offset] Pagination, index to start searching at when retrieving elements, used in combination with limit to paginate results * @param {number} [limit] Pagination, the number of elements to retrieve, used in combination with offset to paginate results * @param {Search1PaginationDetailsEnum} [paginationDetails] Flag specifying whether the pagination details should be provided in response headers. Please note that by default it is disabled (OFF), in order to improve the performance of the APIs * @param {Search1DetailsLevelEnum} [detailsLevel] The level of details to return: `FULL` means the full details of the object will be returned (custom field values, address, contact info, or any other related objects) and `BASIC` will return only the first level elements of the object. * @param {*} [options] Override http request option. * @throws {RequiredError} */ async search1( communicationMessagesSearchSortCriteria: CommunicationMessagesSearchSortCriteria, offset?: number, limit?: number, paginationDetails?: Search1PaginationDetailsEnum, detailsLevel?: Search1DetailsLevelEnum, options?: RawAxiosRequestConfig, ): Promise< ( axios?: AxiosInstance, basePath?: string, ) => AxiosPromise> > { const localVarAxiosArgs = await localVarAxiosParamCreator.search1( communicationMessagesSearchSortCriteria, offset, limit, paginationDetails, detailsLevel, options, ); const localVarOperationServerIndex = configuration?.serverIndex ?? 0; const localVarOperationServerBasePath = operationServerMap['CommunicationsApi.search1']?.[ localVarOperationServerIndex ]?.url; return (axios, basePath) => createRequestFunction( localVarAxiosArgs, globalAxios, BASE_PATH, configuration, )(axios, localVarOperationServerBasePath || basePath); }, /** * * @summary Send communication message * @param {CommunicationMessage} communicationMessage Communication message to be created. * @param {string} [idempotencyKey] Key that can be used to support idempotency on this POST. Must be a valid UUID(version 4 is recommended) string and can only be used with the exact same request. Can be used in retry mechanisms to prevent double posting. * @param {*} [options] Override http request option. * @throws {RequiredError} */ async send( communicationMessage: CommunicationMessage, idempotencyKey?: string, options?: RawAxiosRequestConfig, ): Promise< ( axios?: AxiosInstance, basePath?: string, ) => AxiosPromise > { const localVarAxiosArgs = await localVarAxiosParamCreator.send( communicationMessage, idempotencyKey, options, ); const localVarOperationServerIndex = configuration?.serverIndex ?? 0; const localVarOperationServerBasePath = operationServerMap['CommunicationsApi.send']?.[ localVarOperationServerIndex ]?.url; return (axios, basePath) => createRequestFunction( localVarAxiosArgs, globalAxios, BASE_PATH, configuration, )(axios, localVarOperationServerBasePath || basePath); }, }; }; /** * CommunicationsApi - factory interface */ export const CommunicationsApiFactory = function ( configuration?: Configuration, basePath?: string, axios?: AxiosInstance, ) { const localVarFp = CommunicationsApiFp(configuration); return { /** * * @summary Resend failed communication message(s) asynchronously by date * @param {CommunicationMessageEnqueueAction} communicationMessageEnqueueAction Resend failed communication message(s) asynchronously by date * @param {string} [idempotencyKey] Key that can be used to support idempotency on this POST. Must be a valid UUID(version 4 is recommended) string and can only be used with the exact same request. Can be used in retry mechanisms to prevent double posting. * @param {*} [options] Override http request option. * @throws {RequiredError} */ enqueueByDate( communicationMessageEnqueueAction: CommunicationMessageEnqueueAction, idempotencyKey?: string, options?: RawAxiosRequestConfig, ): AxiosPromise { return localVarFp .enqueueByDate( communicationMessageEnqueueAction, idempotencyKey, options, ) .then((request) => request(axios, basePath)); }, /** * * @summary Resend failed communication message(s) asynchronously using keys * @param {CommunicationMessageAction} communicationMessageAction Resend failed communication message(s) asynchronously using keys * @param {string} [idempotencyKey] Key that can be used to support idempotency on this POST. Must be a valid UUID(version 4 is recommended) string and can only be used with the exact same request. Can be used in retry mechanisms to prevent double posting. * @param {*} [options] Override http request option. * @throws {RequiredError} */ enqueueByKeys( communicationMessageAction: CommunicationMessageAction, idempotencyKey?: string, options?: RawAxiosRequestConfig, ): AxiosPromise { return localVarFp .enqueueByKeys(communicationMessageAction, idempotencyKey, options) .then((request) => request(axios, basePath)); }, /** * * @summary Get communication message * @param {string} encodedKey The encoded key of the message to be returned. * @param {GetByEncodedKeyDetailsLevelEnum} [detailsLevel] The level of details to return: `FULL` means the full details of the object will be returned (custom field values, address, contact info, or any other related objects) and `BASIC` will return only the first level elements of the object. * @param {*} [options] Override http request option. * @throws {RequiredError} */ getByEncodedKey( encodedKey: string, detailsLevel?: GetByEncodedKeyDetailsLevelEnum, options?: RawAxiosRequestConfig, ): AxiosPromise { return localVarFp .getByEncodedKey(encodedKey, detailsLevel, options) .then((request) => request(axios, basePath)); }, /** * * @summary Resend failed communication message(s) * @param {CommunicationMessageAction} communicationMessageAction Represents a list of failed communication messages to resend. * @param {string} [idempotencyKey] Key that can be used to support idempotency on this POST. Must be a valid UUID(version 4 is recommended) string and can only be used with the exact same request. Can be used in retry mechanisms to prevent double posting. * @param {*} [options] Override http request option. * @throws {RequiredError} */ resend( communicationMessageAction: CommunicationMessageAction, idempotencyKey?: string, options?: RawAxiosRequestConfig, ): AxiosPromise { return localVarFp .resend(communicationMessageAction, idempotencyKey, options) .then((request) => request(axios, basePath)); }, /** * * @summary Searching communication messages * @param {Array} communicationMessageFilterCriteria Represents search criteria for communication messages. * @param {number} [offset] Pagination, index to start searching at when retrieving elements, used in combination with limit to paginate results * @param {number} [limit] Pagination, the number of elements to retrieve, used in combination with offset to paginate results * @param {SearchPaginationDetailsEnum} [paginationDetails] Flag specifying whether the pagination details should be provided in response headers. Please note that by default it is disabled (OFF), in order to improve the performance of the APIs * @param {SearchDetailsLevelEnum} [detailsLevel] The level of details to return: `FULL` means the full details of the object will be returned (custom field values, address, contact info, or any other related objects) and `BASIC` will return only the first level elements of the object. * @param {*} [options] Override http request option. * @throws {RequiredError} */ search( communicationMessageFilterCriteria: Array, offset?: number, limit?: number, paginationDetails?: SearchPaginationDetailsEnum, detailsLevel?: SearchDetailsLevelEnum, options?: RawAxiosRequestConfig, ): AxiosPromise> { return localVarFp .search( communicationMessageFilterCriteria, offset, limit, paginationDetails, detailsLevel, options, ) .then((request) => request(axios, basePath)); }, /** * * @summary Searching sorted communication messages * @param {CommunicationMessagesSearchSortCriteria} communicationMessagesSearchSortCriteria Represents search criteria for communication messages. * @param {number} [offset] Pagination, index to start searching at when retrieving elements, used in combination with limit to paginate results * @param {number} [limit] Pagination, the number of elements to retrieve, used in combination with offset to paginate results * @param {Search1PaginationDetailsEnum} [paginationDetails] Flag specifying whether the pagination details should be provided in response headers. Please note that by default it is disabled (OFF), in order to improve the performance of the APIs * @param {Search1DetailsLevelEnum} [detailsLevel] The level of details to return: `FULL` means the full details of the object will be returned (custom field values, address, contact info, or any other related objects) and `BASIC` will return only the first level elements of the object. * @param {*} [options] Override http request option. * @throws {RequiredError} */ search1( communicationMessagesSearchSortCriteria: CommunicationMessagesSearchSortCriteria, offset?: number, limit?: number, paginationDetails?: Search1PaginationDetailsEnum, detailsLevel?: Search1DetailsLevelEnum, options?: RawAxiosRequestConfig, ): AxiosPromise> { return localVarFp .search1( communicationMessagesSearchSortCriteria, offset, limit, paginationDetails, detailsLevel, options, ) .then((request) => request(axios, basePath)); }, /** * * @summary Send communication message * @param {CommunicationMessage} communicationMessage Communication message to be created. * @param {string} [idempotencyKey] Key that can be used to support idempotency on this POST. Must be a valid UUID(version 4 is recommended) string and can only be used with the exact same request. Can be used in retry mechanisms to prevent double posting. * @param {*} [options] Override http request option. * @throws {RequiredError} */ send( communicationMessage: CommunicationMessage, idempotencyKey?: string, options?: RawAxiosRequestConfig, ): AxiosPromise { return localVarFp .send(communicationMessage, idempotencyKey, options) .then((request) => request(axios, basePath)); }, }; }; /** * CommunicationsApi - object-oriented interface */ export class CommunicationsApi extends BaseAPI { /** * * @summary Resend failed communication message(s) asynchronously by date * @param {CommunicationMessageEnqueueAction} communicationMessageEnqueueAction Resend failed communication message(s) asynchronously by date * @param {string} [idempotencyKey] Key that can be used to support idempotency on this POST. Must be a valid UUID(version 4 is recommended) string and can only be used with the exact same request. Can be used in retry mechanisms to prevent double posting. * @param {*} [options] Override http request option. * @throws {RequiredError} */ public enqueueByDate( communicationMessageEnqueueAction: CommunicationMessageEnqueueAction, idempotencyKey?: string, options?: RawAxiosRequestConfig, ) { return CommunicationsApiFp(this.configuration) .enqueueByDate(communicationMessageEnqueueAction, idempotencyKey, options) .then((request) => request(this.axios, this.basePath)); } /** * * @summary Resend failed communication message(s) asynchronously using keys * @param {CommunicationMessageAction} communicationMessageAction Resend failed communication message(s) asynchronously using keys * @param {string} [idempotencyKey] Key that can be used to support idempotency on this POST. Must be a valid UUID(version 4 is recommended) string and can only be used with the exact same request. Can be used in retry mechanisms to prevent double posting. * @param {*} [options] Override http request option. * @throws {RequiredError} */ public enqueueByKeys( communicationMessageAction: CommunicationMessageAction, idempotencyKey?: string, options?: RawAxiosRequestConfig, ) { return CommunicationsApiFp(this.configuration) .enqueueByKeys(communicationMessageAction, idempotencyKey, options) .then((request) => request(this.axios, this.basePath)); } /** * * @summary Get communication message * @param {string} encodedKey The encoded key of the message to be returned. * @param {GetByEncodedKeyDetailsLevelEnum} [detailsLevel] The level of details to return: `FULL` means the full details of the object will be returned (custom field values, address, contact info, or any other related objects) and `BASIC` will return only the first level elements of the object. * @param {*} [options] Override http request option. * @throws {RequiredError} */ public getByEncodedKey( encodedKey: string, detailsLevel?: GetByEncodedKeyDetailsLevelEnum, options?: RawAxiosRequestConfig, ) { return CommunicationsApiFp(this.configuration) .getByEncodedKey(encodedKey, detailsLevel, options) .then((request) => request(this.axios, this.basePath)); } /** * * @summary Resend failed communication message(s) * @param {CommunicationMessageAction} communicationMessageAction Represents a list of failed communication messages to resend. * @param {string} [idempotencyKey] Key that can be used to support idempotency on this POST. Must be a valid UUID(version 4 is recommended) string and can only be used with the exact same request. Can be used in retry mechanisms to prevent double posting. * @param {*} [options] Override http request option. * @throws {RequiredError} */ public resend( communicationMessageAction: CommunicationMessageAction, idempotencyKey?: string, options?: RawAxiosRequestConfig, ) { return CommunicationsApiFp(this.configuration) .resend(communicationMessageAction, idempotencyKey, options) .then((request) => request(this.axios, this.basePath)); } /** * * @summary Searching communication messages * @param {Array} communicationMessageFilterCriteria Represents search criteria for communication messages. * @param {number} [offset] Pagination, index to start searching at when retrieving elements, used in combination with limit to paginate results * @param {number} [limit] Pagination, the number of elements to retrieve, used in combination with offset to paginate results * @param {SearchPaginationDetailsEnum} [paginationDetails] Flag specifying whether the pagination details should be provided in response headers. Please note that by default it is disabled (OFF), in order to improve the performance of the APIs * @param {SearchDetailsLevelEnum} [detailsLevel] The level of details to return: `FULL` means the full details of the object will be returned (custom field values, address, contact info, or any other related objects) and `BASIC` will return only the first level elements of the object. * @param {*} [options] Override http request option. * @throws {RequiredError} */ public search( communicationMessageFilterCriteria: Array, offset?: number, limit?: number, paginationDetails?: SearchPaginationDetailsEnum, detailsLevel?: SearchDetailsLevelEnum, options?: RawAxiosRequestConfig, ) { return CommunicationsApiFp(this.configuration) .search( communicationMessageFilterCriteria, offset, limit, paginationDetails, detailsLevel, options, ) .then((request) => request(this.axios, this.basePath)); } /** * * @summary Searching sorted communication messages * @param {CommunicationMessagesSearchSortCriteria} communicationMessagesSearchSortCriteria Represents search criteria for communication messages. * @param {number} [offset] Pagination, index to start searching at when retrieving elements, used in combination with limit to paginate results * @param {number} [limit] Pagination, the number of elements to retrieve, used in combination with offset to paginate results * @param {Search1PaginationDetailsEnum} [paginationDetails] Flag specifying whether the pagination details should be provided in response headers. Please note that by default it is disabled (OFF), in order to improve the performance of the APIs * @param {Search1DetailsLevelEnum} [detailsLevel] The level of details to return: `FULL` means the full details of the object will be returned (custom field values, address, contact info, or any other related objects) and `BASIC` will return only the first level elements of the object. * @param {*} [options] Override http request option. * @throws {RequiredError} */ public search1( communicationMessagesSearchSortCriteria: CommunicationMessagesSearchSortCriteria, offset?: number, limit?: number, paginationDetails?: Search1PaginationDetailsEnum, detailsLevel?: Search1DetailsLevelEnum, options?: RawAxiosRequestConfig, ) { return CommunicationsApiFp(this.configuration) .search1( communicationMessagesSearchSortCriteria, offset, limit, paginationDetails, detailsLevel, options, ) .then((request) => request(this.axios, this.basePath)); } /** * * @summary Send communication message * @param {CommunicationMessage} communicationMessage Communication message to be created. * @param {string} [idempotencyKey] Key that can be used to support idempotency on this POST. Must be a valid UUID(version 4 is recommended) string and can only be used with the exact same request. Can be used in retry mechanisms to prevent double posting. * @param {*} [options] Override http request option. * @throws {RequiredError} */ public send( communicationMessage: CommunicationMessage, idempotencyKey?: string, options?: RawAxiosRequestConfig, ) { return CommunicationsApiFp(this.configuration) .send(communicationMessage, idempotencyKey, options) .then((request) => request(this.axios, this.basePath)); } } export const GetByEncodedKeyDetailsLevelEnum = { Basic: 'BASIC', Full: 'FULL', } as const; export type GetByEncodedKeyDetailsLevelEnum = (typeof GetByEncodedKeyDetailsLevelEnum)[keyof typeof GetByEncodedKeyDetailsLevelEnum]; export const SearchPaginationDetailsEnum = { On: 'ON', Off: 'OFF', } as const; export type SearchPaginationDetailsEnum = (typeof SearchPaginationDetailsEnum)[keyof typeof SearchPaginationDetailsEnum]; export const SearchDetailsLevelEnum = { Basic: 'BASIC', Full: 'FULL', } as const; export type SearchDetailsLevelEnum = (typeof SearchDetailsLevelEnum)[keyof typeof SearchDetailsLevelEnum]; export const Search1PaginationDetailsEnum = { On: 'ON', Off: 'OFF', } as const; export type Search1PaginationDetailsEnum = (typeof Search1PaginationDetailsEnum)[keyof typeof Search1PaginationDetailsEnum]; export const Search1DetailsLevelEnum = { Basic: 'BASIC', Full: 'FULL', } as const; export type Search1DetailsLevelEnum = (typeof Search1DetailsLevelEnum)[keyof typeof Search1DetailsLevelEnum];