"use strict";
/* tslint:disable */
/* eslint-disable */
/**
 * KubeBlocks Cloud API
 * KubeBlocks Cloud API is a RESTful API for managing KubeBlocks Cloud resources.  The API is organized around REST.  Our API has predictable resource-oriented URLs, accepts `JSON-encoded` request bodies, returns `JSON-encoded` responses, and uses standard HTTP response codes, authentication, and verbs.  We use standard HTTP authentication and provide API keys to identify who you are. Your API keys carry many privileges, so be sure to keep them secret! Do not share your secret API keys in publicly accessible areas such as GitHub, client-side code, and so forth.
 *
 * 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.AlertReceiverApi = exports.AlertReceiverApiFactory = exports.AlertReceiverApiFp = exports.AlertReceiverApiAxiosParamCreator = 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");
/**
 * AlertReceiverApi - axios parameter creator
 * @export
 */
const AlertReceiverApiAxiosParamCreator = function (configuration) {
    return {
        /**
         *
         * @summary Create alert receiver
         * @param {string} orgName name of the Org
         * @param {AlertReceiverCategory} category alert receiver category
         * @param {AlertReceiver} body
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        createAlertReceiver: async (orgName, category, body, options = {}) => {
            // verify required parameter 'orgName' is not null or undefined
            (0, common_1.assertParamExists)('createAlertReceiver', 'orgName', orgName);
            // verify required parameter 'category' is not null or undefined
            (0, common_1.assertParamExists)('createAlertReceiver', 'category', category);
            // verify required parameter 'body' is not null or undefined
            (0, common_1.assertParamExists)('createAlertReceiver', 'body', body);
            const localVarPath = `/api/v1/organizations/{orgName}/receivers`
                .replace(`{${"orgName"}}`, encodeURIComponent(String(orgName)));
            // 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);
            if (category !== undefined) {
                localVarQueryParameter['category'] = category;
            }
            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 alert receiver
         * @param {string} orgName name of the Org
         * @param {string} receiverId id of the alert receivers
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        deleteAlertReceiver: async (orgName, receiverId, options = {}) => {
            // verify required parameter 'orgName' is not null or undefined
            (0, common_1.assertParamExists)('deleteAlertReceiver', 'orgName', orgName);
            // verify required parameter 'receiverId' is not null or undefined
            (0, common_1.assertParamExists)('deleteAlertReceiver', 'receiverId', receiverId);
            const localVarPath = `/api/v1/organizations/{orgName}/receivers/{receiverId}`
                .replace(`{${"orgName"}}`, encodeURIComponent(String(orgName)))
                .replace(`{${"receiverId"}}`, encodeURIComponent(String(receiverId)));
            // 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,
            };
        },
        /**
         *
         * @summary Get alert receiver
         * @param {string} orgName name of the Org
         * @param {string} receiverId id of the alert receivers
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        getAlertReceiver: async (orgName, receiverId, options = {}) => {
            // verify required parameter 'orgName' is not null or undefined
            (0, common_1.assertParamExists)('getAlertReceiver', 'orgName', orgName);
            // verify required parameter 'receiverId' is not null or undefined
            (0, common_1.assertParamExists)('getAlertReceiver', 'receiverId', receiverId);
            const localVarPath = `/api/v1/organizations/{orgName}/receivers/{receiverId}`
                .replace(`{${"orgName"}}`, encodeURIComponent(String(orgName)))
                .replace(`{${"receiverId"}}`, encodeURIComponent(String(receiverId)));
            // 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,
            };
        },
        /**
         *
         * @summary List alert receivers
         * @param {string} orgName name of the Org
         * @param {AlertReceiverCategory} [category] alert receiver category
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        listAlertReceivers: async (orgName, category, options = {}) => {
            // verify required parameter 'orgName' is not null or undefined
            (0, common_1.assertParamExists)('listAlertReceivers', 'orgName', orgName);
            const localVarPath = `/api/v1/organizations/{orgName}/receivers`
                .replace(`{${"orgName"}}`, encodeURIComponent(String(orgName)));
            // 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 (category !== undefined) {
                localVarQueryParameter['category'] = category;
            }
            (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,
            };
        },
        /**
         * partially update the alert receiver
         * @summary Update alert receiver
         * @param {string} orgName name of the Org
         * @param {string} receiverId id of the alert receivers
         * @param {AlertReceiver} body
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        patchAlertReceiver: async (orgName, receiverId, body, options = {}) => {
            // verify required parameter 'orgName' is not null or undefined
            (0, common_1.assertParamExists)('patchAlertReceiver', 'orgName', orgName);
            // verify required parameter 'receiverId' is not null or undefined
            (0, common_1.assertParamExists)('patchAlertReceiver', 'receiverId', receiverId);
            // verify required parameter 'body' is not null or undefined
            (0, common_1.assertParamExists)('patchAlertReceiver', 'body', body);
            const localVarPath = `/api/v1/organizations/{orgName}/receivers/{receiverId}`
                .replace(`{${"orgName"}}`, encodeURIComponent(String(orgName)))
                .replace(`{${"receiverId"}}`, encodeURIComponent(String(receiverId)));
            // 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.AlertReceiverApiAxiosParamCreator = AlertReceiverApiAxiosParamCreator;
/**
 * AlertReceiverApi - functional programming interface
 * @export
 */
const AlertReceiverApiFp = function (configuration) {
    const localVarAxiosParamCreator = (0, exports.AlertReceiverApiAxiosParamCreator)(configuration);
    return {
        /**
         *
         * @summary Create alert receiver
         * @param {string} orgName name of the Org
         * @param {AlertReceiverCategory} category alert receiver category
         * @param {AlertReceiver} body
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        async createAlertReceiver(orgName, category, body, options) {
            var _a, _b, _c;
            const localVarAxiosArgs = await localVarAxiosParamCreator.createAlertReceiver(orgName, category, 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['AlertReceiverApi.createAlertReceiver']) === 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 alert receiver
         * @param {string} orgName name of the Org
         * @param {string} receiverId id of the alert receivers
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        async deleteAlertReceiver(orgName, receiverId, options) {
            var _a, _b, _c;
            const localVarAxiosArgs = await localVarAxiosParamCreator.deleteAlertReceiver(orgName, receiverId, 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['AlertReceiverApi.deleteAlertReceiver']) === 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 Get alert receiver
         * @param {string} orgName name of the Org
         * @param {string} receiverId id of the alert receivers
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        async getAlertReceiver(orgName, receiverId, options) {
            var _a, _b, _c;
            const localVarAxiosArgs = await localVarAxiosParamCreator.getAlertReceiver(orgName, receiverId, 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['AlertReceiverApi.getAlertReceiver']) === 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 alert receivers
         * @param {string} orgName name of the Org
         * @param {AlertReceiverCategory} [category] alert receiver category
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        async listAlertReceivers(orgName, category, options) {
            var _a, _b, _c;
            const localVarAxiosArgs = await localVarAxiosParamCreator.listAlertReceivers(orgName, category, 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['AlertReceiverApi.listAlertReceivers']) === 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);
        },
        /**
         * partially update the alert receiver
         * @summary Update alert receiver
         * @param {string} orgName name of the Org
         * @param {string} receiverId id of the alert receivers
         * @param {AlertReceiver} body
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        async patchAlertReceiver(orgName, receiverId, body, options) {
            var _a, _b, _c;
            const localVarAxiosArgs = await localVarAxiosParamCreator.patchAlertReceiver(orgName, receiverId, 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['AlertReceiverApi.patchAlertReceiver']) === 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.AlertReceiverApiFp = AlertReceiverApiFp;
/**
 * AlertReceiverApi - factory interface
 * @export
 */
const AlertReceiverApiFactory = function (configuration, basePath, axios) {
    const localVarFp = (0, exports.AlertReceiverApiFp)(configuration);
    return {
        /**
         *
         * @summary Create alert receiver
         * @param {AlertReceiverApiCreateAlertReceiverRequest} requestParameters Request parameters.
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        createAlertReceiver(requestParameters, options) {
            return localVarFp.createAlertReceiver(requestParameters.orgName, requestParameters.category, requestParameters.body, options).then((request) => request(axios, basePath));
        },
        /**
         *
         * @summary Delete alert receiver
         * @param {AlertReceiverApiDeleteAlertReceiverRequest} requestParameters Request parameters.
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        deleteAlertReceiver(requestParameters, options) {
            return localVarFp.deleteAlertReceiver(requestParameters.orgName, requestParameters.receiverId, options).then((request) => request(axios, basePath));
        },
        /**
         *
         * @summary Get alert receiver
         * @param {AlertReceiverApiGetAlertReceiverRequest} requestParameters Request parameters.
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        getAlertReceiver(requestParameters, options) {
            return localVarFp.getAlertReceiver(requestParameters.orgName, requestParameters.receiverId, options).then((request) => request(axios, basePath));
        },
        /**
         *
         * @summary List alert receivers
         * @param {AlertReceiverApiListAlertReceiversRequest} requestParameters Request parameters.
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        listAlertReceivers(requestParameters, options) {
            return localVarFp.listAlertReceivers(requestParameters.orgName, requestParameters.category, options).then((request) => request(axios, basePath));
        },
        /**
         * partially update the alert receiver
         * @summary Update alert receiver
         * @param {AlertReceiverApiPatchAlertReceiverRequest} requestParameters Request parameters.
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        patchAlertReceiver(requestParameters, options) {
            return localVarFp.patchAlertReceiver(requestParameters.orgName, requestParameters.receiverId, requestParameters.body, options).then((request) => request(axios, basePath));
        },
    };
};
exports.AlertReceiverApiFactory = AlertReceiverApiFactory;
/**
 * AlertReceiverApi - object-oriented interface
 * @export
 * @class AlertReceiverApi
 * @extends {BaseAPI}
 */
class AlertReceiverApi extends base_1.BaseAPI {
    /**
     *
     * @summary Create alert receiver
     * @param {AlertReceiverApiCreateAlertReceiverRequest} requestParameters Request parameters.
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     * @memberof AlertReceiverApi
     */
    createAlertReceiver(requestParameters, options) {
        return (0, exports.AlertReceiverApiFp)(this.configuration).createAlertReceiver(requestParameters.orgName, requestParameters.category, requestParameters.body, options).then((request) => request(this.axios, this.basePath));
    }
    /**
     *
     * @summary Delete alert receiver
     * @param {AlertReceiverApiDeleteAlertReceiverRequest} requestParameters Request parameters.
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     * @memberof AlertReceiverApi
     */
    deleteAlertReceiver(requestParameters, options) {
        return (0, exports.AlertReceiverApiFp)(this.configuration).deleteAlertReceiver(requestParameters.orgName, requestParameters.receiverId, options).then((request) => request(this.axios, this.basePath));
    }
    /**
     *
     * @summary Get alert receiver
     * @param {AlertReceiverApiGetAlertReceiverRequest} requestParameters Request parameters.
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     * @memberof AlertReceiverApi
     */
    getAlertReceiver(requestParameters, options) {
        return (0, exports.AlertReceiverApiFp)(this.configuration).getAlertReceiver(requestParameters.orgName, requestParameters.receiverId, options).then((request) => request(this.axios, this.basePath));
    }
    /**
     *
     * @summary List alert receivers
     * @param {AlertReceiverApiListAlertReceiversRequest} requestParameters Request parameters.
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     * @memberof AlertReceiverApi
     */
    listAlertReceivers(requestParameters, options) {
        return (0, exports.AlertReceiverApiFp)(this.configuration).listAlertReceivers(requestParameters.orgName, requestParameters.category, options).then((request) => request(this.axios, this.basePath));
    }
    /**
     * partially update the alert receiver
     * @summary Update alert receiver
     * @param {AlertReceiverApiPatchAlertReceiverRequest} requestParameters Request parameters.
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     * @memberof AlertReceiverApi
     */
    patchAlertReceiver(requestParameters, options) {
        return (0, exports.AlertReceiverApiFp)(this.configuration).patchAlertReceiver(requestParameters.orgName, requestParameters.receiverId, requestParameters.body, options).then((request) => request(this.axios, this.basePath));
    }
}
exports.AlertReceiverApi = AlertReceiverApi;
//# sourceMappingURL=alert-receiver-api.js.map