/* 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.
 */


import type { Configuration } from '../configuration';
import type { AxiosPromise, AxiosInstance, RawAxiosRequestConfig } from 'axios';
import globalAxios from 'axios';
// Some imports not used depending on template conditions
// @ts-ignore
import { DUMMY_BASE_URL, assertParamExists, setApiKeyToObject, setBasicAuthToObject, setBearerAuthToObject, setOAuthToObject, setSearchParams, serializeDataIfNeeded, toPathString, createRequestFunction } from '../common';
// @ts-ignore
import { BASE_PATH, COLLECTION_FORMATS, type RequestArgs, BaseAPI, RequiredError, operationServerMap } from '../base';
// @ts-ignore
import type { APIErrorResponse } from '../models';
// @ts-ignore
import type { Task } from '../models';
// @ts-ignore
import type { TaskList } from '../models';
// @ts-ignore
import type { TaskTypeList } from '../models';
/**
 * TaskApi - axios parameter creator
 * @export
 */
export const TaskApiAxiosParamCreator = function (configuration?: 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: string, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
            // verify required parameter 'taskId' is not null or undefined
            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, DUMMY_BASE_URL);
            let baseOptions;
            if (configuration) {
                baseOptions = configuration.baseOptions;
            }

            const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options};
            const localVarHeaderParameter = {} as any;
            const localVarQueryParameter = {} as any;

            // authentication BearerToken required
            // http bearer authentication required
            await setBearerAuthToObject(localVarHeaderParameter, configuration)

            // authentication DigestAuth required
            await setApiKeyToObject(localVarHeaderParameter, "Authorization", configuration)


    
            setSearchParams(localVarUrlObj, localVarQueryParameter);
            let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
            localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};

            return {
                url: 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: string, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
            // verify required parameter 'taskId' is not null or undefined
            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, DUMMY_BASE_URL);
            let baseOptions;
            if (configuration) {
                baseOptions = configuration.baseOptions;
            }

            const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options};
            const localVarHeaderParameter = {} as any;
            const localVarQueryParameter = {} as any;

            // authentication BearerToken required
            // http bearer authentication required
            await setBearerAuthToObject(localVarHeaderParameter, configuration)

            // authentication DigestAuth required
            await setApiKeyToObject(localVarHeaderParameter, "Authorization", configuration)


    
            setSearchParams(localVarUrlObj, localVarQueryParameter);
            let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
            localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};

            return {
                url: 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: string, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
            // verify required parameter 'taskId' is not null or undefined
            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, DUMMY_BASE_URL);
            let baseOptions;
            if (configuration) {
                baseOptions = configuration.baseOptions;
            }

            const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options};
            const localVarHeaderParameter = {} as any;
            const localVarQueryParameter = {} as any;

            // authentication BearerToken required
            // http bearer authentication required
            await setBearerAuthToObject(localVarHeaderParameter, configuration)

            // authentication DigestAuth required
            await setApiKeyToObject(localVarHeaderParameter, "Authorization", configuration)


    
            setSearchParams(localVarUrlObj, localVarQueryParameter);
            let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
            localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};

            return {
                url: 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: string, stepId: string, follow?: boolean, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
            // verify required parameter 'taskId' is not null or undefined
            assertParamExists('getTaskStepLog', 'taskId', taskId)
            // verify required parameter 'stepId' is not null or undefined
            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, DUMMY_BASE_URL);
            let baseOptions;
            if (configuration) {
                baseOptions = configuration.baseOptions;
            }

            const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options};
            const localVarHeaderParameter = {} as any;
            const localVarQueryParameter = {} as any;

            // authentication BearerToken required
            // http bearer authentication required
            await setBearerAuthToObject(localVarHeaderParameter, configuration)

            // authentication DigestAuth required
            await setApiKeyToObject(localVarHeaderParameter, "Authorization", configuration)

            if (follow !== undefined) {
                localVarQueryParameter['follow'] = follow;
            }


    
            setSearchParams(localVarUrlObj, localVarQueryParameter);
            let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
            localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};

            return {
                url: toPathString(localVarUrlObj),
                options: localVarRequestOptions,
            };
        },
        /**
         * List task types
         * @summary List task types
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        listTaskTypes: async (options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
            const localVarPath = `/admin/v1/taskTypes`;
            // use dummy base URL string because the URL constructor only accepts absolute URLs.
            const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
            let baseOptions;
            if (configuration) {
                baseOptions = configuration.baseOptions;
            }

            const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options};
            const localVarHeaderParameter = {} as any;
            const localVarQueryParameter = {} as any;

            // authentication BearerToken required
            // http bearer authentication required
            await setBearerAuthToObject(localVarHeaderParameter, configuration)

            // authentication DigestAuth required
            await setApiKeyToObject(localVarHeaderParameter, "Authorization", configuration)


    
            setSearchParams(localVarUrlObj, localVarQueryParameter);
            let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
            localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};

            return {
                url: 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: number, end: number, orgName?: string, resourceId?: string, resourceType?: string, taskType?: string, status?: string, pageNumber?: number, pageSize?: number, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
            // verify required parameter 'start' is not null or undefined
            assertParamExists('listTasks', 'start', start)
            // verify required parameter 'end' is not null or undefined
            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, DUMMY_BASE_URL);
            let baseOptions;
            if (configuration) {
                baseOptions = configuration.baseOptions;
            }

            const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options};
            const localVarHeaderParameter = {} as any;
            const localVarQueryParameter = {} as any;

            // authentication BearerToken required
            // http bearer authentication required
            await setBearerAuthToObject(localVarHeaderParameter, configuration)

            // authentication DigestAuth required
            await 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;
            }


    
            setSearchParams(localVarUrlObj, localVarQueryParameter);
            let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
            localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};

            return {
                url: 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: string, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
            // verify required parameter 'taskId' is not null or undefined
            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, DUMMY_BASE_URL);
            let baseOptions;
            if (configuration) {
                baseOptions = configuration.baseOptions;
            }

            const localVarRequestOptions = { method: 'PATCH', ...baseOptions, ...options};
            const localVarHeaderParameter = {} as any;
            const localVarQueryParameter = {} as any;

            // authentication BearerToken required
            // http bearer authentication required
            await setBearerAuthToObject(localVarHeaderParameter, configuration)

            // authentication DigestAuth required
            await setApiKeyToObject(localVarHeaderParameter, "Authorization", configuration)


    
            setSearchParams(localVarUrlObj, localVarQueryParameter);
            let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
            localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};

            return {
                url: 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: string, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
            // verify required parameter 'taskId' is not null or undefined
            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, DUMMY_BASE_URL);
            let baseOptions;
            if (configuration) {
                baseOptions = configuration.baseOptions;
            }

            const localVarRequestOptions = { method: 'PATCH', ...baseOptions, ...options};
            const localVarHeaderParameter = {} as any;
            const localVarQueryParameter = {} as any;

            // authentication BearerToken required
            // http bearer authentication required
            await setBearerAuthToObject(localVarHeaderParameter, configuration)

            // authentication DigestAuth required
            await setApiKeyToObject(localVarHeaderParameter, "Authorization", configuration)


    
            setSearchParams(localVarUrlObj, localVarQueryParameter);
            let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
            localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};

            return {
                url: toPathString(localVarUrlObj),
                options: localVarRequestOptions,
            };
        },
    }
};

/**
 * TaskApi - functional programming interface
 * @export
 */
export const TaskApiFp = function(configuration?: Configuration) {
    const localVarAxiosParamCreator = 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: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<void>> {
            const localVarAxiosArgs = await localVarAxiosParamCreator.cancelTask(taskId, options);
            const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
            const localVarOperationServerBasePath = operationServerMap['TaskApi.cancelTask']?.[localVarOperationServerIndex]?.url;
            return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, 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: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<Task>> {
            const localVarAxiosArgs = await localVarAxiosParamCreator.getTask(taskId, options);
            const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
            const localVarOperationServerBasePath = operationServerMap['TaskApi.getTask']?.[localVarOperationServerIndex]?.url;
            return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, 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: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<void>> {
            const localVarAxiosArgs = await localVarAxiosParamCreator.getTaskLog(taskId, options);
            const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
            const localVarOperationServerBasePath = operationServerMap['TaskApi.getTaskLog']?.[localVarOperationServerIndex]?.url;
            return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, 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: string, stepId: string, follow?: boolean, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<void>> {
            const localVarAxiosArgs = await localVarAxiosParamCreator.getTaskStepLog(taskId, stepId, follow, options);
            const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
            const localVarOperationServerBasePath = operationServerMap['TaskApi.getTaskStepLog']?.[localVarOperationServerIndex]?.url;
            return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
        },
        /**
         * List task types
         * @summary List task types
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        async listTaskTypes(options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<TaskTypeList>> {
            const localVarAxiosArgs = await localVarAxiosParamCreator.listTaskTypes(options);
            const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
            const localVarOperationServerBasePath = operationServerMap['TaskApi.listTaskTypes']?.[localVarOperationServerIndex]?.url;
            return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, 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: number, end: number, orgName?: string, resourceId?: string, resourceType?: string, taskType?: string, status?: string, pageNumber?: number, pageSize?: number, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<TaskList>> {
            const localVarAxiosArgs = await localVarAxiosParamCreator.listTasks(start, end, orgName, resourceId, resourceType, taskType, status, pageNumber, pageSize, options);
            const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
            const localVarOperationServerBasePath = operationServerMap['TaskApi.listTasks']?.[localVarOperationServerIndex]?.url;
            return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, 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: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<Task>> {
            const localVarAxiosArgs = await localVarAxiosParamCreator.retryTask(taskId, options);
            const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
            const localVarOperationServerBasePath = operationServerMap['TaskApi.retryTask']?.[localVarOperationServerIndex]?.url;
            return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, 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: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<Task>> {
            const localVarAxiosArgs = await localVarAxiosParamCreator.stopTask(taskId, options);
            const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
            const localVarOperationServerBasePath = operationServerMap['TaskApi.stopTask']?.[localVarOperationServerIndex]?.url;
            return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
        },
    }
};

/**
 * TaskApi - factory interface
 * @export
 */
export const TaskApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) {
    const localVarFp = 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: TaskApiCancelTaskRequest, options?: RawAxiosRequestConfig): AxiosPromise<void> {
            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: TaskApiGetTaskRequest, options?: RawAxiosRequestConfig): AxiosPromise<Task> {
            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: TaskApiGetTaskLogRequest, options?: RawAxiosRequestConfig): AxiosPromise<void> {
            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: TaskApiGetTaskStepLogRequest, options?: RawAxiosRequestConfig): AxiosPromise<void> {
            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?: RawAxiosRequestConfig): AxiosPromise<TaskTypeList> {
            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: TaskApiListTasksRequest, options?: RawAxiosRequestConfig): AxiosPromise<TaskList> {
            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: TaskApiRetryTaskRequest, options?: RawAxiosRequestConfig): AxiosPromise<Task> {
            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: TaskApiStopTaskRequest, options?: RawAxiosRequestConfig): AxiosPromise<Task> {
            return localVarFp.stopTask(requestParameters.taskId, options).then((request) => request(axios, basePath));
        },
    };
};

/**
 * TaskApi - interface
 * @export
 * @interface TaskApi
 */
export interface TaskApiInterface {
    /**
     * Cancel a task by taskID.
     * @summary Cancel a task
     * @param {TaskApiCancelTaskRequest} requestParameters Request parameters.
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     * @memberof TaskApiInterface
     */
    cancelTask(requestParameters: TaskApiCancelTaskRequest, options?: RawAxiosRequestConfig): AxiosPromise<void>;

    /**
     * Get task
     * @summary Get task detail
     * @param {TaskApiGetTaskRequest} requestParameters Request parameters.
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     * @memberof TaskApiInterface
     */
    getTask(requestParameters: TaskApiGetTaskRequest, options?: RawAxiosRequestConfig): AxiosPromise<Task>;

    /**
     * 
     * @summary Get task log
     * @param {TaskApiGetTaskLogRequest} requestParameters Request parameters.
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     * @memberof TaskApiInterface
     */
    getTaskLog(requestParameters: TaskApiGetTaskLogRequest, options?: RawAxiosRequestConfig): AxiosPromise<void>;

    /**
     * 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 TaskApiInterface
     */
    getTaskStepLog(requestParameters: TaskApiGetTaskStepLogRequest, options?: RawAxiosRequestConfig): AxiosPromise<void>;

    /**
     * List task types
     * @summary List task types
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     * @memberof TaskApiInterface
     */
    listTaskTypes(options?: RawAxiosRequestConfig): AxiosPromise<TaskTypeList>;

    /**
     * List tasks
     * @summary List task
     * @param {TaskApiListTasksRequest} requestParameters Request parameters.
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     * @memberof TaskApiInterface
     */
    listTasks(requestParameters: TaskApiListTasksRequest, options?: RawAxiosRequestConfig): AxiosPromise<TaskList>;

    /**
     * retry task
     * @summary Retry a task
     * @param {TaskApiRetryTaskRequest} requestParameters Request parameters.
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     * @memberof TaskApiInterface
     */
    retryTask(requestParameters: TaskApiRetryTaskRequest, options?: RawAxiosRequestConfig): AxiosPromise<Task>;

    /**
     * stop task
     * @summary Stop a task
     * @param {TaskApiStopTaskRequest} requestParameters Request parameters.
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     * @memberof TaskApiInterface
     */
    stopTask(requestParameters: TaskApiStopTaskRequest, options?: RawAxiosRequestConfig): AxiosPromise<Task>;

}

/**
 * Request parameters for cancelTask operation in TaskApi.
 * @export
 * @interface TaskApiCancelTaskRequest
 */
export interface TaskApiCancelTaskRequest {
    /**
     * ID of the task
     * @type {string}
     * @memberof TaskApiCancelTask
     */
    readonly taskId: string
}

/**
 * Request parameters for getTask operation in TaskApi.
 * @export
 * @interface TaskApiGetTaskRequest
 */
export interface TaskApiGetTaskRequest {
    /**
     * ID of the task
     * @type {string}
     * @memberof TaskApiGetTask
     */
    readonly taskId: string
}

/**
 * Request parameters for getTaskLog operation in TaskApi.
 * @export
 * @interface TaskApiGetTaskLogRequest
 */
export interface TaskApiGetTaskLogRequest {
    /**
     * ID of the task
     * @type {string}
     * @memberof TaskApiGetTaskLog
     */
    readonly taskId: string
}

/**
 * Request parameters for getTaskStepLog operation in TaskApi.
 * @export
 * @interface TaskApiGetTaskStepLogRequest
 */
export interface TaskApiGetTaskStepLogRequest {
    /**
     * ID of the task
     * @type {string}
     * @memberof TaskApiGetTaskStepLog
     */
    readonly taskId: string

    /**
     * ID of the step
     * @type {string}
     * @memberof TaskApiGetTaskStepLog
     */
    readonly stepId: string

    /**
     * Follow log stream (streaming mode for running steps)
     * @type {boolean}
     * @memberof TaskApiGetTaskStepLog
     */
    readonly follow?: boolean
}

/**
 * Request parameters for listTasks operation in TaskApi.
 * @export
 * @interface TaskApiListTasksRequest
 */
export interface TaskApiListTasksRequest {
    /**
     * The start of the time range for the query, unit is seconds.
     * @type {number}
     * @memberof TaskApiListTasks
     */
    readonly start: number

    /**
     * The end of the time range for the query, unit is seconds.
     * @type {number}
     * @memberof TaskApiListTasks
     */
    readonly end: number

    /**
     * Filter by organization name
     * @type {string}
     * @memberof TaskApiListTasks
     */
    readonly orgName?: string

    /**
     * Filter by resource ID (such as cluster ID, environment ID, etc.)
     * @type {string}
     * @memberof TaskApiListTasks
     */
    readonly resourceId?: string

    /**
     * Filter by resource type
     * @type {string}
     * @memberof TaskApiListTasks
     */
    readonly resourceType?: string

    /**
     * Filter by task type (supports multiple task types separated by commas, e.g., \&quot;cluster-scale,cluster-upgrade\&quot;)
     * @type {string}
     * @memberof TaskApiListTasks
     */
    readonly taskType?: string

    /**
     * Filter by task status (supports multiple statuses separated by commas, e.g., \&quot;Running,Pending\&quot;)
     * @type {string}
     * @memberof TaskApiListTasks
     */
    readonly status?: string

    /**
     * The pageNumber of the query
     * @type {number}
     * @memberof TaskApiListTasks
     */
    readonly pageNumber?: number

    /**
     * The pageSize of the query
     * @type {number}
     * @memberof TaskApiListTasks
     */
    readonly pageSize?: number
}

/**
 * Request parameters for retryTask operation in TaskApi.
 * @export
 * @interface TaskApiRetryTaskRequest
 */
export interface TaskApiRetryTaskRequest {
    /**
     * ID of the task
     * @type {string}
     * @memberof TaskApiRetryTask
     */
    readonly taskId: string
}

/**
 * Request parameters for stopTask operation in TaskApi.
 * @export
 * @interface TaskApiStopTaskRequest
 */
export interface TaskApiStopTaskRequest {
    /**
     * ID of the task
     * @type {string}
     * @memberof TaskApiStopTask
     */
    readonly taskId: string
}

/**
 * TaskApi - object-oriented interface
 * @export
 * @class TaskApi
 * @extends {BaseAPI}
 */
export class TaskApi extends BaseAPI implements TaskApiInterface {
    /**
     * Cancel a task by taskID.
     * @summary Cancel a task
     * @param {TaskApiCancelTaskRequest} requestParameters Request parameters.
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     * @memberof TaskApi
     */
    public cancelTask(requestParameters: TaskApiCancelTaskRequest, options?: RawAxiosRequestConfig) {
        return 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
     */
    public getTask(requestParameters: TaskApiGetTaskRequest, options?: RawAxiosRequestConfig) {
        return 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
     */
    public getTaskLog(requestParameters: TaskApiGetTaskLogRequest, options?: RawAxiosRequestConfig) {
        return 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
     */
    public getTaskStepLog(requestParameters: TaskApiGetTaskStepLogRequest, options?: RawAxiosRequestConfig) {
        return 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
     */
    public listTaskTypes(options?: RawAxiosRequestConfig) {
        return 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
     */
    public listTasks(requestParameters: TaskApiListTasksRequest, options?: RawAxiosRequestConfig) {
        return 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
     */
    public retryTask(requestParameters: TaskApiRetryTaskRequest, options?: RawAxiosRequestConfig) {
        return 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
     */
    public stopTask(requestParameters: TaskApiStopTaskRequest, options?: RawAxiosRequestConfig) {
        return TaskApiFp(this.configuration).stopTask(requestParameters.taskId, options).then((request) => request(this.axios, this.basePath));
    }
}

