cloudflare
Version:
The official TypeScript library for the Cloudflare API
25 lines • 984 B
JavaScript
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
import { APIResource } from 'cloudflare/resource';
export class UsageModel extends 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);
}
}
(function (UsageModel) {
})(UsageModel || (UsageModel = {}));
//# sourceMappingURL=usage-model.mjs.map