cloudflare
Version:
The official TypeScript library for the Cloudflare API
46 lines • 2.04 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.Usage = exports.BaseUsage = void 0;
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
const resource_1 = require("../../../core/resource.js");
const path_1 = require("../../../internal/utils/path.js");
var BaseUsage = /* @__PURE__ */ (() => {
class BaseUsage extends resource_1.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((0, path_1.path) `/organizations/${organizationID}/billable/usage`, {
query,
...options,
})._thenUnwrap((obj) => obj.result);
}
}
BaseUsage._key = Object.freeze([
'organizations',
'billing',
'usage',
]);
return BaseUsage;
})();
exports.BaseUsage = BaseUsage;
class Usage extends BaseUsage {
}
exports.Usage = Usage;
//# sourceMappingURL=usage.js.map