feat(api): OpenAPI spec update via Stainless API (#1160)

This commit is contained in:
stainless-app[bot] 2024-07-02 09:23:58 +00:00 committed by stainless-bot
parent eba86e853d
commit 6031ae93d9
5 changed files with 81 additions and 58 deletions

View file

@ -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

8
api.md
View file

@ -1098,11 +1098,11 @@ from cloudflare.types.dns import (
Methods:
- <code title="post /accounts/{account_id}/dns_firewall">client.dns.firewall.<a href="./src/cloudflare/resources/dns/firewall/firewall.py">create</a>(\*, account_id, \*\*<a href="src/cloudflare/types/dns/firewall_create_params.py">params</a>) -> <a href="./src/cloudflare/types/dns/firewall/firewall.py">Firewall</a></code>
- <code title="post /accounts/{account_id}/dns_firewall">client.dns.firewall.<a href="./src/cloudflare/resources/dns/firewall/firewall.py">create</a>(\*, account_id, \*\*<a href="src/cloudflare/types/dns/firewall_create_params.py">params</a>) -> <a href="./src/cloudflare/types/dns/firewall/firewall.py">Optional</a></code>
- <code title="get /accounts/{account_id}/dns_firewall">client.dns.firewall.<a href="./src/cloudflare/resources/dns/firewall/firewall.py">list</a>(\*, account_id, \*\*<a href="src/cloudflare/types/dns/firewall_list_params.py">params</a>) -> <a href="./src/cloudflare/types/dns/firewall/firewall.py">SyncV4PagePaginationArray[Firewall]</a></code>
- <code title="delete /accounts/{account_id}/dns_firewall/{dns_firewall_id}">client.dns.firewall.<a href="./src/cloudflare/resources/dns/firewall/firewall.py">delete</a>(dns_firewall_id, \*, account_id) -> <a href="./src/cloudflare/types/dns/firewall_delete_response.py">FirewallDeleteResponse</a></code>
- <code title="patch /accounts/{account_id}/dns_firewall/{dns_firewall_id}">client.dns.firewall.<a href="./src/cloudflare/resources/dns/firewall/firewall.py">edit</a>(dns_firewall_id, \*, account_id, \*\*<a href="src/cloudflare/types/dns/firewall_edit_params.py">params</a>) -> <a href="./src/cloudflare/types/dns/firewall/firewall.py">Firewall</a></code>
- <code title="get /accounts/{account_id}/dns_firewall/{dns_firewall_id}">client.dns.firewall.<a href="./src/cloudflare/resources/dns/firewall/firewall.py">get</a>(dns_firewall_id, \*, account_id) -> <a href="./src/cloudflare/types/dns/firewall/firewall.py">Firewall</a></code>
- <code title="delete /accounts/{account_id}/dns_firewall/{dns_firewall_id}">client.dns.firewall.<a href="./src/cloudflare/resources/dns/firewall/firewall.py">delete</a>(dns_firewall_id, \*, account_id) -> <a href="./src/cloudflare/types/dns/firewall_delete_response.py">Optional</a></code>
- <code title="patch /accounts/{account_id}/dns_firewall/{dns_firewall_id}">client.dns.firewall.<a href="./src/cloudflare/resources/dns/firewall/firewall.py">edit</a>(dns_firewall_id, \*, account_id, \*\*<a href="src/cloudflare/types/dns/firewall_edit_params.py">params</a>) -> <a href="./src/cloudflare/types/dns/firewall/firewall.py">Optional</a></code>
- <code title="get /accounts/{account_id}/dns_firewall/{dns_firewall_id}">client.dns.firewall.<a href="./src/cloudflare/resources/dns/firewall/firewall.py">get</a>(dns_firewall_id, \*, account_id) -> <a href="./src/cloudflare/types/dns/firewall/firewall.py">Optional</a></code>
### Analytics

View file

@ -77,7 +77,7 @@ class FirewallResource(SyncAPIResource):
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 @@ class FirewallResource(SyncAPIResource):
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 @@ class FirewallResource(SyncAPIResource):
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 @@ class FirewallResource(SyncAPIResource):
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 @@ class FirewallResource(SyncAPIResource):
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 @@ class FirewallResource(SyncAPIResource):
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 @@ class FirewallResource(SyncAPIResource):
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 @@ class FirewallResource(SyncAPIResource):
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 @@ class FirewallResource(SyncAPIResource):
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 @@ class FirewallResource(SyncAPIResource):
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 @@ class FirewallResource(SyncAPIResource):
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 @@ class AsyncFirewallResource(AsyncAPIResource):
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 @@ class AsyncFirewallResource(AsyncAPIResource):
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 @@ class AsyncFirewallResource(AsyncAPIResource):
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 @@ class AsyncFirewallResource(AsyncAPIResource):
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 @@ class AsyncFirewallResource(AsyncAPIResource):
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 @@ class AsyncFirewallResource(AsyncAPIResource):
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 @@ class AsyncFirewallResource(AsyncAPIResource):
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 @@ class AsyncFirewallResource(AsyncAPIResource):
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 @@ class AsyncFirewallResource(AsyncAPIResource):
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 @@ class AsyncFirewallResource(AsyncAPIResource):
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 @@ class AsyncFirewallResource(AsyncAPIResource):
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]),
)

View file

@ -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."""

View file

@ -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 @@ class TestFirewall:
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 @@ class TestFirewall:
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 @@ class TestFirewall:
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 @@ class TestFirewall:
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 @@ class TestFirewall:
"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 @@ class TestFirewall:
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 @@ class TestFirewall:
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 @@ class TestFirewall:
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 @@ class TestFirewall:
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 @@ class TestFirewall:
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 @@ class TestFirewall:
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 @@ class TestFirewall:
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 @@ class TestFirewall:
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 @@ class TestFirewall:
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 @@ class TestFirewall:
"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 @@ class TestFirewall:
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 @@ class TestFirewall:
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 @@ class TestAsyncFirewall:
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 @@ class TestAsyncFirewall:
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 @@ class TestAsyncFirewall:
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 @@ class TestAsyncFirewall:
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 @@ class TestAsyncFirewall:
"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 @@ class TestAsyncFirewall:
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 @@ class TestAsyncFirewall:
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 @@ class TestAsyncFirewall:
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 @@ class TestAsyncFirewall:
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 @@ class TestAsyncFirewall:
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 @@ class TestAsyncFirewall:
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 @@ class TestAsyncFirewall:
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 @@ class TestAsyncFirewall:
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 @@ class TestAsyncFirewall:
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 @@ class TestAsyncFirewall:
"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 @@ class TestAsyncFirewall:
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 @@ class TestAsyncFirewall:
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