/* 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 { ImportOpsType } from '../models';
// @ts-ignore
import type { ImportPreflightRequest } from '../models';
// @ts-ignore
import type { ImportQueryObjectsRequest } from '../models';
// @ts-ignore
import type { ImportTaskCreateRequest } from '../models';
// @ts-ignore
import type { ImportTaskListResponse } from '../models';
// @ts-ignore
import type { ImportTaskResponse } from '../models';
// @ts-ignore
import type { PreCheckTaskDetail } from '../models';
// @ts-ignore
import type { PreCheckTaskResponse } from '../models';
// @ts-ignore
import type { ReplicationObjectTree } from '../models';
/**
 * ImportApi - axios parameter creator
 * @export
 */
export const ImportApiAxiosParamCreator = function (configuration?: Configuration) {
    return {
        /**
         * Creates new data import task based on data source configuration and import options
         * @summary Create import task
         * @param {string} orgName Organization name
         * @param {string} clusterName Cluster name
         * @param {ImportTaskCreateRequest} importTaskCreateRequest Import task configuration including data source connection, object selection and import options
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        createImportTask: async (orgName: string, clusterName: string, importTaskCreateRequest: ImportTaskCreateRequest, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
            // verify required parameter 'orgName' is not null or undefined
            assertParamExists('createImportTask', 'orgName', orgName)
            // verify required parameter 'clusterName' is not null or undefined
            assertParamExists('createImportTask', 'clusterName', clusterName)
            // verify required parameter 'importTaskCreateRequest' is not null or undefined
            assertParamExists('createImportTask', 'importTaskCreateRequest', importTaskCreateRequest)
            const localVarPath = `/admin/v1/organizations/{orgName}/clusters/{clusterName}/import`
                .replace(`{${"orgName"}}`, encodeURIComponent(String(orgName)))
                .replace(`{${"clusterName"}}`, encodeURIComponent(String(clusterName)));
            // 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)


    
            localVarHeaderParameter['Content-Type'] = 'application/json';

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

            return {
                url: toPathString(localVarUrlObj),
                options: localVarRequestOptions,
            };
        },
        /**
         * Stops and deletes specified import task, will clean up related Kubernetes resources
         * @summary Delete import task
         * @param {string} orgName Organization name
         * @param {string} clusterName Cluster name
         * @param {string} id Import task ID
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        deleteImportTask: async (orgName: string, clusterName: string, id: string, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
            // verify required parameter 'orgName' is not null or undefined
            assertParamExists('deleteImportTask', 'orgName', orgName)
            // verify required parameter 'clusterName' is not null or undefined
            assertParamExists('deleteImportTask', 'clusterName', clusterName)
            // verify required parameter 'id' is not null or undefined
            assertParamExists('deleteImportTask', 'id', id)
            const localVarPath = `/admin/v1/organizations/{orgName}/clusters/{clusterName}/import/{id}`
                .replace(`{${"orgName"}}`, encodeURIComponent(String(orgName)))
                .replace(`{${"clusterName"}}`, encodeURIComponent(String(clusterName)))
                .replace(`{${"id"}}`, encodeURIComponent(String(id)));
            // 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: 'DELETE', ...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,
            };
        },
        /**
         * Retrieves detailed information about a specific data import preflight task by its ID
         * @summary Get preflight task details
         * @param {string} orgName Organization name
         * @param {string} clusterName Cluster name
         * @param {string} taskId Preflight task ID
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        getImportPreflightTask: async (orgName: string, clusterName: string, taskId: string, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
            // verify required parameter 'orgName' is not null or undefined
            assertParamExists('getImportPreflightTask', 'orgName', orgName)
            // verify required parameter 'clusterName' is not null or undefined
            assertParamExists('getImportPreflightTask', 'clusterName', clusterName)
            // verify required parameter 'taskId' is not null or undefined
            assertParamExists('getImportPreflightTask', 'taskId', taskId)
            const localVarPath = `/admin/v1/organizations/{orgName}/clusters/{clusterName}/import/preflight/{taskId}`
                .replace(`{${"orgName"}}`, encodeURIComponent(String(orgName)))
                .replace(`{${"clusterName"}}`, encodeURIComponent(String(clusterName)))
                .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,
            };
        },
        /**
         * Gets detailed information about a specific import task by its ID
         * @summary Get import task details
         * @param {string} orgName Organization name
         * @param {string} clusterName Cluster name
         * @param {string} id Import task ID
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        getImportTask: async (orgName: string, clusterName: string, id: string, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
            // verify required parameter 'orgName' is not null or undefined
            assertParamExists('getImportTask', 'orgName', orgName)
            // verify required parameter 'clusterName' is not null or undefined
            assertParamExists('getImportTask', 'clusterName', clusterName)
            // verify required parameter 'id' is not null or undefined
            assertParamExists('getImportTask', 'id', id)
            const localVarPath = `/admin/v1/organizations/{orgName}/clusters/{clusterName}/import/{id}`
                .replace(`{${"orgName"}}`, encodeURIComponent(String(orgName)))
                .replace(`{${"clusterName"}}`, encodeURIComponent(String(clusterName)))
                .replace(`{${"id"}}`, encodeURIComponent(String(id)));
            // 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,
            };
        },
        /**
         * Initiates async validation with the selected source configuration
         * @summary Data source preflight check
         * @param {string} orgName Organization name
         * @param {string} clusterName Cluster name
         * @param {ImportPreflightRequest} importPreflightRequest Data source connection configuration and selection rules
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        importPreflight: async (orgName: string, clusterName: string, importPreflightRequest: ImportPreflightRequest, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
            // verify required parameter 'orgName' is not null or undefined
            assertParamExists('importPreflight', 'orgName', orgName)
            // verify required parameter 'clusterName' is not null or undefined
            assertParamExists('importPreflight', 'clusterName', clusterName)
            // verify required parameter 'importPreflightRequest' is not null or undefined
            assertParamExists('importPreflight', 'importPreflightRequest', importPreflightRequest)
            const localVarPath = `/admin/v1/organizations/{orgName}/clusters/{clusterName}/import/preflight`
                .replace(`{${"orgName"}}`, encodeURIComponent(String(orgName)))
                .replace(`{${"clusterName"}}`, encodeURIComponent(String(clusterName)));
            // 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)


    
            localVarHeaderParameter['Content-Type'] = 'application/json';

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

            return {
                url: toPathString(localVarUrlObj),
                options: localVarRequestOptions,
            };
        },
        /**
         * Gets import task list for specified cluster, supports filtering by status and pagination
         * @summary Query import task list
         * @param {string} orgName Organization name
         * @param {string} clusterName Cluster name
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        listImportTask: async (orgName: string, clusterName: string, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
            // verify required parameter 'orgName' is not null or undefined
            assertParamExists('listImportTask', 'orgName', orgName)
            // verify required parameter 'clusterName' is not null or undefined
            assertParamExists('listImportTask', 'clusterName', clusterName)
            const localVarPath = `/admin/v1/organizations/{orgName}/clusters/{clusterName}/import`
                .replace(`{${"orgName"}}`, encodeURIComponent(String(orgName)))
                .replace(`{${"clusterName"}}`, encodeURIComponent(String(clusterName)));
            // 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,
            };
        },
        /**
         * Enumerates replication objects (databases, schemas, tables, etc.) for the requested node. The metadata levels depend on the source engine (for example MySQL uses `database -> table`, PostgreSQL uses `schema -> table`). 
         * @summary Query replication objects for import
         * @param {string} orgName Organization name
         * @param {string} clusterName Cluster name
         * @param {ImportQueryObjectsRequest} importQueryObjectsRequest Connection configuration and current object tree position
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        queryImportObjects: async (orgName: string, clusterName: string, importQueryObjectsRequest: ImportQueryObjectsRequest, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
            // verify required parameter 'orgName' is not null or undefined
            assertParamExists('queryImportObjects', 'orgName', orgName)
            // verify required parameter 'clusterName' is not null or undefined
            assertParamExists('queryImportObjects', 'clusterName', clusterName)
            // verify required parameter 'importQueryObjectsRequest' is not null or undefined
            assertParamExists('queryImportObjects', 'importQueryObjectsRequest', importQueryObjectsRequest)
            const localVarPath = `/admin/v1/organizations/{orgName}/clusters/{clusterName}/import/objects`
                .replace(`{${"orgName"}}`, encodeURIComponent(String(orgName)))
                .replace(`{${"clusterName"}}`, encodeURIComponent(String(clusterName)));
            // 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)


    
            localVarHeaderParameter['Content-Type'] = 'application/json';

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

            return {
                url: toPathString(localVarUrlObj),
                options: localVarRequestOptions,
            };
        },
        /**
         * Performs pause or resume operation on import task based on opsType parameter
         * @summary Create a import task operation
         * @param {string} orgName Organization name
         * @param {string} clusterName Cluster name
         * @param {string} id Import task ID
         * @param {ImportOpsType} opsType Operation type
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        updateImportTaskOps: async (orgName: string, clusterName: string, id: string, opsType: ImportOpsType, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
            // verify required parameter 'orgName' is not null or undefined
            assertParamExists('updateImportTaskOps', 'orgName', orgName)
            // verify required parameter 'clusterName' is not null or undefined
            assertParamExists('updateImportTaskOps', 'clusterName', clusterName)
            // verify required parameter 'id' is not null or undefined
            assertParamExists('updateImportTaskOps', 'id', id)
            // verify required parameter 'opsType' is not null or undefined
            assertParamExists('updateImportTaskOps', 'opsType', opsType)
            const localVarPath = `/admin/v1/organizations/{orgName}/clusters/{clusterName}/import/{id}/ops/{opsType}`
                .replace(`{${"orgName"}}`, encodeURIComponent(String(orgName)))
                .replace(`{${"clusterName"}}`, encodeURIComponent(String(clusterName)))
                .replace(`{${"id"}}`, encodeURIComponent(String(id)))
                .replace(`{${"opsType"}}`, encodeURIComponent(String(opsType)));
            // 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,
            };
        },
    }
};

/**
 * ImportApi - functional programming interface
 * @export
 */
export const ImportApiFp = function(configuration?: Configuration) {
    const localVarAxiosParamCreator = ImportApiAxiosParamCreator(configuration)
    return {
        /**
         * Creates new data import task based on data source configuration and import options
         * @summary Create import task
         * @param {string} orgName Organization name
         * @param {string} clusterName Cluster name
         * @param {ImportTaskCreateRequest} importTaskCreateRequest Import task configuration including data source connection, object selection and import options
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        async createImportTask(orgName: string, clusterName: string, importTaskCreateRequest: ImportTaskCreateRequest, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<ImportTaskResponse>> {
            const localVarAxiosArgs = await localVarAxiosParamCreator.createImportTask(orgName, clusterName, importTaskCreateRequest, options);
            const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
            const localVarOperationServerBasePath = operationServerMap['ImportApi.createImportTask']?.[localVarOperationServerIndex]?.url;
            return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
        },
        /**
         * Stops and deletes specified import task, will clean up related Kubernetes resources
         * @summary Delete import task
         * @param {string} orgName Organization name
         * @param {string} clusterName Cluster name
         * @param {string} id Import task ID
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        async deleteImportTask(orgName: string, clusterName: string, id: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<void>> {
            const localVarAxiosArgs = await localVarAxiosParamCreator.deleteImportTask(orgName, clusterName, id, options);
            const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
            const localVarOperationServerBasePath = operationServerMap['ImportApi.deleteImportTask']?.[localVarOperationServerIndex]?.url;
            return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
        },
        /**
         * Retrieves detailed information about a specific data import preflight task by its ID
         * @summary Get preflight task details
         * @param {string} orgName Organization name
         * @param {string} clusterName Cluster name
         * @param {string} taskId Preflight task ID
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        async getImportPreflightTask(orgName: string, clusterName: string, taskId: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<PreCheckTaskDetail>> {
            const localVarAxiosArgs = await localVarAxiosParamCreator.getImportPreflightTask(orgName, clusterName, taskId, options);
            const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
            const localVarOperationServerBasePath = operationServerMap['ImportApi.getImportPreflightTask']?.[localVarOperationServerIndex]?.url;
            return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
        },
        /**
         * Gets detailed information about a specific import task by its ID
         * @summary Get import task details
         * @param {string} orgName Organization name
         * @param {string} clusterName Cluster name
         * @param {string} id Import task ID
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        async getImportTask(orgName: string, clusterName: string, id: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<ImportTaskResponse>> {
            const localVarAxiosArgs = await localVarAxiosParamCreator.getImportTask(orgName, clusterName, id, options);
            const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
            const localVarOperationServerBasePath = operationServerMap['ImportApi.getImportTask']?.[localVarOperationServerIndex]?.url;
            return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
        },
        /**
         * Initiates async validation with the selected source configuration
         * @summary Data source preflight check
         * @param {string} orgName Organization name
         * @param {string} clusterName Cluster name
         * @param {ImportPreflightRequest} importPreflightRequest Data source connection configuration and selection rules
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        async importPreflight(orgName: string, clusterName: string, importPreflightRequest: ImportPreflightRequest, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<PreCheckTaskResponse>> {
            const localVarAxiosArgs = await localVarAxiosParamCreator.importPreflight(orgName, clusterName, importPreflightRequest, options);
            const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
            const localVarOperationServerBasePath = operationServerMap['ImportApi.importPreflight']?.[localVarOperationServerIndex]?.url;
            return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
        },
        /**
         * Gets import task list for specified cluster, supports filtering by status and pagination
         * @summary Query import task list
         * @param {string} orgName Organization name
         * @param {string} clusterName Cluster name
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        async listImportTask(orgName: string, clusterName: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<ImportTaskListResponse>> {
            const localVarAxiosArgs = await localVarAxiosParamCreator.listImportTask(orgName, clusterName, options);
            const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
            const localVarOperationServerBasePath = operationServerMap['ImportApi.listImportTask']?.[localVarOperationServerIndex]?.url;
            return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
        },
        /**
         * Enumerates replication objects (databases, schemas, tables, etc.) for the requested node. The metadata levels depend on the source engine (for example MySQL uses `database -> table`, PostgreSQL uses `schema -> table`). 
         * @summary Query replication objects for import
         * @param {string} orgName Organization name
         * @param {string} clusterName Cluster name
         * @param {ImportQueryObjectsRequest} importQueryObjectsRequest Connection configuration and current object tree position
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        async queryImportObjects(orgName: string, clusterName: string, importQueryObjectsRequest: ImportQueryObjectsRequest, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<ReplicationObjectTree>> {
            const localVarAxiosArgs = await localVarAxiosParamCreator.queryImportObjects(orgName, clusterName, importQueryObjectsRequest, options);
            const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
            const localVarOperationServerBasePath = operationServerMap['ImportApi.queryImportObjects']?.[localVarOperationServerIndex]?.url;
            return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
        },
        /**
         * Performs pause or resume operation on import task based on opsType parameter
         * @summary Create a import task operation
         * @param {string} orgName Organization name
         * @param {string} clusterName Cluster name
         * @param {string} id Import task ID
         * @param {ImportOpsType} opsType Operation type
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        async updateImportTaskOps(orgName: string, clusterName: string, id: string, opsType: ImportOpsType, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<ImportTaskResponse>> {
            const localVarAxiosArgs = await localVarAxiosParamCreator.updateImportTaskOps(orgName, clusterName, id, opsType, options);
            const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
            const localVarOperationServerBasePath = operationServerMap['ImportApi.updateImportTaskOps']?.[localVarOperationServerIndex]?.url;
            return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
        },
    }
};

/**
 * ImportApi - factory interface
 * @export
 */
export const ImportApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) {
    const localVarFp = ImportApiFp(configuration)
    return {
        /**
         * Creates new data import task based on data source configuration and import options
         * @summary Create import task
         * @param {ImportApiCreateImportTaskRequest} requestParameters Request parameters.
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        createImportTask(requestParameters: ImportApiCreateImportTaskRequest, options?: RawAxiosRequestConfig): AxiosPromise<ImportTaskResponse> {
            return localVarFp.createImportTask(requestParameters.orgName, requestParameters.clusterName, requestParameters.importTaskCreateRequest, options).then((request) => request(axios, basePath));
        },
        /**
         * Stops and deletes specified import task, will clean up related Kubernetes resources
         * @summary Delete import task
         * @param {ImportApiDeleteImportTaskRequest} requestParameters Request parameters.
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        deleteImportTask(requestParameters: ImportApiDeleteImportTaskRequest, options?: RawAxiosRequestConfig): AxiosPromise<void> {
            return localVarFp.deleteImportTask(requestParameters.orgName, requestParameters.clusterName, requestParameters.id, options).then((request) => request(axios, basePath));
        },
        /**
         * Retrieves detailed information about a specific data import preflight task by its ID
         * @summary Get preflight task details
         * @param {ImportApiGetImportPreflightTaskRequest} requestParameters Request parameters.
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        getImportPreflightTask(requestParameters: ImportApiGetImportPreflightTaskRequest, options?: RawAxiosRequestConfig): AxiosPromise<PreCheckTaskDetail> {
            return localVarFp.getImportPreflightTask(requestParameters.orgName, requestParameters.clusterName, requestParameters.taskId, options).then((request) => request(axios, basePath));
        },
        /**
         * Gets detailed information about a specific import task by its ID
         * @summary Get import task details
         * @param {ImportApiGetImportTaskRequest} requestParameters Request parameters.
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        getImportTask(requestParameters: ImportApiGetImportTaskRequest, options?: RawAxiosRequestConfig): AxiosPromise<ImportTaskResponse> {
            return localVarFp.getImportTask(requestParameters.orgName, requestParameters.clusterName, requestParameters.id, options).then((request) => request(axios, basePath));
        },
        /**
         * Initiates async validation with the selected source configuration
         * @summary Data source preflight check
         * @param {ImportApiImportPreflightRequest} requestParameters Request parameters.
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        importPreflight(requestParameters: ImportApiImportPreflightRequest, options?: RawAxiosRequestConfig): AxiosPromise<PreCheckTaskResponse> {
            return localVarFp.importPreflight(requestParameters.orgName, requestParameters.clusterName, requestParameters.importPreflightRequest, options).then((request) => request(axios, basePath));
        },
        /**
         * Gets import task list for specified cluster, supports filtering by status and pagination
         * @summary Query import task list
         * @param {ImportApiListImportTaskRequest} requestParameters Request parameters.
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        listImportTask(requestParameters: ImportApiListImportTaskRequest, options?: RawAxiosRequestConfig): AxiosPromise<ImportTaskListResponse> {
            return localVarFp.listImportTask(requestParameters.orgName, requestParameters.clusterName, options).then((request) => request(axios, basePath));
        },
        /**
         * Enumerates replication objects (databases, schemas, tables, etc.) for the requested node. The metadata levels depend on the source engine (for example MySQL uses `database -> table`, PostgreSQL uses `schema -> table`). 
         * @summary Query replication objects for import
         * @param {ImportApiQueryImportObjectsRequest} requestParameters Request parameters.
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        queryImportObjects(requestParameters: ImportApiQueryImportObjectsRequest, options?: RawAxiosRequestConfig): AxiosPromise<ReplicationObjectTree> {
            return localVarFp.queryImportObjects(requestParameters.orgName, requestParameters.clusterName, requestParameters.importQueryObjectsRequest, options).then((request) => request(axios, basePath));
        },
        /**
         * Performs pause or resume operation on import task based on opsType parameter
         * @summary Create a import task operation
         * @param {ImportApiUpdateImportTaskOpsRequest} requestParameters Request parameters.
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        updateImportTaskOps(requestParameters: ImportApiUpdateImportTaskOpsRequest, options?: RawAxiosRequestConfig): AxiosPromise<ImportTaskResponse> {
            return localVarFp.updateImportTaskOps(requestParameters.orgName, requestParameters.clusterName, requestParameters.id, requestParameters.opsType, options).then((request) => request(axios, basePath));
        },
    };
};

/**
 * ImportApi - interface
 * @export
 * @interface ImportApi
 */
export interface ImportApiInterface {
    /**
     * Creates new data import task based on data source configuration and import options
     * @summary Create import task
     * @param {ImportApiCreateImportTaskRequest} requestParameters Request parameters.
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     * @memberof ImportApiInterface
     */
    createImportTask(requestParameters: ImportApiCreateImportTaskRequest, options?: RawAxiosRequestConfig): AxiosPromise<ImportTaskResponse>;

    /**
     * Stops and deletes specified import task, will clean up related Kubernetes resources
     * @summary Delete import task
     * @param {ImportApiDeleteImportTaskRequest} requestParameters Request parameters.
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     * @memberof ImportApiInterface
     */
    deleteImportTask(requestParameters: ImportApiDeleteImportTaskRequest, options?: RawAxiosRequestConfig): AxiosPromise<void>;

    /**
     * Retrieves detailed information about a specific data import preflight task by its ID
     * @summary Get preflight task details
     * @param {ImportApiGetImportPreflightTaskRequest} requestParameters Request parameters.
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     * @memberof ImportApiInterface
     */
    getImportPreflightTask(requestParameters: ImportApiGetImportPreflightTaskRequest, options?: RawAxiosRequestConfig): AxiosPromise<PreCheckTaskDetail>;

    /**
     * Gets detailed information about a specific import task by its ID
     * @summary Get import task details
     * @param {ImportApiGetImportTaskRequest} requestParameters Request parameters.
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     * @memberof ImportApiInterface
     */
    getImportTask(requestParameters: ImportApiGetImportTaskRequest, options?: RawAxiosRequestConfig): AxiosPromise<ImportTaskResponse>;

    /**
     * Initiates async validation with the selected source configuration
     * @summary Data source preflight check
     * @param {ImportApiImportPreflightRequest} requestParameters Request parameters.
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     * @memberof ImportApiInterface
     */
    importPreflight(requestParameters: ImportApiImportPreflightRequest, options?: RawAxiosRequestConfig): AxiosPromise<PreCheckTaskResponse>;

    /**
     * Gets import task list for specified cluster, supports filtering by status and pagination
     * @summary Query import task list
     * @param {ImportApiListImportTaskRequest} requestParameters Request parameters.
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     * @memberof ImportApiInterface
     */
    listImportTask(requestParameters: ImportApiListImportTaskRequest, options?: RawAxiosRequestConfig): AxiosPromise<ImportTaskListResponse>;

    /**
     * Enumerates replication objects (databases, schemas, tables, etc.) for the requested node. The metadata levels depend on the source engine (for example MySQL uses `database -> table`, PostgreSQL uses `schema -> table`). 
     * @summary Query replication objects for import
     * @param {ImportApiQueryImportObjectsRequest} requestParameters Request parameters.
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     * @memberof ImportApiInterface
     */
    queryImportObjects(requestParameters: ImportApiQueryImportObjectsRequest, options?: RawAxiosRequestConfig): AxiosPromise<ReplicationObjectTree>;

    /**
     * Performs pause or resume operation on import task based on opsType parameter
     * @summary Create a import task operation
     * @param {ImportApiUpdateImportTaskOpsRequest} requestParameters Request parameters.
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     * @memberof ImportApiInterface
     */
    updateImportTaskOps(requestParameters: ImportApiUpdateImportTaskOpsRequest, options?: RawAxiosRequestConfig): AxiosPromise<ImportTaskResponse>;

}

/**
 * Request parameters for createImportTask operation in ImportApi.
 * @export
 * @interface ImportApiCreateImportTaskRequest
 */
export interface ImportApiCreateImportTaskRequest {
    /**
     * Organization name
     * @type {string}
     * @memberof ImportApiCreateImportTask
     */
    readonly orgName: string

    /**
     * Cluster name
     * @type {string}
     * @memberof ImportApiCreateImportTask
     */
    readonly clusterName: string

    /**
     * Import task configuration including data source connection, object selection and import options
     * @type {ImportTaskCreateRequest}
     * @memberof ImportApiCreateImportTask
     */
    readonly importTaskCreateRequest: ImportTaskCreateRequest
}

/**
 * Request parameters for deleteImportTask operation in ImportApi.
 * @export
 * @interface ImportApiDeleteImportTaskRequest
 */
export interface ImportApiDeleteImportTaskRequest {
    /**
     * Organization name
     * @type {string}
     * @memberof ImportApiDeleteImportTask
     */
    readonly orgName: string

    /**
     * Cluster name
     * @type {string}
     * @memberof ImportApiDeleteImportTask
     */
    readonly clusterName: string

    /**
     * Import task ID
     * @type {string}
     * @memberof ImportApiDeleteImportTask
     */
    readonly id: string
}

/**
 * Request parameters for getImportPreflightTask operation in ImportApi.
 * @export
 * @interface ImportApiGetImportPreflightTaskRequest
 */
export interface ImportApiGetImportPreflightTaskRequest {
    /**
     * Organization name
     * @type {string}
     * @memberof ImportApiGetImportPreflightTask
     */
    readonly orgName: string

    /**
     * Cluster name
     * @type {string}
     * @memberof ImportApiGetImportPreflightTask
     */
    readonly clusterName: string

    /**
     * Preflight task ID
     * @type {string}
     * @memberof ImportApiGetImportPreflightTask
     */
    readonly taskId: string
}

/**
 * Request parameters for getImportTask operation in ImportApi.
 * @export
 * @interface ImportApiGetImportTaskRequest
 */
export interface ImportApiGetImportTaskRequest {
    /**
     * Organization name
     * @type {string}
     * @memberof ImportApiGetImportTask
     */
    readonly orgName: string

    /**
     * Cluster name
     * @type {string}
     * @memberof ImportApiGetImportTask
     */
    readonly clusterName: string

    /**
     * Import task ID
     * @type {string}
     * @memberof ImportApiGetImportTask
     */
    readonly id: string
}

/**
 * Request parameters for importPreflight operation in ImportApi.
 * @export
 * @interface ImportApiImportPreflightRequest
 */
export interface ImportApiImportPreflightRequest {
    /**
     * Organization name
     * @type {string}
     * @memberof ImportApiImportPreflight
     */
    readonly orgName: string

    /**
     * Cluster name
     * @type {string}
     * @memberof ImportApiImportPreflight
     */
    readonly clusterName: string

    /**
     * Data source connection configuration and selection rules
     * @type {ImportPreflightRequest}
     * @memberof ImportApiImportPreflight
     */
    readonly importPreflightRequest: ImportPreflightRequest
}

/**
 * Request parameters for listImportTask operation in ImportApi.
 * @export
 * @interface ImportApiListImportTaskRequest
 */
export interface ImportApiListImportTaskRequest {
    /**
     * Organization name
     * @type {string}
     * @memberof ImportApiListImportTask
     */
    readonly orgName: string

    /**
     * Cluster name
     * @type {string}
     * @memberof ImportApiListImportTask
     */
    readonly clusterName: string
}

/**
 * Request parameters for queryImportObjects operation in ImportApi.
 * @export
 * @interface ImportApiQueryImportObjectsRequest
 */
export interface ImportApiQueryImportObjectsRequest {
    /**
     * Organization name
     * @type {string}
     * @memberof ImportApiQueryImportObjects
     */
    readonly orgName: string

    /**
     * Cluster name
     * @type {string}
     * @memberof ImportApiQueryImportObjects
     */
    readonly clusterName: string

    /**
     * Connection configuration and current object tree position
     * @type {ImportQueryObjectsRequest}
     * @memberof ImportApiQueryImportObjects
     */
    readonly importQueryObjectsRequest: ImportQueryObjectsRequest
}

/**
 * Request parameters for updateImportTaskOps operation in ImportApi.
 * @export
 * @interface ImportApiUpdateImportTaskOpsRequest
 */
export interface ImportApiUpdateImportTaskOpsRequest {
    /**
     * Organization name
     * @type {string}
     * @memberof ImportApiUpdateImportTaskOps
     */
    readonly orgName: string

    /**
     * Cluster name
     * @type {string}
     * @memberof ImportApiUpdateImportTaskOps
     */
    readonly clusterName: string

    /**
     * Import task ID
     * @type {string}
     * @memberof ImportApiUpdateImportTaskOps
     */
    readonly id: string

    /**
     * Operation type
     * @type {ImportOpsType}
     * @memberof ImportApiUpdateImportTaskOps
     */
    readonly opsType: ImportOpsType
}

/**
 * ImportApi - object-oriented interface
 * @export
 * @class ImportApi
 * @extends {BaseAPI}
 */
export class ImportApi extends BaseAPI implements ImportApiInterface {
    /**
     * Creates new data import task based on data source configuration and import options
     * @summary Create import task
     * @param {ImportApiCreateImportTaskRequest} requestParameters Request parameters.
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     * @memberof ImportApi
     */
    public createImportTask(requestParameters: ImportApiCreateImportTaskRequest, options?: RawAxiosRequestConfig) {
        return ImportApiFp(this.configuration).createImportTask(requestParameters.orgName, requestParameters.clusterName, requestParameters.importTaskCreateRequest, options).then((request) => request(this.axios, this.basePath));
    }

    /**
     * Stops and deletes specified import task, will clean up related Kubernetes resources
     * @summary Delete import task
     * @param {ImportApiDeleteImportTaskRequest} requestParameters Request parameters.
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     * @memberof ImportApi
     */
    public deleteImportTask(requestParameters: ImportApiDeleteImportTaskRequest, options?: RawAxiosRequestConfig) {
        return ImportApiFp(this.configuration).deleteImportTask(requestParameters.orgName, requestParameters.clusterName, requestParameters.id, options).then((request) => request(this.axios, this.basePath));
    }

    /**
     * Retrieves detailed information about a specific data import preflight task by its ID
     * @summary Get preflight task details
     * @param {ImportApiGetImportPreflightTaskRequest} requestParameters Request parameters.
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     * @memberof ImportApi
     */
    public getImportPreflightTask(requestParameters: ImportApiGetImportPreflightTaskRequest, options?: RawAxiosRequestConfig) {
        return ImportApiFp(this.configuration).getImportPreflightTask(requestParameters.orgName, requestParameters.clusterName, requestParameters.taskId, options).then((request) => request(this.axios, this.basePath));
    }

    /**
     * Gets detailed information about a specific import task by its ID
     * @summary Get import task details
     * @param {ImportApiGetImportTaskRequest} requestParameters Request parameters.
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     * @memberof ImportApi
     */
    public getImportTask(requestParameters: ImportApiGetImportTaskRequest, options?: RawAxiosRequestConfig) {
        return ImportApiFp(this.configuration).getImportTask(requestParameters.orgName, requestParameters.clusterName, requestParameters.id, options).then((request) => request(this.axios, this.basePath));
    }

    /**
     * Initiates async validation with the selected source configuration
     * @summary Data source preflight check
     * @param {ImportApiImportPreflightRequest} requestParameters Request parameters.
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     * @memberof ImportApi
     */
    public importPreflight(requestParameters: ImportApiImportPreflightRequest, options?: RawAxiosRequestConfig) {
        return ImportApiFp(this.configuration).importPreflight(requestParameters.orgName, requestParameters.clusterName, requestParameters.importPreflightRequest, options).then((request) => request(this.axios, this.basePath));
    }

    /**
     * Gets import task list for specified cluster, supports filtering by status and pagination
     * @summary Query import task list
     * @param {ImportApiListImportTaskRequest} requestParameters Request parameters.
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     * @memberof ImportApi
     */
    public listImportTask(requestParameters: ImportApiListImportTaskRequest, options?: RawAxiosRequestConfig) {
        return ImportApiFp(this.configuration).listImportTask(requestParameters.orgName, requestParameters.clusterName, options).then((request) => request(this.axios, this.basePath));
    }

    /**
     * Enumerates replication objects (databases, schemas, tables, etc.) for the requested node. The metadata levels depend on the source engine (for example MySQL uses `database -> table`, PostgreSQL uses `schema -> table`). 
     * @summary Query replication objects for import
     * @param {ImportApiQueryImportObjectsRequest} requestParameters Request parameters.
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     * @memberof ImportApi
     */
    public queryImportObjects(requestParameters: ImportApiQueryImportObjectsRequest, options?: RawAxiosRequestConfig) {
        return ImportApiFp(this.configuration).queryImportObjects(requestParameters.orgName, requestParameters.clusterName, requestParameters.importQueryObjectsRequest, options).then((request) => request(this.axios, this.basePath));
    }

    /**
     * Performs pause or resume operation on import task based on opsType parameter
     * @summary Create a import task operation
     * @param {ImportApiUpdateImportTaskOpsRequest} requestParameters Request parameters.
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     * @memberof ImportApi
     */
    public updateImportTaskOps(requestParameters: ImportApiUpdateImportTaskOpsRequest, options?: RawAxiosRequestConfig) {
        return ImportApiFp(this.configuration).updateImportTaskOps(requestParameters.orgName, requestParameters.clusterName, requestParameters.id, requestParameters.opsType, options).then((request) => request(this.axios, this.basePath));
    }
}

