"use strict";
/* tslint:disable */
/* eslint-disable */
/**
 * Admin API
 * The Admin API is used to manage the ApeCloud platform.
 *
 * The version of the OpenAPI document: 1.0.0
 * Contact: support@apecloud.com
 *
 * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
 * https://openapi-generator.tech
 * Do not edit the class manually.
 */
var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.ImportApi = exports.ImportApiFactory = exports.ImportApiFp = exports.ImportApiAxiosParamCreator = void 0;
const axios_1 = __importDefault(require("axios"));
// Some imports not used depending on template conditions
// @ts-ignore
const common_1 = require("../common");
// @ts-ignore
const base_1 = require("../base");
/**
 * ImportApi - axios parameter creator
 * @export
 */
const ImportApiAxiosParamCreator = function (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, clusterName, importTaskCreateRequest, options = {}) => {
            // verify required parameter 'orgName' is not null or undefined
            (0, common_1.assertParamExists)('createImportTask', 'orgName', orgName);
            // verify required parameter 'clusterName' is not null or undefined
            (0, common_1.assertParamExists)('createImportTask', 'clusterName', clusterName);
            // verify required parameter 'importTaskCreateRequest' is not null or undefined
            (0, common_1.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, common_1.DUMMY_BASE_URL);
            let baseOptions;
            if (configuration) {
                baseOptions = configuration.baseOptions;
            }
            const localVarRequestOptions = Object.assign(Object.assign({ method: 'POST' }, baseOptions), options);
            const localVarHeaderParameter = {};
            const localVarQueryParameter = {};
            // authentication BearerToken required
            // http bearer authentication required
            await (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration);
            // authentication DigestAuth required
            await (0, common_1.setApiKeyToObject)(localVarHeaderParameter, "Authorization", configuration);
            localVarHeaderParameter['Content-Type'] = 'application/json';
            (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
            let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
            localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
            localVarRequestOptions.data = (0, common_1.serializeDataIfNeeded)(importTaskCreateRequest, localVarRequestOptions, configuration);
            return {
                url: (0, common_1.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, clusterName, id, options = {}) => {
            // verify required parameter 'orgName' is not null or undefined
            (0, common_1.assertParamExists)('deleteImportTask', 'orgName', orgName);
            // verify required parameter 'clusterName' is not null or undefined
            (0, common_1.assertParamExists)('deleteImportTask', 'clusterName', clusterName);
            // verify required parameter 'id' is not null or undefined
            (0, common_1.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, common_1.DUMMY_BASE_URL);
            let baseOptions;
            if (configuration) {
                baseOptions = configuration.baseOptions;
            }
            const localVarRequestOptions = Object.assign(Object.assign({ method: 'DELETE' }, baseOptions), options);
            const localVarHeaderParameter = {};
            const localVarQueryParameter = {};
            // authentication BearerToken required
            // http bearer authentication required
            await (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration);
            // authentication DigestAuth required
            await (0, common_1.setApiKeyToObject)(localVarHeaderParameter, "Authorization", configuration);
            (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
            let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
            localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
            return {
                url: (0, common_1.toPathString)(localVarUrlObj),
                options: localVarRequestOptions,
            };
        },
        /**
         * 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, clusterName, taskId, options = {}) => {
            // verify required parameter 'orgName' is not null or undefined
            (0, common_1.assertParamExists)('getImportPreflightTask', 'orgName', orgName);
            // verify required parameter 'clusterName' is not null or undefined
            (0, common_1.assertParamExists)('getImportPreflightTask', 'clusterName', clusterName);
            // verify required parameter 'taskId' is not null or undefined
            (0, common_1.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, common_1.DUMMY_BASE_URL);
            let baseOptions;
            if (configuration) {
                baseOptions = configuration.baseOptions;
            }
            const localVarRequestOptions = Object.assign(Object.assign({ method: 'GET' }, baseOptions), options);
            const localVarHeaderParameter = {};
            const localVarQueryParameter = {};
            // authentication BearerToken required
            // http bearer authentication required
            await (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration);
            // authentication DigestAuth required
            await (0, common_1.setApiKeyToObject)(localVarHeaderParameter, "Authorization", configuration);
            (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
            let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
            localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
            return {
                url: (0, common_1.toPathString)(localVarUrlObj),
                options: localVarRequestOptions,
            };
        },
        /**
         * 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, clusterName, id, options = {}) => {
            // verify required parameter 'orgName' is not null or undefined
            (0, common_1.assertParamExists)('getImportTask', 'orgName', orgName);
            // verify required parameter 'clusterName' is not null or undefined
            (0, common_1.assertParamExists)('getImportTask', 'clusterName', clusterName);
            // verify required parameter 'id' is not null or undefined
            (0, common_1.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, common_1.DUMMY_BASE_URL);
            let baseOptions;
            if (configuration) {
                baseOptions = configuration.baseOptions;
            }
            const localVarRequestOptions = Object.assign(Object.assign({ method: 'GET' }, baseOptions), options);
            const localVarHeaderParameter = {};
            const localVarQueryParameter = {};
            // authentication BearerToken required
            // http bearer authentication required
            await (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration);
            // authentication DigestAuth required
            await (0, common_1.setApiKeyToObject)(localVarHeaderParameter, "Authorization", configuration);
            (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
            let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
            localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
            return {
                url: (0, common_1.toPathString)(localVarUrlObj),
                options: localVarRequestOptions,
            };
        },
        /**
         * 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, clusterName, importPreflightRequest, options = {}) => {
            // verify required parameter 'orgName' is not null or undefined
            (0, common_1.assertParamExists)('importPreflight', 'orgName', orgName);
            // verify required parameter 'clusterName' is not null or undefined
            (0, common_1.assertParamExists)('importPreflight', 'clusterName', clusterName);
            // verify required parameter 'importPreflightRequest' is not null or undefined
            (0, common_1.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, common_1.DUMMY_BASE_URL);
            let baseOptions;
            if (configuration) {
                baseOptions = configuration.baseOptions;
            }
            const localVarRequestOptions = Object.assign(Object.assign({ method: 'POST' }, baseOptions), options);
            const localVarHeaderParameter = {};
            const localVarQueryParameter = {};
            // authentication BearerToken required
            // http bearer authentication required
            await (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration);
            // authentication DigestAuth required
            await (0, common_1.setApiKeyToObject)(localVarHeaderParameter, "Authorization", configuration);
            localVarHeaderParameter['Content-Type'] = 'application/json';
            (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
            let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
            localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
            localVarRequestOptions.data = (0, common_1.serializeDataIfNeeded)(importPreflightRequest, localVarRequestOptions, configuration);
            return {
                url: (0, common_1.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, clusterName, options = {}) => {
            // verify required parameter 'orgName' is not null or undefined
            (0, common_1.assertParamExists)('listImportTask', 'orgName', orgName);
            // verify required parameter 'clusterName' is not null or undefined
            (0, common_1.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, common_1.DUMMY_BASE_URL);
            let baseOptions;
            if (configuration) {
                baseOptions = configuration.baseOptions;
            }
            const localVarRequestOptions = Object.assign(Object.assign({ method: 'GET' }, baseOptions), options);
            const localVarHeaderParameter = {};
            const localVarQueryParameter = {};
            // authentication BearerToken required
            // http bearer authentication required
            await (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration);
            // authentication DigestAuth required
            await (0, common_1.setApiKeyToObject)(localVarHeaderParameter, "Authorization", configuration);
            (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
            let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
            localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
            return {
                url: (0, common_1.toPathString)(localVarUrlObj),
                options: localVarRequestOptions,
            };
        },
        /**
         * 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, clusterName, importQueryObjectsRequest, options = {}) => {
            // verify required parameter 'orgName' is not null or undefined
            (0, common_1.assertParamExists)('queryImportObjects', 'orgName', orgName);
            // verify required parameter 'clusterName' is not null or undefined
            (0, common_1.assertParamExists)('queryImportObjects', 'clusterName', clusterName);
            // verify required parameter 'importQueryObjectsRequest' is not null or undefined
            (0, common_1.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, common_1.DUMMY_BASE_URL);
            let baseOptions;
            if (configuration) {
                baseOptions = configuration.baseOptions;
            }
            const localVarRequestOptions = Object.assign(Object.assign({ method: 'POST' }, baseOptions), options);
            const localVarHeaderParameter = {};
            const localVarQueryParameter = {};
            // authentication BearerToken required
            // http bearer authentication required
            await (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration);
            // authentication DigestAuth required
            await (0, common_1.setApiKeyToObject)(localVarHeaderParameter, "Authorization", configuration);
            localVarHeaderParameter['Content-Type'] = 'application/json';
            (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
            let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
            localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
            localVarRequestOptions.data = (0, common_1.serializeDataIfNeeded)(importQueryObjectsRequest, localVarRequestOptions, configuration);
            return {
                url: (0, common_1.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, clusterName, id, opsType, options = {}) => {
            // verify required parameter 'orgName' is not null or undefined
            (0, common_1.assertParamExists)('updateImportTaskOps', 'orgName', orgName);
            // verify required parameter 'clusterName' is not null or undefined
            (0, common_1.assertParamExists)('updateImportTaskOps', 'clusterName', clusterName);
            // verify required parameter 'id' is not null or undefined
            (0, common_1.assertParamExists)('updateImportTaskOps', 'id', id);
            // verify required parameter 'opsType' is not null or undefined
            (0, common_1.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, common_1.DUMMY_BASE_URL);
            let baseOptions;
            if (configuration) {
                baseOptions = configuration.baseOptions;
            }
            const localVarRequestOptions = Object.assign(Object.assign({ method: 'PATCH' }, baseOptions), options);
            const localVarHeaderParameter = {};
            const localVarQueryParameter = {};
            // authentication BearerToken required
            // http bearer authentication required
            await (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration);
            // authentication DigestAuth required
            await (0, common_1.setApiKeyToObject)(localVarHeaderParameter, "Authorization", configuration);
            (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
            let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
            localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
            return {
                url: (0, common_1.toPathString)(localVarUrlObj),
                options: localVarRequestOptions,
            };
        },
    };
};
exports.ImportApiAxiosParamCreator = ImportApiAxiosParamCreator;
/**
 * ImportApi - functional programming interface
 * @export
 */
const ImportApiFp = function (configuration) {
    const localVarAxiosParamCreator = (0, exports.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, clusterName, importTaskCreateRequest, options) {
            var _a, _b, _c;
            const localVarAxiosArgs = await localVarAxiosParamCreator.createImportTask(orgName, clusterName, importTaskCreateRequest, options);
            const localVarOperationServerIndex = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0;
            const localVarOperationServerBasePath = (_c = (_b = base_1.operationServerMap['ImportApi.createImportTask']) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === null || _c === void 0 ? void 0 : _c.url;
            return (axios, basePath) => (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
        },
        /**
         * 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, clusterName, id, options) {
            var _a, _b, _c;
            const localVarAxiosArgs = await localVarAxiosParamCreator.deleteImportTask(orgName, clusterName, id, options);
            const localVarOperationServerIndex = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0;
            const localVarOperationServerBasePath = (_c = (_b = base_1.operationServerMap['ImportApi.deleteImportTask']) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === null || _c === void 0 ? void 0 : _c.url;
            return (axios, basePath) => (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
        },
        /**
         * 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, clusterName, taskId, options) {
            var _a, _b, _c;
            const localVarAxiosArgs = await localVarAxiosParamCreator.getImportPreflightTask(orgName, clusterName, taskId, options);
            const localVarOperationServerIndex = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0;
            const localVarOperationServerBasePath = (_c = (_b = base_1.operationServerMap['ImportApi.getImportPreflightTask']) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === null || _c === void 0 ? void 0 : _c.url;
            return (axios, basePath) => (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
        },
        /**
         * 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, clusterName, id, options) {
            var _a, _b, _c;
            const localVarAxiosArgs = await localVarAxiosParamCreator.getImportTask(orgName, clusterName, id, options);
            const localVarOperationServerIndex = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0;
            const localVarOperationServerBasePath = (_c = (_b = base_1.operationServerMap['ImportApi.getImportTask']) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === null || _c === void 0 ? void 0 : _c.url;
            return (axios, basePath) => (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
        },
        /**
         * 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, clusterName, importPreflightRequest, options) {
            var _a, _b, _c;
            const localVarAxiosArgs = await localVarAxiosParamCreator.importPreflight(orgName, clusterName, importPreflightRequest, options);
            const localVarOperationServerIndex = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0;
            const localVarOperationServerBasePath = (_c = (_b = base_1.operationServerMap['ImportApi.importPreflight']) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === null || _c === void 0 ? void 0 : _c.url;
            return (axios, basePath) => (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
        },
        /**
         * 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, clusterName, options) {
            var _a, _b, _c;
            const localVarAxiosArgs = await localVarAxiosParamCreator.listImportTask(orgName, clusterName, options);
            const localVarOperationServerIndex = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0;
            const localVarOperationServerBasePath = (_c = (_b = base_1.operationServerMap['ImportApi.listImportTask']) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === null || _c === void 0 ? void 0 : _c.url;
            return (axios, basePath) => (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
        },
        /**
         * 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, clusterName, importQueryObjectsRequest, options) {
            var _a, _b, _c;
            const localVarAxiosArgs = await localVarAxiosParamCreator.queryImportObjects(orgName, clusterName, importQueryObjectsRequest, options);
            const localVarOperationServerIndex = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0;
            const localVarOperationServerBasePath = (_c = (_b = base_1.operationServerMap['ImportApi.queryImportObjects']) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === null || _c === void 0 ? void 0 : _c.url;
            return (axios, basePath) => (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
        },
        /**
         * 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, clusterName, id, opsType, options) {
            var _a, _b, _c;
            const localVarAxiosArgs = await localVarAxiosParamCreator.updateImportTaskOps(orgName, clusterName, id, opsType, options);
            const localVarOperationServerIndex = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0;
            const localVarOperationServerBasePath = (_c = (_b = base_1.operationServerMap['ImportApi.updateImportTaskOps']) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === null || _c === void 0 ? void 0 : _c.url;
            return (axios, basePath) => (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
        },
    };
};
exports.ImportApiFp = ImportApiFp;
/**
 * ImportApi - factory interface
 * @export
 */
const ImportApiFactory = function (configuration, basePath, axios) {
    const localVarFp = (0, exports.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, options) {
            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, options) {
            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, options) {
            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, options) {
            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, options) {
            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, options) {
            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, options) {
            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, options) {
            return localVarFp.updateImportTaskOps(requestParameters.orgName, requestParameters.clusterName, requestParameters.id, requestParameters.opsType, options).then((request) => request(axios, basePath));
        },
    };
};
exports.ImportApiFactory = ImportApiFactory;
/**
 * ImportApi - object-oriented interface
 * @export
 * @class ImportApi
 * @extends {BaseAPI}
 */
class ImportApi extends base_1.BaseAPI {
    /**
     * 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
     */
    createImportTask(requestParameters, options) {
        return (0, exports.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
     */
    deleteImportTask(requestParameters, options) {
        return (0, exports.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
     */
    getImportPreflightTask(requestParameters, options) {
        return (0, exports.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
     */
    getImportTask(requestParameters, options) {
        return (0, exports.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
     */
    importPreflight(requestParameters, options) {
        return (0, exports.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
     */
    listImportTask(requestParameters, options) {
        return (0, exports.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
     */
    queryImportObjects(requestParameters, options) {
        return (0, exports.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
     */
    updateImportTaskOps(requestParameters, options) {
        return (0, exports.ImportApiFp)(this.configuration).updateImportTaskOps(requestParameters.orgName, requestParameters.clusterName, requestParameters.id, requestParameters.opsType, options).then((request) => request(this.axios, this.basePath));
    }
}
exports.ImportApi = ImportApi;
//# sourceMappingURL=import-api.js.map