// tslint:disable
/**
 * Webitel API
 * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
 *
 * The version of the OpenAPI document: 24.04.0
 * Contact: support@webitel.com
 *
 * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
 * https://openapi-generator.tech
 * Do not edit the class manually.
 */
import * as globalImportUrl from 'url';
import globalAxios from 'axios';
// Some imports not used depending on template conditions
// @ts-ignore
import { BASE_PATH, BaseAPI, RequiredError, } from '../base';
/**
 * MessagesApi - axios parameter creator
 * @export
 */
export const MessagesApiAxiosParamCreator = function (configuration) {
    return {
        /**
         *
         * @summary Broadcast message send message from via to peer recipients.
         * @param {WebitelChatBroadcastMessageRequest} body
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        broadcastMessage: async (body, options = {}) => {
            // verify required parameter 'body' is not null or undefined
            if (body === null || body === undefined) {
                throw new RequiredError('body', 'Required parameter body was null or undefined when calling broadcastMessage.');
            }
            const localVarPath = `/chat/broadcast`;
            const localVarUrlObj = globalImportUrl.parse(localVarPath, true);
            let baseOptions;
            if (configuration) {
                baseOptions = configuration.baseOptions;
            }
            const localVarRequestOptions = {
                method: 'POST',
                ...baseOptions,
                ...options,
            };
            const localVarHeaderParameter = {};
            const localVarQueryParameter = {};
            // authentication AccessToken required
            if (configuration && configuration.apiKey) {
                const localVarApiKeyValue = typeof configuration.apiKey === 'function'
                    ? await configuration.apiKey('X-Webitel-Access')
                    : await configuration.apiKey;
                localVarHeaderParameter['X-Webitel-Access'] = localVarApiKeyValue;
            }
            localVarHeaderParameter['Content-Type'] = 'application/json';
            localVarUrlObj.query = {
                ...localVarUrlObj.query,
                ...localVarQueryParameter,
                ...options.query,
            };
            // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943
            delete localVarUrlObj.search;
            let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
            localVarRequestOptions.headers = {
                ...localVarHeaderParameter,
                ...headersFromBaseOptions,
                ...options.headers,
            };
            const needsSerialization = typeof body !== 'string' ||
                localVarRequestOptions.headers['Content-Type'] === 'application/json';
            localVarRequestOptions.data = needsSerialization
                ? JSON.stringify(body !== undefined ? body : {})
                : body || '';
            return {
                url: globalImportUrl.format(localVarUrlObj),
                options: localVarRequestOptions,
            };
        },
        /**
         *
         * @summary Query of external chat customers
         * @param {number} [page] Page number to return. **default**: 1.
         * @param {number} [size] Page records limit. **default**: 16.
         * @param {string} [q] Search term: peer{id,name}
         * @param {Array<string>} [sort] Sort records by { fields } specification.
         * @param {Array<string>} [fields] Fields [Q]uery to build result dataset record.
         * @param {Array<string>} [id] Set of unique contact **ID**entifier(s).
         * @param {string} [type] The type of contact to filter.
         * @param {string} [viaId] Contact unique **ID**entifier. Contact **type**-specific string.
         * @param {string} [viaType] Contact **type** provider.
         * @param {string} [viaName] Contact display **name**.
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        getCustomers: async (page, size, q, sort, fields, id, type, viaId, viaType, viaName, options = {}) => {
            const localVarPath = `/chat/customers`;
            const localVarUrlObj = globalImportUrl.parse(localVarPath, true);
            let baseOptions;
            if (configuration) {
                baseOptions = configuration.baseOptions;
            }
            const localVarRequestOptions = {
                method: 'GET',
                ...baseOptions,
                ...options,
            };
            const localVarHeaderParameter = {};
            const localVarQueryParameter = {};
            // authentication AccessToken required
            if (configuration && configuration.apiKey) {
                const localVarApiKeyValue = typeof configuration.apiKey === 'function'
                    ? await configuration.apiKey('X-Webitel-Access')
                    : await configuration.apiKey;
                localVarHeaderParameter['X-Webitel-Access'] = localVarApiKeyValue;
            }
            if (page !== undefined) {
                localVarQueryParameter['page'] = page;
            }
            if (size !== undefined) {
                localVarQueryParameter['size'] = size;
            }
            if (q !== undefined) {
                localVarQueryParameter['q'] = q;
            }
            if (sort) {
                localVarQueryParameter['sort'] = sort;
            }
            if (fields) {
                localVarQueryParameter['fields'] = fields;
            }
            if (id) {
                localVarQueryParameter['id'] = id;
            }
            if (type !== undefined) {
                localVarQueryParameter['type'] = type;
            }
            if (viaId !== undefined) {
                localVarQueryParameter['via.id'] = viaId;
            }
            if (viaType !== undefined) {
                localVarQueryParameter['via.type'] = viaType;
            }
            if (viaName !== undefined) {
                localVarQueryParameter['via.name'] = viaName;
            }
            localVarUrlObj.query = {
                ...localVarUrlObj.query,
                ...localVarQueryParameter,
                ...options.query,
            };
            // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943
            delete localVarUrlObj.search;
            let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
            localVarRequestOptions.headers = {
                ...localVarHeaderParameter,
                ...headersFromBaseOptions,
                ...options.headers,
            };
            return {
                url: globalImportUrl.format(localVarUrlObj),
                options: localVarRequestOptions,
            };
        },
        /**
         *
         * @summary Query of chat conversations
         * @param {number} [page] Page number to return. **default**: 1.
         * @param {number} [size] Page records limit. **default**: 16.
         * @param {string} [q] Search term: peer.name
         * @param {Array<string>} [sort] Sort records by { fields } specification.
         * @param {Array<string>} [fields] Fields [Q]uery to build result dataset record.
         * @param {Array<string>} [id] Set of unique chat IDentifier(s). Accept: dialog -or- member ID.
         * @param {string} [viaId] Contact unique **ID**entifier. Contact **type**-specific string.
         * @param {string} [viaType] Contact **type** provider.
         * @param {string} [viaName] Contact display **name**.
         * @param {string} [peerId] Contact unique **ID**entifier. Contact **type**-specific string.
         * @param {string} [peerType] Contact **type** provider.
         * @param {string} [peerName] Contact display **name**.
         * @param {string} [dateSince] Since epochtime (milli). **Match**: greater than ..
         * @param {string} [dateUntil] Until epochtime (milli). **Match**: less or equal ..
         * @param {boolean} [online] Dialogs ONLY that are currently [not] active( closed: ? ).
         * @param {string} [groupString] Includes ONLY those chat dialogs whose member channel(s) contain a specified set of variables.  10
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        getDialogs: async (page, size, q, sort, fields, id, viaId, viaType, viaName, peerId, peerType, peerName, dateSince, dateUntil, online, groupString, options = {}) => {
            const localVarPath = `/chat/dialogs`;
            const localVarUrlObj = globalImportUrl.parse(localVarPath, true);
            let baseOptions;
            if (configuration) {
                baseOptions = configuration.baseOptions;
            }
            const localVarRequestOptions = {
                method: 'GET',
                ...baseOptions,
                ...options,
            };
            const localVarHeaderParameter = {};
            const localVarQueryParameter = {};
            // authentication AccessToken required
            if (configuration && configuration.apiKey) {
                const localVarApiKeyValue = typeof configuration.apiKey === 'function'
                    ? await configuration.apiKey('X-Webitel-Access')
                    : await configuration.apiKey;
                localVarHeaderParameter['X-Webitel-Access'] = localVarApiKeyValue;
            }
            if (page !== undefined) {
                localVarQueryParameter['page'] = page;
            }
            if (size !== undefined) {
                localVarQueryParameter['size'] = size;
            }
            if (q !== undefined) {
                localVarQueryParameter['q'] = q;
            }
            if (sort) {
                localVarQueryParameter['sort'] = sort;
            }
            if (fields) {
                localVarQueryParameter['fields'] = fields;
            }
            if (id) {
                localVarQueryParameter['id'] = id;
            }
            if (viaId !== undefined) {
                localVarQueryParameter['via.id'] = viaId;
            }
            if (viaType !== undefined) {
                localVarQueryParameter['via.type'] = viaType;
            }
            if (viaName !== undefined) {
                localVarQueryParameter['via.name'] = viaName;
            }
            if (peerId !== undefined) {
                localVarQueryParameter['peer.id'] = peerId;
            }
            if (peerType !== undefined) {
                localVarQueryParameter['peer.type'] = peerType;
            }
            if (peerName !== undefined) {
                localVarQueryParameter['peer.name'] = peerName;
            }
            if (dateSince !== undefined) {
                localVarQueryParameter['date.since'] = dateSince;
            }
            if (dateUntil !== undefined) {
                localVarQueryParameter['date.until'] = dateUntil;
            }
            if (online !== undefined) {
                localVarQueryParameter['online'] = online;
            }
            if (groupString !== undefined) {
                localVarQueryParameter['group[string]'] = groupString;
            }
            localVarUrlObj.query = {
                ...localVarUrlObj.query,
                ...localVarQueryParameter,
                ...options.query,
            };
            // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943
            delete localVarUrlObj.search;
            let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
            localVarRequestOptions.headers = {
                ...localVarHeaderParameter,
                ...headersFromBaseOptions,
                ...options.headers,
            };
            return {
                url: globalImportUrl.format(localVarUrlObj),
                options: localVarRequestOptions,
            };
        },
        /**
         *
         * @summary Query of the chat history
         * @param {string} chatId Unique chat dialog
         * @param {string} [offsetId] Messages ONLY starting from the specified message ID
         * @param {string} [offsetDate] Messages ONLY been sent before the specified epochtime(milli).
         * @param {number} [limit] Number of messages to return.
         * @param {string} [q] Search term: message.text
         * @param {Array<string>} [fields] Fields to return into result.
         * @param {string} [peerId] Contact unique **ID**entifier. Contact **type**-specific string.
         * @param {string} [peerType] Contact **type** provider.
         * @param {string} [peerName] Contact display **name**.
         * @param {string} [groupString] Includes the history of ONLY those dialogs whose member channel(s) contain a specified set of variables.
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        getHistory: async (chatId, offsetId, offsetDate, limit, q, fields, peerId, peerType, peerName, groupString, options = {}) => {
            // verify required parameter 'chatId' is not null or undefined
            if (chatId === null || chatId === undefined) {
                throw new RequiredError('chatId', 'Required parameter chatId was null or undefined when calling getHistory.');
            }
            const localVarPath = `/chat/dialogs/{chat_id}/messages`.replace(`{${'chat_id'}}`, encodeURIComponent(String(chatId)));
            const localVarUrlObj = globalImportUrl.parse(localVarPath, true);
            let baseOptions;
            if (configuration) {
                baseOptions = configuration.baseOptions;
            }
            const localVarRequestOptions = {
                method: 'GET',
                ...baseOptions,
                ...options,
            };
            const localVarHeaderParameter = {};
            const localVarQueryParameter = {};
            // authentication AccessToken required
            if (configuration && configuration.apiKey) {
                const localVarApiKeyValue = typeof configuration.apiKey === 'function'
                    ? await configuration.apiKey('X-Webitel-Access')
                    : await configuration.apiKey;
                localVarHeaderParameter['X-Webitel-Access'] = localVarApiKeyValue;
            }
            if (offsetId !== undefined) {
                localVarQueryParameter['offset.id'] = offsetId;
            }
            if (offsetDate !== undefined) {
                localVarQueryParameter['offset.date'] = offsetDate;
            }
            if (limit !== undefined) {
                localVarQueryParameter['limit'] = limit;
            }
            if (q !== undefined) {
                localVarQueryParameter['q'] = q;
            }
            if (fields) {
                localVarQueryParameter['fields'] = fields;
            }
            if (peerId !== undefined) {
                localVarQueryParameter['peer.id'] = peerId;
            }
            if (peerType !== undefined) {
                localVarQueryParameter['peer.type'] = peerType;
            }
            if (peerName !== undefined) {
                localVarQueryParameter['peer.name'] = peerName;
            }
            if (groupString !== undefined) {
                localVarQueryParameter['group[string]'] = groupString;
            }
            localVarUrlObj.query = {
                ...localVarUrlObj.query,
                ...localVarQueryParameter,
                ...options.query,
            };
            // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943
            delete localVarUrlObj.search;
            let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
            localVarRequestOptions.headers = {
                ...localVarHeaderParameter,
                ...headersFromBaseOptions,
                ...options.headers,
            };
            return {
                url: globalImportUrl.format(localVarUrlObj),
                options: localVarRequestOptions,
            };
        },
        /**
         *
         * @summary Query of the chat history
         * @param {string} peerType Contact **type** provider.
         * @param {string} peerId Contact unique **ID**entifier. Contact **type**-specific string.
         * @param {string} [offsetId] Messages ONLY starting from the specified message ID
         * @param {string} [offsetDate] Messages ONLY been sent before the specified epochtime(milli).
         * @param {number} [limit] Number of messages to return.
         * @param {string} [q] Search term: message.text
         * @param {Array<string>} [fields] Fields to return into result.
         * @param {string} [chatId] Unique chat dialog
         * @param {string} [peerName] Contact display **name**.
         * @param {string} [groupStringString] Includes the history of ONLY those dialogs whose member channel(s) contain a specified set of variables.
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        getHistory2: async (peerType, peerId, offsetId, offsetDate, limit, q, fields, chatId, peerName, groupStringString, options = {}) => {
            // verify required parameter 'peerType' is not null or undefined
            if (peerType === null || peerType === undefined) {
                throw new RequiredError('peerType', 'Required parameter peerType was null or undefined when calling getHistory2.');
            }
            // verify required parameter 'peerId' is not null or undefined
            if (peerId === null || peerId === undefined) {
                throw new RequiredError('peerId', 'Required parameter peerId was null or undefined when calling getHistory2.');
            }
            const localVarPath = `/chat/{peer.type}/{peer.id}/messages`
                .replace(`{${'peer.type'}}`, encodeURIComponent(String(peerType)))
                .replace(`{${'peer.id'}}`, encodeURIComponent(String(peerId)));
            const localVarUrlObj = globalImportUrl.parse(localVarPath, true);
            let baseOptions;
            if (configuration) {
                baseOptions = configuration.baseOptions;
            }
            const localVarRequestOptions = {
                method: 'GET',
                ...baseOptions,
                ...options,
            };
            const localVarHeaderParameter = {};
            const localVarQueryParameter = {};
            // authentication AccessToken required
            if (configuration && configuration.apiKey) {
                const localVarApiKeyValue = typeof configuration.apiKey === 'function'
                    ? await configuration.apiKey('X-Webitel-Access')
                    : await configuration.apiKey;
                localVarHeaderParameter['X-Webitel-Access'] = localVarApiKeyValue;
            }
            if (offsetId !== undefined) {
                localVarQueryParameter['offset.id'] = offsetId;
            }
            if (offsetDate !== undefined) {
                localVarQueryParameter['offset.date'] = offsetDate;
            }
            if (limit !== undefined) {
                localVarQueryParameter['limit'] = limit;
            }
            if (q !== undefined) {
                localVarQueryParameter['q'] = q;
            }
            if (fields) {
                localVarQueryParameter['fields'] = fields;
            }
            if (chatId !== undefined) {
                localVarQueryParameter['chat_id'] = chatId;
            }
            if (peerName !== undefined) {
                localVarQueryParameter['peer.name'] = peerName;
            }
            if (groupStringString !== undefined) {
                localVarQueryParameter['group[string][string]'] = groupStringString;
            }
            localVarUrlObj.query = {
                ...localVarUrlObj.query,
                ...localVarQueryParameter,
                ...options.query,
            };
            // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943
            delete localVarUrlObj.search;
            let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
            localVarRequestOptions.headers = {
                ...localVarHeaderParameter,
                ...headersFromBaseOptions,
                ...options.headers,
            };
            return {
                url: globalImportUrl.format(localVarUrlObj),
                options: localVarRequestOptions,
            };
        },
        /**
         *
         * @summary Query of chat participants
         * @param {string} chatId ID of the chat dialog.
         * @param {number} [page] Page number to return. **default**: 1.
         * @param {number} [size] Page records limit. **default**: 16.
         * @param {string} [q] Search term: peer(type;name)
         * @param {Array<string>} [sort] Sort records by { fields } specification.
         * @param {Array<string>} [fields] Fields [Q]uery to build result dataset record.
         * @param {Array<string>} [id] Set of unique chat member ID.
         * @param {string} [viaId] Contact unique **ID**entifier. Contact **type**-specific string.
         * @param {string} [viaType] Contact **type** provider.
         * @param {string} [viaName] Contact display **name**.
         * @param {string} [peerId] Contact unique **ID**entifier. Contact **type**-specific string.
         * @param {string} [peerType] Contact **type** provider.
         * @param {string} [peerName] Contact display **name**.
         * @param {string} [dateSince] Since epochtime (milli). **Match**: greater than ..
         * @param {string} [dateUntil] Until epochtime (milli). **Match**: less or equal ..
         * @param {boolean} [online] Participants ONLY who are currently [not] connected to the chat. ( left: ( 0 ? online : offline ) )
         * @param {boolean} [joined] Participants ONLY who have [not] been connected to the chat. ( join: ( 0 ? [request|abandoned] : connected ) )
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        getMembers: async (chatId, page, size, q, sort, fields, id, viaId, viaType, viaName, peerId, peerType, peerName, dateSince, dateUntil, online, joined, options = {}) => {
            // verify required parameter 'chatId' is not null or undefined
            if (chatId === null || chatId === undefined) {
                throw new RequiredError('chatId', 'Required parameter chatId was null or undefined when calling getMembers.');
            }
            const localVarPath = `/chat/dialogs/{chat_id}/members`.replace(`{${'chat_id'}}`, encodeURIComponent(String(chatId)));
            const localVarUrlObj = globalImportUrl.parse(localVarPath, true);
            let baseOptions;
            if (configuration) {
                baseOptions = configuration.baseOptions;
            }
            const localVarRequestOptions = {
                method: 'GET',
                ...baseOptions,
                ...options,
            };
            const localVarHeaderParameter = {};
            const localVarQueryParameter = {};
            // authentication AccessToken required
            if (configuration && configuration.apiKey) {
                const localVarApiKeyValue = typeof configuration.apiKey === 'function'
                    ? await configuration.apiKey('X-Webitel-Access')
                    : await configuration.apiKey;
                localVarHeaderParameter['X-Webitel-Access'] = localVarApiKeyValue;
            }
            if (page !== undefined) {
                localVarQueryParameter['page'] = page;
            }
            if (size !== undefined) {
                localVarQueryParameter['size'] = size;
            }
            if (q !== undefined) {
                localVarQueryParameter['q'] = q;
            }
            if (sort) {
                localVarQueryParameter['sort'] = sort;
            }
            if (fields) {
                localVarQueryParameter['fields'] = fields;
            }
            if (id) {
                localVarQueryParameter['id'] = id;
            }
            if (viaId !== undefined) {
                localVarQueryParameter['via.id'] = viaId;
            }
            if (viaType !== undefined) {
                localVarQueryParameter['via.type'] = viaType;
            }
            if (viaName !== undefined) {
                localVarQueryParameter['via.name'] = viaName;
            }
            if (peerId !== undefined) {
                localVarQueryParameter['peer.id'] = peerId;
            }
            if (peerType !== undefined) {
                localVarQueryParameter['peer.type'] = peerType;
            }
            if (peerName !== undefined) {
                localVarQueryParameter['peer.name'] = peerName;
            }
            if (dateSince !== undefined) {
                localVarQueryParameter['date.since'] = dateSince;
            }
            if (dateUntil !== undefined) {
                localVarQueryParameter['date.until'] = dateUntil;
            }
            if (online !== undefined) {
                localVarQueryParameter['online'] = online;
            }
            if (joined !== undefined) {
                localVarQueryParameter['joined'] = joined;
            }
            localVarUrlObj.query = {
                ...localVarUrlObj.query,
                ...localVarQueryParameter,
                ...options.query,
            };
            // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943
            delete localVarUrlObj.search;
            let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
            localVarRequestOptions.headers = {
                ...localVarHeaderParameter,
                ...headersFromBaseOptions,
                ...options.headers,
            };
            return {
                url: globalImportUrl.format(localVarUrlObj),
                options: localVarRequestOptions,
            };
        },
    };
};
/**
 * MessagesApi - functional programming interface
 * @export
 */
export const MessagesApiFp = function (configuration) {
    return {
        /**
         *
         * @summary Broadcast message send message from via to peer recipients.
         * @param {WebitelChatBroadcastMessageRequest} body
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        async broadcastMessage(body, options) {
            const localVarAxiosArgs = await MessagesApiAxiosParamCreator(configuration).broadcastMessage(body, options);
            return (axios = globalAxios, basePath = BASE_PATH) => {
                const axiosRequestArgs = {
                    ...localVarAxiosArgs.options,
                    url: basePath + localVarAxiosArgs.url,
                };
                return axios.request(axiosRequestArgs);
            };
        },
        /**
         *
         * @summary Query of external chat customers
         * @param {number} [page] Page number to return. **default**: 1.
         * @param {number} [size] Page records limit. **default**: 16.
         * @param {string} [q] Search term: peer{id,name}
         * @param {Array<string>} [sort] Sort records by { fields } specification.
         * @param {Array<string>} [fields] Fields [Q]uery to build result dataset record.
         * @param {Array<string>} [id] Set of unique contact **ID**entifier(s).
         * @param {string} [type] The type of contact to filter.
         * @param {string} [viaId] Contact unique **ID**entifier. Contact **type**-specific string.
         * @param {string} [viaType] Contact **type** provider.
         * @param {string} [viaName] Contact display **name**.
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        async getCustomers(page, size, q, sort, fields, id, type, viaId, viaType, viaName, options) {
            const localVarAxiosArgs = await MessagesApiAxiosParamCreator(configuration).getCustomers(page, size, q, sort, fields, id, type, viaId, viaType, viaName, options);
            return (axios = globalAxios, basePath = BASE_PATH) => {
                const axiosRequestArgs = {
                    ...localVarAxiosArgs.options,
                    url: basePath + localVarAxiosArgs.url,
                };
                return axios.request(axiosRequestArgs);
            };
        },
        /**
         *
         * @summary Query of chat conversations
         * @param {number} [page] Page number to return. **default**: 1.
         * @param {number} [size] Page records limit. **default**: 16.
         * @param {string} [q] Search term: peer.name
         * @param {Array<string>} [sort] Sort records by { fields } specification.
         * @param {Array<string>} [fields] Fields [Q]uery to build result dataset record.
         * @param {Array<string>} [id] Set of unique chat IDentifier(s). Accept: dialog -or- member ID.
         * @param {string} [viaId] Contact unique **ID**entifier. Contact **type**-specific string.
         * @param {string} [viaType] Contact **type** provider.
         * @param {string} [viaName] Contact display **name**.
         * @param {string} [peerId] Contact unique **ID**entifier. Contact **type**-specific string.
         * @param {string} [peerType] Contact **type** provider.
         * @param {string} [peerName] Contact display **name**.
         * @param {string} [dateSince] Since epochtime (milli). **Match**: greater than ..
         * @param {string} [dateUntil] Until epochtime (milli). **Match**: less or equal ..
         * @param {boolean} [online] Dialogs ONLY that are currently [not] active( closed: ? ).
         * @param {string} [groupString] Includes ONLY those chat dialogs whose member channel(s) contain a specified set of variables.  10
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        async getDialogs(page, size, q, sort, fields, id, viaId, viaType, viaName, peerId, peerType, peerName, dateSince, dateUntil, online, groupString, options) {
            const localVarAxiosArgs = await MessagesApiAxiosParamCreator(configuration).getDialogs(page, size, q, sort, fields, id, viaId, viaType, viaName, peerId, peerType, peerName, dateSince, dateUntil, online, groupString, options);
            return (axios = globalAxios, basePath = BASE_PATH) => {
                const axiosRequestArgs = {
                    ...localVarAxiosArgs.options,
                    url: basePath + localVarAxiosArgs.url,
                };
                return axios.request(axiosRequestArgs);
            };
        },
        /**
         *
         * @summary Query of the chat history
         * @param {string} chatId Unique chat dialog
         * @param {string} [offsetId] Messages ONLY starting from the specified message ID
         * @param {string} [offsetDate] Messages ONLY been sent before the specified epochtime(milli).
         * @param {number} [limit] Number of messages to return.
         * @param {string} [q] Search term: message.text
         * @param {Array<string>} [fields] Fields to return into result.
         * @param {string} [peerId] Contact unique **ID**entifier. Contact **type**-specific string.
         * @param {string} [peerType] Contact **type** provider.
         * @param {string} [peerName] Contact display **name**.
         * @param {string} [groupString] Includes the history of ONLY those dialogs whose member channel(s) contain a specified set of variables.
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        async getHistory(chatId, offsetId, offsetDate, limit, q, fields, peerId, peerType, peerName, groupString, options) {
            const localVarAxiosArgs = await MessagesApiAxiosParamCreator(configuration).getHistory(chatId, offsetId, offsetDate, limit, q, fields, peerId, peerType, peerName, groupString, options);
            return (axios = globalAxios, basePath = BASE_PATH) => {
                const axiosRequestArgs = {
                    ...localVarAxiosArgs.options,
                    url: basePath + localVarAxiosArgs.url,
                };
                return axios.request(axiosRequestArgs);
            };
        },
        /**
         *
         * @summary Query of the chat history
         * @param {string} peerType Contact **type** provider.
         * @param {string} peerId Contact unique **ID**entifier. Contact **type**-specific string.
         * @param {string} [offsetId] Messages ONLY starting from the specified message ID
         * @param {string} [offsetDate] Messages ONLY been sent before the specified epochtime(milli).
         * @param {number} [limit] Number of messages to return.
         * @param {string} [q] Search term: message.text
         * @param {Array<string>} [fields] Fields to return into result.
         * @param {string} [chatId] Unique chat dialog
         * @param {string} [peerName] Contact display **name**.
         * @param {string} [groupStringString] Includes the history of ONLY those dialogs whose member channel(s) contain a specified set of variables.
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        async getHistory2(peerType, peerId, offsetId, offsetDate, limit, q, fields, chatId, peerName, groupStringString, options) {
            const localVarAxiosArgs = await MessagesApiAxiosParamCreator(configuration).getHistory2(peerType, peerId, offsetId, offsetDate, limit, q, fields, chatId, peerName, groupStringString, options);
            return (axios = globalAxios, basePath = BASE_PATH) => {
                const axiosRequestArgs = {
                    ...localVarAxiosArgs.options,
                    url: basePath + localVarAxiosArgs.url,
                };
                return axios.request(axiosRequestArgs);
            };
        },
        /**
         *
         * @summary Query of chat participants
         * @param {string} chatId ID of the chat dialog.
         * @param {number} [page] Page number to return. **default**: 1.
         * @param {number} [size] Page records limit. **default**: 16.
         * @param {string} [q] Search term: peer(type;name)
         * @param {Array<string>} [sort] Sort records by { fields } specification.
         * @param {Array<string>} [fields] Fields [Q]uery to build result dataset record.
         * @param {Array<string>} [id] Set of unique chat member ID.
         * @param {string} [viaId] Contact unique **ID**entifier. Contact **type**-specific string.
         * @param {string} [viaType] Contact **type** provider.
         * @param {string} [viaName] Contact display **name**.
         * @param {string} [peerId] Contact unique **ID**entifier. Contact **type**-specific string.
         * @param {string} [peerType] Contact **type** provider.
         * @param {string} [peerName] Contact display **name**.
         * @param {string} [dateSince] Since epochtime (milli). **Match**: greater than ..
         * @param {string} [dateUntil] Until epochtime (milli). **Match**: less or equal ..
         * @param {boolean} [online] Participants ONLY who are currently [not] connected to the chat. ( left: ( 0 ? online : offline ) )
         * @param {boolean} [joined] Participants ONLY who have [not] been connected to the chat. ( join: ( 0 ? [request|abandoned] : connected ) )
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        async getMembers(chatId, page, size, q, sort, fields, id, viaId, viaType, viaName, peerId, peerType, peerName, dateSince, dateUntil, online, joined, options) {
            const localVarAxiosArgs = await MessagesApiAxiosParamCreator(configuration).getMembers(chatId, page, size, q, sort, fields, id, viaId, viaType, viaName, peerId, peerType, peerName, dateSince, dateUntil, online, joined, options);
            return (axios = globalAxios, basePath = BASE_PATH) => {
                const axiosRequestArgs = {
                    ...localVarAxiosArgs.options,
                    url: basePath + localVarAxiosArgs.url,
                };
                return axios.request(axiosRequestArgs);
            };
        },
    };
};
/**
 * MessagesApi - factory interface
 * @export
 */
export const MessagesApiFactory = function (configuration, basePath, axios) {
    return {
        /**
         *
         * @summary Broadcast message send message from via to peer recipients.
         * @param {WebitelChatBroadcastMessageRequest} body
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        broadcastMessage(body, options) {
            return MessagesApiFp(configuration)
                .broadcastMessage(body, options)
                .then((request) => request(axios, basePath));
        },
        /**
         *
         * @summary Query of external chat customers
         * @param {number} [page] Page number to return. **default**: 1.
         * @param {number} [size] Page records limit. **default**: 16.
         * @param {string} [q] Search term: peer{id,name}
         * @param {Array<string>} [sort] Sort records by { fields } specification.
         * @param {Array<string>} [fields] Fields [Q]uery to build result dataset record.
         * @param {Array<string>} [id] Set of unique contact **ID**entifier(s).
         * @param {string} [type] The type of contact to filter.
         * @param {string} [viaId] Contact unique **ID**entifier. Contact **type**-specific string.
         * @param {string} [viaType] Contact **type** provider.
         * @param {string} [viaName] Contact display **name**.
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        getCustomers(page, size, q, sort, fields, id, type, viaId, viaType, viaName, options) {
            return MessagesApiFp(configuration)
                .getCustomers(page, size, q, sort, fields, id, type, viaId, viaType, viaName, options)
                .then((request) => request(axios, basePath));
        },
        /**
         *
         * @summary Query of chat conversations
         * @param {number} [page] Page number to return. **default**: 1.
         * @param {number} [size] Page records limit. **default**: 16.
         * @param {string} [q] Search term: peer.name
         * @param {Array<string>} [sort] Sort records by { fields } specification.
         * @param {Array<string>} [fields] Fields [Q]uery to build result dataset record.
         * @param {Array<string>} [id] Set of unique chat IDentifier(s). Accept: dialog -or- member ID.
         * @param {string} [viaId] Contact unique **ID**entifier. Contact **type**-specific string.
         * @param {string} [viaType] Contact **type** provider.
         * @param {string} [viaName] Contact display **name**.
         * @param {string} [peerId] Contact unique **ID**entifier. Contact **type**-specific string.
         * @param {string} [peerType] Contact **type** provider.
         * @param {string} [peerName] Contact display **name**.
         * @param {string} [dateSince] Since epochtime (milli). **Match**: greater than ..
         * @param {string} [dateUntil] Until epochtime (milli). **Match**: less or equal ..
         * @param {boolean} [online] Dialogs ONLY that are currently [not] active( closed: ? ).
         * @param {string} [groupString] Includes ONLY those chat dialogs whose member channel(s) contain a specified set of variables.  10
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        getDialogs(page, size, q, sort, fields, id, viaId, viaType, viaName, peerId, peerType, peerName, dateSince, dateUntil, online, groupString, options) {
            return MessagesApiFp(configuration)
                .getDialogs(page, size, q, sort, fields, id, viaId, viaType, viaName, peerId, peerType, peerName, dateSince, dateUntil, online, groupString, options)
                .then((request) => request(axios, basePath));
        },
        /**
         *
         * @summary Query of the chat history
         * @param {string} chatId Unique chat dialog
         * @param {string} [offsetId] Messages ONLY starting from the specified message ID
         * @param {string} [offsetDate] Messages ONLY been sent before the specified epochtime(milli).
         * @param {number} [limit] Number of messages to return.
         * @param {string} [q] Search term: message.text
         * @param {Array<string>} [fields] Fields to return into result.
         * @param {string} [peerId] Contact unique **ID**entifier. Contact **type**-specific string.
         * @param {string} [peerType] Contact **type** provider.
         * @param {string} [peerName] Contact display **name**.
         * @param {string} [groupString] Includes the history of ONLY those dialogs whose member channel(s) contain a specified set of variables.
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        getHistory(chatId, offsetId, offsetDate, limit, q, fields, peerId, peerType, peerName, groupString, options) {
            return MessagesApiFp(configuration)
                .getHistory(chatId, offsetId, offsetDate, limit, q, fields, peerId, peerType, peerName, groupString, options)
                .then((request) => request(axios, basePath));
        },
        /**
         *
         * @summary Query of the chat history
         * @param {string} peerType Contact **type** provider.
         * @param {string} peerId Contact unique **ID**entifier. Contact **type**-specific string.
         * @param {string} [offsetId] Messages ONLY starting from the specified message ID
         * @param {string} [offsetDate] Messages ONLY been sent before the specified epochtime(milli).
         * @param {number} [limit] Number of messages to return.
         * @param {string} [q] Search term: message.text
         * @param {Array<string>} [fields] Fields to return into result.
         * @param {string} [chatId] Unique chat dialog
         * @param {string} [peerName] Contact display **name**.
         * @param {string} [groupStringString] Includes the history of ONLY those dialogs whose member channel(s) contain a specified set of variables.
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        getHistory2(peerType, peerId, offsetId, offsetDate, limit, q, fields, chatId, peerName, groupStringString, options) {
            return MessagesApiFp(configuration)
                .getHistory2(peerType, peerId, offsetId, offsetDate, limit, q, fields, chatId, peerName, groupStringString, options)
                .then((request) => request(axios, basePath));
        },
        /**
         *
         * @summary Query of chat participants
         * @param {string} chatId ID of the chat dialog.
         * @param {number} [page] Page number to return. **default**: 1.
         * @param {number} [size] Page records limit. **default**: 16.
         * @param {string} [q] Search term: peer(type;name)
         * @param {Array<string>} [sort] Sort records by { fields } specification.
         * @param {Array<string>} [fields] Fields [Q]uery to build result dataset record.
         * @param {Array<string>} [id] Set of unique chat member ID.
         * @param {string} [viaId] Contact unique **ID**entifier. Contact **type**-specific string.
         * @param {string} [viaType] Contact **type** provider.
         * @param {string} [viaName] Contact display **name**.
         * @param {string} [peerId] Contact unique **ID**entifier. Contact **type**-specific string.
         * @param {string} [peerType] Contact **type** provider.
         * @param {string} [peerName] Contact display **name**.
         * @param {string} [dateSince] Since epochtime (milli). **Match**: greater than ..
         * @param {string} [dateUntil] Until epochtime (milli). **Match**: less or equal ..
         * @param {boolean} [online] Participants ONLY who are currently [not] connected to the chat. ( left: ( 0 ? online : offline ) )
         * @param {boolean} [joined] Participants ONLY who have [not] been connected to the chat. ( join: ( 0 ? [request|abandoned] : connected ) )
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        getMembers(chatId, page, size, q, sort, fields, id, viaId, viaType, viaName, peerId, peerType, peerName, dateSince, dateUntil, online, joined, options) {
            return MessagesApiFp(configuration)
                .getMembers(chatId, page, size, q, sort, fields, id, viaId, viaType, viaName, peerId, peerType, peerName, dateSince, dateUntil, online, joined, options)
                .then((request) => request(axios, basePath));
        },
    };
};
/**
 * MessagesApi - object-oriented interface
 * @export
 * @class MessagesApi
 * @extends {BaseAPI}
 */
export class MessagesApi extends BaseAPI {
    /**
     *
     * @summary Broadcast message send message from via to peer recipients.
     * @param {WebitelChatBroadcastMessageRequest} body
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     * @memberof MessagesApi
     */
    broadcastMessage(body, options) {
        return MessagesApiFp(this.configuration)
            .broadcastMessage(body, options)
            .then((request) => request(this.axios, this.basePath));
    }
    /**
     *
     * @summary Query of external chat customers
     * @param {number} [page] Page number to return. **default**: 1.
     * @param {number} [size] Page records limit. **default**: 16.
     * @param {string} [q] Search term: peer{id,name}
     * @param {Array<string>} [sort] Sort records by { fields } specification.
     * @param {Array<string>} [fields] Fields [Q]uery to build result dataset record.
     * @param {Array<string>} [id] Set of unique contact **ID**entifier(s).
     * @param {string} [type] The type of contact to filter.
     * @param {string} [viaId] Contact unique **ID**entifier. Contact **type**-specific string.
     * @param {string} [viaType] Contact **type** provider.
     * @param {string} [viaName] Contact display **name**.
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     * @memberof MessagesApi
     */
    getCustomers(page, size, q, sort, fields, id, type, viaId, viaType, viaName, options) {
        return MessagesApiFp(this.configuration)
            .getCustomers(page, size, q, sort, fields, id, type, viaId, viaType, viaName, options)
            .then((request) => request(this.axios, this.basePath));
    }
    /**
     *
     * @summary Query of chat conversations
     * @param {number} [page] Page number to return. **default**: 1.
     * @param {number} [size] Page records limit. **default**: 16.
     * @param {string} [q] Search term: peer.name
     * @param {Array<string>} [sort] Sort records by { fields } specification.
     * @param {Array<string>} [fields] Fields [Q]uery to build result dataset record.
     * @param {Array<string>} [id] Set of unique chat IDentifier(s). Accept: dialog -or- member ID.
     * @param {string} [viaId] Contact unique **ID**entifier. Contact **type**-specific string.
     * @param {string} [viaType] Contact **type** provider.
     * @param {string} [viaName] Contact display **name**.
     * @param {string} [peerId] Contact unique **ID**entifier. Contact **type**-specific string.
     * @param {string} [peerType] Contact **type** provider.
     * @param {string} [peerName] Contact display **name**.
     * @param {string} [dateSince] Since epochtime (milli). **Match**: greater than ..
     * @param {string} [dateUntil] Until epochtime (milli). **Match**: less or equal ..
     * @param {boolean} [online] Dialogs ONLY that are currently [not] active( closed: ? ).
     * @param {string} [groupString] Includes ONLY those chat dialogs whose member channel(s) contain a specified set of variables.  10
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     * @memberof MessagesApi
     */
    getDialogs(page, size, q, sort, fields, id, viaId, viaType, viaName, peerId, peerType, peerName, dateSince, dateUntil, online, groupString, options) {
        return MessagesApiFp(this.configuration)
            .getDialogs(page, size, q, sort, fields, id, viaId, viaType, viaName, peerId, peerType, peerName, dateSince, dateUntil, online, groupString, options)
            .then((request) => request(this.axios, this.basePath));
    }
    /**
     *
     * @summary Query of the chat history
     * @param {string} chatId Unique chat dialog
     * @param {string} [offsetId] Messages ONLY starting from the specified message ID
     * @param {string} [offsetDate] Messages ONLY been sent before the specified epochtime(milli).
     * @param {number} [limit] Number of messages to return.
     * @param {string} [q] Search term: message.text
     * @param {Array<string>} [fields] Fields to return into result.
     * @param {string} [peerId] Contact unique **ID**entifier. Contact **type**-specific string.
     * @param {string} [peerType] Contact **type** provider.
     * @param {string} [peerName] Contact display **name**.
     * @param {string} [groupString] Includes the history of ONLY those dialogs whose member channel(s) contain a specified set of variables.
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     * @memberof MessagesApi
     */
    getHistory(chatId, offsetId, offsetDate, limit, q, fields, peerId, peerType, peerName, groupString, options) {
        return MessagesApiFp(this.configuration)
            .getHistory(chatId, offsetId, offsetDate, limit, q, fields, peerId, peerType, peerName, groupString, options)
            .then((request) => request(this.axios, this.basePath));
    }
    /**
     *
     * @summary Query of the chat history
     * @param {string} peerType Contact **type** provider.
     * @param {string} peerId Contact unique **ID**entifier. Contact **type**-specific string.
     * @param {string} [offsetId] Messages ONLY starting from the specified message ID
     * @param {string} [offsetDate] Messages ONLY been sent before the specified epochtime(milli).
     * @param {number} [limit] Number of messages to return.
     * @param {string} [q] Search term: message.text
     * @param {Array<string>} [fields] Fields to return into result.
     * @param {string} [chatId] Unique chat dialog
     * @param {string} [peerName] Contact display **name**.
     * @param {string} [groupStringString] Includes the history of ONLY those dialogs whose member channel(s) contain a specified set of variables.
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     * @memberof MessagesApi
     */
    getHistory2(peerType, peerId, offsetId, offsetDate, limit, q, fields, chatId, peerName, groupStringString, options) {
        return MessagesApiFp(this.configuration)
            .getHistory2(peerType, peerId, offsetId, offsetDate, limit, q, fields, chatId, peerName, groupStringString, options)
            .then((request) => request(this.axios, this.basePath));
    }
    /**
     *
     * @summary Query of chat participants
     * @param {string} chatId ID of the chat dialog.
     * @param {number} [page] Page number to return. **default**: 1.
     * @param {number} [size] Page records limit. **default**: 16.
     * @param {string} [q] Search term: peer(type;name)
     * @param {Array<string>} [sort] Sort records by { fields } specification.
     * @param {Array<string>} [fields] Fields [Q]uery to build result dataset record.
     * @param {Array<string>} [id] Set of unique chat member ID.
     * @param {string} [viaId] Contact unique **ID**entifier. Contact **type**-specific string.
     * @param {string} [viaType] Contact **type** provider.
     * @param {string} [viaName] Contact display **name**.
     * @param {string} [peerId] Contact unique **ID**entifier. Contact **type**-specific string.
     * @param {string} [peerType] Contact **type** provider.
     * @param {string} [peerName] Contact display **name**.
     * @param {string} [dateSince] Since epochtime (milli). **Match**: greater than ..
     * @param {string} [dateUntil] Until epochtime (milli). **Match**: less or equal ..
     * @param {boolean} [online] Participants ONLY who are currently [not] connected to the chat. ( left: ( 0 ? online : offline ) )
     * @param {boolean} [joined] Participants ONLY who have [not] been connected to the chat. ( join: ( 0 ? [request|abandoned] : connected ) )
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     * @memberof MessagesApi
     */
    getMembers(chatId, page, size, q, sort, fields, id, viaId, viaType, viaName, peerId, peerType, peerName, dateSince, dateUntil, online, joined, options) {
        return MessagesApiFp(this.configuration)
            .getMembers(chatId, page, size, q, sort, fields, id, viaId, viaType, viaName, peerId, peerType, peerName, dateSince, dateUntil, online, joined, options)
            .then((request) => request(this.axios, this.basePath));
    }
}
//# sourceMappingURL=messages-api.js.map