orb-billing
Version:
The official TypeScript library for the Orb API
41 lines • 1.46 kB
JavaScript
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
import { APIResource } from "../../core/resource.mjs";
import { path } from "../../internal/utils/path.mjs";
export class Usage extends 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(path `/licenses/${licenseID}/usage`, { query, ...options });
}
}
//# sourceMappingURL=usage.mjs.map