Skip to content

Commit

Permalink
feat(api): OpenAPI spec update via Stainless API (#1160)
Browse files Browse the repository at this point in the history
  • Loading branch information
stainless-app[bot] authored and stainless-bot committed Jul 2, 2024
1 parent e45ae54 commit f3cadff
Show file tree
Hide file tree
Showing 5 changed files with 81 additions and 58 deletions.
2 changes: 1 addition & 1 deletion .stats.yml
Original file line number Diff line number Diff line change
@@ -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 changes: 4 additions & 4 deletions api.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
56 changes: 32 additions & 24 deletions src/cloudflare/resources/dns/firewall/firewall.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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(
Expand Down Expand Up @@ -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.
Expand Down Expand Up @@ -232,16 +232,17 @@ 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(
self,
dns_firewall_id: str,
*,
account_id: str,
id: str,
deprecate_any_requests: bool,
dns_firewall_ips: List[FirewallIPsParam],
ecs_fallback: bool,
Expand All @@ -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.
Expand All @@ -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.
Expand Down Expand Up @@ -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,
Expand All @@ -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(
Expand All @@ -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.
Expand Down Expand Up @@ -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]),
)


Expand Down Expand Up @@ -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.
Expand Down Expand Up @@ -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(
Expand Down Expand Up @@ -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.
Expand Down Expand Up @@ -561,16 +565,17 @@ 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(
self,
dns_firewall_id: str,
*,
account_id: str,
id: str,
deprecate_any_requests: bool,
dns_firewall_ips: List[FirewallIPsParam],
ecs_fallback: bool,
Expand All @@ -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.
Expand All @@ -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.
Expand Down Expand Up @@ -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,
Expand All @@ -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(
Expand All @@ -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.
Expand Down Expand Up @@ -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]),
)


Expand Down
3 changes: 3 additions & 0 deletions src/cloudflare/types/dns/firewall_edit_params.py
Original file line number Diff line number Diff line change
Expand Up @@ -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."""

Expand Down
Loading

0 comments on commit f3cadff

Please sign in to comment.