// 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';
/**
 * RoutingChatPlanServiceApi - axios parameter creator
 * @export
 */
export const RoutingChatPlanServiceApiAxiosParamCreator = function (configuration) {
    return {
        /**
         *
         * @param {EngineCreateChatPlanRequest} body
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        createChatPlan: 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 createChatPlan.');
            }
            const localVarPath = `/routing/outbound/chat`;
            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,
            };
        },
        /**
         *
         * @param {number} id
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        deleteChatPlan: async (id, 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 deleteChatPlan.');
            }
            const localVarPath = `/routing/outbound/chat/{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;
            }
            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,
            };
        },
        /**
         *
         * @param {number} id
         * @param {EngineRoutingChatPlanServicePatchChatPlanBody} body
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        patchChatPlan: 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 patchChatPlan.');
            }
            // 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 patchChatPlan.');
            }
            const localVarPath = `/routing/outbound/chat/{id}`.replace(`{${'id'}}`, encodeURIComponent(String(id)));
            const localVarUrlObj = globalImportUrl.parse(localVarPath, true);
            let baseOptions;
            if (configuration) {
                baseOptions = configuration.baseOptions;
            }
            const localVarRequestOptions = {
                method: 'PATCH',
                ...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,
            };
        },
        /**
         *
         * @param {number} id
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        readChatPlan: async (id, 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 readChatPlan.');
            }
            const localVarPath = `/routing/outbound/chat/{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;
            }
            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,
            };
        },
        /**
         *
         * @param {number} [page]
         * @param {number} [size]
         * @param {string} [q]
         * @param {string} [sort]
         * @param {Array<string>} [fields]
         * @param {Array<number>} [id]
         * @param {string} [name]
         * @param {boolean} [enabled]
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        searchChatPlan: async (page, size, q, sort, fields, id, name, enabled, options = {}) => {
            const localVarPath = `/routing/outbound/chat`;
            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 (name !== undefined) {
                localVarQueryParameter['name'] = name;
            }
            if (enabled !== undefined) {
                localVarQueryParameter['enabled'] = enabled;
            }
            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,
            };
        },
        /**
         *
         * @param {number} id
         * @param {EngineRoutingChatPlanServiceUpdateChatPlanBody} body
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        updateChatPlan: 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 updateChatPlan.');
            }
            // 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 updateChatPlan.');
            }
            const localVarPath = `/routing/outbound/chat/{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,
            };
        },
    };
};
/**
 * RoutingChatPlanServiceApi - functional programming interface
 * @export
 */
export const RoutingChatPlanServiceApiFp = function (configuration) {
    return {
        /**
         *
         * @param {EngineCreateChatPlanRequest} body
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        async createChatPlan(body, options) {
            const localVarAxiosArgs = await RoutingChatPlanServiceApiAxiosParamCreator(configuration).createChatPlan(body, options);
            return (axios = globalAxios, basePath = BASE_PATH) => {
                const axiosRequestArgs = {
                    ...localVarAxiosArgs.options,
                    url: basePath + localVarAxiosArgs.url,
                };
                return axios.request(axiosRequestArgs);
            };
        },
        /**
         *
         * @param {number} id
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        async deleteChatPlan(id, options) {
            const localVarAxiosArgs = await RoutingChatPlanServiceApiAxiosParamCreator(configuration).deleteChatPlan(id, options);
            return (axios = globalAxios, basePath = BASE_PATH) => {
                const axiosRequestArgs = {
                    ...localVarAxiosArgs.options,
                    url: basePath + localVarAxiosArgs.url,
                };
                return axios.request(axiosRequestArgs);
            };
        },
        /**
         *
         * @param {number} id
         * @param {EngineRoutingChatPlanServicePatchChatPlanBody} body
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        async patchChatPlan(id, body, options) {
            const localVarAxiosArgs = await RoutingChatPlanServiceApiAxiosParamCreator(configuration).patchChatPlan(id, body, options);
            return (axios = globalAxios, basePath = BASE_PATH) => {
                const axiosRequestArgs = {
                    ...localVarAxiosArgs.options,
                    url: basePath + localVarAxiosArgs.url,
                };
                return axios.request(axiosRequestArgs);
            };
        },
        /**
         *
         * @param {number} id
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        async readChatPlan(id, options) {
            const localVarAxiosArgs = await RoutingChatPlanServiceApiAxiosParamCreator(configuration).readChatPlan(id, options);
            return (axios = globalAxios, basePath = BASE_PATH) => {
                const axiosRequestArgs = {
                    ...localVarAxiosArgs.options,
                    url: basePath + localVarAxiosArgs.url,
                };
                return axios.request(axiosRequestArgs);
            };
        },
        /**
         *
         * @param {number} [page]
         * @param {number} [size]
         * @param {string} [q]
         * @param {string} [sort]
         * @param {Array<string>} [fields]
         * @param {Array<number>} [id]
         * @param {string} [name]
         * @param {boolean} [enabled]
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        async searchChatPlan(page, size, q, sort, fields, id, name, enabled, options) {
            const localVarAxiosArgs = await RoutingChatPlanServiceApiAxiosParamCreator(configuration).searchChatPlan(page, size, q, sort, fields, id, name, enabled, options);
            return (axios = globalAxios, basePath = BASE_PATH) => {
                const axiosRequestArgs = {
                    ...localVarAxiosArgs.options,
                    url: basePath + localVarAxiosArgs.url,
                };
                return axios.request(axiosRequestArgs);
            };
        },
        /**
         *
         * @param {number} id
         * @param {EngineRoutingChatPlanServiceUpdateChatPlanBody} body
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        async updateChatPlan(id, body, options) {
            const localVarAxiosArgs = await RoutingChatPlanServiceApiAxiosParamCreator(configuration).updateChatPlan(id, body, options);
            return (axios = globalAxios, basePath = BASE_PATH) => {
                const axiosRequestArgs = {
                    ...localVarAxiosArgs.options,
                    url: basePath + localVarAxiosArgs.url,
                };
                return axios.request(axiosRequestArgs);
            };
        },
    };
};
/**
 * RoutingChatPlanServiceApi - factory interface
 * @export
 */
export const RoutingChatPlanServiceApiFactory = function (configuration, basePath, axios) {
    return {
        /**
         *
         * @param {EngineCreateChatPlanRequest} body
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        createChatPlan(body, options) {
            return RoutingChatPlanServiceApiFp(configuration)
                .createChatPlan(body, options)
                .then((request) => request(axios, basePath));
        },
        /**
         *
         * @param {number} id
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        deleteChatPlan(id, options) {
            return RoutingChatPlanServiceApiFp(configuration)
                .deleteChatPlan(id, options)
                .then((request) => request(axios, basePath));
        },
        /**
         *
         * @param {number} id
         * @param {EngineRoutingChatPlanServicePatchChatPlanBody} body
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        patchChatPlan(id, body, options) {
            return RoutingChatPlanServiceApiFp(configuration)
                .patchChatPlan(id, body, options)
                .then((request) => request(axios, basePath));
        },
        /**
         *
         * @param {number} id
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        readChatPlan(id, options) {
            return RoutingChatPlanServiceApiFp(configuration)
                .readChatPlan(id, options)
                .then((request) => request(axios, basePath));
        },
        /**
         *
         * @param {number} [page]
         * @param {number} [size]
         * @param {string} [q]
         * @param {string} [sort]
         * @param {Array<string>} [fields]
         * @param {Array<number>} [id]
         * @param {string} [name]
         * @param {boolean} [enabled]
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        searchChatPlan(page, size, q, sort, fields, id, name, enabled, options) {
            return RoutingChatPlanServiceApiFp(configuration)
                .searchChatPlan(page, size, q, sort, fields, id, name, enabled, options)
                .then((request) => request(axios, basePath));
        },
        /**
         *
         * @param {number} id
         * @param {EngineRoutingChatPlanServiceUpdateChatPlanBody} body
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        updateChatPlan(id, body, options) {
            return RoutingChatPlanServiceApiFp(configuration)
                .updateChatPlan(id, body, options)
                .then((request) => request(axios, basePath));
        },
    };
};
/**
 * RoutingChatPlanServiceApi - object-oriented interface
 * @export
 * @class RoutingChatPlanServiceApi
 * @extends {BaseAPI}
 */
export class RoutingChatPlanServiceApi extends BaseAPI {
    /**
     *
     * @param {EngineCreateChatPlanRequest} body
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     * @memberof RoutingChatPlanServiceApi
     */
    createChatPlan(body, options) {
        return RoutingChatPlanServiceApiFp(this.configuration)
            .createChatPlan(body, options)
            .then((request) => request(this.axios, this.basePath));
    }
    /**
     *
     * @param {number} id
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     * @memberof RoutingChatPlanServiceApi
     */
    deleteChatPlan(id, options) {
        return RoutingChatPlanServiceApiFp(this.configuration)
            .deleteChatPlan(id, options)
            .then((request) => request(this.axios, this.basePath));
    }
    /**
     *
     * @param {number} id
     * @param {EngineRoutingChatPlanServicePatchChatPlanBody} body
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     * @memberof RoutingChatPlanServiceApi
     */
    patchChatPlan(id, body, options) {
        return RoutingChatPlanServiceApiFp(this.configuration)
            .patchChatPlan(id, body, options)
            .then((request) => request(this.axios, this.basePath));
    }
    /**
     *
     * @param {number} id
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     * @memberof RoutingChatPlanServiceApi
     */
    readChatPlan(id, options) {
        return RoutingChatPlanServiceApiFp(this.configuration)
            .readChatPlan(id, options)
            .then((request) => request(this.axios, this.basePath));
    }
    /**
     *
     * @param {number} [page]
     * @param {number} [size]
     * @param {string} [q]
     * @param {string} [sort]
     * @param {Array<string>} [fields]
     * @param {Array<number>} [id]
     * @param {string} [name]
     * @param {boolean} [enabled]
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     * @memberof RoutingChatPlanServiceApi
     */
    searchChatPlan(page, size, q, sort, fields, id, name, enabled, options) {
        return RoutingChatPlanServiceApiFp(this.configuration)
            .searchChatPlan(page, size, q, sort, fields, id, name, enabled, options)
            .then((request) => request(this.axios, this.basePath));
    }
    /**
     *
     * @param {number} id
     * @param {EngineRoutingChatPlanServiceUpdateChatPlanBody} body
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     * @memberof RoutingChatPlanServiceApi
     */
    updateChatPlan(id, body, options) {
        return RoutingChatPlanServiceApiFp(this.configuration)
            .updateChatPlan(id, body, options)
            .then((request) => request(this.axios, this.basePath));
    }
}
//# sourceMappingURL=routing-chat-plan-service-api.js.map