Skip to content

Commit

Permalink
feat(api): update via SDK Studio (#466)
Browse files Browse the repository at this point in the history
  • Loading branch information
stainless-app[bot] authored and stainless-bot committed May 7, 2024
1 parent a7900a2 commit 8f7435e
Show file tree
Hide file tree
Showing 16 changed files with 67 additions and 18 deletions.
4 changes: 4 additions & 0 deletions api.md
Original file line number Diff line number Diff line change
Expand Up @@ -1278,7 +1278,11 @@ Types:

```python
from cloudflare.types.ssl import (
CertificatePackCA,
CertificatePackRequestType,
CertificatePackRequestValidity,
CertificatePackStatus,
CertificatePackValidationMethod,
Host,
CertificatePackListResponse,
CertificatePackDeleteResponse,
Expand Down
12 changes: 7 additions & 5 deletions src/cloudflare/resources/origin_ca_certificates.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
from __future__ import annotations

from typing import Any, Type, Iterable, Optional, cast
from typing_extensions import Literal

import httpx

Expand All @@ -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
Expand All @@ -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,
Expand Down Expand Up @@ -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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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"]

Expand Down Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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"]

Expand Down Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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"]

Expand All @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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"]

Expand All @@ -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."""
4 changes: 4 additions & 0 deletions src/cloudflare/types/ssl/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
7 changes: 7 additions & 0 deletions src/cloudflare/types/ssl/certificate_pack_ca.py
Original file line number Diff line number Diff line change
@@ -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"]
7 changes: 7 additions & 0 deletions src/cloudflare/types/ssl/certificate_pack_request_type.py
Original file line number Diff line number Diff line change
@@ -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"]
7 changes: 7 additions & 0 deletions src/cloudflare/types/ssl/certificate_pack_request_validity.py
Original file line number Diff line number Diff line change
@@ -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]
Original file line number Diff line number Diff line change
@@ -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"]
3 changes: 2 additions & 1 deletion src/cloudflare/types/ssl/verification.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
from typing_extensions import Literal

from ..._models import BaseModel
from .certificate_pack_validation_method import CertificatePackValidationMethod

__all__ = ["Verification", "VerificationInfo"]

Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 8f7435e

Please sign in to comment.