/* 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 { Database } from '../models';
// @ts-ignore
import type { DatabaseList } from '../models';
/**
 * DatabaseApi - axios parameter creator
 * @export
 */
export const DatabaseApiAxiosParamCreator = function (configuration?: Configuration) {
    return {
        /**
         * create a database in cluster
         * @summary Create cluster database
         * @param {string} engineName name of the engine
         * @param {string} orgName name of the Org
         * @param {string} clusterName name of the Cluster
         * @param {Database} body 
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        createDatabase: async (engineName: string, orgName: string, clusterName: string, body: Database, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
            // verify required parameter 'engineName' is not null or undefined
            assertParamExists('createDatabase', 'engineName', engineName)
            // verify required parameter 'orgName' is not null or undefined
            assertParamExists('createDatabase', 'orgName', orgName)
            // verify required parameter 'clusterName' is not null or undefined
            assertParamExists('createDatabase', 'clusterName', clusterName)
            // verify required parameter 'body' is not null or undefined
            assertParamExists('createDatabase', 'body', body)
            const localVarPath = `/admin/v1/data/{engineName}/organizations/{orgName}/clusters/{clusterName}/databases`
                .replace(`{${"engineName"}}`, encodeURIComponent(String(engineName)))
                .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(body, localVarRequestOptions, configuration)

            return {
                url: toPathString(localVarUrlObj),
                options: localVarRequestOptions,
            };
        },
        /**
         * delete a database in cluster
         * @summary Delete cluster database
         * @param {string} engineName name of the engine
         * @param {string} orgName name of the Org
         * @param {string} clusterName name of the Cluster
         * @param {string} databaseName name of database
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        deleteDatabase: async (engineName: string, orgName: string, clusterName: string, databaseName: string, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
            // verify required parameter 'engineName' is not null or undefined
            assertParamExists('deleteDatabase', 'engineName', engineName)
            // verify required parameter 'orgName' is not null or undefined
            assertParamExists('deleteDatabase', 'orgName', orgName)
            // verify required parameter 'clusterName' is not null or undefined
            assertParamExists('deleteDatabase', 'clusterName', clusterName)
            // verify required parameter 'databaseName' is not null or undefined
            assertParamExists('deleteDatabase', 'databaseName', databaseName)
            const localVarPath = `/admin/v1/data/{engineName}/organizations/{orgName}/clusters/{clusterName}/databases/{databaseName}`
                .replace(`{${"engineName"}}`, encodeURIComponent(String(engineName)))
                .replace(`{${"orgName"}}`, encodeURIComponent(String(orgName)))
                .replace(`{${"clusterName"}}`, encodeURIComponent(String(clusterName)))
                .replace(`{${"databaseName"}}`, encodeURIComponent(String(databaseName)));
            // 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,
            };
        },
        /**
         * get a database info in cluster
         * @param {string} engineName name of the engine
         * @param {string} orgName name of the Org
         * @param {string} clusterName name of the Cluster
         * @param {string} databaseName name of database
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        getDatabase: async (engineName: string, orgName: string, clusterName: string, databaseName: string, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
            // verify required parameter 'engineName' is not null or undefined
            assertParamExists('getDatabase', 'engineName', engineName)
            // verify required parameter 'orgName' is not null or undefined
            assertParamExists('getDatabase', 'orgName', orgName)
            // verify required parameter 'clusterName' is not null or undefined
            assertParamExists('getDatabase', 'clusterName', clusterName)
            // verify required parameter 'databaseName' is not null or undefined
            assertParamExists('getDatabase', 'databaseName', databaseName)
            const localVarPath = `/admin/v1/data/{engineName}/organizations/{orgName}/clusters/{clusterName}/databases/{databaseName}`
                .replace(`{${"engineName"}}`, encodeURIComponent(String(engineName)))
                .replace(`{${"orgName"}}`, encodeURIComponent(String(orgName)))
                .replace(`{${"clusterName"}}`, encodeURIComponent(String(clusterName)))
                .replace(`{${"databaseName"}}`, encodeURIComponent(String(databaseName)));
            // use dummy base URL string because the URL constructor only accepts absolute URLs.
            const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
            let baseOptions;
            if (configuration) {
                baseOptions = configuration.baseOptions;
            }

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

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

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


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

            return {
                url: toPathString(localVarUrlObj),
                options: localVarRequestOptions,
            };
        },
        /**
         * list databases for rdbms engine cluster
         * @summary List cluster databases
         * @param {string} engineName name of the engine
         * @param {string} orgName name of the Org
         * @param {string} clusterName name of the Cluster
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        listDatabases: async (engineName: string, orgName: string, clusterName: string, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
            // verify required parameter 'engineName' is not null or undefined
            assertParamExists('listDatabases', 'engineName', engineName)
            // verify required parameter 'orgName' is not null or undefined
            assertParamExists('listDatabases', 'orgName', orgName)
            // verify required parameter 'clusterName' is not null or undefined
            assertParamExists('listDatabases', 'clusterName', clusterName)
            const localVarPath = `/admin/v1/data/{engineName}/organizations/{orgName}/clusters/{clusterName}/databases`
                .replace(`{${"engineName"}}`, encodeURIComponent(String(engineName)))
                .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,
            };
        },
        /**
         * update a database config in cluster
         * @summary update database config
         * @param {string} engineName name of the engine
         * @param {string} orgName name of the Org
         * @param {string} clusterName name of the Cluster
         * @param {string} databaseName name of database
         * @param {{ [key: string]: string; }} [requestBody] 
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        updateDatabaseConfig: async (engineName: string, orgName: string, clusterName: string, databaseName: string, requestBody?: { [key: string]: string; }, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
            // verify required parameter 'engineName' is not null or undefined
            assertParamExists('updateDatabaseConfig', 'engineName', engineName)
            // verify required parameter 'orgName' is not null or undefined
            assertParamExists('updateDatabaseConfig', 'orgName', orgName)
            // verify required parameter 'clusterName' is not null or undefined
            assertParamExists('updateDatabaseConfig', 'clusterName', clusterName)
            // verify required parameter 'databaseName' is not null or undefined
            assertParamExists('updateDatabaseConfig', 'databaseName', databaseName)
            const localVarPath = `/admin/v1/data/{engineName}/organizations/{orgName}/clusters/{clusterName}/databases/{databaseName}`
                .replace(`{${"engineName"}}`, encodeURIComponent(String(engineName)))
                .replace(`{${"orgName"}}`, encodeURIComponent(String(orgName)))
                .replace(`{${"clusterName"}}`, encodeURIComponent(String(clusterName)))
                .replace(`{${"databaseName"}}`, encodeURIComponent(String(databaseName)));
            // 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)


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

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

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

/**
 * DatabaseApi - functional programming interface
 * @export
 */
export const DatabaseApiFp = function(configuration?: Configuration) {
    const localVarAxiosParamCreator = DatabaseApiAxiosParamCreator(configuration)
    return {
        /**
         * create a database in cluster
         * @summary Create cluster database
         * @param {string} engineName name of the engine
         * @param {string} orgName name of the Org
         * @param {string} clusterName name of the Cluster
         * @param {Database} body 
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        async createDatabase(engineName: string, orgName: string, clusterName: string, body: Database, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<void>> {
            const localVarAxiosArgs = await localVarAxiosParamCreator.createDatabase(engineName, orgName, clusterName, body, options);
            const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
            const localVarOperationServerBasePath = operationServerMap['DatabaseApi.createDatabase']?.[localVarOperationServerIndex]?.url;
            return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
        },
        /**
         * delete a database in cluster
         * @summary Delete cluster database
         * @param {string} engineName name of the engine
         * @param {string} orgName name of the Org
         * @param {string} clusterName name of the Cluster
         * @param {string} databaseName name of database
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        async deleteDatabase(engineName: string, orgName: string, clusterName: string, databaseName: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<void>> {
            const localVarAxiosArgs = await localVarAxiosParamCreator.deleteDatabase(engineName, orgName, clusterName, databaseName, options);
            const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
            const localVarOperationServerBasePath = operationServerMap['DatabaseApi.deleteDatabase']?.[localVarOperationServerIndex]?.url;
            return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
        },
        /**
         * get a database info in cluster
         * @param {string} engineName name of the engine
         * @param {string} orgName name of the Org
         * @param {string} clusterName name of the Cluster
         * @param {string} databaseName name of database
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        async getDatabase(engineName: string, orgName: string, clusterName: string, databaseName: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<Database>> {
            const localVarAxiosArgs = await localVarAxiosParamCreator.getDatabase(engineName, orgName, clusterName, databaseName, options);
            const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
            const localVarOperationServerBasePath = operationServerMap['DatabaseApi.getDatabase']?.[localVarOperationServerIndex]?.url;
            return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
        },
        /**
         * list databases for rdbms engine cluster
         * @summary List cluster databases
         * @param {string} engineName name of the engine
         * @param {string} orgName name of the Org
         * @param {string} clusterName name of the Cluster
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        async listDatabases(engineName: string, orgName: string, clusterName: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<DatabaseList>> {
            const localVarAxiosArgs = await localVarAxiosParamCreator.listDatabases(engineName, orgName, clusterName, options);
            const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
            const localVarOperationServerBasePath = operationServerMap['DatabaseApi.listDatabases']?.[localVarOperationServerIndex]?.url;
            return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
        },
        /**
         * update a database config in cluster
         * @summary update database config
         * @param {string} engineName name of the engine
         * @param {string} orgName name of the Org
         * @param {string} clusterName name of the Cluster
         * @param {string} databaseName name of database
         * @param {{ [key: string]: string; }} [requestBody] 
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        async updateDatabaseConfig(engineName: string, orgName: string, clusterName: string, databaseName: string, requestBody?: { [key: string]: string; }, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<void>> {
            const localVarAxiosArgs = await localVarAxiosParamCreator.updateDatabaseConfig(engineName, orgName, clusterName, databaseName, requestBody, options);
            const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
            const localVarOperationServerBasePath = operationServerMap['DatabaseApi.updateDatabaseConfig']?.[localVarOperationServerIndex]?.url;
            return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
        },
    }
};

/**
 * DatabaseApi - factory interface
 * @export
 */
export const DatabaseApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) {
    const localVarFp = DatabaseApiFp(configuration)
    return {
        /**
         * create a database in cluster
         * @summary Create cluster database
         * @param {DatabaseApiCreateDatabaseRequest} requestParameters Request parameters.
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        createDatabase(requestParameters: DatabaseApiCreateDatabaseRequest, options?: RawAxiosRequestConfig): AxiosPromise<void> {
            return localVarFp.createDatabase(requestParameters.engineName, requestParameters.orgName, requestParameters.clusterName, requestParameters.body, options).then((request) => request(axios, basePath));
        },
        /**
         * delete a database in cluster
         * @summary Delete cluster database
         * @param {DatabaseApiDeleteDatabaseRequest} requestParameters Request parameters.
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        deleteDatabase(requestParameters: DatabaseApiDeleteDatabaseRequest, options?: RawAxiosRequestConfig): AxiosPromise<void> {
            return localVarFp.deleteDatabase(requestParameters.engineName, requestParameters.orgName, requestParameters.clusterName, requestParameters.databaseName, options).then((request) => request(axios, basePath));
        },
        /**
         * get a database info in cluster
         * @param {DatabaseApiGetDatabaseRequest} requestParameters Request parameters.
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        getDatabase(requestParameters: DatabaseApiGetDatabaseRequest, options?: RawAxiosRequestConfig): AxiosPromise<Database> {
            return localVarFp.getDatabase(requestParameters.engineName, requestParameters.orgName, requestParameters.clusterName, requestParameters.databaseName, options).then((request) => request(axios, basePath));
        },
        /**
         * list databases for rdbms engine cluster
         * @summary List cluster databases
         * @param {DatabaseApiListDatabasesRequest} requestParameters Request parameters.
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        listDatabases(requestParameters: DatabaseApiListDatabasesRequest, options?: RawAxiosRequestConfig): AxiosPromise<DatabaseList> {
            return localVarFp.listDatabases(requestParameters.engineName, requestParameters.orgName, requestParameters.clusterName, options).then((request) => request(axios, basePath));
        },
        /**
         * update a database config in cluster
         * @summary update database config
         * @param {DatabaseApiUpdateDatabaseConfigRequest} requestParameters Request parameters.
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        updateDatabaseConfig(requestParameters: DatabaseApiUpdateDatabaseConfigRequest, options?: RawAxiosRequestConfig): AxiosPromise<void> {
            return localVarFp.updateDatabaseConfig(requestParameters.engineName, requestParameters.orgName, requestParameters.clusterName, requestParameters.databaseName, requestParameters.requestBody, options).then((request) => request(axios, basePath));
        },
    };
};

/**
 * DatabaseApi - interface
 * @export
 * @interface DatabaseApi
 */
export interface DatabaseApiInterface {
    /**
     * create a database in cluster
     * @summary Create cluster database
     * @param {DatabaseApiCreateDatabaseRequest} requestParameters Request parameters.
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     * @memberof DatabaseApiInterface
     */
    createDatabase(requestParameters: DatabaseApiCreateDatabaseRequest, options?: RawAxiosRequestConfig): AxiosPromise<void>;

    /**
     * delete a database in cluster
     * @summary Delete cluster database
     * @param {DatabaseApiDeleteDatabaseRequest} requestParameters Request parameters.
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     * @memberof DatabaseApiInterface
     */
    deleteDatabase(requestParameters: DatabaseApiDeleteDatabaseRequest, options?: RawAxiosRequestConfig): AxiosPromise<void>;

    /**
     * get a database info in cluster
     * @param {DatabaseApiGetDatabaseRequest} requestParameters Request parameters.
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     * @memberof DatabaseApiInterface
     */
    getDatabase(requestParameters: DatabaseApiGetDatabaseRequest, options?: RawAxiosRequestConfig): AxiosPromise<Database>;

    /**
     * list databases for rdbms engine cluster
     * @summary List cluster databases
     * @param {DatabaseApiListDatabasesRequest} requestParameters Request parameters.
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     * @memberof DatabaseApiInterface
     */
    listDatabases(requestParameters: DatabaseApiListDatabasesRequest, options?: RawAxiosRequestConfig): AxiosPromise<DatabaseList>;

    /**
     * update a database config in cluster
     * @summary update database config
     * @param {DatabaseApiUpdateDatabaseConfigRequest} requestParameters Request parameters.
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     * @memberof DatabaseApiInterface
     */
    updateDatabaseConfig(requestParameters: DatabaseApiUpdateDatabaseConfigRequest, options?: RawAxiosRequestConfig): AxiosPromise<void>;

}

/**
 * Request parameters for createDatabase operation in DatabaseApi.
 * @export
 * @interface DatabaseApiCreateDatabaseRequest
 */
export interface DatabaseApiCreateDatabaseRequest {
    /**
     * name of the engine
     * @type {string}
     * @memberof DatabaseApiCreateDatabase
     */
    readonly engineName: string

    /**
     * name of the Org
     * @type {string}
     * @memberof DatabaseApiCreateDatabase
     */
    readonly orgName: string

    /**
     * name of the Cluster
     * @type {string}
     * @memberof DatabaseApiCreateDatabase
     */
    readonly clusterName: string

    /**
     * 
     * @type {Database}
     * @memberof DatabaseApiCreateDatabase
     */
    readonly body: Database
}

/**
 * Request parameters for deleteDatabase operation in DatabaseApi.
 * @export
 * @interface DatabaseApiDeleteDatabaseRequest
 */
export interface DatabaseApiDeleteDatabaseRequest {
    /**
     * name of the engine
     * @type {string}
     * @memberof DatabaseApiDeleteDatabase
     */
    readonly engineName: string

    /**
     * name of the Org
     * @type {string}
     * @memberof DatabaseApiDeleteDatabase
     */
    readonly orgName: string

    /**
     * name of the Cluster
     * @type {string}
     * @memberof DatabaseApiDeleteDatabase
     */
    readonly clusterName: string

    /**
     * name of database
     * @type {string}
     * @memberof DatabaseApiDeleteDatabase
     */
    readonly databaseName: string
}

/**
 * Request parameters for getDatabase operation in DatabaseApi.
 * @export
 * @interface DatabaseApiGetDatabaseRequest
 */
export interface DatabaseApiGetDatabaseRequest {
    /**
     * name of the engine
     * @type {string}
     * @memberof DatabaseApiGetDatabase
     */
    readonly engineName: string

    /**
     * name of the Org
     * @type {string}
     * @memberof DatabaseApiGetDatabase
     */
    readonly orgName: string

    /**
     * name of the Cluster
     * @type {string}
     * @memberof DatabaseApiGetDatabase
     */
    readonly clusterName: string

    /**
     * name of database
     * @type {string}
     * @memberof DatabaseApiGetDatabase
     */
    readonly databaseName: string
}

/**
 * Request parameters for listDatabases operation in DatabaseApi.
 * @export
 * @interface DatabaseApiListDatabasesRequest
 */
export interface DatabaseApiListDatabasesRequest {
    /**
     * name of the engine
     * @type {string}
     * @memberof DatabaseApiListDatabases
     */
    readonly engineName: string

    /**
     * name of the Org
     * @type {string}
     * @memberof DatabaseApiListDatabases
     */
    readonly orgName: string

    /**
     * name of the Cluster
     * @type {string}
     * @memberof DatabaseApiListDatabases
     */
    readonly clusterName: string
}

/**
 * Request parameters for updateDatabaseConfig operation in DatabaseApi.
 * @export
 * @interface DatabaseApiUpdateDatabaseConfigRequest
 */
export interface DatabaseApiUpdateDatabaseConfigRequest {
    /**
     * name of the engine
     * @type {string}
     * @memberof DatabaseApiUpdateDatabaseConfig
     */
    readonly engineName: string

    /**
     * name of the Org
     * @type {string}
     * @memberof DatabaseApiUpdateDatabaseConfig
     */
    readonly orgName: string

    /**
     * name of the Cluster
     * @type {string}
     * @memberof DatabaseApiUpdateDatabaseConfig
     */
    readonly clusterName: string

    /**
     * name of database
     * @type {string}
     * @memberof DatabaseApiUpdateDatabaseConfig
     */
    readonly databaseName: string

    /**
     * 
     * @type {{ [key: string]: string; }}
     * @memberof DatabaseApiUpdateDatabaseConfig
     */
    readonly requestBody?: { [key: string]: string; }
}

/**
 * DatabaseApi - object-oriented interface
 * @export
 * @class DatabaseApi
 * @extends {BaseAPI}
 */
export class DatabaseApi extends BaseAPI implements DatabaseApiInterface {
    /**
     * create a database in cluster
     * @summary Create cluster database
     * @param {DatabaseApiCreateDatabaseRequest} requestParameters Request parameters.
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     * @memberof DatabaseApi
     */
    public createDatabase(requestParameters: DatabaseApiCreateDatabaseRequest, options?: RawAxiosRequestConfig) {
        return DatabaseApiFp(this.configuration).createDatabase(requestParameters.engineName, requestParameters.orgName, requestParameters.clusterName, requestParameters.body, options).then((request) => request(this.axios, this.basePath));
    }

    /**
     * delete a database in cluster
     * @summary Delete cluster database
     * @param {DatabaseApiDeleteDatabaseRequest} requestParameters Request parameters.
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     * @memberof DatabaseApi
     */
    public deleteDatabase(requestParameters: DatabaseApiDeleteDatabaseRequest, options?: RawAxiosRequestConfig) {
        return DatabaseApiFp(this.configuration).deleteDatabase(requestParameters.engineName, requestParameters.orgName, requestParameters.clusterName, requestParameters.databaseName, options).then((request) => request(this.axios, this.basePath));
    }

    /**
     * get a database info in cluster
     * @param {DatabaseApiGetDatabaseRequest} requestParameters Request parameters.
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     * @memberof DatabaseApi
     */
    public getDatabase(requestParameters: DatabaseApiGetDatabaseRequest, options?: RawAxiosRequestConfig) {
        return DatabaseApiFp(this.configuration).getDatabase(requestParameters.engineName, requestParameters.orgName, requestParameters.clusterName, requestParameters.databaseName, options).then((request) => request(this.axios, this.basePath));
    }

    /**
     * list databases for rdbms engine cluster
     * @summary List cluster databases
     * @param {DatabaseApiListDatabasesRequest} requestParameters Request parameters.
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     * @memberof DatabaseApi
     */
    public listDatabases(requestParameters: DatabaseApiListDatabasesRequest, options?: RawAxiosRequestConfig) {
        return DatabaseApiFp(this.configuration).listDatabases(requestParameters.engineName, requestParameters.orgName, requestParameters.clusterName, options).then((request) => request(this.axios, this.basePath));
    }

    /**
     * update a database config in cluster
     * @summary update database config
     * @param {DatabaseApiUpdateDatabaseConfigRequest} requestParameters Request parameters.
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     * @memberof DatabaseApi
     */
    public updateDatabaseConfig(requestParameters: DatabaseApiUpdateDatabaseConfigRequest, options?: RawAxiosRequestConfig) {
        return DatabaseApiFp(this.configuration).updateDatabaseConfig(requestParameters.engineName, requestParameters.orgName, requestParameters.clusterName, requestParameters.databaseName, requestParameters.requestBody, options).then((request) => request(this.axios, this.basePath));
    }
}

