UNPKG

cloudflare

Version:

The official TypeScript library for the Cloudflare API

29 lines 1.16 kB
"use strict"; // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. Object.defineProperty(exports, "__esModule", { value: true }); exports.UsageModel = void 0; const resource_1 = require("cloudflare/resource"); class UsageModel extends resource_1.APIResource { /** * Updates the Usage Model for a given Worker. Requires a Workers Paid * subscription. */ update(scriptName, params, options) { const { account_id, body } = params; return this._client.put(`/accounts/${account_id}/workers/scripts/${scriptName}/usage-model`, { body: body, ...options, })._thenUnwrap((obj) => obj.result); } /** * Fetches the Usage Model for a given Worker. */ get(scriptName, params, options) { const { account_id } = params; return this._client.get(`/accounts/${account_id}/workers/scripts/${scriptName}/usage-model`, options)._thenUnwrap((obj) => obj.result); } } exports.UsageModel = UsageModel; (function (UsageModel) { })(UsageModel = exports.UsageModel || (exports.UsageModel = {})); //# sourceMappingURL=usage-model.js.map