// 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';
/**
 * TriggerServiceApi - axios parameter creator
 * @export
 */
export const TriggerServiceApiAxiosParamCreator = function (configuration) {
    return {
        /**
         *
         * @summary Create Trigger
         * @param {EngineCreateTriggerRequest} body
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        createTrigger: 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 createTrigger.');
            }
            const localVarPath = `/trigger`;
            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} triggerId
         * @param {EngineTriggerServiceCreateTriggerJobBody} body
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        createTriggerJob: async (triggerId, body, options = {}) => {
            // verify required parameter 'triggerId' is not null or undefined
            if (triggerId === null || triggerId === undefined) {
                throw new RequiredError('triggerId', 'Required parameter triggerId was null or undefined when calling createTriggerJob.');
            }
            // 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 createTriggerJob.');
            }
            const localVarPath = `/trigger/{trigger_id}/job`.replace(`{${'trigger_id'}}`, encodeURIComponent(String(triggerId)));
            const localVarUrlObj = globalImportUrl.parse(localVarPath, true);
            let baseOptions;
            if (configuration) {
                baseOptions = configuration.baseOptions;
            }
            const localVarRequestOptions = {
                method: 'POST',
                ...baseOptions,
                ...options,
            };
            const localVarHeaderParameter = {};
            const localVarQueryParameter = {};
            // authentication AccessToken required
            if (configuration && configuration.apiKey) {
                const localVarApiKeyValue = typeof configuration.apiKey === 'function'
                    ? await configuration.apiKey('X-Webitel-Access')
                    : await configuration.apiKey;
                localVarHeaderParameter['X-Webitel-Access'] = localVarApiKeyValue;
            }
            localVarHeaderParameter['Content-Type'] = 'application/json';
            localVarUrlObj.query = {
                ...localVarUrlObj.query,
                ...localVarQueryParameter,
                ...options.query,
            };
            // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943
            delete localVarUrlObj.search;
            let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
            localVarRequestOptions.headers = {
                ...localVarHeaderParameter,
                ...headersFromBaseOptions,
                ...options.headers,
            };
            const needsSerialization = typeof body !== 'string' ||
                localVarRequestOptions.headers['Content-Type'] === 'application/json';
            localVarRequestOptions.data = needsSerialization
                ? JSON.stringify(body !== undefined ? body : {})
                : body || '';
            return {
                url: globalImportUrl.format(localVarUrlObj),
                options: localVarRequestOptions,
            };
        },
        /**
         *
         * @summary Remove Trigger
         * @param {number} id
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        deleteTrigger: 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 deleteTrigger.');
            }
            const localVarPath = `/trigger/{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 {EngineTriggerServicePatchTriggerBody} body
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        patchTrigger: 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 patchTrigger.');
            }
            // 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 patchTrigger.');
            }
            const localVarPath = `/trigger/{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,
            };
        },
        /**
         *
         * @summary Trigger item
         * @param {number} id
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        readTrigger: 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 readTrigger.');
            }
            const localVarPath = `/trigger/{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,
            };
        },
        /**
         *
         * @summary List of Trigger
         * @param {number} [page]
         * @param {number} [size]
         * @param {string} [q]
         * @param {string} [sort]
         * @param {Array<string>} [fields]
         * @param {Array<number>} [id]
         * @param {Array<number>} [schemaId]
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        searchTrigger: async (page, size, q, sort, fields, id, schemaId, options = {}) => {
            const localVarPath = `/trigger`;
            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 (schemaId) {
                localVarQueryParameter['schema_id'] = schemaId;
            }
            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} triggerId
         * @param {number} [page]
         * @param {number} [size]
         * @param {string} [q]
         * @param {string} [sort]
         * @param {Array<string>} [fields]
         * @param {string} [createdAtFrom]
         * @param {string} [createdAtTo]
         * @param {string} [startedAtFrom]
         * @param {string} [startedAtTo]
         * @param {string} [durationFrom]
         * @param {string} [durationTo]
         * @param {Array<'idle' | 'active' | 'done' | 'error'>} [state]
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        searchTriggerJob: async (triggerId, page, size, q, sort, fields, createdAtFrom, createdAtTo, startedAtFrom, startedAtTo, durationFrom, durationTo, state, options = {}) => {
            // verify required parameter 'triggerId' is not null or undefined
            if (triggerId === null || triggerId === undefined) {
                throw new RequiredError('triggerId', 'Required parameter triggerId was null or undefined when calling searchTriggerJob.');
            }
            const localVarPath = `/trigger/{trigger_id}/job`.replace(`{${'trigger_id'}}`, encodeURIComponent(String(triggerId)));
            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 (createdAtFrom !== undefined) {
                localVarQueryParameter['created_at.from'] = createdAtFrom;
            }
            if (createdAtTo !== undefined) {
                localVarQueryParameter['created_at.to'] = createdAtTo;
            }
            if (startedAtFrom !== undefined) {
                localVarQueryParameter['started_at.from'] = startedAtFrom;
            }
            if (startedAtTo !== undefined) {
                localVarQueryParameter['started_at.to'] = startedAtTo;
            }
            if (durationFrom !== undefined) {
                localVarQueryParameter['duration.from'] = durationFrom;
            }
            if (durationTo !== undefined) {
                localVarQueryParameter['duration.to'] = durationTo;
            }
            if (state) {
                localVarQueryParameter['state'] = state;
            }
            localVarUrlObj.query = {
                ...localVarUrlObj.query,
                ...localVarQueryParameter,
                ...options.query,
            };
            // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943
            delete localVarUrlObj.search;
            let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
            localVarRequestOptions.headers = {
                ...localVarHeaderParameter,
                ...headersFromBaseOptions,
                ...options.headers,
            };
            return {
                url: globalImportUrl.format(localVarUrlObj),
                options: localVarRequestOptions,
            };
        },
        /**
         *
         * @summary Update Trigger
         * @param {number} id
         * @param {EngineTriggerServiceUpdateTriggerBody} body
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        updateTrigger: 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 updateTrigger.');
            }
            // 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 updateTrigger.');
            }
            const localVarPath = `/trigger/{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,
            };
        },
    };
};
/**
 * TriggerServiceApi - functional programming interface
 * @export
 */
export const TriggerServiceApiFp = function (configuration) {
    return {
        /**
         *
         * @summary Create Trigger
         * @param {EngineCreateTriggerRequest} body
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        async createTrigger(body, options) {
            const localVarAxiosArgs = await TriggerServiceApiAxiosParamCreator(configuration).createTrigger(body, options);
            return (axios = globalAxios, basePath = BASE_PATH) => {
                const axiosRequestArgs = {
                    ...localVarAxiosArgs.options,
                    url: basePath + localVarAxiosArgs.url,
                };
                return axios.request(axiosRequestArgs);
            };
        },
        /**
         *
         * @param {number} triggerId
         * @param {EngineTriggerServiceCreateTriggerJobBody} body
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        async createTriggerJob(triggerId, body, options) {
            const localVarAxiosArgs = await TriggerServiceApiAxiosParamCreator(configuration).createTriggerJob(triggerId, body, options);
            return (axios = globalAxios, basePath = BASE_PATH) => {
                const axiosRequestArgs = {
                    ...localVarAxiosArgs.options,
                    url: basePath + localVarAxiosArgs.url,
                };
                return axios.request(axiosRequestArgs);
            };
        },
        /**
         *
         * @summary Remove Trigger
         * @param {number} id
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        async deleteTrigger(id, options) {
            const localVarAxiosArgs = await TriggerServiceApiAxiosParamCreator(configuration).deleteTrigger(id, options);
            return (axios = globalAxios, basePath = BASE_PATH) => {
                const axiosRequestArgs = {
                    ...localVarAxiosArgs.options,
                    url: basePath + localVarAxiosArgs.url,
                };
                return axios.request(axiosRequestArgs);
            };
        },
        /**
         *
         * @param {number} id
         * @param {EngineTriggerServicePatchTriggerBody} body
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        async patchTrigger(id, body, options) {
            const localVarAxiosArgs = await TriggerServiceApiAxiosParamCreator(configuration).patchTrigger(id, body, options);
            return (axios = globalAxios, basePath = BASE_PATH) => {
                const axiosRequestArgs = {
                    ...localVarAxiosArgs.options,
                    url: basePath + localVarAxiosArgs.url,
                };
                return axios.request(axiosRequestArgs);
            };
        },
        /**
         *
         * @summary Trigger item
         * @param {number} id
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        async readTrigger(id, options) {
            const localVarAxiosArgs = await TriggerServiceApiAxiosParamCreator(configuration).readTrigger(id, options);
            return (axios = globalAxios, basePath = BASE_PATH) => {
                const axiosRequestArgs = {
                    ...localVarAxiosArgs.options,
                    url: basePath + localVarAxiosArgs.url,
                };
                return axios.request(axiosRequestArgs);
            };
        },
        /**
         *
         * @summary List of Trigger
         * @param {number} [page]
         * @param {number} [size]
         * @param {string} [q]
         * @param {string} [sort]
         * @param {Array<string>} [fields]
         * @param {Array<number>} [id]
         * @param {Array<number>} [schemaId]
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        async searchTrigger(page, size, q, sort, fields, id, schemaId, options) {
            const localVarAxiosArgs = await TriggerServiceApiAxiosParamCreator(configuration).searchTrigger(page, size, q, sort, fields, id, schemaId, options);
            return (axios = globalAxios, basePath = BASE_PATH) => {
                const axiosRequestArgs = {
                    ...localVarAxiosArgs.options,
                    url: basePath + localVarAxiosArgs.url,
                };
                return axios.request(axiosRequestArgs);
            };
        },
        /**
         *
         * @param {number} triggerId
         * @param {number} [page]
         * @param {number} [size]
         * @param {string} [q]
         * @param {string} [sort]
         * @param {Array<string>} [fields]
         * @param {string} [createdAtFrom]
         * @param {string} [createdAtTo]
         * @param {string} [startedAtFrom]
         * @param {string} [startedAtTo]
         * @param {string} [durationFrom]
         * @param {string} [durationTo]
         * @param {Array<'idle' | 'active' | 'done' | 'error'>} [state]
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        async searchTriggerJob(triggerId, page, size, q, sort, fields, createdAtFrom, createdAtTo, startedAtFrom, startedAtTo, durationFrom, durationTo, state, options) {
            const localVarAxiosArgs = await TriggerServiceApiAxiosParamCreator(configuration).searchTriggerJob(triggerId, page, size, q, sort, fields, createdAtFrom, createdAtTo, startedAtFrom, startedAtTo, durationFrom, durationTo, state, options);
            return (axios = globalAxios, basePath = BASE_PATH) => {
                const axiosRequestArgs = {
                    ...localVarAxiosArgs.options,
                    url: basePath + localVarAxiosArgs.url,
                };
                return axios.request(axiosRequestArgs);
            };
        },
        /**
         *
         * @summary Update Trigger
         * @param {number} id
         * @param {EngineTriggerServiceUpdateTriggerBody} body
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        async updateTrigger(id, body, options) {
            const localVarAxiosArgs = await TriggerServiceApiAxiosParamCreator(configuration).updateTrigger(id, body, options);
            return (axios = globalAxios, basePath = BASE_PATH) => {
                const axiosRequestArgs = {
                    ...localVarAxiosArgs.options,
                    url: basePath + localVarAxiosArgs.url,
                };
                return axios.request(axiosRequestArgs);
            };
        },
    };
};
/**
 * TriggerServiceApi - factory interface
 * @export
 */
export const TriggerServiceApiFactory = function (configuration, basePath, axios) {
    return {
        /**
         *
         * @summary Create Trigger
         * @param {EngineCreateTriggerRequest} body
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        createTrigger(body, options) {
            return TriggerServiceApiFp(configuration)
                .createTrigger(body, options)
                .then((request) => request(axios, basePath));
        },
        /**
         *
         * @param {number} triggerId
         * @param {EngineTriggerServiceCreateTriggerJobBody} body
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        createTriggerJob(triggerId, body, options) {
            return TriggerServiceApiFp(configuration)
                .createTriggerJob(triggerId, body, options)
                .then((request) => request(axios, basePath));
        },
        /**
         *
         * @summary Remove Trigger
         * @param {number} id
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        deleteTrigger(id, options) {
            return TriggerServiceApiFp(configuration)
                .deleteTrigger(id, options)
                .then((request) => request(axios, basePath));
        },
        /**
         *
         * @param {number} id
         * @param {EngineTriggerServicePatchTriggerBody} body
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        patchTrigger(id, body, options) {
            return TriggerServiceApiFp(configuration)
                .patchTrigger(id, body, options)
                .then((request) => request(axios, basePath));
        },
        /**
         *
         * @summary Trigger item
         * @param {number} id
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        readTrigger(id, options) {
            return TriggerServiceApiFp(configuration)
                .readTrigger(id, options)
                .then((request) => request(axios, basePath));
        },
        /**
         *
         * @summary List of Trigger
         * @param {number} [page]
         * @param {number} [size]
         * @param {string} [q]
         * @param {string} [sort]
         * @param {Array<string>} [fields]
         * @param {Array<number>} [id]
         * @param {Array<number>} [schemaId]
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        searchTrigger(page, size, q, sort, fields, id, schemaId, options) {
            return TriggerServiceApiFp(configuration)
                .searchTrigger(page, size, q, sort, fields, id, schemaId, options)
                .then((request) => request(axios, basePath));
        },
        /**
         *
         * @param {number} triggerId
         * @param {number} [page]
         * @param {number} [size]
         * @param {string} [q]
         * @param {string} [sort]
         * @param {Array<string>} [fields]
         * @param {string} [createdAtFrom]
         * @param {string} [createdAtTo]
         * @param {string} [startedAtFrom]
         * @param {string} [startedAtTo]
         * @param {string} [durationFrom]
         * @param {string} [durationTo]
         * @param {Array<'idle' | 'active' | 'done' | 'error'>} [state]
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        searchTriggerJob(triggerId, page, size, q, sort, fields, createdAtFrom, createdAtTo, startedAtFrom, startedAtTo, durationFrom, durationTo, state, options) {
            return TriggerServiceApiFp(configuration)
                .searchTriggerJob(triggerId, page, size, q, sort, fields, createdAtFrom, createdAtTo, startedAtFrom, startedAtTo, durationFrom, durationTo, state, options)
                .then((request) => request(axios, basePath));
        },
        /**
         *
         * @summary Update Trigger
         * @param {number} id
         * @param {EngineTriggerServiceUpdateTriggerBody} body
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        updateTrigger(id, body, options) {
            return TriggerServiceApiFp(configuration)
                .updateTrigger(id, body, options)
                .then((request) => request(axios, basePath));
        },
    };
};
/**
 * TriggerServiceApi - object-oriented interface
 * @export
 * @class TriggerServiceApi
 * @extends {BaseAPI}
 */
export class TriggerServiceApi extends BaseAPI {
    /**
     *
     * @summary Create Trigger
     * @param {EngineCreateTriggerRequest} body
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     * @memberof TriggerServiceApi
     */
    createTrigger(body, options) {
        return TriggerServiceApiFp(this.configuration)
            .createTrigger(body, options)
            .then((request) => request(this.axios, this.basePath));
    }
    /**
     *
     * @param {number} triggerId
     * @param {EngineTriggerServiceCreateTriggerJobBody} body
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     * @memberof TriggerServiceApi
     */
    createTriggerJob(triggerId, body, options) {
        return TriggerServiceApiFp(this.configuration)
            .createTriggerJob(triggerId, body, options)
            .then((request) => request(this.axios, this.basePath));
    }
    /**
     *
     * @summary Remove Trigger
     * @param {number} id
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     * @memberof TriggerServiceApi
     */
    deleteTrigger(id, options) {
        return TriggerServiceApiFp(this.configuration)
            .deleteTrigger(id, options)
            .then((request) => request(this.axios, this.basePath));
    }
    /**
     *
     * @param {number} id
     * @param {EngineTriggerServicePatchTriggerBody} body
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     * @memberof TriggerServiceApi
     */
    patchTrigger(id, body, options) {
        return TriggerServiceApiFp(this.configuration)
            .patchTrigger(id, body, options)
            .then((request) => request(this.axios, this.basePath));
    }
    /**
     *
     * @summary Trigger item
     * @param {number} id
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     * @memberof TriggerServiceApi
     */
    readTrigger(id, options) {
        return TriggerServiceApiFp(this.configuration)
            .readTrigger(id, options)
            .then((request) => request(this.axios, this.basePath));
    }
    /**
     *
     * @summary List of Trigger
     * @param {number} [page]
     * @param {number} [size]
     * @param {string} [q]
     * @param {string} [sort]
     * @param {Array<string>} [fields]
     * @param {Array<number>} [id]
     * @param {Array<number>} [schemaId]
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     * @memberof TriggerServiceApi
     */
    searchTrigger(page, size, q, sort, fields, id, schemaId, options) {
        return TriggerServiceApiFp(this.configuration)
            .searchTrigger(page, size, q, sort, fields, id, schemaId, options)
            .then((request) => request(this.axios, this.basePath));
    }
    /**
     *
     * @param {number} triggerId
     * @param {number} [page]
     * @param {number} [size]
     * @param {string} [q]
     * @param {string} [sort]
     * @param {Array<string>} [fields]
     * @param {string} [createdAtFrom]
     * @param {string} [createdAtTo]
     * @param {string} [startedAtFrom]
     * @param {string} [startedAtTo]
     * @param {string} [durationFrom]
     * @param {string} [durationTo]
     * @param {Array<'idle' | 'active' | 'done' | 'error'>} [state]
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     * @memberof TriggerServiceApi
     */
    searchTriggerJob(triggerId, page, size, q, sort, fields, createdAtFrom, createdAtTo, startedAtFrom, startedAtTo, durationFrom, durationTo, state, options) {
        return TriggerServiceApiFp(this.configuration)
            .searchTriggerJob(triggerId, page, size, q, sort, fields, createdAtFrom, createdAtTo, startedAtFrom, startedAtTo, durationFrom, durationTo, state, options)
            .then((request) => request(this.axios, this.basePath));
    }
    /**
     *
     * @summary Update Trigger
     * @param {number} id
     * @param {EngineTriggerServiceUpdateTriggerBody} body
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     * @memberof TriggerServiceApi
     */
    updateTrigger(id, body, options) {
        return TriggerServiceApiFp(this.configuration)
            .updateTrigger(id, body, options)
            .then((request) => request(this.axios, this.basePath));
    }
}
//# sourceMappingURL=trigger-service-api.js.map