"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.MeteringApi = exports.MeteringApiFactory = exports.MeteringApiFp = exports.MeteringApiAxiosParamCreator = 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");
/**
 * MeteringApi - axios parameter creator
 * @export
 */
const MeteringApiAxiosParamCreator = function (configuration) {
    return {
        /**
         *
         * @summary List metering tracks
         * @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} [clusterID] The ID of the cluster
         * @param {string} [orgName] Name of organization
         * @param {string} [projectName] name of the project
         * @param {string} [environmentName] The name of the environment
         * @param {number} [pageNumber] the pageNumber of the query
         * @param {number} [pageSize] the pageSize of the query
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        listMeteringTracks: async (start, end, clusterID, orgName, projectName, environmentName, pageNumber, pageSize, options = {}) => {
            // verify required parameter 'start' is not null or undefined
            (0, common_1.assertParamExists)('listMeteringTracks', 'start', start);
            // verify required parameter 'end' is not null or undefined
            (0, common_1.assertParamExists)('listMeteringTracks', 'end', end);
            const localVarPath = `/admin/v1/metering/tracks`;
            // 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 (clusterID !== undefined) {
                localVarQueryParameter['clusterID'] = clusterID;
            }
            if (orgName !== undefined) {
                localVarQueryParameter['orgName'] = orgName;
            }
            if (projectName !== undefined) {
                localVarQueryParameter['projectName'] = projectName;
            }
            if (environmentName !== undefined) {
                localVarQueryParameter['environmentName'] = environmentName;
            }
            if (pageNumber !== undefined) {
                localVarQueryParameter['pageNumber'] = pageNumber;
            }
            if (pageSize !== undefined) {
                localVarQueryParameter['pageSize'] = pageSize;
            }
            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,
            };
        },
    };
};
exports.MeteringApiAxiosParamCreator = MeteringApiAxiosParamCreator;
/**
 * MeteringApi - functional programming interface
 * @export
 */
const MeteringApiFp = function (configuration) {
    const localVarAxiosParamCreator = (0, exports.MeteringApiAxiosParamCreator)(configuration);
    return {
        /**
         *
         * @summary List metering tracks
         * @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} [clusterID] The ID of the cluster
         * @param {string} [orgName] Name of organization
         * @param {string} [projectName] name of the project
         * @param {string} [environmentName] The name of the environment
         * @param {number} [pageNumber] the pageNumber of the query
         * @param {number} [pageSize] the pageSize of the query
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        async listMeteringTracks(start, end, clusterID, orgName, projectName, environmentName, pageNumber, pageSize, options) {
            var _a, _b, _c;
            const localVarAxiosArgs = await localVarAxiosParamCreator.listMeteringTracks(start, end, clusterID, orgName, projectName, environmentName, pageNumber, 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['MeteringApi.listMeteringTracks']) === 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.MeteringApiFp = MeteringApiFp;
/**
 * MeteringApi - factory interface
 * @export
 */
const MeteringApiFactory = function (configuration, basePath, axios) {
    const localVarFp = (0, exports.MeteringApiFp)(configuration);
    return {
        /**
         *
         * @summary List metering tracks
         * @param {MeteringApiListMeteringTracksRequest} requestParameters Request parameters.
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        listMeteringTracks(requestParameters, options) {
            return localVarFp.listMeteringTracks(requestParameters.start, requestParameters.end, requestParameters.clusterID, requestParameters.orgName, requestParameters.projectName, requestParameters.environmentName, requestParameters.pageNumber, requestParameters.pageSize, options).then((request) => request(axios, basePath));
        },
    };
};
exports.MeteringApiFactory = MeteringApiFactory;
/**
 * MeteringApi - object-oriented interface
 * @export
 * @class MeteringApi
 * @extends {BaseAPI}
 */
class MeteringApi extends base_1.BaseAPI {
    /**
     *
     * @summary List metering tracks
     * @param {MeteringApiListMeteringTracksRequest} requestParameters Request parameters.
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     * @memberof MeteringApi
     */
    listMeteringTracks(requestParameters, options) {
        return (0, exports.MeteringApiFp)(this.configuration).listMeteringTracks(requestParameters.start, requestParameters.end, requestParameters.clusterID, requestParameters.orgName, requestParameters.projectName, requestParameters.environmentName, requestParameters.pageNumber, requestParameters.pageSize, options).then((request) => request(this.axios, this.basePath));
    }
}
exports.MeteringApi = MeteringApi;
//# sourceMappingURL=metering-api.js.map