From 18505d808f5e430ee974b4200bfbffc12204c876 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 8 May 2024 03:28:59 +0000 Subject: [PATCH] feat(api): update via SDK Studio (#479) --- .../waf/packages/rule_edit_response.py | 2 - .../waf/packages/rule_list_response.py | 2 - .../types/intel/whois_get_response.py | 2 - .../types/workers/mtls_cert_binding.py | 2 - .../types/workers/mtls_cert_binding_param.py | 2 - .../dex/fleet_status/device_list_response.py | 4 - .../namespaces/test_objects.py | 32 ++-- tests/api_resources/rules/test_lists.py | 136 +++++++------- .../zero_trust/gateway/test_lists.py | 168 +++++++++--------- 9 files changed, 168 insertions(+), 182 deletions(-) diff --git a/src/cloudflare/types/firewall/waf/packages/rule_edit_response.py b/src/cloudflare/types/firewall/waf/packages/rule_edit_response.py index ee9d690caa2..a11036ad2f9 100644 --- a/src/cloudflare/types/firewall/waf/packages/rule_edit_response.py +++ b/src/cloudflare/types/firewall/waf/packages/rule_edit_response.py @@ -80,8 +80,6 @@ class WAFManagedRulesTraditionalAllowRule(BaseModel): allowed_modes: List[Literal["on", "off"]] """Defines the available modes for the current WAF rule.""" - default_mode: object - description: str """The public description of the WAF rule.""" diff --git a/src/cloudflare/types/firewall/waf/packages/rule_list_response.py b/src/cloudflare/types/firewall/waf/packages/rule_list_response.py index 29a688b1a13..5043962f2ed 100644 --- a/src/cloudflare/types/firewall/waf/packages/rule_list_response.py +++ b/src/cloudflare/types/firewall/waf/packages/rule_list_response.py @@ -80,8 +80,6 @@ class WAFManagedRulesTraditionalAllowRule(BaseModel): allowed_modes: List[Literal["on", "off"]] """Defines the available modes for the current WAF rule.""" - default_mode: object - description: str """The public description of the WAF rule.""" diff --git a/src/cloudflare/types/intel/whois_get_response.py b/src/cloudflare/types/intel/whois_get_response.py index 0b740372876..4856a756a9c 100644 --- a/src/cloudflare/types/intel/whois_get_response.py +++ b/src/cloudflare/types/intel/whois_get_response.py @@ -9,8 +9,6 @@ class WhoisGetResponse(BaseModel): - dnnsec: object - domain: str extension: str diff --git a/src/cloudflare/types/workers/mtls_cert_binding.py b/src/cloudflare/types/workers/mtls_cert_binding.py index ce77744c7c7..cdc8618cefb 100644 --- a/src/cloudflare/types/workers/mtls_cert_binding.py +++ b/src/cloudflare/types/workers/mtls_cert_binding.py @@ -9,8 +9,6 @@ class MTLSCERTBinding(BaseModel): - certificate: object - name: str """A JavaScript variable name for the binding.""" diff --git a/src/cloudflare/types/workers/mtls_cert_binding_param.py b/src/cloudflare/types/workers/mtls_cert_binding_param.py index e6d8c865b55..945050492c8 100644 --- a/src/cloudflare/types/workers/mtls_cert_binding_param.py +++ b/src/cloudflare/types/workers/mtls_cert_binding_param.py @@ -8,8 +8,6 @@ class MTLSCERTBindingParam(TypedDict, total=False): - certificate: Required[object] - type: Required[Literal["mtls_certificate"]] """The class of resource that the binding provides.""" diff --git a/src/cloudflare/types/zero_trust/dex/fleet_status/device_list_response.py b/src/cloudflare/types/zero_trust/dex/fleet_status/device_list_response.py index cc90fd794a6..9d8697adeb4 100644 --- a/src/cloudflare/types/zero_trust/dex/fleet_status/device_list_response.py +++ b/src/cloudflare/types/zero_trust/dex/fleet_status/device_list_response.py @@ -16,16 +16,12 @@ class DeviceListResponse(BaseModel): device_id: str = FieldInfo(alias="deviceId") """Device identifier (UUID v4)""" - mode: object - platform: str """Operating system""" status: str """Network status""" - timestamp: object - version: str """WARP client version""" diff --git a/tests/api_resources/durable_objects/namespaces/test_objects.py b/tests/api_resources/durable_objects/namespaces/test_objects.py index a68e090542a..02340cc04b1 100644 --- a/tests/api_resources/durable_objects/namespaces/test_objects.py +++ b/tests/api_resources/durable_objects/namespaces/test_objects.py @@ -20,21 +20,21 @@ class TestObjects: @parametrize def test_method_list(self, client: Cloudflare) -> None: - object = client.durable_objects.namespaces.objects.list( + object_ = client.durable_objects.namespaces.objects.list( "5fd1cafff895419c8bcc647fc64ab8f0", account_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(SyncCursorLimitPagination[DurableObject], object, path=["response"]) + assert_matches_type(SyncCursorLimitPagination[DurableObject], object_, path=["response"]) @parametrize def test_method_list_with_all_params(self, client: Cloudflare) -> None: - object = client.durable_objects.namespaces.objects.list( + object_ = client.durable_objects.namespaces.objects.list( "5fd1cafff895419c8bcc647fc64ab8f0", account_id="023e105f4ecef8ad9ca31a8372d0c353", cursor="AAAAANuhDN7SjacTnSVsDu3WW1Lvst6dxJGTjRY5BhxPXdf6L6uTcpd_NVtjhn11OUYRsVEykxoUwF-JQU4dn6QylZSKTOJuG0indrdn_MlHpMRtsxgXjs-RPdHYIVm3odE_uvEQ_dTQGFm8oikZMohns34DLBgrQpc", limit=10, ) - assert_matches_type(SyncCursorLimitPagination[DurableObject], object, path=["response"]) + assert_matches_type(SyncCursorLimitPagination[DurableObject], object_, path=["response"]) @parametrize def test_raw_response_list(self, client: Cloudflare) -> None: @@ -45,8 +45,8 @@ 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" - object = response.parse() - assert_matches_type(SyncCursorLimitPagination[DurableObject], object, path=["response"]) + object_ = response.parse() + assert_matches_type(SyncCursorLimitPagination[DurableObject], object_, path=["response"]) @parametrize def test_streaming_response_list(self, client: Cloudflare) -> None: @@ -57,8 +57,8 @@ def test_streaming_response_list(self, client: Cloudflare) -> None: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" - object = response.parse() - assert_matches_type(SyncCursorLimitPagination[DurableObject], object, path=["response"]) + object_ = response.parse() + assert_matches_type(SyncCursorLimitPagination[DurableObject], object_, path=["response"]) assert cast(Any, response.is_closed) is True @@ -82,21 +82,21 @@ class TestAsyncObjects: @parametrize async def test_method_list(self, async_client: AsyncCloudflare) -> None: - object = await async_client.durable_objects.namespaces.objects.list( + object_ = await async_client.durable_objects.namespaces.objects.list( "5fd1cafff895419c8bcc647fc64ab8f0", account_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(AsyncCursorLimitPagination[DurableObject], object, path=["response"]) + assert_matches_type(AsyncCursorLimitPagination[DurableObject], object_, path=["response"]) @parametrize async def test_method_list_with_all_params(self, async_client: AsyncCloudflare) -> None: - object = await async_client.durable_objects.namespaces.objects.list( + object_ = await async_client.durable_objects.namespaces.objects.list( "5fd1cafff895419c8bcc647fc64ab8f0", account_id="023e105f4ecef8ad9ca31a8372d0c353", cursor="AAAAANuhDN7SjacTnSVsDu3WW1Lvst6dxJGTjRY5BhxPXdf6L6uTcpd_NVtjhn11OUYRsVEykxoUwF-JQU4dn6QylZSKTOJuG0indrdn_MlHpMRtsxgXjs-RPdHYIVm3odE_uvEQ_dTQGFm8oikZMohns34DLBgrQpc", limit=10, ) - assert_matches_type(AsyncCursorLimitPagination[DurableObject], object, path=["response"]) + assert_matches_type(AsyncCursorLimitPagination[DurableObject], object_, path=["response"]) @parametrize async def test_raw_response_list(self, async_client: AsyncCloudflare) -> None: @@ -107,8 +107,8 @@ 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" - object = await response.parse() - assert_matches_type(AsyncCursorLimitPagination[DurableObject], object, path=["response"]) + object_ = await response.parse() + assert_matches_type(AsyncCursorLimitPagination[DurableObject], object_, path=["response"]) @parametrize async def test_streaming_response_list(self, async_client: AsyncCloudflare) -> None: @@ -119,8 +119,8 @@ async def test_streaming_response_list(self, async_client: AsyncCloudflare) -> N assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" - object = await response.parse() - assert_matches_type(AsyncCursorLimitPagination[DurableObject], object, path=["response"]) + object_ = await response.parse() + assert_matches_type(AsyncCursorLimitPagination[DurableObject], object_, path=["response"]) assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/rules/test_lists.py b/tests/api_resources/rules/test_lists.py index 9c69721f84e..b42d1525efc 100644 --- a/tests/api_resources/rules/test_lists.py +++ b/tests/api_resources/rules/test_lists.py @@ -21,23 +21,23 @@ class TestLists: @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize def test_method_create(self, client: Cloudflare) -> None: - list = client.rules.lists.create( + list_ = client.rules.lists.create( account_id="023e105f4ecef8ad9ca31a8372d0c353", kind="ip", name="list1", ) - assert_matches_type(Optional[ListsList], list, path=["response"]) + assert_matches_type(Optional[ListsList], list_, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize def test_method_create_with_all_params(self, client: Cloudflare) -> None: - list = client.rules.lists.create( + list_ = client.rules.lists.create( account_id="023e105f4ecef8ad9ca31a8372d0c353", kind="ip", name="list1", description="This is a note", ) - assert_matches_type(Optional[ListsList], list, path=["response"]) + assert_matches_type(Optional[ListsList], list_, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -50,8 +50,8 @@ def test_raw_response_create(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" - list = response.parse() - assert_matches_type(Optional[ListsList], list, path=["response"]) + list_ = response.parse() + assert_matches_type(Optional[ListsList], list_, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -64,8 +64,8 @@ def test_streaming_response_create(self, client: Cloudflare) -> None: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" - list = response.parse() - assert_matches_type(Optional[ListsList], list, path=["response"]) + list_ = response.parse() + assert_matches_type(Optional[ListsList], list_, path=["response"]) assert cast(Any, response.is_closed) is True @@ -82,21 +82,21 @@ def test_path_params_create(self, client: Cloudflare) -> None: @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize def test_method_update(self, client: Cloudflare) -> None: - list = client.rules.lists.update( + list_ = client.rules.lists.update( "2c0fc9fa937b11eaa1b71c4d701ab86e", account_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(Optional[ListsList], list, path=["response"]) + assert_matches_type(Optional[ListsList], list_, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize def test_method_update_with_all_params(self, client: Cloudflare) -> None: - list = client.rules.lists.update( + list_ = client.rules.lists.update( "2c0fc9fa937b11eaa1b71c4d701ab86e", account_id="023e105f4ecef8ad9ca31a8372d0c353", description="This is a note", ) - assert_matches_type(Optional[ListsList], list, path=["response"]) + assert_matches_type(Optional[ListsList], list_, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -108,8 +108,8 @@ def test_raw_response_update(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" - list = response.parse() - assert_matches_type(Optional[ListsList], list, path=["response"]) + list_ = response.parse() + assert_matches_type(Optional[ListsList], list_, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -121,8 +121,8 @@ def test_streaming_response_update(self, client: Cloudflare) -> None: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" - list = response.parse() - assert_matches_type(Optional[ListsList], list, path=["response"]) + list_ = response.parse() + assert_matches_type(Optional[ListsList], list_, path=["response"]) assert cast(Any, response.is_closed) is True @@ -143,10 +143,10 @@ def test_path_params_update(self, client: Cloudflare) -> None: @parametrize def test_method_list(self, client: Cloudflare) -> None: - list = client.rules.lists.list( + list_ = client.rules.lists.list( account_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(SyncSinglePage[ListsList], list, path=["response"]) + assert_matches_type(SyncSinglePage[ListsList], list_, path=["response"]) @parametrize def test_raw_response_list(self, client: Cloudflare) -> None: @@ -156,8 +156,8 @@ 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" - list = response.parse() - assert_matches_type(SyncSinglePage[ListsList], list, path=["response"]) + list_ = response.parse() + assert_matches_type(SyncSinglePage[ListsList], list_, path=["response"]) @parametrize def test_streaming_response_list(self, client: Cloudflare) -> None: @@ -167,8 +167,8 @@ def test_streaming_response_list(self, client: Cloudflare) -> None: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" - list = response.parse() - assert_matches_type(SyncSinglePage[ListsList], list, path=["response"]) + list_ = response.parse() + assert_matches_type(SyncSinglePage[ListsList], list_, path=["response"]) assert cast(Any, response.is_closed) is True @@ -181,11 +181,11 @@ def test_path_params_list(self, client: Cloudflare) -> None: @parametrize def test_method_delete(self, client: Cloudflare) -> None: - list = client.rules.lists.delete( + list_ = client.rules.lists.delete( "2c0fc9fa937b11eaa1b71c4d701ab86e", account_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(Optional[ListDeleteResponse], list, path=["response"]) + assert_matches_type(Optional[ListDeleteResponse], list_, path=["response"]) @parametrize def test_raw_response_delete(self, client: Cloudflare) -> None: @@ -196,8 +196,8 @@ def test_raw_response_delete(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" - list = response.parse() - assert_matches_type(Optional[ListDeleteResponse], list, path=["response"]) + list_ = response.parse() + assert_matches_type(Optional[ListDeleteResponse], list_, path=["response"]) @parametrize def test_streaming_response_delete(self, client: Cloudflare) -> None: @@ -208,8 +208,8 @@ def test_streaming_response_delete(self, client: Cloudflare) -> None: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" - list = response.parse() - assert_matches_type(Optional[ListDeleteResponse], list, path=["response"]) + list_ = response.parse() + assert_matches_type(Optional[ListDeleteResponse], list_, path=["response"]) assert cast(Any, response.is_closed) is True @@ -230,11 +230,11 @@ def test_path_params_delete(self, client: Cloudflare) -> None: @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize def test_method_get(self, client: Cloudflare) -> None: - list = client.rules.lists.get( + list_ = client.rules.lists.get( "2c0fc9fa937b11eaa1b71c4d701ab86e", account_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(Optional[ListsList], list, path=["response"]) + assert_matches_type(Optional[ListsList], list_, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -246,8 +246,8 @@ 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" - list = response.parse() - assert_matches_type(Optional[ListsList], list, path=["response"]) + list_ = response.parse() + assert_matches_type(Optional[ListsList], list_, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -259,8 +259,8 @@ def test_streaming_response_get(self, client: Cloudflare) -> None: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" - list = response.parse() - assert_matches_type(Optional[ListsList], list, path=["response"]) + list_ = response.parse() + assert_matches_type(Optional[ListsList], list_, path=["response"]) assert cast(Any, response.is_closed) is True @@ -286,23 +286,23 @@ class TestAsyncLists: @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize async def test_method_create(self, async_client: AsyncCloudflare) -> None: - list = await async_client.rules.lists.create( + list_ = await async_client.rules.lists.create( account_id="023e105f4ecef8ad9ca31a8372d0c353", kind="ip", name="list1", ) - assert_matches_type(Optional[ListsList], list, path=["response"]) + assert_matches_type(Optional[ListsList], list_, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize async def test_method_create_with_all_params(self, async_client: AsyncCloudflare) -> None: - list = await async_client.rules.lists.create( + list_ = await async_client.rules.lists.create( account_id="023e105f4ecef8ad9ca31a8372d0c353", kind="ip", name="list1", description="This is a note", ) - assert_matches_type(Optional[ListsList], list, path=["response"]) + assert_matches_type(Optional[ListsList], list_, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -315,8 +315,8 @@ async def test_raw_response_create(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" - list = await response.parse() - assert_matches_type(Optional[ListsList], list, path=["response"]) + list_ = await response.parse() + assert_matches_type(Optional[ListsList], list_, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -329,8 +329,8 @@ async def test_streaming_response_create(self, async_client: AsyncCloudflare) -> assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" - list = await response.parse() - assert_matches_type(Optional[ListsList], list, path=["response"]) + list_ = await response.parse() + assert_matches_type(Optional[ListsList], list_, path=["response"]) assert cast(Any, response.is_closed) is True @@ -347,21 +347,21 @@ async def test_path_params_create(self, async_client: AsyncCloudflare) -> None: @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize async def test_method_update(self, async_client: AsyncCloudflare) -> None: - list = await async_client.rules.lists.update( + list_ = await async_client.rules.lists.update( "2c0fc9fa937b11eaa1b71c4d701ab86e", account_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(Optional[ListsList], list, path=["response"]) + assert_matches_type(Optional[ListsList], list_, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize async def test_method_update_with_all_params(self, async_client: AsyncCloudflare) -> None: - list = await async_client.rules.lists.update( + list_ = await async_client.rules.lists.update( "2c0fc9fa937b11eaa1b71c4d701ab86e", account_id="023e105f4ecef8ad9ca31a8372d0c353", description="This is a note", ) - assert_matches_type(Optional[ListsList], list, path=["response"]) + assert_matches_type(Optional[ListsList], list_, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -373,8 +373,8 @@ async def test_raw_response_update(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" - list = await response.parse() - assert_matches_type(Optional[ListsList], list, path=["response"]) + list_ = await response.parse() + assert_matches_type(Optional[ListsList], list_, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -386,8 +386,8 @@ async def test_streaming_response_update(self, async_client: AsyncCloudflare) -> assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" - list = await response.parse() - assert_matches_type(Optional[ListsList], list, path=["response"]) + list_ = await response.parse() + assert_matches_type(Optional[ListsList], list_, path=["response"]) assert cast(Any, response.is_closed) is True @@ -408,10 +408,10 @@ async def test_path_params_update(self, async_client: AsyncCloudflare) -> None: @parametrize async def test_method_list(self, async_client: AsyncCloudflare) -> None: - list = await async_client.rules.lists.list( + list_ = await async_client.rules.lists.list( account_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(AsyncSinglePage[ListsList], list, path=["response"]) + assert_matches_type(AsyncSinglePage[ListsList], list_, path=["response"]) @parametrize async def test_raw_response_list(self, async_client: AsyncCloudflare) -> None: @@ -421,8 +421,8 @@ 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" - list = await response.parse() - assert_matches_type(AsyncSinglePage[ListsList], list, path=["response"]) + list_ = await response.parse() + assert_matches_type(AsyncSinglePage[ListsList], list_, path=["response"]) @parametrize async def test_streaming_response_list(self, async_client: AsyncCloudflare) -> None: @@ -432,8 +432,8 @@ async def test_streaming_response_list(self, async_client: AsyncCloudflare) -> N assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" - list = await response.parse() - assert_matches_type(AsyncSinglePage[ListsList], list, path=["response"]) + list_ = await response.parse() + assert_matches_type(AsyncSinglePage[ListsList], list_, path=["response"]) assert cast(Any, response.is_closed) is True @@ -446,11 +446,11 @@ async def test_path_params_list(self, async_client: AsyncCloudflare) -> None: @parametrize async def test_method_delete(self, async_client: AsyncCloudflare) -> None: - list = await async_client.rules.lists.delete( + list_ = await async_client.rules.lists.delete( "2c0fc9fa937b11eaa1b71c4d701ab86e", account_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(Optional[ListDeleteResponse], list, path=["response"]) + assert_matches_type(Optional[ListDeleteResponse], list_, path=["response"]) @parametrize async def test_raw_response_delete(self, async_client: AsyncCloudflare) -> None: @@ -461,8 +461,8 @@ async def test_raw_response_delete(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" - list = await response.parse() - assert_matches_type(Optional[ListDeleteResponse], list, path=["response"]) + list_ = await response.parse() + assert_matches_type(Optional[ListDeleteResponse], list_, path=["response"]) @parametrize async def test_streaming_response_delete(self, async_client: AsyncCloudflare) -> None: @@ -473,8 +473,8 @@ async def test_streaming_response_delete(self, async_client: AsyncCloudflare) -> assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" - list = await response.parse() - assert_matches_type(Optional[ListDeleteResponse], list, path=["response"]) + list_ = await response.parse() + assert_matches_type(Optional[ListDeleteResponse], list_, path=["response"]) assert cast(Any, response.is_closed) is True @@ -495,11 +495,11 @@ async def test_path_params_delete(self, async_client: AsyncCloudflare) -> None: @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize async def test_method_get(self, async_client: AsyncCloudflare) -> None: - list = await async_client.rules.lists.get( + list_ = await async_client.rules.lists.get( "2c0fc9fa937b11eaa1b71c4d701ab86e", account_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(Optional[ListsList], list, path=["response"]) + assert_matches_type(Optional[ListsList], list_, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -511,8 +511,8 @@ 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" - list = await response.parse() - assert_matches_type(Optional[ListsList], list, path=["response"]) + list_ = await response.parse() + assert_matches_type(Optional[ListsList], list_, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -524,8 +524,8 @@ async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> No assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" - list = await response.parse() - assert_matches_type(Optional[ListsList], list, path=["response"]) + list_ = await response.parse() + assert_matches_type(Optional[ListsList], list_, path=["response"]) assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/zero_trust/gateway/test_lists.py b/tests/api_resources/zero_trust/gateway/test_lists.py index fa129ea0f26..cfd4e978d0f 100644 --- a/tests/api_resources/zero_trust/gateway/test_lists.py +++ b/tests/api_resources/zero_trust/gateway/test_lists.py @@ -24,23 +24,23 @@ class TestLists: @parametrize def test_method_create(self, client: Cloudflare) -> None: - list = client.zero_trust.gateway.lists.create( + list_ = client.zero_trust.gateway.lists.create( account_id="699d98642c564d2e855e9661899b7252", name="Admin Serial Numbers", type="SERIAL", ) - assert_matches_type(Optional[ListCreateResponse], list, path=["response"]) + assert_matches_type(Optional[ListCreateResponse], list_, path=["response"]) @parametrize def test_method_create_with_all_params(self, client: Cloudflare) -> None: - list = client.zero_trust.gateway.lists.create( + list_ = client.zero_trust.gateway.lists.create( account_id="699d98642c564d2e855e9661899b7252", name="Admin Serial Numbers", type="SERIAL", description="The serial numbers for administrators", items=[{"value": "8GE8721REF"}, {"value": "8GE8721REF"}, {"value": "8GE8721REF"}], ) - assert_matches_type(Optional[ListCreateResponse], list, path=["response"]) + assert_matches_type(Optional[ListCreateResponse], list_, path=["response"]) @parametrize def test_raw_response_create(self, client: Cloudflare) -> None: @@ -52,8 +52,8 @@ def test_raw_response_create(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" - list = response.parse() - assert_matches_type(Optional[ListCreateResponse], list, path=["response"]) + list_ = response.parse() + assert_matches_type(Optional[ListCreateResponse], list_, path=["response"]) @parametrize def test_streaming_response_create(self, client: Cloudflare) -> None: @@ -65,8 +65,8 @@ def test_streaming_response_create(self, client: Cloudflare) -> None: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" - list = response.parse() - assert_matches_type(Optional[ListCreateResponse], list, path=["response"]) + list_ = response.parse() + assert_matches_type(Optional[ListCreateResponse], list_, path=["response"]) assert cast(Any, response.is_closed) is True @@ -81,22 +81,22 @@ def test_path_params_create(self, client: Cloudflare) -> None: @parametrize def test_method_update(self, client: Cloudflare) -> None: - list = client.zero_trust.gateway.lists.update( + list_ = client.zero_trust.gateway.lists.update( "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", account_id="699d98642c564d2e855e9661899b7252", name="Admin Serial Numbers", ) - assert_matches_type(Optional[GatewayList], list, path=["response"]) + assert_matches_type(Optional[GatewayList], list_, path=["response"]) @parametrize def test_method_update_with_all_params(self, client: Cloudflare) -> None: - list = client.zero_trust.gateway.lists.update( + list_ = client.zero_trust.gateway.lists.update( "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", account_id="699d98642c564d2e855e9661899b7252", name="Admin Serial Numbers", description="The serial numbers for administrators", ) - assert_matches_type(Optional[GatewayList], list, path=["response"]) + assert_matches_type(Optional[GatewayList], list_, path=["response"]) @parametrize def test_raw_response_update(self, client: Cloudflare) -> None: @@ -108,8 +108,8 @@ def test_raw_response_update(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" - list = response.parse() - assert_matches_type(Optional[GatewayList], list, path=["response"]) + list_ = response.parse() + assert_matches_type(Optional[GatewayList], list_, path=["response"]) @parametrize def test_streaming_response_update(self, client: Cloudflare) -> None: @@ -121,8 +121,8 @@ def test_streaming_response_update(self, client: Cloudflare) -> None: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" - list = response.parse() - assert_matches_type(Optional[GatewayList], list, path=["response"]) + list_ = response.parse() + assert_matches_type(Optional[GatewayList], list_, path=["response"]) assert cast(Any, response.is_closed) is True @@ -144,10 +144,10 @@ def test_path_params_update(self, client: Cloudflare) -> None: @parametrize def test_method_list(self, client: Cloudflare) -> None: - list = client.zero_trust.gateway.lists.list( + list_ = client.zero_trust.gateway.lists.list( account_id="699d98642c564d2e855e9661899b7252", ) - assert_matches_type(SyncSinglePage[GatewayList], list, path=["response"]) + assert_matches_type(SyncSinglePage[GatewayList], list_, path=["response"]) @parametrize def test_raw_response_list(self, client: Cloudflare) -> None: @@ -157,8 +157,8 @@ 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" - list = response.parse() - assert_matches_type(SyncSinglePage[GatewayList], list, path=["response"]) + list_ = response.parse() + assert_matches_type(SyncSinglePage[GatewayList], list_, path=["response"]) @parametrize def test_streaming_response_list(self, client: Cloudflare) -> None: @@ -168,8 +168,8 @@ def test_streaming_response_list(self, client: Cloudflare) -> None: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" - list = response.parse() - assert_matches_type(SyncSinglePage[GatewayList], list, path=["response"]) + list_ = response.parse() + assert_matches_type(SyncSinglePage[GatewayList], list_, path=["response"]) assert cast(Any, response.is_closed) is True @@ -182,11 +182,11 @@ def test_path_params_list(self, client: Cloudflare) -> None: @parametrize def test_method_delete(self, client: Cloudflare) -> None: - list = client.zero_trust.gateway.lists.delete( + list_ = client.zero_trust.gateway.lists.delete( "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", account_id="699d98642c564d2e855e9661899b7252", ) - assert_matches_type(Optional[ListDeleteResponse], list, path=["response"]) + assert_matches_type(Optional[ListDeleteResponse], list_, path=["response"]) @parametrize def test_raw_response_delete(self, client: Cloudflare) -> None: @@ -197,8 +197,8 @@ def test_raw_response_delete(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" - list = response.parse() - assert_matches_type(Optional[ListDeleteResponse], list, path=["response"]) + list_ = response.parse() + assert_matches_type(Optional[ListDeleteResponse], list_, path=["response"]) @parametrize def test_streaming_response_delete(self, client: Cloudflare) -> None: @@ -209,8 +209,8 @@ def test_streaming_response_delete(self, client: Cloudflare) -> None: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" - list = response.parse() - assert_matches_type(Optional[ListDeleteResponse], list, path=["response"]) + list_ = response.parse() + assert_matches_type(Optional[ListDeleteResponse], list_, path=["response"]) assert cast(Any, response.is_closed) is True @@ -230,21 +230,21 @@ def test_path_params_delete(self, client: Cloudflare) -> None: @parametrize def test_method_edit(self, client: Cloudflare) -> None: - list = client.zero_trust.gateway.lists.edit( + list_ = client.zero_trust.gateway.lists.edit( "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", account_id="699d98642c564d2e855e9661899b7252", ) - assert_matches_type(Optional[GatewayList], list, path=["response"]) + assert_matches_type(Optional[GatewayList], list_, path=["response"]) @parametrize def test_method_edit_with_all_params(self, client: Cloudflare) -> None: - list = client.zero_trust.gateway.lists.edit( + list_ = client.zero_trust.gateway.lists.edit( "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", account_id="699d98642c564d2e855e9661899b7252", append=[{"value": "8GE8721REF"}, {"value": "8GE8721REF"}, {"value": "8GE8721REF"}], remove=["8GE8721REF", "8GE8721REF", "8GE8721REF"], ) - assert_matches_type(Optional[GatewayList], list, path=["response"]) + assert_matches_type(Optional[GatewayList], list_, path=["response"]) @parametrize def test_raw_response_edit(self, client: Cloudflare) -> None: @@ -255,8 +255,8 @@ def test_raw_response_edit(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" - list = response.parse() - assert_matches_type(Optional[GatewayList], list, path=["response"]) + list_ = response.parse() + assert_matches_type(Optional[GatewayList], list_, path=["response"]) @parametrize def test_streaming_response_edit(self, client: Cloudflare) -> None: @@ -267,8 +267,8 @@ def test_streaming_response_edit(self, client: Cloudflare) -> None: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" - list = response.parse() - assert_matches_type(Optional[GatewayList], list, path=["response"]) + list_ = response.parse() + assert_matches_type(Optional[GatewayList], list_, path=["response"]) assert cast(Any, response.is_closed) is True @@ -288,11 +288,11 @@ def test_path_params_edit(self, client: Cloudflare) -> None: @parametrize def test_method_get(self, client: Cloudflare) -> None: - list = client.zero_trust.gateway.lists.get( + list_ = client.zero_trust.gateway.lists.get( "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", account_id="699d98642c564d2e855e9661899b7252", ) - assert_matches_type(Optional[GatewayList], list, path=["response"]) + assert_matches_type(Optional[GatewayList], list_, path=["response"]) @parametrize def test_raw_response_get(self, client: Cloudflare) -> None: @@ -303,8 +303,8 @@ 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" - list = response.parse() - assert_matches_type(Optional[GatewayList], list, path=["response"]) + list_ = response.parse() + assert_matches_type(Optional[GatewayList], list_, path=["response"]) @parametrize def test_streaming_response_get(self, client: Cloudflare) -> None: @@ -315,8 +315,8 @@ def test_streaming_response_get(self, client: Cloudflare) -> None: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" - list = response.parse() - assert_matches_type(Optional[GatewayList], list, path=["response"]) + list_ = response.parse() + assert_matches_type(Optional[GatewayList], list_, path=["response"]) assert cast(Any, response.is_closed) is True @@ -340,23 +340,23 @@ class TestAsyncLists: @parametrize async def test_method_create(self, async_client: AsyncCloudflare) -> None: - list = await async_client.zero_trust.gateway.lists.create( + list_ = await async_client.zero_trust.gateway.lists.create( account_id="699d98642c564d2e855e9661899b7252", name="Admin Serial Numbers", type="SERIAL", ) - assert_matches_type(Optional[ListCreateResponse], list, path=["response"]) + assert_matches_type(Optional[ListCreateResponse], list_, path=["response"]) @parametrize async def test_method_create_with_all_params(self, async_client: AsyncCloudflare) -> None: - list = await async_client.zero_trust.gateway.lists.create( + list_ = await async_client.zero_trust.gateway.lists.create( account_id="699d98642c564d2e855e9661899b7252", name="Admin Serial Numbers", type="SERIAL", description="The serial numbers for administrators", items=[{"value": "8GE8721REF"}, {"value": "8GE8721REF"}, {"value": "8GE8721REF"}], ) - assert_matches_type(Optional[ListCreateResponse], list, path=["response"]) + assert_matches_type(Optional[ListCreateResponse], list_, path=["response"]) @parametrize async def test_raw_response_create(self, async_client: AsyncCloudflare) -> None: @@ -368,8 +368,8 @@ async def test_raw_response_create(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" - list = await response.parse() - assert_matches_type(Optional[ListCreateResponse], list, path=["response"]) + list_ = await response.parse() + assert_matches_type(Optional[ListCreateResponse], list_, path=["response"]) @parametrize async def test_streaming_response_create(self, async_client: AsyncCloudflare) -> None: @@ -381,8 +381,8 @@ async def test_streaming_response_create(self, async_client: AsyncCloudflare) -> assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" - list = await response.parse() - assert_matches_type(Optional[ListCreateResponse], list, path=["response"]) + list_ = await response.parse() + assert_matches_type(Optional[ListCreateResponse], list_, path=["response"]) assert cast(Any, response.is_closed) is True @@ -397,22 +397,22 @@ async def test_path_params_create(self, async_client: AsyncCloudflare) -> None: @parametrize async def test_method_update(self, async_client: AsyncCloudflare) -> None: - list = await async_client.zero_trust.gateway.lists.update( + list_ = await async_client.zero_trust.gateway.lists.update( "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", account_id="699d98642c564d2e855e9661899b7252", name="Admin Serial Numbers", ) - assert_matches_type(Optional[GatewayList], list, path=["response"]) + assert_matches_type(Optional[GatewayList], list_, path=["response"]) @parametrize async def test_method_update_with_all_params(self, async_client: AsyncCloudflare) -> None: - list = await async_client.zero_trust.gateway.lists.update( + list_ = await async_client.zero_trust.gateway.lists.update( "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", account_id="699d98642c564d2e855e9661899b7252", name="Admin Serial Numbers", description="The serial numbers for administrators", ) - assert_matches_type(Optional[GatewayList], list, path=["response"]) + assert_matches_type(Optional[GatewayList], list_, path=["response"]) @parametrize async def test_raw_response_update(self, async_client: AsyncCloudflare) -> None: @@ -424,8 +424,8 @@ async def test_raw_response_update(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" - list = await response.parse() - assert_matches_type(Optional[GatewayList], list, path=["response"]) + list_ = await response.parse() + assert_matches_type(Optional[GatewayList], list_, path=["response"]) @parametrize async def test_streaming_response_update(self, async_client: AsyncCloudflare) -> None: @@ -437,8 +437,8 @@ async def test_streaming_response_update(self, async_client: AsyncCloudflare) -> assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" - list = await response.parse() - assert_matches_type(Optional[GatewayList], list, path=["response"]) + list_ = await response.parse() + assert_matches_type(Optional[GatewayList], list_, path=["response"]) assert cast(Any, response.is_closed) is True @@ -460,10 +460,10 @@ async def test_path_params_update(self, async_client: AsyncCloudflare) -> None: @parametrize async def test_method_list(self, async_client: AsyncCloudflare) -> None: - list = await async_client.zero_trust.gateway.lists.list( + list_ = await async_client.zero_trust.gateway.lists.list( account_id="699d98642c564d2e855e9661899b7252", ) - assert_matches_type(AsyncSinglePage[GatewayList], list, path=["response"]) + assert_matches_type(AsyncSinglePage[GatewayList], list_, path=["response"]) @parametrize async def test_raw_response_list(self, async_client: AsyncCloudflare) -> None: @@ -473,8 +473,8 @@ 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" - list = await response.parse() - assert_matches_type(AsyncSinglePage[GatewayList], list, path=["response"]) + list_ = await response.parse() + assert_matches_type(AsyncSinglePage[GatewayList], list_, path=["response"]) @parametrize async def test_streaming_response_list(self, async_client: AsyncCloudflare) -> None: @@ -484,8 +484,8 @@ async def test_streaming_response_list(self, async_client: AsyncCloudflare) -> N assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" - list = await response.parse() - assert_matches_type(AsyncSinglePage[GatewayList], list, path=["response"]) + list_ = await response.parse() + assert_matches_type(AsyncSinglePage[GatewayList], list_, path=["response"]) assert cast(Any, response.is_closed) is True @@ -498,11 +498,11 @@ async def test_path_params_list(self, async_client: AsyncCloudflare) -> None: @parametrize async def test_method_delete(self, async_client: AsyncCloudflare) -> None: - list = await async_client.zero_trust.gateway.lists.delete( + list_ = await async_client.zero_trust.gateway.lists.delete( "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", account_id="699d98642c564d2e855e9661899b7252", ) - assert_matches_type(Optional[ListDeleteResponse], list, path=["response"]) + assert_matches_type(Optional[ListDeleteResponse], list_, path=["response"]) @parametrize async def test_raw_response_delete(self, async_client: AsyncCloudflare) -> None: @@ -513,8 +513,8 @@ async def test_raw_response_delete(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" - list = await response.parse() - assert_matches_type(Optional[ListDeleteResponse], list, path=["response"]) + list_ = await response.parse() + assert_matches_type(Optional[ListDeleteResponse], list_, path=["response"]) @parametrize async def test_streaming_response_delete(self, async_client: AsyncCloudflare) -> None: @@ -525,8 +525,8 @@ async def test_streaming_response_delete(self, async_client: AsyncCloudflare) -> assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" - list = await response.parse() - assert_matches_type(Optional[ListDeleteResponse], list, path=["response"]) + list_ = await response.parse() + assert_matches_type(Optional[ListDeleteResponse], list_, path=["response"]) assert cast(Any, response.is_closed) is True @@ -546,21 +546,21 @@ async def test_path_params_delete(self, async_client: AsyncCloudflare) -> None: @parametrize async def test_method_edit(self, async_client: AsyncCloudflare) -> None: - list = await async_client.zero_trust.gateway.lists.edit( + list_ = await async_client.zero_trust.gateway.lists.edit( "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", account_id="699d98642c564d2e855e9661899b7252", ) - assert_matches_type(Optional[GatewayList], list, path=["response"]) + assert_matches_type(Optional[GatewayList], list_, path=["response"]) @parametrize async def test_method_edit_with_all_params(self, async_client: AsyncCloudflare) -> None: - list = await async_client.zero_trust.gateway.lists.edit( + list_ = await async_client.zero_trust.gateway.lists.edit( "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", account_id="699d98642c564d2e855e9661899b7252", append=[{"value": "8GE8721REF"}, {"value": "8GE8721REF"}, {"value": "8GE8721REF"}], remove=["8GE8721REF", "8GE8721REF", "8GE8721REF"], ) - assert_matches_type(Optional[GatewayList], list, path=["response"]) + assert_matches_type(Optional[GatewayList], list_, path=["response"]) @parametrize async def test_raw_response_edit(self, async_client: AsyncCloudflare) -> None: @@ -571,8 +571,8 @@ async def test_raw_response_edit(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" - list = await response.parse() - assert_matches_type(Optional[GatewayList], list, path=["response"]) + list_ = await response.parse() + assert_matches_type(Optional[GatewayList], list_, path=["response"]) @parametrize async def test_streaming_response_edit(self, async_client: AsyncCloudflare) -> None: @@ -583,8 +583,8 @@ async def test_streaming_response_edit(self, async_client: AsyncCloudflare) -> N assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" - list = await response.parse() - assert_matches_type(Optional[GatewayList], list, path=["response"]) + list_ = await response.parse() + assert_matches_type(Optional[GatewayList], list_, path=["response"]) assert cast(Any, response.is_closed) is True @@ -604,11 +604,11 @@ async def test_path_params_edit(self, async_client: AsyncCloudflare) -> None: @parametrize async def test_method_get(self, async_client: AsyncCloudflare) -> None: - list = await async_client.zero_trust.gateway.lists.get( + list_ = await async_client.zero_trust.gateway.lists.get( "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", account_id="699d98642c564d2e855e9661899b7252", ) - assert_matches_type(Optional[GatewayList], list, path=["response"]) + assert_matches_type(Optional[GatewayList], list_, path=["response"]) @parametrize async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: @@ -619,8 +619,8 @@ 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" - list = await response.parse() - assert_matches_type(Optional[GatewayList], list, path=["response"]) + list_ = await response.parse() + assert_matches_type(Optional[GatewayList], list_, path=["response"]) @parametrize async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> None: @@ -631,8 +631,8 @@ async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> No assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" - list = await response.parse() - assert_matches_type(Optional[GatewayList], list, path=["response"]) + list_ = await response.parse() + assert_matches_type(Optional[GatewayList], list_, path=["response"]) assert cast(Any, response.is_closed) is True