// 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';
/**
 * 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: (body, options = {}) => __awaiter(this, void 0, void 0, function* () {
            // 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 = 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;
            }
            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 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: (id, domainId, options = {}) => __awaiter(this, void 0, void 0, function* () {
            // 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 = 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 (domainId !== undefined) {
                localVarQueryParameter['domain_id'] = domainId;
            }
            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 AgentTeam item
         * @param {string} id
         * @param {string} [domainId]
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        readAgentTeam: (id, domainId, options = {}) => __awaiter(this, void 0, void 0, function* () {
            // 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 = 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 (domainId !== undefined) {
                localVarQueryParameter['domain_id'] = domainId;
            }
            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 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 = {}) => __awaiter(this, void 0, void 0, function* () {
            const localVarPath = `/call_center/teams`;
            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 (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 = 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 Update AgentTeam
         * @param {string} id
         * @param {EngineAgentTeamServiceUpdateAgentTeamBody} body
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        updateAgentTeam: (id, body, options = {}) => __awaiter(this, void 0, void 0, function* () {
            // 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 = 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;
            }
            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 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}
         */
        createAgentTeam(body, options) {
            return __awaiter(this, void 0, void 0, function* () {
                const localVarAxiosArgs = yield AgentTeamServiceApiAxiosParamCreator(configuration).createAgentTeam(body, 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 AgentTeam
         * @param {string} id
         * @param {string} [domainId]
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        deleteAgentTeam(id, domainId, options) {
            return __awaiter(this, void 0, void 0, function* () {
                const localVarAxiosArgs = yield AgentTeamServiceApiAxiosParamCreator(configuration).deleteAgentTeam(id, domainId, options);
                return (axios = globalAxios, basePath = BASE_PATH) => {
                    const axiosRequestArgs = Object.assign(Object.assign({}, 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}
         */
        readAgentTeam(id, domainId, options) {
            return __awaiter(this, void 0, void 0, function* () {
                const localVarAxiosArgs = yield AgentTeamServiceApiAxiosParamCreator(configuration).readAgentTeam(id, domainId, 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 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 __awaiter(this, void 0, void 0, function* () {
                const localVarAxiosArgs = yield AgentTeamServiceApiAxiosParamCreator(configuration).searchAgentTeam(page, size, q, sort, fields, id, strategy, adminId, 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 AgentTeam
         * @param {string} id
         * @param {EngineAgentTeamServiceUpdateAgentTeamBody} body
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        updateAgentTeam(id, body, options) {
            return __awaiter(this, void 0, void 0, function* () {
                const localVarAxiosArgs = yield AgentTeamServiceApiAxiosParamCreator(configuration).updateAgentTeam(id, body, options);
                return (axios = globalAxios, basePath = BASE_PATH) => {
                    const axiosRequestArgs = Object.assign(Object.assign({}, 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