From 8f7435e210ddd68ae8aff9af04863a6aca5bbdd3 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:08:04 +0000 Subject: [PATCH] feat(api): update via SDK Studio (#466) --- api.md | 4 ++++ src/cloudflare/resources/origin_ca_certificates.py | 12 +++++++----- .../custom_hostname_create_params.py | 3 ++- .../custom_hostname_create_response.py | 3 ++- .../custom_hostnames/custom_hostname_edit_params.py | 3 ++- .../custom_hostname_edit_response.py | 3 ++- .../custom_hostnames/custom_hostname_get_response.py | 3 ++- .../custom_hostname_list_response.py | 3 ++- .../origin_ca_certificates/origin_ca_certificate.py | 7 ++++--- .../origin_ca_certificate_create_params.py | 9 ++++++--- src/cloudflare/types/ssl/__init__.py | 4 ++++ src/cloudflare/types/ssl/certificate_pack_ca.py | 7 +++++++ .../types/ssl/certificate_pack_request_type.py | 7 +++++++ .../types/ssl/certificate_pack_request_validity.py | 7 +++++++ .../types/ssl/certificate_pack_validation_method.py | 7 +++++++ src/cloudflare/types/ssl/verification.py | 3 ++- 16 files changed, 67 insertions(+), 18 deletions(-) create mode 100644 src/cloudflare/types/ssl/certificate_pack_ca.py create mode 100644 src/cloudflare/types/ssl/certificate_pack_request_type.py create mode 100644 src/cloudflare/types/ssl/certificate_pack_request_validity.py create mode 100644 src/cloudflare/types/ssl/certificate_pack_validation_method.py diff --git a/api.md b/api.md index 7e30a1adb2b..860c183080f 100644 --- a/api.md +++ b/api.md @@ -1278,7 +1278,11 @@ Types: ```python from cloudflare.types.ssl import ( + CertificatePackCA, + CertificatePackRequestType, + CertificatePackRequestValidity, CertificatePackStatus, + CertificatePackValidationMethod, Host, CertificatePackListResponse, CertificatePackDeleteResponse, diff --git a/src/cloudflare/resources/origin_ca_certificates.py b/src/cloudflare/resources/origin_ca_certificates.py index 116b93cb420..f73e83b26d4 100644 --- a/src/cloudflare/resources/origin_ca_certificates.py +++ b/src/cloudflare/resources/origin_ca_certificates.py @@ -3,7 +3,6 @@ from __future__ import annotations from typing import Any, Type, Iterable, Optional, cast -from typing_extensions import Literal import httpx @@ -21,12 +20,15 @@ async_to_streamed_response_wrapper, ) from .._wrappers import ResultWrapper +from ..types.ssl import CertificatePackRequestType, CertificatePackRequestValidity from ..pagination import SyncSinglePage, AsyncSinglePage from .._base_client import ( AsyncPaginator, make_request_options, ) from ..types.origin_ca_certificates import origin_ca_certificate_list_params, origin_ca_certificate_create_params +from ..types.ssl.certificate_pack_request_type import CertificatePackRequestType +from ..types.ssl.certificate_pack_request_validity import CertificatePackRequestValidity from ..types.origin_ca_certificates.origin_ca_certificate import OriginCACertificate from ..types.origin_ca_certificates.origin_ca_certificate_get_response import OriginCACertificateGetResponse from ..types.origin_ca_certificates.origin_ca_certificate_create_response import OriginCACertificateCreateResponse @@ -49,8 +51,8 @@ def create( *, csr: str | NotGiven = NOT_GIVEN, hostnames: Iterable[object] | NotGiven = NOT_GIVEN, - request_type: Literal["origin-rsa", "origin-ecc", "keyless-certificate"] | NotGiven = NOT_GIVEN, - requested_validity: Literal[7, 30, 90, 365, 730, 1095, 5475] | NotGiven = NOT_GIVEN, + request_type: CertificatePackRequestType | NotGiven = NOT_GIVEN, + requested_validity: CertificatePackRequestValidity | 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, @@ -257,8 +259,8 @@ async def create( *, csr: str | NotGiven = NOT_GIVEN, hostnames: Iterable[object] | NotGiven = NOT_GIVEN, - request_type: Literal["origin-rsa", "origin-ecc", "keyless-certificate"] | NotGiven = NOT_GIVEN, - requested_validity: Literal[7, 30, 90, 365, 730, 1095, 5475] | NotGiven = NOT_GIVEN, + request_type: CertificatePackRequestType | NotGiven = NOT_GIVEN, + requested_validity: CertificatePackRequestValidity | 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/custom_hostnames/custom_hostname_create_params.py b/src/cloudflare/types/custom_hostnames/custom_hostname_create_params.py index ef1ec55d60b..60ba3fb69b7 100644 --- a/src/cloudflare/types/custom_hostnames/custom_hostname_create_params.py +++ b/src/cloudflare/types/custom_hostnames/custom_hostname_create_params.py @@ -8,6 +8,7 @@ from .dcv_method import DCVMethod from .bundle_method import BundleMethod from .domain_validation_type import DomainValidationType +from ..ssl.certificate_pack_ca import CertificatePackCA __all__ = ["CustomHostnameCreateParams", "SSL", "SSLSettings", "CustomMetadata"] @@ -55,7 +56,7 @@ class SSL(TypedDict, total=False): chain, but does not otherwise modify it. """ - certificate_authority: Literal["digicert", "google", "lets_encrypt"] + certificate_authority: CertificatePackCA """The Certificate Authority that will issue the certificate""" custom_certificate: str diff --git a/src/cloudflare/types/custom_hostnames/custom_hostname_create_response.py b/src/cloudflare/types/custom_hostnames/custom_hostname_create_response.py index 236e82ae631..91eae242109 100644 --- a/src/cloudflare/types/custom_hostnames/custom_hostname_create_response.py +++ b/src/cloudflare/types/custom_hostnames/custom_hostname_create_response.py @@ -8,6 +8,7 @@ from .dcv_method import DCVMethod from .bundle_method import BundleMethod from .domain_validation_type import DomainValidationType +from ..ssl.certificate_pack_ca import CertificatePackCA __all__ = [ "CustomHostnameCreateResponse", @@ -87,7 +88,7 @@ class SSL(BaseModel): chain, but does not otherwise modify it. """ - certificate_authority: Optional[Literal["digicert", "google", "lets_encrypt"]] = None + certificate_authority: Optional[CertificatePackCA] = None """The Certificate Authority that will issue the certificate""" custom_certificate: Optional[str] = None diff --git a/src/cloudflare/types/custom_hostnames/custom_hostname_edit_params.py b/src/cloudflare/types/custom_hostnames/custom_hostname_edit_params.py index a1c237659da..fd206263555 100644 --- a/src/cloudflare/types/custom_hostnames/custom_hostname_edit_params.py +++ b/src/cloudflare/types/custom_hostnames/custom_hostname_edit_params.py @@ -8,6 +8,7 @@ from .dcv_method import DCVMethod from .bundle_method import BundleMethod from .domain_validation_type import DomainValidationType +from ..ssl.certificate_pack_ca import CertificatePackCA __all__ = ["CustomHostnameEditParams", "CustomMetadata", "SSL", "SSLSettings"] @@ -72,7 +73,7 @@ class SSL(TypedDict, total=False): chain, but does not otherwise modify it. """ - certificate_authority: Literal["digicert", "google", "lets_encrypt"] + certificate_authority: CertificatePackCA """The Certificate Authority that will issue the certificate""" custom_certificate: str diff --git a/src/cloudflare/types/custom_hostnames/custom_hostname_edit_response.py b/src/cloudflare/types/custom_hostnames/custom_hostname_edit_response.py index 8697979d1a7..d2f1c904ceb 100644 --- a/src/cloudflare/types/custom_hostnames/custom_hostname_edit_response.py +++ b/src/cloudflare/types/custom_hostnames/custom_hostname_edit_response.py @@ -8,6 +8,7 @@ from .dcv_method import DCVMethod from .bundle_method import BundleMethod from .domain_validation_type import DomainValidationType +from ..ssl.certificate_pack_ca import CertificatePackCA __all__ = [ "CustomHostnameEditResponse", @@ -87,7 +88,7 @@ class SSL(BaseModel): chain, but does not otherwise modify it. """ - certificate_authority: Optional[Literal["digicert", "google", "lets_encrypt"]] = None + certificate_authority: Optional[CertificatePackCA] = None """The Certificate Authority that will issue the certificate""" custom_certificate: Optional[str] = None diff --git a/src/cloudflare/types/custom_hostnames/custom_hostname_get_response.py b/src/cloudflare/types/custom_hostnames/custom_hostname_get_response.py index 1b539d1df8e..f2cd3a05994 100644 --- a/src/cloudflare/types/custom_hostnames/custom_hostname_get_response.py +++ b/src/cloudflare/types/custom_hostnames/custom_hostname_get_response.py @@ -8,6 +8,7 @@ from .dcv_method import DCVMethod from .bundle_method import BundleMethod from .domain_validation_type import DomainValidationType +from ..ssl.certificate_pack_ca import CertificatePackCA __all__ = [ "CustomHostnameGetResponse", @@ -87,7 +88,7 @@ class SSL(BaseModel): chain, but does not otherwise modify it. """ - certificate_authority: Optional[Literal["digicert", "google", "lets_encrypt"]] = None + certificate_authority: Optional[CertificatePackCA] = None """The Certificate Authority that will issue the certificate""" custom_certificate: Optional[str] = None diff --git a/src/cloudflare/types/custom_hostnames/custom_hostname_list_response.py b/src/cloudflare/types/custom_hostnames/custom_hostname_list_response.py index de8909d348a..11fbd841560 100644 --- a/src/cloudflare/types/custom_hostnames/custom_hostname_list_response.py +++ b/src/cloudflare/types/custom_hostnames/custom_hostname_list_response.py @@ -8,6 +8,7 @@ from .dcv_method import DCVMethod from .bundle_method import BundleMethod from .domain_validation_type import DomainValidationType +from ..ssl.certificate_pack_ca import CertificatePackCA __all__ = [ "CustomHostnameListResponse", @@ -87,7 +88,7 @@ class SSL(BaseModel): chain, but does not otherwise modify it. """ - certificate_authority: Optional[Literal["digicert", "google", "lets_encrypt"]] = None + certificate_authority: Optional[CertificatePackCA] = None """The Certificate Authority that will issue the certificate""" custom_certificate: Optional[str] = None diff --git a/src/cloudflare/types/origin_ca_certificates/origin_ca_certificate.py b/src/cloudflare/types/origin_ca_certificates/origin_ca_certificate.py index ad5a77af9d4..ebeb3329d02 100644 --- a/src/cloudflare/types/origin_ca_certificates/origin_ca_certificate.py +++ b/src/cloudflare/types/origin_ca_certificates/origin_ca_certificate.py @@ -2,9 +2,10 @@ from typing import List, Optional from datetime import datetime -from typing_extensions import Literal from ..._models import BaseModel +from ..ssl.certificate_pack_request_type import CertificatePackRequestType +from ..ssl.certificate_pack_request_validity import CertificatePackRequestValidity __all__ = ["OriginCACertificate"] @@ -19,13 +20,13 @@ class OriginCACertificate(BaseModel): certificate. """ - request_type: Literal["origin-rsa", "origin-ecc", "keyless-certificate"] + request_type: CertificatePackRequestType """ Signature type desired on certificate ("origin-rsa" (rsa), "origin-ecc" (ecdsa), or "keyless-certificate" (for Keyless SSL servers). """ - requested_validity: Literal[7, 30, 90, 365, 730, 1095, 5475] + requested_validity: CertificatePackRequestValidity """The number of days for which the certificate should be valid.""" id: Optional[str] = None diff --git a/src/cloudflare/types/origin_ca_certificates/origin_ca_certificate_create_params.py b/src/cloudflare/types/origin_ca_certificates/origin_ca_certificate_create_params.py index 1594b520831..1c056197d60 100644 --- a/src/cloudflare/types/origin_ca_certificates/origin_ca_certificate_create_params.py +++ b/src/cloudflare/types/origin_ca_certificates/origin_ca_certificate_create_params.py @@ -3,7 +3,10 @@ from __future__ import annotations from typing import Iterable -from typing_extensions import Literal, TypedDict +from typing_extensions import TypedDict + +from ..ssl.certificate_pack_request_type import CertificatePackRequestType +from ..ssl.certificate_pack_request_validity import CertificatePackRequestValidity __all__ = ["OriginCACertificateCreateParams"] @@ -18,11 +21,11 @@ class OriginCACertificateCreateParams(TypedDict, total=False): certificate. """ - request_type: Literal["origin-rsa", "origin-ecc", "keyless-certificate"] + request_type: CertificatePackRequestType """ Signature type desired on certificate ("origin-rsa" (rsa), "origin-ecc" (ecdsa), or "keyless-certificate" (for Keyless SSL servers). """ - requested_validity: Literal[7, 30, 90, 365, 730, 1095, 5475] + requested_validity: CertificatePackRequestValidity """The number of days for which the certificate should be valid.""" diff --git a/src/cloudflare/types/ssl/__init__.py b/src/cloudflare/types/ssl/__init__.py index 41194fd8266..011d6d34505 100644 --- a/src/cloudflare/types/ssl/__init__.py +++ b/src/cloudflare/types/ssl/__init__.py @@ -4,6 +4,7 @@ from .host import Host as Host from .verification import Verification as Verification +from .certificate_pack_ca import CertificatePackCA as CertificatePackCA from .analyze_create_params import AnalyzeCreateParams as AnalyzeCreateParams from .analyze_create_response import AnalyzeCreateResponse as AnalyzeCreateResponse from .certificate_pack_status import CertificatePackStatus as CertificatePackStatus @@ -15,5 +16,8 @@ from .certificate_pack_edit_params import CertificatePackEditParams as CertificatePackEditParams from .certificate_pack_list_params import CertificatePackListParams as CertificatePackListParams from .certificate_pack_get_response import CertificatePackGetResponse as CertificatePackGetResponse +from .certificate_pack_request_type import CertificatePackRequestType as CertificatePackRequestType from .certificate_pack_edit_response import CertificatePackEditResponse as CertificatePackEditResponse from .certificate_pack_delete_response import CertificatePackDeleteResponse as CertificatePackDeleteResponse +from .certificate_pack_request_validity import CertificatePackRequestValidity as CertificatePackRequestValidity +from .certificate_pack_validation_method import CertificatePackValidationMethod as CertificatePackValidationMethod diff --git a/src/cloudflare/types/ssl/certificate_pack_ca.py b/src/cloudflare/types/ssl/certificate_pack_ca.py new file mode 100644 index 00000000000..ad165429462 --- /dev/null +++ b/src/cloudflare/types/ssl/certificate_pack_ca.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal + +__all__ = ["CertificatePackCA"] + +CertificatePackCA = Literal["digicert", "google", "lets_encrypt"] diff --git a/src/cloudflare/types/ssl/certificate_pack_request_type.py b/src/cloudflare/types/ssl/certificate_pack_request_type.py new file mode 100644 index 00000000000..850d67c2f5e --- /dev/null +++ b/src/cloudflare/types/ssl/certificate_pack_request_type.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal + +__all__ = ["CertificatePackRequestType"] + +CertificatePackRequestType = Literal["origin-rsa", "origin-ecc", "keyless-certificate"] diff --git a/src/cloudflare/types/ssl/certificate_pack_request_validity.py b/src/cloudflare/types/ssl/certificate_pack_request_validity.py new file mode 100644 index 00000000000..bb75848a032 --- /dev/null +++ b/src/cloudflare/types/ssl/certificate_pack_request_validity.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal + +__all__ = ["CertificatePackRequestValidity"] + +CertificatePackRequestValidity = Literal[7, 30, 90, 365, 730, 1095, 5475] diff --git a/src/cloudflare/types/ssl/certificate_pack_validation_method.py b/src/cloudflare/types/ssl/certificate_pack_validation_method.py new file mode 100644 index 00000000000..309677c9cdc --- /dev/null +++ b/src/cloudflare/types/ssl/certificate_pack_validation_method.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal + +__all__ = ["CertificatePackValidationMethod"] + +CertificatePackValidationMethod = Literal["http", "cname", "txt"] diff --git a/src/cloudflare/types/ssl/verification.py b/src/cloudflare/types/ssl/verification.py index deae77ca45f..f3e3805efa9 100644 --- a/src/cloudflare/types/ssl/verification.py +++ b/src/cloudflare/types/ssl/verification.py @@ -4,6 +4,7 @@ from typing_extensions import Literal from ..._models import BaseModel +from .certificate_pack_validation_method import CertificatePackValidationMethod __all__ = ["Verification", "VerificationInfo"] @@ -31,7 +32,7 @@ class Verification(BaseModel): signature: Optional[Literal["ECDSAWithSHA256", "SHA1WithRSA", "SHA256WithRSA"]] = None """Certificate's signature algorithm.""" - validation_method: Optional[Literal["http", "cname", "txt"]] = None + validation_method: Optional[CertificatePackValidationMethod] = None """Validation method in use for a certificate pack order.""" verification_info: Optional[VerificationInfo] = None