cloudflare
Version:
The official TypeScript library for the Cloudflare API
53 lines • 1.84 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.Retention = exports.BaseRetention = 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 BaseRetention = /* @__PURE__ */ (() => {
class BaseRetention extends resource_1.APIResource {
/**
* Updates log retention flag for Logpull API.
*
* @example
* ```ts
* const retention =
* await client.logs.control.retention.create({
* zone_id: '023e105f4ecef8ad9ca31a8372d0c353',
* });
* ```
*/
create(params, options) {
const { zone_id, ...body } = params;
return this._client.post((0, path_1.path) `/zones/${zone_id}/logs/control/retention/flag`, {
body,
...options,
})._thenUnwrap((obj) => obj.result);
}
/**
* Gets log retention flag for Logpull API.
*
* @example
* ```ts
* const retention = await client.logs.control.retention.get({
* zone_id: '023e105f4ecef8ad9ca31a8372d0c353',
* });
* ```
*/
get(params, options) {
const { zone_id } = params;
return this._client.get((0, path_1.path) `/zones/${zone_id}/logs/control/retention/flag`, options)._thenUnwrap((obj) => obj.result);
}
}
BaseRetention._key = Object.freeze([
'logs',
'control',
'retention',
]);
return BaseRetention;
})();
exports.BaseRetention = BaseRetention;
class Retention extends BaseRetention {
}
exports.Retention = Retention;
//# sourceMappingURL=retention.js.map