// 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';
/**
 * AgentTeamServiceApi - axios parameter creator
 * @export
 */
export const AgentTeamServiceApiAxiosParamCreator = function (configuration) {
    return {
        /**
         *
         * @summary Create AgentTeam
         * @param {EngineCreateAgentTeamRequest} body
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        createAgentTeam: 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 createAgentTeam.');
            }
            const localVarPath = `/call_center/teams`;
            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 Remove AgentTeam
         * @param {string} id
         * @param {string} [domainId]
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        deleteAgentTeam: async (id, domainId, options = {}) => {
            // verify required parameter 'id' is not null or undefined
            if (id === null || id === undefined) {
                throw new RequiredError('id', 'Required parameter id was null or undefined when calling deleteAgentTeam.');
            }
            const localVarPath = `/call_center/teams/{id}`.replace(`{${'id'}}`, encodeURIComponent(String(id)));
            const localVarUrlObj = globalImportUrl.parse(localVarPath, true);
            let baseOptions;
            if (configuration) {
                baseOptions = configuration.baseOptions;
            }
            const localVarRequestOptions = {
                method: 'DELETE',
                ...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 (domainId !== undefined) {
                localVarQueryParameter['domain_id'] = domainId;
            }
            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 AgentTeam item
         * @param {string} id
         * @param {string} [domainId]
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        readAgentTeam: async (id, domainId, options = {}) => {
            // verify required parameter 'id' is not null or undefined
            if (id === null || id === undefined) {
                throw new RequiredError('id', 'Required parameter id was null or undefined when calling readAgentTeam.');
            }
            const localVarPath = `/call_center/teams/{id}`.replace(`{${'id'}}`, encodeURIComponent(String(id)));
            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 (domainId !== undefined) {
                localVarQueryParameter['domain_id'] = domainId;
            }
            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 List of AgentTeam
         * @param {number} [page]
         * @param {number} [size]
         * @param {string} [q]
         * @param {string} [sort]
         * @param {Array<string>} [fields]
         * @param {Array<number>} [id]
         * @param {Array<string>} [strategy]
         * @param {Array<number>} [adminId]
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        searchAgentTeam: async (page, size, q, sort, fields, id, strategy, adminId, options = {}) => {
            const localVarPath = `/call_center/teams`;
            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 !== undefined) {
                localVarQueryParameter['sort'] = sort;
            }
            if (fields) {
                localVarQueryParameter['fields'] = fields;
            }
            if (id) {
                localVarQueryParameter['id'] = id;
            }
            if (strategy) {
                localVarQueryParameter['strategy'] = strategy;
            }
            if (adminId) {
                localVarQueryParameter['admin_id'] = adminId;
            }
            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 Update AgentTeam
         * @param {string} id
         * @param {EngineAgentTeamServiceUpdateAgentTeamBody} body
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        updateAgentTeam: async (id, body, options = {}) => {
            // verify required parameter 'id' is not null or undefined
            if (id === null || id === undefined) {
                throw new RequiredError('id', 'Required parameter id was null or undefined when calling updateAgentTeam.');
            }
            // 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 updateAgentTeam.');
            }
            const localVarPath = `/call_center/teams/{id}`.replace(`{${'id'}}`, encodeURIComponent(String(id)));
            const localVarUrlObj = globalImportUrl.parse(localVarPath, true);
            let baseOptions;
            if (configuration) {
                baseOptions = configuration.baseOptions;
            }
            const localVarRequestOptions = {
                method: 'PUT',
                ...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,
            };
        },
    };
};
/**
 * AgentTeamServiceApi - functional programming interface
 * @export
 */
export const AgentTeamServiceApiFp = function (configuration) {
    return {
        /**
         *
         * @summary Create AgentTeam
         * @param {EngineCreateAgentTeamRequest} body
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        async createAgentTeam(body, options) {
            const localVarAxiosArgs = await AgentTeamServiceApiAxiosParamCreator(configuration).createAgentTeam(body, options);
            return (axios = globalAxios, basePath = BASE_PATH) => {
                const axiosRequestArgs = {
                    ...localVarAxiosArgs.options,
                    url: basePath + localVarAxiosArgs.url,
                };
                return axios.request(axiosRequestArgs);
            };
        },
        /**
         *
         * @summary Remove AgentTeam
         * @param {string} id
         * @param {string} [domainId]
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        async deleteAgentTeam(id, domainId, options) {
            const localVarAxiosArgs = await AgentTeamServiceApiAxiosParamCreator(configuration).deleteAgentTeam(id, domainId, options);
            return (axios = globalAxios, basePath = BASE_PATH) => {
                const axiosRequestArgs = {
                    ...localVarAxiosArgs.options,
                    url: basePath + localVarAxiosArgs.url,
                };
                return axios.request(axiosRequestArgs);
            };
        },
        /**
         *
         * @summary AgentTeam item
         * @param {string} id
         * @param {string} [domainId]
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        async readAgentTeam(id, domainId, options) {
            const localVarAxiosArgs = await AgentTeamServiceApiAxiosParamCreator(configuration).readAgentTeam(id, domainId, options);
            return (axios = globalAxios, basePath = BASE_PATH) => {
                const axiosRequestArgs = {
                    ...localVarAxiosArgs.options,
                    url: basePath + localVarAxiosArgs.url,
                };
                return axios.request(axiosRequestArgs);
            };
        },
        /**
         *
         * @summary List of AgentTeam
         * @param {number} [page]
         * @param {number} [size]
         * @param {string} [q]
         * @param {string} [sort]
         * @param {Array<string>} [fields]
         * @param {Array<number>} [id]
         * @param {Array<string>} [strategy]
         * @param {Array<number>} [adminId]
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        async searchAgentTeam(page, size, q, sort, fields, id, strategy, adminId, options) {
            const localVarAxiosArgs = await AgentTeamServiceApiAxiosParamCreator(configuration).searchAgentTeam(page, size, q, sort, fields, id, strategy, adminId, options);
            return (axios = globalAxios, basePath = BASE_PATH) => {
                const axiosRequestArgs = {
                    ...localVarAxiosArgs.options,
                    url: basePath + localVarAxiosArgs.url,
                };
                return axios.request(axiosRequestArgs);
            };
        },
        /**
         *
         * @summary Update AgentTeam
         * @param {string} id
         * @param {EngineAgentTeamServiceUpdateAgentTeamBody} body
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        async updateAgentTeam(id, body, options) {
            const localVarAxiosArgs = await AgentTeamServiceApiAxiosParamCreator(configuration).updateAgentTeam(id, body, options);
            return (axios = globalAxios, basePath = BASE_PATH) => {
                const axiosRequestArgs = {
                    ...localVarAxiosArgs.options,
                    url: basePath + localVarAxiosArgs.url,
                };
                return axios.request(axiosRequestArgs);
            };
        },
    };
};
/**
 * AgentTeamServiceApi - factory interface
 * @export
 */
export const AgentTeamServiceApiFactory = function (configuration, basePath, axios) {
    return {
        /**
         *
         * @summary Create AgentTeam
         * @param {EngineCreateAgentTeamRequest} body
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        createAgentTeam(body, options) {
            return AgentTeamServiceApiFp(configuration)
                .createAgentTeam(body, options)
                .then((request) => request(axios, basePath));
        },
        /**
         *
         * @summary Remove AgentTeam
         * @param {string} id
         * @param {string} [domainId]
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        deleteAgentTeam(id, domainId, options) {
            return AgentTeamServiceApiFp(configuration)
                .deleteAgentTeam(id, domainId, options)
                .then((request) => request(axios, basePath));
        },
        /**
         *
         * @summary AgentTeam item
         * @param {string} id
         * @param {string} [domainId]
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        readAgentTeam(id, domainId, options) {
            return AgentTeamServiceApiFp(configuration)
                .readAgentTeam(id, domainId, options)
                .then((request) => request(axios, basePath));
        },
        /**
         *
         * @summary List of AgentTeam
         * @param {number} [page]
         * @param {number} [size]
         * @param {string} [q]
         * @param {string} [sort]
         * @param {Array<string>} [fields]
         * @param {Array<number>} [id]
         * @param {Array<string>} [strategy]
         * @param {Array<number>} [adminId]
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        searchAgentTeam(page, size, q, sort, fields, id, strategy, adminId, options) {
            return AgentTeamServiceApiFp(configuration)
                .searchAgentTeam(page, size, q, sort, fields, id, strategy, adminId, options)
                .then((request) => request(axios, basePath));
        },
        /**
         *
         * @summary Update AgentTeam
         * @param {string} id
         * @param {EngineAgentTeamServiceUpdateAgentTeamBody} body
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        updateAgentTeam(id, body, options) {
            return AgentTeamServiceApiFp(configuration)
                .updateAgentTeam(id, body, options)
                .then((request) => request(axios, basePath));
        },
    };
};
/**
 * AgentTeamServiceApi - object-oriented interface
 * @export
 * @class AgentTeamServiceApi
 * @extends {BaseAPI}
 */
export class AgentTeamServiceApi extends BaseAPI {
    /**
     *
     * @summary Create AgentTeam
     * @param {EngineCreateAgentTeamRequest} body
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     * @memberof AgentTeamServiceApi
     */
    createAgentTeam(body, options) {
        return AgentTeamServiceApiFp(this.configuration)
            .createAgentTeam(body, options)
            .then((request) => request(this.axios, this.basePath));
    }
    /**
     *
     * @summary Remove AgentTeam
     * @param {string} id
     * @param {string} [domainId]
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     * @memberof AgentTeamServiceApi
     */
    deleteAgentTeam(id, domainId, options) {
        return AgentTeamServiceApiFp(this.configuration)
            .deleteAgentTeam(id, domainId, options)
            .then((request) => request(this.axios, this.basePath));
    }
    /**
     *
     * @summary AgentTeam item
     * @param {string} id
     * @param {string} [domainId]
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     * @memberof AgentTeamServiceApi
     */
    readAgentTeam(id, domainId, options) {
        return AgentTeamServiceApiFp(this.configuration)
            .readAgentTeam(id, domainId, options)
            .then((request) => request(this.axios, this.basePath));
    }
    /**
     *
     * @summary List of AgentTeam
     * @param {number} [page]
     * @param {number} [size]
     * @param {string} [q]
     * @param {string} [sort]
     * @param {Array<string>} [fields]
     * @param {Array<number>} [id]
     * @param {Array<string>} [strategy]
     * @param {Array<number>} [adminId]
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     * @memberof AgentTeamServiceApi
     */
    searchAgentTeam(page, size, q, sort, fields, id, strategy, adminId, options) {
        return AgentTeamServiceApiFp(this.configuration)
            .searchAgentTeam(page, size, q, sort, fields, id, strategy, adminId, options)
            .then((request) => request(this.axios, this.basePath));
    }
    /**
     *
     * @summary Update AgentTeam
     * @param {string} id
     * @param {EngineAgentTeamServiceUpdateAgentTeamBody} body
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     * @memberof AgentTeamServiceApi
     */
    updateAgentTeam(id, body, options) {
        return AgentTeamServiceApiFp(this.configuration)
            .updateAgentTeam(id, body, options)
            .then((request) => request(this.axios, this.basePath));
    }
}
//# sourceMappingURL=agent-team-service-api.js.map