cloudflare
Version:
The official TypeScript library for the Cloudflare API
41 lines • 1.85 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 var BaseUsage = /* @__PURE__ */ (() => {
class BaseUsage extends APIResource {
/**
* Returns cost and usage data for all accounts within an organization, aligned
* with the [FinOps FOCUS v1.3](https://focus.finops.org/focus-specification/v1-3/)
* Cost and Usage dataset specification.
*
* Each record represents one billable metric for one account on one day. This
* includes all metered usage, including usage that falls within free-tier
* allowances and may result in zero cost. The response includes usage for every
* account belonging to the specified organization.
*
* **Note:** Cost and pricing fields are not yet populated and will be absent from
* responses until billing integration is complete.
*
* When `from` and `to` are omitted, defaults to the start of the current month
* through today. The maximum date range is 31 days.
*
* An organization with no accounts, or an organization ID that does not exist,
* returns a successful response with an empty result set rather than an error.
*/
get(organizationID, query = {}, options) {
return this._client.get(path `/organizations/${organizationID}/billable/usage`, {
query,
...options,
})._thenUnwrap((obj) => obj.result);
}
}
BaseUsage._key = Object.freeze([
'organizations',
'billing',
'usage',
]);
return BaseUsage;
})();
export class Usage extends BaseUsage {
}
//# sourceMappingURL=usage.mjs.map