Skip to content

Commit c6cf3dc

Browse files
feat(api): api update (#2317)
1 parent a271105 commit c6cf3dc

File tree

51 files changed

+543
-853
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

51 files changed

+543
-853
lines changed

.stats.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
configured_endpoints: 1490
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-85569f0482730af4e8c6afc9b33c7ba894e47b2d8fa36a3e013daf5390adb647.yml
1+
configured_endpoints: 1489
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-de7ae109130349e5b0b35b4d0944270435dfddb3ce7079da9b85f5dffaf86639.yml

api.md

+28-27
Large diffs are not rendered by default.

src/cloudflare/resources/argo/tiered_caching.py

+57-17
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
from __future__ import annotations
44

5-
from typing import Type, cast
5+
from typing import Type, Optional, cast
66
from typing_extensions import Literal
77

88
import httpx
@@ -60,9 +60,19 @@ def edit(
6060
extra_query: Query | None = None,
6161
extra_body: Body | None = None,
6262
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
63-
) -> TieredCachingEditResponse:
63+
) -> Optional[TieredCachingEditResponse]:
6464
"""
65-
Updates enablement of Tiered Caching
65+
Tiered Cache works by dividing Cloudflare's data centers into a hierarchy of
66+
lower-tiers and upper-tiers. If content is not cached in lower-tier data centers
67+
(generally the ones closest to a visitor), the lower-tier must ask an upper-tier
68+
to see if it has the content. If the upper-tier does not have the content, only
69+
the upper-tier can ask the origin for content. This practice improves bandwidth
70+
efficiency by limiting the number of data centers that can ask the origin for
71+
content, which reduces origin load and makes websites more cost-effective to
72+
operate. Additionally, Tiered Cache concentrates connections to origin servers
73+
so they come from a small number of data centers rather than the full set of
74+
network locations. This results in fewer open connections using server
75+
resources.
6676
6777
Args:
6878
zone_id: Identifier
@@ -87,9 +97,9 @@ def edit(
8797
extra_query=extra_query,
8898
extra_body=extra_body,
8999
timeout=timeout,
90-
post_parser=ResultWrapper[TieredCachingEditResponse]._unwrapper,
100+
post_parser=ResultWrapper[Optional[TieredCachingEditResponse]]._unwrapper,
91101
),
92-
cast_to=cast(Type[TieredCachingEditResponse], ResultWrapper[TieredCachingEditResponse]),
102+
cast_to=cast(Type[Optional[TieredCachingEditResponse]], ResultWrapper[TieredCachingEditResponse]),
93103
)
94104

95105
def get(
@@ -102,9 +112,19 @@ def get(
102112
extra_query: Query | None = None,
103113
extra_body: Body | None = None,
104114
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
105-
) -> TieredCachingGetResponse:
115+
) -> Optional[TieredCachingGetResponse]:
106116
"""
107-
Get Tiered Caching setting
117+
Tiered Cache works by dividing Cloudflare's data centers into a hierarchy of
118+
lower-tiers and upper-tiers. If content is not cached in lower-tier data centers
119+
(generally the ones closest to a visitor), the lower-tier must ask an upper-tier
120+
to see if it has the content. If the upper-tier does not have the content, only
121+
the upper-tier can ask the origin for content. This practice improves bandwidth
122+
efficiency by limiting the number of data centers that can ask the origin for
123+
content, which reduces origin load and makes websites more cost-effective to
124+
operate. Additionally, Tiered Cache concentrates connections to origin servers
125+
so they come from a small number of data centers rather than the full set of
126+
network locations. This results in fewer open connections using server
127+
resources.
108128
109129
Args:
110130
zone_id: Identifier
@@ -126,9 +146,9 @@ def get(
126146
extra_query=extra_query,
127147
extra_body=extra_body,
128148
timeout=timeout,
129-
post_parser=ResultWrapper[TieredCachingGetResponse]._unwrapper,
149+
post_parser=ResultWrapper[Optional[TieredCachingGetResponse]]._unwrapper,
130150
),
131-
cast_to=cast(Type[TieredCachingGetResponse], ResultWrapper[TieredCachingGetResponse]),
151+
cast_to=cast(Type[Optional[TieredCachingGetResponse]], ResultWrapper[TieredCachingGetResponse]),
132152
)
133153

134154

@@ -163,9 +183,19 @@ async def edit(
163183
extra_query: Query | None = None,
164184
extra_body: Body | None = None,
165185
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
166-
) -> TieredCachingEditResponse:
186+
) -> Optional[TieredCachingEditResponse]:
167187
"""
168-
Updates enablement of Tiered Caching
188+
Tiered Cache works by dividing Cloudflare's data centers into a hierarchy of
189+
lower-tiers and upper-tiers. If content is not cached in lower-tier data centers
190+
(generally the ones closest to a visitor), the lower-tier must ask an upper-tier
191+
to see if it has the content. If the upper-tier does not have the content, only
192+
the upper-tier can ask the origin for content. This practice improves bandwidth
193+
efficiency by limiting the number of data centers that can ask the origin for
194+
content, which reduces origin load and makes websites more cost-effective to
195+
operate. Additionally, Tiered Cache concentrates connections to origin servers
196+
so they come from a small number of data centers rather than the full set of
197+
network locations. This results in fewer open connections using server
198+
resources.
169199
170200
Args:
171201
zone_id: Identifier
@@ -190,9 +220,9 @@ async def edit(
190220
extra_query=extra_query,
191221
extra_body=extra_body,
192222
timeout=timeout,
193-
post_parser=ResultWrapper[TieredCachingEditResponse]._unwrapper,
223+
post_parser=ResultWrapper[Optional[TieredCachingEditResponse]]._unwrapper,
194224
),
195-
cast_to=cast(Type[TieredCachingEditResponse], ResultWrapper[TieredCachingEditResponse]),
225+
cast_to=cast(Type[Optional[TieredCachingEditResponse]], ResultWrapper[TieredCachingEditResponse]),
196226
)
197227

198228
async def get(
@@ -205,9 +235,19 @@ async def get(
205235
extra_query: Query | None = None,
206236
extra_body: Body | None = None,
207237
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
208-
) -> TieredCachingGetResponse:
238+
) -> Optional[TieredCachingGetResponse]:
209239
"""
210-
Get Tiered Caching setting
240+
Tiered Cache works by dividing Cloudflare's data centers into a hierarchy of
241+
lower-tiers and upper-tiers. If content is not cached in lower-tier data centers
242+
(generally the ones closest to a visitor), the lower-tier must ask an upper-tier
243+
to see if it has the content. If the upper-tier does not have the content, only
244+
the upper-tier can ask the origin for content. This practice improves bandwidth
245+
efficiency by limiting the number of data centers that can ask the origin for
246+
content, which reduces origin load and makes websites more cost-effective to
247+
operate. Additionally, Tiered Cache concentrates connections to origin servers
248+
so they come from a small number of data centers rather than the full set of
249+
network locations. This results in fewer open connections using server
250+
resources.
211251
212252
Args:
213253
zone_id: Identifier
@@ -229,9 +269,9 @@ async def get(
229269
extra_query=extra_query,
230270
extra_body=extra_body,
231271
timeout=timeout,
232-
post_parser=ResultWrapper[TieredCachingGetResponse]._unwrapper,
272+
post_parser=ResultWrapper[Optional[TieredCachingGetResponse]]._unwrapper,
233273
),
234-
cast_to=cast(Type[TieredCachingGetResponse], ResultWrapper[TieredCachingGetResponse]),
274+
cast_to=cast(Type[Optional[TieredCachingGetResponse]], ResultWrapper[TieredCachingGetResponse]),
235275
)
236276

237277

src/cloudflare/resources/cache/cache_reserve.py

+25-25
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
from __future__ import annotations
44

5-
from typing import Type, cast
5+
from typing import Type, Optional, cast
66
from typing_extensions import Literal
77

88
import httpx
@@ -62,7 +62,7 @@ def clear(
6262
extra_query: Query | None = None,
6363
extra_body: Body | None = None,
6464
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
65-
) -> CacheReserveClearResponse:
65+
) -> Optional[CacheReserveClearResponse]:
6666
"""
6767
You can use Cache Reserve Clear to clear your Cache Reserve, but you must first
6868
disable Cache Reserve. In most cases, this will be accomplished within 24 hours.
@@ -90,9 +90,9 @@ def clear(
9090
extra_query=extra_query,
9191
extra_body=extra_body,
9292
timeout=timeout,
93-
post_parser=ResultWrapper[CacheReserveClearResponse]._unwrapper,
93+
post_parser=ResultWrapper[Optional[CacheReserveClearResponse]]._unwrapper,
9494
),
95-
cast_to=cast(Type[CacheReserveClearResponse], ResultWrapper[CacheReserveClearResponse]),
95+
cast_to=cast(Type[Optional[CacheReserveClearResponse]], ResultWrapper[CacheReserveClearResponse]),
9696
)
9797

9898
def edit(
@@ -106,7 +106,7 @@ def edit(
106106
extra_query: Query | None = None,
107107
extra_body: Body | None = None,
108108
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
109-
) -> CacheReserveEditResponse:
109+
) -> Optional[CacheReserveEditResponse]:
110110
"""
111111
Increase cache lifetimes by automatically storing all cacheable files into
112112
Cloudflare's persistent object storage buckets. Requires Cache Reserve
@@ -138,9 +138,9 @@ def edit(
138138
extra_query=extra_query,
139139
extra_body=extra_body,
140140
timeout=timeout,
141-
post_parser=ResultWrapper[CacheReserveEditResponse]._unwrapper,
141+
post_parser=ResultWrapper[Optional[CacheReserveEditResponse]]._unwrapper,
142142
),
143-
cast_to=cast(Type[CacheReserveEditResponse], ResultWrapper[CacheReserveEditResponse]),
143+
cast_to=cast(Type[Optional[CacheReserveEditResponse]], ResultWrapper[CacheReserveEditResponse]),
144144
)
145145

146146
def get(
@@ -153,7 +153,7 @@ def get(
153153
extra_query: Query | None = None,
154154
extra_body: Body | None = None,
155155
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
156-
) -> CacheReserveGetResponse:
156+
) -> Optional[CacheReserveGetResponse]:
157157
"""
158158
Increase cache lifetimes by automatically storing all cacheable files into
159159
Cloudflare's persistent object storage buckets. Requires Cache Reserve
@@ -182,9 +182,9 @@ def get(
182182
extra_query=extra_query,
183183
extra_body=extra_body,
184184
timeout=timeout,
185-
post_parser=ResultWrapper[CacheReserveGetResponse]._unwrapper,
185+
post_parser=ResultWrapper[Optional[CacheReserveGetResponse]]._unwrapper,
186186
),
187-
cast_to=cast(Type[CacheReserveGetResponse], ResultWrapper[CacheReserveGetResponse]),
187+
cast_to=cast(Type[Optional[CacheReserveGetResponse]], ResultWrapper[CacheReserveGetResponse]),
188188
)
189189

190190
def status(
@@ -197,7 +197,7 @@ def status(
197197
extra_query: Query | None = None,
198198
extra_body: Body | None = None,
199199
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
200-
) -> CacheReserveStatusResponse:
200+
) -> Optional[CacheReserveStatusResponse]:
201201
"""
202202
You can use Cache Reserve Clear to clear your Cache Reserve, but you must first
203203
disable Cache Reserve. In most cases, this will be accomplished within 24 hours.
@@ -224,9 +224,9 @@ def status(
224224
extra_query=extra_query,
225225
extra_body=extra_body,
226226
timeout=timeout,
227-
post_parser=ResultWrapper[CacheReserveStatusResponse]._unwrapper,
227+
post_parser=ResultWrapper[Optional[CacheReserveStatusResponse]]._unwrapper,
228228
),
229-
cast_to=cast(Type[CacheReserveStatusResponse], ResultWrapper[CacheReserveStatusResponse]),
229+
cast_to=cast(Type[Optional[CacheReserveStatusResponse]], ResultWrapper[CacheReserveStatusResponse]),
230230
)
231231

232232

@@ -261,7 +261,7 @@ async def clear(
261261
extra_query: Query | None = None,
262262
extra_body: Body | None = None,
263263
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
264-
) -> CacheReserveClearResponse:
264+
) -> Optional[CacheReserveClearResponse]:
265265
"""
266266
You can use Cache Reserve Clear to clear your Cache Reserve, but you must first
267267
disable Cache Reserve. In most cases, this will be accomplished within 24 hours.
@@ -289,9 +289,9 @@ async def clear(
289289
extra_query=extra_query,
290290
extra_body=extra_body,
291291
timeout=timeout,
292-
post_parser=ResultWrapper[CacheReserveClearResponse]._unwrapper,
292+
post_parser=ResultWrapper[Optional[CacheReserveClearResponse]]._unwrapper,
293293
),
294-
cast_to=cast(Type[CacheReserveClearResponse], ResultWrapper[CacheReserveClearResponse]),
294+
cast_to=cast(Type[Optional[CacheReserveClearResponse]], ResultWrapper[CacheReserveClearResponse]),
295295
)
296296

297297
async def edit(
@@ -305,7 +305,7 @@ async def edit(
305305
extra_query: Query | None = None,
306306
extra_body: Body | None = None,
307307
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
308-
) -> CacheReserveEditResponse:
308+
) -> Optional[CacheReserveEditResponse]:
309309
"""
310310
Increase cache lifetimes by automatically storing all cacheable files into
311311
Cloudflare's persistent object storage buckets. Requires Cache Reserve
@@ -337,9 +337,9 @@ async def edit(
337337
extra_query=extra_query,
338338
extra_body=extra_body,
339339
timeout=timeout,
340-
post_parser=ResultWrapper[CacheReserveEditResponse]._unwrapper,
340+
post_parser=ResultWrapper[Optional[CacheReserveEditResponse]]._unwrapper,
341341
),
342-
cast_to=cast(Type[CacheReserveEditResponse], ResultWrapper[CacheReserveEditResponse]),
342+
cast_to=cast(Type[Optional[CacheReserveEditResponse]], ResultWrapper[CacheReserveEditResponse]),
343343
)
344344

345345
async def get(
@@ -352,7 +352,7 @@ async def get(
352352
extra_query: Query | None = None,
353353
extra_body: Body | None = None,
354354
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
355-
) -> CacheReserveGetResponse:
355+
) -> Optional[CacheReserveGetResponse]:
356356
"""
357357
Increase cache lifetimes by automatically storing all cacheable files into
358358
Cloudflare's persistent object storage buckets. Requires Cache Reserve
@@ -381,9 +381,9 @@ async def get(
381381
extra_query=extra_query,
382382
extra_body=extra_body,
383383
timeout=timeout,
384-
post_parser=ResultWrapper[CacheReserveGetResponse]._unwrapper,
384+
post_parser=ResultWrapper[Optional[CacheReserveGetResponse]]._unwrapper,
385385
),
386-
cast_to=cast(Type[CacheReserveGetResponse], ResultWrapper[CacheReserveGetResponse]),
386+
cast_to=cast(Type[Optional[CacheReserveGetResponse]], ResultWrapper[CacheReserveGetResponse]),
387387
)
388388

389389
async def status(
@@ -396,7 +396,7 @@ async def status(
396396
extra_query: Query | None = None,
397397
extra_body: Body | None = None,
398398
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
399-
) -> CacheReserveStatusResponse:
399+
) -> Optional[CacheReserveStatusResponse]:
400400
"""
401401
You can use Cache Reserve Clear to clear your Cache Reserve, but you must first
402402
disable Cache Reserve. In most cases, this will be accomplished within 24 hours.
@@ -423,9 +423,9 @@ async def status(
423423
extra_query=extra_query,
424424
extra_body=extra_body,
425425
timeout=timeout,
426-
post_parser=ResultWrapper[CacheReserveStatusResponse]._unwrapper,
426+
post_parser=ResultWrapper[Optional[CacheReserveStatusResponse]]._unwrapper,
427427
),
428-
cast_to=cast(Type[CacheReserveStatusResponse], ResultWrapper[CacheReserveStatusResponse]),
428+
cast_to=cast(Type[Optional[CacheReserveStatusResponse]], ResultWrapper[CacheReserveStatusResponse]),
429429
)
430430

431431

0 commit comments

Comments
 (0)