diff --git a/.stats.yml b/.stats.yml
index 1682359bc84..11365b78b41 100644
--- a/.stats.yml
+++ b/.stats.yml
@@ -1,4 +1,4 @@
-configured_endpoints: 2194
-openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-0ce49e6bb0d3819f135b9a567b661205fdf5df21cff157eab2b7abd7b5b50347.yml
-openapi_spec_hash: 512a5bb3a32860590c8949765605d65a
-config_hash: 5367ae3e3a9a0d6578c2756965a99e3a
+configured_endpoints: 2195
+openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-a6c352830d1270d0abb5bb983058ea21815e1bb7d2e163965335dcb0e706f057.yml
+openapi_spec_hash: ffe469d5b0b3f29c20ccb91c0a2862e7
+config_hash: a83bae9f0be0219cfe77d38d5af60d4a
diff --git a/src/cloudflare/resources/ai/to_markdown.py b/src/cloudflare/resources/ai/to_markdown.py
index 92c71b86c7d..3f8d7a5e718 100644
--- a/src/cloudflare/resources/ai/to_markdown.py
+++ b/src/cloudflare/resources/ai/to_markdown.py
@@ -111,11 +111,11 @@ def transform(
# sent to the server will contain a `boundary` parameter, e.g.
# multipart/form-data; boundary=---abc--
extra_headers = {"Content-Type": "multipart/form-data", **(extra_headers or {})}
- return self._get_api_list(
+ return self._get_api_list( # type: ignore[call-arg]
path_template("/accounts/{account_id}/ai/tomarkdown", account_id=account_id),
page=SyncSinglePage[ToMarkdownTransformResponse],
body=maybe_transform(body, to_markdown_transform_params.ToMarkdownTransformParams),
- files=files,
+ files=files, # pyright: ignore[reportCallIssue]
options=make_request_options(
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
),
@@ -210,11 +210,11 @@ def transform(
# sent to the server will contain a `boundary` parameter, e.g.
# multipart/form-data; boundary=---abc--
extra_headers = {"Content-Type": "multipart/form-data", **(extra_headers or {})}
- return self._get_api_list(
+ return self._get_api_list( # type: ignore[call-arg]
path_template("/accounts/{account_id}/ai/tomarkdown", account_id=account_id),
page=AsyncSinglePage[ToMarkdownTransformResponse],
body=maybe_transform(body, to_markdown_transform_params.ToMarkdownTransformParams),
- files=files,
+ files=files, # pyright: ignore[reportCallIssue]
options=make_request_options(
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
),
diff --git a/src/cloudflare/resources/aisearch/instances/instances.py b/src/cloudflare/resources/aisearch/instances/instances.py
index 44e302e2e3e..0b4aa0f18c3 100644
--- a/src/cloudflare/resources/aisearch/instances/instances.py
+++ b/src/cloudflare/resources/aisearch/instances/instances.py
@@ -192,7 +192,7 @@ def create(
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> InstanceCreateResponse:
- """Create a new instances.
+ """Create a new instance.
Args:
id: AI Search instance ID.
@@ -420,13 +420,10 @@ def update(
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> InstanceUpdateResponse:
- """Update instances.
+ """
+ Update instance.
Args:
- id: AI Search instance ID.
-
- Lowercase alphanumeric, hyphens, and underscores.
-
index_method: Controls which storage backends are used during indexing. Defaults to
vector-only.
@@ -496,7 +493,7 @@ def list(
self,
*,
account_id: str,
- namespace: Optional[str] | Omit = omit,
+ namespace: str | Omit = omit,
order_by: Literal["created_at"] | Omit = omit,
order_by_direction: Literal["asc", "desc"] | Omit = omit,
page: int | Omit = omit,
@@ -513,11 +510,17 @@ def list(
List instances.
Args:
- order_by: Order By Column Name
+ namespace: Filter by namespace.
- order_by_direction: Order By Direction
+ order_by: Field to order results by.
- search: Search by id
+ order_by_direction: Order direction.
+
+ page: Page number (1-indexed).
+
+ per_page: Number of results per page.
+
+ search: Filter instances whose id contains this string (case-insensitive).
extra_headers: Send extra headers
@@ -564,13 +567,10 @@ def delete(
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> InstanceDeleteResponse:
- """Delete instances.
+ """
+ Delete instance.
Args:
- id: AI Search instance ID.
-
- Lowercase alphanumeric, hyphens, and underscores.
-
extra_headers: Send extra headers
extra_query: Add additional query parameters to the request
@@ -693,13 +693,10 @@ def read(
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> InstanceReadResponse:
- """Read instances.
+ """
+ Read instance.
Args:
- id: AI Search instance ID.
-
- Lowercase alphanumeric, hyphens, and underscores.
-
extra_headers: Send extra headers
extra_query: Add additional query parameters to the request
@@ -969,7 +966,7 @@ async def create(
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> InstanceCreateResponse:
- """Create a new instances.
+ """Create a new instance.
Args:
id: AI Search instance ID.
@@ -1197,13 +1194,10 @@ async def update(
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> InstanceUpdateResponse:
- """Update instances.
+ """
+ Update instance.
Args:
- id: AI Search instance ID.
-
- Lowercase alphanumeric, hyphens, and underscores.
-
index_method: Controls which storage backends are used during indexing. Defaults to
vector-only.
@@ -1273,7 +1267,7 @@ def list(
self,
*,
account_id: str,
- namespace: Optional[str] | Omit = omit,
+ namespace: str | Omit = omit,
order_by: Literal["created_at"] | Omit = omit,
order_by_direction: Literal["asc", "desc"] | Omit = omit,
page: int | Omit = omit,
@@ -1290,11 +1284,17 @@ def list(
List instances.
Args:
- order_by: Order By Column Name
+ namespace: Filter by namespace.
- order_by_direction: Order By Direction
+ order_by: Field to order results by.
- search: Search by id
+ order_by_direction: Order direction.
+
+ page: Page number (1-indexed).
+
+ per_page: Number of results per page.
+
+ search: Filter instances whose id contains this string (case-insensitive).
extra_headers: Send extra headers
@@ -1341,13 +1341,10 @@ async def delete(
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> InstanceDeleteResponse:
- """Delete instances.
+ """
+ Delete instance.
Args:
- id: AI Search instance ID.
-
- Lowercase alphanumeric, hyphens, and underscores.
-
extra_headers: Send extra headers
extra_query: Add additional query parameters to the request
@@ -1470,13 +1467,10 @@ async def read(
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> InstanceReadResponse:
- """Read instances.
+ """
+ Read instance.
Args:
- id: AI Search instance ID.
-
- Lowercase alphanumeric, hyphens, and underscores.
-
extra_headers: Send extra headers
extra_query: Add additional query parameters to the request
diff --git a/src/cloudflare/resources/aisearch/namespaces/instances/instances.py b/src/cloudflare/resources/aisearch/namespaces/instances/instances.py
index 8618c213255..d13a23fec7b 100644
--- a/src/cloudflare/resources/aisearch/namespaces/instances/instances.py
+++ b/src/cloudflare/resources/aisearch/namespaces/instances/instances.py
@@ -205,7 +205,7 @@ def create(
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> InstanceCreateResponse:
- """Create a new instances.
+ """Create a new instance.
Args:
id: AI Search instance ID.
@@ -438,13 +438,10 @@ def update(
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> InstanceUpdateResponse:
- """Update instances.
+ """
+ Update instance.
Args:
- id: AI Search instance ID.
-
- Lowercase alphanumeric, hyphens, and underscores.
-
index_method: Controls which storage backends are used during indexing. Defaults to
vector-only.
@@ -522,7 +519,7 @@ def list(
name: str,
*,
account_id: str,
- namespace: Optional[str] | Omit = omit,
+ namespace: str | Omit = omit,
order_by: Literal["created_at"] | Omit = omit,
order_by_direction: Literal["asc", "desc"] | Omit = omit,
page: int | Omit = omit,
@@ -539,11 +536,17 @@ def list(
List instances.
Args:
- order_by: Order By Column Name
+ namespace: Filter by namespace.
- order_by_direction: Order By Direction
+ order_by: Field to order results by.
- search: Search by id
+ order_by_direction: Order direction.
+
+ page: Page number (1-indexed).
+
+ per_page: Number of results per page.
+
+ search: Filter instances whose id contains this string (case-insensitive).
extra_headers: Send extra headers
@@ -595,13 +598,10 @@ def delete(
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> InstanceDeleteResponse:
- """Delete instances.
+ """
+ Delete instance.
Args:
- id: AI Search instance ID.
-
- Lowercase alphanumeric, hyphens, and underscores.
-
extra_headers: Send extra headers
extra_query: Add additional query parameters to the request
@@ -738,13 +738,10 @@ def read(
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> InstanceReadResponse:
- """Read instances.
+ """
+ Read instance.
Args:
- id: AI Search instance ID.
-
- Lowercase alphanumeric, hyphens, and underscores.
-
extra_headers: Send extra headers
extra_query: Add additional query parameters to the request
@@ -1042,7 +1039,7 @@ async def create(
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> InstanceCreateResponse:
- """Create a new instances.
+ """Create a new instance.
Args:
id: AI Search instance ID.
@@ -1275,13 +1272,10 @@ async def update(
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> InstanceUpdateResponse:
- """Update instances.
+ """
+ Update instance.
Args:
- id: AI Search instance ID.
-
- Lowercase alphanumeric, hyphens, and underscores.
-
index_method: Controls which storage backends are used during indexing. Defaults to
vector-only.
@@ -1359,7 +1353,7 @@ def list(
name: str,
*,
account_id: str,
- namespace: Optional[str] | Omit = omit,
+ namespace: str | Omit = omit,
order_by: Literal["created_at"] | Omit = omit,
order_by_direction: Literal["asc", "desc"] | Omit = omit,
page: int | Omit = omit,
@@ -1376,11 +1370,17 @@ def list(
List instances.
Args:
- order_by: Order By Column Name
+ namespace: Filter by namespace.
- order_by_direction: Order By Direction
+ order_by: Field to order results by.
- search: Search by id
+ order_by_direction: Order direction.
+
+ page: Page number (1-indexed).
+
+ per_page: Number of results per page.
+
+ search: Filter instances whose id contains this string (case-insensitive).
extra_headers: Send extra headers
@@ -1432,13 +1432,10 @@ async def delete(
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> InstanceDeleteResponse:
- """Delete instances.
+ """
+ Delete instance.
Args:
- id: AI Search instance ID.
-
- Lowercase alphanumeric, hyphens, and underscores.
-
extra_headers: Send extra headers
extra_query: Add additional query parameters to the request
@@ -1575,13 +1572,10 @@ async def read(
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> InstanceReadResponse:
- """Read instances.
+ """
+ Read instance.
Args:
- id: AI Search instance ID.
-
- Lowercase alphanumeric, hyphens, and underscores.
-
extra_headers: Send extra headers
extra_query: Add additional query parameters to the request
diff --git a/src/cloudflare/resources/aisearch/namespaces/instances/items.py b/src/cloudflare/resources/aisearch/namespaces/instances/items.py
index ecd58bba6a1..5fd2ac78d1b 100644
--- a/src/cloudflare/resources/aisearch/namespaces/instances/items.py
+++ b/src/cloudflare/resources/aisearch/namespaces/instances/items.py
@@ -280,6 +280,7 @@ def create_or_update(
name: str,
key: str,
next_action: Literal["INDEX"],
+ wait_for_completion: bool | Omit = omit,
# 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,
@@ -295,6 +296,12 @@ def create_or_update(
key: Item key / filename. Must not exceed 128 characters.
+ wait_for_completion: Wait for indexing to fully complete before responding. On RAGs with vector
+ indexing enabled, this additionally waits for Vectorize ingestion confirmation
+ (up to 40s) so the returned item reflects a queryable state. On timeout the item
+ is returned in `running` state and the background alarm continues polling.
+ Defaults to false.
+
extra_headers: Send extra headers
extra_query: Add additional query parameters to the request
@@ -320,6 +327,7 @@ def create_or_update(
{
"key": key,
"next_action": next_action,
+ "wait_for_completion": wait_for_completion,
},
item_create_or_update_params.ItemCreateOrUpdateParams,
),
@@ -510,6 +518,7 @@ def sync(
name: str,
id: str,
next_action: Literal["INDEX"],
+ wait_for_completion: bool | Omit = omit,
# 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,
@@ -524,6 +533,12 @@ def sync(
Lowercase alphanumeric, hyphens, and underscores.
+ wait_for_completion: Wait for indexing to fully complete before responding. On RAGs with vector
+ indexing enabled, this additionally waits for Vectorize ingestion confirmation
+ (up to 40s) so the returned item reflects a queryable state. On timeout the item
+ is returned in `running` state and the background alarm continues polling.
+ Defaults to false.
+
extra_headers: Send extra headers
extra_query: Add additional query parameters to the request
@@ -548,7 +563,13 @@ def sync(
id=id,
item_id=item_id,
),
- body=maybe_transform({"next_action": next_action}, item_sync_params.ItemSyncParams),
+ body=maybe_transform(
+ {
+ "next_action": next_action,
+ "wait_for_completion": wait_for_completion,
+ },
+ item_sync_params.ItemSyncParams,
+ ),
options=make_request_options(
extra_headers=extra_headers,
extra_query=extra_query,
@@ -852,6 +873,7 @@ async def create_or_update(
name: str,
key: str,
next_action: Literal["INDEX"],
+ wait_for_completion: bool | Omit = omit,
# 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,
@@ -867,6 +889,12 @@ async def create_or_update(
key: Item key / filename. Must not exceed 128 characters.
+ wait_for_completion: Wait for indexing to fully complete before responding. On RAGs with vector
+ indexing enabled, this additionally waits for Vectorize ingestion confirmation
+ (up to 40s) so the returned item reflects a queryable state. On timeout the item
+ is returned in `running` state and the background alarm continues polling.
+ Defaults to false.
+
extra_headers: Send extra headers
extra_query: Add additional query parameters to the request
@@ -892,6 +920,7 @@ async def create_or_update(
{
"key": key,
"next_action": next_action,
+ "wait_for_completion": wait_for_completion,
},
item_create_or_update_params.ItemCreateOrUpdateParams,
),
@@ -1082,6 +1111,7 @@ async def sync(
name: str,
id: str,
next_action: Literal["INDEX"],
+ wait_for_completion: bool | Omit = omit,
# 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,
@@ -1096,6 +1126,12 @@ async def sync(
Lowercase alphanumeric, hyphens, and underscores.
+ wait_for_completion: Wait for indexing to fully complete before responding. On RAGs with vector
+ indexing enabled, this additionally waits for Vectorize ingestion confirmation
+ (up to 40s) so the returned item reflects a queryable state. On timeout the item
+ is returned in `running` state and the background alarm continues polling.
+ Defaults to false.
+
extra_headers: Send extra headers
extra_query: Add additional query parameters to the request
@@ -1120,7 +1156,13 @@ async def sync(
id=id,
item_id=item_id,
),
- body=await async_maybe_transform({"next_action": next_action}, item_sync_params.ItemSyncParams),
+ body=await async_maybe_transform(
+ {
+ "next_action": next_action,
+ "wait_for_completion": wait_for_completion,
+ },
+ item_sync_params.ItemSyncParams,
+ ),
options=make_request_options(
extra_headers=extra_headers,
extra_query=extra_query,
diff --git a/src/cloudflare/resources/api_gateway/operations/operations.py b/src/cloudflare/resources/api_gateway/operations/operations.py
index 3850a9a70ec..cd3ba74b2fd 100644
--- a/src/cloudflare/resources/api_gateway/operations/operations.py
+++ b/src/cloudflare/resources/api_gateway/operations/operations.py
@@ -354,6 +354,7 @@ def get(
*,
zone_id: str,
feature: List[Literal["thresholds", "parameter_schemas", "schema_info"]] | Omit = omit,
+ with_schemas: bool | Omit = omit,
# 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,
@@ -374,6 +375,10 @@ def get(
to the resulting feature object. Have a look at the top-level object description
for more details on the specific meaning.
+ with_schemas: When true, includes OpenAPI schemas (both uploaded and learned) for the
+ operation in the response. Due to the conversion overhead, this parameter is
+ only supported on single-operation retrieval.
+
extra_headers: Send extra headers
extra_query: Add additional query parameters to the request
@@ -395,7 +400,13 @@ def get(
extra_query=extra_query,
extra_body=extra_body,
timeout=timeout,
- query=maybe_transform({"feature": feature}, operation_get_params.OperationGetParams),
+ query=maybe_transform(
+ {
+ "feature": feature,
+ "with_schemas": with_schemas,
+ },
+ operation_get_params.OperationGetParams,
+ ),
post_parser=ResultWrapper[OperationGetResponse]._unwrapper,
),
cast_to=cast(Type[OperationGetResponse], ResultWrapper[OperationGetResponse]),
@@ -704,6 +715,7 @@ async def get(
*,
zone_id: str,
feature: List[Literal["thresholds", "parameter_schemas", "schema_info"]] | Omit = omit,
+ with_schemas: bool | Omit = omit,
# 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,
@@ -724,6 +736,10 @@ async def get(
to the resulting feature object. Have a look at the top-level object description
for more details on the specific meaning.
+ with_schemas: When true, includes OpenAPI schemas (both uploaded and learned) for the
+ operation in the response. Due to the conversion overhead, this parameter is
+ only supported on single-operation retrieval.
+
extra_headers: Send extra headers
extra_query: Add additional query parameters to the request
@@ -745,7 +761,13 @@ async def get(
extra_query=extra_query,
extra_body=extra_body,
timeout=timeout,
- query=await async_maybe_transform({"feature": feature}, operation_get_params.OperationGetParams),
+ query=await async_maybe_transform(
+ {
+ "feature": feature,
+ "with_schemas": with_schemas,
+ },
+ operation_get_params.OperationGetParams,
+ ),
post_parser=ResultWrapper[OperationGetResponse]._unwrapper,
),
cast_to=cast(Type[OperationGetResponse], ResultWrapper[OperationGetResponse]),
diff --git a/src/cloudflare/resources/billing/usage.py b/src/cloudflare/resources/billing/usage.py
index d847aea692d..0071a8d4315 100644
--- a/src/cloudflare/resources/billing/usage.py
+++ b/src/cloudflare/resources/billing/usage.py
@@ -62,7 +62,8 @@ def paygo(
When no query
parameters are provided, returns usage for the current billing period. This
- endpoint is currently in beta and access is restricted to select accounts.
+ endpoint is currently in alpha and access is restricted to select accounts.
+ While in alpha, the endpoint may get breaking changes.
Args:
account_id: Represents a Cloudflare resource identifier tag.
@@ -138,7 +139,8 @@ async def paygo(
When no query
parameters are provided, returns usage for the current billing period. This
- endpoint is currently in beta and access is restricted to select accounts.
+ endpoint is currently in alpha and access is restricted to select accounts.
+ While in alpha, the endpoint may get breaking changes.
Args:
account_id: Represents a Cloudflare resource identifier tag.
diff --git a/src/cloudflare/resources/botnet_feed/asn.py b/src/cloudflare/resources/botnet_feed/asn.py
old mode 100755
new mode 100644
diff --git a/src/cloudflare/resources/botnet_feed/botnet_feed.py b/src/cloudflare/resources/botnet_feed/botnet_feed.py
old mode 100755
new mode 100644
diff --git a/src/cloudflare/resources/botnet_feed/configs/__init__.py b/src/cloudflare/resources/botnet_feed/configs/__init__.py
old mode 100755
new mode 100644
diff --git a/src/cloudflare/resources/botnet_feed/configs/asn.py b/src/cloudflare/resources/botnet_feed/configs/asn.py
old mode 100755
new mode 100644
diff --git a/src/cloudflare/resources/botnet_feed/configs/configs.py b/src/cloudflare/resources/botnet_feed/configs/configs.py
old mode 100755
new mode 100644
diff --git a/src/cloudflare/resources/browser_rendering/api.md b/src/cloudflare/resources/browser_rendering/api.md
index c384cdcb32d..af4ab6e36d7 100644
--- a/src/cloudflare/resources/browser_rendering/api.md
+++ b/src/cloudflare/resources/browser_rendering/api.md
@@ -160,6 +160,7 @@ from cloudflare.types.browser_rendering.devtools.browser import (
TargetCreateResponse,
TargetListResponse,
TargetActivateResponse,
+ TargetCloseResponse,
TargetGetResponse,
)
```
@@ -169,4 +170,5 @@ Methods:
- client.browser_rendering.devtools.browser.targets.create(session_id, \*, account_id, \*\*params) -> TargetCreateResponse
- client.browser_rendering.devtools.browser.targets.list(session_id, \*, account_id) -> TargetListResponse
- client.browser_rendering.devtools.browser.targets.activate(target_id, \*, account_id, session_id) -> TargetActivateResponse
+- client.browser_rendering.devtools.browser.targets.close(target_id, \*, account_id, session_id) -> TargetCloseResponse
- client.browser_rendering.devtools.browser.targets.get(target_id, \*, account_id, session_id) -> TargetGetResponse
diff --git a/src/cloudflare/resources/browser_rendering/devtools/browser/targets.py b/src/cloudflare/resources/browser_rendering/devtools/browser/targets.py
index 75a19833916..425af81d325 100644
--- a/src/cloudflare/resources/browser_rendering/devtools/browser/targets.py
+++ b/src/cloudflare/resources/browser_rendering/devtools/browser/targets.py
@@ -18,6 +18,7 @@
from .....types.browser_rendering.devtools.browser import target_create_params
from .....types.browser_rendering.devtools.browser.target_get_response import TargetGetResponse
from .....types.browser_rendering.devtools.browser.target_list_response import TargetListResponse
+from .....types.browser_rendering.devtools.browser.target_close_response import TargetCloseResponse
from .....types.browser_rendering.devtools.browser.target_create_response import TargetCreateResponse
from .....types.browser_rendering.devtools.browser.target_activate_response import TargetActivateResponse
@@ -189,6 +190,58 @@ def activate(
cast_to=TargetActivateResponse,
)
+ def close(
+ self,
+ target_id: str,
+ *,
+ account_id: str,
+ session_id: str,
+ # 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,
+ extra_query: Query | None = None,
+ extra_body: Body | None = None,
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
+ ) -> TargetCloseResponse:
+ """Closes a specific browser target (tab, page, etc.) by its ID.
+
+ Returns 'Target is
+ closing' on success or an error if the target is not found.
+
+ Args:
+ account_id: Account ID.
+
+ session_id: Browser session ID.
+
+ target_id: Target ID to close.
+
+ extra_headers: Send extra headers
+
+ extra_query: Add additional query parameters to the request
+
+ extra_body: Add additional JSON properties to the request
+
+ timeout: Override the client-level default timeout for this request, in seconds
+ """
+ if not account_id:
+ raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
+ if not session_id:
+ raise ValueError(f"Expected a non-empty value for `session_id` but received {session_id!r}")
+ if not target_id:
+ raise ValueError(f"Expected a non-empty value for `target_id` but received {target_id!r}")
+ return self._get(
+ path_template(
+ "/accounts/{account_id}/browser-rendering/devtools/browser/{session_id}/json/close/{target_id}",
+ account_id=account_id,
+ session_id=session_id,
+ target_id=target_id,
+ ),
+ options=make_request_options(
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
+ ),
+ cast_to=TargetCloseResponse,
+ )
+
def get(
self,
target_id: str,
@@ -405,6 +458,58 @@ async def activate(
cast_to=TargetActivateResponse,
)
+ async def close(
+ self,
+ target_id: str,
+ *,
+ account_id: str,
+ session_id: str,
+ # 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,
+ extra_query: Query | None = None,
+ extra_body: Body | None = None,
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
+ ) -> TargetCloseResponse:
+ """Closes a specific browser target (tab, page, etc.) by its ID.
+
+ Returns 'Target is
+ closing' on success or an error if the target is not found.
+
+ Args:
+ account_id: Account ID.
+
+ session_id: Browser session ID.
+
+ target_id: Target ID to close.
+
+ extra_headers: Send extra headers
+
+ extra_query: Add additional query parameters to the request
+
+ extra_body: Add additional JSON properties to the request
+
+ timeout: Override the client-level default timeout for this request, in seconds
+ """
+ if not account_id:
+ raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
+ if not session_id:
+ raise ValueError(f"Expected a non-empty value for `session_id` but received {session_id!r}")
+ if not target_id:
+ raise ValueError(f"Expected a non-empty value for `target_id` but received {target_id!r}")
+ return await self._get(
+ path_template(
+ "/accounts/{account_id}/browser-rendering/devtools/browser/{session_id}/json/close/{target_id}",
+ account_id=account_id,
+ session_id=session_id,
+ target_id=target_id,
+ ),
+ options=make_request_options(
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
+ ),
+ cast_to=TargetCloseResponse,
+ )
+
async def get(
self,
target_id: str,
@@ -469,6 +574,9 @@ def __init__(self, targets: TargetsResource) -> None:
self.activate = to_raw_response_wrapper(
targets.activate,
)
+ self.close = to_raw_response_wrapper(
+ targets.close,
+ )
self.get = to_raw_response_wrapper(
targets.get,
)
@@ -487,6 +595,9 @@ def __init__(self, targets: AsyncTargetsResource) -> None:
self.activate = async_to_raw_response_wrapper(
targets.activate,
)
+ self.close = async_to_raw_response_wrapper(
+ targets.close,
+ )
self.get = async_to_raw_response_wrapper(
targets.get,
)
@@ -505,6 +616,9 @@ def __init__(self, targets: TargetsResource) -> None:
self.activate = to_streamed_response_wrapper(
targets.activate,
)
+ self.close = to_streamed_response_wrapper(
+ targets.close,
+ )
self.get = to_streamed_response_wrapper(
targets.get,
)
@@ -523,6 +637,9 @@ def __init__(self, targets: AsyncTargetsResource) -> None:
self.activate = async_to_streamed_response_wrapper(
targets.activate,
)
+ self.close = async_to_streamed_response_wrapper(
+ targets.close,
+ )
self.get = async_to_streamed_response_wrapper(
targets.get,
)
diff --git a/src/cloudflare/resources/email_security/api.md b/src/cloudflare/resources/email_security/api.md
index 53e335ba90a..cfa43e12f75 100644
--- a/src/cloudflare/resources/email_security/api.md
+++ b/src/cloudflare/resources/email_security/api.md
@@ -11,7 +11,7 @@ from cloudflare.types.email_security import InvestigateListResponse, Investigate
Methods:
- client.email_security.investigate.list(\*, account_id, \*\*params) -> SyncV4PagePaginationArray[InvestigateListResponse]
-- client.email_security.investigate.get(postfix_id, \*, account_id, \*\*params) -> InvestigateGetResponse
+- client.email_security.investigate.get(investigate_id, \*, account_id, \*\*params) -> InvestigateGetResponse
### Detections
@@ -23,7 +23,7 @@ from cloudflare.types.email_security.investigate import DetectionGetResponse
Methods:
-- client.email_security.investigate.detections.get(postfix_id, \*, account_id) -> DetectionGetResponse
+- client.email_security.investigate.detections.get(investigate_id, \*, account_id) -> DetectionGetResponse
### Preview
@@ -36,7 +36,7 @@ from cloudflare.types.email_security.investigate import PreviewCreateResponse, P
Methods:
- client.email_security.investigate.preview.create(\*, account_id, \*\*params) -> PreviewCreateResponse
-- client.email_security.investigate.preview.get(postfix_id, \*, account_id) -> PreviewGetResponse
+- client.email_security.investigate.preview.get(investigate_id, \*, account_id) -> PreviewGetResponse
### Raw
@@ -48,7 +48,7 @@ from cloudflare.types.email_security.investigate import RawGetResponse
Methods:
-- client.email_security.investigate.raw.get(postfix_id, \*, account_id) -> RawGetResponse
+- client.email_security.investigate.raw.get(investigate_id, \*, account_id) -> RawGetResponse
### Trace
@@ -60,7 +60,7 @@ from cloudflare.types.email_security.investigate import TraceGetResponse
Methods:
-- client.email_security.investigate.trace.get(postfix_id, \*, account_id, \*\*params) -> TraceGetResponse
+- client.email_security.investigate.trace.get(investigate_id, \*, account_id) -> TraceGetResponse
### Move
@@ -72,14 +72,14 @@ from cloudflare.types.email_security.investigate import MoveCreateResponse, Move
Methods:
-- client.email_security.investigate.move.create(postfix_id, \*, account_id, \*\*params) -> MoveCreateResponse
+- client.email_security.investigate.move.create(investigate_id, \*, account_id, \*\*params) -> SyncSinglePage[MoveCreateResponse]
- client.email_security.investigate.move.bulk(\*, account_id, \*\*params) -> SyncSinglePage[MoveBulkResponse]
### Reclassify
Methods:
-- client.email_security.investigate.reclassify.create(postfix_id, \*, account_id, \*\*params) -> object
+- client.email_security.investigate.reclassify.create(investigate_id, \*, account_id, \*\*params) -> object
### Release
@@ -125,11 +125,11 @@ from cloudflare.types.email_security.settings import (
Methods:
-- client.email_security.settings.allow_policies.create(\*, account_id, \*\*params) -> AllowPolicyCreateResponse
+- client.email_security.settings.allow_policies.create(\*, account_id, \*\*params) -> Optional[AllowPolicyCreateResponse]
- client.email_security.settings.allow_policies.list(\*, account_id, \*\*params) -> SyncV4PagePaginationArray[AllowPolicyListResponse]
-- client.email_security.settings.allow_policies.delete(policy_id, \*, account_id) -> AllowPolicyDeleteResponse
-- client.email_security.settings.allow_policies.edit(policy_id, \*, account_id, \*\*params) -> AllowPolicyEditResponse
-- client.email_security.settings.allow_policies.get(policy_id, \*, account_id) -> AllowPolicyGetResponse
+- client.email_security.settings.allow_policies.delete(policy_id, \*, account_id) -> Optional[AllowPolicyDeleteResponse]
+- client.email_security.settings.allow_policies.edit(policy_id, \*, account_id, \*\*params) -> Optional[AllowPolicyEditResponse]
+- client.email_security.settings.allow_policies.get(policy_id, \*, account_id) -> Optional[AllowPolicyGetResponse]
### BlockSenders
@@ -147,11 +147,11 @@ from cloudflare.types.email_security.settings import (
Methods:
-- client.email_security.settings.block_senders.create(\*, account_id, \*\*params) -> BlockSenderCreateResponse
+- client.email_security.settings.block_senders.create(\*, account_id, \*\*params) -> Optional[BlockSenderCreateResponse]
- client.email_security.settings.block_senders.list(\*, account_id, \*\*params) -> SyncV4PagePaginationArray[BlockSenderListResponse]
-- client.email_security.settings.block_senders.delete(pattern_id, \*, account_id) -> BlockSenderDeleteResponse
-- client.email_security.settings.block_senders.edit(pattern_id, \*, account_id, \*\*params) -> BlockSenderEditResponse
-- client.email_security.settings.block_senders.get(pattern_id, \*, account_id) -> BlockSenderGetResponse
+- client.email_security.settings.block_senders.delete(pattern_id, \*, account_id) -> Optional[BlockSenderDeleteResponse]
+- client.email_security.settings.block_senders.edit(pattern_id, \*, account_id, \*\*params) -> Optional[BlockSenderEditResponse]
+- client.email_security.settings.block_senders.get(pattern_id, \*, account_id) -> Optional[BlockSenderGetResponse]
### Domains
@@ -161,7 +161,6 @@ Types:
from cloudflare.types.email_security.settings import (
DomainListResponse,
DomainDeleteResponse,
- DomainBulkDeleteResponse,
DomainEditResponse,
DomainGetResponse,
)
@@ -170,10 +169,9 @@ from cloudflare.types.email_security.settings import (
Methods:
- client.email_security.settings.domains.list(\*, account_id, \*\*params) -> SyncV4PagePaginationArray[DomainListResponse]
-- client.email_security.settings.domains.delete(domain_id, \*, account_id) -> DomainDeleteResponse
-- client.email_security.settings.domains.bulk_delete(\*, account_id) -> SyncSinglePage[DomainBulkDeleteResponse]
-- client.email_security.settings.domains.edit(domain_id, \*, account_id, \*\*params) -> DomainEditResponse
-- client.email_security.settings.domains.get(domain_id, \*, account_id) -> DomainGetResponse
+- client.email_security.settings.domains.delete(domain_id, \*, account_id) -> Optional[DomainDeleteResponse]
+- client.email_security.settings.domains.edit(domain_id, \*, account_id, \*\*params) -> Optional[DomainEditResponse]
+- client.email_security.settings.domains.get(domain_id, \*, account_id) -> Optional[DomainGetResponse]
### ImpersonationRegistry
@@ -191,11 +189,11 @@ from cloudflare.types.email_security.settings import (
Methods:
-- client.email_security.settings.impersonation_registry.create(\*, account_id, \*\*params) -> ImpersonationRegistryCreateResponse
+- client.email_security.settings.impersonation_registry.create(\*, account_id, \*\*params) -> Optional[ImpersonationRegistryCreateResponse]
- client.email_security.settings.impersonation_registry.list(\*, account_id, \*\*params) -> SyncV4PagePaginationArray[ImpersonationRegistryListResponse]
-- client.email_security.settings.impersonation_registry.delete(display_name_id, \*, account_id) -> ImpersonationRegistryDeleteResponse
-- client.email_security.settings.impersonation_registry.edit(display_name_id, \*, account_id, \*\*params) -> ImpersonationRegistryEditResponse
-- client.email_security.settings.impersonation_registry.get(display_name_id, \*, account_id) -> ImpersonationRegistryGetResponse
+- client.email_security.settings.impersonation_registry.delete(impersonation_registry_id, \*, account_id) -> Optional[ImpersonationRegistryDeleteResponse]
+- client.email_security.settings.impersonation_registry.edit(impersonation_registry_id, \*, account_id, \*\*params) -> Optional[ImpersonationRegistryEditResponse]
+- client.email_security.settings.impersonation_registry.get(impersonation_registry_id, \*, account_id) -> Optional[ImpersonationRegistryGetResponse]
### TrustedDomains
@@ -213,11 +211,11 @@ from cloudflare.types.email_security.settings import (
Methods:
-- client.email_security.settings.trusted_domains.create(\*, account_id, \*\*params) -> TrustedDomainCreateResponse
+- client.email_security.settings.trusted_domains.create(\*, account_id, \*\*params) -> Optional[TrustedDomainCreateResponse]
- client.email_security.settings.trusted_domains.list(\*, account_id, \*\*params) -> SyncV4PagePaginationArray[TrustedDomainListResponse]
-- client.email_security.settings.trusted_domains.delete(trusted_domain_id, \*, account_id) -> TrustedDomainDeleteResponse
-- client.email_security.settings.trusted_domains.edit(trusted_domain_id, \*, account_id, \*\*params) -> TrustedDomainEditResponse
-- client.email_security.settings.trusted_domains.get(trusted_domain_id, \*, account_id) -> TrustedDomainGetResponse
+- client.email_security.settings.trusted_domains.delete(trusted_domain_id, \*, account_id) -> Optional[TrustedDomainDeleteResponse]
+- client.email_security.settings.trusted_domains.edit(trusted_domain_id, \*, account_id, \*\*params) -> Optional[TrustedDomainEditResponse]
+- client.email_security.settings.trusted_domains.get(trusted_domain_id, \*, account_id) -> Optional[TrustedDomainGetResponse]
## Submissions
diff --git a/src/cloudflare/resources/email_security/investigate/detections.py b/src/cloudflare/resources/email_security/investigate/detections.py
index 3bf800a5931..f53430d18c5 100644
--- a/src/cloudflare/resources/email_security/investigate/detections.py
+++ b/src/cloudflare/resources/email_security/investigate/detections.py
@@ -45,7 +45,7 @@ def with_streaming_response(self) -> DetectionsResourceWithStreamingResponse:
def get(
self,
- postfix_id: str,
+ investigate_id: str,
*,
account_id: str,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
@@ -60,9 +60,9 @@ def get(
non-benign messages.
Args:
- account_id: Account Identifier
+ account_id: Identifier.
- postfix_id: The identifier of the message.
+ investigate_id: Unique identifier for a message retrieved from investigation
extra_headers: Send extra headers
@@ -74,13 +74,13 @@ def get(
"""
if not account_id:
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
- if not postfix_id:
- raise ValueError(f"Expected a non-empty value for `postfix_id` but received {postfix_id!r}")
+ if not investigate_id:
+ raise ValueError(f"Expected a non-empty value for `investigate_id` but received {investigate_id!r}")
return self._get(
path_template(
- "/accounts/{account_id}/email-security/investigate/{postfix_id}/detections",
+ "/accounts/{account_id}/email-security/investigate/{investigate_id}/detections",
account_id=account_id,
- postfix_id=postfix_id,
+ investigate_id=investigate_id,
),
options=make_request_options(
extra_headers=extra_headers,
@@ -115,7 +115,7 @@ def with_streaming_response(self) -> AsyncDetectionsResourceWithStreamingRespons
async def get(
self,
- postfix_id: str,
+ investigate_id: str,
*,
account_id: str,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
@@ -130,9 +130,9 @@ async def get(
non-benign messages.
Args:
- account_id: Account Identifier
+ account_id: Identifier.
- postfix_id: The identifier of the message.
+ investigate_id: Unique identifier for a message retrieved from investigation
extra_headers: Send extra headers
@@ -144,13 +144,13 @@ async def get(
"""
if not account_id:
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
- if not postfix_id:
- raise ValueError(f"Expected a non-empty value for `postfix_id` but received {postfix_id!r}")
+ if not investigate_id:
+ raise ValueError(f"Expected a non-empty value for `investigate_id` but received {investigate_id!r}")
return await self._get(
path_template(
- "/accounts/{account_id}/email-security/investigate/{postfix_id}/detections",
+ "/accounts/{account_id}/email-security/investigate/{investigate_id}/detections",
account_id=account_id,
- postfix_id=postfix_id,
+ investigate_id=investigate_id,
),
options=make_request_options(
extra_headers=extra_headers,
diff --git a/src/cloudflare/resources/email_security/investigate/investigate.py b/src/cloudflare/resources/email_security/investigate/investigate.py
index c6167137eed..6572f57e9f6 100644
--- a/src/cloudflare/resources/email_security/investigate/investigate.py
+++ b/src/cloudflare/resources/email_security/investigate/investigate.py
@@ -142,9 +142,8 @@ def list(
detections_only: bool | Omit = omit,
domain: str | Omit = omit,
end: Union[str, datetime] | Omit = omit,
- exact_subject: str | Omit = omit,
final_disposition: Literal["MALICIOUS", "SUSPICIOUS", "SPOOF", "SPAM", "BULK", "NONE"] | Omit = omit,
- message_action: Literal["PREVIEW", "QUARANTINE_RELEASED", "MOVED", "SUBMITTED"] | Omit = omit,
+ message_action: Literal["PREVIEW", "QUARANTINE_RELEASED", "MOVED"] | Omit = omit,
message_id: str | Omit = omit,
metric: str | Omit = omit,
page: Optional[int] | Omit = omit,
@@ -154,7 +153,6 @@ def list(
sender: str | Omit = omit,
start: Union[str, datetime] | Omit = omit,
subject: str | Omit = omit,
- submissions: bool | Omit = omit,
# 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,
@@ -162,70 +160,31 @@ def list(
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> SyncV4PagePaginationArray[InvestigateListResponse]:
- """Returns information for each email that matches the search parameter(s).
-
- If the
- search takes too long, the endpoint returns 202 with a Location header pointing
- to a polling endpoint where results can be retrieved once ready.
+ """
+ Returns information for each email that matches the search parameter(s).
Args:
- account_id: Account Identifier
-
- action_log: Determines if the message action log is included in the response.
+ account_id: Identifier.
- detections_only: Determines if the search results will include detections or not.
+ action_log: Whether to include the message action log in the response.
- domain: Filter by a domain found in the email: sender domain, recipient domain, or a
- domain in a link.
+ detections_only: Whether to include only detections in search results.
- end: The end of the search date range. Defaults to `now` if not provided.
+ domain: Sender domains to filter by.
- exact_subject: Search for messages with an exact subject match.
+ end: The end of the search date range. Defaults to `now`.
- final_disposition: The dispositions the search filters by.
+ final_disposition: Dispositions to filter by.
- message_action: The message actions the search filters by.
+ message_action: Message actions to filter by.
- page: Deprecated: Use cursor pagination instead.
+ page: Deprecated: Use cursor pagination instead. End of life: November 1, 2026.
per_page: The number of results per page. Maximum value is 1000.
- query: The space-delimited term used in the query. The search is case-insensitive.
-
- The content of the following email metadata fields are searched:
-
- - alert_id
- - CC
- - From (envelope_from)
- - From Name
- - final_disposition
- - md5 hash (of any attachment)
- - sha1 hash (of any attachment)
- - sha256 hash (of any attachment)
- - name (of any attachment)
- - Reason
- - Received DateTime (yyyy-mm-ddThh:mm:ss)
- - Sent DateTime (yyyy-mm-ddThh:mm:ss)
- - ReplyTo
- - To (envelope_to)
- - To Name
- - Message-ID
- - smtp_helo_server_ip
- - smtp_previous_hop_ip
- - x_originating_ip
- - Subject
-
- recipient: Filter by recipient. Matches either an email address or a domain.
-
- sender: Filter by sender. Matches either an email address or a domain.
-
- start: The beginning of the search date range. Defaults to `now - 30 days` if not
- provided.
-
- subject: Search for messages containing individual keywords in any order within the
- subject.
+ query: Space-delimited search term. Case-insensitive.
- submissions: Search for submissions instead of original messages
+ start: The beginning of the search date range. Defaults to `now - 30 days`.
extra_headers: Send extra headers
@@ -253,7 +212,6 @@ def list(
"detections_only": detections_only,
"domain": domain,
"end": end,
- "exact_subject": exact_subject,
"final_disposition": final_disposition,
"message_action": message_action,
"message_id": message_id,
@@ -265,7 +223,6 @@ def list(
"sender": sender,
"start": start,
"subject": subject,
- "submissions": submissions,
},
investigate_list_params.InvestigateListParams,
),
@@ -275,7 +232,7 @@ def list(
def get(
self,
- postfix_id: str,
+ investigate_id: str,
*,
account_id: str,
submission: bool | Omit = omit,
@@ -287,13 +244,14 @@ def get(
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> InvestigateGetResponse:
"""
- Retrieves detailed information about a specific email message, including
- headers, metadata, and security scan results.
+ Retrieves comprehensive details for a specific email message including headers,
+ recipients, sender information, and current quarantine status. Use the
+ investigate_id from search results to fetch detailed information.
Args:
- account_id: Account Identifier
+ account_id: Identifier.
- postfix_id: The identifier of the message.
+ investigate_id: Unique identifier for a message retrieved from investigation
submission: When true, search the submissions datastore only. When false or omitted, search
the regular datastore only.
@@ -308,13 +266,13 @@ def get(
"""
if not account_id:
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
- if not postfix_id:
- raise ValueError(f"Expected a non-empty value for `postfix_id` but received {postfix_id!r}")
+ if not investigate_id:
+ raise ValueError(f"Expected a non-empty value for `investigate_id` but received {investigate_id!r}")
return self._get(
path_template(
- "/accounts/{account_id}/email-security/investigate/{postfix_id}",
+ "/accounts/{account_id}/email-security/investigate/{investigate_id}",
account_id=account_id,
- postfix_id=postfix_id,
+ investigate_id=investigate_id,
),
options=make_request_options(
extra_headers=extra_headers,
@@ -386,9 +344,8 @@ def list(
detections_only: bool | Omit = omit,
domain: str | Omit = omit,
end: Union[str, datetime] | Omit = omit,
- exact_subject: str | Omit = omit,
final_disposition: Literal["MALICIOUS", "SUSPICIOUS", "SPOOF", "SPAM", "BULK", "NONE"] | Omit = omit,
- message_action: Literal["PREVIEW", "QUARANTINE_RELEASED", "MOVED", "SUBMITTED"] | Omit = omit,
+ message_action: Literal["PREVIEW", "QUARANTINE_RELEASED", "MOVED"] | Omit = omit,
message_id: str | Omit = omit,
metric: str | Omit = omit,
page: Optional[int] | Omit = omit,
@@ -398,7 +355,6 @@ def list(
sender: str | Omit = omit,
start: Union[str, datetime] | Omit = omit,
subject: str | Omit = omit,
- submissions: bool | Omit = omit,
# 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,
@@ -406,70 +362,31 @@ def list(
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> AsyncPaginator[InvestigateListResponse, AsyncV4PagePaginationArray[InvestigateListResponse]]:
- """Returns information for each email that matches the search parameter(s).
-
- If the
- search takes too long, the endpoint returns 202 with a Location header pointing
- to a polling endpoint where results can be retrieved once ready.
+ """
+ Returns information for each email that matches the search parameter(s).
Args:
- account_id: Account Identifier
-
- action_log: Determines if the message action log is included in the response.
+ account_id: Identifier.
- detections_only: Determines if the search results will include detections or not.
+ action_log: Whether to include the message action log in the response.
- domain: Filter by a domain found in the email: sender domain, recipient domain, or a
- domain in a link.
+ detections_only: Whether to include only detections in search results.
- end: The end of the search date range. Defaults to `now` if not provided.
+ domain: Sender domains to filter by.
- exact_subject: Search for messages with an exact subject match.
+ end: The end of the search date range. Defaults to `now`.
- final_disposition: The dispositions the search filters by.
+ final_disposition: Dispositions to filter by.
- message_action: The message actions the search filters by.
+ message_action: Message actions to filter by.
- page: Deprecated: Use cursor pagination instead.
+ page: Deprecated: Use cursor pagination instead. End of life: November 1, 2026.
per_page: The number of results per page. Maximum value is 1000.
- query: The space-delimited term used in the query. The search is case-insensitive.
-
- The content of the following email metadata fields are searched:
-
- - alert_id
- - CC
- - From (envelope_from)
- - From Name
- - final_disposition
- - md5 hash (of any attachment)
- - sha1 hash (of any attachment)
- - sha256 hash (of any attachment)
- - name (of any attachment)
- - Reason
- - Received DateTime (yyyy-mm-ddThh:mm:ss)
- - Sent DateTime (yyyy-mm-ddThh:mm:ss)
- - ReplyTo
- - To (envelope_to)
- - To Name
- - Message-ID
- - smtp_helo_server_ip
- - smtp_previous_hop_ip
- - x_originating_ip
- - Subject
-
- recipient: Filter by recipient. Matches either an email address or a domain.
-
- sender: Filter by sender. Matches either an email address or a domain.
-
- start: The beginning of the search date range. Defaults to `now - 30 days` if not
- provided.
-
- subject: Search for messages containing individual keywords in any order within the
- subject.
+ query: Space-delimited search term. Case-insensitive.
- submissions: Search for submissions instead of original messages
+ start: The beginning of the search date range. Defaults to `now - 30 days`.
extra_headers: Send extra headers
@@ -497,7 +414,6 @@ def list(
"detections_only": detections_only,
"domain": domain,
"end": end,
- "exact_subject": exact_subject,
"final_disposition": final_disposition,
"message_action": message_action,
"message_id": message_id,
@@ -509,7 +425,6 @@ def list(
"sender": sender,
"start": start,
"subject": subject,
- "submissions": submissions,
},
investigate_list_params.InvestigateListParams,
),
@@ -519,7 +434,7 @@ def list(
async def get(
self,
- postfix_id: str,
+ investigate_id: str,
*,
account_id: str,
submission: bool | Omit = omit,
@@ -531,13 +446,14 @@ async def get(
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> InvestigateGetResponse:
"""
- Retrieves detailed information about a specific email message, including
- headers, metadata, and security scan results.
+ Retrieves comprehensive details for a specific email message including headers,
+ recipients, sender information, and current quarantine status. Use the
+ investigate_id from search results to fetch detailed information.
Args:
- account_id: Account Identifier
+ account_id: Identifier.
- postfix_id: The identifier of the message.
+ investigate_id: Unique identifier for a message retrieved from investigation
submission: When true, search the submissions datastore only. When false or omitted, search
the regular datastore only.
@@ -552,13 +468,13 @@ async def get(
"""
if not account_id:
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
- if not postfix_id:
- raise ValueError(f"Expected a non-empty value for `postfix_id` but received {postfix_id!r}")
+ if not investigate_id:
+ raise ValueError(f"Expected a non-empty value for `investigate_id` but received {investigate_id!r}")
return await self._get(
path_template(
- "/accounts/{account_id}/email-security/investigate/{postfix_id}",
+ "/accounts/{account_id}/email-security/investigate/{investigate_id}",
account_id=account_id,
- postfix_id=postfix_id,
+ investigate_id=investigate_id,
),
options=make_request_options(
extra_headers=extra_headers,
diff --git a/src/cloudflare/resources/email_security/investigate/move.py b/src/cloudflare/resources/email_security/investigate/move.py
index ae07fced89e..8fa530641c6 100644
--- a/src/cloudflare/resources/email_security/investigate/move.py
+++ b/src/cloudflare/resources/email_security/investigate/move.py
@@ -2,13 +2,12 @@
from __future__ import annotations
-from typing import Type, cast
from typing_extensions import Literal
import httpx
from ...._types import Body, Omit, Query, Headers, NotGiven, SequenceNotStr, omit, not_given
-from ...._utils import path_template, maybe_transform, async_maybe_transform
+from ...._utils import path_template, maybe_transform
from ...._compat import cached_property
from ...._resource import SyncAPIResource, AsyncAPIResource
from ...._response import (
@@ -17,7 +16,6 @@
async_to_raw_response_wrapper,
async_to_streamed_response_wrapper,
)
-from ...._wrappers import ResultWrapper
from ....pagination import SyncSinglePage, AsyncSinglePage
from ...._base_client import AsyncPaginator, make_request_options
from ....types.email_security.investigate import move_bulk_params, move_create_params
@@ -49,31 +47,28 @@ def with_streaming_response(self) -> MoveResourceWithStreamingResponse:
def create(
self,
- postfix_id: str,
+ investigate_id: str,
*,
account_id: str,
destination: Literal[
"Inbox", "JunkEmail", "DeletedItems", "RecoverableItemsDeletions", "RecoverableItemsPurges"
],
- submission: bool | Omit = omit,
# 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,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
- ) -> MoveCreateResponse:
+ ) -> SyncSinglePage[MoveCreateResponse]:
"""
- Moves a single email message to a different folder or changes its quarantine
- status.
+ Moves a single message to a specified mailbox folder (Inbox, JunkEmail,
+ DeletedItems, RecoverableItemsDeletions, or RecoverableItemsPurges). Requires
+ active integration.
Args:
- account_id: Account Identifier
+ account_id: Identifier.
- postfix_id: The identifier of the message.
-
- submission: When true, search the submissions datastore only. When false or omitted, search
- the regular datastore only.
+ investigate_id: Unique identifier for a message retrieved from investigation
extra_headers: Send extra headers
@@ -85,24 +80,21 @@ def create(
"""
if not account_id:
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
- if not postfix_id:
- raise ValueError(f"Expected a non-empty value for `postfix_id` but received {postfix_id!r}")
- return self._post(
+ if not investigate_id:
+ raise ValueError(f"Expected a non-empty value for `investigate_id` but received {investigate_id!r}")
+ return self._get_api_list(
path_template(
- "/accounts/{account_id}/email-security/investigate/{postfix_id}/move",
+ "/accounts/{account_id}/email-security/investigate/{investigate_id}/move",
account_id=account_id,
- postfix_id=postfix_id,
+ investigate_id=investigate_id,
),
+ page=SyncSinglePage[MoveCreateResponse],
body=maybe_transform({"destination": destination}, move_create_params.MoveCreateParams),
options=make_request_options(
- extra_headers=extra_headers,
- extra_query=extra_query,
- extra_body=extra_body,
- timeout=timeout,
- query=maybe_transform({"submission": submission}, move_create_params.MoveCreateParams),
- post_parser=ResultWrapper[MoveCreateResponse]._unwrapper,
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
),
- cast_to=cast(Type[MoveCreateResponse], ResultWrapper[MoveCreateResponse]),
+ model=MoveCreateResponse,
+ method="post",
)
def bulk(
@@ -122,14 +114,17 @@ def bulk(
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> SyncSinglePage[MoveBulkResponse]:
"""
- Maximum batch size: 1000 messages per request
+ Moves multiple messages to a specified mailbox folder (Inbox, JunkEmail,
+ DeletedItems, RecoverableItemsDeletions, or RecoverableItemsPurges). Requires
+ active integration.
Args:
- account_id: Account Identifier
+ account_id: Identifier.
- ids: List of message IDs to move.
+ ids: List of message IDs to move
- postfix_ids: Deprecated: Use `ids` instead. List of message IDs to move.
+ postfix_ids: Deprecated, use `ids` instead. End of life: November 1, 2026. List of message
+ IDs to move.
extra_headers: Send extra headers
@@ -180,33 +175,30 @@ def with_streaming_response(self) -> AsyncMoveResourceWithStreamingResponse:
"""
return AsyncMoveResourceWithStreamingResponse(self)
- async def create(
+ def create(
self,
- postfix_id: str,
+ investigate_id: str,
*,
account_id: str,
destination: Literal[
"Inbox", "JunkEmail", "DeletedItems", "RecoverableItemsDeletions", "RecoverableItemsPurges"
],
- submission: bool | Omit = omit,
# 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,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
- ) -> MoveCreateResponse:
+ ) -> AsyncPaginator[MoveCreateResponse, AsyncSinglePage[MoveCreateResponse]]:
"""
- Moves a single email message to a different folder or changes its quarantine
- status.
+ Moves a single message to a specified mailbox folder (Inbox, JunkEmail,
+ DeletedItems, RecoverableItemsDeletions, or RecoverableItemsPurges). Requires
+ active integration.
Args:
- account_id: Account Identifier
+ account_id: Identifier.
- postfix_id: The identifier of the message.
-
- submission: When true, search the submissions datastore only. When false or omitted, search
- the regular datastore only.
+ investigate_id: Unique identifier for a message retrieved from investigation
extra_headers: Send extra headers
@@ -218,24 +210,21 @@ async def create(
"""
if not account_id:
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
- if not postfix_id:
- raise ValueError(f"Expected a non-empty value for `postfix_id` but received {postfix_id!r}")
- return await self._post(
+ if not investigate_id:
+ raise ValueError(f"Expected a non-empty value for `investigate_id` but received {investigate_id!r}")
+ return self._get_api_list(
path_template(
- "/accounts/{account_id}/email-security/investigate/{postfix_id}/move",
+ "/accounts/{account_id}/email-security/investigate/{investigate_id}/move",
account_id=account_id,
- postfix_id=postfix_id,
+ investigate_id=investigate_id,
),
- body=await async_maybe_transform({"destination": destination}, move_create_params.MoveCreateParams),
+ page=AsyncSinglePage[MoveCreateResponse],
+ body=maybe_transform({"destination": destination}, move_create_params.MoveCreateParams),
options=make_request_options(
- extra_headers=extra_headers,
- extra_query=extra_query,
- extra_body=extra_body,
- timeout=timeout,
- query=await async_maybe_transform({"submission": submission}, move_create_params.MoveCreateParams),
- post_parser=ResultWrapper[MoveCreateResponse]._unwrapper,
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
),
- cast_to=cast(Type[MoveCreateResponse], ResultWrapper[MoveCreateResponse]),
+ model=MoveCreateResponse,
+ method="post",
)
def bulk(
@@ -255,14 +244,17 @@ def bulk(
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> AsyncPaginator[MoveBulkResponse, AsyncSinglePage[MoveBulkResponse]]:
"""
- Maximum batch size: 1000 messages per request
+ Moves multiple messages to a specified mailbox folder (Inbox, JunkEmail,
+ DeletedItems, RecoverableItemsDeletions, or RecoverableItemsPurges). Requires
+ active integration.
Args:
- account_id: Account Identifier
+ account_id: Identifier.
- ids: List of message IDs to move.
+ ids: List of message IDs to move
- postfix_ids: Deprecated: Use `ids` instead. List of message IDs to move.
+ postfix_ids: Deprecated, use `ids` instead. End of life: November 1, 2026. List of message
+ IDs to move.
extra_headers: Send extra headers
diff --git a/src/cloudflare/resources/email_security/investigate/preview.py b/src/cloudflare/resources/email_security/investigate/preview.py
index 17fe835b7f4..1bfbe97d41b 100644
--- a/src/cloudflare/resources/email_security/investigate/preview.py
+++ b/src/cloudflare/resources/email_security/investigate/preview.py
@@ -6,7 +6,7 @@
import httpx
-from ...._types import Body, Omit, Query, Headers, NotGiven, omit, not_given
+from ...._types import Body, Query, Headers, NotGiven, not_given
from ...._utils import path_template, maybe_transform, async_maybe_transform
from ...._compat import cached_property
from ...._resource import SyncAPIResource, AsyncAPIResource
@@ -50,7 +50,6 @@ def create(
*,
account_id: str,
postfix_id: str,
- submission: bool | Omit = omit,
# 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,
@@ -59,16 +58,14 @@ def create(
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> PreviewCreateResponse:
"""
- Generates a preview of an email message for safe viewing without executing any
- embedded content.
+ Generates a preview image for a message that was not flagged as a detection.
+ Useful for investigating benign messages. Returns a base64-encoded PNG
+ screenshot of the email body.
Args:
- account_id: Account Identifier
+ account_id: Identifier.
- postfix_id: The identifier of the message.
-
- submission: When true, search the submissions datastore only. When false or omitted, search
- the regular datastore only.
+ postfix_id: The identifier of the message
extra_headers: Send extra headers
@@ -88,7 +85,6 @@ def create(
extra_query=extra_query,
extra_body=extra_body,
timeout=timeout,
- query=maybe_transform({"submission": submission}, preview_create_params.PreviewCreateParams),
post_parser=ResultWrapper[PreviewCreateResponse]._unwrapper,
),
cast_to=cast(Type[PreviewCreateResponse], ResultWrapper[PreviewCreateResponse]),
@@ -96,7 +92,7 @@ def create(
def get(
self,
- postfix_id: str,
+ investigate_id: str,
*,
account_id: str,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
@@ -111,9 +107,9 @@ def get(
non-benign messages.
Args:
- account_id: Account Identifier
+ account_id: Identifier.
- postfix_id: The identifier of the message.
+ investigate_id: Unique identifier for a message retrieved from investigation
extra_headers: Send extra headers
@@ -125,13 +121,13 @@ def get(
"""
if not account_id:
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
- if not postfix_id:
- raise ValueError(f"Expected a non-empty value for `postfix_id` but received {postfix_id!r}")
+ if not investigate_id:
+ raise ValueError(f"Expected a non-empty value for `investigate_id` but received {investigate_id!r}")
return self._get(
path_template(
- "/accounts/{account_id}/email-security/investigate/{postfix_id}/preview",
+ "/accounts/{account_id}/email-security/investigate/{investigate_id}/preview",
account_id=account_id,
- postfix_id=postfix_id,
+ investigate_id=investigate_id,
),
options=make_request_options(
extra_headers=extra_headers,
@@ -169,7 +165,6 @@ async def create(
*,
account_id: str,
postfix_id: str,
- submission: bool | Omit = omit,
# 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,
@@ -178,16 +173,14 @@ async def create(
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> PreviewCreateResponse:
"""
- Generates a preview of an email message for safe viewing without executing any
- embedded content.
+ Generates a preview image for a message that was not flagged as a detection.
+ Useful for investigating benign messages. Returns a base64-encoded PNG
+ screenshot of the email body.
Args:
- account_id: Account Identifier
+ account_id: Identifier.
- postfix_id: The identifier of the message.
-
- submission: When true, search the submissions datastore only. When false or omitted, search
- the regular datastore only.
+ postfix_id: The identifier of the message
extra_headers: Send extra headers
@@ -207,9 +200,6 @@ async def create(
extra_query=extra_query,
extra_body=extra_body,
timeout=timeout,
- query=await async_maybe_transform(
- {"submission": submission}, preview_create_params.PreviewCreateParams
- ),
post_parser=ResultWrapper[PreviewCreateResponse]._unwrapper,
),
cast_to=cast(Type[PreviewCreateResponse], ResultWrapper[PreviewCreateResponse]),
@@ -217,7 +207,7 @@ async def create(
async def get(
self,
- postfix_id: str,
+ investigate_id: str,
*,
account_id: str,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
@@ -232,9 +222,9 @@ async def get(
non-benign messages.
Args:
- account_id: Account Identifier
+ account_id: Identifier.
- postfix_id: The identifier of the message.
+ investigate_id: Unique identifier for a message retrieved from investigation
extra_headers: Send extra headers
@@ -246,13 +236,13 @@ async def get(
"""
if not account_id:
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
- if not postfix_id:
- raise ValueError(f"Expected a non-empty value for `postfix_id` but received {postfix_id!r}")
+ if not investigate_id:
+ raise ValueError(f"Expected a non-empty value for `investigate_id` but received {investigate_id!r}")
return await self._get(
path_template(
- "/accounts/{account_id}/email-security/investigate/{postfix_id}/preview",
+ "/accounts/{account_id}/email-security/investigate/{investigate_id}/preview",
account_id=account_id,
- postfix_id=postfix_id,
+ investigate_id=investigate_id,
),
options=make_request_options(
extra_headers=extra_headers,
diff --git a/src/cloudflare/resources/email_security/investigate/raw.py b/src/cloudflare/resources/email_security/investigate/raw.py
index 39a8a4b6d39..9a3c682452c 100644
--- a/src/cloudflare/resources/email_security/investigate/raw.py
+++ b/src/cloudflare/resources/email_security/investigate/raw.py
@@ -45,7 +45,7 @@ def with_streaming_response(self) -> RawResourceWithStreamingResponse:
def get(
self,
- postfix_id: str,
+ investigate_id: str,
*,
account_id: str,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
@@ -59,9 +59,9 @@ def get(
Returns the raw eml of any non-benign message.
Args:
- account_id: Account Identifier
+ account_id: Identifier.
- postfix_id: The identifier of the message.
+ investigate_id: Unique identifier for a message retrieved from investigation
extra_headers: Send extra headers
@@ -73,13 +73,13 @@ def get(
"""
if not account_id:
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
- if not postfix_id:
- raise ValueError(f"Expected a non-empty value for `postfix_id` but received {postfix_id!r}")
+ if not investigate_id:
+ raise ValueError(f"Expected a non-empty value for `investigate_id` but received {investigate_id!r}")
return self._get(
path_template(
- "/accounts/{account_id}/email-security/investigate/{postfix_id}/raw",
+ "/accounts/{account_id}/email-security/investigate/{investigate_id}/raw",
account_id=account_id,
- postfix_id=postfix_id,
+ investigate_id=investigate_id,
),
options=make_request_options(
extra_headers=extra_headers,
@@ -114,7 +114,7 @@ def with_streaming_response(self) -> AsyncRawResourceWithStreamingResponse:
async def get(
self,
- postfix_id: str,
+ investigate_id: str,
*,
account_id: str,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
@@ -128,9 +128,9 @@ async def get(
Returns the raw eml of any non-benign message.
Args:
- account_id: Account Identifier
+ account_id: Identifier.
- postfix_id: The identifier of the message.
+ investigate_id: Unique identifier for a message retrieved from investigation
extra_headers: Send extra headers
@@ -142,13 +142,13 @@ async def get(
"""
if not account_id:
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
- if not postfix_id:
- raise ValueError(f"Expected a non-empty value for `postfix_id` but received {postfix_id!r}")
+ if not investigate_id:
+ raise ValueError(f"Expected a non-empty value for `investigate_id` but received {investigate_id!r}")
return await self._get(
path_template(
- "/accounts/{account_id}/email-security/investigate/{postfix_id}/raw",
+ "/accounts/{account_id}/email-security/investigate/{investigate_id}/raw",
account_id=account_id,
- postfix_id=postfix_id,
+ investigate_id=investigate_id,
),
options=make_request_options(
extra_headers=extra_headers,
diff --git a/src/cloudflare/resources/email_security/investigate/reclassify.py b/src/cloudflare/resources/email_security/investigate/reclassify.py
index 27daa3d7260..80a1b87eebb 100644
--- a/src/cloudflare/resources/email_security/investigate/reclassify.py
+++ b/src/cloudflare/resources/email_security/investigate/reclassify.py
@@ -46,11 +46,10 @@ def with_streaming_response(self) -> ReclassifyResourceWithStreamingResponse:
def create(
self,
- postfix_id: str,
+ investigate_id: str,
*,
account_id: str,
expected_disposition: Literal["NONE", "BULK", "MALICIOUS", "SPAM", "SPOOF", "SUSPICIOUS"],
- submission: bool | Omit = omit,
eml_content: str | Omit = omit,
escalated_submission_id: str | Omit = omit,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
@@ -60,19 +59,18 @@ def create(
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> object:
- """
- Submits an email message for reclassification, updating its threat assessment
- based on new analysis.
+ """Submits a request to reclassify an email's disposition.
- Args:
- account_id: Account Identifier
+ Use for reporting false
+ positives or false negatives. Optionally provide the raw EML content for
+ reanalysis. The reclassification is processed asynchronously.
- postfix_id: The identifier of the message.
+ Args:
+ account_id: Identifier.
- submission: When true, search the submissions datastore only. When false or omitted, search
- the regular datastore only.
+ investigate_id: Unique identifier for a message retrieved from investigation
- eml_content: Base64 encoded content of the EML file
+ eml_content: Base64 encoded content of the EML file.
extra_headers: Send extra headers
@@ -84,13 +82,13 @@ def create(
"""
if not account_id:
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
- if not postfix_id:
- raise ValueError(f"Expected a non-empty value for `postfix_id` but received {postfix_id!r}")
+ if not investigate_id:
+ raise ValueError(f"Expected a non-empty value for `investigate_id` but received {investigate_id!r}")
return self._post(
path_template(
- "/accounts/{account_id}/email-security/investigate/{postfix_id}/reclassify",
+ "/accounts/{account_id}/email-security/investigate/{investigate_id}/reclassify",
account_id=account_id,
- postfix_id=postfix_id,
+ investigate_id=investigate_id,
),
body=maybe_transform(
{
@@ -105,7 +103,6 @@ def create(
extra_query=extra_query,
extra_body=extra_body,
timeout=timeout,
- query=maybe_transform({"submission": submission}, reclassify_create_params.ReclassifyCreateParams),
post_parser=ResultWrapper[object]._unwrapper,
),
cast_to=cast(Type[object], ResultWrapper[object]),
@@ -134,11 +131,10 @@ def with_streaming_response(self) -> AsyncReclassifyResourceWithStreamingRespons
async def create(
self,
- postfix_id: str,
+ investigate_id: str,
*,
account_id: str,
expected_disposition: Literal["NONE", "BULK", "MALICIOUS", "SPAM", "SPOOF", "SUSPICIOUS"],
- submission: bool | Omit = omit,
eml_content: str | Omit = omit,
escalated_submission_id: str | Omit = omit,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
@@ -148,19 +144,18 @@ async def create(
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> object:
- """
- Submits an email message for reclassification, updating its threat assessment
- based on new analysis.
+ """Submits a request to reclassify an email's disposition.
- Args:
- account_id: Account Identifier
+ Use for reporting false
+ positives or false negatives. Optionally provide the raw EML content for
+ reanalysis. The reclassification is processed asynchronously.
- postfix_id: The identifier of the message.
+ Args:
+ account_id: Identifier.
- submission: When true, search the submissions datastore only. When false or omitted, search
- the regular datastore only.
+ investigate_id: Unique identifier for a message retrieved from investigation
- eml_content: Base64 encoded content of the EML file
+ eml_content: Base64 encoded content of the EML file.
extra_headers: Send extra headers
@@ -172,13 +167,13 @@ async def create(
"""
if not account_id:
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
- if not postfix_id:
- raise ValueError(f"Expected a non-empty value for `postfix_id` but received {postfix_id!r}")
+ if not investigate_id:
+ raise ValueError(f"Expected a non-empty value for `investigate_id` but received {investigate_id!r}")
return await self._post(
path_template(
- "/accounts/{account_id}/email-security/investigate/{postfix_id}/reclassify",
+ "/accounts/{account_id}/email-security/investigate/{investigate_id}/reclassify",
account_id=account_id,
- postfix_id=postfix_id,
+ investigate_id=investigate_id,
),
body=await async_maybe_transform(
{
@@ -193,9 +188,6 @@ async def create(
extra_query=extra_query,
extra_body=extra_body,
timeout=timeout,
- query=await async_maybe_transform(
- {"submission": submission}, reclassify_create_params.ReclassifyCreateParams
- ),
post_parser=ResultWrapper[object]._unwrapper,
),
cast_to=cast(Type[object], ResultWrapper[object]),
diff --git a/src/cloudflare/resources/email_security/investigate/release.py b/src/cloudflare/resources/email_security/investigate/release.py
index 78d9770cc96..21f78d710b2 100644
--- a/src/cloudflare/resources/email_security/investigate/release.py
+++ b/src/cloudflare/resources/email_security/investigate/release.py
@@ -54,13 +54,12 @@ def bulk(
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> SyncSinglePage[ReleaseBulkResponse]:
"""
- Releases a quarantined email message, allowing it to be delivered to the
- recipient.
+ Releases one or more quarantined messages, delivering them to the intended
+ recipients. Use when a message was incorrectly quarantined. Returns delivery
+ status for each recipient.
Args:
- account_id: Account Identifier
-
- body: A list of messages identfied by their `postfix_id`s that should be released.
+ account_id: Identifier.
extra_headers: Send extra headers
@@ -117,13 +116,12 @@ def bulk(
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> AsyncPaginator[ReleaseBulkResponse, AsyncSinglePage[ReleaseBulkResponse]]:
"""
- Releases a quarantined email message, allowing it to be delivered to the
- recipient.
+ Releases one or more quarantined messages, delivering them to the intended
+ recipients. Use when a message was incorrectly quarantined. Returns delivery
+ status for each recipient.
Args:
- account_id: Account Identifier
-
- body: A list of messages identfied by their `postfix_id`s that should be released.
+ account_id: Identifier.
extra_headers: Send extra headers
diff --git a/src/cloudflare/resources/email_security/investigate/trace.py b/src/cloudflare/resources/email_security/investigate/trace.py
index bcb66883386..daf3560d6d1 100644
--- a/src/cloudflare/resources/email_security/investigate/trace.py
+++ b/src/cloudflare/resources/email_security/investigate/trace.py
@@ -6,8 +6,8 @@
import httpx
-from ...._types import Body, Omit, Query, Headers, NotGiven, omit, not_given
-from ...._utils import path_template, maybe_transform, async_maybe_transform
+from ...._types import Body, Query, Headers, NotGiven, not_given
+from ...._utils import path_template
from ...._compat import cached_property
from ...._resource import SyncAPIResource, AsyncAPIResource
from ...._response import (
@@ -18,7 +18,6 @@
)
from ...._wrappers import ResultWrapper
from ...._base_client import make_request_options
-from ....types.email_security.investigate import trace_get_params
from ....types.email_security.investigate.trace_get_response import TraceGetResponse
__all__ = ["TraceResource", "AsyncTraceResource"]
@@ -46,10 +45,9 @@ def with_streaming_response(self) -> TraceResourceWithStreamingResponse:
def get(
self,
- postfix_id: str,
+ investigate_id: str,
*,
account_id: str,
- submission: bool | Omit = omit,
# 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,
@@ -57,17 +55,16 @@ def get(
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> TraceGetResponse:
- """
- Gets the delivery trace for an email message, showing its path through email
- security processing.
+ """Retrieves delivery and processing trace information for an email message.
- Args:
- account_id: Account Identifier
+ Shows
+ the delivery path, retraction history, and move operations performed on the
+ message. Useful for debugging delivery issues.
- postfix_id: The identifier of the message.
+ Args:
+ account_id: Identifier.
- submission: When true, search the submissions datastore only. When false or omitted, search
- the regular datastore only.
+ investigate_id: Unique identifier for a message retrieved from investigation
extra_headers: Send extra headers
@@ -79,20 +76,19 @@ def get(
"""
if not account_id:
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
- if not postfix_id:
- raise ValueError(f"Expected a non-empty value for `postfix_id` but received {postfix_id!r}")
+ if not investigate_id:
+ raise ValueError(f"Expected a non-empty value for `investigate_id` but received {investigate_id!r}")
return self._get(
path_template(
- "/accounts/{account_id}/email-security/investigate/{postfix_id}/trace",
+ "/accounts/{account_id}/email-security/investigate/{investigate_id}/trace",
account_id=account_id,
- postfix_id=postfix_id,
+ investigate_id=investigate_id,
),
options=make_request_options(
extra_headers=extra_headers,
extra_query=extra_query,
extra_body=extra_body,
timeout=timeout,
- query=maybe_transform({"submission": submission}, trace_get_params.TraceGetParams),
post_parser=ResultWrapper[TraceGetResponse]._unwrapper,
),
cast_to=cast(Type[TraceGetResponse], ResultWrapper[TraceGetResponse]),
@@ -121,10 +117,9 @@ def with_streaming_response(self) -> AsyncTraceResourceWithStreamingResponse:
async def get(
self,
- postfix_id: str,
+ investigate_id: str,
*,
account_id: str,
- submission: bool | Omit = omit,
# 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,
@@ -132,17 +127,16 @@ async def get(
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> TraceGetResponse:
- """
- Gets the delivery trace for an email message, showing its path through email
- security processing.
+ """Retrieves delivery and processing trace information for an email message.
- Args:
- account_id: Account Identifier
+ Shows
+ the delivery path, retraction history, and move operations performed on the
+ message. Useful for debugging delivery issues.
- postfix_id: The identifier of the message.
+ Args:
+ account_id: Identifier.
- submission: When true, search the submissions datastore only. When false or omitted, search
- the regular datastore only.
+ investigate_id: Unique identifier for a message retrieved from investigation
extra_headers: Send extra headers
@@ -154,20 +148,19 @@ async def get(
"""
if not account_id:
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
- if not postfix_id:
- raise ValueError(f"Expected a non-empty value for `postfix_id` but received {postfix_id!r}")
+ if not investigate_id:
+ raise ValueError(f"Expected a non-empty value for `investigate_id` but received {investigate_id!r}")
return await self._get(
path_template(
- "/accounts/{account_id}/email-security/investigate/{postfix_id}/trace",
+ "/accounts/{account_id}/email-security/investigate/{investigate_id}/trace",
account_id=account_id,
- postfix_id=postfix_id,
+ investigate_id=investigate_id,
),
options=make_request_options(
extra_headers=extra_headers,
extra_query=extra_query,
extra_body=extra_body,
timeout=timeout,
- query=await async_maybe_transform({"submission": submission}, trace_get_params.TraceGetParams),
post_parser=ResultWrapper[TraceGetResponse]._unwrapper,
),
cast_to=cast(Type[TraceGetResponse], ResultWrapper[TraceGetResponse]),
diff --git a/src/cloudflare/resources/email_security/phishguard/reports.py b/src/cloudflare/resources/email_security/phishguard/reports.py
index b41c7cdaefc..06029293bc6 100644
--- a/src/cloudflare/resources/email_security/phishguard/reports.py
+++ b/src/cloudflare/resources/email_security/phishguard/reports.py
@@ -60,16 +60,22 @@ def list(
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> SyncSinglePage[ReportListResponse]:
- """
- Retrieves `PhishGuard` reports showing phishing attempts and suspicious email
- patterns detected.
+ """Retrieves PhishGuard security alert reports for a specified date range.
+
+ Reports
+ include detected threats, dispositions, and contextual information. Use for
+ security monitoring and threat analysis.
Args:
- account_id: Account Identifier
+ account_id: Identifier.
+
+ end: End of the time range (RFC3339). Takes precedence over to_date.
+
+ from_date: Deprecated, use `start` instead. Start date in YYYY-MM-DD format.
- end: The end of the search date range (RFC3339 format).
+ start: Start of the time range (RFC3339). Takes precedence over from_date.
- start: The beginning of the search date range (RFC3339 format).
+ to_date: Deprecated, use `end` instead. End date in YYYY-MM-DD format.
extra_headers: Send extra headers
@@ -138,16 +144,22 @@ def list(
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> AsyncPaginator[ReportListResponse, AsyncSinglePage[ReportListResponse]]:
- """
- Retrieves `PhishGuard` reports showing phishing attempts and suspicious email
- patterns detected.
+ """Retrieves PhishGuard security alert reports for a specified date range.
+
+ Reports
+ include detected threats, dispositions, and contextual information. Use for
+ security monitoring and threat analysis.
Args:
- account_id: Account Identifier
+ account_id: Identifier.
+
+ end: End of the time range (RFC3339). Takes precedence over to_date.
+
+ from_date: Deprecated, use `start` instead. Start date in YYYY-MM-DD format.
- end: The end of the search date range (RFC3339 format).
+ start: Start of the time range (RFC3339). Takes precedence over from_date.
- start: The beginning of the search date range (RFC3339 format).
+ to_date: Deprecated, use `end` instead. End date in YYYY-MM-DD format.
extra_headers: Send extra headers
diff --git a/src/cloudflare/resources/email_security/settings/allow_policies.py b/src/cloudflare/resources/email_security/settings/allow_policies.py
index d9c3950c649..67b7f077364 100644
--- a/src/cloudflare/resources/email_security/settings/allow_policies.py
+++ b/src/cloudflare/resources/email_security/settings/allow_policies.py
@@ -75,25 +75,42 @@ def create(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
- ) -> AllowPolicyCreateResponse:
- """
- Creates a new email allow policy that permits specific senders, domains, or
- patterns to bypass security scanning.
+ ) -> Optional[AllowPolicyCreateResponse]:
+ """Creates a new allow policy that exempts matching emails from security
+ detections.
+
+ Use with caution as this bypasses email security scanning. Policies
+ can match on sender patterns and apply to specific detections or all detections.
Args:
- account_id: Account Identifier
+ account_id: Identifier.
is_acceptable_sender: Messages from this sender will be exempted from Spam, Spoof and Bulk
- dispositions. Note: This will not exempt messages with Malicious or Suspicious
+ dispositions. Note - This will not exempt messages with Malicious or Suspicious
dispositions.
- is_exempt_recipient: Messages to this recipient will bypass all detections.
+ is_exempt_recipient: Messages to this recipient will bypass all detections
+
+ is_trusted_sender: Messages from this sender will bypass all detections and link following
- is_trusted_sender: Messages from this sender will bypass all detections and link following.
+ pattern_type: Type of pattern matching. Note: UNKNOWN is deprecated and cannot be used when
+ creating or updating policies, but may be returned for existing entries.
verify_sender: Enforce DMARC, SPF or DKIM authentication. When on, Email Security only honors
policies that pass authentication.
+ is_recipient:
+ Deprecated as of July 1, 2025. Use `is_exempt_recipient` instead. End of life:
+ July 1, 2026.
+
+ is_sender:
+ Deprecated as of July 1, 2025. Use `is_trusted_sender` instead. End of life:
+ July 1, 2026.
+
+ is_spoof:
+ Deprecated as of July 1, 2025. Use `is_acceptable_sender` instead. End of life:
+ July 1, 2026.
+
extra_headers: Send extra headers
extra_query: Add additional query parameters to the request
@@ -127,9 +144,9 @@ def create(
extra_query=extra_query,
extra_body=extra_body,
timeout=timeout,
- post_parser=ResultWrapper[AllowPolicyCreateResponse]._unwrapper,
+ post_parser=ResultWrapper[Optional[AllowPolicyCreateResponse]]._unwrapper,
),
- cast_to=cast(Type[AllowPolicyCreateResponse], ResultWrapper[AllowPolicyCreateResponse]),
+ cast_to=cast(Type[Optional[AllowPolicyCreateResponse]], ResultWrapper[AllowPolicyCreateResponse]),
)
def list(
@@ -139,9 +156,6 @@ def list(
direction: Literal["asc", "desc"] | Omit = omit,
is_acceptable_sender: bool | Omit = omit,
is_exempt_recipient: bool | Omit = omit,
- is_recipient: bool | Omit = omit,
- is_sender: bool | Omit = omit,
- is_spoof: bool | Omit = omit,
is_trusted_sender: bool | Omit = omit,
order: Literal["pattern", "created_at"] | Omit = omit,
page: int | Omit = omit,
@@ -157,23 +171,38 @@ def list(
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> SyncV4PagePaginationArray[AllowPolicyListResponse]:
- """
- Lists, searches, and sorts an account’s email allow policies.
+ """Returns a paginated list of email allow policies.
+
+ These policies exempt matching
+ emails from security detection, allowing them to bypass disposition actions.
+ Supports filtering by pattern type and policy attributes.
Args:
- account_id: Account Identifier
+ account_id: Identifier.
direction: The sorting direction.
- order: The field to sort by.
+ is_acceptable_sender: Filter to show only policies where messages from the sender are exempted from
+ Spam, Spoof, and Bulk dispositions (not Malicious or Suspicious).
+
+ is_exempt_recipient: Filter to show only policies where messages to the recipient bypass all
+ detections.
+
+ is_trusted_sender: Filter to show only policies where messages from the sender bypass all
+ detections and link following.
- page: The page number of paginated results.
+ order: Field to sort by.
- per_page: The number of results per page.
+ page: Current page within paginated list of results.
- search: Allows searching in multiple properties of a record simultaneously. This
- parameter is intended for human users, not automation. Its exact behavior is
- intentionally left unspecified and is subject to change in the future.
+ pattern_type: Type of pattern matching. Note: UNKNOWN is deprecated and cannot be used when
+ creating or updating policies, but may be returned for existing entries.
+
+ per_page: The number of results per page. Maximum value is 1000.
+
+ search: Search term for filtering records. Behavior may change.
+
+ verify_sender: Filter to show only policies that enforce DMARC, SPF, or DKIM authentication.
extra_headers: Send extra headers
@@ -198,9 +227,6 @@ def list(
"direction": direction,
"is_acceptable_sender": is_acceptable_sender,
"is_exempt_recipient": is_exempt_recipient,
- "is_recipient": is_recipient,
- "is_sender": is_sender,
- "is_spoof": is_spoof,
"is_trusted_sender": is_trusted_sender,
"order": order,
"page": page,
@@ -218,7 +244,7 @@ def list(
def delete(
self,
- policy_id: int,
+ policy_id: str,
*,
account_id: str,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
@@ -227,16 +253,16 @@ def delete(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
- ) -> AllowPolicyDeleteResponse:
- """Removes an email allow policy.
+ ) -> Optional[AllowPolicyDeleteResponse]:
+ """Removes an allow policy.
- Previously allowed senders will be subject to
- normal security scanning.
+ After deletion, emails matching this pattern will be
+ subject to normal security scanning and disposition actions.
Args:
- account_id: Account Identifier
+ account_id: Identifier.
- policy_id: The unique identifier for the allow policy.
+ policy_id: Allow policy identifier
extra_headers: Send extra headers
@@ -248,6 +274,8 @@ def delete(
"""
if not account_id:
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
+ if not policy_id:
+ raise ValueError(f"Expected a non-empty value for `policy_id` but received {policy_id!r}")
return self._delete(
path_template(
"/accounts/{account_id}/email-security/settings/allow_policies/{policy_id}",
@@ -259,47 +287,66 @@ def delete(
extra_query=extra_query,
extra_body=extra_body,
timeout=timeout,
- post_parser=ResultWrapper[AllowPolicyDeleteResponse]._unwrapper,
+ post_parser=ResultWrapper[Optional[AllowPolicyDeleteResponse]]._unwrapper,
),
- cast_to=cast(Type[AllowPolicyDeleteResponse], ResultWrapper[AllowPolicyDeleteResponse]),
+ cast_to=cast(Type[Optional[AllowPolicyDeleteResponse]], ResultWrapper[AllowPolicyDeleteResponse]),
)
def edit(
self,
- policy_id: int,
+ policy_id: str,
*,
account_id: str,
comments: Optional[str] | Omit = omit,
- is_acceptable_sender: Optional[bool] | Omit = omit,
- is_exempt_recipient: Optional[bool] | Omit = omit,
- is_regex: Optional[bool] | Omit = omit,
- is_trusted_sender: Optional[bool] | Omit = omit,
- pattern: Optional[str] | Omit = omit,
- pattern_type: Optional[Literal["EMAIL", "DOMAIN", "IP", "UNKNOWN"]] | Omit = omit,
- verify_sender: Optional[bool] | Omit = omit,
+ is_acceptable_sender: bool | Omit = omit,
+ is_exempt_recipient: bool | Omit = omit,
+ is_recipient: bool | Omit = omit,
+ is_regex: bool | Omit = omit,
+ is_sender: bool | Omit = omit,
+ is_spoof: bool | Omit = omit,
+ is_trusted_sender: bool | Omit = omit,
+ pattern: str | Omit = omit,
+ pattern_type: Literal["EMAIL", "DOMAIN", "IP", "UNKNOWN"] | Omit = omit,
+ verify_sender: bool | Omit = omit,
# 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,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
- ) -> AllowPolicyEditResponse:
- """
- Updates an existing email allow policy, modifying its matching criteria or
- scope.
+ ) -> Optional[AllowPolicyEditResponse]:
+ """Updates an existing allow policy.
+
+ Only provided fields will be modified. Changes
+ take effect for new emails matching the pattern.
Args:
- account_id: Account Identifier
+ account_id: Identifier.
- policy_id: The unique identifier for the allow policy.
+ policy_id: Allow policy identifier
is_acceptable_sender: Messages from this sender will be exempted from Spam, Spoof and Bulk
- dispositions. Note: This will not exempt messages with Malicious or Suspicious
+ dispositions. Note - This will not exempt messages with Malicious or Suspicious
dispositions.
- is_exempt_recipient: Messages to this recipient will bypass all detections.
+ is_exempt_recipient: Messages to this recipient will bypass all detections
+
+ is_recipient:
+ Deprecated as of July 1, 2025. Use `is_exempt_recipient` instead. End of life:
+ July 1, 2026.
+
+ is_sender:
+ Deprecated as of July 1, 2025. Use `is_trusted_sender` instead. End of life:
+ July 1, 2026.
+
+ is_spoof:
+ Deprecated as of July 1, 2025. Use `is_acceptable_sender` instead. End of life:
+ July 1, 2026.
- is_trusted_sender: Messages from this sender will bypass all detections and link following.
+ is_trusted_sender: Messages from this sender will bypass all detections and link following
+
+ pattern_type: Type of pattern matching. Note: UNKNOWN is deprecated and cannot be used when
+ creating or updating policies, but may be returned for existing entries.
verify_sender: Enforce DMARC, SPF or DKIM authentication. When on, Email Security only honors
policies that pass authentication.
@@ -314,6 +361,8 @@ def edit(
"""
if not account_id:
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
+ if not policy_id:
+ raise ValueError(f"Expected a non-empty value for `policy_id` but received {policy_id!r}")
return self._patch(
path_template(
"/accounts/{account_id}/email-security/settings/allow_policies/{policy_id}",
@@ -325,7 +374,10 @@ def edit(
"comments": comments,
"is_acceptable_sender": is_acceptable_sender,
"is_exempt_recipient": is_exempt_recipient,
+ "is_recipient": is_recipient,
"is_regex": is_regex,
+ "is_sender": is_sender,
+ "is_spoof": is_spoof,
"is_trusted_sender": is_trusted_sender,
"pattern": pattern,
"pattern_type": pattern_type,
@@ -338,14 +390,14 @@ def edit(
extra_query=extra_query,
extra_body=extra_body,
timeout=timeout,
- post_parser=ResultWrapper[AllowPolicyEditResponse]._unwrapper,
+ post_parser=ResultWrapper[Optional[AllowPolicyEditResponse]]._unwrapper,
),
- cast_to=cast(Type[AllowPolicyEditResponse], ResultWrapper[AllowPolicyEditResponse]),
+ cast_to=cast(Type[Optional[AllowPolicyEditResponse]], ResultWrapper[AllowPolicyEditResponse]),
)
def get(
self,
- policy_id: int,
+ policy_id: str,
*,
account_id: str,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
@@ -354,15 +406,15 @@ def get(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
- ) -> AllowPolicyGetResponse:
+ ) -> Optional[AllowPolicyGetResponse]:
"""
- Retrieves details for a specific email allow policy, including its matching
- criteria and scope.
+ Retrieves details for a specific allow policy including its pattern,
+ dispositions that are exempted, and whether it applies to all detections.
Args:
- account_id: Account Identifier
+ account_id: Identifier.
- policy_id: The unique identifier for the allow policy.
+ policy_id: Allow policy identifier
extra_headers: Send extra headers
@@ -374,6 +426,8 @@ def get(
"""
if not account_id:
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
+ if not policy_id:
+ raise ValueError(f"Expected a non-empty value for `policy_id` but received {policy_id!r}")
return self._get(
path_template(
"/accounts/{account_id}/email-security/settings/allow_policies/{policy_id}",
@@ -385,9 +439,9 @@ def get(
extra_query=extra_query,
extra_body=extra_body,
timeout=timeout,
- post_parser=ResultWrapper[AllowPolicyGetResponse]._unwrapper,
+ post_parser=ResultWrapper[Optional[AllowPolicyGetResponse]]._unwrapper,
),
- cast_to=cast(Type[AllowPolicyGetResponse], ResultWrapper[AllowPolicyGetResponse]),
+ cast_to=cast(Type[Optional[AllowPolicyGetResponse]], ResultWrapper[AllowPolicyGetResponse]),
)
@@ -432,25 +486,42 @@ async def create(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
- ) -> AllowPolicyCreateResponse:
- """
- Creates a new email allow policy that permits specific senders, domains, or
- patterns to bypass security scanning.
+ ) -> Optional[AllowPolicyCreateResponse]:
+ """Creates a new allow policy that exempts matching emails from security
+ detections.
+
+ Use with caution as this bypasses email security scanning. Policies
+ can match on sender patterns and apply to specific detections or all detections.
Args:
- account_id: Account Identifier
+ account_id: Identifier.
is_acceptable_sender: Messages from this sender will be exempted from Spam, Spoof and Bulk
- dispositions. Note: This will not exempt messages with Malicious or Suspicious
+ dispositions. Note - This will not exempt messages with Malicious or Suspicious
dispositions.
- is_exempt_recipient: Messages to this recipient will bypass all detections.
+ is_exempt_recipient: Messages to this recipient will bypass all detections
+
+ is_trusted_sender: Messages from this sender will bypass all detections and link following
- is_trusted_sender: Messages from this sender will bypass all detections and link following.
+ pattern_type: Type of pattern matching. Note: UNKNOWN is deprecated and cannot be used when
+ creating or updating policies, but may be returned for existing entries.
verify_sender: Enforce DMARC, SPF or DKIM authentication. When on, Email Security only honors
policies that pass authentication.
+ is_recipient:
+ Deprecated as of July 1, 2025. Use `is_exempt_recipient` instead. End of life:
+ July 1, 2026.
+
+ is_sender:
+ Deprecated as of July 1, 2025. Use `is_trusted_sender` instead. End of life:
+ July 1, 2026.
+
+ is_spoof:
+ Deprecated as of July 1, 2025. Use `is_acceptable_sender` instead. End of life:
+ July 1, 2026.
+
extra_headers: Send extra headers
extra_query: Add additional query parameters to the request
@@ -484,9 +555,9 @@ async def create(
extra_query=extra_query,
extra_body=extra_body,
timeout=timeout,
- post_parser=ResultWrapper[AllowPolicyCreateResponse]._unwrapper,
+ post_parser=ResultWrapper[Optional[AllowPolicyCreateResponse]]._unwrapper,
),
- cast_to=cast(Type[AllowPolicyCreateResponse], ResultWrapper[AllowPolicyCreateResponse]),
+ cast_to=cast(Type[Optional[AllowPolicyCreateResponse]], ResultWrapper[AllowPolicyCreateResponse]),
)
def list(
@@ -496,9 +567,6 @@ def list(
direction: Literal["asc", "desc"] | Omit = omit,
is_acceptable_sender: bool | Omit = omit,
is_exempt_recipient: bool | Omit = omit,
- is_recipient: bool | Omit = omit,
- is_sender: bool | Omit = omit,
- is_spoof: bool | Omit = omit,
is_trusted_sender: bool | Omit = omit,
order: Literal["pattern", "created_at"] | Omit = omit,
page: int | Omit = omit,
@@ -514,23 +582,38 @@ def list(
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> AsyncPaginator[AllowPolicyListResponse, AsyncV4PagePaginationArray[AllowPolicyListResponse]]:
- """
- Lists, searches, and sorts an account’s email allow policies.
+ """Returns a paginated list of email allow policies.
+
+ These policies exempt matching
+ emails from security detection, allowing them to bypass disposition actions.
+ Supports filtering by pattern type and policy attributes.
Args:
- account_id: Account Identifier
+ account_id: Identifier.
direction: The sorting direction.
- order: The field to sort by.
+ is_acceptable_sender: Filter to show only policies where messages from the sender are exempted from
+ Spam, Spoof, and Bulk dispositions (not Malicious or Suspicious).
+
+ is_exempt_recipient: Filter to show only policies where messages to the recipient bypass all
+ detections.
+
+ is_trusted_sender: Filter to show only policies where messages from the sender bypass all
+ detections and link following.
- page: The page number of paginated results.
+ order: Field to sort by.
- per_page: The number of results per page.
+ page: Current page within paginated list of results.
- search: Allows searching in multiple properties of a record simultaneously. This
- parameter is intended for human users, not automation. Its exact behavior is
- intentionally left unspecified and is subject to change in the future.
+ pattern_type: Type of pattern matching. Note: UNKNOWN is deprecated and cannot be used when
+ creating or updating policies, but may be returned for existing entries.
+
+ per_page: The number of results per page. Maximum value is 1000.
+
+ search: Search term for filtering records. Behavior may change.
+
+ verify_sender: Filter to show only policies that enforce DMARC, SPF, or DKIM authentication.
extra_headers: Send extra headers
@@ -555,9 +638,6 @@ def list(
"direction": direction,
"is_acceptable_sender": is_acceptable_sender,
"is_exempt_recipient": is_exempt_recipient,
- "is_recipient": is_recipient,
- "is_sender": is_sender,
- "is_spoof": is_spoof,
"is_trusted_sender": is_trusted_sender,
"order": order,
"page": page,
@@ -575,7 +655,7 @@ def list(
async def delete(
self,
- policy_id: int,
+ policy_id: str,
*,
account_id: str,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
@@ -584,16 +664,16 @@ async def delete(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
- ) -> AllowPolicyDeleteResponse:
- """Removes an email allow policy.
+ ) -> Optional[AllowPolicyDeleteResponse]:
+ """Removes an allow policy.
- Previously allowed senders will be subject to
- normal security scanning.
+ After deletion, emails matching this pattern will be
+ subject to normal security scanning and disposition actions.
Args:
- account_id: Account Identifier
+ account_id: Identifier.
- policy_id: The unique identifier for the allow policy.
+ policy_id: Allow policy identifier
extra_headers: Send extra headers
@@ -605,6 +685,8 @@ async def delete(
"""
if not account_id:
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
+ if not policy_id:
+ raise ValueError(f"Expected a non-empty value for `policy_id` but received {policy_id!r}")
return await self._delete(
path_template(
"/accounts/{account_id}/email-security/settings/allow_policies/{policy_id}",
@@ -616,47 +698,66 @@ async def delete(
extra_query=extra_query,
extra_body=extra_body,
timeout=timeout,
- post_parser=ResultWrapper[AllowPolicyDeleteResponse]._unwrapper,
+ post_parser=ResultWrapper[Optional[AllowPolicyDeleteResponse]]._unwrapper,
),
- cast_to=cast(Type[AllowPolicyDeleteResponse], ResultWrapper[AllowPolicyDeleteResponse]),
+ cast_to=cast(Type[Optional[AllowPolicyDeleteResponse]], ResultWrapper[AllowPolicyDeleteResponse]),
)
async def edit(
self,
- policy_id: int,
+ policy_id: str,
*,
account_id: str,
comments: Optional[str] | Omit = omit,
- is_acceptable_sender: Optional[bool] | Omit = omit,
- is_exempt_recipient: Optional[bool] | Omit = omit,
- is_regex: Optional[bool] | Omit = omit,
- is_trusted_sender: Optional[bool] | Omit = omit,
- pattern: Optional[str] | Omit = omit,
- pattern_type: Optional[Literal["EMAIL", "DOMAIN", "IP", "UNKNOWN"]] | Omit = omit,
- verify_sender: Optional[bool] | Omit = omit,
+ is_acceptable_sender: bool | Omit = omit,
+ is_exempt_recipient: bool | Omit = omit,
+ is_recipient: bool | Omit = omit,
+ is_regex: bool | Omit = omit,
+ is_sender: bool | Omit = omit,
+ is_spoof: bool | Omit = omit,
+ is_trusted_sender: bool | Omit = omit,
+ pattern: str | Omit = omit,
+ pattern_type: Literal["EMAIL", "DOMAIN", "IP", "UNKNOWN"] | Omit = omit,
+ verify_sender: bool | Omit = omit,
# 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,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
- ) -> AllowPolicyEditResponse:
- """
- Updates an existing email allow policy, modifying its matching criteria or
- scope.
+ ) -> Optional[AllowPolicyEditResponse]:
+ """Updates an existing allow policy.
+
+ Only provided fields will be modified. Changes
+ take effect for new emails matching the pattern.
Args:
- account_id: Account Identifier
+ account_id: Identifier.
- policy_id: The unique identifier for the allow policy.
+ policy_id: Allow policy identifier
is_acceptable_sender: Messages from this sender will be exempted from Spam, Spoof and Bulk
- dispositions. Note: This will not exempt messages with Malicious or Suspicious
+ dispositions. Note - This will not exempt messages with Malicious or Suspicious
dispositions.
- is_exempt_recipient: Messages to this recipient will bypass all detections.
+ is_exempt_recipient: Messages to this recipient will bypass all detections
+
+ is_recipient:
+ Deprecated as of July 1, 2025. Use `is_exempt_recipient` instead. End of life:
+ July 1, 2026.
+
+ is_sender:
+ Deprecated as of July 1, 2025. Use `is_trusted_sender` instead. End of life:
+ July 1, 2026.
+
+ is_spoof:
+ Deprecated as of July 1, 2025. Use `is_acceptable_sender` instead. End of life:
+ July 1, 2026.
- is_trusted_sender: Messages from this sender will bypass all detections and link following.
+ is_trusted_sender: Messages from this sender will bypass all detections and link following
+
+ pattern_type: Type of pattern matching. Note: UNKNOWN is deprecated and cannot be used when
+ creating or updating policies, but may be returned for existing entries.
verify_sender: Enforce DMARC, SPF or DKIM authentication. When on, Email Security only honors
policies that pass authentication.
@@ -671,6 +772,8 @@ async def edit(
"""
if not account_id:
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
+ if not policy_id:
+ raise ValueError(f"Expected a non-empty value for `policy_id` but received {policy_id!r}")
return await self._patch(
path_template(
"/accounts/{account_id}/email-security/settings/allow_policies/{policy_id}",
@@ -682,7 +785,10 @@ async def edit(
"comments": comments,
"is_acceptable_sender": is_acceptable_sender,
"is_exempt_recipient": is_exempt_recipient,
+ "is_recipient": is_recipient,
"is_regex": is_regex,
+ "is_sender": is_sender,
+ "is_spoof": is_spoof,
"is_trusted_sender": is_trusted_sender,
"pattern": pattern,
"pattern_type": pattern_type,
@@ -695,14 +801,14 @@ async def edit(
extra_query=extra_query,
extra_body=extra_body,
timeout=timeout,
- post_parser=ResultWrapper[AllowPolicyEditResponse]._unwrapper,
+ post_parser=ResultWrapper[Optional[AllowPolicyEditResponse]]._unwrapper,
),
- cast_to=cast(Type[AllowPolicyEditResponse], ResultWrapper[AllowPolicyEditResponse]),
+ cast_to=cast(Type[Optional[AllowPolicyEditResponse]], ResultWrapper[AllowPolicyEditResponse]),
)
async def get(
self,
- policy_id: int,
+ policy_id: str,
*,
account_id: str,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
@@ -711,15 +817,15 @@ async def get(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
- ) -> AllowPolicyGetResponse:
+ ) -> Optional[AllowPolicyGetResponse]:
"""
- Retrieves details for a specific email allow policy, including its matching
- criteria and scope.
+ Retrieves details for a specific allow policy including its pattern,
+ dispositions that are exempted, and whether it applies to all detections.
Args:
- account_id: Account Identifier
+ account_id: Identifier.
- policy_id: The unique identifier for the allow policy.
+ policy_id: Allow policy identifier
extra_headers: Send extra headers
@@ -731,6 +837,8 @@ async def get(
"""
if not account_id:
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
+ if not policy_id:
+ raise ValueError(f"Expected a non-empty value for `policy_id` but received {policy_id!r}")
return await self._get(
path_template(
"/accounts/{account_id}/email-security/settings/allow_policies/{policy_id}",
@@ -742,9 +850,9 @@ async def get(
extra_query=extra_query,
extra_body=extra_body,
timeout=timeout,
- post_parser=ResultWrapper[AllowPolicyGetResponse]._unwrapper,
+ post_parser=ResultWrapper[Optional[AllowPolicyGetResponse]]._unwrapper,
),
- cast_to=cast(Type[AllowPolicyGetResponse], ResultWrapper[AllowPolicyGetResponse]),
+ cast_to=cast(Type[Optional[AllowPolicyGetResponse]], ResultWrapper[AllowPolicyGetResponse]),
)
diff --git a/src/cloudflare/resources/email_security/settings/block_senders.py b/src/cloudflare/resources/email_security/settings/block_senders.py
index 9f22d1a96a5..b0c57670eac 100644
--- a/src/cloudflare/resources/email_security/settings/block_senders.py
+++ b/src/cloudflare/resources/email_security/settings/block_senders.py
@@ -68,13 +68,18 @@ def create(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
- ) -> BlockSenderCreateResponse:
- """
- Adds a sender pattern to the email block list, preventing messages from matching
- senders from being delivered.
+ ) -> Optional[BlockSenderCreateResponse]:
+ """Creates a new blocked sender pattern.
+
+ Emails matching this pattern will be
+ blocked from delivery. Patterns can be email addresses, domains, or IP
+ addresses, and support regular expressions.
Args:
- account_id: Account Identifier
+ account_id: Identifier.
+
+ pattern_type: Type of pattern matching. Note: UNKNOWN is deprecated and cannot be used when
+ creating or updating policies, but may be returned for existing entries.
extra_headers: Send extra headers
@@ -102,9 +107,9 @@ def create(
extra_query=extra_query,
extra_body=extra_body,
timeout=timeout,
- post_parser=ResultWrapper[BlockSenderCreateResponse]._unwrapper,
+ post_parser=ResultWrapper[Optional[BlockSenderCreateResponse]]._unwrapper,
),
- cast_to=cast(Type[BlockSenderCreateResponse], ResultWrapper[BlockSenderCreateResponse]),
+ cast_to=cast(Type[Optional[BlockSenderCreateResponse]], ResultWrapper[BlockSenderCreateResponse]),
)
def list(
@@ -125,23 +130,28 @@ def list(
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> SyncV4PagePaginationArray[BlockSenderListResponse]:
- """
- Lists all blocked sender entries with their patterns and block reasons.
+ """Returns a paginated list of blocked email sender patterns.
+
+ These patterns
+ prevent emails from matching senders from being delivered. Supports filtering by
+ pattern type and searching across patterns.
Args:
- account_id: Account Identifier
+ account_id: Identifier.
direction: The sorting direction.
- order: The field to sort by.
+ order: Field to sort by.
+
+ page: Current page within paginated list of results.
+
+ pattern: Filter by pattern value.
- page: The page number of paginated results.
+ pattern_type: Filter by pattern type.
- per_page: The number of results per page.
+ per_page: The number of results per page. Maximum value is 1000.
- search: Allows searching in multiple properties of a record simultaneously. This
- parameter is intended for human users, not automation. Its exact behavior is
- intentionally left unspecified and is subject to change in the future.
+ search: Search term for filtering records. Behavior may change.
extra_headers: Send extra headers
@@ -179,7 +189,7 @@ def list(
def delete(
self,
- pattern_id: int,
+ pattern_id: str,
*,
account_id: str,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
@@ -188,15 +198,16 @@ def delete(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
- ) -> BlockSenderDeleteResponse:
- """
- Removes a sender from the email block list, allowing their messages to be
- delivered normally.
+ ) -> Optional[BlockSenderDeleteResponse]:
+ """Removes a blocked sender pattern.
+
+ After deletion, emails from this sender will
+ no longer be automatically blocked based on this rule.
Args:
- account_id: Account Identifier
+ account_id: Identifier.
- pattern_id: The unique identifier for the allow policy.
+ pattern_id: Blocked sender pattern identifier
extra_headers: Send extra headers
@@ -208,6 +219,8 @@ def delete(
"""
if not account_id:
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
+ if not pattern_id:
+ raise ValueError(f"Expected a non-empty value for `pattern_id` but received {pattern_id!r}")
return self._delete(
path_template(
"/accounts/{account_id}/email-security/settings/block_senders/{pattern_id}",
@@ -219,34 +232,39 @@ def delete(
extra_query=extra_query,
extra_body=extra_body,
timeout=timeout,
- post_parser=ResultWrapper[BlockSenderDeleteResponse]._unwrapper,
+ post_parser=ResultWrapper[Optional[BlockSenderDeleteResponse]]._unwrapper,
),
- cast_to=cast(Type[BlockSenderDeleteResponse], ResultWrapper[BlockSenderDeleteResponse]),
+ cast_to=cast(Type[Optional[BlockSenderDeleteResponse]], ResultWrapper[BlockSenderDeleteResponse]),
)
def edit(
self,
- pattern_id: int,
+ pattern_id: str,
*,
account_id: str,
comments: Optional[str] | Omit = omit,
- is_regex: Optional[bool] | Omit = omit,
- pattern: Optional[str] | Omit = omit,
- pattern_type: Optional[Literal["EMAIL", "DOMAIN", "IP", "UNKNOWN"]] | Omit = omit,
+ is_regex: bool | Omit = omit,
+ pattern: str | Omit = omit,
+ pattern_type: Literal["EMAIL", "DOMAIN", "IP", "UNKNOWN"] | Omit = omit,
# 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,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
- ) -> BlockSenderEditResponse:
- """
- Modifies a blocked sender entry, updating its pattern or block reason.
+ ) -> Optional[BlockSenderEditResponse]:
+ """Updates an existing blocked sender pattern.
+
+ Only provided fields will be
+ modified. The pattern will continue blocking emails until deleted.
Args:
- account_id: Account Identifier
+ account_id: Identifier.
+
+ pattern_id: Blocked sender pattern identifier
- pattern_id: The unique identifier for the allow policy.
+ pattern_type: Type of pattern matching. Note: UNKNOWN is deprecated and cannot be used when
+ creating or updating policies, but may be returned for existing entries.
extra_headers: Send extra headers
@@ -258,6 +276,8 @@ def edit(
"""
if not account_id:
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
+ if not pattern_id:
+ raise ValueError(f"Expected a non-empty value for `pattern_id` but received {pattern_id!r}")
return self._patch(
path_template(
"/accounts/{account_id}/email-security/settings/block_senders/{pattern_id}",
@@ -278,14 +298,14 @@ def edit(
extra_query=extra_query,
extra_body=extra_body,
timeout=timeout,
- post_parser=ResultWrapper[BlockSenderEditResponse]._unwrapper,
+ post_parser=ResultWrapper[Optional[BlockSenderEditResponse]]._unwrapper,
),
- cast_to=cast(Type[BlockSenderEditResponse], ResultWrapper[BlockSenderEditResponse]),
+ cast_to=cast(Type[Optional[BlockSenderEditResponse]], ResultWrapper[BlockSenderEditResponse]),
)
def get(
self,
- pattern_id: int,
+ pattern_id: str,
*,
account_id: str,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
@@ -294,15 +314,15 @@ def get(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
- ) -> BlockSenderGetResponse:
+ ) -> Optional[BlockSenderGetResponse]:
"""
- Gets information about a specific blocked sender entry, including the pattern
- and block reason.
+ Retrieves details for a specific blocked sender pattern including its pattern
+ type, value, and metadata.
Args:
- account_id: Account Identifier
+ account_id: Identifier.
- pattern_id: The unique identifier for the allow policy.
+ pattern_id: Blocked sender pattern identifier
extra_headers: Send extra headers
@@ -314,6 +334,8 @@ def get(
"""
if not account_id:
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
+ if not pattern_id:
+ raise ValueError(f"Expected a non-empty value for `pattern_id` but received {pattern_id!r}")
return self._get(
path_template(
"/accounts/{account_id}/email-security/settings/block_senders/{pattern_id}",
@@ -325,9 +347,9 @@ def get(
extra_query=extra_query,
extra_body=extra_body,
timeout=timeout,
- post_parser=ResultWrapper[BlockSenderGetResponse]._unwrapper,
+ post_parser=ResultWrapper[Optional[BlockSenderGetResponse]]._unwrapper,
),
- cast_to=cast(Type[BlockSenderGetResponse], ResultWrapper[BlockSenderGetResponse]),
+ cast_to=cast(Type[Optional[BlockSenderGetResponse]], ResultWrapper[BlockSenderGetResponse]),
)
@@ -365,13 +387,18 @@ async def create(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
- ) -> BlockSenderCreateResponse:
- """
- Adds a sender pattern to the email block list, preventing messages from matching
- senders from being delivered.
+ ) -> Optional[BlockSenderCreateResponse]:
+ """Creates a new blocked sender pattern.
+
+ Emails matching this pattern will be
+ blocked from delivery. Patterns can be email addresses, domains, or IP
+ addresses, and support regular expressions.
Args:
- account_id: Account Identifier
+ account_id: Identifier.
+
+ pattern_type: Type of pattern matching. Note: UNKNOWN is deprecated and cannot be used when
+ creating or updating policies, but may be returned for existing entries.
extra_headers: Send extra headers
@@ -399,9 +426,9 @@ async def create(
extra_query=extra_query,
extra_body=extra_body,
timeout=timeout,
- post_parser=ResultWrapper[BlockSenderCreateResponse]._unwrapper,
+ post_parser=ResultWrapper[Optional[BlockSenderCreateResponse]]._unwrapper,
),
- cast_to=cast(Type[BlockSenderCreateResponse], ResultWrapper[BlockSenderCreateResponse]),
+ cast_to=cast(Type[Optional[BlockSenderCreateResponse]], ResultWrapper[BlockSenderCreateResponse]),
)
def list(
@@ -422,23 +449,28 @@ def list(
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> AsyncPaginator[BlockSenderListResponse, AsyncV4PagePaginationArray[BlockSenderListResponse]]:
- """
- Lists all blocked sender entries with their patterns and block reasons.
+ """Returns a paginated list of blocked email sender patterns.
+
+ These patterns
+ prevent emails from matching senders from being delivered. Supports filtering by
+ pattern type and searching across patterns.
Args:
- account_id: Account Identifier
+ account_id: Identifier.
direction: The sorting direction.
- order: The field to sort by.
+ order: Field to sort by.
+
+ page: Current page within paginated list of results.
+
+ pattern: Filter by pattern value.
- page: The page number of paginated results.
+ pattern_type: Filter by pattern type.
- per_page: The number of results per page.
+ per_page: The number of results per page. Maximum value is 1000.
- search: Allows searching in multiple properties of a record simultaneously. This
- parameter is intended for human users, not automation. Its exact behavior is
- intentionally left unspecified and is subject to change in the future.
+ search: Search term for filtering records. Behavior may change.
extra_headers: Send extra headers
@@ -476,7 +508,7 @@ def list(
async def delete(
self,
- pattern_id: int,
+ pattern_id: str,
*,
account_id: str,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
@@ -485,15 +517,16 @@ async def delete(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
- ) -> BlockSenderDeleteResponse:
- """
- Removes a sender from the email block list, allowing their messages to be
- delivered normally.
+ ) -> Optional[BlockSenderDeleteResponse]:
+ """Removes a blocked sender pattern.
+
+ After deletion, emails from this sender will
+ no longer be automatically blocked based on this rule.
Args:
- account_id: Account Identifier
+ account_id: Identifier.
- pattern_id: The unique identifier for the allow policy.
+ pattern_id: Blocked sender pattern identifier
extra_headers: Send extra headers
@@ -505,6 +538,8 @@ async def delete(
"""
if not account_id:
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
+ if not pattern_id:
+ raise ValueError(f"Expected a non-empty value for `pattern_id` but received {pattern_id!r}")
return await self._delete(
path_template(
"/accounts/{account_id}/email-security/settings/block_senders/{pattern_id}",
@@ -516,34 +551,39 @@ async def delete(
extra_query=extra_query,
extra_body=extra_body,
timeout=timeout,
- post_parser=ResultWrapper[BlockSenderDeleteResponse]._unwrapper,
+ post_parser=ResultWrapper[Optional[BlockSenderDeleteResponse]]._unwrapper,
),
- cast_to=cast(Type[BlockSenderDeleteResponse], ResultWrapper[BlockSenderDeleteResponse]),
+ cast_to=cast(Type[Optional[BlockSenderDeleteResponse]], ResultWrapper[BlockSenderDeleteResponse]),
)
async def edit(
self,
- pattern_id: int,
+ pattern_id: str,
*,
account_id: str,
comments: Optional[str] | Omit = omit,
- is_regex: Optional[bool] | Omit = omit,
- pattern: Optional[str] | Omit = omit,
- pattern_type: Optional[Literal["EMAIL", "DOMAIN", "IP", "UNKNOWN"]] | Omit = omit,
+ is_regex: bool | Omit = omit,
+ pattern: str | Omit = omit,
+ pattern_type: Literal["EMAIL", "DOMAIN", "IP", "UNKNOWN"] | Omit = omit,
# 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,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
- ) -> BlockSenderEditResponse:
- """
- Modifies a blocked sender entry, updating its pattern or block reason.
+ ) -> Optional[BlockSenderEditResponse]:
+ """Updates an existing blocked sender pattern.
+
+ Only provided fields will be
+ modified. The pattern will continue blocking emails until deleted.
Args:
- account_id: Account Identifier
+ account_id: Identifier.
+
+ pattern_id: Blocked sender pattern identifier
- pattern_id: The unique identifier for the allow policy.
+ pattern_type: Type of pattern matching. Note: UNKNOWN is deprecated and cannot be used when
+ creating or updating policies, but may be returned for existing entries.
extra_headers: Send extra headers
@@ -555,6 +595,8 @@ async def edit(
"""
if not account_id:
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
+ if not pattern_id:
+ raise ValueError(f"Expected a non-empty value for `pattern_id` but received {pattern_id!r}")
return await self._patch(
path_template(
"/accounts/{account_id}/email-security/settings/block_senders/{pattern_id}",
@@ -575,14 +617,14 @@ async def edit(
extra_query=extra_query,
extra_body=extra_body,
timeout=timeout,
- post_parser=ResultWrapper[BlockSenderEditResponse]._unwrapper,
+ post_parser=ResultWrapper[Optional[BlockSenderEditResponse]]._unwrapper,
),
- cast_to=cast(Type[BlockSenderEditResponse], ResultWrapper[BlockSenderEditResponse]),
+ cast_to=cast(Type[Optional[BlockSenderEditResponse]], ResultWrapper[BlockSenderEditResponse]),
)
async def get(
self,
- pattern_id: int,
+ pattern_id: str,
*,
account_id: str,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
@@ -591,15 +633,15 @@ async def get(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
- ) -> BlockSenderGetResponse:
+ ) -> Optional[BlockSenderGetResponse]:
"""
- Gets information about a specific blocked sender entry, including the pattern
- and block reason.
+ Retrieves details for a specific blocked sender pattern including its pattern
+ type, value, and metadata.
Args:
- account_id: Account Identifier
+ account_id: Identifier.
- pattern_id: The unique identifier for the allow policy.
+ pattern_id: Blocked sender pattern identifier
extra_headers: Send extra headers
@@ -611,6 +653,8 @@ async def get(
"""
if not account_id:
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
+ if not pattern_id:
+ raise ValueError(f"Expected a non-empty value for `pattern_id` but received {pattern_id!r}")
return await self._get(
path_template(
"/accounts/{account_id}/email-security/settings/block_senders/{pattern_id}",
@@ -622,9 +666,9 @@ async def get(
extra_query=extra_query,
extra_body=extra_body,
timeout=timeout,
- post_parser=ResultWrapper[BlockSenderGetResponse]._unwrapper,
+ post_parser=ResultWrapper[Optional[BlockSenderGetResponse]]._unwrapper,
),
- cast_to=cast(Type[BlockSenderGetResponse], ResultWrapper[BlockSenderGetResponse]),
+ cast_to=cast(Type[Optional[BlockSenderGetResponse]], ResultWrapper[BlockSenderGetResponse]),
)
diff --git a/src/cloudflare/resources/email_security/settings/domains.py b/src/cloudflare/resources/email_security/settings/domains.py
index 46628f5da7a..c8ca2d9854a 100644
--- a/src/cloudflare/resources/email_security/settings/domains.py
+++ b/src/cloudflare/resources/email_security/settings/domains.py
@@ -2,7 +2,7 @@
from __future__ import annotations
-from typing import List, Type, cast
+from typing import List, Type, Optional, cast
from typing_extensions import Literal
import httpx
@@ -18,14 +18,13 @@
async_to_streamed_response_wrapper,
)
from ...._wrappers import ResultWrapper
-from ....pagination import SyncSinglePage, AsyncSinglePage, SyncV4PagePaginationArray, AsyncV4PagePaginationArray
+from ....pagination import SyncV4PagePaginationArray, AsyncV4PagePaginationArray
from ...._base_client import AsyncPaginator, make_request_options
from ....types.email_security.settings import domain_edit_params, domain_list_params
from ....types.email_security.settings.domain_get_response import DomainGetResponse
from ....types.email_security.settings.domain_edit_response import DomainEditResponse
from ....types.email_security.settings.domain_list_response import DomainListResponse
from ....types.email_security.settings.domain_delete_response import DomainDeleteResponse
-from ....types.email_security.settings.domain_bulk_delete_response import DomainBulkDeleteResponse
__all__ = ["DomainsResource", "AsyncDomainsResource"]
@@ -63,6 +62,7 @@ def list(
page: int | Omit = omit,
per_page: int | Omit = omit,
search: str | Omit = omit,
+ status: Literal["pending", "active", "failed", "timeout"] | Omit = omit,
# 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,
@@ -70,31 +70,34 @@ def list(
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> SyncV4PagePaginationArray[DomainListResponse]:
- """
- Lists, searches, and sorts an account’s email domains.
+ """Returns a paginated list of email domains protected by Email Security.
+
+ Includes
+ domain configuration, delivery modes, and authorization status. Supports
+ filtering by delivery mode and integration ID.
Args:
- account_id: Account Identifier
+ account_id: Identifier.
- active_delivery_mode: Filters response to domains with the currently active delivery mode.
+ active_delivery_mode: Currently active delivery mode to filter by.
- allowed_delivery_mode: Filters response to domains with the provided delivery mode.
+ allowed_delivery_mode: Delivery mode to filter by.
direction: The sorting direction.
- domain: Filters results by the provided domains, allowing for multiple occurrences.
+ domain: Domain names to filter by.
+
+ integration_id: Integration ID to filter by.
- integration_id: Filters response to domains with the provided integration ID.
+ order: Field to sort by.
- order: The field to sort by.
+ page: Current page within paginated list of results.
- page: The page number of paginated results.
+ per_page: The number of results per page. Maximum value is 1000.
- per_page: The number of results per page.
+ search: Search term for filtering records. Behavior may change.
- search: Allows searching in multiple properties of a record simultaneously. This
- parameter is intended for human users, not automation. Its exact behavior is
- intentionally left unspecified and is subject to change in the future.
+ status: Filters response to domains with the provided status.
extra_headers: Send extra headers
@@ -125,6 +128,7 @@ def list(
"page": page,
"per_page": per_page,
"search": search,
+ "status": status,
},
domain_list_params.DomainListParams,
),
@@ -134,7 +138,7 @@ def list(
def delete(
self,
- domain_id: int,
+ domain_id: str,
*,
account_id: str,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
@@ -143,14 +147,17 @@ def delete(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
- ) -> DomainDeleteResponse:
- """
- Unprotect an email domain
+ ) -> Optional[DomainDeleteResponse]:
+ """Removes email security protection from a domain.
+
+ After deletion, emails for this
+ domain will no longer be processed by Email Security. This action cannot be
+ undone.
Args:
- account_id: Account Identifier
+ account_id: Identifier.
- domain_id: The unique identifier for the domain.
+ domain_id: Domain identifier
extra_headers: Send extra headers
@@ -162,6 +169,8 @@ def delete(
"""
if not account_id:
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
+ if not domain_id:
+ raise ValueError(f"Expected a non-empty value for `domain_id` but received {domain_id!r}")
return self._delete(
path_template(
"/accounts/{account_id}/email-security/settings/domains/{domain_id}",
@@ -173,55 +182,16 @@ def delete(
extra_query=extra_query,
extra_body=extra_body,
timeout=timeout,
- post_parser=ResultWrapper[DomainDeleteResponse]._unwrapper,
+ post_parser=ResultWrapper[Optional[DomainDeleteResponse]]._unwrapper,
),
- cast_to=cast(Type[DomainDeleteResponse], ResultWrapper[DomainDeleteResponse]),
- )
-
- def bulk_delete(
- self,
- *,
- account_id: str,
- # 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,
- extra_query: Query | None = None,
- extra_body: Body | None = None,
- timeout: float | httpx.Timeout | None | NotGiven = not_given,
- ) -> SyncSinglePage[DomainBulkDeleteResponse]:
- """
- Bulk removes multiple domains from email security configuration in a single
- request.
-
- Args:
- account_id: Account Identifier
-
- extra_headers: Send extra headers
-
- extra_query: Add additional query parameters to the request
-
- extra_body: Add additional JSON properties to the request
-
- timeout: Override the client-level default timeout for this request, in seconds
- """
- if not account_id:
- raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
- return self._get_api_list(
- path_template("/accounts/{account_id}/email-security/settings/domains", account_id=account_id),
- page=SyncSinglePage[DomainBulkDeleteResponse],
- options=make_request_options(
- extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
- ),
- model=DomainBulkDeleteResponse,
- method="delete",
+ cast_to=cast(Type[Optional[DomainDeleteResponse]], ResultWrapper[DomainDeleteResponse]),
)
def edit(
self,
- domain_id: int,
+ domain_id: str,
*,
account_id: str,
- ip_restrictions: SequenceNotStr[str],
allowed_delivery_modes: List[Literal["DIRECT", "BCC", "JOURNAL", "API", "RETRO_SCAN"]] | Omit = omit,
domain: str | Omit = omit,
drop_dispositions: List[
@@ -240,7 +210,8 @@ def edit(
]
| Omit = omit,
folder: Literal["AllItems", "Inbox"] | Omit = omit,
- integration_id: str | Omit = omit,
+ integration_id: Optional[str] | Omit = omit,
+ ip_restrictions: SequenceNotStr[str] | Omit = omit,
lookback_hops: int | Omit = omit,
regions: List[Literal["GLOBAL", "AU", "DE", "IN", "US"]] | Omit = omit,
require_tls_inbound: bool | Omit = omit,
@@ -252,14 +223,17 @@ def edit(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
- ) -> DomainEditResponse:
- """
- Updates configuration for a domain in email security.
+ ) -> Optional[DomainEditResponse]:
+ """Updates configuration for a protected email domain.
+
+ Only provided fields will be
+ modified. Changes affect delivery mode, security settings, and regional
+ processing.
Args:
- account_id: Account Identifier
+ account_id: Identifier.
- domain_id: The unique identifier for the domain.
+ domain_id: Domain identifier
extra_headers: Send extra headers
@@ -271,6 +245,8 @@ def edit(
"""
if not account_id:
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
+ if not domain_id:
+ raise ValueError(f"Expected a non-empty value for `domain_id` but received {domain_id!r}")
return self._patch(
path_template(
"/accounts/{account_id}/email-security/settings/domains/{domain_id}",
@@ -279,12 +255,12 @@ def edit(
),
body=maybe_transform(
{
- "ip_restrictions": ip_restrictions,
"allowed_delivery_modes": allowed_delivery_modes,
"domain": domain,
"drop_dispositions": drop_dispositions,
"folder": folder,
"integration_id": integration_id,
+ "ip_restrictions": ip_restrictions,
"lookback_hops": lookback_hops,
"regions": regions,
"require_tls_inbound": require_tls_inbound,
@@ -298,14 +274,14 @@ def edit(
extra_query=extra_query,
extra_body=extra_body,
timeout=timeout,
- post_parser=ResultWrapper[DomainEditResponse]._unwrapper,
+ post_parser=ResultWrapper[Optional[DomainEditResponse]]._unwrapper,
),
- cast_to=cast(Type[DomainEditResponse], ResultWrapper[DomainEditResponse]),
+ cast_to=cast(Type[Optional[DomainEditResponse]], ResultWrapper[DomainEditResponse]),
)
def get(
self,
- domain_id: int,
+ domain_id: str,
*,
account_id: str,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
@@ -314,14 +290,15 @@ def get(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
- ) -> DomainGetResponse:
+ ) -> Optional[DomainGetResponse]:
"""
- Gets configuration details for a specific domain in email security.
+ Retrieves detailed information for a specific protected email domain including
+ its delivery configuration, SPF/DMARC status, and authorization state.
Args:
- account_id: Account Identifier
+ account_id: Identifier.
- domain_id: The unique identifier for the domain.
+ domain_id: Domain identifier
extra_headers: Send extra headers
@@ -333,6 +310,8 @@ def get(
"""
if not account_id:
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
+ if not domain_id:
+ raise ValueError(f"Expected a non-empty value for `domain_id` but received {domain_id!r}")
return self._get(
path_template(
"/accounts/{account_id}/email-security/settings/domains/{domain_id}",
@@ -344,9 +323,9 @@ def get(
extra_query=extra_query,
extra_body=extra_body,
timeout=timeout,
- post_parser=ResultWrapper[DomainGetResponse]._unwrapper,
+ post_parser=ResultWrapper[Optional[DomainGetResponse]]._unwrapper,
),
- cast_to=cast(Type[DomainGetResponse], ResultWrapper[DomainGetResponse]),
+ cast_to=cast(Type[Optional[DomainGetResponse]], ResultWrapper[DomainGetResponse]),
)
@@ -383,6 +362,7 @@ def list(
page: int | Omit = omit,
per_page: int | Omit = omit,
search: str | Omit = omit,
+ status: Literal["pending", "active", "failed", "timeout"] | Omit = omit,
# 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,
@@ -390,31 +370,34 @@ def list(
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> AsyncPaginator[DomainListResponse, AsyncV4PagePaginationArray[DomainListResponse]]:
- """
- Lists, searches, and sorts an account’s email domains.
+ """Returns a paginated list of email domains protected by Email Security.
+
+ Includes
+ domain configuration, delivery modes, and authorization status. Supports
+ filtering by delivery mode and integration ID.
Args:
- account_id: Account Identifier
+ account_id: Identifier.
- active_delivery_mode: Filters response to domains with the currently active delivery mode.
+ active_delivery_mode: Currently active delivery mode to filter by.
- allowed_delivery_mode: Filters response to domains with the provided delivery mode.
+ allowed_delivery_mode: Delivery mode to filter by.
direction: The sorting direction.
- domain: Filters results by the provided domains, allowing for multiple occurrences.
+ domain: Domain names to filter by.
- integration_id: Filters response to domains with the provided integration ID.
+ integration_id: Integration ID to filter by.
- order: The field to sort by.
+ order: Field to sort by.
- page: The page number of paginated results.
+ page: Current page within paginated list of results.
- per_page: The number of results per page.
+ per_page: The number of results per page. Maximum value is 1000.
- search: Allows searching in multiple properties of a record simultaneously. This
- parameter is intended for human users, not automation. Its exact behavior is
- intentionally left unspecified and is subject to change in the future.
+ search: Search term for filtering records. Behavior may change.
+
+ status: Filters response to domains with the provided status.
extra_headers: Send extra headers
@@ -445,6 +428,7 @@ def list(
"page": page,
"per_page": per_page,
"search": search,
+ "status": status,
},
domain_list_params.DomainListParams,
),
@@ -454,7 +438,7 @@ def list(
async def delete(
self,
- domain_id: int,
+ domain_id: str,
*,
account_id: str,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
@@ -463,14 +447,17 @@ async def delete(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
- ) -> DomainDeleteResponse:
- """
- Unprotect an email domain
+ ) -> Optional[DomainDeleteResponse]:
+ """Removes email security protection from a domain.
+
+ After deletion, emails for this
+ domain will no longer be processed by Email Security. This action cannot be
+ undone.
Args:
- account_id: Account Identifier
+ account_id: Identifier.
- domain_id: The unique identifier for the domain.
+ domain_id: Domain identifier
extra_headers: Send extra headers
@@ -482,6 +469,8 @@ async def delete(
"""
if not account_id:
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
+ if not domain_id:
+ raise ValueError(f"Expected a non-empty value for `domain_id` but received {domain_id!r}")
return await self._delete(
path_template(
"/accounts/{account_id}/email-security/settings/domains/{domain_id}",
@@ -493,55 +482,16 @@ async def delete(
extra_query=extra_query,
extra_body=extra_body,
timeout=timeout,
- post_parser=ResultWrapper[DomainDeleteResponse]._unwrapper,
+ post_parser=ResultWrapper[Optional[DomainDeleteResponse]]._unwrapper,
),
- cast_to=cast(Type[DomainDeleteResponse], ResultWrapper[DomainDeleteResponse]),
- )
-
- def bulk_delete(
- self,
- *,
- account_id: str,
- # 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,
- extra_query: Query | None = None,
- extra_body: Body | None = None,
- timeout: float | httpx.Timeout | None | NotGiven = not_given,
- ) -> AsyncPaginator[DomainBulkDeleteResponse, AsyncSinglePage[DomainBulkDeleteResponse]]:
- """
- Bulk removes multiple domains from email security configuration in a single
- request.
-
- Args:
- account_id: Account Identifier
-
- extra_headers: Send extra headers
-
- extra_query: Add additional query parameters to the request
-
- extra_body: Add additional JSON properties to the request
-
- timeout: Override the client-level default timeout for this request, in seconds
- """
- if not account_id:
- raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
- return self._get_api_list(
- path_template("/accounts/{account_id}/email-security/settings/domains", account_id=account_id),
- page=AsyncSinglePage[DomainBulkDeleteResponse],
- options=make_request_options(
- extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
- ),
- model=DomainBulkDeleteResponse,
- method="delete",
+ cast_to=cast(Type[Optional[DomainDeleteResponse]], ResultWrapper[DomainDeleteResponse]),
)
async def edit(
self,
- domain_id: int,
+ domain_id: str,
*,
account_id: str,
- ip_restrictions: SequenceNotStr[str],
allowed_delivery_modes: List[Literal["DIRECT", "BCC", "JOURNAL", "API", "RETRO_SCAN"]] | Omit = omit,
domain: str | Omit = omit,
drop_dispositions: List[
@@ -560,7 +510,8 @@ async def edit(
]
| Omit = omit,
folder: Literal["AllItems", "Inbox"] | Omit = omit,
- integration_id: str | Omit = omit,
+ integration_id: Optional[str] | Omit = omit,
+ ip_restrictions: SequenceNotStr[str] | Omit = omit,
lookback_hops: int | Omit = omit,
regions: List[Literal["GLOBAL", "AU", "DE", "IN", "US"]] | Omit = omit,
require_tls_inbound: bool | Omit = omit,
@@ -572,14 +523,17 @@ async def edit(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
- ) -> DomainEditResponse:
- """
- Updates configuration for a domain in email security.
+ ) -> Optional[DomainEditResponse]:
+ """Updates configuration for a protected email domain.
+
+ Only provided fields will be
+ modified. Changes affect delivery mode, security settings, and regional
+ processing.
Args:
- account_id: Account Identifier
+ account_id: Identifier.
- domain_id: The unique identifier for the domain.
+ domain_id: Domain identifier
extra_headers: Send extra headers
@@ -591,6 +545,8 @@ async def edit(
"""
if not account_id:
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
+ if not domain_id:
+ raise ValueError(f"Expected a non-empty value for `domain_id` but received {domain_id!r}")
return await self._patch(
path_template(
"/accounts/{account_id}/email-security/settings/domains/{domain_id}",
@@ -599,12 +555,12 @@ async def edit(
),
body=await async_maybe_transform(
{
- "ip_restrictions": ip_restrictions,
"allowed_delivery_modes": allowed_delivery_modes,
"domain": domain,
"drop_dispositions": drop_dispositions,
"folder": folder,
"integration_id": integration_id,
+ "ip_restrictions": ip_restrictions,
"lookback_hops": lookback_hops,
"regions": regions,
"require_tls_inbound": require_tls_inbound,
@@ -618,14 +574,14 @@ async def edit(
extra_query=extra_query,
extra_body=extra_body,
timeout=timeout,
- post_parser=ResultWrapper[DomainEditResponse]._unwrapper,
+ post_parser=ResultWrapper[Optional[DomainEditResponse]]._unwrapper,
),
- cast_to=cast(Type[DomainEditResponse], ResultWrapper[DomainEditResponse]),
+ cast_to=cast(Type[Optional[DomainEditResponse]], ResultWrapper[DomainEditResponse]),
)
async def get(
self,
- domain_id: int,
+ domain_id: str,
*,
account_id: str,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
@@ -634,14 +590,15 @@ async def get(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
- ) -> DomainGetResponse:
+ ) -> Optional[DomainGetResponse]:
"""
- Gets configuration details for a specific domain in email security.
+ Retrieves detailed information for a specific protected email domain including
+ its delivery configuration, SPF/DMARC status, and authorization state.
Args:
- account_id: Account Identifier
+ account_id: Identifier.
- domain_id: The unique identifier for the domain.
+ domain_id: Domain identifier
extra_headers: Send extra headers
@@ -653,6 +610,8 @@ async def get(
"""
if not account_id:
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
+ if not domain_id:
+ raise ValueError(f"Expected a non-empty value for `domain_id` but received {domain_id!r}")
return await self._get(
path_template(
"/accounts/{account_id}/email-security/settings/domains/{domain_id}",
@@ -664,9 +623,9 @@ async def get(
extra_query=extra_query,
extra_body=extra_body,
timeout=timeout,
- post_parser=ResultWrapper[DomainGetResponse]._unwrapper,
+ post_parser=ResultWrapper[Optional[DomainGetResponse]]._unwrapper,
),
- cast_to=cast(Type[DomainGetResponse], ResultWrapper[DomainGetResponse]),
+ cast_to=cast(Type[Optional[DomainGetResponse]], ResultWrapper[DomainGetResponse]),
)
@@ -680,9 +639,6 @@ def __init__(self, domains: DomainsResource) -> None:
self.delete = to_raw_response_wrapper(
domains.delete,
)
- self.bulk_delete = to_raw_response_wrapper(
- domains.bulk_delete,
- )
self.edit = to_raw_response_wrapper(
domains.edit,
)
@@ -701,9 +657,6 @@ def __init__(self, domains: AsyncDomainsResource) -> None:
self.delete = async_to_raw_response_wrapper(
domains.delete,
)
- self.bulk_delete = async_to_raw_response_wrapper(
- domains.bulk_delete,
- )
self.edit = async_to_raw_response_wrapper(
domains.edit,
)
@@ -722,9 +675,6 @@ def __init__(self, domains: DomainsResource) -> None:
self.delete = to_streamed_response_wrapper(
domains.delete,
)
- self.bulk_delete = to_streamed_response_wrapper(
- domains.bulk_delete,
- )
self.edit = to_streamed_response_wrapper(
domains.edit,
)
@@ -743,9 +693,6 @@ def __init__(self, domains: AsyncDomainsResource) -> None:
self.delete = async_to_streamed_response_wrapper(
domains.delete,
)
- self.bulk_delete = async_to_streamed_response_wrapper(
- domains.bulk_delete,
- )
self.edit = async_to_streamed_response_wrapper(
domains.edit,
)
diff --git a/src/cloudflare/resources/email_security/settings/impersonation_registry.py b/src/cloudflare/resources/email_security/settings/impersonation_registry.py
index cc5a887645a..15d0da3afa2 100644
--- a/src/cloudflare/resources/email_security/settings/impersonation_registry.py
+++ b/src/cloudflare/resources/email_security/settings/impersonation_registry.py
@@ -61,18 +61,26 @@ def create(
email: str,
is_email_regex: bool,
name: str,
+ comments: Optional[str] | Omit = omit,
+ directory_id: Optional[int] | Omit = omit,
+ directory_node_id: Optional[int] | Omit = omit,
+ external_directory_node_id: Optional[str] | Omit = omit,
+ provenance: Literal["A1S_INTERNAL", "SNOOPY-CASB_OFFICE_365", "SNOOPY-OFFICE_365", "SNOOPY-GOOGLE_DIRECTORY"]
+ | Omit = omit,
# 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,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
- ) -> ImpersonationRegistryCreateResponse:
+ ) -> Optional[ImpersonationRegistryCreateResponse]:
"""
- Creates a display name entry for email security impersonation protection.
+ Creates a new entry in the impersonation registry to protect against
+ impersonation. Emails attempting to impersonate this identity will be flagged.
+ Supports regex patterns for flexible email matching.
Args:
- account_id: Account Identifier
+ account_id: Identifier.
extra_headers: Send extra headers
@@ -93,6 +101,11 @@ def create(
"email": email,
"is_email_regex": is_email_regex,
"name": name,
+ "comments": comments,
+ "directory_id": directory_id,
+ "directory_node_id": directory_node_id,
+ "external_directory_node_id": external_directory_node_id,
+ "provenance": provenance,
},
impersonation_registry_create_params.ImpersonationRegistryCreateParams,
),
@@ -101,9 +114,11 @@ def create(
extra_query=extra_query,
extra_body=extra_body,
timeout=timeout,
- post_parser=ResultWrapper[ImpersonationRegistryCreateResponse]._unwrapper,
+ post_parser=ResultWrapper[Optional[ImpersonationRegistryCreateResponse]]._unwrapper,
+ ),
+ cast_to=cast(
+ Type[Optional[ImpersonationRegistryCreateResponse]], ResultWrapper[ImpersonationRegistryCreateResponse]
),
- cast_to=cast(Type[ImpersonationRegistryCreateResponse], ResultWrapper[ImpersonationRegistryCreateResponse]),
)
def list(
@@ -125,22 +140,23 @@ def list(
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> SyncV4PagePaginationArray[ImpersonationRegistryListResponse]:
"""
- Lists, searches, and sorts entries in the impersonation registry.
+ Returns a paginated list of protected identities in the impersonation registry.
+ These entries define identities and email addresses to protect from
+ impersonation attacks. Can be manually added or automatically synced from
+ directory integrations.
Args:
- account_id: Account Identifier
+ account_id: Identifier.
direction: The sorting direction.
- order: The field to sort by.
+ order: Field to sort by.
- page: The page number of paginated results.
+ page: Current page within paginated list of results.
- per_page: The number of results per page.
+ per_page: The number of results per page. Maximum value is 1000.
- search: Allows searching in multiple properties of a record simultaneously. This
- parameter is intended for human users, not automation. Its exact behavior is
- intentionally left unspecified and is subject to change in the future.
+ search: Search term for filtering records. Behavior may change.
extra_headers: Send extra headers
@@ -179,7 +195,7 @@ def list(
def delete(
self,
- display_name_id: int,
+ impersonation_registry_id: str,
*,
account_id: str,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
@@ -188,12 +204,16 @@ def delete(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
- ) -> ImpersonationRegistryDeleteResponse:
- """
- Removes a display name from impersonation protection monitoring.
+ ) -> Optional[ImpersonationRegistryDeleteResponse]:
+ """Removes an entry from the impersonation registry.
+
+ After deletion, this identity
+ will no longer be protected from impersonation.
Args:
- account_id: Account Identifier
+ account_id: Identifier.
+
+ impersonation_registry_id: Impersonation registry entry identifier
extra_headers: Send extra headers
@@ -205,42 +225,58 @@ def delete(
"""
if not account_id:
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
+ if not impersonation_registry_id:
+ raise ValueError(
+ f"Expected a non-empty value for `impersonation_registry_id` but received {impersonation_registry_id!r}"
+ )
return self._delete(
path_template(
- "/accounts/{account_id}/email-security/settings/impersonation_registry/{display_name_id}",
+ "/accounts/{account_id}/email-security/settings/impersonation_registry/{impersonation_registry_id}",
account_id=account_id,
- display_name_id=display_name_id,
+ impersonation_registry_id=impersonation_registry_id,
),
options=make_request_options(
extra_headers=extra_headers,
extra_query=extra_query,
extra_body=extra_body,
timeout=timeout,
- post_parser=ResultWrapper[ImpersonationRegistryDeleteResponse]._unwrapper,
+ post_parser=ResultWrapper[Optional[ImpersonationRegistryDeleteResponse]]._unwrapper,
+ ),
+ cast_to=cast(
+ Type[Optional[ImpersonationRegistryDeleteResponse]], ResultWrapper[ImpersonationRegistryDeleteResponse]
),
- cast_to=cast(Type[ImpersonationRegistryDeleteResponse], ResultWrapper[ImpersonationRegistryDeleteResponse]),
)
def edit(
self,
- display_name_id: int,
+ impersonation_registry_id: str,
*,
account_id: str,
- email: Optional[str] | Omit = omit,
- is_email_regex: Optional[bool] | Omit = omit,
- name: Optional[str] | Omit = omit,
+ comments: Optional[str] | Omit = omit,
+ directory_id: Optional[int] | Omit = omit,
+ directory_node_id: Optional[int] | Omit = omit,
+ email: str | Omit = omit,
+ external_directory_node_id: Optional[str] | Omit = omit,
+ is_email_regex: bool | Omit = omit,
+ name: str | Omit = omit,
+ provenance: Literal["A1S_INTERNAL", "SNOOPY-CASB_OFFICE_365", "SNOOPY-OFFICE_365", "SNOOPY-GOOGLE_DIRECTORY"]
+ | Omit = omit,
# 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,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
- ) -> ImpersonationRegistryEditResponse:
- """
- Updates a display name entry used for impersonation protection.
+ ) -> Optional[ImpersonationRegistryEditResponse]:
+ """Updates an existing impersonation registry entry.
+
+ Only provided fields will be
+ modified. Directory-synced entries can't be updated.
Args:
- account_id: Account Identifier
+ account_id: Identifier.
+
+ impersonation_registry_id: Impersonation registry entry identifier
extra_headers: Send extra headers
@@ -252,17 +288,26 @@ def edit(
"""
if not account_id:
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
+ if not impersonation_registry_id:
+ raise ValueError(
+ f"Expected a non-empty value for `impersonation_registry_id` but received {impersonation_registry_id!r}"
+ )
return self._patch(
path_template(
- "/accounts/{account_id}/email-security/settings/impersonation_registry/{display_name_id}",
+ "/accounts/{account_id}/email-security/settings/impersonation_registry/{impersonation_registry_id}",
account_id=account_id,
- display_name_id=display_name_id,
+ impersonation_registry_id=impersonation_registry_id,
),
body=maybe_transform(
{
+ "comments": comments,
+ "directory_id": directory_id,
+ "directory_node_id": directory_node_id,
"email": email,
+ "external_directory_node_id": external_directory_node_id,
"is_email_regex": is_email_regex,
"name": name,
+ "provenance": provenance,
},
impersonation_registry_edit_params.ImpersonationRegistryEditParams,
),
@@ -271,14 +316,16 @@ def edit(
extra_query=extra_query,
extra_body=extra_body,
timeout=timeout,
- post_parser=ResultWrapper[ImpersonationRegistryEditResponse]._unwrapper,
+ post_parser=ResultWrapper[Optional[ImpersonationRegistryEditResponse]]._unwrapper,
+ ),
+ cast_to=cast(
+ Type[Optional[ImpersonationRegistryEditResponse]], ResultWrapper[ImpersonationRegistryEditResponse]
),
- cast_to=cast(Type[ImpersonationRegistryEditResponse], ResultWrapper[ImpersonationRegistryEditResponse]),
)
def get(
self,
- display_name_id: int,
+ impersonation_registry_id: str,
*,
account_id: str,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
@@ -287,12 +334,16 @@ def get(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
- ) -> ImpersonationRegistryGetResponse:
+ ) -> Optional[ImpersonationRegistryGetResponse]:
"""
- Retrieves a display name entry used for impersonation protection.
+ Retrieves details for a specific impersonation registry entry including the
+ protected identity, email pattern, and synchronization source if
+ directory-synced.
Args:
- account_id: Account Identifier
+ account_id: Identifier.
+
+ impersonation_registry_id: Impersonation registry entry identifier
extra_headers: Send extra headers
@@ -304,20 +355,26 @@ def get(
"""
if not account_id:
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
+ if not impersonation_registry_id:
+ raise ValueError(
+ f"Expected a non-empty value for `impersonation_registry_id` but received {impersonation_registry_id!r}"
+ )
return self._get(
path_template(
- "/accounts/{account_id}/email-security/settings/impersonation_registry/{display_name_id}",
+ "/accounts/{account_id}/email-security/settings/impersonation_registry/{impersonation_registry_id}",
account_id=account_id,
- display_name_id=display_name_id,
+ impersonation_registry_id=impersonation_registry_id,
),
options=make_request_options(
extra_headers=extra_headers,
extra_query=extra_query,
extra_body=extra_body,
timeout=timeout,
- post_parser=ResultWrapper[ImpersonationRegistryGetResponse]._unwrapper,
+ post_parser=ResultWrapper[Optional[ImpersonationRegistryGetResponse]]._unwrapper,
+ ),
+ cast_to=cast(
+ Type[Optional[ImpersonationRegistryGetResponse]], ResultWrapper[ImpersonationRegistryGetResponse]
),
- cast_to=cast(Type[ImpersonationRegistryGetResponse], ResultWrapper[ImpersonationRegistryGetResponse]),
)
@@ -348,18 +405,26 @@ async def create(
email: str,
is_email_regex: bool,
name: str,
+ comments: Optional[str] | Omit = omit,
+ directory_id: Optional[int] | Omit = omit,
+ directory_node_id: Optional[int] | Omit = omit,
+ external_directory_node_id: Optional[str] | Omit = omit,
+ provenance: Literal["A1S_INTERNAL", "SNOOPY-CASB_OFFICE_365", "SNOOPY-OFFICE_365", "SNOOPY-GOOGLE_DIRECTORY"]
+ | Omit = omit,
# 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,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
- ) -> ImpersonationRegistryCreateResponse:
+ ) -> Optional[ImpersonationRegistryCreateResponse]:
"""
- Creates a display name entry for email security impersonation protection.
+ Creates a new entry in the impersonation registry to protect against
+ impersonation. Emails attempting to impersonate this identity will be flagged.
+ Supports regex patterns for flexible email matching.
Args:
- account_id: Account Identifier
+ account_id: Identifier.
extra_headers: Send extra headers
@@ -380,6 +445,11 @@ async def create(
"email": email,
"is_email_regex": is_email_regex,
"name": name,
+ "comments": comments,
+ "directory_id": directory_id,
+ "directory_node_id": directory_node_id,
+ "external_directory_node_id": external_directory_node_id,
+ "provenance": provenance,
},
impersonation_registry_create_params.ImpersonationRegistryCreateParams,
),
@@ -388,9 +458,11 @@ async def create(
extra_query=extra_query,
extra_body=extra_body,
timeout=timeout,
- post_parser=ResultWrapper[ImpersonationRegistryCreateResponse]._unwrapper,
+ post_parser=ResultWrapper[Optional[ImpersonationRegistryCreateResponse]]._unwrapper,
+ ),
+ cast_to=cast(
+ Type[Optional[ImpersonationRegistryCreateResponse]], ResultWrapper[ImpersonationRegistryCreateResponse]
),
- cast_to=cast(Type[ImpersonationRegistryCreateResponse], ResultWrapper[ImpersonationRegistryCreateResponse]),
)
def list(
@@ -414,22 +486,23 @@ def list(
ImpersonationRegistryListResponse, AsyncV4PagePaginationArray[ImpersonationRegistryListResponse]
]:
"""
- Lists, searches, and sorts entries in the impersonation registry.
+ Returns a paginated list of protected identities in the impersonation registry.
+ These entries define identities and email addresses to protect from
+ impersonation attacks. Can be manually added or automatically synced from
+ directory integrations.
Args:
- account_id: Account Identifier
+ account_id: Identifier.
direction: The sorting direction.
- order: The field to sort by.
+ order: Field to sort by.
- page: The page number of paginated results.
+ page: Current page within paginated list of results.
- per_page: The number of results per page.
+ per_page: The number of results per page. Maximum value is 1000.
- search: Allows searching in multiple properties of a record simultaneously. This
- parameter is intended for human users, not automation. Its exact behavior is
- intentionally left unspecified and is subject to change in the future.
+ search: Search term for filtering records. Behavior may change.
extra_headers: Send extra headers
@@ -468,7 +541,7 @@ def list(
async def delete(
self,
- display_name_id: int,
+ impersonation_registry_id: str,
*,
account_id: str,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
@@ -477,12 +550,16 @@ async def delete(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
- ) -> ImpersonationRegistryDeleteResponse:
- """
- Removes a display name from impersonation protection monitoring.
+ ) -> Optional[ImpersonationRegistryDeleteResponse]:
+ """Removes an entry from the impersonation registry.
+
+ After deletion, this identity
+ will no longer be protected from impersonation.
Args:
- account_id: Account Identifier
+ account_id: Identifier.
+
+ impersonation_registry_id: Impersonation registry entry identifier
extra_headers: Send extra headers
@@ -494,42 +571,58 @@ async def delete(
"""
if not account_id:
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
+ if not impersonation_registry_id:
+ raise ValueError(
+ f"Expected a non-empty value for `impersonation_registry_id` but received {impersonation_registry_id!r}"
+ )
return await self._delete(
path_template(
- "/accounts/{account_id}/email-security/settings/impersonation_registry/{display_name_id}",
+ "/accounts/{account_id}/email-security/settings/impersonation_registry/{impersonation_registry_id}",
account_id=account_id,
- display_name_id=display_name_id,
+ impersonation_registry_id=impersonation_registry_id,
),
options=make_request_options(
extra_headers=extra_headers,
extra_query=extra_query,
extra_body=extra_body,
timeout=timeout,
- post_parser=ResultWrapper[ImpersonationRegistryDeleteResponse]._unwrapper,
+ post_parser=ResultWrapper[Optional[ImpersonationRegistryDeleteResponse]]._unwrapper,
+ ),
+ cast_to=cast(
+ Type[Optional[ImpersonationRegistryDeleteResponse]], ResultWrapper[ImpersonationRegistryDeleteResponse]
),
- cast_to=cast(Type[ImpersonationRegistryDeleteResponse], ResultWrapper[ImpersonationRegistryDeleteResponse]),
)
async def edit(
self,
- display_name_id: int,
+ impersonation_registry_id: str,
*,
account_id: str,
- email: Optional[str] | Omit = omit,
- is_email_regex: Optional[bool] | Omit = omit,
- name: Optional[str] | Omit = omit,
+ comments: Optional[str] | Omit = omit,
+ directory_id: Optional[int] | Omit = omit,
+ directory_node_id: Optional[int] | Omit = omit,
+ email: str | Omit = omit,
+ external_directory_node_id: Optional[str] | Omit = omit,
+ is_email_regex: bool | Omit = omit,
+ name: str | Omit = omit,
+ provenance: Literal["A1S_INTERNAL", "SNOOPY-CASB_OFFICE_365", "SNOOPY-OFFICE_365", "SNOOPY-GOOGLE_DIRECTORY"]
+ | Omit = omit,
# 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,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
- ) -> ImpersonationRegistryEditResponse:
- """
- Updates a display name entry used for impersonation protection.
+ ) -> Optional[ImpersonationRegistryEditResponse]:
+ """Updates an existing impersonation registry entry.
+
+ Only provided fields will be
+ modified. Directory-synced entries can't be updated.
Args:
- account_id: Account Identifier
+ account_id: Identifier.
+
+ impersonation_registry_id: Impersonation registry entry identifier
extra_headers: Send extra headers
@@ -541,17 +634,26 @@ async def edit(
"""
if not account_id:
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
+ if not impersonation_registry_id:
+ raise ValueError(
+ f"Expected a non-empty value for `impersonation_registry_id` but received {impersonation_registry_id!r}"
+ )
return await self._patch(
path_template(
- "/accounts/{account_id}/email-security/settings/impersonation_registry/{display_name_id}",
+ "/accounts/{account_id}/email-security/settings/impersonation_registry/{impersonation_registry_id}",
account_id=account_id,
- display_name_id=display_name_id,
+ impersonation_registry_id=impersonation_registry_id,
),
body=await async_maybe_transform(
{
+ "comments": comments,
+ "directory_id": directory_id,
+ "directory_node_id": directory_node_id,
"email": email,
+ "external_directory_node_id": external_directory_node_id,
"is_email_regex": is_email_regex,
"name": name,
+ "provenance": provenance,
},
impersonation_registry_edit_params.ImpersonationRegistryEditParams,
),
@@ -560,14 +662,16 @@ async def edit(
extra_query=extra_query,
extra_body=extra_body,
timeout=timeout,
- post_parser=ResultWrapper[ImpersonationRegistryEditResponse]._unwrapper,
+ post_parser=ResultWrapper[Optional[ImpersonationRegistryEditResponse]]._unwrapper,
+ ),
+ cast_to=cast(
+ Type[Optional[ImpersonationRegistryEditResponse]], ResultWrapper[ImpersonationRegistryEditResponse]
),
- cast_to=cast(Type[ImpersonationRegistryEditResponse], ResultWrapper[ImpersonationRegistryEditResponse]),
)
async def get(
self,
- display_name_id: int,
+ impersonation_registry_id: str,
*,
account_id: str,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
@@ -576,12 +680,16 @@ async def get(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
- ) -> ImpersonationRegistryGetResponse:
+ ) -> Optional[ImpersonationRegistryGetResponse]:
"""
- Retrieves a display name entry used for impersonation protection.
+ Retrieves details for a specific impersonation registry entry including the
+ protected identity, email pattern, and synchronization source if
+ directory-synced.
Args:
- account_id: Account Identifier
+ account_id: Identifier.
+
+ impersonation_registry_id: Impersonation registry entry identifier
extra_headers: Send extra headers
@@ -593,20 +701,26 @@ async def get(
"""
if not account_id:
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
+ if not impersonation_registry_id:
+ raise ValueError(
+ f"Expected a non-empty value for `impersonation_registry_id` but received {impersonation_registry_id!r}"
+ )
return await self._get(
path_template(
- "/accounts/{account_id}/email-security/settings/impersonation_registry/{display_name_id}",
+ "/accounts/{account_id}/email-security/settings/impersonation_registry/{impersonation_registry_id}",
account_id=account_id,
- display_name_id=display_name_id,
+ impersonation_registry_id=impersonation_registry_id,
),
options=make_request_options(
extra_headers=extra_headers,
extra_query=extra_query,
extra_body=extra_body,
timeout=timeout,
- post_parser=ResultWrapper[ImpersonationRegistryGetResponse]._unwrapper,
+ post_parser=ResultWrapper[Optional[ImpersonationRegistryGetResponse]]._unwrapper,
+ ),
+ cast_to=cast(
+ Type[Optional[ImpersonationRegistryGetResponse]], ResultWrapper[ImpersonationRegistryGetResponse]
),
- cast_to=cast(Type[ImpersonationRegistryGetResponse], ResultWrapper[ImpersonationRegistryGetResponse]),
)
diff --git a/src/cloudflare/resources/email_security/settings/trusted_domains.py b/src/cloudflare/resources/email_security/settings/trusted_domains.py
index 2bc4c7a45d2..3f5c4b27cef 100644
--- a/src/cloudflare/resources/email_security/settings/trusted_domains.py
+++ b/src/cloudflare/resources/email_security/settings/trusted_domains.py
@@ -2,13 +2,13 @@
from __future__ import annotations
-from typing import Any, Type, Iterable, Optional, cast
-from typing_extensions import Literal, overload
+from typing import Type, Optional, cast
+from typing_extensions import Literal
import httpx
from ...._types import Body, Omit, Query, Headers, NotGiven, omit, not_given
-from ...._utils import path_template, required_args, maybe_transform, async_maybe_transform
+from ...._utils import path_template, maybe_transform, async_maybe_transform
from ...._compat import cached_property
from ...._resource import SyncAPIResource, AsyncAPIResource
from ...._response import (
@@ -54,7 +54,6 @@ def with_streaming_response(self) -> TrustedDomainsResourceWithStreamingResponse
"""
return TrustedDomainsResourceWithStreamingResponse(self)
- @overload
def create(
self,
*,
@@ -70,13 +69,15 @@ def create(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
- ) -> TrustedDomainCreateResponse:
- """
- Adds a domain to the trusted domains list for email security, reducing false
- positive detections.
+ ) -> Optional[TrustedDomainCreateResponse]:
+ """Creates a new trusted domain pattern.
+
+ Use for partner domains or approved
+ senders that should bypass recent domain registration and similarity checks.
+ Configure whether it prevents recent domain or spoof dispositions.
Args:
- account_id: Account Identifier
+ account_id: Identifier.
is_recent: Select to prevent recently registered domains from triggering a Suspicious or
Malicious disposition.
@@ -92,84 +93,28 @@ def create(
timeout: Override the client-level default timeout for this request, in seconds
"""
- ...
-
- @overload
- def create(
- self,
- *,
- account_id: str,
- body: Iterable[trusted_domain_create_params.Variant1Body],
- # 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,
- extra_query: Query | None = None,
- extra_body: Body | None = None,
- timeout: float | httpx.Timeout | None | NotGiven = not_given,
- ) -> TrustedDomainCreateResponse:
- """
- Adds a domain to the trusted domains list for email security, reducing false
- positive detections.
-
- Args:
- account_id: Account Identifier
-
- extra_headers: Send extra headers
-
- extra_query: Add additional query parameters to the request
-
- extra_body: Add additional JSON properties to the request
-
- timeout: Override the client-level default timeout for this request, in seconds
- """
- ...
-
- @required_args(["account_id", "is_recent", "is_regex", "is_similarity", "pattern"], ["account_id", "body"])
- def create(
- self,
- *,
- account_id: str,
- is_recent: bool | Omit = omit,
- is_regex: bool | Omit = omit,
- is_similarity: bool | Omit = omit,
- pattern: str | Omit = omit,
- comments: Optional[str] | Omit = omit,
- body: Iterable[trusted_domain_create_params.Variant1Body] | Omit = omit,
- # 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,
- extra_query: Query | None = None,
- extra_body: Body | None = None,
- timeout: float | httpx.Timeout | None | NotGiven = not_given,
- ) -> TrustedDomainCreateResponse:
if not account_id:
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
- return cast(
- TrustedDomainCreateResponse,
- self._post(
- path_template("/accounts/{account_id}/email-security/settings/trusted_domains", account_id=account_id),
- body=maybe_transform(
- {
- "is_recent": is_recent,
- "is_regex": is_regex,
- "is_similarity": is_similarity,
- "pattern": pattern,
- "comments": comments,
- "body": body,
- },
- trusted_domain_create_params.TrustedDomainCreateParams,
- ),
- options=make_request_options(
- extra_headers=extra_headers,
- extra_query=extra_query,
- extra_body=extra_body,
- timeout=timeout,
- post_parser=ResultWrapper[TrustedDomainCreateResponse]._unwrapper,
- ),
- cast_to=cast(
- Any, ResultWrapper[TrustedDomainCreateResponse]
- ), # Union types cannot be passed in as arguments in the type system
+ return self._post(
+ path_template("/accounts/{account_id}/email-security/settings/trusted_domains", account_id=account_id),
+ body=maybe_transform(
+ {
+ "is_recent": is_recent,
+ "is_regex": is_regex,
+ "is_similarity": is_similarity,
+ "pattern": pattern,
+ "comments": comments,
+ },
+ trusted_domain_create_params.TrustedDomainCreateParams,
+ ),
+ options=make_request_options(
+ extra_headers=extra_headers,
+ extra_query=extra_query,
+ extra_body=extra_body,
+ timeout=timeout,
+ post_parser=ResultWrapper[Optional[TrustedDomainCreateResponse]]._unwrapper,
),
+ cast_to=cast(Type[Optional[TrustedDomainCreateResponse]], ResultWrapper[TrustedDomainCreateResponse]),
)
def list(
@@ -191,23 +136,30 @@ def list(
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> SyncV4PagePaginationArray[TrustedDomainListResponse]:
- """
- Lists, searches, and sorts an account’s trusted email domains.
+ """Returns a paginated list of trusted domain patterns.
+
+ Trusted domains prevent
+ false positives for recently registered domains and lookalike domain detections.
+ Patterns can use regular expressions for flexible matching.
Args:
- account_id: Account Identifier
+ account_id: Identifier.
direction: The sorting direction.
- order: The field to sort by.
+ is_recent: Filter to show only recently registered domains that are trusted to prevent
+ triggering Suspicious or Malicious dispositions.
+
+ is_similarity: Filter to show only proximity domains (partner or approved domains with similar
+ spelling to connected domains) that prevent Spoof dispositions.
- page: The page number of paginated results.
+ order: Field to sort by.
- per_page: The number of results per page.
+ page: Current page within paginated list of results.
- search: Allows searching in multiple properties of a record simultaneously. This
- parameter is intended for human users, not automation. Its exact behavior is
- intentionally left unspecified and is subject to change in the future.
+ per_page: The number of results per page. Maximum value is 1000.
+
+ search: Search term for filtering records. Behavior may change.
extra_headers: Send extra headers
@@ -246,7 +198,7 @@ def list(
def delete(
self,
- trusted_domain_id: int,
+ trusted_domain_id: str,
*,
account_id: str,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
@@ -255,15 +207,16 @@ def delete(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
- ) -> TrustedDomainDeleteResponse:
- """
- Removes a domain from the trusted domains list, subjecting it to normal security
- scanning.
+ ) -> Optional[TrustedDomainDeleteResponse]:
+ """Removes a trusted domain pattern.
+
+ After deletion, emails from this domain will
+ be subject to normal recent domain and similarity checks.
Args:
- account_id: Account Identifier
+ account_id: Identifier.
- trusted_domain_id: The unique identifier for the trusted domain.
+ trusted_domain_id: Trusted domain identifier
extra_headers: Send extra headers
@@ -275,6 +228,8 @@ def delete(
"""
if not account_id:
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
+ if not trusted_domain_id:
+ raise ValueError(f"Expected a non-empty value for `trusted_domain_id` but received {trusted_domain_id!r}")
return self._delete(
path_template(
"/accounts/{account_id}/email-security/settings/trusted_domains/{trusted_domain_id}",
@@ -286,17 +241,17 @@ def delete(
extra_query=extra_query,
extra_body=extra_body,
timeout=timeout,
- post_parser=ResultWrapper[TrustedDomainDeleteResponse]._unwrapper,
+ post_parser=ResultWrapper[Optional[TrustedDomainDeleteResponse]]._unwrapper,
),
- cast_to=cast(Type[TrustedDomainDeleteResponse], ResultWrapper[TrustedDomainDeleteResponse]),
+ cast_to=cast(Type[Optional[TrustedDomainDeleteResponse]], ResultWrapper[TrustedDomainDeleteResponse]),
)
def edit(
self,
- trusted_domain_id: int,
+ trusted_domain_id: str,
*,
account_id: str,
- comments: str | Omit = omit,
+ comments: Optional[str] | Omit = omit,
is_recent: bool | Omit = omit,
is_regex: bool | Omit = omit,
is_similarity: bool | Omit = omit,
@@ -307,14 +262,16 @@ def edit(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
- ) -> TrustedDomainEditResponse:
- """
- Modifies a trusted domain entry's configuration.
+ ) -> Optional[TrustedDomainEditResponse]:
+ """Updates an existing trusted domain pattern.
+
+ Only provided fields will be
+ modified. Changes take effect for new emails matching the pattern.
Args:
- account_id: Account Identifier
+ account_id: Identifier.
- trusted_domain_id: The unique identifier for the trusted domain.
+ trusted_domain_id: Trusted domain identifier
is_recent: Select to prevent recently registered domains from triggering a Suspicious or
Malicious disposition.
@@ -332,6 +289,8 @@ def edit(
"""
if not account_id:
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
+ if not trusted_domain_id:
+ raise ValueError(f"Expected a non-empty value for `trusted_domain_id` but received {trusted_domain_id!r}")
return self._patch(
path_template(
"/accounts/{account_id}/email-security/settings/trusted_domains/{trusted_domain_id}",
@@ -353,14 +312,14 @@ def edit(
extra_query=extra_query,
extra_body=extra_body,
timeout=timeout,
- post_parser=ResultWrapper[TrustedDomainEditResponse]._unwrapper,
+ post_parser=ResultWrapper[Optional[TrustedDomainEditResponse]]._unwrapper,
),
- cast_to=cast(Type[TrustedDomainEditResponse], ResultWrapper[TrustedDomainEditResponse]),
+ cast_to=cast(Type[Optional[TrustedDomainEditResponse]], ResultWrapper[TrustedDomainEditResponse]),
)
def get(
self,
- trusted_domain_id: int,
+ trusted_domain_id: str,
*,
account_id: str,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
@@ -369,14 +328,15 @@ def get(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
- ) -> TrustedDomainGetResponse:
+ ) -> Optional[TrustedDomainGetResponse]:
"""
- Gets information about a specific trusted domain entry.
+ Retrieves details for a specific trusted domain pattern including its pattern
+ value, whether it uses regex matching, and which detection types it affects.
Args:
- account_id: Account Identifier
+ account_id: Identifier.
- trusted_domain_id: The unique identifier for the trusted domain.
+ trusted_domain_id: Trusted domain identifier
extra_headers: Send extra headers
@@ -388,6 +348,8 @@ def get(
"""
if not account_id:
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
+ if not trusted_domain_id:
+ raise ValueError(f"Expected a non-empty value for `trusted_domain_id` but received {trusted_domain_id!r}")
return self._get(
path_template(
"/accounts/{account_id}/email-security/settings/trusted_domains/{trusted_domain_id}",
@@ -399,9 +361,9 @@ def get(
extra_query=extra_query,
extra_body=extra_body,
timeout=timeout,
- post_parser=ResultWrapper[TrustedDomainGetResponse]._unwrapper,
+ post_parser=ResultWrapper[Optional[TrustedDomainGetResponse]]._unwrapper,
),
- cast_to=cast(Type[TrustedDomainGetResponse], ResultWrapper[TrustedDomainGetResponse]),
+ cast_to=cast(Type[Optional[TrustedDomainGetResponse]], ResultWrapper[TrustedDomainGetResponse]),
)
@@ -425,7 +387,6 @@ def with_streaming_response(self) -> AsyncTrustedDomainsResourceWithStreamingRes
"""
return AsyncTrustedDomainsResourceWithStreamingResponse(self)
- @overload
async def create(
self,
*,
@@ -441,13 +402,15 @@ async def create(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
- ) -> TrustedDomainCreateResponse:
- """
- Adds a domain to the trusted domains list for email security, reducing false
- positive detections.
+ ) -> Optional[TrustedDomainCreateResponse]:
+ """Creates a new trusted domain pattern.
+
+ Use for partner domains or approved
+ senders that should bypass recent domain registration and similarity checks.
+ Configure whether it prevents recent domain or spoof dispositions.
Args:
- account_id: Account Identifier
+ account_id: Identifier.
is_recent: Select to prevent recently registered domains from triggering a Suspicious or
Malicious disposition.
@@ -463,84 +426,28 @@ async def create(
timeout: Override the client-level default timeout for this request, in seconds
"""
- ...
-
- @overload
- async def create(
- self,
- *,
- account_id: str,
- body: Iterable[trusted_domain_create_params.Variant1Body],
- # 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,
- extra_query: Query | None = None,
- extra_body: Body | None = None,
- timeout: float | httpx.Timeout | None | NotGiven = not_given,
- ) -> TrustedDomainCreateResponse:
- """
- Adds a domain to the trusted domains list for email security, reducing false
- positive detections.
-
- Args:
- account_id: Account Identifier
-
- extra_headers: Send extra headers
-
- extra_query: Add additional query parameters to the request
-
- extra_body: Add additional JSON properties to the request
-
- timeout: Override the client-level default timeout for this request, in seconds
- """
- ...
-
- @required_args(["account_id", "is_recent", "is_regex", "is_similarity", "pattern"], ["account_id", "body"])
- async def create(
- self,
- *,
- account_id: str,
- is_recent: bool | Omit = omit,
- is_regex: bool | Omit = omit,
- is_similarity: bool | Omit = omit,
- pattern: str | Omit = omit,
- comments: Optional[str] | Omit = omit,
- body: Iterable[trusted_domain_create_params.Variant1Body] | Omit = omit,
- # 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,
- extra_query: Query | None = None,
- extra_body: Body | None = None,
- timeout: float | httpx.Timeout | None | NotGiven = not_given,
- ) -> TrustedDomainCreateResponse:
if not account_id:
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
- return cast(
- TrustedDomainCreateResponse,
- await self._post(
- path_template("/accounts/{account_id}/email-security/settings/trusted_domains", account_id=account_id),
- body=await async_maybe_transform(
- {
- "is_recent": is_recent,
- "is_regex": is_regex,
- "is_similarity": is_similarity,
- "pattern": pattern,
- "comments": comments,
- "body": body,
- },
- trusted_domain_create_params.TrustedDomainCreateParams,
- ),
- options=make_request_options(
- extra_headers=extra_headers,
- extra_query=extra_query,
- extra_body=extra_body,
- timeout=timeout,
- post_parser=ResultWrapper[TrustedDomainCreateResponse]._unwrapper,
- ),
- cast_to=cast(
- Any, ResultWrapper[TrustedDomainCreateResponse]
- ), # Union types cannot be passed in as arguments in the type system
+ return await self._post(
+ path_template("/accounts/{account_id}/email-security/settings/trusted_domains", account_id=account_id),
+ body=await async_maybe_transform(
+ {
+ "is_recent": is_recent,
+ "is_regex": is_regex,
+ "is_similarity": is_similarity,
+ "pattern": pattern,
+ "comments": comments,
+ },
+ trusted_domain_create_params.TrustedDomainCreateParams,
+ ),
+ options=make_request_options(
+ extra_headers=extra_headers,
+ extra_query=extra_query,
+ extra_body=extra_body,
+ timeout=timeout,
+ post_parser=ResultWrapper[Optional[TrustedDomainCreateResponse]]._unwrapper,
),
+ cast_to=cast(Type[Optional[TrustedDomainCreateResponse]], ResultWrapper[TrustedDomainCreateResponse]),
)
def list(
@@ -562,23 +469,30 @@ def list(
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> AsyncPaginator[TrustedDomainListResponse, AsyncV4PagePaginationArray[TrustedDomainListResponse]]:
- """
- Lists, searches, and sorts an account’s trusted email domains.
+ """Returns a paginated list of trusted domain patterns.
+
+ Trusted domains prevent
+ false positives for recently registered domains and lookalike domain detections.
+ Patterns can use regular expressions for flexible matching.
Args:
- account_id: Account Identifier
+ account_id: Identifier.
direction: The sorting direction.
- order: The field to sort by.
+ is_recent: Filter to show only recently registered domains that are trusted to prevent
+ triggering Suspicious or Malicious dispositions.
+
+ is_similarity: Filter to show only proximity domains (partner or approved domains with similar
+ spelling to connected domains) that prevent Spoof dispositions.
- page: The page number of paginated results.
+ order: Field to sort by.
- per_page: The number of results per page.
+ page: Current page within paginated list of results.
- search: Allows searching in multiple properties of a record simultaneously. This
- parameter is intended for human users, not automation. Its exact behavior is
- intentionally left unspecified and is subject to change in the future.
+ per_page: The number of results per page. Maximum value is 1000.
+
+ search: Search term for filtering records. Behavior may change.
extra_headers: Send extra headers
@@ -617,7 +531,7 @@ def list(
async def delete(
self,
- trusted_domain_id: int,
+ trusted_domain_id: str,
*,
account_id: str,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
@@ -626,15 +540,16 @@ async def delete(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
- ) -> TrustedDomainDeleteResponse:
- """
- Removes a domain from the trusted domains list, subjecting it to normal security
- scanning.
+ ) -> Optional[TrustedDomainDeleteResponse]:
+ """Removes a trusted domain pattern.
+
+ After deletion, emails from this domain will
+ be subject to normal recent domain and similarity checks.
Args:
- account_id: Account Identifier
+ account_id: Identifier.
- trusted_domain_id: The unique identifier for the trusted domain.
+ trusted_domain_id: Trusted domain identifier
extra_headers: Send extra headers
@@ -646,6 +561,8 @@ async def delete(
"""
if not account_id:
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
+ if not trusted_domain_id:
+ raise ValueError(f"Expected a non-empty value for `trusted_domain_id` but received {trusted_domain_id!r}")
return await self._delete(
path_template(
"/accounts/{account_id}/email-security/settings/trusted_domains/{trusted_domain_id}",
@@ -657,17 +574,17 @@ async def delete(
extra_query=extra_query,
extra_body=extra_body,
timeout=timeout,
- post_parser=ResultWrapper[TrustedDomainDeleteResponse]._unwrapper,
+ post_parser=ResultWrapper[Optional[TrustedDomainDeleteResponse]]._unwrapper,
),
- cast_to=cast(Type[TrustedDomainDeleteResponse], ResultWrapper[TrustedDomainDeleteResponse]),
+ cast_to=cast(Type[Optional[TrustedDomainDeleteResponse]], ResultWrapper[TrustedDomainDeleteResponse]),
)
async def edit(
self,
- trusted_domain_id: int,
+ trusted_domain_id: str,
*,
account_id: str,
- comments: str | Omit = omit,
+ comments: Optional[str] | Omit = omit,
is_recent: bool | Omit = omit,
is_regex: bool | Omit = omit,
is_similarity: bool | Omit = omit,
@@ -678,14 +595,16 @@ async def edit(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
- ) -> TrustedDomainEditResponse:
- """
- Modifies a trusted domain entry's configuration.
+ ) -> Optional[TrustedDomainEditResponse]:
+ """Updates an existing trusted domain pattern.
+
+ Only provided fields will be
+ modified. Changes take effect for new emails matching the pattern.
Args:
- account_id: Account Identifier
+ account_id: Identifier.
- trusted_domain_id: The unique identifier for the trusted domain.
+ trusted_domain_id: Trusted domain identifier
is_recent: Select to prevent recently registered domains from triggering a Suspicious or
Malicious disposition.
@@ -703,6 +622,8 @@ async def edit(
"""
if not account_id:
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
+ if not trusted_domain_id:
+ raise ValueError(f"Expected a non-empty value for `trusted_domain_id` but received {trusted_domain_id!r}")
return await self._patch(
path_template(
"/accounts/{account_id}/email-security/settings/trusted_domains/{trusted_domain_id}",
@@ -724,14 +645,14 @@ async def edit(
extra_query=extra_query,
extra_body=extra_body,
timeout=timeout,
- post_parser=ResultWrapper[TrustedDomainEditResponse]._unwrapper,
+ post_parser=ResultWrapper[Optional[TrustedDomainEditResponse]]._unwrapper,
),
- cast_to=cast(Type[TrustedDomainEditResponse], ResultWrapper[TrustedDomainEditResponse]),
+ cast_to=cast(Type[Optional[TrustedDomainEditResponse]], ResultWrapper[TrustedDomainEditResponse]),
)
async def get(
self,
- trusted_domain_id: int,
+ trusted_domain_id: str,
*,
account_id: str,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
@@ -740,14 +661,15 @@ async def get(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
- ) -> TrustedDomainGetResponse:
+ ) -> Optional[TrustedDomainGetResponse]:
"""
- Gets information about a specific trusted domain entry.
+ Retrieves details for a specific trusted domain pattern including its pattern
+ value, whether it uses regex matching, and which detection types it affects.
Args:
- account_id: Account Identifier
+ account_id: Identifier.
- trusted_domain_id: The unique identifier for the trusted domain.
+ trusted_domain_id: Trusted domain identifier
extra_headers: Send extra headers
@@ -759,6 +681,8 @@ async def get(
"""
if not account_id:
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
+ if not trusted_domain_id:
+ raise ValueError(f"Expected a non-empty value for `trusted_domain_id` but received {trusted_domain_id!r}")
return await self._get(
path_template(
"/accounts/{account_id}/email-security/settings/trusted_domains/{trusted_domain_id}",
@@ -770,9 +694,9 @@ async def get(
extra_query=extra_query,
extra_body=extra_body,
timeout=timeout,
- post_parser=ResultWrapper[TrustedDomainGetResponse]._unwrapper,
+ post_parser=ResultWrapper[Optional[TrustedDomainGetResponse]]._unwrapper,
),
- cast_to=cast(Type[TrustedDomainGetResponse], ResultWrapper[TrustedDomainGetResponse]),
+ cast_to=cast(Type[Optional[TrustedDomainGetResponse]], ResultWrapper[TrustedDomainGetResponse]),
)
diff --git a/src/cloudflare/resources/email_security/submissions.py b/src/cloudflare/resources/email_security/submissions.py
index a35b261041e..be830a3f4e9 100644
--- a/src/cloudflare/resources/email_security/submissions.py
+++ b/src/cloudflare/resources/email_security/submissions.py
@@ -50,7 +50,6 @@ def list(
self,
*,
account_id: str,
- customer_status: Literal["escalated", "reviewed", "unreviewed"] | Omit = omit,
end: Union[str, datetime] | Omit = omit,
original_disposition: Literal["MALICIOUS", "SUSPICIOUS", "SPOOF", "SPAM", "BULK", "NONE"] | Omit = omit,
outcome_disposition: Literal["MALICIOUS", "SUSPICIOUS", "SPOOF", "SPAM", "BULK", "NONE"] | Omit = omit,
@@ -69,20 +68,22 @@ def list(
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> SyncV4PagePaginationArray[SubmissionListResponse]:
- """
- This endpoint returns information for submissions to made to reclassify emails.
+ """Returns information for submissions made to reclassify emails.
+
+ Shows the status,
+ outcome, and disposition changes for reclassification requests made by users or
+ the security team. Useful for tracking false positive/negative reports.
Args:
- account_id: Account Identifier
+ account_id: Identifier.
- end: The end of the search date range. Defaults to `now` if not provided.
+ end: The end of the search date range. Defaults to `now`.
- page: The page number of paginated results.
+ page: Current page within paginated list of results.
- per_page: The number of results per page.
+ per_page: The number of results per page. Maximum value is 1000.
- start: The beginning of the search date range. Defaults to `now - 30 days` if not
- provided.
+ start: The beginning of the search date range. Defaults to `now - 30 days`.
extra_headers: Send extra headers
@@ -104,7 +105,6 @@ def list(
timeout=timeout,
query=maybe_transform(
{
- "customer_status": customer_status,
"end": end,
"original_disposition": original_disposition,
"outcome_disposition": outcome_disposition,
@@ -148,7 +148,6 @@ def list(
self,
*,
account_id: str,
- customer_status: Literal["escalated", "reviewed", "unreviewed"] | Omit = omit,
end: Union[str, datetime] | Omit = omit,
original_disposition: Literal["MALICIOUS", "SUSPICIOUS", "SPOOF", "SPAM", "BULK", "NONE"] | Omit = omit,
outcome_disposition: Literal["MALICIOUS", "SUSPICIOUS", "SPOOF", "SPAM", "BULK", "NONE"] | Omit = omit,
@@ -167,20 +166,22 @@ def list(
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> AsyncPaginator[SubmissionListResponse, AsyncV4PagePaginationArray[SubmissionListResponse]]:
- """
- This endpoint returns information for submissions to made to reclassify emails.
+ """Returns information for submissions made to reclassify emails.
+
+ Shows the status,
+ outcome, and disposition changes for reclassification requests made by users or
+ the security team. Useful for tracking false positive/negative reports.
Args:
- account_id: Account Identifier
+ account_id: Identifier.
- end: The end of the search date range. Defaults to `now` if not provided.
+ end: The end of the search date range. Defaults to `now`.
- page: The page number of paginated results.
+ page: Current page within paginated list of results.
- per_page: The number of results per page.
+ per_page: The number of results per page. Maximum value is 1000.
- start: The beginning of the search date range. Defaults to `now - 30 days` if not
- provided.
+ start: The beginning of the search date range. Defaults to `now - 30 days`.
extra_headers: Send extra headers
@@ -202,7 +203,6 @@ def list(
timeout=timeout,
query=maybe_transform(
{
- "customer_status": customer_status,
"end": end,
"original_disposition": original_disposition,
"outcome_disposition": outcome_disposition,
diff --git a/src/cloudflare/resources/magic_transit/api.md b/src/cloudflare/resources/magic_transit/api.md
index a7477a25fa8..2d200bccc35 100644
--- a/src/cloudflare/resources/magic_transit/api.md
+++ b/src/cloudflare/resources/magic_transit/api.md
@@ -220,7 +220,7 @@ Methods:
- client.magic_transit.connectors.create(\*, account_id, \*\*params) -> ConnectorCreateResponse
- client.magic_transit.connectors.update(connector_id, \*, account_id, \*\*params) -> ConnectorUpdateResponse
-- client.magic_transit.connectors.list(\*, account_id) -> SyncSinglePage[ConnectorListResponse]
+- client.magic_transit.connectors.list(\*, account_id, \*\*params) -> SyncSinglePage[ConnectorListResponse]
- client.magic_transit.connectors.delete(connector_id, \*, account_id) -> ConnectorDeleteResponse
- client.magic_transit.connectors.edit(connector_id, \*, account_id, \*\*params) -> ConnectorEditResponse
- client.magic_transit.connectors.get(connector_id, \*, account_id) -> ConnectorGetResponse
diff --git a/src/cloudflare/resources/magic_transit/cf_interconnects.py b/src/cloudflare/resources/magic_transit/cf_interconnects.py
index f2e3ef1890e..6a127aa7698 100644
--- a/src/cloudflare/resources/magic_transit/cf_interconnects.py
+++ b/src/cloudflare/resources/magic_transit/cf_interconnects.py
@@ -81,7 +81,8 @@ def update(
cf_interconnect_id: Identifier
automatic_return_routing: True if automatic stateful return routing should be enabled for a tunnel, false
- otherwise.
+ otherwise. Requires the `coupler_integration` account flag to be enabled;
+ requests setting this to `true` without that flag will be rejected.
description: An optional description of the interconnect.
@@ -370,7 +371,8 @@ async def update(
cf_interconnect_id: Identifier
automatic_return_routing: True if automatic stateful return routing should be enabled for a tunnel, false
- otherwise.
+ otherwise. Requires the `coupler_integration` account flag to be enabled;
+ requests setting this to `true` without that flag will be rejected.
description: An optional description of the interconnect.
diff --git a/src/cloudflare/resources/magic_transit/connectors/connectors.py b/src/cloudflare/resources/magic_transit/connectors/connectors.py
index d842d3ecd80..bf11a0bced6 100644
--- a/src/cloudflare/resources/magic_transit/connectors/connectors.py
+++ b/src/cloudflare/resources/magic_transit/connectors/connectors.py
@@ -36,7 +36,12 @@
SnapshotsResourceWithStreamingResponse,
AsyncSnapshotsResourceWithStreamingResponse,
)
-from ....types.magic_transit import connector_edit_params, connector_create_params, connector_update_params
+from ....types.magic_transit import (
+ connector_edit_params,
+ connector_list_params,
+ connector_create_params,
+ connector_update_params,
+)
from ....types.magic_transit.connector_get_response import ConnectorGetResponse
from ....types.magic_transit.connector_edit_response import ConnectorEditResponse
from ....types.magic_transit.connector_list_response import ConnectorListResponse
@@ -224,6 +229,7 @@ def list(
self,
*,
account_id: str,
+ device_type: Literal["MANAGED", "LICENSED"] | Omit = omit,
# 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,
@@ -237,6 +243,8 @@ def list(
Args:
account_id: Account identifier
+ device_type: Filter connectors by device type.
+
extra_headers: Send extra headers
extra_query: Add additional query parameters to the request
@@ -251,7 +259,11 @@ def list(
path_template("/accounts/{account_id}/magic/connectors", account_id=account_id),
page=SyncSinglePage[ConnectorListResponse],
options=make_request_options(
- extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
+ extra_headers=extra_headers,
+ extra_query=extra_query,
+ extra_body=extra_body,
+ timeout=timeout,
+ query=maybe_transform({"device_type": device_type}, connector_list_params.ConnectorListParams),
),
model=ConnectorListResponse,
)
@@ -602,6 +614,7 @@ def list(
self,
*,
account_id: str,
+ device_type: Literal["MANAGED", "LICENSED"] | Omit = omit,
# 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,
@@ -615,6 +628,8 @@ def list(
Args:
account_id: Account identifier
+ device_type: Filter connectors by device type.
+
extra_headers: Send extra headers
extra_query: Add additional query parameters to the request
@@ -629,7 +644,11 @@ def list(
path_template("/accounts/{account_id}/magic/connectors", account_id=account_id),
page=AsyncSinglePage[ConnectorListResponse],
options=make_request_options(
- extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
+ extra_headers=extra_headers,
+ extra_query=extra_query,
+ extra_body=extra_body,
+ timeout=timeout,
+ query=maybe_transform({"device_type": device_type}, connector_list_params.ConnectorListParams),
),
model=ConnectorListResponse,
)
diff --git a/src/cloudflare/resources/magic_transit/gre_tunnels.py b/src/cloudflare/resources/magic_transit/gre_tunnels.py
index e0cf9482bee..96d0d1f6ea7 100644
--- a/src/cloudflare/resources/magic_transit/gre_tunnels.py
+++ b/src/cloudflare/resources/magic_transit/gre_tunnels.py
@@ -92,7 +92,8 @@ def create(
must be 15 characters or less, and cannot share a name with another GRE tunnel.
automatic_return_routing: True if automatic stateful return routing should be enabled for a tunnel, false
- otherwise.
+ otherwise. Requires the `coupler_integration` account flag to be enabled;
+ requests setting this to `true` without that flag will be rejected.
description: An optional description of the GRE tunnel.
@@ -199,7 +200,8 @@ def update(
must be 15 characters or less, and cannot share a name with another GRE tunnel.
automatic_return_routing: True if automatic stateful return routing should be enabled for a tunnel, false
- otherwise.
+ otherwise. Requires the `coupler_integration` account flag to be enabled;
+ requests setting this to `true` without that flag will be rejected.
description: An optional description of the GRE tunnel.
@@ -554,7 +556,8 @@ async def create(
must be 15 characters or less, and cannot share a name with another GRE tunnel.
automatic_return_routing: True if automatic stateful return routing should be enabled for a tunnel, false
- otherwise.
+ otherwise. Requires the `coupler_integration` account flag to be enabled;
+ requests setting this to `true` without that flag will be rejected.
description: An optional description of the GRE tunnel.
@@ -661,7 +664,8 @@ async def update(
must be 15 characters or less, and cannot share a name with another GRE tunnel.
automatic_return_routing: True if automatic stateful return routing should be enabled for a tunnel, false
- otherwise.
+ otherwise. Requires the `coupler_integration` account flag to be enabled;
+ requests setting this to `true` without that flag will be rejected.
description: An optional description of the GRE tunnel.
diff --git a/src/cloudflare/resources/magic_transit/ipsec_tunnels.py b/src/cloudflare/resources/magic_transit/ipsec_tunnels.py
index 0e3f3ade8bc..776165a6701 100644
--- a/src/cloudflare/resources/magic_transit/ipsec_tunnels.py
+++ b/src/cloudflare/resources/magic_transit/ipsec_tunnels.py
@@ -97,7 +97,8 @@ def create(
name: The name of the IPsec tunnel. The name cannot share a name with other tunnels.
automatic_return_routing: True if automatic stateful return routing should be enabled for a tunnel, false
- otherwise.
+ otherwise. Requires the `coupler_integration` account flag to be enabled;
+ requests setting this to `true` without that flag will be rejected.
customer_endpoint: The IP address assigned to the customer side of the IPsec tunnel. Not required,
but must be set for proactive traceroutes to work.
@@ -208,7 +209,8 @@ def update(
name: The name of the IPsec tunnel. The name cannot share a name with other tunnels.
automatic_return_routing: True if automatic stateful return routing should be enabled for a tunnel, false
- otherwise.
+ otherwise. Requires the `coupler_integration` account flag to be enabled;
+ requests setting this to `true` without that flag will be rejected.
customer_endpoint: The IP address assigned to the customer side of the IPsec tunnel. Not required,
but must be set for proactive traceroutes to work.
@@ -622,7 +624,8 @@ async def create(
name: The name of the IPsec tunnel. The name cannot share a name with other tunnels.
automatic_return_routing: True if automatic stateful return routing should be enabled for a tunnel, false
- otherwise.
+ otherwise. Requires the `coupler_integration` account flag to be enabled;
+ requests setting this to `true` without that flag will be rejected.
customer_endpoint: The IP address assigned to the customer side of the IPsec tunnel. Not required,
but must be set for proactive traceroutes to work.
@@ -733,7 +736,8 @@ async def update(
name: The name of the IPsec tunnel. The name cannot share a name with other tunnels.
automatic_return_routing: True if automatic stateful return routing should be enabled for a tunnel, false
- otherwise.
+ otherwise. Requires the `coupler_integration` account flag to be enabled;
+ requests setting this to `true` without that flag will be rejected.
customer_endpoint: The IP address assigned to the customer side of the IPsec tunnel. Not required,
but must be set for proactive traceroutes to work.
diff --git a/src/cloudflare/resources/queues/api.md b/src/cloudflare/resources/queues/api.md
index 377d7d6186b..59d3863934b 100644
--- a/src/cloudflare/resources/queues/api.md
+++ b/src/cloudflare/resources/queues/api.md
@@ -3,7 +3,7 @@
Types:
```python
-from cloudflare.types.queues import Queue, QueueDeleteResponse
+from cloudflare.types.queues import Queue, QueueDeleteResponse, QueueGetMetricsResponse
```
Methods:
@@ -14,6 +14,7 @@ Methods:
- client.queues.delete(queue_id, \*, account_id) -> QueueDeleteResponse
- client.queues.edit(queue_id, \*, account_id, \*\*params) -> Optional[Queue]
- client.queues.get(queue_id, \*, account_id) -> Optional[Queue]
+- client.queues.get_metrics(queue_id, \*, account_id) -> Optional[QueueGetMetricsResponse]
## Messages
diff --git a/src/cloudflare/resources/queues/queues.py b/src/cloudflare/resources/queues/queues.py
index 138d47827c4..775e62f2a71 100644
--- a/src/cloudflare/resources/queues/queues.py
+++ b/src/cloudflare/resources/queues/queues.py
@@ -54,6 +54,7 @@
from ...types.queues import queue_edit_params, queue_create_params, queue_update_params
from ...types.queues.queue import Queue
from ...types.queues.queue_delete_response import QueueDeleteResponse
+from ...types.queues.queue_get_metrics_response import QueueGetMetricsResponse
__all__ = ["QueuesResource", "AsyncQueuesResource"]
@@ -364,6 +365,52 @@ def get(
cast_to=cast(Type[Optional[Queue]], ResultWrapper[Queue]),
)
+ def get_metrics(
+ self,
+ queue_id: str,
+ *,
+ account_id: str,
+ # 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,
+ extra_query: Query | None = None,
+ extra_body: Body | None = None,
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
+ ) -> Optional[QueueGetMetricsResponse]:
+ """Return best-effort metrics for a queue.
+
+ Values may be approximate due to the
+ distributed nature of queues.
+
+ Args:
+ account_id: A Resource identifier.
+
+ queue_id: A Resource identifier.
+
+ extra_headers: Send extra headers
+
+ extra_query: Add additional query parameters to the request
+
+ extra_body: Add additional JSON properties to the request
+
+ timeout: Override the client-level default timeout for this request, in seconds
+ """
+ if not account_id:
+ raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
+ if not queue_id:
+ raise ValueError(f"Expected a non-empty value for `queue_id` but received {queue_id!r}")
+ return self._get(
+ path_template("/accounts/{account_id}/queues/{queue_id}/metrics", account_id=account_id, queue_id=queue_id),
+ options=make_request_options(
+ extra_headers=extra_headers,
+ extra_query=extra_query,
+ extra_body=extra_body,
+ timeout=timeout,
+ post_parser=ResultWrapper[Optional[QueueGetMetricsResponse]]._unwrapper,
+ ),
+ cast_to=cast(Type[Optional[QueueGetMetricsResponse]], ResultWrapper[QueueGetMetricsResponse]),
+ )
+
class AsyncQueuesResource(AsyncAPIResource):
@cached_property
@@ -671,6 +718,52 @@ async def get(
cast_to=cast(Type[Optional[Queue]], ResultWrapper[Queue]),
)
+ async def get_metrics(
+ self,
+ queue_id: str,
+ *,
+ account_id: str,
+ # 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,
+ extra_query: Query | None = None,
+ extra_body: Body | None = None,
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
+ ) -> Optional[QueueGetMetricsResponse]:
+ """Return best-effort metrics for a queue.
+
+ Values may be approximate due to the
+ distributed nature of queues.
+
+ Args:
+ account_id: A Resource identifier.
+
+ queue_id: A Resource identifier.
+
+ extra_headers: Send extra headers
+
+ extra_query: Add additional query parameters to the request
+
+ extra_body: Add additional JSON properties to the request
+
+ timeout: Override the client-level default timeout for this request, in seconds
+ """
+ if not account_id:
+ raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
+ if not queue_id:
+ raise ValueError(f"Expected a non-empty value for `queue_id` but received {queue_id!r}")
+ return await self._get(
+ path_template("/accounts/{account_id}/queues/{queue_id}/metrics", account_id=account_id, queue_id=queue_id),
+ options=make_request_options(
+ extra_headers=extra_headers,
+ extra_query=extra_query,
+ extra_body=extra_body,
+ timeout=timeout,
+ post_parser=ResultWrapper[Optional[QueueGetMetricsResponse]]._unwrapper,
+ ),
+ cast_to=cast(Type[Optional[QueueGetMetricsResponse]], ResultWrapper[QueueGetMetricsResponse]),
+ )
+
class QueuesResourceWithRawResponse:
def __init__(self, queues: QueuesResource) -> None:
@@ -694,6 +787,9 @@ def __init__(self, queues: QueuesResource) -> None:
self.get = to_raw_response_wrapper(
queues.get,
)
+ self.get_metrics = to_raw_response_wrapper(
+ queues.get_metrics,
+ )
@cached_property
def messages(self) -> MessagesResourceWithRawResponse:
@@ -734,6 +830,9 @@ def __init__(self, queues: AsyncQueuesResource) -> None:
self.get = async_to_raw_response_wrapper(
queues.get,
)
+ self.get_metrics = async_to_raw_response_wrapper(
+ queues.get_metrics,
+ )
@cached_property
def messages(self) -> AsyncMessagesResourceWithRawResponse:
@@ -774,6 +873,9 @@ def __init__(self, queues: QueuesResource) -> None:
self.get = to_streamed_response_wrapper(
queues.get,
)
+ self.get_metrics = to_streamed_response_wrapper(
+ queues.get_metrics,
+ )
@cached_property
def messages(self) -> MessagesResourceWithStreamingResponse:
@@ -814,6 +916,9 @@ def __init__(self, queues: AsyncQueuesResource) -> None:
self.get = async_to_streamed_response_wrapper(
queues.get,
)
+ self.get_metrics = async_to_streamed_response_wrapper(
+ queues.get_metrics,
+ )
@cached_property
def messages(self) -> AsyncMessagesResourceWithStreamingResponse:
diff --git a/src/cloudflare/resources/radar/ai/to_markdown.py b/src/cloudflare/resources/radar/ai/to_markdown.py
index e13a7c75b4c..67ce47c87e5 100644
--- a/src/cloudflare/resources/radar/ai/to_markdown.py
+++ b/src/cloudflare/resources/radar/ai/to_markdown.py
@@ -88,11 +88,11 @@ def create(
# sent to the server will contain a `boundary` parameter, e.g.
# multipart/form-data; boundary=---abc--
extra_headers = {"Content-Type": "multipart/form-data", **(extra_headers or {})}
- return self._get_api_list(
+ return self._get_api_list( # type: ignore[call-arg]
path_template("/accounts/{account_id}/ai/tomarkdown", account_id=account_id),
page=SyncSinglePage[ToMarkdownCreateResponse],
body=maybe_transform(body, to_markdown_create_params.ToMarkdownCreateParams),
- files=extracted_files, # pyright: ignore[reportCallIssue] # type: ignore[call-arg]
+ files=extracted_files, # pyright: ignore[reportCallIssue]
options=make_request_options(
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
),
@@ -156,11 +156,11 @@ def create(
# sent to the server will contain a `boundary` parameter, e.g.
# multipart/form-data; boundary=---abc--
extra_headers = {"Content-Type": "multipart/form-data", **(extra_headers or {})}
- return self._get_api_list(
+ return self._get_api_list( # type: ignore[call-arg]
path_template("/accounts/{account_id}/ai/tomarkdown", account_id=account_id),
page=AsyncSinglePage[ToMarkdownCreateResponse],
body=maybe_transform(body, to_markdown_create_params.ToMarkdownCreateParams),
- files=extracted_files, # pyright: ignore[reportCallIssue] # type: ignore[call-arg]
+ files=extracted_files, # pyright: ignore[reportCallIssue]
options=make_request_options(
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
),
diff --git a/src/cloudflare/resources/workers/observability/telemetry.py b/src/cloudflare/resources/workers/observability/telemetry.py
index 757102e555a..782b8f08f19 100644
--- a/src/cloudflare/resources/workers/observability/telemetry.py
+++ b/src/cloudflare/resources/workers/observability/telemetry.py
@@ -139,44 +139,53 @@ def query(
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> TelemetryQueryResponse:
- """
- Run a temporary or saved query.
+ """Run a temporary or saved query.
Args:
- query_id: Unique identifier for the query to execute
+ query_id: Identifier for the query.
+
+ When parameters are omitted, this ID is used to load a
+ previously saved query's parameters. When providing parameters inline, pass any
+ identifier (e.g. an ad-hoc ID).
- timeframe: Timeframe for your query using Unix timestamps in milliseconds. Provide from/to
- epoch ms; narrower timeframes provide faster responses and more specific
- results.
+ timeframe: Timeframe for the query using Unix timestamps in milliseconds. Narrower
+ timeframes produce faster responses and more specific results.
- chart: Whether to include timeseties data in the response
+ chart: When true, includes time-series data in the response.
- compare: Whether to include comparison data with previous time periods
+ compare: When true, includes a comparison dataset from the previous time period of equal
+ length.
- dry: Whether to perform a dry run without saving the results of the query. Useful for
- validation
+ dry: When true, executes the query without persisting the results. Useful for
+ validation or previewing.
- granularity: This is only used when the view is calculations. Leaving it empty lets Workers
- Observability detect the correct granularity.
+ granularity: Number of time-series buckets. Only used when view is 'calculations'. Omit to
+ let the system auto-detect an appropriate granularity.
- ignore_series: Whether to ignore time-series data in the results and return only aggregated
- values
+ ignore_series: When true, omits time-series data from the response and returns only aggregated
+ values. Reduces response size when series are not needed.
- limit: Use this limit to cap the number of events returned when the view is events.
+ limit: Maximum number of events to return when view is 'events'. Also controls the
+ number of group-by rows when view is 'calculations'.
- offset: Cursor pagination for event/trace/invocation views. Pass the last item's
- $metadata.id as the next offset.
+ offset: Cursor for pagination in event, trace, and invocation views. Pass the
+ $metadata.id of the last returned item to fetch the next page.
- offset_by: Numeric offset for pattern results (top-N list). Use with limit to page pattern
- groups; not used by cursor pagination.
+ offset_by: Numeric offset for paginating grouped/pattern results (top-N lists). Use
+ together with limit. Not used by cursor-based pagination.
- offset_direction: Direction for offset-based pagination (e.g., 'next', 'prev')
+ offset_direction: Pagination direction: 'next' for forward, 'prev' for backward.
- parameters: Optional parameters to pass to the query execution
+ parameters: Query parameters defining what data to retrieve — filters, calculations,
+ group-bys, and ordering. In practice this should always be provided for ad-hoc
+ queries. Only omit when executing a previously saved query by queryId. Use the
+ keys and values endpoints to discover available fields before building filters.
- view: Examples by view type. Events: show errors for a worker in the last 30 minutes.
- Calculations: p99 of wall time or count by status code. Invocations: find a
- specific request that resulted in a 500.
+ view: Controls the shape of the response. 'events': individual log lines matching the
+ query. 'calculations': aggregated metrics (count, avg, p99, etc.) with optional
+ group-by breakdowns and time-series. 'invocations': events grouped by request
+ ID. 'traces': distributed trace summaries. 'agents': Durable Object agent
+ summaries.
extra_headers: Send extra headers
@@ -245,7 +254,8 @@ def values(
filters: Apply filters before listing values. Supports nested groups via kind: 'group'.
Maximum nesting depth is 4.
- needle: Search for a specific substring in the event.
+ needle: Full-text search expression to match events containing the specified text or
+ pattern.
extra_headers: Send extra headers
@@ -391,44 +401,53 @@ async def query(
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> TelemetryQueryResponse:
- """
- Run a temporary or saved query.
+ """Run a temporary or saved query.
Args:
- query_id: Unique identifier for the query to execute
+ query_id: Identifier for the query.
+
+ When parameters are omitted, this ID is used to load a
+ previously saved query's parameters. When providing parameters inline, pass any
+ identifier (e.g. an ad-hoc ID).
- timeframe: Timeframe for your query using Unix timestamps in milliseconds. Provide from/to
- epoch ms; narrower timeframes provide faster responses and more specific
- results.
+ timeframe: Timeframe for the query using Unix timestamps in milliseconds. Narrower
+ timeframes produce faster responses and more specific results.
- chart: Whether to include timeseties data in the response
+ chart: When true, includes time-series data in the response.
- compare: Whether to include comparison data with previous time periods
+ compare: When true, includes a comparison dataset from the previous time period of equal
+ length.
- dry: Whether to perform a dry run without saving the results of the query. Useful for
- validation
+ dry: When true, executes the query without persisting the results. Useful for
+ validation or previewing.
- granularity: This is only used when the view is calculations. Leaving it empty lets Workers
- Observability detect the correct granularity.
+ granularity: Number of time-series buckets. Only used when view is 'calculations'. Omit to
+ let the system auto-detect an appropriate granularity.
- ignore_series: Whether to ignore time-series data in the results and return only aggregated
- values
+ ignore_series: When true, omits time-series data from the response and returns only aggregated
+ values. Reduces response size when series are not needed.
- limit: Use this limit to cap the number of events returned when the view is events.
+ limit: Maximum number of events to return when view is 'events'. Also controls the
+ number of group-by rows when view is 'calculations'.
- offset: Cursor pagination for event/trace/invocation views. Pass the last item's
- $metadata.id as the next offset.
+ offset: Cursor for pagination in event, trace, and invocation views. Pass the
+ $metadata.id of the last returned item to fetch the next page.
- offset_by: Numeric offset for pattern results (top-N list). Use with limit to page pattern
- groups; not used by cursor pagination.
+ offset_by: Numeric offset for paginating grouped/pattern results (top-N lists). Use
+ together with limit. Not used by cursor-based pagination.
- offset_direction: Direction for offset-based pagination (e.g., 'next', 'prev')
+ offset_direction: Pagination direction: 'next' for forward, 'prev' for backward.
- parameters: Optional parameters to pass to the query execution
+ parameters: Query parameters defining what data to retrieve — filters, calculations,
+ group-bys, and ordering. In practice this should always be provided for ad-hoc
+ queries. Only omit when executing a previously saved query by queryId. Use the
+ keys and values endpoints to discover available fields before building filters.
- view: Examples by view type. Events: show errors for a worker in the last 30 minutes.
- Calculations: p99 of wall time or count by status code. Invocations: find a
- specific request that resulted in a 500.
+ view: Controls the shape of the response. 'events': individual log lines matching the
+ query. 'calculations': aggregated metrics (count, avg, p99, etc.) with optional
+ group-by breakdowns and time-series. 'invocations': events grouped by request
+ ID. 'traces': distributed trace summaries. 'agents': Durable Object agent
+ summaries.
extra_headers: Send extra headers
@@ -497,7 +516,8 @@ def values(
filters: Apply filters before listing values. Supports nested groups via kind: 'group'.
Maximum nesting depth is 4.
- needle: Search for a specific substring in the event.
+ needle: Full-text search expression to match events containing the specified text or
+ pattern.
extra_headers: Send extra headers
diff --git a/src/cloudflare/resources/zero_trust/access/applications/policy_tests/__init__.py b/src/cloudflare/resources/zero_trust/access/applications/policy_tests/__init__.py
old mode 100755
new mode 100644
diff --git a/src/cloudflare/resources/zero_trust/access/applications/policy_tests/policy_tests.py b/src/cloudflare/resources/zero_trust/access/applications/policy_tests/policy_tests.py
old mode 100755
new mode 100644
diff --git a/src/cloudflare/resources/zero_trust/access/applications/policy_tests/users.py b/src/cloudflare/resources/zero_trust/access/applications/policy_tests/users.py
old mode 100755
new mode 100644
diff --git a/src/cloudflare/resources/zero_trust/devices/policies/custom/custom.py b/src/cloudflare/resources/zero_trust/devices/policies/custom/custom.py
index ae7b27236a8..ee4baacac41 100644
--- a/src/cloudflare/resources/zero_trust/devices/policies/custom/custom.py
+++ b/src/cloudflare/resources/zero_trust/devices/policies/custom/custom.py
@@ -109,6 +109,7 @@ def create(
support_url: str | Omit = omit,
switch_locked: bool | Omit = omit,
tunnel_protocol: str | Omit = omit,
+ virtual_networks: Optional[custom_create_params.VirtualNetworks] | Omit = omit,
# 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,
@@ -178,6 +179,8 @@ def create(
tunnel_protocol: Determines which tunnel protocol to use.
+ virtual_networks: Virtual network access settings for the device.
+
extra_headers: Send extra headers
extra_query: Add additional query parameters to the request
@@ -214,6 +217,7 @@ def create(
"support_url": support_url,
"switch_locked": switch_locked,
"tunnel_protocol": tunnel_protocol,
+ "virtual_networks": virtual_networks,
},
custom_create_params.CustomCreateParams,
),
@@ -329,6 +333,7 @@ def edit(
support_url: str | Omit = omit,
switch_locked: bool | Omit = omit,
tunnel_protocol: str | Omit = omit,
+ virtual_networks: Optional[custom_edit_params.VirtualNetworks] | Omit = omit,
# 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,
@@ -397,6 +402,8 @@ def edit(
tunnel_protocol: Determines which tunnel protocol to use.
+ virtual_networks: Virtual network access settings for the device.
+
extra_headers: Send extra headers
extra_query: Add additional query parameters to the request
@@ -437,6 +444,7 @@ def edit(
"support_url": support_url,
"switch_locked": switch_locked,
"tunnel_protocol": tunnel_protocol,
+ "virtual_networks": virtual_networks,
},
custom_edit_params.CustomEditParams,
),
@@ -551,6 +559,7 @@ async def create(
support_url: str | Omit = omit,
switch_locked: bool | Omit = omit,
tunnel_protocol: str | Omit = omit,
+ virtual_networks: Optional[custom_create_params.VirtualNetworks] | Omit = omit,
# 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,
@@ -620,6 +629,8 @@ async def create(
tunnel_protocol: Determines which tunnel protocol to use.
+ virtual_networks: Virtual network access settings for the device.
+
extra_headers: Send extra headers
extra_query: Add additional query parameters to the request
@@ -656,6 +667,7 @@ async def create(
"support_url": support_url,
"switch_locked": switch_locked,
"tunnel_protocol": tunnel_protocol,
+ "virtual_networks": virtual_networks,
},
custom_create_params.CustomCreateParams,
),
@@ -771,6 +783,7 @@ async def edit(
support_url: str | Omit = omit,
switch_locked: bool | Omit = omit,
tunnel_protocol: str | Omit = omit,
+ virtual_networks: Optional[custom_edit_params.VirtualNetworks] | Omit = omit,
# 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,
@@ -839,6 +852,8 @@ async def edit(
tunnel_protocol: Determines which tunnel protocol to use.
+ virtual_networks: Virtual network access settings for the device.
+
extra_headers: Send extra headers
extra_query: Add additional query parameters to the request
@@ -879,6 +894,7 @@ async def edit(
"support_url": support_url,
"switch_locked": switch_locked,
"tunnel_protocol": tunnel_protocol,
+ "virtual_networks": virtual_networks,
},
custom_edit_params.CustomEditParams,
),
diff --git a/src/cloudflare/resources/zero_trust/devices/policies/default/default.py b/src/cloudflare/resources/zero_trust/devices/policies/default/default.py
index 42273b7fee8..cbe59b3adac 100644
--- a/src/cloudflare/resources/zero_trust/devices/policies/default/default.py
+++ b/src/cloudflare/resources/zero_trust/devices/policies/default/default.py
@@ -116,6 +116,7 @@ def edit(
support_url: str | Omit = omit,
switch_locked: bool | Omit = omit,
tunnel_protocol: str | Omit = omit,
+ virtual_networks: Optional[default_edit_params.VirtualNetworks] | Omit = omit,
# 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,
@@ -170,6 +171,8 @@ def edit(
tunnel_protocol: Determines which tunnel protocol to use.
+ virtual_networks: Virtual network access settings for the device.
+
extra_headers: Send extra headers
extra_query: Add additional query parameters to the request
@@ -201,6 +204,7 @@ def edit(
"support_url": support_url,
"switch_locked": switch_locked,
"tunnel_protocol": tunnel_protocol,
+ "virtual_networks": virtual_networks,
},
default_edit_params.DefaultEditParams,
),
@@ -309,6 +313,7 @@ async def edit(
support_url: str | Omit = omit,
switch_locked: bool | Omit = omit,
tunnel_protocol: str | Omit = omit,
+ virtual_networks: Optional[default_edit_params.VirtualNetworks] | Omit = omit,
# 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,
@@ -363,6 +368,8 @@ async def edit(
tunnel_protocol: Determines which tunnel protocol to use.
+ virtual_networks: Virtual network access settings for the device.
+
extra_headers: Send extra headers
extra_query: Add additional query parameters to the request
@@ -394,6 +401,7 @@ async def edit(
"support_url": support_url,
"switch_locked": switch_locked,
"tunnel_protocol": tunnel_protocol,
+ "virtual_networks": virtual_networks,
},
default_edit_params.DefaultEditParams,
),
diff --git a/src/cloudflare/resources/zero_trust/dlp/datasets/versions/__init__.py b/src/cloudflare/resources/zero_trust/dlp/datasets/versions/__init__.py
old mode 100755
new mode 100644
diff --git a/src/cloudflare/resources/zero_trust/dlp/datasets/versions/entries.py b/src/cloudflare/resources/zero_trust/dlp/datasets/versions/entries.py
old mode 100755
new mode 100644
diff --git a/src/cloudflare/resources/zero_trust/dlp/datasets/versions/versions.py b/src/cloudflare/resources/zero_trust/dlp/datasets/versions/versions.py
old mode 100755
new mode 100644
diff --git a/src/cloudflare/resources/zero_trust/dlp/limits.py b/src/cloudflare/resources/zero_trust/dlp/limits.py
old mode 100755
new mode 100644
diff --git a/src/cloudflare/resources/zero_trust/gateway/configurations/__init__.py b/src/cloudflare/resources/zero_trust/gateway/configurations/__init__.py
old mode 100755
new mode 100644
diff --git a/src/cloudflare/resources/zero_trust/gateway/configurations/configurations.py b/src/cloudflare/resources/zero_trust/gateway/configurations/configurations.py
old mode 100755
new mode 100644
diff --git a/src/cloudflare/types/ai/finetunes/asset_create_params.py b/src/cloudflare/types/ai/finetunes/asset_create_params.py
index ad11c25d1bd..dffc4f71692 100644
--- a/src/cloudflare/types/ai/finetunes/asset_create_params.py
+++ b/src/cloudflare/types/ai/finetunes/asset_create_params.py
@@ -2,7 +2,7 @@
from __future__ import annotations
-from typing_extensions import TypedDict
+from typing_extensions import Required, TypedDict
from ...._types import FileTypes
diff --git a/src/cloudflare/types/aisearch/instance_list_params.py b/src/cloudflare/types/aisearch/instance_list_params.py
index 7c3b1faa18a..f7191795e9b 100644
--- a/src/cloudflare/types/aisearch/instance_list_params.py
+++ b/src/cloudflare/types/aisearch/instance_list_params.py
@@ -2,7 +2,6 @@
from __future__ import annotations
-from typing import Optional
from typing_extensions import Literal, Required, TypedDict
__all__ = ["InstanceListParams"]
@@ -11,17 +10,20 @@
class InstanceListParams(TypedDict, total=False):
account_id: Required[str]
- namespace: Optional[str]
+ namespace: str
+ """Filter by namespace."""
order_by: Literal["created_at"]
- """Order By Column Name"""
+ """Field to order results by."""
order_by_direction: Literal["asc", "desc"]
- """Order By Direction"""
+ """Order direction."""
page: int
+ """Page number (1-indexed)."""
per_page: int
+ """Number of results per page."""
search: str
- """Search by id"""
+ """Filter instances whose id contains this string (case-insensitive)."""
diff --git a/src/cloudflare/types/aisearch/namespaces/instance_list_params.py b/src/cloudflare/types/aisearch/namespaces/instance_list_params.py
index 7c3b1faa18a..f7191795e9b 100644
--- a/src/cloudflare/types/aisearch/namespaces/instance_list_params.py
+++ b/src/cloudflare/types/aisearch/namespaces/instance_list_params.py
@@ -2,7 +2,6 @@
from __future__ import annotations
-from typing import Optional
from typing_extensions import Literal, Required, TypedDict
__all__ = ["InstanceListParams"]
@@ -11,17 +10,20 @@
class InstanceListParams(TypedDict, total=False):
account_id: Required[str]
- namespace: Optional[str]
+ namespace: str
+ """Filter by namespace."""
order_by: Literal["created_at"]
- """Order By Column Name"""
+ """Field to order results by."""
order_by_direction: Literal["asc", "desc"]
- """Order By Direction"""
+ """Order direction."""
page: int
+ """Page number (1-indexed)."""
per_page: int
+ """Number of results per page."""
search: str
- """Search by id"""
+ """Filter instances whose id contains this string (case-insensitive)."""
diff --git a/src/cloudflare/types/aisearch/namespaces/instances/item_create_or_update_params.py b/src/cloudflare/types/aisearch/namespaces/instances/item_create_or_update_params.py
index 99ee3a5f635..237cc3acaf5 100644
--- a/src/cloudflare/types/aisearch/namespaces/instances/item_create_or_update_params.py
+++ b/src/cloudflare/types/aisearch/namespaces/instances/item_create_or_update_params.py
@@ -16,3 +16,12 @@ class ItemCreateOrUpdateParams(TypedDict, total=False):
"""Item key / filename. Must not exceed 128 characters."""
next_action: Required[Literal["INDEX"]]
+
+ wait_for_completion: bool
+ """Wait for indexing to fully complete before responding.
+
+ On RAGs with vector indexing enabled, this additionally waits for Vectorize
+ ingestion confirmation (up to 40s) so the returned item reflects a queryable
+ state. On timeout the item is returned in `running` state and the background
+ alarm continues polling. Defaults to false.
+ """
diff --git a/src/cloudflare/types/aisearch/namespaces/instances/item_sync_params.py b/src/cloudflare/types/aisearch/namespaces/instances/item_sync_params.py
index 89a0585b224..6fa679fe3b6 100644
--- a/src/cloudflare/types/aisearch/namespaces/instances/item_sync_params.py
+++ b/src/cloudflare/types/aisearch/namespaces/instances/item_sync_params.py
@@ -16,3 +16,12 @@ class ItemSyncParams(TypedDict, total=False):
"""AI Search instance ID. Lowercase alphanumeric, hyphens, and underscores."""
next_action: Required[Literal["INDEX"]]
+
+ wait_for_completion: bool
+ """Wait for indexing to fully complete before responding.
+
+ On RAGs with vector indexing enabled, this additionally waits for Vectorize
+ ingestion confirmation (up to 40s) so the returned item reflects a queryable
+ state. On timeout the item is returned in `running` state and the background
+ alarm continues polling. Defaults to false.
+ """
diff --git a/src/cloudflare/types/aisearch/namespaces/instances/item_upload_params.py b/src/cloudflare/types/aisearch/namespaces/instances/item_upload_params.py
index 96dd49ad951..e7caf691795 100644
--- a/src/cloudflare/types/aisearch/namespaces/instances/item_upload_params.py
+++ b/src/cloudflare/types/aisearch/namespaces/instances/item_upload_params.py
@@ -25,4 +25,10 @@ class File(TypedDict, total=False):
"""JSON string of custom metadata key-value pairs."""
wait_for_completion: bool
- """Wait for indexing to complete before responding. Defaults to false."""
+ """Wait for indexing to fully complete before responding.
+
+ On RAGs with vector indexing enabled, this additionally waits for Vectorize
+ ingestion confirmation (up to 40s) so the returned item reflects a queryable
+ state. On timeout the item is returned in `running` state and the background
+ alarm continues polling. Defaults to false.
+ """
diff --git a/src/cloudflare/types/api_gateway/operation_create_response.py b/src/cloudflare/types/api_gateway/operation_create_response.py
index 3ca28f40890..594a8b7ad83 100644
--- a/src/cloudflare/types/api_gateway/operation_create_response.py
+++ b/src/cloudflare/types/api_gateway/operation_create_response.py
@@ -1,9 +1,11 @@
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
-from typing import List, Union, Optional
+from typing import Dict, List, Union, Optional
from datetime import datetime
from typing_extensions import Literal, TypeAlias
+from pydantic import Field as FieldInfo
+
from ..._models import BaseModel
__all__ = [
@@ -26,6 +28,9 @@
"FeaturesAPIShieldOperationFeatureSchemaInfo",
"FeaturesAPIShieldOperationFeatureSchemaInfoSchemaInfo",
"FeaturesAPIShieldOperationFeatureSchemaInfoSchemaInfoActiveSchema",
+ "Schemas",
+ "SchemasLearned",
+ "SchemasUploaded",
]
@@ -216,6 +221,50 @@ class FeaturesAPIShieldOperationFeatureSchemaInfo(BaseModel):
]
+class SchemasLearned(BaseModel):
+ """
+ An OpenAPI operation object fragment containing schema information for an operation. May include parameter definitions, request body specifications, and a component schema extension.
+ """
+
+ parameters: Optional[List[Dict[str, object]]] = None
+ """OpenAPI parameter objects describing path, query, header, or cookie parameters."""
+
+ request_body: Optional[Dict[str, object]] = FieldInfo(alias="requestBody", default=None)
+ """OpenAPI request body object describing the expected request payload."""
+
+
+class SchemasUploaded(BaseModel):
+ """
+ An OpenAPI operation object fragment containing schema information for an operation. May include parameter definitions, request body specifications, and a component schema extension.
+ """
+
+ parameters: Optional[List[Dict[str, object]]] = None
+ """OpenAPI parameter objects describing path, query, header, or cookie parameters."""
+
+ request_body: Optional[Dict[str, object]] = FieldInfo(alias="requestBody", default=None)
+ """OpenAPI request body object describing the expected request payload."""
+
+
+class Schemas(BaseModel):
+ """
+ OpenAPI JSON schemas for an operation, including both user-uploaded and Cloudflare-learned schemas.
+ """
+
+ learned: Optional[SchemasLearned] = None
+ """
+ An OpenAPI operation object fragment containing schema information for an
+ operation. May include parameter definitions, request body specifications, and a
+ component schema extension.
+ """
+
+ uploaded: Optional[SchemasUploaded] = None
+ """
+ An OpenAPI operation object fragment containing schema information for an
+ operation. May include parameter definitions, request body specifications, and a
+ component schema extension.
+ """
+
+
class OperationCreateResponse(BaseModel):
endpoint: str
"""
@@ -237,3 +286,9 @@ class OperationCreateResponse(BaseModel):
"""UUID."""
features: Optional[Features] = None
+
+ schemas: Optional[Schemas] = None
+ """
+ OpenAPI JSON schemas for an operation, including both user-uploaded and
+ Cloudflare-learned schemas.
+ """
diff --git a/src/cloudflare/types/api_gateway/operation_get_params.py b/src/cloudflare/types/api_gateway/operation_get_params.py
index 80b1e80e724..6fa124ecc14 100644
--- a/src/cloudflare/types/api_gateway/operation_get_params.py
+++ b/src/cloudflare/types/api_gateway/operation_get_params.py
@@ -19,3 +19,10 @@ class OperationGetParams(TypedDict, total=False):
Have a look at the top-level object description for more details on the specific
meaning.
"""
+
+ with_schemas: bool
+ """
+ When true, includes OpenAPI schemas (both uploaded and learned) for the
+ operation in the response. Due to the conversion overhead, this parameter is
+ only supported on single-operation retrieval.
+ """
diff --git a/src/cloudflare/types/api_gateway/operation_get_response.py b/src/cloudflare/types/api_gateway/operation_get_response.py
index 7c45d8d8431..d3407d93057 100644
--- a/src/cloudflare/types/api_gateway/operation_get_response.py
+++ b/src/cloudflare/types/api_gateway/operation_get_response.py
@@ -1,9 +1,11 @@
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
-from typing import List, Union, Optional
+from typing import Dict, List, Union, Optional
from datetime import datetime
from typing_extensions import Literal, TypeAlias
+from pydantic import Field as FieldInfo
+
from ..._models import BaseModel
__all__ = [
@@ -26,6 +28,9 @@
"FeaturesAPIShieldOperationFeatureSchemaInfo",
"FeaturesAPIShieldOperationFeatureSchemaInfoSchemaInfo",
"FeaturesAPIShieldOperationFeatureSchemaInfoSchemaInfoActiveSchema",
+ "Schemas",
+ "SchemasLearned",
+ "SchemasUploaded",
]
@@ -216,6 +221,50 @@ class FeaturesAPIShieldOperationFeatureSchemaInfo(BaseModel):
]
+class SchemasLearned(BaseModel):
+ """
+ An OpenAPI operation object fragment containing schema information for an operation. May include parameter definitions, request body specifications, and a component schema extension.
+ """
+
+ parameters: Optional[List[Dict[str, object]]] = None
+ """OpenAPI parameter objects describing path, query, header, or cookie parameters."""
+
+ request_body: Optional[Dict[str, object]] = FieldInfo(alias="requestBody", default=None)
+ """OpenAPI request body object describing the expected request payload."""
+
+
+class SchemasUploaded(BaseModel):
+ """
+ An OpenAPI operation object fragment containing schema information for an operation. May include parameter definitions, request body specifications, and a component schema extension.
+ """
+
+ parameters: Optional[List[Dict[str, object]]] = None
+ """OpenAPI parameter objects describing path, query, header, or cookie parameters."""
+
+ request_body: Optional[Dict[str, object]] = FieldInfo(alias="requestBody", default=None)
+ """OpenAPI request body object describing the expected request payload."""
+
+
+class Schemas(BaseModel):
+ """
+ OpenAPI JSON schemas for an operation, including both user-uploaded and Cloudflare-learned schemas.
+ """
+
+ learned: Optional[SchemasLearned] = None
+ """
+ An OpenAPI operation object fragment containing schema information for an
+ operation. May include parameter definitions, request body specifications, and a
+ component schema extension.
+ """
+
+ uploaded: Optional[SchemasUploaded] = None
+ """
+ An OpenAPI operation object fragment containing schema information for an
+ operation. May include parameter definitions, request body specifications, and a
+ component schema extension.
+ """
+
+
class OperationGetResponse(BaseModel):
endpoint: str
"""
@@ -237,3 +286,9 @@ class OperationGetResponse(BaseModel):
"""UUID."""
features: Optional[Features] = None
+
+ schemas: Optional[Schemas] = None
+ """
+ OpenAPI JSON schemas for an operation, including both user-uploaded and
+ Cloudflare-learned schemas.
+ """
diff --git a/src/cloudflare/types/botnet_feed/asn_day_report_params.py b/src/cloudflare/types/botnet_feed/asn_day_report_params.py
old mode 100755
new mode 100644
diff --git a/src/cloudflare/types/botnet_feed/asn_day_report_response.py b/src/cloudflare/types/botnet_feed/asn_day_report_response.py
old mode 100755
new mode 100644
diff --git a/src/cloudflare/types/botnet_feed/asn_full_report_response.py b/src/cloudflare/types/botnet_feed/asn_full_report_response.py
old mode 100755
new mode 100644
diff --git a/src/cloudflare/types/botnet_feed/configs/asn_delete_response.py b/src/cloudflare/types/botnet_feed/configs/asn_delete_response.py
old mode 100755
new mode 100644
diff --git a/src/cloudflare/types/botnet_feed/configs/asn_get_response.py b/src/cloudflare/types/botnet_feed/configs/asn_get_response.py
old mode 100755
new mode 100644
diff --git a/src/cloudflare/types/browser_rendering/devtools/browser/__init__.py b/src/cloudflare/types/browser_rendering/devtools/browser/__init__.py
index 3bc1e83d2e4..7f66285244b 100644
--- a/src/cloudflare/types/browser_rendering/devtools/browser/__init__.py
+++ b/src/cloudflare/types/browser_rendering/devtools/browser/__init__.py
@@ -5,5 +5,6 @@
from .target_get_response import TargetGetResponse as TargetGetResponse
from .target_create_params import TargetCreateParams as TargetCreateParams
from .target_list_response import TargetListResponse as TargetListResponse
+from .target_close_response import TargetCloseResponse as TargetCloseResponse
from .target_create_response import TargetCreateResponse as TargetCreateResponse
from .target_activate_response import TargetActivateResponse as TargetActivateResponse
diff --git a/src/cloudflare/types/browser_rendering/devtools/browser/target_close_response.py b/src/cloudflare/types/browser_rendering/devtools/browser/target_close_response.py
new file mode 100644
index 00000000000..db57120d7d4
--- /dev/null
+++ b/src/cloudflare/types/browser_rendering/devtools/browser/target_close_response.py
@@ -0,0 +1,10 @@
+# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
+
+from ....._models import BaseModel
+
+__all__ = ["TargetCloseResponse"]
+
+
+class TargetCloseResponse(BaseModel):
+ message: str
+ """Target is closing."""
diff --git a/src/cloudflare/types/email_security/investigate/__init__.py b/src/cloudflare/types/email_security/investigate/__init__.py
index a86e5ccf9aa..e694dd47b9b 100644
--- a/src/cloudflare/types/email_security/investigate/__init__.py
+++ b/src/cloudflare/types/email_security/investigate/__init__.py
@@ -4,7 +4,6 @@
from .move_bulk_params import MoveBulkParams as MoveBulkParams
from .raw_get_response import RawGetResponse as RawGetResponse
-from .trace_get_params import TraceGetParams as TraceGetParams
from .move_bulk_response import MoveBulkResponse as MoveBulkResponse
from .move_create_params import MoveCreateParams as MoveCreateParams
from .trace_get_response import TraceGetResponse as TraceGetResponse
diff --git a/src/cloudflare/types/email_security/investigate/detection_get_response.py b/src/cloudflare/types/email_security/investigate/detection_get_response.py
index 444f1b45083..9d292df5162 100644
--- a/src/cloudflare/types/email_security/investigate/detection_get_response.py
+++ b/src/cloudflare/types/email_security/investigate/detection_get_response.py
@@ -19,8 +19,10 @@
class Attachment(BaseModel):
size: int
+ """Size of the attachment in bytes"""
content_type: Optional[str] = None
+ """MIME type of the attachment"""
detection: Optional[
Literal[
@@ -36,10 +38,25 @@ class Attachment(BaseModel):
"NONE",
]
] = None
+ """Detection result for this attachment"""
encrypted: Optional[bool] = None
+ """Whether the attachment is encrypted"""
+
+ filename: Optional[str] = None
+ """Name of the attached file"""
+
+ md5: Optional[str] = None
+ """MD5 hash of the attachment"""
name: Optional[str] = None
+ """Attachment name (alternative to filename)"""
+
+ sha1: Optional[str] = None
+ """SHA1 hash of the attachment"""
+
+ sha256: Optional[str] = None
+ """SHA256 hash of the attachment"""
class Finding(BaseModel):
@@ -102,7 +119,7 @@ class SenderInfo(BaseModel):
class ThreatCategory(BaseModel):
- id: int
+ id: Optional[int] = None
description: Optional[str] = None
@@ -124,7 +141,7 @@ class DetectionGetResponse(BaseModel):
attachments: List[Attachment]
- findings: List[Finding]
+ findings: Optional[List[Finding]] = None
headers: List[Header]
diff --git a/src/cloudflare/types/email_security/investigate/move_bulk_params.py b/src/cloudflare/types/email_security/investigate/move_bulk_params.py
index b269132b524..35a0e5ac6d6 100644
--- a/src/cloudflare/types/email_security/investigate/move_bulk_params.py
+++ b/src/cloudflare/types/email_security/investigate/move_bulk_params.py
@@ -11,14 +11,17 @@
class MoveBulkParams(TypedDict, total=False):
account_id: Required[str]
- """Account Identifier"""
+ """Identifier."""
destination: Required[
Literal["Inbox", "JunkEmail", "DeletedItems", "RecoverableItemsDeletions", "RecoverableItemsPurges"]
]
ids: SequenceNotStr[str]
- """List of message IDs to move."""
+ """List of message IDs to move"""
postfix_ids: SequenceNotStr[str]
- """Deprecated: Use `ids` instead. List of message IDs to move."""
+ """Deprecated, use `ids` instead.
+
+ End of life: November 1, 2026. List of message IDs to move.
+ """
diff --git a/src/cloudflare/types/email_security/investigate/move_bulk_response.py b/src/cloudflare/types/email_security/investigate/move_bulk_response.py
index 1d660a890ae..34dec906dd2 100644
--- a/src/cloudflare/types/email_security/investigate/move_bulk_response.py
+++ b/src/cloudflare/types/email_security/investigate/move_bulk_response.py
@@ -9,21 +9,29 @@
class MoveBulkResponse(BaseModel):
- completed_timestamp: datetime
- """Deprecated, use `completed_at` instead"""
-
- item_count: int
-
success: bool
+ """Whether the operation succeeded"""
completed_at: Optional[datetime] = None
+ """When the move operation completed (UTC)"""
+
+ completed_timestamp: Optional[datetime] = None
+ """Deprecated, use `completed_at` instead. End of life: November 1, 2026."""
destination: Optional[str] = None
+ """Destination folder for the message"""
+
+ item_count: Optional[int] = None
+ """Number of items moved. End of life: November 1, 2026."""
message_id: Optional[str] = None
+ """Message identifier"""
operation: Optional[str] = None
+ """Type of operation performed"""
recipient: Optional[str] = None
+ """Recipient email address"""
status: Optional[str] = None
+ """Operation status"""
diff --git a/src/cloudflare/types/email_security/investigate/move_create_params.py b/src/cloudflare/types/email_security/investigate/move_create_params.py
index c4c977447e5..0e389b2ae93 100644
--- a/src/cloudflare/types/email_security/investigate/move_create_params.py
+++ b/src/cloudflare/types/email_security/investigate/move_create_params.py
@@ -9,14 +9,8 @@
class MoveCreateParams(TypedDict, total=False):
account_id: Required[str]
- """Account Identifier"""
+ """Identifier."""
destination: Required[
Literal["Inbox", "JunkEmail", "DeletedItems", "RecoverableItemsDeletions", "RecoverableItemsPurges"]
]
-
- submission: bool
- """When true, search the submissions datastore only.
-
- When false or omitted, search the regular datastore only.
- """
diff --git a/src/cloudflare/types/email_security/investigate/move_create_response.py b/src/cloudflare/types/email_security/investigate/move_create_response.py
index 9dac3bddcd8..2737ff7f476 100644
--- a/src/cloudflare/types/email_security/investigate/move_create_response.py
+++ b/src/cloudflare/types/email_security/investigate/move_create_response.py
@@ -1,33 +1,37 @@
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
-from typing import List, Optional
+from typing import Optional
from datetime import datetime
-from typing_extensions import TypeAlias
from ...._models import BaseModel
-__all__ = ["MoveCreateResponse", "MoveCreateResponseItem"]
+__all__ = ["MoveCreateResponse"]
-class MoveCreateResponseItem(BaseModel):
- completed_timestamp: datetime
- """Deprecated, use `completed_at` instead"""
-
- item_count: int
-
+class MoveCreateResponse(BaseModel):
success: bool
+ """Whether the operation succeeded"""
completed_at: Optional[datetime] = None
+ """When the move operation completed (UTC)"""
+
+ completed_timestamp: Optional[datetime] = None
+ """Deprecated, use `completed_at` instead. End of life: November 1, 2026."""
destination: Optional[str] = None
+ """Destination folder for the message"""
+
+ item_count: Optional[int] = None
+ """Number of items moved. End of life: November 1, 2026."""
message_id: Optional[str] = None
+ """Message identifier"""
operation: Optional[str] = None
+ """Type of operation performed"""
recipient: Optional[str] = None
+ """Recipient email address"""
status: Optional[str] = None
-
-
-MoveCreateResponse: TypeAlias = List[MoveCreateResponseItem]
+ """Operation status"""
diff --git a/src/cloudflare/types/email_security/investigate/preview_create_params.py b/src/cloudflare/types/email_security/investigate/preview_create_params.py
index f14b41a6449..58affde473a 100644
--- a/src/cloudflare/types/email_security/investigate/preview_create_params.py
+++ b/src/cloudflare/types/email_security/investigate/preview_create_params.py
@@ -9,13 +9,7 @@
class PreviewCreateParams(TypedDict, total=False):
account_id: Required[str]
- """Account Identifier"""
+ """Identifier."""
postfix_id: Required[str]
- """The identifier of the message."""
-
- submission: bool
- """When true, search the submissions datastore only.
-
- When false or omitted, search the regular datastore only.
- """
+ """The identifier of the message"""
diff --git a/src/cloudflare/types/email_security/investigate/reclassify_create_params.py b/src/cloudflare/types/email_security/investigate/reclassify_create_params.py
index 9bc5a664d51..a35779781ec 100644
--- a/src/cloudflare/types/email_security/investigate/reclassify_create_params.py
+++ b/src/cloudflare/types/email_security/investigate/reclassify_create_params.py
@@ -9,17 +9,11 @@
class ReclassifyCreateParams(TypedDict, total=False):
account_id: Required[str]
- """Account Identifier"""
+ """Identifier."""
expected_disposition: Required[Literal["NONE", "BULK", "MALICIOUS", "SPAM", "SPOOF", "SUSPICIOUS"]]
- submission: bool
- """When true, search the submissions datastore only.
-
- When false or omitted, search the regular datastore only.
- """
-
eml_content: str
- """Base64 encoded content of the EML file"""
+ """Base64 encoded content of the EML file."""
escalated_submission_id: str
diff --git a/src/cloudflare/types/email_security/investigate/release_bulk_params.py b/src/cloudflare/types/email_security/investigate/release_bulk_params.py
index fa6f4ef65b3..80b195efca0 100644
--- a/src/cloudflare/types/email_security/investigate/release_bulk_params.py
+++ b/src/cloudflare/types/email_security/investigate/release_bulk_params.py
@@ -11,7 +11,6 @@
class ReleaseBulkParams(TypedDict, total=False):
account_id: Required[str]
- """Account Identifier"""
+ """Identifier."""
body: Required[SequenceNotStr[str]]
- """A list of messages identfied by their `postfix_id`s that should be released."""
diff --git a/src/cloudflare/types/email_security/investigate/release_bulk_response.py b/src/cloudflare/types/email_security/investigate/release_bulk_response.py
index b766ac7b3f0..26dcb001d44 100644
--- a/src/cloudflare/types/email_security/investigate/release_bulk_response.py
+++ b/src/cloudflare/types/email_security/investigate/release_bulk_response.py
@@ -9,12 +9,13 @@
class ReleaseBulkResponse(BaseModel):
id: str
-
- postfix_id: str
- """The identifier of the message."""
+ """Unique identifier for a message retrieved from investigation"""
delivered: Optional[List[str]] = None
failed: Optional[List[str]] = None
+ postfix_id: Optional[str] = None
+ """Deprecated, use `id` instead. End of life: November 1, 2026."""
+
undelivered: Optional[List[str]] = None
diff --git a/src/cloudflare/types/email_security/investigate/trace_get_response.py b/src/cloudflare/types/email_security/investigate/trace_get_response.py
index 98bce7e2bd2..c62405ddd96 100644
--- a/src/cloudflare/types/email_security/investigate/trace_get_response.py
+++ b/src/cloudflare/types/email_security/investigate/trace_get_response.py
@@ -9,11 +9,15 @@
class InboundLine(BaseModel):
- lineno: int
+ lineno: Optional[int] = None
+ """Line number in the trace log"""
- message: str
+ logged_at: Optional[datetime] = None
- ts: datetime
+ message: Optional[str] = None
+
+ ts: Optional[str] = None
+ """Deprecated, use `logged_at` instead. End of life: November 1, 2026."""
class Inbound(BaseModel):
@@ -23,11 +27,15 @@ class Inbound(BaseModel):
class OutboundLine(BaseModel):
- lineno: int
+ lineno: Optional[int] = None
+ """Line number in the trace log"""
+
+ logged_at: Optional[datetime] = None
- message: str
+ message: Optional[str] = None
- ts: datetime
+ ts: Optional[str] = None
+ """Deprecated, use `logged_at` instead. End of life: November 1, 2026."""
class Outbound(BaseModel):
diff --git a/src/cloudflare/types/email_security/investigate_get_params.py b/src/cloudflare/types/email_security/investigate_get_params.py
index 083388f1cad..bf009131acd 100644
--- a/src/cloudflare/types/email_security/investigate_get_params.py
+++ b/src/cloudflare/types/email_security/investigate_get_params.py
@@ -9,7 +9,7 @@
class InvestigateGetParams(TypedDict, total=False):
account_id: Required[str]
- """Account Identifier"""
+ """Identifier."""
submission: bool
"""When true, search the submissions datastore only.
diff --git a/src/cloudflare/types/email_security/investigate_get_response.py b/src/cloudflare/types/email_security/investigate_get_response.py
index 1396753de51..778fe7f2540 100644
--- a/src/cloudflare/types/email_security/investigate_get_response.py
+++ b/src/cloudflare/types/email_security/investigate_get_response.py
@@ -8,11 +8,41 @@
from ..._models import BaseModel
-__all__ = ["InvestigateGetResponse", "Properties", "Finding", "Validation"]
+__all__ = ["InvestigateGetResponse", "ActionLog", "ActionLogProperties", "Properties", "Finding", "Validation"]
+
+
+class ActionLogProperties(BaseModel):
+ """Additional properties for the action"""
+
+ folder: Optional[str] = None
+ """Target folder for move operations"""
+
+ requested_by: Optional[str] = None
+ """User who requested the action"""
+
+
+class ActionLog(BaseModel):
+ completed_at: datetime
+ """Timestamp when action completed"""
+
+ operation: Literal["MOVE", "RELEASE", "RECLASSIFY", "SUBMISSION", "QUARANTINE_RELEASE", "PREVIEW"]
+ """Type of action performed"""
+
+ completed_timestamp: Optional[str] = None
+ """Deprecated, use `completed_at` instead. End of life: November 1, 2026."""
+
+ properties: Optional[ActionLogProperties] = None
+ """Additional properties for the action"""
+
+ status: Optional[str] = None
+ """Status of the action"""
class Properties(BaseModel):
+ """Message processing properties"""
+
allowlisted_pattern: Optional[str] = None
+ """Pattern that allowlisted this message"""
allowlisted_pattern_type: Optional[
Literal[
@@ -26,10 +56,13 @@ class Properties(BaseModel):
"outbound_ndr",
]
] = None
+ """Type of allowlist pattern"""
blocklisted_message: Optional[bool] = None
+ """Whether message was blocklisted"""
blocklisted_pattern: Optional[str] = None
+ """Pattern that blocklisted this message"""
whitelisted_pattern_type: Optional[
Literal[
@@ -43,6 +76,7 @@ class Properties(BaseModel):
"outbound_ndr",
]
] = None
+ """Legacy field for allowlist pattern type"""
class Finding(BaseModel):
@@ -90,9 +124,13 @@ class Validation(BaseModel):
class InvestigateGetResponse(BaseModel):
id: str
+ """Unique identifier for a message retrieved from investigation"""
+
+ action_log: List[ActionLog]
+ """Deprecated, use `GET /investigate/{investigate_id}/action_log` instead.
- action_log: object
- """Deprecated: use `/investigate/{id}/action_log` instead."""
+ End of life: November 1, 2026.
+ """
client_recipients: List[str]
@@ -103,12 +141,13 @@ class InvestigateGetResponse(BaseModel):
is_quarantined: bool
postfix_id: str
- """The identifier of the message."""
+ """The identifier of the message"""
properties: Properties
+ """Message processing properties"""
ts: str
- """Deprecated, use `scanned_at` instead"""
+ """Deprecated, use `scanned_at` instead. End of life: November 1, 2026."""
alert_id: Optional[str] = None
@@ -154,7 +193,11 @@ class InvestigateGetResponse(BaseModel):
] = None
findings: Optional[List[Finding]] = None
- """Deprecated: use `/investigate/{id}/detections` instead."""
+ """
+ Deprecated, use the `findings` field from
+ `GET /investigate/{investigate_id}/detections` instead. End of life: November
+ 1, 2026. Detection findings for this message.
+ """
from_: Optional[str] = FieldInfo(alias="from", default=None)
@@ -165,17 +208,19 @@ class InvestigateGetResponse(BaseModel):
message_id: Optional[str] = None
post_delivery_operations: Optional[List[Literal["PREVIEW", "QUARANTINE_RELEASE", "SUBMISSION", "MOVE"]]] = None
+ """Post-delivery operations performed on this message"""
postfix_id_outbound: Optional[str] = None
replyto: Optional[str] = None
scanned_at: Optional[datetime] = None
+ """When the message was scanned (UTC)"""
sent_at: Optional[datetime] = None
+ """When the message was sent (UTC)"""
sent_date: Optional[str] = None
- """Deprecated, use `sent_at` instead"""
subject: Optional[str] = None
diff --git a/src/cloudflare/types/email_security/investigate_list_params.py b/src/cloudflare/types/email_security/investigate_list_params.py
index 53d42d0d208..6cb7270dabb 100644
--- a/src/cloudflare/types/email_security/investigate_list_params.py
+++ b/src/cloudflare/types/email_security/investigate_list_params.py
@@ -13,90 +13,48 @@
class InvestigateListParams(TypedDict, total=False):
account_id: Required[str]
- """Account Identifier"""
+ """Identifier."""
action_log: bool
- """Determines if the message action log is included in the response."""
+ """Whether to include the message action log in the response."""
alert_id: str
cursor: str
detections_only: bool
- """Determines if the search results will include detections or not."""
+ """Whether to include only detections in search results."""
domain: str
- """
- Filter by a domain found in the email: sender domain, recipient domain, or a
- domain in a link.
- """
+ """Sender domains to filter by."""
end: Annotated[Union[str, datetime], PropertyInfo(format="iso8601")]
- """The end of the search date range. Defaults to `now` if not provided."""
-
- exact_subject: str
- """Search for messages with an exact subject match."""
+ """The end of the search date range. Defaults to `now`."""
final_disposition: Literal["MALICIOUS", "SUSPICIOUS", "SPOOF", "SPAM", "BULK", "NONE"]
- """The dispositions the search filters by."""
+ """Dispositions to filter by."""
- message_action: Literal["PREVIEW", "QUARANTINE_RELEASED", "MOVED", "SUBMITTED"]
- """The message actions the search filters by."""
+ message_action: Literal["PREVIEW", "QUARANTINE_RELEASED", "MOVED"]
+ """Message actions to filter by."""
message_id: str
metric: str
page: Optional[int]
- """Deprecated: Use cursor pagination instead."""
+ """Deprecated: Use cursor pagination instead. End of life: November 1, 2026."""
per_page: int
"""The number of results per page. Maximum value is 1000."""
query: str
- """The space-delimited term used in the query. The search is case-insensitive.
-
- The content of the following email metadata fields are searched:
-
- - alert_id
- - CC
- - From (envelope_from)
- - From Name
- - final_disposition
- - md5 hash (of any attachment)
- - sha1 hash (of any attachment)
- - sha256 hash (of any attachment)
- - name (of any attachment)
- - Reason
- - Received DateTime (yyyy-mm-ddThh:mm:ss)
- - Sent DateTime (yyyy-mm-ddThh:mm:ss)
- - ReplyTo
- - To (envelope_to)
- - To Name
- - Message-ID
- - smtp_helo_server_ip
- - smtp_previous_hop_ip
- - x_originating_ip
- - Subject
- """
+ """Space-delimited search term. Case-insensitive."""
recipient: str
- """Filter by recipient. Matches either an email address or a domain."""
sender: str
- """Filter by sender. Matches either an email address or a domain."""
start: Annotated[Union[str, datetime], PropertyInfo(format="iso8601")]
- """
- The beginning of the search date range. Defaults to `now - 30 days` if not
- provided.
- """
+ """The beginning of the search date range. Defaults to `now - 30 days`."""
subject: str
- """
- Search for messages containing individual keywords in any order within the
- subject.
- """
-
- submissions: bool
- """Search for submissions instead of original messages"""
diff --git a/src/cloudflare/types/email_security/investigate_list_response.py b/src/cloudflare/types/email_security/investigate_list_response.py
index 12c5ae7cb75..d13d2fb80dd 100644
--- a/src/cloudflare/types/email_security/investigate_list_response.py
+++ b/src/cloudflare/types/email_security/investigate_list_response.py
@@ -8,11 +8,41 @@
from ..._models import BaseModel
-__all__ = ["InvestigateListResponse", "Properties", "Finding", "Validation"]
+__all__ = ["InvestigateListResponse", "ActionLog", "ActionLogProperties", "Properties", "Finding", "Validation"]
+
+
+class ActionLogProperties(BaseModel):
+ """Additional properties for the action"""
+
+ folder: Optional[str] = None
+ """Target folder for move operations"""
+
+ requested_by: Optional[str] = None
+ """User who requested the action"""
+
+
+class ActionLog(BaseModel):
+ completed_at: datetime
+ """Timestamp when action completed"""
+
+ operation: Literal["MOVE", "RELEASE", "RECLASSIFY", "SUBMISSION", "QUARANTINE_RELEASE", "PREVIEW"]
+ """Type of action performed"""
+
+ completed_timestamp: Optional[str] = None
+ """Deprecated, use `completed_at` instead. End of life: November 1, 2026."""
+
+ properties: Optional[ActionLogProperties] = None
+ """Additional properties for the action"""
+
+ status: Optional[str] = None
+ """Status of the action"""
class Properties(BaseModel):
+ """Message processing properties"""
+
allowlisted_pattern: Optional[str] = None
+ """Pattern that allowlisted this message"""
allowlisted_pattern_type: Optional[
Literal[
@@ -26,10 +56,13 @@ class Properties(BaseModel):
"outbound_ndr",
]
] = None
+ """Type of allowlist pattern"""
blocklisted_message: Optional[bool] = None
+ """Whether message was blocklisted"""
blocklisted_pattern: Optional[str] = None
+ """Pattern that blocklisted this message"""
whitelisted_pattern_type: Optional[
Literal[
@@ -43,6 +76,7 @@ class Properties(BaseModel):
"outbound_ndr",
]
] = None
+ """Legacy field for allowlist pattern type"""
class Finding(BaseModel):
@@ -90,9 +124,13 @@ class Validation(BaseModel):
class InvestigateListResponse(BaseModel):
id: str
+ """Unique identifier for a message retrieved from investigation"""
+
+ action_log: List[ActionLog]
+ """Deprecated, use `GET /investigate/{investigate_id}/action_log` instead.
- action_log: object
- """Deprecated: use `/investigate/{id}/action_log` instead."""
+ End of life: November 1, 2026.
+ """
client_recipients: List[str]
@@ -103,12 +141,13 @@ class InvestigateListResponse(BaseModel):
is_quarantined: bool
postfix_id: str
- """The identifier of the message."""
+ """The identifier of the message"""
properties: Properties
+ """Message processing properties"""
ts: str
- """Deprecated, use `scanned_at` instead"""
+ """Deprecated, use `scanned_at` instead. End of life: November 1, 2026."""
alert_id: Optional[str] = None
@@ -154,7 +193,11 @@ class InvestigateListResponse(BaseModel):
] = None
findings: Optional[List[Finding]] = None
- """Deprecated: use `/investigate/{id}/detections` instead."""
+ """
+ Deprecated, use the `findings` field from
+ `GET /investigate/{investigate_id}/detections` instead. End of life: November
+ 1, 2026. Detection findings for this message.
+ """
from_: Optional[str] = FieldInfo(alias="from", default=None)
@@ -165,17 +208,19 @@ class InvestigateListResponse(BaseModel):
message_id: Optional[str] = None
post_delivery_operations: Optional[List[Literal["PREVIEW", "QUARANTINE_RELEASE", "SUBMISSION", "MOVE"]]] = None
+ """Post-delivery operations performed on this message"""
postfix_id_outbound: Optional[str] = None
replyto: Optional[str] = None
scanned_at: Optional[datetime] = None
+ """When the message was scanned (UTC)"""
sent_at: Optional[datetime] = None
+ """When the message was sent (UTC)"""
sent_date: Optional[str] = None
- """Deprecated, use `sent_at` instead"""
subject: Optional[str] = None
diff --git a/src/cloudflare/types/email_security/phishguard/report_list_params.py b/src/cloudflare/types/email_security/phishguard/report_list_params.py
index d138ab6e96c..7f8fd4a7254 100644
--- a/src/cloudflare/types/email_security/phishguard/report_list_params.py
+++ b/src/cloudflare/types/email_security/phishguard/report_list_params.py
@@ -13,14 +13,16 @@
class ReportListParams(TypedDict, total=False):
account_id: Required[str]
- """Account Identifier"""
+ """Identifier."""
end: Annotated[Union[str, datetime], PropertyInfo(format="iso8601")]
- """The end of the search date range (RFC3339 format)."""
+ """End of the time range (RFC3339). Takes precedence over to_date."""
from_date: Annotated[Union[str, date], PropertyInfo(format="iso8601")]
+ """Deprecated, use `start` instead. Start date in YYYY-MM-DD format."""
start: Annotated[Union[str, datetime], PropertyInfo(format="iso8601")]
- """The beginning of the search date range (RFC3339 format)."""
+ """Start of the time range (RFC3339). Takes precedence over from_date."""
to_date: Annotated[Union[str, date], PropertyInfo(format="iso8601")]
+ """Deprecated, use `end` instead. End date in YYYY-MM-DD format."""
diff --git a/src/cloudflare/types/email_security/phishguard/report_list_response.py b/src/cloudflare/types/email_security/phishguard/report_list_response.py
index 2f8b6b21cf2..c97e9941b10 100644
--- a/src/cloudflare/types/email_security/phishguard/report_list_response.py
+++ b/src/cloudflare/types/email_security/phishguard/report_list_response.py
@@ -14,12 +14,15 @@
class Fields(BaseModel):
to: List[str]
- ts: datetime
-
from_: Optional[str] = FieldInfo(alias="from", default=None)
+ occurred_at: Optional[datetime] = None
+
postfix_id: Optional[str] = None
+ ts: Optional[datetime] = None
+ """Deprecated, use `occurred_at` instead"""
+
class Tag(BaseModel):
category: str
@@ -32,8 +35,6 @@ class ReportListResponse(BaseModel):
content: str
- created_at: datetime
-
disposition: Literal[
"MALICIOUS", "MALICIOUS-BEC", "SUSPICIOUS", "SPOOF", "SPAM", "BULK", "ENCRYPTED", "EXTERNAL", "UNKNOWN", "NONE"
]
@@ -44,8 +45,11 @@ class ReportListResponse(BaseModel):
title: str
- ts: datetime
-
- updated_at: datetime
+ created_at: Optional[datetime] = None
tags: Optional[List[Tag]] = None
+
+ ts: Optional[datetime] = None
+ """Deprecated, use `created_at` instead"""
+
+ updated_at: Optional[datetime] = None
diff --git a/src/cloudflare/types/email_security/settings/__init__.py b/src/cloudflare/types/email_security/settings/__init__.py
index 26c5fc41f06..3cdacd3f71b 100644
--- a/src/cloudflare/types/email_security/settings/__init__.py
+++ b/src/cloudflare/types/email_security/settings/__init__.py
@@ -22,7 +22,6 @@
from .block_sender_list_response import BlockSenderListResponse as BlockSenderListResponse
from .trusted_domain_edit_params import TrustedDomainEditParams as TrustedDomainEditParams
from .trusted_domain_list_params import TrustedDomainListParams as TrustedDomainListParams
-from .domain_bulk_delete_response import DomainBulkDeleteResponse as DomainBulkDeleteResponse
from .trusted_domain_get_response import TrustedDomainGetResponse as TrustedDomainGetResponse
from .allow_policy_create_response import AllowPolicyCreateResponse as AllowPolicyCreateResponse
from .allow_policy_delete_response import AllowPolicyDeleteResponse as AllowPolicyDeleteResponse
diff --git a/src/cloudflare/types/email_security/settings/allow_policy_create_params.py b/src/cloudflare/types/email_security/settings/allow_policy_create_params.py
index 9c0e132e1b2..fed310a2694 100644
--- a/src/cloudflare/types/email_security/settings/allow_policy_create_params.py
+++ b/src/cloudflare/types/email_security/settings/allow_policy_create_params.py
@@ -10,37 +10,53 @@
class AllowPolicyCreateParams(TypedDict, total=False):
account_id: Required[str]
- """Account Identifier"""
+ """Identifier."""
is_acceptable_sender: Required[bool]
"""
Messages from this sender will be exempted from Spam, Spoof and Bulk
- dispositions. Note: This will not exempt messages with Malicious or Suspicious
+ dispositions. Note - This will not exempt messages with Malicious or Suspicious
dispositions.
"""
is_exempt_recipient: Required[bool]
- """Messages to this recipient will bypass all detections."""
+ """Messages to this recipient will bypass all detections"""
is_regex: Required[bool]
is_trusted_sender: Required[bool]
- """Messages from this sender will bypass all detections and link following."""
+ """Messages from this sender will bypass all detections and link following"""
pattern: Required[str]
pattern_type: Required[Literal["EMAIL", "DOMAIN", "IP", "UNKNOWN"]]
+ """
+ Type of pattern matching. Note: UNKNOWN is deprecated and cannot be used when
+ creating or updating policies, but may be returned for existing entries.
+ """
verify_sender: Required[bool]
- """
- Enforce DMARC, SPF or DKIM authentication. When on, Email Security only honors
- policies that pass authentication.
+ """Enforce DMARC, SPF or DKIM authentication.
+
+ When on, Email Security only honors policies that pass authentication.
"""
comments: Optional[str]
is_recipient: bool
+ """Deprecated as of July 1, 2025.
+
+ Use `is_exempt_recipient` instead. End of life: July 1, 2026.
+ """
is_sender: bool
+ """Deprecated as of July 1, 2025.
+
+ Use `is_trusted_sender` instead. End of life: July 1, 2026.
+ """
is_spoof: bool
+ """Deprecated as of July 1, 2025.
+
+ Use `is_acceptable_sender` instead. End of life: July 1, 2026.
+ """
diff --git a/src/cloudflare/types/email_security/settings/allow_policy_create_response.py b/src/cloudflare/types/email_security/settings/allow_policy_create_response.py
index 312ff7e2a7c..de5da6c4541 100644
--- a/src/cloudflare/types/email_security/settings/allow_policy_create_response.py
+++ b/src/cloudflare/types/email_security/settings/allow_policy_create_response.py
@@ -10,42 +10,63 @@
class AllowPolicyCreateResponse(BaseModel):
- id: int
- """The unique identifier for the allow policy."""
+ """An email allow policy"""
+
+ id: str
+ """Allow policy identifier"""
created_at: datetime
- is_acceptable_sender: bool
+ last_modified: datetime
+ """Deprecated, use `modified_at` instead. End of life: November 1, 2026."""
+
+ comments: Optional[str] = None
+
+ is_acceptable_sender: Optional[bool] = None
"""
Messages from this sender will be exempted from Spam, Spoof and Bulk
- dispositions. Note: This will not exempt messages with Malicious or Suspicious
+ dispositions. Note - This will not exempt messages with Malicious or Suspicious
dispositions.
"""
- is_exempt_recipient: bool
- """Messages to this recipient will bypass all detections."""
-
- is_regex: bool
+ is_exempt_recipient: Optional[bool] = None
+ """Messages to this recipient will bypass all detections"""
- is_trusted_sender: bool
- """Messages from this sender will bypass all detections and link following."""
+ is_recipient: Optional[bool] = None
+ """Deprecated as of July 1, 2025.
- last_modified: datetime
+ Use `is_exempt_recipient` instead. End of life: July 1, 2026.
+ """
- pattern: str
+ is_regex: Optional[bool] = None
- pattern_type: Literal["EMAIL", "DOMAIN", "IP", "UNKNOWN"]
+ is_sender: Optional[bool] = None
+ """Deprecated as of July 1, 2025.
- verify_sender: bool
+ Use `is_trusted_sender` instead. End of life: July 1, 2026.
"""
- Enforce DMARC, SPF or DKIM authentication. When on, Email Security only honors
- policies that pass authentication.
+
+ is_spoof: Optional[bool] = None
+ """Deprecated as of July 1, 2025.
+
+ Use `is_acceptable_sender` instead. End of life: July 1, 2026.
"""
- comments: Optional[str] = None
+ is_trusted_sender: Optional[bool] = None
+ """Messages from this sender will bypass all detections and link following"""
- is_recipient: Optional[bool] = None
+ modified_at: Optional[datetime] = None
- is_sender: Optional[bool] = None
+ pattern: Optional[str] = None
- is_spoof: Optional[bool] = None
+ pattern_type: Optional[Literal["EMAIL", "DOMAIN", "IP", "UNKNOWN"]] = None
+ """
+ Type of pattern matching. Note: UNKNOWN is deprecated and cannot be used when
+ creating or updating policies, but may be returned for existing entries.
+ """
+
+ verify_sender: Optional[bool] = None
+ """Enforce DMARC, SPF or DKIM authentication.
+
+ When on, Email Security only honors policies that pass authentication.
+ """
diff --git a/src/cloudflare/types/email_security/settings/allow_policy_delete_response.py b/src/cloudflare/types/email_security/settings/allow_policy_delete_response.py
index 38627fc0c30..d46f059d358 100644
--- a/src/cloudflare/types/email_security/settings/allow_policy_delete_response.py
+++ b/src/cloudflare/types/email_security/settings/allow_policy_delete_response.py
@@ -6,5 +6,5 @@
class AllowPolicyDeleteResponse(BaseModel):
- id: int
- """The unique identifier for the allow policy."""
+ id: str
+ """Allow policy identifier"""
diff --git a/src/cloudflare/types/email_security/settings/allow_policy_edit_params.py b/src/cloudflare/types/email_security/settings/allow_policy_edit_params.py
index 6b4de29a3bb..b9d37e6e6f5 100644
--- a/src/cloudflare/types/email_security/settings/allow_policy_edit_params.py
+++ b/src/cloudflare/types/email_security/settings/allow_policy_edit_params.py
@@ -10,31 +10,53 @@
class AllowPolicyEditParams(TypedDict, total=False):
account_id: Required[str]
- """Account Identifier"""
+ """Identifier."""
comments: Optional[str]
- is_acceptable_sender: Optional[bool]
+ is_acceptable_sender: bool
"""
Messages from this sender will be exempted from Spam, Spoof and Bulk
- dispositions. Note: This will not exempt messages with Malicious or Suspicious
+ dispositions. Note - This will not exempt messages with Malicious or Suspicious
dispositions.
"""
- is_exempt_recipient: Optional[bool]
- """Messages to this recipient will bypass all detections."""
+ is_exempt_recipient: bool
+ """Messages to this recipient will bypass all detections"""
- is_regex: Optional[bool]
+ is_recipient: bool
+ """Deprecated as of July 1, 2025.
- is_trusted_sender: Optional[bool]
- """Messages from this sender will bypass all detections and link following."""
+ Use `is_exempt_recipient` instead. End of life: July 1, 2026.
+ """
+
+ is_regex: bool
+
+ is_sender: bool
+ """Deprecated as of July 1, 2025.
- pattern: Optional[str]
+ Use `is_trusted_sender` instead. End of life: July 1, 2026.
+ """
- pattern_type: Optional[Literal["EMAIL", "DOMAIN", "IP", "UNKNOWN"]]
+ is_spoof: bool
+ """Deprecated as of July 1, 2025.
- verify_sender: Optional[bool]
+ Use `is_acceptable_sender` instead. End of life: July 1, 2026.
"""
- Enforce DMARC, SPF or DKIM authentication. When on, Email Security only honors
- policies that pass authentication.
+
+ is_trusted_sender: bool
+ """Messages from this sender will bypass all detections and link following"""
+
+ pattern: str
+
+ pattern_type: Literal["EMAIL", "DOMAIN", "IP", "UNKNOWN"]
+ """
+ Type of pattern matching. Note: UNKNOWN is deprecated and cannot be used when
+ creating or updating policies, but may be returned for existing entries.
+ """
+
+ verify_sender: bool
+ """Enforce DMARC, SPF or DKIM authentication.
+
+ When on, Email Security only honors policies that pass authentication.
"""
diff --git a/src/cloudflare/types/email_security/settings/allow_policy_edit_response.py b/src/cloudflare/types/email_security/settings/allow_policy_edit_response.py
index eb66126b593..ed1743f4f0a 100644
--- a/src/cloudflare/types/email_security/settings/allow_policy_edit_response.py
+++ b/src/cloudflare/types/email_security/settings/allow_policy_edit_response.py
@@ -10,42 +10,63 @@
class AllowPolicyEditResponse(BaseModel):
- id: int
- """The unique identifier for the allow policy."""
+ """An email allow policy"""
+
+ id: str
+ """Allow policy identifier"""
created_at: datetime
- is_acceptable_sender: bool
+ last_modified: datetime
+ """Deprecated, use `modified_at` instead. End of life: November 1, 2026."""
+
+ comments: Optional[str] = None
+
+ is_acceptable_sender: Optional[bool] = None
"""
Messages from this sender will be exempted from Spam, Spoof and Bulk
- dispositions. Note: This will not exempt messages with Malicious or Suspicious
+ dispositions. Note - This will not exempt messages with Malicious or Suspicious
dispositions.
"""
- is_exempt_recipient: bool
- """Messages to this recipient will bypass all detections."""
-
- is_regex: bool
+ is_exempt_recipient: Optional[bool] = None
+ """Messages to this recipient will bypass all detections"""
- is_trusted_sender: bool
- """Messages from this sender will bypass all detections and link following."""
+ is_recipient: Optional[bool] = None
+ """Deprecated as of July 1, 2025.
- last_modified: datetime
+ Use `is_exempt_recipient` instead. End of life: July 1, 2026.
+ """
- pattern: str
+ is_regex: Optional[bool] = None
- pattern_type: Literal["EMAIL", "DOMAIN", "IP", "UNKNOWN"]
+ is_sender: Optional[bool] = None
+ """Deprecated as of July 1, 2025.
- verify_sender: bool
+ Use `is_trusted_sender` instead. End of life: July 1, 2026.
"""
- Enforce DMARC, SPF or DKIM authentication. When on, Email Security only honors
- policies that pass authentication.
+
+ is_spoof: Optional[bool] = None
+ """Deprecated as of July 1, 2025.
+
+ Use `is_acceptable_sender` instead. End of life: July 1, 2026.
"""
- comments: Optional[str] = None
+ is_trusted_sender: Optional[bool] = None
+ """Messages from this sender will bypass all detections and link following"""
- is_recipient: Optional[bool] = None
+ modified_at: Optional[datetime] = None
- is_sender: Optional[bool] = None
+ pattern: Optional[str] = None
- is_spoof: Optional[bool] = None
+ pattern_type: Optional[Literal["EMAIL", "DOMAIN", "IP", "UNKNOWN"]] = None
+ """
+ Type of pattern matching. Note: UNKNOWN is deprecated and cannot be used when
+ creating or updating policies, but may be returned for existing entries.
+ """
+
+ verify_sender: Optional[bool] = None
+ """Enforce DMARC, SPF or DKIM authentication.
+
+ When on, Email Security only honors policies that pass authentication.
+ """
diff --git a/src/cloudflare/types/email_security/settings/allow_policy_get_response.py b/src/cloudflare/types/email_security/settings/allow_policy_get_response.py
index e9cb0384cf3..c2cb6e12603 100644
--- a/src/cloudflare/types/email_security/settings/allow_policy_get_response.py
+++ b/src/cloudflare/types/email_security/settings/allow_policy_get_response.py
@@ -10,42 +10,63 @@
class AllowPolicyGetResponse(BaseModel):
- id: int
- """The unique identifier for the allow policy."""
+ """An email allow policy"""
+
+ id: str
+ """Allow policy identifier"""
created_at: datetime
- is_acceptable_sender: bool
+ last_modified: datetime
+ """Deprecated, use `modified_at` instead. End of life: November 1, 2026."""
+
+ comments: Optional[str] = None
+
+ is_acceptable_sender: Optional[bool] = None
"""
Messages from this sender will be exempted from Spam, Spoof and Bulk
- dispositions. Note: This will not exempt messages with Malicious or Suspicious
+ dispositions. Note - This will not exempt messages with Malicious or Suspicious
dispositions.
"""
- is_exempt_recipient: bool
- """Messages to this recipient will bypass all detections."""
-
- is_regex: bool
+ is_exempt_recipient: Optional[bool] = None
+ """Messages to this recipient will bypass all detections"""
- is_trusted_sender: bool
- """Messages from this sender will bypass all detections and link following."""
+ is_recipient: Optional[bool] = None
+ """Deprecated as of July 1, 2025.
- last_modified: datetime
+ Use `is_exempt_recipient` instead. End of life: July 1, 2026.
+ """
- pattern: str
+ is_regex: Optional[bool] = None
- pattern_type: Literal["EMAIL", "DOMAIN", "IP", "UNKNOWN"]
+ is_sender: Optional[bool] = None
+ """Deprecated as of July 1, 2025.
- verify_sender: bool
+ Use `is_trusted_sender` instead. End of life: July 1, 2026.
"""
- Enforce DMARC, SPF or DKIM authentication. When on, Email Security only honors
- policies that pass authentication.
+
+ is_spoof: Optional[bool] = None
+ """Deprecated as of July 1, 2025.
+
+ Use `is_acceptable_sender` instead. End of life: July 1, 2026.
"""
- comments: Optional[str] = None
+ is_trusted_sender: Optional[bool] = None
+ """Messages from this sender will bypass all detections and link following"""
- is_recipient: Optional[bool] = None
+ modified_at: Optional[datetime] = None
- is_sender: Optional[bool] = None
+ pattern: Optional[str] = None
- is_spoof: Optional[bool] = None
+ pattern_type: Optional[Literal["EMAIL", "DOMAIN", "IP", "UNKNOWN"]] = None
+ """
+ Type of pattern matching. Note: UNKNOWN is deprecated and cannot be used when
+ creating or updating policies, but may be returned for existing entries.
+ """
+
+ verify_sender: Optional[bool] = None
+ """Enforce DMARC, SPF or DKIM authentication.
+
+ When on, Email Security only honors policies that pass authentication.
+ """
diff --git a/src/cloudflare/types/email_security/settings/allow_policy_list_params.py b/src/cloudflare/types/email_security/settings/allow_policy_list_params.py
index 85380271064..5c57fcb71a4 100644
--- a/src/cloudflare/types/email_security/settings/allow_policy_list_params.py
+++ b/src/cloudflare/types/email_security/settings/allow_policy_list_params.py
@@ -9,41 +9,48 @@
class AllowPolicyListParams(TypedDict, total=False):
account_id: Required[str]
- """Account Identifier"""
+ """Identifier."""
direction: Literal["asc", "desc"]
"""The sorting direction."""
is_acceptable_sender: bool
+ """
+ Filter to show only policies where messages from the sender are exempted from
+ Spam, Spoof, and Bulk dispositions (not Malicious or Suspicious).
+ """
is_exempt_recipient: bool
-
- is_recipient: bool
-
- is_sender: bool
-
- is_spoof: bool
+ """
+ Filter to show only policies where messages to the recipient bypass all
+ detections.
+ """
is_trusted_sender: bool
+ """
+ Filter to show only policies where messages from the sender bypass all
+ detections and link following.
+ """
order: Literal["pattern", "created_at"]
- """The field to sort by."""
+ """Field to sort by."""
page: int
- """The page number of paginated results."""
+ """Current page within paginated list of results."""
pattern: str
pattern_type: Literal["EMAIL", "DOMAIN", "IP", "UNKNOWN"]
+ """
+ Type of pattern matching. Note: UNKNOWN is deprecated and cannot be used when
+ creating or updating policies, but may be returned for existing entries.
+ """
per_page: int
- """The number of results per page."""
+ """The number of results per page. Maximum value is 1000."""
search: str
- """
- Allows searching in multiple properties of a record simultaneously. This
- parameter is intended for human users, not automation. Its exact behavior is
- intentionally left unspecified and is subject to change in the future.
- """
+ """Search term for filtering records. Behavior may change."""
verify_sender: bool
+ """Filter to show only policies that enforce DMARC, SPF, or DKIM authentication."""
diff --git a/src/cloudflare/types/email_security/settings/allow_policy_list_response.py b/src/cloudflare/types/email_security/settings/allow_policy_list_response.py
index 9b4c57f2a22..9e77c75eccc 100644
--- a/src/cloudflare/types/email_security/settings/allow_policy_list_response.py
+++ b/src/cloudflare/types/email_security/settings/allow_policy_list_response.py
@@ -10,42 +10,63 @@
class AllowPolicyListResponse(BaseModel):
- id: int
- """The unique identifier for the allow policy."""
+ """An email allow policy"""
+
+ id: str
+ """Allow policy identifier"""
created_at: datetime
- is_acceptable_sender: bool
+ last_modified: datetime
+ """Deprecated, use `modified_at` instead. End of life: November 1, 2026."""
+
+ comments: Optional[str] = None
+
+ is_acceptable_sender: Optional[bool] = None
"""
Messages from this sender will be exempted from Spam, Spoof and Bulk
- dispositions. Note: This will not exempt messages with Malicious or Suspicious
+ dispositions. Note - This will not exempt messages with Malicious or Suspicious
dispositions.
"""
- is_exempt_recipient: bool
- """Messages to this recipient will bypass all detections."""
-
- is_regex: bool
+ is_exempt_recipient: Optional[bool] = None
+ """Messages to this recipient will bypass all detections"""
- is_trusted_sender: bool
- """Messages from this sender will bypass all detections and link following."""
+ is_recipient: Optional[bool] = None
+ """Deprecated as of July 1, 2025.
- last_modified: datetime
+ Use `is_exempt_recipient` instead. End of life: July 1, 2026.
+ """
- pattern: str
+ is_regex: Optional[bool] = None
- pattern_type: Literal["EMAIL", "DOMAIN", "IP", "UNKNOWN"]
+ is_sender: Optional[bool] = None
+ """Deprecated as of July 1, 2025.
- verify_sender: bool
+ Use `is_trusted_sender` instead. End of life: July 1, 2026.
"""
- Enforce DMARC, SPF or DKIM authentication. When on, Email Security only honors
- policies that pass authentication.
+
+ is_spoof: Optional[bool] = None
+ """Deprecated as of July 1, 2025.
+
+ Use `is_acceptable_sender` instead. End of life: July 1, 2026.
"""
- comments: Optional[str] = None
+ is_trusted_sender: Optional[bool] = None
+ """Messages from this sender will bypass all detections and link following"""
- is_recipient: Optional[bool] = None
+ modified_at: Optional[datetime] = None
- is_sender: Optional[bool] = None
+ pattern: Optional[str] = None
- is_spoof: Optional[bool] = None
+ pattern_type: Optional[Literal["EMAIL", "DOMAIN", "IP", "UNKNOWN"]] = None
+ """
+ Type of pattern matching. Note: UNKNOWN is deprecated and cannot be used when
+ creating or updating policies, but may be returned for existing entries.
+ """
+
+ verify_sender: Optional[bool] = None
+ """Enforce DMARC, SPF or DKIM authentication.
+
+ When on, Email Security only honors policies that pass authentication.
+ """
diff --git a/src/cloudflare/types/email_security/settings/block_sender_create_params.py b/src/cloudflare/types/email_security/settings/block_sender_create_params.py
index dc5290d600f..7b1c5b3a3d0 100644
--- a/src/cloudflare/types/email_security/settings/block_sender_create_params.py
+++ b/src/cloudflare/types/email_security/settings/block_sender_create_params.py
@@ -10,12 +10,16 @@
class BlockSenderCreateParams(TypedDict, total=False):
account_id: Required[str]
- """Account Identifier"""
+ """Identifier."""
is_regex: Required[bool]
pattern: Required[str]
pattern_type: Required[Literal["EMAIL", "DOMAIN", "IP", "UNKNOWN"]]
+ """
+ Type of pattern matching. Note: UNKNOWN is deprecated and cannot be used when
+ creating or updating policies, but may be returned for existing entries.
+ """
comments: Optional[str]
diff --git a/src/cloudflare/types/email_security/settings/block_sender_create_response.py b/src/cloudflare/types/email_security/settings/block_sender_create_response.py
index 615755f8fd7..b3b0d507355 100644
--- a/src/cloudflare/types/email_security/settings/block_sender_create_response.py
+++ b/src/cloudflare/types/email_security/settings/block_sender_create_response.py
@@ -10,17 +10,26 @@
class BlockSenderCreateResponse(BaseModel):
- id: int
- """The unique identifier for the allow policy."""
+ """A blocked sender pattern"""
- created_at: datetime
+ id: Optional[str] = None
+ """Blocked sender pattern identifier"""
- is_regex: bool
+ comments: Optional[str] = None
- last_modified: datetime
+ created_at: Optional[datetime] = None
- pattern: str
+ is_regex: Optional[bool] = None
- pattern_type: Literal["EMAIL", "DOMAIN", "IP", "UNKNOWN"]
+ last_modified: Optional[datetime] = None
+ """Deprecated, use `modified_at` instead. End of life: November 1, 2026."""
- comments: Optional[str] = None
+ modified_at: Optional[datetime] = None
+
+ pattern: Optional[str] = None
+
+ pattern_type: Optional[Literal["EMAIL", "DOMAIN", "IP", "UNKNOWN"]] = None
+ """
+ Type of pattern matching. Note: UNKNOWN is deprecated and cannot be used when
+ creating or updating policies, but may be returned for existing entries.
+ """
diff --git a/src/cloudflare/types/email_security/settings/block_sender_delete_response.py b/src/cloudflare/types/email_security/settings/block_sender_delete_response.py
index ea8337060bf..cf2927b2847 100644
--- a/src/cloudflare/types/email_security/settings/block_sender_delete_response.py
+++ b/src/cloudflare/types/email_security/settings/block_sender_delete_response.py
@@ -6,5 +6,5 @@
class BlockSenderDeleteResponse(BaseModel):
- id: int
- """The unique identifier for the allow policy."""
+ id: str
+ """Blocked sender pattern identifier"""
diff --git a/src/cloudflare/types/email_security/settings/block_sender_edit_params.py b/src/cloudflare/types/email_security/settings/block_sender_edit_params.py
index 19f2d23458a..756f0a1e79e 100644
--- a/src/cloudflare/types/email_security/settings/block_sender_edit_params.py
+++ b/src/cloudflare/types/email_security/settings/block_sender_edit_params.py
@@ -10,12 +10,16 @@
class BlockSenderEditParams(TypedDict, total=False):
account_id: Required[str]
- """Account Identifier"""
+ """Identifier."""
comments: Optional[str]
- is_regex: Optional[bool]
+ is_regex: bool
- pattern: Optional[str]
+ pattern: str
- pattern_type: Optional[Literal["EMAIL", "DOMAIN", "IP", "UNKNOWN"]]
+ pattern_type: Literal["EMAIL", "DOMAIN", "IP", "UNKNOWN"]
+ """
+ Type of pattern matching. Note: UNKNOWN is deprecated and cannot be used when
+ creating or updating policies, but may be returned for existing entries.
+ """
diff --git a/src/cloudflare/types/email_security/settings/block_sender_edit_response.py b/src/cloudflare/types/email_security/settings/block_sender_edit_response.py
index 764d9fd5dee..0ade492c40b 100644
--- a/src/cloudflare/types/email_security/settings/block_sender_edit_response.py
+++ b/src/cloudflare/types/email_security/settings/block_sender_edit_response.py
@@ -10,17 +10,26 @@
class BlockSenderEditResponse(BaseModel):
- id: int
- """The unique identifier for the allow policy."""
+ """A blocked sender pattern"""
- created_at: datetime
+ id: Optional[str] = None
+ """Blocked sender pattern identifier"""
- is_regex: bool
+ comments: Optional[str] = None
- last_modified: datetime
+ created_at: Optional[datetime] = None
- pattern: str
+ is_regex: Optional[bool] = None
- pattern_type: Literal["EMAIL", "DOMAIN", "IP", "UNKNOWN"]
+ last_modified: Optional[datetime] = None
+ """Deprecated, use `modified_at` instead. End of life: November 1, 2026."""
- comments: Optional[str] = None
+ modified_at: Optional[datetime] = None
+
+ pattern: Optional[str] = None
+
+ pattern_type: Optional[Literal["EMAIL", "DOMAIN", "IP", "UNKNOWN"]] = None
+ """
+ Type of pattern matching. Note: UNKNOWN is deprecated and cannot be used when
+ creating or updating policies, but may be returned for existing entries.
+ """
diff --git a/src/cloudflare/types/email_security/settings/block_sender_get_response.py b/src/cloudflare/types/email_security/settings/block_sender_get_response.py
index 66f03f3e3f6..9a513f36a76 100644
--- a/src/cloudflare/types/email_security/settings/block_sender_get_response.py
+++ b/src/cloudflare/types/email_security/settings/block_sender_get_response.py
@@ -10,17 +10,26 @@
class BlockSenderGetResponse(BaseModel):
- id: int
- """The unique identifier for the allow policy."""
+ """A blocked sender pattern"""
- created_at: datetime
+ id: Optional[str] = None
+ """Blocked sender pattern identifier"""
- is_regex: bool
+ comments: Optional[str] = None
- last_modified: datetime
+ created_at: Optional[datetime] = None
- pattern: str
+ is_regex: Optional[bool] = None
- pattern_type: Literal["EMAIL", "DOMAIN", "IP", "UNKNOWN"]
+ last_modified: Optional[datetime] = None
+ """Deprecated, use `modified_at` instead. End of life: November 1, 2026."""
- comments: Optional[str] = None
+ modified_at: Optional[datetime] = None
+
+ pattern: Optional[str] = None
+
+ pattern_type: Optional[Literal["EMAIL", "DOMAIN", "IP", "UNKNOWN"]] = None
+ """
+ Type of pattern matching. Note: UNKNOWN is deprecated and cannot be used when
+ creating or updating policies, but may be returned for existing entries.
+ """
diff --git a/src/cloudflare/types/email_security/settings/block_sender_list_params.py b/src/cloudflare/types/email_security/settings/block_sender_list_params.py
index 712ad5932dd..9c1fe7b8850 100644
--- a/src/cloudflare/types/email_security/settings/block_sender_list_params.py
+++ b/src/cloudflare/types/email_security/settings/block_sender_list_params.py
@@ -9,27 +9,25 @@
class BlockSenderListParams(TypedDict, total=False):
account_id: Required[str]
- """Account Identifier"""
+ """Identifier."""
direction: Literal["asc", "desc"]
"""The sorting direction."""
order: Literal["pattern", "created_at"]
- """The field to sort by."""
+ """Field to sort by."""
page: int
- """The page number of paginated results."""
+ """Current page within paginated list of results."""
pattern: str
+ """Filter by pattern value."""
pattern_type: Literal["EMAIL", "DOMAIN", "IP", "UNKNOWN"]
+ """Filter by pattern type."""
per_page: int
- """The number of results per page."""
+ """The number of results per page. Maximum value is 1000."""
search: str
- """
- Allows searching in multiple properties of a record simultaneously. This
- parameter is intended for human users, not automation. Its exact behavior is
- intentionally left unspecified and is subject to change in the future.
- """
+ """Search term for filtering records. Behavior may change."""
diff --git a/src/cloudflare/types/email_security/settings/block_sender_list_response.py b/src/cloudflare/types/email_security/settings/block_sender_list_response.py
index 497ae4dc93d..10587592feb 100644
--- a/src/cloudflare/types/email_security/settings/block_sender_list_response.py
+++ b/src/cloudflare/types/email_security/settings/block_sender_list_response.py
@@ -10,17 +10,26 @@
class BlockSenderListResponse(BaseModel):
- id: int
- """The unique identifier for the allow policy."""
+ """A blocked sender pattern"""
- created_at: datetime
+ id: Optional[str] = None
+ """Blocked sender pattern identifier"""
- is_regex: bool
+ comments: Optional[str] = None
- last_modified: datetime
+ created_at: Optional[datetime] = None
- pattern: str
+ is_regex: Optional[bool] = None
- pattern_type: Literal["EMAIL", "DOMAIN", "IP", "UNKNOWN"]
+ last_modified: Optional[datetime] = None
+ """Deprecated, use `modified_at` instead. End of life: November 1, 2026."""
- comments: Optional[str] = None
+ modified_at: Optional[datetime] = None
+
+ pattern: Optional[str] = None
+
+ pattern_type: Optional[Literal["EMAIL", "DOMAIN", "IP", "UNKNOWN"]] = None
+ """
+ Type of pattern matching. Note: UNKNOWN is deprecated and cannot be used when
+ creating or updating policies, but may be returned for existing entries.
+ """
diff --git a/src/cloudflare/types/email_security/settings/domain_delete_response.py b/src/cloudflare/types/email_security/settings/domain_delete_response.py
index ab5ea3c8842..13a307fe1e9 100644
--- a/src/cloudflare/types/email_security/settings/domain_delete_response.py
+++ b/src/cloudflare/types/email_security/settings/domain_delete_response.py
@@ -6,5 +6,5 @@
class DomainDeleteResponse(BaseModel):
- id: int
- """The unique identifier for the domain."""
+ id: str
+ """Domain identifier"""
diff --git a/src/cloudflare/types/email_security/settings/domain_edit_params.py b/src/cloudflare/types/email_security/settings/domain_edit_params.py
index bf6dec63309..f05612d8726 100644
--- a/src/cloudflare/types/email_security/settings/domain_edit_params.py
+++ b/src/cloudflare/types/email_security/settings/domain_edit_params.py
@@ -2,7 +2,7 @@
from __future__ import annotations
-from typing import List
+from typing import List, Optional
from typing_extensions import Literal, Required, TypedDict
from ...._types import SequenceNotStr
@@ -12,9 +12,7 @@
class DomainEditParams(TypedDict, total=False):
account_id: Required[str]
- """Account Identifier"""
-
- ip_restrictions: Required[SequenceNotStr[str]]
+ """Identifier."""
allowed_delivery_modes: List[Literal["DIRECT", "BCC", "JOURNAL", "API", "RETRO_SCAN"]]
@@ -37,7 +35,9 @@ class DomainEditParams(TypedDict, total=False):
folder: Literal["AllItems", "Inbox"]
- integration_id: str
+ integration_id: Optional[str]
+
+ ip_restrictions: SequenceNotStr[str]
lookback_hops: int
diff --git a/src/cloudflare/types/email_security/settings/domain_edit_response.py b/src/cloudflare/types/email_security/settings/domain_edit_response.py
index 341b48ed16d..60f594792bb 100644
--- a/src/cloudflare/types/email_security/settings/domain_edit_response.py
+++ b/src/cloudflare/types/email_security/settings/domain_edit_response.py
@@ -26,44 +26,36 @@ class EmailsProcessed(BaseModel):
class DomainEditResponse(BaseModel):
- id: int
- """The unique identifier for the domain."""
-
- allowed_delivery_modes: List[Literal["DIRECT", "BCC", "JOURNAL", "API", "RETRO_SCAN"]]
-
- created_at: datetime
-
- domain: str
-
- drop_dispositions: List[
- Literal[
- "MALICIOUS",
- "MALICIOUS-BEC",
- "SUSPICIOUS",
- "SPOOF",
- "SPAM",
- "BULK",
- "ENCRYPTED",
- "EXTERNAL",
- "UNKNOWN",
- "NONE",
- ]
- ]
-
- ip_restrictions: List[str]
-
- last_modified: datetime
-
- lookback_hops: int
+ id: Optional[str] = None
+ """Domain identifier"""
- regions: List[Literal["GLOBAL", "AU", "DE", "IN", "US"]]
-
- transport: str
+ allowed_delivery_modes: Optional[List[Literal["DIRECT", "BCC", "JOURNAL", "API", "RETRO_SCAN"]]] = None
authorization: Optional[Authorization] = None
+ created_at: Optional[datetime] = None
+
dmarc_status: Optional[Literal["none", "good", "invalid"]] = None
+ domain: Optional[str] = None
+
+ drop_dispositions: Optional[
+ List[
+ Literal[
+ "MALICIOUS",
+ "MALICIOUS-BEC",
+ "SUSPICIOUS",
+ "SPOOF",
+ "SPAM",
+ "BULK",
+ "ENCRYPTED",
+ "EXTERNAL",
+ "UNKNOWN",
+ "NONE",
+ ]
+ ]
+ ] = None
+
emails_processed: Optional[EmailsProcessed] = None
folder: Optional[Literal["AllItems", "Inbox"]] = None
@@ -72,10 +64,25 @@ class DomainEditResponse(BaseModel):
integration_id: Optional[str] = None
+ ip_restrictions: Optional[List[str]] = None
+
+ last_modified: Optional[datetime] = None
+ """Deprecated, use `modified_at` instead. End of life: November 1, 2026."""
+
+ lookback_hops: Optional[int] = None
+
+ modified_at: Optional[datetime] = None
+
o365_tenant_id: Optional[str] = None
+ regions: Optional[List[Literal["GLOBAL", "AU", "DE", "IN", "US"]]] = None
+
require_tls_inbound: Optional[bool] = None
require_tls_outbound: Optional[bool] = None
spf_status: Optional[Literal["none", "good", "neutral", "open", "invalid"]] = None
+
+ status: Optional[Literal["pending", "active", "failed", "timeout"]] = None
+
+ transport: Optional[str] = None
diff --git a/src/cloudflare/types/email_security/settings/domain_get_response.py b/src/cloudflare/types/email_security/settings/domain_get_response.py
index 08557681736..d175d364946 100644
--- a/src/cloudflare/types/email_security/settings/domain_get_response.py
+++ b/src/cloudflare/types/email_security/settings/domain_get_response.py
@@ -26,44 +26,36 @@ class EmailsProcessed(BaseModel):
class DomainGetResponse(BaseModel):
- id: int
- """The unique identifier for the domain."""
-
- allowed_delivery_modes: List[Literal["DIRECT", "BCC", "JOURNAL", "API", "RETRO_SCAN"]]
-
- created_at: datetime
-
- domain: str
-
- drop_dispositions: List[
- Literal[
- "MALICIOUS",
- "MALICIOUS-BEC",
- "SUSPICIOUS",
- "SPOOF",
- "SPAM",
- "BULK",
- "ENCRYPTED",
- "EXTERNAL",
- "UNKNOWN",
- "NONE",
- ]
- ]
-
- ip_restrictions: List[str]
-
- last_modified: datetime
-
- lookback_hops: int
+ id: Optional[str] = None
+ """Domain identifier"""
- regions: List[Literal["GLOBAL", "AU", "DE", "IN", "US"]]
-
- transport: str
+ allowed_delivery_modes: Optional[List[Literal["DIRECT", "BCC", "JOURNAL", "API", "RETRO_SCAN"]]] = None
authorization: Optional[Authorization] = None
+ created_at: Optional[datetime] = None
+
dmarc_status: Optional[Literal["none", "good", "invalid"]] = None
+ domain: Optional[str] = None
+
+ drop_dispositions: Optional[
+ List[
+ Literal[
+ "MALICIOUS",
+ "MALICIOUS-BEC",
+ "SUSPICIOUS",
+ "SPOOF",
+ "SPAM",
+ "BULK",
+ "ENCRYPTED",
+ "EXTERNAL",
+ "UNKNOWN",
+ "NONE",
+ ]
+ ]
+ ] = None
+
emails_processed: Optional[EmailsProcessed] = None
folder: Optional[Literal["AllItems", "Inbox"]] = None
@@ -72,10 +64,25 @@ class DomainGetResponse(BaseModel):
integration_id: Optional[str] = None
+ ip_restrictions: Optional[List[str]] = None
+
+ last_modified: Optional[datetime] = None
+ """Deprecated, use `modified_at` instead. End of life: November 1, 2026."""
+
+ lookback_hops: Optional[int] = None
+
+ modified_at: Optional[datetime] = None
+
o365_tenant_id: Optional[str] = None
+ regions: Optional[List[Literal["GLOBAL", "AU", "DE", "IN", "US"]]] = None
+
require_tls_inbound: Optional[bool] = None
require_tls_outbound: Optional[bool] = None
spf_status: Optional[Literal["none", "good", "neutral", "open", "invalid"]] = None
+
+ status: Optional[Literal["pending", "active", "failed", "timeout"]] = None
+
+ transport: Optional[str] = None
diff --git a/src/cloudflare/types/email_security/settings/domain_list_params.py b/src/cloudflare/types/email_security/settings/domain_list_params.py
index 6546a419a74..cccbbee8649 100644
--- a/src/cloudflare/types/email_security/settings/domain_list_params.py
+++ b/src/cloudflare/types/email_security/settings/domain_list_params.py
@@ -11,35 +11,34 @@
class DomainListParams(TypedDict, total=False):
account_id: Required[str]
- """Account Identifier"""
+ """Identifier."""
active_delivery_mode: Literal["DIRECT", "BCC", "JOURNAL", "API", "RETRO_SCAN"]
- """Filters response to domains with the currently active delivery mode."""
+ """Currently active delivery mode to filter by."""
allowed_delivery_mode: Literal["DIRECT", "BCC", "JOURNAL", "API", "RETRO_SCAN"]
- """Filters response to domains with the provided delivery mode."""
+ """Delivery mode to filter by."""
direction: Literal["asc", "desc"]
"""The sorting direction."""
domain: SequenceNotStr[str]
- """Filters results by the provided domains, allowing for multiple occurrences."""
+ """Domain names to filter by."""
integration_id: str
- """Filters response to domains with the provided integration ID."""
+ """Integration ID to filter by."""
order: Literal["domain", "created_at"]
- """The field to sort by."""
+ """Field to sort by."""
page: int
- """The page number of paginated results."""
+ """Current page within paginated list of results."""
per_page: int
- """The number of results per page."""
+ """The number of results per page. Maximum value is 1000."""
search: str
- """
- Allows searching in multiple properties of a record simultaneously. This
- parameter is intended for human users, not automation. Its exact behavior is
- intentionally left unspecified and is subject to change in the future.
- """
+ """Search term for filtering records. Behavior may change."""
+
+ status: Literal["pending", "active", "failed", "timeout"]
+ """Filters response to domains with the provided status."""
diff --git a/src/cloudflare/types/email_security/settings/domain_list_response.py b/src/cloudflare/types/email_security/settings/domain_list_response.py
index eec5a9fcc9c..cca762dcd41 100644
--- a/src/cloudflare/types/email_security/settings/domain_list_response.py
+++ b/src/cloudflare/types/email_security/settings/domain_list_response.py
@@ -26,44 +26,36 @@ class EmailsProcessed(BaseModel):
class DomainListResponse(BaseModel):
- id: int
- """The unique identifier for the domain."""
-
- allowed_delivery_modes: List[Literal["DIRECT", "BCC", "JOURNAL", "API", "RETRO_SCAN"]]
-
- created_at: datetime
-
- domain: str
-
- drop_dispositions: List[
- Literal[
- "MALICIOUS",
- "MALICIOUS-BEC",
- "SUSPICIOUS",
- "SPOOF",
- "SPAM",
- "BULK",
- "ENCRYPTED",
- "EXTERNAL",
- "UNKNOWN",
- "NONE",
- ]
- ]
-
- ip_restrictions: List[str]
-
- last_modified: datetime
-
- lookback_hops: int
+ id: Optional[str] = None
+ """Domain identifier"""
- regions: List[Literal["GLOBAL", "AU", "DE", "IN", "US"]]
-
- transport: str
+ allowed_delivery_modes: Optional[List[Literal["DIRECT", "BCC", "JOURNAL", "API", "RETRO_SCAN"]]] = None
authorization: Optional[Authorization] = None
+ created_at: Optional[datetime] = None
+
dmarc_status: Optional[Literal["none", "good", "invalid"]] = None
+ domain: Optional[str] = None
+
+ drop_dispositions: Optional[
+ List[
+ Literal[
+ "MALICIOUS",
+ "MALICIOUS-BEC",
+ "SUSPICIOUS",
+ "SPOOF",
+ "SPAM",
+ "BULK",
+ "ENCRYPTED",
+ "EXTERNAL",
+ "UNKNOWN",
+ "NONE",
+ ]
+ ]
+ ] = None
+
emails_processed: Optional[EmailsProcessed] = None
folder: Optional[Literal["AllItems", "Inbox"]] = None
@@ -72,10 +64,25 @@ class DomainListResponse(BaseModel):
integration_id: Optional[str] = None
+ ip_restrictions: Optional[List[str]] = None
+
+ last_modified: Optional[datetime] = None
+ """Deprecated, use `modified_at` instead. End of life: November 1, 2026."""
+
+ lookback_hops: Optional[int] = None
+
+ modified_at: Optional[datetime] = None
+
o365_tenant_id: Optional[str] = None
+ regions: Optional[List[Literal["GLOBAL", "AU", "DE", "IN", "US"]]] = None
+
require_tls_inbound: Optional[bool] = None
require_tls_outbound: Optional[bool] = None
spf_status: Optional[Literal["none", "good", "neutral", "open", "invalid"]] = None
+
+ status: Optional[Literal["pending", "active", "failed", "timeout"]] = None
+
+ transport: Optional[str] = None
diff --git a/src/cloudflare/types/email_security/settings/impersonation_registry_create_params.py b/src/cloudflare/types/email_security/settings/impersonation_registry_create_params.py
index db25db7e746..a2e4c838eac 100644
--- a/src/cloudflare/types/email_security/settings/impersonation_registry_create_params.py
+++ b/src/cloudflare/types/email_security/settings/impersonation_registry_create_params.py
@@ -2,17 +2,28 @@
from __future__ import annotations
-from typing_extensions import Required, TypedDict
+from typing import Optional
+from typing_extensions import Literal, Required, TypedDict
__all__ = ["ImpersonationRegistryCreateParams"]
class ImpersonationRegistryCreateParams(TypedDict, total=False):
account_id: Required[str]
- """Account Identifier"""
+ """Identifier."""
email: Required[str]
is_email_regex: Required[bool]
name: Required[str]
+
+ comments: Optional[str]
+
+ directory_id: Optional[int]
+
+ directory_node_id: Optional[int]
+
+ external_directory_node_id: Optional[str]
+
+ provenance: Literal["A1S_INTERNAL", "SNOOPY-CASB_OFFICE_365", "SNOOPY-OFFICE_365", "SNOOPY-GOOGLE_DIRECTORY"]
diff --git a/src/cloudflare/types/email_security/settings/impersonation_registry_create_response.py b/src/cloudflare/types/email_security/settings/impersonation_registry_create_response.py
index c0dd1f55354..e34f1dab28b 100644
--- a/src/cloudflare/types/email_security/settings/impersonation_registry_create_response.py
+++ b/src/cloudflare/types/email_security/settings/impersonation_registry_create_response.py
@@ -2,6 +2,7 @@
from typing import Optional
from datetime import datetime
+from typing_extensions import Literal
from ...._models import BaseModel
@@ -9,24 +10,32 @@
class ImpersonationRegistryCreateResponse(BaseModel):
- id: int
+ """An impersonation registry entry"""
- created_at: datetime
-
- email: str
-
- is_email_regex: bool
-
- last_modified: datetime
-
- name: str
+ id: Optional[str] = None
+ """Impersonation registry entry identifier"""
comments: Optional[str] = None
+ created_at: Optional[datetime] = None
+
directory_id: Optional[int] = None
directory_node_id: Optional[int] = None
+ email: Optional[str] = None
+
external_directory_node_id: Optional[str] = None
- provenance: Optional[str] = None
+ is_email_regex: Optional[bool] = None
+
+ last_modified: Optional[datetime] = None
+ """Deprecated, use `modified_at` instead. End of life: November 1, 2026."""
+
+ modified_at: Optional[datetime] = None
+
+ name: Optional[str] = None
+
+ provenance: Optional[
+ Literal["A1S_INTERNAL", "SNOOPY-CASB_OFFICE_365", "SNOOPY-OFFICE_365", "SNOOPY-GOOGLE_DIRECTORY"]
+ ] = None
diff --git a/src/cloudflare/types/email_security/settings/impersonation_registry_delete_response.py b/src/cloudflare/types/email_security/settings/impersonation_registry_delete_response.py
index ba4913c92f1..9f53eea77c2 100644
--- a/src/cloudflare/types/email_security/settings/impersonation_registry_delete_response.py
+++ b/src/cloudflare/types/email_security/settings/impersonation_registry_delete_response.py
@@ -6,4 +6,5 @@
class ImpersonationRegistryDeleteResponse(BaseModel):
- id: int
+ id: str
+ """Impersonation registry entry identifier"""
diff --git a/src/cloudflare/types/email_security/settings/impersonation_registry_edit_params.py b/src/cloudflare/types/email_security/settings/impersonation_registry_edit_params.py
index 8dceb0e75f7..6da26a51e67 100644
--- a/src/cloudflare/types/email_security/settings/impersonation_registry_edit_params.py
+++ b/src/cloudflare/types/email_security/settings/impersonation_registry_edit_params.py
@@ -3,17 +3,27 @@
from __future__ import annotations
from typing import Optional
-from typing_extensions import Required, TypedDict
+from typing_extensions import Literal, Required, TypedDict
__all__ = ["ImpersonationRegistryEditParams"]
class ImpersonationRegistryEditParams(TypedDict, total=False):
account_id: Required[str]
- """Account Identifier"""
+ """Identifier."""
- email: Optional[str]
+ comments: Optional[str]
- is_email_regex: Optional[bool]
+ directory_id: Optional[int]
- name: Optional[str]
+ directory_node_id: Optional[int]
+
+ email: str
+
+ external_directory_node_id: Optional[str]
+
+ is_email_regex: bool
+
+ name: str
+
+ provenance: Literal["A1S_INTERNAL", "SNOOPY-CASB_OFFICE_365", "SNOOPY-OFFICE_365", "SNOOPY-GOOGLE_DIRECTORY"]
diff --git a/src/cloudflare/types/email_security/settings/impersonation_registry_edit_response.py b/src/cloudflare/types/email_security/settings/impersonation_registry_edit_response.py
index 824a0946f7c..f857877c46b 100644
--- a/src/cloudflare/types/email_security/settings/impersonation_registry_edit_response.py
+++ b/src/cloudflare/types/email_security/settings/impersonation_registry_edit_response.py
@@ -2,6 +2,7 @@
from typing import Optional
from datetime import datetime
+from typing_extensions import Literal
from ...._models import BaseModel
@@ -9,24 +10,32 @@
class ImpersonationRegistryEditResponse(BaseModel):
- id: int
+ """An impersonation registry entry"""
- created_at: datetime
-
- email: str
-
- is_email_regex: bool
-
- last_modified: datetime
-
- name: str
+ id: Optional[str] = None
+ """Impersonation registry entry identifier"""
comments: Optional[str] = None
+ created_at: Optional[datetime] = None
+
directory_id: Optional[int] = None
directory_node_id: Optional[int] = None
+ email: Optional[str] = None
+
external_directory_node_id: Optional[str] = None
- provenance: Optional[str] = None
+ is_email_regex: Optional[bool] = None
+
+ last_modified: Optional[datetime] = None
+ """Deprecated, use `modified_at` instead. End of life: November 1, 2026."""
+
+ modified_at: Optional[datetime] = None
+
+ name: Optional[str] = None
+
+ provenance: Optional[
+ Literal["A1S_INTERNAL", "SNOOPY-CASB_OFFICE_365", "SNOOPY-OFFICE_365", "SNOOPY-GOOGLE_DIRECTORY"]
+ ] = None
diff --git a/src/cloudflare/types/email_security/settings/impersonation_registry_get_response.py b/src/cloudflare/types/email_security/settings/impersonation_registry_get_response.py
index 85a8ab50d71..4a8d99ca5a3 100644
--- a/src/cloudflare/types/email_security/settings/impersonation_registry_get_response.py
+++ b/src/cloudflare/types/email_security/settings/impersonation_registry_get_response.py
@@ -2,6 +2,7 @@
from typing import Optional
from datetime import datetime
+from typing_extensions import Literal
from ...._models import BaseModel
@@ -9,24 +10,32 @@
class ImpersonationRegistryGetResponse(BaseModel):
- id: int
+ """An impersonation registry entry"""
- created_at: datetime
-
- email: str
-
- is_email_regex: bool
-
- last_modified: datetime
-
- name: str
+ id: Optional[str] = None
+ """Impersonation registry entry identifier"""
comments: Optional[str] = None
+ created_at: Optional[datetime] = None
+
directory_id: Optional[int] = None
directory_node_id: Optional[int] = None
+ email: Optional[str] = None
+
external_directory_node_id: Optional[str] = None
- provenance: Optional[str] = None
+ is_email_regex: Optional[bool] = None
+
+ last_modified: Optional[datetime] = None
+ """Deprecated, use `modified_at` instead. End of life: November 1, 2026."""
+
+ modified_at: Optional[datetime] = None
+
+ name: Optional[str] = None
+
+ provenance: Optional[
+ Literal["A1S_INTERNAL", "SNOOPY-CASB_OFFICE_365", "SNOOPY-OFFICE_365", "SNOOPY-GOOGLE_DIRECTORY"]
+ ] = None
diff --git a/src/cloudflare/types/email_security/settings/impersonation_registry_list_params.py b/src/cloudflare/types/email_security/settings/impersonation_registry_list_params.py
index 49a2b1ddf0a..d652f6012b8 100644
--- a/src/cloudflare/types/email_security/settings/impersonation_registry_list_params.py
+++ b/src/cloudflare/types/email_security/settings/impersonation_registry_list_params.py
@@ -9,25 +9,21 @@
class ImpersonationRegistryListParams(TypedDict, total=False):
account_id: Required[str]
- """Account Identifier"""
+ """Identifier."""
direction: Literal["asc", "desc"]
"""The sorting direction."""
order: Literal["name", "email", "created_at"]
- """The field to sort by."""
+ """Field to sort by."""
page: int
- """The page number of paginated results."""
+ """Current page within paginated list of results."""
per_page: int
- """The number of results per page."""
+ """The number of results per page. Maximum value is 1000."""
provenance: Literal["A1S_INTERNAL", "SNOOPY-CASB_OFFICE_365", "SNOOPY-OFFICE_365", "SNOOPY-GOOGLE_DIRECTORY"]
search: str
- """
- Allows searching in multiple properties of a record simultaneously. This
- parameter is intended for human users, not automation. Its exact behavior is
- intentionally left unspecified and is subject to change in the future.
- """
+ """Search term for filtering records. Behavior may change."""
diff --git a/src/cloudflare/types/email_security/settings/impersonation_registry_list_response.py b/src/cloudflare/types/email_security/settings/impersonation_registry_list_response.py
index 800c8d4bfd7..17299856d1a 100644
--- a/src/cloudflare/types/email_security/settings/impersonation_registry_list_response.py
+++ b/src/cloudflare/types/email_security/settings/impersonation_registry_list_response.py
@@ -2,6 +2,7 @@
from typing import Optional
from datetime import datetime
+from typing_extensions import Literal
from ...._models import BaseModel
@@ -9,24 +10,32 @@
class ImpersonationRegistryListResponse(BaseModel):
- id: int
+ """An impersonation registry entry"""
- created_at: datetime
-
- email: str
-
- is_email_regex: bool
-
- last_modified: datetime
-
- name: str
+ id: Optional[str] = None
+ """Impersonation registry entry identifier"""
comments: Optional[str] = None
+ created_at: Optional[datetime] = None
+
directory_id: Optional[int] = None
directory_node_id: Optional[int] = None
+ email: Optional[str] = None
+
external_directory_node_id: Optional[str] = None
- provenance: Optional[str] = None
+ is_email_regex: Optional[bool] = None
+
+ last_modified: Optional[datetime] = None
+ """Deprecated, use `modified_at` instead. End of life: November 1, 2026."""
+
+ modified_at: Optional[datetime] = None
+
+ name: Optional[str] = None
+
+ provenance: Optional[
+ Literal["A1S_INTERNAL", "SNOOPY-CASB_OFFICE_365", "SNOOPY-OFFICE_365", "SNOOPY-GOOGLE_DIRECTORY"]
+ ] = None
diff --git a/src/cloudflare/types/email_security/settings/trusted_domain_create_params.py b/src/cloudflare/types/email_security/settings/trusted_domain_create_params.py
index 3159478e22d..0ea1e50ccd5 100644
--- a/src/cloudflare/types/email_security/settings/trusted_domain_create_params.py
+++ b/src/cloudflare/types/email_security/settings/trusted_domain_create_params.py
@@ -2,15 +2,15 @@
from __future__ import annotations
-from typing import Union, Iterable, Optional
-from typing_extensions import Required, TypeAlias, TypedDict
+from typing import Optional
+from typing_extensions import Required, TypedDict
-__all__ = ["TrustedDomainCreateParams", "EmailSecurityCreateTrustedDomain", "Variant1", "Variant1Body"]
+__all__ = ["TrustedDomainCreateParams"]
-class EmailSecurityCreateTrustedDomain(TypedDict, total=False):
+class TrustedDomainCreateParams(TypedDict, total=False):
account_id: Required[str]
- """Account Identifier"""
+ """Identifier."""
is_recent: Required[bool]
"""
@@ -29,33 +29,3 @@ class EmailSecurityCreateTrustedDomain(TypedDict, total=False):
pattern: Required[str]
comments: Optional[str]
-
-
-class Variant1(TypedDict, total=False):
- account_id: Required[str]
- """Account Identifier"""
-
- body: Required[Iterable[Variant1Body]]
-
-
-class Variant1Body(TypedDict, total=False):
- is_recent: Required[bool]
- """
- Select to prevent recently registered domains from triggering a Suspicious or
- Malicious disposition.
- """
-
- is_regex: Required[bool]
-
- is_similarity: Required[bool]
- """
- Select for partner or other approved domains that have similar spelling to your
- connected domains. Prevents listed domains from triggering a Spoof disposition.
- """
-
- pattern: Required[str]
-
- comments: Optional[str]
-
-
-TrustedDomainCreateParams: TypeAlias = Union[EmailSecurityCreateTrustedDomain, Variant1]
diff --git a/src/cloudflare/types/email_security/settings/trusted_domain_create_response.py b/src/cloudflare/types/email_security/settings/trusted_domain_create_response.py
index 1dfe56cf075..33b7cc18fdf 100644
--- a/src/cloudflare/types/email_security/settings/trusted_domain_create_response.py
+++ b/src/cloudflare/types/email_security/settings/trusted_domain_create_response.py
@@ -1,66 +1,40 @@
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
-from typing import List, Union, Optional
+from typing import Optional
from datetime import datetime
-from typing_extensions import TypeAlias
from ...._models import BaseModel
-__all__ = ["TrustedDomainCreateResponse", "EmailSecurityTrustedDomain", "UnionMember1"]
+__all__ = ["TrustedDomainCreateResponse"]
-class EmailSecurityTrustedDomain(BaseModel):
- id: int
- """The unique identifier for the trusted domain."""
+class TrustedDomainCreateResponse(BaseModel):
+ """A trusted email domain"""
- created_at: datetime
-
- is_recent: bool
- """
- Select to prevent recently registered domains from triggering a Suspicious or
- Malicious disposition.
- """
-
- is_regex: bool
-
- is_similarity: bool
- """
- Select for partner or other approved domains that have similar spelling to your
- connected domains. Prevents listed domains from triggering a Spoof disposition.
- """
-
- last_modified: datetime
-
- pattern: str
+ id: Optional[str] = None
+ """Trusted domain identifier"""
comments: Optional[str] = None
+ created_at: Optional[datetime] = None
-class UnionMember1(BaseModel):
- id: int
- """The unique identifier for the trusted domain."""
-
- created_at: datetime
-
- is_recent: bool
+ is_recent: Optional[bool] = None
"""
Select to prevent recently registered domains from triggering a Suspicious or
Malicious disposition.
"""
- is_regex: bool
+ is_regex: Optional[bool] = None
- is_similarity: bool
+ is_similarity: Optional[bool] = None
"""
Select for partner or other approved domains that have similar spelling to your
connected domains. Prevents listed domains from triggering a Spoof disposition.
"""
- last_modified: datetime
-
- pattern: str
-
- comments: Optional[str] = None
+ last_modified: Optional[datetime] = None
+ """Deprecated, use `modified_at` instead. End of life: November 1, 2026."""
+ modified_at: Optional[datetime] = None
-TrustedDomainCreateResponse: TypeAlias = Union[EmailSecurityTrustedDomain, List[UnionMember1]]
+ pattern: Optional[str] = None
diff --git a/src/cloudflare/types/email_security/settings/trusted_domain_delete_response.py b/src/cloudflare/types/email_security/settings/trusted_domain_delete_response.py
index 9c5251946fd..ca3b3afd980 100644
--- a/src/cloudflare/types/email_security/settings/trusted_domain_delete_response.py
+++ b/src/cloudflare/types/email_security/settings/trusted_domain_delete_response.py
@@ -6,5 +6,5 @@
class TrustedDomainDeleteResponse(BaseModel):
- id: int
- """The unique identifier for the trusted domain."""
+ id: str
+ """Trusted domain identifier"""
diff --git a/src/cloudflare/types/email_security/settings/trusted_domain_edit_params.py b/src/cloudflare/types/email_security/settings/trusted_domain_edit_params.py
index 90d1acfc7c0..a96de6dc005 100644
--- a/src/cloudflare/types/email_security/settings/trusted_domain_edit_params.py
+++ b/src/cloudflare/types/email_security/settings/trusted_domain_edit_params.py
@@ -2,6 +2,7 @@
from __future__ import annotations
+from typing import Optional
from typing_extensions import Required, TypedDict
__all__ = ["TrustedDomainEditParams"]
@@ -9,9 +10,9 @@
class TrustedDomainEditParams(TypedDict, total=False):
account_id: Required[str]
- """Account Identifier"""
+ """Identifier."""
- comments: str
+ comments: Optional[str]
is_recent: bool
"""
diff --git a/src/cloudflare/types/email_security/settings/trusted_domain_edit_response.py b/src/cloudflare/types/email_security/settings/trusted_domain_edit_response.py
index eb86a0bfebc..2e3b8aa0427 100644
--- a/src/cloudflare/types/email_security/settings/trusted_domain_edit_response.py
+++ b/src/cloudflare/types/email_security/settings/trusted_domain_edit_response.py
@@ -9,27 +9,32 @@
class TrustedDomainEditResponse(BaseModel):
- id: int
- """The unique identifier for the trusted domain."""
+ """A trusted email domain"""
- created_at: datetime
+ id: Optional[str] = None
+ """Trusted domain identifier"""
- is_recent: bool
+ comments: Optional[str] = None
+
+ created_at: Optional[datetime] = None
+
+ is_recent: Optional[bool] = None
"""
Select to prevent recently registered domains from triggering a Suspicious or
Malicious disposition.
"""
- is_regex: bool
+ is_regex: Optional[bool] = None
- is_similarity: bool
+ is_similarity: Optional[bool] = None
"""
Select for partner or other approved domains that have similar spelling to your
connected domains. Prevents listed domains from triggering a Spoof disposition.
"""
- last_modified: datetime
+ last_modified: Optional[datetime] = None
+ """Deprecated, use `modified_at` instead. End of life: November 1, 2026."""
- pattern: str
+ modified_at: Optional[datetime] = None
- comments: Optional[str] = None
+ pattern: Optional[str] = None
diff --git a/src/cloudflare/types/email_security/settings/trusted_domain_get_response.py b/src/cloudflare/types/email_security/settings/trusted_domain_get_response.py
index 23b217fa8d7..dc31ef66b43 100644
--- a/src/cloudflare/types/email_security/settings/trusted_domain_get_response.py
+++ b/src/cloudflare/types/email_security/settings/trusted_domain_get_response.py
@@ -9,27 +9,32 @@
class TrustedDomainGetResponse(BaseModel):
- id: int
- """The unique identifier for the trusted domain."""
+ """A trusted email domain"""
- created_at: datetime
+ id: Optional[str] = None
+ """Trusted domain identifier"""
- is_recent: bool
+ comments: Optional[str] = None
+
+ created_at: Optional[datetime] = None
+
+ is_recent: Optional[bool] = None
"""
Select to prevent recently registered domains from triggering a Suspicious or
Malicious disposition.
"""
- is_regex: bool
+ is_regex: Optional[bool] = None
- is_similarity: bool
+ is_similarity: Optional[bool] = None
"""
Select for partner or other approved domains that have similar spelling to your
connected domains. Prevents listed domains from triggering a Spoof disposition.
"""
- last_modified: datetime
+ last_modified: Optional[datetime] = None
+ """Deprecated, use `modified_at` instead. End of life: November 1, 2026."""
- pattern: str
+ modified_at: Optional[datetime] = None
- comments: Optional[str] = None
+ pattern: Optional[str] = None
diff --git a/src/cloudflare/types/email_security/settings/trusted_domain_list_params.py b/src/cloudflare/types/email_security/settings/trusted_domain_list_params.py
index b9446971853..5036cc37986 100644
--- a/src/cloudflare/types/email_security/settings/trusted_domain_list_params.py
+++ b/src/cloudflare/types/email_security/settings/trusted_domain_list_params.py
@@ -9,29 +9,33 @@
class TrustedDomainListParams(TypedDict, total=False):
account_id: Required[str]
- """Account Identifier"""
+ """Identifier."""
direction: Literal["asc", "desc"]
"""The sorting direction."""
is_recent: bool
+ """
+ Filter to show only recently registered domains that are trusted to prevent
+ triggering Suspicious or Malicious dispositions.
+ """
is_similarity: bool
+ """
+ Filter to show only proximity domains (partner or approved domains with similar
+ spelling to connected domains) that prevent Spoof dispositions.
+ """
order: Literal["pattern", "created_at"]
- """The field to sort by."""
+ """Field to sort by."""
page: int
- """The page number of paginated results."""
+ """Current page within paginated list of results."""
pattern: str
per_page: int
- """The number of results per page."""
+ """The number of results per page. Maximum value is 1000."""
search: str
- """
- Allows searching in multiple properties of a record simultaneously. This
- parameter is intended for human users, not automation. Its exact behavior is
- intentionally left unspecified and is subject to change in the future.
- """
+ """Search term for filtering records. Behavior may change."""
diff --git a/src/cloudflare/types/email_security/settings/trusted_domain_list_response.py b/src/cloudflare/types/email_security/settings/trusted_domain_list_response.py
index 42e7eec4fed..c7643df7860 100644
--- a/src/cloudflare/types/email_security/settings/trusted_domain_list_response.py
+++ b/src/cloudflare/types/email_security/settings/trusted_domain_list_response.py
@@ -9,27 +9,32 @@
class TrustedDomainListResponse(BaseModel):
- id: int
- """The unique identifier for the trusted domain."""
+ """A trusted email domain"""
- created_at: datetime
+ id: Optional[str] = None
+ """Trusted domain identifier"""
- is_recent: bool
+ comments: Optional[str] = None
+
+ created_at: Optional[datetime] = None
+
+ is_recent: Optional[bool] = None
"""
Select to prevent recently registered domains from triggering a Suspicious or
Malicious disposition.
"""
- is_regex: bool
+ is_regex: Optional[bool] = None
- is_similarity: bool
+ is_similarity: Optional[bool] = None
"""
Select for partner or other approved domains that have similar spelling to your
connected domains. Prevents listed domains from triggering a Spoof disposition.
"""
- last_modified: datetime
+ last_modified: Optional[datetime] = None
+ """Deprecated, use `modified_at` instead. End of life: November 1, 2026."""
- pattern: str
+ modified_at: Optional[datetime] = None
- comments: Optional[str] = None
+ pattern: Optional[str] = None
diff --git a/src/cloudflare/types/email_security/submission_list_params.py b/src/cloudflare/types/email_security/submission_list_params.py
index 225fb097290..b333cbd18b4 100644
--- a/src/cloudflare/types/email_security/submission_list_params.py
+++ b/src/cloudflare/types/email_security/submission_list_params.py
@@ -13,32 +13,27 @@
class SubmissionListParams(TypedDict, total=False):
account_id: Required[str]
- """Account Identifier"""
-
- customer_status: Literal["escalated", "reviewed", "unreviewed"]
+ """Identifier."""
end: Annotated[Union[str, datetime], PropertyInfo(format="iso8601")]
- """The end of the search date range. Defaults to `now` if not provided."""
+ """The end of the search date range. Defaults to `now`."""
original_disposition: Literal["MALICIOUS", "SUSPICIOUS", "SPOOF", "SPAM", "BULK", "NONE"]
outcome_disposition: Literal["MALICIOUS", "SUSPICIOUS", "SPOOF", "SPAM", "BULK", "NONE"]
page: int
- """The page number of paginated results."""
+ """Current page within paginated list of results."""
per_page: int
- """The number of results per page."""
+ """The number of results per page. Maximum value is 1000."""
query: Optional[str]
requested_disposition: Literal["MALICIOUS", "SUSPICIOUS", "SPOOF", "SPAM", "BULK", "NONE"]
start: Annotated[Union[str, datetime], PropertyInfo(format="iso8601")]
- """
- The beginning of the search date range. Defaults to `now - 30 days` if not
- provided.
- """
+ """The beginning of the search date range. Defaults to `now - 30 days`."""
status: str
diff --git a/src/cloudflare/types/email_security/submission_list_response.py b/src/cloudflare/types/email_security/submission_list_response.py
index 6e48024d27d..d3b3f17014f 100644
--- a/src/cloudflare/types/email_security/submission_list_response.py
+++ b/src/cloudflare/types/email_security/submission_list_response.py
@@ -10,27 +10,14 @@
class SubmissionListResponse(BaseModel):
- requested_ts: datetime
- """deprecated as of 2026-04-01, use `requested_at` instead."""
+ requested_at: datetime
+ """When the submission was requested (UTC)."""
submission_id: str
customer_status: Optional[Literal["escalated", "reviewed", "unreviewed"]] = None
- escalated_as: Optional[
- Literal[
- "MALICIOUS",
- "MALICIOUS-BEC",
- "SUSPICIOUS",
- "SPOOF",
- "SPAM",
- "BULK",
- "ENCRYPTED",
- "EXTERNAL",
- "UNKNOWN",
- "NONE",
- ]
- ] = None
+ escalated_as: Optional[Literal["MALICIOUS", "SUSPICIOUS", "SPOOF", "SPAM", "BULK", "NONE"]] = None
escalated_at: Optional[datetime] = None
@@ -38,63 +25,27 @@ class SubmissionListResponse(BaseModel):
escalated_submission_id: Optional[str] = None
- original_disposition: Optional[
- Literal[
- "MALICIOUS",
- "MALICIOUS-BEC",
- "SUSPICIOUS",
- "SPOOF",
- "SPAM",
- "BULK",
- "ENCRYPTED",
- "EXTERNAL",
- "UNKNOWN",
- "NONE",
- ]
- ] = None
+ original_disposition: Optional[Literal["MALICIOUS", "SUSPICIOUS", "SPOOF", "SPAM", "BULK", "NONE"]] = None
original_edf_hash: Optional[str] = None
original_postfix_id: Optional[str] = None
+ """The postfix ID of the original message that was submitted"""
outcome: Optional[str] = None
- outcome_disposition: Optional[
- Literal[
- "MALICIOUS",
- "MALICIOUS-BEC",
- "SUSPICIOUS",
- "SPOOF",
- "SPAM",
- "BULK",
- "ENCRYPTED",
- "EXTERNAL",
- "UNKNOWN",
- "NONE",
- ]
- ] = None
-
- requested_at: Optional[datetime] = None
+ outcome_disposition: Optional[Literal["MALICIOUS", "SUSPICIOUS", "SPOOF", "SPAM", "BULK", "NONE"]] = None
requested_by: Optional[str] = None
- requested_disposition: Optional[
- Literal[
- "MALICIOUS",
- "MALICIOUS-BEC",
- "SUSPICIOUS",
- "SPOOF",
- "SPAM",
- "BULK",
- "ENCRYPTED",
- "EXTERNAL",
- "UNKNOWN",
- "NONE",
- ]
- ] = None
+ requested_disposition: Optional[Literal["MALICIOUS", "SUSPICIOUS", "SPOOF", "SPAM", "BULK", "NONE"]] = None
+
+ requested_ts: Optional[str] = None
+ """Deprecated, use `requested_at` instead"""
status: Optional[str] = None
subject: Optional[str] = None
- type: Optional[str] = None
+ type: Optional[Literal["Team", "User"]] = None
+ """Whether the submission was created by a team member or an end user."""
diff --git a/src/cloudflare/types/magic_transit/__init__.py b/src/cloudflare/types/magic_transit/__init__.py
index 700b72f955b..bec3c88a56d 100644
--- a/src/cloudflare/types/magic_transit/__init__.py
+++ b/src/cloudflare/types/magic_transit/__init__.py
@@ -37,6 +37,7 @@
from .pcap_create_response import PCAPCreateResponse as PCAPCreateResponse
from .route_empty_response import RouteEmptyResponse as RouteEmptyResponse
from .connector_edit_params import ConnectorEditParams as ConnectorEditParams
+from .connector_list_params import ConnectorListParams as ConnectorListParams
from .route_create_response import RouteCreateResponse as RouteCreateResponse
from .route_delete_response import RouteDeleteResponse as RouteDeleteResponse
from .route_update_response import RouteUpdateResponse as RouteUpdateResponse
diff --git a/src/cloudflare/types/magic_transit/cf_interconnect_bulk_update_response.py b/src/cloudflare/types/magic_transit/cf_interconnect_bulk_update_response.py
index 5ec4fe4087c..2f077f1a996 100644
--- a/src/cloudflare/types/magic_transit/cf_interconnect_bulk_update_response.py
+++ b/src/cloudflare/types/magic_transit/cf_interconnect_bulk_update_response.py
@@ -26,7 +26,8 @@ class ModifiedInterconnect(BaseModel):
automatic_return_routing: Optional[bool] = None
"""
True if automatic stateful return routing should be enabled for a tunnel, false
- otherwise.
+ otherwise. Requires the `coupler_integration` account flag to be enabled;
+ requests setting this to `true` without that flag will be rejected.
"""
colo_name: Optional[str] = None
diff --git a/src/cloudflare/types/magic_transit/cf_interconnect_get_response.py b/src/cloudflare/types/magic_transit/cf_interconnect_get_response.py
index 389b0fb12f0..93c01b6d70e 100644
--- a/src/cloudflare/types/magic_transit/cf_interconnect_get_response.py
+++ b/src/cloudflare/types/magic_transit/cf_interconnect_get_response.py
@@ -26,7 +26,8 @@ class Interconnect(BaseModel):
automatic_return_routing: Optional[bool] = None
"""
True if automatic stateful return routing should be enabled for a tunnel, false
- otherwise.
+ otherwise. Requires the `coupler_integration` account flag to be enabled;
+ requests setting this to `true` without that flag will be rejected.
"""
colo_name: Optional[str] = None
diff --git a/src/cloudflare/types/magic_transit/cf_interconnect_list_response.py b/src/cloudflare/types/magic_transit/cf_interconnect_list_response.py
index d4e7e7b8745..26eee8fee48 100644
--- a/src/cloudflare/types/magic_transit/cf_interconnect_list_response.py
+++ b/src/cloudflare/types/magic_transit/cf_interconnect_list_response.py
@@ -26,7 +26,8 @@ class Interconnect(BaseModel):
automatic_return_routing: Optional[bool] = None
"""
True if automatic stateful return routing should be enabled for a tunnel, false
- otherwise.
+ otherwise. Requires the `coupler_integration` account flag to be enabled;
+ requests setting this to `true` without that flag will be rejected.
"""
colo_name: Optional[str] = None
diff --git a/src/cloudflare/types/magic_transit/cf_interconnect_update_params.py b/src/cloudflare/types/magic_transit/cf_interconnect_update_params.py
index dea0aabfdeb..c57aba4f6e4 100644
--- a/src/cloudflare/types/magic_transit/cf_interconnect_update_params.py
+++ b/src/cloudflare/types/magic_transit/cf_interconnect_update_params.py
@@ -17,7 +17,8 @@ class CfInterconnectUpdateParams(TypedDict, total=False):
automatic_return_routing: bool
"""
True if automatic stateful return routing should be enabled for a tunnel, false
- otherwise.
+ otherwise. Requires the `coupler_integration` account flag to be enabled;
+ requests setting this to `true` without that flag will be rejected.
"""
description: str
diff --git a/src/cloudflare/types/magic_transit/cf_interconnect_update_response.py b/src/cloudflare/types/magic_transit/cf_interconnect_update_response.py
index 1e7f379fde1..acf0ec93893 100644
--- a/src/cloudflare/types/magic_transit/cf_interconnect_update_response.py
+++ b/src/cloudflare/types/magic_transit/cf_interconnect_update_response.py
@@ -26,7 +26,8 @@ class ModifiedInterconnect(BaseModel):
automatic_return_routing: Optional[bool] = None
"""
True if automatic stateful return routing should be enabled for a tunnel, false
- otherwise.
+ otherwise. Requires the `coupler_integration` account flag to be enabled;
+ requests setting this to `true` without that flag will be rejected.
"""
colo_name: Optional[str] = None
diff --git a/src/cloudflare/types/magic_transit/connector_create_response.py b/src/cloudflare/types/magic_transit/connector_create_response.py
index 74053c83628..57fabb8b537 100644
--- a/src/cloudflare/types/magic_transit/connector_create_response.py
+++ b/src/cloudflare/types/magic_transit/connector_create_response.py
@@ -13,6 +13,8 @@ class Device(BaseModel):
serial_number: Optional[str] = None
+ type: Optional[Literal["MANAGED", "LICENSED"]] = None
+
class ConnectorCreateResponse(BaseModel):
id: str
diff --git a/src/cloudflare/types/magic_transit/connector_delete_response.py b/src/cloudflare/types/magic_transit/connector_delete_response.py
index 7dc21b7c70c..e7e20709783 100644
--- a/src/cloudflare/types/magic_transit/connector_delete_response.py
+++ b/src/cloudflare/types/magic_transit/connector_delete_response.py
@@ -13,6 +13,8 @@ class Device(BaseModel):
serial_number: Optional[str] = None
+ type: Optional[Literal["MANAGED", "LICENSED"]] = None
+
class ConnectorDeleteResponse(BaseModel):
id: str
diff --git a/src/cloudflare/types/magic_transit/connector_edit_response.py b/src/cloudflare/types/magic_transit/connector_edit_response.py
index e65a54a4c14..25046e5f468 100644
--- a/src/cloudflare/types/magic_transit/connector_edit_response.py
+++ b/src/cloudflare/types/magic_transit/connector_edit_response.py
@@ -13,6 +13,8 @@ class Device(BaseModel):
serial_number: Optional[str] = None
+ type: Optional[Literal["MANAGED", "LICENSED"]] = None
+
class ConnectorEditResponse(BaseModel):
id: str
diff --git a/src/cloudflare/types/magic_transit/connector_get_response.py b/src/cloudflare/types/magic_transit/connector_get_response.py
index 00426f9c13b..2c5ab086aee 100644
--- a/src/cloudflare/types/magic_transit/connector_get_response.py
+++ b/src/cloudflare/types/magic_transit/connector_get_response.py
@@ -13,6 +13,8 @@ class Device(BaseModel):
serial_number: Optional[str] = None
+ type: Optional[Literal["MANAGED", "LICENSED"]] = None
+
class ConnectorGetResponse(BaseModel):
id: str
diff --git a/src/cloudflare/types/magic_transit/connector_list_params.py b/src/cloudflare/types/magic_transit/connector_list_params.py
new file mode 100644
index 00000000000..385ec3574f5
--- /dev/null
+++ b/src/cloudflare/types/magic_transit/connector_list_params.py
@@ -0,0 +1,15 @@
+# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
+
+from __future__ import annotations
+
+from typing_extensions import Literal, Required, TypedDict
+
+__all__ = ["ConnectorListParams"]
+
+
+class ConnectorListParams(TypedDict, total=False):
+ account_id: Required[str]
+ """Account identifier"""
+
+ device_type: Literal["MANAGED", "LICENSED"]
+ """Filter connectors by device type."""
diff --git a/src/cloudflare/types/magic_transit/connector_list_response.py b/src/cloudflare/types/magic_transit/connector_list_response.py
index bb73ab1bbf3..06079e4a732 100644
--- a/src/cloudflare/types/magic_transit/connector_list_response.py
+++ b/src/cloudflare/types/magic_transit/connector_list_response.py
@@ -13,6 +13,8 @@ class Device(BaseModel):
serial_number: Optional[str] = None
+ type: Optional[Literal["MANAGED", "LICENSED"]] = None
+
class ConnectorListResponse(BaseModel):
id: str
diff --git a/src/cloudflare/types/magic_transit/connector_update_response.py b/src/cloudflare/types/magic_transit/connector_update_response.py
index 35d0ee9f20d..17a1543c152 100644
--- a/src/cloudflare/types/magic_transit/connector_update_response.py
+++ b/src/cloudflare/types/magic_transit/connector_update_response.py
@@ -13,6 +13,8 @@ class Device(BaseModel):
serial_number: Optional[str] = None
+ type: Optional[Literal["MANAGED", "LICENSED"]] = None
+
class ConnectorUpdateResponse(BaseModel):
id: str
diff --git a/src/cloudflare/types/magic_transit/gre_tunnel_bulk_update_response.py b/src/cloudflare/types/magic_transit/gre_tunnel_bulk_update_response.py
index d98f4e9f5bf..ffacd0ffc74 100644
--- a/src/cloudflare/types/magic_transit/gre_tunnel_bulk_update_response.py
+++ b/src/cloudflare/types/magic_transit/gre_tunnel_bulk_update_response.py
@@ -151,7 +151,8 @@ class ModifiedGRETunnel(BaseModel):
automatic_return_routing: Optional[bool] = None
"""
True if automatic stateful return routing should be enabled for a tunnel, false
- otherwise.
+ otherwise. Requires the `coupler_integration` account flag to be enabled;
+ requests setting this to `true` without that flag will be rejected.
"""
bgp: Optional[ModifiedGRETunnelBGP] = None
diff --git a/src/cloudflare/types/magic_transit/gre_tunnel_create_params.py b/src/cloudflare/types/magic_transit/gre_tunnel_create_params.py
index 2e8e4a5b8e8..19e85148542 100644
--- a/src/cloudflare/types/magic_transit/gre_tunnel_create_params.py
+++ b/src/cloudflare/types/magic_transit/gre_tunnel_create_params.py
@@ -46,7 +46,8 @@ class GRETunnelCreateParams(TypedDict, total=False):
automatic_return_routing: bool
"""
True if automatic stateful return routing should be enabled for a tunnel, false
- otherwise.
+ otherwise. Requires the `coupler_integration` account flag to be enabled;
+ requests setting this to `true` without that flag will be rejected.
"""
bgp: BGP
diff --git a/src/cloudflare/types/magic_transit/gre_tunnel_create_response.py b/src/cloudflare/types/magic_transit/gre_tunnel_create_response.py
index d9af36faaab..ee95b6fa8b2 100644
--- a/src/cloudflare/types/magic_transit/gre_tunnel_create_response.py
+++ b/src/cloudflare/types/magic_transit/gre_tunnel_create_response.py
@@ -150,7 +150,8 @@ class GRETunnelCreateResponse(BaseModel):
automatic_return_routing: Optional[bool] = None
"""
True if automatic stateful return routing should be enabled for a tunnel, false
- otherwise.
+ otherwise. Requires the `coupler_integration` account flag to be enabled;
+ requests setting this to `true` without that flag will be rejected.
"""
bgp: Optional[BGP] = None
diff --git a/src/cloudflare/types/magic_transit/gre_tunnel_delete_response.py b/src/cloudflare/types/magic_transit/gre_tunnel_delete_response.py
index c31aed82b80..2607e9e41bf 100644
--- a/src/cloudflare/types/magic_transit/gre_tunnel_delete_response.py
+++ b/src/cloudflare/types/magic_transit/gre_tunnel_delete_response.py
@@ -151,7 +151,8 @@ class DeletedGRETunnel(BaseModel):
automatic_return_routing: Optional[bool] = None
"""
True if automatic stateful return routing should be enabled for a tunnel, false
- otherwise.
+ otherwise. Requires the `coupler_integration` account flag to be enabled;
+ requests setting this to `true` without that flag will be rejected.
"""
bgp: Optional[DeletedGRETunnelBGP] = None
diff --git a/src/cloudflare/types/magic_transit/gre_tunnel_get_response.py b/src/cloudflare/types/magic_transit/gre_tunnel_get_response.py
index 77e2db7f295..ef8eb5cacd8 100644
--- a/src/cloudflare/types/magic_transit/gre_tunnel_get_response.py
+++ b/src/cloudflare/types/magic_transit/gre_tunnel_get_response.py
@@ -151,7 +151,8 @@ class GRETunnel(BaseModel):
automatic_return_routing: Optional[bool] = None
"""
True if automatic stateful return routing should be enabled for a tunnel, false
- otherwise.
+ otherwise. Requires the `coupler_integration` account flag to be enabled;
+ requests setting this to `true` without that flag will be rejected.
"""
bgp: Optional[GRETunnelBGP] = None
diff --git a/src/cloudflare/types/magic_transit/gre_tunnel_list_response.py b/src/cloudflare/types/magic_transit/gre_tunnel_list_response.py
index 45d3abf29dd..e4d0cc9ec77 100644
--- a/src/cloudflare/types/magic_transit/gre_tunnel_list_response.py
+++ b/src/cloudflare/types/magic_transit/gre_tunnel_list_response.py
@@ -151,7 +151,8 @@ class GRETunnel(BaseModel):
automatic_return_routing: Optional[bool] = None
"""
True if automatic stateful return routing should be enabled for a tunnel, false
- otherwise.
+ otherwise. Requires the `coupler_integration` account flag to be enabled;
+ requests setting this to `true` without that flag will be rejected.
"""
bgp: Optional[GRETunnelBGP] = None
diff --git a/src/cloudflare/types/magic_transit/gre_tunnel_update_params.py b/src/cloudflare/types/magic_transit/gre_tunnel_update_params.py
index 0081115a1d3..003983dcf7d 100644
--- a/src/cloudflare/types/magic_transit/gre_tunnel_update_params.py
+++ b/src/cloudflare/types/magic_transit/gre_tunnel_update_params.py
@@ -39,7 +39,8 @@ class GRETunnelUpdateParams(TypedDict, total=False):
automatic_return_routing: bool
"""
True if automatic stateful return routing should be enabled for a tunnel, false
- otherwise.
+ otherwise. Requires the `coupler_integration` account flag to be enabled;
+ requests setting this to `true` without that flag will be rejected.
"""
description: str
diff --git a/src/cloudflare/types/magic_transit/gre_tunnel_update_response.py b/src/cloudflare/types/magic_transit/gre_tunnel_update_response.py
index 637b448d880..a1bba508388 100644
--- a/src/cloudflare/types/magic_transit/gre_tunnel_update_response.py
+++ b/src/cloudflare/types/magic_transit/gre_tunnel_update_response.py
@@ -151,7 +151,8 @@ class ModifiedGRETunnel(BaseModel):
automatic_return_routing: Optional[bool] = None
"""
True if automatic stateful return routing should be enabled for a tunnel, false
- otherwise.
+ otherwise. Requires the `coupler_integration` account flag to be enabled;
+ requests setting this to `true` without that flag will be rejected.
"""
bgp: Optional[ModifiedGRETunnelBGP] = None
diff --git a/src/cloudflare/types/magic_transit/ipsec_tunnel_bulk_update_response.py b/src/cloudflare/types/magic_transit/ipsec_tunnel_bulk_update_response.py
index 6fa99f7d723..09d3a3e6bc4 100644
--- a/src/cloudflare/types/magic_transit/ipsec_tunnel_bulk_update_response.py
+++ b/src/cloudflare/types/magic_transit/ipsec_tunnel_bulk_update_response.py
@@ -166,7 +166,8 @@ class ModifiedIPSECTunnel(BaseModel):
automatic_return_routing: Optional[bool] = None
"""
True if automatic stateful return routing should be enabled for a tunnel, false
- otherwise.
+ otherwise. Requires the `coupler_integration` account flag to be enabled;
+ requests setting this to `true` without that flag will be rejected.
"""
bgp: Optional[ModifiedIPSECTunnelBGP] = None
diff --git a/src/cloudflare/types/magic_transit/ipsec_tunnel_create_params.py b/src/cloudflare/types/magic_transit/ipsec_tunnel_create_params.py
index 1b6171df8e7..cbfb544cfcf 100644
--- a/src/cloudflare/types/magic_transit/ipsec_tunnel_create_params.py
+++ b/src/cloudflare/types/magic_transit/ipsec_tunnel_create_params.py
@@ -40,7 +40,8 @@ class IPSECTunnelCreateParams(TypedDict, total=False):
automatic_return_routing: bool
"""
True if automatic stateful return routing should be enabled for a tunnel, false
- otherwise.
+ otherwise. Requires the `coupler_integration` account flag to be enabled;
+ requests setting this to `true` without that flag will be rejected.
"""
bgp: BGP
diff --git a/src/cloudflare/types/magic_transit/ipsec_tunnel_create_response.py b/src/cloudflare/types/magic_transit/ipsec_tunnel_create_response.py
index 62a8802d687..3dfa6eef0d3 100644
--- a/src/cloudflare/types/magic_transit/ipsec_tunnel_create_response.py
+++ b/src/cloudflare/types/magic_transit/ipsec_tunnel_create_response.py
@@ -165,7 +165,8 @@ class IPSECTunnelCreateResponse(BaseModel):
automatic_return_routing: Optional[bool] = None
"""
True if automatic stateful return routing should be enabled for a tunnel, false
- otherwise.
+ otherwise. Requires the `coupler_integration` account flag to be enabled;
+ requests setting this to `true` without that flag will be rejected.
"""
bgp: Optional[BGP] = None
diff --git a/src/cloudflare/types/magic_transit/ipsec_tunnel_delete_response.py b/src/cloudflare/types/magic_transit/ipsec_tunnel_delete_response.py
index 20b73971937..196c7dd3204 100644
--- a/src/cloudflare/types/magic_transit/ipsec_tunnel_delete_response.py
+++ b/src/cloudflare/types/magic_transit/ipsec_tunnel_delete_response.py
@@ -166,7 +166,8 @@ class DeletedIPSECTunnel(BaseModel):
automatic_return_routing: Optional[bool] = None
"""
True if automatic stateful return routing should be enabled for a tunnel, false
- otherwise.
+ otherwise. Requires the `coupler_integration` account flag to be enabled;
+ requests setting this to `true` without that flag will be rejected.
"""
bgp: Optional[DeletedIPSECTunnelBGP] = None
diff --git a/src/cloudflare/types/magic_transit/ipsec_tunnel_get_response.py b/src/cloudflare/types/magic_transit/ipsec_tunnel_get_response.py
index 5a01d3e1a75..f8bc64d3ba0 100644
--- a/src/cloudflare/types/magic_transit/ipsec_tunnel_get_response.py
+++ b/src/cloudflare/types/magic_transit/ipsec_tunnel_get_response.py
@@ -166,7 +166,8 @@ class IPSECTunnel(BaseModel):
automatic_return_routing: Optional[bool] = None
"""
True if automatic stateful return routing should be enabled for a tunnel, false
- otherwise.
+ otherwise. Requires the `coupler_integration` account flag to be enabled;
+ requests setting this to `true` without that flag will be rejected.
"""
bgp: Optional[IPSECTunnelBGP] = None
diff --git a/src/cloudflare/types/magic_transit/ipsec_tunnel_list_response.py b/src/cloudflare/types/magic_transit/ipsec_tunnel_list_response.py
index a2671697a5a..2b400df722d 100644
--- a/src/cloudflare/types/magic_transit/ipsec_tunnel_list_response.py
+++ b/src/cloudflare/types/magic_transit/ipsec_tunnel_list_response.py
@@ -166,7 +166,8 @@ class IPSECTunnel(BaseModel):
automatic_return_routing: Optional[bool] = None
"""
True if automatic stateful return routing should be enabled for a tunnel, false
- otherwise.
+ otherwise. Requires the `coupler_integration` account flag to be enabled;
+ requests setting this to `true` without that flag will be rejected.
"""
bgp: Optional[IPSECTunnelBGP] = None
diff --git a/src/cloudflare/types/magic_transit/ipsec_tunnel_update_params.py b/src/cloudflare/types/magic_transit/ipsec_tunnel_update_params.py
index 459e55c76ed..b8d6325f32e 100644
--- a/src/cloudflare/types/magic_transit/ipsec_tunnel_update_params.py
+++ b/src/cloudflare/types/magic_transit/ipsec_tunnel_update_params.py
@@ -40,7 +40,8 @@ class IPSECTunnelUpdateParams(TypedDict, total=False):
automatic_return_routing: bool
"""
True if automatic stateful return routing should be enabled for a tunnel, false
- otherwise.
+ otherwise. Requires the `coupler_integration` account flag to be enabled;
+ requests setting this to `true` without that flag will be rejected.
"""
bgp: BGP
diff --git a/src/cloudflare/types/magic_transit/ipsec_tunnel_update_response.py b/src/cloudflare/types/magic_transit/ipsec_tunnel_update_response.py
index 291befb11e9..9e82141a51d 100644
--- a/src/cloudflare/types/magic_transit/ipsec_tunnel_update_response.py
+++ b/src/cloudflare/types/magic_transit/ipsec_tunnel_update_response.py
@@ -166,7 +166,8 @@ class ModifiedIPSECTunnel(BaseModel):
automatic_return_routing: Optional[bool] = None
"""
True if automatic stateful return routing should be enabled for a tunnel, false
- otherwise.
+ otherwise. Requires the `coupler_integration` account flag to be enabled;
+ requests setting this to `true` without that flag will be rejected.
"""
bgp: Optional[ModifiedIPSECTunnelBGP] = None
diff --git a/src/cloudflare/types/magic_transit/sites/dhcp_server.py b/src/cloudflare/types/magic_transit/sites/dhcp_server.py
index 51cce549430..55609a201c9 100644
--- a/src/cloudflare/types/magic_transit/sites/dhcp_server.py
+++ b/src/cloudflare/types/magic_transit/sites/dhcp_server.py
@@ -1,13 +1,43 @@
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
from typing import Dict, List, Optional
+from typing_extensions import Literal
from ...._models import BaseModel
-__all__ = ["DHCPServer"]
+__all__ = ["DHCPServer", "DHCPOption"]
+
+
+class DHCPOption(BaseModel):
+ """A custom DHCP option to include in DHCP responses."""
+
+ code: int
+ """DHCP option number (1-254).
+
+ Options 0 and 255 are reserved by RFC 2132. Options 3, 6, and 51 are not allowed
+ because they conflict with connector-managed configuration.
+ """
+
+ type: Literal["text", "hex", "ip", "byte", "short", "integer"]
+ """The type of the option value.
+
+ text: a string (max 255 bytes). hex: colon-separated hex bytes (e.g.
+ "01:04:aa:bb:cc", max 255 bytes). ip: an IPv4 address (e.g. "10.20.30.40").
+ byte: an unsigned integer 0-255 (1 byte). short: an unsigned integer 0-65535 (2
+ bytes). integer: an unsigned integer 0-4294967295 (4 bytes).
+ """
+
+ value: str
+ """The option value, interpreted according to the type field."""
class DHCPServer(BaseModel):
+ dhcp_options: Optional[List[DHCPOption]] = None
+ """Optional list of custom DHCP options to include in DHCP responses.
+
+ Only valid when DHCP server is enabled.
+ """
+
dhcp_pool_end: Optional[str] = None
"""A valid IPv4 address."""
diff --git a/src/cloudflare/types/magic_transit/sites/dhcp_server_param.py b/src/cloudflare/types/magic_transit/sites/dhcp_server_param.py
index 4eecd6a47df..58e8d8983f2 100644
--- a/src/cloudflare/types/magic_transit/sites/dhcp_server_param.py
+++ b/src/cloudflare/types/magic_transit/sites/dhcp_server_param.py
@@ -2,15 +2,44 @@
from __future__ import annotations
-from typing import Dict
-from typing_extensions import TypedDict
+from typing import Dict, Iterable
+from typing_extensions import Literal, Required, TypedDict
from ...._types import SequenceNotStr
-__all__ = ["DHCPServerParam"]
+__all__ = ["DHCPServerParam", "DHCPOption"]
+
+
+class DHCPOption(TypedDict, total=False):
+ """A custom DHCP option to include in DHCP responses."""
+
+ code: Required[int]
+ """DHCP option number (1-254).
+
+ Options 0 and 255 are reserved by RFC 2132. Options 3, 6, and 51 are not allowed
+ because they conflict with connector-managed configuration.
+ """
+
+ type: Required[Literal["text", "hex", "ip", "byte", "short", "integer"]]
+ """The type of the option value.
+
+ text: a string (max 255 bytes). hex: colon-separated hex bytes (e.g.
+ "01:04:aa:bb:cc", max 255 bytes). ip: an IPv4 address (e.g. "10.20.30.40").
+ byte: an unsigned integer 0-255 (1 byte). short: an unsigned integer 0-65535 (2
+ bytes). integer: an unsigned integer 0-4294967295 (4 bytes).
+ """
+
+ value: Required[str]
+ """The option value, interpreted according to the type field."""
class DHCPServerParam(TypedDict, total=False):
+ dhcp_options: Iterable[DHCPOption]
+ """Optional list of custom DHCP options to include in DHCP responses.
+
+ Only valid when DHCP server is enabled.
+ """
+
dhcp_pool_end: str
"""A valid IPv4 address."""
diff --git a/src/cloudflare/types/organizations/__init__.py b/src/cloudflare/types/organizations/__init__.py
index 5a572cf4049..af7b2fd5f68 100644
--- a/src/cloudflare/types/organizations/__init__.py
+++ b/src/cloudflare/types/organizations/__init__.py
@@ -3,6 +3,7 @@
from __future__ import annotations
from .organization import Organization as Organization
+from .organization_profile import OrganizationProfile as OrganizationProfile
from .organization_list_params import OrganizationListParams as OrganizationListParams
from .organization_create_params import OrganizationCreateParams as OrganizationCreateParams
from .organization_update_params import OrganizationUpdateParams as OrganizationUpdateParams
diff --git a/src/cloudflare/types/organizations/organization_profile_get_params.py b/src/cloudflare/types/organizations/organization_profile_get_params.py
new file mode 100644
index 00000000000..8075b04922b
--- /dev/null
+++ b/src/cloudflare/types/organizations/organization_profile_get_params.py
@@ -0,0 +1,11 @@
+# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
+
+from __future__ import annotations
+
+from typing_extensions import TypeAlias
+
+from .organization_profile import OrganizationProfile
+
+__all__ = ["Result"]
+
+Result: TypeAlias = OrganizationProfile
diff --git a/src/cloudflare/types/pipelines/sink_create_params.py b/src/cloudflare/types/pipelines/sink_create_params.py
index 5834c220a62..4e552374c9e 100644
--- a/src/cloudflare/types/pipelines/sink_create_params.py
+++ b/src/cloudflare/types/pipelines/sink_create_params.py
@@ -290,11 +290,11 @@ class SchemaFieldJson(TypedDict, total=False):
sql_name: str
-class SchemaFieldStruct(total=False):
+class SchemaFieldStruct(TypedDict, total=False):
pass
-class SchemaFieldList(total=False):
+class SchemaFieldList(TypedDict, total=False):
pass
diff --git a/src/cloudflare/types/pipelines/sink_create_response.py b/src/cloudflare/types/pipelines/sink_create_response.py
index 0d903fa1baf..2f398dd1924 100644
--- a/src/cloudflare/types/pipelines/sink_create_response.py
+++ b/src/cloudflare/types/pipelines/sink_create_response.py
@@ -276,11 +276,11 @@ class SchemaFieldJson(BaseModel):
sql_name: Optional[str] = None
-class SchemaFieldStruct:
+class SchemaFieldStruct(BaseModel):
pass
-class SchemaFieldList:
+class SchemaFieldList(BaseModel):
pass
diff --git a/src/cloudflare/types/pipelines/sink_get_response.py b/src/cloudflare/types/pipelines/sink_get_response.py
index 9541dbbb94d..2f7111cc455 100644
--- a/src/cloudflare/types/pipelines/sink_get_response.py
+++ b/src/cloudflare/types/pipelines/sink_get_response.py
@@ -264,11 +264,11 @@ class SchemaFieldJson(BaseModel):
sql_name: Optional[str] = None
-class SchemaFieldStruct:
+class SchemaFieldStruct(BaseModel):
pass
-class SchemaFieldList:
+class SchemaFieldList(BaseModel):
pass
diff --git a/src/cloudflare/types/pipelines/sink_list_response.py b/src/cloudflare/types/pipelines/sink_list_response.py
index fefd423ca39..7a3b443de67 100644
--- a/src/cloudflare/types/pipelines/sink_list_response.py
+++ b/src/cloudflare/types/pipelines/sink_list_response.py
@@ -264,11 +264,11 @@ class SchemaFieldJson(BaseModel):
sql_name: Optional[str] = None
-class SchemaFieldStruct:
+class SchemaFieldStruct(BaseModel):
pass
-class SchemaFieldList:
+class SchemaFieldList(BaseModel):
pass
diff --git a/src/cloudflare/types/pipelines/stream_create_params.py b/src/cloudflare/types/pipelines/stream_create_params.py
index 5c3a7448c1f..a519e9e9cf0 100644
--- a/src/cloudflare/types/pipelines/stream_create_params.py
+++ b/src/cloudflare/types/pipelines/stream_create_params.py
@@ -198,11 +198,11 @@ class SchemaFieldJson(TypedDict, total=False):
sql_name: str
-class SchemaFieldStruct(total=False):
+class SchemaFieldStruct(TypedDict, total=False):
pass
-class SchemaFieldList(total=False):
+class SchemaFieldList(TypedDict, total=False):
pass
diff --git a/src/cloudflare/types/pipelines/stream_create_response.py b/src/cloudflare/types/pipelines/stream_create_response.py
index 8db4fcc1937..04ffa7c7e0c 100644
--- a/src/cloudflare/types/pipelines/stream_create_response.py
+++ b/src/cloudflare/types/pipelines/stream_create_response.py
@@ -189,11 +189,11 @@ class SchemaFieldJson(BaseModel):
sql_name: Optional[str] = None
-class SchemaFieldStruct:
+class SchemaFieldStruct(BaseModel):
pass
-class SchemaFieldList:
+class SchemaFieldList(BaseModel):
pass
diff --git a/src/cloudflare/types/pipelines/stream_get_response.py b/src/cloudflare/types/pipelines/stream_get_response.py
index 7b9098819e2..1d78113c96c 100644
--- a/src/cloudflare/types/pipelines/stream_get_response.py
+++ b/src/cloudflare/types/pipelines/stream_get_response.py
@@ -189,11 +189,11 @@ class SchemaFieldJson(BaseModel):
sql_name: Optional[str] = None
-class SchemaFieldStruct:
+class SchemaFieldStruct(BaseModel):
pass
-class SchemaFieldList:
+class SchemaFieldList(BaseModel):
pass
diff --git a/src/cloudflare/types/pipelines/stream_list_response.py b/src/cloudflare/types/pipelines/stream_list_response.py
index a2d4540ef0b..9b4e76e9609 100644
--- a/src/cloudflare/types/pipelines/stream_list_response.py
+++ b/src/cloudflare/types/pipelines/stream_list_response.py
@@ -189,11 +189,11 @@ class SchemaFieldJson(BaseModel):
sql_name: Optional[str] = None
-class SchemaFieldStruct:
+class SchemaFieldStruct(BaseModel):
pass
-class SchemaFieldList:
+class SchemaFieldList(BaseModel):
pass
diff --git a/src/cloudflare/types/queues/__init__.py b/src/cloudflare/types/queues/__init__.py
index 2d25382356d..af80c330eab 100644
--- a/src/cloudflare/types/queues/__init__.py
+++ b/src/cloudflare/types/queues/__init__.py
@@ -23,6 +23,7 @@
from .subscription_list_params import SubscriptionListParams as SubscriptionListParams
from .subscription_get_response import SubscriptionGetResponse as SubscriptionGetResponse
from .message_bulk_push_response import MessageBulkPushResponse as MessageBulkPushResponse
+from .queue_get_metrics_response import QueueGetMetricsResponse as QueueGetMetricsResponse
from .subscription_create_params import SubscriptionCreateParams as SubscriptionCreateParams
from .subscription_list_response import SubscriptionListResponse as SubscriptionListResponse
from .subscription_update_params import SubscriptionUpdateParams as SubscriptionUpdateParams
diff --git a/src/cloudflare/types/queues/queue_get_metrics_response.py b/src/cloudflare/types/queues/queue_get_metrics_response.py
new file mode 100644
index 00000000000..6d60e49a45b
--- /dev/null
+++ b/src/cloudflare/types/queues/queue_get_metrics_response.py
@@ -0,0 +1,25 @@
+# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
+
+from ..._models import BaseModel
+
+__all__ = ["QueueGetMetricsResponse"]
+
+
+class QueueGetMetricsResponse(BaseModel):
+ """Best-effort metrics for the queue.
+
+ Values may be approximate due to the distributed nature of queues.
+ """
+
+ backlog_bytes: float
+ """The size in bytes of unacknowledged messages in the queue."""
+
+ backlog_count: float
+ """The number of unacknowledged messages in the queue."""
+
+ oldest_message_timestamp_ms: float
+ """Unix timestamp in milliseconds of the oldest unacknowledged message in the
+ queue.
+
+ Returns 0 if unknown.
+ """
diff --git a/src/cloudflare/types/workers/beta/workers/version.py b/src/cloudflare/types/workers/beta/workers/version.py
index 708a27dd244..4aaab999555 100644
--- a/src/cloudflare/types/workers/beta/workers/version.py
+++ b/src/cloudflare/types/workers/beta/workers/version.py
@@ -424,6 +424,13 @@ class BindingWorkersBindingKindRatelimitSimple(BaseModel):
period: int
"""The period in seconds."""
+ mitigation_timeout: Optional[int] = None
+ """
+ Duration in seconds to apply the mitigation action after the rate limit is
+ exceeded. Valid values are 0 (disabled), 10, or multiples of 60 up to 86400.
+ Must be greater than or equal to the period when non-zero.
+ """
+
class BindingWorkersBindingKindRatelimit(BaseModel):
name: str
diff --git a/src/cloudflare/types/workers/beta/workers/version_create_params.py b/src/cloudflare/types/workers/beta/workers/version_create_params.py
index 9f4b87ffba3..0267fb27bc0 100644
--- a/src/cloudflare/types/workers/beta/workers/version_create_params.py
+++ b/src/cloudflare/types/workers/beta/workers/version_create_params.py
@@ -509,6 +509,13 @@ class BindingWorkersBindingKindRatelimitSimple(TypedDict, total=False):
period: Required[int]
"""The period in seconds."""
+ mitigation_timeout: int
+ """
+ Duration in seconds to apply the mitigation action after the rate limit is
+ exceeded. Valid values are 0 (disabled), 10, or multiples of 60 up to 86400.
+ Must be greater than or equal to the period when non-zero.
+ """
+
class BindingWorkersBindingKindRatelimit(TypedDict, total=False):
name: Required[str]
diff --git a/src/cloudflare/types/workers/observability/telemetry_keys_params.py b/src/cloudflare/types/workers/observability/telemetry_keys_params.py
index 275b94b0c97..0f9c75cd0e3 100644
--- a/src/cloudflare/types/workers/observability/telemetry_keys_params.py
+++ b/src/cloudflare/types/workers/observability/telemetry_keys_params.py
@@ -12,6 +12,9 @@
"TelemetryKeysParams",
"Filter",
"FilterUnionMember0",
+ "FilterUnionMember0Filter",
+ "FilterUnionMember0FilterUnionMember0",
+ "FilterUnionMember0FilterWorkersObservabilityFilterLeaf",
"FilterWorkersObservabilityFilterLeaf",
"KeyNeedle",
"Needle",
@@ -50,7 +53,7 @@ class TelemetryKeysParams(TypedDict, total=False):
to: float
-class FilterUnionMember0(TypedDict, total=False):
+class FilterUnionMember0FilterUnionMember0(TypedDict, total=False):
filter_combination: Required[Annotated[Literal["and", "or", "AND", "OR"], PropertyInfo(alias="filterCombination")]]
filters: Required[Iterable[object]]
@@ -58,17 +61,106 @@ class FilterUnionMember0(TypedDict, total=False):
kind: Required[Literal["group"]]
-class FilterWorkersObservabilityFilterLeaf(TypedDict, total=False):
+class FilterUnionMember0FilterWorkersObservabilityFilterLeaf(TypedDict, total=False):
+ """A filter condition applied to query results.
+
+ Use the keys and values endpoints to discover available fields and their values before constructing filters.
"""
- Filtering best practices: use observability_keys and observability_values to confirm available fields and values. If searching for errors, filter for $metadata.error exists.
+
+ key: Required[str]
+ """Filter field name.
+
+ Use verified keys from previous query results or the keys endpoint. Common keys
+ include $metadata.service, $metadata.origin, $metadata.trigger,
+ $metadata.message, and $metadata.error.
+ """
+
+ operation: Required[
+ Literal[
+ "includes",
+ "not_includes",
+ "starts_with",
+ "regex",
+ "exists",
+ "is_null",
+ "in",
+ "not_in",
+ "eq",
+ "neq",
+ "gt",
+ "gte",
+ "lt",
+ "lte",
+ "=",
+ "!=",
+ ">",
+ ">=",
+ "<",
+ "<=",
+ "INCLUDES",
+ "DOES_NOT_INCLUDE",
+ "MATCH_REGEX",
+ "EXISTS",
+ "DOES_NOT_EXIST",
+ "IN",
+ "NOT_IN",
+ "STARTS_WITH",
+ ]
+ ]
+ """Comparison operator.
+
+ String operators: includes, not_includes, starts_with, regex. Existence: exists,
+ is_null. Set membership: in, not_in (comma-separated values). Numeric: eq, neq,
+ gt, gte, lt, lte.
+ """
+
+ type: Required[Literal["string", "number", "boolean"]]
+ """Data type of the filter field.
+
+ Must match the actual type of the key being filtered.
+ """
+
+ kind: Literal["filter"]
+ """Discriminator for leaf filter nodes.
+
+ Always 'filter' when present; may be omitted.
+ """
+
+ value: Union[str, float, bool]
+ """Comparison value.
+
+ Must match actual values in your data — verify with the values endpoint. Ensure
+ the value type (string/number/boolean) matches the field type. String
+ comparisons are case-sensitive. Regex uses RE2 syntax (no
+ lookaheads/lookbehinds).
+ """
+
+
+FilterUnionMember0Filter: TypeAlias = Union[
+ FilterUnionMember0FilterUnionMember0, FilterUnionMember0FilterWorkersObservabilityFilterLeaf
+]
+
+
+class FilterUnionMember0(TypedDict, total=False):
+ filter_combination: Required[Annotated[Literal["and", "or", "AND", "OR"], PropertyInfo(alias="filterCombination")]]
+
+ filters: Required[Iterable[FilterUnionMember0Filter]]
+
+ kind: Required[Literal["group"]]
+
+
+class FilterWorkersObservabilityFilterLeaf(TypedDict, total=False):
+ """A filter condition applied to query results.
+
+ Use the keys and values endpoints to discover available fields and their values before constructing filters.
"""
key: Required[str]
"""Filter field name.
- IMPORTANT: do not guess keys. Always use verified keys from previous query
- results or the observability_keys response. Preferred keys: $metadata.service,
- $metadata.origin, $metadata.trigger, $metadata.message, $metadata.error.
+ Use verified keys from previous query results or the keys endpoint. Common keys
+ include $metadata.service, $metadata.origin, $metadata.trigger,
+ $metadata.message, and $metadata.error.
"""
operation: Required[
@@ -103,19 +195,32 @@ class FilterWorkersObservabilityFilterLeaf(TypedDict, total=False):
"STARTS_WITH",
]
]
+ """Comparison operator.
+
+ String operators: includes, not_includes, starts_with, regex. Existence: exists,
+ is_null. Set membership: in, not_in (comma-separated values). Numeric: eq, neq,
+ gt, gte, lt, lte.
+ """
type: Required[Literal["string", "number", "boolean"]]
+ """Data type of the filter field.
+
+ Must match the actual type of the key being filtered.
+ """
kind: Literal["filter"]
+ """Discriminator for leaf filter nodes.
+
+ Always 'filter' when present; may be omitted.
+ """
value: Union[str, float, bool]
- """Filter comparison value.
+ """Comparison value.
- IMPORTANT: must match actual values in your logs. Verify using previous query
- results or the /values endpoint. Ensure value type matches the field type.
- String comparisons are case-sensitive unless using specific operations. Regex
- uses ClickHouse RE2 syntax (no lookaheads/lookbehinds); examples: ^5\\dd{2}$ for
- HTTP 5xx, \bERROR\b for word boundary.
+ Must match actual values in your data — verify with the values endpoint. Ensure
+ the value type (string/number/boolean) matches the field type. String
+ comparisons are case-sensitive. Regex uses RE2 syntax (no
+ lookaheads/lookbehinds).
"""
@@ -129,17 +234,23 @@ class KeyNeedle(TypedDict, total=False):
"""
value: Required[Union[str, float, bool]]
+ """The text or pattern to search for."""
is_regex: Annotated[bool, PropertyInfo(alias="isRegex")]
+ """When true, treats the value as a regular expression (RE2 syntax)."""
match_case: Annotated[bool, PropertyInfo(alias="matchCase")]
+ """When true, performs a case-sensitive search. Defaults to case-insensitive."""
class Needle(TypedDict, total=False):
"""Search for a specific substring in any of the events"""
value: Required[Union[str, float, bool]]
+ """The text or pattern to search for."""
is_regex: Annotated[bool, PropertyInfo(alias="isRegex")]
+ """When true, treats the value as a regular expression (RE2 syntax)."""
match_case: Annotated[bool, PropertyInfo(alias="matchCase")]
+ """When true, performs a case-sensitive search. Defaults to case-insensitive."""
diff --git a/src/cloudflare/types/workers/observability/telemetry_query_params.py b/src/cloudflare/types/workers/observability/telemetry_query_params.py
index 6430ea3f9fb..c328f89aad2 100644
--- a/src/cloudflare/types/workers/observability/telemetry_query_params.py
+++ b/src/cloudflare/types/workers/observability/telemetry_query_params.py
@@ -15,6 +15,9 @@
"ParametersCalculation",
"ParametersFilter",
"ParametersFilterUnionMember0",
+ "ParametersFilterUnionMember0Filter",
+ "ParametersFilterUnionMember0FilterUnionMember0",
+ "ParametersFilterUnionMember0FilterWorkersObservabilityFilterLeaf",
"ParametersFilterWorkersObservabilityFilterLeaf",
"ParametersGroupBy",
"ParametersHaving",
@@ -27,66 +30,83 @@ class TelemetryQueryParams(TypedDict, total=False):
account_id: Required[str]
query_id: Required[Annotated[str, PropertyInfo(alias="queryId")]]
- """Unique identifier for the query to execute"""
+ """Identifier for the query.
+
+ When parameters are omitted, this ID is used to load a previously saved query's
+ parameters. When providing parameters inline, pass any identifier (e.g. an
+ ad-hoc ID).
+ """
timeframe: Required[Timeframe]
- """Timeframe for your query using Unix timestamps in milliseconds.
+ """Timeframe for the query using Unix timestamps in milliseconds.
- Provide from/to epoch ms; narrower timeframes provide faster responses and more
- specific results.
+ Narrower timeframes produce faster responses and more specific results.
"""
chart: bool
- """Whether to include timeseties data in the response"""
+ """When true, includes time-series data in the response."""
compare: bool
- """Whether to include comparison data with previous time periods"""
+ """
+ When true, includes a comparison dataset from the previous time period of equal
+ length.
+ """
dry: bool
- """Whether to perform a dry run without saving the results of the query.
+ """When true, executes the query without persisting the results.
- Useful for validation
+ Useful for validation or previewing.
"""
granularity: float
- """This is only used when the view is calculations.
+ """Number of time-series buckets.
- Leaving it empty lets Workers Observability detect the correct granularity.
+ Only used when view is 'calculations'. Omit to let the system auto-detect an
+ appropriate granularity.
"""
ignore_series: Annotated[bool, PropertyInfo(alias="ignoreSeries")]
"""
- Whether to ignore time-series data in the results and return only aggregated
- values
+ When true, omits time-series data from the response and returns only aggregated
+ values. Reduces response size when series are not needed.
"""
limit: float
- """Use this limit to cap the number of events returned when the view is events."""
+ """Maximum number of events to return when view is 'events'.
+
+ Also controls the number of group-by rows when view is 'calculations'.
+ """
offset: str
- """Cursor pagination for event/trace/invocation views.
+ """Cursor for pagination in event, trace, and invocation views.
- Pass the last item's $metadata.id as the next offset.
+ Pass the $metadata.id of the last returned item to fetch the next page.
"""
offset_by: Annotated[float, PropertyInfo(alias="offsetBy")]
- """Numeric offset for pattern results (top-N list).
+ """Numeric offset for paginating grouped/pattern results (top-N lists).
- Use with limit to page pattern groups; not used by cursor pagination.
+ Use together with limit. Not used by cursor-based pagination.
"""
offset_direction: Annotated[str, PropertyInfo(alias="offsetDirection")]
- """Direction for offset-based pagination (e.g., 'next', 'prev')"""
+ """Pagination direction: 'next' for forward, 'prev' for backward."""
parameters: Parameters
- """Optional parameters to pass to the query execution"""
+ """
+ Query parameters defining what data to retrieve — filters, calculations,
+ group-bys, and ordering. In practice this should always be provided for ad-hoc
+ queries. Only omit when executing a previously saved query by queryId. Use the
+ keys and values endpoints to discover available fields before building filters.
+ """
view: Literal["traces", "events", "calculations", "invocations", "requests", "agents"]
- """Examples by view type.
+ """Controls the shape of the response.
- Events: show errors for a worker in the last 30 minutes. Calculations: p99 of
- wall time or count by status code. Invocations: find a specific request that
- resulted in a 500.
+ 'events': individual log lines matching the query. 'calculations': aggregated
+ metrics (count, avg, p99, etc.) with optional group-by breakdowns and
+ time-series. 'invocations': events grouped by request ID. 'traces': distributed
+ trace summaries. 'agents': Durable Object agent summaries.
"""
@@ -100,9 +120,9 @@ class TelemetryQueryParams(TypedDict, total=False):
class Timeframe(_TimeframeReservedKeywords, total=False):
- """Timeframe for your query using Unix timestamps in milliseconds.
+ """Timeframe for the query using Unix timestamps in milliseconds.
- Provide from/to epoch ms; narrower timeframes provide faster responses and more specific results.
+ Narrower timeframes produce faster responses and more specific results.
"""
to: Required[float]
@@ -152,20 +172,32 @@ class ParametersCalculation(TypedDict, total=False):
"VARIANCE",
]
]
+ """Aggregation operator to apply.
+
+ Examples: count, avg, sum, min, max, p50, p90, p95, p99, uniq, stddev, variance.
+ """
alias: str
+ """Custom label for this calculation in the results.
+
+ Useful for distinguishing multiple calculations.
+ """
key: str
- """The key to use for the calculation.
+ """Field name to calculate over.
- This key must exist in the logs. Use the observability_keys response to confirm.
- Do not guess keys.
+ Must exist in the data — verify with the keys endpoint. Omit for operators that
+ don't require a key (e.g. count).
"""
key_type: Annotated[Literal["string", "number", "boolean"], PropertyInfo(alias="keyType")]
+ """Data type of the key.
+ Required when key is provided to ensure correct aggregation.
+ """
-class ParametersFilterUnionMember0(TypedDict, total=False):
+
+class ParametersFilterUnionMember0FilterUnionMember0(TypedDict, total=False):
filter_combination: Required[Annotated[Literal["and", "or", "AND", "OR"], PropertyInfo(alias="filterCombination")]]
filters: Required[Iterable[object]]
@@ -173,17 +205,106 @@ class ParametersFilterUnionMember0(TypedDict, total=False):
kind: Required[Literal["group"]]
-class ParametersFilterWorkersObservabilityFilterLeaf(TypedDict, total=False):
+class ParametersFilterUnionMember0FilterWorkersObservabilityFilterLeaf(TypedDict, total=False):
+ """A filter condition applied to query results.
+
+ Use the keys and values endpoints to discover available fields and their values before constructing filters.
+ """
+
+ key: Required[str]
+ """Filter field name.
+
+ Use verified keys from previous query results or the keys endpoint. Common keys
+ include $metadata.service, $metadata.origin, $metadata.trigger,
+ $metadata.message, and $metadata.error.
"""
- Filtering best practices: use observability_keys and observability_values to confirm available fields and values. If searching for errors, filter for $metadata.error exists.
+
+ operation: Required[
+ Literal[
+ "includes",
+ "not_includes",
+ "starts_with",
+ "regex",
+ "exists",
+ "is_null",
+ "in",
+ "not_in",
+ "eq",
+ "neq",
+ "gt",
+ "gte",
+ "lt",
+ "lte",
+ "=",
+ "!=",
+ ">",
+ ">=",
+ "<",
+ "<=",
+ "INCLUDES",
+ "DOES_NOT_INCLUDE",
+ "MATCH_REGEX",
+ "EXISTS",
+ "DOES_NOT_EXIST",
+ "IN",
+ "NOT_IN",
+ "STARTS_WITH",
+ ]
+ ]
+ """Comparison operator.
+
+ String operators: includes, not_includes, starts_with, regex. Existence: exists,
+ is_null. Set membership: in, not_in (comma-separated values). Numeric: eq, neq,
+ gt, gte, lt, lte.
+ """
+
+ type: Required[Literal["string", "number", "boolean"]]
+ """Data type of the filter field.
+
+ Must match the actual type of the key being filtered.
+ """
+
+ kind: Literal["filter"]
+ """Discriminator for leaf filter nodes.
+
+ Always 'filter' when present; may be omitted.
+ """
+
+ value: Union[str, float, bool]
+ """Comparison value.
+
+ Must match actual values in your data — verify with the values endpoint. Ensure
+ the value type (string/number/boolean) matches the field type. String
+ comparisons are case-sensitive. Regex uses RE2 syntax (no
+ lookaheads/lookbehinds).
+ """
+
+
+ParametersFilterUnionMember0Filter: TypeAlias = Union[
+ ParametersFilterUnionMember0FilterUnionMember0, ParametersFilterUnionMember0FilterWorkersObservabilityFilterLeaf
+]
+
+
+class ParametersFilterUnionMember0(TypedDict, total=False):
+ filter_combination: Required[Annotated[Literal["and", "or", "AND", "OR"], PropertyInfo(alias="filterCombination")]]
+
+ filters: Required[Iterable[ParametersFilterUnionMember0Filter]]
+
+ kind: Required[Literal["group"]]
+
+
+class ParametersFilterWorkersObservabilityFilterLeaf(TypedDict, total=False):
+ """A filter condition applied to query results.
+
+ Use the keys and values endpoints to discover available fields and their values before constructing filters.
"""
key: Required[str]
"""Filter field name.
- IMPORTANT: do not guess keys. Always use verified keys from previous query
- results or the observability_keys response. Preferred keys: $metadata.service,
- $metadata.origin, $metadata.trigger, $metadata.message, $metadata.error.
+ Use verified keys from previous query results or the keys endpoint. Common keys
+ include $metadata.service, $metadata.origin, $metadata.trigger,
+ $metadata.message, and $metadata.error.
"""
operation: Required[
@@ -218,19 +339,32 @@ class ParametersFilterWorkersObservabilityFilterLeaf(TypedDict, total=False):
"STARTS_WITH",
]
]
+ """Comparison operator.
+
+ String operators: includes, not_includes, starts_with, regex. Existence: exists,
+ is_null. Set membership: in, not_in (comma-separated values). Numeric: eq, neq,
+ gt, gte, lt, lte.
+ """
type: Required[Literal["string", "number", "boolean"]]
+ """Data type of the filter field.
+
+ Must match the actual type of the key being filtered.
+ """
kind: Literal["filter"]
+ """Discriminator for leaf filter nodes.
+
+ Always 'filter' when present; may be omitted.
+ """
value: Union[str, float, bool]
- """Filter comparison value.
+ """Comparison value.
- IMPORTANT: must match actual values in your logs. Verify using previous query
- results or the /values endpoint. Ensure value type matches the field type.
- String comparisons are case-sensitive unless using specific operations. Regex
- uses ClickHouse RE2 syntax (no lookaheads/lookbehinds); examples: ^5\\dd{2}$ for
- HTTP 5xx, \bERROR\b for word boundary.
+ Must match actual values in your data — verify with the values endpoint. Ensure
+ the value type (string/number/boolean) matches the field type. String
+ comparisons are case-sensitive. Regex uses RE2 syntax (no
+ lookaheads/lookbehinds).
"""
@@ -239,67 +373,110 @@ class ParametersFilterWorkersObservabilityFilterLeaf(TypedDict, total=False):
class ParametersGroupBy(TypedDict, total=False):
type: Required[Literal["string", "number", "boolean"]]
+ """Data type of the group-by field."""
value: Required[str]
+ """Field name to group results by (e.g. $metadata.service, $metadata.statusCode)."""
class ParametersHaving(TypedDict, total=False):
key: Required[str]
+ """Calculation alias or operator to filter on after aggregation."""
operation: Required[Literal["eq", "neq", "gt", "gte", "lt", "lte"]]
+ """Numeric comparison operator: eq, neq, gt, gte, lt, lte."""
value: Required[float]
+ """Threshold value to compare the calculation result against."""
class ParametersNeedle(TypedDict, total=False):
- """Define an expression to search using full-text search."""
+ """Full-text search expression applied across all event fields.
+
+ Matches events containing the specified text.
+ """
value: Required[Union[str, float, bool]]
+ """The text or pattern to search for."""
is_regex: Annotated[bool, PropertyInfo(alias="isRegex")]
+ """When true, treats the value as a regular expression (RE2 syntax)."""
match_case: Annotated[bool, PropertyInfo(alias="matchCase")]
+ """When true, performs a case-sensitive search. Defaults to case-insensitive."""
class ParametersOrderBy(TypedDict, total=False):
- """Configure the order of the results returned by the query."""
+ """Ordering for grouped calculation results.
+
+ Only effective when a group-by is present.
+ """
value: Required[str]
- """Configure which Calculation to order the results by."""
+ """Alias of the calculation to order results by.
+
+ Must match the alias (or operator) of a calculation in the query.
+ """
order: Literal["asc", "desc"]
- """Set the order of the results"""
+ """Sort direction: 'asc' for ascending, 'desc' for descending."""
class Parameters(TypedDict, total=False):
- """Optional parameters to pass to the query execution"""
+ """
+ Query parameters defining what data to retrieve — filters, calculations, group-bys, and ordering. In practice this should always be provided for ad-hoc queries. Only omit when executing a previously saved query by queryId. Use the keys and values endpoints to discover available fields before building filters.
+ """
calculations: Iterable[ParametersCalculation]
- """Create Calculations to compute as part of the query."""
+ """Aggregation calculations to compute (e.g.
+
+ count, avg, p99). Each calculation produces aggregate values and optional
+ time-series data.
+ """
datasets: SequenceNotStr[str]
- """Set the Datasets to query. Leave it empty to query all the datasets."""
+ """Datasets to query. Leave empty to query all available datasets."""
filter_combination: Annotated[Literal["and", "or", "AND", "OR"], PropertyInfo(alias="filterCombination")]
- """Set a Flag to describe how to combine the filters on the query."""
+ """
+ Logical operator for combining top-level filters: 'and' (all must match) or 'or'
+ (any must match). Defaults to 'and'.
+ """
filters: Iterable[ParametersFilter]
- """Configure the Filters to apply to the query.
+ """Filters to narrow query results.
- Supports nested groups via kind: 'group'. Maximum nesting depth is 4.
+ Use the keys and values endpoints to discover available fields before building
+ filters. Supports nested groups via kind: 'group'. Maximum nesting depth is 4.
"""
group_bys: Annotated[Iterable[ParametersGroupBy], PropertyInfo(alias="groupBys")]
- """Define how to group the results of the query."""
+ """Fields to group calculation results by.
+
+ Only applicable when the query view is 'calculations'. Produces per-group
+ aggregate values.
+ """
havings: Iterable[ParametersHaving]
- """Configure the Having clauses that filter on calculations in the query result."""
+ """Post-aggregation filters applied to calculation results.
+
+ Use to filter groups after aggregation (e.g. only groups where count > 100).
+ """
limit: int
- """Set a limit on the number of results / records returned by the query"""
+ """Maximum number of group-by rows to return in calculation results.
+
+ A value of 10 is a sensible default for most use cases.
+ """
needle: ParametersNeedle
- """Define an expression to search using full-text search."""
+ """Full-text search expression applied across all event fields.
+
+ Matches events containing the specified text.
+ """
order_by: Annotated[ParametersOrderBy, PropertyInfo(alias="orderBy")]
- """Configure the order of the results returned by the query."""
+ """Ordering for grouped calculation results.
+
+ Only effective when a group-by is present.
+ """
diff --git a/src/cloudflare/types/workers/observability/telemetry_query_response.py b/src/cloudflare/types/workers/observability/telemetry_query_response.py
index 27fe10fc78d..6ec793c152f 100644
--- a/src/cloudflare/types/workers/observability/telemetry_query_response.py
+++ b/src/cloudflare/types/workers/observability/telemetry_query_response.py
@@ -120,16 +120,17 @@ class RunQueryParametersFilterUnionMember0(BaseModel):
class RunQueryParametersFilterWorkersObservabilityFilterLeaf(BaseModel):
- """
- Filtering best practices: use observability_keys and observability_values to confirm available fields and values. If searching for errors, filter for $metadata.error exists.
+ """A filter condition applied to query results.
+
+ Use the keys and values endpoints to discover available fields and their values before constructing filters.
"""
key: str
"""Filter field name.
- IMPORTANT: do not guess keys. Always use verified keys from previous query
- results or the observability_keys response. Preferred keys: $metadata.service,
- $metadata.origin, $metadata.trigger, $metadata.message, $metadata.error.
+ Use verified keys from previous query results or the keys endpoint. Common keys
+ include $metadata.service, $metadata.origin, $metadata.trigger,
+ $metadata.message, and $metadata.error.
"""
operation: Literal[
@@ -162,19 +163,32 @@ class RunQueryParametersFilterWorkersObservabilityFilterLeaf(BaseModel):
"NOT_IN",
"STARTS_WITH",
]
+ """Comparison operator.
+
+ String operators: includes, not_includes, starts_with, regex. Existence: exists,
+ is_null. Set membership: in, not_in (comma-separated values). Numeric: eq, neq,
+ gt, gte, lt, lte.
+ """
type: Literal["string", "number", "boolean"]
+ """Data type of the filter field.
+
+ Must match the actual type of the key being filtered.
+ """
kind: Optional[Literal["filter"]] = None
+ """Discriminator for leaf filter nodes.
+
+ Always 'filter' when present; may be omitted.
+ """
value: Union[str, float, bool, None] = None
- """Filter comparison value.
+ """Comparison value.
- IMPORTANT: must match actual values in your logs. Verify using previous query
- results or the /values endpoint. Ensure value type matches the field type.
- String comparisons are case-sensitive unless using specific operations. Regex
- uses ClickHouse RE2 syntax (no lookaheads/lookbehinds); examples: ^5\\dd{2}$ for
- HTTP 5xx, \bERROR\b for word boundary.
+ Must match actual values in your data — verify with the values endpoint. Ensure
+ the value type (string/number/boolean) matches the field type. String
+ comparisons are case-sensitive. Regex uses RE2 syntax (no
+ lookaheads/lookbehinds).
"""
@@ -254,6 +268,10 @@ class RunQueryParameters(BaseModel):
class RunQuery(BaseModel):
+ """
+ A saved query definition with its parameters, metadata, and ownership information.
+ """
+
id: str
adhoc: bool
@@ -286,6 +304,10 @@ class RunTimeframe(BaseModel):
class RunStatistics(BaseModel):
+ """
+ Query performance statistics from the database (does not include network latency).
+ """
+
bytes_read: float
"""Number of uncompressed bytes read from the table."""
@@ -303,35 +325,57 @@ class RunStatistics(BaseModel):
class Run(BaseModel):
- """A Workers Observability Query Object"""
+ """
+ The query run metadata including the query definition, execution status, and timeframe.
+ """
id: str
+ """Unique identifier for this query run."""
account_id: str = FieldInfo(alias="accountId")
+ """Cloudflare account ID that owns this query run."""
dry: bool
+ """Whether this was a dry run (results not persisted)."""
granularity: float
+ """Number of time-series buckets used for the query.
+
+ Higher values produce more detailed series data.
+ """
query: RunQuery
+ """
+ A saved query definition with its parameters, metadata, and ownership
+ information.
+ """
status: Literal["STARTED", "COMPLETED"]
+ """Current execution status of the query run."""
timeframe: RunTimeframe
"""Time range for the query execution"""
user_id: str = FieldInfo(alias="userId")
+ """ID of the user who initiated the query run."""
created: Optional[str] = None
+ """ISO-8601 timestamp when the query run was created."""
statistics: Optional[RunStatistics] = None
+ """
+ Query performance statistics from the database (does not include network
+ latency).
+ """
updated: Optional[str] = None
+ """ISO-8601 timestamp when the query run was last updated."""
class Statistics(BaseModel):
- """
- The statistics object contains information about query performance from the database, it does not include any network latency
+ """Query performance statistics from the database.
+
+ Includes execution time, rows scanned, and bytes read. Does not include network latency.
"""
bytes_read: float
@@ -352,20 +396,31 @@ class Statistics(BaseModel):
class Agent(BaseModel):
agent_class: str = FieldInfo(alias="agentClass")
+ """Class name of the Durable Object agent."""
event_type_counts: Dict[str, float] = FieldInfo(alias="eventTypeCounts")
+ """Breakdown of event counts by event type."""
first_event_ms: float = FieldInfo(alias="firstEventMs")
+ """
+ Timestamp of the earliest event from this agent in the queried window (Unix
+ epoch ms).
+ """
has_errors: bool = FieldInfo(alias="hasErrors")
+ """Whether the agent emitted any error events in the queried window."""
last_event_ms: float = FieldInfo(alias="lastEventMs")
+ """Timestamp of the most recent event from this agent (Unix epoch ms)."""
namespace: str
+ """Durable Object namespace the agent belongs to."""
service: str
+ """Worker service name that hosts this agent."""
total_events: float = FieldInfo(alias="totalEvents")
+ """Total number of events emitted by this agent in the queried window."""
class CalculationAggregateGroup(BaseModel):
@@ -481,68 +536,103 @@ class Compare(BaseModel):
class EventsEventMetadata(BaseModel):
+ """Structured metadata extracted from the event.
+
+ These fields are indexed and available for filtering and aggregation.
+ """
+
id: str
- """Unique event ID. Use as the cursor for offset-based pagination."""
+ """Unique event ID. Use as the cursor value for offset-based pagination."""
account: Optional[str] = None
+ """Cloudflare account identifier."""
cloud_service: Optional[str] = FieldInfo(alias="cloudService", default=None)
+ """Cloudflare product that generated this event (e.g. workers, pages)."""
cold_start: Optional[int] = FieldInfo(alias="coldStart", default=None)
+ """Whether this was a cold start (1) or warm invocation (0)."""
cost: Optional[int] = None
+ """Estimated cost units for this invocation."""
duration: Optional[int] = None
+ """Span duration in milliseconds."""
end_time: Optional[int] = FieldInfo(alias="endTime", default=None)
+ """Span end time as a Unix epoch in milliseconds."""
error: Optional[str] = None
+ """Error message, present when the log represents an error."""
error_template: Optional[str] = FieldInfo(alias="errorTemplate", default=None)
+ """Templatized version of the error message used for grouping similar errors."""
fingerprint: Optional[str] = None
+ """Content-based fingerprint used to group similar events."""
level: Optional[str] = None
+ """Log level (e.g. log, debug, info, warn, error)."""
message: Optional[str] = None
+ """Log message text."""
message_template: Optional[str] = FieldInfo(alias="messageTemplate", default=None)
+ """Templatized version of the log message used for grouping similar messages."""
metric_name: Optional[str] = FieldInfo(alias="metricName", default=None)
+ """Metric name when the event represents a metric data point."""
origin: Optional[str] = None
+ """Origin of the event (e.g. fetch, scheduled, queue)."""
parent_span_id: Optional[str] = FieldInfo(alias="parentSpanId", default=None)
+ """Span ID of the parent span in the trace hierarchy."""
provider: Optional[str] = None
+ """Infrastructure provider identifier."""
region: Optional[str] = None
+ """Cloudflare data center / region that handled the request."""
request_id: Optional[str] = FieldInfo(alias="requestId", default=None)
+ """Cloudflare request ID that ties all logs from a single invocation together."""
service: Optional[str] = None
+ """Worker script name that produced this event."""
span_id: Optional[str] = FieldInfo(alias="spanId", default=None)
+ """Span ID for this individual unit of work within a trace."""
span_name: Optional[str] = FieldInfo(alias="spanName", default=None)
+ """Human-readable name for this span."""
stack_id: Optional[str] = FieldInfo(alias="stackId", default=None)
+ """Stack / deployment identifier."""
start_time: Optional[int] = FieldInfo(alias="startTime", default=None)
+ """Span start time as a Unix epoch in milliseconds."""
status_code: Optional[int] = FieldInfo(alias="statusCode", default=None)
+ """HTTP response status code returned by the Worker."""
trace_duration: Optional[int] = FieldInfo(alias="traceDuration", default=None)
+ """Total duration of the entire trace in milliseconds."""
trace_id: Optional[str] = FieldInfo(alias="traceId", default=None)
+ """Distributed trace ID linking spans across services."""
transaction_name: Optional[str] = FieldInfo(alias="transactionName", default=None)
+ """Logical transaction name for this request."""
trigger: Optional[str] = None
+ """What triggered the invocation (e.g. GET /users, POST /orders, queue message)."""
type: Optional[str] = None
+ """Event type classifier (e.g. cf-worker-event, cf-worker-log)."""
url: Optional[str] = None
+ """Request URL that triggered the Worker invocation."""
class EventsEventWorkersUnionMember0ScriptVersion(BaseModel):
@@ -576,6 +666,10 @@ class EventsEventWorkersUnionMember0(BaseModel):
alias="scriptVersion", default=None
)
+ span_id: Optional[str] = FieldInfo(alias="spanId", default=None)
+
+ trace_id: Optional[str] = FieldInfo(alias="traceId", default=None)
+
truncated: Optional[bool] = None
@@ -628,6 +722,10 @@ class EventsEventWorkersUnionMember1(BaseModel):
alias="scriptVersion", default=None
)
+ span_id: Optional[str] = FieldInfo(alias="spanId", default=None)
+
+ trace_id: Optional[str] = FieldInfo(alias="traceId", default=None)
+
truncated: Optional[bool] = None
@@ -635,33 +733,47 @@ class EventsEventWorkersUnionMember1(BaseModel):
class EventsEvent(BaseModel):
- """The data structure of a telemetry event"""
+ """
+ A single telemetry event representing a log line, span, or metric data point emitted by a Worker.
+ """
metadata: EventsEventMetadata = FieldInfo(alias="$metadata")
+ """Structured metadata extracted from the event.
+
+ These fields are indexed and available for filtering and aggregation.
+ """
dataset: str
+ """The dataset this event belongs to (e.g. cloudflare-workers)."""
source: Union[str, object]
+ """Raw log payload.
+
+ May be a string or a structured object depending on how the log was emitted.
+ """
timestamp: int
+ """Event timestamp as a Unix epoch in milliseconds."""
containers: Optional[object] = FieldInfo(alias="$containers", default=None)
"""
- Cloudflare Containers event information enriches your logs so you can easily
- identify and debug issues.
+ Cloudflare Containers event information that enriches your logs for identifying
+ and debugging issues.
"""
workers: Optional[EventsEventWorkers] = FieldInfo(alias="$workers", default=None)
"""
- Cloudflare Workers event information enriches your logs so you can easily
- identify and debug issues.
+ Cloudflare Workers event information that enriches your logs for identifying and
+ debugging issues.
"""
class EventsField(BaseModel):
key: str
+ """Field name present in the matched events."""
type: str
+ """Data type of the field (string, number, or boolean)."""
class EventsSeriesDataAggregates(BaseModel):
@@ -698,78 +810,128 @@ class EventsSeries(BaseModel):
class Events(BaseModel):
+ """Individual event results.
+
+ Present when the query view is 'events'. Contains the matching log lines and their metadata.
+ """
+
count: Optional[float] = None
+ """
+ Total number of events matching the query (may exceed the number returned due to
+ limits).
+ """
events: Optional[List[EventsEvent]] = None
+ """List of individual telemetry events matching the query."""
fields: Optional[List[EventsField]] = None
+ """List of fields discovered in the matched events.
+
+ Useful for building dynamic UIs.
+ """
series: Optional[List[EventsSeries]] = None
+ """Time-series data for the matched events, bucketed by the query granularity."""
class InvocationMetadata(BaseModel):
+ """Structured metadata extracted from the event.
+
+ These fields are indexed and available for filtering and aggregation.
+ """
+
id: str
- """Unique event ID. Use as the cursor for offset-based pagination."""
+ """Unique event ID. Use as the cursor value for offset-based pagination."""
account: Optional[str] = None
+ """Cloudflare account identifier."""
cloud_service: Optional[str] = FieldInfo(alias="cloudService", default=None)
+ """Cloudflare product that generated this event (e.g. workers, pages)."""
cold_start: Optional[int] = FieldInfo(alias="coldStart", default=None)
+ """Whether this was a cold start (1) or warm invocation (0)."""
cost: Optional[int] = None
+ """Estimated cost units for this invocation."""
duration: Optional[int] = None
+ """Span duration in milliseconds."""
end_time: Optional[int] = FieldInfo(alias="endTime", default=None)
+ """Span end time as a Unix epoch in milliseconds."""
error: Optional[str] = None
+ """Error message, present when the log represents an error."""
error_template: Optional[str] = FieldInfo(alias="errorTemplate", default=None)
+ """Templatized version of the error message used for grouping similar errors."""
fingerprint: Optional[str] = None
+ """Content-based fingerprint used to group similar events."""
level: Optional[str] = None
+ """Log level (e.g. log, debug, info, warn, error)."""
message: Optional[str] = None
+ """Log message text."""
message_template: Optional[str] = FieldInfo(alias="messageTemplate", default=None)
+ """Templatized version of the log message used for grouping similar messages."""
metric_name: Optional[str] = FieldInfo(alias="metricName", default=None)
+ """Metric name when the event represents a metric data point."""
origin: Optional[str] = None
+ """Origin of the event (e.g. fetch, scheduled, queue)."""
parent_span_id: Optional[str] = FieldInfo(alias="parentSpanId", default=None)
+ """Span ID of the parent span in the trace hierarchy."""
provider: Optional[str] = None
+ """Infrastructure provider identifier."""
region: Optional[str] = None
+ """Cloudflare data center / region that handled the request."""
request_id: Optional[str] = FieldInfo(alias="requestId", default=None)
+ """Cloudflare request ID that ties all logs from a single invocation together."""
service: Optional[str] = None
+ """Worker script name that produced this event."""
span_id: Optional[str] = FieldInfo(alias="spanId", default=None)
+ """Span ID for this individual unit of work within a trace."""
span_name: Optional[str] = FieldInfo(alias="spanName", default=None)
+ """Human-readable name for this span."""
stack_id: Optional[str] = FieldInfo(alias="stackId", default=None)
+ """Stack / deployment identifier."""
start_time: Optional[int] = FieldInfo(alias="startTime", default=None)
+ """Span start time as a Unix epoch in milliseconds."""
status_code: Optional[int] = FieldInfo(alias="statusCode", default=None)
+ """HTTP response status code returned by the Worker."""
trace_duration: Optional[int] = FieldInfo(alias="traceDuration", default=None)
+ """Total duration of the entire trace in milliseconds."""
trace_id: Optional[str] = FieldInfo(alias="traceId", default=None)
+ """Distributed trace ID linking spans across services."""
transaction_name: Optional[str] = FieldInfo(alias="transactionName", default=None)
+ """Logical transaction name for this request."""
trigger: Optional[str] = None
+ """What triggered the invocation (e.g. GET /users, POST /orders, queue message)."""
type: Optional[str] = None
+ """Event type classifier (e.g. cf-worker-event, cf-worker-log)."""
url: Optional[str] = None
+ """Request URL that triggered the Worker invocation."""
class InvocationWorkersUnionMember0ScriptVersion(BaseModel):
@@ -803,6 +965,10 @@ class InvocationWorkersUnionMember0(BaseModel):
alias="scriptVersion", default=None
)
+ span_id: Optional[str] = FieldInfo(alias="spanId", default=None)
+
+ trace_id: Optional[str] = FieldInfo(alias="traceId", default=None)
+
truncated: Optional[bool] = None
@@ -855,6 +1021,10 @@ class InvocationWorkersUnionMember1(BaseModel):
alias="scriptVersion", default=None
)
+ span_id: Optional[str] = FieldInfo(alias="spanId", default=None)
+
+ trace_id: Optional[str] = FieldInfo(alias="traceId", default=None)
+
truncated: Optional[bool] = None
@@ -862,67 +1032,126 @@ class InvocationWorkersUnionMember1(BaseModel):
class Invocation(BaseModel):
- """The data structure of a telemetry event"""
+ """
+ A single telemetry event representing a log line, span, or metric data point emitted by a Worker.
+ """
metadata: InvocationMetadata = FieldInfo(alias="$metadata")
+ """Structured metadata extracted from the event.
+
+ These fields are indexed and available for filtering and aggregation.
+ """
dataset: str
+ """The dataset this event belongs to (e.g. cloudflare-workers)."""
source: Union[str, object]
+ """Raw log payload.
+
+ May be a string or a structured object depending on how the log was emitted.
+ """
timestamp: int
+ """Event timestamp as a Unix epoch in milliseconds."""
containers: Optional[object] = FieldInfo(alias="$containers", default=None)
"""
- Cloudflare Containers event information enriches your logs so you can easily
- identify and debug issues.
+ Cloudflare Containers event information that enriches your logs for identifying
+ and debugging issues.
"""
workers: Optional[InvocationWorkers] = FieldInfo(alias="$workers", default=None)
"""
- Cloudflare Workers event information enriches your logs so you can easily
- identify and debug issues.
+ Cloudflare Workers event information that enriches your logs for identifying and
+ debugging issues.
"""
class Trace(BaseModel):
root_span_name: str = FieldInfo(alias="rootSpanName")
+ """Name of the root span that initiated the trace."""
root_transaction_name: str = FieldInfo(alias="rootTransactionName")
+ """Logical transaction name for the root span."""
service: List[str]
+ """List of Worker services involved in the trace."""
spans: float
+ """Total number of spans in the trace."""
trace_duration_ms: float = FieldInfo(alias="traceDurationMs")
+ """Total duration of the trace in milliseconds."""
trace_end_ms: float = FieldInfo(alias="traceEndMs")
+ """Trace end time as a Unix epoch in milliseconds."""
trace_id: str = FieldInfo(alias="traceId")
+ """Unique identifier for the distributed trace."""
trace_start_ms: float = FieldInfo(alias="traceStartMs")
+ """Trace start time as a Unix epoch in milliseconds."""
errors: Optional[List[str]] = None
+ """Error messages encountered during the trace, if any."""
class TelemetryQueryResponse(BaseModel):
+ """Complete results of a query run.
+
+ The populated fields depend on the requested view type (events, calculations, invocations, traces, or agents).
+ """
+
run: Run
- """A Workers Observability Query Object"""
+ """
+ The query run metadata including the query definition, execution status, and
+ timeframe.
+ """
statistics: Statistics
- """
- The statistics object contains information about query performance from the
- database, it does not include any network latency
+ """Query performance statistics from the database.
+
+ Includes execution time, rows scanned, and bytes read. Does not include network
+ latency.
"""
agents: Optional[List[Agent]] = None
+ """Durable Object agent summaries.
+
+ Present when the query view is 'agents'. Each entry represents an agent with its
+ event counts and status.
+ """
calculations: Optional[List[Calculation]] = None
+ """Aggregated calculation results.
+
+ Present when the query view is 'calculations'. Contains computed metrics (count,
+ avg, p99, etc.) with optional group-by breakdowns and time-series data.
+ """
compare: Optional[List[Compare]] = None
+ """Comparison calculation results from the previous time period.
+
+ Present when the compare option is enabled. Same structure as calculations.
+ """
events: Optional[Events] = None
+ """Individual event results.
+
+ Present when the query view is 'events'. Contains the matching log lines and
+ their metadata.
+ """
invocations: Optional[Dict[str, List[Invocation]]] = None
+ """Events grouped by invocation (request ID).
+
+ Present when the query view is 'invocations'. Each key is a request ID mapping
+ to all events from that invocation.
+ """
traces: Optional[List[Trace]] = None
+ """Trace summaries matching the query.
+
+ Present when the query view is 'traces'. Each entry represents a distributed
+ trace with its spans, duration, and services involved.
+ """
diff --git a/src/cloudflare/types/workers/observability/telemetry_values_params.py b/src/cloudflare/types/workers/observability/telemetry_values_params.py
index 9451743e295..a42192593ea 100644
--- a/src/cloudflare/types/workers/observability/telemetry_values_params.py
+++ b/src/cloudflare/types/workers/observability/telemetry_values_params.py
@@ -13,6 +13,9 @@
"Timeframe",
"Filter",
"FilterUnionMember0",
+ "FilterUnionMember0Filter",
+ "FilterUnionMember0FilterUnionMember0",
+ "FilterUnionMember0FilterWorkersObservabilityFilterLeaf",
"FilterWorkersObservabilityFilterLeaf",
"Needle",
]
@@ -39,7 +42,10 @@ class TelemetryValuesParams(TypedDict, total=False):
limit: float
needle: Needle
- """Search for a specific substring in the event."""
+ """
+ Full-text search expression to match events containing the specified text or
+ pattern.
+ """
_TimeframeReservedKeywords = TypedDict(
@@ -55,7 +61,7 @@ class Timeframe(_TimeframeReservedKeywords, total=False):
to: Required[float]
-class FilterUnionMember0(TypedDict, total=False):
+class FilterUnionMember0FilterUnionMember0(TypedDict, total=False):
filter_combination: Required[Annotated[Literal["and", "or", "AND", "OR"], PropertyInfo(alias="filterCombination")]]
filters: Required[Iterable[object]]
@@ -63,17 +69,106 @@ class FilterUnionMember0(TypedDict, total=False):
kind: Required[Literal["group"]]
-class FilterWorkersObservabilityFilterLeaf(TypedDict, total=False):
+class FilterUnionMember0FilterWorkersObservabilityFilterLeaf(TypedDict, total=False):
+ """A filter condition applied to query results.
+
+ Use the keys and values endpoints to discover available fields and their values before constructing filters.
"""
- Filtering best practices: use observability_keys and observability_values to confirm available fields and values. If searching for errors, filter for $metadata.error exists.
+
+ key: Required[str]
+ """Filter field name.
+
+ Use verified keys from previous query results or the keys endpoint. Common keys
+ include $metadata.service, $metadata.origin, $metadata.trigger,
+ $metadata.message, and $metadata.error.
+ """
+
+ operation: Required[
+ Literal[
+ "includes",
+ "not_includes",
+ "starts_with",
+ "regex",
+ "exists",
+ "is_null",
+ "in",
+ "not_in",
+ "eq",
+ "neq",
+ "gt",
+ "gte",
+ "lt",
+ "lte",
+ "=",
+ "!=",
+ ">",
+ ">=",
+ "<",
+ "<=",
+ "INCLUDES",
+ "DOES_NOT_INCLUDE",
+ "MATCH_REGEX",
+ "EXISTS",
+ "DOES_NOT_EXIST",
+ "IN",
+ "NOT_IN",
+ "STARTS_WITH",
+ ]
+ ]
+ """Comparison operator.
+
+ String operators: includes, not_includes, starts_with, regex. Existence: exists,
+ is_null. Set membership: in, not_in (comma-separated values). Numeric: eq, neq,
+ gt, gte, lt, lte.
+ """
+
+ type: Required[Literal["string", "number", "boolean"]]
+ """Data type of the filter field.
+
+ Must match the actual type of the key being filtered.
+ """
+
+ kind: Literal["filter"]
+ """Discriminator for leaf filter nodes.
+
+ Always 'filter' when present; may be omitted.
+ """
+
+ value: Union[str, float, bool]
+ """Comparison value.
+
+ Must match actual values in your data — verify with the values endpoint. Ensure
+ the value type (string/number/boolean) matches the field type. String
+ comparisons are case-sensitive. Regex uses RE2 syntax (no
+ lookaheads/lookbehinds).
+ """
+
+
+FilterUnionMember0Filter: TypeAlias = Union[
+ FilterUnionMember0FilterUnionMember0, FilterUnionMember0FilterWorkersObservabilityFilterLeaf
+]
+
+
+class FilterUnionMember0(TypedDict, total=False):
+ filter_combination: Required[Annotated[Literal["and", "or", "AND", "OR"], PropertyInfo(alias="filterCombination")]]
+
+ filters: Required[Iterable[FilterUnionMember0Filter]]
+
+ kind: Required[Literal["group"]]
+
+
+class FilterWorkersObservabilityFilterLeaf(TypedDict, total=False):
+ """A filter condition applied to query results.
+
+ Use the keys and values endpoints to discover available fields and their values before constructing filters.
"""
key: Required[str]
"""Filter field name.
- IMPORTANT: do not guess keys. Always use verified keys from previous query
- results or the observability_keys response. Preferred keys: $metadata.service,
- $metadata.origin, $metadata.trigger, $metadata.message, $metadata.error.
+ Use verified keys from previous query results or the keys endpoint. Common keys
+ include $metadata.service, $metadata.origin, $metadata.trigger,
+ $metadata.message, and $metadata.error.
"""
operation: Required[
@@ -108,19 +203,32 @@ class FilterWorkersObservabilityFilterLeaf(TypedDict, total=False):
"STARTS_WITH",
]
]
+ """Comparison operator.
+
+ String operators: includes, not_includes, starts_with, regex. Existence: exists,
+ is_null. Set membership: in, not_in (comma-separated values). Numeric: eq, neq,
+ gt, gte, lt, lte.
+ """
type: Required[Literal["string", "number", "boolean"]]
+ """Data type of the filter field.
+
+ Must match the actual type of the key being filtered.
+ """
kind: Literal["filter"]
+ """Discriminator for leaf filter nodes.
+
+ Always 'filter' when present; may be omitted.
+ """
value: Union[str, float, bool]
- """Filter comparison value.
+ """Comparison value.
- IMPORTANT: must match actual values in your logs. Verify using previous query
- results or the /values endpoint. Ensure value type matches the field type.
- String comparisons are case-sensitive unless using specific operations. Regex
- uses ClickHouse RE2 syntax (no lookaheads/lookbehinds); examples: ^5\\dd{2}$ for
- HTTP 5xx, \bERROR\b for word boundary.
+ Must match actual values in your data — verify with the values endpoint. Ensure
+ the value type (string/number/boolean) matches the field type. String
+ comparisons are case-sensitive. Regex uses RE2 syntax (no
+ lookaheads/lookbehinds).
"""
@@ -128,10 +236,15 @@ class FilterWorkersObservabilityFilterLeaf(TypedDict, total=False):
class Needle(TypedDict, total=False):
- """Search for a specific substring in the event."""
+ """
+ Full-text search expression to match events containing the specified text or pattern.
+ """
value: Required[Union[str, float, bool]]
+ """The text or pattern to search for."""
is_regex: Annotated[bool, PropertyInfo(alias="isRegex")]
+ """When true, treats the value as a regular expression (RE2 syntax)."""
match_case: Annotated[bool, PropertyInfo(alias="matchCase")]
+ """When true, performs a case-sensitive search. Defaults to case-insensitive."""
diff --git a/src/cloudflare/types/workers/script_update_params.py b/src/cloudflare/types/workers/script_update_params.py
index fab83dc8675..87d31dee903 100644
--- a/src/cloudflare/types/workers/script_update_params.py
+++ b/src/cloudflare/types/workers/script_update_params.py
@@ -462,6 +462,13 @@ class MetadataBindingWorkersBindingKindRatelimitSimple(TypedDict, total=False):
period: Required[int]
"""The period in seconds."""
+ mitigation_timeout: int
+ """
+ Duration in seconds to apply the mitigation action after the rate limit is
+ exceeded. Valid values are 0 (disabled), 10, or multiples of 60 up to 86400.
+ Must be greater than or equal to the period when non-zero.
+ """
+
class MetadataBindingWorkersBindingKindRatelimit(TypedDict, total=False):
name: Required[str]
diff --git a/src/cloudflare/types/workers/scripts/script_and_version_setting_edit_params.py b/src/cloudflare/types/workers/scripts/script_and_version_setting_edit_params.py
index 4307e6a11f3..6429f45ae6e 100644
--- a/src/cloudflare/types/workers/scripts/script_and_version_setting_edit_params.py
+++ b/src/cloudflare/types/workers/scripts/script_and_version_setting_edit_params.py
@@ -394,6 +394,13 @@ class SettingsBindingWorkersBindingKindRatelimitSimple(TypedDict, total=False):
period: Required[int]
"""The period in seconds."""
+ mitigation_timeout: int
+ """
+ Duration in seconds to apply the mitigation action after the rate limit is
+ exceeded. Valid values are 0 (disabled), 10, or multiples of 60 up to 86400.
+ Must be greater than or equal to the period when non-zero.
+ """
+
class SettingsBindingWorkersBindingKindRatelimit(TypedDict, total=False):
name: Required[str]
diff --git a/src/cloudflare/types/workers/scripts/script_and_version_setting_edit_response.py b/src/cloudflare/types/workers/scripts/script_and_version_setting_edit_response.py
index 0e750e5f8d3..067b2732892 100644
--- a/src/cloudflare/types/workers/scripts/script_and_version_setting_edit_response.py
+++ b/src/cloudflare/types/workers/scripts/script_and_version_setting_edit_response.py
@@ -391,6 +391,13 @@ class BindingWorkersBindingKindRatelimitSimple(BaseModel):
period: int
"""The period in seconds."""
+ mitigation_timeout: Optional[int] = None
+ """
+ Duration in seconds to apply the mitigation action after the rate limit is
+ exceeded. Valid values are 0 (disabled), 10, or multiples of 60 up to 86400.
+ Must be greater than or equal to the period when non-zero.
+ """
+
class BindingWorkersBindingKindRatelimit(BaseModel):
name: str
diff --git a/src/cloudflare/types/workers/scripts/script_and_version_setting_get_response.py b/src/cloudflare/types/workers/scripts/script_and_version_setting_get_response.py
index 5349c407900..0ef9c3aa1d2 100644
--- a/src/cloudflare/types/workers/scripts/script_and_version_setting_get_response.py
+++ b/src/cloudflare/types/workers/scripts/script_and_version_setting_get_response.py
@@ -391,6 +391,13 @@ class BindingWorkersBindingKindRatelimitSimple(BaseModel):
period: int
"""The period in seconds."""
+ mitigation_timeout: Optional[int] = None
+ """
+ Duration in seconds to apply the mitigation action after the rate limit is
+ exceeded. Valid values are 0 (disabled), 10, or multiples of 60 up to 86400.
+ Must be greater than or equal to the period when non-zero.
+ """
+
class BindingWorkersBindingKindRatelimit(BaseModel):
name: str
diff --git a/src/cloudflare/types/workers/scripts/version_create_params.py b/src/cloudflare/types/workers/scripts/version_create_params.py
index 1d985b2f937..0e8a9292025 100644
--- a/src/cloudflare/types/workers/scripts/version_create_params.py
+++ b/src/cloudflare/types/workers/scripts/version_create_params.py
@@ -389,6 +389,13 @@ class MetadataBindingWorkersBindingKindRatelimitSimple(TypedDict, total=False):
period: Required[int]
"""The period in seconds."""
+ mitigation_timeout: int
+ """
+ Duration in seconds to apply the mitigation action after the rate limit is
+ exceeded. Valid values are 0 (disabled), 10, or multiples of 60 up to 86400.
+ Must be greater than or equal to the period when non-zero.
+ """
+
class MetadataBindingWorkersBindingKindRatelimit(TypedDict, total=False):
name: Required[str]
diff --git a/src/cloudflare/types/workers/scripts/version_create_response.py b/src/cloudflare/types/workers/scripts/version_create_response.py
index 005dc5468ea..19a0770d43f 100644
--- a/src/cloudflare/types/workers/scripts/version_create_response.py
+++ b/src/cloudflare/types/workers/scripts/version_create_response.py
@@ -356,6 +356,13 @@ class ResourcesBindingWorkersBindingKindRatelimitSimple(BaseModel):
period: int
"""The period in seconds."""
+ mitigation_timeout: Optional[int] = None
+ """
+ Duration in seconds to apply the mitigation action after the rate limit is
+ exceeded. Valid values are 0 (disabled), 10, or multiples of 60 up to 86400.
+ Must be greater than or equal to the period when non-zero.
+ """
+
class ResourcesBindingWorkersBindingKindRatelimit(BaseModel):
name: str
diff --git a/src/cloudflare/types/workers/scripts/version_get_response.py b/src/cloudflare/types/workers/scripts/version_get_response.py
index 3174e861c13..6dd42eceb0d 100644
--- a/src/cloudflare/types/workers/scripts/version_get_response.py
+++ b/src/cloudflare/types/workers/scripts/version_get_response.py
@@ -356,6 +356,13 @@ class ResourcesBindingWorkersBindingKindRatelimitSimple(BaseModel):
period: int
"""The period in seconds."""
+ mitigation_timeout: Optional[int] = None
+ """
+ Duration in seconds to apply the mitigation action after the rate limit is
+ exceeded. Valid values are 0 (disabled), 10, or multiples of 60 up to 86400.
+ Must be greater than or equal to the period when non-zero.
+ """
+
class ResourcesBindingWorkersBindingKindRatelimit(BaseModel):
name: str
diff --git a/src/cloudflare/types/zero_trust/access/applications/policy_test_create_params.py b/src/cloudflare/types/zero_trust/access/applications/policy_test_create_params.py
old mode 100755
new mode 100644
diff --git a/src/cloudflare/types/zero_trust/access/applications/policy_test_create_response.py b/src/cloudflare/types/zero_trust/access/applications/policy_test_create_response.py
old mode 100755
new mode 100644
diff --git a/src/cloudflare/types/zero_trust/access/applications/policy_test_get_response.py b/src/cloudflare/types/zero_trust/access/applications/policy_test_get_response.py
old mode 100755
new mode 100644
diff --git a/src/cloudflare/types/zero_trust/access/applications/policy_tests/user_list_response.py b/src/cloudflare/types/zero_trust/access/applications/policy_tests/user_list_response.py
old mode 100755
new mode 100644
diff --git a/src/cloudflare/types/zero_trust/devices/kolide_input.py b/src/cloudflare/types/zero_trust/devices/kolide_input.py
index a18da6e1fcc..34f8b1534a0 100644
--- a/src/cloudflare/types/zero_trust/devices/kolide_input.py
+++ b/src/cloudflare/types/zero_trust/devices/kolide_input.py
@@ -1,6 +1,6 @@
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
-from typing import List, Optional
+from typing import Optional
from typing_extensions import Literal
from pydantic import Field as FieldInfo
@@ -14,12 +14,6 @@ class KolideInput(BaseModel):
connection_id: str
"""Posture Integration ID."""
- auth_state: Optional[List[Literal["Good", "Notified", "Will Block", "Blocked"]]] = None
- """The set of Kolide device authentication states that pass the posture check.
-
- Device must match one of the specified states.
- """
-
count_operator: Optional[Literal["<", "<=", ">", ">=", "=="]] = FieldInfo(alias="countOperator", default=None)
"""Count Operator."""
diff --git a/src/cloudflare/types/zero_trust/devices/kolide_input_param.py b/src/cloudflare/types/zero_trust/devices/kolide_input_param.py
index 85990a105bb..2876e3bc9b6 100644
--- a/src/cloudflare/types/zero_trust/devices/kolide_input_param.py
+++ b/src/cloudflare/types/zero_trust/devices/kolide_input_param.py
@@ -2,7 +2,6 @@
from __future__ import annotations
-from typing import List
from typing_extensions import Literal, Required, Annotated, TypedDict
from ...._utils import PropertyInfo
@@ -14,12 +13,6 @@ class KolideInputParam(TypedDict, total=False):
connection_id: Required[str]
"""Posture Integration ID."""
- auth_state: List[Literal["Good", "Notified", "Will Block", "Blocked"]]
- """The set of Kolide device authentication states that pass the posture check.
-
- Device must match one of the specified states.
- """
-
count_operator: Annotated[Literal["<", "<=", ">", ">=", "=="], PropertyInfo(alias="countOperator")]
"""Count Operator."""
diff --git a/src/cloudflare/types/zero_trust/devices/policies/custom_create_params.py b/src/cloudflare/types/zero_trust/devices/policies/custom_create_params.py
index d2302201175..2712f2391aa 100644
--- a/src/cloudflare/types/zero_trust/devices/policies/custom_create_params.py
+++ b/src/cloudflare/types/zero_trust/devices/policies/custom_create_params.py
@@ -2,13 +2,14 @@
from __future__ import annotations
-from typing import Iterable
+from typing import Iterable, Optional
from typing_extensions import Required, TypedDict
+from ....._types import SequenceNotStr
from ..split_tunnel_exclude_param import SplitTunnelExcludeParam
from ..split_tunnel_include_param import SplitTunnelIncludeParam
-__all__ = ["CustomCreateParams", "ServiceModeV2"]
+__all__ = ["CustomCreateParams", "ServiceModeV2", "VirtualNetworks"]
class CustomCreateParams(TypedDict, total=False):
@@ -117,6 +118,9 @@ class CustomCreateParams(TypedDict, total=False):
tunnel_protocol: str
"""Determines which tunnel protocol to use."""
+ virtual_networks: Optional[VirtualNetworks]
+ """Virtual network access settings for the device."""
+
class ServiceModeV2(TypedDict, total=False):
mode: str
@@ -124,3 +128,16 @@ class ServiceModeV2(TypedDict, total=False):
port: float
"""The port number when used with proxy mode."""
+
+
+class VirtualNetworks(TypedDict, total=False):
+ """Virtual network access settings for the device."""
+
+ allowed: Required[SequenceNotStr[str]]
+ """List of virtual network IDs the device is allowed to access.
+
+ When virtual_networks is set, at least one entry is required.
+ """
+
+ default: Required[str]
+ """The default virtual network ID. Must be included in the `allowed` list."""
diff --git a/src/cloudflare/types/zero_trust/devices/policies/custom_edit_params.py b/src/cloudflare/types/zero_trust/devices/policies/custom_edit_params.py
index 85e7e19bd3c..004fb5454bd 100644
--- a/src/cloudflare/types/zero_trust/devices/policies/custom_edit_params.py
+++ b/src/cloudflare/types/zero_trust/devices/policies/custom_edit_params.py
@@ -2,13 +2,14 @@
from __future__ import annotations
-from typing import Iterable
+from typing import Iterable, Optional
from typing_extensions import Required, TypedDict
+from ....._types import SequenceNotStr
from ..split_tunnel_exclude_param import SplitTunnelExcludeParam
from ..split_tunnel_include_param import SplitTunnelIncludeParam
-__all__ = ["CustomEditParams", "ServiceModeV2"]
+__all__ = ["CustomEditParams", "ServiceModeV2", "VirtualNetworks"]
class CustomEditParams(TypedDict, total=False):
@@ -117,6 +118,9 @@ class CustomEditParams(TypedDict, total=False):
tunnel_protocol: str
"""Determines which tunnel protocol to use."""
+ virtual_networks: Optional[VirtualNetworks]
+ """Virtual network access settings for the device."""
+
class ServiceModeV2(TypedDict, total=False):
mode: str
@@ -124,3 +128,16 @@ class ServiceModeV2(TypedDict, total=False):
port: float
"""The port number when used with proxy mode."""
+
+
+class VirtualNetworks(TypedDict, total=False):
+ """Virtual network access settings for the device."""
+
+ allowed: Required[SequenceNotStr[str]]
+ """List of virtual network IDs the device is allowed to access.
+
+ When virtual_networks is set, at least one entry is required.
+ """
+
+ default: Required[str]
+ """The default virtual network ID. Must be included in the `allowed` list."""
diff --git a/src/cloudflare/types/zero_trust/devices/policies/default_edit_params.py b/src/cloudflare/types/zero_trust/devices/policies/default_edit_params.py
index 9a6b533464c..74eb2e3ce42 100644
--- a/src/cloudflare/types/zero_trust/devices/policies/default_edit_params.py
+++ b/src/cloudflare/types/zero_trust/devices/policies/default_edit_params.py
@@ -2,13 +2,14 @@
from __future__ import annotations
-from typing import Iterable
+from typing import Iterable, Optional
from typing_extensions import Required, TypedDict
+from ....._types import SequenceNotStr
from ..split_tunnel_exclude_param import SplitTunnelExcludeParam
from ..split_tunnel_include_param import SplitTunnelIncludeParam
-__all__ = ["DefaultEditParams", "ServiceModeV2"]
+__all__ = ["DefaultEditParams", "ServiceModeV2", "VirtualNetworks"]
class DefaultEditParams(TypedDict, total=False):
@@ -93,6 +94,9 @@ class DefaultEditParams(TypedDict, total=False):
tunnel_protocol: str
"""Determines which tunnel protocol to use."""
+ virtual_networks: Optional[VirtualNetworks]
+ """Virtual network access settings for the device."""
+
class ServiceModeV2(TypedDict, total=False):
mode: str
@@ -100,3 +104,16 @@ class ServiceModeV2(TypedDict, total=False):
port: float
"""The port number when used with proxy mode."""
+
+
+class VirtualNetworks(TypedDict, total=False):
+ """Virtual network access settings for the device."""
+
+ allowed: Required[SequenceNotStr[str]]
+ """List of virtual network IDs the device is allowed to access.
+
+ When virtual_networks is set, at least one entry is required.
+ """
+
+ default: Required[str]
+ """The default virtual network ID. Must be included in the `allowed` list."""
diff --git a/src/cloudflare/types/zero_trust/devices/policies/default_edit_response.py b/src/cloudflare/types/zero_trust/devices/policies/default_edit_response.py
index 4e512a63abc..d1eb4dca9d1 100644
--- a/src/cloudflare/types/zero_trust/devices/policies/default_edit_response.py
+++ b/src/cloudflare/types/zero_trust/devices/policies/default_edit_response.py
@@ -7,7 +7,7 @@
from ..split_tunnel_exclude import SplitTunnelExclude
from ..split_tunnel_include import SplitTunnelInclude
-__all__ = ["DefaultEditResponse", "ServiceModeV2"]
+__all__ = ["DefaultEditResponse", "ServiceModeV2", "VirtualNetworks"]
class ServiceModeV2(BaseModel):
@@ -18,6 +18,19 @@ class ServiceModeV2(BaseModel):
"""The port number when used with proxy mode."""
+class VirtualNetworks(BaseModel):
+ """Virtual network access settings for the device."""
+
+ allowed: List[str]
+ """List of virtual network IDs the device is allowed to access.
+
+ When virtual_networks is set, at least one entry is required.
+ """
+
+ default: str
+ """The default virtual network ID. Must be included in the `allowed` list."""
+
+
class DefaultEditResponse(BaseModel):
allow_mode_switch: Optional[bool] = None
"""Whether to allow the user to switch WARP between modes."""
@@ -89,3 +102,6 @@ class DefaultEditResponse(BaseModel):
tunnel_protocol: Optional[str] = None
"""Determines which tunnel protocol to use."""
+
+ virtual_networks: Optional[VirtualNetworks] = None
+ """Virtual network access settings for the device."""
diff --git a/src/cloudflare/types/zero_trust/devices/policies/default_get_response.py b/src/cloudflare/types/zero_trust/devices/policies/default_get_response.py
index acdfa643df3..4fe0811461d 100644
--- a/src/cloudflare/types/zero_trust/devices/policies/default_get_response.py
+++ b/src/cloudflare/types/zero_trust/devices/policies/default_get_response.py
@@ -7,7 +7,7 @@
from ..split_tunnel_exclude import SplitTunnelExclude
from ..split_tunnel_include import SplitTunnelInclude
-__all__ = ["DefaultGetResponse", "ServiceModeV2"]
+__all__ = ["DefaultGetResponse", "ServiceModeV2", "VirtualNetworks"]
class ServiceModeV2(BaseModel):
@@ -18,6 +18,19 @@ class ServiceModeV2(BaseModel):
"""The port number when used with proxy mode."""
+class VirtualNetworks(BaseModel):
+ """Virtual network access settings for the device."""
+
+ allowed: List[str]
+ """List of virtual network IDs the device is allowed to access.
+
+ When virtual_networks is set, at least one entry is required.
+ """
+
+ default: str
+ """The default virtual network ID. Must be included in the `allowed` list."""
+
+
class DefaultGetResponse(BaseModel):
allow_mode_switch: Optional[bool] = None
"""Whether to allow the user to switch WARP between modes."""
@@ -89,3 +102,6 @@ class DefaultGetResponse(BaseModel):
tunnel_protocol: Optional[str] = None
"""Determines which tunnel protocol to use."""
+
+ virtual_networks: Optional[VirtualNetworks] = None
+ """Virtual network access settings for the device."""
diff --git a/src/cloudflare/types/zero_trust/devices/setting_edit_params.py b/src/cloudflare/types/zero_trust/devices/setting_edit_params.py
old mode 100755
new mode 100644
diff --git a/src/cloudflare/types/zero_trust/devices/settings_policy.py b/src/cloudflare/types/zero_trust/devices/settings_policy.py
index dfc7f7ae559..0dbbe0ea2e2 100644
--- a/src/cloudflare/types/zero_trust/devices/settings_policy.py
+++ b/src/cloudflare/types/zero_trust/devices/settings_policy.py
@@ -7,7 +7,7 @@
from .split_tunnel_exclude import SplitTunnelExclude
from .split_tunnel_include import SplitTunnelInclude
-__all__ = ["SettingsPolicy", "ServiceModeV2", "TargetTest"]
+__all__ = ["SettingsPolicy", "ServiceModeV2", "TargetTest", "VirtualNetworks"]
class ServiceModeV2(BaseModel):
@@ -26,6 +26,19 @@ class TargetTest(BaseModel):
"""The name of the DEX test targeting this policy."""
+class VirtualNetworks(BaseModel):
+ """Virtual network access settings for the device."""
+
+ allowed: List[str]
+ """List of virtual network IDs the device is allowed to access.
+
+ When virtual_networks is set, at least one entry is required.
+ """
+
+ default: str
+ """The default virtual network ID. Must be included in the `allowed` list."""
+
+
class SettingsPolicy(BaseModel):
allow_mode_switch: Optional[bool] = None
"""Whether to allow the user to switch WARP between modes."""
@@ -134,3 +147,6 @@ class SettingsPolicy(BaseModel):
tunnel_protocol: Optional[str] = None
"""Determines which tunnel protocol to use."""
+
+ virtual_networks: Optional[VirtualNetworks] = None
+ """Virtual network access settings for the device."""
diff --git a/src/cloudflare/types/zero_trust/dlp/datasets/version_create_params.py b/src/cloudflare/types/zero_trust/dlp/datasets/version_create_params.py
old mode 100755
new mode 100644
diff --git a/src/cloudflare/types/zero_trust/dlp/datasets/version_create_response.py b/src/cloudflare/types/zero_trust/dlp/datasets/version_create_response.py
old mode 100755
new mode 100644
diff --git a/src/cloudflare/types/zero_trust/dlp/datasets/versions/entry_create_params.py b/src/cloudflare/types/zero_trust/dlp/datasets/versions/entry_create_params.py
old mode 100755
new mode 100644
diff --git a/src/cloudflare/types/zero_trust/dlp/datasets/versions/entry_create_response.py b/src/cloudflare/types/zero_trust/dlp/datasets/versions/entry_create_response.py
old mode 100755
new mode 100644
diff --git a/src/cloudflare/types/zero_trust/dlp/entries/custom_get_response.py b/src/cloudflare/types/zero_trust/dlp/entries/custom_get_response.py
index 0643a73c554..d0af2de6213 100644
--- a/src/cloudflare/types/zero_trust/dlp/entries/custom_get_response.py
+++ b/src/cloudflare/types/zero_trust/dlp/entries/custom_get_response.py
@@ -15,6 +15,8 @@
"UnionMember1Confidence",
"UnionMember1Profile",
"UnionMember1Variant",
+ "UnionMember1VariantUnionMember0",
+ "UnionMember1VariantUnionMember1",
"UnionMember2",
"UnionMember2Profile",
"UnionMember3",
@@ -77,12 +79,30 @@ class UnionMember1Profile(BaseModel):
name: str
-class UnionMember1Variant(BaseModel):
+class UnionMember1VariantUnionMember0(BaseModel):
+ """A Predefined AI prompt classification topic entry."""
+
topic_type: Literal["Intent", "Content"]
type: Literal["PromptTopic"]
description: Optional[str] = None
+ """
+ A customer-facing explanation of what this predefined AI prompt topic
+ represents.
+ """
+
+
+class UnionMember1VariantUnionMember1(BaseModel):
+ """A general predefined entry."""
+
+ type: Literal["General"]
+
+ description: Optional[str] = None
+ """A customer-facing explanation of what this predefined entry represents."""
+
+
+UnionMember1Variant: TypeAlias = Union[UnionMember1VariantUnionMember0, UnionMember1VariantUnionMember1]
class UnionMember1(BaseModel):
@@ -103,6 +123,7 @@ class UnionMember1(BaseModel):
upload_status: Optional[Literal["empty", "uploading", "pending", "processing", "failed", "complete"]] = None
variant: Optional[UnionMember1Variant] = None
+ """A Predefined AI prompt classification topic entry."""
class UnionMember2Profile(BaseModel):
diff --git a/src/cloudflare/types/zero_trust/dlp/entries/custom_list_response.py b/src/cloudflare/types/zero_trust/dlp/entries/custom_list_response.py
index af4e3334fbc..c8c47ce738d 100644
--- a/src/cloudflare/types/zero_trust/dlp/entries/custom_list_response.py
+++ b/src/cloudflare/types/zero_trust/dlp/entries/custom_list_response.py
@@ -13,6 +13,8 @@
"UnionMember1",
"UnionMember1Confidence",
"UnionMember1Variant",
+ "UnionMember1VariantUnionMember0",
+ "UnionMember1VariantUnionMember1",
"UnionMember2",
"UnionMember3",
"UnionMember4",
@@ -53,12 +55,30 @@ class UnionMember1Confidence(BaseModel):
"""
-class UnionMember1Variant(BaseModel):
+class UnionMember1VariantUnionMember0(BaseModel):
+ """A Predefined AI prompt classification topic entry."""
+
topic_type: Literal["Intent", "Content"]
type: Literal["PromptTopic"]
description: Optional[str] = None
+ """
+ A customer-facing explanation of what this predefined AI prompt topic
+ represents.
+ """
+
+
+class UnionMember1VariantUnionMember1(BaseModel):
+ """A general predefined entry."""
+
+ type: Literal["General"]
+
+ description: Optional[str] = None
+ """A customer-facing explanation of what this predefined entry represents."""
+
+
+UnionMember1Variant: TypeAlias = Union[UnionMember1VariantUnionMember0, UnionMember1VariantUnionMember1]
class UnionMember1(BaseModel):
@@ -77,6 +97,7 @@ class UnionMember1(BaseModel):
upload_status: Optional[Literal["empty", "uploading", "pending", "processing", "failed", "complete"]] = None
variant: Optional[UnionMember1Variant] = None
+ """A Predefined AI prompt classification topic entry."""
class UnionMember2(BaseModel):
diff --git a/src/cloudflare/types/zero_trust/dlp/entries/integration_get_response.py b/src/cloudflare/types/zero_trust/dlp/entries/integration_get_response.py
index da9028d38d6..28c992d2143 100644
--- a/src/cloudflare/types/zero_trust/dlp/entries/integration_get_response.py
+++ b/src/cloudflare/types/zero_trust/dlp/entries/integration_get_response.py
@@ -15,6 +15,8 @@
"UnionMember1Confidence",
"UnionMember1Profile",
"UnionMember1Variant",
+ "UnionMember1VariantUnionMember0",
+ "UnionMember1VariantUnionMember1",
"UnionMember2",
"UnionMember2Profile",
"UnionMember3",
@@ -77,12 +79,30 @@ class UnionMember1Profile(BaseModel):
name: str
-class UnionMember1Variant(BaseModel):
+class UnionMember1VariantUnionMember0(BaseModel):
+ """A Predefined AI prompt classification topic entry."""
+
topic_type: Literal["Intent", "Content"]
type: Literal["PromptTopic"]
description: Optional[str] = None
+ """
+ A customer-facing explanation of what this predefined AI prompt topic
+ represents.
+ """
+
+
+class UnionMember1VariantUnionMember1(BaseModel):
+ """A general predefined entry."""
+
+ type: Literal["General"]
+
+ description: Optional[str] = None
+ """A customer-facing explanation of what this predefined entry represents."""
+
+
+UnionMember1Variant: TypeAlias = Union[UnionMember1VariantUnionMember0, UnionMember1VariantUnionMember1]
class UnionMember1(BaseModel):
@@ -103,6 +123,7 @@ class UnionMember1(BaseModel):
upload_status: Optional[Literal["empty", "uploading", "pending", "processing", "failed", "complete"]] = None
variant: Optional[UnionMember1Variant] = None
+ """A Predefined AI prompt classification topic entry."""
class UnionMember2Profile(BaseModel):
diff --git a/src/cloudflare/types/zero_trust/dlp/entries/integration_list_response.py b/src/cloudflare/types/zero_trust/dlp/entries/integration_list_response.py
index ea7214a2153..f757267e68e 100644
--- a/src/cloudflare/types/zero_trust/dlp/entries/integration_list_response.py
+++ b/src/cloudflare/types/zero_trust/dlp/entries/integration_list_response.py
@@ -13,6 +13,8 @@
"UnionMember1",
"UnionMember1Confidence",
"UnionMember1Variant",
+ "UnionMember1VariantUnionMember0",
+ "UnionMember1VariantUnionMember1",
"UnionMember2",
"UnionMember3",
"UnionMember4",
@@ -53,12 +55,30 @@ class UnionMember1Confidence(BaseModel):
"""
-class UnionMember1Variant(BaseModel):
+class UnionMember1VariantUnionMember0(BaseModel):
+ """A Predefined AI prompt classification topic entry."""
+
topic_type: Literal["Intent", "Content"]
type: Literal["PromptTopic"]
description: Optional[str] = None
+ """
+ A customer-facing explanation of what this predefined AI prompt topic
+ represents.
+ """
+
+
+class UnionMember1VariantUnionMember1(BaseModel):
+ """A general predefined entry."""
+
+ type: Literal["General"]
+
+ description: Optional[str] = None
+ """A customer-facing explanation of what this predefined entry represents."""
+
+
+UnionMember1Variant: TypeAlias = Union[UnionMember1VariantUnionMember0, UnionMember1VariantUnionMember1]
class UnionMember1(BaseModel):
@@ -77,6 +97,7 @@ class UnionMember1(BaseModel):
upload_status: Optional[Literal["empty", "uploading", "pending", "processing", "failed", "complete"]] = None
variant: Optional[UnionMember1Variant] = None
+ """A Predefined AI prompt classification topic entry."""
class UnionMember2(BaseModel):
diff --git a/src/cloudflare/types/zero_trust/dlp/entries/predefined_create_response.py b/src/cloudflare/types/zero_trust/dlp/entries/predefined_create_response.py
index 60864076dca..21f28b21f3f 100644
--- a/src/cloudflare/types/zero_trust/dlp/entries/predefined_create_response.py
+++ b/src/cloudflare/types/zero_trust/dlp/entries/predefined_create_response.py
@@ -1,11 +1,11 @@
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
-from typing import Optional
-from typing_extensions import Literal
+from typing import Union, Optional
+from typing_extensions import Literal, TypeAlias
from ....._models import BaseModel
-__all__ = ["PredefinedCreateResponse", "Confidence", "Variant"]
+__all__ = ["PredefinedCreateResponse", "Confidence", "Variant", "VariantUnionMember0", "VariantUnionMember1"]
class Confidence(BaseModel):
@@ -19,12 +19,30 @@ class Confidence(BaseModel):
"""
-class Variant(BaseModel):
+class VariantUnionMember0(BaseModel):
+ """A Predefined AI prompt classification topic entry."""
+
topic_type: Literal["Intent", "Content"]
type: Literal["PromptTopic"]
description: Optional[str] = None
+ """
+ A customer-facing explanation of what this predefined AI prompt topic
+ represents.
+ """
+
+
+class VariantUnionMember1(BaseModel):
+ """A general predefined entry."""
+
+ type: Literal["General"]
+
+ description: Optional[str] = None
+ """A customer-facing explanation of what this predefined entry represents."""
+
+
+Variant: TypeAlias = Union[VariantUnionMember0, VariantUnionMember1]
class PredefinedCreateResponse(BaseModel):
@@ -39,3 +57,4 @@ class PredefinedCreateResponse(BaseModel):
profile_id: Optional[str] = None
variant: Optional[Variant] = None
+ """A Predefined AI prompt classification topic entry."""
diff --git a/src/cloudflare/types/zero_trust/dlp/entries/predefined_get_response.py b/src/cloudflare/types/zero_trust/dlp/entries/predefined_get_response.py
index 975c433ccf9..8d7479e52b7 100644
--- a/src/cloudflare/types/zero_trust/dlp/entries/predefined_get_response.py
+++ b/src/cloudflare/types/zero_trust/dlp/entries/predefined_get_response.py
@@ -15,6 +15,8 @@
"UnionMember1Confidence",
"UnionMember1Profile",
"UnionMember1Variant",
+ "UnionMember1VariantUnionMember0",
+ "UnionMember1VariantUnionMember1",
"UnionMember2",
"UnionMember2Profile",
"UnionMember3",
@@ -77,12 +79,30 @@ class UnionMember1Profile(BaseModel):
name: str
-class UnionMember1Variant(BaseModel):
+class UnionMember1VariantUnionMember0(BaseModel):
+ """A Predefined AI prompt classification topic entry."""
+
topic_type: Literal["Intent", "Content"]
type: Literal["PromptTopic"]
description: Optional[str] = None
+ """
+ A customer-facing explanation of what this predefined AI prompt topic
+ represents.
+ """
+
+
+class UnionMember1VariantUnionMember1(BaseModel):
+ """A general predefined entry."""
+
+ type: Literal["General"]
+
+ description: Optional[str] = None
+ """A customer-facing explanation of what this predefined entry represents."""
+
+
+UnionMember1Variant: TypeAlias = Union[UnionMember1VariantUnionMember0, UnionMember1VariantUnionMember1]
class UnionMember1(BaseModel):
@@ -103,6 +123,7 @@ class UnionMember1(BaseModel):
upload_status: Optional[Literal["empty", "uploading", "pending", "processing", "failed", "complete"]] = None
variant: Optional[UnionMember1Variant] = None
+ """A Predefined AI prompt classification topic entry."""
class UnionMember2Profile(BaseModel):
diff --git a/src/cloudflare/types/zero_trust/dlp/entries/predefined_list_response.py b/src/cloudflare/types/zero_trust/dlp/entries/predefined_list_response.py
index 2dcfabd8dc1..177f70b1745 100644
--- a/src/cloudflare/types/zero_trust/dlp/entries/predefined_list_response.py
+++ b/src/cloudflare/types/zero_trust/dlp/entries/predefined_list_response.py
@@ -13,6 +13,8 @@
"UnionMember1",
"UnionMember1Confidence",
"UnionMember1Variant",
+ "UnionMember1VariantUnionMember0",
+ "UnionMember1VariantUnionMember1",
"UnionMember2",
"UnionMember3",
"UnionMember4",
@@ -53,12 +55,30 @@ class UnionMember1Confidence(BaseModel):
"""
-class UnionMember1Variant(BaseModel):
+class UnionMember1VariantUnionMember0(BaseModel):
+ """A Predefined AI prompt classification topic entry."""
+
topic_type: Literal["Intent", "Content"]
type: Literal["PromptTopic"]
description: Optional[str] = None
+ """
+ A customer-facing explanation of what this predefined AI prompt topic
+ represents.
+ """
+
+
+class UnionMember1VariantUnionMember1(BaseModel):
+ """A general predefined entry."""
+
+ type: Literal["General"]
+
+ description: Optional[str] = None
+ """A customer-facing explanation of what this predefined entry represents."""
+
+
+UnionMember1Variant: TypeAlias = Union[UnionMember1VariantUnionMember0, UnionMember1VariantUnionMember1]
class UnionMember1(BaseModel):
@@ -77,6 +97,7 @@ class UnionMember1(BaseModel):
upload_status: Optional[Literal["empty", "uploading", "pending", "processing", "failed", "complete"]] = None
variant: Optional[UnionMember1Variant] = None
+ """A Predefined AI prompt classification topic entry."""
class UnionMember2(BaseModel):
diff --git a/src/cloudflare/types/zero_trust/dlp/entries/predefined_update_response.py b/src/cloudflare/types/zero_trust/dlp/entries/predefined_update_response.py
index 178470ad0a2..f72509d654d 100644
--- a/src/cloudflare/types/zero_trust/dlp/entries/predefined_update_response.py
+++ b/src/cloudflare/types/zero_trust/dlp/entries/predefined_update_response.py
@@ -1,11 +1,11 @@
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
-from typing import Optional
-from typing_extensions import Literal
+from typing import Union, Optional
+from typing_extensions import Literal, TypeAlias
from ....._models import BaseModel
-__all__ = ["PredefinedUpdateResponse", "Confidence", "Variant"]
+__all__ = ["PredefinedUpdateResponse", "Confidence", "Variant", "VariantUnionMember0", "VariantUnionMember1"]
class Confidence(BaseModel):
@@ -19,12 +19,30 @@ class Confidence(BaseModel):
"""
-class Variant(BaseModel):
+class VariantUnionMember0(BaseModel):
+ """A Predefined AI prompt classification topic entry."""
+
topic_type: Literal["Intent", "Content"]
type: Literal["PromptTopic"]
description: Optional[str] = None
+ """
+ A customer-facing explanation of what this predefined AI prompt topic
+ represents.
+ """
+
+
+class VariantUnionMember1(BaseModel):
+ """A general predefined entry."""
+
+ type: Literal["General"]
+
+ description: Optional[str] = None
+ """A customer-facing explanation of what this predefined entry represents."""
+
+
+Variant: TypeAlias = Union[VariantUnionMember0, VariantUnionMember1]
class PredefinedUpdateResponse(BaseModel):
@@ -39,3 +57,4 @@ class PredefinedUpdateResponse(BaseModel):
profile_id: Optional[str] = None
variant: Optional[Variant] = None
+ """A Predefined AI prompt classification topic entry."""
diff --git a/src/cloudflare/types/zero_trust/dlp/entry_get_response.py b/src/cloudflare/types/zero_trust/dlp/entry_get_response.py
index b14a69946d9..1ee40f14fd5 100644
--- a/src/cloudflare/types/zero_trust/dlp/entry_get_response.py
+++ b/src/cloudflare/types/zero_trust/dlp/entry_get_response.py
@@ -15,6 +15,8 @@
"UnionMember1Confidence",
"UnionMember1Profile",
"UnionMember1Variant",
+ "UnionMember1VariantUnionMember0",
+ "UnionMember1VariantUnionMember1",
"UnionMember2",
"UnionMember2Profile",
"UnionMember3",
@@ -77,12 +79,30 @@ class UnionMember1Profile(BaseModel):
name: str
-class UnionMember1Variant(BaseModel):
+class UnionMember1VariantUnionMember0(BaseModel):
+ """A Predefined AI prompt classification topic entry."""
+
topic_type: Literal["Intent", "Content"]
type: Literal["PromptTopic"]
description: Optional[str] = None
+ """
+ A customer-facing explanation of what this predefined AI prompt topic
+ represents.
+ """
+
+
+class UnionMember1VariantUnionMember1(BaseModel):
+ """A general predefined entry."""
+
+ type: Literal["General"]
+
+ description: Optional[str] = None
+ """A customer-facing explanation of what this predefined entry represents."""
+
+
+UnionMember1Variant: TypeAlias = Union[UnionMember1VariantUnionMember0, UnionMember1VariantUnionMember1]
class UnionMember1(BaseModel):
@@ -103,6 +123,7 @@ class UnionMember1(BaseModel):
upload_status: Optional[Literal["empty", "uploading", "pending", "processing", "failed", "complete"]] = None
variant: Optional[UnionMember1Variant] = None
+ """A Predefined AI prompt classification topic entry."""
class UnionMember2Profile(BaseModel):
diff --git a/src/cloudflare/types/zero_trust/dlp/entry_list_response.py b/src/cloudflare/types/zero_trust/dlp/entry_list_response.py
index c0e6b250d00..d6661bd90df 100644
--- a/src/cloudflare/types/zero_trust/dlp/entry_list_response.py
+++ b/src/cloudflare/types/zero_trust/dlp/entry_list_response.py
@@ -13,6 +13,8 @@
"UnionMember1",
"UnionMember1Confidence",
"UnionMember1Variant",
+ "UnionMember1VariantUnionMember0",
+ "UnionMember1VariantUnionMember1",
"UnionMember2",
"UnionMember3",
"UnionMember4",
@@ -53,12 +55,30 @@ class UnionMember1Confidence(BaseModel):
"""
-class UnionMember1Variant(BaseModel):
+class UnionMember1VariantUnionMember0(BaseModel):
+ """A Predefined AI prompt classification topic entry."""
+
topic_type: Literal["Intent", "Content"]
type: Literal["PromptTopic"]
description: Optional[str] = None
+ """
+ A customer-facing explanation of what this predefined AI prompt topic
+ represents.
+ """
+
+
+class UnionMember1VariantUnionMember1(BaseModel):
+ """A general predefined entry."""
+
+ type: Literal["General"]
+
+ description: Optional[str] = None
+ """A customer-facing explanation of what this predefined entry represents."""
+
+
+UnionMember1Variant: TypeAlias = Union[UnionMember1VariantUnionMember0, UnionMember1VariantUnionMember1]
class UnionMember1(BaseModel):
@@ -77,6 +97,7 @@ class UnionMember1(BaseModel):
upload_status: Optional[Literal["empty", "uploading", "pending", "processing", "failed", "complete"]] = None
variant: Optional[UnionMember1Variant] = None
+ """A Predefined AI prompt classification topic entry."""
class UnionMember2(BaseModel):
diff --git a/src/cloudflare/types/zero_trust/dlp/entry_update_response.py b/src/cloudflare/types/zero_trust/dlp/entry_update_response.py
index 0e256a22386..3b569087412 100644
--- a/src/cloudflare/types/zero_trust/dlp/entry_update_response.py
+++ b/src/cloudflare/types/zero_trust/dlp/entry_update_response.py
@@ -13,6 +13,8 @@
"PredefinedEntry",
"PredefinedEntryConfidence",
"PredefinedEntryVariant",
+ "PredefinedEntryVariantUnionMember0",
+ "PredefinedEntryVariantUnionMember1",
"IntegrationEntry",
"ExactDataEntry",
"DocumentFingerprintEntry",
@@ -51,12 +53,30 @@ class PredefinedEntryConfidence(BaseModel):
"""
-class PredefinedEntryVariant(BaseModel):
+class PredefinedEntryVariantUnionMember0(BaseModel):
+ """A Predefined AI prompt classification topic entry."""
+
topic_type: Literal["Intent", "Content"]
type: Literal["PromptTopic"]
description: Optional[str] = None
+ """
+ A customer-facing explanation of what this predefined AI prompt topic
+ represents.
+ """
+
+
+class PredefinedEntryVariantUnionMember1(BaseModel):
+ """A general predefined entry."""
+
+ type: Literal["General"]
+
+ description: Optional[str] = None
+ """A customer-facing explanation of what this predefined entry represents."""
+
+
+PredefinedEntryVariant: TypeAlias = Union[PredefinedEntryVariantUnionMember0, PredefinedEntryVariantUnionMember1]
class PredefinedEntry(BaseModel):
@@ -73,6 +93,7 @@ class PredefinedEntry(BaseModel):
profile_id: Optional[str] = None
variant: Optional[PredefinedEntryVariant] = None
+ """A Predefined AI prompt classification topic entry."""
class IntegrationEntry(BaseModel):
diff --git a/src/cloudflare/types/zero_trust/dlp/limit_list_response.py b/src/cloudflare/types/zero_trust/dlp/limit_list_response.py
old mode 100755
new mode 100644
diff --git a/src/cloudflare/types/zero_trust/dlp/profile.py b/src/cloudflare/types/zero_trust/dlp/profile.py
index 96d6a05976b..869b45315df 100644
--- a/src/cloudflare/types/zero_trust/dlp/profile.py
+++ b/src/cloudflare/types/zero_trust/dlp/profile.py
@@ -19,6 +19,8 @@
"CustomProfileEntryPredefinedEntry",
"CustomProfileEntryPredefinedEntryConfidence",
"CustomProfileEntryPredefinedEntryVariant",
+ "CustomProfileEntryPredefinedEntryVariantUnionMember0",
+ "CustomProfileEntryPredefinedEntryVariantUnionMember1",
"CustomProfileEntryIntegrationEntry",
"CustomProfileEntryExactDataEntry",
"CustomProfileEntryDocumentFingerprintEntry",
@@ -29,6 +31,8 @@
"CustomProfileSharedEntryPredefinedEntry",
"CustomProfileSharedEntryPredefinedEntryConfidence",
"CustomProfileSharedEntryPredefinedEntryVariant",
+ "CustomProfileSharedEntryPredefinedEntryVariantUnionMember0",
+ "CustomProfileSharedEntryPredefinedEntryVariantUnionMember1",
"CustomProfileSharedEntryIntegrationEntry",
"CustomProfileSharedEntryExactDataEntry",
"CustomProfileSharedEntryDocumentFingerprintEntry",
@@ -39,6 +43,8 @@
"PredefinedProfileEntryPredefinedEntry",
"PredefinedProfileEntryPredefinedEntryConfidence",
"PredefinedProfileEntryPredefinedEntryVariant",
+ "PredefinedProfileEntryPredefinedEntryVariantUnionMember0",
+ "PredefinedProfileEntryPredefinedEntryVariantUnionMember1",
"PredefinedProfileEntryIntegrationEntry",
"PredefinedProfileEntryExactDataEntry",
"PredefinedProfileEntryDocumentFingerprintEntry",
@@ -49,6 +55,8 @@
"IntegrationProfileEntryPredefinedEntry",
"IntegrationProfileEntryPredefinedEntryConfidence",
"IntegrationProfileEntryPredefinedEntryVariant",
+ "IntegrationProfileEntryPredefinedEntryVariantUnionMember0",
+ "IntegrationProfileEntryPredefinedEntryVariantUnionMember1",
"IntegrationProfileEntryIntegrationEntry",
"IntegrationProfileEntryExactDataEntry",
"IntegrationProfileEntryDocumentFingerprintEntry",
@@ -58,6 +66,8 @@
"IntegrationProfileSharedEntryPredefinedEntry",
"IntegrationProfileSharedEntryPredefinedEntryConfidence",
"IntegrationProfileSharedEntryPredefinedEntryVariant",
+ "IntegrationProfileSharedEntryPredefinedEntryVariantUnionMember0",
+ "IntegrationProfileSharedEntryPredefinedEntryVariantUnionMember1",
"IntegrationProfileSharedEntryIntegrationEntry",
"IntegrationProfileSharedEntryExactDataEntry",
"IntegrationProfileSharedEntryDocumentFingerprintEntry",
@@ -96,12 +106,32 @@ class CustomProfileEntryPredefinedEntryConfidence(BaseModel):
"""
-class CustomProfileEntryPredefinedEntryVariant(BaseModel):
+class CustomProfileEntryPredefinedEntryVariantUnionMember0(BaseModel):
+ """A Predefined AI prompt classification topic entry."""
+
topic_type: Literal["Intent", "Content"]
type: Literal["PromptTopic"]
description: Optional[str] = None
+ """
+ A customer-facing explanation of what this predefined AI prompt topic
+ represents.
+ """
+
+
+class CustomProfileEntryPredefinedEntryVariantUnionMember1(BaseModel):
+ """A general predefined entry."""
+
+ type: Literal["General"]
+
+ description: Optional[str] = None
+ """A customer-facing explanation of what this predefined entry represents."""
+
+
+CustomProfileEntryPredefinedEntryVariant: TypeAlias = Union[
+ CustomProfileEntryPredefinedEntryVariantUnionMember0, CustomProfileEntryPredefinedEntryVariantUnionMember1
+]
class CustomProfileEntryPredefinedEntry(BaseModel):
@@ -118,6 +148,7 @@ class CustomProfileEntryPredefinedEntry(BaseModel):
profile_id: Optional[str] = None
variant: Optional[CustomProfileEntryPredefinedEntryVariant] = None
+ """A Predefined AI prompt classification topic entry."""
class CustomProfileEntryIntegrationEntry(BaseModel):
@@ -241,12 +272,33 @@ class CustomProfileSharedEntryPredefinedEntryConfidence(BaseModel):
"""
-class CustomProfileSharedEntryPredefinedEntryVariant(BaseModel):
+class CustomProfileSharedEntryPredefinedEntryVariantUnionMember0(BaseModel):
+ """A Predefined AI prompt classification topic entry."""
+
topic_type: Literal["Intent", "Content"]
type: Literal["PromptTopic"]
description: Optional[str] = None
+ """
+ A customer-facing explanation of what this predefined AI prompt topic
+ represents.
+ """
+
+
+class CustomProfileSharedEntryPredefinedEntryVariantUnionMember1(BaseModel):
+ """A general predefined entry."""
+
+ type: Literal["General"]
+
+ description: Optional[str] = None
+ """A customer-facing explanation of what this predefined entry represents."""
+
+
+CustomProfileSharedEntryPredefinedEntryVariant: TypeAlias = Union[
+ CustomProfileSharedEntryPredefinedEntryVariantUnionMember0,
+ CustomProfileSharedEntryPredefinedEntryVariantUnionMember1,
+]
class CustomProfileSharedEntryPredefinedEntry(BaseModel):
@@ -263,6 +315,7 @@ class CustomProfileSharedEntryPredefinedEntry(BaseModel):
profile_id: Optional[str] = None
variant: Optional[CustomProfileSharedEntryPredefinedEntryVariant] = None
+ """A Predefined AI prompt classification topic entry."""
class CustomProfileSharedEntryIntegrationEntry(BaseModel):
@@ -423,12 +476,32 @@ class PredefinedProfileEntryPredefinedEntryConfidence(BaseModel):
"""
-class PredefinedProfileEntryPredefinedEntryVariant(BaseModel):
+class PredefinedProfileEntryPredefinedEntryVariantUnionMember0(BaseModel):
+ """A Predefined AI prompt classification topic entry."""
+
topic_type: Literal["Intent", "Content"]
type: Literal["PromptTopic"]
description: Optional[str] = None
+ """
+ A customer-facing explanation of what this predefined AI prompt topic
+ represents.
+ """
+
+
+class PredefinedProfileEntryPredefinedEntryVariantUnionMember1(BaseModel):
+ """A general predefined entry."""
+
+ type: Literal["General"]
+
+ description: Optional[str] = None
+ """A customer-facing explanation of what this predefined entry represents."""
+
+
+PredefinedProfileEntryPredefinedEntryVariant: TypeAlias = Union[
+ PredefinedProfileEntryPredefinedEntryVariantUnionMember0, PredefinedProfileEntryPredefinedEntryVariantUnionMember1
+]
class PredefinedProfileEntryPredefinedEntry(BaseModel):
@@ -445,6 +518,7 @@ class PredefinedProfileEntryPredefinedEntry(BaseModel):
profile_id: Optional[str] = None
variant: Optional[PredefinedProfileEntryPredefinedEntryVariant] = None
+ """A Predefined AI prompt classification topic entry."""
class PredefinedProfileEntryIntegrationEntry(BaseModel):
@@ -587,12 +661,32 @@ class IntegrationProfileEntryPredefinedEntryConfidence(BaseModel):
"""
-class IntegrationProfileEntryPredefinedEntryVariant(BaseModel):
+class IntegrationProfileEntryPredefinedEntryVariantUnionMember0(BaseModel):
+ """A Predefined AI prompt classification topic entry."""
+
topic_type: Literal["Intent", "Content"]
type: Literal["PromptTopic"]
description: Optional[str] = None
+ """
+ A customer-facing explanation of what this predefined AI prompt topic
+ represents.
+ """
+
+
+class IntegrationProfileEntryPredefinedEntryVariantUnionMember1(BaseModel):
+ """A general predefined entry."""
+
+ type: Literal["General"]
+
+ description: Optional[str] = None
+ """A customer-facing explanation of what this predefined entry represents."""
+
+
+IntegrationProfileEntryPredefinedEntryVariant: TypeAlias = Union[
+ IntegrationProfileEntryPredefinedEntryVariantUnionMember0, IntegrationProfileEntryPredefinedEntryVariantUnionMember1
+]
class IntegrationProfileEntryPredefinedEntry(BaseModel):
@@ -609,6 +703,7 @@ class IntegrationProfileEntryPredefinedEntry(BaseModel):
profile_id: Optional[str] = None
variant: Optional[IntegrationProfileEntryPredefinedEntryVariant] = None
+ """A Predefined AI prompt classification topic entry."""
class IntegrationProfileEntryIntegrationEntry(BaseModel):
@@ -722,12 +817,33 @@ class IntegrationProfileSharedEntryPredefinedEntryConfidence(BaseModel):
"""
-class IntegrationProfileSharedEntryPredefinedEntryVariant(BaseModel):
+class IntegrationProfileSharedEntryPredefinedEntryVariantUnionMember0(BaseModel):
+ """A Predefined AI prompt classification topic entry."""
+
topic_type: Literal["Intent", "Content"]
type: Literal["PromptTopic"]
description: Optional[str] = None
+ """
+ A customer-facing explanation of what this predefined AI prompt topic
+ represents.
+ """
+
+
+class IntegrationProfileSharedEntryPredefinedEntryVariantUnionMember1(BaseModel):
+ """A general predefined entry."""
+
+ type: Literal["General"]
+
+ description: Optional[str] = None
+ """A customer-facing explanation of what this predefined entry represents."""
+
+
+IntegrationProfileSharedEntryPredefinedEntryVariant: TypeAlias = Union[
+ IntegrationProfileSharedEntryPredefinedEntryVariantUnionMember0,
+ IntegrationProfileSharedEntryPredefinedEntryVariantUnionMember1,
+]
class IntegrationProfileSharedEntryPredefinedEntry(BaseModel):
@@ -744,6 +860,7 @@ class IntegrationProfileSharedEntryPredefinedEntry(BaseModel):
profile_id: Optional[str] = None
variant: Optional[IntegrationProfileSharedEntryPredefinedEntryVariant] = None
+ """A Predefined AI prompt classification topic entry."""
class IntegrationProfileSharedEntryIntegrationEntry(BaseModel):
diff --git a/src/cloudflare/types/zero_trust/dlp/profile_list_params.py b/src/cloudflare/types/zero_trust/dlp/profile_list_params.py
old mode 100755
new mode 100644
diff --git a/src/cloudflare/types/zero_trust/dlp/profiles/predefined_profile.py b/src/cloudflare/types/zero_trust/dlp/profiles/predefined_profile.py
index b3c97b85ffc..234339358d1 100644
--- a/src/cloudflare/types/zero_trust/dlp/profiles/predefined_profile.py
+++ b/src/cloudflare/types/zero_trust/dlp/profiles/predefined_profile.py
@@ -14,6 +14,8 @@
"EntryPredefinedEntry",
"EntryPredefinedEntryConfidence",
"EntryPredefinedEntryVariant",
+ "EntryPredefinedEntryVariantUnionMember0",
+ "EntryPredefinedEntryVariantUnionMember1",
"EntryIntegrationEntry",
"EntryExactDataEntry",
"EntryDocumentFingerprintEntry",
@@ -52,12 +54,32 @@ class EntryPredefinedEntryConfidence(BaseModel):
"""
-class EntryPredefinedEntryVariant(BaseModel):
+class EntryPredefinedEntryVariantUnionMember0(BaseModel):
+ """A Predefined AI prompt classification topic entry."""
+
topic_type: Literal["Intent", "Content"]
type: Literal["PromptTopic"]
description: Optional[str] = None
+ """
+ A customer-facing explanation of what this predefined AI prompt topic
+ represents.
+ """
+
+
+class EntryPredefinedEntryVariantUnionMember1(BaseModel):
+ """A general predefined entry."""
+
+ type: Literal["General"]
+
+ description: Optional[str] = None
+ """A customer-facing explanation of what this predefined entry represents."""
+
+
+EntryPredefinedEntryVariant: TypeAlias = Union[
+ EntryPredefinedEntryVariantUnionMember0, EntryPredefinedEntryVariantUnionMember1
+]
class EntryPredefinedEntry(BaseModel):
@@ -74,6 +96,7 @@ class EntryPredefinedEntry(BaseModel):
profile_id: Optional[str] = None
variant: Optional[EntryPredefinedEntryVariant] = None
+ """A Predefined AI prompt classification topic entry."""
class EntryIntegrationEntry(BaseModel):
diff --git a/tests/api_resources/aisearch/namespaces/instances/test_items.py b/tests/api_resources/aisearch/namespaces/instances/test_items.py
index d7a6b9b7bed..6753ef60196 100644
--- a/tests/api_resources/aisearch/namespaces/instances/test_items.py
+++ b/tests/api_resources/aisearch/namespaces/instances/test_items.py
@@ -283,6 +283,18 @@ def test_method_create_or_update(self, client: Cloudflare) -> None:
)
assert_matches_type(ItemCreateOrUpdateResponse, item, path=["response"])
+ @parametrize
+ def test_method_create_or_update_with_all_params(self, client: Cloudflare) -> None:
+ item = client.aisearch.namespaces.instances.items.create_or_update(
+ id="my-ai-search",
+ account_id="c3dc5f0b34a14ff8e1b3ec04895e1b22",
+ name="my-namespace",
+ key="key",
+ next_action="INDEX",
+ wait_for_completion=True,
+ )
+ assert_matches_type(ItemCreateOrUpdateResponse, item, path=["response"])
+
@parametrize
def test_raw_response_create_or_update(self, client: Cloudflare) -> None:
response = client.aisearch.namespaces.instances.items.with_raw_response.create_or_update(
@@ -607,6 +619,18 @@ def test_method_sync(self, client: Cloudflare) -> None:
)
assert_matches_type(ItemSyncResponse, item, path=["response"])
+ @parametrize
+ def test_method_sync_with_all_params(self, client: Cloudflare) -> None:
+ item = client.aisearch.namespaces.instances.items.sync(
+ item_id="item_id",
+ account_id="c3dc5f0b34a14ff8e1b3ec04895e1b22",
+ name="my-namespace",
+ id="my-ai-search",
+ next_action="INDEX",
+ wait_for_completion=True,
+ )
+ assert_matches_type(ItemSyncResponse, item, path=["response"])
+
@parametrize
def test_raw_response_sync(self, client: Cloudflare) -> None:
response = client.aisearch.namespaces.instances.items.with_raw_response.sync(
@@ -1011,6 +1035,18 @@ async def test_method_create_or_update(self, async_client: AsyncCloudflare) -> N
)
assert_matches_type(ItemCreateOrUpdateResponse, item, path=["response"])
+ @parametrize
+ async def test_method_create_or_update_with_all_params(self, async_client: AsyncCloudflare) -> None:
+ item = await async_client.aisearch.namespaces.instances.items.create_or_update(
+ id="my-ai-search",
+ account_id="c3dc5f0b34a14ff8e1b3ec04895e1b22",
+ name="my-namespace",
+ key="key",
+ next_action="INDEX",
+ wait_for_completion=True,
+ )
+ assert_matches_type(ItemCreateOrUpdateResponse, item, path=["response"])
+
@parametrize
async def test_raw_response_create_or_update(self, async_client: AsyncCloudflare) -> None:
response = await async_client.aisearch.namespaces.instances.items.with_raw_response.create_or_update(
@@ -1335,6 +1371,18 @@ async def test_method_sync(self, async_client: AsyncCloudflare) -> None:
)
assert_matches_type(ItemSyncResponse, item, path=["response"])
+ @parametrize
+ async def test_method_sync_with_all_params(self, async_client: AsyncCloudflare) -> None:
+ item = await async_client.aisearch.namespaces.instances.items.sync(
+ item_id="item_id",
+ account_id="c3dc5f0b34a14ff8e1b3ec04895e1b22",
+ name="my-namespace",
+ id="my-ai-search",
+ next_action="INDEX",
+ wait_for_completion=True,
+ )
+ assert_matches_type(ItemSyncResponse, item, path=["response"])
+
@parametrize
async def test_raw_response_sync(self, async_client: AsyncCloudflare) -> None:
response = await async_client.aisearch.namespaces.instances.items.with_raw_response.sync(
diff --git a/tests/api_resources/aisearch/namespaces/test_instances.py b/tests/api_resources/aisearch/namespaces/test_instances.py
index 3aab8040ce6..b9ef034cc9e 100644
--- a/tests/api_resources/aisearch/namespaces/test_instances.py
+++ b/tests/api_resources/aisearch/namespaces/test_instances.py
@@ -378,7 +378,7 @@ def test_method_list_with_all_params(self, client: Cloudflare) -> None:
order_by="created_at",
order_by_direction="asc",
page=1,
- per_page=1,
+ per_page=20,
search="search",
)
assert_matches_type(SyncV4PagePaginationArray[InstanceListResponse], instance, path=["response"])
@@ -1213,7 +1213,7 @@ async def test_method_list_with_all_params(self, async_client: AsyncCloudflare)
order_by="created_at",
order_by_direction="asc",
page=1,
- per_page=1,
+ per_page=20,
search="search",
)
assert_matches_type(AsyncV4PagePaginationArray[InstanceListResponse], instance, path=["response"])
diff --git a/tests/api_resources/aisearch/test_instances.py b/tests/api_resources/aisearch/test_instances.py
index 80bd18541ba..b80c7cb3ba2 100644
--- a/tests/api_resources/aisearch/test_instances.py
+++ b/tests/api_resources/aisearch/test_instances.py
@@ -351,7 +351,7 @@ def test_method_list_with_all_params(self, client: Cloudflare) -> None:
order_by="created_at",
order_by_direction="asc",
page=1,
- per_page=1,
+ per_page=20,
search="search",
)
assert_matches_type(SyncV4PagePaginationArray[InstanceListResponse], instance, path=["response"])
@@ -1082,7 +1082,7 @@ async def test_method_list_with_all_params(self, async_client: AsyncCloudflare)
order_by="created_at",
order_by_direction="asc",
page=1,
- per_page=1,
+ per_page=20,
search="search",
)
assert_matches_type(AsyncV4PagePaginationArray[InstanceListResponse], instance, path=["response"])
diff --git a/tests/api_resources/api_gateway/test_operations.py b/tests/api_resources/api_gateway/test_operations.py
index aab5d1b4997..03ad915d493 100644
--- a/tests/api_resources/api_gateway/test_operations.py
+++ b/tests/api_resources/api_gateway/test_operations.py
@@ -294,6 +294,7 @@ def test_method_get_with_all_params(self, client: Cloudflare) -> None:
operation_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
zone_id="023e105f4ecef8ad9ca31a8372d0c353",
feature=["thresholds"],
+ with_schemas=True,
)
assert_matches_type(OperationGetResponse, operation, path=["response"])
@@ -612,6 +613,7 @@ async def test_method_get_with_all_params(self, async_client: AsyncCloudflare) -
operation_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
zone_id="023e105f4ecef8ad9ca31a8372d0c353",
feature=["thresholds"],
+ with_schemas=True,
)
assert_matches_type(OperationGetResponse, operation, path=["response"])
diff --git a/tests/api_resources/botnet_feed/configs/__init__.py b/tests/api_resources/botnet_feed/configs/__init__.py
old mode 100755
new mode 100644
diff --git a/tests/api_resources/botnet_feed/configs/test_asn.py b/tests/api_resources/botnet_feed/configs/test_asn.py
old mode 100755
new mode 100644
diff --git a/tests/api_resources/botnet_feed/test_asn.py b/tests/api_resources/botnet_feed/test_asn.py
old mode 100755
new mode 100644
diff --git a/tests/api_resources/browser_rendering/devtools/browser/test_targets.py b/tests/api_resources/browser_rendering/devtools/browser/test_targets.py
index f574b31673c..ca56261b925 100644
--- a/tests/api_resources/browser_rendering/devtools/browser/test_targets.py
+++ b/tests/api_resources/browser_rendering/devtools/browser/test_targets.py
@@ -12,6 +12,7 @@
from cloudflare.types.browser_rendering.devtools.browser import (
TargetGetResponse,
TargetListResponse,
+ TargetCloseResponse,
TargetCreateResponse,
TargetActivateResponse,
)
@@ -187,6 +188,66 @@ def test_path_params_activate(self, client: Cloudflare) -> None:
session_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
)
+ @parametrize
+ def test_method_close(self, client: Cloudflare) -> None:
+ target = client.browser_rendering.devtools.browser.targets.close(
+ target_id="target_id",
+ account_id="account_id",
+ session_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
+ )
+ assert_matches_type(TargetCloseResponse, target, path=["response"])
+
+ @parametrize
+ def test_raw_response_close(self, client: Cloudflare) -> None:
+ response = client.browser_rendering.devtools.browser.targets.with_raw_response.close(
+ target_id="target_id",
+ account_id="account_id",
+ session_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
+ )
+
+ assert response.is_closed is True
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+ target = response.parse()
+ assert_matches_type(TargetCloseResponse, target, path=["response"])
+
+ @parametrize
+ def test_streaming_response_close(self, client: Cloudflare) -> None:
+ with client.browser_rendering.devtools.browser.targets.with_streaming_response.close(
+ target_id="target_id",
+ account_id="account_id",
+ session_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
+ ) as response:
+ assert not response.is_closed
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+
+ target = response.parse()
+ assert_matches_type(TargetCloseResponse, target, path=["response"])
+
+ assert cast(Any, response.is_closed) is True
+
+ @parametrize
+ def test_path_params_close(self, client: Cloudflare) -> None:
+ with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"):
+ client.browser_rendering.devtools.browser.targets.with_raw_response.close(
+ target_id="target_id",
+ account_id="",
+ session_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
+ )
+
+ with pytest.raises(ValueError, match=r"Expected a non-empty value for `session_id` but received ''"):
+ client.browser_rendering.devtools.browser.targets.with_raw_response.close(
+ target_id="target_id",
+ account_id="account_id",
+ session_id="",
+ )
+
+ with pytest.raises(ValueError, match=r"Expected a non-empty value for `target_id` but received ''"):
+ client.browser_rendering.devtools.browser.targets.with_raw_response.close(
+ target_id="",
+ account_id="account_id",
+ session_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
+ )
+
@parametrize
def test_method_get(self, client: Cloudflare) -> None:
target = client.browser_rendering.devtools.browser.targets.get(
@@ -418,6 +479,66 @@ async def test_path_params_activate(self, async_client: AsyncCloudflare) -> None
session_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
)
+ @parametrize
+ async def test_method_close(self, async_client: AsyncCloudflare) -> None:
+ target = await async_client.browser_rendering.devtools.browser.targets.close(
+ target_id="target_id",
+ account_id="account_id",
+ session_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
+ )
+ assert_matches_type(TargetCloseResponse, target, path=["response"])
+
+ @parametrize
+ async def test_raw_response_close(self, async_client: AsyncCloudflare) -> None:
+ response = await async_client.browser_rendering.devtools.browser.targets.with_raw_response.close(
+ target_id="target_id",
+ account_id="account_id",
+ session_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
+ )
+
+ assert response.is_closed is True
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+ target = await response.parse()
+ assert_matches_type(TargetCloseResponse, target, path=["response"])
+
+ @parametrize
+ async def test_streaming_response_close(self, async_client: AsyncCloudflare) -> None:
+ async with async_client.browser_rendering.devtools.browser.targets.with_streaming_response.close(
+ target_id="target_id",
+ account_id="account_id",
+ session_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
+ ) as response:
+ assert not response.is_closed
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+
+ target = await response.parse()
+ assert_matches_type(TargetCloseResponse, target, path=["response"])
+
+ assert cast(Any, response.is_closed) is True
+
+ @parametrize
+ async def test_path_params_close(self, async_client: AsyncCloudflare) -> None:
+ with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"):
+ await async_client.browser_rendering.devtools.browser.targets.with_raw_response.close(
+ target_id="target_id",
+ account_id="",
+ session_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
+ )
+
+ with pytest.raises(ValueError, match=r"Expected a non-empty value for `session_id` but received ''"):
+ await async_client.browser_rendering.devtools.browser.targets.with_raw_response.close(
+ target_id="target_id",
+ account_id="account_id",
+ session_id="",
+ )
+
+ with pytest.raises(ValueError, match=r"Expected a non-empty value for `target_id` but received ''"):
+ await async_client.browser_rendering.devtools.browser.targets.with_raw_response.close(
+ target_id="",
+ account_id="account_id",
+ session_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
+ )
+
@parametrize
async def test_method_get(self, async_client: AsyncCloudflare) -> None:
target = await async_client.browser_rendering.devtools.browser.targets.get(
diff --git a/tests/api_resources/browser_rendering/test_content.py b/tests/api_resources/browser_rendering/test_content.py
index c702e1e2c05..42a1a8708b0 100644
--- a/tests/api_resources/browser_rendering/test_content.py
+++ b/tests/api_resources/browser_rendering/test_content.py
@@ -29,7 +29,7 @@ def test_method_create_with_all_params_overload_1(self, client: Cloudflare) -> N
content = client.browser_rendering.content.create(
account_id="account_id",
url="https://example.com/",
- cache_ttl=86400,
+ cache_ttl=0,
action_timeout=120000,
add_script_tag=[
{
@@ -147,7 +147,7 @@ def test_method_create_with_all_params_overload_2(self, client: Cloudflare) -> N
content = client.browser_rendering.content.create(
account_id="account_id",
html="