From 995191a870401a5ff5b5e792576471331cf8bc38 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 23 Apr 2024 19:00:14 +0000 Subject: [PATCH] feat(api): update via SDK Studio (#357) --- api.md | 2 +- src/cloudflare/resources/magic_transit/sites/acls.py | 10 +++++----- src/cloudflare/types/magic_transit/sites/__init__.py | 1 + src/cloudflare/types/magic_transit/sites/acl.py | 4 ++-- .../types/magic_transit/sites/acl_create_params.py | 5 +++-- .../types/magic_transit/sites/acl_update_params.py | 5 +++-- .../types/magic_transit/sites/allowed_protocol.py | 7 +++++++ 7 files changed, 22 insertions(+), 12 deletions(-) create mode 100644 src/cloudflare/types/magic_transit/sites/allowed_protocol.py diff --git a/api.md b/api.md index d1efa1129f7..f85a471a549 100644 --- a/api.md +++ b/api.md @@ -3852,7 +3852,7 @@ Methods: Types: ```python -from cloudflare.types.magic_transit.sites import ACL, ACLConfiguration, Subnet +from cloudflare.types.magic_transit.sites import ACL, ACLConfiguration, AllowedProtocol, Subnet ``` Methods: diff --git a/src/cloudflare/resources/magic_transit/sites/acls.py b/src/cloudflare/resources/magic_transit/sites/acls.py index e96cbd5473e..3f52cf167b7 100644 --- a/src/cloudflare/resources/magic_transit/sites/acls.py +++ b/src/cloudflare/resources/magic_transit/sites/acls.py @@ -3,7 +3,6 @@ from __future__ import annotations from typing import List, Type, cast -from typing_extensions import Literal import httpx @@ -28,6 +27,7 @@ ) from ....types.magic_transit.sites import ( ACL, + AllowedProtocol, ACLConfigurationParam, acl_create_params, acl_delete_params, @@ -56,7 +56,7 @@ def create( name: str, description: str | NotGiven = NOT_GIVEN, forward_locally: bool | NotGiven = NOT_GIVEN, - protocols: List[Literal["tcp", "udp", "icmp"]] | NotGiven = NOT_GIVEN, + protocols: List[AllowedProtocol] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -127,7 +127,7 @@ def update( lan_1: ACLConfigurationParam | NotGiven = NOT_GIVEN, lan_2: ACLConfigurationParam | NotGiven = NOT_GIVEN, name: str | NotGiven = NOT_GIVEN, - protocols: List[Literal["tcp", "udp", "icmp"]] | NotGiven = NOT_GIVEN, + protocols: List[AllowedProtocol] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -352,7 +352,7 @@ async def create( name: str, description: str | NotGiven = NOT_GIVEN, forward_locally: bool | NotGiven = NOT_GIVEN, - protocols: List[Literal["tcp", "udp", "icmp"]] | NotGiven = NOT_GIVEN, + protocols: List[AllowedProtocol] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -423,7 +423,7 @@ async def update( lan_1: ACLConfigurationParam | NotGiven = NOT_GIVEN, lan_2: ACLConfigurationParam | NotGiven = NOT_GIVEN, name: str | NotGiven = NOT_GIVEN, - protocols: List[Literal["tcp", "udp", "icmp"]] | NotGiven = NOT_GIVEN, + protocols: List[AllowedProtocol] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, diff --git a/src/cloudflare/types/magic_transit/sites/__init__.py b/src/cloudflare/types/magic_transit/sites/__init__.py index d4082759794..1b2ed37966f 100644 --- a/src/cloudflare/types/magic_transit/sites/__init__.py +++ b/src/cloudflare/types/magic_transit/sites/__init__.py @@ -12,6 +12,7 @@ from .dhcp_server import DHCPServer as DHCPServer from .subnet_param import SubnetParam as SubnetParam from .routed_subnet import RoutedSubnet as RoutedSubnet +from .allowed_protocol import AllowedProtocol as AllowedProtocol from .dhcp_relay_param import DHCPRelayParam as DHCPRelayParam from .acl_configuration import ACLConfiguration as ACLConfiguration from .acl_create_params import ACLCreateParams as ACLCreateParams diff --git a/src/cloudflare/types/magic_transit/sites/acl.py b/src/cloudflare/types/magic_transit/sites/acl.py index b8b077c43b6..01bcf9e4b55 100644 --- a/src/cloudflare/types/magic_transit/sites/acl.py +++ b/src/cloudflare/types/magic_transit/sites/acl.py @@ -1,9 +1,9 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. from typing import List, Optional -from typing_extensions import Literal from ...._models import BaseModel +from .allowed_protocol import AllowedProtocol from .acl_configuration import ACLConfiguration __all__ = ["ACL"] @@ -31,4 +31,4 @@ class ACL(BaseModel): name: Optional[str] = None """The name of the ACL.""" - protocols: Optional[List[Literal["tcp", "udp", "icmp"]]] = None + protocols: Optional[List[AllowedProtocol]] = None diff --git a/src/cloudflare/types/magic_transit/sites/acl_create_params.py b/src/cloudflare/types/magic_transit/sites/acl_create_params.py index c5619618283..67a21900fa4 100644 --- a/src/cloudflare/types/magic_transit/sites/acl_create_params.py +++ b/src/cloudflare/types/magic_transit/sites/acl_create_params.py @@ -3,8 +3,9 @@ from __future__ import annotations from typing import List -from typing_extensions import Literal, Required, TypedDict +from typing_extensions import Required, TypedDict +from .allowed_protocol import AllowedProtocol from .acl_configuration_param import ACLConfigurationParam __all__ = ["ACLCreateParams"] @@ -32,4 +33,4 @@ class ACLCreateParams(TypedDict, total=False): not included in request, will default to false. """ - protocols: List[Literal["tcp", "udp", "icmp"]] + protocols: List[AllowedProtocol] diff --git a/src/cloudflare/types/magic_transit/sites/acl_update_params.py b/src/cloudflare/types/magic_transit/sites/acl_update_params.py index c0514f44017..72165d3c2a2 100644 --- a/src/cloudflare/types/magic_transit/sites/acl_update_params.py +++ b/src/cloudflare/types/magic_transit/sites/acl_update_params.py @@ -3,8 +3,9 @@ from __future__ import annotations from typing import List -from typing_extensions import Literal, Required, TypedDict +from typing_extensions import Required, TypedDict +from .allowed_protocol import AllowedProtocol from .acl_configuration_param import ACLConfigurationParam __all__ = ["ACLUpdateParams"] @@ -35,4 +36,4 @@ class ACLUpdateParams(TypedDict, total=False): name: str """The name of the ACL.""" - protocols: List[Literal["tcp", "udp", "icmp"]] + protocols: List[AllowedProtocol] diff --git a/src/cloudflare/types/magic_transit/sites/allowed_protocol.py b/src/cloudflare/types/magic_transit/sites/allowed_protocol.py new file mode 100644 index 00000000000..cce3a21021e --- /dev/null +++ b/src/cloudflare/types/magic_transit/sites/allowed_protocol.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal + +__all__ = ["AllowedProtocol"] + +AllowedProtocol = Literal["tcp", "udp", "icmp"]