cloudflare
Version:
The official TypeScript library for the Cloudflare API
32 lines • 1.39 kB
JavaScript
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
import { APIResource } from 'cloudflare/resource';
export class AlwaysOnline extends APIResource {
/**
* When enabled, Cloudflare serves limited copies of web pages available from the
* [Internet Archive's Wayback Machine](https://archive.org/web/) if your server is
* offline. Refer to
* [Always Online](https://developers.cloudflare.com/cache/about/always-online) for
* more information.
*/
edit(params, options) {
const { zone_id, ...body } = params;
return this._client.patch(`/zones/${zone_id}/settings/always_online`, {
body,
...options,
})._thenUnwrap((obj) => obj.result);
}
/**
* When enabled, Cloudflare serves limited copies of web pages available from the
* [Internet Archive's Wayback Machine](https://archive.org/web/) if your server is
* offline. Refer to
* [Always Online](https://developers.cloudflare.com/cache/about/always-online) for
* more information.
*/
get(params, options) {
const { zone_id } = params;
return this._client.get(`/zones/${zone_id}/settings/always_online`, options)._thenUnwrap((obj) => obj.result);
}
}
(function (AlwaysOnline) {
})(AlwaysOnline || (AlwaysOnline = {}));
//# sourceMappingURL=always-online.mjs.map