diff --git a/api.md b/api.md index 4ae48b9e3f5d..6884ba0edfb6 100644 --- a/api.md +++ b/api.md @@ -5365,7 +5365,7 @@ from cloudflare.types.zero_trust.dex import LiveStat, FleetStatusLiveResponse Methods: -- client.zero_trust.dex.fleet_status.live(\*, account_id, \*\*params) -> FleetStatusLiveResponse +- client.zero_trust.dex.fleet_status.live(\*, account_id, \*\*params) -> Optional - client.zero_trust.dex.fleet_status.over_time(\*, account_id, \*\*params) -> None #### Devices @@ -5390,7 +5390,7 @@ from cloudflare.types.zero_trust.dex import HTTPDetails Methods: -- client.zero_trust.dex.http_tests.get(test_id, \*, account_id, \*\*params) -> HTTPDetails +- client.zero_trust.dex.http_tests.get(test_id, \*, account_id, \*\*params) -> Optional #### Percentiles @@ -5402,7 +5402,7 @@ from cloudflare.types.zero_trust.dex.http_tests import HTTPDetailsPercentiles, T Methods: -- client.zero_trust.dex.http_tests.percentiles.get(test_id, \*, account_id, \*\*params) -> HTTPDetailsPercentiles +- client.zero_trust.dex.http_tests.percentiles.get(test_id, \*, account_id, \*\*params) -> Optional ### Tests @@ -5426,7 +5426,7 @@ from cloudflare.types.zero_trust.dex.tests import UniqueDevices Methods: -- client.zero_trust.dex.tests.unique_devices.list(\*, account_id, \*\*params) -> UniqueDevices +- client.zero_trust.dex.tests.unique_devices.list(\*, account_id, \*\*params) -> Optional ### TracerouteTestResults @@ -5440,7 +5440,7 @@ from cloudflare.types.zero_trust.dex.traceroute_test_results import NetworkPathG Methods: -- client.zero_trust.dex.traceroute_test_results.network_path.get(test_result_id, \*, account_id) -> NetworkPathGetResponse +- client.zero_trust.dex.traceroute_test_results.network_path.get(test_result_id, \*, account_id) -> Optional ### TracerouteTests @@ -5452,9 +5452,9 @@ from cloudflare.types.zero_trust.dex import Traceroute, TracerouteTestPercentile Methods: -- client.zero_trust.dex.traceroute_tests.get(test_id, \*, account_id, \*\*params) -> Traceroute -- client.zero_trust.dex.traceroute_tests.network_path(test_id, \*, account_id, \*\*params) -> NetworkPath -- client.zero_trust.dex.traceroute_tests.percentiles(test_id, \*, account_id, \*\*params) -> TracerouteTestPercentilesResponse +- client.zero_trust.dex.traceroute_tests.get(test_id, \*, account_id, \*\*params) -> Optional +- client.zero_trust.dex.traceroute_tests.network_path(test_id, \*, account_id, \*\*params) -> Optional +- client.zero_trust.dex.traceroute_tests.percentiles(test_id, \*, account_id, \*\*params) -> Optional ## Tunnels diff --git a/src/cloudflare/resources/zero_trust/dex/fleet_status/fleet_status.py b/src/cloudflare/resources/zero_trust/dex/fleet_status/fleet_status.py index 1493bad0088e..d1abaa7f5198 100644 --- a/src/cloudflare/resources/zero_trust/dex/fleet_status/fleet_status.py +++ b/src/cloudflare/resources/zero_trust/dex/fleet_status/fleet_status.py @@ -2,7 +2,7 @@ from __future__ import annotations -from typing import Type, cast +from typing import Type, Optional, cast import httpx @@ -60,7 +60,7 @@ def live( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> FleetStatusLiveResponse: + ) -> Optional[FleetStatusLiveResponse]: """ List details for live (up to 60 minutes) devices using WARP @@ -87,7 +87,7 @@ def live( query=maybe_transform({"since_minutes": since_minutes}, fleet_status_live_params.FleetStatusLiveParams), post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[FleetStatusLiveResponse], ResultWrapper[FleetStatusLiveResponse]), + cast_to=cast(Type[Optional[FleetStatusLiveResponse]], ResultWrapper[FleetStatusLiveResponse]), ) def over_time( @@ -173,7 +173,7 @@ async def live( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> FleetStatusLiveResponse: + ) -> Optional[FleetStatusLiveResponse]: """ List details for live (up to 60 minutes) devices using WARP @@ -202,7 +202,7 @@ async def live( ), post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[FleetStatusLiveResponse], ResultWrapper[FleetStatusLiveResponse]), + cast_to=cast(Type[Optional[FleetStatusLiveResponse]], ResultWrapper[FleetStatusLiveResponse]), ) async def over_time( diff --git a/src/cloudflare/resources/zero_trust/dex/http_tests/http_tests.py b/src/cloudflare/resources/zero_trust/dex/http_tests/http_tests.py index e74462127893..f7328b7674e9 100644 --- a/src/cloudflare/resources/zero_trust/dex/http_tests/http_tests.py +++ b/src/cloudflare/resources/zero_trust/dex/http_tests/http_tests.py @@ -2,7 +2,7 @@ from __future__ import annotations -from typing import List, Type, cast +from typing import List, Type, Optional, cast from typing_extensions import Literal import httpx @@ -66,7 +66,7 @@ def get( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> HTTPDetails: + ) -> Optional[HTTPDetails]: """ Get test details and aggregate performance metrics for an http test for a given time period between 1 hour and 7 days. @@ -117,7 +117,7 @@ def get( ), post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[HTTPDetails], ResultWrapper[HTTPDetails]), + cast_to=cast(Type[Optional[HTTPDetails]], ResultWrapper[HTTPDetails]), ) @@ -150,7 +150,7 @@ async def get( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> HTTPDetails: + ) -> Optional[HTTPDetails]: """ Get test details and aggregate performance metrics for an http test for a given time period between 1 hour and 7 days. @@ -201,7 +201,7 @@ async def get( ), post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[HTTPDetails], ResultWrapper[HTTPDetails]), + cast_to=cast(Type[Optional[HTTPDetails]], ResultWrapper[HTTPDetails]), ) diff --git a/src/cloudflare/resources/zero_trust/dex/http_tests/percentiles.py b/src/cloudflare/resources/zero_trust/dex/http_tests/percentiles.py index 6c3ad1596775..b8b117bac3e2 100644 --- a/src/cloudflare/resources/zero_trust/dex/http_tests/percentiles.py +++ b/src/cloudflare/resources/zero_trust/dex/http_tests/percentiles.py @@ -2,7 +2,7 @@ from __future__ import annotations -from typing import List, Type, cast +from typing import List, Type, Optional, cast import httpx @@ -52,7 +52,7 @@ def get( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> HTTPDetailsPercentiles: + ) -> Optional[HTTPDetailsPercentiles]: """ Get percentiles for an http test for a given time period between 1 hour and 7 days. @@ -100,7 +100,7 @@ def get( ), post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[HTTPDetailsPercentiles], ResultWrapper[HTTPDetailsPercentiles]), + cast_to=cast(Type[Optional[HTTPDetailsPercentiles]], ResultWrapper[HTTPDetailsPercentiles]), ) @@ -128,7 +128,7 @@ async def get( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> HTTPDetailsPercentiles: + ) -> Optional[HTTPDetailsPercentiles]: """ Get percentiles for an http test for a given time period between 1 hour and 7 days. @@ -176,7 +176,7 @@ async def get( ), post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[HTTPDetailsPercentiles], ResultWrapper[HTTPDetailsPercentiles]), + cast_to=cast(Type[Optional[HTTPDetailsPercentiles]], ResultWrapper[HTTPDetailsPercentiles]), ) diff --git a/src/cloudflare/resources/zero_trust/dex/tests/unique_devices.py b/src/cloudflare/resources/zero_trust/dex/tests/unique_devices.py index 659a71822500..0f2a51d431de 100644 --- a/src/cloudflare/resources/zero_trust/dex/tests/unique_devices.py +++ b/src/cloudflare/resources/zero_trust/dex/tests/unique_devices.py @@ -2,7 +2,7 @@ from __future__ import annotations -from typing import List, Type, cast +from typing import List, Type, Optional, cast import httpx @@ -49,7 +49,7 @@ def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> unique_devices.UniqueDevices: + ) -> Optional[unique_devices.UniqueDevices]: """ Returns unique count of devices that have run synthetic application monitoring tests in the past 7 days. @@ -86,7 +86,7 @@ def list( ), post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[unique_devices.UniqueDevices], ResultWrapper[unique_devices.UniqueDevices]), + cast_to=cast(Type[Optional[unique_devices.UniqueDevices]], ResultWrapper[unique_devices.UniqueDevices]), ) @@ -111,7 +111,7 @@ async def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> unique_devices.UniqueDevices: + ) -> Optional[unique_devices.UniqueDevices]: """ Returns unique count of devices that have run synthetic application monitoring tests in the past 7 days. @@ -148,7 +148,7 @@ async def list( ), post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[unique_devices.UniqueDevices], ResultWrapper[unique_devices.UniqueDevices]), + cast_to=cast(Type[Optional[unique_devices.UniqueDevices]], ResultWrapper[unique_devices.UniqueDevices]), ) diff --git a/src/cloudflare/resources/zero_trust/dex/traceroute_test_results/network_path.py b/src/cloudflare/resources/zero_trust/dex/traceroute_test_results/network_path.py index 18fbbbb628ab..eea6dd1858c4 100644 --- a/src/cloudflare/resources/zero_trust/dex/traceroute_test_results/network_path.py +++ b/src/cloudflare/resources/zero_trust/dex/traceroute_test_results/network_path.py @@ -2,7 +2,7 @@ from __future__ import annotations -from typing import Type, cast +from typing import Type, Optional, cast import httpx @@ -44,7 +44,7 @@ def get( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> NetworkPathGetResponse: + ) -> Optional[NetworkPathGetResponse]: """ Get a breakdown of hops and performance metrics for a specific traceroute test run @@ -73,7 +73,7 @@ def get( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[NetworkPathGetResponse], ResultWrapper[NetworkPathGetResponse]), + cast_to=cast(Type[Optional[NetworkPathGetResponse]], ResultWrapper[NetworkPathGetResponse]), ) @@ -97,7 +97,7 @@ async def get( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> NetworkPathGetResponse: + ) -> Optional[NetworkPathGetResponse]: """ Get a breakdown of hops and performance metrics for a specific traceroute test run @@ -126,7 +126,7 @@ async def get( timeout=timeout, post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[NetworkPathGetResponse], ResultWrapper[NetworkPathGetResponse]), + cast_to=cast(Type[Optional[NetworkPathGetResponse]], ResultWrapper[NetworkPathGetResponse]), ) diff --git a/src/cloudflare/resources/zero_trust/dex/traceroute_tests.py b/src/cloudflare/resources/zero_trust/dex/traceroute_tests.py index 9b3c1bb067e2..54de40ec10d6 100644 --- a/src/cloudflare/resources/zero_trust/dex/traceroute_tests.py +++ b/src/cloudflare/resources/zero_trust/dex/traceroute_tests.py @@ -2,7 +2,7 @@ from __future__ import annotations -from typing import List, Type, cast +from typing import List, Type, Optional, cast from typing_extensions import Literal import httpx @@ -61,7 +61,7 @@ def get( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Traceroute: + ) -> Optional[Traceroute]: """ Get test details and aggregate performance metrics for an traceroute test for a given time period between 1 hour and 7 days. @@ -112,7 +112,7 @@ def get( ), post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[Traceroute], ResultWrapper[Traceroute]), + cast_to=cast(Type[Optional[Traceroute]], ResultWrapper[Traceroute]), ) def network_path( @@ -130,7 +130,7 @@ def network_path( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> NetworkPath: + ) -> Optional[NetworkPath]: """ Get a breakdown of metrics by hop for individual traceroute test runs @@ -175,7 +175,7 @@ def network_path( ), post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[NetworkPath], ResultWrapper[NetworkPath]), + cast_to=cast(Type[Optional[NetworkPath]], ResultWrapper[NetworkPath]), ) def percentiles( @@ -193,7 +193,7 @@ def percentiles( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> TracerouteTestPercentilesResponse: + ) -> Optional[TracerouteTestPercentilesResponse]: """ Get percentiles for a traceroute test for a given time period between 1 hour and 7 days. @@ -241,7 +241,9 @@ def percentiles( ), post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[TracerouteTestPercentilesResponse], ResultWrapper[TracerouteTestPercentilesResponse]), + cast_to=cast( + Type[Optional[TracerouteTestPercentilesResponse]], ResultWrapper[TracerouteTestPercentilesResponse] + ), ) @@ -270,7 +272,7 @@ async def get( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Traceroute: + ) -> Optional[Traceroute]: """ Get test details and aggregate performance metrics for an traceroute test for a given time period between 1 hour and 7 days. @@ -321,7 +323,7 @@ async def get( ), post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[Traceroute], ResultWrapper[Traceroute]), + cast_to=cast(Type[Optional[Traceroute]], ResultWrapper[Traceroute]), ) async def network_path( @@ -339,7 +341,7 @@ async def network_path( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> NetworkPath: + ) -> Optional[NetworkPath]: """ Get a breakdown of metrics by hop for individual traceroute test runs @@ -384,7 +386,7 @@ async def network_path( ), post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[NetworkPath], ResultWrapper[NetworkPath]), + cast_to=cast(Type[Optional[NetworkPath]], ResultWrapper[NetworkPath]), ) async def percentiles( @@ -402,7 +404,7 @@ async def percentiles( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> TracerouteTestPercentilesResponse: + ) -> Optional[TracerouteTestPercentilesResponse]: """ Get percentiles for a traceroute test for a given time period between 1 hour and 7 days. @@ -450,7 +452,9 @@ async def percentiles( ), post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[TracerouteTestPercentilesResponse], ResultWrapper[TracerouteTestPercentilesResponse]), + cast_to=cast( + Type[Optional[TracerouteTestPercentilesResponse]], ResultWrapper[TracerouteTestPercentilesResponse] + ), ) diff --git a/src/cloudflare/types/zero_trust/dex/test_list_response.py b/src/cloudflare/types/zero_trust/dex/test_list_response.py index dfe04367d233..aec336013c26 100644 --- a/src/cloudflare/types/zero_trust/dex/test_list_response.py +++ b/src/cloudflare/types/zero_trust/dex/test_list_response.py @@ -30,9 +30,9 @@ class TestListResponse(BaseModel): messages: List[ResponseInfo] - result: Tests - success: Literal[True] """Whether the API call was successful""" + result: Optional[Tests] = None + result_info: Optional[ResultInfo] = None diff --git a/tests/api_resources/zero_trust/dex/http_tests/test_percentiles.py b/tests/api_resources/zero_trust/dex/http_tests/test_percentiles.py index 562154d19fb8..44f1f6f210b1 100644 --- a/tests/api_resources/zero_trust/dex/http_tests/test_percentiles.py +++ b/tests/api_resources/zero_trust/dex/http_tests/test_percentiles.py @@ -3,7 +3,7 @@ from __future__ import annotations import os -from typing import Any, cast +from typing import Any, Optional, cast import pytest @@ -26,7 +26,7 @@ def test_method_get(self, client: Cloudflare) -> None: time_end="2023-09-20T17:00:00Z", time_start="2023-09-20T17:00:00Z", ) - assert_matches_type(HTTPDetailsPercentiles, percentile, path=["response"]) + assert_matches_type(Optional[HTTPDetailsPercentiles], percentile, path=["response"]) @pytest.mark.skip() @parametrize @@ -39,7 +39,7 @@ def test_method_get_with_all_params(self, client: Cloudflare) -> None: colo="string", device_id=["string", "string", "string"], ) - assert_matches_type(HTTPDetailsPercentiles, percentile, path=["response"]) + assert_matches_type(Optional[HTTPDetailsPercentiles], percentile, path=["response"]) @pytest.mark.skip() @parametrize @@ -54,7 +54,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" percentile = response.parse() - assert_matches_type(HTTPDetailsPercentiles, percentile, path=["response"]) + assert_matches_type(Optional[HTTPDetailsPercentiles], percentile, path=["response"]) @pytest.mark.skip() @parametrize @@ -69,7 +69,7 @@ def test_streaming_response_get(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" percentile = response.parse() - assert_matches_type(HTTPDetailsPercentiles, percentile, path=["response"]) + assert_matches_type(Optional[HTTPDetailsPercentiles], percentile, path=["response"]) assert cast(Any, response.is_closed) is True @@ -105,7 +105,7 @@ async def test_method_get(self, async_client: AsyncCloudflare) -> None: time_end="2023-09-20T17:00:00Z", time_start="2023-09-20T17:00:00Z", ) - assert_matches_type(HTTPDetailsPercentiles, percentile, path=["response"]) + assert_matches_type(Optional[HTTPDetailsPercentiles], percentile, path=["response"]) @pytest.mark.skip() @parametrize @@ -118,7 +118,7 @@ async def test_method_get_with_all_params(self, async_client: AsyncCloudflare) - colo="string", device_id=["string", "string", "string"], ) - assert_matches_type(HTTPDetailsPercentiles, percentile, path=["response"]) + assert_matches_type(Optional[HTTPDetailsPercentiles], percentile, path=["response"]) @pytest.mark.skip() @parametrize @@ -133,7 +133,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" percentile = await response.parse() - assert_matches_type(HTTPDetailsPercentiles, percentile, path=["response"]) + assert_matches_type(Optional[HTTPDetailsPercentiles], percentile, path=["response"]) @pytest.mark.skip() @parametrize @@ -148,7 +148,7 @@ async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> No assert response.http_request.headers.get("X-Stainless-Lang") == "python" percentile = await response.parse() - assert_matches_type(HTTPDetailsPercentiles, percentile, path=["response"]) + assert_matches_type(Optional[HTTPDetailsPercentiles], percentile, path=["response"]) assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/zero_trust/dex/test_fleet_status.py b/tests/api_resources/zero_trust/dex/test_fleet_status.py index f613200ec2a7..0a360ca83d58 100644 --- a/tests/api_resources/zero_trust/dex/test_fleet_status.py +++ b/tests/api_resources/zero_trust/dex/test_fleet_status.py @@ -3,7 +3,7 @@ from __future__ import annotations import os -from typing import Any, cast +from typing import Any, Optional, cast import pytest @@ -26,7 +26,7 @@ def test_method_live(self, client: Cloudflare) -> None: account_id="01a7362d577a6c3019a474fd6f485823", since_minutes=10, ) - assert_matches_type(FleetStatusLiveResponse, fleet_status, path=["response"]) + assert_matches_type(Optional[FleetStatusLiveResponse], fleet_status, path=["response"]) @pytest.mark.skip() @parametrize @@ -39,7 +39,7 @@ def test_raw_response_live(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" fleet_status = response.parse() - assert_matches_type(FleetStatusLiveResponse, fleet_status, path=["response"]) + assert_matches_type(Optional[FleetStatusLiveResponse], fleet_status, path=["response"]) @pytest.mark.skip() @parametrize @@ -52,7 +52,7 @@ def test_streaming_response_live(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" fleet_status = response.parse() - assert_matches_type(FleetStatusLiveResponse, fleet_status, path=["response"]) + assert_matches_type(Optional[FleetStatusLiveResponse], fleet_status, path=["response"]) assert cast(Any, response.is_closed) is True @@ -138,7 +138,7 @@ async def test_method_live(self, async_client: AsyncCloudflare) -> None: account_id="01a7362d577a6c3019a474fd6f485823", since_minutes=10, ) - assert_matches_type(FleetStatusLiveResponse, fleet_status, path=["response"]) + assert_matches_type(Optional[FleetStatusLiveResponse], fleet_status, path=["response"]) @pytest.mark.skip() @parametrize @@ -151,7 +151,7 @@ async def test_raw_response_live(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" fleet_status = await response.parse() - assert_matches_type(FleetStatusLiveResponse, fleet_status, path=["response"]) + assert_matches_type(Optional[FleetStatusLiveResponse], fleet_status, path=["response"]) @pytest.mark.skip() @parametrize @@ -164,7 +164,7 @@ async def test_streaming_response_live(self, async_client: AsyncCloudflare) -> N assert response.http_request.headers.get("X-Stainless-Lang") == "python" fleet_status = await response.parse() - assert_matches_type(FleetStatusLiveResponse, fleet_status, path=["response"]) + assert_matches_type(Optional[FleetStatusLiveResponse], fleet_status, path=["response"]) assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/zero_trust/dex/test_http_tests.py b/tests/api_resources/zero_trust/dex/test_http_tests.py index ada1507b66c1..1bee3b8453ae 100644 --- a/tests/api_resources/zero_trust/dex/test_http_tests.py +++ b/tests/api_resources/zero_trust/dex/test_http_tests.py @@ -3,7 +3,7 @@ from __future__ import annotations import os -from typing import Any, cast +from typing import Any, Optional, cast import pytest @@ -27,7 +27,7 @@ def test_method_get(self, client: Cloudflare) -> None: time_end="string", time_start="string", ) - assert_matches_type(HTTPDetails, http_test, path=["response"]) + assert_matches_type(Optional[HTTPDetails], http_test, path=["response"]) @pytest.mark.skip() @parametrize @@ -41,7 +41,7 @@ def test_method_get_with_all_params(self, client: Cloudflare) -> None: colo="string", device_id=["string", "string", "string"], ) - assert_matches_type(HTTPDetails, http_test, path=["response"]) + assert_matches_type(Optional[HTTPDetails], http_test, path=["response"]) @pytest.mark.skip() @parametrize @@ -57,7 +57,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" http_test = response.parse() - assert_matches_type(HTTPDetails, http_test, path=["response"]) + assert_matches_type(Optional[HTTPDetails], http_test, path=["response"]) @pytest.mark.skip() @parametrize @@ -73,7 +73,7 @@ def test_streaming_response_get(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" http_test = response.parse() - assert_matches_type(HTTPDetails, http_test, path=["response"]) + assert_matches_type(Optional[HTTPDetails], http_test, path=["response"]) assert cast(Any, response.is_closed) is True @@ -112,7 +112,7 @@ async def test_method_get(self, async_client: AsyncCloudflare) -> None: time_end="string", time_start="string", ) - assert_matches_type(HTTPDetails, http_test, path=["response"]) + assert_matches_type(Optional[HTTPDetails], http_test, path=["response"]) @pytest.mark.skip() @parametrize @@ -126,7 +126,7 @@ async def test_method_get_with_all_params(self, async_client: AsyncCloudflare) - colo="string", device_id=["string", "string", "string"], ) - assert_matches_type(HTTPDetails, http_test, path=["response"]) + assert_matches_type(Optional[HTTPDetails], http_test, path=["response"]) @pytest.mark.skip() @parametrize @@ -142,7 +142,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" http_test = await response.parse() - assert_matches_type(HTTPDetails, http_test, path=["response"]) + assert_matches_type(Optional[HTTPDetails], http_test, path=["response"]) @pytest.mark.skip() @parametrize @@ -158,7 +158,7 @@ async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> No assert response.http_request.headers.get("X-Stainless-Lang") == "python" http_test = await response.parse() - assert_matches_type(HTTPDetails, http_test, path=["response"]) + assert_matches_type(Optional[HTTPDetails], http_test, path=["response"]) assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/zero_trust/dex/test_traceroute_tests.py b/tests/api_resources/zero_trust/dex/test_traceroute_tests.py index 8c006167e613..4f40f23b02f7 100644 --- a/tests/api_resources/zero_trust/dex/test_traceroute_tests.py +++ b/tests/api_resources/zero_trust/dex/test_traceroute_tests.py @@ -3,7 +3,7 @@ from __future__ import annotations import os -from typing import Any, cast +from typing import Any, Optional, cast import pytest @@ -31,7 +31,7 @@ def test_method_get(self, client: Cloudflare) -> None: time_end="string", time_start="string", ) - assert_matches_type(Traceroute, traceroute_test, path=["response"]) + assert_matches_type(Optional[Traceroute], traceroute_test, path=["response"]) @pytest.mark.skip() @parametrize @@ -45,7 +45,7 @@ def test_method_get_with_all_params(self, client: Cloudflare) -> None: colo="string", device_id=["string", "string", "string"], ) - assert_matches_type(Traceroute, traceroute_test, path=["response"]) + assert_matches_type(Optional[Traceroute], traceroute_test, path=["response"]) @pytest.mark.skip() @parametrize @@ -61,7 +61,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" traceroute_test = response.parse() - assert_matches_type(Traceroute, traceroute_test, path=["response"]) + assert_matches_type(Optional[Traceroute], traceroute_test, path=["response"]) @pytest.mark.skip() @parametrize @@ -77,7 +77,7 @@ def test_streaming_response_get(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" traceroute_test = response.parse() - assert_matches_type(Traceroute, traceroute_test, path=["response"]) + assert_matches_type(Optional[Traceroute], traceroute_test, path=["response"]) assert cast(Any, response.is_closed) is True @@ -113,7 +113,7 @@ def test_method_network_path(self, client: Cloudflare) -> None: time_end="string", time_start="string", ) - assert_matches_type(NetworkPath, traceroute_test, path=["response"]) + assert_matches_type(Optional[NetworkPath], traceroute_test, path=["response"]) @pytest.mark.skip() @parametrize @@ -130,7 +130,7 @@ def test_raw_response_network_path(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" traceroute_test = response.parse() - assert_matches_type(NetworkPath, traceroute_test, path=["response"]) + assert_matches_type(Optional[NetworkPath], traceroute_test, path=["response"]) @pytest.mark.skip() @parametrize @@ -147,7 +147,7 @@ def test_streaming_response_network_path(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" traceroute_test = response.parse() - assert_matches_type(NetworkPath, traceroute_test, path=["response"]) + assert_matches_type(Optional[NetworkPath], traceroute_test, path=["response"]) assert cast(Any, response.is_closed) is True @@ -183,7 +183,7 @@ def test_method_percentiles(self, client: Cloudflare) -> None: time_end="2023-09-20T17:00:00Z", time_start="2023-09-20T17:00:00Z", ) - assert_matches_type(TracerouteTestPercentilesResponse, traceroute_test, path=["response"]) + assert_matches_type(Optional[TracerouteTestPercentilesResponse], traceroute_test, path=["response"]) @pytest.mark.skip() @parametrize @@ -196,7 +196,7 @@ def test_method_percentiles_with_all_params(self, client: Cloudflare) -> None: colo="string", device_id=["string", "string", "string"], ) - assert_matches_type(TracerouteTestPercentilesResponse, traceroute_test, path=["response"]) + assert_matches_type(Optional[TracerouteTestPercentilesResponse], traceroute_test, path=["response"]) @pytest.mark.skip() @parametrize @@ -211,7 +211,7 @@ def test_raw_response_percentiles(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" traceroute_test = response.parse() - assert_matches_type(TracerouteTestPercentilesResponse, traceroute_test, path=["response"]) + assert_matches_type(Optional[TracerouteTestPercentilesResponse], traceroute_test, path=["response"]) @pytest.mark.skip() @parametrize @@ -226,7 +226,7 @@ def test_streaming_response_percentiles(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" traceroute_test = response.parse() - assert_matches_type(TracerouteTestPercentilesResponse, traceroute_test, path=["response"]) + assert_matches_type(Optional[TracerouteTestPercentilesResponse], traceroute_test, path=["response"]) assert cast(Any, response.is_closed) is True @@ -263,7 +263,7 @@ async def test_method_get(self, async_client: AsyncCloudflare) -> None: time_end="string", time_start="string", ) - assert_matches_type(Traceroute, traceroute_test, path=["response"]) + assert_matches_type(Optional[Traceroute], traceroute_test, path=["response"]) @pytest.mark.skip() @parametrize @@ -277,7 +277,7 @@ async def test_method_get_with_all_params(self, async_client: AsyncCloudflare) - colo="string", device_id=["string", "string", "string"], ) - assert_matches_type(Traceroute, traceroute_test, path=["response"]) + assert_matches_type(Optional[Traceroute], traceroute_test, path=["response"]) @pytest.mark.skip() @parametrize @@ -293,7 +293,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" traceroute_test = await response.parse() - assert_matches_type(Traceroute, traceroute_test, path=["response"]) + assert_matches_type(Optional[Traceroute], traceroute_test, path=["response"]) @pytest.mark.skip() @parametrize @@ -309,7 +309,7 @@ async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> No assert response.http_request.headers.get("X-Stainless-Lang") == "python" traceroute_test = await response.parse() - assert_matches_type(Traceroute, traceroute_test, path=["response"]) + assert_matches_type(Optional[Traceroute], traceroute_test, path=["response"]) assert cast(Any, response.is_closed) is True @@ -345,7 +345,7 @@ async def test_method_network_path(self, async_client: AsyncCloudflare) -> None: time_end="string", time_start="string", ) - assert_matches_type(NetworkPath, traceroute_test, path=["response"]) + assert_matches_type(Optional[NetworkPath], traceroute_test, path=["response"]) @pytest.mark.skip() @parametrize @@ -362,7 +362,7 @@ async def test_raw_response_network_path(self, async_client: AsyncCloudflare) -> assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" traceroute_test = await response.parse() - assert_matches_type(NetworkPath, traceroute_test, path=["response"]) + assert_matches_type(Optional[NetworkPath], traceroute_test, path=["response"]) @pytest.mark.skip() @parametrize @@ -379,7 +379,7 @@ async def test_streaming_response_network_path(self, async_client: AsyncCloudfla assert response.http_request.headers.get("X-Stainless-Lang") == "python" traceroute_test = await response.parse() - assert_matches_type(NetworkPath, traceroute_test, path=["response"]) + assert_matches_type(Optional[NetworkPath], traceroute_test, path=["response"]) assert cast(Any, response.is_closed) is True @@ -415,7 +415,7 @@ async def test_method_percentiles(self, async_client: AsyncCloudflare) -> None: time_end="2023-09-20T17:00:00Z", time_start="2023-09-20T17:00:00Z", ) - assert_matches_type(TracerouteTestPercentilesResponse, traceroute_test, path=["response"]) + assert_matches_type(Optional[TracerouteTestPercentilesResponse], traceroute_test, path=["response"]) @pytest.mark.skip() @parametrize @@ -428,7 +428,7 @@ async def test_method_percentiles_with_all_params(self, async_client: AsyncCloud colo="string", device_id=["string", "string", "string"], ) - assert_matches_type(TracerouteTestPercentilesResponse, traceroute_test, path=["response"]) + assert_matches_type(Optional[TracerouteTestPercentilesResponse], traceroute_test, path=["response"]) @pytest.mark.skip() @parametrize @@ -443,7 +443,7 @@ async def test_raw_response_percentiles(self, async_client: AsyncCloudflare) -> assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" traceroute_test = await response.parse() - assert_matches_type(TracerouteTestPercentilesResponse, traceroute_test, path=["response"]) + assert_matches_type(Optional[TracerouteTestPercentilesResponse], traceroute_test, path=["response"]) @pytest.mark.skip() @parametrize @@ -458,7 +458,7 @@ async def test_streaming_response_percentiles(self, async_client: AsyncCloudflar assert response.http_request.headers.get("X-Stainless-Lang") == "python" traceroute_test = await response.parse() - assert_matches_type(TracerouteTestPercentilesResponse, traceroute_test, path=["response"]) + assert_matches_type(Optional[TracerouteTestPercentilesResponse], traceroute_test, path=["response"]) assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/zero_trust/dex/tests/test_unique_devices.py b/tests/api_resources/zero_trust/dex/tests/test_unique_devices.py index be18ac1f5b06..219371cebd9f 100644 --- a/tests/api_resources/zero_trust/dex/tests/test_unique_devices.py +++ b/tests/api_resources/zero_trust/dex/tests/test_unique_devices.py @@ -3,7 +3,7 @@ from __future__ import annotations import os -from typing import Any, cast +from typing import Any, Optional, cast import pytest @@ -23,7 +23,7 @@ def test_method_list(self, client: Cloudflare) -> None: unique_device = client.zero_trust.dex.tests.unique_devices.list( account_id="01a7362d577a6c3019a474fd6f485823", ) - assert_matches_type(UniqueDevices, unique_device, path=["response"]) + assert_matches_type(Optional[UniqueDevices], unique_device, path=["response"]) @pytest.mark.skip() @parametrize @@ -33,7 +33,7 @@ def test_method_list_with_all_params(self, client: Cloudflare) -> None: device_id=["string", "string", "string"], test_name="string", ) - assert_matches_type(UniqueDevices, unique_device, path=["response"]) + assert_matches_type(Optional[UniqueDevices], unique_device, path=["response"]) @pytest.mark.skip() @parametrize @@ -45,7 +45,7 @@ def test_raw_response_list(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" unique_device = response.parse() - assert_matches_type(UniqueDevices, unique_device, path=["response"]) + assert_matches_type(Optional[UniqueDevices], unique_device, path=["response"]) @pytest.mark.skip() @parametrize @@ -57,7 +57,7 @@ def test_streaming_response_list(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" unique_device = response.parse() - assert_matches_type(UniqueDevices, unique_device, path=["response"]) + assert_matches_type(Optional[UniqueDevices], unique_device, path=["response"]) assert cast(Any, response.is_closed) is True @@ -79,7 +79,7 @@ async def test_method_list(self, async_client: AsyncCloudflare) -> None: unique_device = await async_client.zero_trust.dex.tests.unique_devices.list( account_id="01a7362d577a6c3019a474fd6f485823", ) - assert_matches_type(UniqueDevices, unique_device, path=["response"]) + assert_matches_type(Optional[UniqueDevices], unique_device, path=["response"]) @pytest.mark.skip() @parametrize @@ -89,7 +89,7 @@ async def test_method_list_with_all_params(self, async_client: AsyncCloudflare) device_id=["string", "string", "string"], test_name="string", ) - assert_matches_type(UniqueDevices, unique_device, path=["response"]) + assert_matches_type(Optional[UniqueDevices], unique_device, path=["response"]) @pytest.mark.skip() @parametrize @@ -101,7 +101,7 @@ async def test_raw_response_list(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" unique_device = await response.parse() - assert_matches_type(UniqueDevices, unique_device, path=["response"]) + assert_matches_type(Optional[UniqueDevices], unique_device, path=["response"]) @pytest.mark.skip() @parametrize @@ -113,7 +113,7 @@ async def test_streaming_response_list(self, async_client: AsyncCloudflare) -> N assert response.http_request.headers.get("X-Stainless-Lang") == "python" unique_device = await response.parse() - assert_matches_type(UniqueDevices, unique_device, path=["response"]) + assert_matches_type(Optional[UniqueDevices], unique_device, path=["response"]) assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/zero_trust/dex/traceroute_test_results/test_network_path.py b/tests/api_resources/zero_trust/dex/traceroute_test_results/test_network_path.py index 738dcfcb6ec6..a0b19f6c8819 100644 --- a/tests/api_resources/zero_trust/dex/traceroute_test_results/test_network_path.py +++ b/tests/api_resources/zero_trust/dex/traceroute_test_results/test_network_path.py @@ -3,7 +3,7 @@ from __future__ import annotations import os -from typing import Any, cast +from typing import Any, Optional, cast import pytest @@ -24,7 +24,7 @@ def test_method_get(self, client: Cloudflare) -> None: "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", account_id="01a7362d577a6c3019a474fd6f485823", ) - assert_matches_type(NetworkPathGetResponse, network_path, path=["response"]) + assert_matches_type(Optional[NetworkPathGetResponse], network_path, path=["response"]) @pytest.mark.skip() @parametrize @@ -37,7 +37,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" network_path = response.parse() - assert_matches_type(NetworkPathGetResponse, network_path, path=["response"]) + assert_matches_type(Optional[NetworkPathGetResponse], network_path, path=["response"]) @pytest.mark.skip() @parametrize @@ -50,7 +50,7 @@ def test_streaming_response_get(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" network_path = response.parse() - assert_matches_type(NetworkPathGetResponse, network_path, path=["response"]) + assert_matches_type(Optional[NetworkPathGetResponse], network_path, path=["response"]) assert cast(Any, response.is_closed) is True @@ -80,7 +80,7 @@ async def test_method_get(self, async_client: AsyncCloudflare) -> None: "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", account_id="01a7362d577a6c3019a474fd6f485823", ) - assert_matches_type(NetworkPathGetResponse, network_path, path=["response"]) + assert_matches_type(Optional[NetworkPathGetResponse], network_path, path=["response"]) @pytest.mark.skip() @parametrize @@ -93,7 +93,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" network_path = await response.parse() - assert_matches_type(NetworkPathGetResponse, network_path, path=["response"]) + assert_matches_type(Optional[NetworkPathGetResponse], network_path, path=["response"]) @pytest.mark.skip() @parametrize @@ -106,7 +106,7 @@ async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> No assert response.http_request.headers.get("X-Stainless-Lang") == "python" network_path = await response.parse() - assert_matches_type(NetworkPathGetResponse, network_path, path=["response"]) + assert_matches_type(Optional[NetworkPathGetResponse], network_path, path=["response"]) assert cast(Any, response.is_closed) is True