cloudflare/cloudflare-typescript
Publicmirrored fromhttps://github.com/cloudflare/cloudflare-typescriptAvailable
src/resources/cache/smart-tiered-cache.ts
156lines · 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 SmartTieredCacheAPI from './smart-tiered-cache'; |
| 6 | |
| 7 | export class SmartTieredCache extends APIResource { |
| 8 | /** |
| 9 | * Remvoves enablement of Smart Tiered Cache |
| 10 | */ |
| 11 | delete( |
| 12 | params: SmartTieredCacheDeleteParams, |
| 13 | options?: Core.RequestOptions, |
| 14 | ): Core.APIPromise<SmartTieredCacheDeleteResponse> { |
| 15 | const { zone_id } = params; |
| 16 | return ( |
| 17 | this._client.delete( |
| 18 | `/zones/${zone_id}/cache/tiered_cache_smart_topology_enable`, |
| 19 | options, |
| 20 | ) as Core.APIPromise<{ result: SmartTieredCacheDeleteResponse }> |
| 21 | )._thenUnwrap((obj) => obj.result); |
| 22 | } |
| 23 | |
| 24 | /** |
| 25 | * Updates enablement of Tiered Cache |
| 26 | */ |
| 27 | edit( |
| 28 | params: SmartTieredCacheEditParams, |
| 29 | options?: Core.RequestOptions, |
| 30 | ): Core.APIPromise<SmartTieredCacheEditResponse> { |
| 31 | const { zone_id, ...body } = params; |
| 32 | return ( |
| 33 | this._client.patch(`/zones/${zone_id}/cache/tiered_cache_smart_topology_enable`, { |
| 34 | body, |
| 35 | ...options, |
| 36 | }) as Core.APIPromise<{ result: SmartTieredCacheEditResponse }> |
| 37 | )._thenUnwrap((obj) => obj.result); |
| 38 | } |
| 39 | |
| 40 | /** |
| 41 | * Get Smart Tiered Cache setting |
| 42 | */ |
| 43 | get( |
| 44 | params: SmartTieredCacheGetParams, |
| 45 | options?: Core.RequestOptions, |
| 46 | ): Core.APIPromise<SmartTieredCacheGetResponse> { |
| 47 | const { zone_id } = params; |
| 48 | return ( |
| 49 | this._client.get( |
| 50 | `/zones/${zone_id}/cache/tiered_cache_smart_topology_enable`, |
| 51 | options, |
| 52 | ) as Core.APIPromise<{ result: SmartTieredCacheGetResponse }> |
| 53 | )._thenUnwrap((obj) => obj.result); |
| 54 | } |
| 55 | } |
| 56 | |
| 57 | export interface SmartTieredCacheDeleteResponse { |
| 58 | /** |
| 59 | * The identifier of the caching setting |
| 60 | */ |
| 61 | id: string; |
| 62 | |
| 63 | /** |
| 64 | * Whether the setting is editable |
| 65 | */ |
| 66 | editable: boolean; |
| 67 | |
| 68 | /** |
| 69 | * The time when the setting was last modified |
| 70 | */ |
| 71 | modified_on: string; |
| 72 | |
| 73 | /** |
| 74 | * The status of the feature being on / off |
| 75 | */ |
| 76 | value: 'on' | 'off'; |
| 77 | } |
| 78 | |
| 79 | export interface SmartTieredCacheEditResponse { |
| 80 | /** |
| 81 | * The identifier of the caching setting |
| 82 | */ |
| 83 | id: string; |
| 84 | |
| 85 | /** |
| 86 | * Whether the setting is editable |
| 87 | */ |
| 88 | editable: boolean; |
| 89 | |
| 90 | /** |
| 91 | * The time when the setting was last modified |
| 92 | */ |
| 93 | modified_on: string; |
| 94 | |
| 95 | /** |
| 96 | * The status of the feature being on / off |
| 97 | */ |
| 98 | value: 'on' | 'off'; |
| 99 | } |
| 100 | |
| 101 | export interface SmartTieredCacheGetResponse { |
| 102 | /** |
| 103 | * The identifier of the caching setting |
| 104 | */ |
| 105 | id: string; |
| 106 | |
| 107 | /** |
| 108 | * Whether the setting is editable |
| 109 | */ |
| 110 | editable: boolean; |
| 111 | |
| 112 | /** |
| 113 | * The time when the setting was last modified |
| 114 | */ |
| 115 | modified_on: string; |
| 116 | |
| 117 | /** |
| 118 | * The status of the feature being on / off |
| 119 | */ |
| 120 | value: 'on' | 'off'; |
| 121 | } |
| 122 | |
| 123 | export interface SmartTieredCacheDeleteParams { |
| 124 | /** |
| 125 | * Identifier |
| 126 | */ |
| 127 | zone_id: string; |
| 128 | } |
| 129 | |
| 130 | export interface SmartTieredCacheEditParams { |
| 131 | /** |
| 132 | * Path param: Identifier |
| 133 | */ |
| 134 | zone_id: string; |
| 135 | |
| 136 | /** |
| 137 | * Body param: Enable or disable the Smart Tiered Cache |
| 138 | */ |
| 139 | value: 'on' | 'off'; |
| 140 | } |
| 141 | |
| 142 | export interface SmartTieredCacheGetParams { |
| 143 | /** |
| 144 | * Identifier |
| 145 | */ |
| 146 | zone_id: string; |
| 147 | } |
| 148 | |
| 149 | export namespace SmartTieredCache { |
| 150 | export import SmartTieredCacheDeleteResponse = SmartTieredCacheAPI.SmartTieredCacheDeleteResponse; |
| 151 | export import SmartTieredCacheEditResponse = SmartTieredCacheAPI.SmartTieredCacheEditResponse; |
| 152 | export import SmartTieredCacheGetResponse = SmartTieredCacheAPI.SmartTieredCacheGetResponse; |
| 153 | export import SmartTieredCacheDeleteParams = SmartTieredCacheAPI.SmartTieredCacheDeleteParams; |
| 154 | export import SmartTieredCacheEditParams = SmartTieredCacheAPI.SmartTieredCacheEditParams; |
| 155 | export import SmartTieredCacheGetParams = SmartTieredCacheAPI.SmartTieredCacheGetParams; |
| 156 | } |
| 157 | |