cloudflare/cloudflare-typescript

Public

mirrored fromhttps://github.com/cloudflare/cloudflare-typescriptAvailable

CodeCommitsIssuesPull requestsActionsInsightsSecurity
v3.0.0-beta.13

Branches

Tags

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

Clone

HTTPS

Download ZIP

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

154lines · modecode

1// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
3import * as Core from 'cloudflare/core';
4import { APIResource } from 'cloudflare/resource';
5import * as RegionalTieredCacheAPI from 'cloudflare/resources/cache/regional-tiered-cache';
6
7export class RegionalTieredCache extends APIResource {
8 /**
9 * Instructs Cloudflare to check a regional hub data center on the way to your
10 * upper tier. This can help improve performance for smart and custom tiered cache
11 * topologies.
12 */
13 edit(
14 params: RegionalTieredCacheEditParams,
15 options?: Core.RequestOptions,
16 ): Core.APIPromise<RegionalTieredCacheEditResponse> {
17 const { zone_id, ...body } = params;
18 return (
19 this._client.patch(`/zones/${zone_id}/cache/regional_tiered_cache`, {
20 body,
21 ...options,
22 }) as Core.APIPromise<{ result: RegionalTieredCacheEditResponse }>
23 )._thenUnwrap((obj) => obj.result);
24 }
25
26 /**
27 * Instructs Cloudflare to check a regional hub data center on the way to your
28 * upper tier. This can help improve performance for smart and custom tiered cache
29 * topologies.
30 */
31 get(
32 params: RegionalTieredCacheGetParams,
33 options?: Core.RequestOptions,
34 ): Core.APIPromise<RegionalTieredCacheGetResponse> {
35 const { zone_id } = params;
36 return (
37 this._client.get(`/zones/${zone_id}/cache/regional_tiered_cache`, options) as Core.APIPromise<{
38 result: RegionalTieredCacheGetResponse;
39 }>
40 )._thenUnwrap((obj) => obj.result);
41 }
42}
43
44/**
45 * Instructs Cloudflare to check a regional hub data center on the way to your
46 * upper tier. This can help improve performance for smart and custom tiered cache
47 * topologies.
48 */
49export interface RegionalTieredCacheEditResponse {
50 /**
51 * ID of the zone setting.
52 */
53 id: 'tc_regional';
54
55 /**
56 * last time this setting was modified.
57 */
58 modified_on: string | null;
59
60 /**
61 * Instructs Cloudflare to check a regional hub data center on the way to your
62 * upper tier. This can help improve performance for smart and custom tiered cache
63 * topologies.
64 */
65 value: RegionalTieredCacheEditResponse.Value;
66}
67
68export namespace RegionalTieredCacheEditResponse {
69 /**
70 * Instructs Cloudflare to check a regional hub data center on the way to your
71 * upper tier. This can help improve performance for smart and custom tiered cache
72 * topologies.
73 */
74 export interface Value {
75 /**
76 * ID of the zone setting.
77 */
78 id: 'tc_regional';
79
80 /**
81 * last time this setting was modified.
82 */
83 modified_on: string | null;
84 }
85}
86
87/**
88 * Instructs Cloudflare to check a regional hub data center on the way to your
89 * upper tier. This can help improve performance for smart and custom tiered cache
90 * topologies.
91 */
92export interface RegionalTieredCacheGetResponse {
93 /**
94 * ID of the zone setting.
95 */
96 id: 'tc_regional';
97
98 /**
99 * last time this setting was modified.
100 */
101 modified_on: string | null;
102
103 /**
104 * Instructs Cloudflare to check a regional hub data center on the way to your
105 * upper tier. This can help improve performance for smart and custom tiered cache
106 * topologies.
107 */
108 value: RegionalTieredCacheGetResponse.Value;
109}
110
111export namespace RegionalTieredCacheGetResponse {
112 /**
113 * Instructs Cloudflare to check a regional hub data center on the way to your
114 * upper tier. This can help improve performance for smart and custom tiered cache
115 * topologies.
116 */
117 export interface Value {
118 /**
119 * ID of the zone setting.
120 */
121 id: 'tc_regional';
122
123 /**
124 * last time this setting was modified.
125 */
126 modified_on: string | null;
127 }
128}
129
130export interface RegionalTieredCacheEditParams {
131 /**
132 * Path param: Identifier
133 */
134 zone_id: string;
135
136 /**
137 * Body param: Value of the Regional Tiered Cache zone setting.
138 */
139 value: 'on' | 'off';
140}
141
142export interface RegionalTieredCacheGetParams {
143 /**
144 * Identifier
145 */
146 zone_id: string;
147}
148
149export namespace RegionalTieredCache {
150 export import RegionalTieredCacheEditResponse = RegionalTieredCacheAPI.RegionalTieredCacheEditResponse;
151 export import RegionalTieredCacheGetResponse = RegionalTieredCacheAPI.RegionalTieredCacheGetResponse;
152 export import RegionalTieredCacheEditParams = RegionalTieredCacheAPI.RegionalTieredCacheEditParams;
153 export import RegionalTieredCacheGetParams = RegionalTieredCacheAPI.RegionalTieredCacheGetParams;
154}
155