Skip to content

Commit

Permalink
feat(api): update via SDK Studio (#225)
Browse files Browse the repository at this point in the history
  • Loading branch information
stainless-app[bot] authored and stainless-bot committed Apr 22, 2024
1 parent e06ef4e commit 5dadedb
Show file tree
Hide file tree
Showing 172 changed files with 3,613 additions and 3,713 deletions.
382 changes: 191 additions & 191 deletions api.md

Large diffs are not rendered by default.

1,008 changes: 504 additions & 504 deletions src/cloudflare/resources/zones/settings/__init__.py

Large diffs are not rendered by default.

10 changes: 5 additions & 5 deletions src/cloudflare/resources/zones/settings/advanced_ddos.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
from ...._base_client import (
make_request_options,
)
from ....types.zones.settings import ZoneSettingAdvancedDDoS
from ....types.zones.settings import advanced_ddos

__all__ = ["AdvancedDDoS", "AsyncAdvancedDDoS"]

Expand All @@ -43,7 +43,7 @@ def get(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> Optional[ZoneSettingAdvancedDDoS]:
) -> Optional[advanced_ddos.AdvancedDDoS]:
"""
Advanced protection from Distributed Denial of Service (DDoS) attacks on your
website. This is an uneditable value that is 'on' in the case of Business and
Expand Down Expand Up @@ -71,7 +71,7 @@ def get(
timeout=timeout,
post_parser=ResultWrapper._unwrapper,
),
cast_to=cast(Type[Optional[ZoneSettingAdvancedDDoS]], ResultWrapper[ZoneSettingAdvancedDDoS]),
cast_to=cast(Type[Optional[advanced_ddos.AdvancedDDoS]], ResultWrapper[advanced_ddos.AdvancedDDoS]),
)


Expand All @@ -94,7 +94,7 @@ async def get(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> Optional[ZoneSettingAdvancedDDoS]:
) -> Optional[advanced_ddos.AdvancedDDoS]:
"""
Advanced protection from Distributed Denial of Service (DDoS) attacks on your
website. This is an uneditable value that is 'on' in the case of Business and
Expand Down Expand Up @@ -122,7 +122,7 @@ async def get(
timeout=timeout,
post_parser=ResultWrapper._unwrapper,
),
cast_to=cast(Type[Optional[ZoneSettingAdvancedDDoS]], ResultWrapper[ZoneSettingAdvancedDDoS]),
cast_to=cast(Type[Optional[advanced_ddos.AdvancedDDoS]], ResultWrapper[advanced_ddos.AdvancedDDoS]),
)


Expand Down
56 changes: 28 additions & 28 deletions src/cloudflare/resources/zones/settings/always_online.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,19 +24,19 @@
from ...._base_client import (
make_request_options,
)
from ....types.zones.settings import ZoneSettingAlwaysOnline, always_online_edit_params
from ....types.zones.settings import AlwaysOnline, always_online_edit_params

__all__ = ["AlwaysOnline", "AsyncAlwaysOnline"]
__all__ = ["AlwaysOnlineResource", "AsyncAlwaysOnlineResource"]


class AlwaysOnline(SyncAPIResource):
class AlwaysOnlineResource(SyncAPIResource):
@cached_property
def with_raw_response(self) -> AlwaysOnlineWithRawResponse:
return AlwaysOnlineWithRawResponse(self)
def with_raw_response(self) -> AlwaysOnlineResourceWithRawResponse:
return AlwaysOnlineResourceWithRawResponse(self)

@cached_property
def with_streaming_response(self) -> AlwaysOnlineWithStreamingResponse:
return AlwaysOnlineWithStreamingResponse(self)
def with_streaming_response(self) -> AlwaysOnlineResourceWithStreamingResponse:
return AlwaysOnlineResourceWithStreamingResponse(self)

def edit(
self,
Expand All @@ -49,7 +49,7 @@ def edit(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> Optional[ZoneSettingAlwaysOnline]:
) -> Optional[AlwaysOnline]:
"""
When enabled, Cloudflare serves limited copies of web pages available from the
[Internet Archive's Wayback Machine](https://archive.org/web/) if your server is
Expand Down Expand Up @@ -82,7 +82,7 @@ def edit(
timeout=timeout,
post_parser=ResultWrapper._unwrapper,
),
cast_to=cast(Type[Optional[ZoneSettingAlwaysOnline]], ResultWrapper[ZoneSettingAlwaysOnline]),
cast_to=cast(Type[Optional[AlwaysOnline]], ResultWrapper[AlwaysOnline]),
)

def get(
Expand All @@ -95,7 +95,7 @@ def get(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> Optional[ZoneSettingAlwaysOnline]:
) -> Optional[AlwaysOnline]:
"""
When enabled, Cloudflare serves limited copies of web pages available from the
[Internet Archive's Wayback Machine](https://archive.org/web/) if your server is
Expand Down Expand Up @@ -125,18 +125,18 @@ def get(
timeout=timeout,
post_parser=ResultWrapper._unwrapper,
),
cast_to=cast(Type[Optional[ZoneSettingAlwaysOnline]], ResultWrapper[ZoneSettingAlwaysOnline]),
cast_to=cast(Type[Optional[AlwaysOnline]], ResultWrapper[AlwaysOnline]),
)


class AsyncAlwaysOnline(AsyncAPIResource):
class AsyncAlwaysOnlineResource(AsyncAPIResource):
@cached_property
def with_raw_response(self) -> AsyncAlwaysOnlineWithRawResponse:
return AsyncAlwaysOnlineWithRawResponse(self)
def with_raw_response(self) -> AsyncAlwaysOnlineResourceWithRawResponse:
return AsyncAlwaysOnlineResourceWithRawResponse(self)

@cached_property
def with_streaming_response(self) -> AsyncAlwaysOnlineWithStreamingResponse:
return AsyncAlwaysOnlineWithStreamingResponse(self)
def with_streaming_response(self) -> AsyncAlwaysOnlineResourceWithStreamingResponse:
return AsyncAlwaysOnlineResourceWithStreamingResponse(self)

async def edit(
self,
Expand All @@ -149,7 +149,7 @@ async def edit(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> Optional[ZoneSettingAlwaysOnline]:
) -> Optional[AlwaysOnline]:
"""
When enabled, Cloudflare serves limited copies of web pages available from the
[Internet Archive's Wayback Machine](https://archive.org/web/) if your server is
Expand Down Expand Up @@ -182,7 +182,7 @@ async def edit(
timeout=timeout,
post_parser=ResultWrapper._unwrapper,
),
cast_to=cast(Type[Optional[ZoneSettingAlwaysOnline]], ResultWrapper[ZoneSettingAlwaysOnline]),
cast_to=cast(Type[Optional[AlwaysOnline]], ResultWrapper[AlwaysOnline]),
)

async def get(
Expand All @@ -195,7 +195,7 @@ async def get(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> Optional[ZoneSettingAlwaysOnline]:
) -> Optional[AlwaysOnline]:
"""
When enabled, Cloudflare serves limited copies of web pages available from the
[Internet Archive's Wayback Machine](https://archive.org/web/) if your server is
Expand Down Expand Up @@ -225,12 +225,12 @@ async def get(
timeout=timeout,
post_parser=ResultWrapper._unwrapper,
),
cast_to=cast(Type[Optional[ZoneSettingAlwaysOnline]], ResultWrapper[ZoneSettingAlwaysOnline]),
cast_to=cast(Type[Optional[AlwaysOnline]], ResultWrapper[AlwaysOnline]),
)


class AlwaysOnlineWithRawResponse:
def __init__(self, always_online: AlwaysOnline) -> None:
class AlwaysOnlineResourceWithRawResponse:
def __init__(self, always_online: AlwaysOnlineResource) -> None:
self._always_online = always_online

self.edit = to_raw_response_wrapper(
Expand All @@ -241,8 +241,8 @@ def __init__(self, always_online: AlwaysOnline) -> None:
)


class AsyncAlwaysOnlineWithRawResponse:
def __init__(self, always_online: AsyncAlwaysOnline) -> None:
class AsyncAlwaysOnlineResourceWithRawResponse:
def __init__(self, always_online: AsyncAlwaysOnlineResource) -> None:
self._always_online = always_online

self.edit = async_to_raw_response_wrapper(
Expand All @@ -253,8 +253,8 @@ def __init__(self, always_online: AsyncAlwaysOnline) -> None:
)


class AlwaysOnlineWithStreamingResponse:
def __init__(self, always_online: AlwaysOnline) -> None:
class AlwaysOnlineResourceWithStreamingResponse:
def __init__(self, always_online: AlwaysOnlineResource) -> None:
self._always_online = always_online

self.edit = to_streamed_response_wrapper(
Expand All @@ -265,8 +265,8 @@ def __init__(self, always_online: AlwaysOnline) -> None:
)


class AsyncAlwaysOnlineWithStreamingResponse:
def __init__(self, always_online: AsyncAlwaysOnline) -> None:
class AsyncAlwaysOnlineResourceWithStreamingResponse:
def __init__(self, always_online: AsyncAlwaysOnlineResource) -> None:
self._always_online = always_online

self.edit = async_to_streamed_response_wrapper(
Expand Down
26 changes: 17 additions & 9 deletions src/cloudflare/resources/zones/settings/always_use_https.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
from ...._base_client import (
make_request_options,
)
from ....types.zones.settings import ZoneSettingAlwaysUseHTTPS, always_use_https_edit_params
from ....types.zones.settings import always_use_https, always_use_https_edit_params

__all__ = ["AlwaysUseHTTPS", "AsyncAlwaysUseHTTPS"]

Expand All @@ -49,7 +49,7 @@ def edit(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> Optional[ZoneSettingAlwaysUseHTTPS]:
) -> Optional[always_use_https.AlwaysUseHTTPS]:
"""
Reply to all requests for URLs that use "http" with a 301 redirect to the
equivalent "https" URL. If you only want to redirect for a subset of requests,
Expand Down Expand Up @@ -80,7 +80,9 @@ def edit(
timeout=timeout,
post_parser=ResultWrapper._unwrapper,
),
cast_to=cast(Type[Optional[ZoneSettingAlwaysUseHTTPS]], ResultWrapper[ZoneSettingAlwaysUseHTTPS]),
cast_to=cast(
Type[Optional[always_use_https.AlwaysUseHTTPS]], ResultWrapper[always_use_https.AlwaysUseHTTPS]
),
)

def get(
Expand All @@ -93,7 +95,7 @@ def get(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> Optional[ZoneSettingAlwaysUseHTTPS]:
) -> Optional[always_use_https.AlwaysUseHTTPS]:
"""
Reply to all requests for URLs that use "http" with a 301 redirect to the
equivalent "https" URL. If you only want to redirect for a subset of requests,
Expand Down Expand Up @@ -121,7 +123,9 @@ def get(
timeout=timeout,
post_parser=ResultWrapper._unwrapper,
),
cast_to=cast(Type[Optional[ZoneSettingAlwaysUseHTTPS]], ResultWrapper[ZoneSettingAlwaysUseHTTPS]),
cast_to=cast(
Type[Optional[always_use_https.AlwaysUseHTTPS]], ResultWrapper[always_use_https.AlwaysUseHTTPS]
),
)


Expand All @@ -145,7 +149,7 @@ async def edit(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> Optional[ZoneSettingAlwaysUseHTTPS]:
) -> Optional[always_use_https.AlwaysUseHTTPS]:
"""
Reply to all requests for URLs that use "http" with a 301 redirect to the
equivalent "https" URL. If you only want to redirect for a subset of requests,
Expand Down Expand Up @@ -176,7 +180,9 @@ async def edit(
timeout=timeout,
post_parser=ResultWrapper._unwrapper,
),
cast_to=cast(Type[Optional[ZoneSettingAlwaysUseHTTPS]], ResultWrapper[ZoneSettingAlwaysUseHTTPS]),
cast_to=cast(
Type[Optional[always_use_https.AlwaysUseHTTPS]], ResultWrapper[always_use_https.AlwaysUseHTTPS]
),
)

async def get(
Expand All @@ -189,7 +195,7 @@ async def get(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> Optional[ZoneSettingAlwaysUseHTTPS]:
) -> Optional[always_use_https.AlwaysUseHTTPS]:
"""
Reply to all requests for URLs that use "http" with a 301 redirect to the
equivalent "https" URL. If you only want to redirect for a subset of requests,
Expand Down Expand Up @@ -217,7 +223,9 @@ async def get(
timeout=timeout,
post_parser=ResultWrapper._unwrapper,
),
cast_to=cast(Type[Optional[ZoneSettingAlwaysUseHTTPS]], ResultWrapper[ZoneSettingAlwaysUseHTTPS]),
cast_to=cast(
Type[Optional[always_use_https.AlwaysUseHTTPS]], ResultWrapper[always_use_https.AlwaysUseHTTPS]
),
)


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
from ...._base_client import (
make_request_options,
)
from ....types.zones.settings import ZoneSettingAutomaticHTTPSRewrites, automatic_https_rewrite_edit_params
from ....types.zones.settings import automatic_https_rewrites, automatic_https_rewrite_edit_params

__all__ = ["AutomaticHTTPSRewrites", "AsyncAutomaticHTTPSRewrites"]

Expand All @@ -49,7 +49,7 @@ def edit(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> Optional[ZoneSettingAutomaticHTTPSRewrites]:
) -> Optional[automatic_https_rewrites.AutomaticHTTPSRewrites]:
"""
Enable the Automatic HTTPS Rewrites feature for this zone.
Expand Down Expand Up @@ -80,7 +80,8 @@ def edit(
post_parser=ResultWrapper._unwrapper,
),
cast_to=cast(
Type[Optional[ZoneSettingAutomaticHTTPSRewrites]], ResultWrapper[ZoneSettingAutomaticHTTPSRewrites]
Type[Optional[automatic_https_rewrites.AutomaticHTTPSRewrites]],
ResultWrapper[automatic_https_rewrites.AutomaticHTTPSRewrites],
),
)

Expand All @@ -94,7 +95,7 @@ def get(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> Optional[ZoneSettingAutomaticHTTPSRewrites]:
) -> Optional[automatic_https_rewrites.AutomaticHTTPSRewrites]:
"""
Enable the Automatic HTTPS Rewrites feature for this zone.
Expand All @@ -121,7 +122,8 @@ def get(
post_parser=ResultWrapper._unwrapper,
),
cast_to=cast(
Type[Optional[ZoneSettingAutomaticHTTPSRewrites]], ResultWrapper[ZoneSettingAutomaticHTTPSRewrites]
Type[Optional[automatic_https_rewrites.AutomaticHTTPSRewrites]],
ResultWrapper[automatic_https_rewrites.AutomaticHTTPSRewrites],
),
)

Expand All @@ -146,7 +148,7 @@ async def edit(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> Optional[ZoneSettingAutomaticHTTPSRewrites]:
) -> Optional[automatic_https_rewrites.AutomaticHTTPSRewrites]:
"""
Enable the Automatic HTTPS Rewrites feature for this zone.
Expand Down Expand Up @@ -179,7 +181,8 @@ async def edit(
post_parser=ResultWrapper._unwrapper,
),
cast_to=cast(
Type[Optional[ZoneSettingAutomaticHTTPSRewrites]], ResultWrapper[ZoneSettingAutomaticHTTPSRewrites]
Type[Optional[automatic_https_rewrites.AutomaticHTTPSRewrites]],
ResultWrapper[automatic_https_rewrites.AutomaticHTTPSRewrites],
),
)

Expand All @@ -193,7 +196,7 @@ async def get(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> Optional[ZoneSettingAutomaticHTTPSRewrites]:
) -> Optional[automatic_https_rewrites.AutomaticHTTPSRewrites]:
"""
Enable the Automatic HTTPS Rewrites feature for this zone.
Expand All @@ -220,7 +223,8 @@ async def get(
post_parser=ResultWrapper._unwrapper,
),
cast_to=cast(
Type[Optional[ZoneSettingAutomaticHTTPSRewrites]], ResultWrapper[ZoneSettingAutomaticHTTPSRewrites]
Type[Optional[automatic_https_rewrites.AutomaticHTTPSRewrites]],
ResultWrapper[automatic_https_rewrites.AutomaticHTTPSRewrites],
),
)

Expand Down
Loading

0 comments on commit 5dadedb

Please sign in to comment.