Skip to content

Commit

Permalink
feat(api): update via SDK Studio (#469)
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 a6c4b4b commit 37db74d
Show file tree
Hide file tree
Showing 17 changed files with 53 additions and 28 deletions.
8 changes: 7 additions & 1 deletion api.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
from cloudflare.types import (
ASN,
AuditLog,
CertificatePackRequestType,
CloudflareTunnel,
ErrorData,
Identifier,
Expand Down Expand Up @@ -1285,7 +1286,6 @@ Types:
from cloudflare.types.ssl import (
CertificateAuthority,
Host,
RequestType,
RequestValidity,
Status,
ValidationMethod,
Expand Down Expand Up @@ -1700,6 +1700,12 @@ Methods:

### Analytics

Types:

```python
from cloudflare.types.dns.firewall import Delta
```

#### Reports

Methods:
Expand Down
9 changes: 4 additions & 5 deletions src/cloudflare/resources/dns/analytics/reports/bytimes.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

from typing import Type, Union, Optional, cast
from datetime import datetime
from typing_extensions import Literal

import httpx

Expand All @@ -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

Expand All @@ -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.
Expand Down Expand Up @@ -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.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

from typing import Type, Union, Optional, cast
from datetime import datetime
from typing_extensions import Literal

import httpx

Expand All @@ -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

Expand All @@ -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.
Expand Down Expand Up @@ -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.
Expand Down
8 changes: 4 additions & 4 deletions src/cloudflare/resources/origin_ca_certificates.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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.
Expand Down Expand Up @@ -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.
Expand Down
1 change: 1 addition & 0 deletions src/cloudflare/types/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,5 @@
PermissionGrant as PermissionGrant,
CloudflareTunnel as CloudflareTunnel,
LoadBalancerPreview as LoadBalancerPreview,
CertificatePackRequestType as CertificatePackRequestType,
)
Original file line number Diff line number Diff line change
Expand Up @@ -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"]

Expand Down Expand Up @@ -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")]
Expand Down
4 changes: 2 additions & 2 deletions src/cloudflare/types/dns/dns_analytics_query.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"]

Expand All @@ -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
Expand Down
1 change: 1 addition & 0 deletions src/cloudflare/types/dns/firewall/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@

from __future__ import annotations

from .delta import Delta as Delta
from .firewall import Firewall as Firewall
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
Expand Down Expand Up @@ -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")]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
Original file line number Diff line number Diff line change
Expand Up @@ -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"]

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

Expand All @@ -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).
Expand Down
1 change: 1 addition & 0 deletions src/cloudflare/types/shared/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
7 changes: 7 additions & 0 deletions src/cloudflare/types/shared/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"]
1 change: 1 addition & 0 deletions src/cloudflare/types/shared_params/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Original file line number Diff line number Diff line change
@@ -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"]
1 change: 0 additions & 1 deletion src/cloudflare/types/ssl/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 37db74d

Please sign in to comment.