cloudflare
Version:
The official TypeScript library for the Cloudflare API
107 lines • 5.09 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.SmartTieredCache = exports.BaseSmartTieredCache = 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 BaseSmartTieredCache = /* @__PURE__ */ (() => {
class BaseSmartTieredCache extends resource_1.APIResource {
/**
* Smart Tiered Cache dynamically selects the single closest upper tier for each of
* your website's origins with no configuration required, using our in-house
* performance and routing data. Cloudflare collects latency data for each request
* to an origin, and uses the latency data to determine how well any upper-tier
* data center is connected with an origin. As a result, Cloudflare can select the
* data center with the lowest latency to be the upper-tier for an origin.
*
* @example
* ```ts
* const smartTieredCache =
* await client.cache.smartTieredCache.create({
* zone_id: '023e105f4ecef8ad9ca31a8372d0c353',
* value: 'on',
* });
* ```
*/
create(params, options) {
const { zone_id, ...body } = params;
return this._client.post((0, path_1.path) `/zones/${zone_id}/cache/tiered_cache_smart_topology_enable`, {
body,
...options,
})._thenUnwrap((obj) => obj.result);
}
/**
* Smart Tiered Cache dynamically selects the single closest upper tier for each of
* your website’s origins with no configuration required, using our in-house
* performance and routing data. Cloudflare collects latency data for each request
* to an origin, and uses the latency data to determine how well any upper-tier
* data center is connected with an origin. As a result, Cloudflare can select the
* data center with the lowest latency to be the upper-tier for an origin.
*
* @example
* ```ts
* const smartTieredCache =
* await client.cache.smartTieredCache.delete({
* zone_id: '023e105f4ecef8ad9ca31a8372d0c353',
* });
* ```
*/
delete(params, options) {
const { zone_id } = params;
return this._client.delete((0, path_1.path) `/zones/${zone_id}/cache/tiered_cache_smart_topology_enable`, options)._thenUnwrap((obj) => obj.result);
}
/**
* Smart Tiered Cache dynamically selects the single closest upper tier for each of
* your website’s origins with no configuration required, using our in-house
* performance and routing data. Cloudflare collects latency data for each request
* to an origin, and uses the latency data to determine how well any upper-tier
* data center is connected with an origin. As a result, Cloudflare can select the
* data center with the lowest latency to be the upper-tier for an origin.
*
* @example
* ```ts
* const response = await client.cache.smartTieredCache.edit({
* zone_id: '023e105f4ecef8ad9ca31a8372d0c353',
* value: 'on',
* });
* ```
*/
edit(params, options) {
const { zone_id, ...body } = params;
return this._client.patch((0, path_1.path) `/zones/${zone_id}/cache/tiered_cache_smart_topology_enable`, {
body,
...options,
})._thenUnwrap((obj) => obj.result);
}
/**
* Smart Tiered Cache dynamically selects the single closest upper tier for each of
* your website’s origins with no configuration required, using our in-house
* performance and routing data. Cloudflare collects latency data for each request
* to an origin, and uses the latency data to determine how well any upper-tier
* data center is connected with an origin. As a result, Cloudflare can select the
* data center with the lowest latency to be the upper-tier for an origin.
*
* @example
* ```ts
* const smartTieredCache =
* await client.cache.smartTieredCache.get({
* zone_id: '023e105f4ecef8ad9ca31a8372d0c353',
* });
* ```
*/
get(params, options) {
const { zone_id } = params;
return this._client.get((0, path_1.path) `/zones/${zone_id}/cache/tiered_cache_smart_topology_enable`, options)._thenUnwrap((obj) => obj.result);
}
}
BaseSmartTieredCache._key = Object.freeze([
'cache',
'smartTieredCache',
]);
return BaseSmartTieredCache;
})();
exports.BaseSmartTieredCache = BaseSmartTieredCache;
class SmartTieredCache extends BaseSmartTieredCache {
}
exports.SmartTieredCache = SmartTieredCache;
//# sourceMappingURL=smart-tiered-cache.js.map