@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.
29 lines • 1.39 kB
JavaScript
import API from '../../APICore.js';
import Resource from '../Resource.js';
export default class Limits extends Resource {
static getBaseUrl = () => `/rest/organizations/${API.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));
}
}
//# sourceMappingURL=Limits.js.map