diff --git a/.stats.yml b/.stats.yml index 8403633201a..17dbf61025e 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 1254 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-23739fcf19a78a56ef68373e3bb613cb28b383ba52681e112e079f18e8f5c3cb.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-21c3f4e3559582f365d9afb16ec8ccfadc79aa7fd5c5d295a3f1bebfa28765ca.yml diff --git a/api.md b/api.md index b00839577e9..a2e72a6a5dd 100644 --- a/api.md +++ b/api.md @@ -1098,11 +1098,11 @@ from cloudflare.types.dns import ( Methods: -- client.dns.firewall.create(\*, account_id, \*\*params) -> Firewall +- client.dns.firewall.create(\*, account_id, \*\*params) -> Optional - client.dns.firewall.list(\*, account_id, \*\*params) -> SyncV4PagePaginationArray[Firewall] -- client.dns.firewall.delete(dns_firewall_id, \*, account_id) -> FirewallDeleteResponse -- client.dns.firewall.edit(dns_firewall_id, \*, account_id, \*\*params) -> Firewall -- client.dns.firewall.get(dns_firewall_id, \*, account_id) -> Firewall +- client.dns.firewall.delete(dns_firewall_id, \*, account_id) -> Optional +- client.dns.firewall.edit(dns_firewall_id, \*, account_id, \*\*params) -> Optional +- client.dns.firewall.get(dns_firewall_id, \*, account_id) -> Optional ### Analytics diff --git a/src/cloudflare/resources/dns/firewall/firewall.py b/src/cloudflare/resources/dns/firewall/firewall.py index dd82f5448c3..7bfa583769e 100644 --- a/src/cloudflare/resources/dns/firewall/firewall.py +++ b/src/cloudflare/resources/dns/firewall/firewall.py @@ -77,7 +77,7 @@ def create( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Firewall: + ) -> Optional[Firewall]: """ Create a configured DNS Firewall Cluster. @@ -136,9 +136,9 @@ def create( extra_query=extra_query, extra_body=extra_body, timeout=timeout, - post_parser=ResultWrapper[Firewall]._unwrapper, + post_parser=ResultWrapper[Optional[Firewall]]._unwrapper, ), - cast_to=cast(Type[Firewall], ResultWrapper[Firewall]), + cast_to=cast(Type[Optional[Firewall]], ResultWrapper[Firewall]), ) def list( @@ -204,7 +204,7 @@ def delete( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> FirewallDeleteResponse: + ) -> Optional[FirewallDeleteResponse]: """ Delete a configured DNS Firewall Cluster. @@ -232,9 +232,9 @@ def delete( extra_query=extra_query, extra_body=extra_body, timeout=timeout, - post_parser=ResultWrapper[FirewallDeleteResponse]._unwrapper, + post_parser=ResultWrapper[Optional[FirewallDeleteResponse]]._unwrapper, ), - cast_to=cast(Type[FirewallDeleteResponse], ResultWrapper[FirewallDeleteResponse]), + cast_to=cast(Type[Optional[FirewallDeleteResponse]], ResultWrapper[FirewallDeleteResponse]), ) def edit( @@ -242,6 +242,7 @@ def edit( dns_firewall_id: str, *, account_id: str, + id: str, deprecate_any_requests: bool, dns_firewall_ips: List[FirewallIPsParam], ecs_fallback: bool, @@ -259,7 +260,7 @@ def edit( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Firewall: + ) -> Optional[Firewall]: """ Modify a DNS Firewall Cluster configuration. @@ -268,6 +269,8 @@ def edit( dns_firewall_id: Identifier + id: Identifier + deprecate_any_requests: Deprecate the response to ANY requests. ecs_fallback: Forward client IP (resolver) subnet if no EDNS Client Subnet is sent. @@ -304,6 +307,7 @@ def edit( f"/accounts/{account_id}/dns_firewall/{dns_firewall_id}", body=maybe_transform( { + "id": id, "deprecate_any_requests": deprecate_any_requests, "dns_firewall_ips": dns_firewall_ips, "ecs_fallback": ecs_fallback, @@ -323,9 +327,9 @@ def edit( extra_query=extra_query, extra_body=extra_body, timeout=timeout, - post_parser=ResultWrapper[Firewall]._unwrapper, + post_parser=ResultWrapper[Optional[Firewall]]._unwrapper, ), - cast_to=cast(Type[Firewall], ResultWrapper[Firewall]), + cast_to=cast(Type[Optional[Firewall]], ResultWrapper[Firewall]), ) def get( @@ -339,7 +343,7 @@ def get( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Firewall: + ) -> Optional[Firewall]: """ Show a single configured DNS Firewall cluster for an account. @@ -367,9 +371,9 @@ def get( extra_query=extra_query, extra_body=extra_body, timeout=timeout, - post_parser=ResultWrapper[Firewall]._unwrapper, + post_parser=ResultWrapper[Optional[Firewall]]._unwrapper, ), - cast_to=cast(Type[Firewall], ResultWrapper[Firewall]), + cast_to=cast(Type[Optional[Firewall]], ResultWrapper[Firewall]), ) @@ -406,7 +410,7 @@ async def create( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Firewall: + ) -> Optional[Firewall]: """ Create a configured DNS Firewall Cluster. @@ -465,9 +469,9 @@ async def create( extra_query=extra_query, extra_body=extra_body, timeout=timeout, - post_parser=ResultWrapper[Firewall]._unwrapper, + post_parser=ResultWrapper[Optional[Firewall]]._unwrapper, ), - cast_to=cast(Type[Firewall], ResultWrapper[Firewall]), + cast_to=cast(Type[Optional[Firewall]], ResultWrapper[Firewall]), ) def list( @@ -533,7 +537,7 @@ async def delete( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> FirewallDeleteResponse: + ) -> Optional[FirewallDeleteResponse]: """ Delete a configured DNS Firewall Cluster. @@ -561,9 +565,9 @@ async def delete( extra_query=extra_query, extra_body=extra_body, timeout=timeout, - post_parser=ResultWrapper[FirewallDeleteResponse]._unwrapper, + post_parser=ResultWrapper[Optional[FirewallDeleteResponse]]._unwrapper, ), - cast_to=cast(Type[FirewallDeleteResponse], ResultWrapper[FirewallDeleteResponse]), + cast_to=cast(Type[Optional[FirewallDeleteResponse]], ResultWrapper[FirewallDeleteResponse]), ) async def edit( @@ -571,6 +575,7 @@ async def edit( dns_firewall_id: str, *, account_id: str, + id: str, deprecate_any_requests: bool, dns_firewall_ips: List[FirewallIPsParam], ecs_fallback: bool, @@ -588,7 +593,7 @@ async def edit( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Firewall: + ) -> Optional[Firewall]: """ Modify a DNS Firewall Cluster configuration. @@ -597,6 +602,8 @@ async def edit( dns_firewall_id: Identifier + id: Identifier + deprecate_any_requests: Deprecate the response to ANY requests. ecs_fallback: Forward client IP (resolver) subnet if no EDNS Client Subnet is sent. @@ -633,6 +640,7 @@ async def edit( f"/accounts/{account_id}/dns_firewall/{dns_firewall_id}", body=await async_maybe_transform( { + "id": id, "deprecate_any_requests": deprecate_any_requests, "dns_firewall_ips": dns_firewall_ips, "ecs_fallback": ecs_fallback, @@ -652,9 +660,9 @@ async def edit( extra_query=extra_query, extra_body=extra_body, timeout=timeout, - post_parser=ResultWrapper[Firewall]._unwrapper, + post_parser=ResultWrapper[Optional[Firewall]]._unwrapper, ), - cast_to=cast(Type[Firewall], ResultWrapper[Firewall]), + cast_to=cast(Type[Optional[Firewall]], ResultWrapper[Firewall]), ) async def get( @@ -668,7 +676,7 @@ async def get( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Firewall: + ) -> Optional[Firewall]: """ Show a single configured DNS Firewall cluster for an account. @@ -696,9 +704,9 @@ async def get( extra_query=extra_query, extra_body=extra_body, timeout=timeout, - post_parser=ResultWrapper[Firewall]._unwrapper, + post_parser=ResultWrapper[Optional[Firewall]]._unwrapper, ), - cast_to=cast(Type[Firewall], ResultWrapper[Firewall]), + cast_to=cast(Type[Optional[Firewall]], ResultWrapper[Firewall]), ) diff --git a/src/cloudflare/types/dns/firewall_edit_params.py b/src/cloudflare/types/dns/firewall_edit_params.py index 723e2c19cfe..349e2a2b177 100644 --- a/src/cloudflare/types/dns/firewall_edit_params.py +++ b/src/cloudflare/types/dns/firewall_edit_params.py @@ -16,6 +16,9 @@ class FirewallEditParams(TypedDict, total=False): account_id: Required[str] """Identifier""" + id: Required[str] + """Identifier""" + deprecate_any_requests: Required[bool] """Deprecate the response to ANY requests.""" diff --git a/tests/api_resources/dns/test_firewall.py b/tests/api_resources/dns/test_firewall.py index 5d5d6f8646c..b1aa07bd8df 100644 --- a/tests/api_resources/dns/test_firewall.py +++ b/tests/api_resources/dns/test_firewall.py @@ -3,7 +3,7 @@ from __future__ import annotations import os -from typing import Any, cast +from typing import Any, Optional, cast import pytest @@ -28,7 +28,7 @@ def test_method_create(self, client: Cloudflare) -> None: name="My Awesome DNS Firewall cluster", upstream_ips=["192.0.2.1", "198.51.100.1", "2001:DB8:100::CF"], ) - assert_matches_type(Firewall, firewall, path=["response"]) + assert_matches_type(Optional[Firewall], firewall, path=["response"]) @parametrize def test_method_create_with_all_params(self, client: Cloudflare) -> None: @@ -48,7 +48,7 @@ def test_method_create_with_all_params(self, client: Cloudflare) -> None: ratelimit=600, retries=2, ) - assert_matches_type(Firewall, firewall, path=["response"]) + assert_matches_type(Optional[Firewall], firewall, path=["response"]) @parametrize def test_raw_response_create(self, client: Cloudflare) -> None: @@ -61,7 +61,7 @@ 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" firewall = response.parse() - assert_matches_type(Firewall, firewall, path=["response"]) + assert_matches_type(Optional[Firewall], firewall, path=["response"]) @parametrize def test_streaming_response_create(self, client: Cloudflare) -> None: @@ -74,7 +74,7 @@ def test_streaming_response_create(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" firewall = response.parse() - assert_matches_type(Firewall, firewall, path=["response"]) + assert_matches_type(Optional[Firewall], firewall, path=["response"]) assert cast(Any, response.is_closed) is True @@ -140,7 +140,7 @@ def test_method_delete(self, client: Cloudflare) -> None: "023e105f4ecef8ad9ca31a8372d0c353", account_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(FirewallDeleteResponse, firewall, path=["response"]) + assert_matches_type(Optional[FirewallDeleteResponse], firewall, path=["response"]) @parametrize def test_raw_response_delete(self, client: Cloudflare) -> None: @@ -152,7 +152,7 @@ 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" firewall = response.parse() - assert_matches_type(FirewallDeleteResponse, firewall, path=["response"]) + assert_matches_type(Optional[FirewallDeleteResponse], firewall, path=["response"]) @parametrize def test_streaming_response_delete(self, client: Cloudflare) -> None: @@ -164,7 +164,7 @@ def test_streaming_response_delete(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" firewall = response.parse() - assert_matches_type(FirewallDeleteResponse, firewall, path=["response"]) + assert_matches_type(Optional[FirewallDeleteResponse], firewall, path=["response"]) assert cast(Any, response.is_closed) is True @@ -187,6 +187,7 @@ def test_method_edit(self, client: Cloudflare) -> None: firewall = client.dns.firewall.edit( "023e105f4ecef8ad9ca31a8372d0c353", account_id="023e105f4ecef8ad9ca31a8372d0c353", + id="023e105f4ecef8ad9ca31a8372d0c353", deprecate_any_requests=True, dns_firewall_ips=["203.0.113.1", "203.0.113.254", "2001:DB8:AB::CF", "2001:DB8:CD::CF"], ecs_fallback=False, @@ -195,13 +196,14 @@ def test_method_edit(self, client: Cloudflare) -> None: name="My Awesome DNS Firewall cluster", upstream_ips=["192.0.2.1", "198.51.100.1", "2001:DB8:100::CF"], ) - assert_matches_type(Firewall, firewall, path=["response"]) + assert_matches_type(Optional[Firewall], firewall, path=["response"]) @parametrize def test_method_edit_with_all_params(self, client: Cloudflare) -> None: firewall = client.dns.firewall.edit( "023e105f4ecef8ad9ca31a8372d0c353", account_id="023e105f4ecef8ad9ca31a8372d0c353", + id="023e105f4ecef8ad9ca31a8372d0c353", deprecate_any_requests=True, dns_firewall_ips=["203.0.113.1", "203.0.113.254", "2001:DB8:AB::CF", "2001:DB8:CD::CF"], ecs_fallback=False, @@ -217,13 +219,14 @@ def test_method_edit_with_all_params(self, client: Cloudflare) -> None: ratelimit=600, retries=2, ) - assert_matches_type(Firewall, firewall, path=["response"]) + assert_matches_type(Optional[Firewall], firewall, path=["response"]) @parametrize def test_raw_response_edit(self, client: Cloudflare) -> None: response = client.dns.firewall.with_raw_response.edit( "023e105f4ecef8ad9ca31a8372d0c353", account_id="023e105f4ecef8ad9ca31a8372d0c353", + id="023e105f4ecef8ad9ca31a8372d0c353", deprecate_any_requests=True, dns_firewall_ips=["203.0.113.1", "203.0.113.254", "2001:DB8:AB::CF", "2001:DB8:CD::CF"], ecs_fallback=False, @@ -236,13 +239,14 @@ 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" firewall = response.parse() - assert_matches_type(Firewall, firewall, path=["response"]) + assert_matches_type(Optional[Firewall], firewall, path=["response"]) @parametrize def test_streaming_response_edit(self, client: Cloudflare) -> None: with client.dns.firewall.with_streaming_response.edit( "023e105f4ecef8ad9ca31a8372d0c353", account_id="023e105f4ecef8ad9ca31a8372d0c353", + id="023e105f4ecef8ad9ca31a8372d0c353", deprecate_any_requests=True, dns_firewall_ips=["203.0.113.1", "203.0.113.254", "2001:DB8:AB::CF", "2001:DB8:CD::CF"], ecs_fallback=False, @@ -255,7 +259,7 @@ def test_streaming_response_edit(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" firewall = response.parse() - assert_matches_type(Firewall, firewall, path=["response"]) + assert_matches_type(Optional[Firewall], firewall, path=["response"]) assert cast(Any, response.is_closed) is True @@ -265,6 +269,7 @@ def test_path_params_edit(self, client: Cloudflare) -> None: client.dns.firewall.with_raw_response.edit( "023e105f4ecef8ad9ca31a8372d0c353", account_id="", + id="023e105f4ecef8ad9ca31a8372d0c353", deprecate_any_requests=True, dns_firewall_ips=["203.0.113.1", "203.0.113.254", "2001:DB8:AB::CF", "2001:DB8:CD::CF"], ecs_fallback=False, @@ -278,6 +283,7 @@ def test_path_params_edit(self, client: Cloudflare) -> None: client.dns.firewall.with_raw_response.edit( "", account_id="023e105f4ecef8ad9ca31a8372d0c353", + id="023e105f4ecef8ad9ca31a8372d0c353", deprecate_any_requests=True, dns_firewall_ips=["203.0.113.1", "203.0.113.254", "2001:DB8:AB::CF", "2001:DB8:CD::CF"], ecs_fallback=False, @@ -293,7 +299,7 @@ def test_method_get(self, client: Cloudflare) -> None: "023e105f4ecef8ad9ca31a8372d0c353", account_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(Firewall, firewall, path=["response"]) + assert_matches_type(Optional[Firewall], firewall, path=["response"]) @parametrize def test_raw_response_get(self, client: Cloudflare) -> None: @@ -305,7 +311,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" firewall = response.parse() - assert_matches_type(Firewall, firewall, path=["response"]) + assert_matches_type(Optional[Firewall], firewall, path=["response"]) @parametrize def test_streaming_response_get(self, client: Cloudflare) -> None: @@ -317,7 +323,7 @@ def test_streaming_response_get(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" firewall = response.parse() - assert_matches_type(Firewall, firewall, path=["response"]) + assert_matches_type(Optional[Firewall], firewall, path=["response"]) assert cast(Any, response.is_closed) is True @@ -346,7 +352,7 @@ async def test_method_create(self, async_client: AsyncCloudflare) -> None: name="My Awesome DNS Firewall cluster", upstream_ips=["192.0.2.1", "198.51.100.1", "2001:DB8:100::CF"], ) - assert_matches_type(Firewall, firewall, path=["response"]) + assert_matches_type(Optional[Firewall], firewall, path=["response"]) @parametrize async def test_method_create_with_all_params(self, async_client: AsyncCloudflare) -> None: @@ -366,7 +372,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncCloudflare ratelimit=600, retries=2, ) - assert_matches_type(Firewall, firewall, path=["response"]) + assert_matches_type(Optional[Firewall], firewall, path=["response"]) @parametrize async def test_raw_response_create(self, async_client: AsyncCloudflare) -> None: @@ -379,7 +385,7 @@ 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" firewall = await response.parse() - assert_matches_type(Firewall, firewall, path=["response"]) + assert_matches_type(Optional[Firewall], firewall, path=["response"]) @parametrize async def test_streaming_response_create(self, async_client: AsyncCloudflare) -> None: @@ -392,7 +398,7 @@ async def test_streaming_response_create(self, async_client: AsyncCloudflare) -> assert response.http_request.headers.get("X-Stainless-Lang") == "python" firewall = await response.parse() - assert_matches_type(Firewall, firewall, path=["response"]) + assert_matches_type(Optional[Firewall], firewall, path=["response"]) assert cast(Any, response.is_closed) is True @@ -458,7 +464,7 @@ async def test_method_delete(self, async_client: AsyncCloudflare) -> None: "023e105f4ecef8ad9ca31a8372d0c353", account_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(FirewallDeleteResponse, firewall, path=["response"]) + assert_matches_type(Optional[FirewallDeleteResponse], firewall, path=["response"]) @parametrize async def test_raw_response_delete(self, async_client: AsyncCloudflare) -> None: @@ -470,7 +476,7 @@ 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" firewall = await response.parse() - assert_matches_type(FirewallDeleteResponse, firewall, path=["response"]) + assert_matches_type(Optional[FirewallDeleteResponse], firewall, path=["response"]) @parametrize async def test_streaming_response_delete(self, async_client: AsyncCloudflare) -> None: @@ -482,7 +488,7 @@ async def test_streaming_response_delete(self, async_client: AsyncCloudflare) -> assert response.http_request.headers.get("X-Stainless-Lang") == "python" firewall = await response.parse() - assert_matches_type(FirewallDeleteResponse, firewall, path=["response"]) + assert_matches_type(Optional[FirewallDeleteResponse], firewall, path=["response"]) assert cast(Any, response.is_closed) is True @@ -505,6 +511,7 @@ async def test_method_edit(self, async_client: AsyncCloudflare) -> None: firewall = await async_client.dns.firewall.edit( "023e105f4ecef8ad9ca31a8372d0c353", account_id="023e105f4ecef8ad9ca31a8372d0c353", + id="023e105f4ecef8ad9ca31a8372d0c353", deprecate_any_requests=True, dns_firewall_ips=["203.0.113.1", "203.0.113.254", "2001:DB8:AB::CF", "2001:DB8:CD::CF"], ecs_fallback=False, @@ -513,13 +520,14 @@ async def test_method_edit(self, async_client: AsyncCloudflare) -> None: name="My Awesome DNS Firewall cluster", upstream_ips=["192.0.2.1", "198.51.100.1", "2001:DB8:100::CF"], ) - assert_matches_type(Firewall, firewall, path=["response"]) + assert_matches_type(Optional[Firewall], firewall, path=["response"]) @parametrize async def test_method_edit_with_all_params(self, async_client: AsyncCloudflare) -> None: firewall = await async_client.dns.firewall.edit( "023e105f4ecef8ad9ca31a8372d0c353", account_id="023e105f4ecef8ad9ca31a8372d0c353", + id="023e105f4ecef8ad9ca31a8372d0c353", deprecate_any_requests=True, dns_firewall_ips=["203.0.113.1", "203.0.113.254", "2001:DB8:AB::CF", "2001:DB8:CD::CF"], ecs_fallback=False, @@ -535,13 +543,14 @@ async def test_method_edit_with_all_params(self, async_client: AsyncCloudflare) ratelimit=600, retries=2, ) - assert_matches_type(Firewall, firewall, path=["response"]) + assert_matches_type(Optional[Firewall], firewall, path=["response"]) @parametrize async def test_raw_response_edit(self, async_client: AsyncCloudflare) -> None: response = await async_client.dns.firewall.with_raw_response.edit( "023e105f4ecef8ad9ca31a8372d0c353", account_id="023e105f4ecef8ad9ca31a8372d0c353", + id="023e105f4ecef8ad9ca31a8372d0c353", deprecate_any_requests=True, dns_firewall_ips=["203.0.113.1", "203.0.113.254", "2001:DB8:AB::CF", "2001:DB8:CD::CF"], ecs_fallback=False, @@ -554,13 +563,14 @@ 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" firewall = await response.parse() - assert_matches_type(Firewall, firewall, path=["response"]) + assert_matches_type(Optional[Firewall], firewall, path=["response"]) @parametrize async def test_streaming_response_edit(self, async_client: AsyncCloudflare) -> None: async with async_client.dns.firewall.with_streaming_response.edit( "023e105f4ecef8ad9ca31a8372d0c353", account_id="023e105f4ecef8ad9ca31a8372d0c353", + id="023e105f4ecef8ad9ca31a8372d0c353", deprecate_any_requests=True, dns_firewall_ips=["203.0.113.1", "203.0.113.254", "2001:DB8:AB::CF", "2001:DB8:CD::CF"], ecs_fallback=False, @@ -573,7 +583,7 @@ async def test_streaming_response_edit(self, async_client: AsyncCloudflare) -> N assert response.http_request.headers.get("X-Stainless-Lang") == "python" firewall = await response.parse() - assert_matches_type(Firewall, firewall, path=["response"]) + assert_matches_type(Optional[Firewall], firewall, path=["response"]) assert cast(Any, response.is_closed) is True @@ -583,6 +593,7 @@ async def test_path_params_edit(self, async_client: AsyncCloudflare) -> None: await async_client.dns.firewall.with_raw_response.edit( "023e105f4ecef8ad9ca31a8372d0c353", account_id="", + id="023e105f4ecef8ad9ca31a8372d0c353", deprecate_any_requests=True, dns_firewall_ips=["203.0.113.1", "203.0.113.254", "2001:DB8:AB::CF", "2001:DB8:CD::CF"], ecs_fallback=False, @@ -596,6 +607,7 @@ async def test_path_params_edit(self, async_client: AsyncCloudflare) -> None: await async_client.dns.firewall.with_raw_response.edit( "", account_id="023e105f4ecef8ad9ca31a8372d0c353", + id="023e105f4ecef8ad9ca31a8372d0c353", deprecate_any_requests=True, dns_firewall_ips=["203.0.113.1", "203.0.113.254", "2001:DB8:AB::CF", "2001:DB8:CD::CF"], ecs_fallback=False, @@ -611,7 +623,7 @@ async def test_method_get(self, async_client: AsyncCloudflare) -> None: "023e105f4ecef8ad9ca31a8372d0c353", account_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(Firewall, firewall, path=["response"]) + assert_matches_type(Optional[Firewall], firewall, path=["response"]) @parametrize async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: @@ -623,7 +635,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" firewall = await response.parse() - assert_matches_type(Firewall, firewall, path=["response"]) + assert_matches_type(Optional[Firewall], firewall, path=["response"]) @parametrize async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> None: @@ -635,7 +647,7 @@ async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> No assert response.http_request.headers.get("X-Stainless-Lang") == "python" firewall = await response.parse() - assert_matches_type(Firewall, firewall, path=["response"]) + assert_matches_type(Optional[Firewall], firewall, path=["response"]) assert cast(Any, response.is_closed) is True