cloudflare/cloudflare-typescript

Public

mirrored from https://github.com/cloudflare/cloudflare-typescriptAvailable

CodeCommitsIssuesPull requestsActionsInsightsSecurity
v4.2.0

Branches

Tags

  • No tags available.
0Branches0Tags
Go to file
Add file
Code

Clone

HTTPS

Download ZIP

src/resources/cache/smart-tiered-cache.ts

167lines · modecode

1// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
3import { APIResource } from '../../resource';
4import * as Core from '../../core';
5
6export class SmartTieredCache extends APIResource {
7 /**
8 * Smart Tiered Cache dynamically selects the single closest upper tier for each of
9 * your website’s origins with no configuration required, using our in-house
10 * performance and routing data. Cloudflare collects latency data for each request
11 * to an origin, and uses the latency data to determine how well any upper-tier
12 * data center is connected with an origin. As a result, Cloudflare can select the
13 * data center with the lowest latency to be the upper-tier for an origin.
14 */
15 delete(
16 params: SmartTieredCacheDeleteParams,
17 options?: Core.RequestOptions,
18 ): Core.APIPromise<SmartTieredCacheDeleteResponse> {
19 const { zone_id } = params;
20 return (
21 this._client.delete(
22 `/zones/${zone_id}/cache/tiered_cache_smart_topology_enable`,
23 options,
24 ) as Core.APIPromise<{ result: SmartTieredCacheDeleteResponse }>
25 )._thenUnwrap((obj) => obj.result);
26 }
27
28 /**
29 * Smart Tiered Cache dynamically selects the single closest upper tier for each of
30 * your website’s origins with no configuration required, using our in-house
31 * performance and routing data. Cloudflare collects latency data for each request
32 * to an origin, and uses the latency data to determine how well any upper-tier
33 * data center is connected with an origin. As a result, Cloudflare can select the
34 * data center with the lowest latency to be the upper-tier for an origin.
35 */
36 edit(
37 params: SmartTieredCacheEditParams,
38 options?: Core.RequestOptions,
39 ): Core.APIPromise<SmartTieredCacheEditResponse> {
40 const { zone_id, ...body } = params;
41 return (
42 this._client.patch(`/zones/${zone_id}/cache/tiered_cache_smart_topology_enable`, {
43 body,
44 ...options,
45 }) as Core.APIPromise<{ result: SmartTieredCacheEditResponse }>
46 )._thenUnwrap((obj) => obj.result);
47 }
48
49 /**
50 * Smart Tiered Cache dynamically selects the single closest upper tier for each of
51 * your website’s origins with no configuration required, using our in-house
52 * performance and routing data. Cloudflare collects latency data for each request
53 * to an origin, and uses the latency data to determine how well any upper-tier
54 * data center is connected with an origin. As a result, Cloudflare can select the
55 * data center with the lowest latency to be the upper-tier for an origin.
56 */
57 get(
58 params: SmartTieredCacheGetParams,
59 options?: Core.RequestOptions,
60 ): Core.APIPromise<SmartTieredCacheGetResponse> {
61 const { zone_id } = params;
62 return (
63 this._client.get(
64 `/zones/${zone_id}/cache/tiered_cache_smart_topology_enable`,
65 options,
66 ) as Core.APIPromise<{ result: SmartTieredCacheGetResponse }>
67 )._thenUnwrap((obj) => obj.result);
68 }
69}
70
71export interface SmartTieredCacheDeleteResponse {
72 /**
73 * ID of the zone setting.
74 */
75 id: 'tiered_cache_smart_topology_enable';
76
77 /**
78 * Whether the setting is editable
79 */
80 editable: boolean;
81
82 /**
83 * Last time this setting was modified.
84 */
85 modified_on?: string | null;
86}
87
88export interface SmartTieredCacheEditResponse {
89 /**
90 * ID of the zone setting.
91 */
92 id: 'tiered_cache_smart_topology_enable';
93
94 /**
95 * Whether the setting is editable
96 */
97 editable: boolean;
98
99 /**
100 * The value of the feature
101 */
102 value: 'on' | 'off';
103
104 /**
105 * Last time this setting was modified.
106 */
107 modified_on?: string | null;
108}
109
110export interface SmartTieredCacheGetResponse {
111 /**
112 * ID of the zone setting.
113 */
114 id: 'tiered_cache_smart_topology_enable';
115
116 /**
117 * Whether the setting is editable
118 */
119 editable: boolean;
120
121 /**
122 * The value of the feature
123 */
124 value: 'on' | 'off';
125
126 /**
127 * Last time this setting was modified.
128 */
129 modified_on?: string | null;
130}
131
132export interface SmartTieredCacheDeleteParams {
133 /**
134 * Identifier
135 */
136 zone_id: string;
137}
138
139export interface SmartTieredCacheEditParams {
140 /**
141 * Path param: Identifier
142 */
143 zone_id: string;
144
145 /**
146 * Body param: Enable or disable the Smart Tiered Cache
147 */
148 value: 'on' | 'off';
149}
150
151export interface SmartTieredCacheGetParams {
152 /**
153 * Identifier
154 */
155 zone_id: string;
156}
157
158export declare namespace SmartTieredCache {
159 export {
160 type SmartTieredCacheDeleteResponse as SmartTieredCacheDeleteResponse,
161 type SmartTieredCacheEditResponse as SmartTieredCacheEditResponse,
162 type SmartTieredCacheGetResponse as SmartTieredCacheGetResponse,
163 type SmartTieredCacheDeleteParams as SmartTieredCacheDeleteParams,
164 type SmartTieredCacheEditParams as SmartTieredCacheEditParams,
165 type SmartTieredCacheGetParams as SmartTieredCacheGetParams,
166 };
167}
168