// 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 { __awaiter } from "tslib";
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';
/**
 * ContactsChatCatalogApi - axios parameter creator
 * @export
 */
export const ContactsChatCatalogApiAxiosParamCreator = function (configuration) {
    return {
        /**
         *
         * @param {string} contactId Contact identificator
         * @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} [size] Number of messages to return.
         * @param {number} [page]
         * @param {string} [q] Search term: message.text
         * @param {Array<string>} [fields] Fields to return into result.
         * @param {string} [groupString] This is a request variable of the map type. The query format is \&quot;map_name[key]&#x3D;value\&quot;, e.g. If the map name is Age, the key type is string, and the value type is integer, the query parameter is expressed as Age[\&quot;bob\&quot;]&#x3D;18
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        getContactChatHistory: (contactId, chatId, offsetId, offsetDate, size, page, q, fields, groupString, options = {}) => __awaiter(this, void 0, void 0, function* () {
            // verify required parameter 'contactId' is not null or undefined
            if (contactId === null || contactId === undefined) {
                throw new RequiredError('contactId', 'Required parameter contactId was null or undefined when calling getContactChatHistory.');
            }
            // 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 getContactChatHistory.');
            }
            const localVarPath = `/contacts/{contact_id}/chat/{chat_id}/messages`
                .replace(`{${'contact_id'}}`, encodeURIComponent(String(contactId)))
                .replace(`{${'chat_id'}}`, encodeURIComponent(String(chatId)));
            const localVarUrlObj = globalImportUrl.parse(localVarPath, true);
            let baseOptions;
            if (configuration) {
                baseOptions = configuration.baseOptions;
            }
            const localVarRequestOptions = Object.assign(Object.assign({ method: 'GET' }, baseOptions), options);
            const localVarHeaderParameter = {};
            const localVarQueryParameter = {};
            // authentication AccessToken required
            if (configuration && configuration.apiKey) {
                const localVarApiKeyValue = typeof configuration.apiKey === 'function'
                    ? yield configuration.apiKey('X-Webitel-Access')
                    : yield configuration.apiKey;
                localVarHeaderParameter['X-Webitel-Access'] = localVarApiKeyValue;
            }
            if (offsetId !== undefined) {
                localVarQueryParameter['offset.id'] = offsetId;
            }
            if (offsetDate !== undefined) {
                localVarQueryParameter['offset.date'] = offsetDate;
            }
            if (size !== undefined) {
                localVarQueryParameter['size'] = size;
            }
            if (page !== undefined) {
                localVarQueryParameter['page'] = page;
            }
            if (q !== undefined) {
                localVarQueryParameter['q'] = q;
            }
            if (fields) {
                localVarQueryParameter['fields'] = fields;
            }
            if (groupString !== undefined) {
                localVarQueryParameter['group[string]'] = groupString;
            }
            localVarUrlObj.query = Object.assign(Object.assign(Object.assign({}, 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 = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
            return {
                url: globalImportUrl.format(localVarUrlObj),
                options: localVarRequestOptions,
            };
        }),
        /**
         *
         * @param {string} contactId Contact identificator
         * @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} [size] Number of messages to return.
         * @param {number} [page]
         * @param {string} [q] Search term: message.text
         * @param {Array<string>} [fields] Fields to return into result.
         * @param {string} [chatId] Unique chat dialog
         * @param {string} [groupStringString] This is a request variable of the map type. The query format is \&quot;map_name[key]&#x3D;value\&quot;, e.g. If the map name is Age, the key type is string, and the value type is integer, the query parameter is expressed as Age[\&quot;bob\&quot;]&#x3D;18
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        getContactChatHistory2: (contactId, offsetId, offsetDate, size, page, q, fields, chatId, groupStringString, options = {}) => __awaiter(this, void 0, void 0, function* () {
            // verify required parameter 'contactId' is not null or undefined
            if (contactId === null || contactId === undefined) {
                throw new RequiredError('contactId', 'Required parameter contactId was null or undefined when calling getContactChatHistory2.');
            }
            const localVarPath = `/contacts/{contact_id}/chat/messages`.replace(`{${'contact_id'}}`, encodeURIComponent(String(contactId)));
            const localVarUrlObj = globalImportUrl.parse(localVarPath, true);
            let baseOptions;
            if (configuration) {
                baseOptions = configuration.baseOptions;
            }
            const localVarRequestOptions = Object.assign(Object.assign({ method: 'GET' }, baseOptions), options);
            const localVarHeaderParameter = {};
            const localVarQueryParameter = {};
            // authentication AccessToken required
            if (configuration && configuration.apiKey) {
                const localVarApiKeyValue = typeof configuration.apiKey === 'function'
                    ? yield configuration.apiKey('X-Webitel-Access')
                    : yield configuration.apiKey;
                localVarHeaderParameter['X-Webitel-Access'] = localVarApiKeyValue;
            }
            if (offsetId !== undefined) {
                localVarQueryParameter['offset.id'] = offsetId;
            }
            if (offsetDate !== undefined) {
                localVarQueryParameter['offset.date'] = offsetDate;
            }
            if (size !== undefined) {
                localVarQueryParameter['size'] = size;
            }
            if (page !== undefined) {
                localVarQueryParameter['page'] = page;
            }
            if (q !== undefined) {
                localVarQueryParameter['q'] = q;
            }
            if (fields) {
                localVarQueryParameter['fields'] = fields;
            }
            if (chatId !== undefined) {
                localVarQueryParameter['chat_id'] = chatId;
            }
            if (groupStringString !== undefined) {
                localVarQueryParameter['group[string][string]'] = groupStringString;
            }
            localVarUrlObj.query = Object.assign(Object.assign(Object.assign({}, 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 = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
            return {
                url: globalImportUrl.format(localVarUrlObj),
                options: localVarRequestOptions,
            };
        }),
    };
};
/**
 * ContactsChatCatalogApi - functional programming interface
 * @export
 */
export const ContactsChatCatalogApiFp = function (configuration) {
    return {
        /**
         *
         * @param {string} contactId Contact identificator
         * @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} [size] Number of messages to return.
         * @param {number} [page]
         * @param {string} [q] Search term: message.text
         * @param {Array<string>} [fields] Fields to return into result.
         * @param {string} [groupString] This is a request variable of the map type. The query format is \&quot;map_name[key]&#x3D;value\&quot;, e.g. If the map name is Age, the key type is string, and the value type is integer, the query parameter is expressed as Age[\&quot;bob\&quot;]&#x3D;18
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        getContactChatHistory(contactId, chatId, offsetId, offsetDate, size, page, q, fields, groupString, options) {
            return __awaiter(this, void 0, void 0, function* () {
                const localVarAxiosArgs = yield ContactsChatCatalogApiAxiosParamCreator(configuration).getContactChatHistory(contactId, chatId, offsetId, offsetDate, size, page, q, fields, groupString, options);
                return (axios = globalAxios, basePath = BASE_PATH) => {
                    const axiosRequestArgs = Object.assign(Object.assign({}, localVarAxiosArgs.options), { url: basePath + localVarAxiosArgs.url });
                    return axios.request(axiosRequestArgs);
                };
            });
        },
        /**
         *
         * @param {string} contactId Contact identificator
         * @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} [size] Number of messages to return.
         * @param {number} [page]
         * @param {string} [q] Search term: message.text
         * @param {Array<string>} [fields] Fields to return into result.
         * @param {string} [chatId] Unique chat dialog
         * @param {string} [groupStringString] This is a request variable of the map type. The query format is \&quot;map_name[key]&#x3D;value\&quot;, e.g. If the map name is Age, the key type is string, and the value type is integer, the query parameter is expressed as Age[\&quot;bob\&quot;]&#x3D;18
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        getContactChatHistory2(contactId, offsetId, offsetDate, size, page, q, fields, chatId, groupStringString, options) {
            return __awaiter(this, void 0, void 0, function* () {
                const localVarAxiosArgs = yield ContactsChatCatalogApiAxiosParamCreator(configuration).getContactChatHistory2(contactId, offsetId, offsetDate, size, page, q, fields, chatId, groupStringString, options);
                return (axios = globalAxios, basePath = BASE_PATH) => {
                    const axiosRequestArgs = Object.assign(Object.assign({}, localVarAxiosArgs.options), { url: basePath + localVarAxiosArgs.url });
                    return axios.request(axiosRequestArgs);
                };
            });
        },
    };
};
/**
 * ContactsChatCatalogApi - factory interface
 * @export
 */
export const ContactsChatCatalogApiFactory = function (configuration, basePath, axios) {
    return {
        /**
         *
         * @param {string} contactId Contact identificator
         * @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} [size] Number of messages to return.
         * @param {number} [page]
         * @param {string} [q] Search term: message.text
         * @param {Array<string>} [fields] Fields to return into result.
         * @param {string} [groupString] This is a request variable of the map type. The query format is \&quot;map_name[key]&#x3D;value\&quot;, e.g. If the map name is Age, the key type is string, and the value type is integer, the query parameter is expressed as Age[\&quot;bob\&quot;]&#x3D;18
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        getContactChatHistory(contactId, chatId, offsetId, offsetDate, size, page, q, fields, groupString, options) {
            return ContactsChatCatalogApiFp(configuration)
                .getContactChatHistory(contactId, chatId, offsetId, offsetDate, size, page, q, fields, groupString, options)
                .then((request) => request(axios, basePath));
        },
        /**
         *
         * @param {string} contactId Contact identificator
         * @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} [size] Number of messages to return.
         * @param {number} [page]
         * @param {string} [q] Search term: message.text
         * @param {Array<string>} [fields] Fields to return into result.
         * @param {string} [chatId] Unique chat dialog
         * @param {string} [groupStringString] This is a request variable of the map type. The query format is \&quot;map_name[key]&#x3D;value\&quot;, e.g. If the map name is Age, the key type is string, and the value type is integer, the query parameter is expressed as Age[\&quot;bob\&quot;]&#x3D;18
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        getContactChatHistory2(contactId, offsetId, offsetDate, size, page, q, fields, chatId, groupStringString, options) {
            return ContactsChatCatalogApiFp(configuration)
                .getContactChatHistory2(contactId, offsetId, offsetDate, size, page, q, fields, chatId, groupStringString, options)
                .then((request) => request(axios, basePath));
        },
    };
};
/**
 * ContactsChatCatalogApi - object-oriented interface
 * @export
 * @class ContactsChatCatalogApi
 * @extends {BaseAPI}
 */
export class ContactsChatCatalogApi extends BaseAPI {
    /**
     *
     * @param {string} contactId Contact identificator
     * @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} [size] Number of messages to return.
     * @param {number} [page]
     * @param {string} [q] Search term: message.text
     * @param {Array<string>} [fields] Fields to return into result.
     * @param {string} [groupString] This is a request variable of the map type. The query format is \&quot;map_name[key]&#x3D;value\&quot;, e.g. If the map name is Age, the key type is string, and the value type is integer, the query parameter is expressed as Age[\&quot;bob\&quot;]&#x3D;18
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     * @memberof ContactsChatCatalogApi
     */
    getContactChatHistory(contactId, chatId, offsetId, offsetDate, size, page, q, fields, groupString, options) {
        return ContactsChatCatalogApiFp(this.configuration)
            .getContactChatHistory(contactId, chatId, offsetId, offsetDate, size, page, q, fields, groupString, options)
            .then((request) => request(this.axios, this.basePath));
    }
    /**
     *
     * @param {string} contactId Contact identificator
     * @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} [size] Number of messages to return.
     * @param {number} [page]
     * @param {string} [q] Search term: message.text
     * @param {Array<string>} [fields] Fields to return into result.
     * @param {string} [chatId] Unique chat dialog
     * @param {string} [groupStringString] This is a request variable of the map type. The query format is \&quot;map_name[key]&#x3D;value\&quot;, e.g. If the map name is Age, the key type is string, and the value type is integer, the query parameter is expressed as Age[\&quot;bob\&quot;]&#x3D;18
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     * @memberof ContactsChatCatalogApi
     */
    getContactChatHistory2(contactId, offsetId, offsetDate, size, page, q, fields, chatId, groupStringString, options) {
        return ContactsChatCatalogApiFp(this.configuration)
            .getContactChatHistory2(contactId, offsetId, offsetDate, size, page, q, fields, chatId, groupStringString, options)
            .then((request) => request(this.axios, this.basePath));
    }
}
//# sourceMappingURL=contacts-chat-catalog-api.js.map