// 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';
/**
 * ContactGroupsApi - axios parameter creator
 * @export
 */
export const ContactGroupsApiAxiosParamCreator = function (configuration) {
    return {
        /**
         *
         * @summary Remove the Contact\'s group association.
         * @param {string} contactId Contact ID associated with.
         * @param {string} etag Unique ID to remove.
         * @param {Array<string>} [fields] Fields to be retrieved as a result.
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        deleteContactGroup: (contactId, etag, fields, 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 deleteContactGroup.');
            }
            // verify required parameter 'etag' is not null or undefined
            if (etag === null || etag === undefined) {
                throw new RequiredError('etag', 'Required parameter etag was null or undefined when calling deleteContactGroup.');
            }
            const localVarPath = `/contacts/{contact_id}/groups/{etag}`
                .replace(`{${'contact_id'}}`, encodeURIComponent(String(contactId)))
                .replace(`{${'etag'}}`, encodeURIComponent(String(etag)));
            const localVarUrlObj = globalImportUrl.parse(localVarPath, true);
            let baseOptions;
            if (configuration) {
                baseOptions = configuration.baseOptions;
            }
            const localVarRequestOptions = Object.assign(Object.assign({ method: 'DELETE' }, 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 (fields) {
                localVarQueryParameter['fields'] = fields;
            }
            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,
            };
        }),
        /**
         *
         * @summary Remove the Contact\'s group(s).
         * @param {string} contactId Contact ID associated with.
         * @param {Array<string>} etag Set of unique ID(s) to remove.
         * @param {Array<string>} [fields] Fields to be retrieved as a result.
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        deleteContactGroups: (contactId, etag, fields, 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 deleteContactGroups.');
            }
            // verify required parameter 'etag' is not null or undefined
            if (etag === null || etag === undefined) {
                throw new RequiredError('etag', 'Required parameter etag was null or undefined when calling deleteContactGroups.');
            }
            const localVarPath = `/contacts/{contact_id}/groups`.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: 'DELETE' }, 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 (fields) {
                localVarQueryParameter['fields'] = fields;
            }
            if (etag) {
                localVarQueryParameter['etag'] = etag;
            }
            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,
            };
        }),
        /**
         *
         * @summary List of the Contact\'s group(s).
         * @param {string} contactId Contact ID associated with.
         * @param {number} [page] Page number of result dataset records. offset &#x3D; (page*size)
         * @param {number} [size] Size count of records on result page. limit &#x3D; (size++)
         * @param {string} [query] Search term: group name; &#x60;?&#x60; - matches any one character &#x60;*&#x60; - matches 0 or more characters
         * @param {Array<string>} [sort] Sort the result according to fields.
         * @param {Array<string>} [fields] Fields to be retrieved as a result.
         * @param {Array<string>} [id] Record(s) with unique ID only.
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        listContactGroups: (contactId, page, size, query, sort, fields, id, 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 listContactGroups.');
            }
            const localVarPath = `/contacts/{contact_id}/groups`.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 (page !== undefined) {
                localVarQueryParameter['page'] = page;
            }
            if (size !== undefined) {
                localVarQueryParameter['size'] = size;
            }
            if (query !== undefined) {
                localVarQueryParameter['query'] = query;
            }
            if (sort) {
                localVarQueryParameter['sort'] = sort;
            }
            if (fields) {
                localVarQueryParameter['fields'] = fields;
            }
            if (id) {
                localVarQueryParameter['id'] = id;
            }
            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,
            };
        }),
        /**
         *
         * @summary Locate the Contact\'s group association.
         * @param {string} contactId Contact source ID.
         * @param {string} etag Unique group link IDentifier. Accept: &#x60;etag&#x60; (obsolete+) or &#x60;id&#x60;.
         * @param {Array<string>} [fields] Fields to be retrieved into result.
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        locateContactGroup: (contactId, etag, fields, 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 locateContactGroup.');
            }
            // verify required parameter 'etag' is not null or undefined
            if (etag === null || etag === undefined) {
                throw new RequiredError('etag', 'Required parameter etag was null or undefined when calling locateContactGroup.');
            }
            const localVarPath = `/contacts/{contact_id}/groups/{etag}`
                .replace(`{${'contact_id'}}`, encodeURIComponent(String(contactId)))
                .replace(`{${'etag'}}`, encodeURIComponent(String(etag)));
            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 (fields) {
                localVarQueryParameter['fields'] = fields;
            }
            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,
            };
        }),
        /**
         *
         * @summary Associate more group(s) with the Contact.
         * @param {string} contactId Link contact ID.
         * @param {Array<WebitelContactsInputContactGroup>} input Array of the unique User(s) to associate with the Contact. Any duplicate of an already linked user{id} will result in an error.
         * @param {Array<string>} [fields] Fields to be retrieved as a result.
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        mergeContactGroups: (contactId, input, fields, 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 mergeContactGroups.');
            }
            // verify required parameter 'input' is not null or undefined
            if (input === null || input === undefined) {
                throw new RequiredError('input', 'Required parameter input was null or undefined when calling mergeContactGroups.');
            }
            const localVarPath = `/contacts/{contact_id}/groups`.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: 'POST' }, 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 (fields) {
                localVarQueryParameter['fields'] = fields;
            }
            localVarHeaderParameter['Content-Type'] = 'application/json';
            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);
            const needsSerialization = typeof input !== 'string' ||
                localVarRequestOptions.headers['Content-Type'] === 'application/json';
            localVarRequestOptions.data = needsSerialization
                ? JSON.stringify(input !== undefined ? input : {})
                : input || '';
            return {
                url: globalImportUrl.format(localVarUrlObj),
                options: localVarRequestOptions,
            };
        }),
        /**
         *
         * @summary Resets all groups of the contact according to the input dataset.
         * @param {string} contactId Link contact ID.
         * @param {Array<WebitelContactsInputContactGroup>} input Final set of group(s) to be linked with the contact. Group(s) that are already linked with the contact but not given in here will be removed.
         * @param {Array<string>} [fields] Fields to be retrieved into result of changes.
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        resetContactGroups: (contactId, input, fields, 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 resetContactGroups.');
            }
            // verify required parameter 'input' is not null or undefined
            if (input === null || input === undefined) {
                throw new RequiredError('input', 'Required parameter input was null or undefined when calling resetContactGroups.');
            }
            const localVarPath = `/contacts/{contact_id}/groups`.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: 'PUT' }, 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 (fields) {
                localVarQueryParameter['fields'] = fields;
            }
            localVarHeaderParameter['Content-Type'] = 'application/json';
            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);
            const needsSerialization = typeof input !== 'string' ||
                localVarRequestOptions.headers['Content-Type'] === 'application/json';
            localVarRequestOptions.data = needsSerialization
                ? JSON.stringify(input !== undefined ? input : {})
                : input || '';
            return {
                url: globalImportUrl.format(localVarUrlObj),
                options: localVarRequestOptions,
            };
        }),
        /**
         *
         * @summary Update the Contact\'s group details.
         * @param {string} contactId Link contact ID.
         * @param {string} etag Unique ID of the latest version of an existing resource.
         * @param {NEWUpdateOfTheGroupLink} input
         * @param {Array<string>} [fields] Fields to be retrieved into result of changes.
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        updateContactGroup: (contactId, etag, input, fields, 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 updateContactGroup.');
            }
            // verify required parameter 'etag' is not null or undefined
            if (etag === null || etag === undefined) {
                throw new RequiredError('etag', 'Required parameter etag was null or undefined when calling updateContactGroup.');
            }
            // verify required parameter 'input' is not null or undefined
            if (input === null || input === undefined) {
                throw new RequiredError('input', 'Required parameter input was null or undefined when calling updateContactGroup.');
            }
            const localVarPath = `/contacts/{contact_id}/groups/{etag}`
                .replace(`{${'contact_id'}}`, encodeURIComponent(String(contactId)))
                .replace(`{${'etag'}}`, encodeURIComponent(String(etag)));
            const localVarUrlObj = globalImportUrl.parse(localVarPath, true);
            let baseOptions;
            if (configuration) {
                baseOptions = configuration.baseOptions;
            }
            const localVarRequestOptions = Object.assign(Object.assign({ method: 'PUT' }, 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 (fields) {
                localVarQueryParameter['fields'] = fields;
            }
            localVarHeaderParameter['Content-Type'] = 'application/json';
            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);
            const needsSerialization = typeof input !== 'string' ||
                localVarRequestOptions.headers['Content-Type'] === 'application/json';
            localVarRequestOptions.data = needsSerialization
                ? JSON.stringify(input !== undefined ? input : {})
                : input || '';
            return {
                url: globalImportUrl.format(localVarUrlObj),
                options: localVarRequestOptions,
            };
        }),
        /**
         *
         * @summary Update the Contact\'s group details.
         * @param {string} contactId Link contact ID.
         * @param {string} etag Unique ID of the latest version of an existing resource.
         * @param {NEWUpdateOfTheGroupLink1} input
         * @param {Array<string>} [fields] Fields to be retrieved into result of changes.
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        updateContactGroup2: (contactId, etag, input, fields, 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 updateContactGroup2.');
            }
            // verify required parameter 'etag' is not null or undefined
            if (etag === null || etag === undefined) {
                throw new RequiredError('etag', 'Required parameter etag was null or undefined when calling updateContactGroup2.');
            }
            // verify required parameter 'input' is not null or undefined
            if (input === null || input === undefined) {
                throw new RequiredError('input', 'Required parameter input was null or undefined when calling updateContactGroup2.');
            }
            const localVarPath = `/contacts/{contact_id}/groups/{etag}`
                .replace(`{${'contact_id'}}`, encodeURIComponent(String(contactId)))
                .replace(`{${'etag'}}`, encodeURIComponent(String(etag)));
            const localVarUrlObj = globalImportUrl.parse(localVarPath, true);
            let baseOptions;
            if (configuration) {
                baseOptions = configuration.baseOptions;
            }
            const localVarRequestOptions = Object.assign(Object.assign({ method: 'PATCH' }, 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 (fields) {
                localVarQueryParameter['fields'] = fields;
            }
            localVarHeaderParameter['Content-Type'] = 'application/json';
            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);
            const needsSerialization = typeof input !== 'string' ||
                localVarRequestOptions.headers['Content-Type'] === 'application/json';
            localVarRequestOptions.data = needsSerialization
                ? JSON.stringify(input !== undefined ? input : {})
                : input || '';
            return {
                url: globalImportUrl.format(localVarUrlObj),
                options: localVarRequestOptions,
            };
        }),
    };
};
/**
 * ContactGroupsApi - functional programming interface
 * @export
 */
export const ContactGroupsApiFp = function (configuration) {
    return {
        /**
         *
         * @summary Remove the Contact\'s group association.
         * @param {string} contactId Contact ID associated with.
         * @param {string} etag Unique ID to remove.
         * @param {Array<string>} [fields] Fields to be retrieved as a result.
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        deleteContactGroup(contactId, etag, fields, options) {
            return __awaiter(this, void 0, void 0, function* () {
                const localVarAxiosArgs = yield ContactGroupsApiAxiosParamCreator(configuration).deleteContactGroup(contactId, etag, fields, options);
                return (axios = globalAxios, basePath = BASE_PATH) => {
                    const axiosRequestArgs = Object.assign(Object.assign({}, localVarAxiosArgs.options), { url: basePath + localVarAxiosArgs.url });
                    return axios.request(axiosRequestArgs);
                };
            });
        },
        /**
         *
         * @summary Remove the Contact\'s group(s).
         * @param {string} contactId Contact ID associated with.
         * @param {Array<string>} etag Set of unique ID(s) to remove.
         * @param {Array<string>} [fields] Fields to be retrieved as a result.
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        deleteContactGroups(contactId, etag, fields, options) {
            return __awaiter(this, void 0, void 0, function* () {
                const localVarAxiosArgs = yield ContactGroupsApiAxiosParamCreator(configuration).deleteContactGroups(contactId, etag, fields, options);
                return (axios = globalAxios, basePath = BASE_PATH) => {
                    const axiosRequestArgs = Object.assign(Object.assign({}, localVarAxiosArgs.options), { url: basePath + localVarAxiosArgs.url });
                    return axios.request(axiosRequestArgs);
                };
            });
        },
        /**
         *
         * @summary List of the Contact\'s group(s).
         * @param {string} contactId Contact ID associated with.
         * @param {number} [page] Page number of result dataset records. offset &#x3D; (page*size)
         * @param {number} [size] Size count of records on result page. limit &#x3D; (size++)
         * @param {string} [query] Search term: group name; &#x60;?&#x60; - matches any one character &#x60;*&#x60; - matches 0 or more characters
         * @param {Array<string>} [sort] Sort the result according to fields.
         * @param {Array<string>} [fields] Fields to be retrieved as a result.
         * @param {Array<string>} [id] Record(s) with unique ID only.
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        listContactGroups(contactId, page, size, query, sort, fields, id, options) {
            return __awaiter(this, void 0, void 0, function* () {
                const localVarAxiosArgs = yield ContactGroupsApiAxiosParamCreator(configuration).listContactGroups(contactId, page, size, query, sort, fields, id, options);
                return (axios = globalAxios, basePath = BASE_PATH) => {
                    const axiosRequestArgs = Object.assign(Object.assign({}, localVarAxiosArgs.options), { url: basePath + localVarAxiosArgs.url });
                    return axios.request(axiosRequestArgs);
                };
            });
        },
        /**
         *
         * @summary Locate the Contact\'s group association.
         * @param {string} contactId Contact source ID.
         * @param {string} etag Unique group link IDentifier. Accept: &#x60;etag&#x60; (obsolete+) or &#x60;id&#x60;.
         * @param {Array<string>} [fields] Fields to be retrieved into result.
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        locateContactGroup(contactId, etag, fields, options) {
            return __awaiter(this, void 0, void 0, function* () {
                const localVarAxiosArgs = yield ContactGroupsApiAxiosParamCreator(configuration).locateContactGroup(contactId, etag, fields, options);
                return (axios = globalAxios, basePath = BASE_PATH) => {
                    const axiosRequestArgs = Object.assign(Object.assign({}, localVarAxiosArgs.options), { url: basePath + localVarAxiosArgs.url });
                    return axios.request(axiosRequestArgs);
                };
            });
        },
        /**
         *
         * @summary Associate more group(s) with the Contact.
         * @param {string} contactId Link contact ID.
         * @param {Array<WebitelContactsInputContactGroup>} input Array of the unique User(s) to associate with the Contact. Any duplicate of an already linked user{id} will result in an error.
         * @param {Array<string>} [fields] Fields to be retrieved as a result.
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        mergeContactGroups(contactId, input, fields, options) {
            return __awaiter(this, void 0, void 0, function* () {
                const localVarAxiosArgs = yield ContactGroupsApiAxiosParamCreator(configuration).mergeContactGroups(contactId, input, fields, options);
                return (axios = globalAxios, basePath = BASE_PATH) => {
                    const axiosRequestArgs = Object.assign(Object.assign({}, localVarAxiosArgs.options), { url: basePath + localVarAxiosArgs.url });
                    return axios.request(axiosRequestArgs);
                };
            });
        },
        /**
         *
         * @summary Resets all groups of the contact according to the input dataset.
         * @param {string} contactId Link contact ID.
         * @param {Array<WebitelContactsInputContactGroup>} input Final set of group(s) to be linked with the contact. Group(s) that are already linked with the contact but not given in here will be removed.
         * @param {Array<string>} [fields] Fields to be retrieved into result of changes.
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        resetContactGroups(contactId, input, fields, options) {
            return __awaiter(this, void 0, void 0, function* () {
                const localVarAxiosArgs = yield ContactGroupsApiAxiosParamCreator(configuration).resetContactGroups(contactId, input, fields, options);
                return (axios = globalAxios, basePath = BASE_PATH) => {
                    const axiosRequestArgs = Object.assign(Object.assign({}, localVarAxiosArgs.options), { url: basePath + localVarAxiosArgs.url });
                    return axios.request(axiosRequestArgs);
                };
            });
        },
        /**
         *
         * @summary Update the Contact\'s group details.
         * @param {string} contactId Link contact ID.
         * @param {string} etag Unique ID of the latest version of an existing resource.
         * @param {NEWUpdateOfTheGroupLink} input
         * @param {Array<string>} [fields] Fields to be retrieved into result of changes.
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        updateContactGroup(contactId, etag, input, fields, options) {
            return __awaiter(this, void 0, void 0, function* () {
                const localVarAxiosArgs = yield ContactGroupsApiAxiosParamCreator(configuration).updateContactGroup(contactId, etag, input, fields, options);
                return (axios = globalAxios, basePath = BASE_PATH) => {
                    const axiosRequestArgs = Object.assign(Object.assign({}, localVarAxiosArgs.options), { url: basePath + localVarAxiosArgs.url });
                    return axios.request(axiosRequestArgs);
                };
            });
        },
        /**
         *
         * @summary Update the Contact\'s group details.
         * @param {string} contactId Link contact ID.
         * @param {string} etag Unique ID of the latest version of an existing resource.
         * @param {NEWUpdateOfTheGroupLink1} input
         * @param {Array<string>} [fields] Fields to be retrieved into result of changes.
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        updateContactGroup2(contactId, etag, input, fields, options) {
            return __awaiter(this, void 0, void 0, function* () {
                const localVarAxiosArgs = yield ContactGroupsApiAxiosParamCreator(configuration).updateContactGroup2(contactId, etag, input, fields, options);
                return (axios = globalAxios, basePath = BASE_PATH) => {
                    const axiosRequestArgs = Object.assign(Object.assign({}, localVarAxiosArgs.options), { url: basePath + localVarAxiosArgs.url });
                    return axios.request(axiosRequestArgs);
                };
            });
        },
    };
};
/**
 * ContactGroupsApi - factory interface
 * @export
 */
export const ContactGroupsApiFactory = function (configuration, basePath, axios) {
    return {
        /**
         *
         * @summary Remove the Contact\'s group association.
         * @param {string} contactId Contact ID associated with.
         * @param {string} etag Unique ID to remove.
         * @param {Array<string>} [fields] Fields to be retrieved as a result.
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        deleteContactGroup(contactId, etag, fields, options) {
            return ContactGroupsApiFp(configuration)
                .deleteContactGroup(contactId, etag, fields, options)
                .then((request) => request(axios, basePath));
        },
        /**
         *
         * @summary Remove the Contact\'s group(s).
         * @param {string} contactId Contact ID associated with.
         * @param {Array<string>} etag Set of unique ID(s) to remove.
         * @param {Array<string>} [fields] Fields to be retrieved as a result.
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        deleteContactGroups(contactId, etag, fields, options) {
            return ContactGroupsApiFp(configuration)
                .deleteContactGroups(contactId, etag, fields, options)
                .then((request) => request(axios, basePath));
        },
        /**
         *
         * @summary List of the Contact\'s group(s).
         * @param {string} contactId Contact ID associated with.
         * @param {number} [page] Page number of result dataset records. offset &#x3D; (page*size)
         * @param {number} [size] Size count of records on result page. limit &#x3D; (size++)
         * @param {string} [query] Search term: group name; &#x60;?&#x60; - matches any one character &#x60;*&#x60; - matches 0 or more characters
         * @param {Array<string>} [sort] Sort the result according to fields.
         * @param {Array<string>} [fields] Fields to be retrieved as a result.
         * @param {Array<string>} [id] Record(s) with unique ID only.
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        listContactGroups(contactId, page, size, query, sort, fields, id, options) {
            return ContactGroupsApiFp(configuration)
                .listContactGroups(contactId, page, size, query, sort, fields, id, options)
                .then((request) => request(axios, basePath));
        },
        /**
         *
         * @summary Locate the Contact\'s group association.
         * @param {string} contactId Contact source ID.
         * @param {string} etag Unique group link IDentifier. Accept: &#x60;etag&#x60; (obsolete+) or &#x60;id&#x60;.
         * @param {Array<string>} [fields] Fields to be retrieved into result.
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        locateContactGroup(contactId, etag, fields, options) {
            return ContactGroupsApiFp(configuration)
                .locateContactGroup(contactId, etag, fields, options)
                .then((request) => request(axios, basePath));
        },
        /**
         *
         * @summary Associate more group(s) with the Contact.
         * @param {string} contactId Link contact ID.
         * @param {Array<WebitelContactsInputContactGroup>} input Array of the unique User(s) to associate with the Contact. Any duplicate of an already linked user{id} will result in an error.
         * @param {Array<string>} [fields] Fields to be retrieved as a result.
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        mergeContactGroups(contactId, input, fields, options) {
            return ContactGroupsApiFp(configuration)
                .mergeContactGroups(contactId, input, fields, options)
                .then((request) => request(axios, basePath));
        },
        /**
         *
         * @summary Resets all groups of the contact according to the input dataset.
         * @param {string} contactId Link contact ID.
         * @param {Array<WebitelContactsInputContactGroup>} input Final set of group(s) to be linked with the contact. Group(s) that are already linked with the contact but not given in here will be removed.
         * @param {Array<string>} [fields] Fields to be retrieved into result of changes.
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        resetContactGroups(contactId, input, fields, options) {
            return ContactGroupsApiFp(configuration)
                .resetContactGroups(contactId, input, fields, options)
                .then((request) => request(axios, basePath));
        },
        /**
         *
         * @summary Update the Contact\'s group details.
         * @param {string} contactId Link contact ID.
         * @param {string} etag Unique ID of the latest version of an existing resource.
         * @param {NEWUpdateOfTheGroupLink} input
         * @param {Array<string>} [fields] Fields to be retrieved into result of changes.
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        updateContactGroup(contactId, etag, input, fields, options) {
            return ContactGroupsApiFp(configuration)
                .updateContactGroup(contactId, etag, input, fields, options)
                .then((request) => request(axios, basePath));
        },
        /**
         *
         * @summary Update the Contact\'s group details.
         * @param {string} contactId Link contact ID.
         * @param {string} etag Unique ID of the latest version of an existing resource.
         * @param {NEWUpdateOfTheGroupLink1} input
         * @param {Array<string>} [fields] Fields to be retrieved into result of changes.
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        updateContactGroup2(contactId, etag, input, fields, options) {
            return ContactGroupsApiFp(configuration)
                .updateContactGroup2(contactId, etag, input, fields, options)
                .then((request) => request(axios, basePath));
        },
    };
};
/**
 * ContactGroupsApi - object-oriented interface
 * @export
 * @class ContactGroupsApi
 * @extends {BaseAPI}
 */
export class ContactGroupsApi extends BaseAPI {
    /**
     *
     * @summary Remove the Contact\'s group association.
     * @param {string} contactId Contact ID associated with.
     * @param {string} etag Unique ID to remove.
     * @param {Array<string>} [fields] Fields to be retrieved as a result.
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     * @memberof ContactGroupsApi
     */
    deleteContactGroup(contactId, etag, fields, options) {
        return ContactGroupsApiFp(this.configuration)
            .deleteContactGroup(contactId, etag, fields, options)
            .then((request) => request(this.axios, this.basePath));
    }
    /**
     *
     * @summary Remove the Contact\'s group(s).
     * @param {string} contactId Contact ID associated with.
     * @param {Array<string>} etag Set of unique ID(s) to remove.
     * @param {Array<string>} [fields] Fields to be retrieved as a result.
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     * @memberof ContactGroupsApi
     */
    deleteContactGroups(contactId, etag, fields, options) {
        return ContactGroupsApiFp(this.configuration)
            .deleteContactGroups(contactId, etag, fields, options)
            .then((request) => request(this.axios, this.basePath));
    }
    /**
     *
     * @summary List of the Contact\'s group(s).
     * @param {string} contactId Contact ID associated with.
     * @param {number} [page] Page number of result dataset records. offset &#x3D; (page*size)
     * @param {number} [size] Size count of records on result page. limit &#x3D; (size++)
     * @param {string} [query] Search term: group name; &#x60;?&#x60; - matches any one character &#x60;*&#x60; - matches 0 or more characters
     * @param {Array<string>} [sort] Sort the result according to fields.
     * @param {Array<string>} [fields] Fields to be retrieved as a result.
     * @param {Array<string>} [id] Record(s) with unique ID only.
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     * @memberof ContactGroupsApi
     */
    listContactGroups(contactId, page, size, query, sort, fields, id, options) {
        return ContactGroupsApiFp(this.configuration)
            .listContactGroups(contactId, page, size, query, sort, fields, id, options)
            .then((request) => request(this.axios, this.basePath));
    }
    /**
     *
     * @summary Locate the Contact\'s group association.
     * @param {string} contactId Contact source ID.
     * @param {string} etag Unique group link IDentifier. Accept: &#x60;etag&#x60; (obsolete+) or &#x60;id&#x60;.
     * @param {Array<string>} [fields] Fields to be retrieved into result.
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     * @memberof ContactGroupsApi
     */
    locateContactGroup(contactId, etag, fields, options) {
        return ContactGroupsApiFp(this.configuration)
            .locateContactGroup(contactId, etag, fields, options)
            .then((request) => request(this.axios, this.basePath));
    }
    /**
     *
     * @summary Associate more group(s) with the Contact.
     * @param {string} contactId Link contact ID.
     * @param {Array<WebitelContactsInputContactGroup>} input Array of the unique User(s) to associate with the Contact. Any duplicate of an already linked user{id} will result in an error.
     * @param {Array<string>} [fields] Fields to be retrieved as a result.
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     * @memberof ContactGroupsApi
     */
    mergeContactGroups(contactId, input, fields, options) {
        return ContactGroupsApiFp(this.configuration)
            .mergeContactGroups(contactId, input, fields, options)
            .then((request) => request(this.axios, this.basePath));
    }
    /**
     *
     * @summary Resets all groups of the contact according to the input dataset.
     * @param {string} contactId Link contact ID.
     * @param {Array<WebitelContactsInputContactGroup>} input Final set of group(s) to be linked with the contact. Group(s) that are already linked with the contact but not given in here will be removed.
     * @param {Array<string>} [fields] Fields to be retrieved into result of changes.
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     * @memberof ContactGroupsApi
     */
    resetContactGroups(contactId, input, fields, options) {
        return ContactGroupsApiFp(this.configuration)
            .resetContactGroups(contactId, input, fields, options)
            .then((request) => request(this.axios, this.basePath));
    }
    /**
     *
     * @summary Update the Contact\'s group details.
     * @param {string} contactId Link contact ID.
     * @param {string} etag Unique ID of the latest version of an existing resource.
     * @param {NEWUpdateOfTheGroupLink} input
     * @param {Array<string>} [fields] Fields to be retrieved into result of changes.
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     * @memberof ContactGroupsApi
     */
    updateContactGroup(contactId, etag, input, fields, options) {
        return ContactGroupsApiFp(this.configuration)
            .updateContactGroup(contactId, etag, input, fields, options)
            .then((request) => request(this.axios, this.basePath));
    }
    /**
     *
     * @summary Update the Contact\'s group details.
     * @param {string} contactId Link contact ID.
     * @param {string} etag Unique ID of the latest version of an existing resource.
     * @param {NEWUpdateOfTheGroupLink1} input
     * @param {Array<string>} [fields] Fields to be retrieved into result of changes.
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     * @memberof ContactGroupsApi
     */
    updateContactGroup2(contactId, etag, input, fields, options) {
        return ContactGroupsApiFp(this.configuration)
            .updateContactGroup2(contactId, etag, input, fields, options)
            .then((request) => request(this.axios, this.basePath));
    }
}
//# sourceMappingURL=contact-groups-api.js.map