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/regional-tiered-cache.ts

119lines · 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 RegionalTieredCacheResource extends APIResource {
7 /**
8 * Instructs Cloudflare to check a regional hub data center on the way to your
9 * upper tier. This can help improve performance for smart and custom tiered cache
10 * topologies.
11 */
12 edit(
13 params: RegionalTieredCacheEditParams,
14 options?: Core.RequestOptions,
15 ): Core.APIPromise<RegionalTieredCacheEditResponse> {
16 const { zone_id, ...body } = params;
17 return (
18 this._client.patch(`/zones/${zone_id}/cache/regional_tiered_cache`, {
19 body,
20 ...options,
21 }) as Core.APIPromise<{ result: RegionalTieredCacheEditResponse }>
22 )._thenUnwrap((obj) => obj.result);
23 }
24
25 /**
26 * Instructs Cloudflare to check a regional hub data center on the way to your
27 * upper tier. This can help improve performance for smart and custom tiered cache
28 * topologies.
29 */
30 get(
31 params: RegionalTieredCacheGetParams,
32 options?: Core.RequestOptions,
33 ): Core.APIPromise<RegionalTieredCacheGetResponse> {
34 const { zone_id } = params;
35 return (
36 this._client.get(`/zones/${zone_id}/cache/regional_tiered_cache`, options) as Core.APIPromise<{
37 result: RegionalTieredCacheGetResponse;
38 }>
39 )._thenUnwrap((obj) => obj.result);
40 }
41}
42
43/**
44 * ID of the zone setting.
45 */
46export type RegionalTieredCache = 'tc_regional';
47
48export interface RegionalTieredCacheEditResponse {
49 /**
50 * ID of the zone setting.
51 */
52 id: RegionalTieredCache;
53
54 /**
55 * Whether the setting is editable
56 */
57 editable: boolean;
58
59 /**
60 * The value of the feature
61 */
62 value: 'on' | 'off';
63
64 /**
65 * Last time this setting was modified.
66 */
67 modified_on?: string | null;
68}
69
70export interface RegionalTieredCacheGetResponse {
71 /**
72 * ID of the zone setting.
73 */
74 id: RegionalTieredCache;
75
76 /**
77 * Whether the setting is editable
78 */
79 editable: boolean;
80
81 /**
82 * The value of the feature
83 */
84 value: 'on' | 'off';
85
86 /**
87 * Last time this setting was modified.
88 */
89 modified_on?: string | null;
90}
91
92export interface RegionalTieredCacheEditParams {
93 /**
94 * Path param: Identifier
95 */
96 zone_id: string;
97
98 /**
99 * Body param: Value of the Regional Tiered Cache zone setting.
100 */
101 value: 'on' | 'off';
102}
103
104export interface RegionalTieredCacheGetParams {
105 /**
106 * Identifier
107 */
108 zone_id: string;
109}
110
111export declare namespace RegionalTieredCacheResource {
112 export {
113 type RegionalTieredCache as RegionalTieredCache,
114 type RegionalTieredCacheEditResponse as RegionalTieredCacheEditResponse,
115 type RegionalTieredCacheGetResponse as RegionalTieredCacheGetResponse,
116 type RegionalTieredCacheEditParams as RegionalTieredCacheEditParams,
117 type RegionalTieredCacheGetParams as RegionalTieredCacheGetParams,
118 };
119}
120