From 37db74ddacb5adc258985c22b5e27b605b7f3e64 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:30:44 +0000 Subject: [PATCH] feat(api): update via SDK Studio (#469) --- api.md | 8 +++++++- .../resources/dns/analytics/reports/bytimes.py | 9 ++++----- .../resources/dns/firewall/analytics/reports/bytimes.py | 9 ++++----- src/cloudflare/resources/origin_ca_certificates.py | 8 ++++---- src/cloudflare/types/__init__.py | 1 + .../types/dns/analytics/reports/bytime_get_params.py | 5 +++-- src/cloudflare/types/dns/dns_analytics_query.py | 4 ++-- src/cloudflare/types/dns/firewall/__init__.py | 1 + .../dns/firewall/analytics/reports/bytime_get_params.py | 5 +++-- .../types/{ssl/request_type.py => dns/firewall/delta.py} | 4 ++-- .../origin_ca_certificates/origin_ca_certificate.py | 4 ++-- .../origin_ca_certificate_create_params.py | 4 ++-- src/cloudflare/types/shared/__init__.py | 1 + .../types/shared/certificate_pack_request_type.py | 7 +++++++ src/cloudflare/types/shared_params/__init__.py | 1 + .../types/shared_params/certificate_pack_request_type.py | 9 +++++++++ src/cloudflare/types/ssl/__init__.py | 1 - 17 files changed, 53 insertions(+), 28 deletions(-) rename src/cloudflare/types/{ssl/request_type.py => dns/firewall/delta.py} (50%) create mode 100644 src/cloudflare/types/shared/certificate_pack_request_type.py create mode 100644 src/cloudflare/types/shared_params/certificate_pack_request_type.py diff --git a/api.md b/api.md index ce214ccdcdd..82f9d6ad955 100644 --- a/api.md +++ b/api.md @@ -4,6 +4,7 @@ from cloudflare.types import ( ASN, AuditLog, + CertificatePackRequestType, CloudflareTunnel, ErrorData, Identifier, @@ -1285,7 +1286,6 @@ Types: from cloudflare.types.ssl import ( CertificateAuthority, Host, - RequestType, RequestValidity, Status, ValidationMethod, @@ -1700,6 +1700,12 @@ Methods: ### Analytics +Types: + +```python +from cloudflare.types.dns.firewall import Delta +``` + #### Reports Methods: diff --git a/src/cloudflare/resources/dns/analytics/reports/bytimes.py b/src/cloudflare/resources/dns/analytics/reports/bytimes.py index e63915e8090..18e924c6fb2 100644 --- a/src/cloudflare/resources/dns/analytics/reports/bytimes.py +++ b/src/cloudflare/resources/dns/analytics/reports/bytimes.py @@ -4,7 +4,6 @@ from typing import Type, Union, Optional, cast from datetime import datetime -from typing_extensions import Literal import httpx @@ -25,6 +24,8 @@ from ....._base_client import ( make_request_options, ) +from .....types.dns.firewall import Delta +from .....types.dns.firewall.delta import Delta from .....types.dns.analytics.reports import bytime_get_params from .....types.dns.analytics.reports.by_time import ByTime @@ -50,8 +51,7 @@ def get( metrics: str | NotGiven = NOT_GIVEN, since: Union[str, datetime] | NotGiven = NOT_GIVEN, sort: str | NotGiven = NOT_GIVEN, - time_delta: Literal["all", "auto", "year", "quarter", "month", "week", "day", "hour", "dekaminute", "minute"] - | NotGiven = NOT_GIVEN, + time_delta: Delta | NotGiven = NOT_GIVEN, until: Union[str, datetime] | 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. @@ -142,8 +142,7 @@ async def get( metrics: str | NotGiven = NOT_GIVEN, since: Union[str, datetime] | NotGiven = NOT_GIVEN, sort: str | NotGiven = NOT_GIVEN, - time_delta: Literal["all", "auto", "year", "quarter", "month", "week", "day", "hour", "dekaminute", "minute"] - | NotGiven = NOT_GIVEN, + time_delta: Delta | NotGiven = NOT_GIVEN, until: Union[str, datetime] | 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. diff --git a/src/cloudflare/resources/dns/firewall/analytics/reports/bytimes.py b/src/cloudflare/resources/dns/firewall/analytics/reports/bytimes.py index 05c24c9cce7..de7eb9723da 100644 --- a/src/cloudflare/resources/dns/firewall/analytics/reports/bytimes.py +++ b/src/cloudflare/resources/dns/firewall/analytics/reports/bytimes.py @@ -4,7 +4,6 @@ from typing import Type, Union, Optional, cast from datetime import datetime -from typing_extensions import Literal import httpx @@ -25,6 +24,8 @@ from ......_base_client import ( make_request_options, ) +from ......types.dns.firewall import Delta +from ......types.dns.firewall.delta import Delta from ......types.dns.analytics.reports.by_time import ByTime from ......types.dns.firewall.analytics.reports import bytime_get_params @@ -51,8 +52,7 @@ def get( metrics: str | NotGiven = NOT_GIVEN, since: Union[str, datetime] | NotGiven = NOT_GIVEN, sort: str | NotGiven = NOT_GIVEN, - time_delta: Literal["all", "auto", "year", "quarter", "month", "week", "day", "hour", "dekaminute", "minute"] - | NotGiven = NOT_GIVEN, + time_delta: Delta | NotGiven = NOT_GIVEN, until: Union[str, datetime] | 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. @@ -148,8 +148,7 @@ async def get( metrics: str | NotGiven = NOT_GIVEN, since: Union[str, datetime] | NotGiven = NOT_GIVEN, sort: str | NotGiven = NOT_GIVEN, - time_delta: Literal["all", "auto", "year", "quarter", "month", "week", "day", "hour", "dekaminute", "minute"] - | NotGiven = NOT_GIVEN, + time_delta: Delta | NotGiven = NOT_GIVEN, until: Union[str, datetime] | 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. diff --git a/src/cloudflare/resources/origin_ca_certificates.py b/src/cloudflare/resources/origin_ca_certificates.py index 38c86adcefd..9b5e93c7c65 100644 --- a/src/cloudflare/resources/origin_ca_certificates.py +++ b/src/cloudflare/resources/origin_ca_certificates.py @@ -20,15 +20,15 @@ async_to_streamed_response_wrapper, ) from .._wrappers import ResultWrapper -from ..types.ssl import RequestType, RequestValidity +from ..types.ssl import RequestValidity from ..pagination import SyncSinglePage, AsyncSinglePage from .._base_client import ( AsyncPaginator, make_request_options, ) -from ..types.ssl.request_type import RequestType from ..types.ssl.request_validity import RequestValidity from ..types.origin_ca_certificates import origin_ca_certificate_list_params, origin_ca_certificate_create_params +from ..types.shared.certificate_pack_request_type import CertificatePackRequestType 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 @@ -51,7 +51,7 @@ def create( *, csr: str | NotGiven = NOT_GIVEN, hostnames: Iterable[object] | NotGiven = NOT_GIVEN, - request_type: RequestType | NotGiven = NOT_GIVEN, + request_type: CertificatePackRequestType | NotGiven = NOT_GIVEN, requested_validity: RequestValidity | 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. @@ -259,7 +259,7 @@ async def create( *, csr: str | NotGiven = NOT_GIVEN, hostnames: Iterable[object] | NotGiven = NOT_GIVEN, - request_type: RequestType | NotGiven = NOT_GIVEN, + request_type: CertificatePackRequestType | NotGiven = NOT_GIVEN, requested_validity: RequestValidity | 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. diff --git a/src/cloudflare/types/__init__.py b/src/cloudflare/types/__init__.py index c61c5c1b5e3..debf7cacb6a 100644 --- a/src/cloudflare/types/__init__.py +++ b/src/cloudflare/types/__init__.py @@ -16,4 +16,5 @@ PermissionGrant as PermissionGrant, CloudflareTunnel as CloudflareTunnel, LoadBalancerPreview as LoadBalancerPreview, + CertificatePackRequestType as CertificatePackRequestType, ) diff --git a/src/cloudflare/types/dns/analytics/reports/bytime_get_params.py b/src/cloudflare/types/dns/analytics/reports/bytime_get_params.py index 12ef8217a02..ece9fe71b05 100644 --- a/src/cloudflare/types/dns/analytics/reports/bytime_get_params.py +++ b/src/cloudflare/types/dns/analytics/reports/bytime_get_params.py @@ -4,9 +4,10 @@ from typing import Union from datetime import datetime -from typing_extensions import Literal, Required, Annotated, TypedDict +from typing_extensions import Required, Annotated, TypedDict from ....._utils import PropertyInfo +from ...firewall.delta import Delta __all__ = ["BytimeGetParams"] @@ -36,7 +37,7 @@ class BytimeGetParams(TypedDict, total=False): prefixed by - (descending) or + (ascending). """ - time_delta: Literal["all", "auto", "year", "quarter", "month", "week", "day", "hour", "dekaminute", "minute"] + time_delta: Delta """Unit of time to group data by.""" until: Annotated[Union[str, datetime], PropertyInfo(format="iso8601")] diff --git a/src/cloudflare/types/dns/dns_analytics_query.py b/src/cloudflare/types/dns/dns_analytics_query.py index b1d886168e6..a34fcd322bb 100644 --- a/src/cloudflare/types/dns/dns_analytics_query.py +++ b/src/cloudflare/types/dns/dns_analytics_query.py @@ -2,9 +2,9 @@ from typing import List, Optional from datetime import datetime -from typing_extensions import Literal from ..._models import BaseModel +from .firewall.delta import Delta __all__ = ["DNSAnalyticsQuery"] @@ -22,7 +22,7 @@ class DNSAnalyticsQuery(BaseModel): since: datetime """Start date and time of requesting data period in ISO 8601 format.""" - time_delta: Literal["all", "auto", "year", "quarter", "month", "week", "day", "hour", "dekaminute", "minute"] + time_delta: Delta """Unit of time to group data by.""" until: datetime diff --git a/src/cloudflare/types/dns/firewall/__init__.py b/src/cloudflare/types/dns/firewall/__init__.py index 1e446ac36d1..72f681823a2 100644 --- a/src/cloudflare/types/dns/firewall/__init__.py +++ b/src/cloudflare/types/dns/firewall/__init__.py @@ -2,4 +2,5 @@ from __future__ import annotations +from .delta import Delta as Delta from .firewall import Firewall as Firewall diff --git a/src/cloudflare/types/dns/firewall/analytics/reports/bytime_get_params.py b/src/cloudflare/types/dns/firewall/analytics/reports/bytime_get_params.py index 91d85b4a63a..34773f8974a 100644 --- a/src/cloudflare/types/dns/firewall/analytics/reports/bytime_get_params.py +++ b/src/cloudflare/types/dns/firewall/analytics/reports/bytime_get_params.py @@ -4,8 +4,9 @@ from typing import Union from datetime import datetime -from typing_extensions import Literal, Required, Annotated, TypedDict +from typing_extensions import Required, Annotated, TypedDict +from ...delta import Delta from ......_utils import PropertyInfo __all__ = ["BytimeGetParams"] @@ -36,7 +37,7 @@ class BytimeGetParams(TypedDict, total=False): prefixed by - (descending) or + (ascending). """ - time_delta: Literal["all", "auto", "year", "quarter", "month", "week", "day", "hour", "dekaminute", "minute"] + time_delta: Delta """Unit of time to group data by.""" until: Annotated[Union[str, datetime], PropertyInfo(format="iso8601")] diff --git a/src/cloudflare/types/ssl/request_type.py b/src/cloudflare/types/dns/firewall/delta.py similarity index 50% rename from src/cloudflare/types/ssl/request_type.py rename to src/cloudflare/types/dns/firewall/delta.py index ef5b498b0da..0d5a9933f8b 100644 --- a/src/cloudflare/types/ssl/request_type.py +++ b/src/cloudflare/types/dns/firewall/delta.py @@ -2,6 +2,6 @@ from typing_extensions import Literal -__all__ = ["RequestType"] +__all__ = ["Delta"] -RequestType = Literal["origin-rsa", "origin-ecc", "keyless-certificate"] +Delta = Literal["all", "auto", "year", "quarter", "month", "week", "day", "hour", "dekaminute", "minute"] 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 ed6842cd235..1d9ed5cf403 100644 --- a/src/cloudflare/types/origin_ca_certificates/origin_ca_certificate.py +++ b/src/cloudflare/types/origin_ca_certificates/origin_ca_certificate.py @@ -4,8 +4,8 @@ from datetime import datetime from ..._models import BaseModel -from ..ssl.request_type import RequestType from ..ssl.request_validity import RequestValidity +from ..shared.certificate_pack_request_type import CertificatePackRequestType __all__ = ["OriginCACertificate"] @@ -20,7 +20,7 @@ class OriginCACertificate(BaseModel): certificate. """ - request_type: RequestType + request_type: CertificatePackRequestType """ Signature type desired on certificate ("origin-rsa" (rsa), "origin-ecc" (ecdsa), or "keyless-certificate" (for Keyless SSL servers). 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 8c48e958c68..3adb18d7f3f 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 @@ -5,8 +5,8 @@ from typing import Iterable from typing_extensions import TypedDict -from ..ssl.request_type import RequestType from ..ssl.request_validity import RequestValidity +from ..shared.certificate_pack_request_type import CertificatePackRequestType __all__ = ["OriginCACertificateCreateParams"] @@ -21,7 +21,7 @@ class OriginCACertificateCreateParams(TypedDict, total=False): certificate. """ - request_type: RequestType + request_type: CertificatePackRequestType """ Signature type desired on certificate ("origin-rsa" (rsa), "origin-ecc" (ecdsa), or "keyless-certificate" (for Keyless SSL servers). diff --git a/src/cloudflare/types/shared/__init__.py b/src/cloudflare/types/shared/__init__.py index d6d57611926..933cdb9a98b 100644 --- a/src/cloudflare/types/shared/__init__.py +++ b/src/cloudflare/types/shared/__init__.py @@ -13,3 +13,4 @@ from .permission_grant import PermissionGrant as PermissionGrant from .cloudflare_tunnel import CloudflareTunnel as CloudflareTunnel from .load_balancer_preview import LoadBalancerPreview as LoadBalancerPreview +from .certificate_pack_request_type import CertificatePackRequestType as CertificatePackRequestType diff --git a/src/cloudflare/types/shared/certificate_pack_request_type.py b/src/cloudflare/types/shared/certificate_pack_request_type.py new file mode 100644 index 00000000000..850d67c2f5e --- /dev/null +++ b/src/cloudflare/types/shared/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/shared_params/__init__.py b/src/cloudflare/types/shared_params/__init__.py index 9d75a6e1543..1827eea3707 100644 --- a/src/cloudflare/types/shared_params/__init__.py +++ b/src/cloudflare/types/shared_params/__init__.py @@ -2,3 +2,4 @@ from .asn import ASN as ASN from .permission_grant import PermissionGrant as PermissionGrant +from .certificate_pack_request_type import CertificatePackRequestType as CertificatePackRequestType diff --git a/src/cloudflare/types/shared_params/certificate_pack_request_type.py b/src/cloudflare/types/shared_params/certificate_pack_request_type.py new file mode 100644 index 00000000000..aa3fe05410f --- /dev/null +++ b/src/cloudflare/types/shared_params/certificate_pack_request_type.py @@ -0,0 +1,9 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Literal + +__all__ = ["CertificatePackRequestType"] + +CertificatePackRequestType = Literal["origin-rsa", "origin-ecc", "keyless-certificate"] diff --git a/src/cloudflare/types/ssl/__init__.py b/src/cloudflare/types/ssl/__init__.py index c10a873819a..c1afaaddf69 100644 --- a/src/cloudflare/types/ssl/__init__.py +++ b/src/cloudflare/types/ssl/__init__.py @@ -4,7 +4,6 @@ from .host import Host as Host from .status import Status as Status -from .request_type import RequestType as RequestType from .verification import Verification as Verification from .request_validity import RequestValidity as RequestValidity from .validation_method import ValidationMethod as ValidationMethod