Skip to content

Commit

Permalink
feat(api): api update (#2317)
Browse files Browse the repository at this point in the history
  • Loading branch information
stainless-app[bot] committed Jan 6, 2025
1 parent a271105 commit c6cf3dc
Show file tree
Hide file tree
Showing 51 changed files with 543 additions and 853 deletions.
4 changes: 2 additions & 2 deletions .stats.yml
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
configured_endpoints: 1490
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-85569f0482730af4e8c6afc9b33c7ba894e47b2d8fa36a3e013daf5390adb647.yml
configured_endpoints: 1489
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-de7ae109130349e5b0b35b4d0944270435dfddb3ce7079da9b85f5dffaf86639.yml
55 changes: 28 additions & 27 deletions api.md

Large diffs are not rendered by default.

74 changes: 57 additions & 17 deletions src/cloudflare/resources/argo/tiered_caching.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

from __future__ import annotations

from typing import Type, cast
from typing import Type, Optional, cast
from typing_extensions import Literal

import httpx
Expand Down Expand Up @@ -60,9 +60,19 @@ def edit(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> TieredCachingEditResponse:
) -> Optional[TieredCachingEditResponse]:
"""
Updates enablement of Tiered Caching
Tiered Cache works by dividing Cloudflare's data centers into a hierarchy of
lower-tiers and upper-tiers. If content is not cached in lower-tier data centers
(generally the ones closest to a visitor), the lower-tier must ask an upper-tier
to see if it has the content. If the upper-tier does not have the content, only
the upper-tier can ask the origin for content. This practice improves bandwidth
efficiency by limiting the number of data centers that can ask the origin for
content, which reduces origin load and makes websites more cost-effective to
operate. Additionally, Tiered Cache concentrates connections to origin servers
so they come from a small number of data centers rather than the full set of
network locations. This results in fewer open connections using server
resources.
Args:
zone_id: Identifier
Expand All @@ -87,9 +97,9 @@ def edit(
extra_query=extra_query,
extra_body=extra_body,
timeout=timeout,
post_parser=ResultWrapper[TieredCachingEditResponse]._unwrapper,
post_parser=ResultWrapper[Optional[TieredCachingEditResponse]]._unwrapper,
),
cast_to=cast(Type[TieredCachingEditResponse], ResultWrapper[TieredCachingEditResponse]),
cast_to=cast(Type[Optional[TieredCachingEditResponse]], ResultWrapper[TieredCachingEditResponse]),
)

def get(
Expand All @@ -102,9 +112,19 @@ def get(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> TieredCachingGetResponse:
) -> Optional[TieredCachingGetResponse]:
"""
Get Tiered Caching setting
Tiered Cache works by dividing Cloudflare's data centers into a hierarchy of
lower-tiers and upper-tiers. If content is not cached in lower-tier data centers
(generally the ones closest to a visitor), the lower-tier must ask an upper-tier
to see if it has the content. If the upper-tier does not have the content, only
the upper-tier can ask the origin for content. This practice improves bandwidth
efficiency by limiting the number of data centers that can ask the origin for
content, which reduces origin load and makes websites more cost-effective to
operate. Additionally, Tiered Cache concentrates connections to origin servers
so they come from a small number of data centers rather than the full set of
network locations. This results in fewer open connections using server
resources.
Args:
zone_id: Identifier
Expand All @@ -126,9 +146,9 @@ def get(
extra_query=extra_query,
extra_body=extra_body,
timeout=timeout,
post_parser=ResultWrapper[TieredCachingGetResponse]._unwrapper,
post_parser=ResultWrapper[Optional[TieredCachingGetResponse]]._unwrapper,
),
cast_to=cast(Type[TieredCachingGetResponse], ResultWrapper[TieredCachingGetResponse]),
cast_to=cast(Type[Optional[TieredCachingGetResponse]], ResultWrapper[TieredCachingGetResponse]),
)


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

async def get(
Expand All @@ -205,9 +235,19 @@ async def get(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> TieredCachingGetResponse:
) -> Optional[TieredCachingGetResponse]:
"""
Get Tiered Caching setting
Tiered Cache works by dividing Cloudflare's data centers into a hierarchy of
lower-tiers and upper-tiers. If content is not cached in lower-tier data centers
(generally the ones closest to a visitor), the lower-tier must ask an upper-tier
to see if it has the content. If the upper-tier does not have the content, only
the upper-tier can ask the origin for content. This practice improves bandwidth
efficiency by limiting the number of data centers that can ask the origin for
content, which reduces origin load and makes websites more cost-effective to
operate. Additionally, Tiered Cache concentrates connections to origin servers
so they come from a small number of data centers rather than the full set of
network locations. This results in fewer open connections using server
resources.
Args:
zone_id: Identifier
Expand All @@ -229,9 +269,9 @@ async def get(
extra_query=extra_query,
extra_body=extra_body,
timeout=timeout,
post_parser=ResultWrapper[TieredCachingGetResponse]._unwrapper,
post_parser=ResultWrapper[Optional[TieredCachingGetResponse]]._unwrapper,
),
cast_to=cast(Type[TieredCachingGetResponse], ResultWrapper[TieredCachingGetResponse]),
cast_to=cast(Type[Optional[TieredCachingGetResponse]], ResultWrapper[TieredCachingGetResponse]),
)


Expand Down
50 changes: 25 additions & 25 deletions src/cloudflare/resources/cache/cache_reserve.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

from __future__ import annotations

from typing import Type, cast
from typing import Type, Optional, cast
from typing_extensions import Literal

import httpx
Expand Down Expand Up @@ -62,7 +62,7 @@ def clear(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> CacheReserveClearResponse:
) -> Optional[CacheReserveClearResponse]:
"""
You can use Cache Reserve Clear to clear your Cache Reserve, but you must first
disable Cache Reserve. In most cases, this will be accomplished within 24 hours.
Expand Down Expand Up @@ -90,9 +90,9 @@ def clear(
extra_query=extra_query,
extra_body=extra_body,
timeout=timeout,
post_parser=ResultWrapper[CacheReserveClearResponse]._unwrapper,
post_parser=ResultWrapper[Optional[CacheReserveClearResponse]]._unwrapper,
),
cast_to=cast(Type[CacheReserveClearResponse], ResultWrapper[CacheReserveClearResponse]),
cast_to=cast(Type[Optional[CacheReserveClearResponse]], ResultWrapper[CacheReserveClearResponse]),
)

def edit(
Expand All @@ -106,7 +106,7 @@ def edit(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> CacheReserveEditResponse:
) -> Optional[CacheReserveEditResponse]:
"""
Increase cache lifetimes by automatically storing all cacheable files into
Cloudflare's persistent object storage buckets. Requires Cache Reserve
Expand Down Expand Up @@ -138,9 +138,9 @@ def edit(
extra_query=extra_query,
extra_body=extra_body,
timeout=timeout,
post_parser=ResultWrapper[CacheReserveEditResponse]._unwrapper,
post_parser=ResultWrapper[Optional[CacheReserveEditResponse]]._unwrapper,
),
cast_to=cast(Type[CacheReserveEditResponse], ResultWrapper[CacheReserveEditResponse]),
cast_to=cast(Type[Optional[CacheReserveEditResponse]], ResultWrapper[CacheReserveEditResponse]),
)

def get(
Expand All @@ -153,7 +153,7 @@ def get(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> CacheReserveGetResponse:
) -> Optional[CacheReserveGetResponse]:
"""
Increase cache lifetimes by automatically storing all cacheable files into
Cloudflare's persistent object storage buckets. Requires Cache Reserve
Expand Down Expand Up @@ -182,9 +182,9 @@ def get(
extra_query=extra_query,
extra_body=extra_body,
timeout=timeout,
post_parser=ResultWrapper[CacheReserveGetResponse]._unwrapper,
post_parser=ResultWrapper[Optional[CacheReserveGetResponse]]._unwrapper,
),
cast_to=cast(Type[CacheReserveGetResponse], ResultWrapper[CacheReserveGetResponse]),
cast_to=cast(Type[Optional[CacheReserveGetResponse]], ResultWrapper[CacheReserveGetResponse]),
)

def status(
Expand All @@ -197,7 +197,7 @@ def status(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> CacheReserveStatusResponse:
) -> Optional[CacheReserveStatusResponse]:
"""
You can use Cache Reserve Clear to clear your Cache Reserve, but you must first
disable Cache Reserve. In most cases, this will be accomplished within 24 hours.
Expand All @@ -224,9 +224,9 @@ def status(
extra_query=extra_query,
extra_body=extra_body,
timeout=timeout,
post_parser=ResultWrapper[CacheReserveStatusResponse]._unwrapper,
post_parser=ResultWrapper[Optional[CacheReserveStatusResponse]]._unwrapper,
),
cast_to=cast(Type[CacheReserveStatusResponse], ResultWrapper[CacheReserveStatusResponse]),
cast_to=cast(Type[Optional[CacheReserveStatusResponse]], ResultWrapper[CacheReserveStatusResponse]),
)


Expand Down Expand Up @@ -261,7 +261,7 @@ async def clear(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> CacheReserveClearResponse:
) -> Optional[CacheReserveClearResponse]:
"""
You can use Cache Reserve Clear to clear your Cache Reserve, but you must first
disable Cache Reserve. In most cases, this will be accomplished within 24 hours.
Expand Down Expand Up @@ -289,9 +289,9 @@ async def clear(
extra_query=extra_query,
extra_body=extra_body,
timeout=timeout,
post_parser=ResultWrapper[CacheReserveClearResponse]._unwrapper,
post_parser=ResultWrapper[Optional[CacheReserveClearResponse]]._unwrapper,
),
cast_to=cast(Type[CacheReserveClearResponse], ResultWrapper[CacheReserveClearResponse]),
cast_to=cast(Type[Optional[CacheReserveClearResponse]], ResultWrapper[CacheReserveClearResponse]),
)

async def edit(
Expand All @@ -305,7 +305,7 @@ async def edit(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> CacheReserveEditResponse:
) -> Optional[CacheReserveEditResponse]:
"""
Increase cache lifetimes by automatically storing all cacheable files into
Cloudflare's persistent object storage buckets. Requires Cache Reserve
Expand Down Expand Up @@ -337,9 +337,9 @@ async def edit(
extra_query=extra_query,
extra_body=extra_body,
timeout=timeout,
post_parser=ResultWrapper[CacheReserveEditResponse]._unwrapper,
post_parser=ResultWrapper[Optional[CacheReserveEditResponse]]._unwrapper,
),
cast_to=cast(Type[CacheReserveEditResponse], ResultWrapper[CacheReserveEditResponse]),
cast_to=cast(Type[Optional[CacheReserveEditResponse]], ResultWrapper[CacheReserveEditResponse]),
)

async def get(
Expand All @@ -352,7 +352,7 @@ async def get(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> CacheReserveGetResponse:
) -> Optional[CacheReserveGetResponse]:
"""
Increase cache lifetimes by automatically storing all cacheable files into
Cloudflare's persistent object storage buckets. Requires Cache Reserve
Expand Down Expand Up @@ -381,9 +381,9 @@ async def get(
extra_query=extra_query,
extra_body=extra_body,
timeout=timeout,
post_parser=ResultWrapper[CacheReserveGetResponse]._unwrapper,
post_parser=ResultWrapper[Optional[CacheReserveGetResponse]]._unwrapper,
),
cast_to=cast(Type[CacheReserveGetResponse], ResultWrapper[CacheReserveGetResponse]),
cast_to=cast(Type[Optional[CacheReserveGetResponse]], ResultWrapper[CacheReserveGetResponse]),
)

async def status(
Expand All @@ -396,7 +396,7 @@ async def status(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> CacheReserveStatusResponse:
) -> Optional[CacheReserveStatusResponse]:
"""
You can use Cache Reserve Clear to clear your Cache Reserve, but you must first
disable Cache Reserve. In most cases, this will be accomplished within 24 hours.
Expand All @@ -423,9 +423,9 @@ async def status(
extra_query=extra_query,
extra_body=extra_body,
timeout=timeout,
post_parser=ResultWrapper[CacheReserveStatusResponse]._unwrapper,
post_parser=ResultWrapper[Optional[CacheReserveStatusResponse]]._unwrapper,
),
cast_to=cast(Type[CacheReserveStatusResponse], ResultWrapper[CacheReserveStatusResponse]),
cast_to=cast(Type[Optional[CacheReserveStatusResponse]], ResultWrapper[CacheReserveStatusResponse]),
)


Expand Down
Loading

0 comments on commit c6cf3dc

Please sign in to comment.