Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions .stats.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
configured_endpoints: 2404
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare/cloudflare-874436f83bd9c383144c69da47c4b767bb9c6f4f2bb4945af58cf3b6015f0f62.yml
openapi_spec_hash: beaf9a654991bf65d642e05c03460e4c
config_hash: 2f529580a17438fc62cd0b47db41b6f1
configured_endpoints: 2412
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare/cloudflare-ee348bae3bc19d58249c0a0334ea1be47869fd3c73ea0cbbf505f185acc85393.yml
openapi_spec_hash: ce574d5447a6a01dde1d36709a279533
config_hash: a23f4c71ccd6c6117c24f63ae415dcf7
4 changes: 4 additions & 0 deletions api.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,8 @@ from cloudflare.types import (

# [EmailSecurity](src/cloudflare/resources/email_security/api.md)

# [EmailAuth](src/cloudflare/resources/email_auth/api.md)

# [EmailRouting](src/cloudflare/resources/email_routing/api.md)

# [EmailSending](src/cloudflare/resources/email_sending/api.md)
Expand Down Expand Up @@ -211,6 +213,8 @@ from cloudflare.types import (

# [Calls](src/cloudflare/resources/calls/api.md)

# [MoQ](src/cloudflare/resources/moq/api.md)

# [CloudforceOne](src/cloudflare/resources/cloudforce_one/api.md)

# [AIGateway](src/cloudflare/resources/ai_gateway/api.md)
Expand Down
76 changes: 76 additions & 0 deletions src/cloudflare/_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@
dns,
iam,
ips,
moq,
rum,
ssl,
argo,
Expand Down Expand Up @@ -88,6 +89,7 @@
addressing,
ai_gateway,
audit_logs,
email_auth,
hyperdrive,
page_rules,
zero_trust,
Expand Down Expand Up @@ -163,6 +165,7 @@
from .resources.dns.dns import DNSResource, AsyncDNSResource
from .resources.iam.iam import IAMResource, AsyncIAMResource
from .resources.ips.ips import IPsResource, AsyncIPsResource
from .resources.moq.moq import MoQResource, AsyncMoQResource
from .resources.rum.rum import RUMResource, AsyncRUMResource
from .resources.ssl.ssl import SSLResource, AsyncSSLResource
from .resources.argo.argo import ArgoResource, AsyncArgoResource
Expand Down Expand Up @@ -204,6 +207,7 @@
from .resources.addressing.addressing import AddressingResource, AsyncAddressingResource
from .resources.ai_gateway.ai_gateway import AIGatewayResource, AsyncAIGatewayResource
from .resources.audit_logs.audit_logs import AuditLogsResource, AsyncAuditLogsResource
from .resources.email_auth.email_auth import EmailAuthResource, AsyncEmailAuthResource
from .resources.hyperdrive.hyperdrive import HyperdriveResource, AsyncHyperdriveResource
from .resources.page_rules.page_rules import PageRulesResource, AsyncPageRulesResource
from .resources.zero_trust.zero_trust import ZeroTrustResource, AsyncZeroTrustResource
Expand Down Expand Up @@ -557,6 +561,12 @@ def email_security(self) -> EmailSecurityResource:

return EmailSecurityResource(self)

@cached_property
def email_auth(self) -> EmailAuthResource:
from .resources.email_auth import EmailAuthResource

return EmailAuthResource(self)

@cached_property
def email_routing(self) -> EmailRoutingResource:
from .resources.email_routing import EmailRoutingResource
Expand Down Expand Up @@ -965,6 +975,12 @@ def calls(self) -> CallsResource:

return CallsResource(self)

@cached_property
def moq(self) -> MoQResource:
from .resources.moq import MoQResource

return MoQResource(self)

@cached_property
def cloudforce_one(self) -> CloudforceOneResource:
from .resources.cloudforce_one import CloudforceOneResource
Expand Down Expand Up @@ -1509,6 +1525,12 @@ def email_security(self) -> AsyncEmailSecurityResource:

return AsyncEmailSecurityResource(self)

@cached_property
def email_auth(self) -> AsyncEmailAuthResource:
from .resources.email_auth import AsyncEmailAuthResource

return AsyncEmailAuthResource(self)

@cached_property
def email_routing(self) -> AsyncEmailRoutingResource:
from .resources.email_routing import AsyncEmailRoutingResource
Expand Down Expand Up @@ -1917,6 +1939,12 @@ def calls(self) -> AsyncCallsResource:

return AsyncCallsResource(self)

@cached_property
def moq(self) -> AsyncMoQResource:
from .resources.moq import AsyncMoQResource

return AsyncMoQResource(self)

@cached_property
def cloudforce_one(self) -> AsyncCloudforceOneResource:
from .resources.cloudforce_one import AsyncCloudforceOneResource
Expand Down Expand Up @@ -2381,6 +2409,12 @@ def email_security(self) -> email_security.EmailSecurityResourceWithRawResponse:

return EmailSecurityResourceWithRawResponse(self._client.email_security)

@cached_property
def email_auth(self) -> email_auth.EmailAuthResourceWithRawResponse:
from .resources.email_auth import EmailAuthResourceWithRawResponse

return EmailAuthResourceWithRawResponse(self._client.email_auth)

@cached_property
def email_routing(self) -> email_routing.EmailRoutingResourceWithRawResponse:
from .resources.email_routing import EmailRoutingResourceWithRawResponse
Expand Down Expand Up @@ -2793,6 +2827,12 @@ def calls(self) -> calls.CallsResourceWithRawResponse:

return CallsResourceWithRawResponse(self._client.calls)

@cached_property
def moq(self) -> moq.MoQResourceWithRawResponse:
from .resources.moq import MoQResourceWithRawResponse

return MoQResourceWithRawResponse(self._client.moq)

@cached_property
def cloudforce_one(self) -> cloudforce_one.CloudforceOneResourceWithRawResponse:
from .resources.cloudforce_one import CloudforceOneResourceWithRawResponse
Expand Down Expand Up @@ -3084,6 +3124,12 @@ def email_security(self) -> email_security.AsyncEmailSecurityResourceWithRawResp

return AsyncEmailSecurityResourceWithRawResponse(self._client.email_security)

@cached_property
def email_auth(self) -> email_auth.AsyncEmailAuthResourceWithRawResponse:
from .resources.email_auth import AsyncEmailAuthResourceWithRawResponse

return AsyncEmailAuthResourceWithRawResponse(self._client.email_auth)

@cached_property
def email_routing(self) -> email_routing.AsyncEmailRoutingResourceWithRawResponse:
from .resources.email_routing import AsyncEmailRoutingResourceWithRawResponse
Expand Down Expand Up @@ -3496,6 +3542,12 @@ def calls(self) -> calls.AsyncCallsResourceWithRawResponse:

return AsyncCallsResourceWithRawResponse(self._client.calls)

@cached_property
def moq(self) -> moq.AsyncMoQResourceWithRawResponse:
from .resources.moq import AsyncMoQResourceWithRawResponse

return AsyncMoQResourceWithRawResponse(self._client.moq)

@cached_property
def cloudforce_one(self) -> cloudforce_one.AsyncCloudforceOneResourceWithRawResponse:
from .resources.cloudforce_one import AsyncCloudforceOneResourceWithRawResponse
Expand Down Expand Up @@ -3787,6 +3839,12 @@ def email_security(self) -> email_security.EmailSecurityResourceWithStreamingRes

return EmailSecurityResourceWithStreamingResponse(self._client.email_security)

@cached_property
def email_auth(self) -> email_auth.EmailAuthResourceWithStreamingResponse:
from .resources.email_auth import EmailAuthResourceWithStreamingResponse

return EmailAuthResourceWithStreamingResponse(self._client.email_auth)

@cached_property
def email_routing(self) -> email_routing.EmailRoutingResourceWithStreamingResponse:
from .resources.email_routing import EmailRoutingResourceWithStreamingResponse
Expand Down Expand Up @@ -4199,6 +4257,12 @@ def calls(self) -> calls.CallsResourceWithStreamingResponse:

return CallsResourceWithStreamingResponse(self._client.calls)

@cached_property
def moq(self) -> moq.MoQResourceWithStreamingResponse:
from .resources.moq import MoQResourceWithStreamingResponse

return MoQResourceWithStreamingResponse(self._client.moq)

@cached_property
def cloudforce_one(self) -> cloudforce_one.CloudforceOneResourceWithStreamingResponse:
from .resources.cloudforce_one import CloudforceOneResourceWithStreamingResponse
Expand Down Expand Up @@ -4492,6 +4556,12 @@ def email_security(self) -> email_security.AsyncEmailSecurityResourceWithStreami

return AsyncEmailSecurityResourceWithStreamingResponse(self._client.email_security)

@cached_property
def email_auth(self) -> email_auth.AsyncEmailAuthResourceWithStreamingResponse:
from .resources.email_auth import AsyncEmailAuthResourceWithStreamingResponse

return AsyncEmailAuthResourceWithStreamingResponse(self._client.email_auth)

@cached_property
def email_routing(self) -> email_routing.AsyncEmailRoutingResourceWithStreamingResponse:
from .resources.email_routing import AsyncEmailRoutingResourceWithStreamingResponse
Expand Down Expand Up @@ -4910,6 +4980,12 @@ def calls(self) -> calls.AsyncCallsResourceWithStreamingResponse:

return AsyncCallsResourceWithStreamingResponse(self._client.calls)

@cached_property
def moq(self) -> moq.AsyncMoQResourceWithStreamingResponse:
from .resources.moq import AsyncMoQResourceWithStreamingResponse

return AsyncMoQResourceWithStreamingResponse(self._client.moq)

@cached_property
def cloudforce_one(self) -> cloudforce_one.AsyncCloudforceOneResourceWithStreamingResponse:
from .resources.cloudforce_one import AsyncCloudforceOneResourceWithStreamingResponse
Expand Down
37 changes: 27 additions & 10 deletions src/cloudflare/resources/ai_gateway/billing/spending_limit.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

from __future__ import annotations

import typing_extensions
from typing import Type, cast
from typing_extensions import Literal

Expand Down Expand Up @@ -45,6 +46,7 @@ def with_streaming_response(self) -> SpendingLimitResourceWithStreamingResponse:
"""
return SpendingLimitResourceWithStreamingResponse(self)

@typing_extensions.deprecated("deprecated")
def create(
self,
*,
Expand All @@ -60,7 +62,10 @@ def create(
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> object:
"""
Configure a spending limit with amount, strategy, and duration.
Deprecated: spending limits can no longer be created, enabled, or modified and
this endpoint always responds 403. Use the new AI Gateway spend limits instead:
https://developers.cloudflare.com/ai-gateway/features/spend-limits/. Existing
limits can be removed via DELETE /spending-limit.

Args:
amount: Spending limit amount in cents (min 100).
Expand Down Expand Up @@ -194,6 +199,7 @@ def with_streaming_response(self) -> AsyncSpendingLimitResourceWithStreamingResp
"""
return AsyncSpendingLimitResourceWithStreamingResponse(self)

@typing_extensions.deprecated("deprecated")
async def create(
self,
*,
Expand All @@ -209,7 +215,10 @@ async def create(
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> object:
"""
Configure a spending limit with amount, strategy, and duration.
Deprecated: spending limits can no longer be created, enabled, or modified and
this endpoint always responds 403. Use the new AI Gateway spend limits instead:
https://developers.cloudflare.com/ai-gateway/features/spend-limits/. Existing
limits can be removed via DELETE /spending-limit.

Args:
amount: Spending limit amount in cents (min 100).
Expand Down Expand Up @@ -327,8 +336,10 @@ class SpendingLimitResourceWithRawResponse:
def __init__(self, spending_limit: SpendingLimitResource) -> None:
self._spending_limit = spending_limit

self.create = to_raw_response_wrapper(
spending_limit.create,
self.create = ( # pyright: ignore[reportDeprecated]
to_raw_response_wrapper(
spending_limit.create, # pyright: ignore[reportDeprecated],
)
)
self.delete = to_raw_response_wrapper(
spending_limit.delete,
Expand All @@ -342,8 +353,10 @@ class AsyncSpendingLimitResourceWithRawResponse:
def __init__(self, spending_limit: AsyncSpendingLimitResource) -> None:
self._spending_limit = spending_limit

self.create = async_to_raw_response_wrapper(
spending_limit.create,
self.create = ( # pyright: ignore[reportDeprecated]
async_to_raw_response_wrapper(
spending_limit.create, # pyright: ignore[reportDeprecated],
)
)
self.delete = async_to_raw_response_wrapper(
spending_limit.delete,
Expand All @@ -357,8 +370,10 @@ class SpendingLimitResourceWithStreamingResponse:
def __init__(self, spending_limit: SpendingLimitResource) -> None:
self._spending_limit = spending_limit

self.create = to_streamed_response_wrapper(
spending_limit.create,
self.create = ( # pyright: ignore[reportDeprecated]
to_streamed_response_wrapper(
spending_limit.create, # pyright: ignore[reportDeprecated],
)
)
self.delete = to_streamed_response_wrapper(
spending_limit.delete,
Expand All @@ -372,8 +387,10 @@ class AsyncSpendingLimitResourceWithStreamingResponse:
def __init__(self, spending_limit: AsyncSpendingLimitResource) -> None:
self._spending_limit = spending_limit

self.create = async_to_streamed_response_wrapper(
spending_limit.create,
self.create = ( # pyright: ignore[reportDeprecated]
async_to_streamed_response_wrapper(
spending_limit.create, # pyright: ignore[reportDeprecated],
)
)
self.delete = async_to_streamed_response_wrapper(
spending_limit.delete,
Expand Down
47 changes: 47 additions & 0 deletions src/cloudflare/resources/email_auth/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.

from .spf import (
SPFResource,
AsyncSPFResource,
SPFResourceWithRawResponse,
AsyncSPFResourceWithRawResponse,
SPFResourceWithStreamingResponse,
AsyncSPFResourceWithStreamingResponse,
)
from .email_auth import (
EmailAuthResource,
AsyncEmailAuthResource,
EmailAuthResourceWithRawResponse,
AsyncEmailAuthResourceWithRawResponse,
EmailAuthResourceWithStreamingResponse,
AsyncEmailAuthResourceWithStreamingResponse,
)
from .dmarc_reports import (
DMARCReportsResource,
AsyncDMARCReportsResource,
DMARCReportsResourceWithRawResponse,
AsyncDMARCReportsResourceWithRawResponse,
DMARCReportsResourceWithStreamingResponse,
AsyncDMARCReportsResourceWithStreamingResponse,
)

__all__ = [
"DMARCReportsResource",
"AsyncDMARCReportsResource",
"DMARCReportsResourceWithRawResponse",
"AsyncDMARCReportsResourceWithRawResponse",
"DMARCReportsResourceWithStreamingResponse",
"AsyncDMARCReportsResourceWithStreamingResponse",
"SPFResource",
"AsyncSPFResource",
"SPFResourceWithRawResponse",
"AsyncSPFResourceWithRawResponse",
"SPFResourceWithStreamingResponse",
"AsyncSPFResourceWithStreamingResponse",
"EmailAuthResource",
"AsyncEmailAuthResource",
"EmailAuthResourceWithRawResponse",
"AsyncEmailAuthResourceWithRawResponse",
"EmailAuthResourceWithStreamingResponse",
"AsyncEmailAuthResourceWithStreamingResponse",
]
28 changes: 28 additions & 0 deletions src/cloudflare/resources/email_auth/api.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# EmailAuth

## DMARCReports

Types:

```python
from cloudflare.types.email_auth import DMARCReportEditResponse, DMARCReportGetResponse
```

Methods:

- <code title="patch /zones/{zone_id}/email/auth/dmarc-reports">client.email_auth.dmarc_reports.<a href="./src/cloudflare/resources/email_auth/dmarc_reports.py">edit</a>(\*, zone_id, \*\*<a href="src/cloudflare/types/email_auth/dmarc_report_edit_params.py">params</a>) -> <a href="./src/cloudflare/types/email_auth/dmarc_report_edit_response.py">Optional[DMARCReportEditResponse]</a></code>
- <code title="get /zones/{zone_id}/email/auth/dmarc-reports">client.email_auth.dmarc_reports.<a href="./src/cloudflare/resources/email_auth/dmarc_reports.py">get</a>(\*, zone_id) -> <a href="./src/cloudflare/types/email_auth/dmarc_report_get_response.py">Optional[DMARCReportGetResponse]</a></code>

## SPF

### Inspect

Types:

```python
from cloudflare.types.email_auth.spf import InspectGetResponse
```

Methods:

- <code title="get /zones/{zone_id}/email/auth/spf/inspect">client.email_auth.spf.inspect.<a href="./src/cloudflare/resources/email_auth/spf/inspect.py">get</a>(\*, zone_id, \*\*<a href="src/cloudflare/types/email_auth/spf/inspect_get_params.py">params</a>) -> <a href="./src/cloudflare/types/email_auth/spf/inspect_get_response.py">Optional[InspectGetResponse]</a></code>
Loading
Loading