cloudflare/cloudflare-typescript

Public

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

CodeCommitsIssuesPull requestsActionsInsightsSecurity
dee3057bf3dcc911bd6a16ad12f5c079ef887bcc

Branches

Tags

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

Clone

HTTPS

Download ZIP

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

101lines · 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 SmartTieredCacheAPI from 'cloudflare/resources/cache/smart-tiered-cache';
6
7export 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, body } = params;
16 return (
17 this._client.delete(`/zones/${zone_id}/cache/tiered_cache_smart_topology_enable`, {
18 body: body,
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
57export type SmartTieredCacheDeleteResponse = unknown | string | null;
58
59export type SmartTieredCacheEditResponse = unknown | string | null;
60
61export type SmartTieredCacheGetResponse = unknown | string | null;
62
63export interface SmartTieredCacheDeleteParams {
64 /**
65 * Path param: Identifier
66 */
67 zone_id: string;
68
69 /**
70 * Body param:
71 */
72 body: unknown;
73}
74
75export interface SmartTieredCacheEditParams {
76 /**
77 * Path param: Identifier
78 */
79 zone_id: string;
80
81 /**
82 * Body param: Enables Tiered Cache.
83 */
84 value: 'on' | 'off';
85}
86
87export interface SmartTieredCacheGetParams {
88 /**
89 * Identifier
90 */
91 zone_id: string;
92}
93
94export namespace SmartTieredCache {
95 export import SmartTieredCacheDeleteResponse = SmartTieredCacheAPI.SmartTieredCacheDeleteResponse;
96 export import SmartTieredCacheEditResponse = SmartTieredCacheAPI.SmartTieredCacheEditResponse;
97 export import SmartTieredCacheGetResponse = SmartTieredCacheAPI.SmartTieredCacheGetResponse;
98 export import SmartTieredCacheDeleteParams = SmartTieredCacheAPI.SmartTieredCacheDeleteParams;
99 export import SmartTieredCacheEditParams = SmartTieredCacheAPI.SmartTieredCacheEditParams;
100 export import SmartTieredCacheGetParams = SmartTieredCacheAPI.SmartTieredCacheGetParams;
101}
102