"use strict";
/* tslint:disable */
/* eslint-disable */
/**
 * Admin API
 * The Admin API is used to manage the ApeCloud platform.
 *
 * The version of the OpenAPI document: 1.0.0
 * Contact: support@apecloud.com
 *
 * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
 * https://openapi-generator.tech
 * Do not edit the class manually.
 */
var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.TaskApi = exports.TaskApiFactory = exports.TaskApiFp = exports.TaskApiAxiosParamCreator = void 0;
const axios_1 = __importDefault(require("axios"));
// Some imports not used depending on template conditions
// @ts-ignore
const common_1 = require("../common");
// @ts-ignore
const base_1 = require("../base");
/**
 * TaskApi - axios parameter creator
 * @export
 */
const TaskApiAxiosParamCreator = function (configuration) {
    return {
        /**
         * Cancel a task by taskID.
         * @summary Cancel a task
         * @param {string} taskId ID of the task
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        cancelTask: async (taskId, options = {}) => {
            // verify required parameter 'taskId' is not null or undefined
            (0, common_1.assertParamExists)('cancelTask', 'taskId', taskId);
            const localVarPath = `/admin/v1/tasks/{taskId}/cancel`
                .replace(`{${"taskId"}}`, encodeURIComponent(String(taskId)));
            // use dummy base URL string because the URL constructor only accepts absolute URLs.
            const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
            let baseOptions;
            if (configuration) {
                baseOptions = configuration.baseOptions;
            }
            const localVarRequestOptions = Object.assign(Object.assign({ method: 'POST' }, baseOptions), options);
            const localVarHeaderParameter = {};
            const localVarQueryParameter = {};
            // authentication BearerToken required
            // http bearer authentication required
            await (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration);
            // authentication DigestAuth required
            await (0, common_1.setApiKeyToObject)(localVarHeaderParameter, "Authorization", configuration);
            (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
            let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
            localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
            return {
                url: (0, common_1.toPathString)(localVarUrlObj),
                options: localVarRequestOptions,
            };
        },
        /**
         * Get task
         * @summary Get task detail
         * @param {string} taskId ID of the task
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        getTask: async (taskId, options = {}) => {
            // verify required parameter 'taskId' is not null or undefined
            (0, common_1.assertParamExists)('getTask', 'taskId', taskId);
            const localVarPath = `/admin/v1/tasks/{taskId}`
                .replace(`{${"taskId"}}`, encodeURIComponent(String(taskId)));
            // use dummy base URL string because the URL constructor only accepts absolute URLs.
            const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
            let baseOptions;
            if (configuration) {
                baseOptions = configuration.baseOptions;
            }
            const localVarRequestOptions = Object.assign(Object.assign({ method: 'GET' }, baseOptions), options);
            const localVarHeaderParameter = {};
            const localVarQueryParameter = {};
            // authentication BearerToken required
            // http bearer authentication required
            await (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration);
            // authentication DigestAuth required
            await (0, common_1.setApiKeyToObject)(localVarHeaderParameter, "Authorization", configuration);
            (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
            let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
            localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
            return {
                url: (0, common_1.toPathString)(localVarUrlObj),
                options: localVarRequestOptions,
            };
        },
        /**
         *
         * @summary Get task log
         * @param {string} taskId ID of the task
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        getTaskLog: async (taskId, options = {}) => {
            // verify required parameter 'taskId' is not null or undefined
            (0, common_1.assertParamExists)('getTaskLog', 'taskId', taskId);
            const localVarPath = `/admin/v1/tasks/{taskId}/log`
                .replace(`{${"taskId"}}`, encodeURIComponent(String(taskId)));
            // use dummy base URL string because the URL constructor only accepts absolute URLs.
            const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
            let baseOptions;
            if (configuration) {
                baseOptions = configuration.baseOptions;
            }
            const localVarRequestOptions = Object.assign(Object.assign({ method: 'GET' }, baseOptions), options);
            const localVarHeaderParameter = {};
            const localVarQueryParameter = {};
            // authentication BearerToken required
            // http bearer authentication required
            await (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration);
            // authentication DigestAuth required
            await (0, common_1.setApiKeyToObject)(localVarHeaderParameter, "Authorization", configuration);
            (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
            let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
            localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
            return {
                url: (0, common_1.toPathString)(localVarUrlObj),
                options: localVarRequestOptions,
            };
        },
        /**
         * Get logs for a specific task step (supports job type steps)
         * @summary Get task step log
         * @param {string} taskId ID of the task
         * @param {string} stepId ID of the step
         * @param {boolean} [follow] Follow log stream (streaming mode for running steps)
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        getTaskStepLog: async (taskId, stepId, follow, options = {}) => {
            // verify required parameter 'taskId' is not null or undefined
            (0, common_1.assertParamExists)('getTaskStepLog', 'taskId', taskId);
            // verify required parameter 'stepId' is not null or undefined
            (0, common_1.assertParamExists)('getTaskStepLog', 'stepId', stepId);
            const localVarPath = `/admin/v1/tasks/{taskId}/steps/{stepId}/log`
                .replace(`{${"taskId"}}`, encodeURIComponent(String(taskId)))
                .replace(`{${"stepId"}}`, encodeURIComponent(String(stepId)));
            // use dummy base URL string because the URL constructor only accepts absolute URLs.
            const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
            let baseOptions;
            if (configuration) {
                baseOptions = configuration.baseOptions;
            }
            const localVarRequestOptions = Object.assign(Object.assign({ method: 'GET' }, baseOptions), options);
            const localVarHeaderParameter = {};
            const localVarQueryParameter = {};
            // authentication BearerToken required
            // http bearer authentication required
            await (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration);
            // authentication DigestAuth required
            await (0, common_1.setApiKeyToObject)(localVarHeaderParameter, "Authorization", configuration);
            if (follow !== undefined) {
                localVarQueryParameter['follow'] = follow;
            }
            (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
            let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
            localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
            return {
                url: (0, common_1.toPathString)(localVarUrlObj),
                options: localVarRequestOptions,
            };
        },
        /**
         * List task types
         * @summary List task types
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        listTaskTypes: async (options = {}) => {
            const localVarPath = `/admin/v1/taskTypes`;
            // use dummy base URL string because the URL constructor only accepts absolute URLs.
            const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
            let baseOptions;
            if (configuration) {
                baseOptions = configuration.baseOptions;
            }
            const localVarRequestOptions = Object.assign(Object.assign({ method: 'GET' }, baseOptions), options);
            const localVarHeaderParameter = {};
            const localVarQueryParameter = {};
            // authentication BearerToken required
            // http bearer authentication required
            await (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration);
            // authentication DigestAuth required
            await (0, common_1.setApiKeyToObject)(localVarHeaderParameter, "Authorization", configuration);
            (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
            let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
            localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
            return {
                url: (0, common_1.toPathString)(localVarUrlObj),
                options: localVarRequestOptions,
            };
        },
        /**
         * List tasks
         * @summary List task
         * @param {number} start The start of the time range for the query, unit is seconds.
         * @param {number} end The end of the time range for the query, unit is seconds.
         * @param {string} [orgName] Filter by organization name
         * @param {string} [resourceId] Filter by resource ID (such as cluster ID, environment ID, etc.)
         * @param {string} [resourceType] Filter by resource type
         * @param {string} [taskType] Filter by task type (supports multiple task types separated by commas, e.g., \&quot;cluster-scale,cluster-upgrade\&quot;)
         * @param {string} [status] Filter by task status (supports multiple statuses separated by commas, e.g., \&quot;Running,Pending\&quot;)
         * @param {number} [pageNumber] The pageNumber of the query
         * @param {number} [pageSize] The pageSize of the query
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        listTasks: async (start, end, orgName, resourceId, resourceType, taskType, status, pageNumber, pageSize, options = {}) => {
            // verify required parameter 'start' is not null or undefined
            (0, common_1.assertParamExists)('listTasks', 'start', start);
            // verify required parameter 'end' is not null or undefined
            (0, common_1.assertParamExists)('listTasks', 'end', end);
            const localVarPath = `/admin/v1/tasks`;
            // use dummy base URL string because the URL constructor only accepts absolute URLs.
            const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
            let baseOptions;
            if (configuration) {
                baseOptions = configuration.baseOptions;
            }
            const localVarRequestOptions = Object.assign(Object.assign({ method: 'GET' }, baseOptions), options);
            const localVarHeaderParameter = {};
            const localVarQueryParameter = {};
            // authentication BearerToken required
            // http bearer authentication required
            await (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration);
            // authentication DigestAuth required
            await (0, common_1.setApiKeyToObject)(localVarHeaderParameter, "Authorization", configuration);
            if (orgName !== undefined) {
                localVarQueryParameter['orgName'] = orgName;
            }
            if (resourceId !== undefined) {
                localVarQueryParameter['resourceId'] = resourceId;
            }
            if (resourceType !== undefined) {
                localVarQueryParameter['resourceType'] = resourceType;
            }
            if (taskType !== undefined) {
                localVarQueryParameter['taskType'] = taskType;
            }
            if (status !== undefined) {
                localVarQueryParameter['status'] = status;
            }
            if (start !== undefined) {
                localVarQueryParameter['start'] = start;
            }
            if (end !== undefined) {
                localVarQueryParameter['end'] = end;
            }
            if (pageNumber !== undefined) {
                localVarQueryParameter['pageNumber'] = pageNumber;
            }
            if (pageSize !== undefined) {
                localVarQueryParameter['pageSize'] = pageSize;
            }
            (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
            let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
            localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
            return {
                url: (0, common_1.toPathString)(localVarUrlObj),
                options: localVarRequestOptions,
            };
        },
        /**
         * retry task
         * @summary Retry a task
         * @param {string} taskId ID of the task
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        retryTask: async (taskId, options = {}) => {
            // verify required parameter 'taskId' is not null or undefined
            (0, common_1.assertParamExists)('retryTask', 'taskId', taskId);
            const localVarPath = `/admin/v1/tasks/{taskId}/retry`
                .replace(`{${"taskId"}}`, encodeURIComponent(String(taskId)));
            // use dummy base URL string because the URL constructor only accepts absolute URLs.
            const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
            let baseOptions;
            if (configuration) {
                baseOptions = configuration.baseOptions;
            }
            const localVarRequestOptions = Object.assign(Object.assign({ method: 'PATCH' }, baseOptions), options);
            const localVarHeaderParameter = {};
            const localVarQueryParameter = {};
            // authentication BearerToken required
            // http bearer authentication required
            await (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration);
            // authentication DigestAuth required
            await (0, common_1.setApiKeyToObject)(localVarHeaderParameter, "Authorization", configuration);
            (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
            let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
            localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
            return {
                url: (0, common_1.toPathString)(localVarUrlObj),
                options: localVarRequestOptions,
            };
        },
        /**
         * stop task
         * @summary Stop a task
         * @param {string} taskId ID of the task
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        stopTask: async (taskId, options = {}) => {
            // verify required parameter 'taskId' is not null or undefined
            (0, common_1.assertParamExists)('stopTask', 'taskId', taskId);
            const localVarPath = `/admin/v1/tasks/{taskId}/stop`
                .replace(`{${"taskId"}}`, encodeURIComponent(String(taskId)));
            // use dummy base URL string because the URL constructor only accepts absolute URLs.
            const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
            let baseOptions;
            if (configuration) {
                baseOptions = configuration.baseOptions;
            }
            const localVarRequestOptions = Object.assign(Object.assign({ method: 'PATCH' }, baseOptions), options);
            const localVarHeaderParameter = {};
            const localVarQueryParameter = {};
            // authentication BearerToken required
            // http bearer authentication required
            await (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration);
            // authentication DigestAuth required
            await (0, common_1.setApiKeyToObject)(localVarHeaderParameter, "Authorization", configuration);
            (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
            let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
            localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
            return {
                url: (0, common_1.toPathString)(localVarUrlObj),
                options: localVarRequestOptions,
            };
        },
    };
};
exports.TaskApiAxiosParamCreator = TaskApiAxiosParamCreator;
/**
 * TaskApi - functional programming interface
 * @export
 */
const TaskApiFp = function (configuration) {
    const localVarAxiosParamCreator = (0, exports.TaskApiAxiosParamCreator)(configuration);
    return {
        /**
         * Cancel a task by taskID.
         * @summary Cancel a task
         * @param {string} taskId ID of the task
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        async cancelTask(taskId, options) {
            var _a, _b, _c;
            const localVarAxiosArgs = await localVarAxiosParamCreator.cancelTask(taskId, options);
            const localVarOperationServerIndex = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0;
            const localVarOperationServerBasePath = (_c = (_b = base_1.operationServerMap['TaskApi.cancelTask']) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === null || _c === void 0 ? void 0 : _c.url;
            return (axios, basePath) => (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
        },
        /**
         * Get task
         * @summary Get task detail
         * @param {string} taskId ID of the task
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        async getTask(taskId, options) {
            var _a, _b, _c;
            const localVarAxiosArgs = await localVarAxiosParamCreator.getTask(taskId, options);
            const localVarOperationServerIndex = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0;
            const localVarOperationServerBasePath = (_c = (_b = base_1.operationServerMap['TaskApi.getTask']) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === null || _c === void 0 ? void 0 : _c.url;
            return (axios, basePath) => (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
        },
        /**
         *
         * @summary Get task log
         * @param {string} taskId ID of the task
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        async getTaskLog(taskId, options) {
            var _a, _b, _c;
            const localVarAxiosArgs = await localVarAxiosParamCreator.getTaskLog(taskId, options);
            const localVarOperationServerIndex = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0;
            const localVarOperationServerBasePath = (_c = (_b = base_1.operationServerMap['TaskApi.getTaskLog']) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === null || _c === void 0 ? void 0 : _c.url;
            return (axios, basePath) => (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
        },
        /**
         * Get logs for a specific task step (supports job type steps)
         * @summary Get task step log
         * @param {string} taskId ID of the task
         * @param {string} stepId ID of the step
         * @param {boolean} [follow] Follow log stream (streaming mode for running steps)
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        async getTaskStepLog(taskId, stepId, follow, options) {
            var _a, _b, _c;
            const localVarAxiosArgs = await localVarAxiosParamCreator.getTaskStepLog(taskId, stepId, follow, options);
            const localVarOperationServerIndex = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0;
            const localVarOperationServerBasePath = (_c = (_b = base_1.operationServerMap['TaskApi.getTaskStepLog']) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === null || _c === void 0 ? void 0 : _c.url;
            return (axios, basePath) => (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
        },
        /**
         * List task types
         * @summary List task types
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        async listTaskTypes(options) {
            var _a, _b, _c;
            const localVarAxiosArgs = await localVarAxiosParamCreator.listTaskTypes(options);
            const localVarOperationServerIndex = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0;
            const localVarOperationServerBasePath = (_c = (_b = base_1.operationServerMap['TaskApi.listTaskTypes']) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === null || _c === void 0 ? void 0 : _c.url;
            return (axios, basePath) => (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
        },
        /**
         * List tasks
         * @summary List task
         * @param {number} start The start of the time range for the query, unit is seconds.
         * @param {number} end The end of the time range for the query, unit is seconds.
         * @param {string} [orgName] Filter by organization name
         * @param {string} [resourceId] Filter by resource ID (such as cluster ID, environment ID, etc.)
         * @param {string} [resourceType] Filter by resource type
         * @param {string} [taskType] Filter by task type (supports multiple task types separated by commas, e.g., \&quot;cluster-scale,cluster-upgrade\&quot;)
         * @param {string} [status] Filter by task status (supports multiple statuses separated by commas, e.g., \&quot;Running,Pending\&quot;)
         * @param {number} [pageNumber] The pageNumber of the query
         * @param {number} [pageSize] The pageSize of the query
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        async listTasks(start, end, orgName, resourceId, resourceType, taskType, status, pageNumber, pageSize, options) {
            var _a, _b, _c;
            const localVarAxiosArgs = await localVarAxiosParamCreator.listTasks(start, end, orgName, resourceId, resourceType, taskType, status, pageNumber, pageSize, options);
            const localVarOperationServerIndex = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0;
            const localVarOperationServerBasePath = (_c = (_b = base_1.operationServerMap['TaskApi.listTasks']) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === null || _c === void 0 ? void 0 : _c.url;
            return (axios, basePath) => (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
        },
        /**
         * retry task
         * @summary Retry a task
         * @param {string} taskId ID of the task
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        async retryTask(taskId, options) {
            var _a, _b, _c;
            const localVarAxiosArgs = await localVarAxiosParamCreator.retryTask(taskId, options);
            const localVarOperationServerIndex = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0;
            const localVarOperationServerBasePath = (_c = (_b = base_1.operationServerMap['TaskApi.retryTask']) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === null || _c === void 0 ? void 0 : _c.url;
            return (axios, basePath) => (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
        },
        /**
         * stop task
         * @summary Stop a task
         * @param {string} taskId ID of the task
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        async stopTask(taskId, options) {
            var _a, _b, _c;
            const localVarAxiosArgs = await localVarAxiosParamCreator.stopTask(taskId, options);
            const localVarOperationServerIndex = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0;
            const localVarOperationServerBasePath = (_c = (_b = base_1.operationServerMap['TaskApi.stopTask']) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === null || _c === void 0 ? void 0 : _c.url;
            return (axios, basePath) => (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
        },
    };
};
exports.TaskApiFp = TaskApiFp;
/**
 * TaskApi - factory interface
 * @export
 */
const TaskApiFactory = function (configuration, basePath, axios) {
    const localVarFp = (0, exports.TaskApiFp)(configuration);
    return {
        /**
         * Cancel a task by taskID.
         * @summary Cancel a task
         * @param {TaskApiCancelTaskRequest} requestParameters Request parameters.
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        cancelTask(requestParameters, options) {
            return localVarFp.cancelTask(requestParameters.taskId, options).then((request) => request(axios, basePath));
        },
        /**
         * Get task
         * @summary Get task detail
         * @param {TaskApiGetTaskRequest} requestParameters Request parameters.
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        getTask(requestParameters, options) {
            return localVarFp.getTask(requestParameters.taskId, options).then((request) => request(axios, basePath));
        },
        /**
         *
         * @summary Get task log
         * @param {TaskApiGetTaskLogRequest} requestParameters Request parameters.
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        getTaskLog(requestParameters, options) {
            return localVarFp.getTaskLog(requestParameters.taskId, options).then((request) => request(axios, basePath));
        },
        /**
         * Get logs for a specific task step (supports job type steps)
         * @summary Get task step log
         * @param {TaskApiGetTaskStepLogRequest} requestParameters Request parameters.
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        getTaskStepLog(requestParameters, options) {
            return localVarFp.getTaskStepLog(requestParameters.taskId, requestParameters.stepId, requestParameters.follow, options).then((request) => request(axios, basePath));
        },
        /**
         * List task types
         * @summary List task types
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        listTaskTypes(options) {
            return localVarFp.listTaskTypes(options).then((request) => request(axios, basePath));
        },
        /**
         * List tasks
         * @summary List task
         * @param {TaskApiListTasksRequest} requestParameters Request parameters.
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        listTasks(requestParameters, options) {
            return localVarFp.listTasks(requestParameters.start, requestParameters.end, requestParameters.orgName, requestParameters.resourceId, requestParameters.resourceType, requestParameters.taskType, requestParameters.status, requestParameters.pageNumber, requestParameters.pageSize, options).then((request) => request(axios, basePath));
        },
        /**
         * retry task
         * @summary Retry a task
         * @param {TaskApiRetryTaskRequest} requestParameters Request parameters.
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        retryTask(requestParameters, options) {
            return localVarFp.retryTask(requestParameters.taskId, options).then((request) => request(axios, basePath));
        },
        /**
         * stop task
         * @summary Stop a task
         * @param {TaskApiStopTaskRequest} requestParameters Request parameters.
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        stopTask(requestParameters, options) {
            return localVarFp.stopTask(requestParameters.taskId, options).then((request) => request(axios, basePath));
        },
    };
};
exports.TaskApiFactory = TaskApiFactory;
/**
 * TaskApi - object-oriented interface
 * @export
 * @class TaskApi
 * @extends {BaseAPI}
 */
class TaskApi extends base_1.BaseAPI {
    /**
     * Cancel a task by taskID.
     * @summary Cancel a task
     * @param {TaskApiCancelTaskRequest} requestParameters Request parameters.
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     * @memberof TaskApi
     */
    cancelTask(requestParameters, options) {
        return (0, exports.TaskApiFp)(this.configuration).cancelTask(requestParameters.taskId, options).then((request) => request(this.axios, this.basePath));
    }
    /**
     * Get task
     * @summary Get task detail
     * @param {TaskApiGetTaskRequest} requestParameters Request parameters.
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     * @memberof TaskApi
     */
    getTask(requestParameters, options) {
        return (0, exports.TaskApiFp)(this.configuration).getTask(requestParameters.taskId, options).then((request) => request(this.axios, this.basePath));
    }
    /**
     *
     * @summary Get task log
     * @param {TaskApiGetTaskLogRequest} requestParameters Request parameters.
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     * @memberof TaskApi
     */
    getTaskLog(requestParameters, options) {
        return (0, exports.TaskApiFp)(this.configuration).getTaskLog(requestParameters.taskId, options).then((request) => request(this.axios, this.basePath));
    }
    /**
     * Get logs for a specific task step (supports job type steps)
     * @summary Get task step log
     * @param {TaskApiGetTaskStepLogRequest} requestParameters Request parameters.
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     * @memberof TaskApi
     */
    getTaskStepLog(requestParameters, options) {
        return (0, exports.TaskApiFp)(this.configuration).getTaskStepLog(requestParameters.taskId, requestParameters.stepId, requestParameters.follow, options).then((request) => request(this.axios, this.basePath));
    }
    /**
     * List task types
     * @summary List task types
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     * @memberof TaskApi
     */
    listTaskTypes(options) {
        return (0, exports.TaskApiFp)(this.configuration).listTaskTypes(options).then((request) => request(this.axios, this.basePath));
    }
    /**
     * List tasks
     * @summary List task
     * @param {TaskApiListTasksRequest} requestParameters Request parameters.
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     * @memberof TaskApi
     */
    listTasks(requestParameters, options) {
        return (0, exports.TaskApiFp)(this.configuration).listTasks(requestParameters.start, requestParameters.end, requestParameters.orgName, requestParameters.resourceId, requestParameters.resourceType, requestParameters.taskType, requestParameters.status, requestParameters.pageNumber, requestParameters.pageSize, options).then((request) => request(this.axios, this.basePath));
    }
    /**
     * retry task
     * @summary Retry a task
     * @param {TaskApiRetryTaskRequest} requestParameters Request parameters.
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     * @memberof TaskApi
     */
    retryTask(requestParameters, options) {
        return (0, exports.TaskApiFp)(this.configuration).retryTask(requestParameters.taskId, options).then((request) => request(this.axios, this.basePath));
    }
    /**
     * stop task
     * @summary Stop a task
     * @param {TaskApiStopTaskRequest} requestParameters Request parameters.
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     * @memberof TaskApi
     */
    stopTask(requestParameters, options) {
        return (0, exports.TaskApiFp)(this.configuration).stopTask(requestParameters.taskId, options).then((request) => request(this.axios, this.basePath));
    }
}
exports.TaskApi = TaskApi;
//# sourceMappingURL=task-api.js.map