@coveo/platform-client
Version:
The main goal of this package is to provide an easy to configure and straightforward way of querying Coveo Cloud APIs using JavaScript.
33 lines • 1.62 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
const tslib_1 = require("tslib");
const APICore_js_1 = tslib_1.__importDefault(require("../../APICore.js"));
const Resource_js_1 = tslib_1.__importDefault(require("../Resource.js"));
class Limits extends Resource_js_1.default {
static getBaseUrl = () => `/rest/organizations/${APICore_js_1.default.orgPlaceholder}/limits`;
static getWithSection = (sectionName) => `${Limits.getBaseUrl()}/${sectionName}`;
static getWithSectionAndHistory = (sectionName, limitKey) => `${Limits.getWithSection(sectionName)}/${limitKey}/history`;
static getSpecificLimit = (sectionName, limitKey) => `${Limits.getWithSection(sectionName)}/${limitKey}`;
get(sectionName) {
return this.api.get(Limits.getWithSection(sectionName));
}
getAll() {
return this.api.get(Limits.getBaseUrl());
}
getAllPerLimitType(limitType) {
return this.api.get(this.buildPath(Limits.getBaseUrl(), { limitType: limitType }));
}
/**
* Shows the status of a specific limit in an organization
* @param sectionName The name of the target license section
* @param limitKey The unique identifier of the target limit status to show
*/
getSpecificLimitStatus(sectionName, limitKey) {
return this.api.get(Limits.getSpecificLimit(sectionName, limitKey));
}
getHistoryLimit(sectionName, limitKey, options) {
return this.api.get(this.buildPath(Limits.getWithSectionAndHistory(sectionName, limitKey), options));
}
}
exports.default = Limits;
//# sourceMappingURL=Limits.js.map