"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.AlertObjectApi = exports.AlertObjectApiFactory = exports.AlertObjectApiFp = exports.AlertObjectApiAxiosParamCreator = 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");
/**
 * AlertObjectApi - axios parameter creator
 * @export
 */
const AlertObjectApiAxiosParamCreator = function (configuration) {
    return {
        /**
         *
         * @summary List alert objects
         * @param {number} [page] page number
         * @param {number} [pageSize] page size
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        listAlertObjects: async (page, pageSize, options = {}) => {
            const localVarPath = `/admin/v1/alerts/objects`;
            // 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 (page !== undefined) {
                localVarQueryParameter['page'] = page;
            }
            if (pageSize !== undefined) {
                localVarQueryParameter['pageSize'] = pageSize;
            }
            (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 Set alert object status
         * @param {string} alertId alert id
         * @param {string} status
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        setAlertObjectStatus: async (alertId, status, options = {}) => {
            // verify required parameter 'alertId' is not null or undefined
            (0, common_1.assertParamExists)('setAlertObjectStatus', 'alertId', alertId);
            // verify required parameter 'status' is not null or undefined
            (0, common_1.assertParamExists)('setAlertObjectStatus', 'status', status);
            const localVarPath = `/admin/v1/alerts/objects/{alertId}`
                .replace(`{${"alertId"}}`, encodeURIComponent(String(alertId)));
            // 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);
            if (status !== undefined) {
                localVarQueryParameter['status'] = status;
            }
            (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 Set alert objects status
         * @param {string} status
         * @param {Array<AlertObject>} [alertObject]
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        setAlertObjectsStatus: async (status, alertObject, options = {}) => {
            // verify required parameter 'status' is not null or undefined
            (0, common_1.assertParamExists)('setAlertObjectsStatus', 'status', status);
            const localVarPath = `/admin/v1/alerts/objects`;
            // 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);
            if (status !== undefined) {
                localVarQueryParameter['status'] = status;
            }
            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)(alertObject, localVarRequestOptions, configuration);
            return {
                url: (0, common_1.toPathString)(localVarUrlObj),
                options: localVarRequestOptions,
            };
        },
    };
};
exports.AlertObjectApiAxiosParamCreator = AlertObjectApiAxiosParamCreator;
/**
 * AlertObjectApi - functional programming interface
 * @export
 */
const AlertObjectApiFp = function (configuration) {
    const localVarAxiosParamCreator = (0, exports.AlertObjectApiAxiosParamCreator)(configuration);
    return {
        /**
         *
         * @summary List alert objects
         * @param {number} [page] page number
         * @param {number} [pageSize] page size
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        async listAlertObjects(page, pageSize, options) {
            var _a, _b, _c;
            const localVarAxiosArgs = await localVarAxiosParamCreator.listAlertObjects(page, pageSize, 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['AlertObjectApi.listAlertObjects']) === 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 Set alert object status
         * @param {string} alertId alert id
         * @param {string} status
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        async setAlertObjectStatus(alertId, status, options) {
            var _a, _b, _c;
            const localVarAxiosArgs = await localVarAxiosParamCreator.setAlertObjectStatus(alertId, status, 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['AlertObjectApi.setAlertObjectStatus']) === 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 Set alert objects status
         * @param {string} status
         * @param {Array<AlertObject>} [alertObject]
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        async setAlertObjectsStatus(status, alertObject, options) {
            var _a, _b, _c;
            const localVarAxiosArgs = await localVarAxiosParamCreator.setAlertObjectsStatus(status, alertObject, 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['AlertObjectApi.setAlertObjectsStatus']) === 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.AlertObjectApiFp = AlertObjectApiFp;
/**
 * AlertObjectApi - factory interface
 * @export
 */
const AlertObjectApiFactory = function (configuration, basePath, axios) {
    const localVarFp = (0, exports.AlertObjectApiFp)(configuration);
    return {
        /**
         *
         * @summary List alert objects
         * @param {AlertObjectApiListAlertObjectsRequest} requestParameters Request parameters.
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        listAlertObjects(requestParameters = {}, options) {
            return localVarFp.listAlertObjects(requestParameters.page, requestParameters.pageSize, options).then((request) => request(axios, basePath));
        },
        /**
         *
         * @summary Set alert object status
         * @param {AlertObjectApiSetAlertObjectStatusRequest} requestParameters Request parameters.
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        setAlertObjectStatus(requestParameters, options) {
            return localVarFp.setAlertObjectStatus(requestParameters.alertId, requestParameters.status, options).then((request) => request(axios, basePath));
        },
        /**
         *
         * @summary Set alert objects status
         * @param {AlertObjectApiSetAlertObjectsStatusRequest} requestParameters Request parameters.
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        setAlertObjectsStatus(requestParameters, options) {
            return localVarFp.setAlertObjectsStatus(requestParameters.status, requestParameters.alertObject, options).then((request) => request(axios, basePath));
        },
    };
};
exports.AlertObjectApiFactory = AlertObjectApiFactory;
/**
 * AlertObjectApi - object-oriented interface
 * @export
 * @class AlertObjectApi
 * @extends {BaseAPI}
 */
class AlertObjectApi extends base_1.BaseAPI {
    /**
     *
     * @summary List alert objects
     * @param {AlertObjectApiListAlertObjectsRequest} requestParameters Request parameters.
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     * @memberof AlertObjectApi
     */
    listAlertObjects(requestParameters = {}, options) {
        return (0, exports.AlertObjectApiFp)(this.configuration).listAlertObjects(requestParameters.page, requestParameters.pageSize, options).then((request) => request(this.axios, this.basePath));
    }
    /**
     *
     * @summary Set alert object status
     * @param {AlertObjectApiSetAlertObjectStatusRequest} requestParameters Request parameters.
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     * @memberof AlertObjectApi
     */
    setAlertObjectStatus(requestParameters, options) {
        return (0, exports.AlertObjectApiFp)(this.configuration).setAlertObjectStatus(requestParameters.alertId, requestParameters.status, options).then((request) => request(this.axios, this.basePath));
    }
    /**
     *
     * @summary Set alert objects status
     * @param {AlertObjectApiSetAlertObjectsStatusRequest} requestParameters Request parameters.
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     * @memberof AlertObjectApi
     */
    setAlertObjectsStatus(requestParameters, options) {
        return (0, exports.AlertObjectApiFp)(this.configuration).setAlertObjectsStatus(requestParameters.status, requestParameters.alertObject, options).then((request) => request(this.axios, this.basePath));
    }
}
exports.AlertObjectApi = AlertObjectApi;
//# sourceMappingURL=alert-object-api.js.map