orb-billing
Version:
The official TypeScript library for the Orb API
45 lines • 1.59 kB
JavaScript
;
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
Object.defineProperty(exports, "__esModule", { value: true });
exports.Usage = void 0;
const resource_1 = require("../../core/resource.js");
const path_1 = require("../../internal/utils/path.js");
class Usage extends resource_1.APIResource {
/**
* Returns usage and remaining credits for all licenses of a given type on a
* subscription.
*
* Date range defaults to the current billing period if not specified.
*
* @example
* ```ts
* const response = await client.licenses.usage.getAllUsage({
* license_type_id: 'license_type_id',
* subscription_id: 'subscription_id',
* });
* ```
*/
getAllUsage(query, options) {
return this._client.get('/licenses/usage', { query, ...options });
}
/**
* Returns usage and remaining credits for a specific license over a date range.
*
* Resolves the license by ID regardless of whether it is currently active, unlike
* the external-license-ID variant, which only resolves a currently active license.
*
* Date range defaults to the current billing period if not specified.
*
* @example
* ```ts
* const response = await client.licenses.usage.getUsage(
* 'license_id',
* );
* ```
*/
getUsage(licenseID, query = {}, options) {
return this._client.get((0, path_1.path) `/licenses/${licenseID}/usage`, { query, ...options });
}
}
exports.Usage = Usage;
//# sourceMappingURL=usage.js.map