From bce1bf4e6cd3736b4d2f354e9b76ad688a3a26a8 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 7 May 2024 04:15:55 +0000 Subject: [PATCH] feat(api): update via SDK Studio (#467) --- api.md | 14 ++++++++++++-- src/cloudflare/resources/acm/total_tls.py | 8 ++++---- src/cloudflare/types/accounts/__init__.py | 1 + src/cloudflare/types/accounts/member_status.py | 7 +++++++ src/cloudflare/types/acm/__init__.py | 1 + .../types/acm/total_tls_certificate_authority.py | 7 +++++++ .../types/acm/total_tls_create_params.py | 6 ++++-- .../types/acm/total_tls_create_response.py | 3 ++- src/cloudflare/types/acm/total_tls_get_response.py | 3 ++- src/cloudflare/types/addressing/__init__.py | 1 + .../addressing/address_map_create_response.py | 4 ++-- .../types/addressing/address_map_get_response.py | 4 ++-- .../types/addressing/address_map_kind.py | 7 +++++++ src/cloudflare/types/rulesets/route_rule.py | 6 +++--- src/cloudflare/types/rulesets/route_rule_param.py | 6 +++--- .../types/rulesets/rule_create_params.py | 6 +++--- src/cloudflare/types/rulesets/rule_edit_params.py | 6 +++--- src/cloudflare/types/user/organization.py | 4 ++-- tests/api_resources/acm/test_total_tls.py | 5 ++++- 19 files changed, 70 insertions(+), 29 deletions(-) create mode 100644 src/cloudflare/types/accounts/member_status.py create mode 100644 src/cloudflare/types/acm/total_tls_certificate_authority.py create mode 100644 src/cloudflare/types/addressing/address_map_kind.py diff --git a/api.md b/api.md index 860c183080f..94e0991bb9c 100644 --- a/api.md +++ b/api.md @@ -42,7 +42,12 @@ Methods: Types: ```python -from cloudflare.types.accounts import UserWithInviteCode, MemberListResponse, MemberDeleteResponse +from cloudflare.types.accounts import ( + MemberStatus, + UserWithInviteCode, + MemberListResponse, + MemberDeleteResponse, +) ``` Methods: @@ -1390,7 +1395,11 @@ Methods: Types: ```python -from cloudflare.types.acm import TotalTLSCreateResponse, TotalTLSGetResponse +from cloudflare.types.acm import ( + TotalTLSCertificateAuthority, + TotalTLSCreateResponse, + TotalTLSGetResponse, +) ``` Methods: @@ -3225,6 +3234,7 @@ Types: ```python from cloudflare.types.addressing import ( AddressMap, + AddressMapKind, AddressMapCreateResponse, AddressMapDeleteResponse, AddressMapGetResponse, diff --git a/src/cloudflare/resources/acm/total_tls.py b/src/cloudflare/resources/acm/total_tls.py index 6c8acf16000..f687efa967e 100644 --- a/src/cloudflare/resources/acm/total_tls.py +++ b/src/cloudflare/resources/acm/total_tls.py @@ -3,7 +3,6 @@ from __future__ import annotations from typing import Type, Optional, cast -from typing_extensions import Literal import httpx @@ -21,12 +20,13 @@ async_to_streamed_response_wrapper, ) from ..._wrappers import ResultWrapper -from ...types.acm import total_tls_create_params +from ...types.acm import TotalTLSCertificateAuthority, total_tls_create_params from ..._base_client import ( make_request_options, ) from ...types.acm.total_tls_get_response import TotalTLSGetResponse from ...types.acm.total_tls_create_response import TotalTLSCreateResponse +from ...types.acm.total_tls_certificate_authority import TotalTLSCertificateAuthority __all__ = ["TotalTLSResource", "AsyncTotalTLSResource"] @@ -45,7 +45,7 @@ def create( *, zone_id: str, enabled: bool, - certificate_authority: Literal["google", "lets_encrypt"] | NotGiven = NOT_GIVEN, + certificate_authority: TotalTLSCertificateAuthority | 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, @@ -147,7 +147,7 @@ async def create( *, zone_id: str, enabled: bool, - certificate_authority: Literal["google", "lets_encrypt"] | NotGiven = NOT_GIVEN, + certificate_authority: TotalTLSCertificateAuthority | 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/accounts/__init__.py b/src/cloudflare/types/accounts/__init__.py index 8d3d15425ca..fea67a337fc 100644 --- a/src/cloudflare/types/accounts/__init__.py +++ b/src/cloudflare/types/accounts/__init__.py @@ -3,6 +3,7 @@ from __future__ import annotations from .account import Account as Account +from .member_status import MemberStatus as MemberStatus from .role_get_response import RoleGetResponse as RoleGetResponse from .member_list_params import MemberListParams as MemberListParams from .account_list_params import AccountListParams as AccountListParams diff --git a/src/cloudflare/types/accounts/member_status.py b/src/cloudflare/types/accounts/member_status.py new file mode 100644 index 00000000000..fc12793b5fc --- /dev/null +++ b/src/cloudflare/types/accounts/member_status.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal + +__all__ = ["MemberStatus"] + +MemberStatus = Literal["member", "invited"] diff --git a/src/cloudflare/types/acm/__init__.py b/src/cloudflare/types/acm/__init__.py index 8a22d0dd955..151a01596ba 100644 --- a/src/cloudflare/types/acm/__init__.py +++ b/src/cloudflare/types/acm/__init__.py @@ -5,3 +5,4 @@ from .total_tls_get_response import TotalTLSGetResponse as TotalTLSGetResponse from .total_tls_create_params import TotalTLSCreateParams as TotalTLSCreateParams from .total_tls_create_response import TotalTLSCreateResponse as TotalTLSCreateResponse +from .total_tls_certificate_authority import TotalTLSCertificateAuthority as TotalTLSCertificateAuthority diff --git a/src/cloudflare/types/acm/total_tls_certificate_authority.py b/src/cloudflare/types/acm/total_tls_certificate_authority.py new file mode 100644 index 00000000000..6dc0c6fce36 --- /dev/null +++ b/src/cloudflare/types/acm/total_tls_certificate_authority.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal + +__all__ = ["TotalTLSCertificateAuthority"] + +TotalTLSCertificateAuthority = Literal["google", "lets_encrypt"] diff --git a/src/cloudflare/types/acm/total_tls_create_params.py b/src/cloudflare/types/acm/total_tls_create_params.py index 027231ae928..b2f881147a5 100644 --- a/src/cloudflare/types/acm/total_tls_create_params.py +++ b/src/cloudflare/types/acm/total_tls_create_params.py @@ -2,7 +2,9 @@ from __future__ import annotations -from typing_extensions import Literal, Required, TypedDict +from typing_extensions import Required, TypedDict + +from .total_tls_certificate_authority import TotalTLSCertificateAuthority __all__ = ["TotalTLSCreateParams"] @@ -17,5 +19,5 @@ class TotalTLSCreateParams(TypedDict, total=False): proxied A, AAAA, or CNAME record in your zone. """ - certificate_authority: Literal["google", "lets_encrypt"] + certificate_authority: TotalTLSCertificateAuthority """The Certificate Authority that Total TLS certificates will be issued through.""" diff --git a/src/cloudflare/types/acm/total_tls_create_response.py b/src/cloudflare/types/acm/total_tls_create_response.py index 83c99534e84..cfccefdf242 100644 --- a/src/cloudflare/types/acm/total_tls_create_response.py +++ b/src/cloudflare/types/acm/total_tls_create_response.py @@ -4,12 +4,13 @@ from typing_extensions import Literal from ..._models import BaseModel +from .total_tls_certificate_authority import TotalTLSCertificateAuthority __all__ = ["TotalTLSCreateResponse"] class TotalTLSCreateResponse(BaseModel): - certificate_authority: Optional[Literal["google", "lets_encrypt"]] = None + certificate_authority: Optional[TotalTLSCertificateAuthority] = None """The Certificate Authority that Total TLS certificates will be issued through.""" enabled: Optional[bool] = None diff --git a/src/cloudflare/types/acm/total_tls_get_response.py b/src/cloudflare/types/acm/total_tls_get_response.py index fa25aa2bab2..c06c91c5330 100644 --- a/src/cloudflare/types/acm/total_tls_get_response.py +++ b/src/cloudflare/types/acm/total_tls_get_response.py @@ -4,12 +4,13 @@ from typing_extensions import Literal from ..._models import BaseModel +from .total_tls_certificate_authority import TotalTLSCertificateAuthority __all__ = ["TotalTLSGetResponse"] class TotalTLSGetResponse(BaseModel): - certificate_authority: Optional[Literal["google", "lets_encrypt"]] = None + certificate_authority: Optional[TotalTLSCertificateAuthority] = None """The Certificate Authority that Total TLS certificates will be issued through.""" enabled: Optional[bool] = None diff --git a/src/cloudflare/types/addressing/__init__.py b/src/cloudflare/types/addressing/__init__.py index c1e1e146f4d..f863e76ec26 100644 --- a/src/cloudflare/types/addressing/__init__.py +++ b/src/cloudflare/types/addressing/__init__.py @@ -4,6 +4,7 @@ from .prefix import Prefix as Prefix from .address_map import AddressMap as AddressMap +from .address_map_kind import AddressMapKind as AddressMapKind from .prefix_edit_params import PrefixEditParams as PrefixEditParams from .prefix_create_params import PrefixCreateParams as PrefixCreateParams from .service_list_response import ServiceListResponse as ServiceListResponse diff --git a/src/cloudflare/types/addressing/address_map_create_response.py b/src/cloudflare/types/addressing/address_map_create_response.py index 26d4dc0041f..015d84e46f6 100644 --- a/src/cloudflare/types/addressing/address_map_create_response.py +++ b/src/cloudflare/types/addressing/address_map_create_response.py @@ -2,9 +2,9 @@ from typing import List, Optional from datetime import datetime -from typing_extensions import Literal from ..._models import BaseModel +from .address_map_kind import AddressMapKind __all__ = ["AddressMapCreateResponse", "IP", "Membership"] @@ -25,7 +25,7 @@ class Membership(BaseModel): identifier: Optional[str] = None """Identifier""" - kind: Optional[Literal["zone", "account"]] = None + kind: Optional[AddressMapKind] = None """The type of the membership.""" diff --git a/src/cloudflare/types/addressing/address_map_get_response.py b/src/cloudflare/types/addressing/address_map_get_response.py index 2fa6d14e168..3a93c423d39 100644 --- a/src/cloudflare/types/addressing/address_map_get_response.py +++ b/src/cloudflare/types/addressing/address_map_get_response.py @@ -2,9 +2,9 @@ from typing import List, Optional from datetime import datetime -from typing_extensions import Literal from ..._models import BaseModel +from .address_map_kind import AddressMapKind __all__ = ["AddressMapGetResponse", "IP", "Membership"] @@ -25,7 +25,7 @@ class Membership(BaseModel): identifier: Optional[str] = None """Identifier""" - kind: Optional[Literal["zone", "account"]] = None + kind: Optional[AddressMapKind] = None """The type of the membership.""" diff --git a/src/cloudflare/types/addressing/address_map_kind.py b/src/cloudflare/types/addressing/address_map_kind.py new file mode 100644 index 00000000000..b47d61efc0e --- /dev/null +++ b/src/cloudflare/types/addressing/address_map_kind.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal + +__all__ = ["AddressMapKind"] + +AddressMapKind = Literal["zone", "account"] diff --git a/src/cloudflare/types/rulesets/route_rule.py b/src/cloudflare/types/rulesets/route_rule.py index 79ac7512ba0..ee9647c2ca9 100644 --- a/src/cloudflare/types/rulesets/route_rule.py +++ b/src/cloudflare/types/rulesets/route_rule.py @@ -7,7 +7,7 @@ from .logging import Logging from ..._models import BaseModel -__all__ = ["RouteRule", "ActionParameters", "ActionParametersOrigin", "ActionParametersSni"] +__all__ = ["RouteRule", "ActionParameters", "ActionParametersOrigin", "ActionParametersSNI"] class ActionParametersOrigin(BaseModel): @@ -18,7 +18,7 @@ class ActionParametersOrigin(BaseModel): """Override the destination port.""" -class ActionParametersSni(BaseModel): +class ActionParametersSNI(BaseModel): value: str """The SNI override.""" @@ -30,7 +30,7 @@ class ActionParameters(BaseModel): origin: Optional[ActionParametersOrigin] = None """Override the IP/TCP destination.""" - sni: Optional[ActionParametersSni] = None + sni: Optional[ActionParametersSNI] = None """Override the Server Name Indication (SNI).""" diff --git a/src/cloudflare/types/rulesets/route_rule_param.py b/src/cloudflare/types/rulesets/route_rule_param.py index 06ba330a332..13738c29b68 100644 --- a/src/cloudflare/types/rulesets/route_rule_param.py +++ b/src/cloudflare/types/rulesets/route_rule_param.py @@ -6,7 +6,7 @@ from .logging_param import LoggingParam -__all__ = ["RouteRuleParam", "ActionParameters", "ActionParametersOrigin", "ActionParametersSni"] +__all__ = ["RouteRuleParam", "ActionParameters", "ActionParametersOrigin", "ActionParametersSNI"] class ActionParametersOrigin(TypedDict, total=False): @@ -17,7 +17,7 @@ class ActionParametersOrigin(TypedDict, total=False): """Override the destination port.""" -class ActionParametersSni(TypedDict, total=False): +class ActionParametersSNI(TypedDict, total=False): value: Required[str] """The SNI override.""" @@ -29,7 +29,7 @@ class ActionParameters(TypedDict, total=False): origin: ActionParametersOrigin """Override the IP/TCP destination.""" - sni: ActionParametersSni + sni: ActionParametersSNI """Override the Server Name Indication (SNI).""" diff --git a/src/cloudflare/types/rulesets/rule_create_params.py b/src/cloudflare/types/rulesets/rule_create_params.py index 0aa3ff1f5a8..e4df9ee3c94 100644 --- a/src/cloudflare/types/rulesets/rule_create_params.py +++ b/src/cloudflare/types/rulesets/rule_create_params.py @@ -43,7 +43,7 @@ "RouteRule", "RouteRuleActionParameters", "RouteRuleActionParametersOrigin", - "RouteRuleActionParametersSni", + "RouteRuleActionParametersSNI", "ScoreRule", "ScoreRuleActionParameters", "ServeErrorRule", @@ -588,7 +588,7 @@ class RouteRuleActionParametersOrigin(TypedDict, total=False): """Override the destination port.""" -class RouteRuleActionParametersSni(TypedDict, total=False): +class RouteRuleActionParametersSNI(TypedDict, total=False): value: Required[str] """The SNI override.""" @@ -600,7 +600,7 @@ class RouteRuleActionParameters(TypedDict, total=False): origin: RouteRuleActionParametersOrigin """Override the IP/TCP destination.""" - sni: RouteRuleActionParametersSni + sni: RouteRuleActionParametersSNI """Override the Server Name Indication (SNI).""" diff --git a/src/cloudflare/types/rulesets/rule_edit_params.py b/src/cloudflare/types/rulesets/rule_edit_params.py index 2b4fabd4b76..32c27ccd157 100644 --- a/src/cloudflare/types/rulesets/rule_edit_params.py +++ b/src/cloudflare/types/rulesets/rule_edit_params.py @@ -43,7 +43,7 @@ "RouteRule", "RouteRuleActionParameters", "RouteRuleActionParametersOrigin", - "RouteRuleActionParametersSni", + "RouteRuleActionParametersSNI", "ScoreRule", "ScoreRuleActionParameters", "ServeErrorRule", @@ -618,7 +618,7 @@ class RouteRuleActionParametersOrigin(TypedDict, total=False): """Override the destination port.""" -class RouteRuleActionParametersSni(TypedDict, total=False): +class RouteRuleActionParametersSNI(TypedDict, total=False): value: Required[str] """The SNI override.""" @@ -630,7 +630,7 @@ class RouteRuleActionParameters(TypedDict, total=False): origin: RouteRuleActionParametersOrigin """Override the IP/TCP destination.""" - sni: RouteRuleActionParametersSni + sni: RouteRuleActionParametersSNI """Override the Server Name Indication (SNI).""" diff --git a/src/cloudflare/types/user/organization.py b/src/cloudflare/types/user/organization.py index 1db4388d7de..d464f217e36 100644 --- a/src/cloudflare/types/user/organization.py +++ b/src/cloudflare/types/user/organization.py @@ -1,10 +1,10 @@ # 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 ..shared.permission import Permission +from ..accounts.member_status import MemberStatus __all__ = ["Organization"] @@ -22,5 +22,5 @@ class Organization(BaseModel): roles: Optional[List[str]] = None """List of roles that a user has within an organization.""" - status: Optional[Literal["member", "invited"]] = None + status: Optional[MemberStatus] = None """Whether the user is a member of the organization or has an inivitation pending.""" diff --git a/tests/api_resources/acm/test_total_tls.py b/tests/api_resources/acm/test_total_tls.py index 5ac61d4a656..cf7af173e5f 100644 --- a/tests/api_resources/acm/test_total_tls.py +++ b/tests/api_resources/acm/test_total_tls.py @@ -9,7 +9,10 @@ from cloudflare import Cloudflare, AsyncCloudflare from tests.utils import assert_matches_type -from cloudflare.types.acm import TotalTLSGetResponse, TotalTLSCreateResponse +from cloudflare.types.acm import ( + TotalTLSGetResponse, + TotalTLSCreateResponse, +) base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010")