cloudflare/cloudflare-typescript

Public

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

CodeCommitsIssuesPull requestsActionsInsightsSecurity
7609e84ab3db53e79aefce6a112e90cb2a2bbba0

Branches

Tags

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

Clone

HTTPS

Download ZIP

src/resources/cache/cache-reserves.ts

106lines · modecode

1// File generated from our OpenAPI spec by Stainless.
2
3import * as Core from 'cloudflare/core';
4import { APIResource } from 'cloudflare/resource';
5import * as CacheReservesAPI from 'cloudflare/resources/cache/cache-reserves';
6
7export class CacheReserves extends APIResource {
8 /**
9 * Increase cache lifetimes by automatically storing all cacheable files into
10 * Cloudflare's persistent object storage buckets. Requires Cache Reserve
11 * subscription. Note: using Tiered Cache with Cache Reserve is highly recommended
12 * to reduce Reserve operations costs. See the
13 * [developer docs](https://developers.cloudflare.com/cache/about/cache-reserve)
14 * for more information.
15 */
16 update(
17 zoneId: string,
18 body: CacheReserveUpdateParams,
19 options?: Core.RequestOptions,
20 ): Core.APIPromise<CacheReserveUpdateResponse> {
21 return (
22 this._client.patch(`/zones/${zoneId}/cache/cache_reserve`, { body, ...options }) as Core.APIPromise<{
23 result: CacheReserveUpdateResponse;
24 }>
25 )._thenUnwrap((obj) => obj.result);
26 }
27
28 /**
29 * Increase cache lifetimes by automatically storing all cacheable files into
30 * Cloudflare's persistent object storage buckets. Requires Cache Reserve
31 * subscription. Note: using Tiered Cache with Cache Reserve is highly recommended
32 * to reduce Reserve operations costs. See the
33 * [developer docs](https://developers.cloudflare.com/cache/about/cache-reserve)
34 * for more information.
35 */
36 list(zoneId: string, options?: Core.RequestOptions): Core.APIPromise<CacheReserveListResponse> {
37 return (
38 this._client.get(`/zones/${zoneId}/cache/cache_reserve`, options) as Core.APIPromise<{
39 result: CacheReserveListResponse;
40 }>
41 )._thenUnwrap((obj) => obj.result);
42 }
43}
44
45/**
46 * Increase cache lifetimes by automatically storing all cacheable files into
47 * Cloudflare's persistent object storage buckets. Requires Cache Reserve
48 * subscription. Note: using Tiered Cache with Cache Reserve is highly recommended
49 * to reduce Reserve operations costs. See the
50 * [developer docs](https://developers.cloudflare.com/cache/about/cache-reserve)
51 * for more information.
52 */
53export interface CacheReserveUpdateResponse {
54 /**
55 * ID of the zone setting.
56 */
57 id: 'cache_reserve';
58
59 /**
60 * last time this setting was modified.
61 */
62 modified_on: string | null;
63
64 /**
65 * Value of the Cache Reserve zone setting.
66 */
67 value: 'on' | 'off';
68}
69
70/**
71 * Increase cache lifetimes by automatically storing all cacheable files into
72 * Cloudflare's persistent object storage buckets. Requires Cache Reserve
73 * subscription. Note: using Tiered Cache with Cache Reserve is highly recommended
74 * to reduce Reserve operations costs. See the
75 * [developer docs](https://developers.cloudflare.com/cache/about/cache-reserve)
76 * for more information.
77 */
78export interface CacheReserveListResponse {
79 /**
80 * ID of the zone setting.
81 */
82 id: 'cache_reserve';
83
84 /**
85 * last time this setting was modified.
86 */
87 modified_on: string | null;
88
89 /**
90 * Value of the Cache Reserve zone setting.
91 */
92 value: 'on' | 'off';
93}
94
95export interface CacheReserveUpdateParams {
96 /**
97 * Value of the Cache Reserve zone setting.
98 */
99 value: 'on' | 'off';
100}
101
102export namespace CacheReserves {
103 export import CacheReserveUpdateResponse = CacheReservesAPI.CacheReserveUpdateResponse;
104 export import CacheReserveListResponse = CacheReservesAPI.CacheReserveListResponse;
105 export import CacheReserveUpdateParams = CacheReservesAPI.CacheReserveUpdateParams;
106}
107