// 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';
/**
 * PauseTemplateServiceApi - axios parameter creator
 * @export
 */
export const PauseTemplateServiceApiAxiosParamCreator = function (configuration) {
    return {
        /**
         *
         * @param {WfmCreatePauseTemplateRequest} body
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        createPauseTemplate: (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 createPauseTemplate.');
            }
            const localVarPath = `/wfm/lookups/pause_templates`;
            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,
            };
        }),
        /**
         *
         * @param {string} id
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        deletePauseTemplate: (id, 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 deletePauseTemplate.');
            }
            const localVarPath = `/wfm/lookups/pause_templates/{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;
            }
            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,
            };
        }),
        /**
         *
         * @param {string} id
         * @param {Array<string>} [fields]
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        readPauseTemplate: (id, fields, 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 readPauseTemplate.');
            }
            const localVarPath = `/wfm/lookups/pause_templates/{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 (fields) {
                localVarQueryParameter['fields'] = fields;
            }
            localVarUrlObj.query = Object.assign(Object.assign(Object.assign({}, localVarUrlObj.query), localVarQueryParameter), options.query);
            // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943
            delete localVarUrlObj.search;
            let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
            localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
            return {
                url: globalImportUrl.format(localVarUrlObj),
                options: localVarRequestOptions,
            };
        }),
        /**
         *
         * @param {string} [q]
         * @param {number} [page]
         * @param {number} [size]
         * @param {string} [sort]
         * @param {Array<string>} [fields]
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        searchPauseTemplate: (q, page, size, sort, fields, options = {}) => __awaiter(this, void 0, void 0, function* () {
            const localVarPath = `/wfm/lookups/pause_templates`;
            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 (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 = 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 UpdatePauseTemplateCauseBulk updates a pause template with a list of causes. Update existing cause, create that not exists in database and delete that not exists in the list.
         * @param {string} itemId
         * @param {InlineObject8} body
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        updatePauseTemplate: (itemId, body, options = {}) => __awaiter(this, void 0, void 0, function* () {
            // 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 updatePauseTemplate.');
            }
            // 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 updatePauseTemplate.');
            }
            const localVarPath = `/wfm/lookups/pause_templates/{item.id}`.replace(`{${'item.id'}}`, encodeURIComponent(String(itemId)));
            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,
            };
        }),
    };
};
/**
 * PauseTemplateServiceApi - functional programming interface
 * @export
 */
export const PauseTemplateServiceApiFp = function (configuration) {
    return {
        /**
         *
         * @param {WfmCreatePauseTemplateRequest} body
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        createPauseTemplate(body, options) {
            return __awaiter(this, void 0, void 0, function* () {
                const localVarAxiosArgs = yield PauseTemplateServiceApiAxiosParamCreator(configuration).createPauseTemplate(body, options);
                return (axios = globalAxios, basePath = BASE_PATH) => {
                    const axiosRequestArgs = Object.assign(Object.assign({}, localVarAxiosArgs.options), { url: basePath + localVarAxiosArgs.url });
                    return axios.request(axiosRequestArgs);
                };
            });
        },
        /**
         *
         * @param {string} id
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        deletePauseTemplate(id, options) {
            return __awaiter(this, void 0, void 0, function* () {
                const localVarAxiosArgs = yield PauseTemplateServiceApiAxiosParamCreator(configuration).deletePauseTemplate(id, options);
                return (axios = globalAxios, basePath = BASE_PATH) => {
                    const axiosRequestArgs = Object.assign(Object.assign({}, 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}
         */
        readPauseTemplate(id, fields, options) {
            return __awaiter(this, void 0, void 0, function* () {
                const localVarAxiosArgs = yield PauseTemplateServiceApiAxiosParamCreator(configuration).readPauseTemplate(id, fields, options);
                return (axios = globalAxios, basePath = BASE_PATH) => {
                    const axiosRequestArgs = Object.assign(Object.assign({}, 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}
         */
        searchPauseTemplate(q, page, size, sort, fields, options) {
            return __awaiter(this, void 0, void 0, function* () {
                const localVarAxiosArgs = yield PauseTemplateServiceApiAxiosParamCreator(configuration).searchPauseTemplate(q, page, size, sort, fields, options);
                return (axios = globalAxios, basePath = BASE_PATH) => {
                    const axiosRequestArgs = Object.assign(Object.assign({}, localVarAxiosArgs.options), { url: basePath + localVarAxiosArgs.url });
                    return axios.request(axiosRequestArgs);
                };
            });
        },
        /**
         *
         * @summary UpdatePauseTemplateCauseBulk updates a pause template with a list of causes. Update existing cause, create that not exists in database and delete that not exists in the list.
         * @param {string} itemId
         * @param {InlineObject8} body
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        updatePauseTemplate(itemId, body, options) {
            return __awaiter(this, void 0, void 0, function* () {
                const localVarAxiosArgs = yield PauseTemplateServiceApiAxiosParamCreator(configuration).updatePauseTemplate(itemId, body, options);
                return (axios = globalAxios, basePath = BASE_PATH) => {
                    const axiosRequestArgs = Object.assign(Object.assign({}, localVarAxiosArgs.options), { url: basePath + localVarAxiosArgs.url });
                    return axios.request(axiosRequestArgs);
                };
            });
        },
    };
};
/**
 * PauseTemplateServiceApi - factory interface
 * @export
 */
export const PauseTemplateServiceApiFactory = function (configuration, basePath, axios) {
    return {
        /**
         *
         * @param {WfmCreatePauseTemplateRequest} body
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        createPauseTemplate(body, options) {
            return PauseTemplateServiceApiFp(configuration)
                .createPauseTemplate(body, options)
                .then((request) => request(axios, basePath));
        },
        /**
         *
         * @param {string} id
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        deletePauseTemplate(id, options) {
            return PauseTemplateServiceApiFp(configuration)
                .deletePauseTemplate(id, options)
                .then((request) => request(axios, basePath));
        },
        /**
         *
         * @param {string} id
         * @param {Array<string>} [fields]
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        readPauseTemplate(id, fields, options) {
            return PauseTemplateServiceApiFp(configuration)
                .readPauseTemplate(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}
         */
        searchPauseTemplate(q, page, size, sort, fields, options) {
            return PauseTemplateServiceApiFp(configuration)
                .searchPauseTemplate(q, page, size, sort, fields, options)
                .then((request) => request(axios, basePath));
        },
        /**
         *
         * @summary UpdatePauseTemplateCauseBulk updates a pause template with a list of causes. Update existing cause, create that not exists in database and delete that not exists in the list.
         * @param {string} itemId
         * @param {InlineObject8} body
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        updatePauseTemplate(itemId, body, options) {
            return PauseTemplateServiceApiFp(configuration)
                .updatePauseTemplate(itemId, body, options)
                .then((request) => request(axios, basePath));
        },
    };
};
/**
 * PauseTemplateServiceApi - object-oriented interface
 * @export
 * @class PauseTemplateServiceApi
 * @extends {BaseAPI}
 */
export class PauseTemplateServiceApi extends BaseAPI {
    /**
     *
     * @param {WfmCreatePauseTemplateRequest} body
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     * @memberof PauseTemplateServiceApi
     */
    createPauseTemplate(body, options) {
        return PauseTemplateServiceApiFp(this.configuration)
            .createPauseTemplate(body, options)
            .then((request) => request(this.axios, this.basePath));
    }
    /**
     *
     * @param {string} id
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     * @memberof PauseTemplateServiceApi
     */
    deletePauseTemplate(id, options) {
        return PauseTemplateServiceApiFp(this.configuration)
            .deletePauseTemplate(id, options)
            .then((request) => request(this.axios, this.basePath));
    }
    /**
     *
     * @param {string} id
     * @param {Array<string>} [fields]
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     * @memberof PauseTemplateServiceApi
     */
    readPauseTemplate(id, fields, options) {
        return PauseTemplateServiceApiFp(this.configuration)
            .readPauseTemplate(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 PauseTemplateServiceApi
     */
    searchPauseTemplate(q, page, size, sort, fields, options) {
        return PauseTemplateServiceApiFp(this.configuration)
            .searchPauseTemplate(q, page, size, sort, fields, options)
            .then((request) => request(this.axios, this.basePath));
    }
    /**
     *
     * @summary UpdatePauseTemplateCauseBulk updates a pause template with a list of causes. Update existing cause, create that not exists in database and delete that not exists in the list.
     * @param {string} itemId
     * @param {InlineObject8} body
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     * @memberof PauseTemplateServiceApi
     */
    updatePauseTemplate(itemId, body, options) {
        return PauseTemplateServiceApiFp(this.configuration)
            .updatePauseTemplate(itemId, body, options)
            .then((request) => request(this.axios, this.basePath));
    }
}
//# sourceMappingURL=pause-template-service-api.js.map