"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.EventApi = exports.EventApiFactory = exports.EventApiFp = exports.EventApiAxiosParamCreator = 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");
/**
 * EventApi - axios parameter creator
 * @export
 */
const EventApiAxiosParamCreator = function (configuration) {
    return {
        /**
         * Retrieves detailed information about an event based on the provided Event ID.
         * @summary Query event detail by Event ID
         * @param {string} eventID Unique identifier for the event.
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        getEvent: async (eventID, options = {}) => {
            // verify required parameter 'eventID' is not null or undefined
            (0, common_1.assertParamExists)('getEvent', 'eventID', eventID);
            const localVarPath = `/admin/v1/events/{eventID}`
                .replace(`{${"eventID"}}`, encodeURIComponent(String(eventID)));
            // 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,
            };
        },
        /**
         * Query available filters for event listing
         * @summary Query available filters for event listing
         * @param {EventFilterType} filterType The event filter field you want to obtain.
         * @param {string} source The event filter you want to query from a certain source.
         * @param {number} start The start of the time range for the query, unit is seconds.
         * @param {number} end The end of the time range for the query, unit is seconds.
         * @param {string} [resourceType] The resource type you want to obtain.
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        getEventFilter: async (filterType, source, start, end, resourceType, options = {}) => {
            // verify required parameter 'filterType' is not null or undefined
            (0, common_1.assertParamExists)('getEventFilter', 'filterType', filterType);
            // verify required parameter 'source' is not null or undefined
            (0, common_1.assertParamExists)('getEventFilter', 'source', source);
            // verify required parameter 'start' is not null or undefined
            (0, common_1.assertParamExists)('getEventFilter', 'start', start);
            // verify required parameter 'end' is not null or undefined
            (0, common_1.assertParamExists)('getEventFilter', 'end', end);
            const localVarPath = `/admin/v1/eventfilter/{filterType}`
                .replace(`{${"filterType"}}`, encodeURIComponent(String(filterType)));
            // 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 (source !== undefined) {
                localVarQueryParameter['source'] = source;
            }
            if (resourceType !== undefined) {
                localVarQueryParameter['resourceType'] = resourceType;
            }
            if (start !== undefined) {
                localVarQueryParameter['start'] = start;
            }
            if (end !== undefined) {
                localVarQueryParameter['end'] = end;
            }
            (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,
            };
        },
        /**
         * List events
         * @summary List events
         * @param {number} start The start of the time range for the query, unit is seconds.
         * @param {number} end The end of the time range for the query, unit is seconds.
         * @param {EventResultStatus} [status] the status of the event
         * @param {string} [customQuery] Advanced query conditions, supporting all types of filterType. Such as \&quot;orgID:111 orgID:222 operatorID:333\&quot;
         * @param {number} [pageNumber] the pageNumber of the query
         * @param {number} [pageSize] the pageSize of the query
         * @param {string} [orderBy] A generic orderBy construct used to specify which field to sort by in the interface. (e.g., startTime or endTime).  The validity of this field is verified by the apiserver,  and it is not required in the YAML.
         * @param {boolean} [sortDesc] Specifies the sorting direction. &#x60;true&#x60; for descending, &#x60;false&#x60; for ascending.
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        listEvents: async (start, end, status, customQuery, pageNumber, pageSize, orderBy, sortDesc, options = {}) => {
            // verify required parameter 'start' is not null or undefined
            (0, common_1.assertParamExists)('listEvents', 'start', start);
            // verify required parameter 'end' is not null or undefined
            (0, common_1.assertParamExists)('listEvents', 'end', end);
            const localVarPath = `/admin/v1/events`;
            // 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 (status !== undefined) {
                localVarQueryParameter['status'] = status;
            }
            if (customQuery !== undefined) {
                localVarQueryParameter['customQuery'] = customQuery;
            }
            if (pageNumber !== undefined) {
                localVarQueryParameter['pageNumber'] = pageNumber;
            }
            if (pageSize !== undefined) {
                localVarQueryParameter['pageSize'] = pageSize;
            }
            if (start !== undefined) {
                localVarQueryParameter['start'] = start;
            }
            if (end !== undefined) {
                localVarQueryParameter['end'] = end;
            }
            if (orderBy !== undefined) {
                localVarQueryParameter['orderBy'] = orderBy;
            }
            if (sortDesc !== undefined) {
                localVarQueryParameter['sortDesc'] = sortDesc;
            }
            (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,
            };
        },
        /**
         * List events
         * @summary List events
         * @param {string} orgName Organization Name
         * @param {number} start The start of the time range for the query, unit is seconds.
         * @param {number} end The end of the time range for the query, unit is seconds.
         * @param {string} [customQuery] Advanced query conditions, supporting all types of filterType. Such as \&quot;operatorID:333 operatorID:444\&quot;
         * @param {EventResultStatus} [status] the status of the event
         * @param {number} [pageNumber] the pageNumber of the query
         * @param {number} [pageSize] the pageSize of the query
         * @param {string} [orderBy] A generic orderBy construct used to specify which field to sort by in the interface. (e.g., startTime or endTime).  The validity of this field is verified by the apiserver,  and it is not required in the YAML.
         * @param {boolean} [sortDesc] Specifies the sorting direction. &#x60;true&#x60; for descending, &#x60;false&#x60; for ascending.
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        listOrgEvents: async (orgName, start, end, customQuery, status, pageNumber, pageSize, orderBy, sortDesc, options = {}) => {
            // verify required parameter 'orgName' is not null or undefined
            (0, common_1.assertParamExists)('listOrgEvents', 'orgName', orgName);
            // verify required parameter 'start' is not null or undefined
            (0, common_1.assertParamExists)('listOrgEvents', 'start', start);
            // verify required parameter 'end' is not null or undefined
            (0, common_1.assertParamExists)('listOrgEvents', 'end', end);
            const localVarPath = `/admin/v1/organizations/{orgName}/events`
                .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 (customQuery !== undefined) {
                localVarQueryParameter['customQuery'] = customQuery;
            }
            if (status !== undefined) {
                localVarQueryParameter['status'] = status;
            }
            if (pageNumber !== undefined) {
                localVarQueryParameter['pageNumber'] = pageNumber;
            }
            if (pageSize !== undefined) {
                localVarQueryParameter['pageSize'] = pageSize;
            }
            if (start !== undefined) {
                localVarQueryParameter['start'] = start;
            }
            if (end !== undefined) {
                localVarQueryParameter['end'] = end;
            }
            if (orderBy !== undefined) {
                localVarQueryParameter['orderBy'] = orderBy;
            }
            if (sortDesc !== undefined) {
                localVarQueryParameter['sortDesc'] = sortDesc;
            }
            (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,
            };
        },
    };
};
exports.EventApiAxiosParamCreator = EventApiAxiosParamCreator;
/**
 * EventApi - functional programming interface
 * @export
 */
const EventApiFp = function (configuration) {
    const localVarAxiosParamCreator = (0, exports.EventApiAxiosParamCreator)(configuration);
    return {
        /**
         * Retrieves detailed information about an event based on the provided Event ID.
         * @summary Query event detail by Event ID
         * @param {string} eventID Unique identifier for the event.
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        async getEvent(eventID, options) {
            var _a, _b, _c;
            const localVarAxiosArgs = await localVarAxiosParamCreator.getEvent(eventID, 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['EventApi.getEvent']) === 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);
        },
        /**
         * Query available filters for event listing
         * @summary Query available filters for event listing
         * @param {EventFilterType} filterType The event filter field you want to obtain.
         * @param {string} source The event filter you want to query from a certain source.
         * @param {number} start The start of the time range for the query, unit is seconds.
         * @param {number} end The end of the time range for the query, unit is seconds.
         * @param {string} [resourceType] The resource type you want to obtain.
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        async getEventFilter(filterType, source, start, end, resourceType, options) {
            var _a, _b, _c;
            const localVarAxiosArgs = await localVarAxiosParamCreator.getEventFilter(filterType, source, start, end, resourceType, 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['EventApi.getEventFilter']) === 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);
        },
        /**
         * List events
         * @summary List events
         * @param {number} start The start of the time range for the query, unit is seconds.
         * @param {number} end The end of the time range for the query, unit is seconds.
         * @param {EventResultStatus} [status] the status of the event
         * @param {string} [customQuery] Advanced query conditions, supporting all types of filterType. Such as \&quot;orgID:111 orgID:222 operatorID:333\&quot;
         * @param {number} [pageNumber] the pageNumber of the query
         * @param {number} [pageSize] the pageSize of the query
         * @param {string} [orderBy] A generic orderBy construct used to specify which field to sort by in the interface. (e.g., startTime or endTime).  The validity of this field is verified by the apiserver,  and it is not required in the YAML.
         * @param {boolean} [sortDesc] Specifies the sorting direction. &#x60;true&#x60; for descending, &#x60;false&#x60; for ascending.
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        async listEvents(start, end, status, customQuery, pageNumber, pageSize, orderBy, sortDesc, options) {
            var _a, _b, _c;
            const localVarAxiosArgs = await localVarAxiosParamCreator.listEvents(start, end, status, customQuery, pageNumber, pageSize, orderBy, sortDesc, 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['EventApi.listEvents']) === 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);
        },
        /**
         * List events
         * @summary List events
         * @param {string} orgName Organization Name
         * @param {number} start The start of the time range for the query, unit is seconds.
         * @param {number} end The end of the time range for the query, unit is seconds.
         * @param {string} [customQuery] Advanced query conditions, supporting all types of filterType. Such as \&quot;operatorID:333 operatorID:444\&quot;
         * @param {EventResultStatus} [status] the status of the event
         * @param {number} [pageNumber] the pageNumber of the query
         * @param {number} [pageSize] the pageSize of the query
         * @param {string} [orderBy] A generic orderBy construct used to specify which field to sort by in the interface. (e.g., startTime or endTime).  The validity of this field is verified by the apiserver,  and it is not required in the YAML.
         * @param {boolean} [sortDesc] Specifies the sorting direction. &#x60;true&#x60; for descending, &#x60;false&#x60; for ascending.
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        async listOrgEvents(orgName, start, end, customQuery, status, pageNumber, pageSize, orderBy, sortDesc, options) {
            var _a, _b, _c;
            const localVarAxiosArgs = await localVarAxiosParamCreator.listOrgEvents(orgName, start, end, customQuery, status, pageNumber, pageSize, orderBy, sortDesc, 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['EventApi.listOrgEvents']) === 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.EventApiFp = EventApiFp;
/**
 * EventApi - factory interface
 * @export
 */
const EventApiFactory = function (configuration, basePath, axios) {
    const localVarFp = (0, exports.EventApiFp)(configuration);
    return {
        /**
         * Retrieves detailed information about an event based on the provided Event ID.
         * @summary Query event detail by Event ID
         * @param {EventApiGetEventRequest} requestParameters Request parameters.
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        getEvent(requestParameters, options) {
            return localVarFp.getEvent(requestParameters.eventID, options).then((request) => request(axios, basePath));
        },
        /**
         * Query available filters for event listing
         * @summary Query available filters for event listing
         * @param {EventApiGetEventFilterRequest} requestParameters Request parameters.
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        getEventFilter(requestParameters, options) {
            return localVarFp.getEventFilter(requestParameters.filterType, requestParameters.source, requestParameters.start, requestParameters.end, requestParameters.resourceType, options).then((request) => request(axios, basePath));
        },
        /**
         * List events
         * @summary List events
         * @param {EventApiListEventsRequest} requestParameters Request parameters.
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        listEvents(requestParameters, options) {
            return localVarFp.listEvents(requestParameters.start, requestParameters.end, requestParameters.status, requestParameters.customQuery, requestParameters.pageNumber, requestParameters.pageSize, requestParameters.orderBy, requestParameters.sortDesc, options).then((request) => request(axios, basePath));
        },
        /**
         * List events
         * @summary List events
         * @param {EventApiListOrgEventsRequest} requestParameters Request parameters.
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        listOrgEvents(requestParameters, options) {
            return localVarFp.listOrgEvents(requestParameters.orgName, requestParameters.start, requestParameters.end, requestParameters.customQuery, requestParameters.status, requestParameters.pageNumber, requestParameters.pageSize, requestParameters.orderBy, requestParameters.sortDesc, options).then((request) => request(axios, basePath));
        },
    };
};
exports.EventApiFactory = EventApiFactory;
/**
 * EventApi - object-oriented interface
 * @export
 * @class EventApi
 * @extends {BaseAPI}
 */
class EventApi extends base_1.BaseAPI {
    /**
     * Retrieves detailed information about an event based on the provided Event ID.
     * @summary Query event detail by Event ID
     * @param {EventApiGetEventRequest} requestParameters Request parameters.
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     * @memberof EventApi
     */
    getEvent(requestParameters, options) {
        return (0, exports.EventApiFp)(this.configuration).getEvent(requestParameters.eventID, options).then((request) => request(this.axios, this.basePath));
    }
    /**
     * Query available filters for event listing
     * @summary Query available filters for event listing
     * @param {EventApiGetEventFilterRequest} requestParameters Request parameters.
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     * @memberof EventApi
     */
    getEventFilter(requestParameters, options) {
        return (0, exports.EventApiFp)(this.configuration).getEventFilter(requestParameters.filterType, requestParameters.source, requestParameters.start, requestParameters.end, requestParameters.resourceType, options).then((request) => request(this.axios, this.basePath));
    }
    /**
     * List events
     * @summary List events
     * @param {EventApiListEventsRequest} requestParameters Request parameters.
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     * @memberof EventApi
     */
    listEvents(requestParameters, options) {
        return (0, exports.EventApiFp)(this.configuration).listEvents(requestParameters.start, requestParameters.end, requestParameters.status, requestParameters.customQuery, requestParameters.pageNumber, requestParameters.pageSize, requestParameters.orderBy, requestParameters.sortDesc, options).then((request) => request(this.axios, this.basePath));
    }
    /**
     * List events
     * @summary List events
     * @param {EventApiListOrgEventsRequest} requestParameters Request parameters.
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     * @memberof EventApi
     */
    listOrgEvents(requestParameters, options) {
        return (0, exports.EventApiFp)(this.configuration).listOrgEvents(requestParameters.orgName, requestParameters.start, requestParameters.end, requestParameters.customQuery, requestParameters.status, requestParameters.pageNumber, requestParameters.pageSize, requestParameters.orderBy, requestParameters.sortDesc, options).then((request) => request(this.axios, this.basePath));
    }
}
exports.EventApi = EventApi;
//# sourceMappingURL=event-api.js.map