// 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';
/**
 * ForecastCalculationServiceApi - axios parameter creator
 * @export
 */
export const ForecastCalculationServiceApiAxiosParamCreator = function (configuration) {
    return {
        /**
         *
         * @param {WfmCreateForecastCalculationRequest} body
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        createForecastCalculation: 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 createForecastCalculation.');
            }
            const localVarPath = `/wfm/lookups/forecast_calculation`;
            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 {string} id
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        deleteForecastCalculation: 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 deleteForecastCalculation.');
            }
            const localVarPath = `/wfm/lookups/forecast_calculation/{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 {string} id
         * @param {string} [teamId]
         * @param {string} [forecastDataFrom]
         * @param {string} [forecastDataTo]
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        executeForecastCalculation: async (id, teamId, forecastDataFrom, forecastDataTo, 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 executeForecastCalculation.');
            }
            const localVarPath = `/wfm/lookups/forecast_calculation/{id}/execute`.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 (teamId !== undefined) {
                localVarQueryParameter['team_id'] = teamId;
            }
            if (forecastDataFrom !== undefined) {
                localVarQueryParameter['forecast_data.from'] = forecastDataFrom;
            }
            if (forecastDataTo !== undefined) {
                localVarQueryParameter['forecast_data.to'] = forecastDataTo;
            }
            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 {string} id
         * @param {Array<string>} [fields]
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        readForecastCalculation: async (id, fields, 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 readForecastCalculation.');
            }
            const localVarPath = `/wfm/lookups/forecast_calculation/{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 (fields) {
                localVarQueryParameter['fields'] = fields;
            }
            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 {string} [q]
         * @param {number} [page]
         * @param {number} [size]
         * @param {string} [sort]
         * @param {Array<string>} [fields]
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        searchForecastCalculation: async (q, page, size, sort, fields, options = {}) => {
            const localVarPath = `/wfm/lookups/forecast_calculation`;
            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 (q !== undefined) {
                localVarQueryParameter['q'] = q;
            }
            if (page !== undefined) {
                localVarQueryParameter['page'] = page;
            }
            if (size !== undefined) {
                localVarQueryParameter['size'] = size;
            }
            if (sort !== undefined) {
                localVarQueryParameter['sort'] = sort;
            }
            if (fields) {
                localVarQueryParameter['fields'] = fields;
            }
            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 {string} itemId
         * @param {InlineObject7} body
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        updateForecastCalculation: async (itemId, body, options = {}) => {
            // verify required parameter 'itemId' is not null or undefined
            if (itemId === null || itemId === undefined) {
                throw new RequiredError('itemId', 'Required parameter itemId was null or undefined when calling updateForecastCalculation.');
            }
            // 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 updateForecastCalculation.');
            }
            const localVarPath = `/wfm/lookups/forecast_calculation/{item.id}`.replace(`{${'item.id'}}`, encodeURIComponent(String(itemId)));
            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,
            };
        },
    };
};
/**
 * ForecastCalculationServiceApi - functional programming interface
 * @export
 */
export const ForecastCalculationServiceApiFp = function (configuration) {
    return {
        /**
         *
         * @param {WfmCreateForecastCalculationRequest} body
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        async createForecastCalculation(body, options) {
            const localVarAxiosArgs = await ForecastCalculationServiceApiAxiosParamCreator(configuration).createForecastCalculation(body, options);
            return (axios = globalAxios, basePath = BASE_PATH) => {
                const axiosRequestArgs = {
                    ...localVarAxiosArgs.options,
                    url: basePath + localVarAxiosArgs.url,
                };
                return axios.request(axiosRequestArgs);
            };
        },
        /**
         *
         * @param {string} id
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        async deleteForecastCalculation(id, options) {
            const localVarAxiosArgs = await ForecastCalculationServiceApiAxiosParamCreator(configuration).deleteForecastCalculation(id, options);
            return (axios = globalAxios, basePath = BASE_PATH) => {
                const axiosRequestArgs = {
                    ...localVarAxiosArgs.options,
                    url: basePath + localVarAxiosArgs.url,
                };
                return axios.request(axiosRequestArgs);
            };
        },
        /**
         *
         * @param {string} id
         * @param {string} [teamId]
         * @param {string} [forecastDataFrom]
         * @param {string} [forecastDataTo]
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        async executeForecastCalculation(id, teamId, forecastDataFrom, forecastDataTo, options) {
            const localVarAxiosArgs = await ForecastCalculationServiceApiAxiosParamCreator(configuration).executeForecastCalculation(id, teamId, forecastDataFrom, forecastDataTo, options);
            return (axios = globalAxios, basePath = BASE_PATH) => {
                const axiosRequestArgs = {
                    ...localVarAxiosArgs.options,
                    url: basePath + localVarAxiosArgs.url,
                };
                return axios.request(axiosRequestArgs);
            };
        },
        /**
         *
         * @param {string} id
         * @param {Array<string>} [fields]
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        async readForecastCalculation(id, fields, options) {
            const localVarAxiosArgs = await ForecastCalculationServiceApiAxiosParamCreator(configuration).readForecastCalculation(id, fields, options);
            return (axios = globalAxios, basePath = BASE_PATH) => {
                const axiosRequestArgs = {
                    ...localVarAxiosArgs.options,
                    url: basePath + localVarAxiosArgs.url,
                };
                return axios.request(axiosRequestArgs);
            };
        },
        /**
         *
         * @param {string} [q]
         * @param {number} [page]
         * @param {number} [size]
         * @param {string} [sort]
         * @param {Array<string>} [fields]
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        async searchForecastCalculation(q, page, size, sort, fields, options) {
            const localVarAxiosArgs = await ForecastCalculationServiceApiAxiosParamCreator(configuration).searchForecastCalculation(q, page, size, sort, fields, options);
            return (axios = globalAxios, basePath = BASE_PATH) => {
                const axiosRequestArgs = {
                    ...localVarAxiosArgs.options,
                    url: basePath + localVarAxiosArgs.url,
                };
                return axios.request(axiosRequestArgs);
            };
        },
        /**
         *
         * @param {string} itemId
         * @param {InlineObject7} body
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        async updateForecastCalculation(itemId, body, options) {
            const localVarAxiosArgs = await ForecastCalculationServiceApiAxiosParamCreator(configuration).updateForecastCalculation(itemId, body, options);
            return (axios = globalAxios, basePath = BASE_PATH) => {
                const axiosRequestArgs = {
                    ...localVarAxiosArgs.options,
                    url: basePath + localVarAxiosArgs.url,
                };
                return axios.request(axiosRequestArgs);
            };
        },
    };
};
/**
 * ForecastCalculationServiceApi - factory interface
 * @export
 */
export const ForecastCalculationServiceApiFactory = function (configuration, basePath, axios) {
    return {
        /**
         *
         * @param {WfmCreateForecastCalculationRequest} body
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        createForecastCalculation(body, options) {
            return ForecastCalculationServiceApiFp(configuration)
                .createForecastCalculation(body, options)
                .then((request) => request(axios, basePath));
        },
        /**
         *
         * @param {string} id
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        deleteForecastCalculation(id, options) {
            return ForecastCalculationServiceApiFp(configuration)
                .deleteForecastCalculation(id, options)
                .then((request) => request(axios, basePath));
        },
        /**
         *
         * @param {string} id
         * @param {string} [teamId]
         * @param {string} [forecastDataFrom]
         * @param {string} [forecastDataTo]
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        executeForecastCalculation(id, teamId, forecastDataFrom, forecastDataTo, options) {
            return ForecastCalculationServiceApiFp(configuration)
                .executeForecastCalculation(id, teamId, forecastDataFrom, forecastDataTo, options)
                .then((request) => request(axios, basePath));
        },
        /**
         *
         * @param {string} id
         * @param {Array<string>} [fields]
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        readForecastCalculation(id, fields, options) {
            return ForecastCalculationServiceApiFp(configuration)
                .readForecastCalculation(id, fields, options)
                .then((request) => request(axios, basePath));
        },
        /**
         *
         * @param {string} [q]
         * @param {number} [page]
         * @param {number} [size]
         * @param {string} [sort]
         * @param {Array<string>} [fields]
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        searchForecastCalculation(q, page, size, sort, fields, options) {
            return ForecastCalculationServiceApiFp(configuration)
                .searchForecastCalculation(q, page, size, sort, fields, options)
                .then((request) => request(axios, basePath));
        },
        /**
         *
         * @param {string} itemId
         * @param {InlineObject7} body
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        updateForecastCalculation(itemId, body, options) {
            return ForecastCalculationServiceApiFp(configuration)
                .updateForecastCalculation(itemId, body, options)
                .then((request) => request(axios, basePath));
        },
    };
};
/**
 * ForecastCalculationServiceApi - object-oriented interface
 * @export
 * @class ForecastCalculationServiceApi
 * @extends {BaseAPI}
 */
export class ForecastCalculationServiceApi extends BaseAPI {
    /**
     *
     * @param {WfmCreateForecastCalculationRequest} body
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     * @memberof ForecastCalculationServiceApi
     */
    createForecastCalculation(body, options) {
        return ForecastCalculationServiceApiFp(this.configuration)
            .createForecastCalculation(body, options)
            .then((request) => request(this.axios, this.basePath));
    }
    /**
     *
     * @param {string} id
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     * @memberof ForecastCalculationServiceApi
     */
    deleteForecastCalculation(id, options) {
        return ForecastCalculationServiceApiFp(this.configuration)
            .deleteForecastCalculation(id, options)
            .then((request) => request(this.axios, this.basePath));
    }
    /**
     *
     * @param {string} id
     * @param {string} [teamId]
     * @param {string} [forecastDataFrom]
     * @param {string} [forecastDataTo]
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     * @memberof ForecastCalculationServiceApi
     */
    executeForecastCalculation(id, teamId, forecastDataFrom, forecastDataTo, options) {
        return ForecastCalculationServiceApiFp(this.configuration)
            .executeForecastCalculation(id, teamId, forecastDataFrom, forecastDataTo, options)
            .then((request) => request(this.axios, this.basePath));
    }
    /**
     *
     * @param {string} id
     * @param {Array<string>} [fields]
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     * @memberof ForecastCalculationServiceApi
     */
    readForecastCalculation(id, fields, options) {
        return ForecastCalculationServiceApiFp(this.configuration)
            .readForecastCalculation(id, fields, options)
            .then((request) => request(this.axios, this.basePath));
    }
    /**
     *
     * @param {string} [q]
     * @param {number} [page]
     * @param {number} [size]
     * @param {string} [sort]
     * @param {Array<string>} [fields]
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     * @memberof ForecastCalculationServiceApi
     */
    searchForecastCalculation(q, page, size, sort, fields, options) {
        return ForecastCalculationServiceApiFp(this.configuration)
            .searchForecastCalculation(q, page, size, sort, fields, options)
            .then((request) => request(this.axios, this.basePath));
    }
    /**
     *
     * @param {string} itemId
     * @param {InlineObject7} body
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     * @memberof ForecastCalculationServiceApi
     */
    updateForecastCalculation(itemId, body, options) {
        return ForecastCalculationServiceApiFp(this.configuration)
            .updateForecastCalculation(itemId, body, options)
            .then((request) => request(this.axios, this.basePath));
    }
}
//# sourceMappingURL=forecast-calculation-service-api.js.map