diff --git a/api.md b/api.md index 40f7e23ef80..c6ef7011bf4 100644 --- a/api.md +++ b/api.md @@ -422,12 +422,12 @@ Methods: - client.zones.settings.zero_rtt.edit(\*, zone_id, \*\*params) -> Optional - client.zones.settings.zero_rtt.get(\*, zone_id) -> Optional -### AdvancedDDOS +### AdvancedDDoS Types: ```python -from cloudflare.types.zones.settings import ZoneSettingAdvancedDDOS +from cloudflare.types.zones.settings import ZoneSettingAdvancedDDoS ``` Methods: diff --git a/src/cloudflare/resources/zones/settings/__init__.py b/src/cloudflare/resources/zones/settings/__init__.py index 2757eb7e695..95ca89ea01b 100644 --- a/src/cloudflare/resources/zones/settings/__init__.py +++ b/src/cloudflare/resources/zones/settings/__init__.py @@ -153,12 +153,12 @@ AsyncPseudoIPV4WithStreamingResponse, ) from .advanced_ddos import ( - AdvancedDDOS, - AsyncAdvancedDDOS, - AdvancedDDOSWithRawResponse, - AsyncAdvancedDDOSWithRawResponse, - AdvancedDDOSWithStreamingResponse, - AsyncAdvancedDDOSWithStreamingResponse, + AdvancedDDoS, + AsyncAdvancedDDoS, + AdvancedDDoSWithRawResponse, + AsyncAdvancedDDoSWithRawResponse, + AdvancedDDoSWithStreamingResponse, + AsyncAdvancedDDoSWithStreamingResponse, ) from .always_online import ( AlwaysOnline, @@ -424,12 +424,12 @@ "AsyncZeroRTTWithRawResponse", "ZeroRTTWithStreamingResponse", "AsyncZeroRTTWithStreamingResponse", - "AdvancedDDOS", - "AsyncAdvancedDDOS", - "AdvancedDDOSWithRawResponse", - "AsyncAdvancedDDOSWithRawResponse", - "AdvancedDDOSWithStreamingResponse", - "AsyncAdvancedDDOSWithStreamingResponse", + "AdvancedDDoS", + "AsyncAdvancedDDoS", + "AdvancedDDoSWithRawResponse", + "AsyncAdvancedDDoSWithRawResponse", + "AdvancedDDoSWithStreamingResponse", + "AsyncAdvancedDDoSWithStreamingResponse", "AlwaysOnline", "AsyncAlwaysOnline", "AlwaysOnlineWithRawResponse", diff --git a/src/cloudflare/resources/zones/settings/advanced_ddos.py b/src/cloudflare/resources/zones/settings/advanced_ddos.py index 132ee89a02b..824148d44d0 100644 --- a/src/cloudflare/resources/zones/settings/advanced_ddos.py +++ b/src/cloudflare/resources/zones/settings/advanced_ddos.py @@ -19,19 +19,19 @@ from ...._base_client import ( make_request_options, ) -from ....types.zones.settings import ZoneSettingAdvancedDDOS +from ....types.zones.settings import ZoneSettingAdvancedDDoS -__all__ = ["AdvancedDDOS", "AsyncAdvancedDDOS"] +__all__ = ["AdvancedDDoS", "AsyncAdvancedDDoS"] -class AdvancedDDOS(SyncAPIResource): +class AdvancedDDoS(SyncAPIResource): @cached_property - def with_raw_response(self) -> AdvancedDDOSWithRawResponse: - return AdvancedDDOSWithRawResponse(self) + def with_raw_response(self) -> AdvancedDDoSWithRawResponse: + return AdvancedDDoSWithRawResponse(self) @cached_property - def with_streaming_response(self) -> AdvancedDDOSWithStreamingResponse: - return AdvancedDDOSWithStreamingResponse(self) + def with_streaming_response(self) -> AdvancedDDoSWithStreamingResponse: + return AdvancedDDoSWithStreamingResponse(self) def get( self, @@ -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[ZoneSettingAdvancedDDoS]: """ 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 @@ -71,18 +71,18 @@ def get( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[Optional[ZoneSettingAdvancedDDOS]], ResultWrapper[ZoneSettingAdvancedDDOS]), + cast_to=cast(Type[Optional[ZoneSettingAdvancedDDoS]], ResultWrapper[ZoneSettingAdvancedDDoS]), ) -class AsyncAdvancedDDOS(AsyncAPIResource): +class AsyncAdvancedDDoS(AsyncAPIResource): @cached_property - def with_raw_response(self) -> AsyncAdvancedDDOSWithRawResponse: - return AsyncAdvancedDDOSWithRawResponse(self) + def with_raw_response(self) -> AsyncAdvancedDDoSWithRawResponse: + return AsyncAdvancedDDoSWithRawResponse(self) @cached_property - def with_streaming_response(self) -> AsyncAdvancedDDOSWithStreamingResponse: - return AsyncAdvancedDDOSWithStreamingResponse(self) + def with_streaming_response(self) -> AsyncAdvancedDDoSWithStreamingResponse: + return AsyncAdvancedDDoSWithStreamingResponse(self) async def get( self, @@ -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[ZoneSettingAdvancedDDoS]: """ 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 @@ -122,12 +122,12 @@ async def get( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[Optional[ZoneSettingAdvancedDDOS]], ResultWrapper[ZoneSettingAdvancedDDOS]), + cast_to=cast(Type[Optional[ZoneSettingAdvancedDDoS]], ResultWrapper[ZoneSettingAdvancedDDoS]), ) -class AdvancedDDOSWithRawResponse: - def __init__(self, advanced_ddos: AdvancedDDOS) -> None: +class AdvancedDDoSWithRawResponse: + def __init__(self, advanced_ddos: AdvancedDDoS) -> None: self._advanced_ddos = advanced_ddos self.get = to_raw_response_wrapper( @@ -135,8 +135,8 @@ def __init__(self, advanced_ddos: AdvancedDDOS) -> None: ) -class AsyncAdvancedDDOSWithRawResponse: - def __init__(self, advanced_ddos: AsyncAdvancedDDOS) -> None: +class AsyncAdvancedDDoSWithRawResponse: + def __init__(self, advanced_ddos: AsyncAdvancedDDoS) -> None: self._advanced_ddos = advanced_ddos self.get = async_to_raw_response_wrapper( @@ -144,8 +144,8 @@ def __init__(self, advanced_ddos: AsyncAdvancedDDOS) -> None: ) -class AdvancedDDOSWithStreamingResponse: - def __init__(self, advanced_ddos: AdvancedDDOS) -> None: +class AdvancedDDoSWithStreamingResponse: + def __init__(self, advanced_ddos: AdvancedDDoS) -> None: self._advanced_ddos = advanced_ddos self.get = to_streamed_response_wrapper( @@ -153,8 +153,8 @@ def __init__(self, advanced_ddos: AdvancedDDOS) -> None: ) -class AsyncAdvancedDDOSWithStreamingResponse: - def __init__(self, advanced_ddos: AsyncAdvancedDDOS) -> None: +class AsyncAdvancedDDoSWithStreamingResponse: + def __init__(self, advanced_ddos: AsyncAdvancedDDoS) -> None: self._advanced_ddos = advanced_ddos self.get = async_to_streamed_response_wrapper( diff --git a/src/cloudflare/resources/zones/settings/settings.py b/src/cloudflare/resources/zones/settings/settings.py index cd42d6e7010..10df9fed82b 100644 --- a/src/cloudflare/resources/zones/settings/settings.py +++ b/src/cloudflare/resources/zones/settings/settings.py @@ -165,12 +165,12 @@ ) from ...._wrappers import ResultWrapper from .advanced_ddos import ( - AdvancedDDOS, - AsyncAdvancedDDOS, - AdvancedDDOSWithRawResponse, - AsyncAdvancedDDOSWithRawResponse, - AdvancedDDOSWithStreamingResponse, - AsyncAdvancedDDOSWithStreamingResponse, + AdvancedDDoS, + AsyncAdvancedDDoS, + AdvancedDDoSWithRawResponse, + AsyncAdvancedDDoSWithRawResponse, + AdvancedDDoSWithStreamingResponse, + AsyncAdvancedDDoSWithStreamingResponse, ) from .always_online import ( AlwaysOnline, @@ -442,8 +442,8 @@ def zero_rtt(self) -> ZeroRTT: return ZeroRTT(self._client) @cached_property - def advanced_ddos(self) -> AdvancedDDOS: - return AdvancedDDOS(self._client) + def advanced_ddos(self) -> AdvancedDDoS: + return AdvancedDDoS(self._client) @cached_property def always_online(self) -> AlwaysOnline: @@ -738,8 +738,8 @@ def zero_rtt(self) -> AsyncZeroRTT: return AsyncZeroRTT(self._client) @cached_property - def advanced_ddos(self) -> AsyncAdvancedDDOS: - return AsyncAdvancedDDOS(self._client) + def advanced_ddos(self) -> AsyncAdvancedDDoS: + return AsyncAdvancedDDoS(self._client) @cached_property def always_online(self) -> AsyncAlwaysOnline: @@ -1044,8 +1044,8 @@ def zero_rtt(self) -> ZeroRTTWithRawResponse: return ZeroRTTWithRawResponse(self._settings.zero_rtt) @cached_property - def advanced_ddos(self) -> AdvancedDDOSWithRawResponse: - return AdvancedDDOSWithRawResponse(self._settings.advanced_ddos) + def advanced_ddos(self) -> AdvancedDDoSWithRawResponse: + return AdvancedDDoSWithRawResponse(self._settings.advanced_ddos) @cached_property def always_online(self) -> AlwaysOnlineWithRawResponse: @@ -1260,8 +1260,8 @@ def zero_rtt(self) -> AsyncZeroRTTWithRawResponse: return AsyncZeroRTTWithRawResponse(self._settings.zero_rtt) @cached_property - def advanced_ddos(self) -> AsyncAdvancedDDOSWithRawResponse: - return AsyncAdvancedDDOSWithRawResponse(self._settings.advanced_ddos) + def advanced_ddos(self) -> AsyncAdvancedDDoSWithRawResponse: + return AsyncAdvancedDDoSWithRawResponse(self._settings.advanced_ddos) @cached_property def always_online(self) -> AsyncAlwaysOnlineWithRawResponse: @@ -1476,8 +1476,8 @@ def zero_rtt(self) -> ZeroRTTWithStreamingResponse: return ZeroRTTWithStreamingResponse(self._settings.zero_rtt) @cached_property - def advanced_ddos(self) -> AdvancedDDOSWithStreamingResponse: - return AdvancedDDOSWithStreamingResponse(self._settings.advanced_ddos) + def advanced_ddos(self) -> AdvancedDDoSWithStreamingResponse: + return AdvancedDDoSWithStreamingResponse(self._settings.advanced_ddos) @cached_property def always_online(self) -> AlwaysOnlineWithStreamingResponse: @@ -1692,8 +1692,8 @@ def zero_rtt(self) -> AsyncZeroRTTWithStreamingResponse: return AsyncZeroRTTWithStreamingResponse(self._settings.zero_rtt) @cached_property - def advanced_ddos(self) -> AsyncAdvancedDDOSWithStreamingResponse: - return AsyncAdvancedDDOSWithStreamingResponse(self._settings.advanced_ddos) + def advanced_ddos(self) -> AsyncAdvancedDDoSWithStreamingResponse: + return AsyncAdvancedDDoSWithStreamingResponse(self._settings.advanced_ddos) @cached_property def always_online(self) -> AsyncAlwaysOnlineWithStreamingResponse: diff --git a/src/cloudflare/types/zones/setting_edit_params.py b/src/cloudflare/types/zones/setting_edit_params.py index 48337d7b449..cf0c7c0befe 100644 --- a/src/cloudflare/types/zones/setting_edit_params.py +++ b/src/cloudflare/types/zones/setting_edit_params.py @@ -25,7 +25,7 @@ ZoneSettingEarlyHintsParam, ZoneSettingPseudoIPV4Param, ZoneSettingWebsocketsParam, - ZoneSettingAdvancedDDOSParam, + ZoneSettingAdvancedDDoSParam, ZoneSettingAlwaysOnlineParam, ZoneSettingBrowserCheckParam, ZoneSettingChallengeTTLParam, @@ -151,7 +151,7 @@ class ItemZonesTLS1_2Only(TypedDict, total=False): Item = Union[ ZoneSetting0rttParam, - ZoneSettingAdvancedDDOSParam, + ZoneSettingAdvancedDDoSParam, ZoneSettingAlwaysOnlineParam, ZoneSettingAlwaysUseHTTPSParam, ZoneSettingAutomaticHTTPSRewritesParam, diff --git a/src/cloudflare/types/zones/setting_edit_response.py b/src/cloudflare/types/zones/setting_edit_response.py index b2935263c54..28cc6aa5e87 100644 --- a/src/cloudflare/types/zones/setting_edit_response.py +++ b/src/cloudflare/types/zones/setting_edit_response.py @@ -24,7 +24,7 @@ ZoneSettingEarlyHints, ZoneSettingPseudoIPV4, ZoneSettingWebsockets, - ZoneSettingAdvancedDDOS, + ZoneSettingAdvancedDDoS, ZoneSettingAlwaysOnline, ZoneSettingBrowserCheck, ZoneSettingChallengeTTL, @@ -195,7 +195,7 @@ class SettingEditResponseItemZonesTLS1_2Only(BaseModel): SettingEditResponseItem = Union[ ZoneSetting0rtt, - ZoneSettingAdvancedDDOS, + ZoneSettingAdvancedDDoS, ZoneSettingAlwaysOnline, ZoneSettingAlwaysUseHTTPS, ZoneSettingAutomaticHTTPSRewrites, diff --git a/src/cloudflare/types/zones/setting_get_response.py b/src/cloudflare/types/zones/setting_get_response.py index 24a19873b63..f4d66ec4769 100644 --- a/src/cloudflare/types/zones/setting_get_response.py +++ b/src/cloudflare/types/zones/setting_get_response.py @@ -24,7 +24,7 @@ ZoneSettingEarlyHints, ZoneSettingPseudoIPV4, ZoneSettingWebsockets, - ZoneSettingAdvancedDDOS, + ZoneSettingAdvancedDDoS, ZoneSettingAlwaysOnline, ZoneSettingBrowserCheck, ZoneSettingChallengeTTL, @@ -195,7 +195,7 @@ class SettingGetResponseItemZonesTLS1_2Only(BaseModel): SettingGetResponseItem = Union[ ZoneSetting0rtt, - ZoneSettingAdvancedDDOS, + ZoneSettingAdvancedDDoS, ZoneSettingAlwaysOnline, ZoneSettingAlwaysUseHTTPS, ZoneSettingAutomaticHTTPSRewrites, diff --git a/src/cloudflare/types/zones/settings/__init__.py b/src/cloudflare/types/zones/settings/__init__.py index 8fb435e00d7..b52ab846052 100644 --- a/src/cloudflare/types/zones/settings/__init__.py +++ b/src/cloudflare/types/zones/settings/__init__.py @@ -60,7 +60,7 @@ from .image_resizing_edit_params import ImageResizingEditParams as ImageResizingEditParams from .ip_geolocation_edit_params import IPGeolocationEditParams as IPGeolocationEditParams from .security_level_edit_params import SecurityLevelEditParams as SecurityLevelEditParams -from .zone_setting_advanced_ddos import ZoneSettingAdvancedDDOS as ZoneSettingAdvancedDDOS +from .zone_setting_advanced_ddos import ZoneSettingAdvancedDDoS as ZoneSettingAdvancedDDoS from .zone_setting_always_online import ZoneSettingAlwaysOnline as ZoneSettingAlwaysOnline from .zone_setting_browser_check import ZoneSettingBrowserCheck as ZoneSettingBrowserCheck from .zone_setting_challenge_ttl import ZoneSettingChallengeTTL as ZoneSettingChallengeTTL @@ -106,7 +106,7 @@ from .server_side_exclude_edit_params import ServerSideExcludeEditParams as ServerSideExcludeEditParams from .zone_setting_hotlink_protection import ZoneSettingHotlinkProtection as ZoneSettingHotlinkProtection from .zone_setting_proxy_read_timeout import ZoneSettingProxyReadTimeout as ZoneSettingProxyReadTimeout -from .zone_setting_advanced_ddos_param import ZoneSettingAdvancedDDOSParam as ZoneSettingAdvancedDDOSParam +from .zone_setting_advanced_ddos_param import ZoneSettingAdvancedDDoSParam as ZoneSettingAdvancedDDoSParam from .zone_setting_always_online_param import ZoneSettingAlwaysOnlineParam as ZoneSettingAlwaysOnlineParam from .zone_setting_browser_check_param import ZoneSettingBrowserCheckParam as ZoneSettingBrowserCheckParam from .zone_setting_challenge_ttl_param import ZoneSettingChallengeTTLParam as ZoneSettingChallengeTTLParam diff --git a/src/cloudflare/types/zones/settings/zone_setting_advanced_ddos.py b/src/cloudflare/types/zones/settings/zone_setting_advanced_ddos.py index aaebab81f32..ea88edd4793 100644 --- a/src/cloudflare/types/zones/settings/zone_setting_advanced_ddos.py +++ b/src/cloudflare/types/zones/settings/zone_setting_advanced_ddos.py @@ -6,10 +6,10 @@ from ...._models import BaseModel -__all__ = ["ZoneSettingAdvancedDDOS"] +__all__ = ["ZoneSettingAdvancedDDoS"] -class ZoneSettingAdvancedDDOS(BaseModel): +class ZoneSettingAdvancedDDoS(BaseModel): id: Literal["advanced_ddos"] """ID of the zone setting.""" diff --git a/src/cloudflare/types/zones/settings/zone_setting_advanced_ddos_param.py b/src/cloudflare/types/zones/settings/zone_setting_advanced_ddos_param.py index d928f35a454..508516ae76d 100644 --- a/src/cloudflare/types/zones/settings/zone_setting_advanced_ddos_param.py +++ b/src/cloudflare/types/zones/settings/zone_setting_advanced_ddos_param.py @@ -4,10 +4,10 @@ from typing_extensions import Literal, Required, TypedDict -__all__ = ["ZoneSettingAdvancedDDOSParam"] +__all__ = ["ZoneSettingAdvancedDDoSParam"] -class ZoneSettingAdvancedDDOSParam(TypedDict, total=False): +class ZoneSettingAdvancedDDoSParam(TypedDict, total=False): id: Required[Literal["advanced_ddos"]] """ID of the zone setting.""" diff --git a/tests/api_resources/zones/settings/test_advanced_ddos.py b/tests/api_resources/zones/settings/test_advanced_ddos.py index b2093a38e88..891653faed3 100644 --- a/tests/api_resources/zones/settings/test_advanced_ddos.py +++ b/tests/api_resources/zones/settings/test_advanced_ddos.py @@ -9,12 +9,12 @@ from cloudflare import Cloudflare, AsyncCloudflare from tests.utils import assert_matches_type -from cloudflare.types.zones.settings import ZoneSettingAdvancedDDOS +from cloudflare.types.zones.settings import ZoneSettingAdvancedDDoS base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") -class TestAdvancedDDOS: +class TestAdvancedDDoS: parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) @pytest.mark.skip() @@ -23,7 +23,7 @@ def test_method_get(self, client: Cloudflare) -> None: advanced_ddos = client.zones.settings.advanced_ddos.get( zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(Optional[ZoneSettingAdvancedDDOS], advanced_ddos, path=["response"]) + assert_matches_type(Optional[ZoneSettingAdvancedDDoS], advanced_ddos, path=["response"]) @pytest.mark.skip() @parametrize @@ -35,7 +35,7 @@ def test_raw_response_get(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" advanced_ddos = response.parse() - assert_matches_type(Optional[ZoneSettingAdvancedDDOS], advanced_ddos, path=["response"]) + assert_matches_type(Optional[ZoneSettingAdvancedDDoS], advanced_ddos, path=["response"]) @pytest.mark.skip() @parametrize @@ -47,7 +47,7 @@ def test_streaming_response_get(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" advanced_ddos = response.parse() - assert_matches_type(Optional[ZoneSettingAdvancedDDOS], advanced_ddos, path=["response"]) + assert_matches_type(Optional[ZoneSettingAdvancedDDoS], advanced_ddos, path=["response"]) assert cast(Any, response.is_closed) is True @@ -60,7 +60,7 @@ def test_path_params_get(self, client: Cloudflare) -> None: ) -class TestAsyncAdvancedDDOS: +class TestAsyncAdvancedDDoS: parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"]) @pytest.mark.skip() @@ -69,7 +69,7 @@ async def test_method_get(self, async_client: AsyncCloudflare) -> None: advanced_ddos = await async_client.zones.settings.advanced_ddos.get( zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(Optional[ZoneSettingAdvancedDDOS], advanced_ddos, path=["response"]) + assert_matches_type(Optional[ZoneSettingAdvancedDDoS], advanced_ddos, path=["response"]) @pytest.mark.skip() @parametrize @@ -81,7 +81,7 @@ async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" advanced_ddos = await response.parse() - assert_matches_type(Optional[ZoneSettingAdvancedDDOS], advanced_ddos, path=["response"]) + assert_matches_type(Optional[ZoneSettingAdvancedDDoS], advanced_ddos, path=["response"]) @pytest.mark.skip() @parametrize @@ -93,7 +93,7 @@ async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> No assert response.http_request.headers.get("X-Stainless-Lang") == "python" advanced_ddos = await response.parse() - assert_matches_type(Optional[ZoneSettingAdvancedDDOS], advanced_ddos, path=["response"]) + assert_matches_type(Optional[ZoneSettingAdvancedDDoS], advanced_ddos, path=["response"]) assert cast(Any, response.is_closed) is True