"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.MonitorDataSinkApi = exports.MonitorDataSinkApiFactory = exports.MonitorDataSinkApiFp = exports.MonitorDataSinkApiAxiosParamCreator = 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");
/**
 * MonitorDataSinkApi - axios parameter creator
 * @export
 */
const MonitorDataSinkApiAxiosParamCreator = function (configuration) {
    return {
        /**
         * Create monitor data sink
         * @summary Create monitor data sink
         * @param {MonitorDataSinkCreate} monitorDataSinkCreate
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        createMonitorDataSink: async (monitorDataSinkCreate, options = {}) => {
            // verify required parameter 'monitorDataSinkCreate' is not null or undefined
            (0, common_1.assertParamExists)('createMonitorDataSink', 'monitorDataSinkCreate', monitorDataSinkCreate);
            const localVarPath = `/admin/v1/monitorDataSinks`;
            // 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)(monitorDataSinkCreate, localVarRequestOptions, configuration);
            return {
                url: (0, common_1.toPathString)(localVarUrlObj),
                options: localVarRequestOptions,
            };
        },
        /**
         *
         * @summary Delete monitor data sink
         * @param {string} monitorDataSinkID monitor data sink id
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        deleteMonitorDataSink: async (monitorDataSinkID, options = {}) => {
            // verify required parameter 'monitorDataSinkID' is not null or undefined
            (0, common_1.assertParamExists)('deleteMonitorDataSink', 'monitorDataSinkID', monitorDataSinkID);
            const localVarPath = `/admin/v1/monitorDataSinks/{monitorDataSinkID}`
                .replace(`{${"monitorDataSinkID"}}`, encodeURIComponent(String(monitorDataSinkID)));
            // 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,
            };
        },
        /**
         * Get monitor data sink list
         * @summary Get monitor data sink list
         * @param {string} environmentName kubernetes environment name which monitor data sink deployed in.
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        listMonitorDataSinks: async (environmentName, options = {}) => {
            // verify required parameter 'environmentName' is not null or undefined
            (0, common_1.assertParamExists)('listMonitorDataSinks', 'environmentName', environmentName);
            const localVarPath = `/admin/v1/monitorDataSinks/environments/{environmentName}`
                .replace(`{${"environmentName"}}`, encodeURIComponent(String(environmentName)));
            // 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,
            };
        },
        /**
         * Update the specified monitor data sink
         * @summary Update the specified monitor data sink
         * @param {string} monitorDataSinkID monitor data sink id
         * @param {MonitorDataSinkUpdate} monitorDataSinkUpdate
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        patchMonitorDataSink: async (monitorDataSinkID, monitorDataSinkUpdate, options = {}) => {
            // verify required parameter 'monitorDataSinkID' is not null or undefined
            (0, common_1.assertParamExists)('patchMonitorDataSink', 'monitorDataSinkID', monitorDataSinkID);
            // verify required parameter 'monitorDataSinkUpdate' is not null or undefined
            (0, common_1.assertParamExists)('patchMonitorDataSink', 'monitorDataSinkUpdate', monitorDataSinkUpdate);
            const localVarPath = `/admin/v1/monitorDataSinks/{monitorDataSinkID}`
                .replace(`{${"monitorDataSinkID"}}`, encodeURIComponent(String(monitorDataSinkID)));
            // 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)(monitorDataSinkUpdate, localVarRequestOptions, configuration);
            return {
                url: (0, common_1.toPathString)(localVarUrlObj),
                options: localVarRequestOptions,
            };
        },
    };
};
exports.MonitorDataSinkApiAxiosParamCreator = MonitorDataSinkApiAxiosParamCreator;
/**
 * MonitorDataSinkApi - functional programming interface
 * @export
 */
const MonitorDataSinkApiFp = function (configuration) {
    const localVarAxiosParamCreator = (0, exports.MonitorDataSinkApiAxiosParamCreator)(configuration);
    return {
        /**
         * Create monitor data sink
         * @summary Create monitor data sink
         * @param {MonitorDataSinkCreate} monitorDataSinkCreate
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        async createMonitorDataSink(monitorDataSinkCreate, options) {
            var _a, _b, _c;
            const localVarAxiosArgs = await localVarAxiosParamCreator.createMonitorDataSink(monitorDataSinkCreate, 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['MonitorDataSinkApi.createMonitorDataSink']) === 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 monitor data sink
         * @param {string} monitorDataSinkID monitor data sink id
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        async deleteMonitorDataSink(monitorDataSinkID, options) {
            var _a, _b, _c;
            const localVarAxiosArgs = await localVarAxiosParamCreator.deleteMonitorDataSink(monitorDataSinkID, 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['MonitorDataSinkApi.deleteMonitorDataSink']) === 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);
        },
        /**
         * Get monitor data sink list
         * @summary Get monitor data sink list
         * @param {string} environmentName kubernetes environment name which monitor data sink deployed in.
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        async listMonitorDataSinks(environmentName, options) {
            var _a, _b, _c;
            const localVarAxiosArgs = await localVarAxiosParamCreator.listMonitorDataSinks(environmentName, 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['MonitorDataSinkApi.listMonitorDataSinks']) === 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);
        },
        /**
         * Update the specified monitor data sink
         * @summary Update the specified monitor data sink
         * @param {string} monitorDataSinkID monitor data sink id
         * @param {MonitorDataSinkUpdate} monitorDataSinkUpdate
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        async patchMonitorDataSink(monitorDataSinkID, monitorDataSinkUpdate, options) {
            var _a, _b, _c;
            const localVarAxiosArgs = await localVarAxiosParamCreator.patchMonitorDataSink(monitorDataSinkID, monitorDataSinkUpdate, 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['MonitorDataSinkApi.patchMonitorDataSink']) === 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.MonitorDataSinkApiFp = MonitorDataSinkApiFp;
/**
 * MonitorDataSinkApi - factory interface
 * @export
 */
const MonitorDataSinkApiFactory = function (configuration, basePath, axios) {
    const localVarFp = (0, exports.MonitorDataSinkApiFp)(configuration);
    return {
        /**
         * Create monitor data sink
         * @summary Create monitor data sink
         * @param {MonitorDataSinkApiCreateMonitorDataSinkRequest} requestParameters Request parameters.
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        createMonitorDataSink(requestParameters, options) {
            return localVarFp.createMonitorDataSink(requestParameters.monitorDataSinkCreate, options).then((request) => request(axios, basePath));
        },
        /**
         *
         * @summary Delete monitor data sink
         * @param {MonitorDataSinkApiDeleteMonitorDataSinkRequest} requestParameters Request parameters.
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        deleteMonitorDataSink(requestParameters, options) {
            return localVarFp.deleteMonitorDataSink(requestParameters.monitorDataSinkID, options).then((request) => request(axios, basePath));
        },
        /**
         * Get monitor data sink list
         * @summary Get monitor data sink list
         * @param {MonitorDataSinkApiListMonitorDataSinksRequest} requestParameters Request parameters.
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        listMonitorDataSinks(requestParameters, options) {
            return localVarFp.listMonitorDataSinks(requestParameters.environmentName, options).then((request) => request(axios, basePath));
        },
        /**
         * Update the specified monitor data sink
         * @summary Update the specified monitor data sink
         * @param {MonitorDataSinkApiPatchMonitorDataSinkRequest} requestParameters Request parameters.
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        patchMonitorDataSink(requestParameters, options) {
            return localVarFp.patchMonitorDataSink(requestParameters.monitorDataSinkID, requestParameters.monitorDataSinkUpdate, options).then((request) => request(axios, basePath));
        },
    };
};
exports.MonitorDataSinkApiFactory = MonitorDataSinkApiFactory;
/**
 * MonitorDataSinkApi - object-oriented interface
 * @export
 * @class MonitorDataSinkApi
 * @extends {BaseAPI}
 */
class MonitorDataSinkApi extends base_1.BaseAPI {
    /**
     * Create monitor data sink
     * @summary Create monitor data sink
     * @param {MonitorDataSinkApiCreateMonitorDataSinkRequest} requestParameters Request parameters.
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     * @memberof MonitorDataSinkApi
     */
    createMonitorDataSink(requestParameters, options) {
        return (0, exports.MonitorDataSinkApiFp)(this.configuration).createMonitorDataSink(requestParameters.monitorDataSinkCreate, options).then((request) => request(this.axios, this.basePath));
    }
    /**
     *
     * @summary Delete monitor data sink
     * @param {MonitorDataSinkApiDeleteMonitorDataSinkRequest} requestParameters Request parameters.
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     * @memberof MonitorDataSinkApi
     */
    deleteMonitorDataSink(requestParameters, options) {
        return (0, exports.MonitorDataSinkApiFp)(this.configuration).deleteMonitorDataSink(requestParameters.monitorDataSinkID, options).then((request) => request(this.axios, this.basePath));
    }
    /**
     * Get monitor data sink list
     * @summary Get monitor data sink list
     * @param {MonitorDataSinkApiListMonitorDataSinksRequest} requestParameters Request parameters.
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     * @memberof MonitorDataSinkApi
     */
    listMonitorDataSinks(requestParameters, options) {
        return (0, exports.MonitorDataSinkApiFp)(this.configuration).listMonitorDataSinks(requestParameters.environmentName, options).then((request) => request(this.axios, this.basePath));
    }
    /**
     * Update the specified monitor data sink
     * @summary Update the specified monitor data sink
     * @param {MonitorDataSinkApiPatchMonitorDataSinkRequest} requestParameters Request parameters.
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     * @memberof MonitorDataSinkApi
     */
    patchMonitorDataSink(requestParameters, options) {
        return (0, exports.MonitorDataSinkApiFp)(this.configuration).patchMonitorDataSink(requestParameters.monitorDataSinkID, requestParameters.monitorDataSinkUpdate, options).then((request) => request(this.axios, this.basePath));
    }
}
exports.MonitorDataSinkApi = MonitorDataSinkApi;
//# sourceMappingURL=monitor-data-sink-api.js.map