cloudflare/cloudflare-typescript
Publicmirrored fromhttps://github.com/cloudflare/cloudflare-typescriptAvailable
src/resources/cache/regional-tiered-cache.ts
160lines · modecode
| 1 | // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. |
| 2 | |
| 3 | import { APIResource } from '../../resource'; |
| 4 | import * as Core from '../../core'; |
| 5 | import * as RegionalTieredCacheAPI from './regional-tiered-cache'; |
| 6 | |
| 7 | export class RegionalTieredCacheResource 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 | * ID of the zone setting. |
| 46 | */ |
| 47 | export type RegionalTieredCache = 'tc_regional'; |
| 48 | |
| 49 | /** |
| 50 | * Instructs Cloudflare to check a regional hub data center on the way to your |
| 51 | * upper tier. This can help improve performance for smart and custom tiered cache |
| 52 | * topologies. |
| 53 | */ |
| 54 | export interface RegionalTieredCacheEditResponse { |
| 55 | /** |
| 56 | * ID of the zone setting. |
| 57 | */ |
| 58 | id: RegionalTieredCache; |
| 59 | |
| 60 | /** |
| 61 | * last time this setting was modified. |
| 62 | */ |
| 63 | modified_on: string | null; |
| 64 | |
| 65 | /** |
| 66 | * Instructs Cloudflare to check a regional hub data center on the way to your |
| 67 | * upper tier. This can help improve performance for smart and custom tiered cache |
| 68 | * topologies. |
| 69 | */ |
| 70 | value: RegionalTieredCacheEditResponse.Value; |
| 71 | } |
| 72 | |
| 73 | export namespace RegionalTieredCacheEditResponse { |
| 74 | /** |
| 75 | * Instructs Cloudflare to check a regional hub data center on the way to your |
| 76 | * upper tier. This can help improve performance for smart and custom tiered cache |
| 77 | * topologies. |
| 78 | */ |
| 79 | export interface Value { |
| 80 | /** |
| 81 | * ID of the zone setting. |
| 82 | */ |
| 83 | id: RegionalTieredCacheAPI.RegionalTieredCache; |
| 84 | |
| 85 | /** |
| 86 | * last time this setting was modified. |
| 87 | */ |
| 88 | modified_on: string | null; |
| 89 | } |
| 90 | } |
| 91 | |
| 92 | /** |
| 93 | * Instructs Cloudflare to check a regional hub data center on the way to your |
| 94 | * upper tier. This can help improve performance for smart and custom tiered cache |
| 95 | * topologies. |
| 96 | */ |
| 97 | export interface RegionalTieredCacheGetResponse { |
| 98 | /** |
| 99 | * ID of the zone setting. |
| 100 | */ |
| 101 | id: RegionalTieredCache; |
| 102 | |
| 103 | /** |
| 104 | * last time this setting was modified. |
| 105 | */ |
| 106 | modified_on: string | null; |
| 107 | |
| 108 | /** |
| 109 | * Instructs Cloudflare to check a regional hub data center on the way to your |
| 110 | * upper tier. This can help improve performance for smart and custom tiered cache |
| 111 | * topologies. |
| 112 | */ |
| 113 | value: RegionalTieredCacheGetResponse.Value; |
| 114 | } |
| 115 | |
| 116 | export namespace RegionalTieredCacheGetResponse { |
| 117 | /** |
| 118 | * Instructs Cloudflare to check a regional hub data center on the way to your |
| 119 | * upper tier. This can help improve performance for smart and custom tiered cache |
| 120 | * topologies. |
| 121 | */ |
| 122 | export interface Value { |
| 123 | /** |
| 124 | * ID of the zone setting. |
| 125 | */ |
| 126 | id: RegionalTieredCacheAPI.RegionalTieredCache; |
| 127 | |
| 128 | /** |
| 129 | * last time this setting was modified. |
| 130 | */ |
| 131 | modified_on: string | null; |
| 132 | } |
| 133 | } |
| 134 | |
| 135 | export interface RegionalTieredCacheEditParams { |
| 136 | /** |
| 137 | * Path param: Identifier |
| 138 | */ |
| 139 | zone_id: string; |
| 140 | |
| 141 | /** |
| 142 | * Body param: Value of the Regional Tiered Cache zone setting. |
| 143 | */ |
| 144 | value: 'on' | 'off'; |
| 145 | } |
| 146 | |
| 147 | export interface RegionalTieredCacheGetParams { |
| 148 | /** |
| 149 | * Identifier |
| 150 | */ |
| 151 | zone_id: string; |
| 152 | } |
| 153 | |
| 154 | export namespace RegionalTieredCacheResource { |
| 155 | export import RegionalTieredCache = RegionalTieredCacheAPI.RegionalTieredCache; |
| 156 | export import RegionalTieredCacheEditResponse = RegionalTieredCacheAPI.RegionalTieredCacheEditResponse; |
| 157 | export import RegionalTieredCacheGetResponse = RegionalTieredCacheAPI.RegionalTieredCacheGetResponse; |
| 158 | export import RegionalTieredCacheEditParams = RegionalTieredCacheAPI.RegionalTieredCacheEditParams; |
| 159 | export import RegionalTieredCacheGetParams = RegionalTieredCacheAPI.RegionalTieredCacheGetParams; |
| 160 | } |
| 161 | |