From 9e78a68d881b4274d89f1fae0692c10ce9b7eafa Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 16 Apr 2024 15:33:21 +0000 Subject: [PATCH] feat(api): OpenAPI spec update via Stainless API (#322) --- api.md | 16 +++---- .../dex/fleet_status/fleet_status.py | 10 ++-- .../zero_trust/dex/http_tests/http_tests.py | 10 ++-- .../zero_trust/dex/http_tests/percentiles.py | 10 ++-- .../zero_trust/dex/tests/unique_devices.py | 10 ++-- .../traceroute_test_results/network_path.py | 10 ++-- .../zero_trust/dex/traceroute_tests.py | 30 ++++++------ .../zero_trust/dex/test_list_response.py | 4 +- .../dex/http_tests/test_percentiles.py | 18 ++++---- .../zero_trust/dex/test_fleet_status.py | 14 +++--- .../zero_trust/dex/test_http_tests.py | 18 ++++---- .../zero_trust/dex/test_traceroute_tests.py | 46 +++++++++---------- .../dex/tests/test_unique_devices.py | 18 ++++---- .../test_network_path.py | 14 +++--- 14 files changed, 112 insertions(+), 116 deletions(-) diff --git a/api.md b/api.md index 6884ba0edfb..4ae48b9e3f5 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) -> Optional +- client.zero_trust.dex.fleet_status.live(\*, account_id, \*\*params) -> FleetStatusLiveResponse - 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) -> Optional +- client.zero_trust.dex.http_tests.get(test_id, \*, account_id, \*\*params) -> HTTPDetails #### 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) -> Optional +- client.zero_trust.dex.http_tests.percentiles.get(test_id, \*, account_id, \*\*params) -> HTTPDetailsPercentiles ### 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) -> Optional +- client.zero_trust.dex.tests.unique_devices.list(\*, account_id, \*\*params) -> UniqueDevices ### 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) -> Optional +- client.zero_trust.dex.traceroute_test_results.network_path.get(test_result_id, \*, account_id) -> NetworkPathGetResponse ### 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) -> 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 +- 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 ## 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 d1abaa7f519..1493bad0088 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, Optional, cast +from typing import Type, 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, - ) -> Optional[FleetStatusLiveResponse]: + ) -> 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[Optional[FleetStatusLiveResponse]], ResultWrapper[FleetStatusLiveResponse]), + cast_to=cast(Type[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, - ) -> Optional[FleetStatusLiveResponse]: + ) -> 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[Optional[FleetStatusLiveResponse]], ResultWrapper[FleetStatusLiveResponse]), + cast_to=cast(Type[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 f7328b7674e..e7446212789 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, Optional, cast +from typing import List, Type, 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, - ) -> Optional[HTTPDetails]: + ) -> 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[Optional[HTTPDetails]], ResultWrapper[HTTPDetails]), + cast_to=cast(Type[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, - ) -> Optional[HTTPDetails]: + ) -> 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[Optional[HTTPDetails]], ResultWrapper[HTTPDetails]), + cast_to=cast(Type[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 b8b117bac3e..6c3ad159677 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, Optional, cast +from typing import List, Type, 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, - ) -> Optional[HTTPDetailsPercentiles]: + ) -> 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[Optional[HTTPDetailsPercentiles]], ResultWrapper[HTTPDetailsPercentiles]), + cast_to=cast(Type[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, - ) -> Optional[HTTPDetailsPercentiles]: + ) -> 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[Optional[HTTPDetailsPercentiles]], ResultWrapper[HTTPDetailsPercentiles]), + cast_to=cast(Type[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 0f2a51d431d..659a7182250 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, Optional, cast +from typing import List, Type, 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, - ) -> Optional[unique_devices.UniqueDevices]: + ) -> 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[Optional[unique_devices.UniqueDevices]], ResultWrapper[unique_devices.UniqueDevices]), + cast_to=cast(Type[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, - ) -> Optional[unique_devices.UniqueDevices]: + ) -> 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[Optional[unique_devices.UniqueDevices]], ResultWrapper[unique_devices.UniqueDevices]), + cast_to=cast(Type[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 eea6dd1858c..18fbbbb628a 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, Optional, cast +from typing import Type, 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, - ) -> Optional[NetworkPathGetResponse]: + ) -> 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[Optional[NetworkPathGetResponse]], ResultWrapper[NetworkPathGetResponse]), + cast_to=cast(Type[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, - ) -> Optional[NetworkPathGetResponse]: + ) -> 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[Optional[NetworkPathGetResponse]], ResultWrapper[NetworkPathGetResponse]), + cast_to=cast(Type[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 54de40ec10d..9b3c1bb067e 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, Optional, cast +from typing import List, Type, 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, - ) -> Optional[Traceroute]: + ) -> 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[Optional[Traceroute]], ResultWrapper[Traceroute]), + cast_to=cast(Type[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, - ) -> Optional[NetworkPath]: + ) -> 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[Optional[NetworkPath]], ResultWrapper[NetworkPath]), + cast_to=cast(Type[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, - ) -> Optional[TracerouteTestPercentilesResponse]: + ) -> TracerouteTestPercentilesResponse: """ Get percentiles for a traceroute test for a given time period between 1 hour and 7 days. @@ -241,9 +241,7 @@ def percentiles( ), post_parser=ResultWrapper._unwrapper, ), - cast_to=cast( - Type[Optional[TracerouteTestPercentilesResponse]], ResultWrapper[TracerouteTestPercentilesResponse] - ), + cast_to=cast(Type[TracerouteTestPercentilesResponse], ResultWrapper[TracerouteTestPercentilesResponse]), ) @@ -272,7 +270,7 @@ async def get( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[Traceroute]: + ) -> Traceroute: """ Get test details and aggregate performance metrics for an traceroute test for a given time period between 1 hour and 7 days. @@ -323,7 +321,7 @@ async def get( ), post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[Optional[Traceroute]], ResultWrapper[Traceroute]), + cast_to=cast(Type[Traceroute], ResultWrapper[Traceroute]), ) async def network_path( @@ -341,7 +339,7 @@ async def network_path( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[NetworkPath]: + ) -> NetworkPath: """ Get a breakdown of metrics by hop for individual traceroute test runs @@ -386,7 +384,7 @@ async def network_path( ), post_parser=ResultWrapper._unwrapper, ), - cast_to=cast(Type[Optional[NetworkPath]], ResultWrapper[NetworkPath]), + cast_to=cast(Type[NetworkPath], ResultWrapper[NetworkPath]), ) async def percentiles( @@ -404,7 +402,7 @@ async def percentiles( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[TracerouteTestPercentilesResponse]: + ) -> TracerouteTestPercentilesResponse: """ Get percentiles for a traceroute test for a given time period between 1 hour and 7 days. @@ -452,9 +450,7 @@ async def percentiles( ), post_parser=ResultWrapper._unwrapper, ), - cast_to=cast( - Type[Optional[TracerouteTestPercentilesResponse]], ResultWrapper[TracerouteTestPercentilesResponse] - ), + cast_to=cast(Type[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 aec336013c2..dfe04367d23 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 44f1f6f210b..562154d19fb 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, Optional, cast +from typing import Any, 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(Optional[HTTPDetailsPercentiles], percentile, path=["response"]) + assert_matches_type(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(Optional[HTTPDetailsPercentiles], percentile, path=["response"]) + assert_matches_type(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(Optional[HTTPDetailsPercentiles], percentile, path=["response"]) + assert_matches_type(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(Optional[HTTPDetailsPercentiles], percentile, path=["response"]) + assert_matches_type(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(Optional[HTTPDetailsPercentiles], percentile, path=["response"]) + assert_matches_type(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(Optional[HTTPDetailsPercentiles], percentile, path=["response"]) + assert_matches_type(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(Optional[HTTPDetailsPercentiles], percentile, path=["response"]) + assert_matches_type(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(Optional[HTTPDetailsPercentiles], percentile, path=["response"]) + assert_matches_type(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 0a360ca83d5..f613200ec2a 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, Optional, cast +from typing import Any, cast import pytest @@ -26,7 +26,7 @@ def test_method_live(self, client: Cloudflare) -> None: account_id="01a7362d577a6c3019a474fd6f485823", since_minutes=10, ) - assert_matches_type(Optional[FleetStatusLiveResponse], fleet_status, path=["response"]) + assert_matches_type(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(Optional[FleetStatusLiveResponse], fleet_status, path=["response"]) + assert_matches_type(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(Optional[FleetStatusLiveResponse], fleet_status, path=["response"]) + assert_matches_type(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(Optional[FleetStatusLiveResponse], fleet_status, path=["response"]) + assert_matches_type(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(Optional[FleetStatusLiveResponse], fleet_status, path=["response"]) + assert_matches_type(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(Optional[FleetStatusLiveResponse], fleet_status, path=["response"]) + assert_matches_type(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 1bee3b8453a..ada1507b66c 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, Optional, cast +from typing import Any, cast import pytest @@ -27,7 +27,7 @@ def test_method_get(self, client: Cloudflare) -> None: time_end="string", time_start="string", ) - assert_matches_type(Optional[HTTPDetails], http_test, path=["response"]) + assert_matches_type(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(Optional[HTTPDetails], http_test, path=["response"]) + assert_matches_type(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(Optional[HTTPDetails], http_test, path=["response"]) + assert_matches_type(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(Optional[HTTPDetails], http_test, path=["response"]) + assert_matches_type(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(Optional[HTTPDetails], http_test, path=["response"]) + assert_matches_type(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(Optional[HTTPDetails], http_test, path=["response"]) + assert_matches_type(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(Optional[HTTPDetails], http_test, path=["response"]) + assert_matches_type(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(Optional[HTTPDetails], http_test, path=["response"]) + assert_matches_type(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 4f40f23b02f..8c006167e61 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, Optional, cast +from typing import Any, cast import pytest @@ -31,7 +31,7 @@ def test_method_get(self, client: Cloudflare) -> None: time_end="string", time_start="string", ) - assert_matches_type(Optional[Traceroute], traceroute_test, path=["response"]) + assert_matches_type(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(Optional[Traceroute], traceroute_test, path=["response"]) + assert_matches_type(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(Optional[Traceroute], traceroute_test, path=["response"]) + assert_matches_type(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(Optional[Traceroute], traceroute_test, path=["response"]) + assert_matches_type(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(Optional[NetworkPath], traceroute_test, path=["response"]) + assert_matches_type(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(Optional[NetworkPath], traceroute_test, path=["response"]) + assert_matches_type(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(Optional[NetworkPath], traceroute_test, path=["response"]) + assert_matches_type(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(Optional[TracerouteTestPercentilesResponse], traceroute_test, path=["response"]) + assert_matches_type(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(Optional[TracerouteTestPercentilesResponse], traceroute_test, path=["response"]) + assert_matches_type(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(Optional[TracerouteTestPercentilesResponse], traceroute_test, path=["response"]) + assert_matches_type(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(Optional[TracerouteTestPercentilesResponse], traceroute_test, path=["response"]) + assert_matches_type(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(Optional[Traceroute], traceroute_test, path=["response"]) + assert_matches_type(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(Optional[Traceroute], traceroute_test, path=["response"]) + assert_matches_type(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(Optional[Traceroute], traceroute_test, path=["response"]) + assert_matches_type(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(Optional[Traceroute], traceroute_test, path=["response"]) + assert_matches_type(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(Optional[NetworkPath], traceroute_test, path=["response"]) + assert_matches_type(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(Optional[NetworkPath], traceroute_test, path=["response"]) + assert_matches_type(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(Optional[NetworkPath], traceroute_test, path=["response"]) + assert_matches_type(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(Optional[TracerouteTestPercentilesResponse], traceroute_test, path=["response"]) + assert_matches_type(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(Optional[TracerouteTestPercentilesResponse], traceroute_test, path=["response"]) + assert_matches_type(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(Optional[TracerouteTestPercentilesResponse], traceroute_test, path=["response"]) + assert_matches_type(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(Optional[TracerouteTestPercentilesResponse], traceroute_test, path=["response"]) + assert_matches_type(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 219371cebd9..be18ac1f5b0 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, Optional, cast +from typing import Any, 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(Optional[UniqueDevices], unique_device, path=["response"]) + assert_matches_type(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(Optional[UniqueDevices], unique_device, path=["response"]) + assert_matches_type(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(Optional[UniqueDevices], unique_device, path=["response"]) + assert_matches_type(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(Optional[UniqueDevices], unique_device, path=["response"]) + assert_matches_type(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(Optional[UniqueDevices], unique_device, path=["response"]) + assert_matches_type(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(Optional[UniqueDevices], unique_device, path=["response"]) + assert_matches_type(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(Optional[UniqueDevices], unique_device, path=["response"]) + assert_matches_type(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(Optional[UniqueDevices], unique_device, path=["response"]) + assert_matches_type(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 a0b19f6c881..738dcfcb6ec 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, Optional, cast +from typing import Any, 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(Optional[NetworkPathGetResponse], network_path, path=["response"]) + assert_matches_type(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(Optional[NetworkPathGetResponse], network_path, path=["response"]) + assert_matches_type(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(Optional[NetworkPathGetResponse], network_path, path=["response"]) + assert_matches_type(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(Optional[NetworkPathGetResponse], network_path, path=["response"]) + assert_matches_type(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(Optional[NetworkPathGetResponse], network_path, path=["response"]) + assert_matches_type(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(Optional[NetworkPathGetResponse], network_path, path=["response"]) + assert_matches_type(NetworkPathGetResponse, network_path, path=["response"]) assert cast(Any, response.is_closed) is True