UNPKG

orb-billing

Version:

The official TypeScript library for the Orb API

37 lines 1.45 kB
// 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 ExternalLicenses extends APIResource { /** * Returns usage and remaining credits for a license identified by its external * license ID. * * Resolves the currently active license with this external ID, i.e. the license * whose active window contains the current time. An external license ID can map to * multiple licenses over time, so if none is currently active (deactivated, window * ended, or not yet started) this returns a 404. To fetch usage for a license * regardless of active state, use the endpoint that takes Orb's internal license * ID. * * Date range defaults to the current billing period if not specified. * * @example * ```ts * const response = * await client.licenses.externalLicenses.getUsage( * 'external_license_id', * { * license_type_id: 'license_type_id', * subscription_id: 'subscription_id', * }, * ); * ``` */ getUsage(externalLicenseID, query, options) { return this._client.get(path `/licenses/external_licenses/${externalLicenseID}/usage`, { query, ...options, }); } } //# sourceMappingURL=external-licenses.mjs.map