"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.DatabaseParametersApi = exports.DatabaseParametersApiFactory = exports.DatabaseParametersApiFp = exports.DatabaseParametersApiAxiosParamCreator = 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");
/**
 * DatabaseParametersApi - axios parameter creator
 * @export
 */
const DatabaseParametersApiAxiosParamCreator = function (configuration) {
    return {
        /**
         *
         * @summary Create database parameter
         * @param {DatabaseParameterItem} body
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        createDatabaseParameter: async (body, options = {}) => {
            // verify required parameter 'body' is not null or undefined
            (0, common_1.assertParamExists)('createDatabaseParameter', 'body', body);
            const localVarPath = `/admin/v1/databaseParameters`;
            // 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)(body, localVarRequestOptions, configuration);
            return {
                url: (0, common_1.toPathString)(localVarUrlObj),
                options: localVarRequestOptions,
            };
        },
        /**
         *
         * @summary Delete database parameter
         * @param {DeleteDatabaseParameterItem} body
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        deleteDatabaseParameter: async (body, options = {}) => {
            // verify required parameter 'body' is not null or undefined
            (0, common_1.assertParamExists)('deleteDatabaseParameter', 'body', body);
            const localVarPath = `/admin/v1/databaseParameters`;
            // 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);
            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)(body, localVarRequestOptions, configuration);
            return {
                url: (0, common_1.toPathString)(localVarUrlObj),
                options: localVarRequestOptions,
            };
        },
        /**
         *
         * @summary List database parameters
         * @param {string} engineName engine Name
         * @param {string} component component type
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        listDatabaseParameters: async (engineName, component, options = {}) => {
            // verify required parameter 'engineName' is not null or undefined
            (0, common_1.assertParamExists)('listDatabaseParameters', 'engineName', engineName);
            // verify required parameter 'component' is not null or undefined
            (0, common_1.assertParamExists)('listDatabaseParameters', 'component', component);
            const localVarPath = `/admin/v1/databaseParameters`;
            // use dummy base URL string because the URL constructor only accepts absolute URLs.
            const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
            let baseOptions;
            if (configuration) {
                baseOptions = configuration.baseOptions;
            }
            const localVarRequestOptions = Object.assign(Object.assign({ method: 'GET' }, baseOptions), options);
            const localVarHeaderParameter = {};
            const localVarQueryParameter = {};
            // authentication BearerToken required
            // http bearer authentication required
            await (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration);
            // authentication DigestAuth required
            await (0, common_1.setApiKeyToObject)(localVarHeaderParameter, "Authorization", configuration);
            if (engineName !== undefined) {
                localVarQueryParameter['engineName'] = engineName;
            }
            if (component !== undefined) {
                localVarQueryParameter['component'] = component;
            }
            (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
            let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
            localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
            return {
                url: (0, common_1.toPathString)(localVarUrlObj),
                options: localVarRequestOptions,
            };
        },
        /**
         *
         * @summary Update database parameter
         * @param {DatabaseParameterItem} body
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        updateDatabaseParameter: async (body, options = {}) => {
            // verify required parameter 'body' is not null or undefined
            (0, common_1.assertParamExists)('updateDatabaseParameter', 'body', body);
            const localVarPath = `/admin/v1/databaseParameters`;
            // 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);
            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)(body, localVarRequestOptions, configuration);
            return {
                url: (0, common_1.toPathString)(localVarUrlObj),
                options: localVarRequestOptions,
            };
        },
    };
};
exports.DatabaseParametersApiAxiosParamCreator = DatabaseParametersApiAxiosParamCreator;
/**
 * DatabaseParametersApi - functional programming interface
 * @export
 */
const DatabaseParametersApiFp = function (configuration) {
    const localVarAxiosParamCreator = (0, exports.DatabaseParametersApiAxiosParamCreator)(configuration);
    return {
        /**
         *
         * @summary Create database parameter
         * @param {DatabaseParameterItem} body
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        async createDatabaseParameter(body, options) {
            var _a, _b, _c;
            const localVarAxiosArgs = await localVarAxiosParamCreator.createDatabaseParameter(body, 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['DatabaseParametersApi.createDatabaseParameter']) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === null || _c === void 0 ? void 0 : _c.url;
            return (axios, basePath) => (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
        },
        /**
         *
         * @summary Delete database parameter
         * @param {DeleteDatabaseParameterItem} body
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        async deleteDatabaseParameter(body, options) {
            var _a, _b, _c;
            const localVarAxiosArgs = await localVarAxiosParamCreator.deleteDatabaseParameter(body, 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['DatabaseParametersApi.deleteDatabaseParameter']) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === null || _c === void 0 ? void 0 : _c.url;
            return (axios, basePath) => (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
        },
        /**
         *
         * @summary List database parameters
         * @param {string} engineName engine Name
         * @param {string} component component type
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        async listDatabaseParameters(engineName, component, options) {
            var _a, _b, _c;
            const localVarAxiosArgs = await localVarAxiosParamCreator.listDatabaseParameters(engineName, component, 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['DatabaseParametersApi.listDatabaseParameters']) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === null || _c === void 0 ? void 0 : _c.url;
            return (axios, basePath) => (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
        },
        /**
         *
         * @summary Update database parameter
         * @param {DatabaseParameterItem} body
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        async updateDatabaseParameter(body, options) {
            var _a, _b, _c;
            const localVarAxiosArgs = await localVarAxiosParamCreator.updateDatabaseParameter(body, 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['DatabaseParametersApi.updateDatabaseParameter']) === 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.DatabaseParametersApiFp = DatabaseParametersApiFp;
/**
 * DatabaseParametersApi - factory interface
 * @export
 */
const DatabaseParametersApiFactory = function (configuration, basePath, axios) {
    const localVarFp = (0, exports.DatabaseParametersApiFp)(configuration);
    return {
        /**
         *
         * @summary Create database parameter
         * @param {DatabaseParametersApiCreateDatabaseParameterRequest} requestParameters Request parameters.
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        createDatabaseParameter(requestParameters, options) {
            return localVarFp.createDatabaseParameter(requestParameters.body, options).then((request) => request(axios, basePath));
        },
        /**
         *
         * @summary Delete database parameter
         * @param {DatabaseParametersApiDeleteDatabaseParameterRequest} requestParameters Request parameters.
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        deleteDatabaseParameter(requestParameters, options) {
            return localVarFp.deleteDatabaseParameter(requestParameters.body, options).then((request) => request(axios, basePath));
        },
        /**
         *
         * @summary List database parameters
         * @param {DatabaseParametersApiListDatabaseParametersRequest} requestParameters Request parameters.
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        listDatabaseParameters(requestParameters, options) {
            return localVarFp.listDatabaseParameters(requestParameters.engineName, requestParameters.component, options).then((request) => request(axios, basePath));
        },
        /**
         *
         * @summary Update database parameter
         * @param {DatabaseParametersApiUpdateDatabaseParameterRequest} requestParameters Request parameters.
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        updateDatabaseParameter(requestParameters, options) {
            return localVarFp.updateDatabaseParameter(requestParameters.body, options).then((request) => request(axios, basePath));
        },
    };
};
exports.DatabaseParametersApiFactory = DatabaseParametersApiFactory;
/**
 * DatabaseParametersApi - object-oriented interface
 * @export
 * @class DatabaseParametersApi
 * @extends {BaseAPI}
 */
class DatabaseParametersApi extends base_1.BaseAPI {
    /**
     *
     * @summary Create database parameter
     * @param {DatabaseParametersApiCreateDatabaseParameterRequest} requestParameters Request parameters.
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     * @memberof DatabaseParametersApi
     */
    createDatabaseParameter(requestParameters, options) {
        return (0, exports.DatabaseParametersApiFp)(this.configuration).createDatabaseParameter(requestParameters.body, options).then((request) => request(this.axios, this.basePath));
    }
    /**
     *
     * @summary Delete database parameter
     * @param {DatabaseParametersApiDeleteDatabaseParameterRequest} requestParameters Request parameters.
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     * @memberof DatabaseParametersApi
     */
    deleteDatabaseParameter(requestParameters, options) {
        return (0, exports.DatabaseParametersApiFp)(this.configuration).deleteDatabaseParameter(requestParameters.body, options).then((request) => request(this.axios, this.basePath));
    }
    /**
     *
     * @summary List database parameters
     * @param {DatabaseParametersApiListDatabaseParametersRequest} requestParameters Request parameters.
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     * @memberof DatabaseParametersApi
     */
    listDatabaseParameters(requestParameters, options) {
        return (0, exports.DatabaseParametersApiFp)(this.configuration).listDatabaseParameters(requestParameters.engineName, requestParameters.component, options).then((request) => request(this.axios, this.basePath));
    }
    /**
     *
     * @summary Update database parameter
     * @param {DatabaseParametersApiUpdateDatabaseParameterRequest} requestParameters Request parameters.
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     * @memberof DatabaseParametersApi
     */
    updateDatabaseParameter(requestParameters, options) {
        return (0, exports.DatabaseParametersApiFp)(this.configuration).updateDatabaseParameter(requestParameters.body, options).then((request) => request(this.axios, this.basePath));
    }
}
exports.DatabaseParametersApi = DatabaseParametersApi;
//# sourceMappingURL=database-parameters-api.js.map