From 4727acec0eb9ce14c6a1d8ded3d69a00a3bf22c9 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 13 Feb 2026 15:41:56 +0000 Subject: [PATCH 001/279] chore(api): update composite API spec --- .stats.yml | 6 +- api.md | 47 ++- src/cloudflare/resources/accounts/members.py | 16 + src/cloudflare/resources/ai/models/schema.py | 13 +- .../resources/aisearch/instances/instances.py | 34 +- .../threat_events/threat_events.py | 101 ------ .../custom_certificates.py | 182 +++-------- .../email_security/investigate/investigate.py | 10 +- .../email_security/investigate/move.py | 4 +- .../resources/email_security/submissions.py | 10 +- src/cloudflare/resources/queues/consumers.py | 177 ++++++----- .../r2/super_slurper/connectivity_precheck.py | 12 +- .../resources/radar/ai/bots/bots.py | 178 ++++++++++- .../resources/radar/ai/timeseries_groups.py | 178 ++++++++++- src/cloudflare/resources/radar/bots/bots.py | 8 +- .../resources/radar/bots/web_crawlers.py | 4 +- src/cloudflare/resources/radar/ct/ct.py | 8 +- .../resources/radar/netflows/netflows.py | 4 +- src/cloudflare/resources/snippets/content.py | 8 +- src/cloudflare/resources/snippets/rules.py | 117 +++---- src/cloudflare/resources/snippets/snippets.py | 53 ++-- .../zero_trust/dlp/entries/custom.py | 8 + .../zero_trust/dlp/entries/entries.py | 10 + src/cloudflare/resources/zones/zones.py | 16 +- .../types/accounts/member_create_params.py | 12 + src/cloudflare/types/ai/ai_run_params.py | 11 +- src/cloudflare/types/ai/models/__init__.py | 1 + .../types/ai/models/schema_get_response.py | 29 ++ .../instance_chat_completions_params.py | 37 +-- .../types/aisearch/instance_create_params.py | 8 +- .../aisearch/instance_create_response.py | 55 +--- .../aisearch/instance_delete_response.py | 55 +--- .../types/aisearch/instance_list_response.py | 55 +--- .../types/aisearch/instance_read_response.py | 55 +--- .../types/aisearch/instance_search_params.py | 36 +-- .../types/aisearch/instance_update_params.py | 15 +- .../aisearch/instance_update_response.py | 55 +--- .../types/aisearch/token_create_response.py | 8 - .../types/aisearch/token_delete_response.py | 8 - .../types/aisearch/token_list_response.py | 8 - .../types/aisearch/token_read_response.py | 8 - .../types/aisearch/token_update_response.py | 8 - .../types/cloudforce_one/__init__.py | 1 - .../threat_event_delete_response.py | 9 - .../custom_certificates/custom_certificate.py | 21 +- .../custom_certificate_create_params.py | 7 +- .../custom_certificate_edit_params.py | 34 +- .../certificate_update_response.py | 115 +++++-- .../custom_hostname_create_response.py | 115 +++++-- .../custom_hostname_edit_response.py | 115 +++++-- .../custom_hostname_get_response.py | 115 +++++-- .../custom_hostname_list_response.py | 115 +++++-- .../email_security/investigate_list_params.py | 7 +- .../email_security/submission_list_params.py | 7 +- src/cloudflare/types/queues/__init__.py | 5 +- .../types/queues/consumer_create_params.py | 34 +- .../types/queues/consumer_create_response.py | 102 ++++++ .../{consumer.py => consumer_get_response.py} | 46 ++- .../types/queues/consumer_list_response.py | 102 ++++++ .../types/queues/consumer_update_params.py | 34 +- .../types/queues/consumer_update_response.py | 102 ++++++ src/cloudflare/types/queues/queue.py | 104 +++++- .../connectivity_precheck_source_params.py | 7 + .../r2/super_slurper/job_create_params.py | 7 + .../types/radar/ai/bot_summary_v2_params.py | 30 +- .../radar/ai/bot_timeseries_groups_params.py | 32 +- .../types/radar/ai/bot_timeseries_params.py | 27 +- .../ai/timeseries_group_summary_params.py | 30 +- ...meseries_group_timeseries_groups_params.py | 32 +- .../ai/timeseries_group_timeseries_params.py | 27 +- .../types/rulesets/rule_create_params.py | 3 + .../types/rulesets/rule_edit_params.py | 3 + .../types/rulesets/set_config_rule.py | 3 + .../types/rulesets/set_config_rule_param.py | 3 + src/cloudflare/types/snippets/__init__.py | 4 - .../types/snippets/rule_delete_response.py | 30 -- .../types/snippets/rule_list_response.py | 30 -- .../types/snippets/rule_update_params.py | 14 +- .../types/snippets/rule_update_response.py | 30 -- .../types/snippets/snippet_delete_response.py | 8 - .../types/snippets/snippet_get_response.py | 8 +- .../types/snippets/snippet_list_params.py | 6 +- .../types/snippets/snippet_list_response.py | 8 +- .../types/snippets/snippet_update_params.py | 8 +- .../types/snippets/snippet_update_response.py | 8 +- .../ssl/certificate_pack_create_response.py | 53 ++++ .../ssl/certificate_pack_edit_response.py | 53 ++++ .../ssl/certificate_pack_get_response.py | 53 ++++ .../ssl/certificate_pack_list_response.py | 53 ++++ .../types/workflows/version_get_response.py | 2 + .../types/workflows/version_list_response.py | 2 + .../dlp/entries/custom_create_params.py | 3 + .../dlp/entries/custom_create_response.py | 2 + .../dlp/entries/custom_get_response.py | 2 + .../dlp/entries/custom_list_response.py | 2 + .../dlp/entries/custom_update_params.py | 3 + .../dlp/entries/custom_update_response.py | 2 + .../dlp/entries/integration_get_response.py | 2 + .../dlp/entries/integration_list_response.py | 2 + .../dlp/entries/predefined_get_response.py | 2 + .../dlp/entries/predefined_list_response.py | 2 + .../zero_trust/dlp/entry_create_params.py | 3 + .../zero_trust/dlp/entry_create_response.py | 2 + .../zero_trust/dlp/entry_get_response.py | 2 + .../zero_trust/dlp/entry_list_response.py | 2 + .../zero_trust/dlp/entry_update_params.py | 4 +- .../zero_trust/dlp/entry_update_response.py | 2 + .../types/zero_trust/dlp/profile.py | 298 ++++++++++++++++++ .../zero_trust/dlp/profile_get_response.py | 298 ++++++++++++++++++ .../dlp/profiles/custom_create_params.py | 2 + .../dlp/profiles/custom_create_response.py | 298 ++++++++++++++++++ .../dlp/profiles/custom_get_response.py | 298 ++++++++++++++++++ .../dlp/profiles/custom_update_params.py | 4 + .../dlp/profiles/custom_update_response.py | 298 ++++++++++++++++++ .../dlp/profiles/predefined_get_response.py | 2 + .../profiles/predefined_update_response.py | 2 + .../networks/subnet_list_response.py | 2 +- .../cloudflare_source_update_response.py | 2 +- src/cloudflare/types/zones/zone.py | 7 +- .../types/zones/zone_create_params.py | 7 +- tests/api_resources/ai/models/test_schema.py | 13 +- .../api_resources/aisearch/test_instances.py | 48 +-- .../cloudforce_one/test_threat_events.py | 105 ------ tests/api_resources/queues/test_consumers.py | 186 +++++++---- .../test_connectivity_precheck.py | 6 + .../r2/super_slurper/test_jobs.py | 2 + tests/api_resources/radar/ai/test_bots.py | 14 +- .../radar/ai/test_timeseries_groups.py | 14 +- tests/api_resources/rulesets/test_rules.py | 4 + tests/api_resources/snippets/test_rules.py | 38 ++- tests/api_resources/test_ai.py | 24 +- .../api_resources/test_custom_certificates.py | 178 ++--------- tests/api_resources/test_snippets.py | 12 +- .../zero_trust/dlp/entries/test_custom.py | 4 + .../zero_trust/dlp/profiles/test_custom.py | 4 + .../zero_trust/dlp/test_entries.py | 4 + 136 files changed, 3983 insertions(+), 1660 deletions(-) create mode 100644 src/cloudflare/types/ai/models/schema_get_response.py delete mode 100644 src/cloudflare/types/cloudforce_one/threat_event_delete_response.py create mode 100644 src/cloudflare/types/queues/consumer_create_response.py rename src/cloudflare/types/queues/{consumer.py => consumer_get_response.py} (58%) create mode 100644 src/cloudflare/types/queues/consumer_list_response.py create mode 100644 src/cloudflare/types/queues/consumer_update_response.py delete mode 100644 src/cloudflare/types/snippets/rule_delete_response.py delete mode 100644 src/cloudflare/types/snippets/rule_list_response.py delete mode 100644 src/cloudflare/types/snippets/rule_update_response.py delete mode 100644 src/cloudflare/types/snippets/snippet_delete_response.py diff --git a/.stats.yml b/.stats.yml index 2dc0294f22e..cc52949a276 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ -configured_endpoints: 2015 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-83f49bc3fa9273ef989d3e8bcd27f6fdaa7d04ae2519a91f4878f46acc501bb9.yml -openapi_spec_hash: 3f4be3af6f51eea4787dc8345f9ca9c1 +configured_endpoints: 2014 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-30edf614aac6aca8f0f9f32f687e9fad91929509a22e4337b673b905db8b8801.yml +openapi_spec_hash: d2f21a869c3b0902e8c8ea72d216170f config_hash: 9d1829ed664bb3efa8638f98bb32cf46 diff --git a/api.md b/api.md index 890a848cb44..cc1dcee75b4 100644 --- a/api.md +++ b/api.md @@ -2791,16 +2791,22 @@ Methods: Types: ```python -from cloudflare.types.queues import Consumer, ConsumerDeleteResponse +from cloudflare.types.queues import ( + ConsumerCreateResponse, + ConsumerUpdateResponse, + ConsumerListResponse, + ConsumerDeleteResponse, + ConsumerGetResponse, +) ``` Methods: -- client.queues.consumers.create(queue_id, \*, account_id, \*\*params) -> Optional[Consumer] -- client.queues.consumers.update(consumer_id, \*, account_id, queue_id, \*\*params) -> Optional[Consumer] -- client.queues.consumers.list(queue_id, \*, account_id) -> SyncSinglePage[Consumer] +- client.queues.consumers.create(queue_id, \*, account_id, \*\*params) -> Optional[ConsumerCreateResponse] +- client.queues.consumers.update(consumer_id, \*, account_id, queue_id, \*\*params) -> Optional[ConsumerUpdateResponse] +- client.queues.consumers.list(queue_id, \*, account_id) -> SyncSinglePage[ConsumerListResponse] - client.queues.consumers.delete(consumer_id, \*, account_id, queue_id) -> ConsumerDeleteResponse -- client.queues.consumers.get(consumer_id, \*, account_id, queue_id) -> Optional[Consumer] +- client.queues.consumers.get(consumer_id, \*, account_id, queue_id) -> Optional[ConsumerGetResponse] ## Subscriptions @@ -9383,19 +9389,14 @@ Methods: Types: ```python -from cloudflare.types.snippets import ( - SnippetUpdateResponse, - SnippetListResponse, - SnippetDeleteResponse, - SnippetGetResponse, -) +from cloudflare.types.snippets import SnippetUpdateResponse, SnippetListResponse, SnippetGetResponse ``` Methods: - client.snippets.update(snippet_name, \*, zone_id, \*\*params) -> SnippetUpdateResponse - client.snippets.list(\*, zone_id, \*\*params) -> SyncV4PagePaginationArray[SnippetListResponse] -- client.snippets.delete(snippet_name, \*, zone_id) -> str +- client.snippets.delete(snippet_name, \*, zone_id) -> object - client.snippets.get(snippet_name, \*, zone_id) -> SnippetGetResponse ## Content @@ -9406,17 +9407,11 @@ Methods: ## Rules -Types: - -```python -from cloudflare.types.snippets import RuleUpdateResponse, RuleListResponse, RuleDeleteResponse -``` - Methods: -- client.snippets.rules.update(\*, zone_id, \*\*params) -> SyncSinglePage[RuleUpdateResponse] -- client.snippets.rules.list(\*, zone_id) -> SyncSinglePage[RuleListResponse] -- client.snippets.rules.delete(\*, zone_id) -> SyncSinglePage[RuleDeleteResponse] +- client.snippets.rules.update(\*, zone_id, \*\*params) -> object +- client.snippets.rules.list(\*, zone_id) -> object +- client.snippets.rules.delete(\*, zone_id) -> object # RealtimeKit @@ -9814,7 +9809,6 @@ Types: from cloudflare.types.cloudforce_one import ( ThreatEventCreateResponse, ThreatEventListResponse, - ThreatEventDeleteResponse, ThreatEventBulkCreateResponse, ThreatEventEditResponse, ThreatEventGetResponse, @@ -9825,7 +9819,6 @@ Methods: - client.cloudforce_one.threat_events.create(\*, path_account_id, \*\*params) -> ThreatEventCreateResponse - client.cloudforce_one.threat_events.list(\*, account_id, \*\*params) -> ThreatEventListResponse -- client.cloudforce_one.threat_events.delete(event_id, \*, account_id) -> ThreatEventDeleteResponse - client.cloudforce_one.threat_events.bulk_create(\*, account_id, \*\*params) -> ThreatEventBulkCreateResponse - client.cloudforce_one.threat_events.edit(event_id, \*, account_id, \*\*params) -> ThreatEventEditResponse - client.cloudforce_one.threat_events.get(event_id, \*, account_id) -> ThreatEventGetResponse @@ -10613,9 +10606,15 @@ Methods: ### Schema +Types: + +```python +from cloudflare.types.ai.models import SchemaGetResponse +``` + Methods: -- client.ai.models.schema.get(\*, account_id, \*\*params) -> object +- client.ai.models.schema.get(\*, account_id, \*\*params) -> SchemaGetResponse ## ToMarkdown diff --git a/src/cloudflare/resources/accounts/members.py b/src/cloudflare/resources/accounts/members.py index 61eb3ff9fc2..015215bb852 100644 --- a/src/cloudflare/resources/accounts/members.py +++ b/src/cloudflare/resources/accounts/members.py @@ -73,6 +73,10 @@ def create( roles: Array of roles associated with this member. + status: Status of the member invitation. If not provided during creation, defaults to + 'pending'. Changing from 'accepted' back to 'pending' will trigger a replacement + of the member resource in Terraform. + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -108,6 +112,10 @@ def create( policies: Array of policies associated with this member. + status: Status of the member invitation. If not provided during creation, defaults to + 'pending'. Changing from 'accepted' back to 'pending' will trigger a replacement + of the member resource in Terraform. + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -461,6 +469,10 @@ async def create( roles: Array of roles associated with this member. + status: Status of the member invitation. If not provided during creation, defaults to + 'pending'. Changing from 'accepted' back to 'pending' will trigger a replacement + of the member resource in Terraform. + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -496,6 +508,10 @@ async def create( policies: Array of policies associated with this member. + status: Status of the member invitation. If not provided during creation, defaults to + 'pending'. Changing from 'accepted' back to 'pending' will trigger a replacement + of the member resource in Terraform. + extra_headers: Send extra headers extra_query: Add additional query parameters to the request diff --git a/src/cloudflare/resources/ai/models/schema.py b/src/cloudflare/resources/ai/models/schema.py index 2f12236dd38..d555ab98627 100644 --- a/src/cloudflare/resources/ai/models/schema.py +++ b/src/cloudflare/resources/ai/models/schema.py @@ -19,6 +19,7 @@ from ...._wrappers import ResultWrapper from ...._base_client import make_request_options from ....types.ai.models import schema_get_params +from ....types.ai.models.schema_get_response import SchemaGetResponse __all__ = ["SchemaResource", "AsyncSchemaResource"] @@ -54,7 +55,7 @@ def get( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, - ) -> object: + ) -> SchemaGetResponse: """ Get Model Schema @@ -79,9 +80,9 @@ def get( extra_body=extra_body, timeout=timeout, query=maybe_transform({"model": model}, schema_get_params.SchemaGetParams), - post_parser=ResultWrapper[object]._unwrapper, + post_parser=ResultWrapper[SchemaGetResponse]._unwrapper, ), - cast_to=cast(Type[object], ResultWrapper[object]), + cast_to=cast(Type[SchemaGetResponse], ResultWrapper[SchemaGetResponse]), ) @@ -116,7 +117,7 @@ async def get( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, - ) -> object: + ) -> SchemaGetResponse: """ Get Model Schema @@ -141,9 +142,9 @@ async def get( extra_body=extra_body, timeout=timeout, query=await async_maybe_transform({"model": model}, schema_get_params.SchemaGetParams), - post_parser=ResultWrapper[object]._unwrapper, + post_parser=ResultWrapper[SchemaGetResponse]._unwrapper, ), - cast_to=cast(Type[object], ResultWrapper[object]), + cast_to=cast(Type[SchemaGetResponse], ResultWrapper[SchemaGetResponse]), ) diff --git a/src/cloudflare/resources/aisearch/instances/instances.py b/src/cloudflare/resources/aisearch/instances/instances.py index 44984f27f89..fff9397adad 100644 --- a/src/cloudflare/resources/aisearch/instances/instances.py +++ b/src/cloudflare/resources/aisearch/instances/instances.py @@ -2,7 +2,7 @@ from __future__ import annotations -from typing import Type, Iterable, cast +from typing import Type, Iterable, Optional, cast from typing_extensions import Literal import httpx @@ -90,9 +90,10 @@ def create( id: str, source: str, type: Literal["r2", "web-crawler"], - ai_gateway_id: str | Omit = omit, + ai_gateway_id: Optional[str] | Omit = omit, aisearch_model: Literal[ "@cf/meta/llama-3.3-70b-instruct-fp8-fast", + "@cf/zai-org/glm-4.7-flash", "@cf/meta/llama-3.1-8b-instruct-fast", "@cf/meta/llama-3.1-8b-instruct-fp8", "@cf/meta/llama-4-scout-17b-16e-instruct", @@ -143,6 +144,7 @@ def create( reranking_model: Literal["@cf/baai/bge-reranker-base", ""] | Omit = omit, rewrite_model: Literal[ "@cf/meta/llama-3.3-70b-instruct-fp8-fast", + "@cf/zai-org/glm-4.7-flash", "@cf/meta/llama-3.1-8b-instruct-fast", "@cf/meta/llama-3.1-8b-instruct-fp8", "@cf/meta/llama-4-scout-17b-16e-instruct", @@ -240,9 +242,10 @@ def update( id: str, *, account_id: str, - ai_gateway_id: str | Omit = omit, + ai_gateway_id: Optional[str] | Omit = omit, aisearch_model: Literal[ "@cf/meta/llama-3.3-70b-instruct-fp8-fast", + "@cf/zai-org/glm-4.7-flash", "@cf/meta/llama-3.1-8b-instruct-fast", "@cf/meta/llama-3.1-8b-instruct-fp8", "@cf/meta/llama-4-scout-17b-16e-instruct", @@ -297,6 +300,7 @@ def update( reranking_model: Literal["@cf/baai/bge-reranker-base", ""] | Omit = omit, rewrite_model: Literal[ "@cf/meta/llama-3.3-70b-instruct-fp8-fast", + "@cf/zai-org/glm-4.7-flash", "@cf/meta/llama-3.1-8b-instruct-fast", "@cf/meta/llama-3.1-8b-instruct-fp8", "@cf/meta/llama-4-scout-17b-16e-instruct", @@ -330,6 +334,7 @@ def update( summarization: bool | Omit = omit, summarization_model: Literal[ "@cf/meta/llama-3.3-70b-instruct-fp8-fast", + "@cf/zai-org/glm-4.7-flash", "@cf/meta/llama-3.1-8b-instruct-fast", "@cf/meta/llama-3.1-8b-instruct-fp8", "@cf/meta/llama-4-scout-17b-16e-instruct", @@ -357,9 +362,9 @@ def update( "", ] | Omit = omit, - system_prompt_aisearch: str | Omit = omit, - system_prompt_index_summarization: str | Omit = omit, - system_prompt_rewrite_query: str | Omit = omit, + system_prompt_aisearch: Optional[str] | Omit = omit, + system_prompt_index_summarization: Optional[str] | Omit = omit, + system_prompt_rewrite_query: Optional[str] | Omit = omit, token_id: str | 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. @@ -530,6 +535,7 @@ def chat_completions( aisearch_options: instance_chat_completions_params.AISearchOptions | Omit = omit, model: Literal[ "@cf/meta/llama-3.3-70b-instruct-fp8-fast", + "@cf/zai-org/glm-4.7-flash", "@cf/meta/llama-3.1-8b-instruct-fast", "@cf/meta/llama-3.1-8b-instruct-fp8", "@cf/meta/llama-4-scout-17b-16e-instruct", @@ -771,9 +777,10 @@ async def create( id: str, source: str, type: Literal["r2", "web-crawler"], - ai_gateway_id: str | Omit = omit, + ai_gateway_id: Optional[str] | Omit = omit, aisearch_model: Literal[ "@cf/meta/llama-3.3-70b-instruct-fp8-fast", + "@cf/zai-org/glm-4.7-flash", "@cf/meta/llama-3.1-8b-instruct-fast", "@cf/meta/llama-3.1-8b-instruct-fp8", "@cf/meta/llama-4-scout-17b-16e-instruct", @@ -824,6 +831,7 @@ async def create( reranking_model: Literal["@cf/baai/bge-reranker-base", ""] | Omit = omit, rewrite_model: Literal[ "@cf/meta/llama-3.3-70b-instruct-fp8-fast", + "@cf/zai-org/glm-4.7-flash", "@cf/meta/llama-3.1-8b-instruct-fast", "@cf/meta/llama-3.1-8b-instruct-fp8", "@cf/meta/llama-4-scout-17b-16e-instruct", @@ -921,9 +929,10 @@ async def update( id: str, *, account_id: str, - ai_gateway_id: str | Omit = omit, + ai_gateway_id: Optional[str] | Omit = omit, aisearch_model: Literal[ "@cf/meta/llama-3.3-70b-instruct-fp8-fast", + "@cf/zai-org/glm-4.7-flash", "@cf/meta/llama-3.1-8b-instruct-fast", "@cf/meta/llama-3.1-8b-instruct-fp8", "@cf/meta/llama-4-scout-17b-16e-instruct", @@ -978,6 +987,7 @@ async def update( reranking_model: Literal["@cf/baai/bge-reranker-base", ""] | Omit = omit, rewrite_model: Literal[ "@cf/meta/llama-3.3-70b-instruct-fp8-fast", + "@cf/zai-org/glm-4.7-flash", "@cf/meta/llama-3.1-8b-instruct-fast", "@cf/meta/llama-3.1-8b-instruct-fp8", "@cf/meta/llama-4-scout-17b-16e-instruct", @@ -1011,6 +1021,7 @@ async def update( summarization: bool | Omit = omit, summarization_model: Literal[ "@cf/meta/llama-3.3-70b-instruct-fp8-fast", + "@cf/zai-org/glm-4.7-flash", "@cf/meta/llama-3.1-8b-instruct-fast", "@cf/meta/llama-3.1-8b-instruct-fp8", "@cf/meta/llama-4-scout-17b-16e-instruct", @@ -1038,9 +1049,9 @@ async def update( "", ] | Omit = omit, - system_prompt_aisearch: str | Omit = omit, - system_prompt_index_summarization: str | Omit = omit, - system_prompt_rewrite_query: str | Omit = omit, + system_prompt_aisearch: Optional[str] | Omit = omit, + system_prompt_index_summarization: Optional[str] | Omit = omit, + system_prompt_rewrite_query: Optional[str] | Omit = omit, token_id: str | 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. @@ -1211,6 +1222,7 @@ async def chat_completions( aisearch_options: instance_chat_completions_params.AISearchOptions | Omit = omit, model: Literal[ "@cf/meta/llama-3.3-70b-instruct-fp8-fast", + "@cf/zai-org/glm-4.7-flash", "@cf/meta/llama-3.1-8b-instruct-fast", "@cf/meta/llama-3.1-8b-instruct-fp8", "@cf/meta/llama-4-scout-17b-16e-instruct", diff --git a/src/cloudflare/resources/cloudforce_one/threat_events/threat_events.py b/src/cloudflare/resources/cloudforce_one/threat_events/threat_events.py index a7192f4b7e3..54df839157c 100644 --- a/src/cloudflare/resources/cloudforce_one/threat_events/threat_events.py +++ b/src/cloudflare/resources/cloudforce_one/threat_events/threat_events.py @@ -110,7 +110,6 @@ from ....types.cloudforce_one.threat_event_edit_response import ThreatEventEditResponse from ....types.cloudforce_one.threat_event_list_response import ThreatEventListResponse from ....types.cloudforce_one.threat_event_create_response import ThreatEventCreateResponse -from ....types.cloudforce_one.threat_event_delete_response import ThreatEventDeleteResponse from ....types.cloudforce_one.threat_event_bulk_create_response import ThreatEventBulkCreateResponse __all__ = ["ThreatEventsResource", "AsyncThreatEventsResource"] @@ -329,50 +328,6 @@ def list( cast_to=ThreatEventListResponse, ) - def delete( - self, - event_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, - ) -> ThreatEventDeleteResponse: - """The `datasetId` parameter must be defined. - - To list existing datasets (and their - IDs) in your account, use the - [`List Datasets`](https://developers.cloudflare.com/api/resources/cloudforce_one/subresources/threat_events/subresources/datasets/methods/list/) - endpoint. - - Args: - account_id: Account ID. - - event_id: Event UUID. - - 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 event_id: - raise ValueError(f"Expected a non-empty value for `event_id` but received {event_id!r}") - return self._delete( - f"/accounts/{account_id}/cloudforce-one/events/{event_id}", - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=ThreatEventDeleteResponse, - ) - def bulk_create( self, *, @@ -756,50 +711,6 @@ async def list( cast_to=ThreatEventListResponse, ) - async def delete( - self, - event_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, - ) -> ThreatEventDeleteResponse: - """The `datasetId` parameter must be defined. - - To list existing datasets (and their - IDs) in your account, use the - [`List Datasets`](https://developers.cloudflare.com/api/resources/cloudforce_one/subresources/threat_events/subresources/datasets/methods/list/) - endpoint. - - Args: - account_id: Account ID. - - event_id: Event UUID. - - 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 event_id: - raise ValueError(f"Expected a non-empty value for `event_id` but received {event_id!r}") - return await self._delete( - f"/accounts/{account_id}/cloudforce-one/events/{event_id}", - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - cast_to=ThreatEventDeleteResponse, - ) - async def bulk_create( self, *, @@ -980,9 +891,6 @@ def __init__(self, threat_events: ThreatEventsResource) -> None: self.list = to_raw_response_wrapper( threat_events.list, ) - self.delete = to_raw_response_wrapper( - threat_events.delete, - ) self.bulk_create = to_raw_response_wrapper( threat_events.bulk_create, ) @@ -1046,9 +954,6 @@ def __init__(self, threat_events: AsyncThreatEventsResource) -> None: self.list = async_to_raw_response_wrapper( threat_events.list, ) - self.delete = async_to_raw_response_wrapper( - threat_events.delete, - ) self.bulk_create = async_to_raw_response_wrapper( threat_events.bulk_create, ) @@ -1112,9 +1017,6 @@ def __init__(self, threat_events: ThreatEventsResource) -> None: self.list = to_streamed_response_wrapper( threat_events.list, ) - self.delete = to_streamed_response_wrapper( - threat_events.delete, - ) self.bulk_create = to_streamed_response_wrapper( threat_events.bulk_create, ) @@ -1178,9 +1080,6 @@ def __init__(self, threat_events: AsyncThreatEventsResource) -> None: self.list = async_to_streamed_response_wrapper( threat_events.list, ) - self.delete = async_to_streamed_response_wrapper( - threat_events.delete, - ) self.bulk_create = async_to_streamed_response_wrapper( threat_events.bulk_create, ) diff --git a/src/cloudflare/resources/custom_certificates/custom_certificates.py b/src/cloudflare/resources/custom_certificates/custom_certificates.py index 0d205aea65f..23b2b41c180 100644 --- a/src/cloudflare/resources/custom_certificates/custom_certificates.py +++ b/src/cloudflare/resources/custom_certificates/custom_certificates.py @@ -3,12 +3,12 @@ from __future__ import annotations from typing import Type, Optional, cast -from typing_extensions import Literal, overload +from typing_extensions import Literal import httpx from ..._types import Body, Omit, Query, Headers, NotGiven, omit, not_given -from ..._utils import required_args, maybe_transform, async_maybe_transform +from ..._utils import maybe_transform, async_maybe_transform from ..._compat import cached_property from .prioritize import ( PrioritizeResource, @@ -73,6 +73,7 @@ def create( certificate: str, private_key: str, bundle_method: BundleMethod | Omit = omit, + deploy: Literal["staging", "production"] | Omit = omit, geo_restrictions: GeoRestrictionsParam | Omit = omit, policy: str | Omit = omit, type: Literal["legacy_custom", "sni_custom"] | Omit = omit, @@ -98,6 +99,8 @@ def create( the shortest chain and newest intermediates. And the force bundle verifies the chain, but does not otherwise modify it. + deploy: The environment to deploy the certificate to, defaults to production + geo_restrictions: Specify the region where your private key can be held locally for optimal TLS performance. HTTPS connections to any excluded data center will still be fully encrypted, but will incur some latency while Keyless SSL is used to complete the @@ -114,7 +117,9 @@ def create( (https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements) can be chosen, such as 'country: IN', as well as 'region: EU' which refers to the EU region. If there are too few data centers satisfying the policy, it will - be rejected. + be rejected. Note: The API accepts this field as either "policy" or + "policy_restrictions" in requests. Responses return this field as + "policy_restrictions". example: "(country: US) or (region: EU)" type: The type 'legacy_custom' enables support for legacy clients which do not include SNI in the TLS handshake. @@ -136,6 +141,7 @@ def create( "certificate": certificate, "private_key": private_key, "bundle_method": bundle_method, + "deploy": deploy, "geo_restrictions": geo_restrictions, "policy": policy, "type": type, @@ -263,13 +269,17 @@ def delete( ), ) - @overload def edit( self, custom_certificate_id: str, *, zone_id: str, bundle_method: BundleMethod | Omit = omit, + certificate: str | Omit = omit, + deploy: Literal["staging", "production"] | Omit = omit, + geo_restrictions: GeoRestrictionsParam | Omit = omit, + policy: str | Omit = omit, + private_key: str | 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, @@ -293,53 +303,9 @@ def edit( the shortest chain and newest intermediates. And the force bundle verifies the chain, but does not otherwise modify it. - 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 - """ - ... - - @overload - def edit( - self, - custom_certificate_id: str, - *, - zone_id: str, - certificate: str, - private_key: str, - bundle_method: BundleMethod | Omit = omit, - geo_restrictions: GeoRestrictionsParam | Omit = omit, - policy: str | 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, - ) -> Optional[CustomCertificate]: - """Upload a new private key and/or PEM/CRT for the SSL certificate. - - Note: PATCHing - a configuration for sni_custom certificates will result in a new resource id - being returned, and the previous one being deleted. - - Args: - zone_id: Identifier. - - custom_certificate_id: Identifier. - certificate: The zone's SSL certificate or certificate and the intermediate(s). - private_key: The zone's private key. - - bundle_method: A ubiquitous bundle has the highest probability of being verified everywhere, - even by clients using outdated or unusual trust stores. An optimal bundle uses - the shortest chain and newest intermediates. And the force bundle verifies the - chain, but does not otherwise modify it. + deploy: The environment to deploy the certificate to, defaults to production geo_restrictions: Specify the region where your private key can be held locally for optimal TLS performance. HTTPS connections to any excluded data center will still be fully @@ -357,7 +323,11 @@ def edit( (https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements) can be chosen, such as 'country: IN', as well as 'region: EU' which refers to the EU region. If there are too few data centers satisfying the policy, it will - be rejected. + be rejected. Note: The API accepts this field as either "policy" or + "policy_restrictions" in requests. Responses return this field as + "policy_restrictions". example: "(country: US) or (region: EU)" + + private_key: The zone's private key. extra_headers: Send extra headers @@ -367,26 +337,6 @@ def edit( timeout: Override the client-level default timeout for this request, in seconds """ - ... - - @required_args(["zone_id"], ["zone_id", "certificate", "private_key"]) - def edit( - self, - custom_certificate_id: str, - *, - zone_id: str, - bundle_method: BundleMethod | Omit = omit, - certificate: str | Omit = omit, - private_key: str | Omit = omit, - geo_restrictions: GeoRestrictionsParam | Omit = omit, - policy: str | 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, - ) -> Optional[CustomCertificate]: if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") if not custom_certificate_id: @@ -399,9 +349,10 @@ def edit( { "bundle_method": bundle_method, "certificate": certificate, - "private_key": private_key, + "deploy": deploy, "geo_restrictions": geo_restrictions, "policy": policy, + "private_key": private_key, }, custom_certificate_edit_params.CustomCertificateEditParams, ), @@ -493,6 +444,7 @@ async def create( certificate: str, private_key: str, bundle_method: BundleMethod | Omit = omit, + deploy: Literal["staging", "production"] | Omit = omit, geo_restrictions: GeoRestrictionsParam | Omit = omit, policy: str | Omit = omit, type: Literal["legacy_custom", "sni_custom"] | Omit = omit, @@ -518,6 +470,8 @@ async def create( the shortest chain and newest intermediates. And the force bundle verifies the chain, but does not otherwise modify it. + deploy: The environment to deploy the certificate to, defaults to production + geo_restrictions: Specify the region where your private key can be held locally for optimal TLS performance. HTTPS connections to any excluded data center will still be fully encrypted, but will incur some latency while Keyless SSL is used to complete the @@ -534,7 +488,9 @@ async def create( (https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements) can be chosen, such as 'country: IN', as well as 'region: EU' which refers to the EU region. If there are too few data centers satisfying the policy, it will - be rejected. + be rejected. Note: The API accepts this field as either "policy" or + "policy_restrictions" in requests. Responses return this field as + "policy_restrictions". example: "(country: US) or (region: EU)" type: The type 'legacy_custom' enables support for legacy clients which do not include SNI in the TLS handshake. @@ -556,6 +512,7 @@ async def create( "certificate": certificate, "private_key": private_key, "bundle_method": bundle_method, + "deploy": deploy, "geo_restrictions": geo_restrictions, "policy": policy, "type": type, @@ -683,13 +640,17 @@ async def delete( ), ) - @overload async def edit( self, custom_certificate_id: str, *, zone_id: str, bundle_method: BundleMethod | Omit = omit, + certificate: str | Omit = omit, + deploy: Literal["staging", "production"] | Omit = omit, + geo_restrictions: GeoRestrictionsParam | Omit = omit, + policy: str | Omit = omit, + private_key: str | 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, @@ -713,53 +674,9 @@ async def edit( the shortest chain and newest intermediates. And the force bundle verifies the chain, but does not otherwise modify it. - 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 - """ - ... - - @overload - async def edit( - self, - custom_certificate_id: str, - *, - zone_id: str, - certificate: str, - private_key: str, - bundle_method: BundleMethod | Omit = omit, - geo_restrictions: GeoRestrictionsParam | Omit = omit, - policy: str | 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, - ) -> Optional[CustomCertificate]: - """Upload a new private key and/or PEM/CRT for the SSL certificate. - - Note: PATCHing - a configuration for sni_custom certificates will result in a new resource id - being returned, and the previous one being deleted. - - Args: - zone_id: Identifier. - - custom_certificate_id: Identifier. - certificate: The zone's SSL certificate or certificate and the intermediate(s). - private_key: The zone's private key. - - bundle_method: A ubiquitous bundle has the highest probability of being verified everywhere, - even by clients using outdated or unusual trust stores. An optimal bundle uses - the shortest chain and newest intermediates. And the force bundle verifies the - chain, but does not otherwise modify it. + deploy: The environment to deploy the certificate to, defaults to production geo_restrictions: Specify the region where your private key can be held locally for optimal TLS performance. HTTPS connections to any excluded data center will still be fully @@ -777,7 +694,11 @@ async def edit( (https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements) can be chosen, such as 'country: IN', as well as 'region: EU' which refers to the EU region. If there are too few data centers satisfying the policy, it will - be rejected. + be rejected. Note: The API accepts this field as either "policy" or + "policy_restrictions" in requests. Responses return this field as + "policy_restrictions". example: "(country: US) or (region: EU)" + + private_key: The zone's private key. extra_headers: Send extra headers @@ -787,26 +708,6 @@ async def edit( timeout: Override the client-level default timeout for this request, in seconds """ - ... - - @required_args(["zone_id"], ["zone_id", "certificate", "private_key"]) - async def edit( - self, - custom_certificate_id: str, - *, - zone_id: str, - bundle_method: BundleMethod | Omit = omit, - certificate: str | Omit = omit, - private_key: str | Omit = omit, - geo_restrictions: GeoRestrictionsParam | Omit = omit, - policy: str | 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, - ) -> Optional[CustomCertificate]: if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") if not custom_certificate_id: @@ -819,9 +720,10 @@ async def edit( { "bundle_method": bundle_method, "certificate": certificate, - "private_key": private_key, + "deploy": deploy, "geo_restrictions": geo_restrictions, "policy": policy, + "private_key": private_key, }, custom_certificate_edit_params.CustomCertificateEditParams, ), diff --git a/src/cloudflare/resources/email_security/investigate/investigate.py b/src/cloudflare/resources/email_security/investigate/investigate.py index 4d937d99aa8..819279a8b67 100644 --- a/src/cloudflare/resources/email_security/investigate/investigate.py +++ b/src/cloudflare/resources/email_security/investigate/investigate.py @@ -175,7 +175,7 @@ def list( domain: The sender domains the search filters by. - end: The end of the search date range. Defaults to `now`. + end: The end of the search date range. Defaults to `now` if not provided. final_disposition: The dispositions the search filters by. @@ -210,7 +210,8 @@ def list( - x_originating_ip - Subject - start: The beginning of the search date range. Defaults to `now - 30 days`. + start: The beginning of the search date range. Defaults to `now - 30 days` if not + provided. extra_headers: Send extra headers @@ -392,7 +393,7 @@ def list( domain: The sender domains the search filters by. - end: The end of the search date range. Defaults to `now`. + end: The end of the search date range. Defaults to `now` if not provided. final_disposition: The dispositions the search filters by. @@ -427,7 +428,8 @@ def list( - x_originating_ip - Subject - start: The beginning of the search date range. Defaults to `now - 30 days`. + start: The beginning of the search date range. Defaults to `now - 30 days` if not + provided. extra_headers: Send extra headers diff --git a/src/cloudflare/resources/email_security/investigate/move.py b/src/cloudflare/resources/email_security/investigate/move.py index 489423e8a70..f4a2267332a 100644 --- a/src/cloudflare/resources/email_security/investigate/move.py +++ b/src/cloudflare/resources/email_security/investigate/move.py @@ -108,7 +108,7 @@ def bulk( timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SyncSinglePage[MoveBulkResponse]: """ - Maximum batch size: 100 messages per request + Maximum batch size: 1000 messages per request Args: account_id: Account Identifier @@ -229,7 +229,7 @@ def bulk( timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AsyncPaginator[MoveBulkResponse, AsyncSinglePage[MoveBulkResponse]]: """ - Maximum batch size: 100 messages per request + Maximum batch size: 1000 messages per request Args: account_id: Account Identifier diff --git a/src/cloudflare/resources/email_security/submissions.py b/src/cloudflare/resources/email_security/submissions.py index 4e8ff7ee97b..5eff9c1c234 100644 --- a/src/cloudflare/resources/email_security/submissions.py +++ b/src/cloudflare/resources/email_security/submissions.py @@ -74,13 +74,14 @@ def list( Args: account_id: Account Identifier - end: The end of the search date range. Defaults to `now`. + end: The end of the search date range. Defaults to `now` if not provided. page: The page number of paginated results. per_page: The number of results per page. - start: The beginning of the search date range. Defaults to `now - 30 days`. + start: The beginning of the search date range. Defaults to `now - 30 days` if not + provided. extra_headers: Send extra headers @@ -169,13 +170,14 @@ def list( Args: account_id: Account Identifier - end: The end of the search date range. Defaults to `now`. + end: The end of the search date range. Defaults to `now` if not provided. page: The page number of paginated results. per_page: The number of results per page. - start: The beginning of the search date range. Defaults to `now - 30 days`. + start: The beginning of the search date range. Defaults to `now - 30 days` if not + provided. extra_headers: Send extra headers diff --git a/src/cloudflare/resources/queues/consumers.py b/src/cloudflare/resources/queues/consumers.py index 3d1a696af75..8bd97a1f72d 100644 --- a/src/cloudflare/resources/queues/consumers.py +++ b/src/cloudflare/resources/queues/consumers.py @@ -21,8 +21,11 @@ from ...pagination import SyncSinglePage, AsyncSinglePage from ..._base_client import AsyncPaginator, make_request_options from ...types.queues import consumer_create_params, consumer_update_params -from ...types.queues.consumer import Consumer +from ...types.queues.consumer_get_response import ConsumerGetResponse +from ...types.queues.consumer_list_response import ConsumerListResponse +from ...types.queues.consumer_create_response import ConsumerCreateResponse from ...types.queues.consumer_delete_response import ConsumerDeleteResponse +from ...types.queues.consumer_update_response import ConsumerUpdateResponse __all__ = ["ConsumersResource", "AsyncConsumersResource"] @@ -53,17 +56,17 @@ def create( queue_id: str, *, account_id: str, + script_name: str, + type: Literal["worker"], dead_letter_queue: str | Omit = omit, - script_name: str | Omit = omit, - settings: consumer_create_params.MqWorkerConsumerSettings | Omit = omit, - type: Literal["worker"] | Omit = omit, + settings: consumer_create_params.MqWorkerConsumerRequestSettings | 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, - ) -> Optional[Consumer]: + ) -> Optional[ConsumerCreateResponse]: """ Creates a new consumer for a Queue @@ -90,16 +93,16 @@ def create( queue_id: str, *, account_id: str, + type: Literal["http_pull"], dead_letter_queue: str | Omit = omit, - settings: consumer_create_params.MqHTTPConsumerSettings | Omit = omit, - type: Literal["http_pull"] | Omit = omit, + settings: consumer_create_params.MqHTTPConsumerRequestSettings | 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, - ) -> Optional[Consumer]: + ) -> Optional[ConsumerCreateResponse]: """ Creates a new consumer for a Queue @@ -118,39 +121,39 @@ def create( """ ... - @required_args(["account_id"]) + @required_args(["account_id", "script_name", "type"], ["account_id", "type"]) def create( self, queue_id: str, *, account_id: str, - dead_letter_queue: str | Omit = omit, script_name: str | Omit = omit, - settings: consumer_create_params.MqWorkerConsumerSettings - | consumer_create_params.MqHTTPConsumerSettings + type: Literal["worker"] | Literal["http_pull"], + dead_letter_queue: str | Omit = omit, + settings: consumer_create_params.MqWorkerConsumerRequestSettings + | consumer_create_params.MqHTTPConsumerRequestSettings | Omit = omit, - type: Literal["worker"] | Literal["http_pull"] | 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, - ) -> Optional[Consumer]: + ) -> Optional[ConsumerCreateResponse]: 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 cast( - Optional[Consumer], + Optional[ConsumerCreateResponse], self._post( f"/accounts/{account_id}/queues/{queue_id}/consumers", body=maybe_transform( { - "dead_letter_queue": dead_letter_queue, "script_name": script_name, - "settings": settings, "type": type, + "dead_letter_queue": dead_letter_queue, + "settings": settings, }, consumer_create_params.ConsumerCreateParams, ), @@ -159,10 +162,10 @@ def create( extra_query=extra_query, extra_body=extra_body, timeout=timeout, - post_parser=ResultWrapper[Optional[Consumer]]._unwrapper, + post_parser=ResultWrapper[Optional[ConsumerCreateResponse]]._unwrapper, ), cast_to=cast( - Any, ResultWrapper[Consumer] + Any, ResultWrapper[ConsumerCreateResponse] ), # Union types cannot be passed in as arguments in the type system ), ) @@ -174,17 +177,17 @@ def update( *, account_id: str, queue_id: str, + script_name: str, + type: Literal["worker"], dead_letter_queue: str | Omit = omit, - script_name: str | Omit = omit, - settings: consumer_update_params.MqWorkerConsumerSettings | Omit = omit, - type: Literal["worker"] | Omit = omit, + settings: consumer_update_params.MqWorkerConsumerRequestSettings | 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, - ) -> Optional[Consumer]: + ) -> Optional[ConsumerUpdateResponse]: """ Updates the consumer for a queue, or creates one if it does not exist. @@ -214,16 +217,16 @@ def update( *, account_id: str, queue_id: str, + type: Literal["http_pull"], dead_letter_queue: str | Omit = omit, - settings: consumer_update_params.MqHTTPConsumerSettings | Omit = omit, - type: Literal["http_pull"] | Omit = omit, + settings: consumer_update_params.MqHTTPConsumerRequestSettings | 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, - ) -> Optional[Consumer]: + ) -> Optional[ConsumerUpdateResponse]: """ Updates the consumer for a queue, or creates one if it does not exist. @@ -244,26 +247,26 @@ def update( """ ... - @required_args(["account_id", "queue_id"]) + @required_args(["account_id", "queue_id", "script_name", "type"], ["account_id", "queue_id", "type"]) def update( self, consumer_id: str, *, account_id: str, queue_id: str, - dead_letter_queue: str | Omit = omit, script_name: str | Omit = omit, - settings: consumer_update_params.MqWorkerConsumerSettings - | consumer_update_params.MqHTTPConsumerSettings + type: Literal["worker"] | Literal["http_pull"], + dead_letter_queue: str | Omit = omit, + settings: consumer_update_params.MqWorkerConsumerRequestSettings + | consumer_update_params.MqHTTPConsumerRequestSettings | Omit = omit, - type: Literal["worker"] | Literal["http_pull"] | 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, - ) -> Optional[Consumer]: + ) -> Optional[ConsumerUpdateResponse]: if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not queue_id: @@ -271,15 +274,15 @@ def update( if not consumer_id: raise ValueError(f"Expected a non-empty value for `consumer_id` but received {consumer_id!r}") return cast( - Optional[Consumer], + Optional[ConsumerUpdateResponse], self._put( f"/accounts/{account_id}/queues/{queue_id}/consumers/{consumer_id}", body=maybe_transform( { - "dead_letter_queue": dead_letter_queue, "script_name": script_name, - "settings": settings, "type": type, + "dead_letter_queue": dead_letter_queue, + "settings": settings, }, consumer_update_params.ConsumerUpdateParams, ), @@ -288,10 +291,10 @@ def update( extra_query=extra_query, extra_body=extra_body, timeout=timeout, - post_parser=ResultWrapper[Optional[Consumer]]._unwrapper, + post_parser=ResultWrapper[Optional[ConsumerUpdateResponse]]._unwrapper, ), cast_to=cast( - Any, ResultWrapper[Consumer] + Any, ResultWrapper[ConsumerUpdateResponse] ), # Union types cannot be passed in as arguments in the type system ), ) @@ -307,7 +310,7 @@ def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, - ) -> SyncSinglePage[Consumer]: + ) -> SyncSinglePage[ConsumerListResponse]: """ Returns the consumers for a Queue @@ -330,11 +333,11 @@ def list( raise ValueError(f"Expected a non-empty value for `queue_id` but received {queue_id!r}") return self._get_api_list( f"/accounts/{account_id}/queues/{queue_id}/consumers", - page=SyncSinglePage[Consumer], + page=SyncSinglePage[ConsumerListResponse], options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - model=cast(Any, Consumer), # Union types cannot be passed in as arguments in the type system + model=cast(Any, ConsumerListResponse), # Union types cannot be passed in as arguments in the type system ) def delete( @@ -394,7 +397,7 @@ def get( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, - ) -> Optional[Consumer]: + ) -> Optional[ConsumerGetResponse]: """ Fetches the consumer for a queue by consumer id @@ -420,7 +423,7 @@ def get( if not consumer_id: raise ValueError(f"Expected a non-empty value for `consumer_id` but received {consumer_id!r}") return cast( - Optional[Consumer], + Optional[ConsumerGetResponse], self._get( f"/accounts/{account_id}/queues/{queue_id}/consumers/{consumer_id}", options=make_request_options( @@ -428,10 +431,10 @@ def get( extra_query=extra_query, extra_body=extra_body, timeout=timeout, - post_parser=ResultWrapper[Optional[Consumer]]._unwrapper, + post_parser=ResultWrapper[Optional[ConsumerGetResponse]]._unwrapper, ), cast_to=cast( - Any, ResultWrapper[Consumer] + Any, ResultWrapper[ConsumerGetResponse] ), # Union types cannot be passed in as arguments in the type system ), ) @@ -463,17 +466,17 @@ async def create( queue_id: str, *, account_id: str, + script_name: str, + type: Literal["worker"], dead_letter_queue: str | Omit = omit, - script_name: str | Omit = omit, - settings: consumer_create_params.MqWorkerConsumerSettings | Omit = omit, - type: Literal["worker"] | Omit = omit, + settings: consumer_create_params.MqWorkerConsumerRequestSettings | 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, - ) -> Optional[Consumer]: + ) -> Optional[ConsumerCreateResponse]: """ Creates a new consumer for a Queue @@ -500,16 +503,16 @@ async def create( queue_id: str, *, account_id: str, + type: Literal["http_pull"], dead_letter_queue: str | Omit = omit, - settings: consumer_create_params.MqHTTPConsumerSettings | Omit = omit, - type: Literal["http_pull"] | Omit = omit, + settings: consumer_create_params.MqHTTPConsumerRequestSettings | 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, - ) -> Optional[Consumer]: + ) -> Optional[ConsumerCreateResponse]: """ Creates a new consumer for a Queue @@ -528,39 +531,39 @@ async def create( """ ... - @required_args(["account_id"]) + @required_args(["account_id", "script_name", "type"], ["account_id", "type"]) async def create( self, queue_id: str, *, account_id: str, - dead_letter_queue: str | Omit = omit, script_name: str | Omit = omit, - settings: consumer_create_params.MqWorkerConsumerSettings - | consumer_create_params.MqHTTPConsumerSettings + type: Literal["worker"] | Literal["http_pull"], + dead_letter_queue: str | Omit = omit, + settings: consumer_create_params.MqWorkerConsumerRequestSettings + | consumer_create_params.MqHTTPConsumerRequestSettings | Omit = omit, - type: Literal["worker"] | Literal["http_pull"] | 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, - ) -> Optional[Consumer]: + ) -> Optional[ConsumerCreateResponse]: 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 cast( - Optional[Consumer], + Optional[ConsumerCreateResponse], await self._post( f"/accounts/{account_id}/queues/{queue_id}/consumers", body=await async_maybe_transform( { - "dead_letter_queue": dead_letter_queue, "script_name": script_name, - "settings": settings, "type": type, + "dead_letter_queue": dead_letter_queue, + "settings": settings, }, consumer_create_params.ConsumerCreateParams, ), @@ -569,10 +572,10 @@ async def create( extra_query=extra_query, extra_body=extra_body, timeout=timeout, - post_parser=ResultWrapper[Optional[Consumer]]._unwrapper, + post_parser=ResultWrapper[Optional[ConsumerCreateResponse]]._unwrapper, ), cast_to=cast( - Any, ResultWrapper[Consumer] + Any, ResultWrapper[ConsumerCreateResponse] ), # Union types cannot be passed in as arguments in the type system ), ) @@ -584,17 +587,17 @@ async def update( *, account_id: str, queue_id: str, + script_name: str, + type: Literal["worker"], dead_letter_queue: str | Omit = omit, - script_name: str | Omit = omit, - settings: consumer_update_params.MqWorkerConsumerSettings | Omit = omit, - type: Literal["worker"] | Omit = omit, + settings: consumer_update_params.MqWorkerConsumerRequestSettings | 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, - ) -> Optional[Consumer]: + ) -> Optional[ConsumerUpdateResponse]: """ Updates the consumer for a queue, or creates one if it does not exist. @@ -624,16 +627,16 @@ async def update( *, account_id: str, queue_id: str, + type: Literal["http_pull"], dead_letter_queue: str | Omit = omit, - settings: consumer_update_params.MqHTTPConsumerSettings | Omit = omit, - type: Literal["http_pull"] | Omit = omit, + settings: consumer_update_params.MqHTTPConsumerRequestSettings | 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, - ) -> Optional[Consumer]: + ) -> Optional[ConsumerUpdateResponse]: """ Updates the consumer for a queue, or creates one if it does not exist. @@ -654,26 +657,26 @@ async def update( """ ... - @required_args(["account_id", "queue_id"]) + @required_args(["account_id", "queue_id", "script_name", "type"], ["account_id", "queue_id", "type"]) async def update( self, consumer_id: str, *, account_id: str, queue_id: str, - dead_letter_queue: str | Omit = omit, script_name: str | Omit = omit, - settings: consumer_update_params.MqWorkerConsumerSettings - | consumer_update_params.MqHTTPConsumerSettings + type: Literal["worker"] | Literal["http_pull"], + dead_letter_queue: str | Omit = omit, + settings: consumer_update_params.MqWorkerConsumerRequestSettings + | consumer_update_params.MqHTTPConsumerRequestSettings | Omit = omit, - type: Literal["worker"] | Literal["http_pull"] | 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, - ) -> Optional[Consumer]: + ) -> Optional[ConsumerUpdateResponse]: if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not queue_id: @@ -681,15 +684,15 @@ async def update( if not consumer_id: raise ValueError(f"Expected a non-empty value for `consumer_id` but received {consumer_id!r}") return cast( - Optional[Consumer], + Optional[ConsumerUpdateResponse], await self._put( f"/accounts/{account_id}/queues/{queue_id}/consumers/{consumer_id}", body=await async_maybe_transform( { - "dead_letter_queue": dead_letter_queue, "script_name": script_name, - "settings": settings, "type": type, + "dead_letter_queue": dead_letter_queue, + "settings": settings, }, consumer_update_params.ConsumerUpdateParams, ), @@ -698,10 +701,10 @@ async def update( extra_query=extra_query, extra_body=extra_body, timeout=timeout, - post_parser=ResultWrapper[Optional[Consumer]]._unwrapper, + post_parser=ResultWrapper[Optional[ConsumerUpdateResponse]]._unwrapper, ), cast_to=cast( - Any, ResultWrapper[Consumer] + Any, ResultWrapper[ConsumerUpdateResponse] ), # Union types cannot be passed in as arguments in the type system ), ) @@ -717,7 +720,7 @@ def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, - ) -> AsyncPaginator[Consumer, AsyncSinglePage[Consumer]]: + ) -> AsyncPaginator[ConsumerListResponse, AsyncSinglePage[ConsumerListResponse]]: """ Returns the consumers for a Queue @@ -740,11 +743,11 @@ def list( raise ValueError(f"Expected a non-empty value for `queue_id` but received {queue_id!r}") return self._get_api_list( f"/accounts/{account_id}/queues/{queue_id}/consumers", - page=AsyncSinglePage[Consumer], + page=AsyncSinglePage[ConsumerListResponse], options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - model=cast(Any, Consumer), # Union types cannot be passed in as arguments in the type system + model=cast(Any, ConsumerListResponse), # Union types cannot be passed in as arguments in the type system ) async def delete( @@ -804,7 +807,7 @@ async def get( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, - ) -> Optional[Consumer]: + ) -> Optional[ConsumerGetResponse]: """ Fetches the consumer for a queue by consumer id @@ -830,7 +833,7 @@ async def get( if not consumer_id: raise ValueError(f"Expected a non-empty value for `consumer_id` but received {consumer_id!r}") return cast( - Optional[Consumer], + Optional[ConsumerGetResponse], await self._get( f"/accounts/{account_id}/queues/{queue_id}/consumers/{consumer_id}", options=make_request_options( @@ -838,10 +841,10 @@ async def get( extra_query=extra_query, extra_body=extra_body, timeout=timeout, - post_parser=ResultWrapper[Optional[Consumer]]._unwrapper, + post_parser=ResultWrapper[Optional[ConsumerGetResponse]]._unwrapper, ), cast_to=cast( - Any, ResultWrapper[Consumer] + Any, ResultWrapper[ConsumerGetResponse] ), # Union types cannot be passed in as arguments in the type system ), ) diff --git a/src/cloudflare/resources/r2/super_slurper/connectivity_precheck.py b/src/cloudflare/resources/r2/super_slurper/connectivity_precheck.py index 2ea1083ea6f..9c06a8df785 100644 --- a/src/cloudflare/resources/r2/super_slurper/connectivity_precheck.py +++ b/src/cloudflare/resources/r2/super_slurper/connectivity_precheck.py @@ -7,7 +7,7 @@ import httpx -from ...._types import Body, Omit, Query, Headers, NotGiven, omit, not_given +from ...._types import Body, Omit, Query, Headers, NotGiven, SequenceNotStr, omit, not_given from ...._utils import required_args, maybe_transform, async_maybe_transform from ...._compat import cached_property from ...._resource import SyncAPIResource, AsyncAPIResource @@ -57,6 +57,7 @@ def source( secret: connectivity_precheck_source_params.R2SlurperS3SourceSchemaSecret, vendor: Literal["s3"], endpoint: Optional[str] | Omit = omit, + keys: Optional[SequenceNotStr[str]] | Omit = omit, path_prefix: Optional[str] | Omit = omit, region: Optional[str] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -88,6 +89,7 @@ def source( bucket: str, secret: connectivity_precheck_source_params.R2SlurperGcsSourceSchemaSecret, vendor: Literal["gcs"], + keys: Optional[SequenceNotStr[str]] | Omit = omit, path_prefix: Optional[str] | 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. @@ -119,6 +121,7 @@ def source( secret: connectivity_precheck_source_params.R2SlurperR2SourceSchemaSecret, vendor: Provider, jurisdiction: Literal["default", "eu", "fedramp"] | Omit = omit, + keys: Optional[SequenceNotStr[str]] | Omit = omit, path_prefix: Optional[str] | 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. @@ -152,6 +155,7 @@ def source( | connectivity_precheck_source_params.R2SlurperR2SourceSchemaSecret, vendor: Literal["s3"] | Literal["gcs"] | Provider, endpoint: Optional[str] | Omit = omit, + keys: Optional[SequenceNotStr[str]] | Omit = omit, path_prefix: Optional[str] | Omit = omit, region: Optional[str] | Omit = omit, jurisdiction: Literal["default", "eu", "fedramp"] | Omit = omit, @@ -172,6 +176,7 @@ def source( "secret": secret, "vendor": vendor, "endpoint": endpoint, + "keys": keys, "path_prefix": path_prefix, "region": region, "jurisdiction": jurisdiction, @@ -272,6 +277,7 @@ async def source( secret: connectivity_precheck_source_params.R2SlurperS3SourceSchemaSecret, vendor: Literal["s3"], endpoint: Optional[str] | Omit = omit, + keys: Optional[SequenceNotStr[str]] | Omit = omit, path_prefix: Optional[str] | Omit = omit, region: Optional[str] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -303,6 +309,7 @@ async def source( bucket: str, secret: connectivity_precheck_source_params.R2SlurperGcsSourceSchemaSecret, vendor: Literal["gcs"], + keys: Optional[SequenceNotStr[str]] | Omit = omit, path_prefix: Optional[str] | 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. @@ -334,6 +341,7 @@ async def source( secret: connectivity_precheck_source_params.R2SlurperR2SourceSchemaSecret, vendor: Provider, jurisdiction: Literal["default", "eu", "fedramp"] | Omit = omit, + keys: Optional[SequenceNotStr[str]] | Omit = omit, path_prefix: Optional[str] | 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. @@ -367,6 +375,7 @@ async def source( | connectivity_precheck_source_params.R2SlurperR2SourceSchemaSecret, vendor: Literal["s3"] | Literal["gcs"] | Provider, endpoint: Optional[str] | Omit = omit, + keys: Optional[SequenceNotStr[str]] | Omit = omit, path_prefix: Optional[str] | Omit = omit, region: Optional[str] | Omit = omit, jurisdiction: Literal["default", "eu", "fedramp"] | Omit = omit, @@ -387,6 +396,7 @@ async def source( "secret": secret, "vendor": vendor, "endpoint": endpoint, + "keys": keys, "path_prefix": path_prefix, "region": region, "jurisdiction": jurisdiction, diff --git a/src/cloudflare/resources/radar/ai/bots/bots.py b/src/cloudflare/resources/radar/ai/bots/bots.py index 71be23206f2..b6568fdd877 100644 --- a/src/cloudflare/resources/radar/ai/bots/bots.py +++ b/src/cloudflare/resources/radar/ai/bots/bots.py @@ -2,7 +2,7 @@ from __future__ import annotations -from typing import Type, Union, cast +from typing import List, Type, Union, cast from datetime import datetime from typing_extensions import Literal @@ -62,9 +62,30 @@ def with_streaming_response(self) -> BotsResourceWithStreamingResponse: def summary_v2( self, - dimension: Literal["USER_AGENT", "CRAWL_PURPOSE", "INDUSTRY", "VERTICAL"], + dimension: Literal["USER_AGENT", "CRAWL_PURPOSE", "INDUSTRY", "VERTICAL", "CONTENT_TYPE"], *, asn: SequenceNotStr[str] | Omit = omit, + content_type: List[ + Literal[ + "HTML", + "IMAGES", + "JSON", + "JAVASCRIPT", + "CSS", + "PLAIN_TEXT", + "FONTS", + "XML", + "YAML", + "VIDEO", + "AUDIO", + "MARKDOWN", + "DOCUMENTS", + "BINARY", + "SERIALIZATION", + "OTHER", + ] + ] + | Omit = omit, continent: SequenceNotStr[str] | Omit = omit, crawl_purpose: SequenceNotStr[str] | Omit = omit, date_end: SequenceNotStr[Union[str, datetime]] | Omit = omit, @@ -75,6 +96,7 @@ def summary_v2( limit_per_group: int | Omit = omit, location: SequenceNotStr[str] | Omit = omit, name: SequenceNotStr[str] | Omit = omit, + user_agent: SequenceNotStr[str] | Omit = omit, vertical: SequenceNotStr[str] | 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. @@ -95,6 +117,8 @@ def summary_v2( results. For example, `-174, 3356` excludes results from AS174, but includes results from AS3356. + content_type: Filters results by content type category. + continent: Filters results by continent. Specify a comma-separated list of alpha-2 codes. Prefix with `-` to exclude continents from results. For example, `-EU,NA` excludes results from EU, but includes results from NA. @@ -123,6 +147,8 @@ def summary_v2( name: Array of names used to label the series in the response. + user_agent: Filters results by user agent. + vertical: Filters results by vertical. extra_headers: Send extra headers @@ -145,6 +171,7 @@ def summary_v2( query=maybe_transform( { "asn": asn, + "content_type": content_type, "continent": continent, "crawl_purpose": crawl_purpose, "date_end": date_end, @@ -155,6 +182,7 @@ def summary_v2( "limit_per_group": limit_per_group, "location": location, "name": name, + "user_agent": user_agent, "vertical": vertical, }, bot_summary_v2_params.BotSummaryV2Params, @@ -169,6 +197,27 @@ def timeseries( *, agg_interval: Literal["15m", "1h", "1d", "1w"] | Omit = omit, asn: SequenceNotStr[str] | Omit = omit, + content_type: List[ + Literal[ + "HTML", + "IMAGES", + "JSON", + "JAVASCRIPT", + "CSS", + "PLAIN_TEXT", + "FONTS", + "XML", + "YAML", + "VIDEO", + "AUDIO", + "MARKDOWN", + "DOCUMENTS", + "BINARY", + "SERIALIZATION", + "OTHER", + ] + ] + | Omit = omit, continent: SequenceNotStr[str] | Omit = omit, crawl_purpose: SequenceNotStr[str] | Omit = omit, date_end: SequenceNotStr[Union[str, datetime]] | Omit = omit, @@ -201,6 +250,8 @@ def timeseries( results. For example, `-174, 3356` excludes results from AS174, but includes results from AS3356. + content_type: Filters results by content type category. + continent: Filters results by continent. Specify a comma-separated list of alpha-2 codes. Prefix with `-` to exclude continents from results. For example, `-EU,NA` excludes results from EU, but includes results from NA. @@ -252,6 +303,7 @@ def timeseries( { "agg_interval": agg_interval, "asn": asn, + "content_type": content_type, "continent": continent, "crawl_purpose": crawl_purpose, "date_end": date_end, @@ -274,10 +326,31 @@ def timeseries( def timeseries_groups( self, - dimension: Literal["USER_AGENT", "CRAWL_PURPOSE", "INDUSTRY", "VERTICAL"], + dimension: Literal["USER_AGENT", "CRAWL_PURPOSE", "INDUSTRY", "VERTICAL", "CONTENT_TYPE"], *, agg_interval: Literal["15m", "1h", "1d", "1w"] | Omit = omit, asn: SequenceNotStr[str] | Omit = omit, + content_type: List[ + Literal[ + "HTML", + "IMAGES", + "JSON", + "JAVASCRIPT", + "CSS", + "PLAIN_TEXT", + "FONTS", + "XML", + "YAML", + "VIDEO", + "AUDIO", + "MARKDOWN", + "DOCUMENTS", + "BINARY", + "SERIALIZATION", + "OTHER", + ] + ] + | Omit = omit, continent: SequenceNotStr[str] | Omit = omit, crawl_purpose: SequenceNotStr[str] | Omit = omit, date_end: SequenceNotStr[Union[str, datetime]] | Omit = omit, @@ -288,7 +361,8 @@ def timeseries_groups( limit_per_group: int | Omit = omit, location: SequenceNotStr[str] | Omit = omit, name: SequenceNotStr[str] | Omit = omit, - normalization: Literal["PERCENTAGE_CHANGE", "MIN0_MAX"] | Omit = omit, + normalization: Literal["PERCENTAGE", "MIN0_MAX"] | Omit = omit, + user_agent: SequenceNotStr[str] | Omit = omit, vertical: SequenceNotStr[str] | 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. @@ -298,7 +372,7 @@ def timeseries_groups( timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> BotTimeseriesGroupsResponse: """ - Retrieves the distribution of HTTP requests from AI bots, grouped by chosen the + Retrieves the distribution of HTTP requests from AI bots, grouped by the specified dimension over time. Args: @@ -313,6 +387,8 @@ def timeseries_groups( results. For example, `-174, 3356` excludes results from AS174, but includes results from AS3356. + content_type: Filters results by content type category. + continent: Filters results by continent. Specify a comma-separated list of alpha-2 codes. Prefix with `-` to exclude continents from results. For example, `-EU,NA` excludes results from EU, but includes results from NA. @@ -344,6 +420,8 @@ def timeseries_groups( normalization: Normalization method applied to the results. Refer to [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/). + user_agent: Filters results by user agent. + vertical: Filters results by vertical. extra_headers: Send extra headers @@ -367,6 +445,7 @@ def timeseries_groups( { "agg_interval": agg_interval, "asn": asn, + "content_type": content_type, "continent": continent, "crawl_purpose": crawl_purpose, "date_end": date_end, @@ -378,6 +457,7 @@ def timeseries_groups( "location": location, "name": name, "normalization": normalization, + "user_agent": user_agent, "vertical": vertical, }, bot_timeseries_groups_params.BotTimeseriesGroupsParams, @@ -414,9 +494,30 @@ def with_streaming_response(self) -> AsyncBotsResourceWithStreamingResponse: async def summary_v2( self, - dimension: Literal["USER_AGENT", "CRAWL_PURPOSE", "INDUSTRY", "VERTICAL"], + dimension: Literal["USER_AGENT", "CRAWL_PURPOSE", "INDUSTRY", "VERTICAL", "CONTENT_TYPE"], *, asn: SequenceNotStr[str] | Omit = omit, + content_type: List[ + Literal[ + "HTML", + "IMAGES", + "JSON", + "JAVASCRIPT", + "CSS", + "PLAIN_TEXT", + "FONTS", + "XML", + "YAML", + "VIDEO", + "AUDIO", + "MARKDOWN", + "DOCUMENTS", + "BINARY", + "SERIALIZATION", + "OTHER", + ] + ] + | Omit = omit, continent: SequenceNotStr[str] | Omit = omit, crawl_purpose: SequenceNotStr[str] | Omit = omit, date_end: SequenceNotStr[Union[str, datetime]] | Omit = omit, @@ -427,6 +528,7 @@ async def summary_v2( limit_per_group: int | Omit = omit, location: SequenceNotStr[str] | Omit = omit, name: SequenceNotStr[str] | Omit = omit, + user_agent: SequenceNotStr[str] | Omit = omit, vertical: SequenceNotStr[str] | 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. @@ -447,6 +549,8 @@ async def summary_v2( results. For example, `-174, 3356` excludes results from AS174, but includes results from AS3356. + content_type: Filters results by content type category. + continent: Filters results by continent. Specify a comma-separated list of alpha-2 codes. Prefix with `-` to exclude continents from results. For example, `-EU,NA` excludes results from EU, but includes results from NA. @@ -475,6 +579,8 @@ async def summary_v2( name: Array of names used to label the series in the response. + user_agent: Filters results by user agent. + vertical: Filters results by vertical. extra_headers: Send extra headers @@ -497,6 +603,7 @@ async def summary_v2( query=await async_maybe_transform( { "asn": asn, + "content_type": content_type, "continent": continent, "crawl_purpose": crawl_purpose, "date_end": date_end, @@ -507,6 +614,7 @@ async def summary_v2( "limit_per_group": limit_per_group, "location": location, "name": name, + "user_agent": user_agent, "vertical": vertical, }, bot_summary_v2_params.BotSummaryV2Params, @@ -521,6 +629,27 @@ async def timeseries( *, agg_interval: Literal["15m", "1h", "1d", "1w"] | Omit = omit, asn: SequenceNotStr[str] | Omit = omit, + content_type: List[ + Literal[ + "HTML", + "IMAGES", + "JSON", + "JAVASCRIPT", + "CSS", + "PLAIN_TEXT", + "FONTS", + "XML", + "YAML", + "VIDEO", + "AUDIO", + "MARKDOWN", + "DOCUMENTS", + "BINARY", + "SERIALIZATION", + "OTHER", + ] + ] + | Omit = omit, continent: SequenceNotStr[str] | Omit = omit, crawl_purpose: SequenceNotStr[str] | Omit = omit, date_end: SequenceNotStr[Union[str, datetime]] | Omit = omit, @@ -553,6 +682,8 @@ async def timeseries( results. For example, `-174, 3356` excludes results from AS174, but includes results from AS3356. + content_type: Filters results by content type category. + continent: Filters results by continent. Specify a comma-separated list of alpha-2 codes. Prefix with `-` to exclude continents from results. For example, `-EU,NA` excludes results from EU, but includes results from NA. @@ -604,6 +735,7 @@ async def timeseries( { "agg_interval": agg_interval, "asn": asn, + "content_type": content_type, "continent": continent, "crawl_purpose": crawl_purpose, "date_end": date_end, @@ -626,10 +758,31 @@ async def timeseries( async def timeseries_groups( self, - dimension: Literal["USER_AGENT", "CRAWL_PURPOSE", "INDUSTRY", "VERTICAL"], + dimension: Literal["USER_AGENT", "CRAWL_PURPOSE", "INDUSTRY", "VERTICAL", "CONTENT_TYPE"], *, agg_interval: Literal["15m", "1h", "1d", "1w"] | Omit = omit, asn: SequenceNotStr[str] | Omit = omit, + content_type: List[ + Literal[ + "HTML", + "IMAGES", + "JSON", + "JAVASCRIPT", + "CSS", + "PLAIN_TEXT", + "FONTS", + "XML", + "YAML", + "VIDEO", + "AUDIO", + "MARKDOWN", + "DOCUMENTS", + "BINARY", + "SERIALIZATION", + "OTHER", + ] + ] + | Omit = omit, continent: SequenceNotStr[str] | Omit = omit, crawl_purpose: SequenceNotStr[str] | Omit = omit, date_end: SequenceNotStr[Union[str, datetime]] | Omit = omit, @@ -640,7 +793,8 @@ async def timeseries_groups( limit_per_group: int | Omit = omit, location: SequenceNotStr[str] | Omit = omit, name: SequenceNotStr[str] | Omit = omit, - normalization: Literal["PERCENTAGE_CHANGE", "MIN0_MAX"] | Omit = omit, + normalization: Literal["PERCENTAGE", "MIN0_MAX"] | Omit = omit, + user_agent: SequenceNotStr[str] | Omit = omit, vertical: SequenceNotStr[str] | 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. @@ -650,7 +804,7 @@ async def timeseries_groups( timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> BotTimeseriesGroupsResponse: """ - Retrieves the distribution of HTTP requests from AI bots, grouped by chosen the + Retrieves the distribution of HTTP requests from AI bots, grouped by the specified dimension over time. Args: @@ -665,6 +819,8 @@ async def timeseries_groups( results. For example, `-174, 3356` excludes results from AS174, but includes results from AS3356. + content_type: Filters results by content type category. + continent: Filters results by continent. Specify a comma-separated list of alpha-2 codes. Prefix with `-` to exclude continents from results. For example, `-EU,NA` excludes results from EU, but includes results from NA. @@ -696,6 +852,8 @@ async def timeseries_groups( normalization: Normalization method applied to the results. Refer to [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/). + user_agent: Filters results by user agent. + vertical: Filters results by vertical. extra_headers: Send extra headers @@ -719,6 +877,7 @@ async def timeseries_groups( { "agg_interval": agg_interval, "asn": asn, + "content_type": content_type, "continent": continent, "crawl_purpose": crawl_purpose, "date_end": date_end, @@ -730,6 +889,7 @@ async def timeseries_groups( "location": location, "name": name, "normalization": normalization, + "user_agent": user_agent, "vertical": vertical, }, bot_timeseries_groups_params.BotTimeseriesGroupsParams, diff --git a/src/cloudflare/resources/radar/ai/timeseries_groups.py b/src/cloudflare/resources/radar/ai/timeseries_groups.py index b956cf33749..b7165e971cb 100644 --- a/src/cloudflare/resources/radar/ai/timeseries_groups.py +++ b/src/cloudflare/resources/radar/ai/timeseries_groups.py @@ -3,7 +3,7 @@ from __future__ import annotations import typing_extensions -from typing import Type, Union, cast +from typing import List, Type, Union, cast from datetime import datetime from typing_extensions import Literal @@ -60,9 +60,30 @@ def with_streaming_response(self) -> TimeseriesGroupsResourceWithStreamingRespon ) def summary( self, - dimension: Literal["USER_AGENT", "CRAWL_PURPOSE", "INDUSTRY", "VERTICAL"], + dimension: Literal["USER_AGENT", "CRAWL_PURPOSE", "INDUSTRY", "VERTICAL", "CONTENT_TYPE"], *, asn: SequenceNotStr[str] | Omit = omit, + content_type: List[ + Literal[ + "HTML", + "IMAGES", + "JSON", + "JAVASCRIPT", + "CSS", + "PLAIN_TEXT", + "FONTS", + "XML", + "YAML", + "VIDEO", + "AUDIO", + "MARKDOWN", + "DOCUMENTS", + "BINARY", + "SERIALIZATION", + "OTHER", + ] + ] + | Omit = omit, continent: SequenceNotStr[str] | Omit = omit, crawl_purpose: SequenceNotStr[str] | Omit = omit, date_end: SequenceNotStr[Union[str, datetime]] | Omit = omit, @@ -73,6 +94,7 @@ def summary( limit_per_group: int | Omit = omit, location: SequenceNotStr[str] | Omit = omit, name: SequenceNotStr[str] | Omit = omit, + user_agent: SequenceNotStr[str] | Omit = omit, vertical: SequenceNotStr[str] | 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. @@ -93,6 +115,8 @@ def summary( results. For example, `-174, 3356` excludes results from AS174, but includes results from AS3356. + content_type: Filters results by content type category. + continent: Filters results by continent. Specify a comma-separated list of alpha-2 codes. Prefix with `-` to exclude continents from results. For example, `-EU,NA` excludes results from EU, but includes results from NA. @@ -121,6 +145,8 @@ def summary( name: Array of names used to label the series in the response. + user_agent: Filters results by user agent. + vertical: Filters results by vertical. extra_headers: Send extra headers @@ -143,6 +169,7 @@ def summary( query=maybe_transform( { "asn": asn, + "content_type": content_type, "continent": continent, "crawl_purpose": crawl_purpose, "date_end": date_end, @@ -153,6 +180,7 @@ def summary( "limit_per_group": limit_per_group, "location": location, "name": name, + "user_agent": user_agent, "vertical": vertical, }, timeseries_group_summary_params.TimeseriesGroupSummaryParams, @@ -170,6 +198,27 @@ def timeseries( *, agg_interval: Literal["15m", "1h", "1d", "1w"] | Omit = omit, asn: SequenceNotStr[str] | Omit = omit, + content_type: List[ + Literal[ + "HTML", + "IMAGES", + "JSON", + "JAVASCRIPT", + "CSS", + "PLAIN_TEXT", + "FONTS", + "XML", + "YAML", + "VIDEO", + "AUDIO", + "MARKDOWN", + "DOCUMENTS", + "BINARY", + "SERIALIZATION", + "OTHER", + ] + ] + | Omit = omit, continent: SequenceNotStr[str] | Omit = omit, crawl_purpose: SequenceNotStr[str] | Omit = omit, date_end: SequenceNotStr[Union[str, datetime]] | Omit = omit, @@ -202,6 +251,8 @@ def timeseries( results. For example, `-174, 3356` excludes results from AS174, but includes results from AS3356. + content_type: Filters results by content type category. + continent: Filters results by continent. Specify a comma-separated list of alpha-2 codes. Prefix with `-` to exclude continents from results. For example, `-EU,NA` excludes results from EU, but includes results from NA. @@ -253,6 +304,7 @@ def timeseries( { "agg_interval": agg_interval, "asn": asn, + "content_type": content_type, "continent": continent, "crawl_purpose": crawl_purpose, "date_end": date_end, @@ -278,10 +330,31 @@ def timeseries( ) def timeseries_groups( self, - dimension: Literal["USER_AGENT", "CRAWL_PURPOSE", "INDUSTRY", "VERTICAL"], + dimension: Literal["USER_AGENT", "CRAWL_PURPOSE", "INDUSTRY", "VERTICAL", "CONTENT_TYPE"], *, agg_interval: Literal["15m", "1h", "1d", "1w"] | Omit = omit, asn: SequenceNotStr[str] | Omit = omit, + content_type: List[ + Literal[ + "HTML", + "IMAGES", + "JSON", + "JAVASCRIPT", + "CSS", + "PLAIN_TEXT", + "FONTS", + "XML", + "YAML", + "VIDEO", + "AUDIO", + "MARKDOWN", + "DOCUMENTS", + "BINARY", + "SERIALIZATION", + "OTHER", + ] + ] + | Omit = omit, continent: SequenceNotStr[str] | Omit = omit, crawl_purpose: SequenceNotStr[str] | Omit = omit, date_end: SequenceNotStr[Union[str, datetime]] | Omit = omit, @@ -292,7 +365,8 @@ def timeseries_groups( limit_per_group: int | Omit = omit, location: SequenceNotStr[str] | Omit = omit, name: SequenceNotStr[str] | Omit = omit, - normalization: Literal["PERCENTAGE_CHANGE", "MIN0_MAX"] | Omit = omit, + normalization: Literal["PERCENTAGE", "MIN0_MAX"] | Omit = omit, + user_agent: SequenceNotStr[str] | Omit = omit, vertical: SequenceNotStr[str] | 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. @@ -302,7 +376,7 @@ def timeseries_groups( timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> TimeseriesGroupTimeseriesGroupsResponse: """ - Retrieves the distribution of HTTP requests from AI bots, grouped by chosen the + Retrieves the distribution of HTTP requests from AI bots, grouped by the specified dimension over time. Args: @@ -317,6 +391,8 @@ def timeseries_groups( results. For example, `-174, 3356` excludes results from AS174, but includes results from AS3356. + content_type: Filters results by content type category. + continent: Filters results by continent. Specify a comma-separated list of alpha-2 codes. Prefix with `-` to exclude continents from results. For example, `-EU,NA` excludes results from EU, but includes results from NA. @@ -348,6 +424,8 @@ def timeseries_groups( normalization: Normalization method applied to the results. Refer to [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/). + user_agent: Filters results by user agent. + vertical: Filters results by vertical. extra_headers: Send extra headers @@ -371,6 +449,7 @@ def timeseries_groups( { "agg_interval": agg_interval, "asn": asn, + "content_type": content_type, "continent": continent, "crawl_purpose": crawl_purpose, "date_end": date_end, @@ -382,6 +461,7 @@ def timeseries_groups( "location": location, "name": name, "normalization": normalization, + "user_agent": user_agent, "vertical": vertical, }, timeseries_group_timeseries_groups_params.TimeseriesGroupTimeseriesGroupsParams, @@ -514,9 +594,30 @@ def with_streaming_response(self) -> AsyncTimeseriesGroupsResourceWithStreamingR ) async def summary( self, - dimension: Literal["USER_AGENT", "CRAWL_PURPOSE", "INDUSTRY", "VERTICAL"], + dimension: Literal["USER_AGENT", "CRAWL_PURPOSE", "INDUSTRY", "VERTICAL", "CONTENT_TYPE"], *, asn: SequenceNotStr[str] | Omit = omit, + content_type: List[ + Literal[ + "HTML", + "IMAGES", + "JSON", + "JAVASCRIPT", + "CSS", + "PLAIN_TEXT", + "FONTS", + "XML", + "YAML", + "VIDEO", + "AUDIO", + "MARKDOWN", + "DOCUMENTS", + "BINARY", + "SERIALIZATION", + "OTHER", + ] + ] + | Omit = omit, continent: SequenceNotStr[str] | Omit = omit, crawl_purpose: SequenceNotStr[str] | Omit = omit, date_end: SequenceNotStr[Union[str, datetime]] | Omit = omit, @@ -527,6 +628,7 @@ async def summary( limit_per_group: int | Omit = omit, location: SequenceNotStr[str] | Omit = omit, name: SequenceNotStr[str] | Omit = omit, + user_agent: SequenceNotStr[str] | Omit = omit, vertical: SequenceNotStr[str] | 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. @@ -547,6 +649,8 @@ async def summary( results. For example, `-174, 3356` excludes results from AS174, but includes results from AS3356. + content_type: Filters results by content type category. + continent: Filters results by continent. Specify a comma-separated list of alpha-2 codes. Prefix with `-` to exclude continents from results. For example, `-EU,NA` excludes results from EU, but includes results from NA. @@ -575,6 +679,8 @@ async def summary( name: Array of names used to label the series in the response. + user_agent: Filters results by user agent. + vertical: Filters results by vertical. extra_headers: Send extra headers @@ -597,6 +703,7 @@ async def summary( query=await async_maybe_transform( { "asn": asn, + "content_type": content_type, "continent": continent, "crawl_purpose": crawl_purpose, "date_end": date_end, @@ -607,6 +714,7 @@ async def summary( "limit_per_group": limit_per_group, "location": location, "name": name, + "user_agent": user_agent, "vertical": vertical, }, timeseries_group_summary_params.TimeseriesGroupSummaryParams, @@ -624,6 +732,27 @@ async def timeseries( *, agg_interval: Literal["15m", "1h", "1d", "1w"] | Omit = omit, asn: SequenceNotStr[str] | Omit = omit, + content_type: List[ + Literal[ + "HTML", + "IMAGES", + "JSON", + "JAVASCRIPT", + "CSS", + "PLAIN_TEXT", + "FONTS", + "XML", + "YAML", + "VIDEO", + "AUDIO", + "MARKDOWN", + "DOCUMENTS", + "BINARY", + "SERIALIZATION", + "OTHER", + ] + ] + | Omit = omit, continent: SequenceNotStr[str] | Omit = omit, crawl_purpose: SequenceNotStr[str] | Omit = omit, date_end: SequenceNotStr[Union[str, datetime]] | Omit = omit, @@ -656,6 +785,8 @@ async def timeseries( results. For example, `-174, 3356` excludes results from AS174, but includes results from AS3356. + content_type: Filters results by content type category. + continent: Filters results by continent. Specify a comma-separated list of alpha-2 codes. Prefix with `-` to exclude continents from results. For example, `-EU,NA` excludes results from EU, but includes results from NA. @@ -707,6 +838,7 @@ async def timeseries( { "agg_interval": agg_interval, "asn": asn, + "content_type": content_type, "continent": continent, "crawl_purpose": crawl_purpose, "date_end": date_end, @@ -732,10 +864,31 @@ async def timeseries( ) async def timeseries_groups( self, - dimension: Literal["USER_AGENT", "CRAWL_PURPOSE", "INDUSTRY", "VERTICAL"], + dimension: Literal["USER_AGENT", "CRAWL_PURPOSE", "INDUSTRY", "VERTICAL", "CONTENT_TYPE"], *, agg_interval: Literal["15m", "1h", "1d", "1w"] | Omit = omit, asn: SequenceNotStr[str] | Omit = omit, + content_type: List[ + Literal[ + "HTML", + "IMAGES", + "JSON", + "JAVASCRIPT", + "CSS", + "PLAIN_TEXT", + "FONTS", + "XML", + "YAML", + "VIDEO", + "AUDIO", + "MARKDOWN", + "DOCUMENTS", + "BINARY", + "SERIALIZATION", + "OTHER", + ] + ] + | Omit = omit, continent: SequenceNotStr[str] | Omit = omit, crawl_purpose: SequenceNotStr[str] | Omit = omit, date_end: SequenceNotStr[Union[str, datetime]] | Omit = omit, @@ -746,7 +899,8 @@ async def timeseries_groups( limit_per_group: int | Omit = omit, location: SequenceNotStr[str] | Omit = omit, name: SequenceNotStr[str] | Omit = omit, - normalization: Literal["PERCENTAGE_CHANGE", "MIN0_MAX"] | Omit = omit, + normalization: Literal["PERCENTAGE", "MIN0_MAX"] | Omit = omit, + user_agent: SequenceNotStr[str] | Omit = omit, vertical: SequenceNotStr[str] | 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. @@ -756,7 +910,7 @@ async def timeseries_groups( timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> TimeseriesGroupTimeseriesGroupsResponse: """ - Retrieves the distribution of HTTP requests from AI bots, grouped by chosen the + Retrieves the distribution of HTTP requests from AI bots, grouped by the specified dimension over time. Args: @@ -771,6 +925,8 @@ async def timeseries_groups( results. For example, `-174, 3356` excludes results from AS174, but includes results from AS3356. + content_type: Filters results by content type category. + continent: Filters results by continent. Specify a comma-separated list of alpha-2 codes. Prefix with `-` to exclude continents from results. For example, `-EU,NA` excludes results from EU, but includes results from NA. @@ -802,6 +958,8 @@ async def timeseries_groups( normalization: Normalization method applied to the results. Refer to [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/). + user_agent: Filters results by user agent. + vertical: Filters results by vertical. extra_headers: Send extra headers @@ -825,6 +983,7 @@ async def timeseries_groups( { "agg_interval": agg_interval, "asn": asn, + "content_type": content_type, "continent": continent, "crawl_purpose": crawl_purpose, "date_end": date_end, @@ -836,6 +995,7 @@ async def timeseries_groups( "location": location, "name": name, "normalization": normalization, + "user_agent": user_agent, "vertical": vertical, }, timeseries_group_timeseries_groups_params.TimeseriesGroupTimeseriesGroupsParams, diff --git a/src/cloudflare/resources/radar/bots/bots.py b/src/cloudflare/resources/radar/bots/bots.py index 3b891df90bc..e3ef5e4287e 100644 --- a/src/cloudflare/resources/radar/bots/bots.py +++ b/src/cloudflare/resources/radar/bots/bots.py @@ -501,8 +501,8 @@ def timeseries_groups( timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> BotTimeseriesGroupsResponse: """ - Retrieves the distribution of HTTP requests from bots, grouped by chosen the - specified dimension over time. + Retrieves the distribution of HTTP requests from bots, grouped by the specified + dimension over time. Args: dimension: Specifies the attribute by which to group the results. @@ -1050,8 +1050,8 @@ async def timeseries_groups( timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> BotTimeseriesGroupsResponse: """ - Retrieves the distribution of HTTP requests from bots, grouped by chosen the - specified dimension over time. + Retrieves the distribution of HTTP requests from bots, grouped by the specified + dimension over time. Args: dimension: Specifies the attribute by which to group the results. diff --git a/src/cloudflare/resources/radar/bots/web_crawlers.py b/src/cloudflare/resources/radar/bots/web_crawlers.py index b5c0c6f0bc9..106f7759e88 100644 --- a/src/cloudflare/resources/radar/bots/web_crawlers.py +++ b/src/cloudflare/resources/radar/bots/web_crawlers.py @@ -159,7 +159,7 @@ def timeseries_groups( timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> WebCrawlerTimeseriesGroupsResponse: """ - Retrieves the distribution of HTTP requests from crawlers, grouped by chosen the + Retrieves the distribution of HTTP requests from crawlers, grouped by the specified dimension over time. Args: @@ -364,7 +364,7 @@ async def timeseries_groups( timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> WebCrawlerTimeseriesGroupsResponse: """ - Retrieves the distribution of HTTP requests from crawlers, grouped by chosen the + Retrieves the distribution of HTTP requests from crawlers, grouped by the specified dimension over time. Args: diff --git a/src/cloudflare/resources/radar/ct/ct.py b/src/cloudflare/resources/radar/ct/ct.py index 2c803e15a5a..2102278a793 100644 --- a/src/cloudflare/resources/radar/ct/ct.py +++ b/src/cloudflare/resources/radar/ct/ct.py @@ -496,8 +496,8 @@ def timeseries_groups( timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> CTTimeseriesGroupsResponse: """ - Retrieves the distribution of certificates grouped by chosen the specified - dimension over time. + Retrieves the distribution of certificates grouped by the specified dimension + over time. Args: dimension: Specifies the certificate attribute by which to group the results. @@ -1060,8 +1060,8 @@ async def timeseries_groups( timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> CTTimeseriesGroupsResponse: """ - Retrieves the distribution of certificates grouped by chosen the specified - dimension over time. + Retrieves the distribution of certificates grouped by the specified dimension + over time. Args: dimension: Specifies the certificate attribute by which to group the results. diff --git a/src/cloudflare/resources/radar/netflows/netflows.py b/src/cloudflare/resources/radar/netflows/netflows.py index 863ad0a5911..829305489be 100644 --- a/src/cloudflare/resources/radar/netflows/netflows.py +++ b/src/cloudflare/resources/radar/netflows/netflows.py @@ -388,7 +388,7 @@ def timeseries_groups( timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> NetFlowsTimeseriesGroupsResponse: """ - Retrieves the distribution of NetFlows traffic, grouped by chosen the specified + Retrieves the distribution of NetFlows traffic, grouped by the specified dimension over time. Args: @@ -823,7 +823,7 @@ async def timeseries_groups( timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> NetFlowsTimeseriesGroupsResponse: """ - Retrieves the distribution of NetFlows traffic, grouped by chosen the specified + Retrieves the distribution of NetFlows traffic, grouped by the specified dimension over time. Args: diff --git a/src/cloudflare/resources/snippets/content.py b/src/cloudflare/resources/snippets/content.py index be4473336d9..84f9ba1e83e 100644 --- a/src/cloudflare/resources/snippets/content.py +++ b/src/cloudflare/resources/snippets/content.py @@ -58,9 +58,9 @@ def get( Fetches the content of a snippet belonging to the zone. Args: - zone_id: The unique ID of the zone. + zone_id: Use this field to specify the unique ID of the zone. - snippet_name: The identifying name of the snippet. + snippet_name: Identify the snippet. extra_headers: Send extra headers @@ -120,9 +120,9 @@ async def get( Fetches the content of a snippet belonging to the zone. Args: - zone_id: The unique ID of the zone. + zone_id: Use this field to specify the unique ID of the zone. - snippet_name: The identifying name of the snippet. + snippet_name: Identify the snippet. extra_headers: Send extra headers diff --git a/src/cloudflare/resources/snippets/rules.py b/src/cloudflare/resources/snippets/rules.py index 60f627b1c83..0d6cf5b8afc 100644 --- a/src/cloudflare/resources/snippets/rules.py +++ b/src/cloudflare/resources/snippets/rules.py @@ -2,12 +2,12 @@ from __future__ import annotations -from typing import Iterable +from typing import Type, Iterable, cast import httpx from ..._types import Body, Query, Headers, NotGiven, not_given -from ..._utils import maybe_transform +from ..._utils import maybe_transform, async_maybe_transform from ..._compat import cached_property from ..._resource import SyncAPIResource, AsyncAPIResource from ..._response import ( @@ -16,12 +16,9 @@ async_to_raw_response_wrapper, async_to_streamed_response_wrapper, ) -from ...pagination import SyncSinglePage, AsyncSinglePage -from ..._base_client import AsyncPaginator, make_request_options +from ..._wrappers import ResultWrapper +from ..._base_client import make_request_options from ...types.snippets import rule_update_params -from ...types.snippets.rule_list_response import RuleListResponse -from ...types.snippets.rule_delete_response import RuleDeleteResponse -from ...types.snippets.rule_update_response import RuleUpdateResponse __all__ = ["RulesResource", "AsyncRulesResource"] @@ -57,14 +54,14 @@ def update( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, - ) -> SyncSinglePage[RuleUpdateResponse]: + ) -> object: """ Updates all snippet rules belonging to the zone. Args: - zone_id: The unique ID of the zone. + zone_id: Use this field to specify the unique ID of the zone. - rules: A list of snippet rules. + rules: Lists snippet rules. extra_headers: Send extra headers @@ -76,15 +73,17 @@ def update( """ if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") - return self._get_api_list( + return self._put( f"/zones/{zone_id}/snippets/snippet_rules", - page=SyncSinglePage[RuleUpdateResponse], body=maybe_transform({"rules": rules}, rule_update_params.RuleUpdateParams), 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, + post_parser=ResultWrapper[object]._unwrapper, ), - model=RuleUpdateResponse, - method="put", + cast_to=cast(Type[object], ResultWrapper[object]), ) def list( @@ -97,12 +96,12 @@ def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, - ) -> SyncSinglePage[RuleListResponse]: + ) -> object: """ Fetches all snippet rules belonging to the zone. Args: - zone_id: The unique ID of the zone. + zone_id: Use this field to specify the unique ID of the zone. extra_headers: Send extra headers @@ -114,13 +113,16 @@ def list( """ if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") - return self._get_api_list( + return self._get( f"/zones/{zone_id}/snippets/snippet_rules", - page=SyncSinglePage[RuleListResponse], 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, + post_parser=ResultWrapper[object]._unwrapper, ), - model=RuleListResponse, + cast_to=cast(Type[object], ResultWrapper[object]), ) def delete( @@ -133,12 +135,12 @@ def delete( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, - ) -> SyncSinglePage[RuleDeleteResponse]: + ) -> object: """ Deletes all snippet rules belonging to the zone. Args: - zone_id: The unique ID of the zone. + zone_id: Use this field to specify the unique ID of the zone. extra_headers: Send extra headers @@ -150,14 +152,16 @@ def delete( """ if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") - return self._get_api_list( + return self._delete( f"/zones/{zone_id}/snippets/snippet_rules", - page=SyncSinglePage[RuleDeleteResponse], 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, + post_parser=ResultWrapper[object]._unwrapper, ), - model=RuleDeleteResponse, - method="delete", + cast_to=cast(Type[object], ResultWrapper[object]), ) @@ -181,7 +185,7 @@ def with_streaming_response(self) -> AsyncRulesResourceWithStreamingResponse: """ return AsyncRulesResourceWithStreamingResponse(self) - def update( + async def update( self, *, zone_id: str, @@ -192,14 +196,14 @@ def update( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, - ) -> AsyncPaginator[RuleUpdateResponse, AsyncSinglePage[RuleUpdateResponse]]: + ) -> object: """ Updates all snippet rules belonging to the zone. Args: - zone_id: The unique ID of the zone. + zone_id: Use this field to specify the unique ID of the zone. - rules: A list of snippet rules. + rules: Lists snippet rules. extra_headers: Send extra headers @@ -211,18 +215,20 @@ def update( """ if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") - return self._get_api_list( + return await self._put( f"/zones/{zone_id}/snippets/snippet_rules", - page=AsyncSinglePage[RuleUpdateResponse], - body=maybe_transform({"rules": rules}, rule_update_params.RuleUpdateParams), + body=await async_maybe_transform({"rules": rules}, rule_update_params.RuleUpdateParams), 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, + post_parser=ResultWrapper[object]._unwrapper, ), - model=RuleUpdateResponse, - method="put", + cast_to=cast(Type[object], ResultWrapper[object]), ) - def list( + async def list( self, *, zone_id: str, @@ -232,12 +238,12 @@ def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, - ) -> AsyncPaginator[RuleListResponse, AsyncSinglePage[RuleListResponse]]: + ) -> object: """ Fetches all snippet rules belonging to the zone. Args: - zone_id: The unique ID of the zone. + zone_id: Use this field to specify the unique ID of the zone. extra_headers: Send extra headers @@ -249,16 +255,19 @@ def list( """ if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") - return self._get_api_list( + return await self._get( f"/zones/{zone_id}/snippets/snippet_rules", - page=AsyncSinglePage[RuleListResponse], 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, + post_parser=ResultWrapper[object]._unwrapper, ), - model=RuleListResponse, + cast_to=cast(Type[object], ResultWrapper[object]), ) - def delete( + async def delete( self, *, zone_id: str, @@ -268,12 +277,12 @@ def delete( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, - ) -> AsyncPaginator[RuleDeleteResponse, AsyncSinglePage[RuleDeleteResponse]]: + ) -> object: """ Deletes all snippet rules belonging to the zone. Args: - zone_id: The unique ID of the zone. + zone_id: Use this field to specify the unique ID of the zone. extra_headers: Send extra headers @@ -285,14 +294,16 @@ def delete( """ if not zone_id: raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") - return self._get_api_list( + return await self._delete( f"/zones/{zone_id}/snippets/snippet_rules", - page=AsyncSinglePage[RuleDeleteResponse], 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, + post_parser=ResultWrapper[object]._unwrapper, ), - model=RuleDeleteResponse, - method="delete", + cast_to=cast(Type[object], ResultWrapper[object]), ) diff --git a/src/cloudflare/resources/snippets/snippets.py b/src/cloudflare/resources/snippets/snippets.py index aa40465dcb3..21e928d8b84 100644 --- a/src/cloudflare/resources/snippets/snippets.py +++ b/src/cloudflare/resources/snippets/snippets.py @@ -38,7 +38,6 @@ from ...types.snippets import snippet_list_params, snippet_update_params from ...types.snippets.snippet_get_response import SnippetGetResponse from ...types.snippets.snippet_list_response import SnippetListResponse -from ...types.snippets.snippet_delete_response import SnippetDeleteResponse from ...types.snippets.snippet_update_response import SnippetUpdateResponse __all__ = ["SnippetsResource", "AsyncSnippetsResource"] @@ -89,11 +88,11 @@ def update( Creates or updates a snippet belonging to the zone. Args: - zone_id: The unique ID of the zone. + zone_id: Use this field to specify the unique ID of the zone. - snippet_name: The identifying name of the snippet. + snippet_name: Identify the snippet. - metadata: Metadata about the snippet. + metadata: Provide metadata about the snippet. extra_headers: Send extra headers @@ -142,11 +141,11 @@ def list( Fetches all snippets belonging to the zone. Args: - zone_id: The unique ID of the zone. + zone_id: Use this field to specify the unique ID of the zone. - page: The current page number. + page: Specifies the current page number. - per_page: The number of results to return per page. + per_page: Specifies how many results to return per page. extra_headers: Send extra headers @@ -188,14 +187,14 @@ def delete( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, - ) -> str: + ) -> object: """ Deletes a snippet belonging to the zone. Args: - zone_id: The unique ID of the zone. + zone_id: Use this field to specify the unique ID of the zone. - snippet_name: The identifying name of the snippet. + snippet_name: Identify the snippet. extra_headers: Send extra headers @@ -216,9 +215,9 @@ def delete( extra_query=extra_query, extra_body=extra_body, timeout=timeout, - post_parser=ResultWrapper[Optional[SnippetDeleteResponse]]._unwrapper, + post_parser=ResultWrapper[Optional[object]]._unwrapper, ), - cast_to=cast(Type[str], ResultWrapper[str]), + cast_to=cast(Type[object], ResultWrapper[object]), ) def get( @@ -237,9 +236,9 @@ def get( Fetches a snippet belonging to the zone. Args: - zone_id: The unique ID of the zone. + zone_id: Use this field to specify the unique ID of the zone. - snippet_name: The identifying name of the snippet. + snippet_name: Identify the snippet. extra_headers: Send extra headers @@ -311,11 +310,11 @@ async def update( Creates or updates a snippet belonging to the zone. Args: - zone_id: The unique ID of the zone. + zone_id: Use this field to specify the unique ID of the zone. - snippet_name: The identifying name of the snippet. + snippet_name: Identify the snippet. - metadata: Metadata about the snippet. + metadata: Provide metadata about the snippet. extra_headers: Send extra headers @@ -364,11 +363,11 @@ def list( Fetches all snippets belonging to the zone. Args: - zone_id: The unique ID of the zone. + zone_id: Use this field to specify the unique ID of the zone. - page: The current page number. + page: Specifies the current page number. - per_page: The number of results to return per page. + per_page: Specifies how many results to return per page. extra_headers: Send extra headers @@ -410,14 +409,14 @@ async def delete( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, - ) -> str: + ) -> object: """ Deletes a snippet belonging to the zone. Args: - zone_id: The unique ID of the zone. + zone_id: Use this field to specify the unique ID of the zone. - snippet_name: The identifying name of the snippet. + snippet_name: Identify the snippet. extra_headers: Send extra headers @@ -438,9 +437,9 @@ async def delete( extra_query=extra_query, extra_body=extra_body, timeout=timeout, - post_parser=ResultWrapper[Optional[SnippetDeleteResponse]]._unwrapper, + post_parser=ResultWrapper[Optional[object]]._unwrapper, ), - cast_to=cast(Type[str], ResultWrapper[str]), + cast_to=cast(Type[object], ResultWrapper[object]), ) async def get( @@ -459,9 +458,9 @@ async def get( Fetches a snippet belonging to the zone. Args: - zone_id: The unique ID of the zone. + zone_id: Use this field to specify the unique ID of the zone. - snippet_name: The identifying name of the snippet. + snippet_name: Identify the snippet. extra_headers: Send extra headers diff --git a/src/cloudflare/resources/zero_trust/dlp/entries/custom.py b/src/cloudflare/resources/zero_trust/dlp/entries/custom.py index ad9e74d0e47..12e290917de 100644 --- a/src/cloudflare/resources/zero_trust/dlp/entries/custom.py +++ b/src/cloudflare/resources/zero_trust/dlp/entries/custom.py @@ -56,6 +56,7 @@ def create( enabled: bool, name: str, pattern: PatternParam, + description: Optional[str] | Omit = omit, profile_id: str | 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. @@ -85,6 +86,7 @@ def create( "enabled": enabled, "name": name, "pattern": pattern, + "description": description, "profile_id": profile_id, }, custom_create_params.CustomCreateParams, @@ -107,6 +109,7 @@ def update( enabled: bool, name: str, pattern: PatternParam, + description: Optional[str] | 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, @@ -137,6 +140,7 @@ def update( "enabled": enabled, "name": name, "pattern": pattern, + "description": description, }, custom_update_params.CustomUpdateParams, ), @@ -297,6 +301,7 @@ async def create( enabled: bool, name: str, pattern: PatternParam, + description: Optional[str] | Omit = omit, profile_id: str | 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. @@ -326,6 +331,7 @@ async def create( "enabled": enabled, "name": name, "pattern": pattern, + "description": description, "profile_id": profile_id, }, custom_create_params.CustomCreateParams, @@ -348,6 +354,7 @@ async def update( enabled: bool, name: str, pattern: PatternParam, + description: Optional[str] | 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, @@ -378,6 +385,7 @@ async def update( "enabled": enabled, "name": name, "pattern": pattern, + "description": description, }, custom_update_params.CustomUpdateParams, ), diff --git a/src/cloudflare/resources/zero_trust/dlp/entries/entries.py b/src/cloudflare/resources/zero_trust/dlp/entries/entries.py index a2e7b357ae1..619df5a3f6a 100644 --- a/src/cloudflare/resources/zero_trust/dlp/entries/entries.py +++ b/src/cloudflare/resources/zero_trust/dlp/entries/entries.py @@ -93,6 +93,7 @@ def create( enabled: bool, name: str, pattern: PatternParam, + description: Optional[str] | Omit = omit, profile_id: str | 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. @@ -122,6 +123,7 @@ def create( "enabled": enabled, "name": name, "pattern": pattern, + "description": description, "profile_id": profile_id, }, entry_create_params.EntryCreateParams, @@ -145,6 +147,7 @@ def update( name: str, pattern: PatternParam, type: Literal["custom"], + description: Optional[str] | Omit = omit, enabled: 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. @@ -234,6 +237,7 @@ def update( name: str | Omit = omit, pattern: PatternParam | Omit = omit, type: Literal["custom"] | Literal["predefined"] | Literal["integration"], + description: Optional[str] | Omit = omit, enabled: 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. @@ -255,6 +259,7 @@ def update( "name": name, "pattern": pattern, "type": type, + "description": description, "enabled": enabled, }, entry_update_params.EntryUpdateParams, @@ -431,6 +436,7 @@ async def create( enabled: bool, name: str, pattern: PatternParam, + description: Optional[str] | Omit = omit, profile_id: str | 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. @@ -460,6 +466,7 @@ async def create( "enabled": enabled, "name": name, "pattern": pattern, + "description": description, "profile_id": profile_id, }, entry_create_params.EntryCreateParams, @@ -483,6 +490,7 @@ async def update( name: str, pattern: PatternParam, type: Literal["custom"], + description: Optional[str] | Omit = omit, enabled: 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. @@ -572,6 +580,7 @@ async def update( name: str | Omit = omit, pattern: PatternParam | Omit = omit, type: Literal["custom"] | Literal["predefined"] | Literal["integration"], + description: Optional[str] | Omit = omit, enabled: 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. @@ -593,6 +602,7 @@ async def update( "name": name, "pattern": pattern, "type": type, + "description": description, "enabled": enabled, }, entry_update_params.EntryUpdateParams, diff --git a/src/cloudflare/resources/zones/zones.py b/src/cloudflare/resources/zones/zones.py index ea3f6779233..cd31a0ddf93 100644 --- a/src/cloudflare/resources/zones/zones.py +++ b/src/cloudflare/resources/zones/zones.py @@ -145,12 +145,16 @@ def create( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[Zone]: - """ - Create Zone + """Create Zone Args: name: The domain name. + Per + [RFC 1035](https://datatracker.ietf.org/doc/html/rfc1035#section-2.3.4) the + overall zone name can be up to 253 characters, with each segment ("label") not + exceeding 63 characters. + type: A full zone implies that DNS is hosted with Cloudflare. A partial zone is typically a partner-hosted zone or a CNAME setup. @@ -465,12 +469,16 @@ async def create( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[Zone]: - """ - Create Zone + """Create Zone Args: name: The domain name. + Per + [RFC 1035](https://datatracker.ietf.org/doc/html/rfc1035#section-2.3.4) the + overall zone name can be up to 253 characters, with each segment ("label") not + exceeding 63 characters. + type: A full zone implies that DNS is hosted with Cloudflare. A partial zone is typically a partner-hosted zone or a CNAME setup. diff --git a/src/cloudflare/types/accounts/member_create_params.py b/src/cloudflare/types/accounts/member_create_params.py index 0fbe8a7347d..48c257c5826 100644 --- a/src/cloudflare/types/accounts/member_create_params.py +++ b/src/cloudflare/types/accounts/member_create_params.py @@ -28,6 +28,12 @@ class IAMCreateMemberWithRoles(TypedDict, total=False): """Array of roles associated with this member.""" status: Literal["accepted", "pending"] + """Status of the member invitation. + + If not provided during creation, defaults to 'pending'. Changing from 'accepted' + back to 'pending' will trigger a replacement of the member resource in + Terraform. + """ class IAMCreateMemberWithPolicies(TypedDict, total=False): @@ -41,6 +47,12 @@ class IAMCreateMemberWithPolicies(TypedDict, total=False): """Array of policies associated with this member.""" status: Literal["accepted", "pending"] + """Status of the member invitation. + + If not provided during creation, defaults to 'pending'. Changing from 'accepted' + back to 'pending' will trigger a replacement of the member resource in + Terraform. + """ class IAMCreateMemberWithPoliciesPolicyPermissionGroup(TypedDict, total=False): diff --git a/src/cloudflare/types/ai/ai_run_params.py b/src/cloudflare/types/ai/ai_run_params.py index 753b2da85d4..61f9181239e 100644 --- a/src/cloudflare/types/ai/ai_run_params.py +++ b/src/cloudflare/types/ai/ai_run_params.py @@ -20,6 +20,7 @@ "PromptResponseFormat", "Messages", "MessagesMessage", + "MessagesMessageContentUnionMember1", "MessagesFunction", "MessagesResponseFormat", "MessagesTool", @@ -284,8 +285,16 @@ class Messages(TypedDict, total=False): """ +class MessagesMessageContentUnionMember1(TypedDict, total=False): + text: str + """Text content""" + + type: str + """Type of the content (text)""" + + class MessagesMessage(TypedDict, total=False): - content: Required[str] + content: Required[Union[str, Iterable[MessagesMessageContentUnionMember1]]] """The content of the message as a string.""" role: Required[str] diff --git a/src/cloudflare/types/ai/models/__init__.py b/src/cloudflare/types/ai/models/__init__.py index 64ed676cee2..1c8d1e37dad 100644 --- a/src/cloudflare/types/ai/models/__init__.py +++ b/src/cloudflare/types/ai/models/__init__.py @@ -3,3 +3,4 @@ from __future__ import annotations from .schema_get_params import SchemaGetParams as SchemaGetParams +from .schema_get_response import SchemaGetResponse as SchemaGetResponse diff --git a/src/cloudflare/types/ai/models/schema_get_response.py b/src/cloudflare/types/ai/models/schema_get_response.py new file mode 100644 index 00000000000..8935fb04255 --- /dev/null +++ b/src/cloudflare/types/ai/models/schema_get_response.py @@ -0,0 +1,29 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from pydantic import Field as FieldInfo + +from ...._models import BaseModel + +__all__ = ["SchemaGetResponse", "Input", "Output"] + + +class Input(BaseModel): + additional_properties: bool = FieldInfo(alias="additionalProperties") + + description: str + + type: str + + +class Output(BaseModel): + additional_properties: bool = FieldInfo(alias="additionalProperties") + + description: str + + type: str + + +class SchemaGetResponse(BaseModel): + input: Input + + output: Output diff --git a/src/cloudflare/types/aisearch/instance_chat_completions_params.py b/src/cloudflare/types/aisearch/instance_chat_completions_params.py index 9dee87fffad..4550e56d5d6 100644 --- a/src/cloudflare/types/aisearch/instance_chat_completions_params.py +++ b/src/cloudflare/types/aisearch/instance_chat_completions_params.py @@ -14,10 +14,6 @@ "AISearchOptionsQueryRewrite", "AISearchOptionsReranking", "AISearchOptionsRetrieval", - "AISearchOptionsRetrievalFilters", - "AISearchOptionsRetrievalFiltersUnionMember0", - "AISearchOptionsRetrievalFiltersUnionMember1", - "AISearchOptionsRetrievalFiltersUnionMember1Filter", ] @@ -30,6 +26,7 @@ class InstanceChatCompletionsParams(TypedDict, total=False): model: Literal[ "@cf/meta/llama-3.3-70b-instruct-fp8-fast", + "@cf/zai-org/glm-4.7-flash", "@cf/meta/llama-3.1-8b-instruct-fast", "@cf/meta/llama-3.1-8b-instruct-fp8", "@cf/meta/llama-4-scout-17b-16e-instruct", @@ -74,6 +71,7 @@ class AISearchOptionsQueryRewrite(TypedDict, total=False): model: Literal[ "@cf/meta/llama-3.3-70b-instruct-fp8-fast", + "@cf/zai-org/glm-4.7-flash", "@cf/meta/llama-3.1-8b-instruct-fast", "@cf/meta/llama-3.1-8b-instruct-fp8", "@cf/meta/llama-4-scout-17b-16e-instruct", @@ -112,37 +110,10 @@ class AISearchOptionsReranking(TypedDict, total=False): model: Literal["@cf/baai/bge-reranker-base", ""] -class AISearchOptionsRetrievalFiltersUnionMember0(TypedDict, total=False): - key: Required[str] - - type: Required[Literal["eq", "ne", "gt", "gte", "lt", "lte"]] - - value: Required[Union[str, float, bool]] - - -class AISearchOptionsRetrievalFiltersUnionMember1Filter(TypedDict, total=False): - key: Required[str] - - type: Required[Literal["eq", "ne", "gt", "gte", "lt", "lte"]] - - value: Required[Union[str, float, bool]] - - -class AISearchOptionsRetrievalFiltersUnionMember1(TypedDict, total=False): - filters: Required[Iterable[AISearchOptionsRetrievalFiltersUnionMember1Filter]] - - type: Required[Literal["and", "or"]] - - -AISearchOptionsRetrievalFilters: TypeAlias = Union[ - AISearchOptionsRetrievalFiltersUnionMember0, AISearchOptionsRetrievalFiltersUnionMember1 -] - - class AISearchOptionsRetrieval(TypedDict, total=False): context_expansion: int - filters: AISearchOptionsRetrievalFilters + filters: Dict[str, object] match_threshold: float @@ -150,6 +121,8 @@ class AISearchOptionsRetrieval(TypedDict, total=False): retrieval_type: Literal["vector", "keyword", "hybrid"] + return_on_failure: bool + class AISearchOptions(TypedDict, total=False): query_rewrite: AISearchOptionsQueryRewrite diff --git a/src/cloudflare/types/aisearch/instance_create_params.py b/src/cloudflare/types/aisearch/instance_create_params.py index d88e808b521..402a1a06404 100644 --- a/src/cloudflare/types/aisearch/instance_create_params.py +++ b/src/cloudflare/types/aisearch/instance_create_params.py @@ -2,7 +2,7 @@ from __future__ import annotations -from typing import Dict, Iterable +from typing import Dict, Iterable, Optional from typing_extensions import Literal, Required, Annotated, TypedDict from ..._types import SequenceNotStr @@ -35,11 +35,12 @@ class InstanceCreateParams(TypedDict, total=False): type: Required[Literal["r2", "web-crawler"]] - ai_gateway_id: str + ai_gateway_id: Optional[str] aisearch_model: Annotated[ Literal[ "@cf/meta/llama-3.3-70b-instruct-fp8-fast", + "@cf/zai-org/glm-4.7-flash", "@cf/meta/llama-3.1-8b-instruct-fast", "@cf/meta/llama-3.1-8b-instruct-fp8", "@cf/meta/llama-4-scout-17b-16e-instruct", @@ -102,6 +103,7 @@ class InstanceCreateParams(TypedDict, total=False): rewrite_model: Literal[ "@cf/meta/llama-3.3-70b-instruct-fp8-fast", + "@cf/zai-org/glm-4.7-flash", "@cf/meta/llama-3.1-8b-instruct-fast", "@cf/meta/llama-3.1-8b-instruct-fp8", "@cf/meta/llama-4-scout-17b-16e-instruct", @@ -156,6 +158,8 @@ class PublicEndpointParamsChatCompletionsEndpoint(TypedDict, total=False): class PublicEndpointParamsMcp(TypedDict, total=False): + description: str + disabled: bool """Disable MCP endpoint for this public endpoint""" diff --git a/src/cloudflare/types/aisearch/instance_create_response.py b/src/cloudflare/types/aisearch/instance_create_response.py index 7e3f4709640..372e0ef5690 100644 --- a/src/cloudflare/types/aisearch/instance_create_response.py +++ b/src/cloudflare/types/aisearch/instance_create_response.py @@ -43,6 +43,8 @@ class PublicEndpointParamsChatCompletionsEndpoint(BaseModel): class PublicEndpointParamsMcp(BaseModel): + description: Optional[str] = None + disabled: Optional[bool] = None """Disable MCP endpoint for this public endpoint""" @@ -131,14 +133,8 @@ class InstanceCreateResponse(BaseModel): id: str """Use your AI Search ID.""" - account_id: str - - account_tag: str - created_at: datetime - internal_id: str - modified_at: datetime source: str @@ -152,6 +148,7 @@ class InstanceCreateResponse(BaseModel): aisearch_model: Optional[ Literal[ "@cf/meta/llama-3.3-70b-instruct-fp8-fast", + "@cf/zai-org/glm-4.7-flash", "@cf/meta/llama-3.1-8b-instruct-fast", "@cf/meta/llama-3.1-8b-instruct-fp8", "@cf/meta/llama-4-scout-17b-16e-instruct", @@ -184,8 +181,6 @@ class InstanceCreateResponse(BaseModel): cache_threshold: Optional[Literal["super_strict_match", "close_enough", "flexible_friend", "anything_goes"]] = None - chunk: Optional[bool] = None - chunk_overlap: Optional[int] = None chunk_size: Optional[int] = None @@ -209,8 +204,6 @@ class InstanceCreateResponse(BaseModel): enable: Optional[bool] = None - engine_version: Optional[float] = None - hybrid_search_enabled: Optional[bool] = None last_activity: Optional[datetime] = None @@ -234,6 +227,7 @@ class InstanceCreateResponse(BaseModel): rewrite_model: Optional[ Literal[ "@cf/meta/llama-3.3-70b-instruct-fp8-fast", + "@cf/zai-org/glm-4.7-flash", "@cf/meta/llama-3.1-8b-instruct-fast", "@cf/meta/llama-3.1-8b-instruct-fp8", "@cf/meta/llama-4-scout-17b-16e-instruct", @@ -270,45 +264,4 @@ class InstanceCreateResponse(BaseModel): status: Optional[str] = None - summarization: Optional[bool] = None - - summarization_model: Optional[ - Literal[ - "@cf/meta/llama-3.3-70b-instruct-fp8-fast", - "@cf/meta/llama-3.1-8b-instruct-fast", - "@cf/meta/llama-3.1-8b-instruct-fp8", - "@cf/meta/llama-4-scout-17b-16e-instruct", - "@cf/qwen/qwen3-30b-a3b-fp8", - "@cf/deepseek-ai/deepseek-r1-distill-qwen-32b", - "@cf/moonshotai/kimi-k2-instruct", - "anthropic/claude-3-7-sonnet", - "anthropic/claude-sonnet-4", - "anthropic/claude-opus-4", - "anthropic/claude-3-5-haiku", - "cerebras/qwen-3-235b-a22b-instruct", - "cerebras/qwen-3-235b-a22b-thinking", - "cerebras/llama-3.3-70b", - "cerebras/llama-4-maverick-17b-128e-instruct", - "cerebras/llama-4-scout-17b-16e-instruct", - "cerebras/gpt-oss-120b", - "google-ai-studio/gemini-2.5-flash", - "google-ai-studio/gemini-2.5-pro", - "grok/grok-4", - "groq/llama-3.3-70b-versatile", - "groq/llama-3.1-8b-instant", - "openai/gpt-5", - "openai/gpt-5-mini", - "openai/gpt-5-nano", - "", - ] - ] = None - - system_prompt_aisearch: Optional[str] = FieldInfo(alias="system_prompt_ai_search", default=None) - - system_prompt_index_summarization: Optional[str] = None - - system_prompt_rewrite_query: Optional[str] = None - token_id: Optional[str] = None - - vectorize_active_namespace: Optional[str] = None diff --git a/src/cloudflare/types/aisearch/instance_delete_response.py b/src/cloudflare/types/aisearch/instance_delete_response.py index e5f966ee6b3..ddf8c3d4cee 100644 --- a/src/cloudflare/types/aisearch/instance_delete_response.py +++ b/src/cloudflare/types/aisearch/instance_delete_response.py @@ -43,6 +43,8 @@ class PublicEndpointParamsChatCompletionsEndpoint(BaseModel): class PublicEndpointParamsMcp(BaseModel): + description: Optional[str] = None + disabled: Optional[bool] = None """Disable MCP endpoint for this public endpoint""" @@ -131,14 +133,8 @@ class InstanceDeleteResponse(BaseModel): id: str """Use your AI Search ID.""" - account_id: str - - account_tag: str - created_at: datetime - internal_id: str - modified_at: datetime source: str @@ -152,6 +148,7 @@ class InstanceDeleteResponse(BaseModel): aisearch_model: Optional[ Literal[ "@cf/meta/llama-3.3-70b-instruct-fp8-fast", + "@cf/zai-org/glm-4.7-flash", "@cf/meta/llama-3.1-8b-instruct-fast", "@cf/meta/llama-3.1-8b-instruct-fp8", "@cf/meta/llama-4-scout-17b-16e-instruct", @@ -184,8 +181,6 @@ class InstanceDeleteResponse(BaseModel): cache_threshold: Optional[Literal["super_strict_match", "close_enough", "flexible_friend", "anything_goes"]] = None - chunk: Optional[bool] = None - chunk_overlap: Optional[int] = None chunk_size: Optional[int] = None @@ -209,8 +204,6 @@ class InstanceDeleteResponse(BaseModel): enable: Optional[bool] = None - engine_version: Optional[float] = None - hybrid_search_enabled: Optional[bool] = None last_activity: Optional[datetime] = None @@ -234,6 +227,7 @@ class InstanceDeleteResponse(BaseModel): rewrite_model: Optional[ Literal[ "@cf/meta/llama-3.3-70b-instruct-fp8-fast", + "@cf/zai-org/glm-4.7-flash", "@cf/meta/llama-3.1-8b-instruct-fast", "@cf/meta/llama-3.1-8b-instruct-fp8", "@cf/meta/llama-4-scout-17b-16e-instruct", @@ -270,45 +264,4 @@ class InstanceDeleteResponse(BaseModel): status: Optional[str] = None - summarization: Optional[bool] = None - - summarization_model: Optional[ - Literal[ - "@cf/meta/llama-3.3-70b-instruct-fp8-fast", - "@cf/meta/llama-3.1-8b-instruct-fast", - "@cf/meta/llama-3.1-8b-instruct-fp8", - "@cf/meta/llama-4-scout-17b-16e-instruct", - "@cf/qwen/qwen3-30b-a3b-fp8", - "@cf/deepseek-ai/deepseek-r1-distill-qwen-32b", - "@cf/moonshotai/kimi-k2-instruct", - "anthropic/claude-3-7-sonnet", - "anthropic/claude-sonnet-4", - "anthropic/claude-opus-4", - "anthropic/claude-3-5-haiku", - "cerebras/qwen-3-235b-a22b-instruct", - "cerebras/qwen-3-235b-a22b-thinking", - "cerebras/llama-3.3-70b", - "cerebras/llama-4-maverick-17b-128e-instruct", - "cerebras/llama-4-scout-17b-16e-instruct", - "cerebras/gpt-oss-120b", - "google-ai-studio/gemini-2.5-flash", - "google-ai-studio/gemini-2.5-pro", - "grok/grok-4", - "groq/llama-3.3-70b-versatile", - "groq/llama-3.1-8b-instant", - "openai/gpt-5", - "openai/gpt-5-mini", - "openai/gpt-5-nano", - "", - ] - ] = None - - system_prompt_aisearch: Optional[str] = FieldInfo(alias="system_prompt_ai_search", default=None) - - system_prompt_index_summarization: Optional[str] = None - - system_prompt_rewrite_query: Optional[str] = None - token_id: Optional[str] = None - - vectorize_active_namespace: Optional[str] = None diff --git a/src/cloudflare/types/aisearch/instance_list_response.py b/src/cloudflare/types/aisearch/instance_list_response.py index 8488c61e58a..cbbdfb48ea8 100644 --- a/src/cloudflare/types/aisearch/instance_list_response.py +++ b/src/cloudflare/types/aisearch/instance_list_response.py @@ -43,6 +43,8 @@ class PublicEndpointParamsChatCompletionsEndpoint(BaseModel): class PublicEndpointParamsMcp(BaseModel): + description: Optional[str] = None + disabled: Optional[bool] = None """Disable MCP endpoint for this public endpoint""" @@ -131,14 +133,8 @@ class InstanceListResponse(BaseModel): id: str """Use your AI Search ID.""" - account_id: str - - account_tag: str - created_at: datetime - internal_id: str - modified_at: datetime source: str @@ -152,6 +148,7 @@ class InstanceListResponse(BaseModel): aisearch_model: Optional[ Literal[ "@cf/meta/llama-3.3-70b-instruct-fp8-fast", + "@cf/zai-org/glm-4.7-flash", "@cf/meta/llama-3.1-8b-instruct-fast", "@cf/meta/llama-3.1-8b-instruct-fp8", "@cf/meta/llama-4-scout-17b-16e-instruct", @@ -184,8 +181,6 @@ class InstanceListResponse(BaseModel): cache_threshold: Optional[Literal["super_strict_match", "close_enough", "flexible_friend", "anything_goes"]] = None - chunk: Optional[bool] = None - chunk_overlap: Optional[int] = None chunk_size: Optional[int] = None @@ -209,8 +204,6 @@ class InstanceListResponse(BaseModel): enable: Optional[bool] = None - engine_version: Optional[float] = None - hybrid_search_enabled: Optional[bool] = None last_activity: Optional[datetime] = None @@ -234,6 +227,7 @@ class InstanceListResponse(BaseModel): rewrite_model: Optional[ Literal[ "@cf/meta/llama-3.3-70b-instruct-fp8-fast", + "@cf/zai-org/glm-4.7-flash", "@cf/meta/llama-3.1-8b-instruct-fast", "@cf/meta/llama-3.1-8b-instruct-fp8", "@cf/meta/llama-4-scout-17b-16e-instruct", @@ -270,45 +264,4 @@ class InstanceListResponse(BaseModel): status: Optional[str] = None - summarization: Optional[bool] = None - - summarization_model: Optional[ - Literal[ - "@cf/meta/llama-3.3-70b-instruct-fp8-fast", - "@cf/meta/llama-3.1-8b-instruct-fast", - "@cf/meta/llama-3.1-8b-instruct-fp8", - "@cf/meta/llama-4-scout-17b-16e-instruct", - "@cf/qwen/qwen3-30b-a3b-fp8", - "@cf/deepseek-ai/deepseek-r1-distill-qwen-32b", - "@cf/moonshotai/kimi-k2-instruct", - "anthropic/claude-3-7-sonnet", - "anthropic/claude-sonnet-4", - "anthropic/claude-opus-4", - "anthropic/claude-3-5-haiku", - "cerebras/qwen-3-235b-a22b-instruct", - "cerebras/qwen-3-235b-a22b-thinking", - "cerebras/llama-3.3-70b", - "cerebras/llama-4-maverick-17b-128e-instruct", - "cerebras/llama-4-scout-17b-16e-instruct", - "cerebras/gpt-oss-120b", - "google-ai-studio/gemini-2.5-flash", - "google-ai-studio/gemini-2.5-pro", - "grok/grok-4", - "groq/llama-3.3-70b-versatile", - "groq/llama-3.1-8b-instant", - "openai/gpt-5", - "openai/gpt-5-mini", - "openai/gpt-5-nano", - "", - ] - ] = None - - system_prompt_aisearch: Optional[str] = FieldInfo(alias="system_prompt_ai_search", default=None) - - system_prompt_index_summarization: Optional[str] = None - - system_prompt_rewrite_query: Optional[str] = None - token_id: Optional[str] = None - - vectorize_active_namespace: Optional[str] = None diff --git a/src/cloudflare/types/aisearch/instance_read_response.py b/src/cloudflare/types/aisearch/instance_read_response.py index 0b3afdbe6a8..12fb2a45517 100644 --- a/src/cloudflare/types/aisearch/instance_read_response.py +++ b/src/cloudflare/types/aisearch/instance_read_response.py @@ -43,6 +43,8 @@ class PublicEndpointParamsChatCompletionsEndpoint(BaseModel): class PublicEndpointParamsMcp(BaseModel): + description: Optional[str] = None + disabled: Optional[bool] = None """Disable MCP endpoint for this public endpoint""" @@ -131,14 +133,8 @@ class InstanceReadResponse(BaseModel): id: str """Use your AI Search ID.""" - account_id: str - - account_tag: str - created_at: datetime - internal_id: str - modified_at: datetime source: str @@ -152,6 +148,7 @@ class InstanceReadResponse(BaseModel): aisearch_model: Optional[ Literal[ "@cf/meta/llama-3.3-70b-instruct-fp8-fast", + "@cf/zai-org/glm-4.7-flash", "@cf/meta/llama-3.1-8b-instruct-fast", "@cf/meta/llama-3.1-8b-instruct-fp8", "@cf/meta/llama-4-scout-17b-16e-instruct", @@ -184,8 +181,6 @@ class InstanceReadResponse(BaseModel): cache_threshold: Optional[Literal["super_strict_match", "close_enough", "flexible_friend", "anything_goes"]] = None - chunk: Optional[bool] = None - chunk_overlap: Optional[int] = None chunk_size: Optional[int] = None @@ -209,8 +204,6 @@ class InstanceReadResponse(BaseModel): enable: Optional[bool] = None - engine_version: Optional[float] = None - hybrid_search_enabled: Optional[bool] = None last_activity: Optional[datetime] = None @@ -234,6 +227,7 @@ class InstanceReadResponse(BaseModel): rewrite_model: Optional[ Literal[ "@cf/meta/llama-3.3-70b-instruct-fp8-fast", + "@cf/zai-org/glm-4.7-flash", "@cf/meta/llama-3.1-8b-instruct-fast", "@cf/meta/llama-3.1-8b-instruct-fp8", "@cf/meta/llama-4-scout-17b-16e-instruct", @@ -270,45 +264,4 @@ class InstanceReadResponse(BaseModel): status: Optional[str] = None - summarization: Optional[bool] = None - - summarization_model: Optional[ - Literal[ - "@cf/meta/llama-3.3-70b-instruct-fp8-fast", - "@cf/meta/llama-3.1-8b-instruct-fast", - "@cf/meta/llama-3.1-8b-instruct-fp8", - "@cf/meta/llama-4-scout-17b-16e-instruct", - "@cf/qwen/qwen3-30b-a3b-fp8", - "@cf/deepseek-ai/deepseek-r1-distill-qwen-32b", - "@cf/moonshotai/kimi-k2-instruct", - "anthropic/claude-3-7-sonnet", - "anthropic/claude-sonnet-4", - "anthropic/claude-opus-4", - "anthropic/claude-3-5-haiku", - "cerebras/qwen-3-235b-a22b-instruct", - "cerebras/qwen-3-235b-a22b-thinking", - "cerebras/llama-3.3-70b", - "cerebras/llama-4-maverick-17b-128e-instruct", - "cerebras/llama-4-scout-17b-16e-instruct", - "cerebras/gpt-oss-120b", - "google-ai-studio/gemini-2.5-flash", - "google-ai-studio/gemini-2.5-pro", - "grok/grok-4", - "groq/llama-3.3-70b-versatile", - "groq/llama-3.1-8b-instant", - "openai/gpt-5", - "openai/gpt-5-mini", - "openai/gpt-5-nano", - "", - ] - ] = None - - system_prompt_aisearch: Optional[str] = FieldInfo(alias="system_prompt_ai_search", default=None) - - system_prompt_index_summarization: Optional[str] = None - - system_prompt_rewrite_query: Optional[str] = None - token_id: Optional[str] = None - - vectorize_active_namespace: Optional[str] = None diff --git a/src/cloudflare/types/aisearch/instance_search_params.py b/src/cloudflare/types/aisearch/instance_search_params.py index 5be0494bf19..84a4846b6ce 100644 --- a/src/cloudflare/types/aisearch/instance_search_params.py +++ b/src/cloudflare/types/aisearch/instance_search_params.py @@ -14,10 +14,6 @@ "AISearchOptionsQueryRewrite", "AISearchOptionsReranking", "AISearchOptionsRetrieval", - "AISearchOptionsRetrievalFilters", - "AISearchOptionsRetrievalFiltersUnionMember0", - "AISearchOptionsRetrievalFiltersUnionMember1", - "AISearchOptionsRetrievalFiltersUnionMember1Filter", ] @@ -43,6 +39,7 @@ class AISearchOptionsQueryRewrite(TypedDict, total=False): model: Literal[ "@cf/meta/llama-3.3-70b-instruct-fp8-fast", + "@cf/zai-org/glm-4.7-flash", "@cf/meta/llama-3.1-8b-instruct-fast", "@cf/meta/llama-3.1-8b-instruct-fp8", "@cf/meta/llama-4-scout-17b-16e-instruct", @@ -81,37 +78,10 @@ class AISearchOptionsReranking(TypedDict, total=False): model: Literal["@cf/baai/bge-reranker-base", ""] -class AISearchOptionsRetrievalFiltersUnionMember0(TypedDict, total=False): - key: Required[str] - - type: Required[Literal["eq", "ne", "gt", "gte", "lt", "lte"]] - - value: Required[Union[str, float, bool]] - - -class AISearchOptionsRetrievalFiltersUnionMember1Filter(TypedDict, total=False): - key: Required[str] - - type: Required[Literal["eq", "ne", "gt", "gte", "lt", "lte"]] - - value: Required[Union[str, float, bool]] - - -class AISearchOptionsRetrievalFiltersUnionMember1(TypedDict, total=False): - filters: Required[Iterable[AISearchOptionsRetrievalFiltersUnionMember1Filter]] - - type: Required[Literal["and", "or"]] - - -AISearchOptionsRetrievalFilters: TypeAlias = Union[ - AISearchOptionsRetrievalFiltersUnionMember0, AISearchOptionsRetrievalFiltersUnionMember1 -] - - class AISearchOptionsRetrieval(TypedDict, total=False): context_expansion: int - filters: AISearchOptionsRetrievalFilters + filters: Dict[str, object] match_threshold: float @@ -119,6 +89,8 @@ class AISearchOptionsRetrieval(TypedDict, total=False): retrieval_type: Literal["vector", "keyword", "hybrid"] + return_on_failure: bool + class AISearchOptions(TypedDict, total=False): query_rewrite: AISearchOptionsQueryRewrite diff --git a/src/cloudflare/types/aisearch/instance_update_params.py b/src/cloudflare/types/aisearch/instance_update_params.py index b39743c1fac..b10b978c266 100644 --- a/src/cloudflare/types/aisearch/instance_update_params.py +++ b/src/cloudflare/types/aisearch/instance_update_params.py @@ -2,7 +2,7 @@ from __future__ import annotations -from typing import Dict, Iterable +from typing import Dict, Iterable, Optional from typing_extensions import Literal, Required, Annotated, TypedDict from ..._types import SequenceNotStr @@ -28,11 +28,12 @@ class InstanceUpdateParams(TypedDict, total=False): account_id: Required[str] - ai_gateway_id: str + ai_gateway_id: Optional[str] aisearch_model: Annotated[ Literal[ "@cf/meta/llama-3.3-70b-instruct-fp8-fast", + "@cf/zai-org/glm-4.7-flash", "@cf/meta/llama-3.1-8b-instruct-fast", "@cf/meta/llama-3.1-8b-instruct-fp8", "@cf/meta/llama-4-scout-17b-16e-instruct", @@ -101,6 +102,7 @@ class InstanceUpdateParams(TypedDict, total=False): rewrite_model: Literal[ "@cf/meta/llama-3.3-70b-instruct-fp8-fast", + "@cf/zai-org/glm-4.7-flash", "@cf/meta/llama-3.1-8b-instruct-fast", "@cf/meta/llama-3.1-8b-instruct-fp8", "@cf/meta/llama-4-scout-17b-16e-instruct", @@ -138,6 +140,7 @@ class InstanceUpdateParams(TypedDict, total=False): summarization_model: Literal[ "@cf/meta/llama-3.3-70b-instruct-fp8-fast", + "@cf/zai-org/glm-4.7-flash", "@cf/meta/llama-3.1-8b-instruct-fast", "@cf/meta/llama-3.1-8b-instruct-fp8", "@cf/meta/llama-4-scout-17b-16e-instruct", @@ -165,11 +168,11 @@ class InstanceUpdateParams(TypedDict, total=False): "", ] - system_prompt_aisearch: Annotated[str, PropertyInfo(alias="system_prompt_ai_search")] + system_prompt_aisearch: Annotated[Optional[str], PropertyInfo(alias="system_prompt_ai_search")] - system_prompt_index_summarization: str + system_prompt_index_summarization: Optional[str] - system_prompt_rewrite_query: str + system_prompt_rewrite_query: Optional[str] token_id: str @@ -192,6 +195,8 @@ class PublicEndpointParamsChatCompletionsEndpoint(TypedDict, total=False): class PublicEndpointParamsMcp(TypedDict, total=False): + description: str + disabled: bool """Disable MCP endpoint for this public endpoint""" diff --git a/src/cloudflare/types/aisearch/instance_update_response.py b/src/cloudflare/types/aisearch/instance_update_response.py index 76cecdbb792..1e0492d4534 100644 --- a/src/cloudflare/types/aisearch/instance_update_response.py +++ b/src/cloudflare/types/aisearch/instance_update_response.py @@ -43,6 +43,8 @@ class PublicEndpointParamsChatCompletionsEndpoint(BaseModel): class PublicEndpointParamsMcp(BaseModel): + description: Optional[str] = None + disabled: Optional[bool] = None """Disable MCP endpoint for this public endpoint""" @@ -131,14 +133,8 @@ class InstanceUpdateResponse(BaseModel): id: str """Use your AI Search ID.""" - account_id: str - - account_tag: str - created_at: datetime - internal_id: str - modified_at: datetime source: str @@ -152,6 +148,7 @@ class InstanceUpdateResponse(BaseModel): aisearch_model: Optional[ Literal[ "@cf/meta/llama-3.3-70b-instruct-fp8-fast", + "@cf/zai-org/glm-4.7-flash", "@cf/meta/llama-3.1-8b-instruct-fast", "@cf/meta/llama-3.1-8b-instruct-fp8", "@cf/meta/llama-4-scout-17b-16e-instruct", @@ -184,8 +181,6 @@ class InstanceUpdateResponse(BaseModel): cache_threshold: Optional[Literal["super_strict_match", "close_enough", "flexible_friend", "anything_goes"]] = None - chunk: Optional[bool] = None - chunk_overlap: Optional[int] = None chunk_size: Optional[int] = None @@ -209,8 +204,6 @@ class InstanceUpdateResponse(BaseModel): enable: Optional[bool] = None - engine_version: Optional[float] = None - hybrid_search_enabled: Optional[bool] = None last_activity: Optional[datetime] = None @@ -234,6 +227,7 @@ class InstanceUpdateResponse(BaseModel): rewrite_model: Optional[ Literal[ "@cf/meta/llama-3.3-70b-instruct-fp8-fast", + "@cf/zai-org/glm-4.7-flash", "@cf/meta/llama-3.1-8b-instruct-fast", "@cf/meta/llama-3.1-8b-instruct-fp8", "@cf/meta/llama-4-scout-17b-16e-instruct", @@ -270,45 +264,4 @@ class InstanceUpdateResponse(BaseModel): status: Optional[str] = None - summarization: Optional[bool] = None - - summarization_model: Optional[ - Literal[ - "@cf/meta/llama-3.3-70b-instruct-fp8-fast", - "@cf/meta/llama-3.1-8b-instruct-fast", - "@cf/meta/llama-3.1-8b-instruct-fp8", - "@cf/meta/llama-4-scout-17b-16e-instruct", - "@cf/qwen/qwen3-30b-a3b-fp8", - "@cf/deepseek-ai/deepseek-r1-distill-qwen-32b", - "@cf/moonshotai/kimi-k2-instruct", - "anthropic/claude-3-7-sonnet", - "anthropic/claude-sonnet-4", - "anthropic/claude-opus-4", - "anthropic/claude-3-5-haiku", - "cerebras/qwen-3-235b-a22b-instruct", - "cerebras/qwen-3-235b-a22b-thinking", - "cerebras/llama-3.3-70b", - "cerebras/llama-4-maverick-17b-128e-instruct", - "cerebras/llama-4-scout-17b-16e-instruct", - "cerebras/gpt-oss-120b", - "google-ai-studio/gemini-2.5-flash", - "google-ai-studio/gemini-2.5-pro", - "grok/grok-4", - "groq/llama-3.3-70b-versatile", - "groq/llama-3.1-8b-instant", - "openai/gpt-5", - "openai/gpt-5-mini", - "openai/gpt-5-nano", - "", - ] - ] = None - - system_prompt_aisearch: Optional[str] = FieldInfo(alias="system_prompt_ai_search", default=None) - - system_prompt_index_summarization: Optional[str] = None - - system_prompt_rewrite_query: Optional[str] = None - token_id: Optional[str] = None - - vectorize_active_namespace: Optional[str] = None diff --git a/src/cloudflare/types/aisearch/token_create_response.py b/src/cloudflare/types/aisearch/token_create_response.py index c452115f380..890d6979da3 100644 --- a/src/cloudflare/types/aisearch/token_create_response.py +++ b/src/cloudflare/types/aisearch/token_create_response.py @@ -11,14 +11,8 @@ class TokenCreateResponse(BaseModel): id: str - account_id: str - - account_tag: str - cf_api_id: str - cf_api_key: str - created_at: datetime modified_at: datetime @@ -32,5 +26,3 @@ class TokenCreateResponse(BaseModel): legacy: Optional[bool] = None modified_by: Optional[str] = None - - synced_at: Optional[datetime] = None diff --git a/src/cloudflare/types/aisearch/token_delete_response.py b/src/cloudflare/types/aisearch/token_delete_response.py index 18c34a2b30a..80331067158 100644 --- a/src/cloudflare/types/aisearch/token_delete_response.py +++ b/src/cloudflare/types/aisearch/token_delete_response.py @@ -11,14 +11,8 @@ class TokenDeleteResponse(BaseModel): id: str - account_id: str - - account_tag: str - cf_api_id: str - cf_api_key: str - created_at: datetime modified_at: datetime @@ -32,5 +26,3 @@ class TokenDeleteResponse(BaseModel): legacy: Optional[bool] = None modified_by: Optional[str] = None - - synced_at: Optional[datetime] = None diff --git a/src/cloudflare/types/aisearch/token_list_response.py b/src/cloudflare/types/aisearch/token_list_response.py index 4f55e5e18d4..2e806edb65c 100644 --- a/src/cloudflare/types/aisearch/token_list_response.py +++ b/src/cloudflare/types/aisearch/token_list_response.py @@ -11,14 +11,8 @@ class TokenListResponse(BaseModel): id: str - account_id: str - - account_tag: str - cf_api_id: str - cf_api_key: str - created_at: datetime modified_at: datetime @@ -32,5 +26,3 @@ class TokenListResponse(BaseModel): legacy: Optional[bool] = None modified_by: Optional[str] = None - - synced_at: Optional[datetime] = None diff --git a/src/cloudflare/types/aisearch/token_read_response.py b/src/cloudflare/types/aisearch/token_read_response.py index 54e861afb99..ad2203011a4 100644 --- a/src/cloudflare/types/aisearch/token_read_response.py +++ b/src/cloudflare/types/aisearch/token_read_response.py @@ -11,14 +11,8 @@ class TokenReadResponse(BaseModel): id: str - account_id: str - - account_tag: str - cf_api_id: str - cf_api_key: str - created_at: datetime modified_at: datetime @@ -32,5 +26,3 @@ class TokenReadResponse(BaseModel): legacy: Optional[bool] = None modified_by: Optional[str] = None - - synced_at: Optional[datetime] = None diff --git a/src/cloudflare/types/aisearch/token_update_response.py b/src/cloudflare/types/aisearch/token_update_response.py index 5ce9eae30af..2a993a8b99b 100644 --- a/src/cloudflare/types/aisearch/token_update_response.py +++ b/src/cloudflare/types/aisearch/token_update_response.py @@ -11,14 +11,8 @@ class TokenUpdateResponse(BaseModel): id: str - account_id: str - - account_tag: str - cf_api_id: str - cf_api_key: str - created_at: datetime modified_at: datetime @@ -32,5 +26,3 @@ class TokenUpdateResponse(BaseModel): legacy: Optional[bool] = None modified_by: Optional[str] = None - - synced_at: Optional[datetime] = None diff --git a/src/cloudflare/types/cloudforce_one/__init__.py b/src/cloudflare/types/cloudforce_one/__init__.py index 89926d23c3f..052512d6227 100644 --- a/src/cloudflare/types/cloudforce_one/__init__.py +++ b/src/cloudflare/types/cloudforce_one/__init__.py @@ -20,7 +20,6 @@ from .threat_event_list_response import ThreatEventListResponse as ThreatEventListResponse from .binary_storage_create_params import BinaryStorageCreateParams as BinaryStorageCreateParams from .threat_event_create_response import ThreatEventCreateResponse as ThreatEventCreateResponse -from .threat_event_delete_response import ThreatEventDeleteResponse as ThreatEventDeleteResponse from .binary_storage_create_response import BinaryStorageCreateResponse as BinaryStorageCreateResponse from .threat_event_bulk_create_params import ThreatEventBulkCreateParams as ThreatEventBulkCreateParams from .threat_event_bulk_create_response import ThreatEventBulkCreateResponse as ThreatEventBulkCreateResponse diff --git a/src/cloudflare/types/cloudforce_one/threat_event_delete_response.py b/src/cloudflare/types/cloudforce_one/threat_event_delete_response.py deleted file mode 100644 index cf389ba658b..00000000000 --- a/src/cloudflare/types/cloudforce_one/threat_event_delete_response.py +++ /dev/null @@ -1,9 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from ..._models import BaseModel - -__all__ = ["ThreatEventDeleteResponse"] - - -class ThreatEventDeleteResponse(BaseModel): - uuid: str diff --git a/src/cloudflare/types/custom_certificates/custom_certificate.py b/src/cloudflare/types/custom_certificates/custom_certificate.py index e68d4a7d256..7e148bfd616 100644 --- a/src/cloudflare/types/custom_certificates/custom_certificate.py +++ b/src/cloudflare/types/custom_certificates/custom_certificate.py @@ -51,17 +51,16 @@ class CustomCertificate(BaseModel): modified_on: Optional[datetime] = None """When the certificate was last modified.""" - policy: Optional[str] = None - """ - Specify the policy that determines the region where your private key will be - held locally. HTTPS connections to any excluded data center will still be fully - encrypted, but will incur some latency while Keyless SSL is used to complete the - handshake with the nearest allowed data center. Any combination of countries, - specified by their two letter country code - (https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements) - can be chosen, such as 'country: IN', as well as 'region: EU' which refers to - the EU region. If there are too few data centers satisfying the policy, it will - be rejected. + policy_restrictions: Optional[str] = None + """The policy restrictions returned by the API. + + This field is returned in responses when a policy has been set. The API accepts + the "policy" field in requests but returns this field as "policy_restrictions" + in responses. + + Specifies the region(s) where your private key can be held locally for optimal + TLS performance. Format is a boolean expression, for example: "(country: US) or + (region: EU)" """ priority: Optional[float] = None diff --git a/src/cloudflare/types/custom_certificates/custom_certificate_create_params.py b/src/cloudflare/types/custom_certificates/custom_certificate_create_params.py index e136cd19a8d..a14fc7f78de 100644 --- a/src/cloudflare/types/custom_certificates/custom_certificate_create_params.py +++ b/src/cloudflare/types/custom_certificates/custom_certificate_create_params.py @@ -28,6 +28,9 @@ class CustomCertificateCreateParams(TypedDict, total=False): chain, but does not otherwise modify it. """ + deploy: Literal["staging", "production"] + """The environment to deploy the certificate to, defaults to production""" + geo_restrictions: GeoRestrictionsParam """ Specify the region where your private key can be held locally for optimal TLS @@ -49,7 +52,9 @@ class CustomCertificateCreateParams(TypedDict, total=False): (https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements) can be chosen, such as 'country: IN', as well as 'region: EU' which refers to the EU region. If there are too few data centers satisfying the policy, it will - be rejected. + be rejected. Note: The API accepts this field as either "policy" or + "policy_restrictions" in requests. Responses return this field as + "policy_restrictions". example: "(country: US) or (region: EU)" """ type: Literal["legacy_custom", "sni_custom"] diff --git a/src/cloudflare/types/custom_certificates/custom_certificate_edit_params.py b/src/cloudflare/types/custom_certificates/custom_certificate_edit_params.py index d2c6545582f..37fafb42372 100644 --- a/src/cloudflare/types/custom_certificates/custom_certificate_edit_params.py +++ b/src/cloudflare/types/custom_certificates/custom_certificate_edit_params.py @@ -2,16 +2,15 @@ from __future__ import annotations -from typing import Union -from typing_extensions import Required, TypeAlias, TypedDict +from typing_extensions import Literal, Required, TypedDict from .geo_restrictions_param import GeoRestrictionsParam from ..custom_hostnames.bundle_method import BundleMethod -__all__ = ["CustomCertificateEditParams", "Variant0", "Variant1"] +__all__ = ["CustomCertificateEditParams"] -class Variant0(TypedDict, total=False): +class CustomCertificateEditParams(TypedDict, total=False): zone_id: Required[str] """Identifier.""" @@ -23,24 +22,11 @@ class Variant0(TypedDict, total=False): chain, but does not otherwise modify it. """ - -class Variant1(TypedDict, total=False): - zone_id: Required[str] - """Identifier.""" - - certificate: Required[str] + certificate: str """The zone's SSL certificate or certificate and the intermediate(s).""" - private_key: Required[str] - """The zone's private key.""" - - bundle_method: BundleMethod - """ - A ubiquitous bundle has the highest probability of being verified everywhere, - even by clients using outdated or unusual trust stores. An optimal bundle uses - the shortest chain and newest intermediates. And the force bundle verifies the - chain, but does not otherwise modify it. - """ + deploy: Literal["staging", "production"] + """The environment to deploy the certificate to, defaults to production""" geo_restrictions: GeoRestrictionsParam """ @@ -63,8 +49,10 @@ class Variant1(TypedDict, total=False): (https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements) can be chosen, such as 'country: IN', as well as 'region: EU' which refers to the EU region. If there are too few data centers satisfying the policy, it will - be rejected. + be rejected. Note: The API accepts this field as either "policy" or + "policy_restrictions" in requests. Responses return this field as + "policy_restrictions". example: "(country: US) or (region: EU)" """ - -CustomCertificateEditParams: TypeAlias = Union[Variant0, Variant1] + private_key: str + """The zone's private key.""" diff --git a/src/cloudflare/types/custom_hostnames/certificate_pack/certificate_update_response.py b/src/cloudflare/types/custom_hostnames/certificate_pack/certificate_update_response.py index fd789d39a14..b185a8a5dd0 100644 --- a/src/cloudflare/types/custom_hostnames/certificate_pack/certificate_update_response.py +++ b/src/cloudflare/types/custom_hostnames/certificate_pack/certificate_update_response.py @@ -12,15 +12,82 @@ __all__ = [ "CertificateUpdateResponse", + "OwnershipVerification", + "OwnershipVerificationHTTP", "SSL", + "SsldcvDelegationRecord", "SSLSettings", "SSLValidationError", "SSLValidationRecord", - "OwnershipVerification", - "OwnershipVerificationHTTP", ] +class OwnershipVerification(BaseModel): + """This is a record which can be placed to activate a hostname.""" + + name: Optional[str] = None + """DNS Name for record.""" + + type: Optional[Literal["txt"]] = None + """DNS Record type.""" + + value: Optional[str] = None + """Content for the record.""" + + +class OwnershipVerificationHTTP(BaseModel): + """ + This presents the token to be served by the given http url to activate a hostname. + """ + + http_body: Optional[str] = None + """Token to be served.""" + + http_url: Optional[str] = None + """ + The HTTP URL that will be checked during custom hostname verification and where + the customer should host the token. + """ + + +class SsldcvDelegationRecord(BaseModel): + cname: Optional[str] = None + """The CNAME record hostname for DCV delegation.""" + + cname_target: Optional[str] = None + """The CNAME record target value for DCV delegation.""" + + emails: Optional[List[str]] = None + """ + The set of email addresses that the certificate authority (CA) will use to + complete domain validation. + """ + + http_body: Optional[str] = None + """ + The content that the certificate authority (CA) will expect to find at the + http_url during the domain validation. + """ + + http_url: Optional[str] = None + """The url that will be checked during domain validation.""" + + status: Optional[str] = None + """Status of the validation record.""" + + txt_name: Optional[str] = None + """ + The hostname that the certificate authority (CA) will check for a TXT record + during domain validation . + """ + + txt_value: Optional[str] = None + """ + The TXT record that the certificate authority (CA) will check during domain + validation. + """ + + class SSLSettings(BaseModel): ciphers: Optional[List[str]] = None """An allowlist of ciphers for TLS termination. @@ -47,6 +114,12 @@ class SSLValidationError(BaseModel): class SSLValidationRecord(BaseModel): + cname: Optional[str] = None + """The CNAME record hostname for DCV delegation.""" + + cname_target: Optional[str] = None + """The CNAME record target value for DCV delegation.""" + emails: Optional[List[str]] = None """ The set of email addresses that the certificate authority (CA) will use to @@ -62,6 +135,9 @@ class SSLValidationRecord(BaseModel): http_url: Optional[str] = None """The url that will be checked during domain validation.""" + status: Optional[str] = None + """Status of the validation record.""" + txt_name: Optional[str] = None """ The hostname that the certificate authority (CA) will check for a TXT record @@ -99,6 +175,9 @@ class SSL(BaseModel): custom_key: Optional[str] = None """The key for a custom uploaded certificate.""" + dcv_delegation_records: Optional[List[SsldcvDelegationRecord]] = None + """DCV Delegation records for domain validation.""" + expires_on: Optional[datetime] = None """The time the custom certificate expires on.""" @@ -167,34 +246,6 @@ class SSL(BaseModel): """Indicates whether the certificate covers a wildcard.""" -class OwnershipVerification(BaseModel): - """This is a record which can be placed to activate a hostname.""" - - name: Optional[str] = None - """DNS Name for record.""" - - type: Optional[Literal["txt"]] = None - """DNS Record type.""" - - value: Optional[str] = None - """Content for the record.""" - - -class OwnershipVerificationHTTP(BaseModel): - """ - This presents the token to be served by the given http url to activate a hostname. - """ - - http_body: Optional[str] = None - """Token to be served.""" - - http_url: Optional[str] = None - """ - The HTTP URL that will be checked during custom hostname verification and where - the customer should host the token. - """ - - class CertificateUpdateResponse(BaseModel): id: str """Identifier.""" @@ -202,8 +253,6 @@ class CertificateUpdateResponse(BaseModel): hostname: str """The custom hostname that will point to your hostname via CNAME.""" - ssl: SSL - created_at: Optional[datetime] = None """This is the time the hostname was created.""" @@ -237,6 +286,8 @@ class CertificateUpdateResponse(BaseModel): hostname. """ + ssl: Optional[SSL] = None + status: Optional[ Literal[ "active", diff --git a/src/cloudflare/types/custom_hostnames/custom_hostname_create_response.py b/src/cloudflare/types/custom_hostnames/custom_hostname_create_response.py index a12bffbcc24..b77d55fb549 100644 --- a/src/cloudflare/types/custom_hostnames/custom_hostname_create_response.py +++ b/src/cloudflare/types/custom_hostnames/custom_hostname_create_response.py @@ -12,15 +12,82 @@ __all__ = [ "CustomHostnameCreateResponse", + "OwnershipVerification", + "OwnershipVerificationHTTP", "SSL", + "SsldcvDelegationRecord", "SSLSettings", "SSLValidationError", "SSLValidationRecord", - "OwnershipVerification", - "OwnershipVerificationHTTP", ] +class OwnershipVerification(BaseModel): + """This is a record which can be placed to activate a hostname.""" + + name: Optional[str] = None + """DNS Name for record.""" + + type: Optional[Literal["txt"]] = None + """DNS Record type.""" + + value: Optional[str] = None + """Content for the record.""" + + +class OwnershipVerificationHTTP(BaseModel): + """ + This presents the token to be served by the given http url to activate a hostname. + """ + + http_body: Optional[str] = None + """Token to be served.""" + + http_url: Optional[str] = None + """ + The HTTP URL that will be checked during custom hostname verification and where + the customer should host the token. + """ + + +class SsldcvDelegationRecord(BaseModel): + cname: Optional[str] = None + """The CNAME record hostname for DCV delegation.""" + + cname_target: Optional[str] = None + """The CNAME record target value for DCV delegation.""" + + emails: Optional[List[str]] = None + """ + The set of email addresses that the certificate authority (CA) will use to + complete domain validation. + """ + + http_body: Optional[str] = None + """ + The content that the certificate authority (CA) will expect to find at the + http_url during the domain validation. + """ + + http_url: Optional[str] = None + """The url that will be checked during domain validation.""" + + status: Optional[str] = None + """Status of the validation record.""" + + txt_name: Optional[str] = None + """ + The hostname that the certificate authority (CA) will check for a TXT record + during domain validation . + """ + + txt_value: Optional[str] = None + """ + The TXT record that the certificate authority (CA) will check during domain + validation. + """ + + class SSLSettings(BaseModel): ciphers: Optional[List[str]] = None """An allowlist of ciphers for TLS termination. @@ -47,6 +114,12 @@ class SSLValidationError(BaseModel): class SSLValidationRecord(BaseModel): + cname: Optional[str] = None + """The CNAME record hostname for DCV delegation.""" + + cname_target: Optional[str] = None + """The CNAME record target value for DCV delegation.""" + emails: Optional[List[str]] = None """ The set of email addresses that the certificate authority (CA) will use to @@ -62,6 +135,9 @@ class SSLValidationRecord(BaseModel): http_url: Optional[str] = None """The url that will be checked during domain validation.""" + status: Optional[str] = None + """Status of the validation record.""" + txt_name: Optional[str] = None """ The hostname that the certificate authority (CA) will check for a TXT record @@ -99,6 +175,9 @@ class SSL(BaseModel): custom_key: Optional[str] = None """The key for a custom uploaded certificate.""" + dcv_delegation_records: Optional[List[SsldcvDelegationRecord]] = None + """DCV Delegation records for domain validation.""" + expires_on: Optional[datetime] = None """The time the custom certificate expires on.""" @@ -167,34 +246,6 @@ class SSL(BaseModel): """Indicates whether the certificate covers a wildcard.""" -class OwnershipVerification(BaseModel): - """This is a record which can be placed to activate a hostname.""" - - name: Optional[str] = None - """DNS Name for record.""" - - type: Optional[Literal["txt"]] = None - """DNS Record type.""" - - value: Optional[str] = None - """Content for the record.""" - - -class OwnershipVerificationHTTP(BaseModel): - """ - This presents the token to be served by the given http url to activate a hostname. - """ - - http_body: Optional[str] = None - """Token to be served.""" - - http_url: Optional[str] = None - """ - The HTTP URL that will be checked during custom hostname verification and where - the customer should host the token. - """ - - class CustomHostnameCreateResponse(BaseModel): id: str """Identifier.""" @@ -202,8 +253,6 @@ class CustomHostnameCreateResponse(BaseModel): hostname: str """The custom hostname that will point to your hostname via CNAME.""" - ssl: SSL - created_at: Optional[datetime] = None """This is the time the hostname was created.""" @@ -237,6 +286,8 @@ class CustomHostnameCreateResponse(BaseModel): hostname. """ + ssl: Optional[SSL] = None + status: Optional[ Literal[ "active", diff --git a/src/cloudflare/types/custom_hostnames/custom_hostname_edit_response.py b/src/cloudflare/types/custom_hostnames/custom_hostname_edit_response.py index 4fab5861d1f..70f6edab1ec 100644 --- a/src/cloudflare/types/custom_hostnames/custom_hostname_edit_response.py +++ b/src/cloudflare/types/custom_hostnames/custom_hostname_edit_response.py @@ -12,15 +12,82 @@ __all__ = [ "CustomHostnameEditResponse", + "OwnershipVerification", + "OwnershipVerificationHTTP", "SSL", + "SsldcvDelegationRecord", "SSLSettings", "SSLValidationError", "SSLValidationRecord", - "OwnershipVerification", - "OwnershipVerificationHTTP", ] +class OwnershipVerification(BaseModel): + """This is a record which can be placed to activate a hostname.""" + + name: Optional[str] = None + """DNS Name for record.""" + + type: Optional[Literal["txt"]] = None + """DNS Record type.""" + + value: Optional[str] = None + """Content for the record.""" + + +class OwnershipVerificationHTTP(BaseModel): + """ + This presents the token to be served by the given http url to activate a hostname. + """ + + http_body: Optional[str] = None + """Token to be served.""" + + http_url: Optional[str] = None + """ + The HTTP URL that will be checked during custom hostname verification and where + the customer should host the token. + """ + + +class SsldcvDelegationRecord(BaseModel): + cname: Optional[str] = None + """The CNAME record hostname for DCV delegation.""" + + cname_target: Optional[str] = None + """The CNAME record target value for DCV delegation.""" + + emails: Optional[List[str]] = None + """ + The set of email addresses that the certificate authority (CA) will use to + complete domain validation. + """ + + http_body: Optional[str] = None + """ + The content that the certificate authority (CA) will expect to find at the + http_url during the domain validation. + """ + + http_url: Optional[str] = None + """The url that will be checked during domain validation.""" + + status: Optional[str] = None + """Status of the validation record.""" + + txt_name: Optional[str] = None + """ + The hostname that the certificate authority (CA) will check for a TXT record + during domain validation . + """ + + txt_value: Optional[str] = None + """ + The TXT record that the certificate authority (CA) will check during domain + validation. + """ + + class SSLSettings(BaseModel): ciphers: Optional[List[str]] = None """An allowlist of ciphers for TLS termination. @@ -47,6 +114,12 @@ class SSLValidationError(BaseModel): class SSLValidationRecord(BaseModel): + cname: Optional[str] = None + """The CNAME record hostname for DCV delegation.""" + + cname_target: Optional[str] = None + """The CNAME record target value for DCV delegation.""" + emails: Optional[List[str]] = None """ The set of email addresses that the certificate authority (CA) will use to @@ -62,6 +135,9 @@ class SSLValidationRecord(BaseModel): http_url: Optional[str] = None """The url that will be checked during domain validation.""" + status: Optional[str] = None + """Status of the validation record.""" + txt_name: Optional[str] = None """ The hostname that the certificate authority (CA) will check for a TXT record @@ -99,6 +175,9 @@ class SSL(BaseModel): custom_key: Optional[str] = None """The key for a custom uploaded certificate.""" + dcv_delegation_records: Optional[List[SsldcvDelegationRecord]] = None + """DCV Delegation records for domain validation.""" + expires_on: Optional[datetime] = None """The time the custom certificate expires on.""" @@ -167,34 +246,6 @@ class SSL(BaseModel): """Indicates whether the certificate covers a wildcard.""" -class OwnershipVerification(BaseModel): - """This is a record which can be placed to activate a hostname.""" - - name: Optional[str] = None - """DNS Name for record.""" - - type: Optional[Literal["txt"]] = None - """DNS Record type.""" - - value: Optional[str] = None - """Content for the record.""" - - -class OwnershipVerificationHTTP(BaseModel): - """ - This presents the token to be served by the given http url to activate a hostname. - """ - - http_body: Optional[str] = None - """Token to be served.""" - - http_url: Optional[str] = None - """ - The HTTP URL that will be checked during custom hostname verification and where - the customer should host the token. - """ - - class CustomHostnameEditResponse(BaseModel): id: str """Identifier.""" @@ -202,8 +253,6 @@ class CustomHostnameEditResponse(BaseModel): hostname: str """The custom hostname that will point to your hostname via CNAME.""" - ssl: SSL - created_at: Optional[datetime] = None """This is the time the hostname was created.""" @@ -237,6 +286,8 @@ class CustomHostnameEditResponse(BaseModel): hostname. """ + ssl: Optional[SSL] = None + status: Optional[ Literal[ "active", diff --git a/src/cloudflare/types/custom_hostnames/custom_hostname_get_response.py b/src/cloudflare/types/custom_hostnames/custom_hostname_get_response.py index 53c6e8f704f..35dd449ebb4 100644 --- a/src/cloudflare/types/custom_hostnames/custom_hostname_get_response.py +++ b/src/cloudflare/types/custom_hostnames/custom_hostname_get_response.py @@ -12,15 +12,82 @@ __all__ = [ "CustomHostnameGetResponse", + "OwnershipVerification", + "OwnershipVerificationHTTP", "SSL", + "SsldcvDelegationRecord", "SSLSettings", "SSLValidationError", "SSLValidationRecord", - "OwnershipVerification", - "OwnershipVerificationHTTP", ] +class OwnershipVerification(BaseModel): + """This is a record which can be placed to activate a hostname.""" + + name: Optional[str] = None + """DNS Name for record.""" + + type: Optional[Literal["txt"]] = None + """DNS Record type.""" + + value: Optional[str] = None + """Content for the record.""" + + +class OwnershipVerificationHTTP(BaseModel): + """ + This presents the token to be served by the given http url to activate a hostname. + """ + + http_body: Optional[str] = None + """Token to be served.""" + + http_url: Optional[str] = None + """ + The HTTP URL that will be checked during custom hostname verification and where + the customer should host the token. + """ + + +class SsldcvDelegationRecord(BaseModel): + cname: Optional[str] = None + """The CNAME record hostname for DCV delegation.""" + + cname_target: Optional[str] = None + """The CNAME record target value for DCV delegation.""" + + emails: Optional[List[str]] = None + """ + The set of email addresses that the certificate authority (CA) will use to + complete domain validation. + """ + + http_body: Optional[str] = None + """ + The content that the certificate authority (CA) will expect to find at the + http_url during the domain validation. + """ + + http_url: Optional[str] = None + """The url that will be checked during domain validation.""" + + status: Optional[str] = None + """Status of the validation record.""" + + txt_name: Optional[str] = None + """ + The hostname that the certificate authority (CA) will check for a TXT record + during domain validation . + """ + + txt_value: Optional[str] = None + """ + The TXT record that the certificate authority (CA) will check during domain + validation. + """ + + class SSLSettings(BaseModel): ciphers: Optional[List[str]] = None """An allowlist of ciphers for TLS termination. @@ -47,6 +114,12 @@ class SSLValidationError(BaseModel): class SSLValidationRecord(BaseModel): + cname: Optional[str] = None + """The CNAME record hostname for DCV delegation.""" + + cname_target: Optional[str] = None + """The CNAME record target value for DCV delegation.""" + emails: Optional[List[str]] = None """ The set of email addresses that the certificate authority (CA) will use to @@ -62,6 +135,9 @@ class SSLValidationRecord(BaseModel): http_url: Optional[str] = None """The url that will be checked during domain validation.""" + status: Optional[str] = None + """Status of the validation record.""" + txt_name: Optional[str] = None """ The hostname that the certificate authority (CA) will check for a TXT record @@ -99,6 +175,9 @@ class SSL(BaseModel): custom_key: Optional[str] = None """The key for a custom uploaded certificate.""" + dcv_delegation_records: Optional[List[SsldcvDelegationRecord]] = None + """DCV Delegation records for domain validation.""" + expires_on: Optional[datetime] = None """The time the custom certificate expires on.""" @@ -167,34 +246,6 @@ class SSL(BaseModel): """Indicates whether the certificate covers a wildcard.""" -class OwnershipVerification(BaseModel): - """This is a record which can be placed to activate a hostname.""" - - name: Optional[str] = None - """DNS Name for record.""" - - type: Optional[Literal["txt"]] = None - """DNS Record type.""" - - value: Optional[str] = None - """Content for the record.""" - - -class OwnershipVerificationHTTP(BaseModel): - """ - This presents the token to be served by the given http url to activate a hostname. - """ - - http_body: Optional[str] = None - """Token to be served.""" - - http_url: Optional[str] = None - """ - The HTTP URL that will be checked during custom hostname verification and where - the customer should host the token. - """ - - class CustomHostnameGetResponse(BaseModel): id: str """Identifier.""" @@ -202,8 +253,6 @@ class CustomHostnameGetResponse(BaseModel): hostname: str """The custom hostname that will point to your hostname via CNAME.""" - ssl: SSL - created_at: Optional[datetime] = None """This is the time the hostname was created.""" @@ -237,6 +286,8 @@ class CustomHostnameGetResponse(BaseModel): hostname. """ + ssl: Optional[SSL] = None + status: Optional[ Literal[ "active", diff --git a/src/cloudflare/types/custom_hostnames/custom_hostname_list_response.py b/src/cloudflare/types/custom_hostnames/custom_hostname_list_response.py index aabb7ebf897..f6a27087477 100644 --- a/src/cloudflare/types/custom_hostnames/custom_hostname_list_response.py +++ b/src/cloudflare/types/custom_hostnames/custom_hostname_list_response.py @@ -12,15 +12,82 @@ __all__ = [ "CustomHostnameListResponse", + "OwnershipVerification", + "OwnershipVerificationHTTP", "SSL", + "SsldcvDelegationRecord", "SSLSettings", "SSLValidationError", "SSLValidationRecord", - "OwnershipVerification", - "OwnershipVerificationHTTP", ] +class OwnershipVerification(BaseModel): + """This is a record which can be placed to activate a hostname.""" + + name: Optional[str] = None + """DNS Name for record.""" + + type: Optional[Literal["txt"]] = None + """DNS Record type.""" + + value: Optional[str] = None + """Content for the record.""" + + +class OwnershipVerificationHTTP(BaseModel): + """ + This presents the token to be served by the given http url to activate a hostname. + """ + + http_body: Optional[str] = None + """Token to be served.""" + + http_url: Optional[str] = None + """ + The HTTP URL that will be checked during custom hostname verification and where + the customer should host the token. + """ + + +class SsldcvDelegationRecord(BaseModel): + cname: Optional[str] = None + """The CNAME record hostname for DCV delegation.""" + + cname_target: Optional[str] = None + """The CNAME record target value for DCV delegation.""" + + emails: Optional[List[str]] = None + """ + The set of email addresses that the certificate authority (CA) will use to + complete domain validation. + """ + + http_body: Optional[str] = None + """ + The content that the certificate authority (CA) will expect to find at the + http_url during the domain validation. + """ + + http_url: Optional[str] = None + """The url that will be checked during domain validation.""" + + status: Optional[str] = None + """Status of the validation record.""" + + txt_name: Optional[str] = None + """ + The hostname that the certificate authority (CA) will check for a TXT record + during domain validation . + """ + + txt_value: Optional[str] = None + """ + The TXT record that the certificate authority (CA) will check during domain + validation. + """ + + class SSLSettings(BaseModel): ciphers: Optional[List[str]] = None """An allowlist of ciphers for TLS termination. @@ -47,6 +114,12 @@ class SSLValidationError(BaseModel): class SSLValidationRecord(BaseModel): + cname: Optional[str] = None + """The CNAME record hostname for DCV delegation.""" + + cname_target: Optional[str] = None + """The CNAME record target value for DCV delegation.""" + emails: Optional[List[str]] = None """ The set of email addresses that the certificate authority (CA) will use to @@ -62,6 +135,9 @@ class SSLValidationRecord(BaseModel): http_url: Optional[str] = None """The url that will be checked during domain validation.""" + status: Optional[str] = None + """Status of the validation record.""" + txt_name: Optional[str] = None """ The hostname that the certificate authority (CA) will check for a TXT record @@ -99,6 +175,9 @@ class SSL(BaseModel): custom_key: Optional[str] = None """The key for a custom uploaded certificate.""" + dcv_delegation_records: Optional[List[SsldcvDelegationRecord]] = None + """DCV Delegation records for domain validation.""" + expires_on: Optional[datetime] = None """The time the custom certificate expires on.""" @@ -167,34 +246,6 @@ class SSL(BaseModel): """Indicates whether the certificate covers a wildcard.""" -class OwnershipVerification(BaseModel): - """This is a record which can be placed to activate a hostname.""" - - name: Optional[str] = None - """DNS Name for record.""" - - type: Optional[Literal["txt"]] = None - """DNS Record type.""" - - value: Optional[str] = None - """Content for the record.""" - - -class OwnershipVerificationHTTP(BaseModel): - """ - This presents the token to be served by the given http url to activate a hostname. - """ - - http_body: Optional[str] = None - """Token to be served.""" - - http_url: Optional[str] = None - """ - The HTTP URL that will be checked during custom hostname verification and where - the customer should host the token. - """ - - class CustomHostnameListResponse(BaseModel): id: str """Identifier.""" @@ -202,8 +253,6 @@ class CustomHostnameListResponse(BaseModel): hostname: str """The custom hostname that will point to your hostname via CNAME.""" - ssl: SSL - created_at: Optional[datetime] = None """This is the time the hostname was created.""" @@ -237,6 +286,8 @@ class CustomHostnameListResponse(BaseModel): hostname. """ + ssl: Optional[SSL] = None + status: Optional[ Literal[ "active", diff --git a/src/cloudflare/types/email_security/investigate_list_params.py b/src/cloudflare/types/email_security/investigate_list_params.py index 8d1ee8bc1a6..9c5fa4e2ab5 100644 --- a/src/cloudflare/types/email_security/investigate_list_params.py +++ b/src/cloudflare/types/email_security/investigate_list_params.py @@ -29,7 +29,7 @@ class InvestigateListParams(TypedDict, total=False): """The sender domains the search filters by.""" end: Annotated[Union[str, datetime], PropertyInfo(format="iso8601")] - """The end of the search date range. Defaults to `now`.""" + """The end of the search date range. Defaults to `now` if not provided.""" final_disposition: Literal["MALICIOUS", "SUSPICIOUS", "SPOOF", "SPAM", "BULK", "NONE"] """The dispositions the search filters by.""" @@ -79,6 +79,9 @@ class InvestigateListParams(TypedDict, total=False): sender: str start: Annotated[Union[str, datetime], PropertyInfo(format="iso8601")] - """The beginning of the search date range. Defaults to `now - 30 days`.""" + """ + The beginning of the search date range. Defaults to `now - 30 days` if not + provided. + """ subject: str diff --git a/src/cloudflare/types/email_security/submission_list_params.py b/src/cloudflare/types/email_security/submission_list_params.py index 2114d3c0e9d..de2f513a2fc 100644 --- a/src/cloudflare/types/email_security/submission_list_params.py +++ b/src/cloudflare/types/email_security/submission_list_params.py @@ -16,7 +16,7 @@ class SubmissionListParams(TypedDict, total=False): """Account Identifier""" end: Annotated[Union[str, datetime], PropertyInfo(format="iso8601")] - """The end of the search date range. Defaults to `now`.""" + """The end of the search date range. Defaults to `now` if not provided.""" original_disposition: Literal["MALICIOUS", "SUSPICIOUS", "SPOOF", "SPAM", "BULK", "NONE"] @@ -33,7 +33,10 @@ class SubmissionListParams(TypedDict, total=False): 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`.""" + """ + The beginning of the search date range. Defaults to `now - 30 days` if not + provided. + """ status: str diff --git a/src/cloudflare/types/queues/__init__.py b/src/cloudflare/types/queues/__init__.py index 2d25382356d..422b48fbad6 100644 --- a/src/cloudflare/types/queues/__init__.py +++ b/src/cloudflare/types/queues/__init__.py @@ -3,7 +3,6 @@ from __future__ import annotations from .queue import Queue as Queue -from .consumer import Consumer as Consumer from .queue_edit_params import QueueEditParams as QueueEditParams from .message_ack_params import MessageAckParams as MessageAckParams from .purge_start_params import PurgeStartParams as PurgeStartParams @@ -12,13 +11,17 @@ from .queue_create_params import QueueCreateParams as QueueCreateParams from .queue_update_params import QueueUpdateParams as QueueUpdateParams from .message_ack_response import MessageAckResponse as MessageAckResponse +from .consumer_get_response import ConsumerGetResponse as ConsumerGetResponse from .message_pull_response import MessagePullResponse as MessagePullResponse from .message_push_response import MessagePushResponse as MessagePushResponse from .purge_status_response import PurgeStatusResponse as PurgeStatusResponse from .queue_delete_response import QueueDeleteResponse as QueueDeleteResponse from .consumer_create_params import ConsumerCreateParams as ConsumerCreateParams +from .consumer_list_response import ConsumerListResponse as ConsumerListResponse from .consumer_update_params import ConsumerUpdateParams as ConsumerUpdateParams +from .consumer_create_response import ConsumerCreateResponse as ConsumerCreateResponse from .consumer_delete_response import ConsumerDeleteResponse as ConsumerDeleteResponse +from .consumer_update_response import ConsumerUpdateResponse as ConsumerUpdateResponse from .message_bulk_push_params import MessageBulkPushParams as MessageBulkPushParams from .subscription_list_params import SubscriptionListParams as SubscriptionListParams from .subscription_get_response import SubscriptionGetResponse as SubscriptionGetResponse diff --git a/src/cloudflare/types/queues/consumer_create_params.py b/src/cloudflare/types/queues/consumer_create_params.py index d3c2f29e14d..7aa340053a2 100644 --- a/src/cloudflare/types/queues/consumer_create_params.py +++ b/src/cloudflare/types/queues/consumer_create_params.py @@ -7,28 +7,28 @@ __all__ = [ "ConsumerCreateParams", - "MqWorkerConsumer", - "MqWorkerConsumerSettings", - "MqHTTPConsumer", - "MqHTTPConsumerSettings", + "MqWorkerConsumerRequest", + "MqWorkerConsumerRequestSettings", + "MqHTTPConsumerRequest", + "MqHTTPConsumerRequestSettings", ] -class MqWorkerConsumer(TypedDict, total=False): +class MqWorkerConsumerRequest(TypedDict, total=False): account_id: Required[str] """A Resource identifier.""" - dead_letter_queue: str - - script_name: str + script_name: Required[str] """Name of a Worker""" - settings: MqWorkerConsumerSettings + type: Required[Literal["worker"]] + + dead_letter_queue: str - type: Literal["worker"] + settings: MqWorkerConsumerRequestSettings -class MqWorkerConsumerSettings(TypedDict, total=False): +class MqWorkerConsumerRequestSettings(TypedDict, total=False): batch_size: float """The maximum number of messages to include in a batch.""" @@ -54,18 +54,18 @@ class MqWorkerConsumerSettings(TypedDict, total=False): """ -class MqHTTPConsumer(TypedDict, total=False): +class MqHTTPConsumerRequest(TypedDict, total=False): account_id: Required[str] """A Resource identifier.""" - dead_letter_queue: str + type: Required[Literal["http_pull"]] - settings: MqHTTPConsumerSettings + dead_letter_queue: str - type: Literal["http_pull"] + settings: MqHTTPConsumerRequestSettings -class MqHTTPConsumerSettings(TypedDict, total=False): +class MqHTTPConsumerRequestSettings(TypedDict, total=False): batch_size: float """The maximum number of messages to include in a batch.""" @@ -85,4 +85,4 @@ class MqHTTPConsumerSettings(TypedDict, total=False): """ -ConsumerCreateParams: TypeAlias = Union[MqWorkerConsumer, MqHTTPConsumer] +ConsumerCreateParams: TypeAlias = Union[MqWorkerConsumerRequest, MqHTTPConsumerRequest] diff --git a/src/cloudflare/types/queues/consumer_create_response.py b/src/cloudflare/types/queues/consumer_create_response.py new file mode 100644 index 00000000000..d72756d1a80 --- /dev/null +++ b/src/cloudflare/types/queues/consumer_create_response.py @@ -0,0 +1,102 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Union, Optional +from datetime import datetime +from typing_extensions import Literal, Annotated, TypeAlias + +from ..._utils import PropertyInfo +from ..._models import BaseModel + +__all__ = [ + "ConsumerCreateResponse", + "MqWorkerConsumerResponse", + "MqWorkerConsumerResponseSettings", + "MqHTTPConsumerResponse", + "MqHTTPConsumerResponseSettings", +] + + +class MqWorkerConsumerResponseSettings(BaseModel): + batch_size: Optional[float] = None + """The maximum number of messages to include in a batch.""" + + max_concurrency: Optional[float] = None + """Maximum number of concurrent consumers that may consume from this Queue. + + Set to `null` to automatically opt in to the platform's maximum (recommended). + """ + + max_retries: Optional[float] = None + """The maximum number of retries""" + + max_wait_time_ms: Optional[float] = None + """ + The number of milliseconds to wait for a batch to fill up before attempting to + deliver it + """ + + retry_delay: Optional[float] = None + """ + The number of seconds to delay before making the message available for another + attempt. + """ + + +class MqWorkerConsumerResponse(BaseModel): + consumer_id: Optional[str] = None + """A Resource identifier.""" + + created_on: Optional[datetime] = None + + dead_letter_queue: Optional[str] = None + """Name of the dead letter queue, or empty string if not configured""" + + queue_name: Optional[str] = None + + script_name: Optional[str] = None + """Name of a Worker""" + + settings: Optional[MqWorkerConsumerResponseSettings] = None + + type: Optional[Literal["worker"]] = None + + +class MqHTTPConsumerResponseSettings(BaseModel): + batch_size: Optional[float] = None + """The maximum number of messages to include in a batch.""" + + max_retries: Optional[float] = None + """The maximum number of retries""" + + retry_delay: Optional[float] = None + """ + The number of seconds to delay before making the message available for another + attempt. + """ + + visibility_timeout_ms: Optional[float] = None + """The number of milliseconds that a message is exclusively leased. + + After the timeout, the message becomes available for another attempt. + """ + + +class MqHTTPConsumerResponse(BaseModel): + consumer_id: Optional[str] = None + """A Resource identifier.""" + + created_on: Optional[datetime] = None + + dead_letter_queue: Optional[str] = None + """Name of the dead letter queue, or empty string if not configured""" + + queue_name: Optional[str] = None + + settings: Optional[MqHTTPConsumerResponseSettings] = None + + type: Optional[Literal["http_pull"]] = None + + +ConsumerCreateResponse: TypeAlias = Annotated[ + Union[MqWorkerConsumerResponse, MqHTTPConsumerResponse], PropertyInfo(discriminator="type") +] diff --git a/src/cloudflare/types/queues/consumer.py b/src/cloudflare/types/queues/consumer_get_response.py similarity index 58% rename from src/cloudflare/types/queues/consumer.py rename to src/cloudflare/types/queues/consumer_get_response.py index 9c0070c3734..7e71f34fa48 100644 --- a/src/cloudflare/types/queues/consumer.py +++ b/src/cloudflare/types/queues/consumer_get_response.py @@ -1,14 +1,22 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. from typing import Union, Optional -from typing_extensions import Literal, TypeAlias +from datetime import datetime +from typing_extensions import Literal, Annotated, TypeAlias +from ..._utils import PropertyInfo from ..._models import BaseModel -__all__ = ["Consumer", "MqWorkerConsumer", "MqWorkerConsumerSettings", "MqHTTPConsumer", "MqHTTPConsumerSettings"] +__all__ = [ + "ConsumerGetResponse", + "MqWorkerConsumerResponse", + "MqWorkerConsumerResponseSettings", + "MqHTTPConsumerResponse", + "MqHTTPConsumerResponseSettings", +] -class MqWorkerConsumerSettings(BaseModel): +class MqWorkerConsumerResponseSettings(BaseModel): batch_size: Optional[float] = None """The maximum number of messages to include in a batch.""" @@ -34,24 +42,26 @@ class MqWorkerConsumerSettings(BaseModel): """ -class MqWorkerConsumer(BaseModel): +class MqWorkerConsumerResponse(BaseModel): consumer_id: Optional[str] = None """A Resource identifier.""" - created_on: Optional[str] = None + created_on: Optional[datetime] = None - queue_id: Optional[str] = None - """A Resource identifier.""" + dead_letter_queue: Optional[str] = None + """Name of the dead letter queue, or empty string if not configured""" + + queue_name: Optional[str] = None - script: Optional[str] = None + script_name: Optional[str] = None """Name of a Worker""" - settings: Optional[MqWorkerConsumerSettings] = None + settings: Optional[MqWorkerConsumerResponseSettings] = None type: Optional[Literal["worker"]] = None -class MqHTTPConsumerSettings(BaseModel): +class MqHTTPConsumerResponseSettings(BaseModel): batch_size: Optional[float] = None """The maximum number of messages to include in a batch.""" @@ -71,18 +81,22 @@ class MqHTTPConsumerSettings(BaseModel): """ -class MqHTTPConsumer(BaseModel): +class MqHTTPConsumerResponse(BaseModel): consumer_id: Optional[str] = None """A Resource identifier.""" - created_on: Optional[str] = None + created_on: Optional[datetime] = None - queue_id: Optional[str] = None - """A Resource identifier.""" + dead_letter_queue: Optional[str] = None + """Name of the dead letter queue, or empty string if not configured""" + + queue_name: Optional[str] = None - settings: Optional[MqHTTPConsumerSettings] = None + settings: Optional[MqHTTPConsumerResponseSettings] = None type: Optional[Literal["http_pull"]] = None -Consumer: TypeAlias = Union[MqWorkerConsumer, MqHTTPConsumer] +ConsumerGetResponse: TypeAlias = Annotated[ + Union[MqWorkerConsumerResponse, MqHTTPConsumerResponse], PropertyInfo(discriminator="type") +] diff --git a/src/cloudflare/types/queues/consumer_list_response.py b/src/cloudflare/types/queues/consumer_list_response.py new file mode 100644 index 00000000000..3e2a54834f7 --- /dev/null +++ b/src/cloudflare/types/queues/consumer_list_response.py @@ -0,0 +1,102 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Union, Optional +from datetime import datetime +from typing_extensions import Literal, Annotated, TypeAlias + +from ..._utils import PropertyInfo +from ..._models import BaseModel + +__all__ = [ + "ConsumerListResponse", + "MqWorkerConsumerResponse", + "MqWorkerConsumerResponseSettings", + "MqHTTPConsumerResponse", + "MqHTTPConsumerResponseSettings", +] + + +class MqWorkerConsumerResponseSettings(BaseModel): + batch_size: Optional[float] = None + """The maximum number of messages to include in a batch.""" + + max_concurrency: Optional[float] = None + """Maximum number of concurrent consumers that may consume from this Queue. + + Set to `null` to automatically opt in to the platform's maximum (recommended). + """ + + max_retries: Optional[float] = None + """The maximum number of retries""" + + max_wait_time_ms: Optional[float] = None + """ + The number of milliseconds to wait for a batch to fill up before attempting to + deliver it + """ + + retry_delay: Optional[float] = None + """ + The number of seconds to delay before making the message available for another + attempt. + """ + + +class MqWorkerConsumerResponse(BaseModel): + consumer_id: Optional[str] = None + """A Resource identifier.""" + + created_on: Optional[datetime] = None + + dead_letter_queue: Optional[str] = None + """Name of the dead letter queue, or empty string if not configured""" + + queue_name: Optional[str] = None + + script_name: Optional[str] = None + """Name of a Worker""" + + settings: Optional[MqWorkerConsumerResponseSettings] = None + + type: Optional[Literal["worker"]] = None + + +class MqHTTPConsumerResponseSettings(BaseModel): + batch_size: Optional[float] = None + """The maximum number of messages to include in a batch.""" + + max_retries: Optional[float] = None + """The maximum number of retries""" + + retry_delay: Optional[float] = None + """ + The number of seconds to delay before making the message available for another + attempt. + """ + + visibility_timeout_ms: Optional[float] = None + """The number of milliseconds that a message is exclusively leased. + + After the timeout, the message becomes available for another attempt. + """ + + +class MqHTTPConsumerResponse(BaseModel): + consumer_id: Optional[str] = None + """A Resource identifier.""" + + created_on: Optional[datetime] = None + + dead_letter_queue: Optional[str] = None + """Name of the dead letter queue, or empty string if not configured""" + + queue_name: Optional[str] = None + + settings: Optional[MqHTTPConsumerResponseSettings] = None + + type: Optional[Literal["http_pull"]] = None + + +ConsumerListResponse: TypeAlias = Annotated[ + Union[MqWorkerConsumerResponse, MqHTTPConsumerResponse], PropertyInfo(discriminator="type") +] diff --git a/src/cloudflare/types/queues/consumer_update_params.py b/src/cloudflare/types/queues/consumer_update_params.py index 1c75d7948f0..6be97557103 100644 --- a/src/cloudflare/types/queues/consumer_update_params.py +++ b/src/cloudflare/types/queues/consumer_update_params.py @@ -7,31 +7,31 @@ __all__ = [ "ConsumerUpdateParams", - "MqWorkerConsumer", - "MqWorkerConsumerSettings", - "MqHTTPConsumer", - "MqHTTPConsumerSettings", + "MqWorkerConsumerRequest", + "MqWorkerConsumerRequestSettings", + "MqHTTPConsumerRequest", + "MqHTTPConsumerRequestSettings", ] -class MqWorkerConsumer(TypedDict, total=False): +class MqWorkerConsumerRequest(TypedDict, total=False): account_id: Required[str] """A Resource identifier.""" queue_id: Required[str] """A Resource identifier.""" - dead_letter_queue: str - - script_name: str + script_name: Required[str] """Name of a Worker""" - settings: MqWorkerConsumerSettings + type: Required[Literal["worker"]] + + dead_letter_queue: str - type: Literal["worker"] + settings: MqWorkerConsumerRequestSettings -class MqWorkerConsumerSettings(TypedDict, total=False): +class MqWorkerConsumerRequestSettings(TypedDict, total=False): batch_size: float """The maximum number of messages to include in a batch.""" @@ -57,21 +57,21 @@ class MqWorkerConsumerSettings(TypedDict, total=False): """ -class MqHTTPConsumer(TypedDict, total=False): +class MqHTTPConsumerRequest(TypedDict, total=False): account_id: Required[str] """A Resource identifier.""" queue_id: Required[str] """A Resource identifier.""" - dead_letter_queue: str + type: Required[Literal["http_pull"]] - settings: MqHTTPConsumerSettings + dead_letter_queue: str - type: Literal["http_pull"] + settings: MqHTTPConsumerRequestSettings -class MqHTTPConsumerSettings(TypedDict, total=False): +class MqHTTPConsumerRequestSettings(TypedDict, total=False): batch_size: float """The maximum number of messages to include in a batch.""" @@ -91,4 +91,4 @@ class MqHTTPConsumerSettings(TypedDict, total=False): """ -ConsumerUpdateParams: TypeAlias = Union[MqWorkerConsumer, MqHTTPConsumer] +ConsumerUpdateParams: TypeAlias = Union[MqWorkerConsumerRequest, MqHTTPConsumerRequest] diff --git a/src/cloudflare/types/queues/consumer_update_response.py b/src/cloudflare/types/queues/consumer_update_response.py new file mode 100644 index 00000000000..fb09236fdf5 --- /dev/null +++ b/src/cloudflare/types/queues/consumer_update_response.py @@ -0,0 +1,102 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Union, Optional +from datetime import datetime +from typing_extensions import Literal, Annotated, TypeAlias + +from ..._utils import PropertyInfo +from ..._models import BaseModel + +__all__ = [ + "ConsumerUpdateResponse", + "MqWorkerConsumerResponse", + "MqWorkerConsumerResponseSettings", + "MqHTTPConsumerResponse", + "MqHTTPConsumerResponseSettings", +] + + +class MqWorkerConsumerResponseSettings(BaseModel): + batch_size: Optional[float] = None + """The maximum number of messages to include in a batch.""" + + max_concurrency: Optional[float] = None + """Maximum number of concurrent consumers that may consume from this Queue. + + Set to `null` to automatically opt in to the platform's maximum (recommended). + """ + + max_retries: Optional[float] = None + """The maximum number of retries""" + + max_wait_time_ms: Optional[float] = None + """ + The number of milliseconds to wait for a batch to fill up before attempting to + deliver it + """ + + retry_delay: Optional[float] = None + """ + The number of seconds to delay before making the message available for another + attempt. + """ + + +class MqWorkerConsumerResponse(BaseModel): + consumer_id: Optional[str] = None + """A Resource identifier.""" + + created_on: Optional[datetime] = None + + dead_letter_queue: Optional[str] = None + """Name of the dead letter queue, or empty string if not configured""" + + queue_name: Optional[str] = None + + script_name: Optional[str] = None + """Name of a Worker""" + + settings: Optional[MqWorkerConsumerResponseSettings] = None + + type: Optional[Literal["worker"]] = None + + +class MqHTTPConsumerResponseSettings(BaseModel): + batch_size: Optional[float] = None + """The maximum number of messages to include in a batch.""" + + max_retries: Optional[float] = None + """The maximum number of retries""" + + retry_delay: Optional[float] = None + """ + The number of seconds to delay before making the message available for another + attempt. + """ + + visibility_timeout_ms: Optional[float] = None + """The number of milliseconds that a message is exclusively leased. + + After the timeout, the message becomes available for another attempt. + """ + + +class MqHTTPConsumerResponse(BaseModel): + consumer_id: Optional[str] = None + """A Resource identifier.""" + + created_on: Optional[datetime] = None + + dead_letter_queue: Optional[str] = None + """Name of the dead letter queue, or empty string if not configured""" + + queue_name: Optional[str] = None + + settings: Optional[MqHTTPConsumerResponseSettings] = None + + type: Optional[Literal["http_pull"]] = None + + +ConsumerUpdateResponse: TypeAlias = Annotated[ + Union[MqWorkerConsumerResponse, MqHTTPConsumerResponse], PropertyInfo(discriminator="type") +] diff --git a/src/cloudflare/types/queues/queue.py b/src/cloudflare/types/queues/queue.py index 9db9ab26583..fc351960f97 100644 --- a/src/cloudflare/types/queues/queue.py +++ b/src/cloudflare/types/queues/queue.py @@ -1,12 +1,110 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. from typing import List, Union, Optional -from typing_extensions import Literal, TypeAlias +from datetime import datetime +from typing_extensions import Literal, Annotated, TypeAlias -from .consumer import Consumer +from ..._utils import PropertyInfo from ..._models import BaseModel -__all__ = ["Queue", "Producer", "ProducerMqWorkerProducer", "ProducerMqR2Producer", "Settings"] +__all__ = [ + "Queue", + "Consumer", + "ConsumerMqWorkerConsumerResponse", + "ConsumerMqWorkerConsumerResponseSettings", + "ConsumerMqHTTPConsumerResponse", + "ConsumerMqHTTPConsumerResponseSettings", + "Producer", + "ProducerMqWorkerProducer", + "ProducerMqR2Producer", + "Settings", +] + + +class ConsumerMqWorkerConsumerResponseSettings(BaseModel): + batch_size: Optional[float] = None + """The maximum number of messages to include in a batch.""" + + max_concurrency: Optional[float] = None + """Maximum number of concurrent consumers that may consume from this Queue. + + Set to `null` to automatically opt in to the platform's maximum (recommended). + """ + + max_retries: Optional[float] = None + """The maximum number of retries""" + + max_wait_time_ms: Optional[float] = None + """ + The number of milliseconds to wait for a batch to fill up before attempting to + deliver it + """ + + retry_delay: Optional[float] = None + """ + The number of seconds to delay before making the message available for another + attempt. + """ + + +class ConsumerMqWorkerConsumerResponse(BaseModel): + consumer_id: Optional[str] = None + """A Resource identifier.""" + + created_on: Optional[datetime] = None + + dead_letter_queue: Optional[str] = None + """Name of the dead letter queue, or empty string if not configured""" + + queue_name: Optional[str] = None + + script_name: Optional[str] = None + """Name of a Worker""" + + settings: Optional[ConsumerMqWorkerConsumerResponseSettings] = None + + type: Optional[Literal["worker"]] = None + + +class ConsumerMqHTTPConsumerResponseSettings(BaseModel): + batch_size: Optional[float] = None + """The maximum number of messages to include in a batch.""" + + max_retries: Optional[float] = None + """The maximum number of retries""" + + retry_delay: Optional[float] = None + """ + The number of seconds to delay before making the message available for another + attempt. + """ + + visibility_timeout_ms: Optional[float] = None + """The number of milliseconds that a message is exclusively leased. + + After the timeout, the message becomes available for another attempt. + """ + + +class ConsumerMqHTTPConsumerResponse(BaseModel): + consumer_id: Optional[str] = None + """A Resource identifier.""" + + created_on: Optional[datetime] = None + + dead_letter_queue: Optional[str] = None + """Name of the dead letter queue, or empty string if not configured""" + + queue_name: Optional[str] = None + + settings: Optional[ConsumerMqHTTPConsumerResponseSettings] = None + + type: Optional[Literal["http_pull"]] = None + + +Consumer: TypeAlias = Annotated[ + Union[ConsumerMqWorkerConsumerResponse, ConsumerMqHTTPConsumerResponse], PropertyInfo(discriminator="type") +] class ProducerMqWorkerProducer(BaseModel): diff --git a/src/cloudflare/types/r2/super_slurper/connectivity_precheck_source_params.py b/src/cloudflare/types/r2/super_slurper/connectivity_precheck_source_params.py index 3164e57b396..20b4aef74f0 100644 --- a/src/cloudflare/types/r2/super_slurper/connectivity_precheck_source_params.py +++ b/src/cloudflare/types/r2/super_slurper/connectivity_precheck_source_params.py @@ -5,6 +5,7 @@ from typing import Union, Optional from typing_extensions import Literal, Required, Annotated, TypeAlias, TypedDict +from ...._types import SequenceNotStr from ...._utils import PropertyInfo from ..buckets.provider import Provider @@ -30,6 +31,8 @@ class R2SlurperS3SourceSchema(TypedDict, total=False): endpoint: Optional[str] + keys: Optional[SequenceNotStr[str]] + path_prefix: Annotated[Optional[str], PropertyInfo(alias="pathPrefix")] region: Optional[str] @@ -50,6 +53,8 @@ class R2SlurperGcsSourceSchema(TypedDict, total=False): vendor: Required[Literal["gcs"]] + keys: Optional[SequenceNotStr[str]] + path_prefix: Annotated[Optional[str], PropertyInfo(alias="pathPrefix")] @@ -70,6 +75,8 @@ class R2SlurperR2SourceSchema(TypedDict, total=False): jurisdiction: Literal["default", "eu", "fedramp"] + keys: Optional[SequenceNotStr[str]] + path_prefix: Annotated[Optional[str], PropertyInfo(alias="pathPrefix")] diff --git a/src/cloudflare/types/r2/super_slurper/job_create_params.py b/src/cloudflare/types/r2/super_slurper/job_create_params.py index 47b97470a39..7c1a4c133e6 100644 --- a/src/cloudflare/types/r2/super_slurper/job_create_params.py +++ b/src/cloudflare/types/r2/super_slurper/job_create_params.py @@ -5,6 +5,7 @@ from typing import Union, Optional from typing_extensions import Literal, Required, Annotated, TypeAlias, TypedDict +from ...._types import SequenceNotStr from ...._utils import PropertyInfo from ..buckets.provider import Provider @@ -47,6 +48,8 @@ class SourceR2SlurperS3SourceSchema(TypedDict, total=False): endpoint: Optional[str] + keys: Optional[SequenceNotStr[str]] + path_prefix: Annotated[Optional[str], PropertyInfo(alias="pathPrefix")] region: Optional[str] @@ -65,6 +68,8 @@ class SourceR2SlurperGcsSourceSchema(TypedDict, total=False): vendor: Required[Literal["gcs"]] + keys: Optional[SequenceNotStr[str]] + path_prefix: Annotated[Optional[str], PropertyInfo(alias="pathPrefix")] @@ -83,6 +88,8 @@ class SourceR2SlurperR2SourceSchema(TypedDict, total=False): jurisdiction: Literal["default", "eu", "fedramp"] + keys: Optional[SequenceNotStr[str]] + path_prefix: Annotated[Optional[str], PropertyInfo(alias="pathPrefix")] diff --git a/src/cloudflare/types/radar/ai/bot_summary_v2_params.py b/src/cloudflare/types/radar/ai/bot_summary_v2_params.py index 047f6066c73..0810ee2579b 100644 --- a/src/cloudflare/types/radar/ai/bot_summary_v2_params.py +++ b/src/cloudflare/types/radar/ai/bot_summary_v2_params.py @@ -2,7 +2,7 @@ from __future__ import annotations -from typing import Union +from typing import List, Union from datetime import datetime from typing_extensions import Literal, Annotated, TypedDict @@ -21,6 +21,31 @@ class BotSummaryV2Params(TypedDict, total=False): results from AS174, but includes results from AS3356. """ + content_type: Annotated[ + List[ + Literal[ + "HTML", + "IMAGES", + "JSON", + "JAVASCRIPT", + "CSS", + "PLAIN_TEXT", + "FONTS", + "XML", + "YAML", + "VIDEO", + "AUDIO", + "MARKDOWN", + "DOCUMENTS", + "BINARY", + "SERIALIZATION", + "OTHER", + ] + ], + PropertyInfo(alias="contentType"), + ] + """Filters results by content type category.""" + continent: SequenceNotStr[str] """Filters results by continent. @@ -70,5 +95,8 @@ class BotSummaryV2Params(TypedDict, total=False): name: SequenceNotStr[str] """Array of names used to label the series in the response.""" + user_agent: Annotated[SequenceNotStr[str], PropertyInfo(alias="userAgent")] + """Filters results by user agent.""" + vertical: SequenceNotStr[str] """Filters results by vertical.""" diff --git a/src/cloudflare/types/radar/ai/bot_timeseries_groups_params.py b/src/cloudflare/types/radar/ai/bot_timeseries_groups_params.py index f67b5eb5569..c686eb359eb 100644 --- a/src/cloudflare/types/radar/ai/bot_timeseries_groups_params.py +++ b/src/cloudflare/types/radar/ai/bot_timeseries_groups_params.py @@ -2,7 +2,7 @@ from __future__ import annotations -from typing import Union +from typing import List, Union from datetime import datetime from typing_extensions import Literal, Annotated, TypedDict @@ -28,6 +28,31 @@ class BotTimeseriesGroupsParams(TypedDict, total=False): results from AS174, but includes results from AS3356. """ + content_type: Annotated[ + List[ + Literal[ + "HTML", + "IMAGES", + "JSON", + "JAVASCRIPT", + "CSS", + "PLAIN_TEXT", + "FONTS", + "XML", + "YAML", + "VIDEO", + "AUDIO", + "MARKDOWN", + "DOCUMENTS", + "BINARY", + "SERIALIZATION", + "OTHER", + ] + ], + PropertyInfo(alias="contentType"), + ] + """Filters results by content type category.""" + continent: SequenceNotStr[str] """Filters results by continent. @@ -77,12 +102,15 @@ class BotTimeseriesGroupsParams(TypedDict, total=False): name: SequenceNotStr[str] """Array of names used to label the series in the response.""" - normalization: Literal["PERCENTAGE_CHANGE", "MIN0_MAX"] + normalization: Literal["PERCENTAGE", "MIN0_MAX"] """Normalization method applied to the results. Refer to [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/). """ + user_agent: Annotated[SequenceNotStr[str], PropertyInfo(alias="userAgent")] + """Filters results by user agent.""" + vertical: SequenceNotStr[str] """Filters results by vertical.""" diff --git a/src/cloudflare/types/radar/ai/bot_timeseries_params.py b/src/cloudflare/types/radar/ai/bot_timeseries_params.py index 923174686fe..721c8ed81d6 100644 --- a/src/cloudflare/types/radar/ai/bot_timeseries_params.py +++ b/src/cloudflare/types/radar/ai/bot_timeseries_params.py @@ -2,7 +2,7 @@ from __future__ import annotations -from typing import Union +from typing import List, Union from datetime import datetime from typing_extensions import Literal, Annotated, TypedDict @@ -28,6 +28,31 @@ class BotTimeseriesParams(TypedDict, total=False): results from AS174, but includes results from AS3356. """ + content_type: Annotated[ + List[ + Literal[ + "HTML", + "IMAGES", + "JSON", + "JAVASCRIPT", + "CSS", + "PLAIN_TEXT", + "FONTS", + "XML", + "YAML", + "VIDEO", + "AUDIO", + "MARKDOWN", + "DOCUMENTS", + "BINARY", + "SERIALIZATION", + "OTHER", + ] + ], + PropertyInfo(alias="contentType"), + ] + """Filters results by content type category.""" + continent: SequenceNotStr[str] """Filters results by continent. diff --git a/src/cloudflare/types/radar/ai/timeseries_group_summary_params.py b/src/cloudflare/types/radar/ai/timeseries_group_summary_params.py index 3c9676e1319..75fdfde6aa1 100644 --- a/src/cloudflare/types/radar/ai/timeseries_group_summary_params.py +++ b/src/cloudflare/types/radar/ai/timeseries_group_summary_params.py @@ -2,7 +2,7 @@ from __future__ import annotations -from typing import Union +from typing import List, Union from datetime import datetime from typing_extensions import Literal, Annotated, TypedDict @@ -21,6 +21,31 @@ class TimeseriesGroupSummaryParams(TypedDict, total=False): results from AS174, but includes results from AS3356. """ + content_type: Annotated[ + List[ + Literal[ + "HTML", + "IMAGES", + "JSON", + "JAVASCRIPT", + "CSS", + "PLAIN_TEXT", + "FONTS", + "XML", + "YAML", + "VIDEO", + "AUDIO", + "MARKDOWN", + "DOCUMENTS", + "BINARY", + "SERIALIZATION", + "OTHER", + ] + ], + PropertyInfo(alias="contentType"), + ] + """Filters results by content type category.""" + continent: SequenceNotStr[str] """Filters results by continent. @@ -70,5 +95,8 @@ class TimeseriesGroupSummaryParams(TypedDict, total=False): name: SequenceNotStr[str] """Array of names used to label the series in the response.""" + user_agent: Annotated[SequenceNotStr[str], PropertyInfo(alias="userAgent")] + """Filters results by user agent.""" + vertical: SequenceNotStr[str] """Filters results by vertical.""" diff --git a/src/cloudflare/types/radar/ai/timeseries_group_timeseries_groups_params.py b/src/cloudflare/types/radar/ai/timeseries_group_timeseries_groups_params.py index c5d54b02a09..7dd1b964e90 100644 --- a/src/cloudflare/types/radar/ai/timeseries_group_timeseries_groups_params.py +++ b/src/cloudflare/types/radar/ai/timeseries_group_timeseries_groups_params.py @@ -2,7 +2,7 @@ from __future__ import annotations -from typing import Union +from typing import List, Union from datetime import datetime from typing_extensions import Literal, Annotated, TypedDict @@ -28,6 +28,31 @@ class TimeseriesGroupTimeseriesGroupsParams(TypedDict, total=False): results from AS174, but includes results from AS3356. """ + content_type: Annotated[ + List[ + Literal[ + "HTML", + "IMAGES", + "JSON", + "JAVASCRIPT", + "CSS", + "PLAIN_TEXT", + "FONTS", + "XML", + "YAML", + "VIDEO", + "AUDIO", + "MARKDOWN", + "DOCUMENTS", + "BINARY", + "SERIALIZATION", + "OTHER", + ] + ], + PropertyInfo(alias="contentType"), + ] + """Filters results by content type category.""" + continent: SequenceNotStr[str] """Filters results by continent. @@ -77,12 +102,15 @@ class TimeseriesGroupTimeseriesGroupsParams(TypedDict, total=False): name: SequenceNotStr[str] """Array of names used to label the series in the response.""" - normalization: Literal["PERCENTAGE_CHANGE", "MIN0_MAX"] + normalization: Literal["PERCENTAGE", "MIN0_MAX"] """Normalization method applied to the results. Refer to [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/). """ + user_agent: Annotated[SequenceNotStr[str], PropertyInfo(alias="userAgent")] + """Filters results by user agent.""" + vertical: SequenceNotStr[str] """Filters results by vertical.""" diff --git a/src/cloudflare/types/radar/ai/timeseries_group_timeseries_params.py b/src/cloudflare/types/radar/ai/timeseries_group_timeseries_params.py index cc74a76e020..64048c095e5 100644 --- a/src/cloudflare/types/radar/ai/timeseries_group_timeseries_params.py +++ b/src/cloudflare/types/radar/ai/timeseries_group_timeseries_params.py @@ -2,7 +2,7 @@ from __future__ import annotations -from typing import Union +from typing import List, Union from datetime import datetime from typing_extensions import Literal, Annotated, TypedDict @@ -28,6 +28,31 @@ class TimeseriesGroupTimeseriesParams(TypedDict, total=False): results from AS174, but includes results from AS3356. """ + content_type: Annotated[ + List[ + Literal[ + "HTML", + "IMAGES", + "JSON", + "JAVASCRIPT", + "CSS", + "PLAIN_TEXT", + "FONTS", + "XML", + "YAML", + "VIDEO", + "AUDIO", + "MARKDOWN", + "DOCUMENTS", + "BINARY", + "SERIALIZATION", + "OTHER", + ] + ], + PropertyInfo(alias="contentType"), + ] + """Filters results by content type category.""" + continent: SequenceNotStr[str] """Filters results by continent. diff --git a/src/cloudflare/types/rulesets/rule_create_params.py b/src/cloudflare/types/rulesets/rule_create_params.py index f563df717d4..a8435dbd1c2 100644 --- a/src/cloudflare/types/rulesets/rule_create_params.py +++ b/src/cloudflare/types/rulesets/rule_create_params.py @@ -3013,6 +3013,9 @@ class SetConfigurationRuleActionParameters(TypedDict, total=False): bic: bool """Whether to enable Browser Integrity Check (BIC).""" + content_converter: bool + """Whether to enable content conversion (e.g., HTML to Markdown).""" + disable_apps: Literal[True] """Whether to disable Cloudflare Apps.""" diff --git a/src/cloudflare/types/rulesets/rule_edit_params.py b/src/cloudflare/types/rulesets/rule_edit_params.py index 717b3e108cd..c3c46474390 100644 --- a/src/cloudflare/types/rulesets/rule_edit_params.py +++ b/src/cloudflare/types/rulesets/rule_edit_params.py @@ -3064,6 +3064,9 @@ class SetConfigurationRuleActionParameters(TypedDict, total=False): bic: bool """Whether to enable Browser Integrity Check (BIC).""" + content_converter: bool + """Whether to enable content conversion (e.g., HTML to Markdown).""" + disable_apps: Literal[True] """Whether to disable Cloudflare Apps.""" diff --git a/src/cloudflare/types/rulesets/set_config_rule.py b/src/cloudflare/types/rulesets/set_config_rule.py index b2f42a3957e..9aa19460bf5 100644 --- a/src/cloudflare/types/rulesets/set_config_rule.py +++ b/src/cloudflare/types/rulesets/set_config_rule.py @@ -35,6 +35,9 @@ class ActionParameters(BaseModel): bic: Optional[bool] = None """Whether to enable Browser Integrity Check (BIC).""" + content_converter: Optional[bool] = None + """Whether to enable content conversion (e.g., HTML to Markdown).""" + disable_apps: Optional[Literal[True]] = None """Whether to disable Cloudflare Apps.""" diff --git a/src/cloudflare/types/rulesets/set_config_rule_param.py b/src/cloudflare/types/rulesets/set_config_rule_param.py index b40b670d169..0bc012392d0 100644 --- a/src/cloudflare/types/rulesets/set_config_rule_param.py +++ b/src/cloudflare/types/rulesets/set_config_rule_param.py @@ -41,6 +41,9 @@ class ActionParameters(TypedDict, total=False): bic: bool """Whether to enable Browser Integrity Check (BIC).""" + content_converter: bool + """Whether to enable content conversion (e.g., HTML to Markdown).""" + disable_apps: Literal[True] """Whether to disable Cloudflare Apps.""" diff --git a/src/cloudflare/types/snippets/__init__.py b/src/cloudflare/types/snippets/__init__.py index 380f54adfbb..a88bcebd970 100644 --- a/src/cloudflare/types/snippets/__init__.py +++ b/src/cloudflare/types/snippets/__init__.py @@ -2,13 +2,9 @@ from __future__ import annotations -from .rule_list_response import RuleListResponse as RuleListResponse from .rule_update_params import RuleUpdateParams as RuleUpdateParams from .snippet_list_params import SnippetListParams as SnippetListParams -from .rule_delete_response import RuleDeleteResponse as RuleDeleteResponse -from .rule_update_response import RuleUpdateResponse as RuleUpdateResponse from .snippet_get_response import SnippetGetResponse as SnippetGetResponse from .snippet_list_response import SnippetListResponse as SnippetListResponse from .snippet_update_params import SnippetUpdateParams as SnippetUpdateParams -from .snippet_delete_response import SnippetDeleteResponse as SnippetDeleteResponse from .snippet_update_response import SnippetUpdateResponse as SnippetUpdateResponse diff --git a/src/cloudflare/types/snippets/rule_delete_response.py b/src/cloudflare/types/snippets/rule_delete_response.py deleted file mode 100644 index 82daad343b7..00000000000 --- a/src/cloudflare/types/snippets/rule_delete_response.py +++ /dev/null @@ -1,30 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Optional -from datetime import datetime - -from ..._models import BaseModel - -__all__ = ["RuleDeleteResponse"] - - -class RuleDeleteResponse(BaseModel): - """A snippet rule.""" - - id: str - """The unique ID of the rule.""" - - expression: str - """The expression defining which traffic will match the rule.""" - - last_updated: datetime - """The timestamp of when the rule was last modified.""" - - snippet_name: str - """The identifying name of the snippet.""" - - description: Optional[str] = None - """An informative description of the rule.""" - - enabled: Optional[bool] = None - """Whether the rule should be executed.""" diff --git a/src/cloudflare/types/snippets/rule_list_response.py b/src/cloudflare/types/snippets/rule_list_response.py deleted file mode 100644 index 580009e8c7b..00000000000 --- a/src/cloudflare/types/snippets/rule_list_response.py +++ /dev/null @@ -1,30 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Optional -from datetime import datetime - -from ..._models import BaseModel - -__all__ = ["RuleListResponse"] - - -class RuleListResponse(BaseModel): - """A snippet rule.""" - - id: str - """The unique ID of the rule.""" - - expression: str - """The expression defining which traffic will match the rule.""" - - last_updated: datetime - """The timestamp of when the rule was last modified.""" - - snippet_name: str - """The identifying name of the snippet.""" - - description: Optional[str] = None - """An informative description of the rule.""" - - enabled: Optional[bool] = None - """Whether the rule should be executed.""" diff --git a/src/cloudflare/types/snippets/rule_update_params.py b/src/cloudflare/types/snippets/rule_update_params.py index cb9b6928438..9511ef89cf8 100644 --- a/src/cloudflare/types/snippets/rule_update_params.py +++ b/src/cloudflare/types/snippets/rule_update_params.py @@ -10,23 +10,23 @@ class RuleUpdateParams(TypedDict, total=False): zone_id: Required[str] - """The unique ID of the zone.""" + """Use this field to specify the unique ID of the zone.""" rules: Required[Iterable[Rule]] - """A list of snippet rules.""" + """Lists snippet rules.""" class Rule(TypedDict, total=False): - """A snippet rule.""" + """Define a snippet rule.""" expression: Required[str] - """The expression defining which traffic will match the rule.""" + """Define the expression that determines which traffic matches the rule.""" snippet_name: Required[str] - """The identifying name of the snippet.""" + """Identify the snippet.""" description: str - """An informative description of the rule.""" + """Provide an informative description of the rule.""" enabled: bool - """Whether the rule should be executed.""" + """Indicate whether to execute the rule.""" diff --git a/src/cloudflare/types/snippets/rule_update_response.py b/src/cloudflare/types/snippets/rule_update_response.py deleted file mode 100644 index df082807a5b..00000000000 --- a/src/cloudflare/types/snippets/rule_update_response.py +++ /dev/null @@ -1,30 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Optional -from datetime import datetime - -from ..._models import BaseModel - -__all__ = ["RuleUpdateResponse"] - - -class RuleUpdateResponse(BaseModel): - """A snippet rule.""" - - id: str - """The unique ID of the rule.""" - - expression: str - """The expression defining which traffic will match the rule.""" - - last_updated: datetime - """The timestamp of when the rule was last modified.""" - - snippet_name: str - """The identifying name of the snippet.""" - - description: Optional[str] = None - """An informative description of the rule.""" - - enabled: Optional[bool] = None - """Whether the rule should be executed.""" diff --git a/src/cloudflare/types/snippets/snippet_delete_response.py b/src/cloudflare/types/snippets/snippet_delete_response.py deleted file mode 100644 index df12b7993ea..00000000000 --- a/src/cloudflare/types/snippets/snippet_delete_response.py +++ /dev/null @@ -1,8 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Optional -from typing_extensions import TypeAlias - -__all__ = ["SnippetDeleteResponse"] - -SnippetDeleteResponse: TypeAlias = Optional[str] diff --git a/src/cloudflare/types/snippets/snippet_get_response.py b/src/cloudflare/types/snippets/snippet_get_response.py index bc87585db18..b47c3658811 100644 --- a/src/cloudflare/types/snippets/snippet_get_response.py +++ b/src/cloudflare/types/snippets/snippet_get_response.py @@ -9,13 +9,13 @@ class SnippetGetResponse(BaseModel): - """A result.""" + """Contain the response result.""" created_on: datetime - """The timestamp of when the snippet was created.""" + """Indicates when the snippet was created.""" snippet_name: str - """The identifying name of the snippet.""" + """Identify the snippet.""" modified_on: Optional[datetime] = None - """The timestamp of when the snippet was last modified.""" + """Indicates when the snippet was last modified.""" diff --git a/src/cloudflare/types/snippets/snippet_list_params.py b/src/cloudflare/types/snippets/snippet_list_params.py index 2415136e4e5..6a88fa28753 100644 --- a/src/cloudflare/types/snippets/snippet_list_params.py +++ b/src/cloudflare/types/snippets/snippet_list_params.py @@ -9,10 +9,10 @@ class SnippetListParams(TypedDict, total=False): zone_id: Required[str] - """The unique ID of the zone.""" + """Use this field to specify the unique ID of the zone.""" page: int - """The current page number.""" + """Specifies the current page number.""" per_page: int - """The number of results to return per page.""" + """Specifies how many results to return per page.""" diff --git a/src/cloudflare/types/snippets/snippet_list_response.py b/src/cloudflare/types/snippets/snippet_list_response.py index 5ef8813a826..91e3fb5f017 100644 --- a/src/cloudflare/types/snippets/snippet_list_response.py +++ b/src/cloudflare/types/snippets/snippet_list_response.py @@ -9,13 +9,13 @@ class SnippetListResponse(BaseModel): - """A snippet object.""" + """Define a snippet.""" created_on: datetime - """The timestamp of when the snippet was created.""" + """Indicates when the snippet was created.""" snippet_name: str - """The identifying name of the snippet.""" + """Identify the snippet.""" modified_on: Optional[datetime] = None - """The timestamp of when the snippet was last modified.""" + """Indicates when the snippet was last modified.""" diff --git a/src/cloudflare/types/snippets/snippet_update_params.py b/src/cloudflare/types/snippets/snippet_update_params.py index cf18ba62793..9018359d3cf 100644 --- a/src/cloudflare/types/snippets/snippet_update_params.py +++ b/src/cloudflare/types/snippets/snippet_update_params.py @@ -9,14 +9,14 @@ class SnippetUpdateParams(TypedDict, total=False): zone_id: Required[str] - """The unique ID of the zone.""" + """Use this field to specify the unique ID of the zone.""" metadata: Required[Metadata] - """Metadata about the snippet.""" + """Provide metadata about the snippet.""" class Metadata(TypedDict, total=False): - """Metadata about the snippet.""" + """Provide metadata about the snippet.""" main_module: Required[str] - """Name of the file that contains the main module of the snippet.""" + """Specify the name of the file that contains the main module of the snippet.""" diff --git a/src/cloudflare/types/snippets/snippet_update_response.py b/src/cloudflare/types/snippets/snippet_update_response.py index 1b9b6734aaf..a3466c92a0a 100644 --- a/src/cloudflare/types/snippets/snippet_update_response.py +++ b/src/cloudflare/types/snippets/snippet_update_response.py @@ -9,13 +9,13 @@ class SnippetUpdateResponse(BaseModel): - """A result.""" + """Contain the response result.""" created_on: datetime - """The timestamp of when the snippet was created.""" + """Indicates when the snippet was created.""" snippet_name: str - """The identifying name of the snippet.""" + """Identify the snippet.""" modified_on: Optional[datetime] = None - """The timestamp of when the snippet was last modified.""" + """Indicates when the snippet was last modified.""" diff --git a/src/cloudflare/types/ssl/certificate_pack_create_response.py b/src/cloudflare/types/ssl/certificate_pack_create_response.py index 7e8b4a2e3b4..6612f00e203 100644 --- a/src/cloudflare/types/ssl/certificate_pack_create_response.py +++ b/src/cloudflare/types/ssl/certificate_pack_create_response.py @@ -12,6 +12,7 @@ "CertificatePackCreateResponse", "Certificate", "CertificateGeoRestrictions", + "DCVDelegationRecord", "ValidationError", "ValidationRecord", ] @@ -63,6 +64,46 @@ class Certificate(BaseModel): """Identifier.""" +class DCVDelegationRecord(BaseModel): + """Certificate's required validation record.""" + + cname: Optional[str] = None + """The CNAME record hostname for DCV delegation.""" + + cname_target: Optional[str] = None + """The CNAME record target value for DCV delegation.""" + + emails: Optional[List[str]] = None + """ + The set of email addresses that the certificate authority (CA) will use to + complete domain validation. + """ + + http_body: Optional[str] = None + """ + The content that the certificate authority (CA) will expect to find at the + http_url during the domain validation. + """ + + http_url: Optional[str] = None + """The url that will be checked during domain validation.""" + + status: Optional[str] = None + """Status of the validation record.""" + + txt_name: Optional[str] = None + """ + The hostname that the certificate authority (CA) will check for a TXT record + during domain validation . + """ + + txt_value: Optional[str] = None + """ + The TXT record that the certificate authority (CA) will check during domain + validation. + """ + + class ValidationError(BaseModel): message: Optional[str] = None """A domain validation error.""" @@ -71,6 +112,12 @@ class ValidationError(BaseModel): class ValidationRecord(BaseModel): """Certificate's required validation record.""" + cname: Optional[str] = None + """The CNAME record hostname for DCV delegation.""" + + cname_target: Optional[str] = None + """The CNAME record target value for DCV delegation.""" + emails: Optional[List[str]] = None """ The set of email addresses that the certificate authority (CA) will use to @@ -86,6 +133,9 @@ class ValidationRecord(BaseModel): http_url: Optional[str] = None """The url that will be checked during domain validation.""" + status: Optional[str] = None + """Status of the validation record.""" + txt_name: Optional[str] = None """ The hostname that the certificate authority (CA) will check for a TXT record @@ -137,6 +187,9 @@ class CertificatePackCreateResponse(BaseModel): true. """ + dcv_delegation_records: Optional[List[DCVDelegationRecord]] = None + """DCV Delegation records for domain validation.""" + primary_certificate: Optional[str] = None """Identifier of the primary certificate in a pack.""" diff --git a/src/cloudflare/types/ssl/certificate_pack_edit_response.py b/src/cloudflare/types/ssl/certificate_pack_edit_response.py index bbfa664c5da..49b082dc034 100644 --- a/src/cloudflare/types/ssl/certificate_pack_edit_response.py +++ b/src/cloudflare/types/ssl/certificate_pack_edit_response.py @@ -12,6 +12,7 @@ "CertificatePackEditResponse", "Certificate", "CertificateGeoRestrictions", + "DCVDelegationRecord", "ValidationError", "ValidationRecord", ] @@ -63,6 +64,46 @@ class Certificate(BaseModel): """Identifier.""" +class DCVDelegationRecord(BaseModel): + """Certificate's required validation record.""" + + cname: Optional[str] = None + """The CNAME record hostname for DCV delegation.""" + + cname_target: Optional[str] = None + """The CNAME record target value for DCV delegation.""" + + emails: Optional[List[str]] = None + """ + The set of email addresses that the certificate authority (CA) will use to + complete domain validation. + """ + + http_body: Optional[str] = None + """ + The content that the certificate authority (CA) will expect to find at the + http_url during the domain validation. + """ + + http_url: Optional[str] = None + """The url that will be checked during domain validation.""" + + status: Optional[str] = None + """Status of the validation record.""" + + txt_name: Optional[str] = None + """ + The hostname that the certificate authority (CA) will check for a TXT record + during domain validation . + """ + + txt_value: Optional[str] = None + """ + The TXT record that the certificate authority (CA) will check during domain + validation. + """ + + class ValidationError(BaseModel): message: Optional[str] = None """A domain validation error.""" @@ -71,6 +112,12 @@ class ValidationError(BaseModel): class ValidationRecord(BaseModel): """Certificate's required validation record.""" + cname: Optional[str] = None + """The CNAME record hostname for DCV delegation.""" + + cname_target: Optional[str] = None + """The CNAME record target value for DCV delegation.""" + emails: Optional[List[str]] = None """ The set of email addresses that the certificate authority (CA) will use to @@ -86,6 +133,9 @@ class ValidationRecord(BaseModel): http_url: Optional[str] = None """The url that will be checked during domain validation.""" + status: Optional[str] = None + """Status of the validation record.""" + txt_name: Optional[str] = None """ The hostname that the certificate authority (CA) will check for a TXT record @@ -137,6 +187,9 @@ class CertificatePackEditResponse(BaseModel): true. """ + dcv_delegation_records: Optional[List[DCVDelegationRecord]] = None + """DCV Delegation records for domain validation.""" + primary_certificate: Optional[str] = None """Identifier of the primary certificate in a pack.""" diff --git a/src/cloudflare/types/ssl/certificate_pack_get_response.py b/src/cloudflare/types/ssl/certificate_pack_get_response.py index 126119249fc..5a3b5a9eed0 100644 --- a/src/cloudflare/types/ssl/certificate_pack_get_response.py +++ b/src/cloudflare/types/ssl/certificate_pack_get_response.py @@ -12,6 +12,7 @@ "CertificatePackGetResponse", "Certificate", "CertificateGeoRestrictions", + "DCVDelegationRecord", "ValidationError", "ValidationRecord", ] @@ -63,6 +64,46 @@ class Certificate(BaseModel): """Identifier.""" +class DCVDelegationRecord(BaseModel): + """Certificate's required validation record.""" + + cname: Optional[str] = None + """The CNAME record hostname for DCV delegation.""" + + cname_target: Optional[str] = None + """The CNAME record target value for DCV delegation.""" + + emails: Optional[List[str]] = None + """ + The set of email addresses that the certificate authority (CA) will use to + complete domain validation. + """ + + http_body: Optional[str] = None + """ + The content that the certificate authority (CA) will expect to find at the + http_url during the domain validation. + """ + + http_url: Optional[str] = None + """The url that will be checked during domain validation.""" + + status: Optional[str] = None + """Status of the validation record.""" + + txt_name: Optional[str] = None + """ + The hostname that the certificate authority (CA) will check for a TXT record + during domain validation . + """ + + txt_value: Optional[str] = None + """ + The TXT record that the certificate authority (CA) will check during domain + validation. + """ + + class ValidationError(BaseModel): message: Optional[str] = None """A domain validation error.""" @@ -71,6 +112,12 @@ class ValidationError(BaseModel): class ValidationRecord(BaseModel): """Certificate's required validation record.""" + cname: Optional[str] = None + """The CNAME record hostname for DCV delegation.""" + + cname_target: Optional[str] = None + """The CNAME record target value for DCV delegation.""" + emails: Optional[List[str]] = None """ The set of email addresses that the certificate authority (CA) will use to @@ -86,6 +133,9 @@ class ValidationRecord(BaseModel): http_url: Optional[str] = None """The url that will be checked during domain validation.""" + status: Optional[str] = None + """Status of the validation record.""" + txt_name: Optional[str] = None """ The hostname that the certificate authority (CA) will check for a TXT record @@ -137,6 +187,9 @@ class CertificatePackGetResponse(BaseModel): true. """ + dcv_delegation_records: Optional[List[DCVDelegationRecord]] = None + """DCV Delegation records for domain validation.""" + primary_certificate: Optional[str] = None """Identifier of the primary certificate in a pack.""" diff --git a/src/cloudflare/types/ssl/certificate_pack_list_response.py b/src/cloudflare/types/ssl/certificate_pack_list_response.py index f189cc048b0..1255a10c5f4 100644 --- a/src/cloudflare/types/ssl/certificate_pack_list_response.py +++ b/src/cloudflare/types/ssl/certificate_pack_list_response.py @@ -12,6 +12,7 @@ "CertificatePackListResponse", "Certificate", "CertificateGeoRestrictions", + "DCVDelegationRecord", "ValidationError", "ValidationRecord", ] @@ -63,6 +64,46 @@ class Certificate(BaseModel): """Identifier.""" +class DCVDelegationRecord(BaseModel): + """Certificate's required validation record.""" + + cname: Optional[str] = None + """The CNAME record hostname for DCV delegation.""" + + cname_target: Optional[str] = None + """The CNAME record target value for DCV delegation.""" + + emails: Optional[List[str]] = None + """ + The set of email addresses that the certificate authority (CA) will use to + complete domain validation. + """ + + http_body: Optional[str] = None + """ + The content that the certificate authority (CA) will expect to find at the + http_url during the domain validation. + """ + + http_url: Optional[str] = None + """The url that will be checked during domain validation.""" + + status: Optional[str] = None + """Status of the validation record.""" + + txt_name: Optional[str] = None + """ + The hostname that the certificate authority (CA) will check for a TXT record + during domain validation . + """ + + txt_value: Optional[str] = None + """ + The TXT record that the certificate authority (CA) will check during domain + validation. + """ + + class ValidationError(BaseModel): message: Optional[str] = None """A domain validation error.""" @@ -71,6 +112,12 @@ class ValidationError(BaseModel): class ValidationRecord(BaseModel): """Certificate's required validation record.""" + cname: Optional[str] = None + """The CNAME record hostname for DCV delegation.""" + + cname_target: Optional[str] = None + """The CNAME record target value for DCV delegation.""" + emails: Optional[List[str]] = None """ The set of email addresses that the certificate authority (CA) will use to @@ -86,6 +133,9 @@ class ValidationRecord(BaseModel): http_url: Optional[str] = None """The url that will be checked during domain validation.""" + status: Optional[str] = None + """Status of the validation record.""" + txt_name: Optional[str] = None """ The hostname that the certificate authority (CA) will check for a TXT record @@ -137,6 +187,9 @@ class CertificatePackListResponse(BaseModel): true. """ + dcv_delegation_records: Optional[List[DCVDelegationRecord]] = None + """DCV Delegation records for domain validation.""" + primary_certificate: Optional[str] = None """Identifier of the primary certificate in a pack.""" diff --git a/src/cloudflare/types/workflows/version_get_response.py b/src/cloudflare/types/workflows/version_get_response.py index e0c679c5704..51c1879072f 100644 --- a/src/cloudflare/types/workflows/version_get_response.py +++ b/src/cloudflare/types/workflows/version_get_response.py @@ -14,6 +14,8 @@ class VersionGetResponse(BaseModel): created_on: datetime + has_dag: bool + modified_on: datetime workflow_id: str diff --git a/src/cloudflare/types/workflows/version_list_response.py b/src/cloudflare/types/workflows/version_list_response.py index 573299922a3..03a9a24feef 100644 --- a/src/cloudflare/types/workflows/version_list_response.py +++ b/src/cloudflare/types/workflows/version_list_response.py @@ -14,6 +14,8 @@ class VersionListResponse(BaseModel): created_on: datetime + has_dag: bool + modified_on: datetime workflow_id: str diff --git a/src/cloudflare/types/zero_trust/dlp/entries/custom_create_params.py b/src/cloudflare/types/zero_trust/dlp/entries/custom_create_params.py index c96b0eaf370..8700d3d8469 100644 --- a/src/cloudflare/types/zero_trust/dlp/entries/custom_create_params.py +++ b/src/cloudflare/types/zero_trust/dlp/entries/custom_create_params.py @@ -2,6 +2,7 @@ from __future__ import annotations +from typing import Optional from typing_extensions import Required, TypedDict from ..profiles.pattern_param import PatternParam @@ -18,4 +19,6 @@ class CustomCreateParams(TypedDict, total=False): pattern: Required[PatternParam] + description: Optional[str] + profile_id: str diff --git a/src/cloudflare/types/zero_trust/dlp/entries/custom_create_response.py b/src/cloudflare/types/zero_trust/dlp/entries/custom_create_response.py index 5a695cc08f1..8b6cbc94fbf 100644 --- a/src/cloudflare/types/zero_trust/dlp/entries/custom_create_response.py +++ b/src/cloudflare/types/zero_trust/dlp/entries/custom_create_response.py @@ -22,4 +22,6 @@ class CustomCreateResponse(BaseModel): updated_at: datetime + description: Optional[str] = None + profile_id: Optional[str] = None 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 d7357683446..0643a73c554 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 @@ -49,6 +49,8 @@ class UnionMember0(BaseModel): updated_at: datetime + description: Optional[str] = None + profile_id: Optional[str] = None profiles: Optional[List[UnionMember0Profile]] = None 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 47f4b0a4d6d..ae6c5f56e7e 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 @@ -35,6 +35,8 @@ class CustomEntry(BaseModel): updated_at: datetime + description: Optional[str] = None + profile_id: Optional[str] = None upload_status: Optional[Literal["empty", "uploading", "pending", "processing", "failed", "complete"]] = None diff --git a/src/cloudflare/types/zero_trust/dlp/entries/custom_update_params.py b/src/cloudflare/types/zero_trust/dlp/entries/custom_update_params.py index c773958695b..c6e957d80d3 100644 --- a/src/cloudflare/types/zero_trust/dlp/entries/custom_update_params.py +++ b/src/cloudflare/types/zero_trust/dlp/entries/custom_update_params.py @@ -2,6 +2,7 @@ from __future__ import annotations +from typing import Optional from typing_extensions import Required, TypedDict from ..profiles.pattern_param import PatternParam @@ -17,3 +18,5 @@ class CustomUpdateParams(TypedDict, total=False): name: Required[str] pattern: Required[PatternParam] + + description: Optional[str] diff --git a/src/cloudflare/types/zero_trust/dlp/entries/custom_update_response.py b/src/cloudflare/types/zero_trust/dlp/entries/custom_update_response.py index 6aa076e2a4e..1f77d4b9b31 100644 --- a/src/cloudflare/types/zero_trust/dlp/entries/custom_update_response.py +++ b/src/cloudflare/types/zero_trust/dlp/entries/custom_update_response.py @@ -22,4 +22,6 @@ class CustomUpdateResponse(BaseModel): updated_at: datetime + description: Optional[str] = None + profile_id: Optional[str] = None 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 2448e69c5d3..da9028d38d6 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 @@ -49,6 +49,8 @@ class UnionMember0(BaseModel): updated_at: datetime + description: Optional[str] = None + profile_id: Optional[str] = None profiles: Optional[List[UnionMember0Profile]] = None 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 ec1f81c4592..79a8312ce3b 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 @@ -35,6 +35,8 @@ class CustomEntry(BaseModel): updated_at: datetime + description: Optional[str] = None + profile_id: Optional[str] = None upload_status: Optional[Literal["empty", "uploading", "pending", "processing", "failed", "complete"]] = None 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 7ea062b0886..975c433ccf9 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 @@ -49,6 +49,8 @@ class UnionMember0(BaseModel): updated_at: datetime + description: Optional[str] = None + profile_id: Optional[str] = None profiles: Optional[List[UnionMember0Profile]] = None 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 e8bd1dd0e62..2f9571fe90b 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 @@ -35,6 +35,8 @@ class CustomEntry(BaseModel): updated_at: datetime + description: Optional[str] = None + profile_id: Optional[str] = None upload_status: Optional[Literal["empty", "uploading", "pending", "processing", "failed", "complete"]] = None diff --git a/src/cloudflare/types/zero_trust/dlp/entry_create_params.py b/src/cloudflare/types/zero_trust/dlp/entry_create_params.py index 8aaaa65ea7f..6b6c3364021 100644 --- a/src/cloudflare/types/zero_trust/dlp/entry_create_params.py +++ b/src/cloudflare/types/zero_trust/dlp/entry_create_params.py @@ -2,6 +2,7 @@ from __future__ import annotations +from typing import Optional from typing_extensions import Required, TypedDict from .profiles.pattern_param import PatternParam @@ -18,4 +19,6 @@ class EntryCreateParams(TypedDict, total=False): pattern: Required[PatternParam] + description: Optional[str] + profile_id: str diff --git a/src/cloudflare/types/zero_trust/dlp/entry_create_response.py b/src/cloudflare/types/zero_trust/dlp/entry_create_response.py index a21a44fe06e..cd3cd80dea5 100644 --- a/src/cloudflare/types/zero_trust/dlp/entry_create_response.py +++ b/src/cloudflare/types/zero_trust/dlp/entry_create_response.py @@ -22,4 +22,6 @@ class EntryCreateResponse(BaseModel): updated_at: datetime + description: Optional[str] = None + profile_id: Optional[str] = None 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 0276d9da7b3..b14a69946d9 100644 --- a/src/cloudflare/types/zero_trust/dlp/entry_get_response.py +++ b/src/cloudflare/types/zero_trust/dlp/entry_get_response.py @@ -49,6 +49,8 @@ class UnionMember0(BaseModel): updated_at: datetime + description: Optional[str] = None + profile_id: Optional[str] = None profiles: Optional[List[UnionMember0Profile]] = None 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 95f6c9de362..a762e734404 100644 --- a/src/cloudflare/types/zero_trust/dlp/entry_list_response.py +++ b/src/cloudflare/types/zero_trust/dlp/entry_list_response.py @@ -35,6 +35,8 @@ class CustomEntry(BaseModel): updated_at: datetime + description: Optional[str] = None + profile_id: Optional[str] = None upload_status: Optional[Literal["empty", "uploading", "pending", "processing", "failed", "complete"]] = None diff --git a/src/cloudflare/types/zero_trust/dlp/entry_update_params.py b/src/cloudflare/types/zero_trust/dlp/entry_update_params.py index 7fc8706ca1e..04a45767afe 100644 --- a/src/cloudflare/types/zero_trust/dlp/entry_update_params.py +++ b/src/cloudflare/types/zero_trust/dlp/entry_update_params.py @@ -2,7 +2,7 @@ from __future__ import annotations -from typing import Union +from typing import Union, Optional from typing_extensions import Literal, Required, TypeAlias, TypedDict from .profiles.pattern_param import PatternParam @@ -19,6 +19,8 @@ class Variant0(TypedDict, total=False): type: Required[Literal["custom"]] + description: Optional[str] + enabled: bool 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 ced93632cfb..9e608c2eb48 100644 --- a/src/cloudflare/types/zero_trust/dlp/entry_update_response.py +++ b/src/cloudflare/types/zero_trust/dlp/entry_update_response.py @@ -36,6 +36,8 @@ class Custom(BaseModel): updated_at: datetime + description: Optional[str] = None + profile_id: Optional[str] = None diff --git a/src/cloudflare/types/zero_trust/dlp/profile.py b/src/cloudflare/types/zero_trust/dlp/profile.py index e5b0b8f8ed1..3e204f1c0fa 100644 --- a/src/cloudflare/types/zero_trust/dlp/profile.py +++ b/src/cloudflare/types/zero_trust/dlp/profile.py @@ -23,6 +23,15 @@ "CustomProfileEntryExactDataEntry", "CustomProfileEntryDocumentFingerprintEntry", "CustomProfileEntryWordListEntry", + "CustomProfileSharedEntry", + "CustomProfileSharedEntryCustomEntry", + "CustomProfileSharedEntryPredefinedEntry", + "CustomProfileSharedEntryPredefinedEntryConfidence", + "CustomProfileSharedEntryPredefinedEntryVariant", + "CustomProfileSharedEntryIntegrationEntry", + "CustomProfileSharedEntryExactDataEntry", + "CustomProfileSharedEntryDocumentFingerprintEntry", + "CustomProfileSharedEntryWordListEntry", "PredefinedProfile", "PredefinedProfileEntry", "PredefinedProfileEntryCustomEntry", @@ -43,6 +52,15 @@ "IntegrationProfileEntryExactDataEntry", "IntegrationProfileEntryDocumentFingerprintEntry", "IntegrationProfileEntryWordListEntry", + "IntegrationProfileSharedEntry", + "IntegrationProfileSharedEntryCustomEntry", + "IntegrationProfileSharedEntryPredefinedEntry", + "IntegrationProfileSharedEntryPredefinedEntryConfidence", + "IntegrationProfileSharedEntryPredefinedEntryVariant", + "IntegrationProfileSharedEntryIntegrationEntry", + "IntegrationProfileSharedEntryExactDataEntry", + "IntegrationProfileSharedEntryDocumentFingerprintEntry", + "IntegrationProfileSharedEntryWordListEntry", ] @@ -61,6 +79,8 @@ class CustomProfileEntryCustomEntry(BaseModel): updated_at: datetime + description: Optional[str] = None + profile_id: Optional[str] = None @@ -179,6 +199,141 @@ class CustomProfileEntryWordListEntry(BaseModel): ] +class CustomProfileSharedEntryCustomEntry(BaseModel): + id: str + + created_at: datetime + + enabled: bool + + name: str + + pattern: Pattern + + type: Literal["custom"] + + updated_at: datetime + + description: Optional[str] = None + + profile_id: Optional[str] = None + + +class CustomProfileSharedEntryPredefinedEntryConfidence(BaseModel): + ai_context_available: bool + """Indicates whether this entry has AI remote service validation.""" + + available: bool + """ + Indicates whether this entry has any form of validation that is not an AI remote + service. + """ + + +class CustomProfileSharedEntryPredefinedEntryVariant(BaseModel): + topic_type: Literal["Intent", "Content"] + + type: Literal["PromptTopic"] + + description: Optional[str] = None + + +class CustomProfileSharedEntryPredefinedEntry(BaseModel): + id: str + + confidence: CustomProfileSharedEntryPredefinedEntryConfidence + + enabled: bool + + name: str + + type: Literal["predefined"] + + profile_id: Optional[str] = None + + variant: Optional[CustomProfileSharedEntryPredefinedEntryVariant] = None + + +class CustomProfileSharedEntryIntegrationEntry(BaseModel): + id: str + + created_at: datetime + + enabled: bool + + name: str + + type: Literal["integration"] + + updated_at: datetime + + profile_id: Optional[str] = None + + +class CustomProfileSharedEntryExactDataEntry(BaseModel): + id: str + + case_sensitive: bool + """ + Only applies to custom word lists. Determines if the words should be matched in + a case-sensitive manner Cannot be set to false if secret is true + """ + + created_at: datetime + + enabled: bool + + name: str + + secret: bool + + type: Literal["exact_data"] + + updated_at: datetime + + +class CustomProfileSharedEntryDocumentFingerprintEntry(BaseModel): + id: str + + created_at: datetime + + enabled: bool + + name: str + + type: Literal["document_fingerprint"] + + updated_at: datetime + + +class CustomProfileSharedEntryWordListEntry(BaseModel): + id: str + + created_at: datetime + + enabled: bool + + name: str + + type: Literal["word_list"] + + updated_at: datetime + + word_list: object + + profile_id: Optional[str] = None + + +CustomProfileSharedEntry: TypeAlias = Union[ + CustomProfileSharedEntryCustomEntry, + CustomProfileSharedEntryPredefinedEntry, + CustomProfileSharedEntryIntegrationEntry, + CustomProfileSharedEntryExactDataEntry, + CustomProfileSharedEntryDocumentFingerprintEntry, + CustomProfileSharedEntryWordListEntry, +] + + class CustomProfile(BaseModel): id: str """The id of the profile (uuid).""" @@ -214,6 +369,8 @@ class CustomProfile(BaseModel): entries: Optional[List[CustomProfileEntry]] = None + shared_entries: Optional[List[CustomProfileSharedEntry]] = None + class PredefinedProfileEntryCustomEntry(BaseModel): id: str @@ -230,6 +387,8 @@ class PredefinedProfileEntryCustomEntry(BaseModel): updated_at: datetime + description: Optional[str] = None + profile_id: Optional[str] = None @@ -392,6 +551,8 @@ class IntegrationProfileEntryCustomEntry(BaseModel): updated_at: datetime + description: Optional[str] = None + profile_id: Optional[str] = None @@ -510,6 +671,141 @@ class IntegrationProfileEntryWordListEntry(BaseModel): ] +class IntegrationProfileSharedEntryCustomEntry(BaseModel): + id: str + + created_at: datetime + + enabled: bool + + name: str + + pattern: Pattern + + type: Literal["custom"] + + updated_at: datetime + + description: Optional[str] = None + + profile_id: Optional[str] = None + + +class IntegrationProfileSharedEntryPredefinedEntryConfidence(BaseModel): + ai_context_available: bool + """Indicates whether this entry has AI remote service validation.""" + + available: bool + """ + Indicates whether this entry has any form of validation that is not an AI remote + service. + """ + + +class IntegrationProfileSharedEntryPredefinedEntryVariant(BaseModel): + topic_type: Literal["Intent", "Content"] + + type: Literal["PromptTopic"] + + description: Optional[str] = None + + +class IntegrationProfileSharedEntryPredefinedEntry(BaseModel): + id: str + + confidence: IntegrationProfileSharedEntryPredefinedEntryConfidence + + enabled: bool + + name: str + + type: Literal["predefined"] + + profile_id: Optional[str] = None + + variant: Optional[IntegrationProfileSharedEntryPredefinedEntryVariant] = None + + +class IntegrationProfileSharedEntryIntegrationEntry(BaseModel): + id: str + + created_at: datetime + + enabled: bool + + name: str + + type: Literal["integration"] + + updated_at: datetime + + profile_id: Optional[str] = None + + +class IntegrationProfileSharedEntryExactDataEntry(BaseModel): + id: str + + case_sensitive: bool + """ + Only applies to custom word lists. Determines if the words should be matched in + a case-sensitive manner Cannot be set to false if secret is true + """ + + created_at: datetime + + enabled: bool + + name: str + + secret: bool + + type: Literal["exact_data"] + + updated_at: datetime + + +class IntegrationProfileSharedEntryDocumentFingerprintEntry(BaseModel): + id: str + + created_at: datetime + + enabled: bool + + name: str + + type: Literal["document_fingerprint"] + + updated_at: datetime + + +class IntegrationProfileSharedEntryWordListEntry(BaseModel): + id: str + + created_at: datetime + + enabled: bool + + name: str + + type: Literal["word_list"] + + updated_at: datetime + + word_list: object + + profile_id: Optional[str] = None + + +IntegrationProfileSharedEntry: TypeAlias = Union[ + IntegrationProfileSharedEntryCustomEntry, + IntegrationProfileSharedEntryPredefinedEntry, + IntegrationProfileSharedEntryIntegrationEntry, + IntegrationProfileSharedEntryExactDataEntry, + IntegrationProfileSharedEntryDocumentFingerprintEntry, + IntegrationProfileSharedEntryWordListEntry, +] + + class IntegrationProfile(BaseModel): id: str @@ -519,6 +815,8 @@ class IntegrationProfile(BaseModel): name: str + shared_entries: List[IntegrationProfileSharedEntry] + type: Literal["integration"] updated_at: datetime diff --git a/src/cloudflare/types/zero_trust/dlp/profile_get_response.py b/src/cloudflare/types/zero_trust/dlp/profile_get_response.py index 1732d21bee9..aba07605c6a 100644 --- a/src/cloudflare/types/zero_trust/dlp/profile_get_response.py +++ b/src/cloudflare/types/zero_trust/dlp/profile_get_response.py @@ -21,6 +21,15 @@ "CustomEntryExactDataEntry", "CustomEntryDocumentFingerprintEntry", "CustomEntryWordListEntry", + "CustomSharedEntry", + "CustomSharedEntryCustomEntry", + "CustomSharedEntryPredefinedEntry", + "CustomSharedEntryPredefinedEntryConfidence", + "CustomSharedEntryPredefinedEntryVariant", + "CustomSharedEntryIntegrationEntry", + "CustomSharedEntryExactDataEntry", + "CustomSharedEntryDocumentFingerprintEntry", + "CustomSharedEntryWordListEntry", "Predefined", "PredefinedEntry", "PredefinedEntryCustomEntry", @@ -41,6 +50,15 @@ "IntegrationEntryExactDataEntry", "IntegrationEntryDocumentFingerprintEntry", "IntegrationEntryWordListEntry", + "IntegrationSharedEntry", + "IntegrationSharedEntryCustomEntry", + "IntegrationSharedEntryPredefinedEntry", + "IntegrationSharedEntryPredefinedEntryConfidence", + "IntegrationSharedEntryPredefinedEntryVariant", + "IntegrationSharedEntryIntegrationEntry", + "IntegrationSharedEntryExactDataEntry", + "IntegrationSharedEntryDocumentFingerprintEntry", + "IntegrationSharedEntryWordListEntry", ] @@ -59,6 +77,8 @@ class CustomEntryCustomEntry(BaseModel): updated_at: datetime + description: Optional[str] = None + profile_id: Optional[str] = None @@ -177,6 +197,141 @@ class CustomEntryWordListEntry(BaseModel): ] +class CustomSharedEntryCustomEntry(BaseModel): + id: str + + created_at: datetime + + enabled: bool + + name: str + + pattern: Pattern + + type: Literal["custom"] + + updated_at: datetime + + description: Optional[str] = None + + profile_id: Optional[str] = None + + +class CustomSharedEntryPredefinedEntryConfidence(BaseModel): + ai_context_available: bool + """Indicates whether this entry has AI remote service validation.""" + + available: bool + """ + Indicates whether this entry has any form of validation that is not an AI remote + service. + """ + + +class CustomSharedEntryPredefinedEntryVariant(BaseModel): + topic_type: Literal["Intent", "Content"] + + type: Literal["PromptTopic"] + + description: Optional[str] = None + + +class CustomSharedEntryPredefinedEntry(BaseModel): + id: str + + confidence: CustomSharedEntryPredefinedEntryConfidence + + enabled: bool + + name: str + + type: Literal["predefined"] + + profile_id: Optional[str] = None + + variant: Optional[CustomSharedEntryPredefinedEntryVariant] = None + + +class CustomSharedEntryIntegrationEntry(BaseModel): + id: str + + created_at: datetime + + enabled: bool + + name: str + + type: Literal["integration"] + + updated_at: datetime + + profile_id: Optional[str] = None + + +class CustomSharedEntryExactDataEntry(BaseModel): + id: str + + case_sensitive: bool + """ + Only applies to custom word lists. Determines if the words should be matched in + a case-sensitive manner Cannot be set to false if secret is true + """ + + created_at: datetime + + enabled: bool + + name: str + + secret: bool + + type: Literal["exact_data"] + + updated_at: datetime + + +class CustomSharedEntryDocumentFingerprintEntry(BaseModel): + id: str + + created_at: datetime + + enabled: bool + + name: str + + type: Literal["document_fingerprint"] + + updated_at: datetime + + +class CustomSharedEntryWordListEntry(BaseModel): + id: str + + created_at: datetime + + enabled: bool + + name: str + + type: Literal["word_list"] + + updated_at: datetime + + word_list: object + + profile_id: Optional[str] = None + + +CustomSharedEntry: TypeAlias = Union[ + CustomSharedEntryCustomEntry, + CustomSharedEntryPredefinedEntry, + CustomSharedEntryIntegrationEntry, + CustomSharedEntryExactDataEntry, + CustomSharedEntryDocumentFingerprintEntry, + CustomSharedEntryWordListEntry, +] + + class Custom(BaseModel): id: str """The id of the profile (uuid).""" @@ -212,6 +367,8 @@ class Custom(BaseModel): entries: Optional[List[CustomEntry]] = None + shared_entries: Optional[List[CustomSharedEntry]] = None + class PredefinedEntryCustomEntry(BaseModel): id: str @@ -228,6 +385,8 @@ class PredefinedEntryCustomEntry(BaseModel): updated_at: datetime + description: Optional[str] = None + profile_id: Optional[str] = None @@ -390,6 +549,8 @@ class IntegrationEntryCustomEntry(BaseModel): updated_at: datetime + description: Optional[str] = None + profile_id: Optional[str] = None @@ -508,6 +669,141 @@ class IntegrationEntryWordListEntry(BaseModel): ] +class IntegrationSharedEntryCustomEntry(BaseModel): + id: str + + created_at: datetime + + enabled: bool + + name: str + + pattern: Pattern + + type: Literal["custom"] + + updated_at: datetime + + description: Optional[str] = None + + profile_id: Optional[str] = None + + +class IntegrationSharedEntryPredefinedEntryConfidence(BaseModel): + ai_context_available: bool + """Indicates whether this entry has AI remote service validation.""" + + available: bool + """ + Indicates whether this entry has any form of validation that is not an AI remote + service. + """ + + +class IntegrationSharedEntryPredefinedEntryVariant(BaseModel): + topic_type: Literal["Intent", "Content"] + + type: Literal["PromptTopic"] + + description: Optional[str] = None + + +class IntegrationSharedEntryPredefinedEntry(BaseModel): + id: str + + confidence: IntegrationSharedEntryPredefinedEntryConfidence + + enabled: bool + + name: str + + type: Literal["predefined"] + + profile_id: Optional[str] = None + + variant: Optional[IntegrationSharedEntryPredefinedEntryVariant] = None + + +class IntegrationSharedEntryIntegrationEntry(BaseModel): + id: str + + created_at: datetime + + enabled: bool + + name: str + + type: Literal["integration"] + + updated_at: datetime + + profile_id: Optional[str] = None + + +class IntegrationSharedEntryExactDataEntry(BaseModel): + id: str + + case_sensitive: bool + """ + Only applies to custom word lists. Determines if the words should be matched in + a case-sensitive manner Cannot be set to false if secret is true + """ + + created_at: datetime + + enabled: bool + + name: str + + secret: bool + + type: Literal["exact_data"] + + updated_at: datetime + + +class IntegrationSharedEntryDocumentFingerprintEntry(BaseModel): + id: str + + created_at: datetime + + enabled: bool + + name: str + + type: Literal["document_fingerprint"] + + updated_at: datetime + + +class IntegrationSharedEntryWordListEntry(BaseModel): + id: str + + created_at: datetime + + enabled: bool + + name: str + + type: Literal["word_list"] + + updated_at: datetime + + word_list: object + + profile_id: Optional[str] = None + + +IntegrationSharedEntry: TypeAlias = Union[ + IntegrationSharedEntryCustomEntry, + IntegrationSharedEntryPredefinedEntry, + IntegrationSharedEntryIntegrationEntry, + IntegrationSharedEntryExactDataEntry, + IntegrationSharedEntryDocumentFingerprintEntry, + IntegrationSharedEntryWordListEntry, +] + + class Integration(BaseModel): id: str @@ -517,6 +813,8 @@ class Integration(BaseModel): name: str + shared_entries: List[IntegrationSharedEntry] + type: Literal["integration"] updated_at: datetime diff --git a/src/cloudflare/types/zero_trust/dlp/profiles/custom_create_params.py b/src/cloudflare/types/zero_trust/dlp/profiles/custom_create_params.py index 42b151cc13d..fa44d5c365f 100644 --- a/src/cloudflare/types/zero_trust/dlp/profiles/custom_create_params.py +++ b/src/cloudflare/types/zero_trust/dlp/profiles/custom_create_params.py @@ -52,6 +52,8 @@ class EntryDLPNewCustomEntry(TypedDict, total=False): pattern: Required[PatternParam] + description: Optional[str] + class EntryDLPNewWordListEntry(TypedDict, total=False): enabled: Required[bool] diff --git a/src/cloudflare/types/zero_trust/dlp/profiles/custom_create_response.py b/src/cloudflare/types/zero_trust/dlp/profiles/custom_create_response.py index 5e9f63ca298..5dfc1701c04 100644 --- a/src/cloudflare/types/zero_trust/dlp/profiles/custom_create_response.py +++ b/src/cloudflare/types/zero_trust/dlp/profiles/custom_create_response.py @@ -21,6 +21,15 @@ "CustomEntryExactDataEntry", "CustomEntryDocumentFingerprintEntry", "CustomEntryWordListEntry", + "CustomSharedEntry", + "CustomSharedEntryCustomEntry", + "CustomSharedEntryPredefinedEntry", + "CustomSharedEntryPredefinedEntryConfidence", + "CustomSharedEntryPredefinedEntryVariant", + "CustomSharedEntryIntegrationEntry", + "CustomSharedEntryExactDataEntry", + "CustomSharedEntryDocumentFingerprintEntry", + "CustomSharedEntryWordListEntry", "Predefined", "PredefinedEntry", "PredefinedEntryCustomEntry", @@ -41,6 +50,15 @@ "IntegrationEntryExactDataEntry", "IntegrationEntryDocumentFingerprintEntry", "IntegrationEntryWordListEntry", + "IntegrationSharedEntry", + "IntegrationSharedEntryCustomEntry", + "IntegrationSharedEntryPredefinedEntry", + "IntegrationSharedEntryPredefinedEntryConfidence", + "IntegrationSharedEntryPredefinedEntryVariant", + "IntegrationSharedEntryIntegrationEntry", + "IntegrationSharedEntryExactDataEntry", + "IntegrationSharedEntryDocumentFingerprintEntry", + "IntegrationSharedEntryWordListEntry", ] @@ -59,6 +77,8 @@ class CustomEntryCustomEntry(BaseModel): updated_at: datetime + description: Optional[str] = None + profile_id: Optional[str] = None @@ -177,6 +197,141 @@ class CustomEntryWordListEntry(BaseModel): ] +class CustomSharedEntryCustomEntry(BaseModel): + id: str + + created_at: datetime + + enabled: bool + + name: str + + pattern: Pattern + + type: Literal["custom"] + + updated_at: datetime + + description: Optional[str] = None + + profile_id: Optional[str] = None + + +class CustomSharedEntryPredefinedEntryConfidence(BaseModel): + ai_context_available: bool + """Indicates whether this entry has AI remote service validation.""" + + available: bool + """ + Indicates whether this entry has any form of validation that is not an AI remote + service. + """ + + +class CustomSharedEntryPredefinedEntryVariant(BaseModel): + topic_type: Literal["Intent", "Content"] + + type: Literal["PromptTopic"] + + description: Optional[str] = None + + +class CustomSharedEntryPredefinedEntry(BaseModel): + id: str + + confidence: CustomSharedEntryPredefinedEntryConfidence + + enabled: bool + + name: str + + type: Literal["predefined"] + + profile_id: Optional[str] = None + + variant: Optional[CustomSharedEntryPredefinedEntryVariant] = None + + +class CustomSharedEntryIntegrationEntry(BaseModel): + id: str + + created_at: datetime + + enabled: bool + + name: str + + type: Literal["integration"] + + updated_at: datetime + + profile_id: Optional[str] = None + + +class CustomSharedEntryExactDataEntry(BaseModel): + id: str + + case_sensitive: bool + """ + Only applies to custom word lists. Determines if the words should be matched in + a case-sensitive manner Cannot be set to false if secret is true + """ + + created_at: datetime + + enabled: bool + + name: str + + secret: bool + + type: Literal["exact_data"] + + updated_at: datetime + + +class CustomSharedEntryDocumentFingerprintEntry(BaseModel): + id: str + + created_at: datetime + + enabled: bool + + name: str + + type: Literal["document_fingerprint"] + + updated_at: datetime + + +class CustomSharedEntryWordListEntry(BaseModel): + id: str + + created_at: datetime + + enabled: bool + + name: str + + type: Literal["word_list"] + + updated_at: datetime + + word_list: object + + profile_id: Optional[str] = None + + +CustomSharedEntry: TypeAlias = Union[ + CustomSharedEntryCustomEntry, + CustomSharedEntryPredefinedEntry, + CustomSharedEntryIntegrationEntry, + CustomSharedEntryExactDataEntry, + CustomSharedEntryDocumentFingerprintEntry, + CustomSharedEntryWordListEntry, +] + + class Custom(BaseModel): id: str """The id of the profile (uuid).""" @@ -212,6 +367,8 @@ class Custom(BaseModel): entries: Optional[List[CustomEntry]] = None + shared_entries: Optional[List[CustomSharedEntry]] = None + class PredefinedEntryCustomEntry(BaseModel): id: str @@ -228,6 +385,8 @@ class PredefinedEntryCustomEntry(BaseModel): updated_at: datetime + description: Optional[str] = None + profile_id: Optional[str] = None @@ -390,6 +549,8 @@ class IntegrationEntryCustomEntry(BaseModel): updated_at: datetime + description: Optional[str] = None + profile_id: Optional[str] = None @@ -508,6 +669,141 @@ class IntegrationEntryWordListEntry(BaseModel): ] +class IntegrationSharedEntryCustomEntry(BaseModel): + id: str + + created_at: datetime + + enabled: bool + + name: str + + pattern: Pattern + + type: Literal["custom"] + + updated_at: datetime + + description: Optional[str] = None + + profile_id: Optional[str] = None + + +class IntegrationSharedEntryPredefinedEntryConfidence(BaseModel): + ai_context_available: bool + """Indicates whether this entry has AI remote service validation.""" + + available: bool + """ + Indicates whether this entry has any form of validation that is not an AI remote + service. + """ + + +class IntegrationSharedEntryPredefinedEntryVariant(BaseModel): + topic_type: Literal["Intent", "Content"] + + type: Literal["PromptTopic"] + + description: Optional[str] = None + + +class IntegrationSharedEntryPredefinedEntry(BaseModel): + id: str + + confidence: IntegrationSharedEntryPredefinedEntryConfidence + + enabled: bool + + name: str + + type: Literal["predefined"] + + profile_id: Optional[str] = None + + variant: Optional[IntegrationSharedEntryPredefinedEntryVariant] = None + + +class IntegrationSharedEntryIntegrationEntry(BaseModel): + id: str + + created_at: datetime + + enabled: bool + + name: str + + type: Literal["integration"] + + updated_at: datetime + + profile_id: Optional[str] = None + + +class IntegrationSharedEntryExactDataEntry(BaseModel): + id: str + + case_sensitive: bool + """ + Only applies to custom word lists. Determines if the words should be matched in + a case-sensitive manner Cannot be set to false if secret is true + """ + + created_at: datetime + + enabled: bool + + name: str + + secret: bool + + type: Literal["exact_data"] + + updated_at: datetime + + +class IntegrationSharedEntryDocumentFingerprintEntry(BaseModel): + id: str + + created_at: datetime + + enabled: bool + + name: str + + type: Literal["document_fingerprint"] + + updated_at: datetime + + +class IntegrationSharedEntryWordListEntry(BaseModel): + id: str + + created_at: datetime + + enabled: bool + + name: str + + type: Literal["word_list"] + + updated_at: datetime + + word_list: object + + profile_id: Optional[str] = None + + +IntegrationSharedEntry: TypeAlias = Union[ + IntegrationSharedEntryCustomEntry, + IntegrationSharedEntryPredefinedEntry, + IntegrationSharedEntryIntegrationEntry, + IntegrationSharedEntryExactDataEntry, + IntegrationSharedEntryDocumentFingerprintEntry, + IntegrationSharedEntryWordListEntry, +] + + class Integration(BaseModel): id: str @@ -517,6 +813,8 @@ class Integration(BaseModel): name: str + shared_entries: List[IntegrationSharedEntry] + type: Literal["integration"] updated_at: datetime diff --git a/src/cloudflare/types/zero_trust/dlp/profiles/custom_get_response.py b/src/cloudflare/types/zero_trust/dlp/profiles/custom_get_response.py index 05c7b9010cf..bd9fc1744f3 100644 --- a/src/cloudflare/types/zero_trust/dlp/profiles/custom_get_response.py +++ b/src/cloudflare/types/zero_trust/dlp/profiles/custom_get_response.py @@ -21,6 +21,15 @@ "CustomEntryExactDataEntry", "CustomEntryDocumentFingerprintEntry", "CustomEntryWordListEntry", + "CustomSharedEntry", + "CustomSharedEntryCustomEntry", + "CustomSharedEntryPredefinedEntry", + "CustomSharedEntryPredefinedEntryConfidence", + "CustomSharedEntryPredefinedEntryVariant", + "CustomSharedEntryIntegrationEntry", + "CustomSharedEntryExactDataEntry", + "CustomSharedEntryDocumentFingerprintEntry", + "CustomSharedEntryWordListEntry", "Predefined", "PredefinedEntry", "PredefinedEntryCustomEntry", @@ -41,6 +50,15 @@ "IntegrationEntryExactDataEntry", "IntegrationEntryDocumentFingerprintEntry", "IntegrationEntryWordListEntry", + "IntegrationSharedEntry", + "IntegrationSharedEntryCustomEntry", + "IntegrationSharedEntryPredefinedEntry", + "IntegrationSharedEntryPredefinedEntryConfidence", + "IntegrationSharedEntryPredefinedEntryVariant", + "IntegrationSharedEntryIntegrationEntry", + "IntegrationSharedEntryExactDataEntry", + "IntegrationSharedEntryDocumentFingerprintEntry", + "IntegrationSharedEntryWordListEntry", ] @@ -59,6 +77,8 @@ class CustomEntryCustomEntry(BaseModel): updated_at: datetime + description: Optional[str] = None + profile_id: Optional[str] = None @@ -177,6 +197,141 @@ class CustomEntryWordListEntry(BaseModel): ] +class CustomSharedEntryCustomEntry(BaseModel): + id: str + + created_at: datetime + + enabled: bool + + name: str + + pattern: Pattern + + type: Literal["custom"] + + updated_at: datetime + + description: Optional[str] = None + + profile_id: Optional[str] = None + + +class CustomSharedEntryPredefinedEntryConfidence(BaseModel): + ai_context_available: bool + """Indicates whether this entry has AI remote service validation.""" + + available: bool + """ + Indicates whether this entry has any form of validation that is not an AI remote + service. + """ + + +class CustomSharedEntryPredefinedEntryVariant(BaseModel): + topic_type: Literal["Intent", "Content"] + + type: Literal["PromptTopic"] + + description: Optional[str] = None + + +class CustomSharedEntryPredefinedEntry(BaseModel): + id: str + + confidence: CustomSharedEntryPredefinedEntryConfidence + + enabled: bool + + name: str + + type: Literal["predefined"] + + profile_id: Optional[str] = None + + variant: Optional[CustomSharedEntryPredefinedEntryVariant] = None + + +class CustomSharedEntryIntegrationEntry(BaseModel): + id: str + + created_at: datetime + + enabled: bool + + name: str + + type: Literal["integration"] + + updated_at: datetime + + profile_id: Optional[str] = None + + +class CustomSharedEntryExactDataEntry(BaseModel): + id: str + + case_sensitive: bool + """ + Only applies to custom word lists. Determines if the words should be matched in + a case-sensitive manner Cannot be set to false if secret is true + """ + + created_at: datetime + + enabled: bool + + name: str + + secret: bool + + type: Literal["exact_data"] + + updated_at: datetime + + +class CustomSharedEntryDocumentFingerprintEntry(BaseModel): + id: str + + created_at: datetime + + enabled: bool + + name: str + + type: Literal["document_fingerprint"] + + updated_at: datetime + + +class CustomSharedEntryWordListEntry(BaseModel): + id: str + + created_at: datetime + + enabled: bool + + name: str + + type: Literal["word_list"] + + updated_at: datetime + + word_list: object + + profile_id: Optional[str] = None + + +CustomSharedEntry: TypeAlias = Union[ + CustomSharedEntryCustomEntry, + CustomSharedEntryPredefinedEntry, + CustomSharedEntryIntegrationEntry, + CustomSharedEntryExactDataEntry, + CustomSharedEntryDocumentFingerprintEntry, + CustomSharedEntryWordListEntry, +] + + class Custom(BaseModel): id: str """The id of the profile (uuid).""" @@ -212,6 +367,8 @@ class Custom(BaseModel): entries: Optional[List[CustomEntry]] = None + shared_entries: Optional[List[CustomSharedEntry]] = None + class PredefinedEntryCustomEntry(BaseModel): id: str @@ -228,6 +385,8 @@ class PredefinedEntryCustomEntry(BaseModel): updated_at: datetime + description: Optional[str] = None + profile_id: Optional[str] = None @@ -390,6 +549,8 @@ class IntegrationEntryCustomEntry(BaseModel): updated_at: datetime + description: Optional[str] = None + profile_id: Optional[str] = None @@ -508,6 +669,141 @@ class IntegrationEntryWordListEntry(BaseModel): ] +class IntegrationSharedEntryCustomEntry(BaseModel): + id: str + + created_at: datetime + + enabled: bool + + name: str + + pattern: Pattern + + type: Literal["custom"] + + updated_at: datetime + + description: Optional[str] = None + + profile_id: Optional[str] = None + + +class IntegrationSharedEntryPredefinedEntryConfidence(BaseModel): + ai_context_available: bool + """Indicates whether this entry has AI remote service validation.""" + + available: bool + """ + Indicates whether this entry has any form of validation that is not an AI remote + service. + """ + + +class IntegrationSharedEntryPredefinedEntryVariant(BaseModel): + topic_type: Literal["Intent", "Content"] + + type: Literal["PromptTopic"] + + description: Optional[str] = None + + +class IntegrationSharedEntryPredefinedEntry(BaseModel): + id: str + + confidence: IntegrationSharedEntryPredefinedEntryConfidence + + enabled: bool + + name: str + + type: Literal["predefined"] + + profile_id: Optional[str] = None + + variant: Optional[IntegrationSharedEntryPredefinedEntryVariant] = None + + +class IntegrationSharedEntryIntegrationEntry(BaseModel): + id: str + + created_at: datetime + + enabled: bool + + name: str + + type: Literal["integration"] + + updated_at: datetime + + profile_id: Optional[str] = None + + +class IntegrationSharedEntryExactDataEntry(BaseModel): + id: str + + case_sensitive: bool + """ + Only applies to custom word lists. Determines if the words should be matched in + a case-sensitive manner Cannot be set to false if secret is true + """ + + created_at: datetime + + enabled: bool + + name: str + + secret: bool + + type: Literal["exact_data"] + + updated_at: datetime + + +class IntegrationSharedEntryDocumentFingerprintEntry(BaseModel): + id: str + + created_at: datetime + + enabled: bool + + name: str + + type: Literal["document_fingerprint"] + + updated_at: datetime + + +class IntegrationSharedEntryWordListEntry(BaseModel): + id: str + + created_at: datetime + + enabled: bool + + name: str + + type: Literal["word_list"] + + updated_at: datetime + + word_list: object + + profile_id: Optional[str] = None + + +IntegrationSharedEntry: TypeAlias = Union[ + IntegrationSharedEntryCustomEntry, + IntegrationSharedEntryPredefinedEntry, + IntegrationSharedEntryIntegrationEntry, + IntegrationSharedEntryExactDataEntry, + IntegrationSharedEntryDocumentFingerprintEntry, + IntegrationSharedEntryWordListEntry, +] + + class Integration(BaseModel): id: str @@ -517,6 +813,8 @@ class Integration(BaseModel): name: str + shared_entries: List[IntegrationSharedEntry] + type: Literal["integration"] updated_at: datetime diff --git a/src/cloudflare/types/zero_trust/dlp/profiles/custom_update_params.py b/src/cloudflare/types/zero_trust/dlp/profiles/custom_update_params.py index 30d00081f93..b6b46d1059d 100644 --- a/src/cloudflare/types/zero_trust/dlp/profiles/custom_update_params.py +++ b/src/cloudflare/types/zero_trust/dlp/profiles/custom_update_params.py @@ -52,6 +52,8 @@ class EntryDLPNewCustomEntryWithID(TypedDict, total=False): pattern: Required[PatternParam] + description: Optional[str] + class EntryDLPNewCustomEntry(TypedDict, total=False): enabled: Required[bool] @@ -60,6 +62,8 @@ class EntryDLPNewCustomEntry(TypedDict, total=False): pattern: Required[PatternParam] + description: Optional[str] + Entry: TypeAlias = Union[EntryDLPNewCustomEntryWithID, EntryDLPNewCustomEntry] diff --git a/src/cloudflare/types/zero_trust/dlp/profiles/custom_update_response.py b/src/cloudflare/types/zero_trust/dlp/profiles/custom_update_response.py index 47443582e9c..8d6f93a5487 100644 --- a/src/cloudflare/types/zero_trust/dlp/profiles/custom_update_response.py +++ b/src/cloudflare/types/zero_trust/dlp/profiles/custom_update_response.py @@ -21,6 +21,15 @@ "CustomEntryExactDataEntry", "CustomEntryDocumentFingerprintEntry", "CustomEntryWordListEntry", + "CustomSharedEntry", + "CustomSharedEntryCustomEntry", + "CustomSharedEntryPredefinedEntry", + "CustomSharedEntryPredefinedEntryConfidence", + "CustomSharedEntryPredefinedEntryVariant", + "CustomSharedEntryIntegrationEntry", + "CustomSharedEntryExactDataEntry", + "CustomSharedEntryDocumentFingerprintEntry", + "CustomSharedEntryWordListEntry", "Predefined", "PredefinedEntry", "PredefinedEntryCustomEntry", @@ -41,6 +50,15 @@ "IntegrationEntryExactDataEntry", "IntegrationEntryDocumentFingerprintEntry", "IntegrationEntryWordListEntry", + "IntegrationSharedEntry", + "IntegrationSharedEntryCustomEntry", + "IntegrationSharedEntryPredefinedEntry", + "IntegrationSharedEntryPredefinedEntryConfidence", + "IntegrationSharedEntryPredefinedEntryVariant", + "IntegrationSharedEntryIntegrationEntry", + "IntegrationSharedEntryExactDataEntry", + "IntegrationSharedEntryDocumentFingerprintEntry", + "IntegrationSharedEntryWordListEntry", ] @@ -59,6 +77,8 @@ class CustomEntryCustomEntry(BaseModel): updated_at: datetime + description: Optional[str] = None + profile_id: Optional[str] = None @@ -177,6 +197,141 @@ class CustomEntryWordListEntry(BaseModel): ] +class CustomSharedEntryCustomEntry(BaseModel): + id: str + + created_at: datetime + + enabled: bool + + name: str + + pattern: Pattern + + type: Literal["custom"] + + updated_at: datetime + + description: Optional[str] = None + + profile_id: Optional[str] = None + + +class CustomSharedEntryPredefinedEntryConfidence(BaseModel): + ai_context_available: bool + """Indicates whether this entry has AI remote service validation.""" + + available: bool + """ + Indicates whether this entry has any form of validation that is not an AI remote + service. + """ + + +class CustomSharedEntryPredefinedEntryVariant(BaseModel): + topic_type: Literal["Intent", "Content"] + + type: Literal["PromptTopic"] + + description: Optional[str] = None + + +class CustomSharedEntryPredefinedEntry(BaseModel): + id: str + + confidence: CustomSharedEntryPredefinedEntryConfidence + + enabled: bool + + name: str + + type: Literal["predefined"] + + profile_id: Optional[str] = None + + variant: Optional[CustomSharedEntryPredefinedEntryVariant] = None + + +class CustomSharedEntryIntegrationEntry(BaseModel): + id: str + + created_at: datetime + + enabled: bool + + name: str + + type: Literal["integration"] + + updated_at: datetime + + profile_id: Optional[str] = None + + +class CustomSharedEntryExactDataEntry(BaseModel): + id: str + + case_sensitive: bool + """ + Only applies to custom word lists. Determines if the words should be matched in + a case-sensitive manner Cannot be set to false if secret is true + """ + + created_at: datetime + + enabled: bool + + name: str + + secret: bool + + type: Literal["exact_data"] + + updated_at: datetime + + +class CustomSharedEntryDocumentFingerprintEntry(BaseModel): + id: str + + created_at: datetime + + enabled: bool + + name: str + + type: Literal["document_fingerprint"] + + updated_at: datetime + + +class CustomSharedEntryWordListEntry(BaseModel): + id: str + + created_at: datetime + + enabled: bool + + name: str + + type: Literal["word_list"] + + updated_at: datetime + + word_list: object + + profile_id: Optional[str] = None + + +CustomSharedEntry: TypeAlias = Union[ + CustomSharedEntryCustomEntry, + CustomSharedEntryPredefinedEntry, + CustomSharedEntryIntegrationEntry, + CustomSharedEntryExactDataEntry, + CustomSharedEntryDocumentFingerprintEntry, + CustomSharedEntryWordListEntry, +] + + class Custom(BaseModel): id: str """The id of the profile (uuid).""" @@ -212,6 +367,8 @@ class Custom(BaseModel): entries: Optional[List[CustomEntry]] = None + shared_entries: Optional[List[CustomSharedEntry]] = None + class PredefinedEntryCustomEntry(BaseModel): id: str @@ -228,6 +385,8 @@ class PredefinedEntryCustomEntry(BaseModel): updated_at: datetime + description: Optional[str] = None + profile_id: Optional[str] = None @@ -390,6 +549,8 @@ class IntegrationEntryCustomEntry(BaseModel): updated_at: datetime + description: Optional[str] = None + profile_id: Optional[str] = None @@ -508,6 +669,141 @@ class IntegrationEntryWordListEntry(BaseModel): ] +class IntegrationSharedEntryCustomEntry(BaseModel): + id: str + + created_at: datetime + + enabled: bool + + name: str + + pattern: Pattern + + type: Literal["custom"] + + updated_at: datetime + + description: Optional[str] = None + + profile_id: Optional[str] = None + + +class IntegrationSharedEntryPredefinedEntryConfidence(BaseModel): + ai_context_available: bool + """Indicates whether this entry has AI remote service validation.""" + + available: bool + """ + Indicates whether this entry has any form of validation that is not an AI remote + service. + """ + + +class IntegrationSharedEntryPredefinedEntryVariant(BaseModel): + topic_type: Literal["Intent", "Content"] + + type: Literal["PromptTopic"] + + description: Optional[str] = None + + +class IntegrationSharedEntryPredefinedEntry(BaseModel): + id: str + + confidence: IntegrationSharedEntryPredefinedEntryConfidence + + enabled: bool + + name: str + + type: Literal["predefined"] + + profile_id: Optional[str] = None + + variant: Optional[IntegrationSharedEntryPredefinedEntryVariant] = None + + +class IntegrationSharedEntryIntegrationEntry(BaseModel): + id: str + + created_at: datetime + + enabled: bool + + name: str + + type: Literal["integration"] + + updated_at: datetime + + profile_id: Optional[str] = None + + +class IntegrationSharedEntryExactDataEntry(BaseModel): + id: str + + case_sensitive: bool + """ + Only applies to custom word lists. Determines if the words should be matched in + a case-sensitive manner Cannot be set to false if secret is true + """ + + created_at: datetime + + enabled: bool + + name: str + + secret: bool + + type: Literal["exact_data"] + + updated_at: datetime + + +class IntegrationSharedEntryDocumentFingerprintEntry(BaseModel): + id: str + + created_at: datetime + + enabled: bool + + name: str + + type: Literal["document_fingerprint"] + + updated_at: datetime + + +class IntegrationSharedEntryWordListEntry(BaseModel): + id: str + + created_at: datetime + + enabled: bool + + name: str + + type: Literal["word_list"] + + updated_at: datetime + + word_list: object + + profile_id: Optional[str] = None + + +IntegrationSharedEntry: TypeAlias = Union[ + IntegrationSharedEntryCustomEntry, + IntegrationSharedEntryPredefinedEntry, + IntegrationSharedEntryIntegrationEntry, + IntegrationSharedEntryExactDataEntry, + IntegrationSharedEntryDocumentFingerprintEntry, + IntegrationSharedEntryWordListEntry, +] + + class Integration(BaseModel): id: str @@ -517,6 +813,8 @@ class Integration(BaseModel): name: str + shared_entries: List[IntegrationSharedEntry] + type: Literal["integration"] updated_at: datetime diff --git a/src/cloudflare/types/zero_trust/dlp/profiles/predefined_get_response.py b/src/cloudflare/types/zero_trust/dlp/profiles/predefined_get_response.py index e58ce4e7c97..89b8fecbff3 100644 --- a/src/cloudflare/types/zero_trust/dlp/profiles/predefined_get_response.py +++ b/src/cloudflare/types/zero_trust/dlp/profiles/predefined_get_response.py @@ -36,6 +36,8 @@ class EntryCustomEntry(BaseModel): updated_at: datetime + description: Optional[str] = None + profile_id: Optional[str] = None diff --git a/src/cloudflare/types/zero_trust/dlp/profiles/predefined_update_response.py b/src/cloudflare/types/zero_trust/dlp/profiles/predefined_update_response.py index 4f11f1de79d..ce5b00b8600 100644 --- a/src/cloudflare/types/zero_trust/dlp/profiles/predefined_update_response.py +++ b/src/cloudflare/types/zero_trust/dlp/profiles/predefined_update_response.py @@ -36,6 +36,8 @@ class EntryCustomEntry(BaseModel): updated_at: datetime + description: Optional[str] = None + profile_id: Optional[str] = None diff --git a/src/cloudflare/types/zero_trust/networks/subnet_list_response.py b/src/cloudflare/types/zero_trust/networks/subnet_list_response.py index c6218a22a82..4ecca401e28 100644 --- a/src/cloudflare/types/zero_trust/networks/subnet_list_response.py +++ b/src/cloudflare/types/zero_trust/networks/subnet_list_response.py @@ -37,5 +37,5 @@ class SubnetListResponse(BaseModel): network: Optional[str] = None """The private IPv4 or IPv6 range defining the subnet, in CIDR notation.""" - subnet_type: Optional[Literal["cloudflare_source"]] = None + subnet_type: Optional[Literal["cloudflare_source", "warp"]] = None """The type of subnet.""" diff --git a/src/cloudflare/types/zero_trust/networks/subnets/cloudflare_source_update_response.py b/src/cloudflare/types/zero_trust/networks/subnets/cloudflare_source_update_response.py index 7630e9fe39a..37f881d9a97 100644 --- a/src/cloudflare/types/zero_trust/networks/subnets/cloudflare_source_update_response.py +++ b/src/cloudflare/types/zero_trust/networks/subnets/cloudflare_source_update_response.py @@ -37,5 +37,5 @@ class CloudflareSourceUpdateResponse(BaseModel): network: Optional[str] = None """The private IPv4 or IPv6 range defining the subnet, in CIDR notation.""" - subnet_type: Optional[Literal["cloudflare_source"]] = None + subnet_type: Optional[Literal["cloudflare_source", "warp"]] = None """The type of subnet.""" diff --git a/src/cloudflare/types/zones/zone.py b/src/cloudflare/types/zones/zone.py index 4a8b41762e6..ffc9b1a8633 100644 --- a/src/cloudflare/types/zones/zone.py +++ b/src/cloudflare/types/zones/zone.py @@ -139,7 +139,12 @@ class Zone(BaseModel): """When the zone was last modified.""" name: str - """The domain name.""" + """The domain name. + + Per [RFC 1035](https://datatracker.ietf.org/doc/html/rfc1035#section-2.3.4) the + overall zone name can be up to 253 characters, with each segment ("label") not + exceeding 63 characters. + """ name_servers: List[str] """The name servers Cloudflare assigns to a zone.""" diff --git a/src/cloudflare/types/zones/zone_create_params.py b/src/cloudflare/types/zones/zone_create_params.py index 209f8e0d0a5..b3ad70c9b90 100644 --- a/src/cloudflare/types/zones/zone_create_params.py +++ b/src/cloudflare/types/zones/zone_create_params.py @@ -13,7 +13,12 @@ class ZoneCreateParams(TypedDict, total=False): account: Required[Account] name: Required[str] - """The domain name.""" + """The domain name. + + Per [RFC 1035](https://datatracker.ietf.org/doc/html/rfc1035#section-2.3.4) the + overall zone name can be up to 253 characters, with each segment ("label") not + exceeding 63 characters. + """ type: Type """A full zone implies that DNS is hosted with Cloudflare. diff --git a/tests/api_resources/ai/models/test_schema.py b/tests/api_resources/ai/models/test_schema.py index ff54c76b027..faf6ba59452 100644 --- a/tests/api_resources/ai/models/test_schema.py +++ b/tests/api_resources/ai/models/test_schema.py @@ -9,6 +9,7 @@ from cloudflare import Cloudflare, AsyncCloudflare from tests.utils import assert_matches_type +from cloudflare.types.ai.models import SchemaGetResponse base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") @@ -22,7 +23,7 @@ def test_method_get(self, client: Cloudflare) -> None: account_id="023e105f4ecef8ad9ca31a8372d0c353", model="model", ) - assert_matches_type(object, schema, path=["response"]) + assert_matches_type(SchemaGetResponse, schema, path=["response"]) @parametrize def test_raw_response_get(self, client: Cloudflare) -> None: @@ -34,7 +35,7 @@ def test_raw_response_get(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" schema = response.parse() - assert_matches_type(object, schema, path=["response"]) + assert_matches_type(SchemaGetResponse, schema, path=["response"]) @parametrize def test_streaming_response_get(self, client: Cloudflare) -> None: @@ -46,7 +47,7 @@ def test_streaming_response_get(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" schema = response.parse() - assert_matches_type(object, schema, path=["response"]) + assert_matches_type(SchemaGetResponse, schema, path=["response"]) assert cast(Any, response.is_closed) is True @@ -70,7 +71,7 @@ async def test_method_get(self, async_client: AsyncCloudflare) -> None: account_id="023e105f4ecef8ad9ca31a8372d0c353", model="model", ) - assert_matches_type(object, schema, path=["response"]) + assert_matches_type(SchemaGetResponse, schema, path=["response"]) @parametrize async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: @@ -82,7 +83,7 @@ async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" schema = await response.parse() - assert_matches_type(object, schema, path=["response"]) + assert_matches_type(SchemaGetResponse, schema, path=["response"]) @parametrize async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> None: @@ -94,7 +95,7 @@ async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> No assert response.http_request.headers.get("X-Stainless-Lang") == "python" schema = await response.parse() - assert_matches_type(object, schema, path=["response"]) + assert_matches_type(SchemaGetResponse, schema, path=["response"]) assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/aisearch/test_instances.py b/tests/api_resources/aisearch/test_instances.py index dfd32d9d6e8..ab630764939 100644 --- a/tests/api_resources/aisearch/test_instances.py +++ b/tests/api_resources/aisearch/test_instances.py @@ -66,7 +66,10 @@ def test_method_create_with_all_params(self, client: Cloudflare) -> None: "authorized_hosts": ["string"], "chat_completions_endpoint": {"disabled": True}, "enabled": True, - "mcp": {"disabled": True}, + "mcp": { + "description": "description", + "disabled": True, + }, "rate_limit": { "period_ms": 60000, "requests": 1, @@ -184,7 +187,10 @@ def test_method_update_with_all_params(self, client: Cloudflare) -> None: "authorized_hosts": ["string"], "chat_completions_endpoint": {"disabled": True}, "enabled": True, - "mcp": {"disabled": True}, + "mcp": { + "description": "description", + "disabled": True, + }, "rate_limit": { "period_ms": 60000, "requests": 1, @@ -403,14 +409,11 @@ def test_method_chat_completions_with_all_params(self, client: Cloudflare) -> No }, "retrieval": { "context_expansion": 0, - "filters": { - "key": "key", - "type": "eq", - "value": "string", - }, + "filters": {"foo": "bar"}, "match_threshold": 0, "max_num_results": 1, "retrieval_type": "vector", + "return_on_failure": True, }, }, model="@cf/meta/llama-3.3-70b-instruct-fp8-fast", @@ -568,14 +571,11 @@ def test_method_search_with_all_params(self, client: Cloudflare) -> None: }, "retrieval": { "context_expansion": 0, - "filters": { - "key": "key", - "type": "eq", - "value": "string", - }, + "filters": {"foo": "bar"}, "match_threshold": 0, "max_num_results": 1, "retrieval_type": "vector", + "return_on_failure": True, }, }, ) @@ -738,7 +738,10 @@ async def test_method_create_with_all_params(self, async_client: AsyncCloudflare "authorized_hosts": ["string"], "chat_completions_endpoint": {"disabled": True}, "enabled": True, - "mcp": {"disabled": True}, + "mcp": { + "description": "description", + "disabled": True, + }, "rate_limit": { "period_ms": 60000, "requests": 1, @@ -856,7 +859,10 @@ async def test_method_update_with_all_params(self, async_client: AsyncCloudflare "authorized_hosts": ["string"], "chat_completions_endpoint": {"disabled": True}, "enabled": True, - "mcp": {"disabled": True}, + "mcp": { + "description": "description", + "disabled": True, + }, "rate_limit": { "period_ms": 60000, "requests": 1, @@ -1075,14 +1081,11 @@ async def test_method_chat_completions_with_all_params(self, async_client: Async }, "retrieval": { "context_expansion": 0, - "filters": { - "key": "key", - "type": "eq", - "value": "string", - }, + "filters": {"foo": "bar"}, "match_threshold": 0, "max_num_results": 1, "retrieval_type": "vector", + "return_on_failure": True, }, }, model="@cf/meta/llama-3.3-70b-instruct-fp8-fast", @@ -1240,14 +1243,11 @@ async def test_method_search_with_all_params(self, async_client: AsyncCloudflare }, "retrieval": { "context_expansion": 0, - "filters": { - "key": "key", - "type": "eq", - "value": "string", - }, + "filters": {"foo": "bar"}, "match_threshold": 0, "max_num_results": 1, "retrieval_type": "vector", + "return_on_failure": True, }, }, ) diff --git a/tests/api_resources/cloudforce_one/test_threat_events.py b/tests/api_resources/cloudforce_one/test_threat_events.py index 7353757e437..cfaffb229ed 100644 --- a/tests/api_resources/cloudforce_one/test_threat_events.py +++ b/tests/api_resources/cloudforce_one/test_threat_events.py @@ -15,7 +15,6 @@ ThreatEventEditResponse, ThreatEventListResponse, ThreatEventCreateResponse, - ThreatEventDeleteResponse, ThreatEventBulkCreateResponse, ) @@ -187,58 +186,6 @@ def test_path_params_list(self, client: Cloudflare) -> None: account_id="", ) - @pytest.mark.skip(reason="TODO: HTTP 401 from prism") - @parametrize - def test_method_delete(self, client: Cloudflare) -> None: - threat_event = client.cloudforce_one.threat_events.delete( - event_id="event_id", - account_id="account_id", - ) - assert_matches_type(ThreatEventDeleteResponse, threat_event, path=["response"]) - - @pytest.mark.skip(reason="TODO: HTTP 401 from prism") - @parametrize - def test_raw_response_delete(self, client: Cloudflare) -> None: - response = client.cloudforce_one.threat_events.with_raw_response.delete( - event_id="event_id", - account_id="account_id", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - threat_event = response.parse() - assert_matches_type(ThreatEventDeleteResponse, threat_event, path=["response"]) - - @pytest.mark.skip(reason="TODO: HTTP 401 from prism") - @parametrize - def test_streaming_response_delete(self, client: Cloudflare) -> None: - with client.cloudforce_one.threat_events.with_streaming_response.delete( - event_id="event_id", - account_id="account_id", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - threat_event = response.parse() - assert_matches_type(ThreatEventDeleteResponse, threat_event, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @pytest.mark.skip(reason="TODO: HTTP 401 from prism") - @parametrize - def test_path_params_delete(self, client: Cloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): - client.cloudforce_one.threat_events.with_raw_response.delete( - event_id="event_id", - account_id="", - ) - - with pytest.raises(ValueError, match=r"Expected a non-empty value for `event_id` but received ''"): - client.cloudforce_one.threat_events.with_raw_response.delete( - event_id="", - account_id="account_id", - ) - @pytest.mark.skip(reason="TODO: HTTP 401 from prism") @parametrize def test_method_bulk_create(self, client: Cloudflare) -> None: @@ -662,58 +609,6 @@ async def test_path_params_list(self, async_client: AsyncCloudflare) -> None: account_id="", ) - @pytest.mark.skip(reason="TODO: HTTP 401 from prism") - @parametrize - async def test_method_delete(self, async_client: AsyncCloudflare) -> None: - threat_event = await async_client.cloudforce_one.threat_events.delete( - event_id="event_id", - account_id="account_id", - ) - assert_matches_type(ThreatEventDeleteResponse, threat_event, path=["response"]) - - @pytest.mark.skip(reason="TODO: HTTP 401 from prism") - @parametrize - async def test_raw_response_delete(self, async_client: AsyncCloudflare) -> None: - response = await async_client.cloudforce_one.threat_events.with_raw_response.delete( - event_id="event_id", - account_id="account_id", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - threat_event = await response.parse() - assert_matches_type(ThreatEventDeleteResponse, threat_event, path=["response"]) - - @pytest.mark.skip(reason="TODO: HTTP 401 from prism") - @parametrize - async def test_streaming_response_delete(self, async_client: AsyncCloudflare) -> None: - async with async_client.cloudforce_one.threat_events.with_streaming_response.delete( - event_id="event_id", - account_id="account_id", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - threat_event = await response.parse() - assert_matches_type(ThreatEventDeleteResponse, threat_event, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @pytest.mark.skip(reason="TODO: HTTP 401 from prism") - @parametrize - async def test_path_params_delete(self, async_client: AsyncCloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): - await async_client.cloudforce_one.threat_events.with_raw_response.delete( - event_id="event_id", - account_id="", - ) - - with pytest.raises(ValueError, match=r"Expected a non-empty value for `event_id` but received ''"): - await async_client.cloudforce_one.threat_events.with_raw_response.delete( - event_id="", - account_id="account_id", - ) - @pytest.mark.skip(reason="TODO: HTTP 401 from prism") @parametrize async def test_method_bulk_create(self, async_client: AsyncCloudflare) -> None: diff --git a/tests/api_resources/queues/test_consumers.py b/tests/api_resources/queues/test_consumers.py index f6d8f1a374d..813728fba35 100644 --- a/tests/api_resources/queues/test_consumers.py +++ b/tests/api_resources/queues/test_consumers.py @@ -10,7 +10,13 @@ from cloudflare import Cloudflare, AsyncCloudflare from tests.utils import assert_matches_type from cloudflare.pagination import SyncSinglePage, AsyncSinglePage -from cloudflare.types.queues import Consumer, ConsumerDeleteResponse +from cloudflare.types.queues import ( + ConsumerGetResponse, + ConsumerListResponse, + ConsumerCreateResponse, + ConsumerDeleteResponse, + ConsumerUpdateResponse, +) base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") @@ -23,16 +29,19 @@ def test_method_create_overload_1(self, client: Cloudflare) -> None: consumer = client.queues.consumers.create( queue_id="023e105f4ecef8ad9ca31a8372d0c353", account_id="023e105f4ecef8ad9ca31a8372d0c353", + script_name="my-consumer-worker", + type="worker", ) - assert_matches_type(Optional[Consumer], consumer, path=["response"]) + assert_matches_type(Optional[ConsumerCreateResponse], consumer, path=["response"]) @parametrize def test_method_create_with_all_params_overload_1(self, client: Cloudflare) -> None: consumer = client.queues.consumers.create( queue_id="023e105f4ecef8ad9ca31a8372d0c353", account_id="023e105f4ecef8ad9ca31a8372d0c353", - dead_letter_queue="example-queue", script_name="my-consumer-worker", + type="worker", + dead_letter_queue="example-queue", settings={ "batch_size": 50, "max_concurrency": 10, @@ -40,33 +49,36 @@ def test_method_create_with_all_params_overload_1(self, client: Cloudflare) -> N "max_wait_time_ms": 5000, "retry_delay": 10, }, - type="worker", ) - assert_matches_type(Optional[Consumer], consumer, path=["response"]) + assert_matches_type(Optional[ConsumerCreateResponse], consumer, path=["response"]) @parametrize def test_raw_response_create_overload_1(self, client: Cloudflare) -> None: response = client.queues.consumers.with_raw_response.create( queue_id="023e105f4ecef8ad9ca31a8372d0c353", account_id="023e105f4ecef8ad9ca31a8372d0c353", + script_name="my-consumer-worker", + type="worker", ) assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" consumer = response.parse() - assert_matches_type(Optional[Consumer], consumer, path=["response"]) + assert_matches_type(Optional[ConsumerCreateResponse], consumer, path=["response"]) @parametrize def test_streaming_response_create_overload_1(self, client: Cloudflare) -> None: with client.queues.consumers.with_streaming_response.create( queue_id="023e105f4ecef8ad9ca31a8372d0c353", account_id="023e105f4ecef8ad9ca31a8372d0c353", + script_name="my-consumer-worker", + type="worker", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" consumer = response.parse() - assert_matches_type(Optional[Consumer], consumer, path=["response"]) + assert_matches_type(Optional[ConsumerCreateResponse], consumer, path=["response"]) assert cast(Any, response.is_closed) is True @@ -76,12 +88,16 @@ def test_path_params_create_overload_1(self, client: Cloudflare) -> None: client.queues.consumers.with_raw_response.create( queue_id="023e105f4ecef8ad9ca31a8372d0c353", account_id="", + script_name="my-consumer-worker", + type="worker", ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `queue_id` but received ''"): client.queues.consumers.with_raw_response.create( queue_id="", account_id="023e105f4ecef8ad9ca31a8372d0c353", + script_name="my-consumer-worker", + type="worker", ) @parametrize @@ -89,14 +105,16 @@ def test_method_create_overload_2(self, client: Cloudflare) -> None: consumer = client.queues.consumers.create( queue_id="023e105f4ecef8ad9ca31a8372d0c353", account_id="023e105f4ecef8ad9ca31a8372d0c353", + type="http_pull", ) - assert_matches_type(Optional[Consumer], consumer, path=["response"]) + assert_matches_type(Optional[ConsumerCreateResponse], consumer, path=["response"]) @parametrize def test_method_create_with_all_params_overload_2(self, client: Cloudflare) -> None: consumer = client.queues.consumers.create( queue_id="023e105f4ecef8ad9ca31a8372d0c353", account_id="023e105f4ecef8ad9ca31a8372d0c353", + type="http_pull", dead_letter_queue="example-queue", settings={ "batch_size": 50, @@ -104,33 +122,34 @@ def test_method_create_with_all_params_overload_2(self, client: Cloudflare) -> N "retry_delay": 10, "visibility_timeout_ms": 6000, }, - type="http_pull", ) - assert_matches_type(Optional[Consumer], consumer, path=["response"]) + assert_matches_type(Optional[ConsumerCreateResponse], consumer, path=["response"]) @parametrize def test_raw_response_create_overload_2(self, client: Cloudflare) -> None: response = client.queues.consumers.with_raw_response.create( queue_id="023e105f4ecef8ad9ca31a8372d0c353", account_id="023e105f4ecef8ad9ca31a8372d0c353", + type="http_pull", ) assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" consumer = response.parse() - assert_matches_type(Optional[Consumer], consumer, path=["response"]) + assert_matches_type(Optional[ConsumerCreateResponse], consumer, path=["response"]) @parametrize def test_streaming_response_create_overload_2(self, client: Cloudflare) -> None: with client.queues.consumers.with_streaming_response.create( queue_id="023e105f4ecef8ad9ca31a8372d0c353", account_id="023e105f4ecef8ad9ca31a8372d0c353", + type="http_pull", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" consumer = response.parse() - assert_matches_type(Optional[Consumer], consumer, path=["response"]) + assert_matches_type(Optional[ConsumerCreateResponse], consumer, path=["response"]) assert cast(Any, response.is_closed) is True @@ -140,12 +159,14 @@ def test_path_params_create_overload_2(self, client: Cloudflare) -> None: client.queues.consumers.with_raw_response.create( queue_id="023e105f4ecef8ad9ca31a8372d0c353", account_id="", + type="http_pull", ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `queue_id` but received ''"): client.queues.consumers.with_raw_response.create( queue_id="", account_id="023e105f4ecef8ad9ca31a8372d0c353", + type="http_pull", ) @parametrize @@ -154,8 +175,10 @@ def test_method_update_overload_1(self, client: Cloudflare) -> None: consumer_id="023e105f4ecef8ad9ca31a8372d0c353", account_id="023e105f4ecef8ad9ca31a8372d0c353", queue_id="023e105f4ecef8ad9ca31a8372d0c353", + script_name="my-consumer-worker", + type="worker", ) - assert_matches_type(Optional[Consumer], consumer, path=["response"]) + assert_matches_type(Optional[ConsumerUpdateResponse], consumer, path=["response"]) @parametrize def test_method_update_with_all_params_overload_1(self, client: Cloudflare) -> None: @@ -163,8 +186,9 @@ def test_method_update_with_all_params_overload_1(self, client: Cloudflare) -> N consumer_id="023e105f4ecef8ad9ca31a8372d0c353", account_id="023e105f4ecef8ad9ca31a8372d0c353", queue_id="023e105f4ecef8ad9ca31a8372d0c353", - dead_letter_queue="example-queue", script_name="my-consumer-worker", + type="worker", + dead_letter_queue="example-queue", settings={ "batch_size": 50, "max_concurrency": 10, @@ -172,9 +196,8 @@ def test_method_update_with_all_params_overload_1(self, client: Cloudflare) -> N "max_wait_time_ms": 5000, "retry_delay": 10, }, - type="worker", ) - assert_matches_type(Optional[Consumer], consumer, path=["response"]) + assert_matches_type(Optional[ConsumerUpdateResponse], consumer, path=["response"]) @parametrize def test_raw_response_update_overload_1(self, client: Cloudflare) -> None: @@ -182,12 +205,14 @@ def test_raw_response_update_overload_1(self, client: Cloudflare) -> None: consumer_id="023e105f4ecef8ad9ca31a8372d0c353", account_id="023e105f4ecef8ad9ca31a8372d0c353", queue_id="023e105f4ecef8ad9ca31a8372d0c353", + script_name="my-consumer-worker", + type="worker", ) assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" consumer = response.parse() - assert_matches_type(Optional[Consumer], consumer, path=["response"]) + assert_matches_type(Optional[ConsumerUpdateResponse], consumer, path=["response"]) @parametrize def test_streaming_response_update_overload_1(self, client: Cloudflare) -> None: @@ -195,12 +220,14 @@ def test_streaming_response_update_overload_1(self, client: Cloudflare) -> None: consumer_id="023e105f4ecef8ad9ca31a8372d0c353", account_id="023e105f4ecef8ad9ca31a8372d0c353", queue_id="023e105f4ecef8ad9ca31a8372d0c353", + script_name="my-consumer-worker", + type="worker", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" consumer = response.parse() - assert_matches_type(Optional[Consumer], consumer, path=["response"]) + assert_matches_type(Optional[ConsumerUpdateResponse], consumer, path=["response"]) assert cast(Any, response.is_closed) is True @@ -211,6 +238,8 @@ def test_path_params_update_overload_1(self, client: Cloudflare) -> None: consumer_id="023e105f4ecef8ad9ca31a8372d0c353", account_id="", queue_id="023e105f4ecef8ad9ca31a8372d0c353", + script_name="my-consumer-worker", + type="worker", ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `queue_id` but received ''"): @@ -218,6 +247,8 @@ def test_path_params_update_overload_1(self, client: Cloudflare) -> None: consumer_id="023e105f4ecef8ad9ca31a8372d0c353", account_id="023e105f4ecef8ad9ca31a8372d0c353", queue_id="", + script_name="my-consumer-worker", + type="worker", ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `consumer_id` but received ''"): @@ -225,6 +256,8 @@ def test_path_params_update_overload_1(self, client: Cloudflare) -> None: consumer_id="", account_id="023e105f4ecef8ad9ca31a8372d0c353", queue_id="023e105f4ecef8ad9ca31a8372d0c353", + script_name="my-consumer-worker", + type="worker", ) @parametrize @@ -233,8 +266,9 @@ def test_method_update_overload_2(self, client: Cloudflare) -> None: consumer_id="023e105f4ecef8ad9ca31a8372d0c353", account_id="023e105f4ecef8ad9ca31a8372d0c353", queue_id="023e105f4ecef8ad9ca31a8372d0c353", + type="http_pull", ) - assert_matches_type(Optional[Consumer], consumer, path=["response"]) + assert_matches_type(Optional[ConsumerUpdateResponse], consumer, path=["response"]) @parametrize def test_method_update_with_all_params_overload_2(self, client: Cloudflare) -> None: @@ -242,6 +276,7 @@ def test_method_update_with_all_params_overload_2(self, client: Cloudflare) -> N consumer_id="023e105f4ecef8ad9ca31a8372d0c353", account_id="023e105f4ecef8ad9ca31a8372d0c353", queue_id="023e105f4ecef8ad9ca31a8372d0c353", + type="http_pull", dead_letter_queue="example-queue", settings={ "batch_size": 50, @@ -249,9 +284,8 @@ def test_method_update_with_all_params_overload_2(self, client: Cloudflare) -> N "retry_delay": 10, "visibility_timeout_ms": 6000, }, - type="http_pull", ) - assert_matches_type(Optional[Consumer], consumer, path=["response"]) + assert_matches_type(Optional[ConsumerUpdateResponse], consumer, path=["response"]) @parametrize def test_raw_response_update_overload_2(self, client: Cloudflare) -> None: @@ -259,12 +293,13 @@ def test_raw_response_update_overload_2(self, client: Cloudflare) -> None: consumer_id="023e105f4ecef8ad9ca31a8372d0c353", account_id="023e105f4ecef8ad9ca31a8372d0c353", queue_id="023e105f4ecef8ad9ca31a8372d0c353", + type="http_pull", ) assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" consumer = response.parse() - assert_matches_type(Optional[Consumer], consumer, path=["response"]) + assert_matches_type(Optional[ConsumerUpdateResponse], consumer, path=["response"]) @parametrize def test_streaming_response_update_overload_2(self, client: Cloudflare) -> None: @@ -272,12 +307,13 @@ def test_streaming_response_update_overload_2(self, client: Cloudflare) -> None: consumer_id="023e105f4ecef8ad9ca31a8372d0c353", account_id="023e105f4ecef8ad9ca31a8372d0c353", queue_id="023e105f4ecef8ad9ca31a8372d0c353", + type="http_pull", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" consumer = response.parse() - assert_matches_type(Optional[Consumer], consumer, path=["response"]) + assert_matches_type(Optional[ConsumerUpdateResponse], consumer, path=["response"]) assert cast(Any, response.is_closed) is True @@ -288,6 +324,7 @@ def test_path_params_update_overload_2(self, client: Cloudflare) -> None: consumer_id="023e105f4ecef8ad9ca31a8372d0c353", account_id="", queue_id="023e105f4ecef8ad9ca31a8372d0c353", + type="http_pull", ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `queue_id` but received ''"): @@ -295,6 +332,7 @@ def test_path_params_update_overload_2(self, client: Cloudflare) -> None: consumer_id="023e105f4ecef8ad9ca31a8372d0c353", account_id="023e105f4ecef8ad9ca31a8372d0c353", queue_id="", + type="http_pull", ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `consumer_id` but received ''"): @@ -302,6 +340,7 @@ def test_path_params_update_overload_2(self, client: Cloudflare) -> None: consumer_id="", account_id="023e105f4ecef8ad9ca31a8372d0c353", queue_id="023e105f4ecef8ad9ca31a8372d0c353", + type="http_pull", ) @parametrize @@ -310,7 +349,7 @@ def test_method_list(self, client: Cloudflare) -> None: queue_id="023e105f4ecef8ad9ca31a8372d0c353", account_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(SyncSinglePage[Consumer], consumer, path=["response"]) + assert_matches_type(SyncSinglePage[ConsumerListResponse], consumer, path=["response"]) @parametrize def test_raw_response_list(self, client: Cloudflare) -> None: @@ -322,7 +361,7 @@ def test_raw_response_list(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" consumer = response.parse() - assert_matches_type(SyncSinglePage[Consumer], consumer, path=["response"]) + assert_matches_type(SyncSinglePage[ConsumerListResponse], consumer, path=["response"]) @parametrize def test_streaming_response_list(self, client: Cloudflare) -> None: @@ -334,7 +373,7 @@ def test_streaming_response_list(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" consumer = response.parse() - assert_matches_type(SyncSinglePage[Consumer], consumer, path=["response"]) + assert_matches_type(SyncSinglePage[ConsumerListResponse], consumer, path=["response"]) assert cast(Any, response.is_closed) is True @@ -419,7 +458,7 @@ def test_method_get(self, client: Cloudflare) -> None: account_id="023e105f4ecef8ad9ca31a8372d0c353", queue_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(Optional[Consumer], consumer, path=["response"]) + assert_matches_type(Optional[ConsumerGetResponse], consumer, path=["response"]) @parametrize def test_raw_response_get(self, client: Cloudflare) -> None: @@ -432,7 +471,7 @@ def test_raw_response_get(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" consumer = response.parse() - assert_matches_type(Optional[Consumer], consumer, path=["response"]) + assert_matches_type(Optional[ConsumerGetResponse], consumer, path=["response"]) @parametrize def test_streaming_response_get(self, client: Cloudflare) -> None: @@ -445,7 +484,7 @@ def test_streaming_response_get(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" consumer = response.parse() - assert_matches_type(Optional[Consumer], consumer, path=["response"]) + assert_matches_type(Optional[ConsumerGetResponse], consumer, path=["response"]) assert cast(Any, response.is_closed) is True @@ -483,16 +522,19 @@ async def test_method_create_overload_1(self, async_client: AsyncCloudflare) -> consumer = await async_client.queues.consumers.create( queue_id="023e105f4ecef8ad9ca31a8372d0c353", account_id="023e105f4ecef8ad9ca31a8372d0c353", + script_name="my-consumer-worker", + type="worker", ) - assert_matches_type(Optional[Consumer], consumer, path=["response"]) + assert_matches_type(Optional[ConsumerCreateResponse], consumer, path=["response"]) @parametrize async def test_method_create_with_all_params_overload_1(self, async_client: AsyncCloudflare) -> None: consumer = await async_client.queues.consumers.create( queue_id="023e105f4ecef8ad9ca31a8372d0c353", account_id="023e105f4ecef8ad9ca31a8372d0c353", - dead_letter_queue="example-queue", script_name="my-consumer-worker", + type="worker", + dead_letter_queue="example-queue", settings={ "batch_size": 50, "max_concurrency": 10, @@ -500,33 +542,36 @@ async def test_method_create_with_all_params_overload_1(self, async_client: Asyn "max_wait_time_ms": 5000, "retry_delay": 10, }, - type="worker", ) - assert_matches_type(Optional[Consumer], consumer, path=["response"]) + assert_matches_type(Optional[ConsumerCreateResponse], consumer, path=["response"]) @parametrize async def test_raw_response_create_overload_1(self, async_client: AsyncCloudflare) -> None: response = await async_client.queues.consumers.with_raw_response.create( queue_id="023e105f4ecef8ad9ca31a8372d0c353", account_id="023e105f4ecef8ad9ca31a8372d0c353", + script_name="my-consumer-worker", + type="worker", ) assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" consumer = await response.parse() - assert_matches_type(Optional[Consumer], consumer, path=["response"]) + assert_matches_type(Optional[ConsumerCreateResponse], consumer, path=["response"]) @parametrize async def test_streaming_response_create_overload_1(self, async_client: AsyncCloudflare) -> None: async with async_client.queues.consumers.with_streaming_response.create( queue_id="023e105f4ecef8ad9ca31a8372d0c353", account_id="023e105f4ecef8ad9ca31a8372d0c353", + script_name="my-consumer-worker", + type="worker", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" consumer = await response.parse() - assert_matches_type(Optional[Consumer], consumer, path=["response"]) + assert_matches_type(Optional[ConsumerCreateResponse], consumer, path=["response"]) assert cast(Any, response.is_closed) is True @@ -536,12 +581,16 @@ async def test_path_params_create_overload_1(self, async_client: AsyncCloudflare await async_client.queues.consumers.with_raw_response.create( queue_id="023e105f4ecef8ad9ca31a8372d0c353", account_id="", + script_name="my-consumer-worker", + type="worker", ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `queue_id` but received ''"): await async_client.queues.consumers.with_raw_response.create( queue_id="", account_id="023e105f4ecef8ad9ca31a8372d0c353", + script_name="my-consumer-worker", + type="worker", ) @parametrize @@ -549,14 +598,16 @@ async def test_method_create_overload_2(self, async_client: AsyncCloudflare) -> consumer = await async_client.queues.consumers.create( queue_id="023e105f4ecef8ad9ca31a8372d0c353", account_id="023e105f4ecef8ad9ca31a8372d0c353", + type="http_pull", ) - assert_matches_type(Optional[Consumer], consumer, path=["response"]) + assert_matches_type(Optional[ConsumerCreateResponse], consumer, path=["response"]) @parametrize async def test_method_create_with_all_params_overload_2(self, async_client: AsyncCloudflare) -> None: consumer = await async_client.queues.consumers.create( queue_id="023e105f4ecef8ad9ca31a8372d0c353", account_id="023e105f4ecef8ad9ca31a8372d0c353", + type="http_pull", dead_letter_queue="example-queue", settings={ "batch_size": 50, @@ -564,33 +615,34 @@ async def test_method_create_with_all_params_overload_2(self, async_client: Asyn "retry_delay": 10, "visibility_timeout_ms": 6000, }, - type="http_pull", ) - assert_matches_type(Optional[Consumer], consumer, path=["response"]) + assert_matches_type(Optional[ConsumerCreateResponse], consumer, path=["response"]) @parametrize async def test_raw_response_create_overload_2(self, async_client: AsyncCloudflare) -> None: response = await async_client.queues.consumers.with_raw_response.create( queue_id="023e105f4ecef8ad9ca31a8372d0c353", account_id="023e105f4ecef8ad9ca31a8372d0c353", + type="http_pull", ) assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" consumer = await response.parse() - assert_matches_type(Optional[Consumer], consumer, path=["response"]) + assert_matches_type(Optional[ConsumerCreateResponse], consumer, path=["response"]) @parametrize async def test_streaming_response_create_overload_2(self, async_client: AsyncCloudflare) -> None: async with async_client.queues.consumers.with_streaming_response.create( queue_id="023e105f4ecef8ad9ca31a8372d0c353", account_id="023e105f4ecef8ad9ca31a8372d0c353", + type="http_pull", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" consumer = await response.parse() - assert_matches_type(Optional[Consumer], consumer, path=["response"]) + assert_matches_type(Optional[ConsumerCreateResponse], consumer, path=["response"]) assert cast(Any, response.is_closed) is True @@ -600,12 +652,14 @@ async def test_path_params_create_overload_2(self, async_client: AsyncCloudflare await async_client.queues.consumers.with_raw_response.create( queue_id="023e105f4ecef8ad9ca31a8372d0c353", account_id="", + type="http_pull", ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `queue_id` but received ''"): await async_client.queues.consumers.with_raw_response.create( queue_id="", account_id="023e105f4ecef8ad9ca31a8372d0c353", + type="http_pull", ) @parametrize @@ -614,8 +668,10 @@ async def test_method_update_overload_1(self, async_client: AsyncCloudflare) -> consumer_id="023e105f4ecef8ad9ca31a8372d0c353", account_id="023e105f4ecef8ad9ca31a8372d0c353", queue_id="023e105f4ecef8ad9ca31a8372d0c353", + script_name="my-consumer-worker", + type="worker", ) - assert_matches_type(Optional[Consumer], consumer, path=["response"]) + assert_matches_type(Optional[ConsumerUpdateResponse], consumer, path=["response"]) @parametrize async def test_method_update_with_all_params_overload_1(self, async_client: AsyncCloudflare) -> None: @@ -623,8 +679,9 @@ async def test_method_update_with_all_params_overload_1(self, async_client: Asyn consumer_id="023e105f4ecef8ad9ca31a8372d0c353", account_id="023e105f4ecef8ad9ca31a8372d0c353", queue_id="023e105f4ecef8ad9ca31a8372d0c353", - dead_letter_queue="example-queue", script_name="my-consumer-worker", + type="worker", + dead_letter_queue="example-queue", settings={ "batch_size": 50, "max_concurrency": 10, @@ -632,9 +689,8 @@ async def test_method_update_with_all_params_overload_1(self, async_client: Asyn "max_wait_time_ms": 5000, "retry_delay": 10, }, - type="worker", ) - assert_matches_type(Optional[Consumer], consumer, path=["response"]) + assert_matches_type(Optional[ConsumerUpdateResponse], consumer, path=["response"]) @parametrize async def test_raw_response_update_overload_1(self, async_client: AsyncCloudflare) -> None: @@ -642,12 +698,14 @@ async def test_raw_response_update_overload_1(self, async_client: AsyncCloudflar consumer_id="023e105f4ecef8ad9ca31a8372d0c353", account_id="023e105f4ecef8ad9ca31a8372d0c353", queue_id="023e105f4ecef8ad9ca31a8372d0c353", + script_name="my-consumer-worker", + type="worker", ) assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" consumer = await response.parse() - assert_matches_type(Optional[Consumer], consumer, path=["response"]) + assert_matches_type(Optional[ConsumerUpdateResponse], consumer, path=["response"]) @parametrize async def test_streaming_response_update_overload_1(self, async_client: AsyncCloudflare) -> None: @@ -655,12 +713,14 @@ async def test_streaming_response_update_overload_1(self, async_client: AsyncClo consumer_id="023e105f4ecef8ad9ca31a8372d0c353", account_id="023e105f4ecef8ad9ca31a8372d0c353", queue_id="023e105f4ecef8ad9ca31a8372d0c353", + script_name="my-consumer-worker", + type="worker", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" consumer = await response.parse() - assert_matches_type(Optional[Consumer], consumer, path=["response"]) + assert_matches_type(Optional[ConsumerUpdateResponse], consumer, path=["response"]) assert cast(Any, response.is_closed) is True @@ -671,6 +731,8 @@ async def test_path_params_update_overload_1(self, async_client: AsyncCloudflare consumer_id="023e105f4ecef8ad9ca31a8372d0c353", account_id="", queue_id="023e105f4ecef8ad9ca31a8372d0c353", + script_name="my-consumer-worker", + type="worker", ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `queue_id` but received ''"): @@ -678,6 +740,8 @@ async def test_path_params_update_overload_1(self, async_client: AsyncCloudflare consumer_id="023e105f4ecef8ad9ca31a8372d0c353", account_id="023e105f4ecef8ad9ca31a8372d0c353", queue_id="", + script_name="my-consumer-worker", + type="worker", ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `consumer_id` but received ''"): @@ -685,6 +749,8 @@ async def test_path_params_update_overload_1(self, async_client: AsyncCloudflare consumer_id="", account_id="023e105f4ecef8ad9ca31a8372d0c353", queue_id="023e105f4ecef8ad9ca31a8372d0c353", + script_name="my-consumer-worker", + type="worker", ) @parametrize @@ -693,8 +759,9 @@ async def test_method_update_overload_2(self, async_client: AsyncCloudflare) -> consumer_id="023e105f4ecef8ad9ca31a8372d0c353", account_id="023e105f4ecef8ad9ca31a8372d0c353", queue_id="023e105f4ecef8ad9ca31a8372d0c353", + type="http_pull", ) - assert_matches_type(Optional[Consumer], consumer, path=["response"]) + assert_matches_type(Optional[ConsumerUpdateResponse], consumer, path=["response"]) @parametrize async def test_method_update_with_all_params_overload_2(self, async_client: AsyncCloudflare) -> None: @@ -702,6 +769,7 @@ async def test_method_update_with_all_params_overload_2(self, async_client: Asyn consumer_id="023e105f4ecef8ad9ca31a8372d0c353", account_id="023e105f4ecef8ad9ca31a8372d0c353", queue_id="023e105f4ecef8ad9ca31a8372d0c353", + type="http_pull", dead_letter_queue="example-queue", settings={ "batch_size": 50, @@ -709,9 +777,8 @@ async def test_method_update_with_all_params_overload_2(self, async_client: Asyn "retry_delay": 10, "visibility_timeout_ms": 6000, }, - type="http_pull", ) - assert_matches_type(Optional[Consumer], consumer, path=["response"]) + assert_matches_type(Optional[ConsumerUpdateResponse], consumer, path=["response"]) @parametrize async def test_raw_response_update_overload_2(self, async_client: AsyncCloudflare) -> None: @@ -719,12 +786,13 @@ async def test_raw_response_update_overload_2(self, async_client: AsyncCloudflar consumer_id="023e105f4ecef8ad9ca31a8372d0c353", account_id="023e105f4ecef8ad9ca31a8372d0c353", queue_id="023e105f4ecef8ad9ca31a8372d0c353", + type="http_pull", ) assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" consumer = await response.parse() - assert_matches_type(Optional[Consumer], consumer, path=["response"]) + assert_matches_type(Optional[ConsumerUpdateResponse], consumer, path=["response"]) @parametrize async def test_streaming_response_update_overload_2(self, async_client: AsyncCloudflare) -> None: @@ -732,12 +800,13 @@ async def test_streaming_response_update_overload_2(self, async_client: AsyncClo consumer_id="023e105f4ecef8ad9ca31a8372d0c353", account_id="023e105f4ecef8ad9ca31a8372d0c353", queue_id="023e105f4ecef8ad9ca31a8372d0c353", + type="http_pull", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" consumer = await response.parse() - assert_matches_type(Optional[Consumer], consumer, path=["response"]) + assert_matches_type(Optional[ConsumerUpdateResponse], consumer, path=["response"]) assert cast(Any, response.is_closed) is True @@ -748,6 +817,7 @@ async def test_path_params_update_overload_2(self, async_client: AsyncCloudflare consumer_id="023e105f4ecef8ad9ca31a8372d0c353", account_id="", queue_id="023e105f4ecef8ad9ca31a8372d0c353", + type="http_pull", ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `queue_id` but received ''"): @@ -755,6 +825,7 @@ async def test_path_params_update_overload_2(self, async_client: AsyncCloudflare consumer_id="023e105f4ecef8ad9ca31a8372d0c353", account_id="023e105f4ecef8ad9ca31a8372d0c353", queue_id="", + type="http_pull", ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `consumer_id` but received ''"): @@ -762,6 +833,7 @@ async def test_path_params_update_overload_2(self, async_client: AsyncCloudflare consumer_id="", account_id="023e105f4ecef8ad9ca31a8372d0c353", queue_id="023e105f4ecef8ad9ca31a8372d0c353", + type="http_pull", ) @parametrize @@ -770,7 +842,7 @@ async def test_method_list(self, async_client: AsyncCloudflare) -> None: queue_id="023e105f4ecef8ad9ca31a8372d0c353", account_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(AsyncSinglePage[Consumer], consumer, path=["response"]) + assert_matches_type(AsyncSinglePage[ConsumerListResponse], consumer, path=["response"]) @parametrize async def test_raw_response_list(self, async_client: AsyncCloudflare) -> None: @@ -782,7 +854,7 @@ async def test_raw_response_list(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" consumer = await response.parse() - assert_matches_type(AsyncSinglePage[Consumer], consumer, path=["response"]) + assert_matches_type(AsyncSinglePage[ConsumerListResponse], consumer, path=["response"]) @parametrize async def test_streaming_response_list(self, async_client: AsyncCloudflare) -> None: @@ -794,7 +866,7 @@ async def test_streaming_response_list(self, async_client: AsyncCloudflare) -> N assert response.http_request.headers.get("X-Stainless-Lang") == "python" consumer = await response.parse() - assert_matches_type(AsyncSinglePage[Consumer], consumer, path=["response"]) + assert_matches_type(AsyncSinglePage[ConsumerListResponse], consumer, path=["response"]) assert cast(Any, response.is_closed) is True @@ -879,7 +951,7 @@ async def test_method_get(self, async_client: AsyncCloudflare) -> None: account_id="023e105f4ecef8ad9ca31a8372d0c353", queue_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(Optional[Consumer], consumer, path=["response"]) + assert_matches_type(Optional[ConsumerGetResponse], consumer, path=["response"]) @parametrize async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: @@ -892,7 +964,7 @@ async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" consumer = await response.parse() - assert_matches_type(Optional[Consumer], consumer, path=["response"]) + assert_matches_type(Optional[ConsumerGetResponse], consumer, path=["response"]) @parametrize async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> None: @@ -905,7 +977,7 @@ async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> No assert response.http_request.headers.get("X-Stainless-Lang") == "python" consumer = await response.parse() - assert_matches_type(Optional[Consumer], consumer, path=["response"]) + assert_matches_type(Optional[ConsumerGetResponse], consumer, path=["response"]) assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/r2/super_slurper/test_connectivity_precheck.py b/tests/api_resources/r2/super_slurper/test_connectivity_precheck.py index 3d6e68149af..36b777342f4 100644 --- a/tests/api_resources/r2/super_slurper/test_connectivity_precheck.py +++ b/tests/api_resources/r2/super_slurper/test_connectivity_precheck.py @@ -44,6 +44,7 @@ def test_method_source_with_all_params_overload_1(self, client: Cloudflare) -> N }, vendor="s3", endpoint="endpoint", + keys=["string"], path_prefix="pathPrefix", region="region", ) @@ -121,6 +122,7 @@ def test_method_source_with_all_params_overload_2(self, client: Cloudflare) -> N "private_key": "privateKey", }, vendor="gcs", + keys=["string"], path_prefix="pathPrefix", ) assert_matches_type(Optional[ConnectivityPrecheckSourceResponse], connectivity_precheck, path=["response"]) @@ -198,6 +200,7 @@ def test_method_source_with_all_params_overload_3(self, client: Cloudflare) -> N }, vendor="r2", jurisdiction="default", + keys=["string"], path_prefix="pathPrefix", ) assert_matches_type(Optional[ConnectivityPrecheckSourceResponse], connectivity_precheck, path=["response"]) @@ -357,6 +360,7 @@ async def test_method_source_with_all_params_overload_1(self, async_client: Asyn }, vendor="s3", endpoint="endpoint", + keys=["string"], path_prefix="pathPrefix", region="region", ) @@ -434,6 +438,7 @@ async def test_method_source_with_all_params_overload_2(self, async_client: Asyn "private_key": "privateKey", }, vendor="gcs", + keys=["string"], path_prefix="pathPrefix", ) assert_matches_type(Optional[ConnectivityPrecheckSourceResponse], connectivity_precheck, path=["response"]) @@ -511,6 +516,7 @@ async def test_method_source_with_all_params_overload_3(self, async_client: Asyn }, vendor="r2", jurisdiction="default", + keys=["string"], path_prefix="pathPrefix", ) assert_matches_type(Optional[ConnectivityPrecheckSourceResponse], connectivity_precheck, path=["response"]) diff --git a/tests/api_resources/r2/super_slurper/test_jobs.py b/tests/api_resources/r2/super_slurper/test_jobs.py index e99c08891a1..48150de5eb3 100644 --- a/tests/api_resources/r2/super_slurper/test_jobs.py +++ b/tests/api_resources/r2/super_slurper/test_jobs.py @@ -43,6 +43,7 @@ def test_method_create_with_all_params(self, client: Cloudflare) -> None: }, "vendor": "s3", "endpoint": "endpoint", + "keys": ["string"], "path_prefix": "pathPrefix", "region": "region", }, @@ -440,6 +441,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncCloudflare }, "vendor": "s3", "endpoint": "endpoint", + "keys": ["string"], "path_prefix": "pathPrefix", "region": "region", }, diff --git a/tests/api_resources/radar/ai/test_bots.py b/tests/api_resources/radar/ai/test_bots.py index 80a6276974e..c80b17f24a7 100644 --- a/tests/api_resources/radar/ai/test_bots.py +++ b/tests/api_resources/radar/ai/test_bots.py @@ -34,6 +34,7 @@ def test_method_summary_v2_with_all_params(self, client: Cloudflare) -> None: bot = client.radar.ai.bots.summary_v2( dimension="USER_AGENT", asn=["string"], + content_type=["HTML"], continent=["string"], crawl_purpose=["string"], date_end=[parse_datetime("2019-12-27T18:11:19.117Z")], @@ -44,6 +45,7 @@ def test_method_summary_v2_with_all_params(self, client: Cloudflare) -> None: limit_per_group=10, location=["string"], name=["main_series"], + user_agent=["string"], vertical=["string"], ) assert_matches_type(BotSummaryV2Response, bot, path=["response"]) @@ -82,6 +84,7 @@ def test_method_timeseries_with_all_params(self, client: Cloudflare) -> None: bot = client.radar.ai.bots.timeseries( agg_interval="1h", asn=["string"], + content_type=["HTML"], continent=["string"], crawl_purpose=["string"], date_end=[parse_datetime("2019-12-27T18:11:19.117Z")], @@ -130,6 +133,7 @@ def test_method_timeseries_groups_with_all_params(self, client: Cloudflare) -> N dimension="USER_AGENT", agg_interval="1h", asn=["string"], + content_type=["HTML"], continent=["string"], crawl_purpose=["string"], date_end=[parse_datetime("2019-12-27T18:11:19.117Z")], @@ -140,7 +144,8 @@ def test_method_timeseries_groups_with_all_params(self, client: Cloudflare) -> N limit_per_group=10, location=["string"], name=["main_series"], - normalization="MIN0_MAX", + normalization="PERCENTAGE", + user_agent=["string"], vertical=["string"], ) assert_matches_type(BotTimeseriesGroupsResponse, bot, path=["response"]) @@ -187,6 +192,7 @@ async def test_method_summary_v2_with_all_params(self, async_client: AsyncCloudf bot = await async_client.radar.ai.bots.summary_v2( dimension="USER_AGENT", asn=["string"], + content_type=["HTML"], continent=["string"], crawl_purpose=["string"], date_end=[parse_datetime("2019-12-27T18:11:19.117Z")], @@ -197,6 +203,7 @@ async def test_method_summary_v2_with_all_params(self, async_client: AsyncCloudf limit_per_group=10, location=["string"], name=["main_series"], + user_agent=["string"], vertical=["string"], ) assert_matches_type(BotSummaryV2Response, bot, path=["response"]) @@ -235,6 +242,7 @@ async def test_method_timeseries_with_all_params(self, async_client: AsyncCloudf bot = await async_client.radar.ai.bots.timeseries( agg_interval="1h", asn=["string"], + content_type=["HTML"], continent=["string"], crawl_purpose=["string"], date_end=[parse_datetime("2019-12-27T18:11:19.117Z")], @@ -283,6 +291,7 @@ async def test_method_timeseries_groups_with_all_params(self, async_client: Asyn dimension="USER_AGENT", agg_interval="1h", asn=["string"], + content_type=["HTML"], continent=["string"], crawl_purpose=["string"], date_end=[parse_datetime("2019-12-27T18:11:19.117Z")], @@ -293,7 +302,8 @@ async def test_method_timeseries_groups_with_all_params(self, async_client: Asyn limit_per_group=10, location=["string"], name=["main_series"], - normalization="MIN0_MAX", + normalization="PERCENTAGE", + user_agent=["string"], vertical=["string"], ) assert_matches_type(BotTimeseriesGroupsResponse, bot, path=["response"]) diff --git a/tests/api_resources/radar/ai/test_timeseries_groups.py b/tests/api_resources/radar/ai/test_timeseries_groups.py index 4d12d4f250f..281a8f652f7 100644 --- a/tests/api_resources/radar/ai/test_timeseries_groups.py +++ b/tests/api_resources/radar/ai/test_timeseries_groups.py @@ -40,6 +40,7 @@ def test_method_summary_with_all_params(self, client: Cloudflare) -> None: timeseries_group = client.radar.ai.timeseries_groups.summary( dimension="USER_AGENT", asn=["string"], + content_type=["HTML"], continent=["string"], crawl_purpose=["string"], date_end=[parse_datetime("2019-12-27T18:11:19.117Z")], @@ -50,6 +51,7 @@ def test_method_summary_with_all_params(self, client: Cloudflare) -> None: limit_per_group=10, location=["string"], name=["main_series"], + user_agent=["string"], vertical=["string"], ) @@ -94,6 +96,7 @@ def test_method_timeseries_with_all_params(self, client: Cloudflare) -> None: timeseries_group = client.radar.ai.timeseries_groups.timeseries( agg_interval="1h", asn=["string"], + content_type=["HTML"], continent=["string"], crawl_purpose=["string"], date_end=[parse_datetime("2019-12-27T18:11:19.117Z")], @@ -148,6 +151,7 @@ def test_method_timeseries_groups_with_all_params(self, client: Cloudflare) -> N dimension="USER_AGENT", agg_interval="1h", asn=["string"], + content_type=["HTML"], continent=["string"], crawl_purpose=["string"], date_end=[parse_datetime("2019-12-27T18:11:19.117Z")], @@ -158,7 +162,8 @@ def test_method_timeseries_groups_with_all_params(self, client: Cloudflare) -> N limit_per_group=10, location=["string"], name=["main_series"], - normalization="MIN0_MAX", + normalization="PERCENTAGE", + user_agent=["string"], vertical=["string"], ) @@ -258,6 +263,7 @@ async def test_method_summary_with_all_params(self, async_client: AsyncCloudflar timeseries_group = await async_client.radar.ai.timeseries_groups.summary( dimension="USER_AGENT", asn=["string"], + content_type=["HTML"], continent=["string"], crawl_purpose=["string"], date_end=[parse_datetime("2019-12-27T18:11:19.117Z")], @@ -268,6 +274,7 @@ async def test_method_summary_with_all_params(self, async_client: AsyncCloudflar limit_per_group=10, location=["string"], name=["main_series"], + user_agent=["string"], vertical=["string"], ) @@ -312,6 +319,7 @@ async def test_method_timeseries_with_all_params(self, async_client: AsyncCloudf timeseries_group = await async_client.radar.ai.timeseries_groups.timeseries( agg_interval="1h", asn=["string"], + content_type=["HTML"], continent=["string"], crawl_purpose=["string"], date_end=[parse_datetime("2019-12-27T18:11:19.117Z")], @@ -366,6 +374,7 @@ async def test_method_timeseries_groups_with_all_params(self, async_client: Asyn dimension="USER_AGENT", agg_interval="1h", asn=["string"], + content_type=["HTML"], continent=["string"], crawl_purpose=["string"], date_end=[parse_datetime("2019-12-27T18:11:19.117Z")], @@ -376,7 +385,8 @@ async def test_method_timeseries_groups_with_all_params(self, async_client: Asyn limit_per_group=10, location=["string"], name=["main_series"], - normalization="MIN0_MAX", + normalization="PERCENTAGE", + user_agent=["string"], vertical=["string"], ) diff --git a/tests/api_resources/rulesets/test_rules.py b/tests/api_resources/rulesets/test_rules.py index d19c85a55ee..a15cd560be1 100644 --- a/tests/api_resources/rulesets/test_rules.py +++ b/tests/api_resources/rulesets/test_rules.py @@ -1633,6 +1633,7 @@ def test_method_create_with_all_params_overload_17(self, client: Cloudflare) -> "js": True, }, "bic": True, + "content_converter": True, "disable_apps": True, "disable_pay_per_crawl": True, "disable_rum": True, @@ -3739,6 +3740,7 @@ def test_method_edit_with_all_params_overload_17(self, client: Cloudflare) -> No "js": True, }, "bic": True, + "content_converter": True, "disable_apps": True, "disable_pay_per_crawl": True, "disable_rum": True, @@ -5570,6 +5572,7 @@ async def test_method_create_with_all_params_overload_17(self, async_client: Asy "js": True, }, "bic": True, + "content_converter": True, "disable_apps": True, "disable_pay_per_crawl": True, "disable_rum": True, @@ -7676,6 +7679,7 @@ async def test_method_edit_with_all_params_overload_17(self, async_client: Async "js": True, }, "bic": True, + "content_converter": True, "disable_apps": True, "disable_pay_per_crawl": True, "disable_rum": True, diff --git a/tests/api_resources/snippets/test_rules.py b/tests/api_resources/snippets/test_rules.py index 53da364b377..862ce32bb8a 100644 --- a/tests/api_resources/snippets/test_rules.py +++ b/tests/api_resources/snippets/test_rules.py @@ -9,8 +9,6 @@ from cloudflare import Cloudflare, AsyncCloudflare from tests.utils import assert_matches_type -from cloudflare.pagination import SyncSinglePage, AsyncSinglePage -from cloudflare.types.snippets import RuleListResponse, RuleDeleteResponse, RuleUpdateResponse base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") @@ -29,7 +27,7 @@ def test_method_update(self, client: Cloudflare) -> None: } ], ) - assert_matches_type(SyncSinglePage[RuleUpdateResponse], rule, path=["response"]) + assert_matches_type(object, rule, path=["response"]) @parametrize def test_raw_response_update(self, client: Cloudflare) -> None: @@ -46,7 +44,7 @@ def test_raw_response_update(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" rule = response.parse() - assert_matches_type(SyncSinglePage[RuleUpdateResponse], rule, path=["response"]) + assert_matches_type(object, rule, path=["response"]) @parametrize def test_streaming_response_update(self, client: Cloudflare) -> None: @@ -63,7 +61,7 @@ def test_streaming_response_update(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" rule = response.parse() - assert_matches_type(SyncSinglePage[RuleUpdateResponse], rule, path=["response"]) + assert_matches_type(object, rule, path=["response"]) assert cast(Any, response.is_closed) is True @@ -85,7 +83,7 @@ def test_method_list(self, client: Cloudflare) -> None: rule = client.snippets.rules.list( zone_id="9f1839b6152d298aca64c4e906b6d074", ) - assert_matches_type(SyncSinglePage[RuleListResponse], rule, path=["response"]) + assert_matches_type(object, rule, path=["response"]) @parametrize def test_raw_response_list(self, client: Cloudflare) -> None: @@ -96,7 +94,7 @@ def test_raw_response_list(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" rule = response.parse() - assert_matches_type(SyncSinglePage[RuleListResponse], rule, path=["response"]) + assert_matches_type(object, rule, path=["response"]) @parametrize def test_streaming_response_list(self, client: Cloudflare) -> None: @@ -107,7 +105,7 @@ def test_streaming_response_list(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" rule = response.parse() - assert_matches_type(SyncSinglePage[RuleListResponse], rule, path=["response"]) + assert_matches_type(object, rule, path=["response"]) assert cast(Any, response.is_closed) is True @@ -123,7 +121,7 @@ def test_method_delete(self, client: Cloudflare) -> None: rule = client.snippets.rules.delete( zone_id="9f1839b6152d298aca64c4e906b6d074", ) - assert_matches_type(SyncSinglePage[RuleDeleteResponse], rule, path=["response"]) + assert_matches_type(object, rule, path=["response"]) @parametrize def test_raw_response_delete(self, client: Cloudflare) -> None: @@ -134,7 +132,7 @@ def test_raw_response_delete(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" rule = response.parse() - assert_matches_type(SyncSinglePage[RuleDeleteResponse], rule, path=["response"]) + assert_matches_type(object, rule, path=["response"]) @parametrize def test_streaming_response_delete(self, client: Cloudflare) -> None: @@ -145,7 +143,7 @@ def test_streaming_response_delete(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" rule = response.parse() - assert_matches_type(SyncSinglePage[RuleDeleteResponse], rule, path=["response"]) + assert_matches_type(object, rule, path=["response"]) assert cast(Any, response.is_closed) is True @@ -173,7 +171,7 @@ async def test_method_update(self, async_client: AsyncCloudflare) -> None: } ], ) - assert_matches_type(AsyncSinglePage[RuleUpdateResponse], rule, path=["response"]) + assert_matches_type(object, rule, path=["response"]) @parametrize async def test_raw_response_update(self, async_client: AsyncCloudflare) -> None: @@ -190,7 +188,7 @@ async def test_raw_response_update(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" rule = await response.parse() - assert_matches_type(AsyncSinglePage[RuleUpdateResponse], rule, path=["response"]) + assert_matches_type(object, rule, path=["response"]) @parametrize async def test_streaming_response_update(self, async_client: AsyncCloudflare) -> None: @@ -207,7 +205,7 @@ async def test_streaming_response_update(self, async_client: AsyncCloudflare) -> assert response.http_request.headers.get("X-Stainless-Lang") == "python" rule = await response.parse() - assert_matches_type(AsyncSinglePage[RuleUpdateResponse], rule, path=["response"]) + assert_matches_type(object, rule, path=["response"]) assert cast(Any, response.is_closed) is True @@ -229,7 +227,7 @@ async def test_method_list(self, async_client: AsyncCloudflare) -> None: rule = await async_client.snippets.rules.list( zone_id="9f1839b6152d298aca64c4e906b6d074", ) - assert_matches_type(AsyncSinglePage[RuleListResponse], rule, path=["response"]) + assert_matches_type(object, rule, path=["response"]) @parametrize async def test_raw_response_list(self, async_client: AsyncCloudflare) -> None: @@ -240,7 +238,7 @@ async def test_raw_response_list(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" rule = await response.parse() - assert_matches_type(AsyncSinglePage[RuleListResponse], rule, path=["response"]) + assert_matches_type(object, rule, path=["response"]) @parametrize async def test_streaming_response_list(self, async_client: AsyncCloudflare) -> None: @@ -251,7 +249,7 @@ async def test_streaming_response_list(self, async_client: AsyncCloudflare) -> N assert response.http_request.headers.get("X-Stainless-Lang") == "python" rule = await response.parse() - assert_matches_type(AsyncSinglePage[RuleListResponse], rule, path=["response"]) + assert_matches_type(object, rule, path=["response"]) assert cast(Any, response.is_closed) is True @@ -267,7 +265,7 @@ async def test_method_delete(self, async_client: AsyncCloudflare) -> None: rule = await async_client.snippets.rules.delete( zone_id="9f1839b6152d298aca64c4e906b6d074", ) - assert_matches_type(AsyncSinglePage[RuleDeleteResponse], rule, path=["response"]) + assert_matches_type(object, rule, path=["response"]) @parametrize async def test_raw_response_delete(self, async_client: AsyncCloudflare) -> None: @@ -278,7 +276,7 @@ async def test_raw_response_delete(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" rule = await response.parse() - assert_matches_type(AsyncSinglePage[RuleDeleteResponse], rule, path=["response"]) + assert_matches_type(object, rule, path=["response"]) @parametrize async def test_streaming_response_delete(self, async_client: AsyncCloudflare) -> None: @@ -289,7 +287,7 @@ async def test_streaming_response_delete(self, async_client: AsyncCloudflare) -> assert response.http_request.headers.get("X-Stainless-Lang") == "python" rule = await response.parse() - assert_matches_type(AsyncSinglePage[RuleDeleteResponse], rule, path=["response"]) + assert_matches_type(object, rule, path=["response"]) assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/test_ai.py b/tests/api_resources/test_ai.py index aa2f3717bc0..6b4f886b98d 100644 --- a/tests/api_resources/test_ai.py +++ b/tests/api_resources/test_ai.py @@ -516,7 +516,7 @@ def test_method_run_overload_9(self, client: Cloudflare) -> None: account_id="023e105f4ecef8ad9ca31a8372d0c353", messages=[ { - "content": "content", + "content": "string", "role": "role", } ], @@ -530,7 +530,7 @@ def test_method_run_with_all_params_overload_9(self, client: Cloudflare) -> None account_id="023e105f4ecef8ad9ca31a8372d0c353", messages=[ { - "content": "content", + "content": "string", "role": "role", } ], @@ -580,7 +580,7 @@ def test_raw_response_run_overload_9(self, client: Cloudflare) -> None: account_id="023e105f4ecef8ad9ca31a8372d0c353", messages=[ { - "content": "content", + "content": "string", "role": "role", } ], @@ -598,7 +598,7 @@ def test_streaming_response_run_overload_9(self, client: Cloudflare) -> None: account_id="023e105f4ecef8ad9ca31a8372d0c353", messages=[ { - "content": "content", + "content": "string", "role": "role", } ], @@ -619,7 +619,7 @@ def test_path_params_run_overload_9(self, client: Cloudflare) -> None: account_id="", messages=[ { - "content": "content", + "content": "string", "role": "role", } ], @@ -631,7 +631,7 @@ def test_path_params_run_overload_9(self, client: Cloudflare) -> None: account_id="023e105f4ecef8ad9ca31a8372d0c353", messages=[ { - "content": "content", + "content": "string", "role": "role", } ], @@ -1588,7 +1588,7 @@ async def test_method_run_overload_9(self, async_client: AsyncCloudflare) -> Non account_id="023e105f4ecef8ad9ca31a8372d0c353", messages=[ { - "content": "content", + "content": "string", "role": "role", } ], @@ -1602,7 +1602,7 @@ async def test_method_run_with_all_params_overload_9(self, async_client: AsyncCl account_id="023e105f4ecef8ad9ca31a8372d0c353", messages=[ { - "content": "content", + "content": "string", "role": "role", } ], @@ -1652,7 +1652,7 @@ async def test_raw_response_run_overload_9(self, async_client: AsyncCloudflare) account_id="023e105f4ecef8ad9ca31a8372d0c353", messages=[ { - "content": "content", + "content": "string", "role": "role", } ], @@ -1670,7 +1670,7 @@ async def test_streaming_response_run_overload_9(self, async_client: AsyncCloudf account_id="023e105f4ecef8ad9ca31a8372d0c353", messages=[ { - "content": "content", + "content": "string", "role": "role", } ], @@ -1691,7 +1691,7 @@ async def test_path_params_run_overload_9(self, async_client: AsyncCloudflare) - account_id="", messages=[ { - "content": "content", + "content": "string", "role": "role", } ], @@ -1703,7 +1703,7 @@ async def test_path_params_run_overload_9(self, async_client: AsyncCloudflare) - account_id="023e105f4ecef8ad9ca31a8372d0c353", messages=[ { - "content": "content", + "content": "string", "role": "role", } ], diff --git a/tests/api_resources/test_custom_certificates.py b/tests/api_resources/test_custom_certificates.py index 5632863289f..a2ab6d927f5 100644 --- a/tests/api_resources/test_custom_certificates.py +++ b/tests/api_resources/test_custom_certificates.py @@ -37,8 +37,9 @@ def test_method_create_with_all_params(self, client: Cloudflare) -> None: certificate="-----BEGIN CERTIFICATE-----\nMIIDtTCCAp2gAwIBAgIJAMHAwfXZ5/PWMA0GCSqGSIb3DQEBCwUAMEUxCzAJBgNV\nBAYTAkFVMRMwEQYDVQQIEwpTb21lLVN0YXRlMSEwHwYDVQQKExhJbnRlcm5ldCBX\naWRnaXRzIFB0eSBMdGQwHhcNMTYwODI0MTY0MzAxWhcNMTYxMTIyMTY0MzAxWjBF\nMQswCQYDVQQGEwJBVTETMBEGA1UECBMKU29tZS1TdGF0ZTEhMB8GA1UEChMYSW50\nZXJuZXQgV2lkZ2l0cyBQdHkgTHRkMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIB\nCgKCAQEAwQHoetcl9+5ikGzV6cMzWtWPJHqXT3wpbEkRU9Yz7lgvddmGdtcGbg/1\nCGZu0jJGkMoppoUo4c3dts3iwqRYmBikUP77wwY2QGmDZw2FvkJCJlKnabIRuGvB\nKwzESIXgKk2016aTP6/dAjEHyo6SeoK8lkIySUvK0fyOVlsiEsCmOpidtnKX/a+5\n0GjB79CJH4ER2lLVZnhePFR/zUOyPxZQQ4naHf7yu/b5jhO0f8fwt+pyFxIXjbEI\ndZliWRkRMtzrHOJIhrmJ2A1J7iOrirbbwillwjjNVUWPf3IJ3M12S9pEewooaeO2\nizNTERcG9HzAacbVRn2Y2SWIyT/18QIDAQABo4GnMIGkMB0GA1UdDgQWBBT/LbE4\n9rWf288N6sJA5BRb6FJIGDB1BgNVHSMEbjBsgBT/LbE49rWf288N6sJA5BRb6FJI\nGKFJpEcwRTELMAkGA1UEBhMCQVUxEzARBgNVBAgTClNvbWUtU3RhdGUxITAfBgNV\nBAoTGEludGVybmV0IFdpZGdpdHMgUHR5IEx0ZIIJAMHAwfXZ5/PWMAwGA1UdEwQF\nMAMBAf8wDQYJKoZIhvcNAQELBQADggEBAHHFwl0tH0quUYZYO0dZYt4R7SJ0pCm2\n2satiyzHl4OnXcHDpekAo7/a09c6Lz6AU83cKy/+x3/djYHXWba7HpEu0dR3ugQP\nMlr4zrhd9xKZ0KZKiYmtJH+ak4OM4L3FbT0owUZPyjLSlhMtJVcoRp5CJsjAMBUG\nSvD8RX+T01wzox/Qb+lnnNnOlaWpqu8eoOenybxKp1a9ULzIVvN/LAcc+14vioFq\n2swRWtmocBAs8QR9n4uvbpiYvS8eYueDCWMM4fvFfBhaDZ3N9IbtySh3SpFdQDhw\nYbjM2rxXiyLGxB4Bol7QTv4zHif7Zt89FReT/NBy4rzaskDJY5L6xmY=\n-----END CERTIFICATE-----\n", private_key="-----BEGIN RSA PRIVATE KEY-----\nMIIEowIBAAKCAQEAwQHoetcl9+5ikGzV6cMzWtWPJHqXT3wpbEkRU9Yz7lgvddmG\ndtcGbg/1CGZu0jJGkMoppoUo4c3dts3iwqRYmBikUP77wwY2QGmDZw2FvkJCJlKn\nabIRuGvBKwzESIXgKk2016aTP6/dAjEHyo6SeoK8lkIySUvK0fyOVlsiEsCmOpid\ntnKX/a+50GjB79CJH4ER2lLVZnhePFR/zUOyPxZQQ4naHf7yu/b5jhO0f8fwt+py\nFxIXjbEIdZliWRkRMtzrHOJIhrmJ2A1J7iOrirbbwillwjjNVUWPf3IJ3M12S9pE\newooaeO2izNTERcG9HzAacbVRn2Y2SWIyT/18QIDAQABAoIBACbhTYXBZYKmYPCb\nHBR1IBlCQA2nLGf0qRuJNJZg5iEzXows/6tc8YymZkQE7nolapWsQ+upk2y5Xdp/\naxiuprIs9JzkYK8Ox0r+dlwCG1kSW+UAbX0bQ/qUqlsTvU6muVuMP8vZYHxJ3wmb\n+ufRBKztPTQ/rYWaYQcgC0RWI20HTFBMxlTAyNxYNWzX7RKFkGVVyB9RsAtmcc8g\n+j4OdosbfNoJPS0HeIfNpAznDfHKdxDk2Yc1tV6RHBrC1ynyLE9+TaflIAdo2MVv\nKLMLq51GqYKtgJFIlBRPQqKoyXdz3fGvXrTkf/WY9QNq0J1Vk5ERePZ54mN8iZB7\n9lwy/AkCgYEA6FXzosxswaJ2wQLeoYc7ceaweX/SwTvxHgXzRyJIIT0eJWgx13Wo\n/WA3Iziimsjf6qE+SI/8laxPp2A86VMaIt3Z3mJN/CqSVGw8LK2AQst+OwdPyDMu\niacE8lj/IFGC8mwNUAb9CzGU3JpU4PxxGFjS/eMtGeRXCWkK4NE+G08CgYEA1Kp9\nN2JrVlqUz+gAX+LPmE9OEMAS9WQSQsfCHGogIFDGGcNf7+uwBM7GAaSJIP01zcoe\nVAgWdzXCv3FLhsaZoJ6RyLOLay5phbu1iaTr4UNYm5WtYTzMzqh8l1+MFFDl9xDB\nvULuCIIrglM5MeS/qnSg1uMoH2oVPj9TVst/ir8CgYEAxrI7Ws9Zc4Bt70N1As+U\nlySjaEVZCMkqvHJ6TCuVZFfQoE0r0whdLdRLU2PsLFP+q7qaeZQqgBaNSKeVcDYR\n9B+nY/jOmQoPewPVsp/vQTCnE/R81spu0mp0YI6cIheT1Z9zAy322svcc43JaWB7\nmEbeqyLOP4Z4qSOcmghZBSECgYACvR9Xs0DGn+wCsW4vze/2ei77MD4OQvepPIFX\ndFZtlBy5ADcgE9z0cuVB6CiL8DbdK5kwY9pGNr8HUCI03iHkW6Zs+0L0YmihfEVe\nPG19PSzK9CaDdhD9KFZSbLyVFmWfxOt50H7YRTTiPMgjyFpfi5j2q348yVT0tEQS\nfhRqaQKBgAcWPokmJ7EbYQGeMbS7HC8eWO/RyamlnSffdCdSc7ue3zdVJxpAkQ8W\nqu80pEIF6raIQfAf8MXiiZ7auFOSnHQTXUbhCpvDLKi0Mwq3G8Pl07l+2s6dQG6T\nlv6XTQaMyf6n1yjzL+fzDrH3qXMxHMO/b13EePXpDMpY7HQpoLDi\n-----END RSA PRIVATE KEY-----\n", bundle_method="ubiquitous", + deploy="staging", geo_restrictions={"label": "us"}, - policy="(country: US) or (region: EU)", + policy="policy", type="sni_custom", ) assert_matches_type(Optional[CustomCertificate], custom_certificate, path=["response"]) @@ -179,7 +180,7 @@ def test_path_params_delete(self, client: Cloudflare) -> None: @pytest.mark.skip(reason="Test missing required parameters: certificate and private_key (Issue #4)") @parametrize - def test_method_edit_overload_1(self, client: Cloudflare) -> None: + def test_method_edit(self, client: Cloudflare) -> None: custom_certificate = client.custom_certificates.edit( custom_certificate_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", @@ -187,86 +188,25 @@ def test_method_edit_overload_1(self, client: Cloudflare) -> None: assert_matches_type(Optional[CustomCertificate], custom_certificate, path=["response"]) @parametrize - def test_method_edit_with_all_params_overload_1(self, client: Cloudflare) -> None: + def test_method_edit_with_all_params(self, client: Cloudflare) -> None: custom_certificate = client.custom_certificates.edit( custom_certificate_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", bundle_method="ubiquitous", - ) - assert_matches_type(Optional[CustomCertificate], custom_certificate, path=["response"]) - - @pytest.mark.skip(reason="Test missing required parameters: certificate and private_key (Issue #4)") - @parametrize - def test_raw_response_edit_overload_1(self, client: Cloudflare) -> None: - response = client.custom_certificates.with_raw_response.edit( - custom_certificate_id="023e105f4ecef8ad9ca31a8372d0c353", - zone_id="023e105f4ecef8ad9ca31a8372d0c353", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - custom_certificate = response.parse() - assert_matches_type(Optional[CustomCertificate], custom_certificate, path=["response"]) - - @pytest.mark.skip(reason="Test missing required parameters: certificate and private_key (Issue #4)") - @parametrize - def test_streaming_response_edit_overload_1(self, client: Cloudflare) -> None: - with client.custom_certificates.with_streaming_response.edit( - custom_certificate_id="023e105f4ecef8ad9ca31a8372d0c353", - zone_id="023e105f4ecef8ad9ca31a8372d0c353", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - custom_certificate = response.parse() - assert_matches_type(Optional[CustomCertificate], custom_certificate, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_edit_overload_1(self, client: Cloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): - client.custom_certificates.with_raw_response.edit( - custom_certificate_id="023e105f4ecef8ad9ca31a8372d0c353", - zone_id="", - ) - - with pytest.raises(ValueError, match=r"Expected a non-empty value for `custom_certificate_id` but received ''"): - client.custom_certificates.with_raw_response.edit( - custom_certificate_id="", - zone_id="023e105f4ecef8ad9ca31a8372d0c353", - ) - - @parametrize - def test_method_edit_overload_2(self, client: Cloudflare) -> None: - custom_certificate = client.custom_certificates.edit( - custom_certificate_id="023e105f4ecef8ad9ca31a8372d0c353", - zone_id="023e105f4ecef8ad9ca31a8372d0c353", - certificate="-----BEGIN CERTIFICATE-----\nMIIDtTCCAp2gAwIBAgIJAMHAwfXZ5/PWMA0GCSqGSIb3DQEBCwUAMEUxCzAJBgNV\nBAYTAkFVMRMwEQYDVQQIEwpTb21lLVN0YXRlMSEwHwYDVQQKExhJbnRlcm5ldCBX\naWRnaXRzIFB0eSBMdGQwHhcNMTYwODI0MTY0MzAxWhcNMTYxMTIyMTY0MzAxWjBF\nMQswCQYDVQQGEwJBVTETMBEGA1UECBMKU29tZS1TdGF0ZTEhMB8GA1UEChMYSW50\nZXJuZXQgV2lkZ2l0cyBQdHkgTHRkMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIB\nCgKCAQEAwQHoetcl9+5ikGzV6cMzWtWPJHqXT3wpbEkRU9Yz7lgvddmGdtcGbg/1\nCGZu0jJGkMoppoUo4c3dts3iwqRYmBikUP77wwY2QGmDZw2FvkJCJlKnabIRuGvB\nKwzESIXgKk2016aTP6/dAjEHyo6SeoK8lkIySUvK0fyOVlsiEsCmOpidtnKX/a+5\n0GjB79CJH4ER2lLVZnhePFR/zUOyPxZQQ4naHf7yu/b5jhO0f8fwt+pyFxIXjbEI\ndZliWRkRMtzrHOJIhrmJ2A1J7iOrirbbwillwjjNVUWPf3IJ3M12S9pEewooaeO2\nizNTERcG9HzAacbVRn2Y2SWIyT/18QIDAQABo4GnMIGkMB0GA1UdDgQWBBT/LbE4\n9rWf288N6sJA5BRb6FJIGDB1BgNVHSMEbjBsgBT/LbE49rWf288N6sJA5BRb6FJI\nGKFJpEcwRTELMAkGA1UEBhMCQVUxEzARBgNVBAgTClNvbWUtU3RhdGUxITAfBgNV\nBAoTGEludGVybmV0IFdpZGdpdHMgUHR5IEx0ZIIJAMHAwfXZ5/PWMAwGA1UdEwQF\nMAMBAf8wDQYJKoZIhvcNAQELBQADggEBAHHFwl0tH0quUYZYO0dZYt4R7SJ0pCm2\n2satiyzHl4OnXcHDpekAo7/a09c6Lz6AU83cKy/+x3/djYHXWba7HpEu0dR3ugQP\nMlr4zrhd9xKZ0KZKiYmtJH+ak4OM4L3FbT0owUZPyjLSlhMtJVcoRp5CJsjAMBUG\nSvD8RX+T01wzox/Qb+lnnNnOlaWpqu8eoOenybxKp1a9ULzIVvN/LAcc+14vioFq\n2swRWtmocBAs8QR9n4uvbpiYvS8eYueDCWMM4fvFfBhaDZ3N9IbtySh3SpFdQDhw\nYbjM2rxXiyLGxB4Bol7QTv4zHif7Zt89FReT/NBy4rzaskDJY5L6xmY=\n-----END CERTIFICATE-----\n", - private_key="-----BEGIN RSA PRIVATE KEY-----\nMIIEowIBAAKCAQEAwQHoetcl9+5ikGzV6cMzWtWPJHqXT3wpbEkRU9Yz7lgvddmG\ndtcGbg/1CGZu0jJGkMoppoUo4c3dts3iwqRYmBikUP77wwY2QGmDZw2FvkJCJlKn\nabIRuGvBKwzESIXgKk2016aTP6/dAjEHyo6SeoK8lkIySUvK0fyOVlsiEsCmOpid\ntnKX/a+50GjB79CJH4ER2lLVZnhePFR/zUOyPxZQQ4naHf7yu/b5jhO0f8fwt+py\nFxIXjbEIdZliWRkRMtzrHOJIhrmJ2A1J7iOrirbbwillwjjNVUWPf3IJ3M12S9pE\newooaeO2izNTERcG9HzAacbVRn2Y2SWIyT/18QIDAQABAoIBACbhTYXBZYKmYPCb\nHBR1IBlCQA2nLGf0qRuJNJZg5iEzXows/6tc8YymZkQE7nolapWsQ+upk2y5Xdp/\naxiuprIs9JzkYK8Ox0r+dlwCG1kSW+UAbX0bQ/qUqlsTvU6muVuMP8vZYHxJ3wmb\n+ufRBKztPTQ/rYWaYQcgC0RWI20HTFBMxlTAyNxYNWzX7RKFkGVVyB9RsAtmcc8g\n+j4OdosbfNoJPS0HeIfNpAznDfHKdxDk2Yc1tV6RHBrC1ynyLE9+TaflIAdo2MVv\nKLMLq51GqYKtgJFIlBRPQqKoyXdz3fGvXrTkf/WY9QNq0J1Vk5ERePZ54mN8iZB7\n9lwy/AkCgYEA6FXzosxswaJ2wQLeoYc7ceaweX/SwTvxHgXzRyJIIT0eJWgx13Wo\n/WA3Iziimsjf6qE+SI/8laxPp2A86VMaIt3Z3mJN/CqSVGw8LK2AQst+OwdPyDMu\niacE8lj/IFGC8mwNUAb9CzGU3JpU4PxxGFjS/eMtGeRXCWkK4NE+G08CgYEA1Kp9\nN2JrVlqUz+gAX+LPmE9OEMAS9WQSQsfCHGogIFDGGcNf7+uwBM7GAaSJIP01zcoe\nVAgWdzXCv3FLhsaZoJ6RyLOLay5phbu1iaTr4UNYm5WtYTzMzqh8l1+MFFDl9xDB\nvULuCIIrglM5MeS/qnSg1uMoH2oVPj9TVst/ir8CgYEAxrI7Ws9Zc4Bt70N1As+U\nlySjaEVZCMkqvHJ6TCuVZFfQoE0r0whdLdRLU2PsLFP+q7qaeZQqgBaNSKeVcDYR\n9B+nY/jOmQoPewPVsp/vQTCnE/R81spu0mp0YI6cIheT1Z9zAy322svcc43JaWB7\nmEbeqyLOP4Z4qSOcmghZBSECgYACvR9Xs0DGn+wCsW4vze/2ei77MD4OQvepPIFX\ndFZtlBy5ADcgE9z0cuVB6CiL8DbdK5kwY9pGNr8HUCI03iHkW6Zs+0L0YmihfEVe\nPG19PSzK9CaDdhD9KFZSbLyVFmWfxOt50H7YRTTiPMgjyFpfi5j2q348yVT0tEQS\nfhRqaQKBgAcWPokmJ7EbYQGeMbS7HC8eWO/RyamlnSffdCdSc7ue3zdVJxpAkQ8W\nqu80pEIF6raIQfAf8MXiiZ7auFOSnHQTXUbhCpvDLKi0Mwq3G8Pl07l+2s6dQG6T\nlv6XTQaMyf6n1yjzL+fzDrH3qXMxHMO/b13EePXpDMpY7HQpoLDi\n-----END RSA PRIVATE KEY-----\n", - ) - assert_matches_type(Optional[CustomCertificate], custom_certificate, path=["response"]) - - @parametrize - def test_method_edit_with_all_params_overload_2(self, client: Cloudflare) -> None: - custom_certificate = client.custom_certificates.edit( - custom_certificate_id="023e105f4ecef8ad9ca31a8372d0c353", - zone_id="023e105f4ecef8ad9ca31a8372d0c353", certificate="-----BEGIN CERTIFICATE-----\nMIIDtTCCAp2gAwIBAgIJAMHAwfXZ5/PWMA0GCSqGSIb3DQEBCwUAMEUxCzAJBgNV\nBAYTAkFVMRMwEQYDVQQIEwpTb21lLVN0YXRlMSEwHwYDVQQKExhJbnRlcm5ldCBX\naWRnaXRzIFB0eSBMdGQwHhcNMTYwODI0MTY0MzAxWhcNMTYxMTIyMTY0MzAxWjBF\nMQswCQYDVQQGEwJBVTETMBEGA1UECBMKU29tZS1TdGF0ZTEhMB8GA1UEChMYSW50\nZXJuZXQgV2lkZ2l0cyBQdHkgTHRkMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIB\nCgKCAQEAwQHoetcl9+5ikGzV6cMzWtWPJHqXT3wpbEkRU9Yz7lgvddmGdtcGbg/1\nCGZu0jJGkMoppoUo4c3dts3iwqRYmBikUP77wwY2QGmDZw2FvkJCJlKnabIRuGvB\nKwzESIXgKk2016aTP6/dAjEHyo6SeoK8lkIySUvK0fyOVlsiEsCmOpidtnKX/a+5\n0GjB79CJH4ER2lLVZnhePFR/zUOyPxZQQ4naHf7yu/b5jhO0f8fwt+pyFxIXjbEI\ndZliWRkRMtzrHOJIhrmJ2A1J7iOrirbbwillwjjNVUWPf3IJ3M12S9pEewooaeO2\nizNTERcG9HzAacbVRn2Y2SWIyT/18QIDAQABo4GnMIGkMB0GA1UdDgQWBBT/LbE4\n9rWf288N6sJA5BRb6FJIGDB1BgNVHSMEbjBsgBT/LbE49rWf288N6sJA5BRb6FJI\nGKFJpEcwRTELMAkGA1UEBhMCQVUxEzARBgNVBAgTClNvbWUtU3RhdGUxITAfBgNV\nBAoTGEludGVybmV0IFdpZGdpdHMgUHR5IEx0ZIIJAMHAwfXZ5/PWMAwGA1UdEwQF\nMAMBAf8wDQYJKoZIhvcNAQELBQADggEBAHHFwl0tH0quUYZYO0dZYt4R7SJ0pCm2\n2satiyzHl4OnXcHDpekAo7/a09c6Lz6AU83cKy/+x3/djYHXWba7HpEu0dR3ugQP\nMlr4zrhd9xKZ0KZKiYmtJH+ak4OM4L3FbT0owUZPyjLSlhMtJVcoRp5CJsjAMBUG\nSvD8RX+T01wzox/Qb+lnnNnOlaWpqu8eoOenybxKp1a9ULzIVvN/LAcc+14vioFq\n2swRWtmocBAs8QR9n4uvbpiYvS8eYueDCWMM4fvFfBhaDZ3N9IbtySh3SpFdQDhw\nYbjM2rxXiyLGxB4Bol7QTv4zHif7Zt89FReT/NBy4rzaskDJY5L6xmY=\n-----END CERTIFICATE-----\n", - private_key="-----BEGIN RSA PRIVATE KEY-----\nMIIEowIBAAKCAQEAwQHoetcl9+5ikGzV6cMzWtWPJHqXT3wpbEkRU9Yz7lgvddmG\ndtcGbg/1CGZu0jJGkMoppoUo4c3dts3iwqRYmBikUP77wwY2QGmDZw2FvkJCJlKn\nabIRuGvBKwzESIXgKk2016aTP6/dAjEHyo6SeoK8lkIySUvK0fyOVlsiEsCmOpid\ntnKX/a+50GjB79CJH4ER2lLVZnhePFR/zUOyPxZQQ4naHf7yu/b5jhO0f8fwt+py\nFxIXjbEIdZliWRkRMtzrHOJIhrmJ2A1J7iOrirbbwillwjjNVUWPf3IJ3M12S9pE\newooaeO2izNTERcG9HzAacbVRn2Y2SWIyT/18QIDAQABAoIBACbhTYXBZYKmYPCb\nHBR1IBlCQA2nLGf0qRuJNJZg5iEzXows/6tc8YymZkQE7nolapWsQ+upk2y5Xdp/\naxiuprIs9JzkYK8Ox0r+dlwCG1kSW+UAbX0bQ/qUqlsTvU6muVuMP8vZYHxJ3wmb\n+ufRBKztPTQ/rYWaYQcgC0RWI20HTFBMxlTAyNxYNWzX7RKFkGVVyB9RsAtmcc8g\n+j4OdosbfNoJPS0HeIfNpAznDfHKdxDk2Yc1tV6RHBrC1ynyLE9+TaflIAdo2MVv\nKLMLq51GqYKtgJFIlBRPQqKoyXdz3fGvXrTkf/WY9QNq0J1Vk5ERePZ54mN8iZB7\n9lwy/AkCgYEA6FXzosxswaJ2wQLeoYc7ceaweX/SwTvxHgXzRyJIIT0eJWgx13Wo\n/WA3Iziimsjf6qE+SI/8laxPp2A86VMaIt3Z3mJN/CqSVGw8LK2AQst+OwdPyDMu\niacE8lj/IFGC8mwNUAb9CzGU3JpU4PxxGFjS/eMtGeRXCWkK4NE+G08CgYEA1Kp9\nN2JrVlqUz+gAX+LPmE9OEMAS9WQSQsfCHGogIFDGGcNf7+uwBM7GAaSJIP01zcoe\nVAgWdzXCv3FLhsaZoJ6RyLOLay5phbu1iaTr4UNYm5WtYTzMzqh8l1+MFFDl9xDB\nvULuCIIrglM5MeS/qnSg1uMoH2oVPj9TVst/ir8CgYEAxrI7Ws9Zc4Bt70N1As+U\nlySjaEVZCMkqvHJ6TCuVZFfQoE0r0whdLdRLU2PsLFP+q7qaeZQqgBaNSKeVcDYR\n9B+nY/jOmQoPewPVsp/vQTCnE/R81spu0mp0YI6cIheT1Z9zAy322svcc43JaWB7\nmEbeqyLOP4Z4qSOcmghZBSECgYACvR9Xs0DGn+wCsW4vze/2ei77MD4OQvepPIFX\ndFZtlBy5ADcgE9z0cuVB6CiL8DbdK5kwY9pGNr8HUCI03iHkW6Zs+0L0YmihfEVe\nPG19PSzK9CaDdhD9KFZSbLyVFmWfxOt50H7YRTTiPMgjyFpfi5j2q348yVT0tEQS\nfhRqaQKBgAcWPokmJ7EbYQGeMbS7HC8eWO/RyamlnSffdCdSc7ue3zdVJxpAkQ8W\nqu80pEIF6raIQfAf8MXiiZ7auFOSnHQTXUbhCpvDLKi0Mwq3G8Pl07l+2s6dQG6T\nlv6XTQaMyf6n1yjzL+fzDrH3qXMxHMO/b13EePXpDMpY7HQpoLDi\n-----END RSA PRIVATE KEY-----\n", - bundle_method="ubiquitous", + deploy="staging", geo_restrictions={"label": "us"}, - policy="(country: US) or (region: EU)", + policy="policy", + private_key="-----BEGIN RSA PRIVATE KEY-----\nMIIEowIBAAKCAQEAwQHoetcl9+5ikGzV6cMzWtWPJHqXT3wpbEkRU9Yz7lgvddmG\ndtcGbg/1CGZu0jJGkMoppoUo4c3dts3iwqRYmBikUP77wwY2QGmDZw2FvkJCJlKn\nabIRuGvBKwzESIXgKk2016aTP6/dAjEHyo6SeoK8lkIySUvK0fyOVlsiEsCmOpid\ntnKX/a+50GjB79CJH4ER2lLVZnhePFR/zUOyPxZQQ4naHf7yu/b5jhO0f8fwt+py\nFxIXjbEIdZliWRkRMtzrHOJIhrmJ2A1J7iOrirbbwillwjjNVUWPf3IJ3M12S9pE\newooaeO2izNTERcG9HzAacbVRn2Y2SWIyT/18QIDAQABAoIBACbhTYXBZYKmYPCb\nHBR1IBlCQA2nLGf0qRuJNJZg5iEzXows/6tc8YymZkQE7nolapWsQ+upk2y5Xdp/\naxiuprIs9JzkYK8Ox0r+dlwCG1kSW+UAbX0bQ/qUqlsTvU6muVuMP8vZYHxJ3wmb\n+ufRBKztPTQ/rYWaYQcgC0RWI20HTFBMxlTAyNxYNWzX7RKFkGVVyB9RsAtmcc8g\n+j4OdosbfNoJPS0HeIfNpAznDfHKdxDk2Yc1tV6RHBrC1ynyLE9+TaflIAdo2MVv\nKLMLq51GqYKtgJFIlBRPQqKoyXdz3fGvXrTkf/WY9QNq0J1Vk5ERePZ54mN8iZB7\n9lwy/AkCgYEA6FXzosxswaJ2wQLeoYc7ceaweX/SwTvxHgXzRyJIIT0eJWgx13Wo\n/WA3Iziimsjf6qE+SI/8laxPp2A86VMaIt3Z3mJN/CqSVGw8LK2AQst+OwdPyDMu\niacE8lj/IFGC8mwNUAb9CzGU3JpU4PxxGFjS/eMtGeRXCWkK4NE+G08CgYEA1Kp9\nN2JrVlqUz+gAX+LPmE9OEMAS9WQSQsfCHGogIFDGGcNf7+uwBM7GAaSJIP01zcoe\nVAgWdzXCv3FLhsaZoJ6RyLOLay5phbu1iaTr4UNYm5WtYTzMzqh8l1+MFFDl9xDB\nvULuCIIrglM5MeS/qnSg1uMoH2oVPj9TVst/ir8CgYEAxrI7Ws9Zc4Bt70N1As+U\nlySjaEVZCMkqvHJ6TCuVZFfQoE0r0whdLdRLU2PsLFP+q7qaeZQqgBaNSKeVcDYR\n9B+nY/jOmQoPewPVsp/vQTCnE/R81spu0mp0YI6cIheT1Z9zAy322svcc43JaWB7\nmEbeqyLOP4Z4qSOcmghZBSECgYACvR9Xs0DGn+wCsW4vze/2ei77MD4OQvepPIFX\ndFZtlBy5ADcgE9z0cuVB6CiL8DbdK5kwY9pGNr8HUCI03iHkW6Zs+0L0YmihfEVe\nPG19PSzK9CaDdhD9KFZSbLyVFmWfxOt50H7YRTTiPMgjyFpfi5j2q348yVT0tEQS\nfhRqaQKBgAcWPokmJ7EbYQGeMbS7HC8eWO/RyamlnSffdCdSc7ue3zdVJxpAkQ8W\nqu80pEIF6raIQfAf8MXiiZ7auFOSnHQTXUbhCpvDLKi0Mwq3G8Pl07l+2s6dQG6T\nlv6XTQaMyf6n1yjzL+fzDrH3qXMxHMO/b13EePXpDMpY7HQpoLDi\n-----END RSA PRIVATE KEY-----\n", ) assert_matches_type(Optional[CustomCertificate], custom_certificate, path=["response"]) + @pytest.mark.skip(reason="Test missing required parameters: certificate and private_key (Issue #4)") @parametrize - def test_raw_response_edit_overload_2(self, client: Cloudflare) -> None: + def test_raw_response_edit(self, client: Cloudflare) -> None: response = client.custom_certificates.with_raw_response.edit( custom_certificate_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", - certificate="-----BEGIN CERTIFICATE-----\nMIIDtTCCAp2gAwIBAgIJAMHAwfXZ5/PWMA0GCSqGSIb3DQEBCwUAMEUxCzAJBgNV\nBAYTAkFVMRMwEQYDVQQIEwpTb21lLVN0YXRlMSEwHwYDVQQKExhJbnRlcm5ldCBX\naWRnaXRzIFB0eSBMdGQwHhcNMTYwODI0MTY0MzAxWhcNMTYxMTIyMTY0MzAxWjBF\nMQswCQYDVQQGEwJBVTETMBEGA1UECBMKU29tZS1TdGF0ZTEhMB8GA1UEChMYSW50\nZXJuZXQgV2lkZ2l0cyBQdHkgTHRkMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIB\nCgKCAQEAwQHoetcl9+5ikGzV6cMzWtWPJHqXT3wpbEkRU9Yz7lgvddmGdtcGbg/1\nCGZu0jJGkMoppoUo4c3dts3iwqRYmBikUP77wwY2QGmDZw2FvkJCJlKnabIRuGvB\nKwzESIXgKk2016aTP6/dAjEHyo6SeoK8lkIySUvK0fyOVlsiEsCmOpidtnKX/a+5\n0GjB79CJH4ER2lLVZnhePFR/zUOyPxZQQ4naHf7yu/b5jhO0f8fwt+pyFxIXjbEI\ndZliWRkRMtzrHOJIhrmJ2A1J7iOrirbbwillwjjNVUWPf3IJ3M12S9pEewooaeO2\nizNTERcG9HzAacbVRn2Y2SWIyT/18QIDAQABo4GnMIGkMB0GA1UdDgQWBBT/LbE4\n9rWf288N6sJA5BRb6FJIGDB1BgNVHSMEbjBsgBT/LbE49rWf288N6sJA5BRb6FJI\nGKFJpEcwRTELMAkGA1UEBhMCQVUxEzARBgNVBAgTClNvbWUtU3RhdGUxITAfBgNV\nBAoTGEludGVybmV0IFdpZGdpdHMgUHR5IEx0ZIIJAMHAwfXZ5/PWMAwGA1UdEwQF\nMAMBAf8wDQYJKoZIhvcNAQELBQADggEBAHHFwl0tH0quUYZYO0dZYt4R7SJ0pCm2\n2satiyzHl4OnXcHDpekAo7/a09c6Lz6AU83cKy/+x3/djYHXWba7HpEu0dR3ugQP\nMlr4zrhd9xKZ0KZKiYmtJH+ak4OM4L3FbT0owUZPyjLSlhMtJVcoRp5CJsjAMBUG\nSvD8RX+T01wzox/Qb+lnnNnOlaWpqu8eoOenybxKp1a9ULzIVvN/LAcc+14vioFq\n2swRWtmocBAs8QR9n4uvbpiYvS8eYueDCWMM4fvFfBhaDZ3N9IbtySh3SpFdQDhw\nYbjM2rxXiyLGxB4Bol7QTv4zHif7Zt89FReT/NBy4rzaskDJY5L6xmY=\n-----END CERTIFICATE-----\n", - private_key="-----BEGIN RSA PRIVATE KEY-----\nMIIEowIBAAKCAQEAwQHoetcl9+5ikGzV6cMzWtWPJHqXT3wpbEkRU9Yz7lgvddmG\ndtcGbg/1CGZu0jJGkMoppoUo4c3dts3iwqRYmBikUP77wwY2QGmDZw2FvkJCJlKn\nabIRuGvBKwzESIXgKk2016aTP6/dAjEHyo6SeoK8lkIySUvK0fyOVlsiEsCmOpid\ntnKX/a+50GjB79CJH4ER2lLVZnhePFR/zUOyPxZQQ4naHf7yu/b5jhO0f8fwt+py\nFxIXjbEIdZliWRkRMtzrHOJIhrmJ2A1J7iOrirbbwillwjjNVUWPf3IJ3M12S9pE\newooaeO2izNTERcG9HzAacbVRn2Y2SWIyT/18QIDAQABAoIBACbhTYXBZYKmYPCb\nHBR1IBlCQA2nLGf0qRuJNJZg5iEzXows/6tc8YymZkQE7nolapWsQ+upk2y5Xdp/\naxiuprIs9JzkYK8Ox0r+dlwCG1kSW+UAbX0bQ/qUqlsTvU6muVuMP8vZYHxJ3wmb\n+ufRBKztPTQ/rYWaYQcgC0RWI20HTFBMxlTAyNxYNWzX7RKFkGVVyB9RsAtmcc8g\n+j4OdosbfNoJPS0HeIfNpAznDfHKdxDk2Yc1tV6RHBrC1ynyLE9+TaflIAdo2MVv\nKLMLq51GqYKtgJFIlBRPQqKoyXdz3fGvXrTkf/WY9QNq0J1Vk5ERePZ54mN8iZB7\n9lwy/AkCgYEA6FXzosxswaJ2wQLeoYc7ceaweX/SwTvxHgXzRyJIIT0eJWgx13Wo\n/WA3Iziimsjf6qE+SI/8laxPp2A86VMaIt3Z3mJN/CqSVGw8LK2AQst+OwdPyDMu\niacE8lj/IFGC8mwNUAb9CzGU3JpU4PxxGFjS/eMtGeRXCWkK4NE+G08CgYEA1Kp9\nN2JrVlqUz+gAX+LPmE9OEMAS9WQSQsfCHGogIFDGGcNf7+uwBM7GAaSJIP01zcoe\nVAgWdzXCv3FLhsaZoJ6RyLOLay5phbu1iaTr4UNYm5WtYTzMzqh8l1+MFFDl9xDB\nvULuCIIrglM5MeS/qnSg1uMoH2oVPj9TVst/ir8CgYEAxrI7Ws9Zc4Bt70N1As+U\nlySjaEVZCMkqvHJ6TCuVZFfQoE0r0whdLdRLU2PsLFP+q7qaeZQqgBaNSKeVcDYR\n9B+nY/jOmQoPewPVsp/vQTCnE/R81spu0mp0YI6cIheT1Z9zAy322svcc43JaWB7\nmEbeqyLOP4Z4qSOcmghZBSECgYACvR9Xs0DGn+wCsW4vze/2ei77MD4OQvepPIFX\ndFZtlBy5ADcgE9z0cuVB6CiL8DbdK5kwY9pGNr8HUCI03iHkW6Zs+0L0YmihfEVe\nPG19PSzK9CaDdhD9KFZSbLyVFmWfxOt50H7YRTTiPMgjyFpfi5j2q348yVT0tEQS\nfhRqaQKBgAcWPokmJ7EbYQGeMbS7HC8eWO/RyamlnSffdCdSc7ue3zdVJxpAkQ8W\nqu80pEIF6raIQfAf8MXiiZ7auFOSnHQTXUbhCpvDLKi0Mwq3G8Pl07l+2s6dQG6T\nlv6XTQaMyf6n1yjzL+fzDrH3qXMxHMO/b13EePXpDMpY7HQpoLDi\n-----END RSA PRIVATE KEY-----\n", ) assert response.is_closed is True @@ -274,13 +214,12 @@ def test_raw_response_edit_overload_2(self, client: Cloudflare) -> None: custom_certificate = response.parse() assert_matches_type(Optional[CustomCertificate], custom_certificate, path=["response"]) + @pytest.mark.skip(reason="Test missing required parameters: certificate and private_key (Issue #4)") @parametrize - def test_streaming_response_edit_overload_2(self, client: Cloudflare) -> None: + def test_streaming_response_edit(self, client: Cloudflare) -> None: with client.custom_certificates.with_streaming_response.edit( custom_certificate_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", - certificate="-----BEGIN CERTIFICATE-----\nMIIDtTCCAp2gAwIBAgIJAMHAwfXZ5/PWMA0GCSqGSIb3DQEBCwUAMEUxCzAJBgNV\nBAYTAkFVMRMwEQYDVQQIEwpTb21lLVN0YXRlMSEwHwYDVQQKExhJbnRlcm5ldCBX\naWRnaXRzIFB0eSBMdGQwHhcNMTYwODI0MTY0MzAxWhcNMTYxMTIyMTY0MzAxWjBF\nMQswCQYDVQQGEwJBVTETMBEGA1UECBMKU29tZS1TdGF0ZTEhMB8GA1UEChMYSW50\nZXJuZXQgV2lkZ2l0cyBQdHkgTHRkMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIB\nCgKCAQEAwQHoetcl9+5ikGzV6cMzWtWPJHqXT3wpbEkRU9Yz7lgvddmGdtcGbg/1\nCGZu0jJGkMoppoUo4c3dts3iwqRYmBikUP77wwY2QGmDZw2FvkJCJlKnabIRuGvB\nKwzESIXgKk2016aTP6/dAjEHyo6SeoK8lkIySUvK0fyOVlsiEsCmOpidtnKX/a+5\n0GjB79CJH4ER2lLVZnhePFR/zUOyPxZQQ4naHf7yu/b5jhO0f8fwt+pyFxIXjbEI\ndZliWRkRMtzrHOJIhrmJ2A1J7iOrirbbwillwjjNVUWPf3IJ3M12S9pEewooaeO2\nizNTERcG9HzAacbVRn2Y2SWIyT/18QIDAQABo4GnMIGkMB0GA1UdDgQWBBT/LbE4\n9rWf288N6sJA5BRb6FJIGDB1BgNVHSMEbjBsgBT/LbE49rWf288N6sJA5BRb6FJI\nGKFJpEcwRTELMAkGA1UEBhMCQVUxEzARBgNVBAgTClNvbWUtU3RhdGUxITAfBgNV\nBAoTGEludGVybmV0IFdpZGdpdHMgUHR5IEx0ZIIJAMHAwfXZ5/PWMAwGA1UdEwQF\nMAMBAf8wDQYJKoZIhvcNAQELBQADggEBAHHFwl0tH0quUYZYO0dZYt4R7SJ0pCm2\n2satiyzHl4OnXcHDpekAo7/a09c6Lz6AU83cKy/+x3/djYHXWba7HpEu0dR3ugQP\nMlr4zrhd9xKZ0KZKiYmtJH+ak4OM4L3FbT0owUZPyjLSlhMtJVcoRp5CJsjAMBUG\nSvD8RX+T01wzox/Qb+lnnNnOlaWpqu8eoOenybxKp1a9ULzIVvN/LAcc+14vioFq\n2swRWtmocBAs8QR9n4uvbpiYvS8eYueDCWMM4fvFfBhaDZ3N9IbtySh3SpFdQDhw\nYbjM2rxXiyLGxB4Bol7QTv4zHif7Zt89FReT/NBy4rzaskDJY5L6xmY=\n-----END CERTIFICATE-----\n", - private_key="-----BEGIN RSA PRIVATE KEY-----\nMIIEowIBAAKCAQEAwQHoetcl9+5ikGzV6cMzWtWPJHqXT3wpbEkRU9Yz7lgvddmG\ndtcGbg/1CGZu0jJGkMoppoUo4c3dts3iwqRYmBikUP77wwY2QGmDZw2FvkJCJlKn\nabIRuGvBKwzESIXgKk2016aTP6/dAjEHyo6SeoK8lkIySUvK0fyOVlsiEsCmOpid\ntnKX/a+50GjB79CJH4ER2lLVZnhePFR/zUOyPxZQQ4naHf7yu/b5jhO0f8fwt+py\nFxIXjbEIdZliWRkRMtzrHOJIhrmJ2A1J7iOrirbbwillwjjNVUWPf3IJ3M12S9pE\newooaeO2izNTERcG9HzAacbVRn2Y2SWIyT/18QIDAQABAoIBACbhTYXBZYKmYPCb\nHBR1IBlCQA2nLGf0qRuJNJZg5iEzXows/6tc8YymZkQE7nolapWsQ+upk2y5Xdp/\naxiuprIs9JzkYK8Ox0r+dlwCG1kSW+UAbX0bQ/qUqlsTvU6muVuMP8vZYHxJ3wmb\n+ufRBKztPTQ/rYWaYQcgC0RWI20HTFBMxlTAyNxYNWzX7RKFkGVVyB9RsAtmcc8g\n+j4OdosbfNoJPS0HeIfNpAznDfHKdxDk2Yc1tV6RHBrC1ynyLE9+TaflIAdo2MVv\nKLMLq51GqYKtgJFIlBRPQqKoyXdz3fGvXrTkf/WY9QNq0J1Vk5ERePZ54mN8iZB7\n9lwy/AkCgYEA6FXzosxswaJ2wQLeoYc7ceaweX/SwTvxHgXzRyJIIT0eJWgx13Wo\n/WA3Iziimsjf6qE+SI/8laxPp2A86VMaIt3Z3mJN/CqSVGw8LK2AQst+OwdPyDMu\niacE8lj/IFGC8mwNUAb9CzGU3JpU4PxxGFjS/eMtGeRXCWkK4NE+G08CgYEA1Kp9\nN2JrVlqUz+gAX+LPmE9OEMAS9WQSQsfCHGogIFDGGcNf7+uwBM7GAaSJIP01zcoe\nVAgWdzXCv3FLhsaZoJ6RyLOLay5phbu1iaTr4UNYm5WtYTzMzqh8l1+MFFDl9xDB\nvULuCIIrglM5MeS/qnSg1uMoH2oVPj9TVst/ir8CgYEAxrI7Ws9Zc4Bt70N1As+U\nlySjaEVZCMkqvHJ6TCuVZFfQoE0r0whdLdRLU2PsLFP+q7qaeZQqgBaNSKeVcDYR\n9B+nY/jOmQoPewPVsp/vQTCnE/R81spu0mp0YI6cIheT1Z9zAy322svcc43JaWB7\nmEbeqyLOP4Z4qSOcmghZBSECgYACvR9Xs0DGn+wCsW4vze/2ei77MD4OQvepPIFX\ndFZtlBy5ADcgE9z0cuVB6CiL8DbdK5kwY9pGNr8HUCI03iHkW6Zs+0L0YmihfEVe\nPG19PSzK9CaDdhD9KFZSbLyVFmWfxOt50H7YRTTiPMgjyFpfi5j2q348yVT0tEQS\nfhRqaQKBgAcWPokmJ7EbYQGeMbS7HC8eWO/RyamlnSffdCdSc7ue3zdVJxpAkQ8W\nqu80pEIF6raIQfAf8MXiiZ7auFOSnHQTXUbhCpvDLKi0Mwq3G8Pl07l+2s6dQG6T\nlv6XTQaMyf6n1yjzL+fzDrH3qXMxHMO/b13EePXpDMpY7HQpoLDi\n-----END RSA PRIVATE KEY-----\n", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -291,21 +230,17 @@ def test_streaming_response_edit_overload_2(self, client: Cloudflare) -> None: assert cast(Any, response.is_closed) is True @parametrize - def test_path_params_edit_overload_2(self, client: Cloudflare) -> None: + def test_path_params_edit(self, client: Cloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): client.custom_certificates.with_raw_response.edit( custom_certificate_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="", - certificate="-----BEGIN CERTIFICATE-----\nMIIDtTCCAp2gAwIBAgIJAMHAwfXZ5/PWMA0GCSqGSIb3DQEBCwUAMEUxCzAJBgNV\nBAYTAkFVMRMwEQYDVQQIEwpTb21lLVN0YXRlMSEwHwYDVQQKExhJbnRlcm5ldCBX\naWRnaXRzIFB0eSBMdGQwHhcNMTYwODI0MTY0MzAxWhcNMTYxMTIyMTY0MzAxWjBF\nMQswCQYDVQQGEwJBVTETMBEGA1UECBMKU29tZS1TdGF0ZTEhMB8GA1UEChMYSW50\nZXJuZXQgV2lkZ2l0cyBQdHkgTHRkMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIB\nCgKCAQEAwQHoetcl9+5ikGzV6cMzWtWPJHqXT3wpbEkRU9Yz7lgvddmGdtcGbg/1\nCGZu0jJGkMoppoUo4c3dts3iwqRYmBikUP77wwY2QGmDZw2FvkJCJlKnabIRuGvB\nKwzESIXgKk2016aTP6/dAjEHyo6SeoK8lkIySUvK0fyOVlsiEsCmOpidtnKX/a+5\n0GjB79CJH4ER2lLVZnhePFR/zUOyPxZQQ4naHf7yu/b5jhO0f8fwt+pyFxIXjbEI\ndZliWRkRMtzrHOJIhrmJ2A1J7iOrirbbwillwjjNVUWPf3IJ3M12S9pEewooaeO2\nizNTERcG9HzAacbVRn2Y2SWIyT/18QIDAQABo4GnMIGkMB0GA1UdDgQWBBT/LbE4\n9rWf288N6sJA5BRb6FJIGDB1BgNVHSMEbjBsgBT/LbE49rWf288N6sJA5BRb6FJI\nGKFJpEcwRTELMAkGA1UEBhMCQVUxEzARBgNVBAgTClNvbWUtU3RhdGUxITAfBgNV\nBAoTGEludGVybmV0IFdpZGdpdHMgUHR5IEx0ZIIJAMHAwfXZ5/PWMAwGA1UdEwQF\nMAMBAf8wDQYJKoZIhvcNAQELBQADggEBAHHFwl0tH0quUYZYO0dZYt4R7SJ0pCm2\n2satiyzHl4OnXcHDpekAo7/a09c6Lz6AU83cKy/+x3/djYHXWba7HpEu0dR3ugQP\nMlr4zrhd9xKZ0KZKiYmtJH+ak4OM4L3FbT0owUZPyjLSlhMtJVcoRp5CJsjAMBUG\nSvD8RX+T01wzox/Qb+lnnNnOlaWpqu8eoOenybxKp1a9ULzIVvN/LAcc+14vioFq\n2swRWtmocBAs8QR9n4uvbpiYvS8eYueDCWMM4fvFfBhaDZ3N9IbtySh3SpFdQDhw\nYbjM2rxXiyLGxB4Bol7QTv4zHif7Zt89FReT/NBy4rzaskDJY5L6xmY=\n-----END CERTIFICATE-----\n", - private_key="-----BEGIN RSA PRIVATE KEY-----\nMIIEowIBAAKCAQEAwQHoetcl9+5ikGzV6cMzWtWPJHqXT3wpbEkRU9Yz7lgvddmG\ndtcGbg/1CGZu0jJGkMoppoUo4c3dts3iwqRYmBikUP77wwY2QGmDZw2FvkJCJlKn\nabIRuGvBKwzESIXgKk2016aTP6/dAjEHyo6SeoK8lkIySUvK0fyOVlsiEsCmOpid\ntnKX/a+50GjB79CJH4ER2lLVZnhePFR/zUOyPxZQQ4naHf7yu/b5jhO0f8fwt+py\nFxIXjbEIdZliWRkRMtzrHOJIhrmJ2A1J7iOrirbbwillwjjNVUWPf3IJ3M12S9pE\newooaeO2izNTERcG9HzAacbVRn2Y2SWIyT/18QIDAQABAoIBACbhTYXBZYKmYPCb\nHBR1IBlCQA2nLGf0qRuJNJZg5iEzXows/6tc8YymZkQE7nolapWsQ+upk2y5Xdp/\naxiuprIs9JzkYK8Ox0r+dlwCG1kSW+UAbX0bQ/qUqlsTvU6muVuMP8vZYHxJ3wmb\n+ufRBKztPTQ/rYWaYQcgC0RWI20HTFBMxlTAyNxYNWzX7RKFkGVVyB9RsAtmcc8g\n+j4OdosbfNoJPS0HeIfNpAznDfHKdxDk2Yc1tV6RHBrC1ynyLE9+TaflIAdo2MVv\nKLMLq51GqYKtgJFIlBRPQqKoyXdz3fGvXrTkf/WY9QNq0J1Vk5ERePZ54mN8iZB7\n9lwy/AkCgYEA6FXzosxswaJ2wQLeoYc7ceaweX/SwTvxHgXzRyJIIT0eJWgx13Wo\n/WA3Iziimsjf6qE+SI/8laxPp2A86VMaIt3Z3mJN/CqSVGw8LK2AQst+OwdPyDMu\niacE8lj/IFGC8mwNUAb9CzGU3JpU4PxxGFjS/eMtGeRXCWkK4NE+G08CgYEA1Kp9\nN2JrVlqUz+gAX+LPmE9OEMAS9WQSQsfCHGogIFDGGcNf7+uwBM7GAaSJIP01zcoe\nVAgWdzXCv3FLhsaZoJ6RyLOLay5phbu1iaTr4UNYm5WtYTzMzqh8l1+MFFDl9xDB\nvULuCIIrglM5MeS/qnSg1uMoH2oVPj9TVst/ir8CgYEAxrI7Ws9Zc4Bt70N1As+U\nlySjaEVZCMkqvHJ6TCuVZFfQoE0r0whdLdRLU2PsLFP+q7qaeZQqgBaNSKeVcDYR\n9B+nY/jOmQoPewPVsp/vQTCnE/R81spu0mp0YI6cIheT1Z9zAy322svcc43JaWB7\nmEbeqyLOP4Z4qSOcmghZBSECgYACvR9Xs0DGn+wCsW4vze/2ei77MD4OQvepPIFX\ndFZtlBy5ADcgE9z0cuVB6CiL8DbdK5kwY9pGNr8HUCI03iHkW6Zs+0L0YmihfEVe\nPG19PSzK9CaDdhD9KFZSbLyVFmWfxOt50H7YRTTiPMgjyFpfi5j2q348yVT0tEQS\nfhRqaQKBgAcWPokmJ7EbYQGeMbS7HC8eWO/RyamlnSffdCdSc7ue3zdVJxpAkQ8W\nqu80pEIF6raIQfAf8MXiiZ7auFOSnHQTXUbhCpvDLKi0Mwq3G8Pl07l+2s6dQG6T\nlv6XTQaMyf6n1yjzL+fzDrH3qXMxHMO/b13EePXpDMpY7HQpoLDi\n-----END RSA PRIVATE KEY-----\n", ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `custom_certificate_id` but received ''"): client.custom_certificates.with_raw_response.edit( custom_certificate_id="", zone_id="023e105f4ecef8ad9ca31a8372d0c353", - certificate="-----BEGIN CERTIFICATE-----\nMIIDtTCCAp2gAwIBAgIJAMHAwfXZ5/PWMA0GCSqGSIb3DQEBCwUAMEUxCzAJBgNV\nBAYTAkFVMRMwEQYDVQQIEwpTb21lLVN0YXRlMSEwHwYDVQQKExhJbnRlcm5ldCBX\naWRnaXRzIFB0eSBMdGQwHhcNMTYwODI0MTY0MzAxWhcNMTYxMTIyMTY0MzAxWjBF\nMQswCQYDVQQGEwJBVTETMBEGA1UECBMKU29tZS1TdGF0ZTEhMB8GA1UEChMYSW50\nZXJuZXQgV2lkZ2l0cyBQdHkgTHRkMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIB\nCgKCAQEAwQHoetcl9+5ikGzV6cMzWtWPJHqXT3wpbEkRU9Yz7lgvddmGdtcGbg/1\nCGZu0jJGkMoppoUo4c3dts3iwqRYmBikUP77wwY2QGmDZw2FvkJCJlKnabIRuGvB\nKwzESIXgKk2016aTP6/dAjEHyo6SeoK8lkIySUvK0fyOVlsiEsCmOpidtnKX/a+5\n0GjB79CJH4ER2lLVZnhePFR/zUOyPxZQQ4naHf7yu/b5jhO0f8fwt+pyFxIXjbEI\ndZliWRkRMtzrHOJIhrmJ2A1J7iOrirbbwillwjjNVUWPf3IJ3M12S9pEewooaeO2\nizNTERcG9HzAacbVRn2Y2SWIyT/18QIDAQABo4GnMIGkMB0GA1UdDgQWBBT/LbE4\n9rWf288N6sJA5BRb6FJIGDB1BgNVHSMEbjBsgBT/LbE49rWf288N6sJA5BRb6FJI\nGKFJpEcwRTELMAkGA1UEBhMCQVUxEzARBgNVBAgTClNvbWUtU3RhdGUxITAfBgNV\nBAoTGEludGVybmV0IFdpZGdpdHMgUHR5IEx0ZIIJAMHAwfXZ5/PWMAwGA1UdEwQF\nMAMBAf8wDQYJKoZIhvcNAQELBQADggEBAHHFwl0tH0quUYZYO0dZYt4R7SJ0pCm2\n2satiyzHl4OnXcHDpekAo7/a09c6Lz6AU83cKy/+x3/djYHXWba7HpEu0dR3ugQP\nMlr4zrhd9xKZ0KZKiYmtJH+ak4OM4L3FbT0owUZPyjLSlhMtJVcoRp5CJsjAMBUG\nSvD8RX+T01wzox/Qb+lnnNnOlaWpqu8eoOenybxKp1a9ULzIVvN/LAcc+14vioFq\n2swRWtmocBAs8QR9n4uvbpiYvS8eYueDCWMM4fvFfBhaDZ3N9IbtySh3SpFdQDhw\nYbjM2rxXiyLGxB4Bol7QTv4zHif7Zt89FReT/NBy4rzaskDJY5L6xmY=\n-----END CERTIFICATE-----\n", - private_key="-----BEGIN RSA PRIVATE KEY-----\nMIIEowIBAAKCAQEAwQHoetcl9+5ikGzV6cMzWtWPJHqXT3wpbEkRU9Yz7lgvddmG\ndtcGbg/1CGZu0jJGkMoppoUo4c3dts3iwqRYmBikUP77wwY2QGmDZw2FvkJCJlKn\nabIRuGvBKwzESIXgKk2016aTP6/dAjEHyo6SeoK8lkIySUvK0fyOVlsiEsCmOpid\ntnKX/a+50GjB79CJH4ER2lLVZnhePFR/zUOyPxZQQ4naHf7yu/b5jhO0f8fwt+py\nFxIXjbEIdZliWRkRMtzrHOJIhrmJ2A1J7iOrirbbwillwjjNVUWPf3IJ3M12S9pE\newooaeO2izNTERcG9HzAacbVRn2Y2SWIyT/18QIDAQABAoIBACbhTYXBZYKmYPCb\nHBR1IBlCQA2nLGf0qRuJNJZg5iEzXows/6tc8YymZkQE7nolapWsQ+upk2y5Xdp/\naxiuprIs9JzkYK8Ox0r+dlwCG1kSW+UAbX0bQ/qUqlsTvU6muVuMP8vZYHxJ3wmb\n+ufRBKztPTQ/rYWaYQcgC0RWI20HTFBMxlTAyNxYNWzX7RKFkGVVyB9RsAtmcc8g\n+j4OdosbfNoJPS0HeIfNpAznDfHKdxDk2Yc1tV6RHBrC1ynyLE9+TaflIAdo2MVv\nKLMLq51GqYKtgJFIlBRPQqKoyXdz3fGvXrTkf/WY9QNq0J1Vk5ERePZ54mN8iZB7\n9lwy/AkCgYEA6FXzosxswaJ2wQLeoYc7ceaweX/SwTvxHgXzRyJIIT0eJWgx13Wo\n/WA3Iziimsjf6qE+SI/8laxPp2A86VMaIt3Z3mJN/CqSVGw8LK2AQst+OwdPyDMu\niacE8lj/IFGC8mwNUAb9CzGU3JpU4PxxGFjS/eMtGeRXCWkK4NE+G08CgYEA1Kp9\nN2JrVlqUz+gAX+LPmE9OEMAS9WQSQsfCHGogIFDGGcNf7+uwBM7GAaSJIP01zcoe\nVAgWdzXCv3FLhsaZoJ6RyLOLay5phbu1iaTr4UNYm5WtYTzMzqh8l1+MFFDl9xDB\nvULuCIIrglM5MeS/qnSg1uMoH2oVPj9TVst/ir8CgYEAxrI7Ws9Zc4Bt70N1As+U\nlySjaEVZCMkqvHJ6TCuVZFfQoE0r0whdLdRLU2PsLFP+q7qaeZQqgBaNSKeVcDYR\n9B+nY/jOmQoPewPVsp/vQTCnE/R81spu0mp0YI6cIheT1Z9zAy322svcc43JaWB7\nmEbeqyLOP4Z4qSOcmghZBSECgYACvR9Xs0DGn+wCsW4vze/2ei77MD4OQvepPIFX\ndFZtlBy5ADcgE9z0cuVB6CiL8DbdK5kwY9pGNr8HUCI03iHkW6Zs+0L0YmihfEVe\nPG19PSzK9CaDdhD9KFZSbLyVFmWfxOt50H7YRTTiPMgjyFpfi5j2q348yVT0tEQS\nfhRqaQKBgAcWPokmJ7EbYQGeMbS7HC8eWO/RyamlnSffdCdSc7ue3zdVJxpAkQ8W\nqu80pEIF6raIQfAf8MXiiZ7auFOSnHQTXUbhCpvDLKi0Mwq3G8Pl07l+2s6dQG6T\nlv6XTQaMyf6n1yjzL+fzDrH3qXMxHMO/b13EePXpDMpY7HQpoLDi\n-----END RSA PRIVATE KEY-----\n", ) @parametrize @@ -378,8 +313,9 @@ async def test_method_create_with_all_params(self, async_client: AsyncCloudflare certificate="-----BEGIN CERTIFICATE-----\nMIIDtTCCAp2gAwIBAgIJAMHAwfXZ5/PWMA0GCSqGSIb3DQEBCwUAMEUxCzAJBgNV\nBAYTAkFVMRMwEQYDVQQIEwpTb21lLVN0YXRlMSEwHwYDVQQKExhJbnRlcm5ldCBX\naWRnaXRzIFB0eSBMdGQwHhcNMTYwODI0MTY0MzAxWhcNMTYxMTIyMTY0MzAxWjBF\nMQswCQYDVQQGEwJBVTETMBEGA1UECBMKU29tZS1TdGF0ZTEhMB8GA1UEChMYSW50\nZXJuZXQgV2lkZ2l0cyBQdHkgTHRkMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIB\nCgKCAQEAwQHoetcl9+5ikGzV6cMzWtWPJHqXT3wpbEkRU9Yz7lgvddmGdtcGbg/1\nCGZu0jJGkMoppoUo4c3dts3iwqRYmBikUP77wwY2QGmDZw2FvkJCJlKnabIRuGvB\nKwzESIXgKk2016aTP6/dAjEHyo6SeoK8lkIySUvK0fyOVlsiEsCmOpidtnKX/a+5\n0GjB79CJH4ER2lLVZnhePFR/zUOyPxZQQ4naHf7yu/b5jhO0f8fwt+pyFxIXjbEI\ndZliWRkRMtzrHOJIhrmJ2A1J7iOrirbbwillwjjNVUWPf3IJ3M12S9pEewooaeO2\nizNTERcG9HzAacbVRn2Y2SWIyT/18QIDAQABo4GnMIGkMB0GA1UdDgQWBBT/LbE4\n9rWf288N6sJA5BRb6FJIGDB1BgNVHSMEbjBsgBT/LbE49rWf288N6sJA5BRb6FJI\nGKFJpEcwRTELMAkGA1UEBhMCQVUxEzARBgNVBAgTClNvbWUtU3RhdGUxITAfBgNV\nBAoTGEludGVybmV0IFdpZGdpdHMgUHR5IEx0ZIIJAMHAwfXZ5/PWMAwGA1UdEwQF\nMAMBAf8wDQYJKoZIhvcNAQELBQADggEBAHHFwl0tH0quUYZYO0dZYt4R7SJ0pCm2\n2satiyzHl4OnXcHDpekAo7/a09c6Lz6AU83cKy/+x3/djYHXWba7HpEu0dR3ugQP\nMlr4zrhd9xKZ0KZKiYmtJH+ak4OM4L3FbT0owUZPyjLSlhMtJVcoRp5CJsjAMBUG\nSvD8RX+T01wzox/Qb+lnnNnOlaWpqu8eoOenybxKp1a9ULzIVvN/LAcc+14vioFq\n2swRWtmocBAs8QR9n4uvbpiYvS8eYueDCWMM4fvFfBhaDZ3N9IbtySh3SpFdQDhw\nYbjM2rxXiyLGxB4Bol7QTv4zHif7Zt89FReT/NBy4rzaskDJY5L6xmY=\n-----END CERTIFICATE-----\n", private_key="-----BEGIN RSA PRIVATE KEY-----\nMIIEowIBAAKCAQEAwQHoetcl9+5ikGzV6cMzWtWPJHqXT3wpbEkRU9Yz7lgvddmG\ndtcGbg/1CGZu0jJGkMoppoUo4c3dts3iwqRYmBikUP77wwY2QGmDZw2FvkJCJlKn\nabIRuGvBKwzESIXgKk2016aTP6/dAjEHyo6SeoK8lkIySUvK0fyOVlsiEsCmOpid\ntnKX/a+50GjB79CJH4ER2lLVZnhePFR/zUOyPxZQQ4naHf7yu/b5jhO0f8fwt+py\nFxIXjbEIdZliWRkRMtzrHOJIhrmJ2A1J7iOrirbbwillwjjNVUWPf3IJ3M12S9pE\newooaeO2izNTERcG9HzAacbVRn2Y2SWIyT/18QIDAQABAoIBACbhTYXBZYKmYPCb\nHBR1IBlCQA2nLGf0qRuJNJZg5iEzXows/6tc8YymZkQE7nolapWsQ+upk2y5Xdp/\naxiuprIs9JzkYK8Ox0r+dlwCG1kSW+UAbX0bQ/qUqlsTvU6muVuMP8vZYHxJ3wmb\n+ufRBKztPTQ/rYWaYQcgC0RWI20HTFBMxlTAyNxYNWzX7RKFkGVVyB9RsAtmcc8g\n+j4OdosbfNoJPS0HeIfNpAznDfHKdxDk2Yc1tV6RHBrC1ynyLE9+TaflIAdo2MVv\nKLMLq51GqYKtgJFIlBRPQqKoyXdz3fGvXrTkf/WY9QNq0J1Vk5ERePZ54mN8iZB7\n9lwy/AkCgYEA6FXzosxswaJ2wQLeoYc7ceaweX/SwTvxHgXzRyJIIT0eJWgx13Wo\n/WA3Iziimsjf6qE+SI/8laxPp2A86VMaIt3Z3mJN/CqSVGw8LK2AQst+OwdPyDMu\niacE8lj/IFGC8mwNUAb9CzGU3JpU4PxxGFjS/eMtGeRXCWkK4NE+G08CgYEA1Kp9\nN2JrVlqUz+gAX+LPmE9OEMAS9WQSQsfCHGogIFDGGcNf7+uwBM7GAaSJIP01zcoe\nVAgWdzXCv3FLhsaZoJ6RyLOLay5phbu1iaTr4UNYm5WtYTzMzqh8l1+MFFDl9xDB\nvULuCIIrglM5MeS/qnSg1uMoH2oVPj9TVst/ir8CgYEAxrI7Ws9Zc4Bt70N1As+U\nlySjaEVZCMkqvHJ6TCuVZFfQoE0r0whdLdRLU2PsLFP+q7qaeZQqgBaNSKeVcDYR\n9B+nY/jOmQoPewPVsp/vQTCnE/R81spu0mp0YI6cIheT1Z9zAy322svcc43JaWB7\nmEbeqyLOP4Z4qSOcmghZBSECgYACvR9Xs0DGn+wCsW4vze/2ei77MD4OQvepPIFX\ndFZtlBy5ADcgE9z0cuVB6CiL8DbdK5kwY9pGNr8HUCI03iHkW6Zs+0L0YmihfEVe\nPG19PSzK9CaDdhD9KFZSbLyVFmWfxOt50H7YRTTiPMgjyFpfi5j2q348yVT0tEQS\nfhRqaQKBgAcWPokmJ7EbYQGeMbS7HC8eWO/RyamlnSffdCdSc7ue3zdVJxpAkQ8W\nqu80pEIF6raIQfAf8MXiiZ7auFOSnHQTXUbhCpvDLKi0Mwq3G8Pl07l+2s6dQG6T\nlv6XTQaMyf6n1yjzL+fzDrH3qXMxHMO/b13EePXpDMpY7HQpoLDi\n-----END RSA PRIVATE KEY-----\n", bundle_method="ubiquitous", + deploy="staging", geo_restrictions={"label": "us"}, - policy="(country: US) or (region: EU)", + policy="policy", type="sni_custom", ) assert_matches_type(Optional[CustomCertificate], custom_certificate, path=["response"]) @@ -520,7 +456,7 @@ async def test_path_params_delete(self, async_client: AsyncCloudflare) -> None: @pytest.mark.skip(reason="Test missing required parameters: certificate and private_key (Issue #4)") @parametrize - async def test_method_edit_overload_1(self, async_client: AsyncCloudflare) -> None: + async def test_method_edit(self, async_client: AsyncCloudflare) -> None: custom_certificate = await async_client.custom_certificates.edit( custom_certificate_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", @@ -528,86 +464,25 @@ async def test_method_edit_overload_1(self, async_client: AsyncCloudflare) -> No assert_matches_type(Optional[CustomCertificate], custom_certificate, path=["response"]) @parametrize - async def test_method_edit_with_all_params_overload_1(self, async_client: AsyncCloudflare) -> None: + async def test_method_edit_with_all_params(self, async_client: AsyncCloudflare) -> None: custom_certificate = await async_client.custom_certificates.edit( custom_certificate_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", bundle_method="ubiquitous", - ) - assert_matches_type(Optional[CustomCertificate], custom_certificate, path=["response"]) - - @pytest.mark.skip(reason="Test missing required parameters: certificate and private_key (Issue #4)") - @parametrize - async def test_raw_response_edit_overload_1(self, async_client: AsyncCloudflare) -> None: - response = await async_client.custom_certificates.with_raw_response.edit( - custom_certificate_id="023e105f4ecef8ad9ca31a8372d0c353", - zone_id="023e105f4ecef8ad9ca31a8372d0c353", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - custom_certificate = await response.parse() - assert_matches_type(Optional[CustomCertificate], custom_certificate, path=["response"]) - - @pytest.mark.skip(reason="Test missing required parameters: certificate and private_key (Issue #4)") - @parametrize - async def test_streaming_response_edit_overload_1(self, async_client: AsyncCloudflare) -> None: - async with async_client.custom_certificates.with_streaming_response.edit( - custom_certificate_id="023e105f4ecef8ad9ca31a8372d0c353", - zone_id="023e105f4ecef8ad9ca31a8372d0c353", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - custom_certificate = await response.parse() - assert_matches_type(Optional[CustomCertificate], custom_certificate, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_edit_overload_1(self, async_client: AsyncCloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): - await async_client.custom_certificates.with_raw_response.edit( - custom_certificate_id="023e105f4ecef8ad9ca31a8372d0c353", - zone_id="", - ) - - with pytest.raises(ValueError, match=r"Expected a non-empty value for `custom_certificate_id` but received ''"): - await async_client.custom_certificates.with_raw_response.edit( - custom_certificate_id="", - zone_id="023e105f4ecef8ad9ca31a8372d0c353", - ) - - @parametrize - async def test_method_edit_overload_2(self, async_client: AsyncCloudflare) -> None: - custom_certificate = await async_client.custom_certificates.edit( - custom_certificate_id="023e105f4ecef8ad9ca31a8372d0c353", - zone_id="023e105f4ecef8ad9ca31a8372d0c353", - certificate="-----BEGIN CERTIFICATE-----\nMIIDtTCCAp2gAwIBAgIJAMHAwfXZ5/PWMA0GCSqGSIb3DQEBCwUAMEUxCzAJBgNV\nBAYTAkFVMRMwEQYDVQQIEwpTb21lLVN0YXRlMSEwHwYDVQQKExhJbnRlcm5ldCBX\naWRnaXRzIFB0eSBMdGQwHhcNMTYwODI0MTY0MzAxWhcNMTYxMTIyMTY0MzAxWjBF\nMQswCQYDVQQGEwJBVTETMBEGA1UECBMKU29tZS1TdGF0ZTEhMB8GA1UEChMYSW50\nZXJuZXQgV2lkZ2l0cyBQdHkgTHRkMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIB\nCgKCAQEAwQHoetcl9+5ikGzV6cMzWtWPJHqXT3wpbEkRU9Yz7lgvddmGdtcGbg/1\nCGZu0jJGkMoppoUo4c3dts3iwqRYmBikUP77wwY2QGmDZw2FvkJCJlKnabIRuGvB\nKwzESIXgKk2016aTP6/dAjEHyo6SeoK8lkIySUvK0fyOVlsiEsCmOpidtnKX/a+5\n0GjB79CJH4ER2lLVZnhePFR/zUOyPxZQQ4naHf7yu/b5jhO0f8fwt+pyFxIXjbEI\ndZliWRkRMtzrHOJIhrmJ2A1J7iOrirbbwillwjjNVUWPf3IJ3M12S9pEewooaeO2\nizNTERcG9HzAacbVRn2Y2SWIyT/18QIDAQABo4GnMIGkMB0GA1UdDgQWBBT/LbE4\n9rWf288N6sJA5BRb6FJIGDB1BgNVHSMEbjBsgBT/LbE49rWf288N6sJA5BRb6FJI\nGKFJpEcwRTELMAkGA1UEBhMCQVUxEzARBgNVBAgTClNvbWUtU3RhdGUxITAfBgNV\nBAoTGEludGVybmV0IFdpZGdpdHMgUHR5IEx0ZIIJAMHAwfXZ5/PWMAwGA1UdEwQF\nMAMBAf8wDQYJKoZIhvcNAQELBQADggEBAHHFwl0tH0quUYZYO0dZYt4R7SJ0pCm2\n2satiyzHl4OnXcHDpekAo7/a09c6Lz6AU83cKy/+x3/djYHXWba7HpEu0dR3ugQP\nMlr4zrhd9xKZ0KZKiYmtJH+ak4OM4L3FbT0owUZPyjLSlhMtJVcoRp5CJsjAMBUG\nSvD8RX+T01wzox/Qb+lnnNnOlaWpqu8eoOenybxKp1a9ULzIVvN/LAcc+14vioFq\n2swRWtmocBAs8QR9n4uvbpiYvS8eYueDCWMM4fvFfBhaDZ3N9IbtySh3SpFdQDhw\nYbjM2rxXiyLGxB4Bol7QTv4zHif7Zt89FReT/NBy4rzaskDJY5L6xmY=\n-----END CERTIFICATE-----\n", - private_key="-----BEGIN RSA PRIVATE KEY-----\nMIIEowIBAAKCAQEAwQHoetcl9+5ikGzV6cMzWtWPJHqXT3wpbEkRU9Yz7lgvddmG\ndtcGbg/1CGZu0jJGkMoppoUo4c3dts3iwqRYmBikUP77wwY2QGmDZw2FvkJCJlKn\nabIRuGvBKwzESIXgKk2016aTP6/dAjEHyo6SeoK8lkIySUvK0fyOVlsiEsCmOpid\ntnKX/a+50GjB79CJH4ER2lLVZnhePFR/zUOyPxZQQ4naHf7yu/b5jhO0f8fwt+py\nFxIXjbEIdZliWRkRMtzrHOJIhrmJ2A1J7iOrirbbwillwjjNVUWPf3IJ3M12S9pE\newooaeO2izNTERcG9HzAacbVRn2Y2SWIyT/18QIDAQABAoIBACbhTYXBZYKmYPCb\nHBR1IBlCQA2nLGf0qRuJNJZg5iEzXows/6tc8YymZkQE7nolapWsQ+upk2y5Xdp/\naxiuprIs9JzkYK8Ox0r+dlwCG1kSW+UAbX0bQ/qUqlsTvU6muVuMP8vZYHxJ3wmb\n+ufRBKztPTQ/rYWaYQcgC0RWI20HTFBMxlTAyNxYNWzX7RKFkGVVyB9RsAtmcc8g\n+j4OdosbfNoJPS0HeIfNpAznDfHKdxDk2Yc1tV6RHBrC1ynyLE9+TaflIAdo2MVv\nKLMLq51GqYKtgJFIlBRPQqKoyXdz3fGvXrTkf/WY9QNq0J1Vk5ERePZ54mN8iZB7\n9lwy/AkCgYEA6FXzosxswaJ2wQLeoYc7ceaweX/SwTvxHgXzRyJIIT0eJWgx13Wo\n/WA3Iziimsjf6qE+SI/8laxPp2A86VMaIt3Z3mJN/CqSVGw8LK2AQst+OwdPyDMu\niacE8lj/IFGC8mwNUAb9CzGU3JpU4PxxGFjS/eMtGeRXCWkK4NE+G08CgYEA1Kp9\nN2JrVlqUz+gAX+LPmE9OEMAS9WQSQsfCHGogIFDGGcNf7+uwBM7GAaSJIP01zcoe\nVAgWdzXCv3FLhsaZoJ6RyLOLay5phbu1iaTr4UNYm5WtYTzMzqh8l1+MFFDl9xDB\nvULuCIIrglM5MeS/qnSg1uMoH2oVPj9TVst/ir8CgYEAxrI7Ws9Zc4Bt70N1As+U\nlySjaEVZCMkqvHJ6TCuVZFfQoE0r0whdLdRLU2PsLFP+q7qaeZQqgBaNSKeVcDYR\n9B+nY/jOmQoPewPVsp/vQTCnE/R81spu0mp0YI6cIheT1Z9zAy322svcc43JaWB7\nmEbeqyLOP4Z4qSOcmghZBSECgYACvR9Xs0DGn+wCsW4vze/2ei77MD4OQvepPIFX\ndFZtlBy5ADcgE9z0cuVB6CiL8DbdK5kwY9pGNr8HUCI03iHkW6Zs+0L0YmihfEVe\nPG19PSzK9CaDdhD9KFZSbLyVFmWfxOt50H7YRTTiPMgjyFpfi5j2q348yVT0tEQS\nfhRqaQKBgAcWPokmJ7EbYQGeMbS7HC8eWO/RyamlnSffdCdSc7ue3zdVJxpAkQ8W\nqu80pEIF6raIQfAf8MXiiZ7auFOSnHQTXUbhCpvDLKi0Mwq3G8Pl07l+2s6dQG6T\nlv6XTQaMyf6n1yjzL+fzDrH3qXMxHMO/b13EePXpDMpY7HQpoLDi\n-----END RSA PRIVATE KEY-----\n", - ) - assert_matches_type(Optional[CustomCertificate], custom_certificate, path=["response"]) - - @parametrize - async def test_method_edit_with_all_params_overload_2(self, async_client: AsyncCloudflare) -> None: - custom_certificate = await async_client.custom_certificates.edit( - custom_certificate_id="023e105f4ecef8ad9ca31a8372d0c353", - zone_id="023e105f4ecef8ad9ca31a8372d0c353", certificate="-----BEGIN CERTIFICATE-----\nMIIDtTCCAp2gAwIBAgIJAMHAwfXZ5/PWMA0GCSqGSIb3DQEBCwUAMEUxCzAJBgNV\nBAYTAkFVMRMwEQYDVQQIEwpTb21lLVN0YXRlMSEwHwYDVQQKExhJbnRlcm5ldCBX\naWRnaXRzIFB0eSBMdGQwHhcNMTYwODI0MTY0MzAxWhcNMTYxMTIyMTY0MzAxWjBF\nMQswCQYDVQQGEwJBVTETMBEGA1UECBMKU29tZS1TdGF0ZTEhMB8GA1UEChMYSW50\nZXJuZXQgV2lkZ2l0cyBQdHkgTHRkMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIB\nCgKCAQEAwQHoetcl9+5ikGzV6cMzWtWPJHqXT3wpbEkRU9Yz7lgvddmGdtcGbg/1\nCGZu0jJGkMoppoUo4c3dts3iwqRYmBikUP77wwY2QGmDZw2FvkJCJlKnabIRuGvB\nKwzESIXgKk2016aTP6/dAjEHyo6SeoK8lkIySUvK0fyOVlsiEsCmOpidtnKX/a+5\n0GjB79CJH4ER2lLVZnhePFR/zUOyPxZQQ4naHf7yu/b5jhO0f8fwt+pyFxIXjbEI\ndZliWRkRMtzrHOJIhrmJ2A1J7iOrirbbwillwjjNVUWPf3IJ3M12S9pEewooaeO2\nizNTERcG9HzAacbVRn2Y2SWIyT/18QIDAQABo4GnMIGkMB0GA1UdDgQWBBT/LbE4\n9rWf288N6sJA5BRb6FJIGDB1BgNVHSMEbjBsgBT/LbE49rWf288N6sJA5BRb6FJI\nGKFJpEcwRTELMAkGA1UEBhMCQVUxEzARBgNVBAgTClNvbWUtU3RhdGUxITAfBgNV\nBAoTGEludGVybmV0IFdpZGdpdHMgUHR5IEx0ZIIJAMHAwfXZ5/PWMAwGA1UdEwQF\nMAMBAf8wDQYJKoZIhvcNAQELBQADggEBAHHFwl0tH0quUYZYO0dZYt4R7SJ0pCm2\n2satiyzHl4OnXcHDpekAo7/a09c6Lz6AU83cKy/+x3/djYHXWba7HpEu0dR3ugQP\nMlr4zrhd9xKZ0KZKiYmtJH+ak4OM4L3FbT0owUZPyjLSlhMtJVcoRp5CJsjAMBUG\nSvD8RX+T01wzox/Qb+lnnNnOlaWpqu8eoOenybxKp1a9ULzIVvN/LAcc+14vioFq\n2swRWtmocBAs8QR9n4uvbpiYvS8eYueDCWMM4fvFfBhaDZ3N9IbtySh3SpFdQDhw\nYbjM2rxXiyLGxB4Bol7QTv4zHif7Zt89FReT/NBy4rzaskDJY5L6xmY=\n-----END CERTIFICATE-----\n", - private_key="-----BEGIN RSA PRIVATE KEY-----\nMIIEowIBAAKCAQEAwQHoetcl9+5ikGzV6cMzWtWPJHqXT3wpbEkRU9Yz7lgvddmG\ndtcGbg/1CGZu0jJGkMoppoUo4c3dts3iwqRYmBikUP77wwY2QGmDZw2FvkJCJlKn\nabIRuGvBKwzESIXgKk2016aTP6/dAjEHyo6SeoK8lkIySUvK0fyOVlsiEsCmOpid\ntnKX/a+50GjB79CJH4ER2lLVZnhePFR/zUOyPxZQQ4naHf7yu/b5jhO0f8fwt+py\nFxIXjbEIdZliWRkRMtzrHOJIhrmJ2A1J7iOrirbbwillwjjNVUWPf3IJ3M12S9pE\newooaeO2izNTERcG9HzAacbVRn2Y2SWIyT/18QIDAQABAoIBACbhTYXBZYKmYPCb\nHBR1IBlCQA2nLGf0qRuJNJZg5iEzXows/6tc8YymZkQE7nolapWsQ+upk2y5Xdp/\naxiuprIs9JzkYK8Ox0r+dlwCG1kSW+UAbX0bQ/qUqlsTvU6muVuMP8vZYHxJ3wmb\n+ufRBKztPTQ/rYWaYQcgC0RWI20HTFBMxlTAyNxYNWzX7RKFkGVVyB9RsAtmcc8g\n+j4OdosbfNoJPS0HeIfNpAznDfHKdxDk2Yc1tV6RHBrC1ynyLE9+TaflIAdo2MVv\nKLMLq51GqYKtgJFIlBRPQqKoyXdz3fGvXrTkf/WY9QNq0J1Vk5ERePZ54mN8iZB7\n9lwy/AkCgYEA6FXzosxswaJ2wQLeoYc7ceaweX/SwTvxHgXzRyJIIT0eJWgx13Wo\n/WA3Iziimsjf6qE+SI/8laxPp2A86VMaIt3Z3mJN/CqSVGw8LK2AQst+OwdPyDMu\niacE8lj/IFGC8mwNUAb9CzGU3JpU4PxxGFjS/eMtGeRXCWkK4NE+G08CgYEA1Kp9\nN2JrVlqUz+gAX+LPmE9OEMAS9WQSQsfCHGogIFDGGcNf7+uwBM7GAaSJIP01zcoe\nVAgWdzXCv3FLhsaZoJ6RyLOLay5phbu1iaTr4UNYm5WtYTzMzqh8l1+MFFDl9xDB\nvULuCIIrglM5MeS/qnSg1uMoH2oVPj9TVst/ir8CgYEAxrI7Ws9Zc4Bt70N1As+U\nlySjaEVZCMkqvHJ6TCuVZFfQoE0r0whdLdRLU2PsLFP+q7qaeZQqgBaNSKeVcDYR\n9B+nY/jOmQoPewPVsp/vQTCnE/R81spu0mp0YI6cIheT1Z9zAy322svcc43JaWB7\nmEbeqyLOP4Z4qSOcmghZBSECgYACvR9Xs0DGn+wCsW4vze/2ei77MD4OQvepPIFX\ndFZtlBy5ADcgE9z0cuVB6CiL8DbdK5kwY9pGNr8HUCI03iHkW6Zs+0L0YmihfEVe\nPG19PSzK9CaDdhD9KFZSbLyVFmWfxOt50H7YRTTiPMgjyFpfi5j2q348yVT0tEQS\nfhRqaQKBgAcWPokmJ7EbYQGeMbS7HC8eWO/RyamlnSffdCdSc7ue3zdVJxpAkQ8W\nqu80pEIF6raIQfAf8MXiiZ7auFOSnHQTXUbhCpvDLKi0Mwq3G8Pl07l+2s6dQG6T\nlv6XTQaMyf6n1yjzL+fzDrH3qXMxHMO/b13EePXpDMpY7HQpoLDi\n-----END RSA PRIVATE KEY-----\n", - bundle_method="ubiquitous", + deploy="staging", geo_restrictions={"label": "us"}, - policy="(country: US) or (region: EU)", + policy="policy", + private_key="-----BEGIN RSA PRIVATE KEY-----\nMIIEowIBAAKCAQEAwQHoetcl9+5ikGzV6cMzWtWPJHqXT3wpbEkRU9Yz7lgvddmG\ndtcGbg/1CGZu0jJGkMoppoUo4c3dts3iwqRYmBikUP77wwY2QGmDZw2FvkJCJlKn\nabIRuGvBKwzESIXgKk2016aTP6/dAjEHyo6SeoK8lkIySUvK0fyOVlsiEsCmOpid\ntnKX/a+50GjB79CJH4ER2lLVZnhePFR/zUOyPxZQQ4naHf7yu/b5jhO0f8fwt+py\nFxIXjbEIdZliWRkRMtzrHOJIhrmJ2A1J7iOrirbbwillwjjNVUWPf3IJ3M12S9pE\newooaeO2izNTERcG9HzAacbVRn2Y2SWIyT/18QIDAQABAoIBACbhTYXBZYKmYPCb\nHBR1IBlCQA2nLGf0qRuJNJZg5iEzXows/6tc8YymZkQE7nolapWsQ+upk2y5Xdp/\naxiuprIs9JzkYK8Ox0r+dlwCG1kSW+UAbX0bQ/qUqlsTvU6muVuMP8vZYHxJ3wmb\n+ufRBKztPTQ/rYWaYQcgC0RWI20HTFBMxlTAyNxYNWzX7RKFkGVVyB9RsAtmcc8g\n+j4OdosbfNoJPS0HeIfNpAznDfHKdxDk2Yc1tV6RHBrC1ynyLE9+TaflIAdo2MVv\nKLMLq51GqYKtgJFIlBRPQqKoyXdz3fGvXrTkf/WY9QNq0J1Vk5ERePZ54mN8iZB7\n9lwy/AkCgYEA6FXzosxswaJ2wQLeoYc7ceaweX/SwTvxHgXzRyJIIT0eJWgx13Wo\n/WA3Iziimsjf6qE+SI/8laxPp2A86VMaIt3Z3mJN/CqSVGw8LK2AQst+OwdPyDMu\niacE8lj/IFGC8mwNUAb9CzGU3JpU4PxxGFjS/eMtGeRXCWkK4NE+G08CgYEA1Kp9\nN2JrVlqUz+gAX+LPmE9OEMAS9WQSQsfCHGogIFDGGcNf7+uwBM7GAaSJIP01zcoe\nVAgWdzXCv3FLhsaZoJ6RyLOLay5phbu1iaTr4UNYm5WtYTzMzqh8l1+MFFDl9xDB\nvULuCIIrglM5MeS/qnSg1uMoH2oVPj9TVst/ir8CgYEAxrI7Ws9Zc4Bt70N1As+U\nlySjaEVZCMkqvHJ6TCuVZFfQoE0r0whdLdRLU2PsLFP+q7qaeZQqgBaNSKeVcDYR\n9B+nY/jOmQoPewPVsp/vQTCnE/R81spu0mp0YI6cIheT1Z9zAy322svcc43JaWB7\nmEbeqyLOP4Z4qSOcmghZBSECgYACvR9Xs0DGn+wCsW4vze/2ei77MD4OQvepPIFX\ndFZtlBy5ADcgE9z0cuVB6CiL8DbdK5kwY9pGNr8HUCI03iHkW6Zs+0L0YmihfEVe\nPG19PSzK9CaDdhD9KFZSbLyVFmWfxOt50H7YRTTiPMgjyFpfi5j2q348yVT0tEQS\nfhRqaQKBgAcWPokmJ7EbYQGeMbS7HC8eWO/RyamlnSffdCdSc7ue3zdVJxpAkQ8W\nqu80pEIF6raIQfAf8MXiiZ7auFOSnHQTXUbhCpvDLKi0Mwq3G8Pl07l+2s6dQG6T\nlv6XTQaMyf6n1yjzL+fzDrH3qXMxHMO/b13EePXpDMpY7HQpoLDi\n-----END RSA PRIVATE KEY-----\n", ) assert_matches_type(Optional[CustomCertificate], custom_certificate, path=["response"]) + @pytest.mark.skip(reason="Test missing required parameters: certificate and private_key (Issue #4)") @parametrize - async def test_raw_response_edit_overload_2(self, async_client: AsyncCloudflare) -> None: + async def test_raw_response_edit(self, async_client: AsyncCloudflare) -> None: response = await async_client.custom_certificates.with_raw_response.edit( custom_certificate_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", - certificate="-----BEGIN CERTIFICATE-----\nMIIDtTCCAp2gAwIBAgIJAMHAwfXZ5/PWMA0GCSqGSIb3DQEBCwUAMEUxCzAJBgNV\nBAYTAkFVMRMwEQYDVQQIEwpTb21lLVN0YXRlMSEwHwYDVQQKExhJbnRlcm5ldCBX\naWRnaXRzIFB0eSBMdGQwHhcNMTYwODI0MTY0MzAxWhcNMTYxMTIyMTY0MzAxWjBF\nMQswCQYDVQQGEwJBVTETMBEGA1UECBMKU29tZS1TdGF0ZTEhMB8GA1UEChMYSW50\nZXJuZXQgV2lkZ2l0cyBQdHkgTHRkMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIB\nCgKCAQEAwQHoetcl9+5ikGzV6cMzWtWPJHqXT3wpbEkRU9Yz7lgvddmGdtcGbg/1\nCGZu0jJGkMoppoUo4c3dts3iwqRYmBikUP77wwY2QGmDZw2FvkJCJlKnabIRuGvB\nKwzESIXgKk2016aTP6/dAjEHyo6SeoK8lkIySUvK0fyOVlsiEsCmOpidtnKX/a+5\n0GjB79CJH4ER2lLVZnhePFR/zUOyPxZQQ4naHf7yu/b5jhO0f8fwt+pyFxIXjbEI\ndZliWRkRMtzrHOJIhrmJ2A1J7iOrirbbwillwjjNVUWPf3IJ3M12S9pEewooaeO2\nizNTERcG9HzAacbVRn2Y2SWIyT/18QIDAQABo4GnMIGkMB0GA1UdDgQWBBT/LbE4\n9rWf288N6sJA5BRb6FJIGDB1BgNVHSMEbjBsgBT/LbE49rWf288N6sJA5BRb6FJI\nGKFJpEcwRTELMAkGA1UEBhMCQVUxEzARBgNVBAgTClNvbWUtU3RhdGUxITAfBgNV\nBAoTGEludGVybmV0IFdpZGdpdHMgUHR5IEx0ZIIJAMHAwfXZ5/PWMAwGA1UdEwQF\nMAMBAf8wDQYJKoZIhvcNAQELBQADggEBAHHFwl0tH0quUYZYO0dZYt4R7SJ0pCm2\n2satiyzHl4OnXcHDpekAo7/a09c6Lz6AU83cKy/+x3/djYHXWba7HpEu0dR3ugQP\nMlr4zrhd9xKZ0KZKiYmtJH+ak4OM4L3FbT0owUZPyjLSlhMtJVcoRp5CJsjAMBUG\nSvD8RX+T01wzox/Qb+lnnNnOlaWpqu8eoOenybxKp1a9ULzIVvN/LAcc+14vioFq\n2swRWtmocBAs8QR9n4uvbpiYvS8eYueDCWMM4fvFfBhaDZ3N9IbtySh3SpFdQDhw\nYbjM2rxXiyLGxB4Bol7QTv4zHif7Zt89FReT/NBy4rzaskDJY5L6xmY=\n-----END CERTIFICATE-----\n", - private_key="-----BEGIN RSA PRIVATE KEY-----\nMIIEowIBAAKCAQEAwQHoetcl9+5ikGzV6cMzWtWPJHqXT3wpbEkRU9Yz7lgvddmG\ndtcGbg/1CGZu0jJGkMoppoUo4c3dts3iwqRYmBikUP77wwY2QGmDZw2FvkJCJlKn\nabIRuGvBKwzESIXgKk2016aTP6/dAjEHyo6SeoK8lkIySUvK0fyOVlsiEsCmOpid\ntnKX/a+50GjB79CJH4ER2lLVZnhePFR/zUOyPxZQQ4naHf7yu/b5jhO0f8fwt+py\nFxIXjbEIdZliWRkRMtzrHOJIhrmJ2A1J7iOrirbbwillwjjNVUWPf3IJ3M12S9pE\newooaeO2izNTERcG9HzAacbVRn2Y2SWIyT/18QIDAQABAoIBACbhTYXBZYKmYPCb\nHBR1IBlCQA2nLGf0qRuJNJZg5iEzXows/6tc8YymZkQE7nolapWsQ+upk2y5Xdp/\naxiuprIs9JzkYK8Ox0r+dlwCG1kSW+UAbX0bQ/qUqlsTvU6muVuMP8vZYHxJ3wmb\n+ufRBKztPTQ/rYWaYQcgC0RWI20HTFBMxlTAyNxYNWzX7RKFkGVVyB9RsAtmcc8g\n+j4OdosbfNoJPS0HeIfNpAznDfHKdxDk2Yc1tV6RHBrC1ynyLE9+TaflIAdo2MVv\nKLMLq51GqYKtgJFIlBRPQqKoyXdz3fGvXrTkf/WY9QNq0J1Vk5ERePZ54mN8iZB7\n9lwy/AkCgYEA6FXzosxswaJ2wQLeoYc7ceaweX/SwTvxHgXzRyJIIT0eJWgx13Wo\n/WA3Iziimsjf6qE+SI/8laxPp2A86VMaIt3Z3mJN/CqSVGw8LK2AQst+OwdPyDMu\niacE8lj/IFGC8mwNUAb9CzGU3JpU4PxxGFjS/eMtGeRXCWkK4NE+G08CgYEA1Kp9\nN2JrVlqUz+gAX+LPmE9OEMAS9WQSQsfCHGogIFDGGcNf7+uwBM7GAaSJIP01zcoe\nVAgWdzXCv3FLhsaZoJ6RyLOLay5phbu1iaTr4UNYm5WtYTzMzqh8l1+MFFDl9xDB\nvULuCIIrglM5MeS/qnSg1uMoH2oVPj9TVst/ir8CgYEAxrI7Ws9Zc4Bt70N1As+U\nlySjaEVZCMkqvHJ6TCuVZFfQoE0r0whdLdRLU2PsLFP+q7qaeZQqgBaNSKeVcDYR\n9B+nY/jOmQoPewPVsp/vQTCnE/R81spu0mp0YI6cIheT1Z9zAy322svcc43JaWB7\nmEbeqyLOP4Z4qSOcmghZBSECgYACvR9Xs0DGn+wCsW4vze/2ei77MD4OQvepPIFX\ndFZtlBy5ADcgE9z0cuVB6CiL8DbdK5kwY9pGNr8HUCI03iHkW6Zs+0L0YmihfEVe\nPG19PSzK9CaDdhD9KFZSbLyVFmWfxOt50H7YRTTiPMgjyFpfi5j2q348yVT0tEQS\nfhRqaQKBgAcWPokmJ7EbYQGeMbS7HC8eWO/RyamlnSffdCdSc7ue3zdVJxpAkQ8W\nqu80pEIF6raIQfAf8MXiiZ7auFOSnHQTXUbhCpvDLKi0Mwq3G8Pl07l+2s6dQG6T\nlv6XTQaMyf6n1yjzL+fzDrH3qXMxHMO/b13EePXpDMpY7HQpoLDi\n-----END RSA PRIVATE KEY-----\n", ) assert response.is_closed is True @@ -615,13 +490,12 @@ async def test_raw_response_edit_overload_2(self, async_client: AsyncCloudflare) custom_certificate = await response.parse() assert_matches_type(Optional[CustomCertificate], custom_certificate, path=["response"]) + @pytest.mark.skip(reason="Test missing required parameters: certificate and private_key (Issue #4)") @parametrize - async def test_streaming_response_edit_overload_2(self, async_client: AsyncCloudflare) -> None: + async def test_streaming_response_edit(self, async_client: AsyncCloudflare) -> None: async with async_client.custom_certificates.with_streaming_response.edit( custom_certificate_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="023e105f4ecef8ad9ca31a8372d0c353", - certificate="-----BEGIN CERTIFICATE-----\nMIIDtTCCAp2gAwIBAgIJAMHAwfXZ5/PWMA0GCSqGSIb3DQEBCwUAMEUxCzAJBgNV\nBAYTAkFVMRMwEQYDVQQIEwpTb21lLVN0YXRlMSEwHwYDVQQKExhJbnRlcm5ldCBX\naWRnaXRzIFB0eSBMdGQwHhcNMTYwODI0MTY0MzAxWhcNMTYxMTIyMTY0MzAxWjBF\nMQswCQYDVQQGEwJBVTETMBEGA1UECBMKU29tZS1TdGF0ZTEhMB8GA1UEChMYSW50\nZXJuZXQgV2lkZ2l0cyBQdHkgTHRkMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIB\nCgKCAQEAwQHoetcl9+5ikGzV6cMzWtWPJHqXT3wpbEkRU9Yz7lgvddmGdtcGbg/1\nCGZu0jJGkMoppoUo4c3dts3iwqRYmBikUP77wwY2QGmDZw2FvkJCJlKnabIRuGvB\nKwzESIXgKk2016aTP6/dAjEHyo6SeoK8lkIySUvK0fyOVlsiEsCmOpidtnKX/a+5\n0GjB79CJH4ER2lLVZnhePFR/zUOyPxZQQ4naHf7yu/b5jhO0f8fwt+pyFxIXjbEI\ndZliWRkRMtzrHOJIhrmJ2A1J7iOrirbbwillwjjNVUWPf3IJ3M12S9pEewooaeO2\nizNTERcG9HzAacbVRn2Y2SWIyT/18QIDAQABo4GnMIGkMB0GA1UdDgQWBBT/LbE4\n9rWf288N6sJA5BRb6FJIGDB1BgNVHSMEbjBsgBT/LbE49rWf288N6sJA5BRb6FJI\nGKFJpEcwRTELMAkGA1UEBhMCQVUxEzARBgNVBAgTClNvbWUtU3RhdGUxITAfBgNV\nBAoTGEludGVybmV0IFdpZGdpdHMgUHR5IEx0ZIIJAMHAwfXZ5/PWMAwGA1UdEwQF\nMAMBAf8wDQYJKoZIhvcNAQELBQADggEBAHHFwl0tH0quUYZYO0dZYt4R7SJ0pCm2\n2satiyzHl4OnXcHDpekAo7/a09c6Lz6AU83cKy/+x3/djYHXWba7HpEu0dR3ugQP\nMlr4zrhd9xKZ0KZKiYmtJH+ak4OM4L3FbT0owUZPyjLSlhMtJVcoRp5CJsjAMBUG\nSvD8RX+T01wzox/Qb+lnnNnOlaWpqu8eoOenybxKp1a9ULzIVvN/LAcc+14vioFq\n2swRWtmocBAs8QR9n4uvbpiYvS8eYueDCWMM4fvFfBhaDZ3N9IbtySh3SpFdQDhw\nYbjM2rxXiyLGxB4Bol7QTv4zHif7Zt89FReT/NBy4rzaskDJY5L6xmY=\n-----END CERTIFICATE-----\n", - private_key="-----BEGIN RSA PRIVATE KEY-----\nMIIEowIBAAKCAQEAwQHoetcl9+5ikGzV6cMzWtWPJHqXT3wpbEkRU9Yz7lgvddmG\ndtcGbg/1CGZu0jJGkMoppoUo4c3dts3iwqRYmBikUP77wwY2QGmDZw2FvkJCJlKn\nabIRuGvBKwzESIXgKk2016aTP6/dAjEHyo6SeoK8lkIySUvK0fyOVlsiEsCmOpid\ntnKX/a+50GjB79CJH4ER2lLVZnhePFR/zUOyPxZQQ4naHf7yu/b5jhO0f8fwt+py\nFxIXjbEIdZliWRkRMtzrHOJIhrmJ2A1J7iOrirbbwillwjjNVUWPf3IJ3M12S9pE\newooaeO2izNTERcG9HzAacbVRn2Y2SWIyT/18QIDAQABAoIBACbhTYXBZYKmYPCb\nHBR1IBlCQA2nLGf0qRuJNJZg5iEzXows/6tc8YymZkQE7nolapWsQ+upk2y5Xdp/\naxiuprIs9JzkYK8Ox0r+dlwCG1kSW+UAbX0bQ/qUqlsTvU6muVuMP8vZYHxJ3wmb\n+ufRBKztPTQ/rYWaYQcgC0RWI20HTFBMxlTAyNxYNWzX7RKFkGVVyB9RsAtmcc8g\n+j4OdosbfNoJPS0HeIfNpAznDfHKdxDk2Yc1tV6RHBrC1ynyLE9+TaflIAdo2MVv\nKLMLq51GqYKtgJFIlBRPQqKoyXdz3fGvXrTkf/WY9QNq0J1Vk5ERePZ54mN8iZB7\n9lwy/AkCgYEA6FXzosxswaJ2wQLeoYc7ceaweX/SwTvxHgXzRyJIIT0eJWgx13Wo\n/WA3Iziimsjf6qE+SI/8laxPp2A86VMaIt3Z3mJN/CqSVGw8LK2AQst+OwdPyDMu\niacE8lj/IFGC8mwNUAb9CzGU3JpU4PxxGFjS/eMtGeRXCWkK4NE+G08CgYEA1Kp9\nN2JrVlqUz+gAX+LPmE9OEMAS9WQSQsfCHGogIFDGGcNf7+uwBM7GAaSJIP01zcoe\nVAgWdzXCv3FLhsaZoJ6RyLOLay5phbu1iaTr4UNYm5WtYTzMzqh8l1+MFFDl9xDB\nvULuCIIrglM5MeS/qnSg1uMoH2oVPj9TVst/ir8CgYEAxrI7Ws9Zc4Bt70N1As+U\nlySjaEVZCMkqvHJ6TCuVZFfQoE0r0whdLdRLU2PsLFP+q7qaeZQqgBaNSKeVcDYR\n9B+nY/jOmQoPewPVsp/vQTCnE/R81spu0mp0YI6cIheT1Z9zAy322svcc43JaWB7\nmEbeqyLOP4Z4qSOcmghZBSECgYACvR9Xs0DGn+wCsW4vze/2ei77MD4OQvepPIFX\ndFZtlBy5ADcgE9z0cuVB6CiL8DbdK5kwY9pGNr8HUCI03iHkW6Zs+0L0YmihfEVe\nPG19PSzK9CaDdhD9KFZSbLyVFmWfxOt50H7YRTTiPMgjyFpfi5j2q348yVT0tEQS\nfhRqaQKBgAcWPokmJ7EbYQGeMbS7HC8eWO/RyamlnSffdCdSc7ue3zdVJxpAkQ8W\nqu80pEIF6raIQfAf8MXiiZ7auFOSnHQTXUbhCpvDLKi0Mwq3G8Pl07l+2s6dQG6T\nlv6XTQaMyf6n1yjzL+fzDrH3qXMxHMO/b13EePXpDMpY7HQpoLDi\n-----END RSA PRIVATE KEY-----\n", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -632,21 +506,17 @@ async def test_streaming_response_edit_overload_2(self, async_client: AsyncCloud assert cast(Any, response.is_closed) is True @parametrize - async def test_path_params_edit_overload_2(self, async_client: AsyncCloudflare) -> None: + async def test_path_params_edit(self, async_client: AsyncCloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): await async_client.custom_certificates.with_raw_response.edit( custom_certificate_id="023e105f4ecef8ad9ca31a8372d0c353", zone_id="", - certificate="-----BEGIN CERTIFICATE-----\nMIIDtTCCAp2gAwIBAgIJAMHAwfXZ5/PWMA0GCSqGSIb3DQEBCwUAMEUxCzAJBgNV\nBAYTAkFVMRMwEQYDVQQIEwpTb21lLVN0YXRlMSEwHwYDVQQKExhJbnRlcm5ldCBX\naWRnaXRzIFB0eSBMdGQwHhcNMTYwODI0MTY0MzAxWhcNMTYxMTIyMTY0MzAxWjBF\nMQswCQYDVQQGEwJBVTETMBEGA1UECBMKU29tZS1TdGF0ZTEhMB8GA1UEChMYSW50\nZXJuZXQgV2lkZ2l0cyBQdHkgTHRkMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIB\nCgKCAQEAwQHoetcl9+5ikGzV6cMzWtWPJHqXT3wpbEkRU9Yz7lgvddmGdtcGbg/1\nCGZu0jJGkMoppoUo4c3dts3iwqRYmBikUP77wwY2QGmDZw2FvkJCJlKnabIRuGvB\nKwzESIXgKk2016aTP6/dAjEHyo6SeoK8lkIySUvK0fyOVlsiEsCmOpidtnKX/a+5\n0GjB79CJH4ER2lLVZnhePFR/zUOyPxZQQ4naHf7yu/b5jhO0f8fwt+pyFxIXjbEI\ndZliWRkRMtzrHOJIhrmJ2A1J7iOrirbbwillwjjNVUWPf3IJ3M12S9pEewooaeO2\nizNTERcG9HzAacbVRn2Y2SWIyT/18QIDAQABo4GnMIGkMB0GA1UdDgQWBBT/LbE4\n9rWf288N6sJA5BRb6FJIGDB1BgNVHSMEbjBsgBT/LbE49rWf288N6sJA5BRb6FJI\nGKFJpEcwRTELMAkGA1UEBhMCQVUxEzARBgNVBAgTClNvbWUtU3RhdGUxITAfBgNV\nBAoTGEludGVybmV0IFdpZGdpdHMgUHR5IEx0ZIIJAMHAwfXZ5/PWMAwGA1UdEwQF\nMAMBAf8wDQYJKoZIhvcNAQELBQADggEBAHHFwl0tH0quUYZYO0dZYt4R7SJ0pCm2\n2satiyzHl4OnXcHDpekAo7/a09c6Lz6AU83cKy/+x3/djYHXWba7HpEu0dR3ugQP\nMlr4zrhd9xKZ0KZKiYmtJH+ak4OM4L3FbT0owUZPyjLSlhMtJVcoRp5CJsjAMBUG\nSvD8RX+T01wzox/Qb+lnnNnOlaWpqu8eoOenybxKp1a9ULzIVvN/LAcc+14vioFq\n2swRWtmocBAs8QR9n4uvbpiYvS8eYueDCWMM4fvFfBhaDZ3N9IbtySh3SpFdQDhw\nYbjM2rxXiyLGxB4Bol7QTv4zHif7Zt89FReT/NBy4rzaskDJY5L6xmY=\n-----END CERTIFICATE-----\n", - private_key="-----BEGIN RSA PRIVATE KEY-----\nMIIEowIBAAKCAQEAwQHoetcl9+5ikGzV6cMzWtWPJHqXT3wpbEkRU9Yz7lgvddmG\ndtcGbg/1CGZu0jJGkMoppoUo4c3dts3iwqRYmBikUP77wwY2QGmDZw2FvkJCJlKn\nabIRuGvBKwzESIXgKk2016aTP6/dAjEHyo6SeoK8lkIySUvK0fyOVlsiEsCmOpid\ntnKX/a+50GjB79CJH4ER2lLVZnhePFR/zUOyPxZQQ4naHf7yu/b5jhO0f8fwt+py\nFxIXjbEIdZliWRkRMtzrHOJIhrmJ2A1J7iOrirbbwillwjjNVUWPf3IJ3M12S9pE\newooaeO2izNTERcG9HzAacbVRn2Y2SWIyT/18QIDAQABAoIBACbhTYXBZYKmYPCb\nHBR1IBlCQA2nLGf0qRuJNJZg5iEzXows/6tc8YymZkQE7nolapWsQ+upk2y5Xdp/\naxiuprIs9JzkYK8Ox0r+dlwCG1kSW+UAbX0bQ/qUqlsTvU6muVuMP8vZYHxJ3wmb\n+ufRBKztPTQ/rYWaYQcgC0RWI20HTFBMxlTAyNxYNWzX7RKFkGVVyB9RsAtmcc8g\n+j4OdosbfNoJPS0HeIfNpAznDfHKdxDk2Yc1tV6RHBrC1ynyLE9+TaflIAdo2MVv\nKLMLq51GqYKtgJFIlBRPQqKoyXdz3fGvXrTkf/WY9QNq0J1Vk5ERePZ54mN8iZB7\n9lwy/AkCgYEA6FXzosxswaJ2wQLeoYc7ceaweX/SwTvxHgXzRyJIIT0eJWgx13Wo\n/WA3Iziimsjf6qE+SI/8laxPp2A86VMaIt3Z3mJN/CqSVGw8LK2AQst+OwdPyDMu\niacE8lj/IFGC8mwNUAb9CzGU3JpU4PxxGFjS/eMtGeRXCWkK4NE+G08CgYEA1Kp9\nN2JrVlqUz+gAX+LPmE9OEMAS9WQSQsfCHGogIFDGGcNf7+uwBM7GAaSJIP01zcoe\nVAgWdzXCv3FLhsaZoJ6RyLOLay5phbu1iaTr4UNYm5WtYTzMzqh8l1+MFFDl9xDB\nvULuCIIrglM5MeS/qnSg1uMoH2oVPj9TVst/ir8CgYEAxrI7Ws9Zc4Bt70N1As+U\nlySjaEVZCMkqvHJ6TCuVZFfQoE0r0whdLdRLU2PsLFP+q7qaeZQqgBaNSKeVcDYR\n9B+nY/jOmQoPewPVsp/vQTCnE/R81spu0mp0YI6cIheT1Z9zAy322svcc43JaWB7\nmEbeqyLOP4Z4qSOcmghZBSECgYACvR9Xs0DGn+wCsW4vze/2ei77MD4OQvepPIFX\ndFZtlBy5ADcgE9z0cuVB6CiL8DbdK5kwY9pGNr8HUCI03iHkW6Zs+0L0YmihfEVe\nPG19PSzK9CaDdhD9KFZSbLyVFmWfxOt50H7YRTTiPMgjyFpfi5j2q348yVT0tEQS\nfhRqaQKBgAcWPokmJ7EbYQGeMbS7HC8eWO/RyamlnSffdCdSc7ue3zdVJxpAkQ8W\nqu80pEIF6raIQfAf8MXiiZ7auFOSnHQTXUbhCpvDLKi0Mwq3G8Pl07l+2s6dQG6T\nlv6XTQaMyf6n1yjzL+fzDrH3qXMxHMO/b13EePXpDMpY7HQpoLDi\n-----END RSA PRIVATE KEY-----\n", ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `custom_certificate_id` but received ''"): await async_client.custom_certificates.with_raw_response.edit( custom_certificate_id="", zone_id="023e105f4ecef8ad9ca31a8372d0c353", - certificate="-----BEGIN CERTIFICATE-----\nMIIDtTCCAp2gAwIBAgIJAMHAwfXZ5/PWMA0GCSqGSIb3DQEBCwUAMEUxCzAJBgNV\nBAYTAkFVMRMwEQYDVQQIEwpTb21lLVN0YXRlMSEwHwYDVQQKExhJbnRlcm5ldCBX\naWRnaXRzIFB0eSBMdGQwHhcNMTYwODI0MTY0MzAxWhcNMTYxMTIyMTY0MzAxWjBF\nMQswCQYDVQQGEwJBVTETMBEGA1UECBMKU29tZS1TdGF0ZTEhMB8GA1UEChMYSW50\nZXJuZXQgV2lkZ2l0cyBQdHkgTHRkMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIB\nCgKCAQEAwQHoetcl9+5ikGzV6cMzWtWPJHqXT3wpbEkRU9Yz7lgvddmGdtcGbg/1\nCGZu0jJGkMoppoUo4c3dts3iwqRYmBikUP77wwY2QGmDZw2FvkJCJlKnabIRuGvB\nKwzESIXgKk2016aTP6/dAjEHyo6SeoK8lkIySUvK0fyOVlsiEsCmOpidtnKX/a+5\n0GjB79CJH4ER2lLVZnhePFR/zUOyPxZQQ4naHf7yu/b5jhO0f8fwt+pyFxIXjbEI\ndZliWRkRMtzrHOJIhrmJ2A1J7iOrirbbwillwjjNVUWPf3IJ3M12S9pEewooaeO2\nizNTERcG9HzAacbVRn2Y2SWIyT/18QIDAQABo4GnMIGkMB0GA1UdDgQWBBT/LbE4\n9rWf288N6sJA5BRb6FJIGDB1BgNVHSMEbjBsgBT/LbE49rWf288N6sJA5BRb6FJI\nGKFJpEcwRTELMAkGA1UEBhMCQVUxEzARBgNVBAgTClNvbWUtU3RhdGUxITAfBgNV\nBAoTGEludGVybmV0IFdpZGdpdHMgUHR5IEx0ZIIJAMHAwfXZ5/PWMAwGA1UdEwQF\nMAMBAf8wDQYJKoZIhvcNAQELBQADggEBAHHFwl0tH0quUYZYO0dZYt4R7SJ0pCm2\n2satiyzHl4OnXcHDpekAo7/a09c6Lz6AU83cKy/+x3/djYHXWba7HpEu0dR3ugQP\nMlr4zrhd9xKZ0KZKiYmtJH+ak4OM4L3FbT0owUZPyjLSlhMtJVcoRp5CJsjAMBUG\nSvD8RX+T01wzox/Qb+lnnNnOlaWpqu8eoOenybxKp1a9ULzIVvN/LAcc+14vioFq\n2swRWtmocBAs8QR9n4uvbpiYvS8eYueDCWMM4fvFfBhaDZ3N9IbtySh3SpFdQDhw\nYbjM2rxXiyLGxB4Bol7QTv4zHif7Zt89FReT/NBy4rzaskDJY5L6xmY=\n-----END CERTIFICATE-----\n", - private_key="-----BEGIN RSA PRIVATE KEY-----\nMIIEowIBAAKCAQEAwQHoetcl9+5ikGzV6cMzWtWPJHqXT3wpbEkRU9Yz7lgvddmG\ndtcGbg/1CGZu0jJGkMoppoUo4c3dts3iwqRYmBikUP77wwY2QGmDZw2FvkJCJlKn\nabIRuGvBKwzESIXgKk2016aTP6/dAjEHyo6SeoK8lkIySUvK0fyOVlsiEsCmOpid\ntnKX/a+50GjB79CJH4ER2lLVZnhePFR/zUOyPxZQQ4naHf7yu/b5jhO0f8fwt+py\nFxIXjbEIdZliWRkRMtzrHOJIhrmJ2A1J7iOrirbbwillwjjNVUWPf3IJ3M12S9pE\newooaeO2izNTERcG9HzAacbVRn2Y2SWIyT/18QIDAQABAoIBACbhTYXBZYKmYPCb\nHBR1IBlCQA2nLGf0qRuJNJZg5iEzXows/6tc8YymZkQE7nolapWsQ+upk2y5Xdp/\naxiuprIs9JzkYK8Ox0r+dlwCG1kSW+UAbX0bQ/qUqlsTvU6muVuMP8vZYHxJ3wmb\n+ufRBKztPTQ/rYWaYQcgC0RWI20HTFBMxlTAyNxYNWzX7RKFkGVVyB9RsAtmcc8g\n+j4OdosbfNoJPS0HeIfNpAznDfHKdxDk2Yc1tV6RHBrC1ynyLE9+TaflIAdo2MVv\nKLMLq51GqYKtgJFIlBRPQqKoyXdz3fGvXrTkf/WY9QNq0J1Vk5ERePZ54mN8iZB7\n9lwy/AkCgYEA6FXzosxswaJ2wQLeoYc7ceaweX/SwTvxHgXzRyJIIT0eJWgx13Wo\n/WA3Iziimsjf6qE+SI/8laxPp2A86VMaIt3Z3mJN/CqSVGw8LK2AQst+OwdPyDMu\niacE8lj/IFGC8mwNUAb9CzGU3JpU4PxxGFjS/eMtGeRXCWkK4NE+G08CgYEA1Kp9\nN2JrVlqUz+gAX+LPmE9OEMAS9WQSQsfCHGogIFDGGcNf7+uwBM7GAaSJIP01zcoe\nVAgWdzXCv3FLhsaZoJ6RyLOLay5phbu1iaTr4UNYm5WtYTzMzqh8l1+MFFDl9xDB\nvULuCIIrglM5MeS/qnSg1uMoH2oVPj9TVst/ir8CgYEAxrI7Ws9Zc4Bt70N1As+U\nlySjaEVZCMkqvHJ6TCuVZFfQoE0r0whdLdRLU2PsLFP+q7qaeZQqgBaNSKeVcDYR\n9B+nY/jOmQoPewPVsp/vQTCnE/R81spu0mp0YI6cIheT1Z9zAy322svcc43JaWB7\nmEbeqyLOP4Z4qSOcmghZBSECgYACvR9Xs0DGn+wCsW4vze/2ei77MD4OQvepPIFX\ndFZtlBy5ADcgE9z0cuVB6CiL8DbdK5kwY9pGNr8HUCI03iHkW6Zs+0L0YmihfEVe\nPG19PSzK9CaDdhD9KFZSbLyVFmWfxOt50H7YRTTiPMgjyFpfi5j2q348yVT0tEQS\nfhRqaQKBgAcWPokmJ7EbYQGeMbS7HC8eWO/RyamlnSffdCdSc7ue3zdVJxpAkQ8W\nqu80pEIF6raIQfAf8MXiiZ7auFOSnHQTXUbhCpvDLKi0Mwq3G8Pl07l+2s6dQG6T\nlv6XTQaMyf6n1yjzL+fzDrH3qXMxHMO/b13EePXpDMpY7HQpoLDi\n-----END RSA PRIVATE KEY-----\n", ) @parametrize diff --git a/tests/api_resources/test_snippets.py b/tests/api_resources/test_snippets.py index 5f6fb492862..1d68951047f 100644 --- a/tests/api_resources/test_snippets.py +++ b/tests/api_resources/test_snippets.py @@ -133,7 +133,7 @@ def test_method_delete(self, client: Cloudflare) -> None: snippet_name="my_snippet", zone_id="9f1839b6152d298aca64c4e906b6d074", ) - assert_matches_type(str, snippet, path=["response"]) + assert_matches_type(object, snippet, path=["response"]) @pytest.mark.skip(reason="API returns None instead of str for delete operation (Issue #3)") @parametrize @@ -146,7 +146,7 @@ def test_raw_response_delete(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" snippet = response.parse() - assert_matches_type(str, snippet, path=["response"]) + assert_matches_type(object, snippet, path=["response"]) @pytest.mark.skip(reason="API returns None instead of str for delete operation (Issue #3)") @parametrize @@ -159,7 +159,7 @@ def test_streaming_response_delete(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" snippet = response.parse() - assert_matches_type(str, snippet, path=["response"]) + assert_matches_type(object, snippet, path=["response"]) assert cast(Any, response.is_closed) is True @@ -342,7 +342,7 @@ async def test_method_delete(self, async_client: AsyncCloudflare) -> None: snippet_name="my_snippet", zone_id="9f1839b6152d298aca64c4e906b6d074", ) - assert_matches_type(str, snippet, path=["response"]) + assert_matches_type(object, snippet, path=["response"]) @pytest.mark.skip(reason="API returns None instead of str for delete operation (Issue #3)") @parametrize @@ -355,7 +355,7 @@ async def test_raw_response_delete(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" snippet = await response.parse() - assert_matches_type(str, snippet, path=["response"]) + assert_matches_type(object, snippet, path=["response"]) @pytest.mark.skip(reason="API returns None instead of str for delete operation (Issue #3)") @parametrize @@ -368,7 +368,7 @@ async def test_streaming_response_delete(self, async_client: AsyncCloudflare) -> assert response.http_request.headers.get("X-Stainless-Lang") == "python" snippet = await response.parse() - assert_matches_type(str, snippet, path=["response"]) + assert_matches_type(object, snippet, path=["response"]) assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/zero_trust/dlp/entries/test_custom.py b/tests/api_resources/zero_trust/dlp/entries/test_custom.py index 29cf1357284..203e9acb871 100644 --- a/tests/api_resources/zero_trust/dlp/entries/test_custom.py +++ b/tests/api_resources/zero_trust/dlp/entries/test_custom.py @@ -43,6 +43,7 @@ def test_method_create_with_all_params(self, client: Cloudflare) -> None: "regex": "regex", "validation": "luhn", }, + description="description", profile_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", ) assert_matches_type(Optional[CustomCreateResponse], custom, path=["response"]) @@ -111,6 +112,7 @@ def test_method_update_with_all_params(self, client: Cloudflare) -> None: "regex": "regex", "validation": "luhn", }, + description="description", ) assert_matches_type(Optional[CustomUpdateResponse], custom, path=["response"]) @@ -329,6 +331,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncCloudflare "regex": "regex", "validation": "luhn", }, + description="description", profile_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", ) assert_matches_type(Optional[CustomCreateResponse], custom, path=["response"]) @@ -397,6 +400,7 @@ async def test_method_update_with_all_params(self, async_client: AsyncCloudflare "regex": "regex", "validation": "luhn", }, + description="description", ) assert_matches_type(Optional[CustomUpdateResponse], custom, path=["response"]) diff --git a/tests/api_resources/zero_trust/dlp/profiles/test_custom.py b/tests/api_resources/zero_trust/dlp/profiles/test_custom.py index 7ec4a09e699..6c5feaff7fb 100644 --- a/tests/api_resources/zero_trust/dlp/profiles/test_custom.py +++ b/tests/api_resources/zero_trust/dlp/profiles/test_custom.py @@ -50,6 +50,7 @@ def test_method_create_with_all_params(self, client: Cloudflare) -> None: "regex": "regex", "validation": "luhn", }, + "description": "description", } ], ocr_enabled=True, @@ -128,6 +129,7 @@ def test_method_update_with_all_params(self, client: Cloudflare) -> None: "regex": "regex", "validation": "luhn", }, + "description": "description", } ], ocr_enabled=True, @@ -315,6 +317,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncCloudflare "regex": "regex", "validation": "luhn", }, + "description": "description", } ], ocr_enabled=True, @@ -393,6 +396,7 @@ async def test_method_update_with_all_params(self, async_client: AsyncCloudflare "regex": "regex", "validation": "luhn", }, + "description": "description", } ], ocr_enabled=True, diff --git a/tests/api_resources/zero_trust/dlp/test_entries.py b/tests/api_resources/zero_trust/dlp/test_entries.py index 0f64b4372c7..55ef6364827 100644 --- a/tests/api_resources/zero_trust/dlp/test_entries.py +++ b/tests/api_resources/zero_trust/dlp/test_entries.py @@ -43,6 +43,7 @@ def test_method_create_with_all_params(self, client: Cloudflare) -> None: "regex": "regex", "validation": "luhn", }, + description="description", profile_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", ) assert_matches_type(Optional[EntryCreateResponse], entry, path=["response"]) @@ -111,6 +112,7 @@ def test_method_update_with_all_params_overload_1(self, client: Cloudflare) -> N "validation": "luhn", }, type="custom", + description="description", enabled=True, ) assert_matches_type(Optional[EntryUpdateResponse], entry, path=["response"]) @@ -466,6 +468,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncCloudflare "regex": "regex", "validation": "luhn", }, + description="description", profile_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", ) assert_matches_type(Optional[EntryCreateResponse], entry, path=["response"]) @@ -534,6 +537,7 @@ async def test_method_update_with_all_params_overload_1(self, async_client: Asyn "validation": "luhn", }, type="custom", + description="description", enabled=True, ) assert_matches_type(Optional[EntryUpdateResponse], entry, path=["response"]) From 3cbb6a6a5eee10e510bbdc9a8594a5e1218c0154 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 13 Feb 2026 16:10:05 +0000 Subject: [PATCH 002/279] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index cc52949a276..d74890de571 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 2014 openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-30edf614aac6aca8f0f9f32f687e9fad91929509a22e4337b673b905db8b8801.yml openapi_spec_hash: d2f21a869c3b0902e8c8ea72d216170f -config_hash: 9d1829ed664bb3efa8638f98bb32cf46 +config_hash: 3b5a073ea01bcd6be97d48c78c243b9e From 3accc56c43e04292b700ea573d036872a8e9cb7b Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 13 Feb 2026 17:50:52 +0000 Subject: [PATCH 003/279] feat: feat(stainless): TUN-10249 Add WARP Subnet endpoints * feat(stainless): TUN-10249 Add WARP Subnet endpoints --- .stats.yml | 4 +- api.md | 20 + .../zero_trust/networks/subnets/__init__.py | 14 + .../zero_trust/networks/subnets/subnets.py | 32 + .../zero_trust/networks/subnets/warp.py | 609 ++++++++++++++++++ .../zero_trust/networks/subnets/__init__.py | 6 + .../networks/subnets/warp_create_params.py | 27 + .../networks/subnets/warp_create_response.py | 41 ++ .../networks/subnets/warp_delete_response.py | 41 ++ .../networks/subnets/warp_edit_params.py | 27 + .../networks/subnets/warp_edit_response.py | 41 ++ .../networks/subnets/warp_get_response.py | 41 ++ .../zero_trust/networks/subnets/test_warp.py | 455 +++++++++++++ 13 files changed, 1356 insertions(+), 2 deletions(-) create mode 100644 src/cloudflare/resources/zero_trust/networks/subnets/warp.py create mode 100644 src/cloudflare/types/zero_trust/networks/subnets/warp_create_params.py create mode 100644 src/cloudflare/types/zero_trust/networks/subnets/warp_create_response.py create mode 100644 src/cloudflare/types/zero_trust/networks/subnets/warp_delete_response.py create mode 100644 src/cloudflare/types/zero_trust/networks/subnets/warp_edit_params.py create mode 100644 src/cloudflare/types/zero_trust/networks/subnets/warp_edit_response.py create mode 100644 src/cloudflare/types/zero_trust/networks/subnets/warp_get_response.py create mode 100644 tests/api_resources/zero_trust/networks/subnets/test_warp.py diff --git a/.stats.yml b/.stats.yml index d74890de571..a094faf5bde 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ -configured_endpoints: 2014 +configured_endpoints: 2018 openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-30edf614aac6aca8f0f9f32f687e9fad91929509a22e4337b673b905db8b8801.yml openapi_spec_hash: d2f21a869c3b0902e8c8ea72d216170f -config_hash: 3b5a073ea01bcd6be97d48c78c243b9e +config_hash: 7a08b6d7e050d324501d76c833118c84 diff --git a/api.md b/api.md index cc1dcee75b4..0dcaf3e6a94 100644 --- a/api.md +++ b/api.md @@ -7280,6 +7280,26 @@ Methods: - client.zero_trust.networks.subnets.list(\*, account_id, \*\*params) -> SyncV4PagePaginationArray[SubnetListResponse] +#### WARP + +Types: + +```python +from cloudflare.types.zero_trust.networks.subnets import ( + WARPCreateResponse, + WARPDeleteResponse, + WARPEditResponse, + WARPGetResponse, +) +``` + +Methods: + +- client.zero_trust.networks.subnets.warp.create(\*, account_id, \*\*params) -> WARPCreateResponse +- client.zero_trust.networks.subnets.warp.delete(subnet_id, \*, account_id) -> Optional[WARPDeleteResponse] +- client.zero_trust.networks.subnets.warp.edit(subnet_id, \*, account_id, \*\*params) -> WARPEditResponse +- client.zero_trust.networks.subnets.warp.get(subnet_id, \*, account_id) -> WARPGetResponse + #### CloudflareSource Types: diff --git a/src/cloudflare/resources/zero_trust/networks/subnets/__init__.py b/src/cloudflare/resources/zero_trust/networks/subnets/__init__.py index 3af4ace5d3b..3b0a923b401 100644 --- a/src/cloudflare/resources/zero_trust/networks/subnets/__init__.py +++ b/src/cloudflare/resources/zero_trust/networks/subnets/__init__.py @@ -1,5 +1,13 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. +from .warp import ( + WARPResource, + AsyncWARPResource, + WARPResourceWithRawResponse, + AsyncWARPResourceWithRawResponse, + WARPResourceWithStreamingResponse, + AsyncWARPResourceWithStreamingResponse, +) from .subnets import ( SubnetsResource, AsyncSubnetsResource, @@ -18,6 +26,12 @@ ) __all__ = [ + "WARPResource", + "AsyncWARPResource", + "WARPResourceWithRawResponse", + "AsyncWARPResourceWithRawResponse", + "WARPResourceWithStreamingResponse", + "AsyncWARPResourceWithStreamingResponse", "CloudflareSourceResource", "AsyncCloudflareSourceResource", "CloudflareSourceResourceWithRawResponse", diff --git a/src/cloudflare/resources/zero_trust/networks/subnets/subnets.py b/src/cloudflare/resources/zero_trust/networks/subnets/subnets.py index c7d545c3809..d723f449966 100644 --- a/src/cloudflare/resources/zero_trust/networks/subnets/subnets.py +++ b/src/cloudflare/resources/zero_trust/networks/subnets/subnets.py @@ -6,6 +6,14 @@ import httpx +from .warp import ( + WARPResource, + AsyncWARPResource, + WARPResourceWithRawResponse, + AsyncWARPResourceWithRawResponse, + WARPResourceWithStreamingResponse, + AsyncWARPResourceWithStreamingResponse, +) from ....._types import Body, Omit, Query, Headers, NotGiven, omit, not_given from ....._utils import maybe_transform from ....._compat import cached_property @@ -33,6 +41,10 @@ class SubnetsResource(SyncAPIResource): + @cached_property + def warp(self) -> WARPResource: + return WARPResource(self._client) + @cached_property def cloudflare_source(self) -> CloudflareSourceResource: return CloudflareSourceResource(self._client) @@ -150,6 +162,10 @@ def list( class AsyncSubnetsResource(AsyncAPIResource): + @cached_property + def warp(self) -> AsyncWARPResource: + return AsyncWARPResource(self._client) + @cached_property def cloudflare_source(self) -> AsyncCloudflareSourceResource: return AsyncCloudflareSourceResource(self._client) @@ -274,6 +290,10 @@ def __init__(self, subnets: SubnetsResource) -> None: subnets.list, ) + @cached_property + def warp(self) -> WARPResourceWithRawResponse: + return WARPResourceWithRawResponse(self._subnets.warp) + @cached_property def cloudflare_source(self) -> CloudflareSourceResourceWithRawResponse: return CloudflareSourceResourceWithRawResponse(self._subnets.cloudflare_source) @@ -287,6 +307,10 @@ def __init__(self, subnets: AsyncSubnetsResource) -> None: subnets.list, ) + @cached_property + def warp(self) -> AsyncWARPResourceWithRawResponse: + return AsyncWARPResourceWithRawResponse(self._subnets.warp) + @cached_property def cloudflare_source(self) -> AsyncCloudflareSourceResourceWithRawResponse: return AsyncCloudflareSourceResourceWithRawResponse(self._subnets.cloudflare_source) @@ -300,6 +324,10 @@ def __init__(self, subnets: SubnetsResource) -> None: subnets.list, ) + @cached_property + def warp(self) -> WARPResourceWithStreamingResponse: + return WARPResourceWithStreamingResponse(self._subnets.warp) + @cached_property def cloudflare_source(self) -> CloudflareSourceResourceWithStreamingResponse: return CloudflareSourceResourceWithStreamingResponse(self._subnets.cloudflare_source) @@ -313,6 +341,10 @@ def __init__(self, subnets: AsyncSubnetsResource) -> None: subnets.list, ) + @cached_property + def warp(self) -> AsyncWARPResourceWithStreamingResponse: + return AsyncWARPResourceWithStreamingResponse(self._subnets.warp) + @cached_property def cloudflare_source(self) -> AsyncCloudflareSourceResourceWithStreamingResponse: return AsyncCloudflareSourceResourceWithStreamingResponse(self._subnets.cloudflare_source) diff --git a/src/cloudflare/resources/zero_trust/networks/subnets/warp.py b/src/cloudflare/resources/zero_trust/networks/subnets/warp.py new file mode 100644 index 00000000000..79caba44736 --- /dev/null +++ b/src/cloudflare/resources/zero_trust/networks/subnets/warp.py @@ -0,0 +1,609 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Type, Optional, cast + +import httpx + +from ....._types import Body, Omit, Query, Headers, NotGiven, omit, not_given +from ....._utils import maybe_transform, async_maybe_transform +from ....._compat import cached_property +from ....._resource import SyncAPIResource, AsyncAPIResource +from ....._response import ( + to_raw_response_wrapper, + to_streamed_response_wrapper, + async_to_raw_response_wrapper, + async_to_streamed_response_wrapper, +) +from ....._wrappers import ResultWrapper +from ....._base_client import make_request_options +from .....types.zero_trust.networks.subnets import warp_edit_params, warp_create_params +from .....types.zero_trust.networks.subnets.warp_get_response import WARPGetResponse +from .....types.zero_trust.networks.subnets.warp_edit_response import WARPEditResponse +from .....types.zero_trust.networks.subnets.warp_create_response import WARPCreateResponse +from .....types.zero_trust.networks.subnets.warp_delete_response import WARPDeleteResponse + +__all__ = ["WARPResource", "AsyncWARPResource"] + + +class WARPResource(SyncAPIResource): + @cached_property + def with_raw_response(self) -> WARPResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers + """ + return WARPResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> WARPResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/cloudflare/cloudflare-python#with_streaming_response + """ + return WARPResourceWithStreamingResponse(self) + + def create( + self, + *, + account_id: str, + name: str, + network: str, + comment: str | Omit = omit, + is_default_network: 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, + ) -> WARPCreateResponse: + """Create a WARP IP assignment subnet. + + Currently, only IPv4 subnets can be created. + + **Network constraints:** + + - The network must be within one of the following private IP ranges: + - `10.0.0.0/8` (RFC 1918) + - `172.16.0.0/12` (RFC 1918) + - `192.168.0.0/16` (RFC 1918) + - `100.64.0.0/10` (RFC 6598 - CGNAT) + - The subnet must have a prefix length of `/24` or larger (e.g., `/16`, `/20`, + `/24` are valid; `/25`, `/28` are not) + + Args: + account_id: Cloudflare account ID + + name: A user-friendly name for the subnet. + + network: The private IPv4 or IPv6 range defining the subnet, in CIDR notation. + + comment: An optional description of the subnet. + + is_default_network: If `true`, this is the default subnet for the account. There can only be one + default subnet per account. + + 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._post( + f"/accounts/{account_id}/zerotrust/subnets/warp", + body=maybe_transform( + { + "name": name, + "network": network, + "comment": comment, + "is_default_network": is_default_network, + }, + warp_create_params.WARPCreateParams, + ), + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + post_parser=ResultWrapper[WARPCreateResponse]._unwrapper, + ), + cast_to=cast(Type[WARPCreateResponse], ResultWrapper[WARPCreateResponse]), + ) + + def delete( + self, + subnet_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[WARPDeleteResponse]: + """Delete a WARP IP assignment subnet. + + This operation is idempotent - deleting an + already-deleted or non-existent subnet will return success with a null result. + + Args: + account_id: Cloudflare account ID + + subnet_id: The UUID of the subnet. + + 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 subnet_id: + raise ValueError(f"Expected a non-empty value for `subnet_id` but received {subnet_id!r}") + return self._delete( + f"/accounts/{account_id}/zerotrust/subnets/warp/{subnet_id}", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + post_parser=ResultWrapper[Optional[WARPDeleteResponse]]._unwrapper, + ), + cast_to=cast(Type[Optional[WARPDeleteResponse]], ResultWrapper[WARPDeleteResponse]), + ) + + def edit( + self, + subnet_id: str, + *, + account_id: str, + comment: str | Omit = omit, + is_default_network: bool | Omit = omit, + name: str | Omit = omit, + network: str | 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, + ) -> WARPEditResponse: + """ + Updates a WARP IP assignment subnet. + + **Update constraints:** + + - The `network` field cannot be modified for WARP subnets. Only `name`, + `comment`, and `is_default_network` can be updated. + - IPv6 subnets cannot be updated + + Args: + account_id: Cloudflare account ID + + subnet_id: The UUID of the subnet. + + comment: An optional description of the subnet. + + is_default_network: If `true`, this is the default subnet for the account. There can only be one + default subnet per account. + + name: A user-friendly name for the subnet. + + network: The private IPv4 or IPv6 range defining the subnet, in CIDR notation. + + 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 subnet_id: + raise ValueError(f"Expected a non-empty value for `subnet_id` but received {subnet_id!r}") + return self._patch( + f"/accounts/{account_id}/zerotrust/subnets/warp/{subnet_id}", + body=maybe_transform( + { + "comment": comment, + "is_default_network": is_default_network, + "name": name, + "network": network, + }, + warp_edit_params.WARPEditParams, + ), + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + post_parser=ResultWrapper[WARPEditResponse]._unwrapper, + ), + cast_to=cast(Type[WARPEditResponse], ResultWrapper[WARPEditResponse]), + ) + + def get( + self, + subnet_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, + ) -> WARPGetResponse: + """ + Get a WARP IP assignment subnet. + + Args: + account_id: Cloudflare account ID + + subnet_id: The UUID of the subnet. + + 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 subnet_id: + raise ValueError(f"Expected a non-empty value for `subnet_id` but received {subnet_id!r}") + return self._get( + f"/accounts/{account_id}/zerotrust/subnets/warp/{subnet_id}", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + post_parser=ResultWrapper[WARPGetResponse]._unwrapper, + ), + cast_to=cast(Type[WARPGetResponse], ResultWrapper[WARPGetResponse]), + ) + + +class AsyncWARPResource(AsyncAPIResource): + @cached_property + def with_raw_response(self) -> AsyncWARPResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers + """ + return AsyncWARPResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> AsyncWARPResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/cloudflare/cloudflare-python#with_streaming_response + """ + return AsyncWARPResourceWithStreamingResponse(self) + + async def create( + self, + *, + account_id: str, + name: str, + network: str, + comment: str | Omit = omit, + is_default_network: 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, + ) -> WARPCreateResponse: + """Create a WARP IP assignment subnet. + + Currently, only IPv4 subnets can be created. + + **Network constraints:** + + - The network must be within one of the following private IP ranges: + - `10.0.0.0/8` (RFC 1918) + - `172.16.0.0/12` (RFC 1918) + - `192.168.0.0/16` (RFC 1918) + - `100.64.0.0/10` (RFC 6598 - CGNAT) + - The subnet must have a prefix length of `/24` or larger (e.g., `/16`, `/20`, + `/24` are valid; `/25`, `/28` are not) + + Args: + account_id: Cloudflare account ID + + name: A user-friendly name for the subnet. + + network: The private IPv4 or IPv6 range defining the subnet, in CIDR notation. + + comment: An optional description of the subnet. + + is_default_network: If `true`, this is the default subnet for the account. There can only be one + default subnet per account. + + 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 await self._post( + f"/accounts/{account_id}/zerotrust/subnets/warp", + body=await async_maybe_transform( + { + "name": name, + "network": network, + "comment": comment, + "is_default_network": is_default_network, + }, + warp_create_params.WARPCreateParams, + ), + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + post_parser=ResultWrapper[WARPCreateResponse]._unwrapper, + ), + cast_to=cast(Type[WARPCreateResponse], ResultWrapper[WARPCreateResponse]), + ) + + async def delete( + self, + subnet_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[WARPDeleteResponse]: + """Delete a WARP IP assignment subnet. + + This operation is idempotent - deleting an + already-deleted or non-existent subnet will return success with a null result. + + Args: + account_id: Cloudflare account ID + + subnet_id: The UUID of the subnet. + + 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 subnet_id: + raise ValueError(f"Expected a non-empty value for `subnet_id` but received {subnet_id!r}") + return await self._delete( + f"/accounts/{account_id}/zerotrust/subnets/warp/{subnet_id}", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + post_parser=ResultWrapper[Optional[WARPDeleteResponse]]._unwrapper, + ), + cast_to=cast(Type[Optional[WARPDeleteResponse]], ResultWrapper[WARPDeleteResponse]), + ) + + async def edit( + self, + subnet_id: str, + *, + account_id: str, + comment: str | Omit = omit, + is_default_network: bool | Omit = omit, + name: str | Omit = omit, + network: str | 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, + ) -> WARPEditResponse: + """ + Updates a WARP IP assignment subnet. + + **Update constraints:** + + - The `network` field cannot be modified for WARP subnets. Only `name`, + `comment`, and `is_default_network` can be updated. + - IPv6 subnets cannot be updated + + Args: + account_id: Cloudflare account ID + + subnet_id: The UUID of the subnet. + + comment: An optional description of the subnet. + + is_default_network: If `true`, this is the default subnet for the account. There can only be one + default subnet per account. + + name: A user-friendly name for the subnet. + + network: The private IPv4 or IPv6 range defining the subnet, in CIDR notation. + + 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 subnet_id: + raise ValueError(f"Expected a non-empty value for `subnet_id` but received {subnet_id!r}") + return await self._patch( + f"/accounts/{account_id}/zerotrust/subnets/warp/{subnet_id}", + body=await async_maybe_transform( + { + "comment": comment, + "is_default_network": is_default_network, + "name": name, + "network": network, + }, + warp_edit_params.WARPEditParams, + ), + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + post_parser=ResultWrapper[WARPEditResponse]._unwrapper, + ), + cast_to=cast(Type[WARPEditResponse], ResultWrapper[WARPEditResponse]), + ) + + async def get( + self, + subnet_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, + ) -> WARPGetResponse: + """ + Get a WARP IP assignment subnet. + + Args: + account_id: Cloudflare account ID + + subnet_id: The UUID of the subnet. + + 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 subnet_id: + raise ValueError(f"Expected a non-empty value for `subnet_id` but received {subnet_id!r}") + return await self._get( + f"/accounts/{account_id}/zerotrust/subnets/warp/{subnet_id}", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + post_parser=ResultWrapper[WARPGetResponse]._unwrapper, + ), + cast_to=cast(Type[WARPGetResponse], ResultWrapper[WARPGetResponse]), + ) + + +class WARPResourceWithRawResponse: + def __init__(self, warp: WARPResource) -> None: + self._warp = warp + + self.create = to_raw_response_wrapper( + warp.create, + ) + self.delete = to_raw_response_wrapper( + warp.delete, + ) + self.edit = to_raw_response_wrapper( + warp.edit, + ) + self.get = to_raw_response_wrapper( + warp.get, + ) + + +class AsyncWARPResourceWithRawResponse: + def __init__(self, warp: AsyncWARPResource) -> None: + self._warp = warp + + self.create = async_to_raw_response_wrapper( + warp.create, + ) + self.delete = async_to_raw_response_wrapper( + warp.delete, + ) + self.edit = async_to_raw_response_wrapper( + warp.edit, + ) + self.get = async_to_raw_response_wrapper( + warp.get, + ) + + +class WARPResourceWithStreamingResponse: + def __init__(self, warp: WARPResource) -> None: + self._warp = warp + + self.create = to_streamed_response_wrapper( + warp.create, + ) + self.delete = to_streamed_response_wrapper( + warp.delete, + ) + self.edit = to_streamed_response_wrapper( + warp.edit, + ) + self.get = to_streamed_response_wrapper( + warp.get, + ) + + +class AsyncWARPResourceWithStreamingResponse: + def __init__(self, warp: AsyncWARPResource) -> None: + self._warp = warp + + self.create = async_to_streamed_response_wrapper( + warp.create, + ) + self.delete = async_to_streamed_response_wrapper( + warp.delete, + ) + self.edit = async_to_streamed_response_wrapper( + warp.edit, + ) + self.get = async_to_streamed_response_wrapper( + warp.get, + ) diff --git a/src/cloudflare/types/zero_trust/networks/subnets/__init__.py b/src/cloudflare/types/zero_trust/networks/subnets/__init__.py index afa04bcaada..5c47375b355 100644 --- a/src/cloudflare/types/zero_trust/networks/subnets/__init__.py +++ b/src/cloudflare/types/zero_trust/networks/subnets/__init__.py @@ -2,5 +2,11 @@ from __future__ import annotations +from .warp_edit_params import WARPEditParams as WARPEditParams +from .warp_get_response import WARPGetResponse as WARPGetResponse +from .warp_create_params import WARPCreateParams as WARPCreateParams +from .warp_edit_response import WARPEditResponse as WARPEditResponse +from .warp_create_response import WARPCreateResponse as WARPCreateResponse +from .warp_delete_response import WARPDeleteResponse as WARPDeleteResponse from .cloudflare_source_update_params import CloudflareSourceUpdateParams as CloudflareSourceUpdateParams from .cloudflare_source_update_response import CloudflareSourceUpdateResponse as CloudflareSourceUpdateResponse diff --git a/src/cloudflare/types/zero_trust/networks/subnets/warp_create_params.py b/src/cloudflare/types/zero_trust/networks/subnets/warp_create_params.py new file mode 100644 index 00000000000..e9ea45f0951 --- /dev/null +++ b/src/cloudflare/types/zero_trust/networks/subnets/warp_create_params.py @@ -0,0 +1,27 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +__all__ = ["WARPCreateParams"] + + +class WARPCreateParams(TypedDict, total=False): + account_id: Required[str] + """Cloudflare account ID""" + + name: Required[str] + """A user-friendly name for the subnet.""" + + network: Required[str] + """The private IPv4 or IPv6 range defining the subnet, in CIDR notation.""" + + comment: str + """An optional description of the subnet.""" + + is_default_network: bool + """If `true`, this is the default subnet for the account. + + There can only be one default subnet per account. + """ diff --git a/src/cloudflare/types/zero_trust/networks/subnets/warp_create_response.py b/src/cloudflare/types/zero_trust/networks/subnets/warp_create_response.py new file mode 100644 index 00000000000..c4ae8abfb42 --- /dev/null +++ b/src/cloudflare/types/zero_trust/networks/subnets/warp_create_response.py @@ -0,0 +1,41 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional +from datetime import datetime +from typing_extensions import Literal + +from ....._models import BaseModel + +__all__ = ["WARPCreateResponse"] + + +class WARPCreateResponse(BaseModel): + id: Optional[str] = None + """The UUID of the subnet.""" + + comment: Optional[str] = None + """An optional description of the subnet.""" + + created_at: Optional[datetime] = None + """Timestamp of when the resource was created.""" + + deleted_at: Optional[datetime] = None + """Timestamp of when the resource was deleted. + + If `null`, the resource has not been deleted. + """ + + is_default_network: Optional[bool] = None + """If `true`, this is the default subnet for the account. + + There can only be one default subnet per account. + """ + + name: Optional[str] = None + """A user-friendly name for the subnet.""" + + network: Optional[str] = None + """The private IPv4 or IPv6 range defining the subnet, in CIDR notation.""" + + subnet_type: Optional[Literal["cloudflare_source", "warp"]] = None + """The type of subnet.""" diff --git a/src/cloudflare/types/zero_trust/networks/subnets/warp_delete_response.py b/src/cloudflare/types/zero_trust/networks/subnets/warp_delete_response.py new file mode 100644 index 00000000000..675377f381c --- /dev/null +++ b/src/cloudflare/types/zero_trust/networks/subnets/warp_delete_response.py @@ -0,0 +1,41 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional +from datetime import datetime +from typing_extensions import Literal + +from ....._models import BaseModel + +__all__ = ["WARPDeleteResponse"] + + +class WARPDeleteResponse(BaseModel): + id: Optional[str] = None + """The UUID of the subnet.""" + + comment: Optional[str] = None + """An optional description of the subnet.""" + + created_at: Optional[datetime] = None + """Timestamp of when the resource was created.""" + + deleted_at: Optional[datetime] = None + """Timestamp of when the resource was deleted. + + If `null`, the resource has not been deleted. + """ + + is_default_network: Optional[bool] = None + """If `true`, this is the default subnet for the account. + + There can only be one default subnet per account. + """ + + name: Optional[str] = None + """A user-friendly name for the subnet.""" + + network: Optional[str] = None + """The private IPv4 or IPv6 range defining the subnet, in CIDR notation.""" + + subnet_type: Optional[Literal["cloudflare_source", "warp"]] = None + """The type of subnet.""" diff --git a/src/cloudflare/types/zero_trust/networks/subnets/warp_edit_params.py b/src/cloudflare/types/zero_trust/networks/subnets/warp_edit_params.py new file mode 100644 index 00000000000..d38b538fda5 --- /dev/null +++ b/src/cloudflare/types/zero_trust/networks/subnets/warp_edit_params.py @@ -0,0 +1,27 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +__all__ = ["WARPEditParams"] + + +class WARPEditParams(TypedDict, total=False): + account_id: Required[str] + """Cloudflare account ID""" + + comment: str + """An optional description of the subnet.""" + + is_default_network: bool + """If `true`, this is the default subnet for the account. + + There can only be one default subnet per account. + """ + + name: str + """A user-friendly name for the subnet.""" + + network: str + """The private IPv4 or IPv6 range defining the subnet, in CIDR notation.""" diff --git a/src/cloudflare/types/zero_trust/networks/subnets/warp_edit_response.py b/src/cloudflare/types/zero_trust/networks/subnets/warp_edit_response.py new file mode 100644 index 00000000000..b976b41f832 --- /dev/null +++ b/src/cloudflare/types/zero_trust/networks/subnets/warp_edit_response.py @@ -0,0 +1,41 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional +from datetime import datetime +from typing_extensions import Literal + +from ....._models import BaseModel + +__all__ = ["WARPEditResponse"] + + +class WARPEditResponse(BaseModel): + id: Optional[str] = None + """The UUID of the subnet.""" + + comment: Optional[str] = None + """An optional description of the subnet.""" + + created_at: Optional[datetime] = None + """Timestamp of when the resource was created.""" + + deleted_at: Optional[datetime] = None + """Timestamp of when the resource was deleted. + + If `null`, the resource has not been deleted. + """ + + is_default_network: Optional[bool] = None + """If `true`, this is the default subnet for the account. + + There can only be one default subnet per account. + """ + + name: Optional[str] = None + """A user-friendly name for the subnet.""" + + network: Optional[str] = None + """The private IPv4 or IPv6 range defining the subnet, in CIDR notation.""" + + subnet_type: Optional[Literal["cloudflare_source", "warp"]] = None + """The type of subnet.""" diff --git a/src/cloudflare/types/zero_trust/networks/subnets/warp_get_response.py b/src/cloudflare/types/zero_trust/networks/subnets/warp_get_response.py new file mode 100644 index 00000000000..efaafd465a5 --- /dev/null +++ b/src/cloudflare/types/zero_trust/networks/subnets/warp_get_response.py @@ -0,0 +1,41 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional +from datetime import datetime +from typing_extensions import Literal + +from ....._models import BaseModel + +__all__ = ["WARPGetResponse"] + + +class WARPGetResponse(BaseModel): + id: Optional[str] = None + """The UUID of the subnet.""" + + comment: Optional[str] = None + """An optional description of the subnet.""" + + created_at: Optional[datetime] = None + """Timestamp of when the resource was created.""" + + deleted_at: Optional[datetime] = None + """Timestamp of when the resource was deleted. + + If `null`, the resource has not been deleted. + """ + + is_default_network: Optional[bool] = None + """If `true`, this is the default subnet for the account. + + There can only be one default subnet per account. + """ + + name: Optional[str] = None + """A user-friendly name for the subnet.""" + + network: Optional[str] = None + """The private IPv4 or IPv6 range defining the subnet, in CIDR notation.""" + + subnet_type: Optional[Literal["cloudflare_source", "warp"]] = None + """The type of subnet.""" diff --git a/tests/api_resources/zero_trust/networks/subnets/test_warp.py b/tests/api_resources/zero_trust/networks/subnets/test_warp.py new file mode 100644 index 00000000000..b016142f108 --- /dev/null +++ b/tests/api_resources/zero_trust/networks/subnets/test_warp.py @@ -0,0 +1,455 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +import os +from typing import Any, Optional, cast + +import pytest + +from cloudflare import Cloudflare, AsyncCloudflare +from tests.utils import assert_matches_type +from cloudflare.types.zero_trust.networks.subnets import ( + WARPGetResponse, + WARPEditResponse, + WARPCreateResponse, + WARPDeleteResponse, +) + +base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") + + +class TestWARP: + parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) + + @parametrize + def test_method_create(self, client: Cloudflare) -> None: + warp = client.zero_trust.networks.subnets.warp.create( + account_id="699d98642c564d2e855e9661899b7252", + name="IPv4 Cloudflare Source IPs", + network="100.64.0.0/12", + ) + assert_matches_type(WARPCreateResponse, warp, path=["response"]) + + @parametrize + def test_method_create_with_all_params(self, client: Cloudflare) -> None: + warp = client.zero_trust.networks.subnets.warp.create( + account_id="699d98642c564d2e855e9661899b7252", + name="IPv4 Cloudflare Source IPs", + network="100.64.0.0/12", + comment="example comment", + is_default_network=True, + ) + assert_matches_type(WARPCreateResponse, warp, path=["response"]) + + @parametrize + def test_raw_response_create(self, client: Cloudflare) -> None: + response = client.zero_trust.networks.subnets.warp.with_raw_response.create( + account_id="699d98642c564d2e855e9661899b7252", + name="IPv4 Cloudflare Source IPs", + network="100.64.0.0/12", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + warp = response.parse() + assert_matches_type(WARPCreateResponse, warp, path=["response"]) + + @parametrize + def test_streaming_response_create(self, client: Cloudflare) -> None: + with client.zero_trust.networks.subnets.warp.with_streaming_response.create( + account_id="699d98642c564d2e855e9661899b7252", + name="IPv4 Cloudflare Source IPs", + network="100.64.0.0/12", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + warp = response.parse() + assert_matches_type(WARPCreateResponse, warp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_create(self, client: Cloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + client.zero_trust.networks.subnets.warp.with_raw_response.create( + account_id="", + name="IPv4 Cloudflare Source IPs", + network="100.64.0.0/12", + ) + + @parametrize + def test_method_delete(self, client: Cloudflare) -> None: + warp = client.zero_trust.networks.subnets.warp.delete( + subnet_id="f70ff985-a4ef-4643-bbbc-4a0ed4fc8415", + account_id="699d98642c564d2e855e9661899b7252", + ) + assert_matches_type(Optional[WARPDeleteResponse], warp, path=["response"]) + + @parametrize + def test_raw_response_delete(self, client: Cloudflare) -> None: + response = client.zero_trust.networks.subnets.warp.with_raw_response.delete( + subnet_id="f70ff985-a4ef-4643-bbbc-4a0ed4fc8415", + account_id="699d98642c564d2e855e9661899b7252", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + warp = response.parse() + assert_matches_type(Optional[WARPDeleteResponse], warp, path=["response"]) + + @parametrize + def test_streaming_response_delete(self, client: Cloudflare) -> None: + with client.zero_trust.networks.subnets.warp.with_streaming_response.delete( + subnet_id="f70ff985-a4ef-4643-bbbc-4a0ed4fc8415", + account_id="699d98642c564d2e855e9661899b7252", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + warp = response.parse() + assert_matches_type(Optional[WARPDeleteResponse], warp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_delete(self, client: Cloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + client.zero_trust.networks.subnets.warp.with_raw_response.delete( + subnet_id="f70ff985-a4ef-4643-bbbc-4a0ed4fc8415", + account_id="", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `subnet_id` but received ''"): + client.zero_trust.networks.subnets.warp.with_raw_response.delete( + subnet_id="", + account_id="699d98642c564d2e855e9661899b7252", + ) + + @parametrize + def test_method_edit(self, client: Cloudflare) -> None: + warp = client.zero_trust.networks.subnets.warp.edit( + subnet_id="f70ff985-a4ef-4643-bbbc-4a0ed4fc8415", + account_id="699d98642c564d2e855e9661899b7252", + ) + assert_matches_type(WARPEditResponse, warp, path=["response"]) + + @parametrize + def test_method_edit_with_all_params(self, client: Cloudflare) -> None: + warp = client.zero_trust.networks.subnets.warp.edit( + subnet_id="f70ff985-a4ef-4643-bbbc-4a0ed4fc8415", + account_id="699d98642c564d2e855e9661899b7252", + comment="example comment", + is_default_network=True, + name="IPv4 Cloudflare Source IPs", + network="100.64.0.0/12", + ) + assert_matches_type(WARPEditResponse, warp, path=["response"]) + + @parametrize + def test_raw_response_edit(self, client: Cloudflare) -> None: + response = client.zero_trust.networks.subnets.warp.with_raw_response.edit( + subnet_id="f70ff985-a4ef-4643-bbbc-4a0ed4fc8415", + account_id="699d98642c564d2e855e9661899b7252", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + warp = response.parse() + assert_matches_type(WARPEditResponse, warp, path=["response"]) + + @parametrize + def test_streaming_response_edit(self, client: Cloudflare) -> None: + with client.zero_trust.networks.subnets.warp.with_streaming_response.edit( + subnet_id="f70ff985-a4ef-4643-bbbc-4a0ed4fc8415", + account_id="699d98642c564d2e855e9661899b7252", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + warp = response.parse() + assert_matches_type(WARPEditResponse, warp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_edit(self, client: Cloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + client.zero_trust.networks.subnets.warp.with_raw_response.edit( + subnet_id="f70ff985-a4ef-4643-bbbc-4a0ed4fc8415", + account_id="", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `subnet_id` but received ''"): + client.zero_trust.networks.subnets.warp.with_raw_response.edit( + subnet_id="", + account_id="699d98642c564d2e855e9661899b7252", + ) + + @parametrize + def test_method_get(self, client: Cloudflare) -> None: + warp = client.zero_trust.networks.subnets.warp.get( + subnet_id="f70ff985-a4ef-4643-bbbc-4a0ed4fc8415", + account_id="699d98642c564d2e855e9661899b7252", + ) + assert_matches_type(WARPGetResponse, warp, path=["response"]) + + @parametrize + def test_raw_response_get(self, client: Cloudflare) -> None: + response = client.zero_trust.networks.subnets.warp.with_raw_response.get( + subnet_id="f70ff985-a4ef-4643-bbbc-4a0ed4fc8415", + account_id="699d98642c564d2e855e9661899b7252", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + warp = response.parse() + assert_matches_type(WARPGetResponse, warp, path=["response"]) + + @parametrize + def test_streaming_response_get(self, client: Cloudflare) -> None: + with client.zero_trust.networks.subnets.warp.with_streaming_response.get( + subnet_id="f70ff985-a4ef-4643-bbbc-4a0ed4fc8415", + account_id="699d98642c564d2e855e9661899b7252", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + warp = response.parse() + assert_matches_type(WARPGetResponse, warp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_get(self, client: Cloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + client.zero_trust.networks.subnets.warp.with_raw_response.get( + subnet_id="f70ff985-a4ef-4643-bbbc-4a0ed4fc8415", + account_id="", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `subnet_id` but received ''"): + client.zero_trust.networks.subnets.warp.with_raw_response.get( + subnet_id="", + account_id="699d98642c564d2e855e9661899b7252", + ) + + +class TestAsyncWARP: + parametrize = pytest.mark.parametrize( + "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"] + ) + + @parametrize + async def test_method_create(self, async_client: AsyncCloudflare) -> None: + warp = await async_client.zero_trust.networks.subnets.warp.create( + account_id="699d98642c564d2e855e9661899b7252", + name="IPv4 Cloudflare Source IPs", + network="100.64.0.0/12", + ) + assert_matches_type(WARPCreateResponse, warp, path=["response"]) + + @parametrize + async def test_method_create_with_all_params(self, async_client: AsyncCloudflare) -> None: + warp = await async_client.zero_trust.networks.subnets.warp.create( + account_id="699d98642c564d2e855e9661899b7252", + name="IPv4 Cloudflare Source IPs", + network="100.64.0.0/12", + comment="example comment", + is_default_network=True, + ) + assert_matches_type(WARPCreateResponse, warp, path=["response"]) + + @parametrize + async def test_raw_response_create(self, async_client: AsyncCloudflare) -> None: + response = await async_client.zero_trust.networks.subnets.warp.with_raw_response.create( + account_id="699d98642c564d2e855e9661899b7252", + name="IPv4 Cloudflare Source IPs", + network="100.64.0.0/12", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + warp = await response.parse() + assert_matches_type(WARPCreateResponse, warp, path=["response"]) + + @parametrize + async def test_streaming_response_create(self, async_client: AsyncCloudflare) -> None: + async with async_client.zero_trust.networks.subnets.warp.with_streaming_response.create( + account_id="699d98642c564d2e855e9661899b7252", + name="IPv4 Cloudflare Source IPs", + network="100.64.0.0/12", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + warp = await response.parse() + assert_matches_type(WARPCreateResponse, warp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_create(self, async_client: AsyncCloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + await async_client.zero_trust.networks.subnets.warp.with_raw_response.create( + account_id="", + name="IPv4 Cloudflare Source IPs", + network="100.64.0.0/12", + ) + + @parametrize + async def test_method_delete(self, async_client: AsyncCloudflare) -> None: + warp = await async_client.zero_trust.networks.subnets.warp.delete( + subnet_id="f70ff985-a4ef-4643-bbbc-4a0ed4fc8415", + account_id="699d98642c564d2e855e9661899b7252", + ) + assert_matches_type(Optional[WARPDeleteResponse], warp, path=["response"]) + + @parametrize + async def test_raw_response_delete(self, async_client: AsyncCloudflare) -> None: + response = await async_client.zero_trust.networks.subnets.warp.with_raw_response.delete( + subnet_id="f70ff985-a4ef-4643-bbbc-4a0ed4fc8415", + account_id="699d98642c564d2e855e9661899b7252", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + warp = await response.parse() + assert_matches_type(Optional[WARPDeleteResponse], warp, path=["response"]) + + @parametrize + async def test_streaming_response_delete(self, async_client: AsyncCloudflare) -> None: + async with async_client.zero_trust.networks.subnets.warp.with_streaming_response.delete( + subnet_id="f70ff985-a4ef-4643-bbbc-4a0ed4fc8415", + account_id="699d98642c564d2e855e9661899b7252", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + warp = await response.parse() + assert_matches_type(Optional[WARPDeleteResponse], warp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_delete(self, async_client: AsyncCloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + await async_client.zero_trust.networks.subnets.warp.with_raw_response.delete( + subnet_id="f70ff985-a4ef-4643-bbbc-4a0ed4fc8415", + account_id="", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `subnet_id` but received ''"): + await async_client.zero_trust.networks.subnets.warp.with_raw_response.delete( + subnet_id="", + account_id="699d98642c564d2e855e9661899b7252", + ) + + @parametrize + async def test_method_edit(self, async_client: AsyncCloudflare) -> None: + warp = await async_client.zero_trust.networks.subnets.warp.edit( + subnet_id="f70ff985-a4ef-4643-bbbc-4a0ed4fc8415", + account_id="699d98642c564d2e855e9661899b7252", + ) + assert_matches_type(WARPEditResponse, warp, path=["response"]) + + @parametrize + async def test_method_edit_with_all_params(self, async_client: AsyncCloudflare) -> None: + warp = await async_client.zero_trust.networks.subnets.warp.edit( + subnet_id="f70ff985-a4ef-4643-bbbc-4a0ed4fc8415", + account_id="699d98642c564d2e855e9661899b7252", + comment="example comment", + is_default_network=True, + name="IPv4 Cloudflare Source IPs", + network="100.64.0.0/12", + ) + assert_matches_type(WARPEditResponse, warp, path=["response"]) + + @parametrize + async def test_raw_response_edit(self, async_client: AsyncCloudflare) -> None: + response = await async_client.zero_trust.networks.subnets.warp.with_raw_response.edit( + subnet_id="f70ff985-a4ef-4643-bbbc-4a0ed4fc8415", + account_id="699d98642c564d2e855e9661899b7252", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + warp = await response.parse() + assert_matches_type(WARPEditResponse, warp, path=["response"]) + + @parametrize + async def test_streaming_response_edit(self, async_client: AsyncCloudflare) -> None: + async with async_client.zero_trust.networks.subnets.warp.with_streaming_response.edit( + subnet_id="f70ff985-a4ef-4643-bbbc-4a0ed4fc8415", + account_id="699d98642c564d2e855e9661899b7252", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + warp = await response.parse() + assert_matches_type(WARPEditResponse, warp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_edit(self, async_client: AsyncCloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + await async_client.zero_trust.networks.subnets.warp.with_raw_response.edit( + subnet_id="f70ff985-a4ef-4643-bbbc-4a0ed4fc8415", + account_id="", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `subnet_id` but received ''"): + await async_client.zero_trust.networks.subnets.warp.with_raw_response.edit( + subnet_id="", + account_id="699d98642c564d2e855e9661899b7252", + ) + + @parametrize + async def test_method_get(self, async_client: AsyncCloudflare) -> None: + warp = await async_client.zero_trust.networks.subnets.warp.get( + subnet_id="f70ff985-a4ef-4643-bbbc-4a0ed4fc8415", + account_id="699d98642c564d2e855e9661899b7252", + ) + assert_matches_type(WARPGetResponse, warp, path=["response"]) + + @parametrize + async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: + response = await async_client.zero_trust.networks.subnets.warp.with_raw_response.get( + subnet_id="f70ff985-a4ef-4643-bbbc-4a0ed4fc8415", + account_id="699d98642c564d2e855e9661899b7252", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + warp = await response.parse() + assert_matches_type(WARPGetResponse, warp, path=["response"]) + + @parametrize + async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> None: + async with async_client.zero_trust.networks.subnets.warp.with_streaming_response.get( + subnet_id="f70ff985-a4ef-4643-bbbc-4a0ed4fc8415", + account_id="699d98642c564d2e855e9661899b7252", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + warp = await response.parse() + assert_matches_type(WARPGetResponse, warp, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_get(self, async_client: AsyncCloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + await async_client.zero_trust.networks.subnets.warp.with_raw_response.get( + subnet_id="f70ff985-a4ef-4643-bbbc-4a0ed4fc8415", + account_id="", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `subnet_id` but received ''"): + await async_client.zero_trust.networks.subnets.warp.with_raw_response.get( + subnet_id="", + account_id="699d98642c564d2e855e9661899b7252", + ) From e531924080c7d5d184a0734932f08ee59b5d085f Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 13 Feb 2026 21:07:16 +0000 Subject: [PATCH 004/279] chore(api): update composite API spec --- .stats.yml | 4 +- api.md | 2 +- .../certificate_packs/certificate_packs.py | 48 ++++++++++++++++--- .../types/ssl/certificate_pack_list_params.py | 9 ++++ .../ssl/test_certificate_packs.py | 34 +++++++++---- 5 files changed, 78 insertions(+), 19 deletions(-) diff --git a/.stats.yml b/.stats.yml index a094faf5bde..1e656e89387 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 2018 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-30edf614aac6aca8f0f9f32f687e9fad91929509a22e4337b673b905db8b8801.yml -openapi_spec_hash: d2f21a869c3b0902e8c8ea72d216170f +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-10defb5420be5866f186c4f619ade68fc4b3a4ba8e85e011ed1f17b23057cc73.yml +openapi_spec_hash: ef8d4f06b158c74fb347806a6748eed7 config_hash: 7a08b6d7e050d324501d76c833118c84 diff --git a/api.md b/api.md index 0dcaf3e6a94..c2d31bcbff4 100644 --- a/api.md +++ b/api.md @@ -791,7 +791,7 @@ from cloudflare.types.ssl import ( Methods: - client.ssl.certificate_packs.create(\*, zone_id, \*\*params) -> Optional[CertificatePackCreateResponse] -- client.ssl.certificate_packs.list(\*, zone_id, \*\*params) -> SyncSinglePage[CertificatePackListResponse] +- client.ssl.certificate_packs.list(\*, zone_id, \*\*params) -> SyncV4PagePaginationArray[CertificatePackListResponse] - client.ssl.certificate_packs.delete(certificate_pack_id, \*, zone_id) -> Optional[CertificatePackDeleteResponse] - client.ssl.certificate_packs.edit(certificate_pack_id, \*, zone_id, \*\*params) -> Optional[CertificatePackEditResponse] - client.ssl.certificate_packs.get(certificate_pack_id, \*, zone_id) -> Optional[CertificatePackGetResponse] diff --git a/src/cloudflare/resources/ssl/certificate_packs/certificate_packs.py b/src/cloudflare/resources/ssl/certificate_packs/certificate_packs.py index 2dc361a85e7..773b8ed172d 100644 --- a/src/cloudflare/resources/ssl/certificate_packs/certificate_packs.py +++ b/src/cloudflare/resources/ssl/certificate_packs/certificate_packs.py @@ -27,7 +27,7 @@ ) from ...._wrappers import ResultWrapper from ....types.ssl import certificate_pack_edit_params, certificate_pack_list_params, certificate_pack_create_params -from ....pagination import SyncSinglePage, AsyncSinglePage +from ....pagination import SyncV4PagePaginationArray, AsyncV4PagePaginationArray from ...._base_client import AsyncPaginator, make_request_options from ....types.ssl.host import Host from ....types.ssl.certificate_pack_get_response import CertificatePackGetResponse @@ -139,6 +139,9 @@ def list( self, *, zone_id: str, + deploy: Literal["staging", "production"] | Omit = omit, + page: float | Omit = omit, + per_page: float | Omit = omit, status: Literal["all"] | 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. @@ -146,13 +149,19 @@ def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, - ) -> SyncSinglePage[CertificatePackListResponse]: + ) -> SyncV4PagePaginationArray[CertificatePackListResponse]: """ For a given zone, list all active certificate packs. Args: zone_id: Identifier. + deploy: Specify the deployment environment for the certificate packs. + + page: Page number of paginated results. + + per_page: Number of certificate packs per page. + status: Include Certificate Packs of all statuses, not just active ones. extra_headers: Send extra headers @@ -167,13 +176,21 @@ def list( raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") return self._get_api_list( f"/zones/{zone_id}/ssl/certificate_packs", - page=SyncSinglePage[CertificatePackListResponse], + page=SyncV4PagePaginationArray[CertificatePackListResponse], options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout, - query=maybe_transform({"status": status}, certificate_pack_list_params.CertificatePackListParams), + query=maybe_transform( + { + "deploy": deploy, + "page": page, + "per_page": per_page, + "status": status, + }, + certificate_pack_list_params.CertificatePackListParams, + ), ), model=CertificatePackListResponse, ) @@ -426,6 +443,9 @@ def list( self, *, zone_id: str, + deploy: Literal["staging", "production"] | Omit = omit, + page: float | Omit = omit, + per_page: float | Omit = omit, status: Literal["all"] | 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. @@ -433,13 +453,19 @@ def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, - ) -> AsyncPaginator[CertificatePackListResponse, AsyncSinglePage[CertificatePackListResponse]]: + ) -> AsyncPaginator[CertificatePackListResponse, AsyncV4PagePaginationArray[CertificatePackListResponse]]: """ For a given zone, list all active certificate packs. Args: zone_id: Identifier. + deploy: Specify the deployment environment for the certificate packs. + + page: Page number of paginated results. + + per_page: Number of certificate packs per page. + status: Include Certificate Packs of all statuses, not just active ones. extra_headers: Send extra headers @@ -454,13 +480,21 @@ def list( raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") return self._get_api_list( f"/zones/{zone_id}/ssl/certificate_packs", - page=AsyncSinglePage[CertificatePackListResponse], + page=AsyncV4PagePaginationArray[CertificatePackListResponse], options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout, - query=maybe_transform({"status": status}, certificate_pack_list_params.CertificatePackListParams), + query=maybe_transform( + { + "deploy": deploy, + "page": page, + "per_page": per_page, + "status": status, + }, + certificate_pack_list_params.CertificatePackListParams, + ), ), model=CertificatePackListResponse, ) diff --git a/src/cloudflare/types/ssl/certificate_pack_list_params.py b/src/cloudflare/types/ssl/certificate_pack_list_params.py index 60e4ed1a7ec..b231888d073 100644 --- a/src/cloudflare/types/ssl/certificate_pack_list_params.py +++ b/src/cloudflare/types/ssl/certificate_pack_list_params.py @@ -11,5 +11,14 @@ class CertificatePackListParams(TypedDict, total=False): zone_id: Required[str] """Identifier.""" + deploy: Literal["staging", "production"] + """Specify the deployment environment for the certificate packs.""" + + page: float + """Page number of paginated results.""" + + per_page: float + """Number of certificate packs per page.""" + status: Literal["all"] """Include Certificate Packs of all statuses, not just active ones.""" diff --git a/tests/api_resources/ssl/test_certificate_packs.py b/tests/api_resources/ssl/test_certificate_packs.py index f2ace2cbb53..dc0fbee435e 100644 --- a/tests/api_resources/ssl/test_certificate_packs.py +++ b/tests/api_resources/ssl/test_certificate_packs.py @@ -16,7 +16,7 @@ CertificatePackCreateResponse, CertificatePackDeleteResponse, ) -from cloudflare.pagination import SyncSinglePage, AsyncSinglePage +from cloudflare.pagination import SyncV4PagePaginationArray, AsyncV4PagePaginationArray base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") @@ -100,15 +100,18 @@ def test_method_list(self, client: Cloudflare) -> None: certificate_pack = client.ssl.certificate_packs.list( zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(SyncSinglePage[CertificatePackListResponse], certificate_pack, path=["response"]) + assert_matches_type(SyncV4PagePaginationArray[CertificatePackListResponse], certificate_pack, path=["response"]) @parametrize def test_method_list_with_all_params(self, client: Cloudflare) -> None: certificate_pack = client.ssl.certificate_packs.list( zone_id="023e105f4ecef8ad9ca31a8372d0c353", + deploy="staging", + page=1, + per_page=5, status="all", ) - assert_matches_type(SyncSinglePage[CertificatePackListResponse], certificate_pack, path=["response"]) + assert_matches_type(SyncV4PagePaginationArray[CertificatePackListResponse], certificate_pack, path=["response"]) @parametrize def test_raw_response_list(self, client: Cloudflare) -> None: @@ -119,7 +122,7 @@ def test_raw_response_list(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" certificate_pack = response.parse() - assert_matches_type(SyncSinglePage[CertificatePackListResponse], certificate_pack, path=["response"]) + assert_matches_type(SyncV4PagePaginationArray[CertificatePackListResponse], certificate_pack, path=["response"]) @parametrize def test_streaming_response_list(self, client: Cloudflare) -> None: @@ -130,7 +133,9 @@ def test_streaming_response_list(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" certificate_pack = response.parse() - assert_matches_type(SyncSinglePage[CertificatePackListResponse], certificate_pack, path=["response"]) + assert_matches_type( + SyncV4PagePaginationArray[CertificatePackListResponse], certificate_pack, path=["response"] + ) assert cast(Any, response.is_closed) is True @@ -376,15 +381,22 @@ async def test_method_list(self, async_client: AsyncCloudflare) -> None: certificate_pack = await async_client.ssl.certificate_packs.list( zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(AsyncSinglePage[CertificatePackListResponse], certificate_pack, path=["response"]) + assert_matches_type( + AsyncV4PagePaginationArray[CertificatePackListResponse], certificate_pack, path=["response"] + ) @parametrize async def test_method_list_with_all_params(self, async_client: AsyncCloudflare) -> None: certificate_pack = await async_client.ssl.certificate_packs.list( zone_id="023e105f4ecef8ad9ca31a8372d0c353", + deploy="staging", + page=1, + per_page=5, status="all", ) - assert_matches_type(AsyncSinglePage[CertificatePackListResponse], certificate_pack, path=["response"]) + assert_matches_type( + AsyncV4PagePaginationArray[CertificatePackListResponse], certificate_pack, path=["response"] + ) @parametrize async def test_raw_response_list(self, async_client: AsyncCloudflare) -> None: @@ -395,7 +407,9 @@ async def test_raw_response_list(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" certificate_pack = await response.parse() - assert_matches_type(AsyncSinglePage[CertificatePackListResponse], certificate_pack, path=["response"]) + assert_matches_type( + AsyncV4PagePaginationArray[CertificatePackListResponse], certificate_pack, path=["response"] + ) @parametrize async def test_streaming_response_list(self, async_client: AsyncCloudflare) -> None: @@ -406,7 +420,9 @@ async def test_streaming_response_list(self, async_client: AsyncCloudflare) -> N assert response.http_request.headers.get("X-Stainless-Lang") == "python" certificate_pack = await response.parse() - assert_matches_type(AsyncSinglePage[CertificatePackListResponse], certificate_pack, path=["response"]) + assert_matches_type( + AsyncV4PagePaginationArray[CertificatePackListResponse], certificate_pack, path=["response"] + ) assert cast(Any, response.is_closed) is True From bb37db8de6c2e0b289b0a7eb60fcabf178f43a50 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 13 Feb 2026 21:09:50 +0000 Subject: [PATCH 005/279] chore(api): update composite API spec --- .stats.yml | 4 +- .../hostname_certificate_create_response.py | 3 ++ .../hostname_certificate_delete_response.py | 3 ++ .../hostname_certificate_get_response.py | 3 ++ .../hostname_certificate_list_response.py | 49 ++++++++++++------- tests/api_resources/test_mtls_certificates.py | 24 ++++----- 6 files changed, 55 insertions(+), 31 deletions(-) diff --git a/.stats.yml b/.stats.yml index 1e656e89387..a92419a091d 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 2018 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-10defb5420be5866f186c4f619ade68fc4b3a4ba8e85e011ed1f17b23057cc73.yml -openapi_spec_hash: ef8d4f06b158c74fb347806a6748eed7 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-96674708a71bdccf65c32cfde3668102802ddcbd0013e0e6bea5fe5a15e96c2d.yml +openapi_spec_hash: 07913982475b8cd9b10e68db898a4047 config_hash: 7a08b6d7e050d324501d76c833118c84 diff --git a/src/cloudflare/types/origin_tls_client_auth/hostname_certificate_create_response.py b/src/cloudflare/types/origin_tls_client_auth/hostname_certificate_create_response.py index 744c6a1aca8..05418a9ac38 100644 --- a/src/cloudflare/types/origin_tls_client_auth/hostname_certificate_create_response.py +++ b/src/cloudflare/types/origin_tls_client_auth/hostname_certificate_create_response.py @@ -41,5 +41,8 @@ class HostnameCertificateCreateResponse(BaseModel): ] = None """Status of the certificate or the association.""" + updated_at: Optional[datetime] = None + """The time when the certificate was updated.""" + uploaded_on: Optional[datetime] = None """The time when the certificate was uploaded.""" diff --git a/src/cloudflare/types/origin_tls_client_auth/hostname_certificate_delete_response.py b/src/cloudflare/types/origin_tls_client_auth/hostname_certificate_delete_response.py index ad892bfce77..73c14b1cc2f 100644 --- a/src/cloudflare/types/origin_tls_client_auth/hostname_certificate_delete_response.py +++ b/src/cloudflare/types/origin_tls_client_auth/hostname_certificate_delete_response.py @@ -41,5 +41,8 @@ class HostnameCertificateDeleteResponse(BaseModel): ] = None """Status of the certificate or the association.""" + updated_at: Optional[datetime] = None + """The time when the certificate was updated.""" + uploaded_on: Optional[datetime] = None """The time when the certificate was uploaded.""" diff --git a/src/cloudflare/types/origin_tls_client_auth/hostname_certificate_get_response.py b/src/cloudflare/types/origin_tls_client_auth/hostname_certificate_get_response.py index 4983b50f43c..e7b14c895dd 100644 --- a/src/cloudflare/types/origin_tls_client_auth/hostname_certificate_get_response.py +++ b/src/cloudflare/types/origin_tls_client_auth/hostname_certificate_get_response.py @@ -41,5 +41,8 @@ class HostnameCertificateGetResponse(BaseModel): ] = None """Status of the certificate or the association.""" + updated_at: Optional[datetime] = None + """The time when the certificate was updated.""" + uploaded_on: Optional[datetime] = None """The time when the certificate was uploaded.""" diff --git a/src/cloudflare/types/origin_tls_client_auth/hostname_certificate_list_response.py b/src/cloudflare/types/origin_tls_client_auth/hostname_certificate_list_response.py index cda22f1e1b3..df4a76953d9 100644 --- a/src/cloudflare/types/origin_tls_client_auth/hostname_certificate_list_response.py +++ b/src/cloudflare/types/origin_tls_client_auth/hostname_certificate_list_response.py @@ -1,33 +1,48 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. from typing import Optional +from datetime import datetime +from typing_extensions import Literal -from .authenticated_origin_pull import AuthenticatedOriginPull +from ..._models import BaseModel __all__ = ["HostnameCertificateListResponse"] -class HostnameCertificateListResponse(AuthenticatedOriginPull): +class HostnameCertificateListResponse(BaseModel): id: Optional[str] = None """Identifier.""" - cert_id: Optional[str] = None # type: ignore - """Identifier.""" - - certificate: Optional[str] = None # type: ignore + certificate: Optional[str] = None """The hostname certificate.""" - enabled: Optional[bool] = None # type: ignore - """Indicates whether hostname-level authenticated origin pulls is enabled. + expires_on: Optional[datetime] = None + """The date when the certificate expires.""" + + issuer: Optional[str] = None + """The certificate authority that issued the certificate.""" + + serial_number: Optional[str] = None + """The serial number on the uploaded certificate.""" + + signature: Optional[str] = None + """The type of hash used for the certificate.""" - A null value voids the association. - """ + status: Optional[ + Literal[ + "initializing", + "pending_deployment", + "pending_deletion", + "active", + "deleted", + "deployment_timed_out", + "deletion_timed_out", + ] + ] = None + """Status of the certificate or the association.""" - hostname: Optional[str] = None # type: ignore - """ - The hostname on the origin for which the client certificate uploaded will be - used. - """ + updated_at: Optional[datetime] = None + """The time when the certificate was updated.""" - private_key: Optional[str] = None - """The hostname certificate's private key.""" + uploaded_on: Optional[datetime] = None + """The time when the certificate was uploaded.""" diff --git a/tests/api_resources/test_mtls_certificates.py b/tests/api_resources/test_mtls_certificates.py index e5ad0553d13..2635fb2c31d 100644 --- a/tests/api_resources/test_mtls_certificates.py +++ b/tests/api_resources/test_mtls_certificates.py @@ -26,7 +26,7 @@ def test_method_create(self, client: Cloudflare) -> None: mtls_certificate = client.mtls_certificates.create( account_id="023e105f4ecef8ad9ca31a8372d0c353", ca=True, - certificates="-----BEGIN CERTIFICATE-----\nMIIDmDCCAoCgAwIBAgIUKTOAZNjcXVZRj4oQt0SHsl1c1vMwDQYJKoZIhvcNAQELBQAwUTELMAkGA1UEBhMCVVMxFjAUBgNVBAgMDVNhbiBGcmFuY2lzY28xEzARBgNVBAcMCkNhbGlmb3JuaWExFTATBgNVBAoMDEV4YW1wbGUgSW5jLjAgFw0yMjExMjIxNjU5NDdaGA8yMTIyMTAyOTE2NTk0N1owUTELMAkGA1UEBhMCVVMxFjAUBgNVBAgMDVNhbiBGcmFuY2lzY28xEzARBgNVBAcMCkNhbGlmb3JuaWExFTATBgNVBAoMDEV4YW1wbGUgSW5jLjCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAMRcORwgJFTdcG/2GKI+cFYiOBNDKjCZUXEOvXWY42BkH9wxiMT869CO+enA1w5pIrXow6kCM1sQspHHaVmJUlotEMJxyoLFfA/8Kt1EKFyobOjuZs2SwyVyJ2sStvQuUQEosULZCNGZEqoH5g6zhMPxaxm7ZLrrsDZ9maNGVqo7EWLWHrZ57Q/5MtTrbxQL+eXjUmJ9K3kS+3uEwMdqR6Z3BluU1ivanpPc1CN2GNhdO0/hSY4YkGEnuLsqJyDd3cIiB1MxuCBJ4ZaqOd2viV1WcP3oU3dxVPm4MWyfYIldMWB14FahScxLhWdRnM9YZ/i9IFcLypXsuz7DjrJPtPUCAwEAAaNmMGQwHQYDVR0OBBYEFP5JzLUawNF+c3AXsYTEWHh7z2czMB8GA1UdIwQYMBaAFP5JzLUawNF+c3AXsYTEWHh7z2czMA4GA1UdDwEB/wQEAwIBBjASBgNVHRMBAf8ECDAGAQH/AgEBMA0GCSqGSIb3DQEBCwUAA4IBAQBc+Be7NDhpE09y7hLPZGRPl1cSKBw4RI0XIv6rlbSTFs5EebpTGjhx/whNxwEZhB9HZ7111Oa1YlT8xkI9DshB78mjAHCKBAJ76moK8tkG0aqdYpJ4ZcJTVBB7l98Rvgc7zfTii7WemTy72deBbSeiEtXavm4EF0mWjHhQ5Nxpnp00Bqn5g1x8CyTDypgmugnep+xG+iFzNmTdsz7WI9T/7kDMXqB7M/FPWBORyS98OJqNDswCLF8bIZYwUBEe+bRHFomoShMzaC3tvim7WCb16noDkSTMlfKO4pnvKhpcVdSgwcruATV7y+W+Lvmz2OT/Gui4JhqeoTewsxndhDDE\n-----END CERTIFICATE-----", + certificates="-----BEGIN CERTIFICATE-----\nMIIDmDCCAoCgAwIBAgIUKTOAZNjcXVZRj4oQt0SHsl1c1vMwDQYJKoZIhvcNAQEL\nBQAwUTELMAkGA1UEBhMCVVMxFjAUBgNVBAgMDVNhbiBGcmFuY2lzY28xEzARBgNV\nBAcMCkNhbGlmb3JuaWExFTATBgNVBAoMDEV4YW1wbGUgSW5jLjAgFw0yMjExMjIx\nNjU5NDdaGA8yMTIyMTAyOTE2NTk0N1owUTELMAkGA1UEBhMCVVMxFjAUBgNVBAgM\nDVNhbiBGcmFuY2lzY28xEzARBgNVBAcMCkNhbGlmb3JuaWExFTATBgNVBAoMDEV4\nYW1wbGUgSW5jLjCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAMRcORwg\nJFTdcG/2GKI+cFYiOBNDKjCZUXEOvXWY42BkH9wxiMT869CO+enA1w5pIrXow6kC\nM1sQspHHaVmJUlotEMJxyoLFfA/8Kt1EKFyobOjuZs2SwyVyJ2sStvQuUQEosULZ\nCNGZEqoH5g6zhMPxaxm7ZLrrsDZ9maNGVqo7EWLWHrZ57Q/5MtTrbxQL+eXjUmJ9\nK3kS+3uEwMdqR6Z3BluU1ivanpPc1CN2GNhdO0/hSY4YkGEnuLsqJyDd3cIiB1Mx\nuCBJ4ZaqOd2viV1WcP3oU3dxVPm4MWyfYIldMWB14FahScxLhWdRnM9YZ/i9IFcL\nypXsuz7DjrJPtPUCAwEAAaNmMGQwHQYDVR0OBBYEFP5JzLUawNF+c3AXsYTEWHh7\nz2czMB8GA1UdIwQYMBaAFP5JzLUawNF+c3AXsYTEWHh7z2czMA4GA1UdDwEB/wQE\nAwIBBjASBgNVHRMBAf8ECDAGAQH/AgEBMA0GCSqGSIb3DQEBCwUAA4IBAQBc+Be7\nNDhpE09y7hLPZGRPl1cSKBw4RI0XIv6rlbSTFs5EebpTGjhx/whNxwEZhB9HZ711\n1Oa1YlT8xkI9DshB78mjAHCKBAJ76moK8tkG0aqdYpJ4ZcJTVBB7l98Rvgc7zfTi\ni7WemTy72deBbSeiEtXavm4EF0mWjHhQ5Nxpnp00Bqn5g1x8CyTDypgmugnep+xG\n+iFzNmTdsz7WI9T/7kDMXqB7M/FPWBORyS98OJqNDswCLF8bIZYwUBEe+bRHFomo\nShMzaC3tvim7WCb16noDkSTMlfKO4pnvKhpcVdSgwcruATV7y+W+Lvmz2OT/Gui4\nJhqeoTewsxndhDDE\n-----END CERTIFICATE-----", ) assert_matches_type(Optional[MTLSCertificateCreateResponse], mtls_certificate, path=["response"]) @@ -35,9 +35,9 @@ def test_method_create_with_all_params(self, client: Cloudflare) -> None: mtls_certificate = client.mtls_certificates.create( account_id="023e105f4ecef8ad9ca31a8372d0c353", ca=True, - certificates="-----BEGIN CERTIFICATE-----\nMIIDmDCCAoCgAwIBAgIUKTOAZNjcXVZRj4oQt0SHsl1c1vMwDQYJKoZIhvcNAQELBQAwUTELMAkGA1UEBhMCVVMxFjAUBgNVBAgMDVNhbiBGcmFuY2lzY28xEzARBgNVBAcMCkNhbGlmb3JuaWExFTATBgNVBAoMDEV4YW1wbGUgSW5jLjAgFw0yMjExMjIxNjU5NDdaGA8yMTIyMTAyOTE2NTk0N1owUTELMAkGA1UEBhMCVVMxFjAUBgNVBAgMDVNhbiBGcmFuY2lzY28xEzARBgNVBAcMCkNhbGlmb3JuaWExFTATBgNVBAoMDEV4YW1wbGUgSW5jLjCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAMRcORwgJFTdcG/2GKI+cFYiOBNDKjCZUXEOvXWY42BkH9wxiMT869CO+enA1w5pIrXow6kCM1sQspHHaVmJUlotEMJxyoLFfA/8Kt1EKFyobOjuZs2SwyVyJ2sStvQuUQEosULZCNGZEqoH5g6zhMPxaxm7ZLrrsDZ9maNGVqo7EWLWHrZ57Q/5MtTrbxQL+eXjUmJ9K3kS+3uEwMdqR6Z3BluU1ivanpPc1CN2GNhdO0/hSY4YkGEnuLsqJyDd3cIiB1MxuCBJ4ZaqOd2viV1WcP3oU3dxVPm4MWyfYIldMWB14FahScxLhWdRnM9YZ/i9IFcLypXsuz7DjrJPtPUCAwEAAaNmMGQwHQYDVR0OBBYEFP5JzLUawNF+c3AXsYTEWHh7z2czMB8GA1UdIwQYMBaAFP5JzLUawNF+c3AXsYTEWHh7z2czMA4GA1UdDwEB/wQEAwIBBjASBgNVHRMBAf8ECDAGAQH/AgEBMA0GCSqGSIb3DQEBCwUAA4IBAQBc+Be7NDhpE09y7hLPZGRPl1cSKBw4RI0XIv6rlbSTFs5EebpTGjhx/whNxwEZhB9HZ7111Oa1YlT8xkI9DshB78mjAHCKBAJ76moK8tkG0aqdYpJ4ZcJTVBB7l98Rvgc7zfTii7WemTy72deBbSeiEtXavm4EF0mWjHhQ5Nxpnp00Bqn5g1x8CyTDypgmugnep+xG+iFzNmTdsz7WI9T/7kDMXqB7M/FPWBORyS98OJqNDswCLF8bIZYwUBEe+bRHFomoShMzaC3tvim7WCb16noDkSTMlfKO4pnvKhpcVdSgwcruATV7y+W+Lvmz2OT/Gui4JhqeoTewsxndhDDE\n-----END CERTIFICATE-----", + certificates="-----BEGIN CERTIFICATE-----\nMIIDmDCCAoCgAwIBAgIUKTOAZNjcXVZRj4oQt0SHsl1c1vMwDQYJKoZIhvcNAQEL\nBQAwUTELMAkGA1UEBhMCVVMxFjAUBgNVBAgMDVNhbiBGcmFuY2lzY28xEzARBgNV\nBAcMCkNhbGlmb3JuaWExFTATBgNVBAoMDEV4YW1wbGUgSW5jLjAgFw0yMjExMjIx\nNjU5NDdaGA8yMTIyMTAyOTE2NTk0N1owUTELMAkGA1UEBhMCVVMxFjAUBgNVBAgM\nDVNhbiBGcmFuY2lzY28xEzARBgNVBAcMCkNhbGlmb3JuaWExFTATBgNVBAoMDEV4\nYW1wbGUgSW5jLjCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAMRcORwg\nJFTdcG/2GKI+cFYiOBNDKjCZUXEOvXWY42BkH9wxiMT869CO+enA1w5pIrXow6kC\nM1sQspHHaVmJUlotEMJxyoLFfA/8Kt1EKFyobOjuZs2SwyVyJ2sStvQuUQEosULZ\nCNGZEqoH5g6zhMPxaxm7ZLrrsDZ9maNGVqo7EWLWHrZ57Q/5MtTrbxQL+eXjUmJ9\nK3kS+3uEwMdqR6Z3BluU1ivanpPc1CN2GNhdO0/hSY4YkGEnuLsqJyDd3cIiB1Mx\nuCBJ4ZaqOd2viV1WcP3oU3dxVPm4MWyfYIldMWB14FahScxLhWdRnM9YZ/i9IFcL\nypXsuz7DjrJPtPUCAwEAAaNmMGQwHQYDVR0OBBYEFP5JzLUawNF+c3AXsYTEWHh7\nz2czMB8GA1UdIwQYMBaAFP5JzLUawNF+c3AXsYTEWHh7z2czMA4GA1UdDwEB/wQE\nAwIBBjASBgNVHRMBAf8ECDAGAQH/AgEBMA0GCSqGSIb3DQEBCwUAA4IBAQBc+Be7\nNDhpE09y7hLPZGRPl1cSKBw4RI0XIv6rlbSTFs5EebpTGjhx/whNxwEZhB9HZ711\n1Oa1YlT8xkI9DshB78mjAHCKBAJ76moK8tkG0aqdYpJ4ZcJTVBB7l98Rvgc7zfTi\ni7WemTy72deBbSeiEtXavm4EF0mWjHhQ5Nxpnp00Bqn5g1x8CyTDypgmugnep+xG\n+iFzNmTdsz7WI9T/7kDMXqB7M/FPWBORyS98OJqNDswCLF8bIZYwUBEe+bRHFomo\nShMzaC3tvim7WCb16noDkSTMlfKO4pnvKhpcVdSgwcruATV7y+W+Lvmz2OT/Gui4\nJhqeoTewsxndhDDE\n-----END CERTIFICATE-----", name="example_ca_cert", - private_key="-----BEGIN PRIVATE KEY-----\nMIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQDEXDkcICRU3XBv9hiiPnBWIjgTQyowmVFxDr11mONgZB/cMYjE/OvQjvnpwNcOaSK16MOpAjNbELKRx2lZiVJaLRDCccqCxXwP/CrdRChcqGzo7mbNksMlcidrErb0LlEBKLFC2QjRmRKqB+YOs4TD8WsZu2S667A2fZmjRlaqOxFi1h62ee0P+TLU628UC/nl41JifSt5Evt7hMDHakemdwZblNYr2p6T3NQjdhjYXTtP4UmOGJBhJ7i7Kicg3d3CIgdTMbggSeGWqjndr4ldVnD96FN3cVT5uDFsn2CJXTFgdeBWoUnMS4VnUZzPWGf4vSBXC8qV7Ls+w46yT7T1AgMBAAECggEAQZnp/oqCeNPOR6l5S2L+1tfx0gWjZ78hJVteUpZ0iHSK7F6kKeOxyOird7vUXV0kmo+cJq+0hp0Ke4eam640FCpwKfYoSQ4/R3vgujGWJnaihCN5tv5sMet0XeJPuz5qE7ALoKCvwI6aXLHs20aAeZIDTQJ9QbGSGnJVzOWn+JDTidIgZpN57RpXfSAwnJPTQK/PN8i5z108hsaDOdEgGmxYZ7kYqMqzX20KXmth58LDfPixs5JGtS60iiKC/wOcGzkB2/AdTSojR76oEU77cANP/3zO25NG//whUdYlW0t0d7PgXxIeJe+xgYnamDQJx3qonVyt4H77ha0ObRAj9QKBgQDicZr+VTwFMnELP3a+FXGnjehRiuS1i7MXGKxNweCD+dFlML0FplSQS8Ro2n+d8lu8BBXGx0qm6VXu8Rhn7TAUL6q+PCgfarzxfIhacb/TZCqfieIHsMlVBfhV5HCXnk+kis0tuC/PRArcWTwDHJUJXkBhvkUsNswvQzavDPI7KwKBgQDd/WgLkj7A3X5fgIHZH/GbDSBiXwzKb+rF4ZCT2XFgG/OAW7vapfcX/w+v+5lBLyrocmOAS3PGGAhM5T3HLnUCQfnK4qgps1Lqibkc9Tmnsn60LanUjuUMsYv/zSw70tozbzhJ0pioEpWfRxRZBztO2Rr8Ntm7h6Fk701EXGNAXwKBgQCD1xsjy2J3sCerIdcz0u5qXLAPkeuZW+34m4/ucdwTWwc0gEz9lhsULFj9p4G351zLuiEnq+7mAWLcDJlmIO3mQt6JhiLiL9Y0T4pgBmxmWqKKYtAsJB0EmMY+1BNN44mBRqMxZFTJu1cLdhT/xstrOeoIPqytknYNanfTMZlzIwKBgHrLXe5oq0XMP8dcMneEcAUwsaU4pr6kQd3L9EmUkl5zl7J9C+DaxWAEuwzBw/iGutlxzRB+rD/7szu14wJ29EqXbDGKRzMp+se5/yfBjm7xEZ1hVPw7PwBShfqt57X/4Ktq7lwHnmH6RcGhc+P7WBc5iO/S94YAdIp8xOT3pf9JAoGAE0QkqJUY+5Mgr+fBO0VNV72ZoPveGpW+De59uhKAOnu1zljQCUtk59m6+DXfm0tNYKtawa5n8iN71Zh+s62xXSt3pYi1Y5CCCmv8Y4BhwIcPwXKk3zEvLgSHVTpC0bayA9aSO4bbZgVXa5w+Z0w/vvfp9DWo1IS3EnQRrz6WMYA=\n-----END PRIVATE KEY-----", + private_key="-----BEGIN PRIVATE KEY-----\nMIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQDEXDkcICRU3XBv\n9hiiPnBWIjgTQyowmVFxDr11mONgZB/cMYjE/OvQjvnpwNcOaSK16MOpAjNbELKR\nx2lZiVJaLRDCccqCxXwP/CrdRChcqGzo7mbNksMlcidrErb0LlEBKLFC2QjRmRKq\nB+YOs4TD8WsZu2S667A2fZmjRlaqOxFi1h62ee0P+TLU628UC/nl41JifSt5Evt7\nhMDHakemdwZblNYr2p6T3NQjdhjYXTtP4UmOGJBhJ7i7Kicg3d3CIgdTMbggSeGW\nqjndr4ldVnD96FN3cVT5uDFsn2CJXTFgdeBWoUnMS4VnUZzPWGf4vSBXC8qV7Ls+\nw46yT7T1AgMBAAECggEAQZnp/oqCeNPOR6l5S2L+1tfx0gWjZ78hJVteUpZ0iHSK\n7F6kKeOxyOird7vUXV0kmo+cJq+0hp0Ke4eam640FCpwKfYoSQ4/R3vgujGWJnai\nhCN5tv5sMet0XeJPuz5qE7ALoKCvwI6aXLHs20aAeZIDTQJ9QbGSGnJVzOWn+JDT\nidIgZpN57RpXfSAwnJPTQK/PN8i5z108hsaDOdEgGmxYZ7kYqMqzX20KXmth58LD\nfPixs5JGtS60iiKC/wOcGzkB2/AdTSojR76oEU77cANP/3zO25NG//whUdYlW0t0\nd7PgXxIeJe+xgYnamDQJx3qonVyt4H77ha0ObRAj9QKBgQDicZr+VTwFMnELP3a+\nFXGnjehRiuS1i7MXGKxNweCD+dFlML0FplSQS8Ro2n+d8lu8BBXGx0qm6VXu8Rhn\n7TAUL6q+PCgfarzxfIhacb/TZCqfieIHsMlVBfhV5HCXnk+kis0tuC/PRArcWTwD\nHJUJXkBhvkUsNswvQzavDPI7KwKBgQDd/WgLkj7A3X5fgIHZH/GbDSBiXwzKb+rF\n4ZCT2XFgG/OAW7vapfcX/w+v+5lBLyrocmOAS3PGGAhM5T3HLnUCQfnK4qgps1Lq\nibkc9Tmnsn60LanUjuUMsYv/zSw70tozbzhJ0pioEpWfRxRZBztO2Rr8Ntm7h6Fk\n701EXGNAXwKBgQCD1xsjy2J3sCerIdcz0u5qXLAPkeuZW+34m4/ucdwTWwc0gEz9\nlhsULFj9p4G351zLuiEnq+7mAWLcDJlmIO3mQt6JhiLiL9Y0T4pgBmxmWqKKYtAs\nJB0EmMY+1BNN44mBRqMxZFTJu1cLdhT/xstrOeoIPqytknYNanfTMZlzIwKBgHrL\nXe5oq0XMP8dcMneEcAUwsaU4pr6kQd3L9EmUkl5zl7J9C+DaxWAEuwzBw/iGutlx\nzRB+rD/7szu14wJ29EqXbDGKRzMp+se5/yfBjm7xEZ1hVPw7PwBShfqt57X/4Ktq\n7lwHnmH6RcGhc+P7WBc5iO/S94YAdIp8xOT3pf9JAoGAE0QkqJUY+5Mgr+fBO0VN\nV72ZoPveGpW+De59uhKAOnu1zljQCUtk59m6+DXfm0tNYKtawa5n8iN71Zh+s62x\nXSt3pYi1Y5CCCmv8Y4BhwIcPwXKk3zEvLgSHVTpC0bayA9aSO4bbZgVXa5w+Z0w/\nvvfp9DWo1IS3EnQRrz6WMYA=\n-----END PRIVATE KEY-----", ) assert_matches_type(Optional[MTLSCertificateCreateResponse], mtls_certificate, path=["response"]) @@ -46,7 +46,7 @@ def test_raw_response_create(self, client: Cloudflare) -> None: response = client.mtls_certificates.with_raw_response.create( account_id="023e105f4ecef8ad9ca31a8372d0c353", ca=True, - certificates="-----BEGIN CERTIFICATE-----\nMIIDmDCCAoCgAwIBAgIUKTOAZNjcXVZRj4oQt0SHsl1c1vMwDQYJKoZIhvcNAQELBQAwUTELMAkGA1UEBhMCVVMxFjAUBgNVBAgMDVNhbiBGcmFuY2lzY28xEzARBgNVBAcMCkNhbGlmb3JuaWExFTATBgNVBAoMDEV4YW1wbGUgSW5jLjAgFw0yMjExMjIxNjU5NDdaGA8yMTIyMTAyOTE2NTk0N1owUTELMAkGA1UEBhMCVVMxFjAUBgNVBAgMDVNhbiBGcmFuY2lzY28xEzARBgNVBAcMCkNhbGlmb3JuaWExFTATBgNVBAoMDEV4YW1wbGUgSW5jLjCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAMRcORwgJFTdcG/2GKI+cFYiOBNDKjCZUXEOvXWY42BkH9wxiMT869CO+enA1w5pIrXow6kCM1sQspHHaVmJUlotEMJxyoLFfA/8Kt1EKFyobOjuZs2SwyVyJ2sStvQuUQEosULZCNGZEqoH5g6zhMPxaxm7ZLrrsDZ9maNGVqo7EWLWHrZ57Q/5MtTrbxQL+eXjUmJ9K3kS+3uEwMdqR6Z3BluU1ivanpPc1CN2GNhdO0/hSY4YkGEnuLsqJyDd3cIiB1MxuCBJ4ZaqOd2viV1WcP3oU3dxVPm4MWyfYIldMWB14FahScxLhWdRnM9YZ/i9IFcLypXsuz7DjrJPtPUCAwEAAaNmMGQwHQYDVR0OBBYEFP5JzLUawNF+c3AXsYTEWHh7z2czMB8GA1UdIwQYMBaAFP5JzLUawNF+c3AXsYTEWHh7z2czMA4GA1UdDwEB/wQEAwIBBjASBgNVHRMBAf8ECDAGAQH/AgEBMA0GCSqGSIb3DQEBCwUAA4IBAQBc+Be7NDhpE09y7hLPZGRPl1cSKBw4RI0XIv6rlbSTFs5EebpTGjhx/whNxwEZhB9HZ7111Oa1YlT8xkI9DshB78mjAHCKBAJ76moK8tkG0aqdYpJ4ZcJTVBB7l98Rvgc7zfTii7WemTy72deBbSeiEtXavm4EF0mWjHhQ5Nxpnp00Bqn5g1x8CyTDypgmugnep+xG+iFzNmTdsz7WI9T/7kDMXqB7M/FPWBORyS98OJqNDswCLF8bIZYwUBEe+bRHFomoShMzaC3tvim7WCb16noDkSTMlfKO4pnvKhpcVdSgwcruATV7y+W+Lvmz2OT/Gui4JhqeoTewsxndhDDE\n-----END CERTIFICATE-----", + certificates="-----BEGIN CERTIFICATE-----\nMIIDmDCCAoCgAwIBAgIUKTOAZNjcXVZRj4oQt0SHsl1c1vMwDQYJKoZIhvcNAQEL\nBQAwUTELMAkGA1UEBhMCVVMxFjAUBgNVBAgMDVNhbiBGcmFuY2lzY28xEzARBgNV\nBAcMCkNhbGlmb3JuaWExFTATBgNVBAoMDEV4YW1wbGUgSW5jLjAgFw0yMjExMjIx\nNjU5NDdaGA8yMTIyMTAyOTE2NTk0N1owUTELMAkGA1UEBhMCVVMxFjAUBgNVBAgM\nDVNhbiBGcmFuY2lzY28xEzARBgNVBAcMCkNhbGlmb3JuaWExFTATBgNVBAoMDEV4\nYW1wbGUgSW5jLjCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAMRcORwg\nJFTdcG/2GKI+cFYiOBNDKjCZUXEOvXWY42BkH9wxiMT869CO+enA1w5pIrXow6kC\nM1sQspHHaVmJUlotEMJxyoLFfA/8Kt1EKFyobOjuZs2SwyVyJ2sStvQuUQEosULZ\nCNGZEqoH5g6zhMPxaxm7ZLrrsDZ9maNGVqo7EWLWHrZ57Q/5MtTrbxQL+eXjUmJ9\nK3kS+3uEwMdqR6Z3BluU1ivanpPc1CN2GNhdO0/hSY4YkGEnuLsqJyDd3cIiB1Mx\nuCBJ4ZaqOd2viV1WcP3oU3dxVPm4MWyfYIldMWB14FahScxLhWdRnM9YZ/i9IFcL\nypXsuz7DjrJPtPUCAwEAAaNmMGQwHQYDVR0OBBYEFP5JzLUawNF+c3AXsYTEWHh7\nz2czMB8GA1UdIwQYMBaAFP5JzLUawNF+c3AXsYTEWHh7z2czMA4GA1UdDwEB/wQE\nAwIBBjASBgNVHRMBAf8ECDAGAQH/AgEBMA0GCSqGSIb3DQEBCwUAA4IBAQBc+Be7\nNDhpE09y7hLPZGRPl1cSKBw4RI0XIv6rlbSTFs5EebpTGjhx/whNxwEZhB9HZ711\n1Oa1YlT8xkI9DshB78mjAHCKBAJ76moK8tkG0aqdYpJ4ZcJTVBB7l98Rvgc7zfTi\ni7WemTy72deBbSeiEtXavm4EF0mWjHhQ5Nxpnp00Bqn5g1x8CyTDypgmugnep+xG\n+iFzNmTdsz7WI9T/7kDMXqB7M/FPWBORyS98OJqNDswCLF8bIZYwUBEe+bRHFomo\nShMzaC3tvim7WCb16noDkSTMlfKO4pnvKhpcVdSgwcruATV7y+W+Lvmz2OT/Gui4\nJhqeoTewsxndhDDE\n-----END CERTIFICATE-----", ) assert response.is_closed is True @@ -59,7 +59,7 @@ def test_streaming_response_create(self, client: Cloudflare) -> None: with client.mtls_certificates.with_streaming_response.create( account_id="023e105f4ecef8ad9ca31a8372d0c353", ca=True, - certificates="-----BEGIN CERTIFICATE-----\nMIIDmDCCAoCgAwIBAgIUKTOAZNjcXVZRj4oQt0SHsl1c1vMwDQYJKoZIhvcNAQELBQAwUTELMAkGA1UEBhMCVVMxFjAUBgNVBAgMDVNhbiBGcmFuY2lzY28xEzARBgNVBAcMCkNhbGlmb3JuaWExFTATBgNVBAoMDEV4YW1wbGUgSW5jLjAgFw0yMjExMjIxNjU5NDdaGA8yMTIyMTAyOTE2NTk0N1owUTELMAkGA1UEBhMCVVMxFjAUBgNVBAgMDVNhbiBGcmFuY2lzY28xEzARBgNVBAcMCkNhbGlmb3JuaWExFTATBgNVBAoMDEV4YW1wbGUgSW5jLjCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAMRcORwgJFTdcG/2GKI+cFYiOBNDKjCZUXEOvXWY42BkH9wxiMT869CO+enA1w5pIrXow6kCM1sQspHHaVmJUlotEMJxyoLFfA/8Kt1EKFyobOjuZs2SwyVyJ2sStvQuUQEosULZCNGZEqoH5g6zhMPxaxm7ZLrrsDZ9maNGVqo7EWLWHrZ57Q/5MtTrbxQL+eXjUmJ9K3kS+3uEwMdqR6Z3BluU1ivanpPc1CN2GNhdO0/hSY4YkGEnuLsqJyDd3cIiB1MxuCBJ4ZaqOd2viV1WcP3oU3dxVPm4MWyfYIldMWB14FahScxLhWdRnM9YZ/i9IFcLypXsuz7DjrJPtPUCAwEAAaNmMGQwHQYDVR0OBBYEFP5JzLUawNF+c3AXsYTEWHh7z2czMB8GA1UdIwQYMBaAFP5JzLUawNF+c3AXsYTEWHh7z2czMA4GA1UdDwEB/wQEAwIBBjASBgNVHRMBAf8ECDAGAQH/AgEBMA0GCSqGSIb3DQEBCwUAA4IBAQBc+Be7NDhpE09y7hLPZGRPl1cSKBw4RI0XIv6rlbSTFs5EebpTGjhx/whNxwEZhB9HZ7111Oa1YlT8xkI9DshB78mjAHCKBAJ76moK8tkG0aqdYpJ4ZcJTVBB7l98Rvgc7zfTii7WemTy72deBbSeiEtXavm4EF0mWjHhQ5Nxpnp00Bqn5g1x8CyTDypgmugnep+xG+iFzNmTdsz7WI9T/7kDMXqB7M/FPWBORyS98OJqNDswCLF8bIZYwUBEe+bRHFomoShMzaC3tvim7WCb16noDkSTMlfKO4pnvKhpcVdSgwcruATV7y+W+Lvmz2OT/Gui4JhqeoTewsxndhDDE\n-----END CERTIFICATE-----", + certificates="-----BEGIN CERTIFICATE-----\nMIIDmDCCAoCgAwIBAgIUKTOAZNjcXVZRj4oQt0SHsl1c1vMwDQYJKoZIhvcNAQEL\nBQAwUTELMAkGA1UEBhMCVVMxFjAUBgNVBAgMDVNhbiBGcmFuY2lzY28xEzARBgNV\nBAcMCkNhbGlmb3JuaWExFTATBgNVBAoMDEV4YW1wbGUgSW5jLjAgFw0yMjExMjIx\nNjU5NDdaGA8yMTIyMTAyOTE2NTk0N1owUTELMAkGA1UEBhMCVVMxFjAUBgNVBAgM\nDVNhbiBGcmFuY2lzY28xEzARBgNVBAcMCkNhbGlmb3JuaWExFTATBgNVBAoMDEV4\nYW1wbGUgSW5jLjCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAMRcORwg\nJFTdcG/2GKI+cFYiOBNDKjCZUXEOvXWY42BkH9wxiMT869CO+enA1w5pIrXow6kC\nM1sQspHHaVmJUlotEMJxyoLFfA/8Kt1EKFyobOjuZs2SwyVyJ2sStvQuUQEosULZ\nCNGZEqoH5g6zhMPxaxm7ZLrrsDZ9maNGVqo7EWLWHrZ57Q/5MtTrbxQL+eXjUmJ9\nK3kS+3uEwMdqR6Z3BluU1ivanpPc1CN2GNhdO0/hSY4YkGEnuLsqJyDd3cIiB1Mx\nuCBJ4ZaqOd2viV1WcP3oU3dxVPm4MWyfYIldMWB14FahScxLhWdRnM9YZ/i9IFcL\nypXsuz7DjrJPtPUCAwEAAaNmMGQwHQYDVR0OBBYEFP5JzLUawNF+c3AXsYTEWHh7\nz2czMB8GA1UdIwQYMBaAFP5JzLUawNF+c3AXsYTEWHh7z2czMA4GA1UdDwEB/wQE\nAwIBBjASBgNVHRMBAf8ECDAGAQH/AgEBMA0GCSqGSIb3DQEBCwUAA4IBAQBc+Be7\nNDhpE09y7hLPZGRPl1cSKBw4RI0XIv6rlbSTFs5EebpTGjhx/whNxwEZhB9HZ711\n1Oa1YlT8xkI9DshB78mjAHCKBAJ76moK8tkG0aqdYpJ4ZcJTVBB7l98Rvgc7zfTi\ni7WemTy72deBbSeiEtXavm4EF0mWjHhQ5Nxpnp00Bqn5g1x8CyTDypgmugnep+xG\n+iFzNmTdsz7WI9T/7kDMXqB7M/FPWBORyS98OJqNDswCLF8bIZYwUBEe+bRHFomo\nShMzaC3tvim7WCb16noDkSTMlfKO4pnvKhpcVdSgwcruATV7y+W+Lvmz2OT/Gui4\nJhqeoTewsxndhDDE\n-----END CERTIFICATE-----", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -75,7 +75,7 @@ def test_path_params_create(self, client: Cloudflare) -> None: client.mtls_certificates.with_raw_response.create( account_id="", ca=True, - certificates="-----BEGIN CERTIFICATE-----\nMIIDmDCCAoCgAwIBAgIUKTOAZNjcXVZRj4oQt0SHsl1c1vMwDQYJKoZIhvcNAQELBQAwUTELMAkGA1UEBhMCVVMxFjAUBgNVBAgMDVNhbiBGcmFuY2lzY28xEzARBgNVBAcMCkNhbGlmb3JuaWExFTATBgNVBAoMDEV4YW1wbGUgSW5jLjAgFw0yMjExMjIxNjU5NDdaGA8yMTIyMTAyOTE2NTk0N1owUTELMAkGA1UEBhMCVVMxFjAUBgNVBAgMDVNhbiBGcmFuY2lzY28xEzARBgNVBAcMCkNhbGlmb3JuaWExFTATBgNVBAoMDEV4YW1wbGUgSW5jLjCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAMRcORwgJFTdcG/2GKI+cFYiOBNDKjCZUXEOvXWY42BkH9wxiMT869CO+enA1w5pIrXow6kCM1sQspHHaVmJUlotEMJxyoLFfA/8Kt1EKFyobOjuZs2SwyVyJ2sStvQuUQEosULZCNGZEqoH5g6zhMPxaxm7ZLrrsDZ9maNGVqo7EWLWHrZ57Q/5MtTrbxQL+eXjUmJ9K3kS+3uEwMdqR6Z3BluU1ivanpPc1CN2GNhdO0/hSY4YkGEnuLsqJyDd3cIiB1MxuCBJ4ZaqOd2viV1WcP3oU3dxVPm4MWyfYIldMWB14FahScxLhWdRnM9YZ/i9IFcLypXsuz7DjrJPtPUCAwEAAaNmMGQwHQYDVR0OBBYEFP5JzLUawNF+c3AXsYTEWHh7z2czMB8GA1UdIwQYMBaAFP5JzLUawNF+c3AXsYTEWHh7z2czMA4GA1UdDwEB/wQEAwIBBjASBgNVHRMBAf8ECDAGAQH/AgEBMA0GCSqGSIb3DQEBCwUAA4IBAQBc+Be7NDhpE09y7hLPZGRPl1cSKBw4RI0XIv6rlbSTFs5EebpTGjhx/whNxwEZhB9HZ7111Oa1YlT8xkI9DshB78mjAHCKBAJ76moK8tkG0aqdYpJ4ZcJTVBB7l98Rvgc7zfTii7WemTy72deBbSeiEtXavm4EF0mWjHhQ5Nxpnp00Bqn5g1x8CyTDypgmugnep+xG+iFzNmTdsz7WI9T/7kDMXqB7M/FPWBORyS98OJqNDswCLF8bIZYwUBEe+bRHFomoShMzaC3tvim7WCb16noDkSTMlfKO4pnvKhpcVdSgwcruATV7y+W+Lvmz2OT/Gui4JhqeoTewsxndhDDE\n-----END CERTIFICATE-----", + certificates="-----BEGIN CERTIFICATE-----\nMIIDmDCCAoCgAwIBAgIUKTOAZNjcXVZRj4oQt0SHsl1c1vMwDQYJKoZIhvcNAQEL\nBQAwUTELMAkGA1UEBhMCVVMxFjAUBgNVBAgMDVNhbiBGcmFuY2lzY28xEzARBgNV\nBAcMCkNhbGlmb3JuaWExFTATBgNVBAoMDEV4YW1wbGUgSW5jLjAgFw0yMjExMjIx\nNjU5NDdaGA8yMTIyMTAyOTE2NTk0N1owUTELMAkGA1UEBhMCVVMxFjAUBgNVBAgM\nDVNhbiBGcmFuY2lzY28xEzARBgNVBAcMCkNhbGlmb3JuaWExFTATBgNVBAoMDEV4\nYW1wbGUgSW5jLjCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAMRcORwg\nJFTdcG/2GKI+cFYiOBNDKjCZUXEOvXWY42BkH9wxiMT869CO+enA1w5pIrXow6kC\nM1sQspHHaVmJUlotEMJxyoLFfA/8Kt1EKFyobOjuZs2SwyVyJ2sStvQuUQEosULZ\nCNGZEqoH5g6zhMPxaxm7ZLrrsDZ9maNGVqo7EWLWHrZ57Q/5MtTrbxQL+eXjUmJ9\nK3kS+3uEwMdqR6Z3BluU1ivanpPc1CN2GNhdO0/hSY4YkGEnuLsqJyDd3cIiB1Mx\nuCBJ4ZaqOd2viV1WcP3oU3dxVPm4MWyfYIldMWB14FahScxLhWdRnM9YZ/i9IFcL\nypXsuz7DjrJPtPUCAwEAAaNmMGQwHQYDVR0OBBYEFP5JzLUawNF+c3AXsYTEWHh7\nz2czMB8GA1UdIwQYMBaAFP5JzLUawNF+c3AXsYTEWHh7z2czMA4GA1UdDwEB/wQE\nAwIBBjASBgNVHRMBAf8ECDAGAQH/AgEBMA0GCSqGSIb3DQEBCwUAA4IBAQBc+Be7\nNDhpE09y7hLPZGRPl1cSKBw4RI0XIv6rlbSTFs5EebpTGjhx/whNxwEZhB9HZ711\n1Oa1YlT8xkI9DshB78mjAHCKBAJ76moK8tkG0aqdYpJ4ZcJTVBB7l98Rvgc7zfTi\ni7WemTy72deBbSeiEtXavm4EF0mWjHhQ5Nxpnp00Bqn5g1x8CyTDypgmugnep+xG\n+iFzNmTdsz7WI9T/7kDMXqB7M/FPWBORyS98OJqNDswCLF8bIZYwUBEe+bRHFomo\nShMzaC3tvim7WCb16noDkSTMlfKO4pnvKhpcVdSgwcruATV7y+W+Lvmz2OT/Gui4\nJhqeoTewsxndhDDE\n-----END CERTIFICATE-----", ) @parametrize @@ -223,7 +223,7 @@ async def test_method_create(self, async_client: AsyncCloudflare) -> None: mtls_certificate = await async_client.mtls_certificates.create( account_id="023e105f4ecef8ad9ca31a8372d0c353", ca=True, - certificates="-----BEGIN CERTIFICATE-----\nMIIDmDCCAoCgAwIBAgIUKTOAZNjcXVZRj4oQt0SHsl1c1vMwDQYJKoZIhvcNAQELBQAwUTELMAkGA1UEBhMCVVMxFjAUBgNVBAgMDVNhbiBGcmFuY2lzY28xEzARBgNVBAcMCkNhbGlmb3JuaWExFTATBgNVBAoMDEV4YW1wbGUgSW5jLjAgFw0yMjExMjIxNjU5NDdaGA8yMTIyMTAyOTE2NTk0N1owUTELMAkGA1UEBhMCVVMxFjAUBgNVBAgMDVNhbiBGcmFuY2lzY28xEzARBgNVBAcMCkNhbGlmb3JuaWExFTATBgNVBAoMDEV4YW1wbGUgSW5jLjCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAMRcORwgJFTdcG/2GKI+cFYiOBNDKjCZUXEOvXWY42BkH9wxiMT869CO+enA1w5pIrXow6kCM1sQspHHaVmJUlotEMJxyoLFfA/8Kt1EKFyobOjuZs2SwyVyJ2sStvQuUQEosULZCNGZEqoH5g6zhMPxaxm7ZLrrsDZ9maNGVqo7EWLWHrZ57Q/5MtTrbxQL+eXjUmJ9K3kS+3uEwMdqR6Z3BluU1ivanpPc1CN2GNhdO0/hSY4YkGEnuLsqJyDd3cIiB1MxuCBJ4ZaqOd2viV1WcP3oU3dxVPm4MWyfYIldMWB14FahScxLhWdRnM9YZ/i9IFcLypXsuz7DjrJPtPUCAwEAAaNmMGQwHQYDVR0OBBYEFP5JzLUawNF+c3AXsYTEWHh7z2czMB8GA1UdIwQYMBaAFP5JzLUawNF+c3AXsYTEWHh7z2czMA4GA1UdDwEB/wQEAwIBBjASBgNVHRMBAf8ECDAGAQH/AgEBMA0GCSqGSIb3DQEBCwUAA4IBAQBc+Be7NDhpE09y7hLPZGRPl1cSKBw4RI0XIv6rlbSTFs5EebpTGjhx/whNxwEZhB9HZ7111Oa1YlT8xkI9DshB78mjAHCKBAJ76moK8tkG0aqdYpJ4ZcJTVBB7l98Rvgc7zfTii7WemTy72deBbSeiEtXavm4EF0mWjHhQ5Nxpnp00Bqn5g1x8CyTDypgmugnep+xG+iFzNmTdsz7WI9T/7kDMXqB7M/FPWBORyS98OJqNDswCLF8bIZYwUBEe+bRHFomoShMzaC3tvim7WCb16noDkSTMlfKO4pnvKhpcVdSgwcruATV7y+W+Lvmz2OT/Gui4JhqeoTewsxndhDDE\n-----END CERTIFICATE-----", + certificates="-----BEGIN CERTIFICATE-----\nMIIDmDCCAoCgAwIBAgIUKTOAZNjcXVZRj4oQt0SHsl1c1vMwDQYJKoZIhvcNAQEL\nBQAwUTELMAkGA1UEBhMCVVMxFjAUBgNVBAgMDVNhbiBGcmFuY2lzY28xEzARBgNV\nBAcMCkNhbGlmb3JuaWExFTATBgNVBAoMDEV4YW1wbGUgSW5jLjAgFw0yMjExMjIx\nNjU5NDdaGA8yMTIyMTAyOTE2NTk0N1owUTELMAkGA1UEBhMCVVMxFjAUBgNVBAgM\nDVNhbiBGcmFuY2lzY28xEzARBgNVBAcMCkNhbGlmb3JuaWExFTATBgNVBAoMDEV4\nYW1wbGUgSW5jLjCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAMRcORwg\nJFTdcG/2GKI+cFYiOBNDKjCZUXEOvXWY42BkH9wxiMT869CO+enA1w5pIrXow6kC\nM1sQspHHaVmJUlotEMJxyoLFfA/8Kt1EKFyobOjuZs2SwyVyJ2sStvQuUQEosULZ\nCNGZEqoH5g6zhMPxaxm7ZLrrsDZ9maNGVqo7EWLWHrZ57Q/5MtTrbxQL+eXjUmJ9\nK3kS+3uEwMdqR6Z3BluU1ivanpPc1CN2GNhdO0/hSY4YkGEnuLsqJyDd3cIiB1Mx\nuCBJ4ZaqOd2viV1WcP3oU3dxVPm4MWyfYIldMWB14FahScxLhWdRnM9YZ/i9IFcL\nypXsuz7DjrJPtPUCAwEAAaNmMGQwHQYDVR0OBBYEFP5JzLUawNF+c3AXsYTEWHh7\nz2czMB8GA1UdIwQYMBaAFP5JzLUawNF+c3AXsYTEWHh7z2czMA4GA1UdDwEB/wQE\nAwIBBjASBgNVHRMBAf8ECDAGAQH/AgEBMA0GCSqGSIb3DQEBCwUAA4IBAQBc+Be7\nNDhpE09y7hLPZGRPl1cSKBw4RI0XIv6rlbSTFs5EebpTGjhx/whNxwEZhB9HZ711\n1Oa1YlT8xkI9DshB78mjAHCKBAJ76moK8tkG0aqdYpJ4ZcJTVBB7l98Rvgc7zfTi\ni7WemTy72deBbSeiEtXavm4EF0mWjHhQ5Nxpnp00Bqn5g1x8CyTDypgmugnep+xG\n+iFzNmTdsz7WI9T/7kDMXqB7M/FPWBORyS98OJqNDswCLF8bIZYwUBEe+bRHFomo\nShMzaC3tvim7WCb16noDkSTMlfKO4pnvKhpcVdSgwcruATV7y+W+Lvmz2OT/Gui4\nJhqeoTewsxndhDDE\n-----END CERTIFICATE-----", ) assert_matches_type(Optional[MTLSCertificateCreateResponse], mtls_certificate, path=["response"]) @@ -232,9 +232,9 @@ async def test_method_create_with_all_params(self, async_client: AsyncCloudflare mtls_certificate = await async_client.mtls_certificates.create( account_id="023e105f4ecef8ad9ca31a8372d0c353", ca=True, - certificates="-----BEGIN CERTIFICATE-----\nMIIDmDCCAoCgAwIBAgIUKTOAZNjcXVZRj4oQt0SHsl1c1vMwDQYJKoZIhvcNAQELBQAwUTELMAkGA1UEBhMCVVMxFjAUBgNVBAgMDVNhbiBGcmFuY2lzY28xEzARBgNVBAcMCkNhbGlmb3JuaWExFTATBgNVBAoMDEV4YW1wbGUgSW5jLjAgFw0yMjExMjIxNjU5NDdaGA8yMTIyMTAyOTE2NTk0N1owUTELMAkGA1UEBhMCVVMxFjAUBgNVBAgMDVNhbiBGcmFuY2lzY28xEzARBgNVBAcMCkNhbGlmb3JuaWExFTATBgNVBAoMDEV4YW1wbGUgSW5jLjCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAMRcORwgJFTdcG/2GKI+cFYiOBNDKjCZUXEOvXWY42BkH9wxiMT869CO+enA1w5pIrXow6kCM1sQspHHaVmJUlotEMJxyoLFfA/8Kt1EKFyobOjuZs2SwyVyJ2sStvQuUQEosULZCNGZEqoH5g6zhMPxaxm7ZLrrsDZ9maNGVqo7EWLWHrZ57Q/5MtTrbxQL+eXjUmJ9K3kS+3uEwMdqR6Z3BluU1ivanpPc1CN2GNhdO0/hSY4YkGEnuLsqJyDd3cIiB1MxuCBJ4ZaqOd2viV1WcP3oU3dxVPm4MWyfYIldMWB14FahScxLhWdRnM9YZ/i9IFcLypXsuz7DjrJPtPUCAwEAAaNmMGQwHQYDVR0OBBYEFP5JzLUawNF+c3AXsYTEWHh7z2czMB8GA1UdIwQYMBaAFP5JzLUawNF+c3AXsYTEWHh7z2czMA4GA1UdDwEB/wQEAwIBBjASBgNVHRMBAf8ECDAGAQH/AgEBMA0GCSqGSIb3DQEBCwUAA4IBAQBc+Be7NDhpE09y7hLPZGRPl1cSKBw4RI0XIv6rlbSTFs5EebpTGjhx/whNxwEZhB9HZ7111Oa1YlT8xkI9DshB78mjAHCKBAJ76moK8tkG0aqdYpJ4ZcJTVBB7l98Rvgc7zfTii7WemTy72deBbSeiEtXavm4EF0mWjHhQ5Nxpnp00Bqn5g1x8CyTDypgmugnep+xG+iFzNmTdsz7WI9T/7kDMXqB7M/FPWBORyS98OJqNDswCLF8bIZYwUBEe+bRHFomoShMzaC3tvim7WCb16noDkSTMlfKO4pnvKhpcVdSgwcruATV7y+W+Lvmz2OT/Gui4JhqeoTewsxndhDDE\n-----END CERTIFICATE-----", + certificates="-----BEGIN CERTIFICATE-----\nMIIDmDCCAoCgAwIBAgIUKTOAZNjcXVZRj4oQt0SHsl1c1vMwDQYJKoZIhvcNAQEL\nBQAwUTELMAkGA1UEBhMCVVMxFjAUBgNVBAgMDVNhbiBGcmFuY2lzY28xEzARBgNV\nBAcMCkNhbGlmb3JuaWExFTATBgNVBAoMDEV4YW1wbGUgSW5jLjAgFw0yMjExMjIx\nNjU5NDdaGA8yMTIyMTAyOTE2NTk0N1owUTELMAkGA1UEBhMCVVMxFjAUBgNVBAgM\nDVNhbiBGcmFuY2lzY28xEzARBgNVBAcMCkNhbGlmb3JuaWExFTATBgNVBAoMDEV4\nYW1wbGUgSW5jLjCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAMRcORwg\nJFTdcG/2GKI+cFYiOBNDKjCZUXEOvXWY42BkH9wxiMT869CO+enA1w5pIrXow6kC\nM1sQspHHaVmJUlotEMJxyoLFfA/8Kt1EKFyobOjuZs2SwyVyJ2sStvQuUQEosULZ\nCNGZEqoH5g6zhMPxaxm7ZLrrsDZ9maNGVqo7EWLWHrZ57Q/5MtTrbxQL+eXjUmJ9\nK3kS+3uEwMdqR6Z3BluU1ivanpPc1CN2GNhdO0/hSY4YkGEnuLsqJyDd3cIiB1Mx\nuCBJ4ZaqOd2viV1WcP3oU3dxVPm4MWyfYIldMWB14FahScxLhWdRnM9YZ/i9IFcL\nypXsuz7DjrJPtPUCAwEAAaNmMGQwHQYDVR0OBBYEFP5JzLUawNF+c3AXsYTEWHh7\nz2czMB8GA1UdIwQYMBaAFP5JzLUawNF+c3AXsYTEWHh7z2czMA4GA1UdDwEB/wQE\nAwIBBjASBgNVHRMBAf8ECDAGAQH/AgEBMA0GCSqGSIb3DQEBCwUAA4IBAQBc+Be7\nNDhpE09y7hLPZGRPl1cSKBw4RI0XIv6rlbSTFs5EebpTGjhx/whNxwEZhB9HZ711\n1Oa1YlT8xkI9DshB78mjAHCKBAJ76moK8tkG0aqdYpJ4ZcJTVBB7l98Rvgc7zfTi\ni7WemTy72deBbSeiEtXavm4EF0mWjHhQ5Nxpnp00Bqn5g1x8CyTDypgmugnep+xG\n+iFzNmTdsz7WI9T/7kDMXqB7M/FPWBORyS98OJqNDswCLF8bIZYwUBEe+bRHFomo\nShMzaC3tvim7WCb16noDkSTMlfKO4pnvKhpcVdSgwcruATV7y+W+Lvmz2OT/Gui4\nJhqeoTewsxndhDDE\n-----END CERTIFICATE-----", name="example_ca_cert", - private_key="-----BEGIN PRIVATE KEY-----\nMIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQDEXDkcICRU3XBv9hiiPnBWIjgTQyowmVFxDr11mONgZB/cMYjE/OvQjvnpwNcOaSK16MOpAjNbELKRx2lZiVJaLRDCccqCxXwP/CrdRChcqGzo7mbNksMlcidrErb0LlEBKLFC2QjRmRKqB+YOs4TD8WsZu2S667A2fZmjRlaqOxFi1h62ee0P+TLU628UC/nl41JifSt5Evt7hMDHakemdwZblNYr2p6T3NQjdhjYXTtP4UmOGJBhJ7i7Kicg3d3CIgdTMbggSeGWqjndr4ldVnD96FN3cVT5uDFsn2CJXTFgdeBWoUnMS4VnUZzPWGf4vSBXC8qV7Ls+w46yT7T1AgMBAAECggEAQZnp/oqCeNPOR6l5S2L+1tfx0gWjZ78hJVteUpZ0iHSK7F6kKeOxyOird7vUXV0kmo+cJq+0hp0Ke4eam640FCpwKfYoSQ4/R3vgujGWJnaihCN5tv5sMet0XeJPuz5qE7ALoKCvwI6aXLHs20aAeZIDTQJ9QbGSGnJVzOWn+JDTidIgZpN57RpXfSAwnJPTQK/PN8i5z108hsaDOdEgGmxYZ7kYqMqzX20KXmth58LDfPixs5JGtS60iiKC/wOcGzkB2/AdTSojR76oEU77cANP/3zO25NG//whUdYlW0t0d7PgXxIeJe+xgYnamDQJx3qonVyt4H77ha0ObRAj9QKBgQDicZr+VTwFMnELP3a+FXGnjehRiuS1i7MXGKxNweCD+dFlML0FplSQS8Ro2n+d8lu8BBXGx0qm6VXu8Rhn7TAUL6q+PCgfarzxfIhacb/TZCqfieIHsMlVBfhV5HCXnk+kis0tuC/PRArcWTwDHJUJXkBhvkUsNswvQzavDPI7KwKBgQDd/WgLkj7A3X5fgIHZH/GbDSBiXwzKb+rF4ZCT2XFgG/OAW7vapfcX/w+v+5lBLyrocmOAS3PGGAhM5T3HLnUCQfnK4qgps1Lqibkc9Tmnsn60LanUjuUMsYv/zSw70tozbzhJ0pioEpWfRxRZBztO2Rr8Ntm7h6Fk701EXGNAXwKBgQCD1xsjy2J3sCerIdcz0u5qXLAPkeuZW+34m4/ucdwTWwc0gEz9lhsULFj9p4G351zLuiEnq+7mAWLcDJlmIO3mQt6JhiLiL9Y0T4pgBmxmWqKKYtAsJB0EmMY+1BNN44mBRqMxZFTJu1cLdhT/xstrOeoIPqytknYNanfTMZlzIwKBgHrLXe5oq0XMP8dcMneEcAUwsaU4pr6kQd3L9EmUkl5zl7J9C+DaxWAEuwzBw/iGutlxzRB+rD/7szu14wJ29EqXbDGKRzMp+se5/yfBjm7xEZ1hVPw7PwBShfqt57X/4Ktq7lwHnmH6RcGhc+P7WBc5iO/S94YAdIp8xOT3pf9JAoGAE0QkqJUY+5Mgr+fBO0VNV72ZoPveGpW+De59uhKAOnu1zljQCUtk59m6+DXfm0tNYKtawa5n8iN71Zh+s62xXSt3pYi1Y5CCCmv8Y4BhwIcPwXKk3zEvLgSHVTpC0bayA9aSO4bbZgVXa5w+Z0w/vvfp9DWo1IS3EnQRrz6WMYA=\n-----END PRIVATE KEY-----", + private_key="-----BEGIN PRIVATE KEY-----\nMIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQDEXDkcICRU3XBv\n9hiiPnBWIjgTQyowmVFxDr11mONgZB/cMYjE/OvQjvnpwNcOaSK16MOpAjNbELKR\nx2lZiVJaLRDCccqCxXwP/CrdRChcqGzo7mbNksMlcidrErb0LlEBKLFC2QjRmRKq\nB+YOs4TD8WsZu2S667A2fZmjRlaqOxFi1h62ee0P+TLU628UC/nl41JifSt5Evt7\nhMDHakemdwZblNYr2p6T3NQjdhjYXTtP4UmOGJBhJ7i7Kicg3d3CIgdTMbggSeGW\nqjndr4ldVnD96FN3cVT5uDFsn2CJXTFgdeBWoUnMS4VnUZzPWGf4vSBXC8qV7Ls+\nw46yT7T1AgMBAAECggEAQZnp/oqCeNPOR6l5S2L+1tfx0gWjZ78hJVteUpZ0iHSK\n7F6kKeOxyOird7vUXV0kmo+cJq+0hp0Ke4eam640FCpwKfYoSQ4/R3vgujGWJnai\nhCN5tv5sMet0XeJPuz5qE7ALoKCvwI6aXLHs20aAeZIDTQJ9QbGSGnJVzOWn+JDT\nidIgZpN57RpXfSAwnJPTQK/PN8i5z108hsaDOdEgGmxYZ7kYqMqzX20KXmth58LD\nfPixs5JGtS60iiKC/wOcGzkB2/AdTSojR76oEU77cANP/3zO25NG//whUdYlW0t0\nd7PgXxIeJe+xgYnamDQJx3qonVyt4H77ha0ObRAj9QKBgQDicZr+VTwFMnELP3a+\nFXGnjehRiuS1i7MXGKxNweCD+dFlML0FplSQS8Ro2n+d8lu8BBXGx0qm6VXu8Rhn\n7TAUL6q+PCgfarzxfIhacb/TZCqfieIHsMlVBfhV5HCXnk+kis0tuC/PRArcWTwD\nHJUJXkBhvkUsNswvQzavDPI7KwKBgQDd/WgLkj7A3X5fgIHZH/GbDSBiXwzKb+rF\n4ZCT2XFgG/OAW7vapfcX/w+v+5lBLyrocmOAS3PGGAhM5T3HLnUCQfnK4qgps1Lq\nibkc9Tmnsn60LanUjuUMsYv/zSw70tozbzhJ0pioEpWfRxRZBztO2Rr8Ntm7h6Fk\n701EXGNAXwKBgQCD1xsjy2J3sCerIdcz0u5qXLAPkeuZW+34m4/ucdwTWwc0gEz9\nlhsULFj9p4G351zLuiEnq+7mAWLcDJlmIO3mQt6JhiLiL9Y0T4pgBmxmWqKKYtAs\nJB0EmMY+1BNN44mBRqMxZFTJu1cLdhT/xstrOeoIPqytknYNanfTMZlzIwKBgHrL\nXe5oq0XMP8dcMneEcAUwsaU4pr6kQd3L9EmUkl5zl7J9C+DaxWAEuwzBw/iGutlx\nzRB+rD/7szu14wJ29EqXbDGKRzMp+se5/yfBjm7xEZ1hVPw7PwBShfqt57X/4Ktq\n7lwHnmH6RcGhc+P7WBc5iO/S94YAdIp8xOT3pf9JAoGAE0QkqJUY+5Mgr+fBO0VN\nV72ZoPveGpW+De59uhKAOnu1zljQCUtk59m6+DXfm0tNYKtawa5n8iN71Zh+s62x\nXSt3pYi1Y5CCCmv8Y4BhwIcPwXKk3zEvLgSHVTpC0bayA9aSO4bbZgVXa5w+Z0w/\nvvfp9DWo1IS3EnQRrz6WMYA=\n-----END PRIVATE KEY-----", ) assert_matches_type(Optional[MTLSCertificateCreateResponse], mtls_certificate, path=["response"]) @@ -243,7 +243,7 @@ async def test_raw_response_create(self, async_client: AsyncCloudflare) -> None: response = await async_client.mtls_certificates.with_raw_response.create( account_id="023e105f4ecef8ad9ca31a8372d0c353", ca=True, - certificates="-----BEGIN CERTIFICATE-----\nMIIDmDCCAoCgAwIBAgIUKTOAZNjcXVZRj4oQt0SHsl1c1vMwDQYJKoZIhvcNAQELBQAwUTELMAkGA1UEBhMCVVMxFjAUBgNVBAgMDVNhbiBGcmFuY2lzY28xEzARBgNVBAcMCkNhbGlmb3JuaWExFTATBgNVBAoMDEV4YW1wbGUgSW5jLjAgFw0yMjExMjIxNjU5NDdaGA8yMTIyMTAyOTE2NTk0N1owUTELMAkGA1UEBhMCVVMxFjAUBgNVBAgMDVNhbiBGcmFuY2lzY28xEzARBgNVBAcMCkNhbGlmb3JuaWExFTATBgNVBAoMDEV4YW1wbGUgSW5jLjCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAMRcORwgJFTdcG/2GKI+cFYiOBNDKjCZUXEOvXWY42BkH9wxiMT869CO+enA1w5pIrXow6kCM1sQspHHaVmJUlotEMJxyoLFfA/8Kt1EKFyobOjuZs2SwyVyJ2sStvQuUQEosULZCNGZEqoH5g6zhMPxaxm7ZLrrsDZ9maNGVqo7EWLWHrZ57Q/5MtTrbxQL+eXjUmJ9K3kS+3uEwMdqR6Z3BluU1ivanpPc1CN2GNhdO0/hSY4YkGEnuLsqJyDd3cIiB1MxuCBJ4ZaqOd2viV1WcP3oU3dxVPm4MWyfYIldMWB14FahScxLhWdRnM9YZ/i9IFcLypXsuz7DjrJPtPUCAwEAAaNmMGQwHQYDVR0OBBYEFP5JzLUawNF+c3AXsYTEWHh7z2czMB8GA1UdIwQYMBaAFP5JzLUawNF+c3AXsYTEWHh7z2czMA4GA1UdDwEB/wQEAwIBBjASBgNVHRMBAf8ECDAGAQH/AgEBMA0GCSqGSIb3DQEBCwUAA4IBAQBc+Be7NDhpE09y7hLPZGRPl1cSKBw4RI0XIv6rlbSTFs5EebpTGjhx/whNxwEZhB9HZ7111Oa1YlT8xkI9DshB78mjAHCKBAJ76moK8tkG0aqdYpJ4ZcJTVBB7l98Rvgc7zfTii7WemTy72deBbSeiEtXavm4EF0mWjHhQ5Nxpnp00Bqn5g1x8CyTDypgmugnep+xG+iFzNmTdsz7WI9T/7kDMXqB7M/FPWBORyS98OJqNDswCLF8bIZYwUBEe+bRHFomoShMzaC3tvim7WCb16noDkSTMlfKO4pnvKhpcVdSgwcruATV7y+W+Lvmz2OT/Gui4JhqeoTewsxndhDDE\n-----END CERTIFICATE-----", + certificates="-----BEGIN CERTIFICATE-----\nMIIDmDCCAoCgAwIBAgIUKTOAZNjcXVZRj4oQt0SHsl1c1vMwDQYJKoZIhvcNAQEL\nBQAwUTELMAkGA1UEBhMCVVMxFjAUBgNVBAgMDVNhbiBGcmFuY2lzY28xEzARBgNV\nBAcMCkNhbGlmb3JuaWExFTATBgNVBAoMDEV4YW1wbGUgSW5jLjAgFw0yMjExMjIx\nNjU5NDdaGA8yMTIyMTAyOTE2NTk0N1owUTELMAkGA1UEBhMCVVMxFjAUBgNVBAgM\nDVNhbiBGcmFuY2lzY28xEzARBgNVBAcMCkNhbGlmb3JuaWExFTATBgNVBAoMDEV4\nYW1wbGUgSW5jLjCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAMRcORwg\nJFTdcG/2GKI+cFYiOBNDKjCZUXEOvXWY42BkH9wxiMT869CO+enA1w5pIrXow6kC\nM1sQspHHaVmJUlotEMJxyoLFfA/8Kt1EKFyobOjuZs2SwyVyJ2sStvQuUQEosULZ\nCNGZEqoH5g6zhMPxaxm7ZLrrsDZ9maNGVqo7EWLWHrZ57Q/5MtTrbxQL+eXjUmJ9\nK3kS+3uEwMdqR6Z3BluU1ivanpPc1CN2GNhdO0/hSY4YkGEnuLsqJyDd3cIiB1Mx\nuCBJ4ZaqOd2viV1WcP3oU3dxVPm4MWyfYIldMWB14FahScxLhWdRnM9YZ/i9IFcL\nypXsuz7DjrJPtPUCAwEAAaNmMGQwHQYDVR0OBBYEFP5JzLUawNF+c3AXsYTEWHh7\nz2czMB8GA1UdIwQYMBaAFP5JzLUawNF+c3AXsYTEWHh7z2czMA4GA1UdDwEB/wQE\nAwIBBjASBgNVHRMBAf8ECDAGAQH/AgEBMA0GCSqGSIb3DQEBCwUAA4IBAQBc+Be7\nNDhpE09y7hLPZGRPl1cSKBw4RI0XIv6rlbSTFs5EebpTGjhx/whNxwEZhB9HZ711\n1Oa1YlT8xkI9DshB78mjAHCKBAJ76moK8tkG0aqdYpJ4ZcJTVBB7l98Rvgc7zfTi\ni7WemTy72deBbSeiEtXavm4EF0mWjHhQ5Nxpnp00Bqn5g1x8CyTDypgmugnep+xG\n+iFzNmTdsz7WI9T/7kDMXqB7M/FPWBORyS98OJqNDswCLF8bIZYwUBEe+bRHFomo\nShMzaC3tvim7WCb16noDkSTMlfKO4pnvKhpcVdSgwcruATV7y+W+Lvmz2OT/Gui4\nJhqeoTewsxndhDDE\n-----END CERTIFICATE-----", ) assert response.is_closed is True @@ -256,7 +256,7 @@ async def test_streaming_response_create(self, async_client: AsyncCloudflare) -> async with async_client.mtls_certificates.with_streaming_response.create( account_id="023e105f4ecef8ad9ca31a8372d0c353", ca=True, - certificates="-----BEGIN CERTIFICATE-----\nMIIDmDCCAoCgAwIBAgIUKTOAZNjcXVZRj4oQt0SHsl1c1vMwDQYJKoZIhvcNAQELBQAwUTELMAkGA1UEBhMCVVMxFjAUBgNVBAgMDVNhbiBGcmFuY2lzY28xEzARBgNVBAcMCkNhbGlmb3JuaWExFTATBgNVBAoMDEV4YW1wbGUgSW5jLjAgFw0yMjExMjIxNjU5NDdaGA8yMTIyMTAyOTE2NTk0N1owUTELMAkGA1UEBhMCVVMxFjAUBgNVBAgMDVNhbiBGcmFuY2lzY28xEzARBgNVBAcMCkNhbGlmb3JuaWExFTATBgNVBAoMDEV4YW1wbGUgSW5jLjCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAMRcORwgJFTdcG/2GKI+cFYiOBNDKjCZUXEOvXWY42BkH9wxiMT869CO+enA1w5pIrXow6kCM1sQspHHaVmJUlotEMJxyoLFfA/8Kt1EKFyobOjuZs2SwyVyJ2sStvQuUQEosULZCNGZEqoH5g6zhMPxaxm7ZLrrsDZ9maNGVqo7EWLWHrZ57Q/5MtTrbxQL+eXjUmJ9K3kS+3uEwMdqR6Z3BluU1ivanpPc1CN2GNhdO0/hSY4YkGEnuLsqJyDd3cIiB1MxuCBJ4ZaqOd2viV1WcP3oU3dxVPm4MWyfYIldMWB14FahScxLhWdRnM9YZ/i9IFcLypXsuz7DjrJPtPUCAwEAAaNmMGQwHQYDVR0OBBYEFP5JzLUawNF+c3AXsYTEWHh7z2czMB8GA1UdIwQYMBaAFP5JzLUawNF+c3AXsYTEWHh7z2czMA4GA1UdDwEB/wQEAwIBBjASBgNVHRMBAf8ECDAGAQH/AgEBMA0GCSqGSIb3DQEBCwUAA4IBAQBc+Be7NDhpE09y7hLPZGRPl1cSKBw4RI0XIv6rlbSTFs5EebpTGjhx/whNxwEZhB9HZ7111Oa1YlT8xkI9DshB78mjAHCKBAJ76moK8tkG0aqdYpJ4ZcJTVBB7l98Rvgc7zfTii7WemTy72deBbSeiEtXavm4EF0mWjHhQ5Nxpnp00Bqn5g1x8CyTDypgmugnep+xG+iFzNmTdsz7WI9T/7kDMXqB7M/FPWBORyS98OJqNDswCLF8bIZYwUBEe+bRHFomoShMzaC3tvim7WCb16noDkSTMlfKO4pnvKhpcVdSgwcruATV7y+W+Lvmz2OT/Gui4JhqeoTewsxndhDDE\n-----END CERTIFICATE-----", + certificates="-----BEGIN CERTIFICATE-----\nMIIDmDCCAoCgAwIBAgIUKTOAZNjcXVZRj4oQt0SHsl1c1vMwDQYJKoZIhvcNAQEL\nBQAwUTELMAkGA1UEBhMCVVMxFjAUBgNVBAgMDVNhbiBGcmFuY2lzY28xEzARBgNV\nBAcMCkNhbGlmb3JuaWExFTATBgNVBAoMDEV4YW1wbGUgSW5jLjAgFw0yMjExMjIx\nNjU5NDdaGA8yMTIyMTAyOTE2NTk0N1owUTELMAkGA1UEBhMCVVMxFjAUBgNVBAgM\nDVNhbiBGcmFuY2lzY28xEzARBgNVBAcMCkNhbGlmb3JuaWExFTATBgNVBAoMDEV4\nYW1wbGUgSW5jLjCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAMRcORwg\nJFTdcG/2GKI+cFYiOBNDKjCZUXEOvXWY42BkH9wxiMT869CO+enA1w5pIrXow6kC\nM1sQspHHaVmJUlotEMJxyoLFfA/8Kt1EKFyobOjuZs2SwyVyJ2sStvQuUQEosULZ\nCNGZEqoH5g6zhMPxaxm7ZLrrsDZ9maNGVqo7EWLWHrZ57Q/5MtTrbxQL+eXjUmJ9\nK3kS+3uEwMdqR6Z3BluU1ivanpPc1CN2GNhdO0/hSY4YkGEnuLsqJyDd3cIiB1Mx\nuCBJ4ZaqOd2viV1WcP3oU3dxVPm4MWyfYIldMWB14FahScxLhWdRnM9YZ/i9IFcL\nypXsuz7DjrJPtPUCAwEAAaNmMGQwHQYDVR0OBBYEFP5JzLUawNF+c3AXsYTEWHh7\nz2czMB8GA1UdIwQYMBaAFP5JzLUawNF+c3AXsYTEWHh7z2czMA4GA1UdDwEB/wQE\nAwIBBjASBgNVHRMBAf8ECDAGAQH/AgEBMA0GCSqGSIb3DQEBCwUAA4IBAQBc+Be7\nNDhpE09y7hLPZGRPl1cSKBw4RI0XIv6rlbSTFs5EebpTGjhx/whNxwEZhB9HZ711\n1Oa1YlT8xkI9DshB78mjAHCKBAJ76moK8tkG0aqdYpJ4ZcJTVBB7l98Rvgc7zfTi\ni7WemTy72deBbSeiEtXavm4EF0mWjHhQ5Nxpnp00Bqn5g1x8CyTDypgmugnep+xG\n+iFzNmTdsz7WI9T/7kDMXqB7M/FPWBORyS98OJqNDswCLF8bIZYwUBEe+bRHFomo\nShMzaC3tvim7WCb16noDkSTMlfKO4pnvKhpcVdSgwcruATV7y+W+Lvmz2OT/Gui4\nJhqeoTewsxndhDDE\n-----END CERTIFICATE-----", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -272,7 +272,7 @@ async def test_path_params_create(self, async_client: AsyncCloudflare) -> None: await async_client.mtls_certificates.with_raw_response.create( account_id="", ca=True, - certificates="-----BEGIN CERTIFICATE-----\nMIIDmDCCAoCgAwIBAgIUKTOAZNjcXVZRj4oQt0SHsl1c1vMwDQYJKoZIhvcNAQELBQAwUTELMAkGA1UEBhMCVVMxFjAUBgNVBAgMDVNhbiBGcmFuY2lzY28xEzARBgNVBAcMCkNhbGlmb3JuaWExFTATBgNVBAoMDEV4YW1wbGUgSW5jLjAgFw0yMjExMjIxNjU5NDdaGA8yMTIyMTAyOTE2NTk0N1owUTELMAkGA1UEBhMCVVMxFjAUBgNVBAgMDVNhbiBGcmFuY2lzY28xEzARBgNVBAcMCkNhbGlmb3JuaWExFTATBgNVBAoMDEV4YW1wbGUgSW5jLjCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAMRcORwgJFTdcG/2GKI+cFYiOBNDKjCZUXEOvXWY42BkH9wxiMT869CO+enA1w5pIrXow6kCM1sQspHHaVmJUlotEMJxyoLFfA/8Kt1EKFyobOjuZs2SwyVyJ2sStvQuUQEosULZCNGZEqoH5g6zhMPxaxm7ZLrrsDZ9maNGVqo7EWLWHrZ57Q/5MtTrbxQL+eXjUmJ9K3kS+3uEwMdqR6Z3BluU1ivanpPc1CN2GNhdO0/hSY4YkGEnuLsqJyDd3cIiB1MxuCBJ4ZaqOd2viV1WcP3oU3dxVPm4MWyfYIldMWB14FahScxLhWdRnM9YZ/i9IFcLypXsuz7DjrJPtPUCAwEAAaNmMGQwHQYDVR0OBBYEFP5JzLUawNF+c3AXsYTEWHh7z2czMB8GA1UdIwQYMBaAFP5JzLUawNF+c3AXsYTEWHh7z2czMA4GA1UdDwEB/wQEAwIBBjASBgNVHRMBAf8ECDAGAQH/AgEBMA0GCSqGSIb3DQEBCwUAA4IBAQBc+Be7NDhpE09y7hLPZGRPl1cSKBw4RI0XIv6rlbSTFs5EebpTGjhx/whNxwEZhB9HZ7111Oa1YlT8xkI9DshB78mjAHCKBAJ76moK8tkG0aqdYpJ4ZcJTVBB7l98Rvgc7zfTii7WemTy72deBbSeiEtXavm4EF0mWjHhQ5Nxpnp00Bqn5g1x8CyTDypgmugnep+xG+iFzNmTdsz7WI9T/7kDMXqB7M/FPWBORyS98OJqNDswCLF8bIZYwUBEe+bRHFomoShMzaC3tvim7WCb16noDkSTMlfKO4pnvKhpcVdSgwcruATV7y+W+Lvmz2OT/Gui4JhqeoTewsxndhDDE\n-----END CERTIFICATE-----", + certificates="-----BEGIN CERTIFICATE-----\nMIIDmDCCAoCgAwIBAgIUKTOAZNjcXVZRj4oQt0SHsl1c1vMwDQYJKoZIhvcNAQEL\nBQAwUTELMAkGA1UEBhMCVVMxFjAUBgNVBAgMDVNhbiBGcmFuY2lzY28xEzARBgNV\nBAcMCkNhbGlmb3JuaWExFTATBgNVBAoMDEV4YW1wbGUgSW5jLjAgFw0yMjExMjIx\nNjU5NDdaGA8yMTIyMTAyOTE2NTk0N1owUTELMAkGA1UEBhMCVVMxFjAUBgNVBAgM\nDVNhbiBGcmFuY2lzY28xEzARBgNVBAcMCkNhbGlmb3JuaWExFTATBgNVBAoMDEV4\nYW1wbGUgSW5jLjCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAMRcORwg\nJFTdcG/2GKI+cFYiOBNDKjCZUXEOvXWY42BkH9wxiMT869CO+enA1w5pIrXow6kC\nM1sQspHHaVmJUlotEMJxyoLFfA/8Kt1EKFyobOjuZs2SwyVyJ2sStvQuUQEosULZ\nCNGZEqoH5g6zhMPxaxm7ZLrrsDZ9maNGVqo7EWLWHrZ57Q/5MtTrbxQL+eXjUmJ9\nK3kS+3uEwMdqR6Z3BluU1ivanpPc1CN2GNhdO0/hSY4YkGEnuLsqJyDd3cIiB1Mx\nuCBJ4ZaqOd2viV1WcP3oU3dxVPm4MWyfYIldMWB14FahScxLhWdRnM9YZ/i9IFcL\nypXsuz7DjrJPtPUCAwEAAaNmMGQwHQYDVR0OBBYEFP5JzLUawNF+c3AXsYTEWHh7\nz2czMB8GA1UdIwQYMBaAFP5JzLUawNF+c3AXsYTEWHh7z2czMA4GA1UdDwEB/wQE\nAwIBBjASBgNVHRMBAf8ECDAGAQH/AgEBMA0GCSqGSIb3DQEBCwUAA4IBAQBc+Be7\nNDhpE09y7hLPZGRPl1cSKBw4RI0XIv6rlbSTFs5EebpTGjhx/whNxwEZhB9HZ711\n1Oa1YlT8xkI9DshB78mjAHCKBAJ76moK8tkG0aqdYpJ4ZcJTVBB7l98Rvgc7zfTi\ni7WemTy72deBbSeiEtXavm4EF0mWjHhQ5Nxpnp00Bqn5g1x8CyTDypgmugnep+xG\n+iFzNmTdsz7WI9T/7kDMXqB7M/FPWBORyS98OJqNDswCLF8bIZYwUBEe+bRHFomo\nShMzaC3tvim7WCb16noDkSTMlfKO4pnvKhpcVdSgwcruATV7y+W+Lvmz2OT/Gui4\nJhqeoTewsxndhDDE\n-----END CERTIFICATE-----", ) @parametrize From 20bfdf876f557f7b581728db112789cc583d7aa6 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 13 Feb 2026 21:12:16 +0000 Subject: [PATCH 006/279] chore(api): update composite API spec --- .stats.yml | 4 +-- .../mtls_certificates/mtls_certificates.py | 34 ++++++++++++++----- 2 files changed, 28 insertions(+), 10 deletions(-) diff --git a/.stats.yml b/.stats.yml index a92419a091d..4e17ca80020 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 2018 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-96674708a71bdccf65c32cfde3668102802ddcbd0013e0e6bea5fe5a15e96c2d.yml -openapi_spec_hash: 07913982475b8cd9b10e68db898a4047 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-502ff5e05c48b9d2cafd71f7fa1b833f7ccf8f328350e5f4648d065d456e765c.yml +openapi_spec_hash: 659199fd85eae22382ad710a8b1d7be1 config_hash: 7a08b6d7e050d324501d76c833118c84 diff --git a/src/cloudflare/resources/mtls_certificates/mtls_certificates.py b/src/cloudflare/resources/mtls_certificates/mtls_certificates.py index 663dbe56585..dc612d6f41a 100644 --- a/src/cloudflare/resources/mtls_certificates/mtls_certificates.py +++ b/src/cloudflare/resources/mtls_certificates/mtls_certificates.py @@ -74,7 +74,10 @@ def create( timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[MTLSCertificateCreateResponse]: """ - Upload a certificate that you want to use with mTLS-enabled Cloudflare services. + Upload a certificate that you want to use with mTLS-enabled Cloudflare services, + such as Bring Your Own CA (BYO-CA) for mTLS. To create certificates issued by + the Cloudflare managed CA, use the + [Create Client Certificate endpoint](/api/resources/client_certificates/methods/create/). Args: account_id: Identifier. @@ -131,7 +134,10 @@ def list( timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SyncSinglePage[MTLSCertificate]: """ - Lists all mTLS certificates. + Lists all mTLS certificates uploaded to your account, such as Bring Your Own CA + (BYO-CA) for mTLS. To list certificates issued by the Cloudflare managed CA, use + the + [List Client Certificates endpoint](/api/resources/client_certificates/methods/list/). Args: account_id: Identifier. @@ -214,8 +220,11 @@ def get( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[MTLSCertificate]: - """ - Fetches a single mTLS certificate. + """Fetches a single mTLS certificate uploaded to your account. + + To get a certificate + issued by the Cloudflare managed CA, use the + [Client Certificate Details endpoint](/api/resources/client_certificates/methods/get/). Args: account_id: Identifier. @@ -289,7 +298,10 @@ async def create( timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[MTLSCertificateCreateResponse]: """ - Upload a certificate that you want to use with mTLS-enabled Cloudflare services. + Upload a certificate that you want to use with mTLS-enabled Cloudflare services, + such as Bring Your Own CA (BYO-CA) for mTLS. To create certificates issued by + the Cloudflare managed CA, use the + [Create Client Certificate endpoint](/api/resources/client_certificates/methods/create/). Args: account_id: Identifier. @@ -346,7 +358,10 @@ def list( timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AsyncPaginator[MTLSCertificate, AsyncSinglePage[MTLSCertificate]]: """ - Lists all mTLS certificates. + Lists all mTLS certificates uploaded to your account, such as Bring Your Own CA + (BYO-CA) for mTLS. To list certificates issued by the Cloudflare managed CA, use + the + [List Client Certificates endpoint](/api/resources/client_certificates/methods/list/). Args: account_id: Identifier. @@ -429,8 +444,11 @@ async def get( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[MTLSCertificate]: - """ - Fetches a single mTLS certificate. + """Fetches a single mTLS certificate uploaded to your account. + + To get a certificate + issued by the Cloudflare managed CA, use the + [Client Certificate Details endpoint](/api/resources/client_certificates/methods/get/). Args: account_id: Identifier. From dd1052dec57ca99a90848910908b05680428b9a8 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 16 Feb 2026 10:59:00 +0000 Subject: [PATCH 007/279] chore(api): update composite API spec --- .stats.yml | 4 +- .../types/url_scanner/scan_get_response.py | 43 +++++++++++++++++++ 2 files changed, 45 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 4e17ca80020..46b39a1e0c8 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 2018 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-502ff5e05c48b9d2cafd71f7fa1b833f7ccf8f328350e5f4648d065d456e765c.yml -openapi_spec_hash: 659199fd85eae22382ad710a8b1d7be1 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-dfe5774fc61bc301dee0de8a3046c9ba6070c6ce55f4090a200b385f93901d33.yml +openapi_spec_hash: 83a6004cb3eb45850937b7e20b344938 config_hash: 7a08b6d7e050d324501d76c833118c84 diff --git a/src/cloudflare/types/url_scanner/scan_get_response.py b/src/cloudflare/types/url_scanner/scan_get_response.py index c2acc8e9ffa..bc7dcb7525a 100644 --- a/src/cloudflare/types/url_scanner/scan_get_response.py +++ b/src/cloudflare/types/url_scanner/scan_get_response.py @@ -47,6 +47,11 @@ "MetaProcessorsWappaData", "MetaProcessorsWappaDataCategory", "MetaProcessorsWappaDataConfidence", + "MetaProcessorsRobotsTXT", + "MetaProcessorsRobotsTXTData", + "MetaProcessorsRobotsTXTDataRules", + "MetaProcessorsRobotsTXTDataRulesapi_empty", + "MetaProcessorsRobotsTXTDataRulesapi_emptyContentSignal", "MetaProcessorsURLCategories", "MetaProcessorsURLCategoriesData", "MetaProcessorsURLCategoriesDataContent", @@ -498,6 +503,42 @@ class MetaProcessorsWappa(BaseModel): data: List[MetaProcessorsWappaData] +class MetaProcessorsRobotsTXTDataRulesapi_emptyContentSignal(BaseModel): + ai_input: Optional[str] = FieldInfo(alias="ai-input", default=None) + + ai_train: Optional[str] = FieldInfo(alias="ai-train", default=None) + + search: Optional[str] = None + + +class MetaProcessorsRobotsTXTDataRulesapi_empty(BaseModel): + allow: List[str] + + disallow: List[str] + + content_signal: Optional[MetaProcessorsRobotsTXTDataRulesapi_emptyContentSignal] = FieldInfo( + alias="contentSignal", default=None + ) + + crawl_delay: Optional[float] = FieldInfo(alias="crawlDelay", default=None) + + +class MetaProcessorsRobotsTXTDataRules(BaseModel): + api_empty: MetaProcessorsRobotsTXTDataRulesapi_empty = FieldInfo(alias="*") + + +class MetaProcessorsRobotsTXTData(BaseModel): + rules: MetaProcessorsRobotsTXTDataRules + + sitemaps: List[str] + + hash: Optional[str] = None + + +class MetaProcessorsRobotsTXT(BaseModel): + data: List[MetaProcessorsRobotsTXTData] + + class MetaProcessorsURLCategoriesDataContent(BaseModel): id: float @@ -567,6 +608,8 @@ class MetaProcessors(BaseModel): wappa: MetaProcessorsWappa + robots_txt: Optional[MetaProcessorsRobotsTXT] = FieldInfo(alias="robotsTxt", default=None) + url_categories: Optional[MetaProcessorsURLCategories] = FieldInfo(alias="urlCategories", default=None) From 7b7741b662c440a61920e6d0ab9fdf04c5130de7 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 16 Feb 2026 13:09:12 +0000 Subject: [PATCH 008/279] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 46b39a1e0c8..38c49bf318a 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 2018 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-dfe5774fc61bc301dee0de8a3046c9ba6070c6ce55f4090a200b385f93901d33.yml -openapi_spec_hash: 83a6004cb3eb45850937b7e20b344938 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-5807819d215d59200ffb9f5f7a040de93818fd7450f3a0e39ae7f7a92289bef0.yml +openapi_spec_hash: 7f66c4c6998df3f3413c58189e894df4 config_hash: 7a08b6d7e050d324501d76c833118c84 From ad6565c1373fc9c7fe70358fe1df4bbd4ef3f831 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 17 Feb 2026 14:36:50 +0000 Subject: [PATCH 009/279] chore(api): update composite API spec --- .stats.yml | 4 +- .../resources/hostnames/settings/tls.py | 74 +++++++++++++++++-- .../types/hostnames/settings/setting.py | 12 ++- .../types/hostnames/settings/setting_value.py | 4 +- .../hostnames/settings/setting_value_param.py | 4 +- .../hostnames/settings/tls_delete_response.py | 12 ++- .../hostnames/settings/tls_get_response.py | 12 ++- .../hostnames/settings/tls_update_params.py | 21 +++++- .../hostnames/settings/test_tls.py | 20 ++--- 9 files changed, 134 insertions(+), 29 deletions(-) diff --git a/.stats.yml b/.stats.yml index 38c49bf318a..ae281f0b797 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 2018 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-5807819d215d59200ffb9f5f7a040de93818fd7450f3a0e39ae7f7a92289bef0.yml -openapi_spec_hash: 7f66c4c6998df3f3413c58189e894df4 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-d5d4d4462803aafff1863a0e621429533bc3a27662fb7261d32d9b79f9ee98fd.yml +openapi_spec_hash: 202d4dd1e9e4e72678ec6290f111b5ee config_hash: 7a08b6d7e050d324501d76c833118c84 diff --git a/src/cloudflare/resources/hostnames/settings/tls.py b/src/cloudflare/resources/hostnames/settings/tls.py index 1444a94a19a..188f5c24d61 100644 --- a/src/cloudflare/resources/hostnames/settings/tls.py +++ b/src/cloudflare/resources/hostnames/settings/tls.py @@ -69,11 +69,26 @@ def update( Args: zone_id: Identifier. - setting_id: The TLS Setting name. + setting_id: + The TLS Setting name. The value type depends on the setting: + + - `ciphers`: value is an array of cipher suite strings (e.g., + `["ECDHE-RSA-AES128-GCM-SHA256", "AES128-GCM-SHA256"]`) + - `min_tls_version`: value is a TLS version string (`"1.0"`, `"1.1"`, `"1.2"`, + or `"1.3"`) + - `http2`: value is `"on"` or `"off"` hostname: The hostname for which the tls settings are set. - value: The tls setting value. + value: The TLS setting value. The type depends on the `setting_id` used in the request + path: + + - `ciphers`: an array of allowed cipher suite strings in BoringSSL format (e.g., + `["ECDHE-RSA-AES128-GCM-SHA256", "AES128-GCM-SHA256"]`) + - `min_tls_version`: a string indicating the minimum TLS version — one of + `"1.0"`, `"1.1"`, `"1.2"`, or `"1.3"` (e.g., `"1.2"`) + - `http2`: a string indicating whether HTTP/2 is enabled — `"on"` or `"off"` + (e.g., `"on"`) extra_headers: Send extra headers @@ -121,7 +136,14 @@ def delete( Args: zone_id: Identifier. - setting_id: The TLS Setting name. + setting_id: + The TLS Setting name. The value type depends on the setting: + + - `ciphers`: value is an array of cipher suite strings (e.g., + `["ECDHE-RSA-AES128-GCM-SHA256", "AES128-GCM-SHA256"]`) + - `min_tls_version`: value is a TLS version string (`"1.0"`, `"1.1"`, `"1.2"`, + or `"1.3"`) + - `http2`: value is `"on"` or `"off"` hostname: The hostname for which the tls settings are set. @@ -169,7 +191,14 @@ def get( Args: zone_id: Identifier. - setting_id: The TLS Setting name. + setting_id: + The TLS Setting name. The value type depends on the setting: + + - `ciphers`: value is an array of cipher suite strings (e.g., + `["ECDHE-RSA-AES128-GCM-SHA256", "AES128-GCM-SHA256"]`) + - `min_tls_version`: value is a TLS version string (`"1.0"`, `"1.1"`, `"1.2"`, + or `"1.3"`) + - `http2`: value is `"on"` or `"off"` extra_headers: Send extra headers @@ -233,11 +262,26 @@ async def update( Args: zone_id: Identifier. - setting_id: The TLS Setting name. + setting_id: + The TLS Setting name. The value type depends on the setting: + + - `ciphers`: value is an array of cipher suite strings (e.g., + `["ECDHE-RSA-AES128-GCM-SHA256", "AES128-GCM-SHA256"]`) + - `min_tls_version`: value is a TLS version string (`"1.0"`, `"1.1"`, `"1.2"`, + or `"1.3"`) + - `http2`: value is `"on"` or `"off"` hostname: The hostname for which the tls settings are set. - value: The tls setting value. + value: The TLS setting value. The type depends on the `setting_id` used in the request + path: + + - `ciphers`: an array of allowed cipher suite strings in BoringSSL format (e.g., + `["ECDHE-RSA-AES128-GCM-SHA256", "AES128-GCM-SHA256"]`) + - `min_tls_version`: a string indicating the minimum TLS version — one of + `"1.0"`, `"1.1"`, `"1.2"`, or `"1.3"` (e.g., `"1.2"`) + - `http2`: a string indicating whether HTTP/2 is enabled — `"on"` or `"off"` + (e.g., `"on"`) extra_headers: Send extra headers @@ -285,7 +329,14 @@ async def delete( Args: zone_id: Identifier. - setting_id: The TLS Setting name. + setting_id: + The TLS Setting name. The value type depends on the setting: + + - `ciphers`: value is an array of cipher suite strings (e.g., + `["ECDHE-RSA-AES128-GCM-SHA256", "AES128-GCM-SHA256"]`) + - `min_tls_version`: value is a TLS version string (`"1.0"`, `"1.1"`, `"1.2"`, + or `"1.3"`) + - `http2`: value is `"on"` or `"off"` hostname: The hostname for which the tls settings are set. @@ -333,7 +384,14 @@ def get( Args: zone_id: Identifier. - setting_id: The TLS Setting name. + setting_id: + The TLS Setting name. The value type depends on the setting: + + - `ciphers`: value is an array of cipher suite strings (e.g., + `["ECDHE-RSA-AES128-GCM-SHA256", "AES128-GCM-SHA256"]`) + - `min_tls_version`: value is a TLS version string (`"1.0"`, `"1.1"`, `"1.2"`, + or `"1.3"`) + - `http2`: value is `"on"` or `"off"` extra_headers: Send extra headers diff --git a/src/cloudflare/types/hostnames/settings/setting.py b/src/cloudflare/types/hostnames/settings/setting.py index 78d63b0d6b4..87be1800470 100644 --- a/src/cloudflare/types/hostnames/settings/setting.py +++ b/src/cloudflare/types/hostnames/settings/setting.py @@ -23,4 +23,14 @@ class Setting(BaseModel): """This is the time the tls setting was updated.""" value: Optional[SettingValue] = None - """The tls setting value.""" + """The TLS setting value. + + The type depends on the `setting_id` used in the request path: + + - `ciphers`: an array of allowed cipher suite strings in BoringSSL format (e.g., + `["ECDHE-RSA-AES128-GCM-SHA256", "AES128-GCM-SHA256"]`) + - `min_tls_version`: a string indicating the minimum TLS version — one of + `"1.0"`, `"1.1"`, `"1.2"`, or `"1.3"` (e.g., `"1.2"`) + - `http2`: a string indicating whether HTTP/2 is enabled — `"on"` or `"off"` + (e.g., `"on"`) + """ diff --git a/src/cloudflare/types/hostnames/settings/setting_value.py b/src/cloudflare/types/hostnames/settings/setting_value.py index 51b9395ef3d..55e30c0bab5 100644 --- a/src/cloudflare/types/hostnames/settings/setting_value.py +++ b/src/cloudflare/types/hostnames/settings/setting_value.py @@ -1,8 +1,8 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. from typing import List, Union -from typing_extensions import TypeAlias +from typing_extensions import Literal, TypeAlias __all__ = ["SettingValue"] -SettingValue: TypeAlias = Union[float, str, List[str]] +SettingValue: TypeAlias = Union[Literal["1.0", "1.1", "1.2", "1.3", "on", "off"], List[str]] diff --git a/src/cloudflare/types/hostnames/settings/setting_value_param.py b/src/cloudflare/types/hostnames/settings/setting_value_param.py index 38c0e9bb153..3be765e251b 100644 --- a/src/cloudflare/types/hostnames/settings/setting_value_param.py +++ b/src/cloudflare/types/hostnames/settings/setting_value_param.py @@ -3,10 +3,10 @@ from __future__ import annotations from typing import Union -from typing_extensions import TypeAlias +from typing_extensions import Literal, TypeAlias from ...._types import SequenceNotStr __all__ = ["SettingValueParam"] -SettingValueParam: TypeAlias = Union[float, str, SequenceNotStr[str]] +SettingValueParam: TypeAlias = Union[Literal["1.0", "1.1", "1.2", "1.3", "on", "off"], SequenceNotStr[str]] diff --git a/src/cloudflare/types/hostnames/settings/tls_delete_response.py b/src/cloudflare/types/hostnames/settings/tls_delete_response.py index 4d3fdff0d22..c50282f8ff6 100644 --- a/src/cloudflare/types/hostnames/settings/tls_delete_response.py +++ b/src/cloudflare/types/hostnames/settings/tls_delete_response.py @@ -23,4 +23,14 @@ class TLSDeleteResponse(BaseModel): """This is the time the tls setting was updated.""" value: Optional[SettingValue] = None - """The tls setting value.""" + """The TLS setting value. + + The type depends on the `setting_id` used in the request path: + + - `ciphers`: an array of allowed cipher suite strings in BoringSSL format (e.g., + `["ECDHE-RSA-AES128-GCM-SHA256", "AES128-GCM-SHA256"]`) + - `min_tls_version`: a string indicating the minimum TLS version — one of + `"1.0"`, `"1.1"`, `"1.2"`, or `"1.3"` (e.g., `"1.2"`) + - `http2`: a string indicating whether HTTP/2 is enabled — `"on"` or `"off"` + (e.g., `"on"`) + """ diff --git a/src/cloudflare/types/hostnames/settings/tls_get_response.py b/src/cloudflare/types/hostnames/settings/tls_get_response.py index 5afefb3f047..ae6589008ec 100644 --- a/src/cloudflare/types/hostnames/settings/tls_get_response.py +++ b/src/cloudflare/types/hostnames/settings/tls_get_response.py @@ -23,4 +23,14 @@ class TLSGetResponse(BaseModel): """This is the time the tls setting was updated.""" value: Optional[SettingValue] = None - """The tls setting value.""" + """The TLS setting value. + + The type depends on the `setting_id` used in the request path: + + - `ciphers`: an array of allowed cipher suite strings in BoringSSL format (e.g., + `["ECDHE-RSA-AES128-GCM-SHA256", "AES128-GCM-SHA256"]`) + - `min_tls_version`: a string indicating the minimum TLS version — one of + `"1.0"`, `"1.1"`, `"1.2"`, or `"1.3"` (e.g., `"1.2"`) + - `http2`: a string indicating whether HTTP/2 is enabled — `"on"` or `"off"` + (e.g., `"on"`) + """ diff --git a/src/cloudflare/types/hostnames/settings/tls_update_params.py b/src/cloudflare/types/hostnames/settings/tls_update_params.py index 1b398d22e23..90e8a461362 100644 --- a/src/cloudflare/types/hostnames/settings/tls_update_params.py +++ b/src/cloudflare/types/hostnames/settings/tls_update_params.py @@ -14,7 +14,24 @@ class TLSUpdateParams(TypedDict, total=False): """Identifier.""" setting_id: Required[Literal["ciphers", "min_tls_version", "http2"]] - """The TLS Setting name.""" + """The TLS Setting name. The value type depends on the setting: + + - `ciphers`: value is an array of cipher suite strings (e.g., + `["ECDHE-RSA-AES128-GCM-SHA256", "AES128-GCM-SHA256"]`) + - `min_tls_version`: value is a TLS version string (`"1.0"`, `"1.1"`, `"1.2"`, + or `"1.3"`) + - `http2`: value is `"on"` or `"off"` + """ value: Required[SettingValueParam] - """The tls setting value.""" + """The TLS setting value. + + The type depends on the `setting_id` used in the request path: + + - `ciphers`: an array of allowed cipher suite strings in BoringSSL format (e.g., + `["ECDHE-RSA-AES128-GCM-SHA256", "AES128-GCM-SHA256"]`) + - `min_tls_version`: a string indicating the minimum TLS version — one of + `"1.0"`, `"1.1"`, `"1.2"`, or `"1.3"` (e.g., `"1.2"`) + - `http2`: a string indicating whether HTTP/2 is enabled — `"on"` or `"off"` + (e.g., `"on"`) + """ diff --git a/tests/api_resources/hostnames/settings/test_tls.py b/tests/api_resources/hostnames/settings/test_tls.py index 09b8b27b4f8..a9849e27c15 100644 --- a/tests/api_resources/hostnames/settings/test_tls.py +++ b/tests/api_resources/hostnames/settings/test_tls.py @@ -28,7 +28,7 @@ def test_method_update(self, client: Cloudflare) -> None: hostname="app.example.com", zone_id="023e105f4ecef8ad9ca31a8372d0c353", setting_id="ciphers", - value=["ECDHE-RSA-AES128-GCM-SHA256", "AES128-GCM-SHA256"], + value="1.0", ) assert_matches_type(Optional[Setting], tls, path=["response"]) @@ -38,7 +38,7 @@ def test_raw_response_update(self, client: Cloudflare) -> None: hostname="app.example.com", zone_id="023e105f4ecef8ad9ca31a8372d0c353", setting_id="ciphers", - value=["ECDHE-RSA-AES128-GCM-SHA256", "AES128-GCM-SHA256"], + value="1.0", ) assert response.is_closed is True @@ -52,7 +52,7 @@ def test_streaming_response_update(self, client: Cloudflare) -> None: hostname="app.example.com", zone_id="023e105f4ecef8ad9ca31a8372d0c353", setting_id="ciphers", - value=["ECDHE-RSA-AES128-GCM-SHA256", "AES128-GCM-SHA256"], + value="1.0", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -69,7 +69,7 @@ def test_path_params_update(self, client: Cloudflare) -> None: hostname="app.example.com", zone_id="", setting_id="ciphers", - value=["ECDHE-RSA-AES128-GCM-SHA256", "AES128-GCM-SHA256"], + value="1.0", ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `hostname` but received ''"): @@ -77,7 +77,7 @@ def test_path_params_update(self, client: Cloudflare) -> None: hostname="", zone_id="023e105f4ecef8ad9ca31a8372d0c353", setting_id="ciphers", - value=["ECDHE-RSA-AES128-GCM-SHA256", "AES128-GCM-SHA256"], + value="1.0", ) @parametrize @@ -187,7 +187,7 @@ async def test_method_update(self, async_client: AsyncCloudflare) -> None: hostname="app.example.com", zone_id="023e105f4ecef8ad9ca31a8372d0c353", setting_id="ciphers", - value=["ECDHE-RSA-AES128-GCM-SHA256", "AES128-GCM-SHA256"], + value="1.0", ) assert_matches_type(Optional[Setting], tls, path=["response"]) @@ -197,7 +197,7 @@ async def test_raw_response_update(self, async_client: AsyncCloudflare) -> None: hostname="app.example.com", zone_id="023e105f4ecef8ad9ca31a8372d0c353", setting_id="ciphers", - value=["ECDHE-RSA-AES128-GCM-SHA256", "AES128-GCM-SHA256"], + value="1.0", ) assert response.is_closed is True @@ -211,7 +211,7 @@ async def test_streaming_response_update(self, async_client: AsyncCloudflare) -> hostname="app.example.com", zone_id="023e105f4ecef8ad9ca31a8372d0c353", setting_id="ciphers", - value=["ECDHE-RSA-AES128-GCM-SHA256", "AES128-GCM-SHA256"], + value="1.0", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -228,7 +228,7 @@ async def test_path_params_update(self, async_client: AsyncCloudflare) -> None: hostname="app.example.com", zone_id="", setting_id="ciphers", - value=["ECDHE-RSA-AES128-GCM-SHA256", "AES128-GCM-SHA256"], + value="1.0", ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `hostname` but received ''"): @@ -236,7 +236,7 @@ async def test_path_params_update(self, async_client: AsyncCloudflare) -> None: hostname="", zone_id="023e105f4ecef8ad9ca31a8372d0c353", setting_id="ciphers", - value=["ECDHE-RSA-AES128-GCM-SHA256", "AES128-GCM-SHA256"], + value="1.0", ) @parametrize From 09e3fb14dfba4fdf088feaa2d567e63065c5960e Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 17 Feb 2026 15:41:34 +0000 Subject: [PATCH 010/279] chore(api): update composite API spec --- .stats.yml | 6 +- api.md | 20 - src/cloudflare/resources/workers/__init__.py | 14 - .../workers/observability/__init__.py | 33 - .../workers/observability/observability.py | 102 -- .../workers/observability/telemetry.py | 560 ----------- src/cloudflare/resources/workers/workers.py | 32 - .../types/workers/observability/__init__.py | 7 - .../observability/telemetry_keys_params.py | 92 -- .../observability/telemetry_keys_response.py | 17 - .../observability/telemetry_query_params.py | 249 ----- .../observability/telemetry_query_response.py | 931 ------------------ .../observability/telemetry_values_params.py | 94 -- .../telemetry_values_response.py | 18 - .../api_resources/test_client_certificates.py | 16 +- tests/api_resources/test_custom_hostnames.py | 8 +- .../test_keyless_certificates.py | 20 +- .../workers/observability/__init__.py | 1 - .../workers/observability/test_telemetry.py | 599 ----------- 19 files changed, 25 insertions(+), 2794 deletions(-) delete mode 100644 src/cloudflare/resources/workers/observability/__init__.py delete mode 100644 src/cloudflare/resources/workers/observability/observability.py delete mode 100644 src/cloudflare/resources/workers/observability/telemetry.py delete mode 100644 src/cloudflare/types/workers/observability/telemetry_keys_params.py delete mode 100644 src/cloudflare/types/workers/observability/telemetry_keys_response.py delete mode 100644 src/cloudflare/types/workers/observability/telemetry_query_params.py delete mode 100644 src/cloudflare/types/workers/observability/telemetry_query_response.py delete mode 100644 src/cloudflare/types/workers/observability/telemetry_values_params.py delete mode 100644 src/cloudflare/types/workers/observability/telemetry_values_response.py delete mode 100644 tests/api_resources/workers/observability/__init__.py delete mode 100644 tests/api_resources/workers/observability/test_telemetry.py diff --git a/.stats.yml b/.stats.yml index ae281f0b797..a4591e15a40 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ -configured_endpoints: 2018 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-d5d4d4462803aafff1863a0e621429533bc3a27662fb7261d32d9b79f9ee98fd.yml -openapi_spec_hash: 202d4dd1e9e4e72678ec6290f111b5ee +configured_endpoints: 2015 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-a2cb90b273f4b2f2f1d7b5b1dc8d12401512d5fa26c8e3238532ddf21d5cb2ba.yml +openapi_spec_hash: 382f52cee347b776d182ad32ea3dd7cf config_hash: 7a08b6d7e050d324501d76c833118c84 diff --git a/api.md b/api.md index c2d31bcbff4..7c5ff7b6bde 100644 --- a/api.md +++ b/api.md @@ -2623,26 +2623,6 @@ Methods: - client.workers.subdomains.delete(\*, account_id) -> None - client.workers.subdomains.get(\*, account_id) -> SubdomainGetResponse -## Observability - -### Telemetry - -Types: - -```python -from cloudflare.types.workers.observability import ( - TelemetryKeysResponse, - TelemetryQueryResponse, - TelemetryValuesResponse, -) -``` - -Methods: - -- client.workers.observability.telemetry.keys(\*, account_id, \*\*params) -> SyncSinglePage[TelemetryKeysResponse] -- client.workers.observability.telemetry.query(\*, account_id, \*\*params) -> TelemetryQueryResponse -- client.workers.observability.telemetry.values(\*, account_id, \*\*params) -> SyncSinglePage[TelemetryValuesResponse] - # KV ## Namespaces diff --git a/src/cloudflare/resources/workers/__init__.py b/src/cloudflare/resources/workers/__init__.py index 67e210847ab..a54a129fd66 100644 --- a/src/cloudflare/resources/workers/__init__.py +++ b/src/cloudflare/resources/workers/__init__.py @@ -56,14 +56,6 @@ SubdomainsResourceWithStreamingResponse, AsyncSubdomainsResourceWithStreamingResponse, ) -from .observability import ( - ObservabilityResource, - AsyncObservabilityResource, - ObservabilityResourceWithRawResponse, - AsyncObservabilityResourceWithRawResponse, - ObservabilityResourceWithStreamingResponse, - AsyncObservabilityResourceWithStreamingResponse, -) from .account_settings import ( AccountSettingsResource, AsyncAccountSettingsResource, @@ -116,12 +108,6 @@ "AsyncSubdomainsResourceWithRawResponse", "SubdomainsResourceWithStreamingResponse", "AsyncSubdomainsResourceWithStreamingResponse", - "ObservabilityResource", - "AsyncObservabilityResource", - "ObservabilityResourceWithRawResponse", - "AsyncObservabilityResourceWithRawResponse", - "ObservabilityResourceWithStreamingResponse", - "AsyncObservabilityResourceWithStreamingResponse", "WorkersResource", "AsyncWorkersResource", "WorkersResourceWithRawResponse", diff --git a/src/cloudflare/resources/workers/observability/__init__.py b/src/cloudflare/resources/workers/observability/__init__.py deleted file mode 100644 index aa9190629cd..00000000000 --- a/src/cloudflare/resources/workers/observability/__init__.py +++ /dev/null @@ -1,33 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from .telemetry import ( - TelemetryResource, - AsyncTelemetryResource, - TelemetryResourceWithRawResponse, - AsyncTelemetryResourceWithRawResponse, - TelemetryResourceWithStreamingResponse, - AsyncTelemetryResourceWithStreamingResponse, -) -from .observability import ( - ObservabilityResource, - AsyncObservabilityResource, - ObservabilityResourceWithRawResponse, - AsyncObservabilityResourceWithRawResponse, - ObservabilityResourceWithStreamingResponse, - AsyncObservabilityResourceWithStreamingResponse, -) - -__all__ = [ - "TelemetryResource", - "AsyncTelemetryResource", - "TelemetryResourceWithRawResponse", - "AsyncTelemetryResourceWithRawResponse", - "TelemetryResourceWithStreamingResponse", - "AsyncTelemetryResourceWithStreamingResponse", - "ObservabilityResource", - "AsyncObservabilityResource", - "ObservabilityResourceWithRawResponse", - "AsyncObservabilityResourceWithRawResponse", - "ObservabilityResourceWithStreamingResponse", - "AsyncObservabilityResourceWithStreamingResponse", -] diff --git a/src/cloudflare/resources/workers/observability/observability.py b/src/cloudflare/resources/workers/observability/observability.py deleted file mode 100644 index 7e09842a71a..00000000000 --- a/src/cloudflare/resources/workers/observability/observability.py +++ /dev/null @@ -1,102 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from .telemetry import ( - TelemetryResource, - AsyncTelemetryResource, - TelemetryResourceWithRawResponse, - AsyncTelemetryResourceWithRawResponse, - TelemetryResourceWithStreamingResponse, - AsyncTelemetryResourceWithStreamingResponse, -) -from ...._compat import cached_property -from ...._resource import SyncAPIResource, AsyncAPIResource - -__all__ = ["ObservabilityResource", "AsyncObservabilityResource"] - - -class ObservabilityResource(SyncAPIResource): - @cached_property - def telemetry(self) -> TelemetryResource: - return TelemetryResource(self._client) - - @cached_property - def with_raw_response(self) -> ObservabilityResourceWithRawResponse: - """ - This property can be used as a prefix for any HTTP method call to return - the raw response object instead of the parsed content. - - For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers - """ - return ObservabilityResourceWithRawResponse(self) - - @cached_property - def with_streaming_response(self) -> ObservabilityResourceWithStreamingResponse: - """ - An alternative to `.with_raw_response` that doesn't eagerly read the response body. - - For more information, see https://www.github.com/cloudflare/cloudflare-python#with_streaming_response - """ - return ObservabilityResourceWithStreamingResponse(self) - - -class AsyncObservabilityResource(AsyncAPIResource): - @cached_property - def telemetry(self) -> AsyncTelemetryResource: - return AsyncTelemetryResource(self._client) - - @cached_property - def with_raw_response(self) -> AsyncObservabilityResourceWithRawResponse: - """ - This property can be used as a prefix for any HTTP method call to return - the raw response object instead of the parsed content. - - For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers - """ - return AsyncObservabilityResourceWithRawResponse(self) - - @cached_property - def with_streaming_response(self) -> AsyncObservabilityResourceWithStreamingResponse: - """ - An alternative to `.with_raw_response` that doesn't eagerly read the response body. - - For more information, see https://www.github.com/cloudflare/cloudflare-python#with_streaming_response - """ - return AsyncObservabilityResourceWithStreamingResponse(self) - - -class ObservabilityResourceWithRawResponse: - def __init__(self, observability: ObservabilityResource) -> None: - self._observability = observability - - @cached_property - def telemetry(self) -> TelemetryResourceWithRawResponse: - return TelemetryResourceWithRawResponse(self._observability.telemetry) - - -class AsyncObservabilityResourceWithRawResponse: - def __init__(self, observability: AsyncObservabilityResource) -> None: - self._observability = observability - - @cached_property - def telemetry(self) -> AsyncTelemetryResourceWithRawResponse: - return AsyncTelemetryResourceWithRawResponse(self._observability.telemetry) - - -class ObservabilityResourceWithStreamingResponse: - def __init__(self, observability: ObservabilityResource) -> None: - self._observability = observability - - @cached_property - def telemetry(self) -> TelemetryResourceWithStreamingResponse: - return TelemetryResourceWithStreamingResponse(self._observability.telemetry) - - -class AsyncObservabilityResourceWithStreamingResponse: - def __init__(self, observability: AsyncObservabilityResource) -> None: - self._observability = observability - - @cached_property - def telemetry(self) -> AsyncTelemetryResourceWithStreamingResponse: - return AsyncTelemetryResourceWithStreamingResponse(self._observability.telemetry) diff --git a/src/cloudflare/resources/workers/observability/telemetry.py b/src/cloudflare/resources/workers/observability/telemetry.py deleted file mode 100644 index 4970c5c4fac..00000000000 --- a/src/cloudflare/resources/workers/observability/telemetry.py +++ /dev/null @@ -1,560 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import Type, Iterable, cast -from typing_extensions import Literal - -import httpx - -from ...._types import Body, Omit, Query, Headers, NotGiven, SequenceNotStr, omit, not_given -from ...._utils import maybe_transform, async_maybe_transform -from ...._compat import cached_property -from ...._resource import SyncAPIResource, AsyncAPIResource -from ...._response import ( - to_raw_response_wrapper, - to_streamed_response_wrapper, - 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.workers.observability import telemetry_keys_params, telemetry_query_params, telemetry_values_params -from ....types.workers.observability.telemetry_keys_response import TelemetryKeysResponse -from ....types.workers.observability.telemetry_query_response import TelemetryQueryResponse -from ....types.workers.observability.telemetry_values_response import TelemetryValuesResponse - -__all__ = ["TelemetryResource", "AsyncTelemetryResource"] - - -class TelemetryResource(SyncAPIResource): - @cached_property - def with_raw_response(self) -> TelemetryResourceWithRawResponse: - """ - This property can be used as a prefix for any HTTP method call to return - the raw response object instead of the parsed content. - - For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers - """ - return TelemetryResourceWithRawResponse(self) - - @cached_property - def with_streaming_response(self) -> TelemetryResourceWithStreamingResponse: - """ - An alternative to `.with_raw_response` that doesn't eagerly read the response body. - - For more information, see https://www.github.com/cloudflare/cloudflare-python#with_streaming_response - """ - return TelemetryResourceWithStreamingResponse(self) - - def keys( - self, - *, - account_id: str, - datasets: SequenceNotStr[str] | Omit = omit, - filters: Iterable[telemetry_keys_params.Filter] | Omit = omit, - from_: float | Omit = omit, - key_needle: telemetry_keys_params.KeyNeedle | Omit = omit, - limit: float | Omit = omit, - needle: telemetry_keys_params.Needle | Omit = omit, - to: float | 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, - ) -> SyncSinglePage[TelemetryKeysResponse]: - """ - List all the keys in your telemetry events. - - Args: - key_needle: Search for a specific substring in the keys. - - needle: Search for a specific substring in any of the events - - 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( - f"/accounts/{account_id}/workers/observability/telemetry/keys", - page=SyncSinglePage[TelemetryKeysResponse], - body=maybe_transform( - { - "datasets": datasets, - "filters": filters, - "from_": from_, - "key_needle": key_needle, - "limit": limit, - "needle": needle, - "to": to, - }, - telemetry_keys_params.TelemetryKeysParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - model=TelemetryKeysResponse, - method="post", - ) - - def query( - self, - *, - account_id: str, - query_id: str, - timeframe: telemetry_query_params.Timeframe, - chart: bool | Omit = omit, - compare: bool | Omit = omit, - dry: bool | Omit = omit, - granularity: float | Omit = omit, - ignore_series: bool | Omit = omit, - limit: float | Omit = omit, - offset: str | Omit = omit, - offset_by: float | Omit = omit, - offset_direction: str | Omit = omit, - parameters: telemetry_query_params.Parameters | Omit = omit, - pattern_type: Literal["message", "error"] | Omit = omit, - view: Literal["traces", "events", "calculations", "invocations", "requests", "patterns"] | 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, - ) -> TelemetryQueryResponse: - """ - Runs a temporary or saved query - - Args: - query_id: Unique identifier for the query to execute - - timeframe: Time range for the query execution - - chart: Whether to include timeseties data in the response - - compare: Whether to include comparison data with previous time periods - - dry: Whether to perform a dry run without saving the results of the query. Useful for - validation - - granularity: Time granularity for aggregating results (in milliseconds). Controls the - bucketing of time-series data - - ignore_series: Whether to ignore time-series data in the results and return only aggregated - values - - limit: Maximum number of events to return. - - offset: Cursor for pagination to retrieve the next set of results - - offset_by: Number of events to skip for pagination. Used in conjunction with offset - - offset_direction: Direction for offset-based pagination (e.g., 'next', 'prev') - - parameters: Optional parameters to pass to the query execution - - pattern_type: Type of pattern to search for when using pattern-based views - - view: View type for presenting the query results. - - 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._post( - f"/accounts/{account_id}/workers/observability/telemetry/query", - body=maybe_transform( - { - "query_id": query_id, - "timeframe": timeframe, - "chart": chart, - "compare": compare, - "dry": dry, - "granularity": granularity, - "ignore_series": ignore_series, - "limit": limit, - "offset": offset, - "offset_by": offset_by, - "offset_direction": offset_direction, - "parameters": parameters, - "pattern_type": pattern_type, - "view": view, - }, - telemetry_query_params.TelemetryQueryParams, - ), - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper[TelemetryQueryResponse]._unwrapper, - ), - cast_to=cast(Type[TelemetryQueryResponse], ResultWrapper[TelemetryQueryResponse]), - ) - - def values( - self, - *, - account_id: str, - datasets: SequenceNotStr[str], - key: str, - timeframe: telemetry_values_params.Timeframe, - type: Literal["string", "boolean", "number"], - filters: Iterable[telemetry_values_params.Filter] | Omit = omit, - limit: float | Omit = omit, - needle: telemetry_values_params.Needle | 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, - ) -> SyncSinglePage[TelemetryValuesResponse]: - """ - List unique values found in your events - - Args: - needle: Search for a specific substring in the event. - - 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( - f"/accounts/{account_id}/workers/observability/telemetry/values", - page=SyncSinglePage[TelemetryValuesResponse], - body=maybe_transform( - { - "datasets": datasets, - "key": key, - "timeframe": timeframe, - "type": type, - "filters": filters, - "limit": limit, - "needle": needle, - }, - telemetry_values_params.TelemetryValuesParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - model=TelemetryValuesResponse, - method="post", - ) - - -class AsyncTelemetryResource(AsyncAPIResource): - @cached_property - def with_raw_response(self) -> AsyncTelemetryResourceWithRawResponse: - """ - This property can be used as a prefix for any HTTP method call to return - the raw response object instead of the parsed content. - - For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers - """ - return AsyncTelemetryResourceWithRawResponse(self) - - @cached_property - def with_streaming_response(self) -> AsyncTelemetryResourceWithStreamingResponse: - """ - An alternative to `.with_raw_response` that doesn't eagerly read the response body. - - For more information, see https://www.github.com/cloudflare/cloudflare-python#with_streaming_response - """ - return AsyncTelemetryResourceWithStreamingResponse(self) - - def keys( - self, - *, - account_id: str, - datasets: SequenceNotStr[str] | Omit = omit, - filters: Iterable[telemetry_keys_params.Filter] | Omit = omit, - from_: float | Omit = omit, - key_needle: telemetry_keys_params.KeyNeedle | Omit = omit, - limit: float | Omit = omit, - needle: telemetry_keys_params.Needle | Omit = omit, - to: float | 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, - ) -> AsyncPaginator[TelemetryKeysResponse, AsyncSinglePage[TelemetryKeysResponse]]: - """ - List all the keys in your telemetry events. - - Args: - key_needle: Search for a specific substring in the keys. - - needle: Search for a specific substring in any of the events - - 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( - f"/accounts/{account_id}/workers/observability/telemetry/keys", - page=AsyncSinglePage[TelemetryKeysResponse], - body=maybe_transform( - { - "datasets": datasets, - "filters": filters, - "from_": from_, - "key_needle": key_needle, - "limit": limit, - "needle": needle, - "to": to, - }, - telemetry_keys_params.TelemetryKeysParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - model=TelemetryKeysResponse, - method="post", - ) - - async def query( - self, - *, - account_id: str, - query_id: str, - timeframe: telemetry_query_params.Timeframe, - chart: bool | Omit = omit, - compare: bool | Omit = omit, - dry: bool | Omit = omit, - granularity: float | Omit = omit, - ignore_series: bool | Omit = omit, - limit: float | Omit = omit, - offset: str | Omit = omit, - offset_by: float | Omit = omit, - offset_direction: str | Omit = omit, - parameters: telemetry_query_params.Parameters | Omit = omit, - pattern_type: Literal["message", "error"] | Omit = omit, - view: Literal["traces", "events", "calculations", "invocations", "requests", "patterns"] | 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, - ) -> TelemetryQueryResponse: - """ - Runs a temporary or saved query - - Args: - query_id: Unique identifier for the query to execute - - timeframe: Time range for the query execution - - chart: Whether to include timeseties data in the response - - compare: Whether to include comparison data with previous time periods - - dry: Whether to perform a dry run without saving the results of the query. Useful for - validation - - granularity: Time granularity for aggregating results (in milliseconds). Controls the - bucketing of time-series data - - ignore_series: Whether to ignore time-series data in the results and return only aggregated - values - - limit: Maximum number of events to return. - - offset: Cursor for pagination to retrieve the next set of results - - offset_by: Number of events to skip for pagination. Used in conjunction with offset - - offset_direction: Direction for offset-based pagination (e.g., 'next', 'prev') - - parameters: Optional parameters to pass to the query execution - - pattern_type: Type of pattern to search for when using pattern-based views - - view: View type for presenting the query results. - - 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 await self._post( - f"/accounts/{account_id}/workers/observability/telemetry/query", - body=await async_maybe_transform( - { - "query_id": query_id, - "timeframe": timeframe, - "chart": chart, - "compare": compare, - "dry": dry, - "granularity": granularity, - "ignore_series": ignore_series, - "limit": limit, - "offset": offset, - "offset_by": offset_by, - "offset_direction": offset_direction, - "parameters": parameters, - "pattern_type": pattern_type, - "view": view, - }, - telemetry_query_params.TelemetryQueryParams, - ), - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper[TelemetryQueryResponse]._unwrapper, - ), - cast_to=cast(Type[TelemetryQueryResponse], ResultWrapper[TelemetryQueryResponse]), - ) - - def values( - self, - *, - account_id: str, - datasets: SequenceNotStr[str], - key: str, - timeframe: telemetry_values_params.Timeframe, - type: Literal["string", "boolean", "number"], - filters: Iterable[telemetry_values_params.Filter] | Omit = omit, - limit: float | Omit = omit, - needle: telemetry_values_params.Needle | 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, - ) -> AsyncPaginator[TelemetryValuesResponse, AsyncSinglePage[TelemetryValuesResponse]]: - """ - List unique values found in your events - - Args: - needle: Search for a specific substring in the event. - - 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( - f"/accounts/{account_id}/workers/observability/telemetry/values", - page=AsyncSinglePage[TelemetryValuesResponse], - body=maybe_transform( - { - "datasets": datasets, - "key": key, - "timeframe": timeframe, - "type": type, - "filters": filters, - "limit": limit, - "needle": needle, - }, - telemetry_values_params.TelemetryValuesParams, - ), - options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout - ), - model=TelemetryValuesResponse, - method="post", - ) - - -class TelemetryResourceWithRawResponse: - def __init__(self, telemetry: TelemetryResource) -> None: - self._telemetry = telemetry - - self.keys = to_raw_response_wrapper( - telemetry.keys, - ) - self.query = to_raw_response_wrapper( - telemetry.query, - ) - self.values = to_raw_response_wrapper( - telemetry.values, - ) - - -class AsyncTelemetryResourceWithRawResponse: - def __init__(self, telemetry: AsyncTelemetryResource) -> None: - self._telemetry = telemetry - - self.keys = async_to_raw_response_wrapper( - telemetry.keys, - ) - self.query = async_to_raw_response_wrapper( - telemetry.query, - ) - self.values = async_to_raw_response_wrapper( - telemetry.values, - ) - - -class TelemetryResourceWithStreamingResponse: - def __init__(self, telemetry: TelemetryResource) -> None: - self._telemetry = telemetry - - self.keys = to_streamed_response_wrapper( - telemetry.keys, - ) - self.query = to_streamed_response_wrapper( - telemetry.query, - ) - self.values = to_streamed_response_wrapper( - telemetry.values, - ) - - -class AsyncTelemetryResourceWithStreamingResponse: - def __init__(self, telemetry: AsyncTelemetryResource) -> None: - self._telemetry = telemetry - - self.keys = async_to_streamed_response_wrapper( - telemetry.keys, - ) - self.query = async_to_streamed_response_wrapper( - telemetry.query, - ) - self.values = async_to_streamed_response_wrapper( - telemetry.values, - ) diff --git a/src/cloudflare/resources/workers/workers.py b/src/cloudflare/resources/workers/workers.py index 971c066d436..c28090c1f2d 100644 --- a/src/cloudflare/resources/workers/workers.py +++ b/src/cloudflare/resources/workers/workers.py @@ -60,14 +60,6 @@ AccountSettingsResourceWithStreamingResponse, AsyncAccountSettingsResourceWithStreamingResponse, ) -from .observability.observability import ( - ObservabilityResource, - AsyncObservabilityResource, - ObservabilityResourceWithRawResponse, - AsyncObservabilityResourceWithRawResponse, - ObservabilityResourceWithStreamingResponse, - AsyncObservabilityResourceWithStreamingResponse, -) __all__ = ["WorkersResource", "AsyncWorkersResource"] @@ -101,10 +93,6 @@ def domains(self) -> DomainsResource: def subdomains(self) -> SubdomainsResource: return SubdomainsResource(self._client) - @cached_property - def observability(self) -> ObservabilityResource: - return ObservabilityResource(self._client) - @cached_property def with_raw_response(self) -> WorkersResourceWithRawResponse: """ @@ -154,10 +142,6 @@ def domains(self) -> AsyncDomainsResource: def subdomains(self) -> AsyncSubdomainsResource: return AsyncSubdomainsResource(self._client) - @cached_property - def observability(self) -> AsyncObservabilityResource: - return AsyncObservabilityResource(self._client) - @cached_property def with_raw_response(self) -> AsyncWorkersResourceWithRawResponse: """ @@ -210,10 +194,6 @@ def domains(self) -> DomainsResourceWithRawResponse: def subdomains(self) -> SubdomainsResourceWithRawResponse: return SubdomainsResourceWithRawResponse(self._workers.subdomains) - @cached_property - def observability(self) -> ObservabilityResourceWithRawResponse: - return ObservabilityResourceWithRawResponse(self._workers.observability) - class AsyncWorkersResourceWithRawResponse: def __init__(self, workers: AsyncWorkersResource) -> None: @@ -247,10 +227,6 @@ def domains(self) -> AsyncDomainsResourceWithRawResponse: def subdomains(self) -> AsyncSubdomainsResourceWithRawResponse: return AsyncSubdomainsResourceWithRawResponse(self._workers.subdomains) - @cached_property - def observability(self) -> AsyncObservabilityResourceWithRawResponse: - return AsyncObservabilityResourceWithRawResponse(self._workers.observability) - class WorkersResourceWithStreamingResponse: def __init__(self, workers: WorkersResource) -> None: @@ -284,10 +260,6 @@ def domains(self) -> DomainsResourceWithStreamingResponse: def subdomains(self) -> SubdomainsResourceWithStreamingResponse: return SubdomainsResourceWithStreamingResponse(self._workers.subdomains) - @cached_property - def observability(self) -> ObservabilityResourceWithStreamingResponse: - return ObservabilityResourceWithStreamingResponse(self._workers.observability) - class AsyncWorkersResourceWithStreamingResponse: def __init__(self, workers: AsyncWorkersResource) -> None: @@ -320,7 +292,3 @@ def domains(self) -> AsyncDomainsResourceWithStreamingResponse: @cached_property def subdomains(self) -> AsyncSubdomainsResourceWithStreamingResponse: return AsyncSubdomainsResourceWithStreamingResponse(self._workers.subdomains) - - @cached_property - def observability(self) -> AsyncObservabilityResourceWithStreamingResponse: - return AsyncObservabilityResourceWithStreamingResponse(self._workers.observability) diff --git a/src/cloudflare/types/workers/observability/__init__.py b/src/cloudflare/types/workers/observability/__init__.py index 0aaa1d0adea..f8ee8b14b1c 100644 --- a/src/cloudflare/types/workers/observability/__init__.py +++ b/src/cloudflare/types/workers/observability/__init__.py @@ -1,10 +1,3 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. from __future__ import annotations - -from .telemetry_keys_params import TelemetryKeysParams as TelemetryKeysParams -from .telemetry_query_params import TelemetryQueryParams as TelemetryQueryParams -from .telemetry_keys_response import TelemetryKeysResponse as TelemetryKeysResponse -from .telemetry_values_params import TelemetryValuesParams as TelemetryValuesParams -from .telemetry_query_response import TelemetryQueryResponse as TelemetryQueryResponse -from .telemetry_values_response import TelemetryValuesResponse as TelemetryValuesResponse diff --git a/src/cloudflare/types/workers/observability/telemetry_keys_params.py b/src/cloudflare/types/workers/observability/telemetry_keys_params.py deleted file mode 100644 index df515b7c392..00000000000 --- a/src/cloudflare/types/workers/observability/telemetry_keys_params.py +++ /dev/null @@ -1,92 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import Union, Iterable -from typing_extensions import Literal, Required, Annotated, TypedDict - -from ...._types import SequenceNotStr -from ...._utils import PropertyInfo - -__all__ = ["TelemetryKeysParams", "Filter", "KeyNeedle", "Needle"] - - -class TelemetryKeysParams(TypedDict, total=False): - account_id: Required[str] - - datasets: SequenceNotStr[str] - - filters: Iterable[Filter] - - from_: Annotated[float, PropertyInfo(alias="from")] - - key_needle: Annotated[KeyNeedle, PropertyInfo(alias="keyNeedle")] - """Search for a specific substring in the keys.""" - - limit: float - - needle: Needle - """Search for a specific substring in any of the events""" - - to: float - - -class Filter(TypedDict, total=False): - key: Required[str] - - 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", - ] - ] - - type: Required[Literal["string", "number", "boolean"]] - - value: Union[str, float, bool] - - -class KeyNeedle(TypedDict, total=False): - """Search for a specific substring in the keys.""" - - value: Required[Union[str, float, bool]] - - is_regex: Annotated[bool, PropertyInfo(alias="isRegex")] - - match_case: Annotated[bool, PropertyInfo(alias="matchCase")] - - -class Needle(TypedDict, total=False): - """Search for a specific substring in any of the events""" - - value: Required[Union[str, float, bool]] - - is_regex: Annotated[bool, PropertyInfo(alias="isRegex")] - - match_case: Annotated[bool, PropertyInfo(alias="matchCase")] diff --git a/src/cloudflare/types/workers/observability/telemetry_keys_response.py b/src/cloudflare/types/workers/observability/telemetry_keys_response.py deleted file mode 100644 index ebe8e775743..00000000000 --- a/src/cloudflare/types/workers/observability/telemetry_keys_response.py +++ /dev/null @@ -1,17 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing_extensions import Literal - -from pydantic import Field as FieldInfo - -from ...._models import BaseModel - -__all__ = ["TelemetryKeysResponse"] - - -class TelemetryKeysResponse(BaseModel): - key: str - - last_seen_at: float = FieldInfo(alias="lastSeenAt") - - type: Literal["string", "boolean", "number"] diff --git a/src/cloudflare/types/workers/observability/telemetry_query_params.py b/src/cloudflare/types/workers/observability/telemetry_query_params.py deleted file mode 100644 index 7b81dadee5e..00000000000 --- a/src/cloudflare/types/workers/observability/telemetry_query_params.py +++ /dev/null @@ -1,249 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import Union, Iterable -from typing_extensions import Literal, Required, Annotated, TypedDict - -from ...._types import SequenceNotStr -from ...._utils import PropertyInfo - -__all__ = [ - "TelemetryQueryParams", - "Timeframe", - "Parameters", - "ParametersCalculation", - "ParametersFilter", - "ParametersGroupBy", - "ParametersHaving", - "ParametersNeedle", - "ParametersOrderBy", -] - - -class TelemetryQueryParams(TypedDict, total=False): - account_id: Required[str] - - query_id: Required[Annotated[str, PropertyInfo(alias="queryId")]] - """Unique identifier for the query to execute""" - - timeframe: Required[Timeframe] - """Time range for the query execution""" - - chart: bool - """Whether to include timeseties data in the response""" - - compare: bool - """Whether to include comparison data with previous time periods""" - - dry: bool - """Whether to perform a dry run without saving the results of the query. - - Useful for validation - """ - - granularity: float - """Time granularity for aggregating results (in milliseconds). - - Controls the bucketing of time-series data - """ - - ignore_series: Annotated[bool, PropertyInfo(alias="ignoreSeries")] - """ - Whether to ignore time-series data in the results and return only aggregated - values - """ - - limit: float - """Maximum number of events to return.""" - - offset: str - """Cursor for pagination to retrieve the next set of results""" - - offset_by: Annotated[float, PropertyInfo(alias="offsetBy")] - """Number of events to skip for pagination. Used in conjunction with offset""" - - offset_direction: Annotated[str, PropertyInfo(alias="offsetDirection")] - """Direction for offset-based pagination (e.g., 'next', 'prev')""" - - parameters: Parameters - """Optional parameters to pass to the query execution""" - - pattern_type: Annotated[Literal["message", "error"], PropertyInfo(alias="patternType")] - """Type of pattern to search for when using pattern-based views""" - - view: Literal["traces", "events", "calculations", "invocations", "requests", "patterns"] - """View type for presenting the query results.""" - - -_TimeframeReservedKeywords = TypedDict( - "_TimeframeReservedKeywords", - { - "from": float, - }, - total=False, -) - - -class Timeframe(_TimeframeReservedKeywords, total=False): - """Time range for the query execution""" - - to: Required[float] - """End timestamp for the query timeframe (Unix timestamp in milliseconds)""" - - -class ParametersCalculation(TypedDict, total=False): - operator: Required[ - Literal[ - "uniq", - "count", - "max", - "min", - "sum", - "avg", - "median", - "p001", - "p01", - "p05", - "p10", - "p25", - "p75", - "p90", - "p95", - "p99", - "p999", - "stddev", - "variance", - "COUNT_DISTINCT", - "COUNT", - "MAX", - "MIN", - "SUM", - "AVG", - "MEDIAN", - "P001", - "P01", - "P05", - "P10", - "P25", - "P75", - "P90", - "P95", - "P99", - "P999", - "STDDEV", - "VARIANCE", - ] - ] - - alias: str - - key: str - - key_type: Annotated[Literal["string", "number", "boolean"], PropertyInfo(alias="keyType")] - - -class ParametersFilter(TypedDict, total=False): - key: Required[str] - - 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", - ] - ] - - type: Required[Literal["string", "number", "boolean"]] - - value: Union[str, float, bool] - - -class ParametersGroupBy(TypedDict, total=False): - type: Required[Literal["string", "number", "boolean"]] - - value: Required[str] - - -class ParametersHaving(TypedDict, total=False): - key: Required[str] - - operation: Required[Literal["eq", "neq", "gt", "gte", "lt", "lte"]] - - value: Required[float] - - -class ParametersNeedle(TypedDict, total=False): - """Define an expression to search using full-text search.""" - - value: Required[Union[str, float, bool]] - - is_regex: Annotated[bool, PropertyInfo(alias="isRegex")] - - match_case: Annotated[bool, PropertyInfo(alias="matchCase")] - - -class ParametersOrderBy(TypedDict, total=False): - """Configure the order of the results returned by the query.""" - - value: Required[str] - """Configure which Calculation to order the results by.""" - - order: Literal["asc", "desc"] - """Set the order of the results""" - - -class Parameters(TypedDict, total=False): - """Optional parameters to pass to the query execution""" - - calculations: Iterable[ParametersCalculation] - """Create Calculations to compute as part of the query.""" - - datasets: SequenceNotStr[str] - """Set the Datasets to query. Leave it empty to query all the 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.""" - - filters: Iterable[ParametersFilter] - """Configure the Filters to apply to the query.""" - - group_bys: Annotated[Iterable[ParametersGroupBy], PropertyInfo(alias="groupBys")] - """Define how to group the results of the query.""" - - havings: Iterable[ParametersHaving] - """Configure the Having clauses that filter on calculations in the query result.""" - - limit: int - """Set a limit on the number of results / records returned by the query""" - - needle: ParametersNeedle - """Define an expression to search using full-text search.""" - - order_by: Annotated[ParametersOrderBy, PropertyInfo(alias="orderBy")] - """Configure the order of the results returned by the query.""" diff --git a/src/cloudflare/types/workers/observability/telemetry_query_response.py b/src/cloudflare/types/workers/observability/telemetry_query_response.py deleted file mode 100644 index 6b147257fd0..00000000000 --- a/src/cloudflare/types/workers/observability/telemetry_query_response.py +++ /dev/null @@ -1,931 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Dict, List, Union, Optional -from typing_extensions import Literal, TypeAlias - -from pydantic import Field as FieldInfo - -from ...._models import BaseModel - -__all__ = [ - "TelemetryQueryResponse", - "Run", - "RunQuery", - "RunQueryParameters", - "RunQueryParametersCalculation", - "RunQueryParametersFilter", - "RunQueryParametersGroupBy", - "RunQueryParametersHaving", - "RunQueryParametersNeedle", - "RunQueryParametersOrderBy", - "RunTimeframe", - "RunStatistics", - "Statistics", - "Calculation", - "CalculationAggregate", - "CalculationAggregateGroup", - "CalculationSeries", - "CalculationSeriesData", - "CalculationSeriesDataGroup", - "Compare", - "CompareAggregate", - "CompareAggregateGroup", - "CompareSeries", - "CompareSeriesData", - "CompareSeriesDataGroup", - "Events", - "EventsEvent", - "EventsEventMetadata", - "EventsEventWorkers", - "EventsEventWorkersUnionMember0", - "EventsEventWorkersUnionMember0ScriptVersion", - "EventsEventWorkersUnionMember1", - "EventsEventWorkersUnionMember1DiagnosticsChannelEvent", - "EventsEventWorkersUnionMember1ScriptVersion", - "EventsField", - "EventsSeries", - "EventsSeriesData", - "EventsSeriesDataAggregates", - "Invocation", - "InvocationMetadata", - "InvocationWorkers", - "InvocationWorkersUnionMember0", - "InvocationWorkersUnionMember0ScriptVersion", - "InvocationWorkersUnionMember1", - "InvocationWorkersUnionMember1DiagnosticsChannelEvent", - "InvocationWorkersUnionMember1ScriptVersion", - "Pattern", - "PatternSeries", - "PatternSeriesData", - "PatternSeriesDataGroup", - "Trace", -] - - -class RunQueryParametersCalculation(BaseModel): - operator: Literal[ - "uniq", - "count", - "max", - "min", - "sum", - "avg", - "median", - "p001", - "p01", - "p05", - "p10", - "p25", - "p75", - "p90", - "p95", - "p99", - "p999", - "stddev", - "variance", - "COUNT_DISTINCT", - "COUNT", - "MAX", - "MIN", - "SUM", - "AVG", - "MEDIAN", - "P001", - "P01", - "P05", - "P10", - "P25", - "P75", - "P90", - "P95", - "P99", - "P999", - "STDDEV", - "VARIANCE", - ] - - alias: Optional[str] = None - - key: Optional[str] = None - - key_type: Optional[Literal["string", "number", "boolean"]] = FieldInfo(alias="keyType", default=None) - - -class RunQueryParametersFilter(BaseModel): - key: str - - operation: 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", - ] - - type: Literal["string", "number", "boolean"] - - value: Union[str, float, bool, None] = None - - -class RunQueryParametersGroupBy(BaseModel): - type: Literal["string", "number", "boolean"] - - value: str - - -class RunQueryParametersHaving(BaseModel): - key: str - - operation: Literal["eq", "neq", "gt", "gte", "lt", "lte"] - - value: float - - -class RunQueryParametersNeedle(BaseModel): - """Define an expression to search using full-text search.""" - - value: Union[str, float, bool] - - is_regex: Optional[bool] = FieldInfo(alias="isRegex", default=None) - - match_case: Optional[bool] = FieldInfo(alias="matchCase", default=None) - - -class RunQueryParametersOrderBy(BaseModel): - """Configure the order of the results returned by the query.""" - - value: str - """Configure which Calculation to order the results by.""" - - order: Optional[Literal["asc", "desc"]] = None - """Set the order of the results""" - - -class RunQueryParameters(BaseModel): - calculations: Optional[List[RunQueryParametersCalculation]] = None - """Create Calculations to compute as part of the query.""" - - datasets: Optional[List[str]] = None - """Set the Datasets to query. Leave it empty to query all the datasets.""" - - filter_combination: Optional[Literal["and", "or", "AND", "OR"]] = FieldInfo(alias="filterCombination", default=None) - """Set a Flag to describe how to combine the filters on the query.""" - - filters: Optional[List[RunQueryParametersFilter]] = None - """Configure the Filters to apply to the query.""" - - group_bys: Optional[List[RunQueryParametersGroupBy]] = FieldInfo(alias="groupBys", default=None) - """Define how to group the results of the query.""" - - havings: Optional[List[RunQueryParametersHaving]] = None - """Configure the Having clauses that filter on calculations in the query result.""" - - limit: Optional[int] = None - """Set a limit on the number of results / records returned by the query""" - - needle: Optional[RunQueryParametersNeedle] = None - """Define an expression to search using full-text search.""" - - order_by: Optional[RunQueryParametersOrderBy] = FieldInfo(alias="orderBy", default=None) - """Configure the order of the results returned by the query.""" - - -class RunQuery(BaseModel): - id: str - """ID of the query""" - - created: str - - description: Optional[str] = None - - environment_id: str = FieldInfo(alias="environmentId") - """ID of your environment""" - - generated: Optional[bool] = None - """Flag for alerts automatically created""" - - name: Optional[str] = None - """Query name""" - - parameters: RunQueryParameters - - updated: str - - user_id: str = FieldInfo(alias="userId") - - workspace_id: str = FieldInfo(alias="workspaceId") - """ID of your workspace""" - - -class RunTimeframe(BaseModel): - """Time range for the query execution""" - - from_: float = FieldInfo(alias="from") - """Start timestamp for the query timeframe (Unix timestamp in milliseconds)""" - - to: float - """End timestamp for the query timeframe (Unix timestamp in milliseconds)""" - - -class RunStatistics(BaseModel): - bytes_read: float - """Number of uncompressed bytes read from the table.""" - - elapsed: float - """Time in seconds for the query to run.""" - - rows_read: float - """Number of rows scanned from the table.""" - - abr_level: Optional[float] = None - """The level of Adaptive Bit Rate (ABR) sampling used for the query. - - If empty the ABR level is 1 - """ - - -class Run(BaseModel): - """A Workers Observability Query Object""" - - id: str - - account_id: str = FieldInfo(alias="accountId") - - dry: bool - - environment_id: str = FieldInfo(alias="environmentId") - - granularity: float - - query: RunQuery - - status: Literal["STARTED", "COMPLETED"] - - timeframe: RunTimeframe - """Time range for the query execution""" - - user_id: str = FieldInfo(alias="userId") - - workspace_id: str = FieldInfo(alias="workspaceId") - - created: Optional[str] = None - - statistics: Optional[RunStatistics] = None - - updated: Optional[str] = None - - -class Statistics(BaseModel): - """ - The statistics object contains information about query performance from the database, it does not include any network latency - """ - - bytes_read: float - """Number of uncompressed bytes read from the table.""" - - elapsed: float - """Time in seconds for the query to run.""" - - rows_read: float - """Number of rows scanned from the table.""" - - abr_level: Optional[float] = None - """The level of Adaptive Bit Rate (ABR) sampling used for the query. - - If empty the ABR level is 1 - """ - - -class CalculationAggregateGroup(BaseModel): - key: str - - value: Union[str, float, bool] - - -class CalculationAggregate(BaseModel): - count: float - - interval: float - - sample_interval: float = FieldInfo(alias="sampleInterval") - - value: float - - groups: Optional[List[CalculationAggregateGroup]] = None - - -class CalculationSeriesDataGroup(BaseModel): - key: str - - value: Union[str, float, bool] - - -class CalculationSeriesData(BaseModel): - count: float - - first_seen: str = FieldInfo(alias="firstSeen") - - interval: float - - last_seen: str = FieldInfo(alias="lastSeen") - - sample_interval: float = FieldInfo(alias="sampleInterval") - - value: float - - groups: Optional[List[CalculationSeriesDataGroup]] = None - - -class CalculationSeries(BaseModel): - data: List[CalculationSeriesData] - - time: str - - -class Calculation(BaseModel): - aggregates: List[CalculationAggregate] - - calculation: str - - series: List[CalculationSeries] - - alias: Optional[str] = None - - -class CompareAggregateGroup(BaseModel): - key: str - - value: Union[str, float, bool] - - -class CompareAggregate(BaseModel): - count: float - - interval: float - - sample_interval: float = FieldInfo(alias="sampleInterval") - - value: float - - groups: Optional[List[CompareAggregateGroup]] = None - - -class CompareSeriesDataGroup(BaseModel): - key: str - - value: Union[str, float, bool] - - -class CompareSeriesData(BaseModel): - count: float - - first_seen: str = FieldInfo(alias="firstSeen") - - interval: float - - last_seen: str = FieldInfo(alias="lastSeen") - - sample_interval: float = FieldInfo(alias="sampleInterval") - - value: float - - groups: Optional[List[CompareSeriesDataGroup]] = None - - -class CompareSeries(BaseModel): - data: List[CompareSeriesData] - - time: str - - -class Compare(BaseModel): - aggregates: List[CompareAggregate] - - calculation: str - - series: List[CompareSeries] - - alias: Optional[str] = None - - -class EventsEventMetadata(BaseModel): - id: str - - account: Optional[str] = None - - cloud_service: Optional[str] = FieldInfo(alias="cloudService", default=None) - - cold_start: Optional[int] = FieldInfo(alias="coldStart", default=None) - - cost: Optional[int] = None - - duration: Optional[int] = None - - end_time: Optional[int] = FieldInfo(alias="endTime", default=None) - - error: Optional[str] = None - - error_template: Optional[str] = FieldInfo(alias="errorTemplate", default=None) - - fingerprint: Optional[str] = None - - level: Optional[str] = None - - message: Optional[str] = None - - message_template: Optional[str] = FieldInfo(alias="messageTemplate", default=None) - - metric_name: Optional[str] = FieldInfo(alias="metricName", default=None) - - origin: Optional[str] = None - - parent_span_id: Optional[str] = FieldInfo(alias="parentSpanId", default=None) - - provider: Optional[str] = None - - region: Optional[str] = None - - request_id: Optional[str] = FieldInfo(alias="requestId", default=None) - - service: Optional[str] = None - - span_id: Optional[str] = FieldInfo(alias="spanId", default=None) - - span_name: Optional[str] = FieldInfo(alias="spanName", default=None) - - stack_id: Optional[str] = FieldInfo(alias="stackId", default=None) - - start_time: Optional[int] = FieldInfo(alias="startTime", default=None) - - status_code: Optional[int] = FieldInfo(alias="statusCode", default=None) - - trace_duration: Optional[int] = FieldInfo(alias="traceDuration", default=None) - - trace_id: Optional[str] = FieldInfo(alias="traceId", default=None) - - transaction_name: Optional[str] = FieldInfo(alias="transactionName", default=None) - - trigger: Optional[str] = None - - type: Optional[str] = None - - url: Optional[str] = None - - -class EventsEventWorkersUnionMember0ScriptVersion(BaseModel): - id: Optional[str] = None - - message: Optional[str] = None - - tag: Optional[str] = None - - -class EventsEventWorkersUnionMember0(BaseModel): - event_type: Literal[ - "fetch", "scheduled", "alarm", "cron", "queue", "email", "tail", "rpc", "websocket", "unknown" - ] = FieldInfo(alias="eventType") - - request_id: str = FieldInfo(alias="requestId") - - script_name: str = FieldInfo(alias="scriptName") - - durable_object_id: Optional[str] = FieldInfo(alias="durableObjectId", default=None) - - entrypoint: Optional[str] = None - - event: Optional[ - Dict[ - str, - Union[ - str, - float, - bool, - Dict[str, Union[str, float, bool, Dict[str, Union[List[Union[str, float, bool]], str, float, bool]]]], - ], - ] - ] = None - - execution_model: Optional[Literal["durableObject", "stateless"]] = FieldInfo(alias="executionModel", default=None) - - outcome: Optional[str] = None - - script_version: Optional[EventsEventWorkersUnionMember0ScriptVersion] = FieldInfo( - alias="scriptVersion", default=None - ) - - truncated: Optional[bool] = None - - -class EventsEventWorkersUnionMember1DiagnosticsChannelEvent(BaseModel): - channel: str - - message: str - - timestamp: float - - -class EventsEventWorkersUnionMember1ScriptVersion(BaseModel): - id: Optional[str] = None - - message: Optional[str] = None - - tag: Optional[str] = None - - -class EventsEventWorkersUnionMember1(BaseModel): - cpu_time_ms: float = FieldInfo(alias="cpuTimeMs") - - event_type: Literal[ - "fetch", "scheduled", "alarm", "cron", "queue", "email", "tail", "rpc", "websocket", "unknown" - ] = FieldInfo(alias="eventType") - - outcome: str - - request_id: str = FieldInfo(alias="requestId") - - script_name: str = FieldInfo(alias="scriptName") - - wall_time_ms: float = FieldInfo(alias="wallTimeMs") - - diagnostics_channel_events: Optional[List[EventsEventWorkersUnionMember1DiagnosticsChannelEvent]] = FieldInfo( - alias="diagnosticsChannelEvents", default=None - ) - - dispatch_namespace: Optional[str] = FieldInfo(alias="dispatchNamespace", default=None) - - durable_object_id: Optional[str] = FieldInfo(alias="durableObjectId", default=None) - - entrypoint: Optional[str] = None - - event: Optional[Dict[str, Union[str, float, bool]]] = None - - execution_model: Optional[Literal["durableObject", "stateless"]] = FieldInfo(alias="executionModel", default=None) - - script_version: Optional[EventsEventWorkersUnionMember1ScriptVersion] = FieldInfo( - alias="scriptVersion", default=None - ) - - truncated: Optional[bool] = None - - -EventsEventWorkers: TypeAlias = Union[EventsEventWorkersUnionMember0, EventsEventWorkersUnionMember1] - - -class EventsEvent(BaseModel): - """The data structure of a telemetry event""" - - metadata: EventsEventMetadata = FieldInfo(alias="$metadata") - - dataset: str - - source: Union[str, object] - - timestamp: int - - containers: Optional[object] = FieldInfo(alias="$containers", default=None) - """ - Cloudflare Containers event information enriches your logs so you can easily - identify and debug issues. - """ - - workers: Optional[EventsEventWorkers] = FieldInfo(alias="$workers", default=None) - """ - Cloudflare Workers event information enriches your logs so you can easily - identify and debug issues. - """ - - -class EventsField(BaseModel): - key: str - - type: str - - -class EventsSeriesDataAggregates(BaseModel): - api_count: int = FieldInfo(alias="_count") - - api_first_seen: str = FieldInfo(alias="_firstSeen") - - api_interval: int = FieldInfo(alias="_interval") - - api_last_seen: str = FieldInfo(alias="_lastSeen") - - bin: Optional[object] = None - - -class EventsSeriesData(BaseModel): - aggregates: EventsSeriesDataAggregates - - count: float - - interval: float - - sample_interval: float = FieldInfo(alias="sampleInterval") - - errors: Optional[float] = None - - groups: Optional[Dict[str, Union[str, float, bool]]] = None - """Groups in the query results.""" - - -class EventsSeries(BaseModel): - data: List[EventsSeriesData] - - time: str - - -class Events(BaseModel): - count: Optional[float] = None - - events: Optional[List[EventsEvent]] = None - - fields: Optional[List[EventsField]] = None - - series: Optional[List[EventsSeries]] = None - - -class InvocationMetadata(BaseModel): - id: str - - account: Optional[str] = None - - cloud_service: Optional[str] = FieldInfo(alias="cloudService", default=None) - - cold_start: Optional[int] = FieldInfo(alias="coldStart", default=None) - - cost: Optional[int] = None - - duration: Optional[int] = None - - end_time: Optional[int] = FieldInfo(alias="endTime", default=None) - - error: Optional[str] = None - - error_template: Optional[str] = FieldInfo(alias="errorTemplate", default=None) - - fingerprint: Optional[str] = None - - level: Optional[str] = None - - message: Optional[str] = None - - message_template: Optional[str] = FieldInfo(alias="messageTemplate", default=None) - - metric_name: Optional[str] = FieldInfo(alias="metricName", default=None) - - origin: Optional[str] = None - - parent_span_id: Optional[str] = FieldInfo(alias="parentSpanId", default=None) - - provider: Optional[str] = None - - region: Optional[str] = None - - request_id: Optional[str] = FieldInfo(alias="requestId", default=None) - - service: Optional[str] = None - - span_id: Optional[str] = FieldInfo(alias="spanId", default=None) - - span_name: Optional[str] = FieldInfo(alias="spanName", default=None) - - stack_id: Optional[str] = FieldInfo(alias="stackId", default=None) - - start_time: Optional[int] = FieldInfo(alias="startTime", default=None) - - status_code: Optional[int] = FieldInfo(alias="statusCode", default=None) - - trace_duration: Optional[int] = FieldInfo(alias="traceDuration", default=None) - - trace_id: Optional[str] = FieldInfo(alias="traceId", default=None) - - transaction_name: Optional[str] = FieldInfo(alias="transactionName", default=None) - - trigger: Optional[str] = None - - type: Optional[str] = None - - url: Optional[str] = None - - -class InvocationWorkersUnionMember0ScriptVersion(BaseModel): - id: Optional[str] = None - - message: Optional[str] = None - - tag: Optional[str] = None - - -class InvocationWorkersUnionMember0(BaseModel): - event_type: Literal[ - "fetch", "scheduled", "alarm", "cron", "queue", "email", "tail", "rpc", "websocket", "unknown" - ] = FieldInfo(alias="eventType") - - request_id: str = FieldInfo(alias="requestId") - - script_name: str = FieldInfo(alias="scriptName") - - durable_object_id: Optional[str] = FieldInfo(alias="durableObjectId", default=None) - - entrypoint: Optional[str] = None - - event: Optional[ - Dict[ - str, - Union[ - str, - float, - bool, - Dict[str, Union[str, float, bool, Dict[str, Union[List[Union[str, float, bool]], str, float, bool]]]], - ], - ] - ] = None - - execution_model: Optional[Literal["durableObject", "stateless"]] = FieldInfo(alias="executionModel", default=None) - - outcome: Optional[str] = None - - script_version: Optional[InvocationWorkersUnionMember0ScriptVersion] = FieldInfo( - alias="scriptVersion", default=None - ) - - truncated: Optional[bool] = None - - -class InvocationWorkersUnionMember1DiagnosticsChannelEvent(BaseModel): - channel: str - - message: str - - timestamp: float - - -class InvocationWorkersUnionMember1ScriptVersion(BaseModel): - id: Optional[str] = None - - message: Optional[str] = None - - tag: Optional[str] = None - - -class InvocationWorkersUnionMember1(BaseModel): - cpu_time_ms: float = FieldInfo(alias="cpuTimeMs") - - event_type: Literal[ - "fetch", "scheduled", "alarm", "cron", "queue", "email", "tail", "rpc", "websocket", "unknown" - ] = FieldInfo(alias="eventType") - - outcome: str - - request_id: str = FieldInfo(alias="requestId") - - script_name: str = FieldInfo(alias="scriptName") - - wall_time_ms: float = FieldInfo(alias="wallTimeMs") - - diagnostics_channel_events: Optional[List[InvocationWorkersUnionMember1DiagnosticsChannelEvent]] = FieldInfo( - alias="diagnosticsChannelEvents", default=None - ) - - dispatch_namespace: Optional[str] = FieldInfo(alias="dispatchNamespace", default=None) - - durable_object_id: Optional[str] = FieldInfo(alias="durableObjectId", default=None) - - entrypoint: Optional[str] = None - - event: Optional[Dict[str, Union[str, float, bool]]] = None - - execution_model: Optional[Literal["durableObject", "stateless"]] = FieldInfo(alias="executionModel", default=None) - - script_version: Optional[InvocationWorkersUnionMember1ScriptVersion] = FieldInfo( - alias="scriptVersion", default=None - ) - - truncated: Optional[bool] = None - - -InvocationWorkers: TypeAlias = Union[InvocationWorkersUnionMember0, InvocationWorkersUnionMember1] - - -class Invocation(BaseModel): - """The data structure of a telemetry event""" - - metadata: InvocationMetadata = FieldInfo(alias="$metadata") - - dataset: str - - source: Union[str, object] - - timestamp: int - - containers: Optional[object] = FieldInfo(alias="$containers", default=None) - """ - Cloudflare Containers event information enriches your logs so you can easily - identify and debug issues. - """ - - workers: Optional[InvocationWorkers] = FieldInfo(alias="$workers", default=None) - """ - Cloudflare Workers event information enriches your logs so you can easily - identify and debug issues. - """ - - -class PatternSeriesDataGroup(BaseModel): - key: str - - value: Union[str, float, bool] - - -class PatternSeriesData(BaseModel): - count: float - - interval: float - - sample_interval: float = FieldInfo(alias="sampleInterval") - - value: float - - groups: Optional[List[PatternSeriesDataGroup]] = None - - -class PatternSeries(BaseModel): - data: PatternSeriesData - - time: str - - -class Pattern(BaseModel): - count: float - - pattern: str - - series: List[PatternSeries] - - service: str - - -class Trace(BaseModel): - root_span_name: str = FieldInfo(alias="rootSpanName") - - root_transaction_name: str = FieldInfo(alias="rootTransactionName") - - service: List[str] - - spans: float - - trace_duration_ms: float = FieldInfo(alias="traceDurationMs") - - trace_end_ms: float = FieldInfo(alias="traceEndMs") - - trace_id: str = FieldInfo(alias="traceId") - - trace_start_ms: float = FieldInfo(alias="traceStartMs") - - errors: Optional[List[str]] = None - - -class TelemetryQueryResponse(BaseModel): - run: Run - """A Workers Observability Query Object""" - - statistics: Statistics - """ - The statistics object contains information about query performance from the - database, it does not include any network latency - """ - - calculations: Optional[List[Calculation]] = None - - compare: Optional[List[Compare]] = None - - events: Optional[Events] = None - - invocations: Optional[Dict[str, List[Invocation]]] = None - - patterns: Optional[List[Pattern]] = None - - traces: Optional[List[Trace]] = None diff --git a/src/cloudflare/types/workers/observability/telemetry_values_params.py b/src/cloudflare/types/workers/observability/telemetry_values_params.py deleted file mode 100644 index 8c5e881ddff..00000000000 --- a/src/cloudflare/types/workers/observability/telemetry_values_params.py +++ /dev/null @@ -1,94 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import Union, Iterable -from typing_extensions import Literal, Required, Annotated, TypedDict - -from ...._types import SequenceNotStr -from ...._utils import PropertyInfo - -__all__ = ["TelemetryValuesParams", "Timeframe", "Filter", "Needle"] - - -class TelemetryValuesParams(TypedDict, total=False): - account_id: Required[str] - - datasets: Required[SequenceNotStr[str]] - - key: Required[str] - - timeframe: Required[Timeframe] - - type: Required[Literal["string", "boolean", "number"]] - - filters: Iterable[Filter] - - limit: float - - needle: Needle - """Search for a specific substring in the event.""" - - -_TimeframeReservedKeywords = TypedDict( - "_TimeframeReservedKeywords", - { - "from": float, - }, - total=False, -) - - -class Timeframe(_TimeframeReservedKeywords, total=False): - to: Required[float] - - -class Filter(TypedDict, total=False): - key: Required[str] - - 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", - ] - ] - - type: Required[Literal["string", "number", "boolean"]] - - value: Union[str, float, bool] - - -class Needle(TypedDict, total=False): - """Search for a specific substring in the event.""" - - value: Required[Union[str, float, bool]] - - is_regex: Annotated[bool, PropertyInfo(alias="isRegex")] - - match_case: Annotated[bool, PropertyInfo(alias="matchCase")] diff --git a/src/cloudflare/types/workers/observability/telemetry_values_response.py b/src/cloudflare/types/workers/observability/telemetry_values_response.py deleted file mode 100644 index 1d7d431f350..00000000000 --- a/src/cloudflare/types/workers/observability/telemetry_values_response.py +++ /dev/null @@ -1,18 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Union -from typing_extensions import Literal - -from ...._models import BaseModel - -__all__ = ["TelemetryValuesResponse"] - - -class TelemetryValuesResponse(BaseModel): - dataset: str - - key: str - - type: Literal["string", "boolean", "number"] - - value: Union[str, float, bool] diff --git a/tests/api_resources/test_client_certificates.py b/tests/api_resources/test_client_certificates.py index 60092807cba..b64546a093a 100644 --- a/tests/api_resources/test_client_certificates.py +++ b/tests/api_resources/test_client_certificates.py @@ -24,7 +24,7 @@ class TestClientCertificates: def test_method_create(self, client: Cloudflare) -> None: client_certificate = client.client_certificates.create( zone_id="023e105f4ecef8ad9ca31a8372d0c353", - csr="-----BEGIN CERTIFICATE REQUEST-----\\nMIICY....\\n-----END CERTIFICATE REQUEST-----\\n", + csr="-----BEGIN CERTIFICATE REQUEST-----\nMIICY....\n-----END CERTIFICATE REQUEST-----", validity_days=3650, ) assert_matches_type(Optional[ClientCertificate], client_certificate, path=["response"]) @@ -33,7 +33,7 @@ def test_method_create(self, client: Cloudflare) -> None: def test_raw_response_create(self, client: Cloudflare) -> None: response = client.client_certificates.with_raw_response.create( zone_id="023e105f4ecef8ad9ca31a8372d0c353", - csr="-----BEGIN CERTIFICATE REQUEST-----\\nMIICY....\\n-----END CERTIFICATE REQUEST-----\\n", + csr="-----BEGIN CERTIFICATE REQUEST-----\nMIICY....\n-----END CERTIFICATE REQUEST-----", validity_days=3650, ) @@ -46,7 +46,7 @@ def test_raw_response_create(self, client: Cloudflare) -> None: def test_streaming_response_create(self, client: Cloudflare) -> None: with client.client_certificates.with_streaming_response.create( zone_id="023e105f4ecef8ad9ca31a8372d0c353", - csr="-----BEGIN CERTIFICATE REQUEST-----\\nMIICY....\\n-----END CERTIFICATE REQUEST-----\\n", + csr="-----BEGIN CERTIFICATE REQUEST-----\nMIICY....\n-----END CERTIFICATE REQUEST-----", validity_days=3650, ) as response: assert not response.is_closed @@ -62,7 +62,7 @@ def test_path_params_create(self, client: Cloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): client.client_certificates.with_raw_response.create( zone_id="", - csr="-----BEGIN CERTIFICATE REQUEST-----\\nMIICY....\\n-----END CERTIFICATE REQUEST-----\\n", + csr="-----BEGIN CERTIFICATE REQUEST-----\nMIICY....\n-----END CERTIFICATE REQUEST-----", validity_days=3650, ) @@ -279,7 +279,7 @@ class TestAsyncClientCertificates: async def test_method_create(self, async_client: AsyncCloudflare) -> None: client_certificate = await async_client.client_certificates.create( zone_id="023e105f4ecef8ad9ca31a8372d0c353", - csr="-----BEGIN CERTIFICATE REQUEST-----\\nMIICY....\\n-----END CERTIFICATE REQUEST-----\\n", + csr="-----BEGIN CERTIFICATE REQUEST-----\nMIICY....\n-----END CERTIFICATE REQUEST-----", validity_days=3650, ) assert_matches_type(Optional[ClientCertificate], client_certificate, path=["response"]) @@ -288,7 +288,7 @@ async def test_method_create(self, async_client: AsyncCloudflare) -> None: async def test_raw_response_create(self, async_client: AsyncCloudflare) -> None: response = await async_client.client_certificates.with_raw_response.create( zone_id="023e105f4ecef8ad9ca31a8372d0c353", - csr="-----BEGIN CERTIFICATE REQUEST-----\\nMIICY....\\n-----END CERTIFICATE REQUEST-----\\n", + csr="-----BEGIN CERTIFICATE REQUEST-----\nMIICY....\n-----END CERTIFICATE REQUEST-----", validity_days=3650, ) @@ -301,7 +301,7 @@ async def test_raw_response_create(self, async_client: AsyncCloudflare) -> None: async def test_streaming_response_create(self, async_client: AsyncCloudflare) -> None: async with async_client.client_certificates.with_streaming_response.create( zone_id="023e105f4ecef8ad9ca31a8372d0c353", - csr="-----BEGIN CERTIFICATE REQUEST-----\\nMIICY....\\n-----END CERTIFICATE REQUEST-----\\n", + csr="-----BEGIN CERTIFICATE REQUEST-----\nMIICY....\n-----END CERTIFICATE REQUEST-----", validity_days=3650, ) as response: assert not response.is_closed @@ -317,7 +317,7 @@ async def test_path_params_create(self, async_client: AsyncCloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): await async_client.client_certificates.with_raw_response.create( zone_id="", - csr="-----BEGIN CERTIFICATE REQUEST-----\\nMIICY....\\n-----END CERTIFICATE REQUEST-----\\n", + csr="-----BEGIN CERTIFICATE REQUEST-----\nMIICY....\n-----END CERTIFICATE REQUEST-----", validity_days=3650, ) diff --git a/tests/api_resources/test_custom_hostnames.py b/tests/api_resources/test_custom_hostnames.py index 9d96b2f0dd6..0e8797357e1 100644 --- a/tests/api_resources/test_custom_hostnames.py +++ b/tests/api_resources/test_custom_hostnames.py @@ -48,7 +48,7 @@ def test_method_create_with_all_params(self, client: Cloudflare) -> None: "custom_key": "-----BEGIN PRIVATE KEY-----\nMIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQC/SCB5...\n-----END PRIVATE KEY-----\n", } ], - "custom_certificate": "-----BEGIN CERTIFICATE-----\\nMIIFJDCCBAygAwIBAgIQD0ifmj/Yi5NP/2gdUySbfzANBgkqhkiG9w0BAQsFADBN\\nMQswCQYDVQQGEwJVUzEVMBMGA1UEChMMRGlnaUNlcnQgSW5jMScwJQYDVQQDEx5E...SzSHfXp5lnu/3V08I72q1QNzOCgY1XeL4GKVcj4or6cT6tX6oJH7ePPmfrBfqI/O\\nOeH8gMJ+FuwtXYEPa4hBf38M5eU5xWG7\\n-----END CERTIFICATE-----\\n", + "custom_certificate": "-----BEGIN CERTIFICATE-----\nMIIFJDCCBAygAwIBAgIQD0ifmj/Yi5NP/2gdUySbfzANBgkqhkiG9w0BAQsFADBN\nMQswCQYDVQQGEwJVUzEVMBMGA1UEChMMRGlnaUNlcnQgSW5jMScwJQYDVQQDEx5E...SzSHfXp5lnu/3V08I72q1QNzOCgY1XeL4GKVcj4or6cT6tX6oJH7ePPmfrBfqI/O\nOeH8gMJ+FuwtXYEPa4hBf38M5eU5xWG7\n-----END CERTIFICATE-----\n", "custom_key": "-----BEGIN RSA PRIVATE KEY-----\nMIIEowIBAAKCAQEAwQHoetcl9+5ikGzV6cMzWtWPJHqXT3wpbEkRU9Yz7lgvddmG\ndtcGbg/1CGZu0jJGkMoppoUo4c3dts3iwqRYmBikUP77wwY2QGmDZw2FvkJCJlKn\nabIRuGvBKwzESIXgKk2016aTP6/dAjEHyo6SeoK8lkIySUvK0fyOVlsiEsCmOpid\ntnKX/a+50GjB79CJH4ER2lLVZnhePFR/zUOyPxZQQ4naHf7yu/b5jhO0f8fwt+py\nFxIXjbEIdZliWRkRMtzrHOJIhrmJ2A1J7iOrirbbwillwjjNVUWPf3IJ3M12S9pE\newooaeO2izNTERcG9HzAacbVRn2Y2SWIyT/18QIDAQABAoIBACbhTYXBZYKmYPCb\nHBR1IBlCQA2nLGf0qRuJNJZg5iEzXows/6tc8YymZkQE7nolapWsQ+upk2y5Xdp/\naxiuprIs9JzkYK8Ox0r+dlwCG1kSW+UAbX0bQ/qUqlsTvU6muVuMP8vZYHxJ3wmb\n+ufRBKztPTQ/rYWaYQcgC0RWI20HTFBMxlTAyNxYNWzX7RKFkGVVyB9RsAtmcc8g\n+j4OdosbfNoJPS0HeIfNpAznDfHKdxDk2Yc1tV6RHBrC1ynyLE9+TaflIAdo2MVv\nKLMLq51GqYKtgJFIlBRPQqKoyXdz3fGvXrTkf/WY9QNq0J1Vk5ERePZ54mN8iZB7\n9lwy/AkCgYEA6FXzosxswaJ2wQLeoYc7ceaweX/SwTvxHgXzRyJIIT0eJWgx13Wo\n/WA3Iziimsjf6qE+SI/8laxPp2A86VMaIt3Z3mJN/CqSVGw8LK2AQst+OwdPyDMu\niacE8lj/IFGC8mwNUAb9CzGU3JpU4PxxGFjS/eMtGeRXCWkK4NE+G08CgYEA1Kp9\nN2JrVlqUz+gAX+LPmE9OEMAS9WQSQsfCHGogIFDGGcNf7+uwBM7GAaSJIP01zcoe\nVAgWdzXCv3FLhsaZoJ6RyLOLay5phbu1iaTr4UNYm5WtYTzMzqh8l1+MFFDl9xDB\nvULuCIIrglM5MeS/qnSg1uMoH2oVPj9TVst/ir8CgYEAxrI7Ws9Zc4Bt70N1As+U\nlySjaEVZCMkqvHJ6TCuVZFfQoE0r0whdLdRLU2PsLFP+q7qaeZQqgBaNSKeVcDYR\n9B+nY/jOmQoPewPVsp/vQTCnE/R81spu0mp0YI6cIheT1Z9zAy322svcc43JaWB7\nmEbeqyLOP4Z4qSOcmghZBSECgYACvR9Xs0DGn+wCsW4vze/2ei77MD4OQvepPIFX\ndFZtlBy5ADcgE9z0cuVB6CiL8DbdK5kwY9pGNr8HUCI03iHkW6Zs+0L0YmihfEVe\nPG19PSzK9CaDdhD9KFZSbLyVFmWfxOt50H7YRTTiPMgjyFpfi5j2q348yVT0tEQS\nfhRqaQKBgAcWPokmJ7EbYQGeMbS7HC8eWO/RyamlnSffdCdSc7ue3zdVJxpAkQ8W\nqu80pEIF6raIQfAf8MXiiZ7auFOSnHQTXUbhCpvDLKi0Mwq3G8Pl07l+2s6dQG6T\nlv6XTQaMyf6n1yjzL+fzDrH3qXMxHMO/b13EePXpDMpY7HQpoLDi\n-----END RSA PRIVATE KEY-----\n", "method": "http", "settings": { @@ -226,7 +226,7 @@ def test_method_edit_with_all_params(self, client: Cloudflare) -> None: "custom_key": "-----BEGIN PRIVATE KEY-----\nMIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQC/SCB5...\n-----END PRIVATE KEY-----\n", } ], - "custom_certificate": "-----BEGIN CERTIFICATE-----\\nMIIFJDCCBAygAwIBAgIQD0ifmj/Yi5NP/2gdUySbfzANBgkqhkiG9w0BAQsFADBN\\nMQswCQYDVQQGEwJVUzEVMBMGA1UEChMMRGlnaUNlcnQgSW5jMScwJQYDVQQDEx5E...SzSHfXp5lnu/3V08I72q1QNzOCgY1XeL4GKVcj4or6cT6tX6oJH7ePPmfrBfqI/O\\nOeH8gMJ+FuwtXYEPa4hBf38M5eU5xWG7\\n-----END CERTIFICATE-----\\n", + "custom_certificate": "-----BEGIN CERTIFICATE-----\nMIIFJDCCBAygAwIBAgIQD0ifmj/Yi5NP/2gdUySbfzANBgkqhkiG9w0BAQsFADBN\nMQswCQYDVQQGEwJVUzEVMBMGA1UEChMMRGlnaUNlcnQgSW5jMScwJQYDVQQDEx5E...SzSHfXp5lnu/3V08I72q1QNzOCgY1XeL4GKVcj4or6cT6tX6oJH7ePPmfrBfqI/O\nOeH8gMJ+FuwtXYEPa4hBf38M5eU5xWG7\n-----END CERTIFICATE-----\n", "custom_key": "-----BEGIN RSA PRIVATE KEY-----\nMIIEowIBAAKCAQEAwQHoetcl9+5ikGzV6cMzWtWPJHqXT3wpbEkRU9Yz7lgvddmG\ndtcGbg/1CGZu0jJGkMoppoUo4c3dts3iwqRYmBikUP77wwY2QGmDZw2FvkJCJlKn\nabIRuGvBKwzESIXgKk2016aTP6/dAjEHyo6SeoK8lkIySUvK0fyOVlsiEsCmOpid\ntnKX/a+50GjB79CJH4ER2lLVZnhePFR/zUOyPxZQQ4naHf7yu/b5jhO0f8fwt+py\nFxIXjbEIdZliWRkRMtzrHOJIhrmJ2A1J7iOrirbbwillwjjNVUWPf3IJ3M12S9pE\newooaeO2izNTERcG9HzAacbVRn2Y2SWIyT/18QIDAQABAoIBACbhTYXBZYKmYPCb\nHBR1IBlCQA2nLGf0qRuJNJZg5iEzXows/6tc8YymZkQE7nolapWsQ+upk2y5Xdp/\naxiuprIs9JzkYK8Ox0r+dlwCG1kSW+UAbX0bQ/qUqlsTvU6muVuMP8vZYHxJ3wmb\n+ufRBKztPTQ/rYWaYQcgC0RWI20HTFBMxlTAyNxYNWzX7RKFkGVVyB9RsAtmcc8g\n+j4OdosbfNoJPS0HeIfNpAznDfHKdxDk2Yc1tV6RHBrC1ynyLE9+TaflIAdo2MVv\nKLMLq51GqYKtgJFIlBRPQqKoyXdz3fGvXrTkf/WY9QNq0J1Vk5ERePZ54mN8iZB7\n9lwy/AkCgYEA6FXzosxswaJ2wQLeoYc7ceaweX/SwTvxHgXzRyJIIT0eJWgx13Wo\n/WA3Iziimsjf6qE+SI/8laxPp2A86VMaIt3Z3mJN/CqSVGw8LK2AQst+OwdPyDMu\niacE8lj/IFGC8mwNUAb9CzGU3JpU4PxxGFjS/eMtGeRXCWkK4NE+G08CgYEA1Kp9\nN2JrVlqUz+gAX+LPmE9OEMAS9WQSQsfCHGogIFDGGcNf7+uwBM7GAaSJIP01zcoe\nVAgWdzXCv3FLhsaZoJ6RyLOLay5phbu1iaTr4UNYm5WtYTzMzqh8l1+MFFDl9xDB\nvULuCIIrglM5MeS/qnSg1uMoH2oVPj9TVst/ir8CgYEAxrI7Ws9Zc4Bt70N1As+U\nlySjaEVZCMkqvHJ6TCuVZFfQoE0r0whdLdRLU2PsLFP+q7qaeZQqgBaNSKeVcDYR\n9B+nY/jOmQoPewPVsp/vQTCnE/R81spu0mp0YI6cIheT1Z9zAy322svcc43JaWB7\nmEbeqyLOP4Z4qSOcmghZBSECgYACvR9Xs0DGn+wCsW4vze/2ei77MD4OQvepPIFX\ndFZtlBy5ADcgE9z0cuVB6CiL8DbdK5kwY9pGNr8HUCI03iHkW6Zs+0L0YmihfEVe\nPG19PSzK9CaDdhD9KFZSbLyVFmWfxOt50H7YRTTiPMgjyFpfi5j2q348yVT0tEQS\nfhRqaQKBgAcWPokmJ7EbYQGeMbS7HC8eWO/RyamlnSffdCdSc7ue3zdVJxpAkQ8W\nqu80pEIF6raIQfAf8MXiiZ7auFOSnHQTXUbhCpvDLKi0Mwq3G8Pl07l+2s6dQG6T\nlv6XTQaMyf6n1yjzL+fzDrH3qXMxHMO/b13EePXpDMpY7HQpoLDi\n-----END RSA PRIVATE KEY-----\n", "method": "http", "settings": { @@ -360,7 +360,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncCloudflare "custom_key": "-----BEGIN PRIVATE KEY-----\nMIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQC/SCB5...\n-----END PRIVATE KEY-----\n", } ], - "custom_certificate": "-----BEGIN CERTIFICATE-----\\nMIIFJDCCBAygAwIBAgIQD0ifmj/Yi5NP/2gdUySbfzANBgkqhkiG9w0BAQsFADBN\\nMQswCQYDVQQGEwJVUzEVMBMGA1UEChMMRGlnaUNlcnQgSW5jMScwJQYDVQQDEx5E...SzSHfXp5lnu/3V08I72q1QNzOCgY1XeL4GKVcj4or6cT6tX6oJH7ePPmfrBfqI/O\\nOeH8gMJ+FuwtXYEPa4hBf38M5eU5xWG7\\n-----END CERTIFICATE-----\\n", + "custom_certificate": "-----BEGIN CERTIFICATE-----\nMIIFJDCCBAygAwIBAgIQD0ifmj/Yi5NP/2gdUySbfzANBgkqhkiG9w0BAQsFADBN\nMQswCQYDVQQGEwJVUzEVMBMGA1UEChMMRGlnaUNlcnQgSW5jMScwJQYDVQQDEx5E...SzSHfXp5lnu/3V08I72q1QNzOCgY1XeL4GKVcj4or6cT6tX6oJH7ePPmfrBfqI/O\nOeH8gMJ+FuwtXYEPa4hBf38M5eU5xWG7\n-----END CERTIFICATE-----\n", "custom_key": "-----BEGIN RSA PRIVATE KEY-----\nMIIEowIBAAKCAQEAwQHoetcl9+5ikGzV6cMzWtWPJHqXT3wpbEkRU9Yz7lgvddmG\ndtcGbg/1CGZu0jJGkMoppoUo4c3dts3iwqRYmBikUP77wwY2QGmDZw2FvkJCJlKn\nabIRuGvBKwzESIXgKk2016aTP6/dAjEHyo6SeoK8lkIySUvK0fyOVlsiEsCmOpid\ntnKX/a+50GjB79CJH4ER2lLVZnhePFR/zUOyPxZQQ4naHf7yu/b5jhO0f8fwt+py\nFxIXjbEIdZliWRkRMtzrHOJIhrmJ2A1J7iOrirbbwillwjjNVUWPf3IJ3M12S9pE\newooaeO2izNTERcG9HzAacbVRn2Y2SWIyT/18QIDAQABAoIBACbhTYXBZYKmYPCb\nHBR1IBlCQA2nLGf0qRuJNJZg5iEzXows/6tc8YymZkQE7nolapWsQ+upk2y5Xdp/\naxiuprIs9JzkYK8Ox0r+dlwCG1kSW+UAbX0bQ/qUqlsTvU6muVuMP8vZYHxJ3wmb\n+ufRBKztPTQ/rYWaYQcgC0RWI20HTFBMxlTAyNxYNWzX7RKFkGVVyB9RsAtmcc8g\n+j4OdosbfNoJPS0HeIfNpAznDfHKdxDk2Yc1tV6RHBrC1ynyLE9+TaflIAdo2MVv\nKLMLq51GqYKtgJFIlBRPQqKoyXdz3fGvXrTkf/WY9QNq0J1Vk5ERePZ54mN8iZB7\n9lwy/AkCgYEA6FXzosxswaJ2wQLeoYc7ceaweX/SwTvxHgXzRyJIIT0eJWgx13Wo\n/WA3Iziimsjf6qE+SI/8laxPp2A86VMaIt3Z3mJN/CqSVGw8LK2AQst+OwdPyDMu\niacE8lj/IFGC8mwNUAb9CzGU3JpU4PxxGFjS/eMtGeRXCWkK4NE+G08CgYEA1Kp9\nN2JrVlqUz+gAX+LPmE9OEMAS9WQSQsfCHGogIFDGGcNf7+uwBM7GAaSJIP01zcoe\nVAgWdzXCv3FLhsaZoJ6RyLOLay5phbu1iaTr4UNYm5WtYTzMzqh8l1+MFFDl9xDB\nvULuCIIrglM5MeS/qnSg1uMoH2oVPj9TVst/ir8CgYEAxrI7Ws9Zc4Bt70N1As+U\nlySjaEVZCMkqvHJ6TCuVZFfQoE0r0whdLdRLU2PsLFP+q7qaeZQqgBaNSKeVcDYR\n9B+nY/jOmQoPewPVsp/vQTCnE/R81spu0mp0YI6cIheT1Z9zAy322svcc43JaWB7\nmEbeqyLOP4Z4qSOcmghZBSECgYACvR9Xs0DGn+wCsW4vze/2ei77MD4OQvepPIFX\ndFZtlBy5ADcgE9z0cuVB6CiL8DbdK5kwY9pGNr8HUCI03iHkW6Zs+0L0YmihfEVe\nPG19PSzK9CaDdhD9KFZSbLyVFmWfxOt50H7YRTTiPMgjyFpfi5j2q348yVT0tEQS\nfhRqaQKBgAcWPokmJ7EbYQGeMbS7HC8eWO/RyamlnSffdCdSc7ue3zdVJxpAkQ8W\nqu80pEIF6raIQfAf8MXiiZ7auFOSnHQTXUbhCpvDLKi0Mwq3G8Pl07l+2s6dQG6T\nlv6XTQaMyf6n1yjzL+fzDrH3qXMxHMO/b13EePXpDMpY7HQpoLDi\n-----END RSA PRIVATE KEY-----\n", "method": "http", "settings": { @@ -538,7 +538,7 @@ async def test_method_edit_with_all_params(self, async_client: AsyncCloudflare) "custom_key": "-----BEGIN PRIVATE KEY-----\nMIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQC/SCB5...\n-----END PRIVATE KEY-----\n", } ], - "custom_certificate": "-----BEGIN CERTIFICATE-----\\nMIIFJDCCBAygAwIBAgIQD0ifmj/Yi5NP/2gdUySbfzANBgkqhkiG9w0BAQsFADBN\\nMQswCQYDVQQGEwJVUzEVMBMGA1UEChMMRGlnaUNlcnQgSW5jMScwJQYDVQQDEx5E...SzSHfXp5lnu/3V08I72q1QNzOCgY1XeL4GKVcj4or6cT6tX6oJH7ePPmfrBfqI/O\\nOeH8gMJ+FuwtXYEPa4hBf38M5eU5xWG7\\n-----END CERTIFICATE-----\\n", + "custom_certificate": "-----BEGIN CERTIFICATE-----\nMIIFJDCCBAygAwIBAgIQD0ifmj/Yi5NP/2gdUySbfzANBgkqhkiG9w0BAQsFADBN\nMQswCQYDVQQGEwJVUzEVMBMGA1UEChMMRGlnaUNlcnQgSW5jMScwJQYDVQQDEx5E...SzSHfXp5lnu/3V08I72q1QNzOCgY1XeL4GKVcj4or6cT6tX6oJH7ePPmfrBfqI/O\nOeH8gMJ+FuwtXYEPa4hBf38M5eU5xWG7\n-----END CERTIFICATE-----\n", "custom_key": "-----BEGIN RSA PRIVATE KEY-----\nMIIEowIBAAKCAQEAwQHoetcl9+5ikGzV6cMzWtWPJHqXT3wpbEkRU9Yz7lgvddmG\ndtcGbg/1CGZu0jJGkMoppoUo4c3dts3iwqRYmBikUP77wwY2QGmDZw2FvkJCJlKn\nabIRuGvBKwzESIXgKk2016aTP6/dAjEHyo6SeoK8lkIySUvK0fyOVlsiEsCmOpid\ntnKX/a+50GjB79CJH4ER2lLVZnhePFR/zUOyPxZQQ4naHf7yu/b5jhO0f8fwt+py\nFxIXjbEIdZliWRkRMtzrHOJIhrmJ2A1J7iOrirbbwillwjjNVUWPf3IJ3M12S9pE\newooaeO2izNTERcG9HzAacbVRn2Y2SWIyT/18QIDAQABAoIBACbhTYXBZYKmYPCb\nHBR1IBlCQA2nLGf0qRuJNJZg5iEzXows/6tc8YymZkQE7nolapWsQ+upk2y5Xdp/\naxiuprIs9JzkYK8Ox0r+dlwCG1kSW+UAbX0bQ/qUqlsTvU6muVuMP8vZYHxJ3wmb\n+ufRBKztPTQ/rYWaYQcgC0RWI20HTFBMxlTAyNxYNWzX7RKFkGVVyB9RsAtmcc8g\n+j4OdosbfNoJPS0HeIfNpAznDfHKdxDk2Yc1tV6RHBrC1ynyLE9+TaflIAdo2MVv\nKLMLq51GqYKtgJFIlBRPQqKoyXdz3fGvXrTkf/WY9QNq0J1Vk5ERePZ54mN8iZB7\n9lwy/AkCgYEA6FXzosxswaJ2wQLeoYc7ceaweX/SwTvxHgXzRyJIIT0eJWgx13Wo\n/WA3Iziimsjf6qE+SI/8laxPp2A86VMaIt3Z3mJN/CqSVGw8LK2AQst+OwdPyDMu\niacE8lj/IFGC8mwNUAb9CzGU3JpU4PxxGFjS/eMtGeRXCWkK4NE+G08CgYEA1Kp9\nN2JrVlqUz+gAX+LPmE9OEMAS9WQSQsfCHGogIFDGGcNf7+uwBM7GAaSJIP01zcoe\nVAgWdzXCv3FLhsaZoJ6RyLOLay5phbu1iaTr4UNYm5WtYTzMzqh8l1+MFFDl9xDB\nvULuCIIrglM5MeS/qnSg1uMoH2oVPj9TVst/ir8CgYEAxrI7Ws9Zc4Bt70N1As+U\nlySjaEVZCMkqvHJ6TCuVZFfQoE0r0whdLdRLU2PsLFP+q7qaeZQqgBaNSKeVcDYR\n9B+nY/jOmQoPewPVsp/vQTCnE/R81spu0mp0YI6cIheT1Z9zAy322svcc43JaWB7\nmEbeqyLOP4Z4qSOcmghZBSECgYACvR9Xs0DGn+wCsW4vze/2ei77MD4OQvepPIFX\ndFZtlBy5ADcgE9z0cuVB6CiL8DbdK5kwY9pGNr8HUCI03iHkW6Zs+0L0YmihfEVe\nPG19PSzK9CaDdhD9KFZSbLyVFmWfxOt50H7YRTTiPMgjyFpfi5j2q348yVT0tEQS\nfhRqaQKBgAcWPokmJ7EbYQGeMbS7HC8eWO/RyamlnSffdCdSc7ue3zdVJxpAkQ8W\nqu80pEIF6raIQfAf8MXiiZ7auFOSnHQTXUbhCpvDLKi0Mwq3G8Pl07l+2s6dQG6T\nlv6XTQaMyf6n1yjzL+fzDrH3qXMxHMO/b13EePXpDMpY7HQpoLDi\n-----END RSA PRIVATE KEY-----\n", "method": "http", "settings": { diff --git a/tests/api_resources/test_keyless_certificates.py b/tests/api_resources/test_keyless_certificates.py index ea17c20d1b1..52085ebc74e 100644 --- a/tests/api_resources/test_keyless_certificates.py +++ b/tests/api_resources/test_keyless_certificates.py @@ -25,7 +25,7 @@ class TestKeylessCertificates: def test_method_create(self, client: Cloudflare) -> None: keyless_certificate = client.keyless_certificates.create( zone_id="023e105f4ecef8ad9ca31a8372d0c353", - certificate="-----BEGIN CERTIFICATE----- MIIDtTCCAp2gAwIBAgIJAM15n7fdxhRtMA0GCSqGSIb3DQEBBQUAMEUxCzAJBgNV BAYTAlVTMRMwEQYDVQQIEwpTb21lLVN0YXRlMSEwHwYDVQQKExhJbnRlcm5ldCBX aWRnaXRzIFB0eSBMdGQwHhcNMTQwMzExMTkyMTU5WhcNMTQwNDEwMTkyMTU5WjBF MQswCQYDVQQGEwJVUzETMBEGA1UECBMKU29tZS1TdGF0ZTEhMB8GA1UEChMYSW50 ZXJuZXQgV2lkZ2l0cyBQdHkgTHRkMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIB CgKCAQEAvq3sKsHpeduJHimOK+fvQdKsI8z8A05MZyyLp2/R/GE8FjNv+hkVY1WQ LIyTNNQH7CJecE1nbTfo8Y56S7x/rhxC6/DJ8MIulapFPnorq46KU6yRxiM0MQ3N nTJHlHA2ozZta6YBBfVfhHWl1F0IfNbXCLKvGwWWMbCx43OfW6KTkbRnE6gFWKuO fSO5h2u5TaWVuSIzBvYs7Vza6m+gtYAvKAJV2nSZ+eSEFPDo29corOy8+huEOUL8 5FAw4BFPsr1TlrlGPFitduQUHGrSL7skk1ESGza0to3bOtrodKei2s9bk5MXm7lZ qI+WZJX4Zu9+mzZhc9pCVi8r/qlXuQIDAQABo4GnMIGkMB0GA1UdDgQWBBRvavf+ sWM4IwKiH9X9w1vl6nUVRDB1BgNVHSMEbjBsgBRvavf+sWM4IwKiH9X9w1vl6nUV RKFJpEcwRTELMAkGA1UEBhMCVVMxEzARBgNVBAgTClNvbWUtU3RhdGUxITAfBgNV BAoTGEludGVybmV0IFdpZGdpdHMgUHR5IEx0ZIIJAM15n7fdxhRtMAwGA1UdEwQF MAMBAf8wDQYJKoZIhvcNAQEFBQADggEBABY2ZzBaW0dMsAAT7tPJzrVWVzQx6KU4 UEBLudIlWPlkAwTnINCWR/8eNjCCmGA4heUdHmazdpPa8RzwOmc0NT1NQqzSyktt vTqb4iHD7+8f9MqJ9/FssCfTtqr/Qst/hGH4Wmdf1EJ/6FqYAAb5iRlPgshFZxU8 uXtA8hWn6fK6eISD9HBdcAFToUvKNZ1BIDPvh9f95Ine8ar6yGd56TUNrHR8eHBs ESxz5ddVR/oWRysNJ+aGAyYqHS8S/ttmC7r4XCAHqXptkHPCGRqkAhsterYhd4I8 /cBzejUobNCjjHFbtkAL/SjxZOLW+pNkZwfeYdM8iPkD54Uua1v2tdw= -----END CERTIFICATE-----", + certificate="-----BEGIN CERTIFICATE-----\nMIIDtTCCAp2gAwIBAgIJAM15n7fdxhRtMA0GCSqGSIb3DQEBBQUAMEUxCzAJBgNV\nBAYTAlVTMRMwEQYDVQQIEwpTb21lLVN0YXRlMSEwHwYDVQQKExhJbnRlcm5ldCBX\naWRnaXRzIFB0eSBMdGQwHhcNMTQwMzExMTkyMTU5WhcNMTQwNDEwMTkyMTU5WjBF\nMQswCQYDVQQGEwJVUzETMBEGA1UECBMKU29tZS1TdGF0ZTEhMB8GA1UEChMYSW50\nZXJuZXQgV2lkZ2l0cyBQdHkgTHRkMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIB\nCgKCAQEAvq3sKsHpeduJHimOK+fvQdKsI8z8A05MZyyLp2/R/GE8FjNv+hkVY1WQ\nLIyTNNQH7CJecE1nbTfo8Y56S7x/rhxC6/DJ8MIulapFPnorq46KU6yRxiM0MQ3N\nnTJHlHA2ozZta6YBBfVfhHWl1F0IfNbXCLKvGwWWMbCx43OfW6KTkbRnE6gFWKuO\nfSO5h2u5TaWVuSIzBvYs7Vza6m+gtYAvKAJV2nSZ+eSEFPDo29corOy8+huEOUL8\n5FAw4BFPsr1TlrlGPFitduQUHGrSL7skk1ESGza0to3bOtrodKei2s9bk5MXm7lZ\nqI+WZJX4Zu9+mzZhc9pCVi8r/qlXuQIDAQABo4GnMIGkMB0GA1UdDgQWBBRvavf+\nsWM4IwKiH9X9w1vl6nUVRDB1BgNVHSMEbjBsgBRvavf+sWM4IwKiH9X9w1vl6nUV\nRKFJpEcwRTELMAkGA1UEBhMCVVMxEzARBgNVBAgTClNvbWUtU3RhdGUxITAfBgNV\nBAoTGEludGVybmV0IFdpZGdpdHMgUHR5IEx0ZIIJAM15n7fdxhRtMAwGA1UdEwQF\nMAMBAf8wDQYJKoZIhvcNAQEFBQADggEBABY2ZzBaW0dMsAAT7tPJzrVWVzQx6KU4\nUEBLudIlWPlkAwTnINCWR/8eNjCCmGA4heUdHmazdpPa8RzwOmc0NT1NQqzSyktt\nvTqb4iHD7+8f9MqJ9/FssCfTtqr/Qst/hGH4Wmdf1EJ/6FqYAAb5iRlPgshFZxU8\nuXtA8hWn6fK6eISD9HBdcAFToUvKNZ1BIDPvh9f95Ine8ar6yGd56TUNrHR8eHBs\nESxz5ddVR/oWRysNJ+aGAyYqHS8S/ttmC7r4XCAHqXptkHPCGRqkAhsterYhd4I8\n/cBzejUobNCjjHFbtkAL/SjxZOLW+pNkZwfeYdM8iPkD54Uua1v2tdw=\n-----END CERTIFICATE-----", host="example.com", port=24008, ) @@ -35,7 +35,7 @@ def test_method_create(self, client: Cloudflare) -> None: def test_method_create_with_all_params(self, client: Cloudflare) -> None: keyless_certificate = client.keyless_certificates.create( zone_id="023e105f4ecef8ad9ca31a8372d0c353", - certificate="-----BEGIN CERTIFICATE----- MIIDtTCCAp2gAwIBAgIJAM15n7fdxhRtMA0GCSqGSIb3DQEBBQUAMEUxCzAJBgNV BAYTAlVTMRMwEQYDVQQIEwpTb21lLVN0YXRlMSEwHwYDVQQKExhJbnRlcm5ldCBX aWRnaXRzIFB0eSBMdGQwHhcNMTQwMzExMTkyMTU5WhcNMTQwNDEwMTkyMTU5WjBF MQswCQYDVQQGEwJVUzETMBEGA1UECBMKU29tZS1TdGF0ZTEhMB8GA1UEChMYSW50 ZXJuZXQgV2lkZ2l0cyBQdHkgTHRkMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIB CgKCAQEAvq3sKsHpeduJHimOK+fvQdKsI8z8A05MZyyLp2/R/GE8FjNv+hkVY1WQ LIyTNNQH7CJecE1nbTfo8Y56S7x/rhxC6/DJ8MIulapFPnorq46KU6yRxiM0MQ3N nTJHlHA2ozZta6YBBfVfhHWl1F0IfNbXCLKvGwWWMbCx43OfW6KTkbRnE6gFWKuO fSO5h2u5TaWVuSIzBvYs7Vza6m+gtYAvKAJV2nSZ+eSEFPDo29corOy8+huEOUL8 5FAw4BFPsr1TlrlGPFitduQUHGrSL7skk1ESGza0to3bOtrodKei2s9bk5MXm7lZ qI+WZJX4Zu9+mzZhc9pCVi8r/qlXuQIDAQABo4GnMIGkMB0GA1UdDgQWBBRvavf+ sWM4IwKiH9X9w1vl6nUVRDB1BgNVHSMEbjBsgBRvavf+sWM4IwKiH9X9w1vl6nUV RKFJpEcwRTELMAkGA1UEBhMCVVMxEzARBgNVBAgTClNvbWUtU3RhdGUxITAfBgNV BAoTGEludGVybmV0IFdpZGdpdHMgUHR5IEx0ZIIJAM15n7fdxhRtMAwGA1UdEwQF MAMBAf8wDQYJKoZIhvcNAQEFBQADggEBABY2ZzBaW0dMsAAT7tPJzrVWVzQx6KU4 UEBLudIlWPlkAwTnINCWR/8eNjCCmGA4heUdHmazdpPa8RzwOmc0NT1NQqzSyktt vTqb4iHD7+8f9MqJ9/FssCfTtqr/Qst/hGH4Wmdf1EJ/6FqYAAb5iRlPgshFZxU8 uXtA8hWn6fK6eISD9HBdcAFToUvKNZ1BIDPvh9f95Ine8ar6yGd56TUNrHR8eHBs ESxz5ddVR/oWRysNJ+aGAyYqHS8S/ttmC7r4XCAHqXptkHPCGRqkAhsterYhd4I8 /cBzejUobNCjjHFbtkAL/SjxZOLW+pNkZwfeYdM8iPkD54Uua1v2tdw= -----END CERTIFICATE-----", + certificate="-----BEGIN CERTIFICATE-----\nMIIDtTCCAp2gAwIBAgIJAM15n7fdxhRtMA0GCSqGSIb3DQEBBQUAMEUxCzAJBgNV\nBAYTAlVTMRMwEQYDVQQIEwpTb21lLVN0YXRlMSEwHwYDVQQKExhJbnRlcm5ldCBX\naWRnaXRzIFB0eSBMdGQwHhcNMTQwMzExMTkyMTU5WhcNMTQwNDEwMTkyMTU5WjBF\nMQswCQYDVQQGEwJVUzETMBEGA1UECBMKU29tZS1TdGF0ZTEhMB8GA1UEChMYSW50\nZXJuZXQgV2lkZ2l0cyBQdHkgTHRkMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIB\nCgKCAQEAvq3sKsHpeduJHimOK+fvQdKsI8z8A05MZyyLp2/R/GE8FjNv+hkVY1WQ\nLIyTNNQH7CJecE1nbTfo8Y56S7x/rhxC6/DJ8MIulapFPnorq46KU6yRxiM0MQ3N\nnTJHlHA2ozZta6YBBfVfhHWl1F0IfNbXCLKvGwWWMbCx43OfW6KTkbRnE6gFWKuO\nfSO5h2u5TaWVuSIzBvYs7Vza6m+gtYAvKAJV2nSZ+eSEFPDo29corOy8+huEOUL8\n5FAw4BFPsr1TlrlGPFitduQUHGrSL7skk1ESGza0to3bOtrodKei2s9bk5MXm7lZ\nqI+WZJX4Zu9+mzZhc9pCVi8r/qlXuQIDAQABo4GnMIGkMB0GA1UdDgQWBBRvavf+\nsWM4IwKiH9X9w1vl6nUVRDB1BgNVHSMEbjBsgBRvavf+sWM4IwKiH9X9w1vl6nUV\nRKFJpEcwRTELMAkGA1UEBhMCVVMxEzARBgNVBAgTClNvbWUtU3RhdGUxITAfBgNV\nBAoTGEludGVybmV0IFdpZGdpdHMgUHR5IEx0ZIIJAM15n7fdxhRtMAwGA1UdEwQF\nMAMBAf8wDQYJKoZIhvcNAQEFBQADggEBABY2ZzBaW0dMsAAT7tPJzrVWVzQx6KU4\nUEBLudIlWPlkAwTnINCWR/8eNjCCmGA4heUdHmazdpPa8RzwOmc0NT1NQqzSyktt\nvTqb4iHD7+8f9MqJ9/FssCfTtqr/Qst/hGH4Wmdf1EJ/6FqYAAb5iRlPgshFZxU8\nuXtA8hWn6fK6eISD9HBdcAFToUvKNZ1BIDPvh9f95Ine8ar6yGd56TUNrHR8eHBs\nESxz5ddVR/oWRysNJ+aGAyYqHS8S/ttmC7r4XCAHqXptkHPCGRqkAhsterYhd4I8\n/cBzejUobNCjjHFbtkAL/SjxZOLW+pNkZwfeYdM8iPkD54Uua1v2tdw=\n-----END CERTIFICATE-----", host="example.com", port=24008, bundle_method="ubiquitous", @@ -51,7 +51,7 @@ def test_method_create_with_all_params(self, client: Cloudflare) -> None: def test_raw_response_create(self, client: Cloudflare) -> None: response = client.keyless_certificates.with_raw_response.create( zone_id="023e105f4ecef8ad9ca31a8372d0c353", - certificate="-----BEGIN CERTIFICATE----- MIIDtTCCAp2gAwIBAgIJAM15n7fdxhRtMA0GCSqGSIb3DQEBBQUAMEUxCzAJBgNV BAYTAlVTMRMwEQYDVQQIEwpTb21lLVN0YXRlMSEwHwYDVQQKExhJbnRlcm5ldCBX aWRnaXRzIFB0eSBMdGQwHhcNMTQwMzExMTkyMTU5WhcNMTQwNDEwMTkyMTU5WjBF MQswCQYDVQQGEwJVUzETMBEGA1UECBMKU29tZS1TdGF0ZTEhMB8GA1UEChMYSW50 ZXJuZXQgV2lkZ2l0cyBQdHkgTHRkMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIB CgKCAQEAvq3sKsHpeduJHimOK+fvQdKsI8z8A05MZyyLp2/R/GE8FjNv+hkVY1WQ LIyTNNQH7CJecE1nbTfo8Y56S7x/rhxC6/DJ8MIulapFPnorq46KU6yRxiM0MQ3N nTJHlHA2ozZta6YBBfVfhHWl1F0IfNbXCLKvGwWWMbCx43OfW6KTkbRnE6gFWKuO fSO5h2u5TaWVuSIzBvYs7Vza6m+gtYAvKAJV2nSZ+eSEFPDo29corOy8+huEOUL8 5FAw4BFPsr1TlrlGPFitduQUHGrSL7skk1ESGza0to3bOtrodKei2s9bk5MXm7lZ qI+WZJX4Zu9+mzZhc9pCVi8r/qlXuQIDAQABo4GnMIGkMB0GA1UdDgQWBBRvavf+ sWM4IwKiH9X9w1vl6nUVRDB1BgNVHSMEbjBsgBRvavf+sWM4IwKiH9X9w1vl6nUV RKFJpEcwRTELMAkGA1UEBhMCVVMxEzARBgNVBAgTClNvbWUtU3RhdGUxITAfBgNV BAoTGEludGVybmV0IFdpZGdpdHMgUHR5IEx0ZIIJAM15n7fdxhRtMAwGA1UdEwQF MAMBAf8wDQYJKoZIhvcNAQEFBQADggEBABY2ZzBaW0dMsAAT7tPJzrVWVzQx6KU4 UEBLudIlWPlkAwTnINCWR/8eNjCCmGA4heUdHmazdpPa8RzwOmc0NT1NQqzSyktt vTqb4iHD7+8f9MqJ9/FssCfTtqr/Qst/hGH4Wmdf1EJ/6FqYAAb5iRlPgshFZxU8 uXtA8hWn6fK6eISD9HBdcAFToUvKNZ1BIDPvh9f95Ine8ar6yGd56TUNrHR8eHBs ESxz5ddVR/oWRysNJ+aGAyYqHS8S/ttmC7r4XCAHqXptkHPCGRqkAhsterYhd4I8 /cBzejUobNCjjHFbtkAL/SjxZOLW+pNkZwfeYdM8iPkD54Uua1v2tdw= -----END CERTIFICATE-----", + certificate="-----BEGIN CERTIFICATE-----\nMIIDtTCCAp2gAwIBAgIJAM15n7fdxhRtMA0GCSqGSIb3DQEBBQUAMEUxCzAJBgNV\nBAYTAlVTMRMwEQYDVQQIEwpTb21lLVN0YXRlMSEwHwYDVQQKExhJbnRlcm5ldCBX\naWRnaXRzIFB0eSBMdGQwHhcNMTQwMzExMTkyMTU5WhcNMTQwNDEwMTkyMTU5WjBF\nMQswCQYDVQQGEwJVUzETMBEGA1UECBMKU29tZS1TdGF0ZTEhMB8GA1UEChMYSW50\nZXJuZXQgV2lkZ2l0cyBQdHkgTHRkMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIB\nCgKCAQEAvq3sKsHpeduJHimOK+fvQdKsI8z8A05MZyyLp2/R/GE8FjNv+hkVY1WQ\nLIyTNNQH7CJecE1nbTfo8Y56S7x/rhxC6/DJ8MIulapFPnorq46KU6yRxiM0MQ3N\nnTJHlHA2ozZta6YBBfVfhHWl1F0IfNbXCLKvGwWWMbCx43OfW6KTkbRnE6gFWKuO\nfSO5h2u5TaWVuSIzBvYs7Vza6m+gtYAvKAJV2nSZ+eSEFPDo29corOy8+huEOUL8\n5FAw4BFPsr1TlrlGPFitduQUHGrSL7skk1ESGza0to3bOtrodKei2s9bk5MXm7lZ\nqI+WZJX4Zu9+mzZhc9pCVi8r/qlXuQIDAQABo4GnMIGkMB0GA1UdDgQWBBRvavf+\nsWM4IwKiH9X9w1vl6nUVRDB1BgNVHSMEbjBsgBRvavf+sWM4IwKiH9X9w1vl6nUV\nRKFJpEcwRTELMAkGA1UEBhMCVVMxEzARBgNVBAgTClNvbWUtU3RhdGUxITAfBgNV\nBAoTGEludGVybmV0IFdpZGdpdHMgUHR5IEx0ZIIJAM15n7fdxhRtMAwGA1UdEwQF\nMAMBAf8wDQYJKoZIhvcNAQEFBQADggEBABY2ZzBaW0dMsAAT7tPJzrVWVzQx6KU4\nUEBLudIlWPlkAwTnINCWR/8eNjCCmGA4heUdHmazdpPa8RzwOmc0NT1NQqzSyktt\nvTqb4iHD7+8f9MqJ9/FssCfTtqr/Qst/hGH4Wmdf1EJ/6FqYAAb5iRlPgshFZxU8\nuXtA8hWn6fK6eISD9HBdcAFToUvKNZ1BIDPvh9f95Ine8ar6yGd56TUNrHR8eHBs\nESxz5ddVR/oWRysNJ+aGAyYqHS8S/ttmC7r4XCAHqXptkHPCGRqkAhsterYhd4I8\n/cBzejUobNCjjHFbtkAL/SjxZOLW+pNkZwfeYdM8iPkD54Uua1v2tdw=\n-----END CERTIFICATE-----", host="example.com", port=24008, ) @@ -65,7 +65,7 @@ def test_raw_response_create(self, client: Cloudflare) -> None: def test_streaming_response_create(self, client: Cloudflare) -> None: with client.keyless_certificates.with_streaming_response.create( zone_id="023e105f4ecef8ad9ca31a8372d0c353", - certificate="-----BEGIN CERTIFICATE----- MIIDtTCCAp2gAwIBAgIJAM15n7fdxhRtMA0GCSqGSIb3DQEBBQUAMEUxCzAJBgNV BAYTAlVTMRMwEQYDVQQIEwpTb21lLVN0YXRlMSEwHwYDVQQKExhJbnRlcm5ldCBX aWRnaXRzIFB0eSBMdGQwHhcNMTQwMzExMTkyMTU5WhcNMTQwNDEwMTkyMTU5WjBF MQswCQYDVQQGEwJVUzETMBEGA1UECBMKU29tZS1TdGF0ZTEhMB8GA1UEChMYSW50 ZXJuZXQgV2lkZ2l0cyBQdHkgTHRkMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIB CgKCAQEAvq3sKsHpeduJHimOK+fvQdKsI8z8A05MZyyLp2/R/GE8FjNv+hkVY1WQ LIyTNNQH7CJecE1nbTfo8Y56S7x/rhxC6/DJ8MIulapFPnorq46KU6yRxiM0MQ3N nTJHlHA2ozZta6YBBfVfhHWl1F0IfNbXCLKvGwWWMbCx43OfW6KTkbRnE6gFWKuO fSO5h2u5TaWVuSIzBvYs7Vza6m+gtYAvKAJV2nSZ+eSEFPDo29corOy8+huEOUL8 5FAw4BFPsr1TlrlGPFitduQUHGrSL7skk1ESGza0to3bOtrodKei2s9bk5MXm7lZ qI+WZJX4Zu9+mzZhc9pCVi8r/qlXuQIDAQABo4GnMIGkMB0GA1UdDgQWBBRvavf+ sWM4IwKiH9X9w1vl6nUVRDB1BgNVHSMEbjBsgBRvavf+sWM4IwKiH9X9w1vl6nUV RKFJpEcwRTELMAkGA1UEBhMCVVMxEzARBgNVBAgTClNvbWUtU3RhdGUxITAfBgNV BAoTGEludGVybmV0IFdpZGdpdHMgUHR5IEx0ZIIJAM15n7fdxhRtMAwGA1UdEwQF MAMBAf8wDQYJKoZIhvcNAQEFBQADggEBABY2ZzBaW0dMsAAT7tPJzrVWVzQx6KU4 UEBLudIlWPlkAwTnINCWR/8eNjCCmGA4heUdHmazdpPa8RzwOmc0NT1NQqzSyktt vTqb4iHD7+8f9MqJ9/FssCfTtqr/Qst/hGH4Wmdf1EJ/6FqYAAb5iRlPgshFZxU8 uXtA8hWn6fK6eISD9HBdcAFToUvKNZ1BIDPvh9f95Ine8ar6yGd56TUNrHR8eHBs ESxz5ddVR/oWRysNJ+aGAyYqHS8S/ttmC7r4XCAHqXptkHPCGRqkAhsterYhd4I8 /cBzejUobNCjjHFbtkAL/SjxZOLW+pNkZwfeYdM8iPkD54Uua1v2tdw= -----END CERTIFICATE-----", + certificate="-----BEGIN CERTIFICATE-----\nMIIDtTCCAp2gAwIBAgIJAM15n7fdxhRtMA0GCSqGSIb3DQEBBQUAMEUxCzAJBgNV\nBAYTAlVTMRMwEQYDVQQIEwpTb21lLVN0YXRlMSEwHwYDVQQKExhJbnRlcm5ldCBX\naWRnaXRzIFB0eSBMdGQwHhcNMTQwMzExMTkyMTU5WhcNMTQwNDEwMTkyMTU5WjBF\nMQswCQYDVQQGEwJVUzETMBEGA1UECBMKU29tZS1TdGF0ZTEhMB8GA1UEChMYSW50\nZXJuZXQgV2lkZ2l0cyBQdHkgTHRkMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIB\nCgKCAQEAvq3sKsHpeduJHimOK+fvQdKsI8z8A05MZyyLp2/R/GE8FjNv+hkVY1WQ\nLIyTNNQH7CJecE1nbTfo8Y56S7x/rhxC6/DJ8MIulapFPnorq46KU6yRxiM0MQ3N\nnTJHlHA2ozZta6YBBfVfhHWl1F0IfNbXCLKvGwWWMbCx43OfW6KTkbRnE6gFWKuO\nfSO5h2u5TaWVuSIzBvYs7Vza6m+gtYAvKAJV2nSZ+eSEFPDo29corOy8+huEOUL8\n5FAw4BFPsr1TlrlGPFitduQUHGrSL7skk1ESGza0to3bOtrodKei2s9bk5MXm7lZ\nqI+WZJX4Zu9+mzZhc9pCVi8r/qlXuQIDAQABo4GnMIGkMB0GA1UdDgQWBBRvavf+\nsWM4IwKiH9X9w1vl6nUVRDB1BgNVHSMEbjBsgBRvavf+sWM4IwKiH9X9w1vl6nUV\nRKFJpEcwRTELMAkGA1UEBhMCVVMxEzARBgNVBAgTClNvbWUtU3RhdGUxITAfBgNV\nBAoTGEludGVybmV0IFdpZGdpdHMgUHR5IEx0ZIIJAM15n7fdxhRtMAwGA1UdEwQF\nMAMBAf8wDQYJKoZIhvcNAQEFBQADggEBABY2ZzBaW0dMsAAT7tPJzrVWVzQx6KU4\nUEBLudIlWPlkAwTnINCWR/8eNjCCmGA4heUdHmazdpPa8RzwOmc0NT1NQqzSyktt\nvTqb4iHD7+8f9MqJ9/FssCfTtqr/Qst/hGH4Wmdf1EJ/6FqYAAb5iRlPgshFZxU8\nuXtA8hWn6fK6eISD9HBdcAFToUvKNZ1BIDPvh9f95Ine8ar6yGd56TUNrHR8eHBs\nESxz5ddVR/oWRysNJ+aGAyYqHS8S/ttmC7r4XCAHqXptkHPCGRqkAhsterYhd4I8\n/cBzejUobNCjjHFbtkAL/SjxZOLW+pNkZwfeYdM8iPkD54Uua1v2tdw=\n-----END CERTIFICATE-----", host="example.com", port=24008, ) as response: @@ -82,7 +82,7 @@ def test_path_params_create(self, client: Cloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): client.keyless_certificates.with_raw_response.create( zone_id="", - certificate="-----BEGIN CERTIFICATE----- MIIDtTCCAp2gAwIBAgIJAM15n7fdxhRtMA0GCSqGSIb3DQEBBQUAMEUxCzAJBgNV BAYTAlVTMRMwEQYDVQQIEwpTb21lLVN0YXRlMSEwHwYDVQQKExhJbnRlcm5ldCBX aWRnaXRzIFB0eSBMdGQwHhcNMTQwMzExMTkyMTU5WhcNMTQwNDEwMTkyMTU5WjBF MQswCQYDVQQGEwJVUzETMBEGA1UECBMKU29tZS1TdGF0ZTEhMB8GA1UEChMYSW50 ZXJuZXQgV2lkZ2l0cyBQdHkgTHRkMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIB CgKCAQEAvq3sKsHpeduJHimOK+fvQdKsI8z8A05MZyyLp2/R/GE8FjNv+hkVY1WQ LIyTNNQH7CJecE1nbTfo8Y56S7x/rhxC6/DJ8MIulapFPnorq46KU6yRxiM0MQ3N nTJHlHA2ozZta6YBBfVfhHWl1F0IfNbXCLKvGwWWMbCx43OfW6KTkbRnE6gFWKuO fSO5h2u5TaWVuSIzBvYs7Vza6m+gtYAvKAJV2nSZ+eSEFPDo29corOy8+huEOUL8 5FAw4BFPsr1TlrlGPFitduQUHGrSL7skk1ESGza0to3bOtrodKei2s9bk5MXm7lZ qI+WZJX4Zu9+mzZhc9pCVi8r/qlXuQIDAQABo4GnMIGkMB0GA1UdDgQWBBRvavf+ sWM4IwKiH9X9w1vl6nUVRDB1BgNVHSMEbjBsgBRvavf+sWM4IwKiH9X9w1vl6nUV RKFJpEcwRTELMAkGA1UEBhMCVVMxEzARBgNVBAgTClNvbWUtU3RhdGUxITAfBgNV BAoTGEludGVybmV0IFdpZGdpdHMgUHR5IEx0ZIIJAM15n7fdxhRtMAwGA1UdEwQF MAMBAf8wDQYJKoZIhvcNAQEFBQADggEBABY2ZzBaW0dMsAAT7tPJzrVWVzQx6KU4 UEBLudIlWPlkAwTnINCWR/8eNjCCmGA4heUdHmazdpPa8RzwOmc0NT1NQqzSyktt vTqb4iHD7+8f9MqJ9/FssCfTtqr/Qst/hGH4Wmdf1EJ/6FqYAAb5iRlPgshFZxU8 uXtA8hWn6fK6eISD9HBdcAFToUvKNZ1BIDPvh9f95Ine8ar6yGd56TUNrHR8eHBs ESxz5ddVR/oWRysNJ+aGAyYqHS8S/ttmC7r4XCAHqXptkHPCGRqkAhsterYhd4I8 /cBzejUobNCjjHFbtkAL/SjxZOLW+pNkZwfeYdM8iPkD54Uua1v2tdw= -----END CERTIFICATE-----", + certificate="-----BEGIN CERTIFICATE-----\nMIIDtTCCAp2gAwIBAgIJAM15n7fdxhRtMA0GCSqGSIb3DQEBBQUAMEUxCzAJBgNV\nBAYTAlVTMRMwEQYDVQQIEwpTb21lLVN0YXRlMSEwHwYDVQQKExhJbnRlcm5ldCBX\naWRnaXRzIFB0eSBMdGQwHhcNMTQwMzExMTkyMTU5WhcNMTQwNDEwMTkyMTU5WjBF\nMQswCQYDVQQGEwJVUzETMBEGA1UECBMKU29tZS1TdGF0ZTEhMB8GA1UEChMYSW50\nZXJuZXQgV2lkZ2l0cyBQdHkgTHRkMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIB\nCgKCAQEAvq3sKsHpeduJHimOK+fvQdKsI8z8A05MZyyLp2/R/GE8FjNv+hkVY1WQ\nLIyTNNQH7CJecE1nbTfo8Y56S7x/rhxC6/DJ8MIulapFPnorq46KU6yRxiM0MQ3N\nnTJHlHA2ozZta6YBBfVfhHWl1F0IfNbXCLKvGwWWMbCx43OfW6KTkbRnE6gFWKuO\nfSO5h2u5TaWVuSIzBvYs7Vza6m+gtYAvKAJV2nSZ+eSEFPDo29corOy8+huEOUL8\n5FAw4BFPsr1TlrlGPFitduQUHGrSL7skk1ESGza0to3bOtrodKei2s9bk5MXm7lZ\nqI+WZJX4Zu9+mzZhc9pCVi8r/qlXuQIDAQABo4GnMIGkMB0GA1UdDgQWBBRvavf+\nsWM4IwKiH9X9w1vl6nUVRDB1BgNVHSMEbjBsgBRvavf+sWM4IwKiH9X9w1vl6nUV\nRKFJpEcwRTELMAkGA1UEBhMCVVMxEzARBgNVBAgTClNvbWUtU3RhdGUxITAfBgNV\nBAoTGEludGVybmV0IFdpZGdpdHMgUHR5IEx0ZIIJAM15n7fdxhRtMAwGA1UdEwQF\nMAMBAf8wDQYJKoZIhvcNAQEFBQADggEBABY2ZzBaW0dMsAAT7tPJzrVWVzQx6KU4\nUEBLudIlWPlkAwTnINCWR/8eNjCCmGA4heUdHmazdpPa8RzwOmc0NT1NQqzSyktt\nvTqb4iHD7+8f9MqJ9/FssCfTtqr/Qst/hGH4Wmdf1EJ/6FqYAAb5iRlPgshFZxU8\nuXtA8hWn6fK6eISD9HBdcAFToUvKNZ1BIDPvh9f95Ine8ar6yGd56TUNrHR8eHBs\nESxz5ddVR/oWRysNJ+aGAyYqHS8S/ttmC7r4XCAHqXptkHPCGRqkAhsterYhd4I8\n/cBzejUobNCjjHFbtkAL/SjxZOLW+pNkZwfeYdM8iPkD54Uua1v2tdw=\n-----END CERTIFICATE-----", host="example.com", port=24008, ) @@ -301,7 +301,7 @@ class TestAsyncKeylessCertificates: async def test_method_create(self, async_client: AsyncCloudflare) -> None: keyless_certificate = await async_client.keyless_certificates.create( zone_id="023e105f4ecef8ad9ca31a8372d0c353", - certificate="-----BEGIN CERTIFICATE----- MIIDtTCCAp2gAwIBAgIJAM15n7fdxhRtMA0GCSqGSIb3DQEBBQUAMEUxCzAJBgNV BAYTAlVTMRMwEQYDVQQIEwpTb21lLVN0YXRlMSEwHwYDVQQKExhJbnRlcm5ldCBX aWRnaXRzIFB0eSBMdGQwHhcNMTQwMzExMTkyMTU5WhcNMTQwNDEwMTkyMTU5WjBF MQswCQYDVQQGEwJVUzETMBEGA1UECBMKU29tZS1TdGF0ZTEhMB8GA1UEChMYSW50 ZXJuZXQgV2lkZ2l0cyBQdHkgTHRkMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIB CgKCAQEAvq3sKsHpeduJHimOK+fvQdKsI8z8A05MZyyLp2/R/GE8FjNv+hkVY1WQ LIyTNNQH7CJecE1nbTfo8Y56S7x/rhxC6/DJ8MIulapFPnorq46KU6yRxiM0MQ3N nTJHlHA2ozZta6YBBfVfhHWl1F0IfNbXCLKvGwWWMbCx43OfW6KTkbRnE6gFWKuO fSO5h2u5TaWVuSIzBvYs7Vza6m+gtYAvKAJV2nSZ+eSEFPDo29corOy8+huEOUL8 5FAw4BFPsr1TlrlGPFitduQUHGrSL7skk1ESGza0to3bOtrodKei2s9bk5MXm7lZ qI+WZJX4Zu9+mzZhc9pCVi8r/qlXuQIDAQABo4GnMIGkMB0GA1UdDgQWBBRvavf+ sWM4IwKiH9X9w1vl6nUVRDB1BgNVHSMEbjBsgBRvavf+sWM4IwKiH9X9w1vl6nUV RKFJpEcwRTELMAkGA1UEBhMCVVMxEzARBgNVBAgTClNvbWUtU3RhdGUxITAfBgNV BAoTGEludGVybmV0IFdpZGdpdHMgUHR5IEx0ZIIJAM15n7fdxhRtMAwGA1UdEwQF MAMBAf8wDQYJKoZIhvcNAQEFBQADggEBABY2ZzBaW0dMsAAT7tPJzrVWVzQx6KU4 UEBLudIlWPlkAwTnINCWR/8eNjCCmGA4heUdHmazdpPa8RzwOmc0NT1NQqzSyktt vTqb4iHD7+8f9MqJ9/FssCfTtqr/Qst/hGH4Wmdf1EJ/6FqYAAb5iRlPgshFZxU8 uXtA8hWn6fK6eISD9HBdcAFToUvKNZ1BIDPvh9f95Ine8ar6yGd56TUNrHR8eHBs ESxz5ddVR/oWRysNJ+aGAyYqHS8S/ttmC7r4XCAHqXptkHPCGRqkAhsterYhd4I8 /cBzejUobNCjjHFbtkAL/SjxZOLW+pNkZwfeYdM8iPkD54Uua1v2tdw= -----END CERTIFICATE-----", + certificate="-----BEGIN CERTIFICATE-----\nMIIDtTCCAp2gAwIBAgIJAM15n7fdxhRtMA0GCSqGSIb3DQEBBQUAMEUxCzAJBgNV\nBAYTAlVTMRMwEQYDVQQIEwpTb21lLVN0YXRlMSEwHwYDVQQKExhJbnRlcm5ldCBX\naWRnaXRzIFB0eSBMdGQwHhcNMTQwMzExMTkyMTU5WhcNMTQwNDEwMTkyMTU5WjBF\nMQswCQYDVQQGEwJVUzETMBEGA1UECBMKU29tZS1TdGF0ZTEhMB8GA1UEChMYSW50\nZXJuZXQgV2lkZ2l0cyBQdHkgTHRkMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIB\nCgKCAQEAvq3sKsHpeduJHimOK+fvQdKsI8z8A05MZyyLp2/R/GE8FjNv+hkVY1WQ\nLIyTNNQH7CJecE1nbTfo8Y56S7x/rhxC6/DJ8MIulapFPnorq46KU6yRxiM0MQ3N\nnTJHlHA2ozZta6YBBfVfhHWl1F0IfNbXCLKvGwWWMbCx43OfW6KTkbRnE6gFWKuO\nfSO5h2u5TaWVuSIzBvYs7Vza6m+gtYAvKAJV2nSZ+eSEFPDo29corOy8+huEOUL8\n5FAw4BFPsr1TlrlGPFitduQUHGrSL7skk1ESGza0to3bOtrodKei2s9bk5MXm7lZ\nqI+WZJX4Zu9+mzZhc9pCVi8r/qlXuQIDAQABo4GnMIGkMB0GA1UdDgQWBBRvavf+\nsWM4IwKiH9X9w1vl6nUVRDB1BgNVHSMEbjBsgBRvavf+sWM4IwKiH9X9w1vl6nUV\nRKFJpEcwRTELMAkGA1UEBhMCVVMxEzARBgNVBAgTClNvbWUtU3RhdGUxITAfBgNV\nBAoTGEludGVybmV0IFdpZGdpdHMgUHR5IEx0ZIIJAM15n7fdxhRtMAwGA1UdEwQF\nMAMBAf8wDQYJKoZIhvcNAQEFBQADggEBABY2ZzBaW0dMsAAT7tPJzrVWVzQx6KU4\nUEBLudIlWPlkAwTnINCWR/8eNjCCmGA4heUdHmazdpPa8RzwOmc0NT1NQqzSyktt\nvTqb4iHD7+8f9MqJ9/FssCfTtqr/Qst/hGH4Wmdf1EJ/6FqYAAb5iRlPgshFZxU8\nuXtA8hWn6fK6eISD9HBdcAFToUvKNZ1BIDPvh9f95Ine8ar6yGd56TUNrHR8eHBs\nESxz5ddVR/oWRysNJ+aGAyYqHS8S/ttmC7r4XCAHqXptkHPCGRqkAhsterYhd4I8\n/cBzejUobNCjjHFbtkAL/SjxZOLW+pNkZwfeYdM8iPkD54Uua1v2tdw=\n-----END CERTIFICATE-----", host="example.com", port=24008, ) @@ -311,7 +311,7 @@ async def test_method_create(self, async_client: AsyncCloudflare) -> None: async def test_method_create_with_all_params(self, async_client: AsyncCloudflare) -> None: keyless_certificate = await async_client.keyless_certificates.create( zone_id="023e105f4ecef8ad9ca31a8372d0c353", - certificate="-----BEGIN CERTIFICATE----- MIIDtTCCAp2gAwIBAgIJAM15n7fdxhRtMA0GCSqGSIb3DQEBBQUAMEUxCzAJBgNV BAYTAlVTMRMwEQYDVQQIEwpTb21lLVN0YXRlMSEwHwYDVQQKExhJbnRlcm5ldCBX aWRnaXRzIFB0eSBMdGQwHhcNMTQwMzExMTkyMTU5WhcNMTQwNDEwMTkyMTU5WjBF MQswCQYDVQQGEwJVUzETMBEGA1UECBMKU29tZS1TdGF0ZTEhMB8GA1UEChMYSW50 ZXJuZXQgV2lkZ2l0cyBQdHkgTHRkMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIB CgKCAQEAvq3sKsHpeduJHimOK+fvQdKsI8z8A05MZyyLp2/R/GE8FjNv+hkVY1WQ LIyTNNQH7CJecE1nbTfo8Y56S7x/rhxC6/DJ8MIulapFPnorq46KU6yRxiM0MQ3N nTJHlHA2ozZta6YBBfVfhHWl1F0IfNbXCLKvGwWWMbCx43OfW6KTkbRnE6gFWKuO fSO5h2u5TaWVuSIzBvYs7Vza6m+gtYAvKAJV2nSZ+eSEFPDo29corOy8+huEOUL8 5FAw4BFPsr1TlrlGPFitduQUHGrSL7skk1ESGza0to3bOtrodKei2s9bk5MXm7lZ qI+WZJX4Zu9+mzZhc9pCVi8r/qlXuQIDAQABo4GnMIGkMB0GA1UdDgQWBBRvavf+ sWM4IwKiH9X9w1vl6nUVRDB1BgNVHSMEbjBsgBRvavf+sWM4IwKiH9X9w1vl6nUV RKFJpEcwRTELMAkGA1UEBhMCVVMxEzARBgNVBAgTClNvbWUtU3RhdGUxITAfBgNV BAoTGEludGVybmV0IFdpZGdpdHMgUHR5IEx0ZIIJAM15n7fdxhRtMAwGA1UdEwQF MAMBAf8wDQYJKoZIhvcNAQEFBQADggEBABY2ZzBaW0dMsAAT7tPJzrVWVzQx6KU4 UEBLudIlWPlkAwTnINCWR/8eNjCCmGA4heUdHmazdpPa8RzwOmc0NT1NQqzSyktt vTqb4iHD7+8f9MqJ9/FssCfTtqr/Qst/hGH4Wmdf1EJ/6FqYAAb5iRlPgshFZxU8 uXtA8hWn6fK6eISD9HBdcAFToUvKNZ1BIDPvh9f95Ine8ar6yGd56TUNrHR8eHBs ESxz5ddVR/oWRysNJ+aGAyYqHS8S/ttmC7r4XCAHqXptkHPCGRqkAhsterYhd4I8 /cBzejUobNCjjHFbtkAL/SjxZOLW+pNkZwfeYdM8iPkD54Uua1v2tdw= -----END CERTIFICATE-----", + certificate="-----BEGIN CERTIFICATE-----\nMIIDtTCCAp2gAwIBAgIJAM15n7fdxhRtMA0GCSqGSIb3DQEBBQUAMEUxCzAJBgNV\nBAYTAlVTMRMwEQYDVQQIEwpTb21lLVN0YXRlMSEwHwYDVQQKExhJbnRlcm5ldCBX\naWRnaXRzIFB0eSBMdGQwHhcNMTQwMzExMTkyMTU5WhcNMTQwNDEwMTkyMTU5WjBF\nMQswCQYDVQQGEwJVUzETMBEGA1UECBMKU29tZS1TdGF0ZTEhMB8GA1UEChMYSW50\nZXJuZXQgV2lkZ2l0cyBQdHkgTHRkMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIB\nCgKCAQEAvq3sKsHpeduJHimOK+fvQdKsI8z8A05MZyyLp2/R/GE8FjNv+hkVY1WQ\nLIyTNNQH7CJecE1nbTfo8Y56S7x/rhxC6/DJ8MIulapFPnorq46KU6yRxiM0MQ3N\nnTJHlHA2ozZta6YBBfVfhHWl1F0IfNbXCLKvGwWWMbCx43OfW6KTkbRnE6gFWKuO\nfSO5h2u5TaWVuSIzBvYs7Vza6m+gtYAvKAJV2nSZ+eSEFPDo29corOy8+huEOUL8\n5FAw4BFPsr1TlrlGPFitduQUHGrSL7skk1ESGza0to3bOtrodKei2s9bk5MXm7lZ\nqI+WZJX4Zu9+mzZhc9pCVi8r/qlXuQIDAQABo4GnMIGkMB0GA1UdDgQWBBRvavf+\nsWM4IwKiH9X9w1vl6nUVRDB1BgNVHSMEbjBsgBRvavf+sWM4IwKiH9X9w1vl6nUV\nRKFJpEcwRTELMAkGA1UEBhMCVVMxEzARBgNVBAgTClNvbWUtU3RhdGUxITAfBgNV\nBAoTGEludGVybmV0IFdpZGdpdHMgUHR5IEx0ZIIJAM15n7fdxhRtMAwGA1UdEwQF\nMAMBAf8wDQYJKoZIhvcNAQEFBQADggEBABY2ZzBaW0dMsAAT7tPJzrVWVzQx6KU4\nUEBLudIlWPlkAwTnINCWR/8eNjCCmGA4heUdHmazdpPa8RzwOmc0NT1NQqzSyktt\nvTqb4iHD7+8f9MqJ9/FssCfTtqr/Qst/hGH4Wmdf1EJ/6FqYAAb5iRlPgshFZxU8\nuXtA8hWn6fK6eISD9HBdcAFToUvKNZ1BIDPvh9f95Ine8ar6yGd56TUNrHR8eHBs\nESxz5ddVR/oWRysNJ+aGAyYqHS8S/ttmC7r4XCAHqXptkHPCGRqkAhsterYhd4I8\n/cBzejUobNCjjHFbtkAL/SjxZOLW+pNkZwfeYdM8iPkD54Uua1v2tdw=\n-----END CERTIFICATE-----", host="example.com", port=24008, bundle_method="ubiquitous", @@ -327,7 +327,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncCloudflare async def test_raw_response_create(self, async_client: AsyncCloudflare) -> None: response = await async_client.keyless_certificates.with_raw_response.create( zone_id="023e105f4ecef8ad9ca31a8372d0c353", - certificate="-----BEGIN CERTIFICATE----- MIIDtTCCAp2gAwIBAgIJAM15n7fdxhRtMA0GCSqGSIb3DQEBBQUAMEUxCzAJBgNV BAYTAlVTMRMwEQYDVQQIEwpTb21lLVN0YXRlMSEwHwYDVQQKExhJbnRlcm5ldCBX aWRnaXRzIFB0eSBMdGQwHhcNMTQwMzExMTkyMTU5WhcNMTQwNDEwMTkyMTU5WjBF MQswCQYDVQQGEwJVUzETMBEGA1UECBMKU29tZS1TdGF0ZTEhMB8GA1UEChMYSW50 ZXJuZXQgV2lkZ2l0cyBQdHkgTHRkMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIB CgKCAQEAvq3sKsHpeduJHimOK+fvQdKsI8z8A05MZyyLp2/R/GE8FjNv+hkVY1WQ LIyTNNQH7CJecE1nbTfo8Y56S7x/rhxC6/DJ8MIulapFPnorq46KU6yRxiM0MQ3N nTJHlHA2ozZta6YBBfVfhHWl1F0IfNbXCLKvGwWWMbCx43OfW6KTkbRnE6gFWKuO fSO5h2u5TaWVuSIzBvYs7Vza6m+gtYAvKAJV2nSZ+eSEFPDo29corOy8+huEOUL8 5FAw4BFPsr1TlrlGPFitduQUHGrSL7skk1ESGza0to3bOtrodKei2s9bk5MXm7lZ qI+WZJX4Zu9+mzZhc9pCVi8r/qlXuQIDAQABo4GnMIGkMB0GA1UdDgQWBBRvavf+ sWM4IwKiH9X9w1vl6nUVRDB1BgNVHSMEbjBsgBRvavf+sWM4IwKiH9X9w1vl6nUV RKFJpEcwRTELMAkGA1UEBhMCVVMxEzARBgNVBAgTClNvbWUtU3RhdGUxITAfBgNV BAoTGEludGVybmV0IFdpZGdpdHMgUHR5IEx0ZIIJAM15n7fdxhRtMAwGA1UdEwQF MAMBAf8wDQYJKoZIhvcNAQEFBQADggEBABY2ZzBaW0dMsAAT7tPJzrVWVzQx6KU4 UEBLudIlWPlkAwTnINCWR/8eNjCCmGA4heUdHmazdpPa8RzwOmc0NT1NQqzSyktt vTqb4iHD7+8f9MqJ9/FssCfTtqr/Qst/hGH4Wmdf1EJ/6FqYAAb5iRlPgshFZxU8 uXtA8hWn6fK6eISD9HBdcAFToUvKNZ1BIDPvh9f95Ine8ar6yGd56TUNrHR8eHBs ESxz5ddVR/oWRysNJ+aGAyYqHS8S/ttmC7r4XCAHqXptkHPCGRqkAhsterYhd4I8 /cBzejUobNCjjHFbtkAL/SjxZOLW+pNkZwfeYdM8iPkD54Uua1v2tdw= -----END CERTIFICATE-----", + certificate="-----BEGIN CERTIFICATE-----\nMIIDtTCCAp2gAwIBAgIJAM15n7fdxhRtMA0GCSqGSIb3DQEBBQUAMEUxCzAJBgNV\nBAYTAlVTMRMwEQYDVQQIEwpTb21lLVN0YXRlMSEwHwYDVQQKExhJbnRlcm5ldCBX\naWRnaXRzIFB0eSBMdGQwHhcNMTQwMzExMTkyMTU5WhcNMTQwNDEwMTkyMTU5WjBF\nMQswCQYDVQQGEwJVUzETMBEGA1UECBMKU29tZS1TdGF0ZTEhMB8GA1UEChMYSW50\nZXJuZXQgV2lkZ2l0cyBQdHkgTHRkMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIB\nCgKCAQEAvq3sKsHpeduJHimOK+fvQdKsI8z8A05MZyyLp2/R/GE8FjNv+hkVY1WQ\nLIyTNNQH7CJecE1nbTfo8Y56S7x/rhxC6/DJ8MIulapFPnorq46KU6yRxiM0MQ3N\nnTJHlHA2ozZta6YBBfVfhHWl1F0IfNbXCLKvGwWWMbCx43OfW6KTkbRnE6gFWKuO\nfSO5h2u5TaWVuSIzBvYs7Vza6m+gtYAvKAJV2nSZ+eSEFPDo29corOy8+huEOUL8\n5FAw4BFPsr1TlrlGPFitduQUHGrSL7skk1ESGza0to3bOtrodKei2s9bk5MXm7lZ\nqI+WZJX4Zu9+mzZhc9pCVi8r/qlXuQIDAQABo4GnMIGkMB0GA1UdDgQWBBRvavf+\nsWM4IwKiH9X9w1vl6nUVRDB1BgNVHSMEbjBsgBRvavf+sWM4IwKiH9X9w1vl6nUV\nRKFJpEcwRTELMAkGA1UEBhMCVVMxEzARBgNVBAgTClNvbWUtU3RhdGUxITAfBgNV\nBAoTGEludGVybmV0IFdpZGdpdHMgUHR5IEx0ZIIJAM15n7fdxhRtMAwGA1UdEwQF\nMAMBAf8wDQYJKoZIhvcNAQEFBQADggEBABY2ZzBaW0dMsAAT7tPJzrVWVzQx6KU4\nUEBLudIlWPlkAwTnINCWR/8eNjCCmGA4heUdHmazdpPa8RzwOmc0NT1NQqzSyktt\nvTqb4iHD7+8f9MqJ9/FssCfTtqr/Qst/hGH4Wmdf1EJ/6FqYAAb5iRlPgshFZxU8\nuXtA8hWn6fK6eISD9HBdcAFToUvKNZ1BIDPvh9f95Ine8ar6yGd56TUNrHR8eHBs\nESxz5ddVR/oWRysNJ+aGAyYqHS8S/ttmC7r4XCAHqXptkHPCGRqkAhsterYhd4I8\n/cBzejUobNCjjHFbtkAL/SjxZOLW+pNkZwfeYdM8iPkD54Uua1v2tdw=\n-----END CERTIFICATE-----", host="example.com", port=24008, ) @@ -341,7 +341,7 @@ async def test_raw_response_create(self, async_client: AsyncCloudflare) -> None: async def test_streaming_response_create(self, async_client: AsyncCloudflare) -> None: async with async_client.keyless_certificates.with_streaming_response.create( zone_id="023e105f4ecef8ad9ca31a8372d0c353", - certificate="-----BEGIN CERTIFICATE----- MIIDtTCCAp2gAwIBAgIJAM15n7fdxhRtMA0GCSqGSIb3DQEBBQUAMEUxCzAJBgNV BAYTAlVTMRMwEQYDVQQIEwpTb21lLVN0YXRlMSEwHwYDVQQKExhJbnRlcm5ldCBX aWRnaXRzIFB0eSBMdGQwHhcNMTQwMzExMTkyMTU5WhcNMTQwNDEwMTkyMTU5WjBF MQswCQYDVQQGEwJVUzETMBEGA1UECBMKU29tZS1TdGF0ZTEhMB8GA1UEChMYSW50 ZXJuZXQgV2lkZ2l0cyBQdHkgTHRkMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIB CgKCAQEAvq3sKsHpeduJHimOK+fvQdKsI8z8A05MZyyLp2/R/GE8FjNv+hkVY1WQ LIyTNNQH7CJecE1nbTfo8Y56S7x/rhxC6/DJ8MIulapFPnorq46KU6yRxiM0MQ3N nTJHlHA2ozZta6YBBfVfhHWl1F0IfNbXCLKvGwWWMbCx43OfW6KTkbRnE6gFWKuO fSO5h2u5TaWVuSIzBvYs7Vza6m+gtYAvKAJV2nSZ+eSEFPDo29corOy8+huEOUL8 5FAw4BFPsr1TlrlGPFitduQUHGrSL7skk1ESGza0to3bOtrodKei2s9bk5MXm7lZ qI+WZJX4Zu9+mzZhc9pCVi8r/qlXuQIDAQABo4GnMIGkMB0GA1UdDgQWBBRvavf+ sWM4IwKiH9X9w1vl6nUVRDB1BgNVHSMEbjBsgBRvavf+sWM4IwKiH9X9w1vl6nUV RKFJpEcwRTELMAkGA1UEBhMCVVMxEzARBgNVBAgTClNvbWUtU3RhdGUxITAfBgNV BAoTGEludGVybmV0IFdpZGdpdHMgUHR5IEx0ZIIJAM15n7fdxhRtMAwGA1UdEwQF MAMBAf8wDQYJKoZIhvcNAQEFBQADggEBABY2ZzBaW0dMsAAT7tPJzrVWVzQx6KU4 UEBLudIlWPlkAwTnINCWR/8eNjCCmGA4heUdHmazdpPa8RzwOmc0NT1NQqzSyktt vTqb4iHD7+8f9MqJ9/FssCfTtqr/Qst/hGH4Wmdf1EJ/6FqYAAb5iRlPgshFZxU8 uXtA8hWn6fK6eISD9HBdcAFToUvKNZ1BIDPvh9f95Ine8ar6yGd56TUNrHR8eHBs ESxz5ddVR/oWRysNJ+aGAyYqHS8S/ttmC7r4XCAHqXptkHPCGRqkAhsterYhd4I8 /cBzejUobNCjjHFbtkAL/SjxZOLW+pNkZwfeYdM8iPkD54Uua1v2tdw= -----END CERTIFICATE-----", + certificate="-----BEGIN CERTIFICATE-----\nMIIDtTCCAp2gAwIBAgIJAM15n7fdxhRtMA0GCSqGSIb3DQEBBQUAMEUxCzAJBgNV\nBAYTAlVTMRMwEQYDVQQIEwpTb21lLVN0YXRlMSEwHwYDVQQKExhJbnRlcm5ldCBX\naWRnaXRzIFB0eSBMdGQwHhcNMTQwMzExMTkyMTU5WhcNMTQwNDEwMTkyMTU5WjBF\nMQswCQYDVQQGEwJVUzETMBEGA1UECBMKU29tZS1TdGF0ZTEhMB8GA1UEChMYSW50\nZXJuZXQgV2lkZ2l0cyBQdHkgTHRkMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIB\nCgKCAQEAvq3sKsHpeduJHimOK+fvQdKsI8z8A05MZyyLp2/R/GE8FjNv+hkVY1WQ\nLIyTNNQH7CJecE1nbTfo8Y56S7x/rhxC6/DJ8MIulapFPnorq46KU6yRxiM0MQ3N\nnTJHlHA2ozZta6YBBfVfhHWl1F0IfNbXCLKvGwWWMbCx43OfW6KTkbRnE6gFWKuO\nfSO5h2u5TaWVuSIzBvYs7Vza6m+gtYAvKAJV2nSZ+eSEFPDo29corOy8+huEOUL8\n5FAw4BFPsr1TlrlGPFitduQUHGrSL7skk1ESGza0to3bOtrodKei2s9bk5MXm7lZ\nqI+WZJX4Zu9+mzZhc9pCVi8r/qlXuQIDAQABo4GnMIGkMB0GA1UdDgQWBBRvavf+\nsWM4IwKiH9X9w1vl6nUVRDB1BgNVHSMEbjBsgBRvavf+sWM4IwKiH9X9w1vl6nUV\nRKFJpEcwRTELMAkGA1UEBhMCVVMxEzARBgNVBAgTClNvbWUtU3RhdGUxITAfBgNV\nBAoTGEludGVybmV0IFdpZGdpdHMgUHR5IEx0ZIIJAM15n7fdxhRtMAwGA1UdEwQF\nMAMBAf8wDQYJKoZIhvcNAQEFBQADggEBABY2ZzBaW0dMsAAT7tPJzrVWVzQx6KU4\nUEBLudIlWPlkAwTnINCWR/8eNjCCmGA4heUdHmazdpPa8RzwOmc0NT1NQqzSyktt\nvTqb4iHD7+8f9MqJ9/FssCfTtqr/Qst/hGH4Wmdf1EJ/6FqYAAb5iRlPgshFZxU8\nuXtA8hWn6fK6eISD9HBdcAFToUvKNZ1BIDPvh9f95Ine8ar6yGd56TUNrHR8eHBs\nESxz5ddVR/oWRysNJ+aGAyYqHS8S/ttmC7r4XCAHqXptkHPCGRqkAhsterYhd4I8\n/cBzejUobNCjjHFbtkAL/SjxZOLW+pNkZwfeYdM8iPkD54Uua1v2tdw=\n-----END CERTIFICATE-----", host="example.com", port=24008, ) as response: @@ -358,7 +358,7 @@ async def test_path_params_create(self, async_client: AsyncCloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): await async_client.keyless_certificates.with_raw_response.create( zone_id="", - certificate="-----BEGIN CERTIFICATE----- MIIDtTCCAp2gAwIBAgIJAM15n7fdxhRtMA0GCSqGSIb3DQEBBQUAMEUxCzAJBgNV BAYTAlVTMRMwEQYDVQQIEwpTb21lLVN0YXRlMSEwHwYDVQQKExhJbnRlcm5ldCBX aWRnaXRzIFB0eSBMdGQwHhcNMTQwMzExMTkyMTU5WhcNMTQwNDEwMTkyMTU5WjBF MQswCQYDVQQGEwJVUzETMBEGA1UECBMKU29tZS1TdGF0ZTEhMB8GA1UEChMYSW50 ZXJuZXQgV2lkZ2l0cyBQdHkgTHRkMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIB CgKCAQEAvq3sKsHpeduJHimOK+fvQdKsI8z8A05MZyyLp2/R/GE8FjNv+hkVY1WQ LIyTNNQH7CJecE1nbTfo8Y56S7x/rhxC6/DJ8MIulapFPnorq46KU6yRxiM0MQ3N nTJHlHA2ozZta6YBBfVfhHWl1F0IfNbXCLKvGwWWMbCx43OfW6KTkbRnE6gFWKuO fSO5h2u5TaWVuSIzBvYs7Vza6m+gtYAvKAJV2nSZ+eSEFPDo29corOy8+huEOUL8 5FAw4BFPsr1TlrlGPFitduQUHGrSL7skk1ESGza0to3bOtrodKei2s9bk5MXm7lZ qI+WZJX4Zu9+mzZhc9pCVi8r/qlXuQIDAQABo4GnMIGkMB0GA1UdDgQWBBRvavf+ sWM4IwKiH9X9w1vl6nUVRDB1BgNVHSMEbjBsgBRvavf+sWM4IwKiH9X9w1vl6nUV RKFJpEcwRTELMAkGA1UEBhMCVVMxEzARBgNVBAgTClNvbWUtU3RhdGUxITAfBgNV BAoTGEludGVybmV0IFdpZGdpdHMgUHR5IEx0ZIIJAM15n7fdxhRtMAwGA1UdEwQF MAMBAf8wDQYJKoZIhvcNAQEFBQADggEBABY2ZzBaW0dMsAAT7tPJzrVWVzQx6KU4 UEBLudIlWPlkAwTnINCWR/8eNjCCmGA4heUdHmazdpPa8RzwOmc0NT1NQqzSyktt vTqb4iHD7+8f9MqJ9/FssCfTtqr/Qst/hGH4Wmdf1EJ/6FqYAAb5iRlPgshFZxU8 uXtA8hWn6fK6eISD9HBdcAFToUvKNZ1BIDPvh9f95Ine8ar6yGd56TUNrHR8eHBs ESxz5ddVR/oWRysNJ+aGAyYqHS8S/ttmC7r4XCAHqXptkHPCGRqkAhsterYhd4I8 /cBzejUobNCjjHFbtkAL/SjxZOLW+pNkZwfeYdM8iPkD54Uua1v2tdw= -----END CERTIFICATE-----", + certificate="-----BEGIN CERTIFICATE-----\nMIIDtTCCAp2gAwIBAgIJAM15n7fdxhRtMA0GCSqGSIb3DQEBBQUAMEUxCzAJBgNV\nBAYTAlVTMRMwEQYDVQQIEwpTb21lLVN0YXRlMSEwHwYDVQQKExhJbnRlcm5ldCBX\naWRnaXRzIFB0eSBMdGQwHhcNMTQwMzExMTkyMTU5WhcNMTQwNDEwMTkyMTU5WjBF\nMQswCQYDVQQGEwJVUzETMBEGA1UECBMKU29tZS1TdGF0ZTEhMB8GA1UEChMYSW50\nZXJuZXQgV2lkZ2l0cyBQdHkgTHRkMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIB\nCgKCAQEAvq3sKsHpeduJHimOK+fvQdKsI8z8A05MZyyLp2/R/GE8FjNv+hkVY1WQ\nLIyTNNQH7CJecE1nbTfo8Y56S7x/rhxC6/DJ8MIulapFPnorq46KU6yRxiM0MQ3N\nnTJHlHA2ozZta6YBBfVfhHWl1F0IfNbXCLKvGwWWMbCx43OfW6KTkbRnE6gFWKuO\nfSO5h2u5TaWVuSIzBvYs7Vza6m+gtYAvKAJV2nSZ+eSEFPDo29corOy8+huEOUL8\n5FAw4BFPsr1TlrlGPFitduQUHGrSL7skk1ESGza0to3bOtrodKei2s9bk5MXm7lZ\nqI+WZJX4Zu9+mzZhc9pCVi8r/qlXuQIDAQABo4GnMIGkMB0GA1UdDgQWBBRvavf+\nsWM4IwKiH9X9w1vl6nUVRDB1BgNVHSMEbjBsgBRvavf+sWM4IwKiH9X9w1vl6nUV\nRKFJpEcwRTELMAkGA1UEBhMCVVMxEzARBgNVBAgTClNvbWUtU3RhdGUxITAfBgNV\nBAoTGEludGVybmV0IFdpZGdpdHMgUHR5IEx0ZIIJAM15n7fdxhRtMAwGA1UdEwQF\nMAMBAf8wDQYJKoZIhvcNAQEFBQADggEBABY2ZzBaW0dMsAAT7tPJzrVWVzQx6KU4\nUEBLudIlWPlkAwTnINCWR/8eNjCCmGA4heUdHmazdpPa8RzwOmc0NT1NQqzSyktt\nvTqb4iHD7+8f9MqJ9/FssCfTtqr/Qst/hGH4Wmdf1EJ/6FqYAAb5iRlPgshFZxU8\nuXtA8hWn6fK6eISD9HBdcAFToUvKNZ1BIDPvh9f95Ine8ar6yGd56TUNrHR8eHBs\nESxz5ddVR/oWRysNJ+aGAyYqHS8S/ttmC7r4XCAHqXptkHPCGRqkAhsterYhd4I8\n/cBzejUobNCjjHFbtkAL/SjxZOLW+pNkZwfeYdM8iPkD54Uua1v2tdw=\n-----END CERTIFICATE-----", host="example.com", port=24008, ) diff --git a/tests/api_resources/workers/observability/__init__.py b/tests/api_resources/workers/observability/__init__.py deleted file mode 100644 index fd8019a9a1a..00000000000 --- a/tests/api_resources/workers/observability/__init__.py +++ /dev/null @@ -1 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. diff --git a/tests/api_resources/workers/observability/test_telemetry.py b/tests/api_resources/workers/observability/test_telemetry.py deleted file mode 100644 index ca10671a97e..00000000000 --- a/tests/api_resources/workers/observability/test_telemetry.py +++ /dev/null @@ -1,599 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -import os -from typing import Any, cast - -import pytest - -from cloudflare import Cloudflare, AsyncCloudflare -from tests.utils import assert_matches_type -from cloudflare.pagination import SyncSinglePage, AsyncSinglePage -from cloudflare.types.workers.observability import ( - TelemetryKeysResponse, - TelemetryQueryResponse, - TelemetryValuesResponse, -) - -base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") - - -class TestTelemetry: - parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - - @parametrize - def test_method_keys(self, client: Cloudflare) -> None: - telemetry = client.workers.observability.telemetry.keys( - account_id="account_id", - ) - assert_matches_type(SyncSinglePage[TelemetryKeysResponse], telemetry, path=["response"]) - - @parametrize - def test_method_keys_with_all_params(self, client: Cloudflare) -> None: - telemetry = client.workers.observability.telemetry.keys( - account_id="account_id", - datasets=["string"], - filters=[ - { - "key": "key", - "operation": "includes", - "type": "string", - "value": "string", - } - ], - from_=0, - key_needle={ - "value": "string", - "is_regex": True, - "match_case": True, - }, - limit=0, - needle={ - "value": "string", - "is_regex": True, - "match_case": True, - }, - to=0, - ) - assert_matches_type(SyncSinglePage[TelemetryKeysResponse], telemetry, path=["response"]) - - @parametrize - def test_raw_response_keys(self, client: Cloudflare) -> None: - response = client.workers.observability.telemetry.with_raw_response.keys( - account_id="account_id", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - telemetry = response.parse() - assert_matches_type(SyncSinglePage[TelemetryKeysResponse], telemetry, path=["response"]) - - @parametrize - def test_streaming_response_keys(self, client: Cloudflare) -> None: - with client.workers.observability.telemetry.with_streaming_response.keys( - account_id="account_id", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - telemetry = response.parse() - assert_matches_type(SyncSinglePage[TelemetryKeysResponse], telemetry, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_keys(self, client: Cloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): - client.workers.observability.telemetry.with_raw_response.keys( - account_id="", - ) - - @parametrize - def test_method_query(self, client: Cloudflare) -> None: - telemetry = client.workers.observability.telemetry.query( - account_id="account_id", - query_id="queryId", - timeframe={ - "from": 0, - "to": 0, - }, - ) - assert_matches_type(TelemetryQueryResponse, telemetry, path=["response"]) - - @parametrize - def test_method_query_with_all_params(self, client: Cloudflare) -> None: - telemetry = client.workers.observability.telemetry.query( - account_id="account_id", - query_id="queryId", - timeframe={ - "from": 0, - "to": 0, - }, - chart=True, - compare=True, - dry=True, - granularity=0, - ignore_series=True, - limit=2000, - offset="offset", - offset_by=0, - offset_direction="offsetDirection", - parameters={ - "calculations": [ - { - "operator": "uniq", - "alias": "alias", - "key": "key", - "key_type": "string", - } - ], - "datasets": ["string"], - "filter_combination": "and", - "filters": [ - { - "key": "key", - "operation": "includes", - "type": "string", - "value": "string", - } - ], - "group_bys": [ - { - "type": "string", - "value": "value", - } - ], - "havings": [ - { - "key": "key", - "operation": "eq", - "value": 0, - } - ], - "limit": 0, - "needle": { - "value": "string", - "is_regex": True, - "match_case": True, - }, - "order_by": { - "value": "value", - "order": "asc", - }, - }, - pattern_type="message", - view="traces", - ) - assert_matches_type(TelemetryQueryResponse, telemetry, path=["response"]) - - @parametrize - def test_raw_response_query(self, client: Cloudflare) -> None: - response = client.workers.observability.telemetry.with_raw_response.query( - account_id="account_id", - query_id="queryId", - timeframe={ - "from": 0, - "to": 0, - }, - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - telemetry = response.parse() - assert_matches_type(TelemetryQueryResponse, telemetry, path=["response"]) - - @parametrize - def test_streaming_response_query(self, client: Cloudflare) -> None: - with client.workers.observability.telemetry.with_streaming_response.query( - account_id="account_id", - query_id="queryId", - timeframe={ - "from": 0, - "to": 0, - }, - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - telemetry = response.parse() - assert_matches_type(TelemetryQueryResponse, telemetry, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_query(self, client: Cloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): - client.workers.observability.telemetry.with_raw_response.query( - account_id="", - query_id="queryId", - timeframe={ - "from": 0, - "to": 0, - }, - ) - - @parametrize - def test_method_values(self, client: Cloudflare) -> None: - telemetry = client.workers.observability.telemetry.values( - account_id="account_id", - datasets=["string"], - key="key", - timeframe={ - "from": 0, - "to": 0, - }, - type="string", - ) - assert_matches_type(SyncSinglePage[TelemetryValuesResponse], telemetry, path=["response"]) - - @parametrize - def test_method_values_with_all_params(self, client: Cloudflare) -> None: - telemetry = client.workers.observability.telemetry.values( - account_id="account_id", - datasets=["string"], - key="key", - timeframe={ - "from": 0, - "to": 0, - }, - type="string", - filters=[ - { - "key": "key", - "operation": "includes", - "type": "string", - "value": "string", - } - ], - limit=0, - needle={ - "value": "string", - "is_regex": True, - "match_case": True, - }, - ) - assert_matches_type(SyncSinglePage[TelemetryValuesResponse], telemetry, path=["response"]) - - @parametrize - def test_raw_response_values(self, client: Cloudflare) -> None: - response = client.workers.observability.telemetry.with_raw_response.values( - account_id="account_id", - datasets=["string"], - key="key", - timeframe={ - "from": 0, - "to": 0, - }, - type="string", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - telemetry = response.parse() - assert_matches_type(SyncSinglePage[TelemetryValuesResponse], telemetry, path=["response"]) - - @parametrize - def test_streaming_response_values(self, client: Cloudflare) -> None: - with client.workers.observability.telemetry.with_streaming_response.values( - account_id="account_id", - datasets=["string"], - key="key", - timeframe={ - "from": 0, - "to": 0, - }, - type="string", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - telemetry = response.parse() - assert_matches_type(SyncSinglePage[TelemetryValuesResponse], telemetry, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_values(self, client: Cloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): - client.workers.observability.telemetry.with_raw_response.values( - account_id="", - datasets=["string"], - key="key", - timeframe={ - "from": 0, - "to": 0, - }, - type="string", - ) - - -class TestAsyncTelemetry: - parametrize = pytest.mark.parametrize( - "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"] - ) - - @parametrize - async def test_method_keys(self, async_client: AsyncCloudflare) -> None: - telemetry = await async_client.workers.observability.telemetry.keys( - account_id="account_id", - ) - assert_matches_type(AsyncSinglePage[TelemetryKeysResponse], telemetry, path=["response"]) - - @parametrize - async def test_method_keys_with_all_params(self, async_client: AsyncCloudflare) -> None: - telemetry = await async_client.workers.observability.telemetry.keys( - account_id="account_id", - datasets=["string"], - filters=[ - { - "key": "key", - "operation": "includes", - "type": "string", - "value": "string", - } - ], - from_=0, - key_needle={ - "value": "string", - "is_regex": True, - "match_case": True, - }, - limit=0, - needle={ - "value": "string", - "is_regex": True, - "match_case": True, - }, - to=0, - ) - assert_matches_type(AsyncSinglePage[TelemetryKeysResponse], telemetry, path=["response"]) - - @parametrize - async def test_raw_response_keys(self, async_client: AsyncCloudflare) -> None: - response = await async_client.workers.observability.telemetry.with_raw_response.keys( - account_id="account_id", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - telemetry = await response.parse() - assert_matches_type(AsyncSinglePage[TelemetryKeysResponse], telemetry, path=["response"]) - - @parametrize - async def test_streaming_response_keys(self, async_client: AsyncCloudflare) -> None: - async with async_client.workers.observability.telemetry.with_streaming_response.keys( - account_id="account_id", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - telemetry = await response.parse() - assert_matches_type(AsyncSinglePage[TelemetryKeysResponse], telemetry, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_keys(self, async_client: AsyncCloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): - await async_client.workers.observability.telemetry.with_raw_response.keys( - account_id="", - ) - - @parametrize - async def test_method_query(self, async_client: AsyncCloudflare) -> None: - telemetry = await async_client.workers.observability.telemetry.query( - account_id="account_id", - query_id="queryId", - timeframe={ - "from": 0, - "to": 0, - }, - ) - assert_matches_type(TelemetryQueryResponse, telemetry, path=["response"]) - - @parametrize - async def test_method_query_with_all_params(self, async_client: AsyncCloudflare) -> None: - telemetry = await async_client.workers.observability.telemetry.query( - account_id="account_id", - query_id="queryId", - timeframe={ - "from": 0, - "to": 0, - }, - chart=True, - compare=True, - dry=True, - granularity=0, - ignore_series=True, - limit=2000, - offset="offset", - offset_by=0, - offset_direction="offsetDirection", - parameters={ - "calculations": [ - { - "operator": "uniq", - "alias": "alias", - "key": "key", - "key_type": "string", - } - ], - "datasets": ["string"], - "filter_combination": "and", - "filters": [ - { - "key": "key", - "operation": "includes", - "type": "string", - "value": "string", - } - ], - "group_bys": [ - { - "type": "string", - "value": "value", - } - ], - "havings": [ - { - "key": "key", - "operation": "eq", - "value": 0, - } - ], - "limit": 0, - "needle": { - "value": "string", - "is_regex": True, - "match_case": True, - }, - "order_by": { - "value": "value", - "order": "asc", - }, - }, - pattern_type="message", - view="traces", - ) - assert_matches_type(TelemetryQueryResponse, telemetry, path=["response"]) - - @parametrize - async def test_raw_response_query(self, async_client: AsyncCloudflare) -> None: - response = await async_client.workers.observability.telemetry.with_raw_response.query( - account_id="account_id", - query_id="queryId", - timeframe={ - "from": 0, - "to": 0, - }, - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - telemetry = await response.parse() - assert_matches_type(TelemetryQueryResponse, telemetry, path=["response"]) - - @parametrize - async def test_streaming_response_query(self, async_client: AsyncCloudflare) -> None: - async with async_client.workers.observability.telemetry.with_streaming_response.query( - account_id="account_id", - query_id="queryId", - timeframe={ - "from": 0, - "to": 0, - }, - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - telemetry = await response.parse() - assert_matches_type(TelemetryQueryResponse, telemetry, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_query(self, async_client: AsyncCloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): - await async_client.workers.observability.telemetry.with_raw_response.query( - account_id="", - query_id="queryId", - timeframe={ - "from": 0, - "to": 0, - }, - ) - - @parametrize - async def test_method_values(self, async_client: AsyncCloudflare) -> None: - telemetry = await async_client.workers.observability.telemetry.values( - account_id="account_id", - datasets=["string"], - key="key", - timeframe={ - "from": 0, - "to": 0, - }, - type="string", - ) - assert_matches_type(AsyncSinglePage[TelemetryValuesResponse], telemetry, path=["response"]) - - @parametrize - async def test_method_values_with_all_params(self, async_client: AsyncCloudflare) -> None: - telemetry = await async_client.workers.observability.telemetry.values( - account_id="account_id", - datasets=["string"], - key="key", - timeframe={ - "from": 0, - "to": 0, - }, - type="string", - filters=[ - { - "key": "key", - "operation": "includes", - "type": "string", - "value": "string", - } - ], - limit=0, - needle={ - "value": "string", - "is_regex": True, - "match_case": True, - }, - ) - assert_matches_type(AsyncSinglePage[TelemetryValuesResponse], telemetry, path=["response"]) - - @parametrize - async def test_raw_response_values(self, async_client: AsyncCloudflare) -> None: - response = await async_client.workers.observability.telemetry.with_raw_response.values( - account_id="account_id", - datasets=["string"], - key="key", - timeframe={ - "from": 0, - "to": 0, - }, - type="string", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - telemetry = await response.parse() - assert_matches_type(AsyncSinglePage[TelemetryValuesResponse], telemetry, path=["response"]) - - @parametrize - async def test_streaming_response_values(self, async_client: AsyncCloudflare) -> None: - async with async_client.workers.observability.telemetry.with_streaming_response.values( - account_id="account_id", - datasets=["string"], - key="key", - timeframe={ - "from": 0, - "to": 0, - }, - type="string", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - telemetry = await response.parse() - assert_matches_type(AsyncSinglePage[TelemetryValuesResponse], telemetry, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_values(self, async_client: AsyncCloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): - await async_client.workers.observability.telemetry.with_raw_response.values( - account_id="", - datasets=["string"], - key="key", - timeframe={ - "from": 0, - "to": 0, - }, - type="string", - ) From 17a33ff8bba4c8adceb155db74bc6a606a3a43cc Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 17 Feb 2026 16:30:40 +0000 Subject: [PATCH 011/279] chore(api): update composite API spec --- .stats.yml | 4 ++-- .../types/workers/beta/workers/version.py | 13 +++++++++++-- .../workers/beta/workers/version_create_params.py | 13 +++++++++++-- .../types/workers/script_search_response.py | 6 +++--- .../types/workers/script_update_params.py | 13 +++++++++++-- .../script_and_version_setting_edit_params.py | 13 +++++++++++-- .../script_and_version_setting_edit_response.py | 13 +++++++++++-- .../script_and_version_setting_get_response.py | 13 +++++++++++-- .../types/workers/scripts/version_create_params.py | 13 +++++++++++-- .../workers/scripts/version_create_response.py | 13 +++++++++++-- .../types/workers/scripts/version_get_response.py | 13 +++++++++++-- .../dispatch/namespaces/script_update_params.py | 13 +++++++++++-- .../namespaces/scripts/binding_get_response.py | 13 +++++++++++-- .../namespaces/scripts/setting_edit_params.py | 13 +++++++++++-- .../namespaces/scripts/setting_edit_response.py | 13 +++++++++++-- .../namespaces/scripts/setting_get_response.py | 13 +++++++++++-- 16 files changed, 159 insertions(+), 33 deletions(-) diff --git a/.stats.yml b/.stats.yml index a4591e15a40..8099de9b7c3 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 2015 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-a2cb90b273f4b2f2f1d7b5b1dc8d12401512d5fa26c8e3238532ddf21d5cb2ba.yml -openapi_spec_hash: 382f52cee347b776d182ad32ea3dd7cf +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-2b935132316d46fe098e11238cf09f7861e29754870e6775c31d53108b357a35.yml +openapi_spec_hash: 3c786e10f8e2cea0b76e820dbd848eab config_hash: 7a08b6d7e050d324501d76c833118c84 diff --git a/src/cloudflare/types/workers/beta/workers/version.py b/src/cloudflare/types/workers/beta/workers/version.py index f8b606eff70..26a16505ff2 100644 --- a/src/cloudflare/types/workers/beta/workers/version.py +++ b/src/cloudflare/types/workers/beta/workers/version.py @@ -24,6 +24,7 @@ "BindingWorkersBindingKindDataBlob", "BindingWorkersBindingKindDispatchNamespace", "BindingWorkersBindingKindDispatchNamespaceOutbound", + "BindingWorkersBindingKindDispatchNamespaceOutboundParam", "BindingWorkersBindingKindDispatchNamespaceOutboundWorker", "BindingWorkersBindingKindDurableObjectNamespace", "BindingWorkersBindingKindHyperdrive", @@ -179,9 +180,17 @@ class BindingWorkersBindingKindDataBlob(BaseModel): """The kind of resource that the binding provides.""" +class BindingWorkersBindingKindDispatchNamespaceOutboundParam(BaseModel): + name: str + """Name of the parameter.""" + + class BindingWorkersBindingKindDispatchNamespaceOutboundWorker(BaseModel): """Outbound worker.""" + entrypoint: Optional[str] = None + """Entrypoint to invoke on the outbound worker.""" + environment: Optional[str] = None """Environment of the outbound worker.""" @@ -192,7 +201,7 @@ class BindingWorkersBindingKindDispatchNamespaceOutboundWorker(BaseModel): class BindingWorkersBindingKindDispatchNamespaceOutbound(BaseModel): """Outbound worker.""" - params: Optional[List[str]] = None + params: Optional[List[BindingWorkersBindingKindDispatchNamespaceOutboundParam]] = None """ Pass information from the Dispatch Worker to the Outbound Worker through the parameters. @@ -281,7 +290,7 @@ class BindingWorkersBindingKindImages(BaseModel): class BindingWorkersBindingKindJson(BaseModel): - json_: str = FieldInfo(alias="json") + json_: object = FieldInfo(alias="json") """JSON data to use.""" 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 0bf4f7ed8bd..1adf686d88e 100644 --- a/src/cloudflare/types/workers/beta/workers/version_create_params.py +++ b/src/cloudflare/types/workers/beta/workers/version_create_params.py @@ -25,6 +25,7 @@ "BindingWorkersBindingKindDataBlob", "BindingWorkersBindingKindDispatchNamespace", "BindingWorkersBindingKindDispatchNamespaceOutbound", + "BindingWorkersBindingKindDispatchNamespaceOutboundParam", "BindingWorkersBindingKindDispatchNamespaceOutboundWorker", "BindingWorkersBindingKindDurableObjectNamespace", "BindingWorkersBindingKindHyperdrive", @@ -258,9 +259,17 @@ class BindingWorkersBindingKindDataBlob(TypedDict, total=False): """The kind of resource that the binding provides.""" +class BindingWorkersBindingKindDispatchNamespaceOutboundParam(TypedDict, total=False): + name: Required[str] + """Name of the parameter.""" + + class BindingWorkersBindingKindDispatchNamespaceOutboundWorker(TypedDict, total=False): """Outbound worker.""" + entrypoint: str + """Entrypoint to invoke on the outbound worker.""" + environment: str """Environment of the outbound worker.""" @@ -271,7 +280,7 @@ class BindingWorkersBindingKindDispatchNamespaceOutboundWorker(TypedDict, total= class BindingWorkersBindingKindDispatchNamespaceOutbound(TypedDict, total=False): """Outbound worker.""" - params: SequenceNotStr[str] + params: Iterable[BindingWorkersBindingKindDispatchNamespaceOutboundParam] """ Pass information from the Dispatch Worker to the Outbound Worker through the parameters. @@ -360,7 +369,7 @@ class BindingWorkersBindingKindImages(TypedDict, total=False): class BindingWorkersBindingKindJson(TypedDict, total=False): - json: Required[str] + json: Required[object] """JSON data to use.""" name: Required[str] diff --git a/src/cloudflare/types/workers/script_search_response.py b/src/cloudflare/types/workers/script_search_response.py index 465f360a0d3..583a623c667 100644 --- a/src/cloudflare/types/workers/script_search_response.py +++ b/src/cloudflare/types/workers/script_search_response.py @@ -10,6 +10,9 @@ class ScriptSearchResponseItem(BaseModel): + id: str + """Identifier.""" + created_on: datetime """When the script was created.""" @@ -19,9 +22,6 @@ class ScriptSearchResponseItem(BaseModel): script_name: str """Name of the script, used in URLs and route configuration.""" - script_tag: str - """Identifier.""" - environment_is_default: Optional[bool] = None """Whether the environment is the default environment.""" diff --git a/src/cloudflare/types/workers/script_update_params.py b/src/cloudflare/types/workers/script_update_params.py index 82434e03ee1..fe9c2842279 100644 --- a/src/cloudflare/types/workers/script_update_params.py +++ b/src/cloudflare/types/workers/script_update_params.py @@ -24,6 +24,7 @@ "MetadataBindingWorkersBindingKindDataBlob", "MetadataBindingWorkersBindingKindDispatchNamespace", "MetadataBindingWorkersBindingKindDispatchNamespaceOutbound", + "MetadataBindingWorkersBindingKindDispatchNamespaceOutboundParam", "MetadataBindingWorkersBindingKindDispatchNamespaceOutboundWorker", "MetadataBindingWorkersBindingKindDurableObjectNamespace", "MetadataBindingWorkersBindingKindHyperdrive", @@ -198,9 +199,17 @@ class MetadataBindingWorkersBindingKindDataBlob(TypedDict, total=False): """The kind of resource that the binding provides.""" +class MetadataBindingWorkersBindingKindDispatchNamespaceOutboundParam(TypedDict, total=False): + name: Required[str] + """Name of the parameter.""" + + class MetadataBindingWorkersBindingKindDispatchNamespaceOutboundWorker(TypedDict, total=False): """Outbound worker.""" + entrypoint: str + """Entrypoint to invoke on the outbound worker.""" + environment: str """Environment of the outbound worker.""" @@ -211,7 +220,7 @@ class MetadataBindingWorkersBindingKindDispatchNamespaceOutboundWorker(TypedDict class MetadataBindingWorkersBindingKindDispatchNamespaceOutbound(TypedDict, total=False): """Outbound worker.""" - params: SequenceNotStr[str] + params: Iterable[MetadataBindingWorkersBindingKindDispatchNamespaceOutboundParam] """ Pass information from the Dispatch Worker to the Outbound Worker through the parameters. @@ -300,7 +309,7 @@ class MetadataBindingWorkersBindingKindImages(TypedDict, total=False): class MetadataBindingWorkersBindingKindJson(TypedDict, total=False): - json: Required[str] + json: Required[object] """JSON data to use.""" 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 0f547f8a0ff..4e32a071f64 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 @@ -22,6 +22,7 @@ "SettingsBindingWorkersBindingKindDataBlob", "SettingsBindingWorkersBindingKindDispatchNamespace", "SettingsBindingWorkersBindingKindDispatchNamespaceOutbound", + "SettingsBindingWorkersBindingKindDispatchNamespaceOutboundParam", "SettingsBindingWorkersBindingKindDispatchNamespaceOutboundWorker", "SettingsBindingWorkersBindingKindDurableObjectNamespace", "SettingsBindingWorkersBindingKindHyperdrive", @@ -134,9 +135,17 @@ class SettingsBindingWorkersBindingKindDataBlob(TypedDict, total=False): """The kind of resource that the binding provides.""" +class SettingsBindingWorkersBindingKindDispatchNamespaceOutboundParam(TypedDict, total=False): + name: Required[str] + """Name of the parameter.""" + + class SettingsBindingWorkersBindingKindDispatchNamespaceOutboundWorker(TypedDict, total=False): """Outbound worker.""" + entrypoint: str + """Entrypoint to invoke on the outbound worker.""" + environment: str """Environment of the outbound worker.""" @@ -147,7 +156,7 @@ class SettingsBindingWorkersBindingKindDispatchNamespaceOutboundWorker(TypedDict class SettingsBindingWorkersBindingKindDispatchNamespaceOutbound(TypedDict, total=False): """Outbound worker.""" - params: SequenceNotStr[str] + params: Iterable[SettingsBindingWorkersBindingKindDispatchNamespaceOutboundParam] """ Pass information from the Dispatch Worker to the Outbound Worker through the parameters. @@ -236,7 +245,7 @@ class SettingsBindingWorkersBindingKindImages(TypedDict, total=False): class SettingsBindingWorkersBindingKindJson(TypedDict, total=False): - json: Required[str] + json: Required[object] """JSON data to use.""" 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 b0ef793ee26..474b8062273 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 @@ -21,6 +21,7 @@ "BindingWorkersBindingKindDataBlob", "BindingWorkersBindingKindDispatchNamespace", "BindingWorkersBindingKindDispatchNamespaceOutbound", + "BindingWorkersBindingKindDispatchNamespaceOutboundParam", "BindingWorkersBindingKindDispatchNamespaceOutboundWorker", "BindingWorkersBindingKindDurableObjectNamespace", "BindingWorkersBindingKindHyperdrive", @@ -126,9 +127,17 @@ class BindingWorkersBindingKindDataBlob(BaseModel): """The kind of resource that the binding provides.""" +class BindingWorkersBindingKindDispatchNamespaceOutboundParam(BaseModel): + name: str + """Name of the parameter.""" + + class BindingWorkersBindingKindDispatchNamespaceOutboundWorker(BaseModel): """Outbound worker.""" + entrypoint: Optional[str] = None + """Entrypoint to invoke on the outbound worker.""" + environment: Optional[str] = None """Environment of the outbound worker.""" @@ -139,7 +148,7 @@ class BindingWorkersBindingKindDispatchNamespaceOutboundWorker(BaseModel): class BindingWorkersBindingKindDispatchNamespaceOutbound(BaseModel): """Outbound worker.""" - params: Optional[List[str]] = None + params: Optional[List[BindingWorkersBindingKindDispatchNamespaceOutboundParam]] = None """ Pass information from the Dispatch Worker to the Outbound Worker through the parameters. @@ -228,7 +237,7 @@ class BindingWorkersBindingKindImages(BaseModel): class BindingWorkersBindingKindJson(BaseModel): - json_: str = FieldInfo(alias="json") + json_: object = FieldInfo(alias="json") """JSON data to use.""" 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 f869dcb6f3c..d46d7ba022e 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 @@ -21,6 +21,7 @@ "BindingWorkersBindingKindDataBlob", "BindingWorkersBindingKindDispatchNamespace", "BindingWorkersBindingKindDispatchNamespaceOutbound", + "BindingWorkersBindingKindDispatchNamespaceOutboundParam", "BindingWorkersBindingKindDispatchNamespaceOutboundWorker", "BindingWorkersBindingKindDurableObjectNamespace", "BindingWorkersBindingKindHyperdrive", @@ -126,9 +127,17 @@ class BindingWorkersBindingKindDataBlob(BaseModel): """The kind of resource that the binding provides.""" +class BindingWorkersBindingKindDispatchNamespaceOutboundParam(BaseModel): + name: str + """Name of the parameter.""" + + class BindingWorkersBindingKindDispatchNamespaceOutboundWorker(BaseModel): """Outbound worker.""" + entrypoint: Optional[str] = None + """Entrypoint to invoke on the outbound worker.""" + environment: Optional[str] = None """Environment of the outbound worker.""" @@ -139,7 +148,7 @@ class BindingWorkersBindingKindDispatchNamespaceOutboundWorker(BaseModel): class BindingWorkersBindingKindDispatchNamespaceOutbound(BaseModel): """Outbound worker.""" - params: Optional[List[str]] = None + params: Optional[List[BindingWorkersBindingKindDispatchNamespaceOutboundParam]] = None """ Pass information from the Dispatch Worker to the Outbound Worker through the parameters. @@ -228,7 +237,7 @@ class BindingWorkersBindingKindImages(BaseModel): class BindingWorkersBindingKindJson(BaseModel): - json_: str = FieldInfo(alias="json") + json_: object = FieldInfo(alias="json") """JSON data to use.""" 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 32e676a20bc..0a489692df3 100644 --- a/src/cloudflare/types/workers/scripts/version_create_params.py +++ b/src/cloudflare/types/workers/scripts/version_create_params.py @@ -21,6 +21,7 @@ "MetadataBindingWorkersBindingKindDataBlob", "MetadataBindingWorkersBindingKindDispatchNamespace", "MetadataBindingWorkersBindingKindDispatchNamespaceOutbound", + "MetadataBindingWorkersBindingKindDispatchNamespaceOutboundParam", "MetadataBindingWorkersBindingKindDispatchNamespaceOutboundWorker", "MetadataBindingWorkersBindingKindDurableObjectNamespace", "MetadataBindingWorkersBindingKindHyperdrive", @@ -138,9 +139,17 @@ class MetadataBindingWorkersBindingKindDataBlob(TypedDict, total=False): """The kind of resource that the binding provides.""" +class MetadataBindingWorkersBindingKindDispatchNamespaceOutboundParam(TypedDict, total=False): + name: Required[str] + """Name of the parameter.""" + + class MetadataBindingWorkersBindingKindDispatchNamespaceOutboundWorker(TypedDict, total=False): """Outbound worker.""" + entrypoint: str + """Entrypoint to invoke on the outbound worker.""" + environment: str """Environment of the outbound worker.""" @@ -151,7 +160,7 @@ class MetadataBindingWorkersBindingKindDispatchNamespaceOutboundWorker(TypedDict class MetadataBindingWorkersBindingKindDispatchNamespaceOutbound(TypedDict, total=False): """Outbound worker.""" - params: SequenceNotStr[str] + params: Iterable[MetadataBindingWorkersBindingKindDispatchNamespaceOutboundParam] """ Pass information from the Dispatch Worker to the Outbound Worker through the parameters. @@ -240,7 +249,7 @@ class MetadataBindingWorkersBindingKindImages(TypedDict, total=False): class MetadataBindingWorkersBindingKindJson(TypedDict, total=False): - json: Required[str] + json: Required[object] """JSON data to use.""" 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 69a14dd8aa7..f71f14a2e21 100644 --- a/src/cloudflare/types/workers/scripts/version_create_response.py +++ b/src/cloudflare/types/workers/scripts/version_create_response.py @@ -20,6 +20,7 @@ "ResourcesBindingWorkersBindingKindDataBlob", "ResourcesBindingWorkersBindingKindDispatchNamespace", "ResourcesBindingWorkersBindingKindDispatchNamespaceOutbound", + "ResourcesBindingWorkersBindingKindDispatchNamespaceOutboundParam", "ResourcesBindingWorkersBindingKindDispatchNamespaceOutboundWorker", "ResourcesBindingWorkersBindingKindDurableObjectNamespace", "ResourcesBindingWorkersBindingKindHyperdrive", @@ -112,9 +113,17 @@ class ResourcesBindingWorkersBindingKindDataBlob(BaseModel): """The kind of resource that the binding provides.""" +class ResourcesBindingWorkersBindingKindDispatchNamespaceOutboundParam(BaseModel): + name: str + """Name of the parameter.""" + + class ResourcesBindingWorkersBindingKindDispatchNamespaceOutboundWorker(BaseModel): """Outbound worker.""" + entrypoint: Optional[str] = None + """Entrypoint to invoke on the outbound worker.""" + environment: Optional[str] = None """Environment of the outbound worker.""" @@ -125,7 +134,7 @@ class ResourcesBindingWorkersBindingKindDispatchNamespaceOutboundWorker(BaseMode class ResourcesBindingWorkersBindingKindDispatchNamespaceOutbound(BaseModel): """Outbound worker.""" - params: Optional[List[str]] = None + params: Optional[List[ResourcesBindingWorkersBindingKindDispatchNamespaceOutboundParam]] = None """ Pass information from the Dispatch Worker to the Outbound Worker through the parameters. @@ -214,7 +223,7 @@ class ResourcesBindingWorkersBindingKindImages(BaseModel): class ResourcesBindingWorkersBindingKindJson(BaseModel): - json_: str = FieldInfo(alias="json") + json_: object = FieldInfo(alias="json") """JSON data to use.""" 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 f84756c8d41..29b55aa6a3d 100644 --- a/src/cloudflare/types/workers/scripts/version_get_response.py +++ b/src/cloudflare/types/workers/scripts/version_get_response.py @@ -20,6 +20,7 @@ "ResourcesBindingWorkersBindingKindDataBlob", "ResourcesBindingWorkersBindingKindDispatchNamespace", "ResourcesBindingWorkersBindingKindDispatchNamespaceOutbound", + "ResourcesBindingWorkersBindingKindDispatchNamespaceOutboundParam", "ResourcesBindingWorkersBindingKindDispatchNamespaceOutboundWorker", "ResourcesBindingWorkersBindingKindDurableObjectNamespace", "ResourcesBindingWorkersBindingKindHyperdrive", @@ -112,9 +113,17 @@ class ResourcesBindingWorkersBindingKindDataBlob(BaseModel): """The kind of resource that the binding provides.""" +class ResourcesBindingWorkersBindingKindDispatchNamespaceOutboundParam(BaseModel): + name: str + """Name of the parameter.""" + + class ResourcesBindingWorkersBindingKindDispatchNamespaceOutboundWorker(BaseModel): """Outbound worker.""" + entrypoint: Optional[str] = None + """Entrypoint to invoke on the outbound worker.""" + environment: Optional[str] = None """Environment of the outbound worker.""" @@ -125,7 +134,7 @@ class ResourcesBindingWorkersBindingKindDispatchNamespaceOutboundWorker(BaseMode class ResourcesBindingWorkersBindingKindDispatchNamespaceOutbound(BaseModel): """Outbound worker.""" - params: Optional[List[str]] = None + params: Optional[List[ResourcesBindingWorkersBindingKindDispatchNamespaceOutboundParam]] = None """ Pass information from the Dispatch Worker to the Outbound Worker through the parameters. @@ -214,7 +223,7 @@ class ResourcesBindingWorkersBindingKindImages(BaseModel): class ResourcesBindingWorkersBindingKindJson(BaseModel): - json_: str = FieldInfo(alias="json") + json_: object = FieldInfo(alias="json") """JSON data to use.""" name: str diff --git a/src/cloudflare/types/workers_for_platforms/dispatch/namespaces/script_update_params.py b/src/cloudflare/types/workers_for_platforms/dispatch/namespaces/script_update_params.py index 59cd806ed41..7ce23ec5cb8 100644 --- a/src/cloudflare/types/workers_for_platforms/dispatch/namespaces/script_update_params.py +++ b/src/cloudflare/types/workers_for_platforms/dispatch/namespaces/script_update_params.py @@ -24,6 +24,7 @@ "MetadataBindingWorkersBindingKindDataBlob", "MetadataBindingWorkersBindingKindDispatchNamespace", "MetadataBindingWorkersBindingKindDispatchNamespaceOutbound", + "MetadataBindingWorkersBindingKindDispatchNamespaceOutboundParam", "MetadataBindingWorkersBindingKindDispatchNamespaceOutboundWorker", "MetadataBindingWorkersBindingKindDurableObjectNamespace", "MetadataBindingWorkersBindingKindHyperdrive", @@ -201,9 +202,17 @@ class MetadataBindingWorkersBindingKindDataBlob(TypedDict, total=False): """The kind of resource that the binding provides.""" +class MetadataBindingWorkersBindingKindDispatchNamespaceOutboundParam(TypedDict, total=False): + name: Required[str] + """Name of the parameter.""" + + class MetadataBindingWorkersBindingKindDispatchNamespaceOutboundWorker(TypedDict, total=False): """Outbound worker.""" + entrypoint: str + """Entrypoint to invoke on the outbound worker.""" + environment: str """Environment of the outbound worker.""" @@ -214,7 +223,7 @@ class MetadataBindingWorkersBindingKindDispatchNamespaceOutboundWorker(TypedDict class MetadataBindingWorkersBindingKindDispatchNamespaceOutbound(TypedDict, total=False): """Outbound worker.""" - params: SequenceNotStr[str] + params: Iterable[MetadataBindingWorkersBindingKindDispatchNamespaceOutboundParam] """ Pass information from the Dispatch Worker to the Outbound Worker through the parameters. @@ -303,7 +312,7 @@ class MetadataBindingWorkersBindingKindImages(TypedDict, total=False): class MetadataBindingWorkersBindingKindJson(TypedDict, total=False): - json: Required[str] + json: Required[object] """JSON data to use.""" name: Required[str] diff --git a/src/cloudflare/types/workers_for_platforms/dispatch/namespaces/scripts/binding_get_response.py b/src/cloudflare/types/workers_for_platforms/dispatch/namespaces/scripts/binding_get_response.py index f718e803a1f..3aa0ba5e4f7 100644 --- a/src/cloudflare/types/workers_for_platforms/dispatch/namespaces/scripts/binding_get_response.py +++ b/src/cloudflare/types/workers_for_platforms/dispatch/namespaces/scripts/binding_get_response.py @@ -18,6 +18,7 @@ "WorkersBindingKindDataBlob", "WorkersBindingKindDispatchNamespace", "WorkersBindingKindDispatchNamespaceOutbound", + "WorkersBindingKindDispatchNamespaceOutboundParam", "WorkersBindingKindDispatchNamespaceOutboundWorker", "WorkersBindingKindDurableObjectNamespace", "WorkersBindingKindHyperdrive", @@ -105,9 +106,17 @@ class WorkersBindingKindDataBlob(BaseModel): """The kind of resource that the binding provides.""" +class WorkersBindingKindDispatchNamespaceOutboundParam(BaseModel): + name: str + """Name of the parameter.""" + + class WorkersBindingKindDispatchNamespaceOutboundWorker(BaseModel): """Outbound worker.""" + entrypoint: Optional[str] = None + """Entrypoint to invoke on the outbound worker.""" + environment: Optional[str] = None """Environment of the outbound worker.""" @@ -118,7 +127,7 @@ class WorkersBindingKindDispatchNamespaceOutboundWorker(BaseModel): class WorkersBindingKindDispatchNamespaceOutbound(BaseModel): """Outbound worker.""" - params: Optional[List[str]] = None + params: Optional[List[WorkersBindingKindDispatchNamespaceOutboundParam]] = None """ Pass information from the Dispatch Worker to the Outbound Worker through the parameters. @@ -207,7 +216,7 @@ class WorkersBindingKindImages(BaseModel): class WorkersBindingKindJson(BaseModel): - json_: str = FieldInfo(alias="json") + json_: object = FieldInfo(alias="json") """JSON data to use.""" name: str diff --git a/src/cloudflare/types/workers_for_platforms/dispatch/namespaces/scripts/setting_edit_params.py b/src/cloudflare/types/workers_for_platforms/dispatch/namespaces/scripts/setting_edit_params.py index 09373ffb1c6..54136c13b2a 100644 --- a/src/cloudflare/types/workers_for_platforms/dispatch/namespaces/scripts/setting_edit_params.py +++ b/src/cloudflare/types/workers_for_platforms/dispatch/namespaces/scripts/setting_edit_params.py @@ -22,6 +22,7 @@ "SettingsBindingWorkersBindingKindDataBlob", "SettingsBindingWorkersBindingKindDispatchNamespace", "SettingsBindingWorkersBindingKindDispatchNamespaceOutbound", + "SettingsBindingWorkersBindingKindDispatchNamespaceOutboundParam", "SettingsBindingWorkersBindingKindDispatchNamespaceOutboundWorker", "SettingsBindingWorkersBindingKindDurableObjectNamespace", "SettingsBindingWorkersBindingKindHyperdrive", @@ -137,9 +138,17 @@ class SettingsBindingWorkersBindingKindDataBlob(TypedDict, total=False): """The kind of resource that the binding provides.""" +class SettingsBindingWorkersBindingKindDispatchNamespaceOutboundParam(TypedDict, total=False): + name: Required[str] + """Name of the parameter.""" + + class SettingsBindingWorkersBindingKindDispatchNamespaceOutboundWorker(TypedDict, total=False): """Outbound worker.""" + entrypoint: str + """Entrypoint to invoke on the outbound worker.""" + environment: str """Environment of the outbound worker.""" @@ -150,7 +159,7 @@ class SettingsBindingWorkersBindingKindDispatchNamespaceOutboundWorker(TypedDict class SettingsBindingWorkersBindingKindDispatchNamespaceOutbound(TypedDict, total=False): """Outbound worker.""" - params: SequenceNotStr[str] + params: Iterable[SettingsBindingWorkersBindingKindDispatchNamespaceOutboundParam] """ Pass information from the Dispatch Worker to the Outbound Worker through the parameters. @@ -239,7 +248,7 @@ class SettingsBindingWorkersBindingKindImages(TypedDict, total=False): class SettingsBindingWorkersBindingKindJson(TypedDict, total=False): - json: Required[str] + json: Required[object] """JSON data to use.""" name: Required[str] diff --git a/src/cloudflare/types/workers_for_platforms/dispatch/namespaces/scripts/setting_edit_response.py b/src/cloudflare/types/workers_for_platforms/dispatch/namespaces/scripts/setting_edit_response.py index 27fe9432dbe..0b34a93f024 100644 --- a/src/cloudflare/types/workers_for_platforms/dispatch/namespaces/scripts/setting_edit_response.py +++ b/src/cloudflare/types/workers_for_platforms/dispatch/namespaces/scripts/setting_edit_response.py @@ -21,6 +21,7 @@ "BindingWorkersBindingKindDataBlob", "BindingWorkersBindingKindDispatchNamespace", "BindingWorkersBindingKindDispatchNamespaceOutbound", + "BindingWorkersBindingKindDispatchNamespaceOutboundParam", "BindingWorkersBindingKindDispatchNamespaceOutboundWorker", "BindingWorkersBindingKindDurableObjectNamespace", "BindingWorkersBindingKindHyperdrive", @@ -126,9 +127,17 @@ class BindingWorkersBindingKindDataBlob(BaseModel): """The kind of resource that the binding provides.""" +class BindingWorkersBindingKindDispatchNamespaceOutboundParam(BaseModel): + name: str + """Name of the parameter.""" + + class BindingWorkersBindingKindDispatchNamespaceOutboundWorker(BaseModel): """Outbound worker.""" + entrypoint: Optional[str] = None + """Entrypoint to invoke on the outbound worker.""" + environment: Optional[str] = None """Environment of the outbound worker.""" @@ -139,7 +148,7 @@ class BindingWorkersBindingKindDispatchNamespaceOutboundWorker(BaseModel): class BindingWorkersBindingKindDispatchNamespaceOutbound(BaseModel): """Outbound worker.""" - params: Optional[List[str]] = None + params: Optional[List[BindingWorkersBindingKindDispatchNamespaceOutboundParam]] = None """ Pass information from the Dispatch Worker to the Outbound Worker through the parameters. @@ -228,7 +237,7 @@ class BindingWorkersBindingKindImages(BaseModel): class BindingWorkersBindingKindJson(BaseModel): - json_: str = FieldInfo(alias="json") + json_: object = FieldInfo(alias="json") """JSON data to use.""" name: str diff --git a/src/cloudflare/types/workers_for_platforms/dispatch/namespaces/scripts/setting_get_response.py b/src/cloudflare/types/workers_for_platforms/dispatch/namespaces/scripts/setting_get_response.py index 9a2aefb205a..25727f31b5d 100644 --- a/src/cloudflare/types/workers_for_platforms/dispatch/namespaces/scripts/setting_get_response.py +++ b/src/cloudflare/types/workers_for_platforms/dispatch/namespaces/scripts/setting_get_response.py @@ -21,6 +21,7 @@ "BindingWorkersBindingKindDataBlob", "BindingWorkersBindingKindDispatchNamespace", "BindingWorkersBindingKindDispatchNamespaceOutbound", + "BindingWorkersBindingKindDispatchNamespaceOutboundParam", "BindingWorkersBindingKindDispatchNamespaceOutboundWorker", "BindingWorkersBindingKindDurableObjectNamespace", "BindingWorkersBindingKindHyperdrive", @@ -126,9 +127,17 @@ class BindingWorkersBindingKindDataBlob(BaseModel): """The kind of resource that the binding provides.""" +class BindingWorkersBindingKindDispatchNamespaceOutboundParam(BaseModel): + name: str + """Name of the parameter.""" + + class BindingWorkersBindingKindDispatchNamespaceOutboundWorker(BaseModel): """Outbound worker.""" + entrypoint: Optional[str] = None + """Entrypoint to invoke on the outbound worker.""" + environment: Optional[str] = None """Environment of the outbound worker.""" @@ -139,7 +148,7 @@ class BindingWorkersBindingKindDispatchNamespaceOutboundWorker(BaseModel): class BindingWorkersBindingKindDispatchNamespaceOutbound(BaseModel): """Outbound worker.""" - params: Optional[List[str]] = None + params: Optional[List[BindingWorkersBindingKindDispatchNamespaceOutboundParam]] = None """ Pass information from the Dispatch Worker to the Outbound Worker through the parameters. @@ -228,7 +237,7 @@ class BindingWorkersBindingKindImages(BaseModel): class BindingWorkersBindingKindJson(BaseModel): - json_: str = FieldInfo(alias="json") + json_: object = FieldInfo(alias="json") """JSON data to use.""" name: str From 1e9c2423aed148c30b92b5a3d25b3d62252f4137 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 17 Feb 2026 17:03:04 +0000 Subject: [PATCH 012/279] feat: feat(dex): add DEX rules --- .stats.yml | 4 +- api.md | 22 + .../resources/zero_trust/dex/__init__.py | 14 + .../resources/zero_trust/dex/dex.py | 32 + .../resources/zero_trust/dex/rules.py | 666 ++++++++++++++++++ .../types/zero_trust/dex/__init__.py | 8 + .../zero_trust/dex/rule_create_params.py | 19 + .../zero_trust/dex/rule_create_response.py | 54 ++ .../zero_trust/dex/rule_delete_response.py | 8 + .../types/zero_trust/dex/rule_get_response.py | 54 ++ .../types/zero_trust/dex/rule_list_params.py | 26 + .../zero_trust/dex/rule_list_response.py | 58 ++ .../zero_trust/dex/rule_update_params.py | 19 + .../zero_trust/dex/rule_update_response.py | 54 ++ .../zero_trust/dex/test_rules.py | 569 +++++++++++++++ 15 files changed, 1605 insertions(+), 2 deletions(-) create mode 100644 src/cloudflare/resources/zero_trust/dex/rules.py create mode 100644 src/cloudflare/types/zero_trust/dex/rule_create_params.py create mode 100644 src/cloudflare/types/zero_trust/dex/rule_create_response.py create mode 100644 src/cloudflare/types/zero_trust/dex/rule_delete_response.py create mode 100644 src/cloudflare/types/zero_trust/dex/rule_get_response.py create mode 100644 src/cloudflare/types/zero_trust/dex/rule_list_params.py create mode 100644 src/cloudflare/types/zero_trust/dex/rule_list_response.py create mode 100644 src/cloudflare/types/zero_trust/dex/rule_update_params.py create mode 100644 src/cloudflare/types/zero_trust/dex/rule_update_response.py create mode 100644 tests/api_resources/zero_trust/dex/test_rules.py diff --git a/.stats.yml b/.stats.yml index 8099de9b7c3..ad4c2446336 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ -configured_endpoints: 2015 +configured_endpoints: 2020 openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-2b935132316d46fe098e11238cf09f7861e29754870e6775c31d53108b357a35.yml openapi_spec_hash: 3c786e10f8e2cea0b76e820dbd848eab -config_hash: 7a08b6d7e050d324501d76c833118c84 +config_hash: a4197f3e022bd501a828d1252b76e06e diff --git a/api.md b/api.md index 7c5ff7b6bde..f3360b82c77 100644 --- a/api.md +++ b/api.md @@ -6564,6 +6564,28 @@ Methods: - client.zero_trust.dex.traceroute_tests.network_path(test_id, \*, account_id, \*\*params) -> Optional[NetworkPathResponse] - client.zero_trust.dex.traceroute_tests.percentiles(test_id, \*, account_id, \*\*params) -> Optional[TracerouteTestPercentilesResponse] +### Rules + +Types: + +```python +from cloudflare.types.zero_trust.dex import ( + RuleCreateResponse, + RuleUpdateResponse, + RuleListResponse, + RuleDeleteResponse, + RuleGetResponse, +) +``` + +Methods: + +- client.zero_trust.dex.rules.create(\*, account_id, \*\*params) -> Optional[RuleCreateResponse] +- client.zero_trust.dex.rules.update(rule_id, \*, account_id, \*\*params) -> Optional[RuleUpdateResponse] +- client.zero_trust.dex.rules.list(\*, account_id, \*\*params) -> SyncV4PagePagination[Optional[RuleListResponse]] +- client.zero_trust.dex.rules.delete(rule_id, \*, account_id) -> Optional[RuleDeleteResponse] +- client.zero_trust.dex.rules.get(rule_id, \*, account_id) -> Optional[RuleGetResponse] + ## Tunnels Types: diff --git a/src/cloudflare/resources/zero_trust/dex/__init__.py b/src/cloudflare/resources/zero_trust/dex/__init__.py index c088f4cb408..b4e5b64def8 100644 --- a/src/cloudflare/resources/zero_trust/dex/__init__.py +++ b/src/cloudflare/resources/zero_trust/dex/__init__.py @@ -16,6 +16,14 @@ ColosResourceWithStreamingResponse, AsyncColosResourceWithStreamingResponse, ) +from .rules import ( + RulesResource, + AsyncRulesResource, + RulesResourceWithRawResponse, + AsyncRulesResourceWithRawResponse, + RulesResourceWithStreamingResponse, + AsyncRulesResourceWithStreamingResponse, +) from .tests import ( TestsResource, AsyncTestsResource, @@ -122,6 +130,12 @@ "AsyncTracerouteTestsResourceWithRawResponse", "TracerouteTestsResourceWithStreamingResponse", "AsyncTracerouteTestsResourceWithStreamingResponse", + "RulesResource", + "AsyncRulesResource", + "RulesResourceWithRawResponse", + "AsyncRulesResourceWithRawResponse", + "RulesResourceWithStreamingResponse", + "AsyncRulesResourceWithStreamingResponse", "DEXResource", "AsyncDEXResource", "DEXResourceWithRawResponse", diff --git a/src/cloudflare/resources/zero_trust/dex/dex.py b/src/cloudflare/resources/zero_trust/dex/dex.py index ae354ec6334..82bd1271b6f 100644 --- a/src/cloudflare/resources/zero_trust/dex/dex.py +++ b/src/cloudflare/resources/zero_trust/dex/dex.py @@ -10,6 +10,14 @@ ColosResourceWithStreamingResponse, AsyncColosResourceWithStreamingResponse, ) +from .rules import ( + RulesResource, + AsyncRulesResource, + RulesResourceWithRawResponse, + AsyncRulesResourceWithRawResponse, + RulesResourceWithStreamingResponse, + AsyncRulesResourceWithStreamingResponse, +) from ...._compat import cached_property from .tests.tests import ( TestsResource, @@ -105,6 +113,10 @@ def traceroute_test_results(self) -> TracerouteTestResultsResource: def traceroute_tests(self) -> TracerouteTestsResource: return TracerouteTestsResource(self._client) + @cached_property + def rules(self) -> RulesResource: + return RulesResource(self._client) + @cached_property def with_raw_response(self) -> DEXResourceWithRawResponse: """ @@ -158,6 +170,10 @@ def traceroute_test_results(self) -> AsyncTracerouteTestResultsResource: def traceroute_tests(self) -> AsyncTracerouteTestsResource: return AsyncTracerouteTestsResource(self._client) + @cached_property + def rules(self) -> AsyncRulesResource: + return AsyncRulesResource(self._client) + @cached_property def with_raw_response(self) -> AsyncDEXResourceWithRawResponse: """ @@ -214,6 +230,10 @@ def traceroute_test_results(self) -> TracerouteTestResultsResourceWithRawRespons def traceroute_tests(self) -> TracerouteTestsResourceWithRawResponse: return TracerouteTestsResourceWithRawResponse(self._dex.traceroute_tests) + @cached_property + def rules(self) -> RulesResourceWithRawResponse: + return RulesResourceWithRawResponse(self._dex.rules) + class AsyncDEXResourceWithRawResponse: def __init__(self, dex: AsyncDEXResource) -> None: @@ -251,6 +271,10 @@ def traceroute_test_results(self) -> AsyncTracerouteTestResultsResourceWithRawRe def traceroute_tests(self) -> AsyncTracerouteTestsResourceWithRawResponse: return AsyncTracerouteTestsResourceWithRawResponse(self._dex.traceroute_tests) + @cached_property + def rules(self) -> AsyncRulesResourceWithRawResponse: + return AsyncRulesResourceWithRawResponse(self._dex.rules) + class DEXResourceWithStreamingResponse: def __init__(self, dex: DEXResource) -> None: @@ -288,6 +312,10 @@ def traceroute_test_results(self) -> TracerouteTestResultsResourceWithStreamingR def traceroute_tests(self) -> TracerouteTestsResourceWithStreamingResponse: return TracerouteTestsResourceWithStreamingResponse(self._dex.traceroute_tests) + @cached_property + def rules(self) -> RulesResourceWithStreamingResponse: + return RulesResourceWithStreamingResponse(self._dex.rules) + class AsyncDEXResourceWithStreamingResponse: def __init__(self, dex: AsyncDEXResource) -> None: @@ -324,3 +352,7 @@ def traceroute_test_results(self) -> AsyncTracerouteTestResultsResourceWithStrea @cached_property def traceroute_tests(self) -> AsyncTracerouteTestsResourceWithStreamingResponse: return AsyncTracerouteTestsResourceWithStreamingResponse(self._dex.traceroute_tests) + + @cached_property + def rules(self) -> AsyncRulesResourceWithStreamingResponse: + return AsyncRulesResourceWithStreamingResponse(self._dex.rules) diff --git a/src/cloudflare/resources/zero_trust/dex/rules.py b/src/cloudflare/resources/zero_trust/dex/rules.py new file mode 100644 index 00000000000..bfc1fab8624 --- /dev/null +++ b/src/cloudflare/resources/zero_trust/dex/rules.py @@ -0,0 +1,666 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +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 maybe_transform, async_maybe_transform +from ...._compat import cached_property +from ...._resource import SyncAPIResource, AsyncAPIResource +from ...._response import ( + to_raw_response_wrapper, + to_streamed_response_wrapper, + async_to_raw_response_wrapper, + async_to_streamed_response_wrapper, +) +from ...._wrappers import ResultWrapper +from ....pagination import SyncV4PagePagination, AsyncV4PagePagination +from ...._base_client import AsyncPaginator, make_request_options +from ....types.zero_trust.dex import rule_list_params, rule_create_params, rule_update_params +from ....types.zero_trust.dex.rule_get_response import RuleGetResponse +from ....types.zero_trust.dex.rule_list_response import RuleListResponse +from ....types.zero_trust.dex.rule_create_response import RuleCreateResponse +from ....types.zero_trust.dex.rule_delete_response import RuleDeleteResponse +from ....types.zero_trust.dex.rule_update_response import RuleUpdateResponse + +__all__ = ["RulesResource", "AsyncRulesResource"] + + +class RulesResource(SyncAPIResource): + @cached_property + def with_raw_response(self) -> RulesResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers + """ + return RulesResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> RulesResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/cloudflare/cloudflare-python#with_streaming_response + """ + return RulesResourceWithStreamingResponse(self) + + def create( + self, + *, + account_id: str, + match: str, + name: str, + description: str | 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, + ) -> Optional[RuleCreateResponse]: + """ + Create a DEX Rule + + Args: + match: The wirefilter expression to match. + + name: The name of the Rule. + + 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._post( + f"/accounts/{account_id}/dex/rules", + body=maybe_transform( + { + "match": match, + "name": name, + "description": description, + }, + rule_create_params.RuleCreateParams, + ), + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + post_parser=ResultWrapper[Optional[RuleCreateResponse]]._unwrapper, + ), + cast_to=cast(Type[Optional[RuleCreateResponse]], ResultWrapper[RuleCreateResponse]), + ) + + def update( + self, + rule_id: str, + *, + account_id: str, + description: str | Omit = omit, + match: str | Omit = omit, + name: str | 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, + ) -> Optional[RuleUpdateResponse]: + """ + Update a DEX Rule + + Args: + rule_id: API Resource UUID tag. + + match: The wirefilter expression to match. + + name: The name of the Rule. + + 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 rule_id: + raise ValueError(f"Expected a non-empty value for `rule_id` but received {rule_id!r}") + return self._patch( + f"/accounts/{account_id}/dex/rules/{rule_id}", + body=maybe_transform( + { + "description": description, + "match": match, + "name": name, + }, + rule_update_params.RuleUpdateParams, + ), + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + post_parser=ResultWrapper[Optional[RuleUpdateResponse]]._unwrapper, + ), + cast_to=cast(Type[Optional[RuleUpdateResponse]], ResultWrapper[RuleUpdateResponse]), + ) + + def list( + self, + *, + account_id: str, + page: float, + per_page: float, + name: str | Omit = omit, + sort_by: Literal["name", "created_at", "updated_at"] | Omit = omit, + sort_order: Literal["ASC", "DESC"] | 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, + ) -> SyncV4PagePagination[Optional[RuleListResponse]]: + """ + List DEX Rules + + Args: + page: Page number of paginated results + + per_page: Number of items per page + + name: Filter results by rule name + + sort_by: Which property to sort results by + + sort_order: Sort direction for sort_by property + + 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( + f"/accounts/{account_id}/dex/rules", + page=SyncV4PagePagination[Optional[RuleListResponse]], + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=maybe_transform( + { + "page": page, + "per_page": per_page, + "name": name, + "sort_by": sort_by, + "sort_order": sort_order, + }, + rule_list_params.RuleListParams, + ), + ), + model=RuleListResponse, + ) + + def delete( + self, + rule_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[RuleDeleteResponse]: + """ + Delete a DEX Rule + + Args: + rule_id: API Resource UUID tag. + + 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 rule_id: + raise ValueError(f"Expected a non-empty value for `rule_id` but received {rule_id!r}") + return self._delete( + f"/accounts/{account_id}/dex/rules/{rule_id}", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + post_parser=ResultWrapper[Optional[RuleDeleteResponse]]._unwrapper, + ), + cast_to=cast(Type[Optional[RuleDeleteResponse]], ResultWrapper[RuleDeleteResponse]), + ) + + def get( + self, + rule_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[RuleGetResponse]: + """ + Get details for a DEX Rule + + Args: + rule_id: API Resource UUID tag. + + 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 rule_id: + raise ValueError(f"Expected a non-empty value for `rule_id` but received {rule_id!r}") + return self._get( + f"/accounts/{account_id}/dex/rules/{rule_id}", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + post_parser=ResultWrapper[Optional[RuleGetResponse]]._unwrapper, + ), + cast_to=cast(Type[Optional[RuleGetResponse]], ResultWrapper[RuleGetResponse]), + ) + + +class AsyncRulesResource(AsyncAPIResource): + @cached_property + def with_raw_response(self) -> AsyncRulesResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers + """ + return AsyncRulesResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> AsyncRulesResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/cloudflare/cloudflare-python#with_streaming_response + """ + return AsyncRulesResourceWithStreamingResponse(self) + + async def create( + self, + *, + account_id: str, + match: str, + name: str, + description: str | 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, + ) -> Optional[RuleCreateResponse]: + """ + Create a DEX Rule + + Args: + match: The wirefilter expression to match. + + name: The name of the Rule. + + 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 await self._post( + f"/accounts/{account_id}/dex/rules", + body=await async_maybe_transform( + { + "match": match, + "name": name, + "description": description, + }, + rule_create_params.RuleCreateParams, + ), + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + post_parser=ResultWrapper[Optional[RuleCreateResponse]]._unwrapper, + ), + cast_to=cast(Type[Optional[RuleCreateResponse]], ResultWrapper[RuleCreateResponse]), + ) + + async def update( + self, + rule_id: str, + *, + account_id: str, + description: str | Omit = omit, + match: str | Omit = omit, + name: str | 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, + ) -> Optional[RuleUpdateResponse]: + """ + Update a DEX Rule + + Args: + rule_id: API Resource UUID tag. + + match: The wirefilter expression to match. + + name: The name of the Rule. + + 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 rule_id: + raise ValueError(f"Expected a non-empty value for `rule_id` but received {rule_id!r}") + return await self._patch( + f"/accounts/{account_id}/dex/rules/{rule_id}", + body=await async_maybe_transform( + { + "description": description, + "match": match, + "name": name, + }, + rule_update_params.RuleUpdateParams, + ), + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + post_parser=ResultWrapper[Optional[RuleUpdateResponse]]._unwrapper, + ), + cast_to=cast(Type[Optional[RuleUpdateResponse]], ResultWrapper[RuleUpdateResponse]), + ) + + def list( + self, + *, + account_id: str, + page: float, + per_page: float, + name: str | Omit = omit, + sort_by: Literal["name", "created_at", "updated_at"] | Omit = omit, + sort_order: Literal["ASC", "DESC"] | 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, + ) -> AsyncPaginator[Optional[RuleListResponse], AsyncV4PagePagination[Optional[RuleListResponse]]]: + """ + List DEX Rules + + Args: + page: Page number of paginated results + + per_page: Number of items per page + + name: Filter results by rule name + + sort_by: Which property to sort results by + + sort_order: Sort direction for sort_by property + + 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( + f"/accounts/{account_id}/dex/rules", + page=AsyncV4PagePagination[Optional[RuleListResponse]], + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=maybe_transform( + { + "page": page, + "per_page": per_page, + "name": name, + "sort_by": sort_by, + "sort_order": sort_order, + }, + rule_list_params.RuleListParams, + ), + ), + model=RuleListResponse, + ) + + async def delete( + self, + rule_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[RuleDeleteResponse]: + """ + Delete a DEX Rule + + Args: + rule_id: API Resource UUID tag. + + 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 rule_id: + raise ValueError(f"Expected a non-empty value for `rule_id` but received {rule_id!r}") + return await self._delete( + f"/accounts/{account_id}/dex/rules/{rule_id}", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + post_parser=ResultWrapper[Optional[RuleDeleteResponse]]._unwrapper, + ), + cast_to=cast(Type[Optional[RuleDeleteResponse]], ResultWrapper[RuleDeleteResponse]), + ) + + async def get( + self, + rule_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[RuleGetResponse]: + """ + Get details for a DEX Rule + + Args: + rule_id: API Resource UUID tag. + + 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 rule_id: + raise ValueError(f"Expected a non-empty value for `rule_id` but received {rule_id!r}") + return await self._get( + f"/accounts/{account_id}/dex/rules/{rule_id}", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + post_parser=ResultWrapper[Optional[RuleGetResponse]]._unwrapper, + ), + cast_to=cast(Type[Optional[RuleGetResponse]], ResultWrapper[RuleGetResponse]), + ) + + +class RulesResourceWithRawResponse: + def __init__(self, rules: RulesResource) -> None: + self._rules = rules + + self.create = to_raw_response_wrapper( + rules.create, + ) + self.update = to_raw_response_wrapper( + rules.update, + ) + self.list = to_raw_response_wrapper( + rules.list, + ) + self.delete = to_raw_response_wrapper( + rules.delete, + ) + self.get = to_raw_response_wrapper( + rules.get, + ) + + +class AsyncRulesResourceWithRawResponse: + def __init__(self, rules: AsyncRulesResource) -> None: + self._rules = rules + + self.create = async_to_raw_response_wrapper( + rules.create, + ) + self.update = async_to_raw_response_wrapper( + rules.update, + ) + self.list = async_to_raw_response_wrapper( + rules.list, + ) + self.delete = async_to_raw_response_wrapper( + rules.delete, + ) + self.get = async_to_raw_response_wrapper( + rules.get, + ) + + +class RulesResourceWithStreamingResponse: + def __init__(self, rules: RulesResource) -> None: + self._rules = rules + + self.create = to_streamed_response_wrapper( + rules.create, + ) + self.update = to_streamed_response_wrapper( + rules.update, + ) + self.list = to_streamed_response_wrapper( + rules.list, + ) + self.delete = to_streamed_response_wrapper( + rules.delete, + ) + self.get = to_streamed_response_wrapper( + rules.get, + ) + + +class AsyncRulesResourceWithStreamingResponse: + def __init__(self, rules: AsyncRulesResource) -> None: + self._rules = rules + + self.create = async_to_streamed_response_wrapper( + rules.create, + ) + self.update = async_to_streamed_response_wrapper( + rules.update, + ) + self.list = async_to_streamed_response_wrapper( + rules.list, + ) + self.delete = async_to_streamed_response_wrapper( + rules.delete, + ) + self.get = async_to_streamed_response_wrapper( + rules.get, + ) diff --git a/src/cloudflare/types/zero_trust/dex/__init__.py b/src/cloudflare/types/zero_trust/dex/__init__.py index 674d2cb7a06..5fd5e308eb2 100644 --- a/src/cloudflare/types/zero_trust/dex/__init__.py +++ b/src/cloudflare/types/zero_trust/dex/__init__.py @@ -7,10 +7,18 @@ from .traceroute import Traceroute as Traceroute from .http_details import HTTPDetails as HTTPDetails from .colo_list_params import ColoListParams as ColoListParams +from .rule_list_params import RuleListParams as RuleListParams from .test_list_params import TestListParams as TestListParams +from .rule_get_response import RuleGetResponse as RuleGetResponse from .colo_list_response import ColoListResponse as ColoListResponse +from .rule_create_params import RuleCreateParams as RuleCreateParams +from .rule_list_response import RuleListResponse as RuleListResponse +from .rule_update_params import RuleUpdateParams as RuleUpdateParams from .command_list_params import CommandListParams as CommandListParams from .http_test_get_params import HTTPTestGetParams as HTTPTestGetParams +from .rule_create_response import RuleCreateResponse as RuleCreateResponse +from .rule_delete_response import RuleDeleteResponse as RuleDeleteResponse +from .rule_update_response import RuleUpdateResponse as RuleUpdateResponse from .aggregate_time_period import AggregateTimePeriod as AggregateTimePeriod from .command_create_params import CommandCreateParams as CommandCreateParams from .command_list_response import CommandListResponse as CommandListResponse diff --git a/src/cloudflare/types/zero_trust/dex/rule_create_params.py b/src/cloudflare/types/zero_trust/dex/rule_create_params.py new file mode 100644 index 00000000000..db10c6a7be7 --- /dev/null +++ b/src/cloudflare/types/zero_trust/dex/rule_create_params.py @@ -0,0 +1,19 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +__all__ = ["RuleCreateParams"] + + +class RuleCreateParams(TypedDict, total=False): + account_id: Required[str] + + match: Required[str] + """The wirefilter expression to match.""" + + name: Required[str] + """The name of the Rule.""" + + description: str diff --git a/src/cloudflare/types/zero_trust/dex/rule_create_response.py b/src/cloudflare/types/zero_trust/dex/rule_create_response.py new file mode 100644 index 00000000000..eecc3ba5510 --- /dev/null +++ b/src/cloudflare/types/zero_trust/dex/rule_create_response.py @@ -0,0 +1,54 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional +from typing_extensions import Literal + +from ...._models import BaseModel + +__all__ = ["RuleCreateResponse", "TargetedTest", "TargetedTestData"] + + +class TargetedTestData(BaseModel): + """ + The configuration object which contains the details for the WARP client to conduct the test. + """ + + host: str + """The desired endpoint to test.""" + + kind: Literal["http", "traceroute"] + """The type of test.""" + + method: Optional[Literal["GET"]] = None + """The HTTP request method type.""" + + +class TargetedTest(BaseModel): + data: TargetedTestData + """ + The configuration object which contains the details for the WARP client to + conduct the test. + """ + + enabled: bool + + name: str + + test_id: str + + +class RuleCreateResponse(BaseModel): + id: str + """API Resource UUID tag.""" + + created_at: str + + match: str + + name: str + + description: Optional[str] = None + + targeted_tests: Optional[List[TargetedTest]] = None + + updated_at: Optional[str] = None diff --git a/src/cloudflare/types/zero_trust/dex/rule_delete_response.py b/src/cloudflare/types/zero_trust/dex/rule_delete_response.py new file mode 100644 index 00000000000..eda04e28a4f --- /dev/null +++ b/src/cloudflare/types/zero_trust/dex/rule_delete_response.py @@ -0,0 +1,8 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional +from typing_extensions import TypeAlias + +__all__ = ["RuleDeleteResponse"] + +RuleDeleteResponse: TypeAlias = Optional[bool] diff --git a/src/cloudflare/types/zero_trust/dex/rule_get_response.py b/src/cloudflare/types/zero_trust/dex/rule_get_response.py new file mode 100644 index 00000000000..e353ed85a78 --- /dev/null +++ b/src/cloudflare/types/zero_trust/dex/rule_get_response.py @@ -0,0 +1,54 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional +from typing_extensions import Literal + +from ...._models import BaseModel + +__all__ = ["RuleGetResponse", "TargetedTest", "TargetedTestData"] + + +class TargetedTestData(BaseModel): + """ + The configuration object which contains the details for the WARP client to conduct the test. + """ + + host: str + """The desired endpoint to test.""" + + kind: Literal["http", "traceroute"] + """The type of test.""" + + method: Optional[Literal["GET"]] = None + """The HTTP request method type.""" + + +class TargetedTest(BaseModel): + data: TargetedTestData + """ + The configuration object which contains the details for the WARP client to + conduct the test. + """ + + enabled: bool + + name: str + + test_id: str + + +class RuleGetResponse(BaseModel): + id: str + """API Resource UUID tag.""" + + created_at: str + + match: str + + name: str + + description: Optional[str] = None + + targeted_tests: Optional[List[TargetedTest]] = None + + updated_at: Optional[str] = None diff --git a/src/cloudflare/types/zero_trust/dex/rule_list_params.py b/src/cloudflare/types/zero_trust/dex/rule_list_params.py new file mode 100644 index 00000000000..f7a59482cd0 --- /dev/null +++ b/src/cloudflare/types/zero_trust/dex/rule_list_params.py @@ -0,0 +1,26 @@ +# 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__ = ["RuleListParams"] + + +class RuleListParams(TypedDict, total=False): + account_id: Required[str] + + page: Required[float] + """Page number of paginated results""" + + per_page: Required[float] + """Number of items per page""" + + name: str + """Filter results by rule name""" + + sort_by: Literal["name", "created_at", "updated_at"] + """Which property to sort results by""" + + sort_order: Literal["ASC", "DESC"] + """Sort direction for sort_by property""" diff --git a/src/cloudflare/types/zero_trust/dex/rule_list_response.py b/src/cloudflare/types/zero_trust/dex/rule_list_response.py new file mode 100644 index 00000000000..c9c6c7f54c3 --- /dev/null +++ b/src/cloudflare/types/zero_trust/dex/rule_list_response.py @@ -0,0 +1,58 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional +from typing_extensions import Literal + +from ...._models import BaseModel + +__all__ = ["RuleListResponse", "Rule", "RuleTargetedTest", "RuleTargetedTestData"] + + +class RuleTargetedTestData(BaseModel): + """ + The configuration object which contains the details for the WARP client to conduct the test. + """ + + host: str + """The desired endpoint to test.""" + + kind: Literal["http", "traceroute"] + """The type of test.""" + + method: Optional[Literal["GET"]] = None + """The HTTP request method type.""" + + +class RuleTargetedTest(BaseModel): + data: RuleTargetedTestData + """ + The configuration object which contains the details for the WARP client to + conduct the test. + """ + + enabled: bool + + name: str + + test_id: str + + +class Rule(BaseModel): + id: str + """API Resource UUID tag.""" + + created_at: str + + match: str + + name: str + + description: Optional[str] = None + + targeted_tests: Optional[List[RuleTargetedTest]] = None + + updated_at: Optional[str] = None + + +class RuleListResponse(BaseModel): + rules: Optional[List[Rule]] = None diff --git a/src/cloudflare/types/zero_trust/dex/rule_update_params.py b/src/cloudflare/types/zero_trust/dex/rule_update_params.py new file mode 100644 index 00000000000..4bafbd979b1 --- /dev/null +++ b/src/cloudflare/types/zero_trust/dex/rule_update_params.py @@ -0,0 +1,19 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +__all__ = ["RuleUpdateParams"] + + +class RuleUpdateParams(TypedDict, total=False): + account_id: Required[str] + + description: str + + match: str + """The wirefilter expression to match.""" + + name: str + """The name of the Rule.""" diff --git a/src/cloudflare/types/zero_trust/dex/rule_update_response.py b/src/cloudflare/types/zero_trust/dex/rule_update_response.py new file mode 100644 index 00000000000..530c76ff2ad --- /dev/null +++ b/src/cloudflare/types/zero_trust/dex/rule_update_response.py @@ -0,0 +1,54 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional +from typing_extensions import Literal + +from ...._models import BaseModel + +__all__ = ["RuleUpdateResponse", "TargetedTest", "TargetedTestData"] + + +class TargetedTestData(BaseModel): + """ + The configuration object which contains the details for the WARP client to conduct the test. + """ + + host: str + """The desired endpoint to test.""" + + kind: Literal["http", "traceroute"] + """The type of test.""" + + method: Optional[Literal["GET"]] = None + """The HTTP request method type.""" + + +class TargetedTest(BaseModel): + data: TargetedTestData + """ + The configuration object which contains the details for the WARP client to + conduct the test. + """ + + enabled: bool + + name: str + + test_id: str + + +class RuleUpdateResponse(BaseModel): + id: str + """API Resource UUID tag.""" + + created_at: str + + match: str + + name: str + + description: Optional[str] = None + + targeted_tests: Optional[List[TargetedTest]] = None + + updated_at: Optional[str] = None diff --git a/tests/api_resources/zero_trust/dex/test_rules.py b/tests/api_resources/zero_trust/dex/test_rules.py new file mode 100644 index 00000000000..c4f5cd1242d --- /dev/null +++ b/tests/api_resources/zero_trust/dex/test_rules.py @@ -0,0 +1,569 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +import os +from typing import Any, Optional, cast + +import pytest + +from cloudflare import Cloudflare, AsyncCloudflare +from tests.utils import assert_matches_type +from cloudflare.pagination import SyncV4PagePagination, AsyncV4PagePagination +from cloudflare.types.zero_trust.dex import ( + RuleGetResponse, + RuleListResponse, + RuleCreateResponse, + RuleDeleteResponse, + RuleUpdateResponse, +) + +base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") + + +class TestRules: + parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) + + @parametrize + def test_method_create(self, client: Cloudflare) -> None: + rule = client.zero_trust.dex.rules.create( + account_id="01a7362d577a6c3019a474fd6f485823", + match="match", + name="name", + ) + assert_matches_type(Optional[RuleCreateResponse], rule, path=["response"]) + + @parametrize + def test_method_create_with_all_params(self, client: Cloudflare) -> None: + rule = client.zero_trust.dex.rules.create( + account_id="01a7362d577a6c3019a474fd6f485823", + match="match", + name="name", + description="description", + ) + assert_matches_type(Optional[RuleCreateResponse], rule, path=["response"]) + + @parametrize + def test_raw_response_create(self, client: Cloudflare) -> None: + response = client.zero_trust.dex.rules.with_raw_response.create( + account_id="01a7362d577a6c3019a474fd6f485823", + match="match", + name="name", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + rule = response.parse() + assert_matches_type(Optional[RuleCreateResponse], rule, path=["response"]) + + @parametrize + def test_streaming_response_create(self, client: Cloudflare) -> None: + with client.zero_trust.dex.rules.with_streaming_response.create( + account_id="01a7362d577a6c3019a474fd6f485823", + match="match", + name="name", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + rule = response.parse() + assert_matches_type(Optional[RuleCreateResponse], rule, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_create(self, client: Cloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + client.zero_trust.dex.rules.with_raw_response.create( + account_id="", + match="match", + name="name", + ) + + @parametrize + def test_method_update(self, client: Cloudflare) -> None: + rule = client.zero_trust.dex.rules.update( + rule_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", + account_id="01a7362d577a6c3019a474fd6f485823", + ) + assert_matches_type(Optional[RuleUpdateResponse], rule, path=["response"]) + + @parametrize + def test_method_update_with_all_params(self, client: Cloudflare) -> None: + rule = client.zero_trust.dex.rules.update( + rule_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", + account_id="01a7362d577a6c3019a474fd6f485823", + description="description", + match="match", + name="name", + ) + assert_matches_type(Optional[RuleUpdateResponse], rule, path=["response"]) + + @parametrize + def test_raw_response_update(self, client: Cloudflare) -> None: + response = client.zero_trust.dex.rules.with_raw_response.update( + rule_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", + account_id="01a7362d577a6c3019a474fd6f485823", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + rule = response.parse() + assert_matches_type(Optional[RuleUpdateResponse], rule, path=["response"]) + + @parametrize + def test_streaming_response_update(self, client: Cloudflare) -> None: + with client.zero_trust.dex.rules.with_streaming_response.update( + rule_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", + account_id="01a7362d577a6c3019a474fd6f485823", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + rule = response.parse() + assert_matches_type(Optional[RuleUpdateResponse], rule, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_update(self, client: Cloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + client.zero_trust.dex.rules.with_raw_response.update( + rule_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", + account_id="", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `rule_id` but received ''"): + client.zero_trust.dex.rules.with_raw_response.update( + rule_id="", + account_id="01a7362d577a6c3019a474fd6f485823", + ) + + @parametrize + def test_method_list(self, client: Cloudflare) -> None: + rule = client.zero_trust.dex.rules.list( + account_id="01a7362d577a6c3019a474fd6f485823", + page=1, + per_page=1, + ) + assert_matches_type(SyncV4PagePagination[Optional[RuleListResponse]], rule, path=["response"]) + + @parametrize + def test_method_list_with_all_params(self, client: Cloudflare) -> None: + rule = client.zero_trust.dex.rules.list( + account_id="01a7362d577a6c3019a474fd6f485823", + page=1, + per_page=1, + name="name", + sort_by="name", + sort_order="ASC", + ) + assert_matches_type(SyncV4PagePagination[Optional[RuleListResponse]], rule, path=["response"]) + + @parametrize + def test_raw_response_list(self, client: Cloudflare) -> None: + response = client.zero_trust.dex.rules.with_raw_response.list( + account_id="01a7362d577a6c3019a474fd6f485823", + page=1, + per_page=1, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + rule = response.parse() + assert_matches_type(SyncV4PagePagination[Optional[RuleListResponse]], rule, path=["response"]) + + @parametrize + def test_streaming_response_list(self, client: Cloudflare) -> None: + with client.zero_trust.dex.rules.with_streaming_response.list( + account_id="01a7362d577a6c3019a474fd6f485823", + page=1, + per_page=1, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + rule = response.parse() + assert_matches_type(SyncV4PagePagination[Optional[RuleListResponse]], rule, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_list(self, client: Cloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + client.zero_trust.dex.rules.with_raw_response.list( + account_id="", + page=1, + per_page=1, + ) + + @parametrize + def test_method_delete(self, client: Cloudflare) -> None: + rule = client.zero_trust.dex.rules.delete( + rule_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", + account_id="01a7362d577a6c3019a474fd6f485823", + ) + assert_matches_type(Optional[RuleDeleteResponse], rule, path=["response"]) + + @parametrize + def test_raw_response_delete(self, client: Cloudflare) -> None: + response = client.zero_trust.dex.rules.with_raw_response.delete( + rule_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", + account_id="01a7362d577a6c3019a474fd6f485823", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + rule = response.parse() + assert_matches_type(Optional[RuleDeleteResponse], rule, path=["response"]) + + @parametrize + def test_streaming_response_delete(self, client: Cloudflare) -> None: + with client.zero_trust.dex.rules.with_streaming_response.delete( + rule_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", + account_id="01a7362d577a6c3019a474fd6f485823", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + rule = response.parse() + assert_matches_type(Optional[RuleDeleteResponse], rule, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_delete(self, client: Cloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + client.zero_trust.dex.rules.with_raw_response.delete( + rule_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", + account_id="", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `rule_id` but received ''"): + client.zero_trust.dex.rules.with_raw_response.delete( + rule_id="", + account_id="01a7362d577a6c3019a474fd6f485823", + ) + + @parametrize + def test_method_get(self, client: Cloudflare) -> None: + rule = client.zero_trust.dex.rules.get( + rule_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", + account_id="01a7362d577a6c3019a474fd6f485823", + ) + assert_matches_type(Optional[RuleGetResponse], rule, path=["response"]) + + @parametrize + def test_raw_response_get(self, client: Cloudflare) -> None: + response = client.zero_trust.dex.rules.with_raw_response.get( + rule_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", + account_id="01a7362d577a6c3019a474fd6f485823", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + rule = response.parse() + assert_matches_type(Optional[RuleGetResponse], rule, path=["response"]) + + @parametrize + def test_streaming_response_get(self, client: Cloudflare) -> None: + with client.zero_trust.dex.rules.with_streaming_response.get( + rule_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", + account_id="01a7362d577a6c3019a474fd6f485823", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + rule = response.parse() + assert_matches_type(Optional[RuleGetResponse], rule, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_get(self, client: Cloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + client.zero_trust.dex.rules.with_raw_response.get( + rule_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", + account_id="", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `rule_id` but received ''"): + client.zero_trust.dex.rules.with_raw_response.get( + rule_id="", + account_id="01a7362d577a6c3019a474fd6f485823", + ) + + +class TestAsyncRules: + parametrize = pytest.mark.parametrize( + "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"] + ) + + @parametrize + async def test_method_create(self, async_client: AsyncCloudflare) -> None: + rule = await async_client.zero_trust.dex.rules.create( + account_id="01a7362d577a6c3019a474fd6f485823", + match="match", + name="name", + ) + assert_matches_type(Optional[RuleCreateResponse], rule, path=["response"]) + + @parametrize + async def test_method_create_with_all_params(self, async_client: AsyncCloudflare) -> None: + rule = await async_client.zero_trust.dex.rules.create( + account_id="01a7362d577a6c3019a474fd6f485823", + match="match", + name="name", + description="description", + ) + assert_matches_type(Optional[RuleCreateResponse], rule, path=["response"]) + + @parametrize + async def test_raw_response_create(self, async_client: AsyncCloudflare) -> None: + response = await async_client.zero_trust.dex.rules.with_raw_response.create( + account_id="01a7362d577a6c3019a474fd6f485823", + match="match", + name="name", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + rule = await response.parse() + assert_matches_type(Optional[RuleCreateResponse], rule, path=["response"]) + + @parametrize + async def test_streaming_response_create(self, async_client: AsyncCloudflare) -> None: + async with async_client.zero_trust.dex.rules.with_streaming_response.create( + account_id="01a7362d577a6c3019a474fd6f485823", + match="match", + name="name", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + rule = await response.parse() + assert_matches_type(Optional[RuleCreateResponse], rule, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_create(self, async_client: AsyncCloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + await async_client.zero_trust.dex.rules.with_raw_response.create( + account_id="", + match="match", + name="name", + ) + + @parametrize + async def test_method_update(self, async_client: AsyncCloudflare) -> None: + rule = await async_client.zero_trust.dex.rules.update( + rule_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", + account_id="01a7362d577a6c3019a474fd6f485823", + ) + assert_matches_type(Optional[RuleUpdateResponse], rule, path=["response"]) + + @parametrize + async def test_method_update_with_all_params(self, async_client: AsyncCloudflare) -> None: + rule = await async_client.zero_trust.dex.rules.update( + rule_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", + account_id="01a7362d577a6c3019a474fd6f485823", + description="description", + match="match", + name="name", + ) + assert_matches_type(Optional[RuleUpdateResponse], rule, path=["response"]) + + @parametrize + async def test_raw_response_update(self, async_client: AsyncCloudflare) -> None: + response = await async_client.zero_trust.dex.rules.with_raw_response.update( + rule_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", + account_id="01a7362d577a6c3019a474fd6f485823", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + rule = await response.parse() + assert_matches_type(Optional[RuleUpdateResponse], rule, path=["response"]) + + @parametrize + async def test_streaming_response_update(self, async_client: AsyncCloudflare) -> None: + async with async_client.zero_trust.dex.rules.with_streaming_response.update( + rule_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", + account_id="01a7362d577a6c3019a474fd6f485823", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + rule = await response.parse() + assert_matches_type(Optional[RuleUpdateResponse], rule, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_update(self, async_client: AsyncCloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + await async_client.zero_trust.dex.rules.with_raw_response.update( + rule_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", + account_id="", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `rule_id` but received ''"): + await async_client.zero_trust.dex.rules.with_raw_response.update( + rule_id="", + account_id="01a7362d577a6c3019a474fd6f485823", + ) + + @parametrize + async def test_method_list(self, async_client: AsyncCloudflare) -> None: + rule = await async_client.zero_trust.dex.rules.list( + account_id="01a7362d577a6c3019a474fd6f485823", + page=1, + per_page=1, + ) + assert_matches_type(AsyncV4PagePagination[Optional[RuleListResponse]], rule, path=["response"]) + + @parametrize + async def test_method_list_with_all_params(self, async_client: AsyncCloudflare) -> None: + rule = await async_client.zero_trust.dex.rules.list( + account_id="01a7362d577a6c3019a474fd6f485823", + page=1, + per_page=1, + name="name", + sort_by="name", + sort_order="ASC", + ) + assert_matches_type(AsyncV4PagePagination[Optional[RuleListResponse]], rule, path=["response"]) + + @parametrize + async def test_raw_response_list(self, async_client: AsyncCloudflare) -> None: + response = await async_client.zero_trust.dex.rules.with_raw_response.list( + account_id="01a7362d577a6c3019a474fd6f485823", + page=1, + per_page=1, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + rule = await response.parse() + assert_matches_type(AsyncV4PagePagination[Optional[RuleListResponse]], rule, path=["response"]) + + @parametrize + async def test_streaming_response_list(self, async_client: AsyncCloudflare) -> None: + async with async_client.zero_trust.dex.rules.with_streaming_response.list( + account_id="01a7362d577a6c3019a474fd6f485823", + page=1, + per_page=1, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + rule = await response.parse() + assert_matches_type(AsyncV4PagePagination[Optional[RuleListResponse]], rule, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_list(self, async_client: AsyncCloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + await async_client.zero_trust.dex.rules.with_raw_response.list( + account_id="", + page=1, + per_page=1, + ) + + @parametrize + async def test_method_delete(self, async_client: AsyncCloudflare) -> None: + rule = await async_client.zero_trust.dex.rules.delete( + rule_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", + account_id="01a7362d577a6c3019a474fd6f485823", + ) + assert_matches_type(Optional[RuleDeleteResponse], rule, path=["response"]) + + @parametrize + async def test_raw_response_delete(self, async_client: AsyncCloudflare) -> None: + response = await async_client.zero_trust.dex.rules.with_raw_response.delete( + rule_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", + account_id="01a7362d577a6c3019a474fd6f485823", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + rule = await response.parse() + assert_matches_type(Optional[RuleDeleteResponse], rule, path=["response"]) + + @parametrize + async def test_streaming_response_delete(self, async_client: AsyncCloudflare) -> None: + async with async_client.zero_trust.dex.rules.with_streaming_response.delete( + rule_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", + account_id="01a7362d577a6c3019a474fd6f485823", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + rule = await response.parse() + assert_matches_type(Optional[RuleDeleteResponse], rule, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_delete(self, async_client: AsyncCloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + await async_client.zero_trust.dex.rules.with_raw_response.delete( + rule_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", + account_id="", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `rule_id` but received ''"): + await async_client.zero_trust.dex.rules.with_raw_response.delete( + rule_id="", + account_id="01a7362d577a6c3019a474fd6f485823", + ) + + @parametrize + async def test_method_get(self, async_client: AsyncCloudflare) -> None: + rule = await async_client.zero_trust.dex.rules.get( + rule_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", + account_id="01a7362d577a6c3019a474fd6f485823", + ) + assert_matches_type(Optional[RuleGetResponse], rule, path=["response"]) + + @parametrize + async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: + response = await async_client.zero_trust.dex.rules.with_raw_response.get( + rule_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", + account_id="01a7362d577a6c3019a474fd6f485823", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + rule = await response.parse() + assert_matches_type(Optional[RuleGetResponse], rule, path=["response"]) + + @parametrize + async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> None: + async with async_client.zero_trust.dex.rules.with_streaming_response.get( + rule_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", + account_id="01a7362d577a6c3019a474fd6f485823", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + rule = await response.parse() + assert_matches_type(Optional[RuleGetResponse], rule, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_get(self, async_client: AsyncCloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + await async_client.zero_trust.dex.rules.with_raw_response.get( + rule_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", + account_id="", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `rule_id` but received ''"): + await async_client.zero_trust.dex.rules.with_raw_response.get( + rule_id="", + account_id="01a7362d577a6c3019a474fd6f485823", + ) From 146459da763b77bcd858d6550ed77e8477bc6e24 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 17 Feb 2026 19:39:17 +0000 Subject: [PATCH 013/279] chore(api): update composite API spec --- .stats.yml | 4 +- .../on_ramps/on_ramps.py | 14 ++--- .../resources/origin_ca_certificates.py | 20 +++++-- .../resources/zero_trust/dlp/payload_logs.py | 59 ++++++++++++++++++- .../on_ramp_create_params.py | 11 ++-- .../origin_ca_certificate.py | 10 +++- .../origin_ca_certificate_create_params.py | 10 +++- .../dlp/payload_log_get_response.py | 14 +++++ .../dlp/payload_log_update_params.py | 25 +++++++- .../dlp/payload_log_update_response.py | 14 +++++ .../test_origin_ca_certificates.py | 16 ++--- .../zero_trust/dlp/test_payload_logs.py | 2 + 12 files changed, 165 insertions(+), 34 deletions(-) diff --git a/.stats.yml b/.stats.yml index ad4c2446336..8f40463fd37 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 2020 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-2b935132316d46fe098e11238cf09f7861e29754870e6775c31d53108b357a35.yml -openapi_spec_hash: 3c786e10f8e2cea0b76e820dbd848eab +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-3bcd5973c2baae10ef49b19c7928b0a5c762f4a6e755f56c2d62c26b54083398.yml +openapi_spec_hash: df51921c4c4f3e4a9797751252db0538 config_hash: a4197f3e022bd501a828d1252b76e06e diff --git a/src/cloudflare/resources/magic_cloud_networking/on_ramps/on_ramps.py b/src/cloudflare/resources/magic_cloud_networking/on_ramps/on_ramps.py index 589e6689a8c..3e602ee1b06 100644 --- a/src/cloudflare/resources/magic_cloud_networking/on_ramps/on_ramps.py +++ b/src/cloudflare/resources/magic_cloud_networking/on_ramps/on_ramps.py @@ -112,11 +112,10 @@ def create( Create a new On-ramp (Closed Beta). Args: - dynamic_routing: if set to true, install_routes_in_cloud and install_routes_in_magic_wan should - be set to false + dynamic_routing: Enables BGP routing. When enabling this feature, set both + install_routes_in_cloud and install_routes_in_magic_wan to false. - cloud_asn: the ASN to use on the cloud side. If unset or zero, the cloud's default will be - used. + cloud_asn: Sets the cloud-side ASN. If unset or zero, the cloud's default ASN takes effect. extra_headers: Send extra headers @@ -608,11 +607,10 @@ async def create( Create a new On-ramp (Closed Beta). Args: - dynamic_routing: if set to true, install_routes_in_cloud and install_routes_in_magic_wan should - be set to false + dynamic_routing: Enables BGP routing. When enabling this feature, set both + install_routes_in_cloud and install_routes_in_magic_wan to false. - cloud_asn: the ASN to use on the cloud side. If unset or zero, the cloud's default will be - used. + cloud_asn: Sets the cloud-side ASN. If unset or zero, the cloud's default ASN takes effect. extra_headers: Send extra headers diff --git a/src/cloudflare/resources/origin_ca_certificates.py b/src/cloudflare/resources/origin_ca_certificates.py index 094ff74f3c7..1943091279a 100644 --- a/src/cloudflare/resources/origin_ca_certificates.py +++ b/src/cloudflare/resources/origin_ca_certificates.py @@ -71,8 +71,14 @@ def create( Args: csr: The Certificate Signing Request (CSR). Must be newline-encoded. - hostnames: Array of hostnames or wildcard names (e.g., \\**.example.com) bound to the - certificate. + hostnames: Array of hostnames or wildcard names bound to the certificate. Hostnames must be + fully qualified domain names (FQDNs) belonging to zones on your account (e.g., + `example.com` or `sub.example.com`). Wildcards are supported only as a `*.` + prefix for a single level (e.g., `*.example.com`). Double wildcards + (`*.*.example.com`) and interior wildcards (`foo.*.example.com`) are not + allowed. The wildcard suffix must be a multi-label domain (`*.example.com` is + valid, but `*.com` is not). Unicode/IDN hostnames are accepted and automatically + converted to punycode. request_type: Signature type desired on certificate ("origin-rsa" (rsa), "origin-ecc" (ecdsa), or "keyless-certificate" (for Keyless SSL servers). @@ -299,8 +305,14 @@ async def create( Args: csr: The Certificate Signing Request (CSR). Must be newline-encoded. - hostnames: Array of hostnames or wildcard names (e.g., \\**.example.com) bound to the - certificate. + hostnames: Array of hostnames or wildcard names bound to the certificate. Hostnames must be + fully qualified domain names (FQDNs) belonging to zones on your account (e.g., + `example.com` or `sub.example.com`). Wildcards are supported only as a `*.` + prefix for a single level (e.g., `*.example.com`). Double wildcards + (`*.*.example.com`) and interior wildcards (`foo.*.example.com`) are not + allowed. The wildcard suffix must be a multi-label domain (`*.example.com` is + valid, but `*.com` is not). Unicode/IDN hostnames are accepted and automatically + converted to punycode. request_type: Signature type desired on certificate ("origin-rsa" (rsa), "origin-ecc" (ecdsa), or "keyless-certificate" (for Keyless SSL servers). diff --git a/src/cloudflare/resources/zero_trust/dlp/payload_logs.py b/src/cloudflare/resources/zero_trust/dlp/payload_logs.py index 99dbbf7784c..ff0e10e81d4 100644 --- a/src/cloudflare/resources/zero_trust/dlp/payload_logs.py +++ b/src/cloudflare/resources/zero_trust/dlp/payload_logs.py @@ -3,6 +3,7 @@ from __future__ import annotations from typing import Type, Optional, cast +from typing_extensions import Literal import httpx @@ -49,6 +50,7 @@ def update( self, *, account_id: str, + masking_level: Literal["full", "partial", "clear", "default"] | Omit = omit, public_key: Optional[str] | 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. @@ -61,6 +63,27 @@ def update( Set payload log settings Args: + masking_level: Masking level for payload logs. + + - `full`: The entire payload is masked. + - `partial`: Only partial payload content is masked. + - `clear`: No masking is applied to the payload content. + - `default`: DLP uses its default masking behavior. + + public_key: Base64-encoded public key for encrypting payload logs. + + - Set to null or empty string to disable payload logging. + - Set to a non-empty base64 string to enable payload logging with the given key. + + For customers with configurable payload masking feature rolled out: + + - If the field is missing, the existing setting will be kept. Note that this is + different from setting to null or empty string. + + For all other customers: + + - If the field is missing, the existing setting will be cleared. + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -73,7 +96,13 @@ def update( raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._put( f"/accounts/{account_id}/dlp/payload_log", - body=maybe_transform({"public_key": public_key}, payload_log_update_params.PayloadLogUpdateParams), + body=maybe_transform( + { + "masking_level": masking_level, + "public_key": public_key, + }, + payload_log_update_params.PayloadLogUpdateParams, + ), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, @@ -146,6 +175,7 @@ async def update( self, *, account_id: str, + masking_level: Literal["full", "partial", "clear", "default"] | Omit = omit, public_key: Optional[str] | 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. @@ -158,6 +188,27 @@ async def update( Set payload log settings Args: + masking_level: Masking level for payload logs. + + - `full`: The entire payload is masked. + - `partial`: Only partial payload content is masked. + - `clear`: No masking is applied to the payload content. + - `default`: DLP uses its default masking behavior. + + public_key: Base64-encoded public key for encrypting payload logs. + + - Set to null or empty string to disable payload logging. + - Set to a non-empty base64 string to enable payload logging with the given key. + + For customers with configurable payload masking feature rolled out: + + - If the field is missing, the existing setting will be kept. Note that this is + different from setting to null or empty string. + + For all other customers: + + - If the field is missing, the existing setting will be cleared. + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -171,7 +222,11 @@ async def update( return await self._put( f"/accounts/{account_id}/dlp/payload_log", body=await async_maybe_transform( - {"public_key": public_key}, payload_log_update_params.PayloadLogUpdateParams + { + "masking_level": masking_level, + "public_key": public_key, + }, + payload_log_update_params.PayloadLogUpdateParams, ), options=make_request_options( extra_headers=extra_headers, diff --git a/src/cloudflare/types/magic_cloud_networking/on_ramp_create_params.py b/src/cloudflare/types/magic_cloud_networking/on_ramp_create_params.py index 7cf2f9b0df7..2893b07cfec 100644 --- a/src/cloudflare/types/magic_cloud_networking/on_ramp_create_params.py +++ b/src/cloudflare/types/magic_cloud_networking/on_ramp_create_params.py @@ -15,9 +15,10 @@ class OnRampCreateParams(TypedDict, total=False): cloud_type: Required[Literal["AWS", "AZURE", "GOOGLE"]] dynamic_routing: Required[bool] - """ - if set to true, install_routes_in_cloud and install_routes_in_magic_wan should - be set to false + """Enables BGP routing. + + When enabling this feature, set both install_routes_in_cloud and + install_routes_in_magic_wan to false. """ install_routes_in_cloud: Required[bool] @@ -35,9 +36,9 @@ class OnRampCreateParams(TypedDict, total=False): attached_vpcs: SequenceNotStr[str] cloud_asn: int - """the ASN to use on the cloud side. + """Sets the cloud-side ASN. - If unset or zero, the cloud's default will be used. + If unset or zero, the cloud's default ASN takes effect. """ description: str diff --git a/src/cloudflare/types/origin_ca_certificates/origin_ca_certificate.py b/src/cloudflare/types/origin_ca_certificates/origin_ca_certificate.py index 375c957ce50..788a05f9bbe 100644 --- a/src/cloudflare/types/origin_ca_certificates/origin_ca_certificate.py +++ b/src/cloudflare/types/origin_ca_certificates/origin_ca_certificate.py @@ -15,8 +15,14 @@ class OriginCACertificate(BaseModel): hostnames: List[str] """ - Array of hostnames or wildcard names (e.g., \\**.example.com) bound to the - certificate. + Array of hostnames or wildcard names bound to the certificate. Hostnames must be + fully qualified domain names (FQDNs) belonging to zones on your account (e.g., + `example.com` or `sub.example.com`). Wildcards are supported only as a `*.` + prefix for a single level (e.g., `*.example.com`). Double wildcards + (`*.*.example.com`) and interior wildcards (`foo.*.example.com`) are not + allowed. The wildcard suffix must be a multi-label domain (`*.example.com` is + valid, but `*.com` is not). Unicode/IDN hostnames are accepted and automatically + converted to punycode. """ request_type: CertificateRequestType diff --git a/src/cloudflare/types/origin_ca_certificates/origin_ca_certificate_create_params.py b/src/cloudflare/types/origin_ca_certificates/origin_ca_certificate_create_params.py index 47950cda0b6..7a7db0f40a6 100644 --- a/src/cloudflare/types/origin_ca_certificates/origin_ca_certificate_create_params.py +++ b/src/cloudflare/types/origin_ca_certificates/origin_ca_certificate_create_params.py @@ -17,8 +17,14 @@ class OriginCACertificateCreateParams(TypedDict, total=False): hostnames: Required[SequenceNotStr[str]] """ - Array of hostnames or wildcard names (e.g., \\**.example.com) bound to the - certificate. + Array of hostnames or wildcard names bound to the certificate. Hostnames must be + fully qualified domain names (FQDNs) belonging to zones on your account (e.g., + `example.com` or `sub.example.com`). Wildcards are supported only as a `*.` + prefix for a single level (e.g., `*.example.com`). Double wildcards + (`*.*.example.com`) and interior wildcards (`foo.*.example.com`) are not + allowed. The wildcard suffix must be a multi-label domain (`*.example.com` is + valid, but `*.com` is not). Unicode/IDN hostnames are accepted and automatically + converted to punycode. """ request_type: Required[CertificateRequestType] diff --git a/src/cloudflare/types/zero_trust/dlp/payload_log_get_response.py b/src/cloudflare/types/zero_trust/dlp/payload_log_get_response.py index 648ba73dcb7..14a5fe92d59 100644 --- a/src/cloudflare/types/zero_trust/dlp/payload_log_get_response.py +++ b/src/cloudflare/types/zero_trust/dlp/payload_log_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,6 +10,19 @@ class PayloadLogGetResponse(BaseModel): + masking_level: Literal["full", "partial", "clear", "default"] + """Masking level for payload logs. + + - `full`: The entire payload is masked. + - `partial`: Only partial payload content is masked. + - `clear`: No masking is applied to the payload content. + - `default`: DLP uses its default masking behavior. + """ + updated_at: datetime public_key: Optional[str] = None + """Base64-encoded public key for encrypting payload logs. + + Null when payload logging is disabled. + """ diff --git a/src/cloudflare/types/zero_trust/dlp/payload_log_update_params.py b/src/cloudflare/types/zero_trust/dlp/payload_log_update_params.py index 00ba11328ae..03c7029235e 100644 --- a/src/cloudflare/types/zero_trust/dlp/payload_log_update_params.py +++ b/src/cloudflare/types/zero_trust/dlp/payload_log_update_params.py @@ -3,7 +3,7 @@ from __future__ import annotations from typing import Optional -from typing_extensions import Required, TypedDict +from typing_extensions import Literal, Required, TypedDict __all__ = ["PayloadLogUpdateParams"] @@ -11,4 +11,27 @@ class PayloadLogUpdateParams(TypedDict, total=False): account_id: Required[str] + masking_level: Literal["full", "partial", "clear", "default"] + """Masking level for payload logs. + + - `full`: The entire payload is masked. + - `partial`: Only partial payload content is masked. + - `clear`: No masking is applied to the payload content. + - `default`: DLP uses its default masking behavior. + """ + public_key: Optional[str] + """Base64-encoded public key for encrypting payload logs. + + - Set to null or empty string to disable payload logging. + - Set to a non-empty base64 string to enable payload logging with the given key. + + For customers with configurable payload masking feature rolled out: + + - If the field is missing, the existing setting will be kept. Note that this is + different from setting to null or empty string. + + For all other customers: + + - If the field is missing, the existing setting will be cleared. + """ diff --git a/src/cloudflare/types/zero_trust/dlp/payload_log_update_response.py b/src/cloudflare/types/zero_trust/dlp/payload_log_update_response.py index 1a4e55436e3..20e305721e7 100644 --- a/src/cloudflare/types/zero_trust/dlp/payload_log_update_response.py +++ b/src/cloudflare/types/zero_trust/dlp/payload_log_update_response.py @@ -2,6 +2,7 @@ from typing import Optional from datetime import datetime +from typing_extensions import Literal from ...._models import BaseModel @@ -9,6 +10,19 @@ class PayloadLogUpdateResponse(BaseModel): + masking_level: Literal["full", "partial", "clear", "default"] + """Masking level for payload logs. + + - `full`: The entire payload is masked. + - `partial`: Only partial payload content is masked. + - `clear`: No masking is applied to the payload content. + - `default`: DLP uses its default masking behavior. + """ + updated_at: datetime public_key: Optional[str] = None + """Base64-encoded public key for encrypting payload logs. + + Null when payload logging is disabled. + """ diff --git a/tests/api_resources/test_origin_ca_certificates.py b/tests/api_resources/test_origin_ca_certificates.py index c882116fa32..2e391553fa6 100644 --- a/tests/api_resources/test_origin_ca_certificates.py +++ b/tests/api_resources/test_origin_ca_certificates.py @@ -26,7 +26,7 @@ class TestOriginCACertificates: def test_method_create(self, client: Cloudflare) -> None: origin_ca_certificate = client.origin_ca_certificates.create( csr="-----BEGIN CERTIFICATE REQUEST-----\nMIICxzCCAa8CAQAwSDELMAkGA1UEBhMCVVMxFjAUBgNVBAgTDVNhbiBGcmFuY2lz\nY28xCzAJBgNVBAcTAkNBMRQwEgYDVQQDEwtleGFtcGxlLm5ldDCCASIwDQYJKoZI\nhvcNAQEBBQADggEPADCCAQoCggEBALxejtu4b+jPdFeFi6OUsye8TYJQBm3WfCvL\nHu5EvijMO/4Z2TImwASbwUF7Ir8OLgH+mGlQZeqyNvGoSOMEaZVXcYfpR1hlVak8\n4GGVr+04IGfOCqaBokaBFIwzclGZbzKmLGwIQioNxGfqFm6RGYGA3be2Je2iseBc\nN8GV1wYmvYE0RR+yWweJCTJ157exyRzu7sVxaEW9F87zBQLyOnwXc64rflXslRqi\ng7F7w5IaQYOl8yvmk/jEPCAha7fkiUfEpj4N12+oPRiMvleJF98chxjD4MH39c5I\nuOslULhrWunfh7GB1jwWNA9y44H0snrf+xvoy2TcHmxvma9Eln8CAwEAAaA6MDgG\nCSqGSIb3DQEJDjErMCkwJwYDVR0RBCAwHoILZXhhbXBsZS5uZXSCD3d3dy5leGFt\ncGxlLm5ldDANBgkqhkiG9w0BAQsFAAOCAQEAcBaX6dOnI8ncARrI9ZSF2AJX+8mx\npTHY2+Y2C0VvrVDGMtbBRH8R9yMbqWtlxeeNGf//LeMkSKSFa4kbpdx226lfui8/\nauRDBTJGx2R1ccUxmLZXx4my0W5iIMxunu+kez+BDlu7bTT2io0uXMRHue4i6quH\nyc5ibxvbJMjR7dqbcanVE10/34oprzXQsJ/VmSuZNXtjbtSKDlmcpw6To/eeAJ+J\nhXykcUihvHyG4A1m2R6qpANBjnA0pHexfwM/SgfzvpbvUg0T1ubmer8BgTwCKIWs\ndcWYTthM51JIqRBfNqy4QcBnX+GY05yltEEswQI55wdiS3CjTTA67sdbcQ==\n-----END CERTIFICATE REQUEST-----", - hostnames=["example.com", "*.example.com"], + hostnames=["example.com", "*.example.com", "sub.example.com"], request_type="origin-rsa", ) assert_matches_type(Optional[OriginCACertificate], origin_ca_certificate, path=["response"]) @@ -36,7 +36,7 @@ def test_method_create(self, client: Cloudflare) -> None: def test_method_create_with_all_params(self, client: Cloudflare) -> None: origin_ca_certificate = client.origin_ca_certificates.create( csr="-----BEGIN CERTIFICATE REQUEST-----\nMIICxzCCAa8CAQAwSDELMAkGA1UEBhMCVVMxFjAUBgNVBAgTDVNhbiBGcmFuY2lz\nY28xCzAJBgNVBAcTAkNBMRQwEgYDVQQDEwtleGFtcGxlLm5ldDCCASIwDQYJKoZI\nhvcNAQEBBQADggEPADCCAQoCggEBALxejtu4b+jPdFeFi6OUsye8TYJQBm3WfCvL\nHu5EvijMO/4Z2TImwASbwUF7Ir8OLgH+mGlQZeqyNvGoSOMEaZVXcYfpR1hlVak8\n4GGVr+04IGfOCqaBokaBFIwzclGZbzKmLGwIQioNxGfqFm6RGYGA3be2Je2iseBc\nN8GV1wYmvYE0RR+yWweJCTJ157exyRzu7sVxaEW9F87zBQLyOnwXc64rflXslRqi\ng7F7w5IaQYOl8yvmk/jEPCAha7fkiUfEpj4N12+oPRiMvleJF98chxjD4MH39c5I\nuOslULhrWunfh7GB1jwWNA9y44H0snrf+xvoy2TcHmxvma9Eln8CAwEAAaA6MDgG\nCSqGSIb3DQEJDjErMCkwJwYDVR0RBCAwHoILZXhhbXBsZS5uZXSCD3d3dy5leGFt\ncGxlLm5ldDANBgkqhkiG9w0BAQsFAAOCAQEAcBaX6dOnI8ncARrI9ZSF2AJX+8mx\npTHY2+Y2C0VvrVDGMtbBRH8R9yMbqWtlxeeNGf//LeMkSKSFa4kbpdx226lfui8/\nauRDBTJGx2R1ccUxmLZXx4my0W5iIMxunu+kez+BDlu7bTT2io0uXMRHue4i6quH\nyc5ibxvbJMjR7dqbcanVE10/34oprzXQsJ/VmSuZNXtjbtSKDlmcpw6To/eeAJ+J\nhXykcUihvHyG4A1m2R6qpANBjnA0pHexfwM/SgfzvpbvUg0T1ubmer8BgTwCKIWs\ndcWYTthM51JIqRBfNqy4QcBnX+GY05yltEEswQI55wdiS3CjTTA67sdbcQ==\n-----END CERTIFICATE REQUEST-----", - hostnames=["example.com", "*.example.com"], + hostnames=["example.com", "*.example.com", "sub.example.com"], request_type="origin-rsa", requested_validity=5475, ) @@ -47,7 +47,7 @@ def test_method_create_with_all_params(self, client: Cloudflare) -> None: def test_raw_response_create(self, client: Cloudflare) -> None: response = client.origin_ca_certificates.with_raw_response.create( csr="-----BEGIN CERTIFICATE REQUEST-----\nMIICxzCCAa8CAQAwSDELMAkGA1UEBhMCVVMxFjAUBgNVBAgTDVNhbiBGcmFuY2lz\nY28xCzAJBgNVBAcTAkNBMRQwEgYDVQQDEwtleGFtcGxlLm5ldDCCASIwDQYJKoZI\nhvcNAQEBBQADggEPADCCAQoCggEBALxejtu4b+jPdFeFi6OUsye8TYJQBm3WfCvL\nHu5EvijMO/4Z2TImwASbwUF7Ir8OLgH+mGlQZeqyNvGoSOMEaZVXcYfpR1hlVak8\n4GGVr+04IGfOCqaBokaBFIwzclGZbzKmLGwIQioNxGfqFm6RGYGA3be2Je2iseBc\nN8GV1wYmvYE0RR+yWweJCTJ157exyRzu7sVxaEW9F87zBQLyOnwXc64rflXslRqi\ng7F7w5IaQYOl8yvmk/jEPCAha7fkiUfEpj4N12+oPRiMvleJF98chxjD4MH39c5I\nuOslULhrWunfh7GB1jwWNA9y44H0snrf+xvoy2TcHmxvma9Eln8CAwEAAaA6MDgG\nCSqGSIb3DQEJDjErMCkwJwYDVR0RBCAwHoILZXhhbXBsZS5uZXSCD3d3dy5leGFt\ncGxlLm5ldDANBgkqhkiG9w0BAQsFAAOCAQEAcBaX6dOnI8ncARrI9ZSF2AJX+8mx\npTHY2+Y2C0VvrVDGMtbBRH8R9yMbqWtlxeeNGf//LeMkSKSFa4kbpdx226lfui8/\nauRDBTJGx2R1ccUxmLZXx4my0W5iIMxunu+kez+BDlu7bTT2io0uXMRHue4i6quH\nyc5ibxvbJMjR7dqbcanVE10/34oprzXQsJ/VmSuZNXtjbtSKDlmcpw6To/eeAJ+J\nhXykcUihvHyG4A1m2R6qpANBjnA0pHexfwM/SgfzvpbvUg0T1ubmer8BgTwCKIWs\ndcWYTthM51JIqRBfNqy4QcBnX+GY05yltEEswQI55wdiS3CjTTA67sdbcQ==\n-----END CERTIFICATE REQUEST-----", - hostnames=["example.com", "*.example.com"], + hostnames=["example.com", "*.example.com", "sub.example.com"], request_type="origin-rsa", ) @@ -61,7 +61,7 @@ def test_raw_response_create(self, client: Cloudflare) -> None: def test_streaming_response_create(self, client: Cloudflare) -> None: with client.origin_ca_certificates.with_streaming_response.create( csr="-----BEGIN CERTIFICATE REQUEST-----\nMIICxzCCAa8CAQAwSDELMAkGA1UEBhMCVVMxFjAUBgNVBAgTDVNhbiBGcmFuY2lz\nY28xCzAJBgNVBAcTAkNBMRQwEgYDVQQDEwtleGFtcGxlLm5ldDCCASIwDQYJKoZI\nhvcNAQEBBQADggEPADCCAQoCggEBALxejtu4b+jPdFeFi6OUsye8TYJQBm3WfCvL\nHu5EvijMO/4Z2TImwASbwUF7Ir8OLgH+mGlQZeqyNvGoSOMEaZVXcYfpR1hlVak8\n4GGVr+04IGfOCqaBokaBFIwzclGZbzKmLGwIQioNxGfqFm6RGYGA3be2Je2iseBc\nN8GV1wYmvYE0RR+yWweJCTJ157exyRzu7sVxaEW9F87zBQLyOnwXc64rflXslRqi\ng7F7w5IaQYOl8yvmk/jEPCAha7fkiUfEpj4N12+oPRiMvleJF98chxjD4MH39c5I\nuOslULhrWunfh7GB1jwWNA9y44H0snrf+xvoy2TcHmxvma9Eln8CAwEAAaA6MDgG\nCSqGSIb3DQEJDjErMCkwJwYDVR0RBCAwHoILZXhhbXBsZS5uZXSCD3d3dy5leGFt\ncGxlLm5ldDANBgkqhkiG9w0BAQsFAAOCAQEAcBaX6dOnI8ncARrI9ZSF2AJX+8mx\npTHY2+Y2C0VvrVDGMtbBRH8R9yMbqWtlxeeNGf//LeMkSKSFa4kbpdx226lfui8/\nauRDBTJGx2R1ccUxmLZXx4my0W5iIMxunu+kez+BDlu7bTT2io0uXMRHue4i6quH\nyc5ibxvbJMjR7dqbcanVE10/34oprzXQsJ/VmSuZNXtjbtSKDlmcpw6To/eeAJ+J\nhXykcUihvHyG4A1m2R6qpANBjnA0pHexfwM/SgfzvpbvUg0T1ubmer8BgTwCKIWs\ndcWYTthM51JIqRBfNqy4QcBnX+GY05yltEEswQI55wdiS3CjTTA67sdbcQ==\n-----END CERTIFICATE REQUEST-----", - hostnames=["example.com", "*.example.com"], + hostnames=["example.com", "*.example.com", "sub.example.com"], request_type="origin-rsa", ) as response: assert not response.is_closed @@ -215,7 +215,7 @@ class TestAsyncOriginCACertificates: async def test_method_create(self, async_client: AsyncCloudflare) -> None: origin_ca_certificate = await async_client.origin_ca_certificates.create( csr="-----BEGIN CERTIFICATE REQUEST-----\nMIICxzCCAa8CAQAwSDELMAkGA1UEBhMCVVMxFjAUBgNVBAgTDVNhbiBGcmFuY2lz\nY28xCzAJBgNVBAcTAkNBMRQwEgYDVQQDEwtleGFtcGxlLm5ldDCCASIwDQYJKoZI\nhvcNAQEBBQADggEPADCCAQoCggEBALxejtu4b+jPdFeFi6OUsye8TYJQBm3WfCvL\nHu5EvijMO/4Z2TImwASbwUF7Ir8OLgH+mGlQZeqyNvGoSOMEaZVXcYfpR1hlVak8\n4GGVr+04IGfOCqaBokaBFIwzclGZbzKmLGwIQioNxGfqFm6RGYGA3be2Je2iseBc\nN8GV1wYmvYE0RR+yWweJCTJ157exyRzu7sVxaEW9F87zBQLyOnwXc64rflXslRqi\ng7F7w5IaQYOl8yvmk/jEPCAha7fkiUfEpj4N12+oPRiMvleJF98chxjD4MH39c5I\nuOslULhrWunfh7GB1jwWNA9y44H0snrf+xvoy2TcHmxvma9Eln8CAwEAAaA6MDgG\nCSqGSIb3DQEJDjErMCkwJwYDVR0RBCAwHoILZXhhbXBsZS5uZXSCD3d3dy5leGFt\ncGxlLm5ldDANBgkqhkiG9w0BAQsFAAOCAQEAcBaX6dOnI8ncARrI9ZSF2AJX+8mx\npTHY2+Y2C0VvrVDGMtbBRH8R9yMbqWtlxeeNGf//LeMkSKSFa4kbpdx226lfui8/\nauRDBTJGx2R1ccUxmLZXx4my0W5iIMxunu+kez+BDlu7bTT2io0uXMRHue4i6quH\nyc5ibxvbJMjR7dqbcanVE10/34oprzXQsJ/VmSuZNXtjbtSKDlmcpw6To/eeAJ+J\nhXykcUihvHyG4A1m2R6qpANBjnA0pHexfwM/SgfzvpbvUg0T1ubmer8BgTwCKIWs\ndcWYTthM51JIqRBfNqy4QcBnX+GY05yltEEswQI55wdiS3CjTTA67sdbcQ==\n-----END CERTIFICATE REQUEST-----", - hostnames=["example.com", "*.example.com"], + hostnames=["example.com", "*.example.com", "sub.example.com"], request_type="origin-rsa", ) assert_matches_type(Optional[OriginCACertificate], origin_ca_certificate, path=["response"]) @@ -225,7 +225,7 @@ async def test_method_create(self, async_client: AsyncCloudflare) -> None: async def test_method_create_with_all_params(self, async_client: AsyncCloudflare) -> None: origin_ca_certificate = await async_client.origin_ca_certificates.create( csr="-----BEGIN CERTIFICATE REQUEST-----\nMIICxzCCAa8CAQAwSDELMAkGA1UEBhMCVVMxFjAUBgNVBAgTDVNhbiBGcmFuY2lz\nY28xCzAJBgNVBAcTAkNBMRQwEgYDVQQDEwtleGFtcGxlLm5ldDCCASIwDQYJKoZI\nhvcNAQEBBQADggEPADCCAQoCggEBALxejtu4b+jPdFeFi6OUsye8TYJQBm3WfCvL\nHu5EvijMO/4Z2TImwASbwUF7Ir8OLgH+mGlQZeqyNvGoSOMEaZVXcYfpR1hlVak8\n4GGVr+04IGfOCqaBokaBFIwzclGZbzKmLGwIQioNxGfqFm6RGYGA3be2Je2iseBc\nN8GV1wYmvYE0RR+yWweJCTJ157exyRzu7sVxaEW9F87zBQLyOnwXc64rflXslRqi\ng7F7w5IaQYOl8yvmk/jEPCAha7fkiUfEpj4N12+oPRiMvleJF98chxjD4MH39c5I\nuOslULhrWunfh7GB1jwWNA9y44H0snrf+xvoy2TcHmxvma9Eln8CAwEAAaA6MDgG\nCSqGSIb3DQEJDjErMCkwJwYDVR0RBCAwHoILZXhhbXBsZS5uZXSCD3d3dy5leGFt\ncGxlLm5ldDANBgkqhkiG9w0BAQsFAAOCAQEAcBaX6dOnI8ncARrI9ZSF2AJX+8mx\npTHY2+Y2C0VvrVDGMtbBRH8R9yMbqWtlxeeNGf//LeMkSKSFa4kbpdx226lfui8/\nauRDBTJGx2R1ccUxmLZXx4my0W5iIMxunu+kez+BDlu7bTT2io0uXMRHue4i6quH\nyc5ibxvbJMjR7dqbcanVE10/34oprzXQsJ/VmSuZNXtjbtSKDlmcpw6To/eeAJ+J\nhXykcUihvHyG4A1m2R6qpANBjnA0pHexfwM/SgfzvpbvUg0T1ubmer8BgTwCKIWs\ndcWYTthM51JIqRBfNqy4QcBnX+GY05yltEEswQI55wdiS3CjTTA67sdbcQ==\n-----END CERTIFICATE REQUEST-----", - hostnames=["example.com", "*.example.com"], + hostnames=["example.com", "*.example.com", "sub.example.com"], request_type="origin-rsa", requested_validity=5475, ) @@ -236,7 +236,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncCloudflare async def test_raw_response_create(self, async_client: AsyncCloudflare) -> None: response = await async_client.origin_ca_certificates.with_raw_response.create( csr="-----BEGIN CERTIFICATE REQUEST-----\nMIICxzCCAa8CAQAwSDELMAkGA1UEBhMCVVMxFjAUBgNVBAgTDVNhbiBGcmFuY2lz\nY28xCzAJBgNVBAcTAkNBMRQwEgYDVQQDEwtleGFtcGxlLm5ldDCCASIwDQYJKoZI\nhvcNAQEBBQADggEPADCCAQoCggEBALxejtu4b+jPdFeFi6OUsye8TYJQBm3WfCvL\nHu5EvijMO/4Z2TImwASbwUF7Ir8OLgH+mGlQZeqyNvGoSOMEaZVXcYfpR1hlVak8\n4GGVr+04IGfOCqaBokaBFIwzclGZbzKmLGwIQioNxGfqFm6RGYGA3be2Je2iseBc\nN8GV1wYmvYE0RR+yWweJCTJ157exyRzu7sVxaEW9F87zBQLyOnwXc64rflXslRqi\ng7F7w5IaQYOl8yvmk/jEPCAha7fkiUfEpj4N12+oPRiMvleJF98chxjD4MH39c5I\nuOslULhrWunfh7GB1jwWNA9y44H0snrf+xvoy2TcHmxvma9Eln8CAwEAAaA6MDgG\nCSqGSIb3DQEJDjErMCkwJwYDVR0RBCAwHoILZXhhbXBsZS5uZXSCD3d3dy5leGFt\ncGxlLm5ldDANBgkqhkiG9w0BAQsFAAOCAQEAcBaX6dOnI8ncARrI9ZSF2AJX+8mx\npTHY2+Y2C0VvrVDGMtbBRH8R9yMbqWtlxeeNGf//LeMkSKSFa4kbpdx226lfui8/\nauRDBTJGx2R1ccUxmLZXx4my0W5iIMxunu+kez+BDlu7bTT2io0uXMRHue4i6quH\nyc5ibxvbJMjR7dqbcanVE10/34oprzXQsJ/VmSuZNXtjbtSKDlmcpw6To/eeAJ+J\nhXykcUihvHyG4A1m2R6qpANBjnA0pHexfwM/SgfzvpbvUg0T1ubmer8BgTwCKIWs\ndcWYTthM51JIqRBfNqy4QcBnX+GY05yltEEswQI55wdiS3CjTTA67sdbcQ==\n-----END CERTIFICATE REQUEST-----", - hostnames=["example.com", "*.example.com"], + hostnames=["example.com", "*.example.com", "sub.example.com"], request_type="origin-rsa", ) @@ -250,7 +250,7 @@ async def test_raw_response_create(self, async_client: AsyncCloudflare) -> None: async def test_streaming_response_create(self, async_client: AsyncCloudflare) -> None: async with async_client.origin_ca_certificates.with_streaming_response.create( csr="-----BEGIN CERTIFICATE REQUEST-----\nMIICxzCCAa8CAQAwSDELMAkGA1UEBhMCVVMxFjAUBgNVBAgTDVNhbiBGcmFuY2lz\nY28xCzAJBgNVBAcTAkNBMRQwEgYDVQQDEwtleGFtcGxlLm5ldDCCASIwDQYJKoZI\nhvcNAQEBBQADggEPADCCAQoCggEBALxejtu4b+jPdFeFi6OUsye8TYJQBm3WfCvL\nHu5EvijMO/4Z2TImwASbwUF7Ir8OLgH+mGlQZeqyNvGoSOMEaZVXcYfpR1hlVak8\n4GGVr+04IGfOCqaBokaBFIwzclGZbzKmLGwIQioNxGfqFm6RGYGA3be2Je2iseBc\nN8GV1wYmvYE0RR+yWweJCTJ157exyRzu7sVxaEW9F87zBQLyOnwXc64rflXslRqi\ng7F7w5IaQYOl8yvmk/jEPCAha7fkiUfEpj4N12+oPRiMvleJF98chxjD4MH39c5I\nuOslULhrWunfh7GB1jwWNA9y44H0snrf+xvoy2TcHmxvma9Eln8CAwEAAaA6MDgG\nCSqGSIb3DQEJDjErMCkwJwYDVR0RBCAwHoILZXhhbXBsZS5uZXSCD3d3dy5leGFt\ncGxlLm5ldDANBgkqhkiG9w0BAQsFAAOCAQEAcBaX6dOnI8ncARrI9ZSF2AJX+8mx\npTHY2+Y2C0VvrVDGMtbBRH8R9yMbqWtlxeeNGf//LeMkSKSFa4kbpdx226lfui8/\nauRDBTJGx2R1ccUxmLZXx4my0W5iIMxunu+kez+BDlu7bTT2io0uXMRHue4i6quH\nyc5ibxvbJMjR7dqbcanVE10/34oprzXQsJ/VmSuZNXtjbtSKDlmcpw6To/eeAJ+J\nhXykcUihvHyG4A1m2R6qpANBjnA0pHexfwM/SgfzvpbvUg0T1ubmer8BgTwCKIWs\ndcWYTthM51JIqRBfNqy4QcBnX+GY05yltEEswQI55wdiS3CjTTA67sdbcQ==\n-----END CERTIFICATE REQUEST-----", - hostnames=["example.com", "*.example.com"], + hostnames=["example.com", "*.example.com", "sub.example.com"], request_type="origin-rsa", ) as response: assert not response.is_closed diff --git a/tests/api_resources/zero_trust/dlp/test_payload_logs.py b/tests/api_resources/zero_trust/dlp/test_payload_logs.py index b868687bae1..a28ee8a4d18 100644 --- a/tests/api_resources/zero_trust/dlp/test_payload_logs.py +++ b/tests/api_resources/zero_trust/dlp/test_payload_logs.py @@ -28,6 +28,7 @@ def test_method_update(self, client: Cloudflare) -> None: def test_method_update_with_all_params(self, client: Cloudflare) -> None: payload_log = client.zero_trust.dlp.payload_logs.update( account_id="account_id", + masking_level="full", public_key="public_key", ) assert_matches_type(Optional[PayloadLogUpdateResponse], payload_log, path=["response"]) @@ -118,6 +119,7 @@ async def test_method_update(self, async_client: AsyncCloudflare) -> None: async def test_method_update_with_all_params(self, async_client: AsyncCloudflare) -> None: payload_log = await async_client.zero_trust.dlp.payload_logs.update( account_id="account_id", + masking_level="full", public_key="public_key", ) assert_matches_type(Optional[PayloadLogUpdateResponse], payload_log, path=["response"]) From 6e6f2f55b1da2f39b4578fa86840f8687f5d4581 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 18 Feb 2026 15:49:37 +0000 Subject: [PATCH 014/279] chore(api): update composite API spec --- .stats.yml | 4 ++-- .../resources/aisearch/instances/instances.py | 12 ++++++++++++ .../aisearch/instance_chat_completions_params.py | 2 ++ .../types/aisearch/instance_create_params.py | 2 ++ .../types/aisearch/instance_create_response.py | 2 ++ .../types/aisearch/instance_delete_response.py | 2 ++ .../types/aisearch/instance_list_response.py | 2 ++ .../types/aisearch/instance_read_response.py | 2 ++ .../types/aisearch/instance_search_params.py | 1 + .../types/aisearch/instance_update_params.py | 3 +++ .../types/aisearch/instance_update_response.py | 2 ++ 11 files changed, 32 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 8f40463fd37..31518e36a61 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 2020 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-3bcd5973c2baae10ef49b19c7928b0a5c762f4a6e755f56c2d62c26b54083398.yml -openapi_spec_hash: df51921c4c4f3e4a9797751252db0538 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-51500f48567b86c542c61d5151c38ea694d2dc9038229729ca2b2acffd2e3859.yml +openapi_spec_hash: 6b2dca17bd9676d08a7c0f79840b5d3f config_hash: a4197f3e022bd501a828d1252b76e06e diff --git a/src/cloudflare/resources/aisearch/instances/instances.py b/src/cloudflare/resources/aisearch/instances/instances.py index fff9397adad..fdf417e1338 100644 --- a/src/cloudflare/resources/aisearch/instances/instances.py +++ b/src/cloudflare/resources/aisearch/instances/instances.py @@ -100,6 +100,7 @@ def create( "@cf/qwen/qwen3-30b-a3b-fp8", "@cf/deepseek-ai/deepseek-r1-distill-qwen-32b", "@cf/moonshotai/kimi-k2-instruct", + "@cf/google/gemma-3-12b-it", "anthropic/claude-3-7-sonnet", "anthropic/claude-sonnet-4", "anthropic/claude-opus-4", @@ -151,6 +152,7 @@ def create( "@cf/qwen/qwen3-30b-a3b-fp8", "@cf/deepseek-ai/deepseek-r1-distill-qwen-32b", "@cf/moonshotai/kimi-k2-instruct", + "@cf/google/gemma-3-12b-it", "anthropic/claude-3-7-sonnet", "anthropic/claude-sonnet-4", "anthropic/claude-opus-4", @@ -252,6 +254,7 @@ def update( "@cf/qwen/qwen3-30b-a3b-fp8", "@cf/deepseek-ai/deepseek-r1-distill-qwen-32b", "@cf/moonshotai/kimi-k2-instruct", + "@cf/google/gemma-3-12b-it", "anthropic/claude-3-7-sonnet", "anthropic/claude-sonnet-4", "anthropic/claude-opus-4", @@ -307,6 +310,7 @@ def update( "@cf/qwen/qwen3-30b-a3b-fp8", "@cf/deepseek-ai/deepseek-r1-distill-qwen-32b", "@cf/moonshotai/kimi-k2-instruct", + "@cf/google/gemma-3-12b-it", "anthropic/claude-3-7-sonnet", "anthropic/claude-sonnet-4", "anthropic/claude-opus-4", @@ -341,6 +345,7 @@ def update( "@cf/qwen/qwen3-30b-a3b-fp8", "@cf/deepseek-ai/deepseek-r1-distill-qwen-32b", "@cf/moonshotai/kimi-k2-instruct", + "@cf/google/gemma-3-12b-it", "anthropic/claude-3-7-sonnet", "anthropic/claude-sonnet-4", "anthropic/claude-opus-4", @@ -542,6 +547,7 @@ def chat_completions( "@cf/qwen/qwen3-30b-a3b-fp8", "@cf/deepseek-ai/deepseek-r1-distill-qwen-32b", "@cf/moonshotai/kimi-k2-instruct", + "@cf/google/gemma-3-12b-it", "anthropic/claude-3-7-sonnet", "anthropic/claude-sonnet-4", "anthropic/claude-opus-4", @@ -787,6 +793,7 @@ async def create( "@cf/qwen/qwen3-30b-a3b-fp8", "@cf/deepseek-ai/deepseek-r1-distill-qwen-32b", "@cf/moonshotai/kimi-k2-instruct", + "@cf/google/gemma-3-12b-it", "anthropic/claude-3-7-sonnet", "anthropic/claude-sonnet-4", "anthropic/claude-opus-4", @@ -838,6 +845,7 @@ async def create( "@cf/qwen/qwen3-30b-a3b-fp8", "@cf/deepseek-ai/deepseek-r1-distill-qwen-32b", "@cf/moonshotai/kimi-k2-instruct", + "@cf/google/gemma-3-12b-it", "anthropic/claude-3-7-sonnet", "anthropic/claude-sonnet-4", "anthropic/claude-opus-4", @@ -939,6 +947,7 @@ async def update( "@cf/qwen/qwen3-30b-a3b-fp8", "@cf/deepseek-ai/deepseek-r1-distill-qwen-32b", "@cf/moonshotai/kimi-k2-instruct", + "@cf/google/gemma-3-12b-it", "anthropic/claude-3-7-sonnet", "anthropic/claude-sonnet-4", "anthropic/claude-opus-4", @@ -994,6 +1003,7 @@ async def update( "@cf/qwen/qwen3-30b-a3b-fp8", "@cf/deepseek-ai/deepseek-r1-distill-qwen-32b", "@cf/moonshotai/kimi-k2-instruct", + "@cf/google/gemma-3-12b-it", "anthropic/claude-3-7-sonnet", "anthropic/claude-sonnet-4", "anthropic/claude-opus-4", @@ -1028,6 +1038,7 @@ async def update( "@cf/qwen/qwen3-30b-a3b-fp8", "@cf/deepseek-ai/deepseek-r1-distill-qwen-32b", "@cf/moonshotai/kimi-k2-instruct", + "@cf/google/gemma-3-12b-it", "anthropic/claude-3-7-sonnet", "anthropic/claude-sonnet-4", "anthropic/claude-opus-4", @@ -1229,6 +1240,7 @@ async def chat_completions( "@cf/qwen/qwen3-30b-a3b-fp8", "@cf/deepseek-ai/deepseek-r1-distill-qwen-32b", "@cf/moonshotai/kimi-k2-instruct", + "@cf/google/gemma-3-12b-it", "anthropic/claude-3-7-sonnet", "anthropic/claude-sonnet-4", "anthropic/claude-opus-4", diff --git a/src/cloudflare/types/aisearch/instance_chat_completions_params.py b/src/cloudflare/types/aisearch/instance_chat_completions_params.py index 4550e56d5d6..3c5ecfcf232 100644 --- a/src/cloudflare/types/aisearch/instance_chat_completions_params.py +++ b/src/cloudflare/types/aisearch/instance_chat_completions_params.py @@ -33,6 +33,7 @@ class InstanceChatCompletionsParams(TypedDict, total=False): "@cf/qwen/qwen3-30b-a3b-fp8", "@cf/deepseek-ai/deepseek-r1-distill-qwen-32b", "@cf/moonshotai/kimi-k2-instruct", + "@cf/google/gemma-3-12b-it", "anthropic/claude-3-7-sonnet", "anthropic/claude-sonnet-4", "anthropic/claude-opus-4", @@ -78,6 +79,7 @@ class AISearchOptionsQueryRewrite(TypedDict, total=False): "@cf/qwen/qwen3-30b-a3b-fp8", "@cf/deepseek-ai/deepseek-r1-distill-qwen-32b", "@cf/moonshotai/kimi-k2-instruct", + "@cf/google/gemma-3-12b-it", "anthropic/claude-3-7-sonnet", "anthropic/claude-sonnet-4", "anthropic/claude-opus-4", diff --git a/src/cloudflare/types/aisearch/instance_create_params.py b/src/cloudflare/types/aisearch/instance_create_params.py index 402a1a06404..d885426b5a1 100644 --- a/src/cloudflare/types/aisearch/instance_create_params.py +++ b/src/cloudflare/types/aisearch/instance_create_params.py @@ -47,6 +47,7 @@ class InstanceCreateParams(TypedDict, total=False): "@cf/qwen/qwen3-30b-a3b-fp8", "@cf/deepseek-ai/deepseek-r1-distill-qwen-32b", "@cf/moonshotai/kimi-k2-instruct", + "@cf/google/gemma-3-12b-it", "anthropic/claude-3-7-sonnet", "anthropic/claude-sonnet-4", "anthropic/claude-opus-4", @@ -110,6 +111,7 @@ class InstanceCreateParams(TypedDict, total=False): "@cf/qwen/qwen3-30b-a3b-fp8", "@cf/deepseek-ai/deepseek-r1-distill-qwen-32b", "@cf/moonshotai/kimi-k2-instruct", + "@cf/google/gemma-3-12b-it", "anthropic/claude-3-7-sonnet", "anthropic/claude-sonnet-4", "anthropic/claude-opus-4", diff --git a/src/cloudflare/types/aisearch/instance_create_response.py b/src/cloudflare/types/aisearch/instance_create_response.py index 372e0ef5690..f034bae01b1 100644 --- a/src/cloudflare/types/aisearch/instance_create_response.py +++ b/src/cloudflare/types/aisearch/instance_create_response.py @@ -155,6 +155,7 @@ class InstanceCreateResponse(BaseModel): "@cf/qwen/qwen3-30b-a3b-fp8", "@cf/deepseek-ai/deepseek-r1-distill-qwen-32b", "@cf/moonshotai/kimi-k2-instruct", + "@cf/google/gemma-3-12b-it", "anthropic/claude-3-7-sonnet", "anthropic/claude-sonnet-4", "anthropic/claude-opus-4", @@ -234,6 +235,7 @@ class InstanceCreateResponse(BaseModel): "@cf/qwen/qwen3-30b-a3b-fp8", "@cf/deepseek-ai/deepseek-r1-distill-qwen-32b", "@cf/moonshotai/kimi-k2-instruct", + "@cf/google/gemma-3-12b-it", "anthropic/claude-3-7-sonnet", "anthropic/claude-sonnet-4", "anthropic/claude-opus-4", diff --git a/src/cloudflare/types/aisearch/instance_delete_response.py b/src/cloudflare/types/aisearch/instance_delete_response.py index ddf8c3d4cee..b1aaeafe2a9 100644 --- a/src/cloudflare/types/aisearch/instance_delete_response.py +++ b/src/cloudflare/types/aisearch/instance_delete_response.py @@ -155,6 +155,7 @@ class InstanceDeleteResponse(BaseModel): "@cf/qwen/qwen3-30b-a3b-fp8", "@cf/deepseek-ai/deepseek-r1-distill-qwen-32b", "@cf/moonshotai/kimi-k2-instruct", + "@cf/google/gemma-3-12b-it", "anthropic/claude-3-7-sonnet", "anthropic/claude-sonnet-4", "anthropic/claude-opus-4", @@ -234,6 +235,7 @@ class InstanceDeleteResponse(BaseModel): "@cf/qwen/qwen3-30b-a3b-fp8", "@cf/deepseek-ai/deepseek-r1-distill-qwen-32b", "@cf/moonshotai/kimi-k2-instruct", + "@cf/google/gemma-3-12b-it", "anthropic/claude-3-7-sonnet", "anthropic/claude-sonnet-4", "anthropic/claude-opus-4", diff --git a/src/cloudflare/types/aisearch/instance_list_response.py b/src/cloudflare/types/aisearch/instance_list_response.py index cbbdfb48ea8..288ee7071c0 100644 --- a/src/cloudflare/types/aisearch/instance_list_response.py +++ b/src/cloudflare/types/aisearch/instance_list_response.py @@ -155,6 +155,7 @@ class InstanceListResponse(BaseModel): "@cf/qwen/qwen3-30b-a3b-fp8", "@cf/deepseek-ai/deepseek-r1-distill-qwen-32b", "@cf/moonshotai/kimi-k2-instruct", + "@cf/google/gemma-3-12b-it", "anthropic/claude-3-7-sonnet", "anthropic/claude-sonnet-4", "anthropic/claude-opus-4", @@ -234,6 +235,7 @@ class InstanceListResponse(BaseModel): "@cf/qwen/qwen3-30b-a3b-fp8", "@cf/deepseek-ai/deepseek-r1-distill-qwen-32b", "@cf/moonshotai/kimi-k2-instruct", + "@cf/google/gemma-3-12b-it", "anthropic/claude-3-7-sonnet", "anthropic/claude-sonnet-4", "anthropic/claude-opus-4", diff --git a/src/cloudflare/types/aisearch/instance_read_response.py b/src/cloudflare/types/aisearch/instance_read_response.py index 12fb2a45517..933929cb70f 100644 --- a/src/cloudflare/types/aisearch/instance_read_response.py +++ b/src/cloudflare/types/aisearch/instance_read_response.py @@ -155,6 +155,7 @@ class InstanceReadResponse(BaseModel): "@cf/qwen/qwen3-30b-a3b-fp8", "@cf/deepseek-ai/deepseek-r1-distill-qwen-32b", "@cf/moonshotai/kimi-k2-instruct", + "@cf/google/gemma-3-12b-it", "anthropic/claude-3-7-sonnet", "anthropic/claude-sonnet-4", "anthropic/claude-opus-4", @@ -234,6 +235,7 @@ class InstanceReadResponse(BaseModel): "@cf/qwen/qwen3-30b-a3b-fp8", "@cf/deepseek-ai/deepseek-r1-distill-qwen-32b", "@cf/moonshotai/kimi-k2-instruct", + "@cf/google/gemma-3-12b-it", "anthropic/claude-3-7-sonnet", "anthropic/claude-sonnet-4", "anthropic/claude-opus-4", diff --git a/src/cloudflare/types/aisearch/instance_search_params.py b/src/cloudflare/types/aisearch/instance_search_params.py index 84a4846b6ce..a69be51f3fa 100644 --- a/src/cloudflare/types/aisearch/instance_search_params.py +++ b/src/cloudflare/types/aisearch/instance_search_params.py @@ -46,6 +46,7 @@ class AISearchOptionsQueryRewrite(TypedDict, total=False): "@cf/qwen/qwen3-30b-a3b-fp8", "@cf/deepseek-ai/deepseek-r1-distill-qwen-32b", "@cf/moonshotai/kimi-k2-instruct", + "@cf/google/gemma-3-12b-it", "anthropic/claude-3-7-sonnet", "anthropic/claude-sonnet-4", "anthropic/claude-opus-4", diff --git a/src/cloudflare/types/aisearch/instance_update_params.py b/src/cloudflare/types/aisearch/instance_update_params.py index b10b978c266..ec4e29fe87a 100644 --- a/src/cloudflare/types/aisearch/instance_update_params.py +++ b/src/cloudflare/types/aisearch/instance_update_params.py @@ -40,6 +40,7 @@ class InstanceUpdateParams(TypedDict, total=False): "@cf/qwen/qwen3-30b-a3b-fp8", "@cf/deepseek-ai/deepseek-r1-distill-qwen-32b", "@cf/moonshotai/kimi-k2-instruct", + "@cf/google/gemma-3-12b-it", "anthropic/claude-3-7-sonnet", "anthropic/claude-sonnet-4", "anthropic/claude-opus-4", @@ -109,6 +110,7 @@ class InstanceUpdateParams(TypedDict, total=False): "@cf/qwen/qwen3-30b-a3b-fp8", "@cf/deepseek-ai/deepseek-r1-distill-qwen-32b", "@cf/moonshotai/kimi-k2-instruct", + "@cf/google/gemma-3-12b-it", "anthropic/claude-3-7-sonnet", "anthropic/claude-sonnet-4", "anthropic/claude-opus-4", @@ -147,6 +149,7 @@ class InstanceUpdateParams(TypedDict, total=False): "@cf/qwen/qwen3-30b-a3b-fp8", "@cf/deepseek-ai/deepseek-r1-distill-qwen-32b", "@cf/moonshotai/kimi-k2-instruct", + "@cf/google/gemma-3-12b-it", "anthropic/claude-3-7-sonnet", "anthropic/claude-sonnet-4", "anthropic/claude-opus-4", diff --git a/src/cloudflare/types/aisearch/instance_update_response.py b/src/cloudflare/types/aisearch/instance_update_response.py index 1e0492d4534..fb9c13ef51f 100644 --- a/src/cloudflare/types/aisearch/instance_update_response.py +++ b/src/cloudflare/types/aisearch/instance_update_response.py @@ -155,6 +155,7 @@ class InstanceUpdateResponse(BaseModel): "@cf/qwen/qwen3-30b-a3b-fp8", "@cf/deepseek-ai/deepseek-r1-distill-qwen-32b", "@cf/moonshotai/kimi-k2-instruct", + "@cf/google/gemma-3-12b-it", "anthropic/claude-3-7-sonnet", "anthropic/claude-sonnet-4", "anthropic/claude-opus-4", @@ -234,6 +235,7 @@ class InstanceUpdateResponse(BaseModel): "@cf/qwen/qwen3-30b-a3b-fp8", "@cf/deepseek-ai/deepseek-r1-distill-qwen-32b", "@cf/moonshotai/kimi-k2-instruct", + "@cf/google/gemma-3-12b-it", "anthropic/claude-3-7-sonnet", "anthropic/claude-sonnet-4", "anthropic/claude-opus-4", From 2b950cfd2456c31b7c85174f23605cb9e8a470c0 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 18 Feb 2026 17:16:36 +0000 Subject: [PATCH 015/279] chore(api): update composite API spec --- .stats.yml | 4 ++-- .../hostname_certificate_create_response.py | 3 --- .../hostname_certificate_delete_response.py | 3 --- .../hostname_certificate_get_response.py | 3 --- .../hostname_certificate_list_response.py | 3 --- 5 files changed, 2 insertions(+), 14 deletions(-) diff --git a/.stats.yml b/.stats.yml index 31518e36a61..6e08e1c1ac2 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 2020 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-51500f48567b86c542c61d5151c38ea694d2dc9038229729ca2b2acffd2e3859.yml -openapi_spec_hash: 6b2dca17bd9676d08a7c0f79840b5d3f +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-753dac367e8e594d62cf1f9f88cc3eadddb6e35ee44dd947fe7a3b3cb3ecde0f.yml +openapi_spec_hash: 2672935161d60ab3263a259699ace5a9 config_hash: a4197f3e022bd501a828d1252b76e06e diff --git a/src/cloudflare/types/origin_tls_client_auth/hostname_certificate_create_response.py b/src/cloudflare/types/origin_tls_client_auth/hostname_certificate_create_response.py index 05418a9ac38..744c6a1aca8 100644 --- a/src/cloudflare/types/origin_tls_client_auth/hostname_certificate_create_response.py +++ b/src/cloudflare/types/origin_tls_client_auth/hostname_certificate_create_response.py @@ -41,8 +41,5 @@ class HostnameCertificateCreateResponse(BaseModel): ] = None """Status of the certificate or the association.""" - updated_at: Optional[datetime] = None - """The time when the certificate was updated.""" - uploaded_on: Optional[datetime] = None """The time when the certificate was uploaded.""" diff --git a/src/cloudflare/types/origin_tls_client_auth/hostname_certificate_delete_response.py b/src/cloudflare/types/origin_tls_client_auth/hostname_certificate_delete_response.py index 73c14b1cc2f..ad892bfce77 100644 --- a/src/cloudflare/types/origin_tls_client_auth/hostname_certificate_delete_response.py +++ b/src/cloudflare/types/origin_tls_client_auth/hostname_certificate_delete_response.py @@ -41,8 +41,5 @@ class HostnameCertificateDeleteResponse(BaseModel): ] = None """Status of the certificate or the association.""" - updated_at: Optional[datetime] = None - """The time when the certificate was updated.""" - uploaded_on: Optional[datetime] = None """The time when the certificate was uploaded.""" diff --git a/src/cloudflare/types/origin_tls_client_auth/hostname_certificate_get_response.py b/src/cloudflare/types/origin_tls_client_auth/hostname_certificate_get_response.py index e7b14c895dd..4983b50f43c 100644 --- a/src/cloudflare/types/origin_tls_client_auth/hostname_certificate_get_response.py +++ b/src/cloudflare/types/origin_tls_client_auth/hostname_certificate_get_response.py @@ -41,8 +41,5 @@ class HostnameCertificateGetResponse(BaseModel): ] = None """Status of the certificate or the association.""" - updated_at: Optional[datetime] = None - """The time when the certificate was updated.""" - uploaded_on: Optional[datetime] = None """The time when the certificate was uploaded.""" diff --git a/src/cloudflare/types/origin_tls_client_auth/hostname_certificate_list_response.py b/src/cloudflare/types/origin_tls_client_auth/hostname_certificate_list_response.py index df4a76953d9..b3d937541ce 100644 --- a/src/cloudflare/types/origin_tls_client_auth/hostname_certificate_list_response.py +++ b/src/cloudflare/types/origin_tls_client_auth/hostname_certificate_list_response.py @@ -41,8 +41,5 @@ class HostnameCertificateListResponse(BaseModel): ] = None """Status of the certificate or the association.""" - updated_at: Optional[datetime] = None - """The time when the certificate was updated.""" - uploaded_on: Optional[datetime] = None """The time when the certificate was uploaded.""" From a0a00481356d678ec42a357483e3da472a16d86d Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 18 Feb 2026 19:39:31 +0000 Subject: [PATCH 016/279] chore(api): update composite API spec --- .stats.yml | 4 ++-- src/cloudflare/types/load_balancers/filter_options_param.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.stats.yml b/.stats.yml index 6e08e1c1ac2..854606d3de6 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 2020 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-753dac367e8e594d62cf1f9f88cc3eadddb6e35ee44dd947fe7a3b3cb3ecde0f.yml -openapi_spec_hash: 2672935161d60ab3263a259699ace5a9 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-a0c559a1a66abed919ab48f1250e6e27646b70fc620808ce1e758d930be17829.yml +openapi_spec_hash: 629af4f49ec06a0c74562b575c7c4f11 config_hash: a4197f3e022bd501a828d1252b76e06e diff --git a/src/cloudflare/types/load_balancers/filter_options_param.py b/src/cloudflare/types/load_balancers/filter_options_param.py index 0a694803283..ac4812ac493 100644 --- a/src/cloudflare/types/load_balancers/filter_options_param.py +++ b/src/cloudflare/types/load_balancers/filter_options_param.py @@ -14,7 +14,7 @@ class FilterOptionsParam(TypedDict, total=False): Use null to reset. """ - disable: bool + disable: Optional[bool] """If set true, disable notifications for this type of resource (pool or origin).""" healthy: Optional[bool] From 79a09b5304a8733b5eff39931f5f3b26d92d7cc9 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 18 Feb 2026 19:54:54 +0000 Subject: [PATCH 017/279] chore(api): update composite API spec --- .stats.yml | 4 ++-- .../resources/stream/live_inputs/live_inputs.py | 16 ++++++++++++++++ src/cloudflare/types/stream/live_input.py | 3 +++ .../types/stream/live_input_create_params.py | 3 +++ .../types/stream/live_input_list_response.py | 3 +++ .../types/stream/live_input_update_params.py | 3 +++ tests/api_resources/stream/test_live_inputs.py | 4 ++++ 7 files changed, 34 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 854606d3de6..3161d93b8df 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 2020 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-a0c559a1a66abed919ab48f1250e6e27646b70fc620808ce1e758d930be17829.yml -openapi_spec_hash: 629af4f49ec06a0c74562b575c7c4f11 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-0aa90536a3aa68340d37a3389461eed6b13c9f5561ca9ad8aa46d2ca4cbb1701.yml +openapi_spec_hash: 95c0ec155c861dacf17154c43cba13f8 config_hash: a4197f3e022bd501a828d1252b76e06e diff --git a/src/cloudflare/resources/stream/live_inputs/live_inputs.py b/src/cloudflare/resources/stream/live_inputs/live_inputs.py index 25a527c5b09..3badf065da5 100644 --- a/src/cloudflare/resources/stream/live_inputs/live_inputs.py +++ b/src/cloudflare/resources/stream/live_inputs/live_inputs.py @@ -63,6 +63,7 @@ def create( account_id: str, default_creator: str | Omit = omit, delete_recording_after_days: float | Omit = omit, + enabled: bool | Omit = omit, meta: object | Omit = omit, recording: live_input_create_params.Recording | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -87,6 +88,8 @@ def create( indicate no change, or include with a `null` value to remove an existing scheduled deletion. + enabled: Indicates whether the live input is enabled and can accept streams. + meta: A user modifiable key-value store used to reference other systems of record for managing live inputs. @@ -110,6 +113,7 @@ def create( { "default_creator": default_creator, "delete_recording_after_days": delete_recording_after_days, + "enabled": enabled, "meta": meta, "recording": recording, }, @@ -132,6 +136,7 @@ def update( account_id: str, default_creator: str | Omit = omit, delete_recording_after_days: float | Omit = omit, + enabled: bool | Omit = omit, meta: object | Omit = omit, recording: live_input_update_params.Recording | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -157,6 +162,8 @@ def update( indicate no change, or include with a `null` value to remove an existing scheduled deletion. + enabled: Indicates whether the live input is enabled and can accept streams. + meta: A user modifiable key-value store used to reference other systems of record for managing live inputs. @@ -184,6 +191,7 @@ def update( { "default_creator": default_creator, "delete_recording_after_days": delete_recording_after_days, + "enabled": enabled, "meta": meta, "recording": recording, }, @@ -366,6 +374,7 @@ async def create( account_id: str, default_creator: str | Omit = omit, delete_recording_after_days: float | Omit = omit, + enabled: bool | Omit = omit, meta: object | Omit = omit, recording: live_input_create_params.Recording | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -390,6 +399,8 @@ async def create( indicate no change, or include with a `null` value to remove an existing scheduled deletion. + enabled: Indicates whether the live input is enabled and can accept streams. + meta: A user modifiable key-value store used to reference other systems of record for managing live inputs. @@ -413,6 +424,7 @@ async def create( { "default_creator": default_creator, "delete_recording_after_days": delete_recording_after_days, + "enabled": enabled, "meta": meta, "recording": recording, }, @@ -435,6 +447,7 @@ async def update( account_id: str, default_creator: str | Omit = omit, delete_recording_after_days: float | Omit = omit, + enabled: bool | Omit = omit, meta: object | Omit = omit, recording: live_input_update_params.Recording | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -460,6 +473,8 @@ async def update( indicate no change, or include with a `null` value to remove an existing scheduled deletion. + enabled: Indicates whether the live input is enabled and can accept streams. + meta: A user modifiable key-value store used to reference other systems of record for managing live inputs. @@ -487,6 +502,7 @@ async def update( { "default_creator": default_creator, "delete_recording_after_days": delete_recording_after_days, + "enabled": enabled, "meta": meta, "recording": recording, }, diff --git a/src/cloudflare/types/stream/live_input.py b/src/cloudflare/types/stream/live_input.py index 34cac4b8421..22f2545e09d 100644 --- a/src/cloudflare/types/stream/live_input.py +++ b/src/cloudflare/types/stream/live_input.py @@ -128,6 +128,9 @@ class LiveInput(BaseModel): scheduled deletion. """ + enabled: Optional[bool] = None + """Indicates whether the live input is enabled and can accept streams.""" + meta: Optional[object] = None """ A user modifiable key-value store used to reference other systems of record for diff --git a/src/cloudflare/types/stream/live_input_create_params.py b/src/cloudflare/types/stream/live_input_create_params.py index 8605ec007cf..63f6f095320 100644 --- a/src/cloudflare/types/stream/live_input_create_params.py +++ b/src/cloudflare/types/stream/live_input_create_params.py @@ -26,6 +26,9 @@ class LiveInputCreateParams(TypedDict, total=False): scheduled deletion. """ + enabled: bool + """Indicates whether the live input is enabled and can accept streams.""" + meta: object """ A user modifiable key-value store used to reference other systems of record for diff --git a/src/cloudflare/types/stream/live_input_list_response.py b/src/cloudflare/types/stream/live_input_list_response.py index 89345d5d01a..8fc70105545 100644 --- a/src/cloudflare/types/stream/live_input_list_response.py +++ b/src/cloudflare/types/stream/live_input_list_response.py @@ -23,6 +23,9 @@ class LiveInput(BaseModel): scheduled deletion. """ + enabled: Optional[bool] = None + """Indicates whether the live input is enabled and can accept streams.""" + meta: Optional[object] = None """ A user modifiable key-value store used to reference other systems of record for diff --git a/src/cloudflare/types/stream/live_input_update_params.py b/src/cloudflare/types/stream/live_input_update_params.py index c75146f9fbb..248048df5af 100644 --- a/src/cloudflare/types/stream/live_input_update_params.py +++ b/src/cloudflare/types/stream/live_input_update_params.py @@ -26,6 +26,9 @@ class LiveInputUpdateParams(TypedDict, total=False): scheduled deletion. """ + enabled: bool + """Indicates whether the live input is enabled and can accept streams.""" + meta: object """ A user modifiable key-value store used to reference other systems of record for diff --git a/tests/api_resources/stream/test_live_inputs.py b/tests/api_resources/stream/test_live_inputs.py index 8c637eb3141..337baada0c7 100644 --- a/tests/api_resources/stream/test_live_inputs.py +++ b/tests/api_resources/stream/test_live_inputs.py @@ -33,6 +33,7 @@ def test_method_create_with_all_params(self, client: Cloudflare) -> None: account_id="023e105f4ecef8ad9ca31a8372d0c353", default_creator="defaultCreator", delete_recording_after_days=45, + enabled=True, meta={"name": "test stream 1"}, recording={ "allowed_origins": ["example.com"], @@ -90,6 +91,7 @@ def test_method_update_with_all_params(self, client: Cloudflare) -> None: account_id="023e105f4ecef8ad9ca31a8372d0c353", default_creator="defaultCreator", delete_recording_after_days=45, + enabled=True, meta={"name": "test stream 1"}, recording={ "allowed_origins": ["example.com"], @@ -302,6 +304,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncCloudflare account_id="023e105f4ecef8ad9ca31a8372d0c353", default_creator="defaultCreator", delete_recording_after_days=45, + enabled=True, meta={"name": "test stream 1"}, recording={ "allowed_origins": ["example.com"], @@ -359,6 +362,7 @@ async def test_method_update_with_all_params(self, async_client: AsyncCloudflare account_id="023e105f4ecef8ad9ca31a8372d0c353", default_creator="defaultCreator", delete_recording_after_days=45, + enabled=True, meta={"name": "test stream 1"}, recording={ "allowed_origins": ["example.com"], From 89ad3ecda80085641644c675ebd4581d5688edf8 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 19 Feb 2026 15:12:53 +0000 Subject: [PATCH 018/279] feat: feat: GIN-1439: Add gateway PAC files * feat: GIN-1439: Add gateway PAC files * feat: GIN-1439: Add gateway PAC files --- .stats.yml | 4 +- api.md | 21 + .../resources/zero_trust/gateway/__init__.py | 14 + .../resources/zero_trust/gateway/gateway.py | 32 + .../resources/zero_trust/gateway/pacfiles.py | 614 ++++++++++++++++++ .../types/zero_trust/gateway/__init__.py | 6 + .../gateway/pacfile_create_params.py | 26 + .../gateway/pacfile_create_response.py | 31 + .../gateway/pacfile_get_response.py | 31 + .../gateway/pacfile_list_response.py | 28 + .../gateway/pacfile_update_params.py | 20 + .../gateway/pacfile_update_response.py | 31 + .../zero_trust/gateway/test_pacfiles.py | 538 +++++++++++++++ 13 files changed, 1394 insertions(+), 2 deletions(-) create mode 100644 src/cloudflare/resources/zero_trust/gateway/pacfiles.py create mode 100644 src/cloudflare/types/zero_trust/gateway/pacfile_create_params.py create mode 100644 src/cloudflare/types/zero_trust/gateway/pacfile_create_response.py create mode 100644 src/cloudflare/types/zero_trust/gateway/pacfile_get_response.py create mode 100644 src/cloudflare/types/zero_trust/gateway/pacfile_list_response.py create mode 100644 src/cloudflare/types/zero_trust/gateway/pacfile_update_params.py create mode 100644 src/cloudflare/types/zero_trust/gateway/pacfile_update_response.py create mode 100644 tests/api_resources/zero_trust/gateway/test_pacfiles.py diff --git a/.stats.yml b/.stats.yml index 3161d93b8df..b8a6c4e6f5c 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ -configured_endpoints: 2020 +configured_endpoints: 2025 openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-0aa90536a3aa68340d37a3389461eed6b13c9f5561ca9ad8aa46d2ca4cbb1701.yml openapi_spec_hash: 95c0ec155c861dacf17154c43cba13f8 -config_hash: a4197f3e022bd501a828d1252b76e06e +config_hash: 7a70007089f586cc7b1ebd1808030dd1 diff --git a/api.md b/api.md index f3360b82c77..e6d030e975e 100644 --- a/api.md +++ b/api.md @@ -7222,6 +7222,27 @@ Methods: - client.zero_trust.gateway.certificates.deactivate(certificate_id, \*, account_id, \*\*params) -> Optional[CertificateDeactivateResponse] - client.zero_trust.gateway.certificates.get(certificate_id, \*, account_id) -> Optional[CertificateGetResponse] +### Pacfiles + +Types: + +```python +from cloudflare.types.zero_trust.gateway import ( + PacfileCreateResponse, + PacfileUpdateResponse, + PacfileListResponse, + PacfileGetResponse, +) +``` + +Methods: + +- client.zero_trust.gateway.pacfiles.create(\*, account_id, \*\*params) -> Optional[PacfileCreateResponse] +- client.zero_trust.gateway.pacfiles.update(pacfile_id, \*, account_id, \*\*params) -> Optional[PacfileUpdateResponse] +- client.zero_trust.gateway.pacfiles.list(\*, account_id) -> SyncSinglePage[PacfileListResponse] +- client.zero_trust.gateway.pacfiles.delete(pacfile_id, \*, account_id) -> object +- client.zero_trust.gateway.pacfiles.get(pacfile_id, \*, account_id) -> Optional[PacfileGetResponse] + ## Networks ### Routes diff --git a/src/cloudflare/resources/zero_trust/gateway/__init__.py b/src/cloudflare/resources/zero_trust/gateway/__init__.py index dd71429636f..070241ac482 100644 --- a/src/cloudflare/resources/zero_trust/gateway/__init__.py +++ b/src/cloudflare/resources/zero_trust/gateway/__init__.py @@ -32,6 +32,14 @@ LoggingResourceWithStreamingResponse, AsyncLoggingResourceWithStreamingResponse, ) +from .pacfiles import ( + PacfilesResource, + AsyncPacfilesResource, + PacfilesResourceWithRawResponse, + AsyncPacfilesResourceWithRawResponse, + PacfilesResourceWithStreamingResponse, + AsyncPacfilesResourceWithStreamingResponse, +) from .app_types import ( AppTypesResource, AsyncAppTypesResource, @@ -150,6 +158,12 @@ "AsyncCertificatesResourceWithRawResponse", "CertificatesResourceWithStreamingResponse", "AsyncCertificatesResourceWithStreamingResponse", + "PacfilesResource", + "AsyncPacfilesResource", + "PacfilesResourceWithRawResponse", + "AsyncPacfilesResourceWithRawResponse", + "PacfilesResourceWithStreamingResponse", + "AsyncPacfilesResourceWithStreamingResponse", "GatewayResource", "AsyncGatewayResource", "GatewayResourceWithRawResponse", diff --git a/src/cloudflare/resources/zero_trust/gateway/gateway.py b/src/cloudflare/resources/zero_trust/gateway/gateway.py index c012dda9b45..e4badcc9720 100644 --- a/src/cloudflare/resources/zero_trust/gateway/gateway.py +++ b/src/cloudflare/resources/zero_trust/gateway/gateway.py @@ -22,6 +22,14 @@ LoggingResourceWithStreamingResponse, AsyncLoggingResourceWithStreamingResponse, ) +from .pacfiles import ( + PacfilesResource, + AsyncPacfilesResource, + PacfilesResourceWithRawResponse, + AsyncPacfilesResourceWithRawResponse, + PacfilesResourceWithStreamingResponse, + AsyncPacfilesResourceWithStreamingResponse, +) from ...._types import Body, Query, Headers, NotGiven, not_given from .app_types import ( AppTypesResource, @@ -144,6 +152,10 @@ def rules(self) -> RulesResource: def certificates(self) -> CertificatesResource: return CertificatesResource(self._client) + @cached_property + def pacfiles(self) -> PacfilesResource: + return PacfilesResource(self._client) + @cached_property def with_raw_response(self) -> GatewayResourceWithRawResponse: """ @@ -279,6 +291,10 @@ def rules(self) -> AsyncRulesResource: def certificates(self) -> AsyncCertificatesResource: return AsyncCertificatesResource(self._client) + @cached_property + def pacfiles(self) -> AsyncPacfilesResource: + return AsyncPacfilesResource(self._client) + @cached_property def with_raw_response(self) -> AsyncGatewayResourceWithRawResponse: """ @@ -424,6 +440,10 @@ def rules(self) -> RulesResourceWithRawResponse: def certificates(self) -> CertificatesResourceWithRawResponse: return CertificatesResourceWithRawResponse(self._gateway.certificates) + @cached_property + def pacfiles(self) -> PacfilesResourceWithRawResponse: + return PacfilesResourceWithRawResponse(self._gateway.pacfiles) + class AsyncGatewayResourceWithRawResponse: def __init__(self, gateway: AsyncGatewayResource) -> None: @@ -476,6 +496,10 @@ def rules(self) -> AsyncRulesResourceWithRawResponse: def certificates(self) -> AsyncCertificatesResourceWithRawResponse: return AsyncCertificatesResourceWithRawResponse(self._gateway.certificates) + @cached_property + def pacfiles(self) -> AsyncPacfilesResourceWithRawResponse: + return AsyncPacfilesResourceWithRawResponse(self._gateway.pacfiles) + class GatewayResourceWithStreamingResponse: def __init__(self, gateway: GatewayResource) -> None: @@ -528,6 +552,10 @@ def rules(self) -> RulesResourceWithStreamingResponse: def certificates(self) -> CertificatesResourceWithStreamingResponse: return CertificatesResourceWithStreamingResponse(self._gateway.certificates) + @cached_property + def pacfiles(self) -> PacfilesResourceWithStreamingResponse: + return PacfilesResourceWithStreamingResponse(self._gateway.pacfiles) + class AsyncGatewayResourceWithStreamingResponse: def __init__(self, gateway: AsyncGatewayResource) -> None: @@ -579,3 +607,7 @@ def rules(self) -> AsyncRulesResourceWithStreamingResponse: @cached_property def certificates(self) -> AsyncCertificatesResourceWithStreamingResponse: return AsyncCertificatesResourceWithStreamingResponse(self._gateway.certificates) + + @cached_property + def pacfiles(self) -> AsyncPacfilesResourceWithStreamingResponse: + return AsyncPacfilesResourceWithStreamingResponse(self._gateway.pacfiles) diff --git a/src/cloudflare/resources/zero_trust/gateway/pacfiles.py b/src/cloudflare/resources/zero_trust/gateway/pacfiles.py new file mode 100644 index 00000000000..e35cc351c4e --- /dev/null +++ b/src/cloudflare/resources/zero_trust/gateway/pacfiles.py @@ -0,0 +1,614 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Type, Optional, cast + +import httpx + +from ...._types import Body, Omit, Query, Headers, NotGiven, omit, not_given +from ...._utils import maybe_transform, async_maybe_transform +from ...._compat import cached_property +from ...._resource import SyncAPIResource, AsyncAPIResource +from ...._response import ( + to_raw_response_wrapper, + to_streamed_response_wrapper, + 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.zero_trust.gateway import pacfile_create_params, pacfile_update_params +from ....types.zero_trust.gateway.pacfile_get_response import PacfileGetResponse +from ....types.zero_trust.gateway.pacfile_list_response import PacfileListResponse +from ....types.zero_trust.gateway.pacfile_create_response import PacfileCreateResponse +from ....types.zero_trust.gateway.pacfile_update_response import PacfileUpdateResponse + +__all__ = ["PacfilesResource", "AsyncPacfilesResource"] + + +class PacfilesResource(SyncAPIResource): + @cached_property + def with_raw_response(self) -> PacfilesResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers + """ + return PacfilesResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> PacfilesResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/cloudflare/cloudflare-python#with_streaming_response + """ + return PacfilesResourceWithStreamingResponse(self) + + def create( + self, + *, + account_id: str, + contents: str, + name: str, + description: str | Omit = omit, + slug: str | 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, + ) -> Optional[PacfileCreateResponse]: + """ + Create a new Zero Trust Gateway PAC file. + + Args: + contents: Actual contents of the PAC file + + name: Name of the PAC file. + + description: Detailed description of the PAC file. + + slug: URL-friendly version of the PAC file name. If not provided, it will be + auto-generated + + 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._post( + f"/accounts/{account_id}/gateway/pacfiles", + body=maybe_transform( + { + "contents": contents, + "name": name, + "description": description, + "slug": slug, + }, + pacfile_create_params.PacfileCreateParams, + ), + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + post_parser=ResultWrapper[Optional[PacfileCreateResponse]]._unwrapper, + ), + cast_to=cast(Type[Optional[PacfileCreateResponse]], ResultWrapper[PacfileCreateResponse]), + ) + + def update( + self, + pacfile_id: str, + *, + account_id: str, + contents: str, + description: str, + name: 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[PacfileUpdateResponse]: + """ + Update a configured Zero Trust Gateway PAC file. + + Args: + contents: Actual contents of the PAC file + + description: Detailed description of the PAC file. + + name: Name of the PAC file. + + 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 pacfile_id: + raise ValueError(f"Expected a non-empty value for `pacfile_id` but received {pacfile_id!r}") + return self._put( + f"/accounts/{account_id}/gateway/pacfiles/{pacfile_id}", + body=maybe_transform( + { + "contents": contents, + "description": description, + "name": name, + }, + pacfile_update_params.PacfileUpdateParams, + ), + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + post_parser=ResultWrapper[Optional[PacfileUpdateResponse]]._unwrapper, + ), + cast_to=cast(Type[Optional[PacfileUpdateResponse]], ResultWrapper[PacfileUpdateResponse]), + ) + + def list( + 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[PacfileListResponse]: + """ + List all Zero Trust Gateway PAC files for an account. + + Args: + 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( + f"/accounts/{account_id}/gateway/pacfiles", + page=SyncSinglePage[PacfileListResponse], + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + model=PacfileListResponse, + ) + + def delete( + self, + pacfile_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, + ) -> object: + """ + Delete a configured Zero Trust Gateway PAC file. + + Args: + 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 pacfile_id: + raise ValueError(f"Expected a non-empty value for `pacfile_id` but received {pacfile_id!r}") + return self._delete( + f"/accounts/{account_id}/gateway/pacfiles/{pacfile_id}", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + post_parser=ResultWrapper[Optional[object]]._unwrapper, + ), + cast_to=cast(Type[object], ResultWrapper[object]), + ) + + def get( + self, + pacfile_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[PacfileGetResponse]: + """ + Get a single Zero Trust Gateway PAC file. + + Args: + 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 pacfile_id: + raise ValueError(f"Expected a non-empty value for `pacfile_id` but received {pacfile_id!r}") + return self._get( + f"/accounts/{account_id}/gateway/pacfiles/{pacfile_id}", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + post_parser=ResultWrapper[Optional[PacfileGetResponse]]._unwrapper, + ), + cast_to=cast(Type[Optional[PacfileGetResponse]], ResultWrapper[PacfileGetResponse]), + ) + + +class AsyncPacfilesResource(AsyncAPIResource): + @cached_property + def with_raw_response(self) -> AsyncPacfilesResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers + """ + return AsyncPacfilesResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> AsyncPacfilesResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/cloudflare/cloudflare-python#with_streaming_response + """ + return AsyncPacfilesResourceWithStreamingResponse(self) + + async def create( + self, + *, + account_id: str, + contents: str, + name: str, + description: str | Omit = omit, + slug: str | 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, + ) -> Optional[PacfileCreateResponse]: + """ + Create a new Zero Trust Gateway PAC file. + + Args: + contents: Actual contents of the PAC file + + name: Name of the PAC file. + + description: Detailed description of the PAC file. + + slug: URL-friendly version of the PAC file name. If not provided, it will be + auto-generated + + 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 await self._post( + f"/accounts/{account_id}/gateway/pacfiles", + body=await async_maybe_transform( + { + "contents": contents, + "name": name, + "description": description, + "slug": slug, + }, + pacfile_create_params.PacfileCreateParams, + ), + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + post_parser=ResultWrapper[Optional[PacfileCreateResponse]]._unwrapper, + ), + cast_to=cast(Type[Optional[PacfileCreateResponse]], ResultWrapper[PacfileCreateResponse]), + ) + + async def update( + self, + pacfile_id: str, + *, + account_id: str, + contents: str, + description: str, + name: 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[PacfileUpdateResponse]: + """ + Update a configured Zero Trust Gateway PAC file. + + Args: + contents: Actual contents of the PAC file + + description: Detailed description of the PAC file. + + name: Name of the PAC file. + + 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 pacfile_id: + raise ValueError(f"Expected a non-empty value for `pacfile_id` but received {pacfile_id!r}") + return await self._put( + f"/accounts/{account_id}/gateway/pacfiles/{pacfile_id}", + body=await async_maybe_transform( + { + "contents": contents, + "description": description, + "name": name, + }, + pacfile_update_params.PacfileUpdateParams, + ), + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + post_parser=ResultWrapper[Optional[PacfileUpdateResponse]]._unwrapper, + ), + cast_to=cast(Type[Optional[PacfileUpdateResponse]], ResultWrapper[PacfileUpdateResponse]), + ) + + def list( + 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[PacfileListResponse, AsyncSinglePage[PacfileListResponse]]: + """ + List all Zero Trust Gateway PAC files for an account. + + Args: + 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( + f"/accounts/{account_id}/gateway/pacfiles", + page=AsyncSinglePage[PacfileListResponse], + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + model=PacfileListResponse, + ) + + async def delete( + self, + pacfile_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, + ) -> object: + """ + Delete a configured Zero Trust Gateway PAC file. + + Args: + 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 pacfile_id: + raise ValueError(f"Expected a non-empty value for `pacfile_id` but received {pacfile_id!r}") + return await self._delete( + f"/accounts/{account_id}/gateway/pacfiles/{pacfile_id}", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + post_parser=ResultWrapper[Optional[object]]._unwrapper, + ), + cast_to=cast(Type[object], ResultWrapper[object]), + ) + + async def get( + self, + pacfile_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[PacfileGetResponse]: + """ + Get a single Zero Trust Gateway PAC file. + + Args: + 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 pacfile_id: + raise ValueError(f"Expected a non-empty value for `pacfile_id` but received {pacfile_id!r}") + return await self._get( + f"/accounts/{account_id}/gateway/pacfiles/{pacfile_id}", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + post_parser=ResultWrapper[Optional[PacfileGetResponse]]._unwrapper, + ), + cast_to=cast(Type[Optional[PacfileGetResponse]], ResultWrapper[PacfileGetResponse]), + ) + + +class PacfilesResourceWithRawResponse: + def __init__(self, pacfiles: PacfilesResource) -> None: + self._pacfiles = pacfiles + + self.create = to_raw_response_wrapper( + pacfiles.create, + ) + self.update = to_raw_response_wrapper( + pacfiles.update, + ) + self.list = to_raw_response_wrapper( + pacfiles.list, + ) + self.delete = to_raw_response_wrapper( + pacfiles.delete, + ) + self.get = to_raw_response_wrapper( + pacfiles.get, + ) + + +class AsyncPacfilesResourceWithRawResponse: + def __init__(self, pacfiles: AsyncPacfilesResource) -> None: + self._pacfiles = pacfiles + + self.create = async_to_raw_response_wrapper( + pacfiles.create, + ) + self.update = async_to_raw_response_wrapper( + pacfiles.update, + ) + self.list = async_to_raw_response_wrapper( + pacfiles.list, + ) + self.delete = async_to_raw_response_wrapper( + pacfiles.delete, + ) + self.get = async_to_raw_response_wrapper( + pacfiles.get, + ) + + +class PacfilesResourceWithStreamingResponse: + def __init__(self, pacfiles: PacfilesResource) -> None: + self._pacfiles = pacfiles + + self.create = to_streamed_response_wrapper( + pacfiles.create, + ) + self.update = to_streamed_response_wrapper( + pacfiles.update, + ) + self.list = to_streamed_response_wrapper( + pacfiles.list, + ) + self.delete = to_streamed_response_wrapper( + pacfiles.delete, + ) + self.get = to_streamed_response_wrapper( + pacfiles.get, + ) + + +class AsyncPacfilesResourceWithStreamingResponse: + def __init__(self, pacfiles: AsyncPacfilesResource) -> None: + self._pacfiles = pacfiles + + self.create = async_to_streamed_response_wrapper( + pacfiles.create, + ) + self.update = async_to_streamed_response_wrapper( + pacfiles.update, + ) + self.list = async_to_streamed_response_wrapper( + pacfiles.list, + ) + self.delete = async_to_streamed_response_wrapper( + pacfiles.delete, + ) + self.get = async_to_streamed_response_wrapper( + pacfiles.get, + ) diff --git a/src/cloudflare/types/zero_trust/gateway/__init__.py b/src/cloudflare/types/zero_trust/gateway/__init__.py index 17c93d1d9b4..f275cbda762 100644 --- a/src/cloudflare/types/zero_trust/gateway/__init__.py +++ b/src/cloudflare/types/zero_trust/gateway/__init__.py @@ -45,13 +45,19 @@ from .ipv4_endpoint_param import IPV4EndpointParam as IPV4EndpointParam from .ipv6_endpoint_param import IPV6EndpointParam as IPV6EndpointParam from .list_create_response import ListCreateResponse as ListCreateResponse +from .pacfile_get_response import PacfileGetResponse as PacfileGetResponse from .activity_log_settings import ActivityLogSettings as ActivityLogSettings from .logging_update_params import LoggingUpdateParams as LoggingUpdateParams from .notification_settings import NotificationSettings as NotificationSettings +from .pacfile_create_params import PacfileCreateParams as PacfileCreateParams +from .pacfile_list_response import PacfileListResponse as PacfileListResponse +from .pacfile_update_params import PacfileUpdateParams as PacfileUpdateParams from .body_scanning_settings import BodyScanningSettings as BodyScanningSettings from .location_create_params import LocationCreateParams as LocationCreateParams from .location_update_params import LocationUpdateParams as LocationUpdateParams from .extended_email_matching import ExtendedEmailMatching as ExtendedEmailMatching +from .pacfile_create_response import PacfileCreateResponse as PacfileCreateResponse +from .pacfile_update_response import PacfileUpdateResponse as PacfileUpdateResponse from .certificate_get_response import CertificateGetResponse as CertificateGetResponse from .dns_resolver_settings_v4 import DNSResolverSettingsV4 as DNSResolverSettingsV4 from .dns_resolver_settings_v6 import DNSResolverSettingsV6 as DNSResolverSettingsV6 diff --git a/src/cloudflare/types/zero_trust/gateway/pacfile_create_params.py b/src/cloudflare/types/zero_trust/gateway/pacfile_create_params.py new file mode 100644 index 00000000000..e37e43b96b1 --- /dev/null +++ b/src/cloudflare/types/zero_trust/gateway/pacfile_create_params.py @@ -0,0 +1,26 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +__all__ = ["PacfileCreateParams"] + + +class PacfileCreateParams(TypedDict, total=False): + account_id: Required[str] + + contents: Required[str] + """Actual contents of the PAC file""" + + name: Required[str] + """Name of the PAC file.""" + + description: str + """Detailed description of the PAC file.""" + + slug: str + """URL-friendly version of the PAC file name. + + If not provided, it will be auto-generated + """ diff --git a/src/cloudflare/types/zero_trust/gateway/pacfile_create_response.py b/src/cloudflare/types/zero_trust/gateway/pacfile_create_response.py new file mode 100644 index 00000000000..29cb1790a79 --- /dev/null +++ b/src/cloudflare/types/zero_trust/gateway/pacfile_create_response.py @@ -0,0 +1,31 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional +from datetime import datetime + +from ...._models import BaseModel + +__all__ = ["PacfileCreateResponse"] + + +class PacfileCreateResponse(BaseModel): + id: Optional[str] = None + + contents: Optional[str] = None + """Actual contents of the PAC file""" + + created_at: Optional[datetime] = None + + description: Optional[str] = None + """Detailed description of the PAC file.""" + + name: Optional[str] = None + """Name of the PAC file.""" + + slug: Optional[str] = None + """URL-friendly version of the PAC file name.""" + + updated_at: Optional[datetime] = None + + url: Optional[str] = None + """Unique URL to download the PAC file.""" diff --git a/src/cloudflare/types/zero_trust/gateway/pacfile_get_response.py b/src/cloudflare/types/zero_trust/gateway/pacfile_get_response.py new file mode 100644 index 00000000000..05d40ed6c8b --- /dev/null +++ b/src/cloudflare/types/zero_trust/gateway/pacfile_get_response.py @@ -0,0 +1,31 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional +from datetime import datetime + +from ...._models import BaseModel + +__all__ = ["PacfileGetResponse"] + + +class PacfileGetResponse(BaseModel): + id: Optional[str] = None + + contents: Optional[str] = None + """Actual contents of the PAC file""" + + created_at: Optional[datetime] = None + + description: Optional[str] = None + """Detailed description of the PAC file.""" + + name: Optional[str] = None + """Name of the PAC file.""" + + slug: Optional[str] = None + """URL-friendly version of the PAC file name.""" + + updated_at: Optional[datetime] = None + + url: Optional[str] = None + """Unique URL to download the PAC file.""" diff --git a/src/cloudflare/types/zero_trust/gateway/pacfile_list_response.py b/src/cloudflare/types/zero_trust/gateway/pacfile_list_response.py new file mode 100644 index 00000000000..c871d0dcee4 --- /dev/null +++ b/src/cloudflare/types/zero_trust/gateway/pacfile_list_response.py @@ -0,0 +1,28 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional +from datetime import datetime + +from ...._models import BaseModel + +__all__ = ["PacfileListResponse"] + + +class PacfileListResponse(BaseModel): + id: Optional[str] = None + + created_at: Optional[datetime] = None + + description: Optional[str] = None + """Detailed description of the PAC file.""" + + name: Optional[str] = None + """Name of the PAC file.""" + + slug: Optional[str] = None + """URL-friendly version of the PAC file name.""" + + updated_at: Optional[datetime] = None + + url: Optional[str] = None + """Unique URL to download the PAC file.""" diff --git a/src/cloudflare/types/zero_trust/gateway/pacfile_update_params.py b/src/cloudflare/types/zero_trust/gateway/pacfile_update_params.py new file mode 100644 index 00000000000..60f44fe4a85 --- /dev/null +++ b/src/cloudflare/types/zero_trust/gateway/pacfile_update_params.py @@ -0,0 +1,20 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +__all__ = ["PacfileUpdateParams"] + + +class PacfileUpdateParams(TypedDict, total=False): + account_id: Required[str] + + contents: Required[str] + """Actual contents of the PAC file""" + + description: Required[str] + """Detailed description of the PAC file.""" + + name: Required[str] + """Name of the PAC file.""" diff --git a/src/cloudflare/types/zero_trust/gateway/pacfile_update_response.py b/src/cloudflare/types/zero_trust/gateway/pacfile_update_response.py new file mode 100644 index 00000000000..f2ce8573aa9 --- /dev/null +++ b/src/cloudflare/types/zero_trust/gateway/pacfile_update_response.py @@ -0,0 +1,31 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional +from datetime import datetime + +from ...._models import BaseModel + +__all__ = ["PacfileUpdateResponse"] + + +class PacfileUpdateResponse(BaseModel): + id: Optional[str] = None + + contents: Optional[str] = None + """Actual contents of the PAC file""" + + created_at: Optional[datetime] = None + + description: Optional[str] = None + """Detailed description of the PAC file.""" + + name: Optional[str] = None + """Name of the PAC file.""" + + slug: Optional[str] = None + """URL-friendly version of the PAC file name.""" + + updated_at: Optional[datetime] = None + + url: Optional[str] = None + """Unique URL to download the PAC file.""" diff --git a/tests/api_resources/zero_trust/gateway/test_pacfiles.py b/tests/api_resources/zero_trust/gateway/test_pacfiles.py new file mode 100644 index 00000000000..a90f20fdca2 --- /dev/null +++ b/tests/api_resources/zero_trust/gateway/test_pacfiles.py @@ -0,0 +1,538 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +import os +from typing import Any, Optional, cast + +import pytest + +from cloudflare import Cloudflare, AsyncCloudflare +from tests.utils import assert_matches_type +from cloudflare.pagination import SyncSinglePage, AsyncSinglePage +from cloudflare.types.zero_trust.gateway import ( + PacfileGetResponse, + PacfileListResponse, + PacfileCreateResponse, + PacfileUpdateResponse, +) + +base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") + + +class TestPacfiles: + parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) + + @parametrize + def test_method_create(self, client: Cloudflare) -> None: + pacfile = client.zero_trust.gateway.pacfiles.create( + account_id="699d98642c564d2e855e9661899b7252", + contents='function FindProxyForURL(url, host) { return "DIRECT"; }', + name="Devops team", + ) + assert_matches_type(Optional[PacfileCreateResponse], pacfile, path=["response"]) + + @parametrize + def test_method_create_with_all_params(self, client: Cloudflare) -> None: + pacfile = client.zero_trust.gateway.pacfiles.create( + account_id="699d98642c564d2e855e9661899b7252", + contents='function FindProxyForURL(url, host) { return "DIRECT"; }', + name="Devops team", + description="PAC file for Devops team", + slug="pac_devops", + ) + assert_matches_type(Optional[PacfileCreateResponse], pacfile, path=["response"]) + + @parametrize + def test_raw_response_create(self, client: Cloudflare) -> None: + response = client.zero_trust.gateway.pacfiles.with_raw_response.create( + account_id="699d98642c564d2e855e9661899b7252", + contents='function FindProxyForURL(url, host) { return "DIRECT"; }', + name="Devops team", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + pacfile = response.parse() + assert_matches_type(Optional[PacfileCreateResponse], pacfile, path=["response"]) + + @parametrize + def test_streaming_response_create(self, client: Cloudflare) -> None: + with client.zero_trust.gateway.pacfiles.with_streaming_response.create( + account_id="699d98642c564d2e855e9661899b7252", + contents='function FindProxyForURL(url, host) { return "DIRECT"; }', + name="Devops team", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + pacfile = response.parse() + assert_matches_type(Optional[PacfileCreateResponse], pacfile, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_create(self, client: Cloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + client.zero_trust.gateway.pacfiles.with_raw_response.create( + account_id="", + contents='function FindProxyForURL(url, host) { return "DIRECT"; }', + name="Devops team", + ) + + @parametrize + def test_method_update(self, client: Cloudflare) -> None: + pacfile = client.zero_trust.gateway.pacfiles.update( + pacfile_id="ed35569b41ce4d1facfe683550f54086", + account_id="699d98642c564d2e855e9661899b7252", + contents='function FindProxyForURL(url, host) { return "DIRECT"; }', + description="PAC file for Devops team", + name="Devops team", + ) + assert_matches_type(Optional[PacfileUpdateResponse], pacfile, path=["response"]) + + @parametrize + def test_raw_response_update(self, client: Cloudflare) -> None: + response = client.zero_trust.gateway.pacfiles.with_raw_response.update( + pacfile_id="ed35569b41ce4d1facfe683550f54086", + account_id="699d98642c564d2e855e9661899b7252", + contents='function FindProxyForURL(url, host) { return "DIRECT"; }', + description="PAC file for Devops team", + name="Devops team", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + pacfile = response.parse() + assert_matches_type(Optional[PacfileUpdateResponse], pacfile, path=["response"]) + + @parametrize + def test_streaming_response_update(self, client: Cloudflare) -> None: + with client.zero_trust.gateway.pacfiles.with_streaming_response.update( + pacfile_id="ed35569b41ce4d1facfe683550f54086", + account_id="699d98642c564d2e855e9661899b7252", + contents='function FindProxyForURL(url, host) { return "DIRECT"; }', + description="PAC file for Devops team", + name="Devops team", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + pacfile = response.parse() + assert_matches_type(Optional[PacfileUpdateResponse], pacfile, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_update(self, client: Cloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + client.zero_trust.gateway.pacfiles.with_raw_response.update( + pacfile_id="ed35569b41ce4d1facfe683550f54086", + account_id="", + contents='function FindProxyForURL(url, host) { return "DIRECT"; }', + description="PAC file for Devops team", + name="Devops team", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `pacfile_id` but received ''"): + client.zero_trust.gateway.pacfiles.with_raw_response.update( + pacfile_id="", + account_id="699d98642c564d2e855e9661899b7252", + contents='function FindProxyForURL(url, host) { return "DIRECT"; }', + description="PAC file for Devops team", + name="Devops team", + ) + + @parametrize + def test_method_list(self, client: Cloudflare) -> None: + pacfile = client.zero_trust.gateway.pacfiles.list( + account_id="699d98642c564d2e855e9661899b7252", + ) + assert_matches_type(SyncSinglePage[PacfileListResponse], pacfile, path=["response"]) + + @parametrize + def test_raw_response_list(self, client: Cloudflare) -> None: + response = client.zero_trust.gateway.pacfiles.with_raw_response.list( + account_id="699d98642c564d2e855e9661899b7252", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + pacfile = response.parse() + assert_matches_type(SyncSinglePage[PacfileListResponse], pacfile, path=["response"]) + + @parametrize + def test_streaming_response_list(self, client: Cloudflare) -> None: + with client.zero_trust.gateway.pacfiles.with_streaming_response.list( + account_id="699d98642c564d2e855e9661899b7252", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + pacfile = response.parse() + assert_matches_type(SyncSinglePage[PacfileListResponse], pacfile, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_list(self, client: Cloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + client.zero_trust.gateway.pacfiles.with_raw_response.list( + account_id="", + ) + + @parametrize + def test_method_delete(self, client: Cloudflare) -> None: + pacfile = client.zero_trust.gateway.pacfiles.delete( + pacfile_id="ed35569b41ce4d1facfe683550f54086", + account_id="699d98642c564d2e855e9661899b7252", + ) + assert_matches_type(object, pacfile, path=["response"]) + + @parametrize + def test_raw_response_delete(self, client: Cloudflare) -> None: + response = client.zero_trust.gateway.pacfiles.with_raw_response.delete( + pacfile_id="ed35569b41ce4d1facfe683550f54086", + account_id="699d98642c564d2e855e9661899b7252", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + pacfile = response.parse() + assert_matches_type(object, pacfile, path=["response"]) + + @parametrize + def test_streaming_response_delete(self, client: Cloudflare) -> None: + with client.zero_trust.gateway.pacfiles.with_streaming_response.delete( + pacfile_id="ed35569b41ce4d1facfe683550f54086", + account_id="699d98642c564d2e855e9661899b7252", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + pacfile = response.parse() + assert_matches_type(object, pacfile, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_delete(self, client: Cloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + client.zero_trust.gateway.pacfiles.with_raw_response.delete( + pacfile_id="ed35569b41ce4d1facfe683550f54086", + account_id="", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `pacfile_id` but received ''"): + client.zero_trust.gateway.pacfiles.with_raw_response.delete( + pacfile_id="", + account_id="699d98642c564d2e855e9661899b7252", + ) + + @parametrize + def test_method_get(self, client: Cloudflare) -> None: + pacfile = client.zero_trust.gateway.pacfiles.get( + pacfile_id="ed35569b41ce4d1facfe683550f54086", + account_id="699d98642c564d2e855e9661899b7252", + ) + assert_matches_type(Optional[PacfileGetResponse], pacfile, path=["response"]) + + @parametrize + def test_raw_response_get(self, client: Cloudflare) -> None: + response = client.zero_trust.gateway.pacfiles.with_raw_response.get( + pacfile_id="ed35569b41ce4d1facfe683550f54086", + account_id="699d98642c564d2e855e9661899b7252", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + pacfile = response.parse() + assert_matches_type(Optional[PacfileGetResponse], pacfile, path=["response"]) + + @parametrize + def test_streaming_response_get(self, client: Cloudflare) -> None: + with client.zero_trust.gateway.pacfiles.with_streaming_response.get( + pacfile_id="ed35569b41ce4d1facfe683550f54086", + account_id="699d98642c564d2e855e9661899b7252", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + pacfile = response.parse() + assert_matches_type(Optional[PacfileGetResponse], pacfile, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_get(self, client: Cloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + client.zero_trust.gateway.pacfiles.with_raw_response.get( + pacfile_id="ed35569b41ce4d1facfe683550f54086", + account_id="", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `pacfile_id` but received ''"): + client.zero_trust.gateway.pacfiles.with_raw_response.get( + pacfile_id="", + account_id="699d98642c564d2e855e9661899b7252", + ) + + +class TestAsyncPacfiles: + parametrize = pytest.mark.parametrize( + "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"] + ) + + @parametrize + async def test_method_create(self, async_client: AsyncCloudflare) -> None: + pacfile = await async_client.zero_trust.gateway.pacfiles.create( + account_id="699d98642c564d2e855e9661899b7252", + contents='function FindProxyForURL(url, host) { return "DIRECT"; }', + name="Devops team", + ) + assert_matches_type(Optional[PacfileCreateResponse], pacfile, path=["response"]) + + @parametrize + async def test_method_create_with_all_params(self, async_client: AsyncCloudflare) -> None: + pacfile = await async_client.zero_trust.gateway.pacfiles.create( + account_id="699d98642c564d2e855e9661899b7252", + contents='function FindProxyForURL(url, host) { return "DIRECT"; }', + name="Devops team", + description="PAC file for Devops team", + slug="pac_devops", + ) + assert_matches_type(Optional[PacfileCreateResponse], pacfile, path=["response"]) + + @parametrize + async def test_raw_response_create(self, async_client: AsyncCloudflare) -> None: + response = await async_client.zero_trust.gateway.pacfiles.with_raw_response.create( + account_id="699d98642c564d2e855e9661899b7252", + contents='function FindProxyForURL(url, host) { return "DIRECT"; }', + name="Devops team", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + pacfile = await response.parse() + assert_matches_type(Optional[PacfileCreateResponse], pacfile, path=["response"]) + + @parametrize + async def test_streaming_response_create(self, async_client: AsyncCloudflare) -> None: + async with async_client.zero_trust.gateway.pacfiles.with_streaming_response.create( + account_id="699d98642c564d2e855e9661899b7252", + contents='function FindProxyForURL(url, host) { return "DIRECT"; }', + name="Devops team", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + pacfile = await response.parse() + assert_matches_type(Optional[PacfileCreateResponse], pacfile, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_create(self, async_client: AsyncCloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + await async_client.zero_trust.gateway.pacfiles.with_raw_response.create( + account_id="", + contents='function FindProxyForURL(url, host) { return "DIRECT"; }', + name="Devops team", + ) + + @parametrize + async def test_method_update(self, async_client: AsyncCloudflare) -> None: + pacfile = await async_client.zero_trust.gateway.pacfiles.update( + pacfile_id="ed35569b41ce4d1facfe683550f54086", + account_id="699d98642c564d2e855e9661899b7252", + contents='function FindProxyForURL(url, host) { return "DIRECT"; }', + description="PAC file for Devops team", + name="Devops team", + ) + assert_matches_type(Optional[PacfileUpdateResponse], pacfile, path=["response"]) + + @parametrize + async def test_raw_response_update(self, async_client: AsyncCloudflare) -> None: + response = await async_client.zero_trust.gateway.pacfiles.with_raw_response.update( + pacfile_id="ed35569b41ce4d1facfe683550f54086", + account_id="699d98642c564d2e855e9661899b7252", + contents='function FindProxyForURL(url, host) { return "DIRECT"; }', + description="PAC file for Devops team", + name="Devops team", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + pacfile = await response.parse() + assert_matches_type(Optional[PacfileUpdateResponse], pacfile, path=["response"]) + + @parametrize + async def test_streaming_response_update(self, async_client: AsyncCloudflare) -> None: + async with async_client.zero_trust.gateway.pacfiles.with_streaming_response.update( + pacfile_id="ed35569b41ce4d1facfe683550f54086", + account_id="699d98642c564d2e855e9661899b7252", + contents='function FindProxyForURL(url, host) { return "DIRECT"; }', + description="PAC file for Devops team", + name="Devops team", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + pacfile = await response.parse() + assert_matches_type(Optional[PacfileUpdateResponse], pacfile, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_update(self, async_client: AsyncCloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + await async_client.zero_trust.gateway.pacfiles.with_raw_response.update( + pacfile_id="ed35569b41ce4d1facfe683550f54086", + account_id="", + contents='function FindProxyForURL(url, host) { return "DIRECT"; }', + description="PAC file for Devops team", + name="Devops team", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `pacfile_id` but received ''"): + await async_client.zero_trust.gateway.pacfiles.with_raw_response.update( + pacfile_id="", + account_id="699d98642c564d2e855e9661899b7252", + contents='function FindProxyForURL(url, host) { return "DIRECT"; }', + description="PAC file for Devops team", + name="Devops team", + ) + + @parametrize + async def test_method_list(self, async_client: AsyncCloudflare) -> None: + pacfile = await async_client.zero_trust.gateway.pacfiles.list( + account_id="699d98642c564d2e855e9661899b7252", + ) + assert_matches_type(AsyncSinglePage[PacfileListResponse], pacfile, path=["response"]) + + @parametrize + async def test_raw_response_list(self, async_client: AsyncCloudflare) -> None: + response = await async_client.zero_trust.gateway.pacfiles.with_raw_response.list( + account_id="699d98642c564d2e855e9661899b7252", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + pacfile = await response.parse() + assert_matches_type(AsyncSinglePage[PacfileListResponse], pacfile, path=["response"]) + + @parametrize + async def test_streaming_response_list(self, async_client: AsyncCloudflare) -> None: + async with async_client.zero_trust.gateway.pacfiles.with_streaming_response.list( + account_id="699d98642c564d2e855e9661899b7252", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + pacfile = await response.parse() + assert_matches_type(AsyncSinglePage[PacfileListResponse], pacfile, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_list(self, async_client: AsyncCloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + await async_client.zero_trust.gateway.pacfiles.with_raw_response.list( + account_id="", + ) + + @parametrize + async def test_method_delete(self, async_client: AsyncCloudflare) -> None: + pacfile = await async_client.zero_trust.gateway.pacfiles.delete( + pacfile_id="ed35569b41ce4d1facfe683550f54086", + account_id="699d98642c564d2e855e9661899b7252", + ) + assert_matches_type(object, pacfile, path=["response"]) + + @parametrize + async def test_raw_response_delete(self, async_client: AsyncCloudflare) -> None: + response = await async_client.zero_trust.gateway.pacfiles.with_raw_response.delete( + pacfile_id="ed35569b41ce4d1facfe683550f54086", + account_id="699d98642c564d2e855e9661899b7252", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + pacfile = await response.parse() + assert_matches_type(object, pacfile, path=["response"]) + + @parametrize + async def test_streaming_response_delete(self, async_client: AsyncCloudflare) -> None: + async with async_client.zero_trust.gateway.pacfiles.with_streaming_response.delete( + pacfile_id="ed35569b41ce4d1facfe683550f54086", + account_id="699d98642c564d2e855e9661899b7252", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + pacfile = await response.parse() + assert_matches_type(object, pacfile, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_delete(self, async_client: AsyncCloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + await async_client.zero_trust.gateway.pacfiles.with_raw_response.delete( + pacfile_id="ed35569b41ce4d1facfe683550f54086", + account_id="", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `pacfile_id` but received ''"): + await async_client.zero_trust.gateway.pacfiles.with_raw_response.delete( + pacfile_id="", + account_id="699d98642c564d2e855e9661899b7252", + ) + + @parametrize + async def test_method_get(self, async_client: AsyncCloudflare) -> None: + pacfile = await async_client.zero_trust.gateway.pacfiles.get( + pacfile_id="ed35569b41ce4d1facfe683550f54086", + account_id="699d98642c564d2e855e9661899b7252", + ) + assert_matches_type(Optional[PacfileGetResponse], pacfile, path=["response"]) + + @parametrize + async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: + response = await async_client.zero_trust.gateway.pacfiles.with_raw_response.get( + pacfile_id="ed35569b41ce4d1facfe683550f54086", + account_id="699d98642c564d2e855e9661899b7252", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + pacfile = await response.parse() + assert_matches_type(Optional[PacfileGetResponse], pacfile, path=["response"]) + + @parametrize + async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> None: + async with async_client.zero_trust.gateway.pacfiles.with_streaming_response.get( + pacfile_id="ed35569b41ce4d1facfe683550f54086", + account_id="699d98642c564d2e855e9661899b7252", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + pacfile = await response.parse() + assert_matches_type(Optional[PacfileGetResponse], pacfile, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_get(self, async_client: AsyncCloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + await async_client.zero_trust.gateway.pacfiles.with_raw_response.get( + pacfile_id="ed35569b41ce4d1facfe683550f54086", + account_id="", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `pacfile_id` but received ''"): + await async_client.zero_trust.gateway.pacfiles.with_raw_response.get( + pacfile_id="", + account_id="699d98642c564d2e855e9661899b7252", + ) From b0eb476c790c319f7e2949d5f232bb726b3cd5bd Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 19 Feb 2026 16:43:05 +0000 Subject: [PATCH 019/279] chore(api): update composite API spec --- .stats.yml | 4 ++-- .../resources/aisearch/instances/instances.py | 16 ++++++++++++---- .../resources/page_shield/policies.py | 8 ++++---- .../instance_chat_completions_params.py | 2 ++ .../instance_chat_completions_response.py | 2 ++ .../types/aisearch/instance_create_params.py | 4 +++- .../types/aisearch/instance_create_response.py | 2 ++ .../types/aisearch/instance_delete_response.py | 2 ++ .../types/aisearch/instance_list_response.py | 2 ++ .../types/aisearch/instance_read_response.py | 2 ++ .../types/aisearch/instance_search_params.py | 2 ++ .../types/aisearch/instance_search_response.py | 2 ++ .../types/aisearch/instance_update_params.py | 4 +++- .../types/aisearch/instance_update_response.py | 2 ++ .../types/page_shield/policy_create_params.py | 2 +- .../types/page_shield/policy_create_response.py | 2 +- .../types/page_shield/policy_get_response.py | 2 +- .../types/page_shield/policy_list_response.py | 2 +- .../types/page_shield/policy_update_params.py | 2 +- .../types/page_shield/policy_update_response.py | 2 +- .../types/workers/script_update_params.py | 17 ++++++++++++++++- tests/api_resources/aisearch/test_instances.py | 8 ++++++++ tests/api_resources/workers/test_scripts.py | 8 ++++++++ 23 files changed, 80 insertions(+), 19 deletions(-) diff --git a/.stats.yml b/.stats.yml index b8a6c4e6f5c..2594d658123 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 2025 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-0aa90536a3aa68340d37a3389461eed6b13c9f5561ca9ad8aa46d2ca4cbb1701.yml -openapi_spec_hash: 95c0ec155c861dacf17154c43cba13f8 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-bbaa54a8cdf9c7f13d7322e3cbe42364b41ff8d08b5d616bab9dcfd1fbda5dc6.yml +openapi_spec_hash: 6a04699dd9c5ed4e5deb8e11b534968c config_hash: 7a70007089f586cc7b1ebd1808030dd1 diff --git a/src/cloudflare/resources/aisearch/instances/instances.py b/src/cloudflare/resources/aisearch/instances/instances.py index fdf417e1338..d4e0631289b 100644 --- a/src/cloudflare/resources/aisearch/instances/instances.py +++ b/src/cloudflare/resources/aisearch/instances/instances.py @@ -137,6 +137,7 @@ def create( "", ] | Omit = omit, + fusion_method: Literal["max", "rrf"] | Omit = omit, hybrid_search_enabled: bool | Omit = omit, max_num_results: int | Omit = omit, metadata: instance_create_params.Metadata | Omit = omit, @@ -176,7 +177,7 @@ def create( | Omit = omit, rewrite_query: bool | Omit = omit, score_threshold: float | Omit = omit, - source_params: instance_create_params.SourceParams | Omit = omit, + source_params: Optional[instance_create_params.SourceParams] | Omit = omit, token_id: str | 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. @@ -215,6 +216,7 @@ def create( "chunk_size": chunk_size, "custom_metadata": custom_metadata, "embedding_model": embedding_model, + "fusion_method": fusion_method, "hybrid_search_enabled": hybrid_search_enabled, "max_num_results": max_num_results, "metadata": metadata, @@ -294,6 +296,7 @@ def update( "", ] | Omit = omit, + fusion_method: Literal["max", "rrf"] | Omit = omit, hybrid_search_enabled: bool | Omit = omit, max_num_results: int | Omit = omit, metadata: instance_update_params.Metadata | Omit = omit, @@ -334,7 +337,7 @@ def update( | Omit = omit, rewrite_query: bool | Omit = omit, score_threshold: float | Omit = omit, - source_params: instance_update_params.SourceParams | Omit = omit, + source_params: Optional[instance_update_params.SourceParams] | Omit = omit, summarization: bool | Omit = omit, summarization_model: Literal[ "@cf/meta/llama-3.3-70b-instruct-fp8-fast", @@ -409,6 +412,7 @@ def update( "chunk_size": chunk_size, "custom_metadata": custom_metadata, "embedding_model": embedding_model, + "fusion_method": fusion_method, "hybrid_search_enabled": hybrid_search_enabled, "max_num_results": max_num_results, "metadata": metadata, @@ -830,6 +834,7 @@ async def create( "", ] | Omit = omit, + fusion_method: Literal["max", "rrf"] | Omit = omit, hybrid_search_enabled: bool | Omit = omit, max_num_results: int | Omit = omit, metadata: instance_create_params.Metadata | Omit = omit, @@ -869,7 +874,7 @@ async def create( | Omit = omit, rewrite_query: bool | Omit = omit, score_threshold: float | Omit = omit, - source_params: instance_create_params.SourceParams | Omit = omit, + source_params: Optional[instance_create_params.SourceParams] | Omit = omit, token_id: str | 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. @@ -908,6 +913,7 @@ async def create( "chunk_size": chunk_size, "custom_metadata": custom_metadata, "embedding_model": embedding_model, + "fusion_method": fusion_method, "hybrid_search_enabled": hybrid_search_enabled, "max_num_results": max_num_results, "metadata": metadata, @@ -987,6 +993,7 @@ async def update( "", ] | Omit = omit, + fusion_method: Literal["max", "rrf"] | Omit = omit, hybrid_search_enabled: bool | Omit = omit, max_num_results: int | Omit = omit, metadata: instance_update_params.Metadata | Omit = omit, @@ -1027,7 +1034,7 @@ async def update( | Omit = omit, rewrite_query: bool | Omit = omit, score_threshold: float | Omit = omit, - source_params: instance_update_params.SourceParams | Omit = omit, + source_params: Optional[instance_update_params.SourceParams] | Omit = omit, summarization: bool | Omit = omit, summarization_model: Literal[ "@cf/meta/llama-3.3-70b-instruct-fp8-fast", @@ -1102,6 +1109,7 @@ async def update( "chunk_size": chunk_size, "custom_metadata": custom_metadata, "embedding_model": embedding_model, + "fusion_method": fusion_method, "hybrid_search_enabled": hybrid_search_enabled, "max_num_results": max_num_results, "metadata": metadata, diff --git a/src/cloudflare/resources/page_shield/policies.py b/src/cloudflare/resources/page_shield/policies.py index debfeeb0a6b..c14c60eaae1 100644 --- a/src/cloudflare/resources/page_shield/policies.py +++ b/src/cloudflare/resources/page_shield/policies.py @@ -53,7 +53,7 @@ def create( self, *, zone_id: str, - action: Literal["allow", "log"], + action: Literal["allow", "log", "add_reporting_directives"], description: str, enabled: bool, expression: str, @@ -119,7 +119,7 @@ def update( policy_id: str, *, zone_id: str, - action: Literal["allow", "log"] | Omit = omit, + action: Literal["allow", "log", "add_reporting_directives"] | Omit = omit, description: str | Omit = omit, enabled: bool | Omit = omit, expression: str | Omit = omit, @@ -330,7 +330,7 @@ async def create( self, *, zone_id: str, - action: Literal["allow", "log"], + action: Literal["allow", "log", "add_reporting_directives"], description: str, enabled: bool, expression: str, @@ -396,7 +396,7 @@ async def update( policy_id: str, *, zone_id: str, - action: Literal["allow", "log"] | Omit = omit, + action: Literal["allow", "log", "add_reporting_directives"] | Omit = omit, description: str | Omit = omit, enabled: bool | Omit = omit, expression: str | Omit = omit, diff --git a/src/cloudflare/types/aisearch/instance_chat_completions_params.py b/src/cloudflare/types/aisearch/instance_chat_completions_params.py index 3c5ecfcf232..77b605c707b 100644 --- a/src/cloudflare/types/aisearch/instance_chat_completions_params.py +++ b/src/cloudflare/types/aisearch/instance_chat_completions_params.py @@ -117,6 +117,8 @@ class AISearchOptionsRetrieval(TypedDict, total=False): filters: Dict[str, object] + fusion_method: Literal["max", "rrf"] + match_threshold: float max_num_results: int diff --git a/src/cloudflare/types/aisearch/instance_chat_completions_response.py b/src/cloudflare/types/aisearch/instance_chat_completions_response.py index 6b8a7e4b614..76e503d1871 100644 --- a/src/cloudflare/types/aisearch/instance_chat_completions_response.py +++ b/src/cloudflare/types/aisearch/instance_chat_completions_response.py @@ -48,6 +48,8 @@ class ChunkScoringDetails(BaseModel): keyword_score: Optional[float] = None + reranking_score: Optional[float] = None + vector_rank: Optional[float] = None vector_score: Optional[float] = None diff --git a/src/cloudflare/types/aisearch/instance_create_params.py b/src/cloudflare/types/aisearch/instance_create_params.py index d885426b5a1..aca06fc17e3 100644 --- a/src/cloudflare/types/aisearch/instance_create_params.py +++ b/src/cloudflare/types/aisearch/instance_create_params.py @@ -90,6 +90,8 @@ class InstanceCreateParams(TypedDict, total=False): "", ] + fusion_method: Literal["max", "rrf"] + hybrid_search_enabled: bool max_num_results: int @@ -137,7 +139,7 @@ class InstanceCreateParams(TypedDict, total=False): score_threshold: float - source_params: SourceParams + source_params: Optional[SourceParams] token_id: str diff --git a/src/cloudflare/types/aisearch/instance_create_response.py b/src/cloudflare/types/aisearch/instance_create_response.py index f034bae01b1..d1b004bea04 100644 --- a/src/cloudflare/types/aisearch/instance_create_response.py +++ b/src/cloudflare/types/aisearch/instance_create_response.py @@ -205,6 +205,8 @@ class InstanceCreateResponse(BaseModel): enable: Optional[bool] = None + fusion_method: Optional[Literal["max", "rrf"]] = None + hybrid_search_enabled: Optional[bool] = None last_activity: Optional[datetime] = None diff --git a/src/cloudflare/types/aisearch/instance_delete_response.py b/src/cloudflare/types/aisearch/instance_delete_response.py index b1aaeafe2a9..74e64f5597f 100644 --- a/src/cloudflare/types/aisearch/instance_delete_response.py +++ b/src/cloudflare/types/aisearch/instance_delete_response.py @@ -205,6 +205,8 @@ class InstanceDeleteResponse(BaseModel): enable: Optional[bool] = None + fusion_method: Optional[Literal["max", "rrf"]] = None + hybrid_search_enabled: Optional[bool] = None last_activity: Optional[datetime] = None diff --git a/src/cloudflare/types/aisearch/instance_list_response.py b/src/cloudflare/types/aisearch/instance_list_response.py index 288ee7071c0..6ada27e5d12 100644 --- a/src/cloudflare/types/aisearch/instance_list_response.py +++ b/src/cloudflare/types/aisearch/instance_list_response.py @@ -205,6 +205,8 @@ class InstanceListResponse(BaseModel): enable: Optional[bool] = None + fusion_method: Optional[Literal["max", "rrf"]] = None + hybrid_search_enabled: Optional[bool] = None last_activity: Optional[datetime] = None diff --git a/src/cloudflare/types/aisearch/instance_read_response.py b/src/cloudflare/types/aisearch/instance_read_response.py index 933929cb70f..96061c431e3 100644 --- a/src/cloudflare/types/aisearch/instance_read_response.py +++ b/src/cloudflare/types/aisearch/instance_read_response.py @@ -205,6 +205,8 @@ class InstanceReadResponse(BaseModel): enable: Optional[bool] = None + fusion_method: Optional[Literal["max", "rrf"]] = None + hybrid_search_enabled: Optional[bool] = None last_activity: Optional[datetime] = None diff --git a/src/cloudflare/types/aisearch/instance_search_params.py b/src/cloudflare/types/aisearch/instance_search_params.py index a69be51f3fa..26fecab2e4a 100644 --- a/src/cloudflare/types/aisearch/instance_search_params.py +++ b/src/cloudflare/types/aisearch/instance_search_params.py @@ -84,6 +84,8 @@ class AISearchOptionsRetrieval(TypedDict, total=False): filters: Dict[str, object] + fusion_method: Literal["max", "rrf"] + match_threshold: float max_num_results: int diff --git a/src/cloudflare/types/aisearch/instance_search_response.py b/src/cloudflare/types/aisearch/instance_search_response.py index c55a1106067..cd404213edc 100644 --- a/src/cloudflare/types/aisearch/instance_search_response.py +++ b/src/cloudflare/types/aisearch/instance_search_response.py @@ -20,6 +20,8 @@ class ChunkScoringDetails(BaseModel): keyword_score: Optional[float] = None + reranking_score: Optional[float] = None + vector_rank: Optional[float] = None vector_score: Optional[float] = None diff --git a/src/cloudflare/types/aisearch/instance_update_params.py b/src/cloudflare/types/aisearch/instance_update_params.py index ec4e29fe87a..7241fc42bc7 100644 --- a/src/cloudflare/types/aisearch/instance_update_params.py +++ b/src/cloudflare/types/aisearch/instance_update_params.py @@ -87,6 +87,8 @@ class InstanceUpdateParams(TypedDict, total=False): "", ] + fusion_method: Literal["max", "rrf"] + hybrid_search_enabled: bool max_num_results: int @@ -136,7 +138,7 @@ class InstanceUpdateParams(TypedDict, total=False): score_threshold: float - source_params: SourceParams + source_params: Optional[SourceParams] summarization: bool diff --git a/src/cloudflare/types/aisearch/instance_update_response.py b/src/cloudflare/types/aisearch/instance_update_response.py index fb9c13ef51f..77d41a7ee23 100644 --- a/src/cloudflare/types/aisearch/instance_update_response.py +++ b/src/cloudflare/types/aisearch/instance_update_response.py @@ -205,6 +205,8 @@ class InstanceUpdateResponse(BaseModel): enable: Optional[bool] = None + fusion_method: Optional[Literal["max", "rrf"]] = None + hybrid_search_enabled: Optional[bool] = None last_activity: Optional[datetime] = None diff --git a/src/cloudflare/types/page_shield/policy_create_params.py b/src/cloudflare/types/page_shield/policy_create_params.py index 6578a38230b..9ff8c1bd62f 100644 --- a/src/cloudflare/types/page_shield/policy_create_params.py +++ b/src/cloudflare/types/page_shield/policy_create_params.py @@ -11,7 +11,7 @@ class PolicyCreateParams(TypedDict, total=False): zone_id: Required[str] """Identifier""" - action: Required[Literal["allow", "log"]] + action: Required[Literal["allow", "log", "add_reporting_directives"]] """The action to take if the expression matches""" description: Required[str] diff --git a/src/cloudflare/types/page_shield/policy_create_response.py b/src/cloudflare/types/page_shield/policy_create_response.py index 483d2835764..52e77d3e7b4 100644 --- a/src/cloudflare/types/page_shield/policy_create_response.py +++ b/src/cloudflare/types/page_shield/policy_create_response.py @@ -11,7 +11,7 @@ class PolicyCreateResponse(BaseModel): id: str """Identifier""" - action: Literal["allow", "log"] + action: Literal["allow", "log", "add_reporting_directives"] """The action to take if the expression matches""" description: str diff --git a/src/cloudflare/types/page_shield/policy_get_response.py b/src/cloudflare/types/page_shield/policy_get_response.py index 3b28c295122..67367c59fbe 100644 --- a/src/cloudflare/types/page_shield/policy_get_response.py +++ b/src/cloudflare/types/page_shield/policy_get_response.py @@ -11,7 +11,7 @@ class PolicyGetResponse(BaseModel): id: str """Identifier""" - action: Literal["allow", "log"] + action: Literal["allow", "log", "add_reporting_directives"] """The action to take if the expression matches""" description: str diff --git a/src/cloudflare/types/page_shield/policy_list_response.py b/src/cloudflare/types/page_shield/policy_list_response.py index 5ce2180de2f..93122c22cdc 100644 --- a/src/cloudflare/types/page_shield/policy_list_response.py +++ b/src/cloudflare/types/page_shield/policy_list_response.py @@ -11,7 +11,7 @@ class PolicyListResponse(BaseModel): id: str """Identifier""" - action: Literal["allow", "log"] + action: Literal["allow", "log", "add_reporting_directives"] """The action to take if the expression matches""" description: str diff --git a/src/cloudflare/types/page_shield/policy_update_params.py b/src/cloudflare/types/page_shield/policy_update_params.py index 547f43a7a05..c0e6e0f9a2c 100644 --- a/src/cloudflare/types/page_shield/policy_update_params.py +++ b/src/cloudflare/types/page_shield/policy_update_params.py @@ -11,7 +11,7 @@ class PolicyUpdateParams(TypedDict, total=False): zone_id: Required[str] """Identifier""" - action: Literal["allow", "log"] + action: Literal["allow", "log", "add_reporting_directives"] """The action to take if the expression matches""" description: str diff --git a/src/cloudflare/types/page_shield/policy_update_response.py b/src/cloudflare/types/page_shield/policy_update_response.py index dcc40a8c6cb..4faf782b054 100644 --- a/src/cloudflare/types/page_shield/policy_update_response.py +++ b/src/cloudflare/types/page_shield/policy_update_response.py @@ -11,7 +11,7 @@ class PolicyUpdateResponse(BaseModel): id: str """Identifier""" - action: Literal["allow", "log"] + action: Literal["allow", "log", "add_reporting_directives"] """The action to take if the expression matches""" description: str diff --git a/src/cloudflare/types/workers/script_update_params.py b/src/cloudflare/types/workers/script_update_params.py index fe9c2842279..68ac120a7a1 100644 --- a/src/cloudflare/types/workers/script_update_params.py +++ b/src/cloudflare/types/workers/script_update_params.py @@ -3,9 +3,10 @@ from __future__ import annotations from typing import List, Union, Iterable, Optional -from typing_extensions import Literal, Required, TypeAlias, TypedDict +from typing_extensions import Literal, Required, Annotated, TypeAlias, TypedDict from ..._types import FileTypes, SequenceNotStr +from ..._utils import PropertyInfo from .migration_step_param import MigrationStepParam from .single_step_migration_param import SingleStepMigrationParam from .scripts.consumer_script_param import ConsumerScriptParam @@ -13,6 +14,7 @@ __all__ = [ "ScriptUpdateParams", "Metadata", + "MetadataAnnotations", "MetadataAssets", "MetadataAssetsConfig", "MetadataBinding", @@ -89,6 +91,16 @@ class ScriptUpdateParams(TypedDict, total=False): """ +class MetadataAnnotations(TypedDict, total=False): + """Annotations for the version created by this upload.""" + + workers_message: Annotated[str, PropertyInfo(alias="workers/message")] + """Human-readable message about the version.""" + + workers_tag: Annotated[str, PropertyInfo(alias="workers/tag")] + """User-provided identifier for the version.""" + + class MetadataAssetsConfig(TypedDict, total=False): """Configuration for assets within a Worker.""" @@ -768,6 +780,9 @@ class MetadataPlacementUnionMember7(TypedDict, total=False): class Metadata(TypedDict, total=False): """JSON-encoded metadata about the uploaded parts and Worker configuration.""" + annotations: MetadataAnnotations + """Annotations for the version created by this upload.""" + assets: MetadataAssets """Configuration for assets within a Worker.""" diff --git a/tests/api_resources/aisearch/test_instances.py b/tests/api_resources/aisearch/test_instances.py index ab630764939..fa6c398b25a 100644 --- a/tests/api_resources/aisearch/test_instances.py +++ b/tests/api_resources/aisearch/test_instances.py @@ -56,6 +56,7 @@ def test_method_create_with_all_params(self, client: Cloudflare) -> None: } ], embedding_model="@cf/qwen/qwen3-embedding-0.6b", + fusion_method="max", hybrid_search_enabled=True, max_num_results=1, metadata={ @@ -176,6 +177,7 @@ def test_method_update_with_all_params(self, client: Cloudflare) -> None: } ], embedding_model="@cf/qwen/qwen3-embedding-0.6b", + fusion_method="max", hybrid_search_enabled=True, max_num_results=1, metadata={ @@ -410,6 +412,7 @@ def test_method_chat_completions_with_all_params(self, client: Cloudflare) -> No "retrieval": { "context_expansion": 0, "filters": {"foo": "bar"}, + "fusion_method": "max", "match_threshold": 0, "max_num_results": 1, "retrieval_type": "vector", @@ -572,6 +575,7 @@ def test_method_search_with_all_params(self, client: Cloudflare) -> None: "retrieval": { "context_expansion": 0, "filters": {"foo": "bar"}, + "fusion_method": "max", "match_threshold": 0, "max_num_results": 1, "retrieval_type": "vector", @@ -728,6 +732,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncCloudflare } ], embedding_model="@cf/qwen/qwen3-embedding-0.6b", + fusion_method="max", hybrid_search_enabled=True, max_num_results=1, metadata={ @@ -848,6 +853,7 @@ async def test_method_update_with_all_params(self, async_client: AsyncCloudflare } ], embedding_model="@cf/qwen/qwen3-embedding-0.6b", + fusion_method="max", hybrid_search_enabled=True, max_num_results=1, metadata={ @@ -1082,6 +1088,7 @@ async def test_method_chat_completions_with_all_params(self, async_client: Async "retrieval": { "context_expansion": 0, "filters": {"foo": "bar"}, + "fusion_method": "max", "match_threshold": 0, "max_num_results": 1, "retrieval_type": "vector", @@ -1244,6 +1251,7 @@ async def test_method_search_with_all_params(self, async_client: AsyncCloudflare "retrieval": { "context_expansion": 0, "filters": {"foo": "bar"}, + "fusion_method": "max", "match_threshold": 0, "max_num_results": 1, "retrieval_type": "vector", diff --git a/tests/api_resources/workers/test_scripts.py b/tests/api_resources/workers/test_scripts.py index 167c82bc966..918d9381e43 100644 --- a/tests/api_resources/workers/test_scripts.py +++ b/tests/api_resources/workers/test_scripts.py @@ -39,6 +39,10 @@ def test_method_update_with_all_params(self, client: Cloudflare) -> None: script_name="this-is_my_script-01", account_id="023e105f4ecef8ad9ca31a8372d0c353", metadata={ + "annotations": { + "workers_message": "Fixed bug.", + "workers_tag": "v1.0.1", + }, "assets": { "config": { "_headers": "/dashboard/*\nX-Frame-Options: DENY\n\n/static/*\nAccess-Control-Allow-Origin: *", @@ -386,6 +390,10 @@ async def test_method_update_with_all_params(self, async_client: AsyncCloudflare script_name="this-is_my_script-01", account_id="023e105f4ecef8ad9ca31a8372d0c353", metadata={ + "annotations": { + "workers_message": "Fixed bug.", + "workers_tag": "v1.0.1", + }, "assets": { "config": { "_headers": "/dashboard/*\nX-Frame-Options: DENY\n\n/static/*\nAccess-Control-Allow-Origin: *", From 7b7407ca94a413c23a0e68882c00d430174b8740 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 20 Feb 2026 01:34:23 +0000 Subject: [PATCH 020/279] chore(api): update composite API spec --- .stats.yml | 4 ++-- src/cloudflare/types/ai/ai_run_params.py | 22 +++++++++++++++++++++- tests/api_resources/test_ai.py | 24 ++++++++++++------------ 3 files changed, 35 insertions(+), 15 deletions(-) diff --git a/.stats.yml b/.stats.yml index 2594d658123..2dbdd49db2e 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 2025 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-bbaa54a8cdf9c7f13d7322e3cbe42364b41ff8d08b5d616bab9dcfd1fbda5dc6.yml -openapi_spec_hash: 6a04699dd9c5ed4e5deb8e11b534968c +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-fbc86ec6804caa535a84b2198abd609995725f02c9142d80f9824213e67617f7.yml +openapi_spec_hash: 4ac5fd5d393f45d236b9e96b86ab931e config_hash: 7a70007089f586cc7b1ebd1808030dd1 diff --git a/src/cloudflare/types/ai/ai_run_params.py b/src/cloudflare/types/ai/ai_run_params.py index 61f9181239e..6ce24ce4ae0 100644 --- a/src/cloudflare/types/ai/ai_run_params.py +++ b/src/cloudflare/types/ai/ai_run_params.py @@ -37,6 +37,8 @@ "Variant12", "Variant13", "Variant13Message", + "Variant13MessageContentUnionMember1", + "Variant13MessageContentUnionMember1ImageURL", "MultimodalEmbeddings", ] @@ -572,8 +574,26 @@ class Variant13(TypedDict, total=False): """ +class Variant13MessageContentUnionMember1ImageURL(TypedDict, total=False): + """Image URL object (when type is 'image_url').""" + + url: Required[str] + """Image URI with data (e.g. data:image/jpeg;base64,/9j/...).""" + + +class Variant13MessageContentUnionMember1(TypedDict, total=False): + type: Required[str] + """Type of the content part (e.g. 'text', 'image_url').""" + + image_url: Variant13MessageContentUnionMember1ImageURL + """Image URL object (when type is 'image_url').""" + + text: str + """Text content (when type is 'text').""" + + class Variant13Message(TypedDict, total=False): - content: Required[str] + content: Required[Union[str, Iterable[Variant13MessageContentUnionMember1]]] """The content of the message as a string.""" role: Required[str] diff --git a/tests/api_resources/test_ai.py b/tests/api_resources/test_ai.py index 6b4f886b98d..2d8fb346f07 100644 --- a/tests/api_resources/test_ai.py +++ b/tests/api_resources/test_ai.py @@ -926,7 +926,7 @@ def test_method_run_overload_14(self, client: Cloudflare) -> None: image="image", messages=[ { - "content": "content", + "content": "string", "role": "role", } ], @@ -941,7 +941,7 @@ def test_method_run_with_all_params_overload_14(self, client: Cloudflare) -> Non image="image", messages=[ { - "content": "content", + "content": "string", "role": "role", } ], @@ -965,7 +965,7 @@ def test_raw_response_run_overload_14(self, client: Cloudflare) -> None: image="image", messages=[ { - "content": "content", + "content": "string", "role": "role", } ], @@ -984,7 +984,7 @@ def test_streaming_response_run_overload_14(self, client: Cloudflare) -> None: image="image", messages=[ { - "content": "content", + "content": "string", "role": "role", } ], @@ -1006,7 +1006,7 @@ def test_path_params_run_overload_14(self, client: Cloudflare) -> None: image="image", messages=[ { - "content": "content", + "content": "string", "role": "role", } ], @@ -1019,7 +1019,7 @@ def test_path_params_run_overload_14(self, client: Cloudflare) -> None: image="image", messages=[ { - "content": "content", + "content": "string", "role": "role", } ], @@ -1998,7 +1998,7 @@ async def test_method_run_overload_14(self, async_client: AsyncCloudflare) -> No image="image", messages=[ { - "content": "content", + "content": "string", "role": "role", } ], @@ -2013,7 +2013,7 @@ async def test_method_run_with_all_params_overload_14(self, async_client: AsyncC image="image", messages=[ { - "content": "content", + "content": "string", "role": "role", } ], @@ -2037,7 +2037,7 @@ async def test_raw_response_run_overload_14(self, async_client: AsyncCloudflare) image="image", messages=[ { - "content": "content", + "content": "string", "role": "role", } ], @@ -2056,7 +2056,7 @@ async def test_streaming_response_run_overload_14(self, async_client: AsyncCloud image="image", messages=[ { - "content": "content", + "content": "string", "role": "role", } ], @@ -2078,7 +2078,7 @@ async def test_path_params_run_overload_14(self, async_client: AsyncCloudflare) image="image", messages=[ { - "content": "content", + "content": "string", "role": "role", } ], @@ -2091,7 +2091,7 @@ async def test_path_params_run_overload_14(self, async_client: AsyncCloudflare) image="image", messages=[ { - "content": "content", + "content": "string", "role": "role", } ], From 17bbdbb67606d49f7bfbc4979ec76ecb6b2e90ed Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 20 Feb 2026 12:48:32 +0000 Subject: [PATCH 021/279] chore(api): update composite API spec --- .stats.yml | 4 +- .../access/applications/applications.py | 1222 ++++++- .../access/applications/policies.py | 16 + .../resources/zero_trust/access/policies.py | 16 + .../zero_trust/organizations/organizations.py | 60 + .../access/application_create_params.py | 1526 ++++++++- .../access/application_create_response.py | 1536 ++++++++- .../access/application_get_response.py | 1536 ++++++++- .../access/application_list_response.py | 1536 ++++++++- .../access/application_update_params.py | 1526 ++++++++- .../access/application_update_response.py | 1536 ++++++++- .../applications/policy_create_params.py | 29 +- .../applications/policy_create_response.py | 26 +- .../applications/policy_get_response.py | 26 +- .../applications/policy_list_response.py | 26 +- .../applications/policy_test_create_params.py | 29 +- .../applications/policy_update_params.py | 29 +- .../applications/policy_update_response.py | 26 +- .../zero_trust/access/policy_create_params.py | 29 +- .../access/policy_create_response.py | 25 +- .../zero_trust/access/policy_get_response.py | 25 +- .../zero_trust/access/policy_list_response.py | 25 +- .../zero_trust/access/policy_update_params.py | 29 +- .../access/policy_update_response.py | 25 +- .../types/zero_trust/organization.py | 33 +- .../zero_trust/organization_create_params.py | 35 +- .../zero_trust/organization_update_params.py | 35 +- .../access/applications/test_policies.py | 20 + .../access/applications/test_policy_tests.py | 10 + .../zero_trust/access/test_applications.py | 3006 +++++++++++++---- .../zero_trust/access/test_policies.py | 20 + .../zero_trust/test_organizations.py | 24 + 32 files changed, 13156 insertions(+), 890 deletions(-) diff --git a/.stats.yml b/.stats.yml index 2dbdd49db2e..0e13f2d3de8 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 2025 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-fbc86ec6804caa535a84b2198abd609995725f02c9142d80f9824213e67617f7.yml -openapi_spec_hash: 4ac5fd5d393f45d236b9e96b86ab931e +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-e59c7f0b24659cdde1fce6c38749064dab4ba61506ed74ee410fc6c8b914ea47.yml +openapi_spec_hash: 2550b01c6b4c864c766537327894b8e0 config_hash: 7a70007089f586cc7b1ebd1808030dd1 diff --git a/src/cloudflare/resources/zero_trust/access/applications/applications.py b/src/cloudflare/resources/zero_trust/access/applications/applications.py index e34872af219..59439d9322c 100644 --- a/src/cloudflare/resources/zero_trust/access/applications/applications.py +++ b/src/cloudflare/resources/zero_trust/access/applications/applications.py @@ -143,7 +143,9 @@ def create( enable_binding_cookie: bool | Omit = omit, http_only_cookie_attribute: bool | Omit = omit, logo_url: str | Omit = omit, + mfa_config: application_create_params.SelfHostedApplicationMfaConfig | Omit = omit, name: str | Omit = omit, + oauth_configuration: application_create_params.SelfHostedApplicationOAuthConfiguration | Omit = omit, options_preflight_bypass: bool | Omit = omit, path_cookie_attribute: bool | Omit = omit, policies: SequenceNotStr[application_create_params.SelfHostedApplicationPolicy] | Omit = omit, @@ -214,8 +216,16 @@ def create( logo_url: The image URL for the logo shown in the App Launcher dashboard. + mfa_config: Configures multi-factor authentication (MFA) settings. + name: The name of the application. + oauth_configuration: **Beta:** Optional configuration for managing an OAuth authorization flow + controlled by Access. When set, Access will act as the OAuth authorization + server for this application. Only compatible with OAuth clients that support + [RFC 8707](https://datatracker.ietf.org/doc/html/rfc8707) (Resource Indicators + for OAuth 2.0). This feature is currently in beta. + options_preflight_bypass: Allows options preflight requests to bypass Access authentication and go directly to the origin. Cannot turn on if cors_headers is set. @@ -375,7 +385,9 @@ def create( enable_binding_cookie: bool | Omit = omit, http_only_cookie_attribute: bool | Omit = omit, logo_url: str | Omit = omit, + mfa_config: application_create_params.BrowserSSHApplicationMfaConfig | Omit = omit, name: str | Omit = omit, + oauth_configuration: application_create_params.BrowserSSHApplicationOAuthConfiguration | Omit = omit, options_preflight_bypass: bool | Omit = omit, path_cookie_attribute: bool | Omit = omit, policies: SequenceNotStr[application_create_params.BrowserSSHApplicationPolicy] | Omit = omit, @@ -446,8 +458,16 @@ def create( logo_url: The image URL for the logo shown in the App Launcher dashboard. + mfa_config: Configures multi-factor authentication (MFA) settings. + name: The name of the application. + oauth_configuration: **Beta:** Optional configuration for managing an OAuth authorization flow + controlled by Access. When set, Access will act as the OAuth authorization + server for this application. Only compatible with OAuth clients that support + [RFC 8707](https://datatracker.ietf.org/doc/html/rfc8707) (Resource Indicators + for OAuth 2.0). This feature is currently in beta. + options_preflight_bypass: Allows options preflight requests to bypass Access authentication and go directly to the origin. Cannot turn on if cors_headers is set. @@ -539,7 +559,9 @@ def create( enable_binding_cookie: bool | Omit = omit, http_only_cookie_attribute: bool | Omit = omit, logo_url: str | Omit = omit, + mfa_config: application_create_params.BrowserVNCApplicationMfaConfig | Omit = omit, name: str | Omit = omit, + oauth_configuration: application_create_params.BrowserVNCApplicationOAuthConfiguration | Omit = omit, options_preflight_bypass: bool | Omit = omit, path_cookie_attribute: bool | Omit = omit, policies: SequenceNotStr[application_create_params.BrowserVNCApplicationPolicy] | Omit = omit, @@ -610,8 +632,16 @@ def create( logo_url: The image URL for the logo shown in the App Launcher dashboard. + mfa_config: Configures multi-factor authentication (MFA) settings. + name: The name of the application. + oauth_configuration: **Beta:** Optional configuration for managing an OAuth authorization flow + controlled by Access. When set, Access will act as the OAuth authorization + server for this application. Only compatible with OAuth clients that support + [RFC 8707](https://datatracker.ietf.org/doc/html/rfc8707) (Resource Indicators + for OAuth 2.0). This feature is currently in beta. + options_preflight_bypass: Allows options preflight requests to bypass Access authentication and go directly to the origin. Cannot turn on if cors_headers is set. @@ -1077,7 +1107,9 @@ def create( enable_binding_cookie: bool | Omit = omit, http_only_cookie_attribute: bool | Omit = omit, logo_url: str | Omit = omit, + mfa_config: application_create_params.BrowserRdpApplicationMfaConfig | Omit = omit, name: str | Omit = omit, + oauth_configuration: application_create_params.BrowserRdpApplicationOAuthConfiguration | Omit = omit, options_preflight_bypass: bool | Omit = omit, path_cookie_attribute: bool | Omit = omit, policies: SequenceNotStr[application_create_params.BrowserRdpApplicationPolicy] | Omit = omit, @@ -1148,8 +1180,16 @@ def create( logo_url: The image URL for the logo shown in the App Launcher dashboard. + mfa_config: Configures multi-factor authentication (MFA) settings. + name: The name of the application. + oauth_configuration: **Beta:** Optional configuration for managing an OAuth authorization flow + controlled by Access. When set, Access will act as the OAuth authorization + server for this application. Only compatible with OAuth clients that support + [RFC 8707](https://datatracker.ietf.org/doc/html/rfc8707) (Resource Indicators + for OAuth 2.0). This feature is currently in beta. + options_preflight_bypass: Allows options preflight requests to bypass Access authentication and go directly to the origin. Cannot turn on if cors_headers is set. @@ -1204,6 +1244,232 @@ def create( """ ... + @overload + def create( + self, + *, + type: ApplicationType, + account_id: str | Omit = omit, + zone_id: str | Omit = omit, + allow_authenticate_via_warp: bool | Omit = omit, + allowed_idps: SequenceNotStr[AllowedIdPs] | Omit = omit, + auto_redirect_to_identity: bool | Omit = omit, + custom_deny_message: str | Omit = omit, + custom_deny_url: str | Omit = omit, + custom_non_identity_deny_url: str | Omit = omit, + custom_pages: SequenceNotStr[str] | Omit = omit, + destinations: Iterable[application_create_params.McpServerApplicationDestination] | Omit = omit, + http_only_cookie_attribute: bool | Omit = omit, + logo_url: str | Omit = omit, + name: str | Omit = omit, + oauth_configuration: application_create_params.McpServerApplicationOAuthConfiguration | Omit = omit, + options_preflight_bypass: bool | Omit = omit, + policies: SequenceNotStr[application_create_params.McpServerApplicationPolicy] | Omit = omit, + same_site_cookie_attribute: str | Omit = omit, + scim_config: application_create_params.McpServerApplicationSCIMConfig | Omit = omit, + session_duration: str | Omit = omit, + tags: SequenceNotStr[str] | 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, + ) -> Optional[ApplicationCreateResponse]: + """ + Adds a new application to Access. + + Args: + type: The application type. + + account_id: The Account ID to use for this endpoint. Mutually exclusive with the Zone ID. + + zone_id: The Zone ID to use for this endpoint. Mutually exclusive with the Account ID. + + allow_authenticate_via_warp: When set to true, users can authenticate to this application using their WARP + session. When set to false this application will always require direct IdP + authentication. This setting always overrides the organization setting for WARP + authentication. + + allowed_idps: The identity providers your users can select when connecting to this + application. Defaults to all IdPs configured in your account. + + auto_redirect_to_identity: When set to `true`, users skip the identity provider selection step during + login. You must specify only one identity provider in allowed_idps. + + custom_deny_message: The custom error message shown to a user when they are denied access to the + application. + + custom_deny_url: The custom URL a user is redirected to when they are denied access to the + application when failing identity-based rules. + + custom_non_identity_deny_url: The custom URL a user is redirected to when they are denied access to the + application when failing non-identity rules. + + custom_pages: The custom pages that will be displayed when applicable for this application + + destinations: List of destinations secured by Access. This supersedes `self_hosted_domains` to + allow for more flexibility in defining different types of domains. If + `destinations` are provided, then `self_hosted_domains` will be ignored. + + http_only_cookie_attribute: Enables the HttpOnly cookie attribute, which increases security against XSS + attacks. + + logo_url: The image URL for the logo shown in the App Launcher dashboard. + + name: The name of the application. + + oauth_configuration: **Beta:** Optional configuration for managing an OAuth authorization flow + controlled by Access. When set, Access will act as the OAuth authorization + server for this application. Only compatible with OAuth clients that support + [RFC 8707](https://datatracker.ietf.org/doc/html/rfc8707) (Resource Indicators + for OAuth 2.0). This feature is currently in beta. + + options_preflight_bypass: Allows options preflight requests to bypass Access authentication and go + directly to the origin. Cannot turn on if cors_headers is set. + + policies: The policies that Access applies to the application, in ascending order of + precedence. Items can reference existing policies or create new policies + exclusive to the application. + + same_site_cookie_attribute: Sets the SameSite cookie setting, which provides increased security against CSRF + attacks. + + scim_config: Configuration for provisioning to this application via SCIM. This is currently + in closed beta. + + session_duration: The amount of time that tokens issued for this application will be valid. Must + be in the format `300ms` or `2h45m`. Valid time units are: ns, us (or µs), ms, + s, m, h. Note: unsupported for infrastructure type applications. + + tags: The tags you want assigned to an application. Tags are used to filter + applications in the App Launcher dashboard. + + 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 + """ + ... + + @overload + def create( + self, + *, + type: ApplicationType, + account_id: str | Omit = omit, + zone_id: str | Omit = omit, + allow_authenticate_via_warp: bool | Omit = omit, + allowed_idps: SequenceNotStr[AllowedIdPs] | Omit = omit, + auto_redirect_to_identity: bool | Omit = omit, + custom_deny_message: str | Omit = omit, + custom_deny_url: str | Omit = omit, + custom_non_identity_deny_url: str | Omit = omit, + custom_pages: SequenceNotStr[str] | Omit = omit, + destinations: Iterable[application_create_params.McpServerPortalApplicationDestination] | Omit = omit, + domain: str | Omit = omit, + http_only_cookie_attribute: bool | Omit = omit, + logo_url: str | Omit = omit, + name: str | Omit = omit, + oauth_configuration: application_create_params.McpServerPortalApplicationOAuthConfiguration | Omit = omit, + options_preflight_bypass: bool | Omit = omit, + policies: SequenceNotStr[application_create_params.McpServerPortalApplicationPolicy] | Omit = omit, + same_site_cookie_attribute: str | Omit = omit, + scim_config: application_create_params.McpServerPortalApplicationSCIMConfig | Omit = omit, + session_duration: str | Omit = omit, + tags: SequenceNotStr[str] | 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, + ) -> Optional[ApplicationCreateResponse]: + """ + Adds a new application to Access. + + Args: + type: The application type. + + account_id: The Account ID to use for this endpoint. Mutually exclusive with the Zone ID. + + zone_id: The Zone ID to use for this endpoint. Mutually exclusive with the Account ID. + + allow_authenticate_via_warp: When set to true, users can authenticate to this application using their WARP + session. When set to false this application will always require direct IdP + authentication. This setting always overrides the organization setting for WARP + authentication. + + allowed_idps: The identity providers your users can select when connecting to this + application. Defaults to all IdPs configured in your account. + + auto_redirect_to_identity: When set to `true`, users skip the identity provider selection step during + login. You must specify only one identity provider in allowed_idps. + + custom_deny_message: The custom error message shown to a user when they are denied access to the + application. + + custom_deny_url: The custom URL a user is redirected to when they are denied access to the + application when failing identity-based rules. + + custom_non_identity_deny_url: The custom URL a user is redirected to when they are denied access to the + application when failing non-identity rules. + + custom_pages: The custom pages that will be displayed when applicable for this application + + destinations: List of destinations secured by Access. This supersedes `self_hosted_domains` to + allow for more flexibility in defining different types of domains. If + `destinations` are provided, then `self_hosted_domains` will be ignored. + + domain: The primary hostname and path secured by Access. This domain will be displayed + if the app is visible in the App Launcher. + + http_only_cookie_attribute: Enables the HttpOnly cookie attribute, which increases security against XSS + attacks. + + logo_url: The image URL for the logo shown in the App Launcher dashboard. + + name: The name of the application. + + oauth_configuration: **Beta:** Optional configuration for managing an OAuth authorization flow + controlled by Access. When set, Access will act as the OAuth authorization + server for this application. Only compatible with OAuth clients that support + [RFC 8707](https://datatracker.ietf.org/doc/html/rfc8707) (Resource Indicators + for OAuth 2.0). This feature is currently in beta. + + options_preflight_bypass: Allows options preflight requests to bypass Access authentication and go + directly to the origin. Cannot turn on if cors_headers is set. + + policies: The policies that Access applies to the application, in ascending order of + precedence. Items can reference existing policies or create new policies + exclusive to the application. + + same_site_cookie_attribute: Sets the SameSite cookie setting, which provides increased security against CSRF + attacks. + + scim_config: Configuration for provisioning to this application via SCIM. This is currently + in closed beta. + + session_duration: The amount of time that tokens issued for this application will be valid. Must + be in the format `300ms` or `2h45m`. Valid time units are: ns, us (or µs), ms, + s, m, h. Note: unsupported for infrastructure type applications. + + tags: The tags you want assigned to an application. Tags are used to filter + applications in the App Launcher dashboard. + + 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 + """ + ... + def create( self, *, @@ -1242,11 +1508,25 @@ def create( | Iterable[application_create_params.BrowserSSHApplicationDestination] | Iterable[application_create_params.BrowserVNCApplicationDestination] | Iterable[application_create_params.BrowserRdpApplicationDestination] + | Iterable[application_create_params.McpServerApplicationDestination] + | Iterable[application_create_params.McpServerPortalApplicationDestination] | Omit = omit, enable_binding_cookie: bool | Omit = omit, http_only_cookie_attribute: bool | Omit = omit, logo_url: str | Omit = omit, + mfa_config: application_create_params.SelfHostedApplicationMfaConfig + | application_create_params.BrowserSSHApplicationMfaConfig + | application_create_params.BrowserVNCApplicationMfaConfig + | application_create_params.BrowserRdpApplicationMfaConfig + | Omit = omit, name: str | Omit = omit, + oauth_configuration: application_create_params.SelfHostedApplicationOAuthConfiguration + | application_create_params.BrowserSSHApplicationOAuthConfiguration + | application_create_params.BrowserVNCApplicationOAuthConfiguration + | application_create_params.BrowserRdpApplicationOAuthConfiguration + | application_create_params.McpServerApplicationOAuthConfiguration + | application_create_params.McpServerPortalApplicationOAuthConfiguration + | Omit = omit, options_preflight_bypass: bool | Omit = omit, path_cookie_attribute: bool | Omit = omit, policies: SequenceNotStr[application_create_params.SelfHostedApplicationPolicy] @@ -1260,6 +1540,8 @@ def create( | SequenceNotStr[application_create_params.BookmarkApplicationPolicy] | Iterable[application_create_params.InfrastructureApplicationPolicy] | SequenceNotStr[application_create_params.BrowserRdpApplicationPolicy] + | SequenceNotStr[application_create_params.McpServerApplicationPolicy] + | SequenceNotStr[application_create_params.McpServerPortalApplicationPolicy] | Omit = omit, read_service_tokens_from_header: str | Omit = omit, same_site_cookie_attribute: str | Omit = omit, @@ -1268,6 +1550,8 @@ def create( | application_create_params.BrowserSSHApplicationSCIMConfig | application_create_params.BrowserVNCApplicationSCIMConfig | application_create_params.BrowserRdpApplicationSCIMConfig + | application_create_params.McpServerApplicationSCIMConfig + | application_create_params.McpServerPortalApplicationSCIMConfig | Omit = omit, self_hosted_domains: SequenceNotStr[SelfHostedDomains] | Omit = omit, service_auth_401_redirect: bool | Omit = omit, @@ -1326,7 +1610,9 @@ def create( "enable_binding_cookie": enable_binding_cookie, "http_only_cookie_attribute": http_only_cookie_attribute, "logo_url": logo_url, + "mfa_config": mfa_config, "name": name, + "oauth_configuration": oauth_configuration, "options_preflight_bypass": options_preflight_bypass, "path_cookie_attribute": path_cookie_attribute, "policies": policies, @@ -1386,7 +1672,9 @@ def update( enable_binding_cookie: bool | Omit = omit, http_only_cookie_attribute: bool | Omit = omit, logo_url: str | Omit = omit, + mfa_config: application_update_params.SelfHostedApplicationMfaConfig | Omit = omit, name: str | Omit = omit, + oauth_configuration: application_update_params.SelfHostedApplicationOAuthConfiguration | Omit = omit, options_preflight_bypass: bool | Omit = omit, path_cookie_attribute: bool | Omit = omit, policies: SequenceNotStr[application_update_params.SelfHostedApplicationPolicy] | Omit = omit, @@ -1459,8 +1747,16 @@ def update( logo_url: The image URL for the logo shown in the App Launcher dashboard. + mfa_config: Configures multi-factor authentication (MFA) settings. + name: The name of the application. + oauth_configuration: **Beta:** Optional configuration for managing an OAuth authorization flow + controlled by Access. When set, Access will act as the OAuth authorization + server for this application. Only compatible with OAuth clients that support + [RFC 8707](https://datatracker.ietf.org/doc/html/rfc8707) (Resource Indicators + for OAuth 2.0). This feature is currently in beta. + options_preflight_bypass: Allows options preflight requests to bypass Access authentication and go directly to the origin. Cannot turn on if cors_headers is set. @@ -1624,7 +1920,9 @@ def update( enable_binding_cookie: bool | Omit = omit, http_only_cookie_attribute: bool | Omit = omit, logo_url: str | Omit = omit, + mfa_config: application_update_params.BrowserSSHApplicationMfaConfig | Omit = omit, name: str | Omit = omit, + oauth_configuration: application_update_params.BrowserSSHApplicationOAuthConfiguration | Omit = omit, options_preflight_bypass: bool | Omit = omit, path_cookie_attribute: bool | Omit = omit, policies: SequenceNotStr[application_update_params.BrowserSSHApplicationPolicy] | Omit = omit, @@ -1697,8 +1995,16 @@ def update( logo_url: The image URL for the logo shown in the App Launcher dashboard. + mfa_config: Configures multi-factor authentication (MFA) settings. + name: The name of the application. + oauth_configuration: **Beta:** Optional configuration for managing an OAuth authorization flow + controlled by Access. When set, Access will act as the OAuth authorization + server for this application. Only compatible with OAuth clients that support + [RFC 8707](https://datatracker.ietf.org/doc/html/rfc8707) (Resource Indicators + for OAuth 2.0). This feature is currently in beta. + options_preflight_bypass: Allows options preflight requests to bypass Access authentication and go directly to the origin. Cannot turn on if cors_headers is set. @@ -1791,7 +2097,9 @@ def update( enable_binding_cookie: bool | Omit = omit, http_only_cookie_attribute: bool | Omit = omit, logo_url: str | Omit = omit, + mfa_config: application_update_params.BrowserVNCApplicationMfaConfig | Omit = omit, name: str | Omit = omit, + oauth_configuration: application_update_params.BrowserVNCApplicationOAuthConfiguration | Omit = omit, options_preflight_bypass: bool | Omit = omit, path_cookie_attribute: bool | Omit = omit, policies: SequenceNotStr[application_update_params.BrowserVNCApplicationPolicy] | Omit = omit, @@ -1864,8 +2172,16 @@ def update( logo_url: The image URL for the logo shown in the App Launcher dashboard. + mfa_config: Configures multi-factor authentication (MFA) settings. + name: The name of the application. + oauth_configuration: **Beta:** Optional configuration for managing an OAuth authorization flow + controlled by Access. When set, Access will act as the OAuth authorization + server for this application. Only compatible with OAuth clients that support + [RFC 8707](https://datatracker.ietf.org/doc/html/rfc8707) (Resource Indicators + for OAuth 2.0). This feature is currently in beta. + options_preflight_bypass: Allows options preflight requests to bypass Access authentication and go directly to the origin. Cannot turn on if cors_headers is set. @@ -2350,7 +2666,9 @@ def update( enable_binding_cookie: bool | Omit = omit, http_only_cookie_attribute: bool | Omit = omit, logo_url: str | Omit = omit, + mfa_config: application_update_params.BrowserRdpApplicationMfaConfig | Omit = omit, name: str | Omit = omit, + oauth_configuration: application_update_params.BrowserRdpApplicationOAuthConfiguration | Omit = omit, options_preflight_bypass: bool | Omit = omit, path_cookie_attribute: bool | Omit = omit, policies: SequenceNotStr[application_update_params.BrowserRdpApplicationPolicy] | Omit = omit, @@ -2423,8 +2741,16 @@ def update( logo_url: The image URL for the logo shown in the App Launcher dashboard. + mfa_config: Configures multi-factor authentication (MFA) settings. + name: The name of the application. + oauth_configuration: **Beta:** Optional configuration for managing an OAuth authorization flow + controlled by Access. When set, Access will act as the OAuth authorization + server for this application. Only compatible with OAuth clients that support + [RFC 8707](https://datatracker.ietf.org/doc/html/rfc8707) (Resource Indicators + for OAuth 2.0). This feature is currently in beta. + options_preflight_bypass: Allows options preflight requests to bypass Access authentication and go directly to the origin. Cannot turn on if cors_headers is set. @@ -2479,50 +2805,296 @@ def update( """ ... + @overload def update( self, app_id: AppID, *, - domain: str | Omit = omit, - type: ApplicationType - | Literal[ - "self_hosted", - "saas", - "ssh", - "vnc", - "app_launcher", - "warp", - "biso", - "bookmark", - "dash_sso", - "infrastructure", - "rdp", - "mcp", - "mcp_portal", - "proxy_endpoint", - ] - | Omit = omit, + type: ApplicationType, account_id: str | Omit = omit, zone_id: str | Omit = omit, allow_authenticate_via_warp: bool | Omit = omit, - allow_iframe: bool | Omit = omit, allowed_idps: SequenceNotStr[AllowedIdPs] | Omit = omit, - app_launcher_visible: bool | Omit = omit, auto_redirect_to_identity: bool | Omit = omit, - cors_headers: CORSHeadersParam | Omit = omit, custom_deny_message: str | Omit = omit, custom_deny_url: str | Omit = omit, custom_non_identity_deny_url: str | Omit = omit, custom_pages: SequenceNotStr[str] | Omit = omit, - destinations: Iterable[application_update_params.SelfHostedApplicationDestination] - | Iterable[application_update_params.BrowserSSHApplicationDestination] - | Iterable[application_update_params.BrowserVNCApplicationDestination] - | Iterable[application_update_params.BrowserRdpApplicationDestination] - | Omit = omit, - enable_binding_cookie: bool | Omit = omit, + destinations: Iterable[application_update_params.McpServerApplicationDestination] | Omit = omit, http_only_cookie_attribute: bool | Omit = omit, logo_url: str | Omit = omit, name: str | Omit = omit, + oauth_configuration: application_update_params.McpServerApplicationOAuthConfiguration | Omit = omit, + options_preflight_bypass: bool | Omit = omit, + policies: SequenceNotStr[application_update_params.McpServerApplicationPolicy] | Omit = omit, + same_site_cookie_attribute: str | Omit = omit, + scim_config: application_update_params.McpServerApplicationSCIMConfig | Omit = omit, + session_duration: str | Omit = omit, + tags: SequenceNotStr[str] | 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, + ) -> Optional[ApplicationUpdateResponse]: + """ + Updates an Access application. + + Args: + app_id: Identifier. + + type: The application type. + + account_id: The Account ID to use for this endpoint. Mutually exclusive with the Zone ID. + + zone_id: The Zone ID to use for this endpoint. Mutually exclusive with the Account ID. + + allow_authenticate_via_warp: When set to true, users can authenticate to this application using their WARP + session. When set to false this application will always require direct IdP + authentication. This setting always overrides the organization setting for WARP + authentication. + + allowed_idps: The identity providers your users can select when connecting to this + application. Defaults to all IdPs configured in your account. + + auto_redirect_to_identity: When set to `true`, users skip the identity provider selection step during + login. You must specify only one identity provider in allowed_idps. + + custom_deny_message: The custom error message shown to a user when they are denied access to the + application. + + custom_deny_url: The custom URL a user is redirected to when they are denied access to the + application when failing identity-based rules. + + custom_non_identity_deny_url: The custom URL a user is redirected to when they are denied access to the + application when failing non-identity rules. + + custom_pages: The custom pages that will be displayed when applicable for this application + + destinations: List of destinations secured by Access. This supersedes `self_hosted_domains` to + allow for more flexibility in defining different types of domains. If + `destinations` are provided, then `self_hosted_domains` will be ignored. + + http_only_cookie_attribute: Enables the HttpOnly cookie attribute, which increases security against XSS + attacks. + + logo_url: The image URL for the logo shown in the App Launcher dashboard. + + name: The name of the application. + + oauth_configuration: **Beta:** Optional configuration for managing an OAuth authorization flow + controlled by Access. When set, Access will act as the OAuth authorization + server for this application. Only compatible with OAuth clients that support + [RFC 8707](https://datatracker.ietf.org/doc/html/rfc8707) (Resource Indicators + for OAuth 2.0). This feature is currently in beta. + + options_preflight_bypass: Allows options preflight requests to bypass Access authentication and go + directly to the origin. Cannot turn on if cors_headers is set. + + policies: The policies that Access applies to the application, in ascending order of + precedence. Items can reference existing policies or create new policies + exclusive to the application. + + same_site_cookie_attribute: Sets the SameSite cookie setting, which provides increased security against CSRF + attacks. + + scim_config: Configuration for provisioning to this application via SCIM. This is currently + in closed beta. + + session_duration: The amount of time that tokens issued for this application will be valid. Must + be in the format `300ms` or `2h45m`. Valid time units are: ns, us (or µs), ms, + s, m, h. Note: unsupported for infrastructure type applications. + + tags: The tags you want assigned to an application. Tags are used to filter + applications in the App Launcher dashboard. + + 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 + """ + ... + + @overload + def update( + self, + app_id: AppID, + *, + type: ApplicationType, + account_id: str | Omit = omit, + zone_id: str | Omit = omit, + allow_authenticate_via_warp: bool | Omit = omit, + allowed_idps: SequenceNotStr[AllowedIdPs] | Omit = omit, + auto_redirect_to_identity: bool | Omit = omit, + custom_deny_message: str | Omit = omit, + custom_deny_url: str | Omit = omit, + custom_non_identity_deny_url: str | Omit = omit, + custom_pages: SequenceNotStr[str] | Omit = omit, + destinations: Iterable[application_update_params.McpServerPortalApplicationDestination] | Omit = omit, + domain: str | Omit = omit, + http_only_cookie_attribute: bool | Omit = omit, + logo_url: str | Omit = omit, + name: str | Omit = omit, + oauth_configuration: application_update_params.McpServerPortalApplicationOAuthConfiguration | Omit = omit, + options_preflight_bypass: bool | Omit = omit, + policies: SequenceNotStr[application_update_params.McpServerPortalApplicationPolicy] | Omit = omit, + same_site_cookie_attribute: str | Omit = omit, + scim_config: application_update_params.McpServerPortalApplicationSCIMConfig | Omit = omit, + session_duration: str | Omit = omit, + tags: SequenceNotStr[str] | 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, + ) -> Optional[ApplicationUpdateResponse]: + """ + Updates an Access application. + + Args: + app_id: Identifier. + + type: The application type. + + account_id: The Account ID to use for this endpoint. Mutually exclusive with the Zone ID. + + zone_id: The Zone ID to use for this endpoint. Mutually exclusive with the Account ID. + + allow_authenticate_via_warp: When set to true, users can authenticate to this application using their WARP + session. When set to false this application will always require direct IdP + authentication. This setting always overrides the organization setting for WARP + authentication. + + allowed_idps: The identity providers your users can select when connecting to this + application. Defaults to all IdPs configured in your account. + + auto_redirect_to_identity: When set to `true`, users skip the identity provider selection step during + login. You must specify only one identity provider in allowed_idps. + + custom_deny_message: The custom error message shown to a user when they are denied access to the + application. + + custom_deny_url: The custom URL a user is redirected to when they are denied access to the + application when failing identity-based rules. + + custom_non_identity_deny_url: The custom URL a user is redirected to when they are denied access to the + application when failing non-identity rules. + + custom_pages: The custom pages that will be displayed when applicable for this application + + destinations: List of destinations secured by Access. This supersedes `self_hosted_domains` to + allow for more flexibility in defining different types of domains. If + `destinations` are provided, then `self_hosted_domains` will be ignored. + + domain: The primary hostname and path secured by Access. This domain will be displayed + if the app is visible in the App Launcher. + + http_only_cookie_attribute: Enables the HttpOnly cookie attribute, which increases security against XSS + attacks. + + logo_url: The image URL for the logo shown in the App Launcher dashboard. + + name: The name of the application. + + oauth_configuration: **Beta:** Optional configuration for managing an OAuth authorization flow + controlled by Access. When set, Access will act as the OAuth authorization + server for this application. Only compatible with OAuth clients that support + [RFC 8707](https://datatracker.ietf.org/doc/html/rfc8707) (Resource Indicators + for OAuth 2.0). This feature is currently in beta. + + options_preflight_bypass: Allows options preflight requests to bypass Access authentication and go + directly to the origin. Cannot turn on if cors_headers is set. + + policies: The policies that Access applies to the application, in ascending order of + precedence. Items can reference existing policies or create new policies + exclusive to the application. + + same_site_cookie_attribute: Sets the SameSite cookie setting, which provides increased security against CSRF + attacks. + + scim_config: Configuration for provisioning to this application via SCIM. This is currently + in closed beta. + + session_duration: The amount of time that tokens issued for this application will be valid. Must + be in the format `300ms` or `2h45m`. Valid time units are: ns, us (or µs), ms, + s, m, h. Note: unsupported for infrastructure type applications. + + tags: The tags you want assigned to an application. Tags are used to filter + applications in the App Launcher dashboard. + + 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 + """ + ... + + def update( + self, + app_id: AppID, + *, + domain: str | Omit = omit, + type: ApplicationType + | Literal[ + "self_hosted", + "saas", + "ssh", + "vnc", + "app_launcher", + "warp", + "biso", + "bookmark", + "dash_sso", + "infrastructure", + "rdp", + "mcp", + "mcp_portal", + "proxy_endpoint", + ] + | Omit = omit, + account_id: str | Omit = omit, + zone_id: str | Omit = omit, + allow_authenticate_via_warp: bool | Omit = omit, + allow_iframe: bool | Omit = omit, + allowed_idps: SequenceNotStr[AllowedIdPs] | Omit = omit, + app_launcher_visible: bool | Omit = omit, + auto_redirect_to_identity: bool | Omit = omit, + cors_headers: CORSHeadersParam | Omit = omit, + custom_deny_message: str | Omit = omit, + custom_deny_url: str | Omit = omit, + custom_non_identity_deny_url: str | Omit = omit, + custom_pages: SequenceNotStr[str] | Omit = omit, + destinations: Iterable[application_update_params.SelfHostedApplicationDestination] + | Iterable[application_update_params.BrowserSSHApplicationDestination] + | Iterable[application_update_params.BrowserVNCApplicationDestination] + | Iterable[application_update_params.BrowserRdpApplicationDestination] + | Iterable[application_update_params.McpServerApplicationDestination] + | Iterable[application_update_params.McpServerPortalApplicationDestination] + | Omit = omit, + enable_binding_cookie: bool | Omit = omit, + http_only_cookie_attribute: bool | Omit = omit, + logo_url: str | Omit = omit, + mfa_config: application_update_params.SelfHostedApplicationMfaConfig + | application_update_params.BrowserSSHApplicationMfaConfig + | application_update_params.BrowserVNCApplicationMfaConfig + | application_update_params.BrowserRdpApplicationMfaConfig + | Omit = omit, + name: str | Omit = omit, + oauth_configuration: application_update_params.SelfHostedApplicationOAuthConfiguration + | application_update_params.BrowserSSHApplicationOAuthConfiguration + | application_update_params.BrowserVNCApplicationOAuthConfiguration + | application_update_params.BrowserRdpApplicationOAuthConfiguration + | application_update_params.McpServerApplicationOAuthConfiguration + | application_update_params.McpServerPortalApplicationOAuthConfiguration + | Omit = omit, options_preflight_bypass: bool | Omit = omit, path_cookie_attribute: bool | Omit = omit, policies: SequenceNotStr[application_update_params.SelfHostedApplicationPolicy] @@ -2536,6 +3108,8 @@ def update( | SequenceNotStr[application_update_params.BookmarkApplicationPolicy] | Iterable[application_update_params.InfrastructureApplicationPolicy] | SequenceNotStr[application_update_params.BrowserRdpApplicationPolicy] + | SequenceNotStr[application_update_params.McpServerApplicationPolicy] + | SequenceNotStr[application_update_params.McpServerPortalApplicationPolicy] | Omit = omit, read_service_tokens_from_header: str | Omit = omit, same_site_cookie_attribute: str | Omit = omit, @@ -2544,6 +3118,8 @@ def update( | application_update_params.BrowserSSHApplicationSCIMConfig | application_update_params.BrowserVNCApplicationSCIMConfig | application_update_params.BrowserRdpApplicationSCIMConfig + | application_update_params.McpServerApplicationSCIMConfig + | application_update_params.McpServerPortalApplicationSCIMConfig | Omit = omit, self_hosted_domains: SequenceNotStr[SelfHostedDomains] | Omit = omit, service_auth_401_redirect: bool | Omit = omit, @@ -2604,7 +3180,9 @@ def update( "enable_binding_cookie": enable_binding_cookie, "http_only_cookie_attribute": http_only_cookie_attribute, "logo_url": logo_url, + "mfa_config": mfa_config, "name": name, + "oauth_configuration": oauth_configuration, "options_preflight_bypass": options_preflight_bypass, "path_cookie_attribute": path_cookie_attribute, "policies": policies, @@ -2969,7 +3547,9 @@ async def create( enable_binding_cookie: bool | Omit = omit, http_only_cookie_attribute: bool | Omit = omit, logo_url: str | Omit = omit, + mfa_config: application_create_params.SelfHostedApplicationMfaConfig | Omit = omit, name: str | Omit = omit, + oauth_configuration: application_create_params.SelfHostedApplicationOAuthConfiguration | Omit = omit, options_preflight_bypass: bool | Omit = omit, path_cookie_attribute: bool | Omit = omit, policies: SequenceNotStr[application_create_params.SelfHostedApplicationPolicy] | Omit = omit, @@ -3040,8 +3620,16 @@ async def create( logo_url: The image URL for the logo shown in the App Launcher dashboard. + mfa_config: Configures multi-factor authentication (MFA) settings. + name: The name of the application. + oauth_configuration: **Beta:** Optional configuration for managing an OAuth authorization flow + controlled by Access. When set, Access will act as the OAuth authorization + server for this application. Only compatible with OAuth clients that support + [RFC 8707](https://datatracker.ietf.org/doc/html/rfc8707) (Resource Indicators + for OAuth 2.0). This feature is currently in beta. + options_preflight_bypass: Allows options preflight requests to bypass Access authentication and go directly to the origin. Cannot turn on if cors_headers is set. @@ -3201,7 +3789,9 @@ async def create( enable_binding_cookie: bool | Omit = omit, http_only_cookie_attribute: bool | Omit = omit, logo_url: str | Omit = omit, + mfa_config: application_create_params.BrowserSSHApplicationMfaConfig | Omit = omit, name: str | Omit = omit, + oauth_configuration: application_create_params.BrowserSSHApplicationOAuthConfiguration | Omit = omit, options_preflight_bypass: bool | Omit = omit, path_cookie_attribute: bool | Omit = omit, policies: SequenceNotStr[application_create_params.BrowserSSHApplicationPolicy] | Omit = omit, @@ -3272,8 +3862,16 @@ async def create( logo_url: The image URL for the logo shown in the App Launcher dashboard. + mfa_config: Configures multi-factor authentication (MFA) settings. + name: The name of the application. + oauth_configuration: **Beta:** Optional configuration for managing an OAuth authorization flow + controlled by Access. When set, Access will act as the OAuth authorization + server for this application. Only compatible with OAuth clients that support + [RFC 8707](https://datatracker.ietf.org/doc/html/rfc8707) (Resource Indicators + for OAuth 2.0). This feature is currently in beta. + options_preflight_bypass: Allows options preflight requests to bypass Access authentication and go directly to the origin. Cannot turn on if cors_headers is set. @@ -3365,7 +3963,9 @@ async def create( enable_binding_cookie: bool | Omit = omit, http_only_cookie_attribute: bool | Omit = omit, logo_url: str | Omit = omit, + mfa_config: application_create_params.BrowserVNCApplicationMfaConfig | Omit = omit, name: str | Omit = omit, + oauth_configuration: application_create_params.BrowserVNCApplicationOAuthConfiguration | Omit = omit, options_preflight_bypass: bool | Omit = omit, path_cookie_attribute: bool | Omit = omit, policies: SequenceNotStr[application_create_params.BrowserVNCApplicationPolicy] | Omit = omit, @@ -3436,8 +4036,16 @@ async def create( logo_url: The image URL for the logo shown in the App Launcher dashboard. + mfa_config: Configures multi-factor authentication (MFA) settings. + name: The name of the application. + oauth_configuration: **Beta:** Optional configuration for managing an OAuth authorization flow + controlled by Access. When set, Access will act as the OAuth authorization + server for this application. Only compatible with OAuth clients that support + [RFC 8707](https://datatracker.ietf.org/doc/html/rfc8707) (Resource Indicators + for OAuth 2.0). This feature is currently in beta. + options_preflight_bypass: Allows options preflight requests to bypass Access authentication and go directly to the origin. Cannot turn on if cors_headers is set. @@ -3903,7 +4511,9 @@ async def create( enable_binding_cookie: bool | Omit = omit, http_only_cookie_attribute: bool | Omit = omit, logo_url: str | Omit = omit, + mfa_config: application_create_params.BrowserRdpApplicationMfaConfig | Omit = omit, name: str | Omit = omit, + oauth_configuration: application_create_params.BrowserRdpApplicationOAuthConfiguration | Omit = omit, options_preflight_bypass: bool | Omit = omit, path_cookie_attribute: bool | Omit = omit, policies: SequenceNotStr[application_create_params.BrowserRdpApplicationPolicy] | Omit = omit, @@ -3974,8 +4584,16 @@ async def create( logo_url: The image URL for the logo shown in the App Launcher dashboard. + mfa_config: Configures multi-factor authentication (MFA) settings. + name: The name of the application. + oauth_configuration: **Beta:** Optional configuration for managing an OAuth authorization flow + controlled by Access. When set, Access will act as the OAuth authorization + server for this application. Only compatible with OAuth clients that support + [RFC 8707](https://datatracker.ietf.org/doc/html/rfc8707) (Resource Indicators + for OAuth 2.0). This feature is currently in beta. + options_preflight_bypass: Allows options preflight requests to bypass Access authentication and go directly to the origin. Cannot turn on if cors_headers is set. @@ -4030,14 +4648,240 @@ async def create( """ ... + @overload async def create( self, *, - domain: str | Omit = omit, - type: ApplicationType - | Literal[ - "self_hosted", - "saas", + type: ApplicationType, + account_id: str | Omit = omit, + zone_id: str | Omit = omit, + allow_authenticate_via_warp: bool | Omit = omit, + allowed_idps: SequenceNotStr[AllowedIdPs] | Omit = omit, + auto_redirect_to_identity: bool | Omit = omit, + custom_deny_message: str | Omit = omit, + custom_deny_url: str | Omit = omit, + custom_non_identity_deny_url: str | Omit = omit, + custom_pages: SequenceNotStr[str] | Omit = omit, + destinations: Iterable[application_create_params.McpServerApplicationDestination] | Omit = omit, + http_only_cookie_attribute: bool | Omit = omit, + logo_url: str | Omit = omit, + name: str | Omit = omit, + oauth_configuration: application_create_params.McpServerApplicationOAuthConfiguration | Omit = omit, + options_preflight_bypass: bool | Omit = omit, + policies: SequenceNotStr[application_create_params.McpServerApplicationPolicy] | Omit = omit, + same_site_cookie_attribute: str | Omit = omit, + scim_config: application_create_params.McpServerApplicationSCIMConfig | Omit = omit, + session_duration: str | Omit = omit, + tags: SequenceNotStr[str] | 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, + ) -> Optional[ApplicationCreateResponse]: + """ + Adds a new application to Access. + + Args: + type: The application type. + + account_id: The Account ID to use for this endpoint. Mutually exclusive with the Zone ID. + + zone_id: The Zone ID to use for this endpoint. Mutually exclusive with the Account ID. + + allow_authenticate_via_warp: When set to true, users can authenticate to this application using their WARP + session. When set to false this application will always require direct IdP + authentication. This setting always overrides the organization setting for WARP + authentication. + + allowed_idps: The identity providers your users can select when connecting to this + application. Defaults to all IdPs configured in your account. + + auto_redirect_to_identity: When set to `true`, users skip the identity provider selection step during + login. You must specify only one identity provider in allowed_idps. + + custom_deny_message: The custom error message shown to a user when they are denied access to the + application. + + custom_deny_url: The custom URL a user is redirected to when they are denied access to the + application when failing identity-based rules. + + custom_non_identity_deny_url: The custom URL a user is redirected to when they are denied access to the + application when failing non-identity rules. + + custom_pages: The custom pages that will be displayed when applicable for this application + + destinations: List of destinations secured by Access. This supersedes `self_hosted_domains` to + allow for more flexibility in defining different types of domains. If + `destinations` are provided, then `self_hosted_domains` will be ignored. + + http_only_cookie_attribute: Enables the HttpOnly cookie attribute, which increases security against XSS + attacks. + + logo_url: The image URL for the logo shown in the App Launcher dashboard. + + name: The name of the application. + + oauth_configuration: **Beta:** Optional configuration for managing an OAuth authorization flow + controlled by Access. When set, Access will act as the OAuth authorization + server for this application. Only compatible with OAuth clients that support + [RFC 8707](https://datatracker.ietf.org/doc/html/rfc8707) (Resource Indicators + for OAuth 2.0). This feature is currently in beta. + + options_preflight_bypass: Allows options preflight requests to bypass Access authentication and go + directly to the origin. Cannot turn on if cors_headers is set. + + policies: The policies that Access applies to the application, in ascending order of + precedence. Items can reference existing policies or create new policies + exclusive to the application. + + same_site_cookie_attribute: Sets the SameSite cookie setting, which provides increased security against CSRF + attacks. + + scim_config: Configuration for provisioning to this application via SCIM. This is currently + in closed beta. + + session_duration: The amount of time that tokens issued for this application will be valid. Must + be in the format `300ms` or `2h45m`. Valid time units are: ns, us (or µs), ms, + s, m, h. Note: unsupported for infrastructure type applications. + + tags: The tags you want assigned to an application. Tags are used to filter + applications in the App Launcher dashboard. + + 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 + """ + ... + + @overload + async def create( + self, + *, + type: ApplicationType, + account_id: str | Omit = omit, + zone_id: str | Omit = omit, + allow_authenticate_via_warp: bool | Omit = omit, + allowed_idps: SequenceNotStr[AllowedIdPs] | Omit = omit, + auto_redirect_to_identity: bool | Omit = omit, + custom_deny_message: str | Omit = omit, + custom_deny_url: str | Omit = omit, + custom_non_identity_deny_url: str | Omit = omit, + custom_pages: SequenceNotStr[str] | Omit = omit, + destinations: Iterable[application_create_params.McpServerPortalApplicationDestination] | Omit = omit, + domain: str | Omit = omit, + http_only_cookie_attribute: bool | Omit = omit, + logo_url: str | Omit = omit, + name: str | Omit = omit, + oauth_configuration: application_create_params.McpServerPortalApplicationOAuthConfiguration | Omit = omit, + options_preflight_bypass: bool | Omit = omit, + policies: SequenceNotStr[application_create_params.McpServerPortalApplicationPolicy] | Omit = omit, + same_site_cookie_attribute: str | Omit = omit, + scim_config: application_create_params.McpServerPortalApplicationSCIMConfig | Omit = omit, + session_duration: str | Omit = omit, + tags: SequenceNotStr[str] | 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, + ) -> Optional[ApplicationCreateResponse]: + """ + Adds a new application to Access. + + Args: + type: The application type. + + account_id: The Account ID to use for this endpoint. Mutually exclusive with the Zone ID. + + zone_id: The Zone ID to use for this endpoint. Mutually exclusive with the Account ID. + + allow_authenticate_via_warp: When set to true, users can authenticate to this application using their WARP + session. When set to false this application will always require direct IdP + authentication. This setting always overrides the organization setting for WARP + authentication. + + allowed_idps: The identity providers your users can select when connecting to this + application. Defaults to all IdPs configured in your account. + + auto_redirect_to_identity: When set to `true`, users skip the identity provider selection step during + login. You must specify only one identity provider in allowed_idps. + + custom_deny_message: The custom error message shown to a user when they are denied access to the + application. + + custom_deny_url: The custom URL a user is redirected to when they are denied access to the + application when failing identity-based rules. + + custom_non_identity_deny_url: The custom URL a user is redirected to when they are denied access to the + application when failing non-identity rules. + + custom_pages: The custom pages that will be displayed when applicable for this application + + destinations: List of destinations secured by Access. This supersedes `self_hosted_domains` to + allow for more flexibility in defining different types of domains. If + `destinations` are provided, then `self_hosted_domains` will be ignored. + + domain: The primary hostname and path secured by Access. This domain will be displayed + if the app is visible in the App Launcher. + + http_only_cookie_attribute: Enables the HttpOnly cookie attribute, which increases security against XSS + attacks. + + logo_url: The image URL for the logo shown in the App Launcher dashboard. + + name: The name of the application. + + oauth_configuration: **Beta:** Optional configuration for managing an OAuth authorization flow + controlled by Access. When set, Access will act as the OAuth authorization + server for this application. Only compatible with OAuth clients that support + [RFC 8707](https://datatracker.ietf.org/doc/html/rfc8707) (Resource Indicators + for OAuth 2.0). This feature is currently in beta. + + options_preflight_bypass: Allows options preflight requests to bypass Access authentication and go + directly to the origin. Cannot turn on if cors_headers is set. + + policies: The policies that Access applies to the application, in ascending order of + precedence. Items can reference existing policies or create new policies + exclusive to the application. + + same_site_cookie_attribute: Sets the SameSite cookie setting, which provides increased security against CSRF + attacks. + + scim_config: Configuration for provisioning to this application via SCIM. This is currently + in closed beta. + + session_duration: The amount of time that tokens issued for this application will be valid. Must + be in the format `300ms` or `2h45m`. Valid time units are: ns, us (or µs), ms, + s, m, h. Note: unsupported for infrastructure type applications. + + tags: The tags you want assigned to an application. Tags are used to filter + applications in the App Launcher dashboard. + + 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 + """ + ... + + async def create( + self, + *, + domain: str | Omit = omit, + type: ApplicationType + | Literal[ + "self_hosted", + "saas", "ssh", "vnc", "app_launcher", @@ -4068,11 +4912,25 @@ async def create( | Iterable[application_create_params.BrowserSSHApplicationDestination] | Iterable[application_create_params.BrowserVNCApplicationDestination] | Iterable[application_create_params.BrowserRdpApplicationDestination] + | Iterable[application_create_params.McpServerApplicationDestination] + | Iterable[application_create_params.McpServerPortalApplicationDestination] | Omit = omit, enable_binding_cookie: bool | Omit = omit, http_only_cookie_attribute: bool | Omit = omit, logo_url: str | Omit = omit, + mfa_config: application_create_params.SelfHostedApplicationMfaConfig + | application_create_params.BrowserSSHApplicationMfaConfig + | application_create_params.BrowserVNCApplicationMfaConfig + | application_create_params.BrowserRdpApplicationMfaConfig + | Omit = omit, name: str | Omit = omit, + oauth_configuration: application_create_params.SelfHostedApplicationOAuthConfiguration + | application_create_params.BrowserSSHApplicationOAuthConfiguration + | application_create_params.BrowserVNCApplicationOAuthConfiguration + | application_create_params.BrowserRdpApplicationOAuthConfiguration + | application_create_params.McpServerApplicationOAuthConfiguration + | application_create_params.McpServerPortalApplicationOAuthConfiguration + | Omit = omit, options_preflight_bypass: bool | Omit = omit, path_cookie_attribute: bool | Omit = omit, policies: SequenceNotStr[application_create_params.SelfHostedApplicationPolicy] @@ -4086,6 +4944,8 @@ async def create( | SequenceNotStr[application_create_params.BookmarkApplicationPolicy] | Iterable[application_create_params.InfrastructureApplicationPolicy] | SequenceNotStr[application_create_params.BrowserRdpApplicationPolicy] + | SequenceNotStr[application_create_params.McpServerApplicationPolicy] + | SequenceNotStr[application_create_params.McpServerPortalApplicationPolicy] | Omit = omit, read_service_tokens_from_header: str | Omit = omit, same_site_cookie_attribute: str | Omit = omit, @@ -4094,6 +4954,8 @@ async def create( | application_create_params.BrowserSSHApplicationSCIMConfig | application_create_params.BrowserVNCApplicationSCIMConfig | application_create_params.BrowserRdpApplicationSCIMConfig + | application_create_params.McpServerApplicationSCIMConfig + | application_create_params.McpServerPortalApplicationSCIMConfig | Omit = omit, self_hosted_domains: SequenceNotStr[SelfHostedDomains] | Omit = omit, service_auth_401_redirect: bool | Omit = omit, @@ -4152,7 +5014,9 @@ async def create( "enable_binding_cookie": enable_binding_cookie, "http_only_cookie_attribute": http_only_cookie_attribute, "logo_url": logo_url, + "mfa_config": mfa_config, "name": name, + "oauth_configuration": oauth_configuration, "options_preflight_bypass": options_preflight_bypass, "path_cookie_attribute": path_cookie_attribute, "policies": policies, @@ -4212,7 +5076,9 @@ async def update( enable_binding_cookie: bool | Omit = omit, http_only_cookie_attribute: bool | Omit = omit, logo_url: str | Omit = omit, + mfa_config: application_update_params.SelfHostedApplicationMfaConfig | Omit = omit, name: str | Omit = omit, + oauth_configuration: application_update_params.SelfHostedApplicationOAuthConfiguration | Omit = omit, options_preflight_bypass: bool | Omit = omit, path_cookie_attribute: bool | Omit = omit, policies: SequenceNotStr[application_update_params.SelfHostedApplicationPolicy] | Omit = omit, @@ -4285,8 +5151,16 @@ async def update( logo_url: The image URL for the logo shown in the App Launcher dashboard. + mfa_config: Configures multi-factor authentication (MFA) settings. + name: The name of the application. + oauth_configuration: **Beta:** Optional configuration for managing an OAuth authorization flow + controlled by Access. When set, Access will act as the OAuth authorization + server for this application. Only compatible with OAuth clients that support + [RFC 8707](https://datatracker.ietf.org/doc/html/rfc8707) (Resource Indicators + for OAuth 2.0). This feature is currently in beta. + options_preflight_bypass: Allows options preflight requests to bypass Access authentication and go directly to the origin. Cannot turn on if cors_headers is set. @@ -4450,7 +5324,9 @@ async def update( enable_binding_cookie: bool | Omit = omit, http_only_cookie_attribute: bool | Omit = omit, logo_url: str | Omit = omit, + mfa_config: application_update_params.BrowserSSHApplicationMfaConfig | Omit = omit, name: str | Omit = omit, + oauth_configuration: application_update_params.BrowserSSHApplicationOAuthConfiguration | Omit = omit, options_preflight_bypass: bool | Omit = omit, path_cookie_attribute: bool | Omit = omit, policies: SequenceNotStr[application_update_params.BrowserSSHApplicationPolicy] | Omit = omit, @@ -4523,8 +5399,16 @@ async def update( logo_url: The image URL for the logo shown in the App Launcher dashboard. + mfa_config: Configures multi-factor authentication (MFA) settings. + name: The name of the application. + oauth_configuration: **Beta:** Optional configuration for managing an OAuth authorization flow + controlled by Access. When set, Access will act as the OAuth authorization + server for this application. Only compatible with OAuth clients that support + [RFC 8707](https://datatracker.ietf.org/doc/html/rfc8707) (Resource Indicators + for OAuth 2.0). This feature is currently in beta. + options_preflight_bypass: Allows options preflight requests to bypass Access authentication and go directly to the origin. Cannot turn on if cors_headers is set. @@ -4617,7 +5501,9 @@ async def update( enable_binding_cookie: bool | Omit = omit, http_only_cookie_attribute: bool | Omit = omit, logo_url: str | Omit = omit, + mfa_config: application_update_params.BrowserVNCApplicationMfaConfig | Omit = omit, name: str | Omit = omit, + oauth_configuration: application_update_params.BrowserVNCApplicationOAuthConfiguration | Omit = omit, options_preflight_bypass: bool | Omit = omit, path_cookie_attribute: bool | Omit = omit, policies: SequenceNotStr[application_update_params.BrowserVNCApplicationPolicy] | Omit = omit, @@ -4690,8 +5576,16 @@ async def update( logo_url: The image URL for the logo shown in the App Launcher dashboard. + mfa_config: Configures multi-factor authentication (MFA) settings. + name: The name of the application. + oauth_configuration: **Beta:** Optional configuration for managing an OAuth authorization flow + controlled by Access. When set, Access will act as the OAuth authorization + server for this application. Only compatible with OAuth clients that support + [RFC 8707](https://datatracker.ietf.org/doc/html/rfc8707) (Resource Indicators + for OAuth 2.0). This feature is currently in beta. + options_preflight_bypass: Allows options preflight requests to bypass Access authentication and go directly to the origin. Cannot turn on if cors_headers is set. @@ -5176,7 +6070,9 @@ async def update( enable_binding_cookie: bool | Omit = omit, http_only_cookie_attribute: bool | Omit = omit, logo_url: str | Omit = omit, + mfa_config: application_update_params.BrowserRdpApplicationMfaConfig | Omit = omit, name: str | Omit = omit, + oauth_configuration: application_update_params.BrowserRdpApplicationOAuthConfiguration | Omit = omit, options_preflight_bypass: bool | Omit = omit, path_cookie_attribute: bool | Omit = omit, policies: SequenceNotStr[application_update_params.BrowserRdpApplicationPolicy] | Omit = omit, @@ -5249,8 +6145,16 @@ async def update( logo_url: The image URL for the logo shown in the App Launcher dashboard. + mfa_config: Configures multi-factor authentication (MFA) settings. + name: The name of the application. + oauth_configuration: **Beta:** Optional configuration for managing an OAuth authorization flow + controlled by Access. When set, Access will act as the OAuth authorization + server for this application. Only compatible with OAuth clients that support + [RFC 8707](https://datatracker.ietf.org/doc/html/rfc8707) (Resource Indicators + for OAuth 2.0). This feature is currently in beta. + options_preflight_bypass: Allows options preflight requests to bypass Access authentication and go directly to the origin. Cannot turn on if cors_headers is set. @@ -5305,6 +6209,238 @@ async def update( """ ... + @overload + async def update( + self, + app_id: AppID, + *, + type: ApplicationType, + account_id: str | Omit = omit, + zone_id: str | Omit = omit, + allow_authenticate_via_warp: bool | Omit = omit, + allowed_idps: SequenceNotStr[AllowedIdPs] | Omit = omit, + auto_redirect_to_identity: bool | Omit = omit, + custom_deny_message: str | Omit = omit, + custom_deny_url: str | Omit = omit, + custom_non_identity_deny_url: str | Omit = omit, + custom_pages: SequenceNotStr[str] | Omit = omit, + destinations: Iterable[application_update_params.McpServerApplicationDestination] | Omit = omit, + http_only_cookie_attribute: bool | Omit = omit, + logo_url: str | Omit = omit, + name: str | Omit = omit, + oauth_configuration: application_update_params.McpServerApplicationOAuthConfiguration | Omit = omit, + options_preflight_bypass: bool | Omit = omit, + policies: SequenceNotStr[application_update_params.McpServerApplicationPolicy] | Omit = omit, + same_site_cookie_attribute: str | Omit = omit, + scim_config: application_update_params.McpServerApplicationSCIMConfig | Omit = omit, + session_duration: str | Omit = omit, + tags: SequenceNotStr[str] | 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, + ) -> Optional[ApplicationUpdateResponse]: + """ + Updates an Access application. + + Args: + app_id: Identifier. + + type: The application type. + + account_id: The Account ID to use for this endpoint. Mutually exclusive with the Zone ID. + + zone_id: The Zone ID to use for this endpoint. Mutually exclusive with the Account ID. + + allow_authenticate_via_warp: When set to true, users can authenticate to this application using their WARP + session. When set to false this application will always require direct IdP + authentication. This setting always overrides the organization setting for WARP + authentication. + + allowed_idps: The identity providers your users can select when connecting to this + application. Defaults to all IdPs configured in your account. + + auto_redirect_to_identity: When set to `true`, users skip the identity provider selection step during + login. You must specify only one identity provider in allowed_idps. + + custom_deny_message: The custom error message shown to a user when they are denied access to the + application. + + custom_deny_url: The custom URL a user is redirected to when they are denied access to the + application when failing identity-based rules. + + custom_non_identity_deny_url: The custom URL a user is redirected to when they are denied access to the + application when failing non-identity rules. + + custom_pages: The custom pages that will be displayed when applicable for this application + + destinations: List of destinations secured by Access. This supersedes `self_hosted_domains` to + allow for more flexibility in defining different types of domains. If + `destinations` are provided, then `self_hosted_domains` will be ignored. + + http_only_cookie_attribute: Enables the HttpOnly cookie attribute, which increases security against XSS + attacks. + + logo_url: The image URL for the logo shown in the App Launcher dashboard. + + name: The name of the application. + + oauth_configuration: **Beta:** Optional configuration for managing an OAuth authorization flow + controlled by Access. When set, Access will act as the OAuth authorization + server for this application. Only compatible with OAuth clients that support + [RFC 8707](https://datatracker.ietf.org/doc/html/rfc8707) (Resource Indicators + for OAuth 2.0). This feature is currently in beta. + + options_preflight_bypass: Allows options preflight requests to bypass Access authentication and go + directly to the origin. Cannot turn on if cors_headers is set. + + policies: The policies that Access applies to the application, in ascending order of + precedence. Items can reference existing policies or create new policies + exclusive to the application. + + same_site_cookie_attribute: Sets the SameSite cookie setting, which provides increased security against CSRF + attacks. + + scim_config: Configuration for provisioning to this application via SCIM. This is currently + in closed beta. + + session_duration: The amount of time that tokens issued for this application will be valid. Must + be in the format `300ms` or `2h45m`. Valid time units are: ns, us (or µs), ms, + s, m, h. Note: unsupported for infrastructure type applications. + + tags: The tags you want assigned to an application. Tags are used to filter + applications in the App Launcher dashboard. + + 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 + """ + ... + + @overload + async def update( + self, + app_id: AppID, + *, + type: ApplicationType, + account_id: str | Omit = omit, + zone_id: str | Omit = omit, + allow_authenticate_via_warp: bool | Omit = omit, + allowed_idps: SequenceNotStr[AllowedIdPs] | Omit = omit, + auto_redirect_to_identity: bool | Omit = omit, + custom_deny_message: str | Omit = omit, + custom_deny_url: str | Omit = omit, + custom_non_identity_deny_url: str | Omit = omit, + custom_pages: SequenceNotStr[str] | Omit = omit, + destinations: Iterable[application_update_params.McpServerPortalApplicationDestination] | Omit = omit, + domain: str | Omit = omit, + http_only_cookie_attribute: bool | Omit = omit, + logo_url: str | Omit = omit, + name: str | Omit = omit, + oauth_configuration: application_update_params.McpServerPortalApplicationOAuthConfiguration | Omit = omit, + options_preflight_bypass: bool | Omit = omit, + policies: SequenceNotStr[application_update_params.McpServerPortalApplicationPolicy] | Omit = omit, + same_site_cookie_attribute: str | Omit = omit, + scim_config: application_update_params.McpServerPortalApplicationSCIMConfig | Omit = omit, + session_duration: str | Omit = omit, + tags: SequenceNotStr[str] | 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, + ) -> Optional[ApplicationUpdateResponse]: + """ + Updates an Access application. + + Args: + app_id: Identifier. + + type: The application type. + + account_id: The Account ID to use for this endpoint. Mutually exclusive with the Zone ID. + + zone_id: The Zone ID to use for this endpoint. Mutually exclusive with the Account ID. + + allow_authenticate_via_warp: When set to true, users can authenticate to this application using their WARP + session. When set to false this application will always require direct IdP + authentication. This setting always overrides the organization setting for WARP + authentication. + + allowed_idps: The identity providers your users can select when connecting to this + application. Defaults to all IdPs configured in your account. + + auto_redirect_to_identity: When set to `true`, users skip the identity provider selection step during + login. You must specify only one identity provider in allowed_idps. + + custom_deny_message: The custom error message shown to a user when they are denied access to the + application. + + custom_deny_url: The custom URL a user is redirected to when they are denied access to the + application when failing identity-based rules. + + custom_non_identity_deny_url: The custom URL a user is redirected to when they are denied access to the + application when failing non-identity rules. + + custom_pages: The custom pages that will be displayed when applicable for this application + + destinations: List of destinations secured by Access. This supersedes `self_hosted_domains` to + allow for more flexibility in defining different types of domains. If + `destinations` are provided, then `self_hosted_domains` will be ignored. + + domain: The primary hostname and path secured by Access. This domain will be displayed + if the app is visible in the App Launcher. + + http_only_cookie_attribute: Enables the HttpOnly cookie attribute, which increases security against XSS + attacks. + + logo_url: The image URL for the logo shown in the App Launcher dashboard. + + name: The name of the application. + + oauth_configuration: **Beta:** Optional configuration for managing an OAuth authorization flow + controlled by Access. When set, Access will act as the OAuth authorization + server for this application. Only compatible with OAuth clients that support + [RFC 8707](https://datatracker.ietf.org/doc/html/rfc8707) (Resource Indicators + for OAuth 2.0). This feature is currently in beta. + + options_preflight_bypass: Allows options preflight requests to bypass Access authentication and go + directly to the origin. Cannot turn on if cors_headers is set. + + policies: The policies that Access applies to the application, in ascending order of + precedence. Items can reference existing policies or create new policies + exclusive to the application. + + same_site_cookie_attribute: Sets the SameSite cookie setting, which provides increased security against CSRF + attacks. + + scim_config: Configuration for provisioning to this application via SCIM. This is currently + in closed beta. + + session_duration: The amount of time that tokens issued for this application will be valid. Must + be in the format `300ms` or `2h45m`. Valid time units are: ns, us (or µs), ms, + s, m, h. Note: unsupported for infrastructure type applications. + + tags: The tags you want assigned to an application. Tags are used to filter + applications in the App Launcher dashboard. + + 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 + """ + ... + async def update( self, app_id: AppID, @@ -5344,11 +6480,25 @@ async def update( | Iterable[application_update_params.BrowserSSHApplicationDestination] | Iterable[application_update_params.BrowserVNCApplicationDestination] | Iterable[application_update_params.BrowserRdpApplicationDestination] + | Iterable[application_update_params.McpServerApplicationDestination] + | Iterable[application_update_params.McpServerPortalApplicationDestination] | Omit = omit, enable_binding_cookie: bool | Omit = omit, http_only_cookie_attribute: bool | Omit = omit, logo_url: str | Omit = omit, + mfa_config: application_update_params.SelfHostedApplicationMfaConfig + | application_update_params.BrowserSSHApplicationMfaConfig + | application_update_params.BrowserVNCApplicationMfaConfig + | application_update_params.BrowserRdpApplicationMfaConfig + | Omit = omit, name: str | Omit = omit, + oauth_configuration: application_update_params.SelfHostedApplicationOAuthConfiguration + | application_update_params.BrowserSSHApplicationOAuthConfiguration + | application_update_params.BrowserVNCApplicationOAuthConfiguration + | application_update_params.BrowserRdpApplicationOAuthConfiguration + | application_update_params.McpServerApplicationOAuthConfiguration + | application_update_params.McpServerPortalApplicationOAuthConfiguration + | Omit = omit, options_preflight_bypass: bool | Omit = omit, path_cookie_attribute: bool | Omit = omit, policies: SequenceNotStr[application_update_params.SelfHostedApplicationPolicy] @@ -5362,6 +6512,8 @@ async def update( | SequenceNotStr[application_update_params.BookmarkApplicationPolicy] | Iterable[application_update_params.InfrastructureApplicationPolicy] | SequenceNotStr[application_update_params.BrowserRdpApplicationPolicy] + | SequenceNotStr[application_update_params.McpServerApplicationPolicy] + | SequenceNotStr[application_update_params.McpServerPortalApplicationPolicy] | Omit = omit, read_service_tokens_from_header: str | Omit = omit, same_site_cookie_attribute: str | Omit = omit, @@ -5370,6 +6522,8 @@ async def update( | application_update_params.BrowserSSHApplicationSCIMConfig | application_update_params.BrowserVNCApplicationSCIMConfig | application_update_params.BrowserRdpApplicationSCIMConfig + | application_update_params.McpServerApplicationSCIMConfig + | application_update_params.McpServerPortalApplicationSCIMConfig | Omit = omit, self_hosted_domains: SequenceNotStr[SelfHostedDomains] | Omit = omit, service_auth_401_redirect: bool | Omit = omit, @@ -5430,7 +6584,9 @@ async def update( "enable_binding_cookie": enable_binding_cookie, "http_only_cookie_attribute": http_only_cookie_attribute, "logo_url": logo_url, + "mfa_config": mfa_config, "name": name, + "oauth_configuration": oauth_configuration, "options_preflight_bypass": options_preflight_bypass, "path_cookie_attribute": path_cookie_attribute, "policies": policies, diff --git a/src/cloudflare/resources/zero_trust/access/applications/policies.py b/src/cloudflare/resources/zero_trust/access/applications/policies.py index 3d403b9ca6c..dc4e33c1cf2 100644 --- a/src/cloudflare/resources/zero_trust/access/applications/policies.py +++ b/src/cloudflare/resources/zero_trust/access/applications/policies.py @@ -59,6 +59,7 @@ def create( approval_groups: Iterable[ApprovalGroupParam] | Omit = omit, approval_required: bool | Omit = omit, isolation_required: bool | Omit = omit, + mfa_config: policy_create_params.MfaConfig | Omit = omit, precedence: int | Omit = omit, purpose_justification_prompt: str | Omit = omit, purpose_justification_required: bool | Omit = omit, @@ -92,6 +93,8 @@ def create( this policy. 'Client Web Isolation' must be on for the account in order to use this feature. + mfa_config: Configures multi-factor authentication (MFA) settings. + precedence: The order of execution for this policy. Must be unique for each policy within an app. @@ -132,6 +135,7 @@ def create( "approval_groups": approval_groups, "approval_required": approval_required, "isolation_required": isolation_required, + "mfa_config": mfa_config, "precedence": precedence, "purpose_justification_prompt": purpose_justification_prompt, "purpose_justification_required": purpose_justification_required, @@ -159,6 +163,7 @@ def update( approval_groups: Iterable[ApprovalGroupParam] | Omit = omit, approval_required: bool | Omit = omit, isolation_required: bool | Omit = omit, + mfa_config: policy_update_params.MfaConfig | Omit = omit, precedence: int | Omit = omit, purpose_justification_prompt: str | Omit = omit, purpose_justification_required: bool | Omit = omit, @@ -193,6 +198,8 @@ def update( this policy. 'Client Web Isolation' must be on for the account in order to use this feature. + mfa_config: Configures multi-factor authentication (MFA) settings. + precedence: The order of execution for this policy. Must be unique for each policy within an app. @@ -235,6 +242,7 @@ def update( "approval_groups": approval_groups, "approval_required": approval_required, "isolation_required": isolation_required, + "mfa_config": mfa_config, "precedence": precedence, "purpose_justification_prompt": purpose_justification_prompt, "purpose_justification_required": purpose_justification_required, @@ -482,6 +490,7 @@ async def create( approval_groups: Iterable[ApprovalGroupParam] | Omit = omit, approval_required: bool | Omit = omit, isolation_required: bool | Omit = omit, + mfa_config: policy_create_params.MfaConfig | Omit = omit, precedence: int | Omit = omit, purpose_justification_prompt: str | Omit = omit, purpose_justification_required: bool | Omit = omit, @@ -515,6 +524,8 @@ async def create( this policy. 'Client Web Isolation' must be on for the account in order to use this feature. + mfa_config: Configures multi-factor authentication (MFA) settings. + precedence: The order of execution for this policy. Must be unique for each policy within an app. @@ -555,6 +566,7 @@ async def create( "approval_groups": approval_groups, "approval_required": approval_required, "isolation_required": isolation_required, + "mfa_config": mfa_config, "precedence": precedence, "purpose_justification_prompt": purpose_justification_prompt, "purpose_justification_required": purpose_justification_required, @@ -582,6 +594,7 @@ async def update( approval_groups: Iterable[ApprovalGroupParam] | Omit = omit, approval_required: bool | Omit = omit, isolation_required: bool | Omit = omit, + mfa_config: policy_update_params.MfaConfig | Omit = omit, precedence: int | Omit = omit, purpose_justification_prompt: str | Omit = omit, purpose_justification_required: bool | Omit = omit, @@ -616,6 +629,8 @@ async def update( this policy. 'Client Web Isolation' must be on for the account in order to use this feature. + mfa_config: Configures multi-factor authentication (MFA) settings. + precedence: The order of execution for this policy. Must be unique for each policy within an app. @@ -658,6 +673,7 @@ async def update( "approval_groups": approval_groups, "approval_required": approval_required, "isolation_required": isolation_required, + "mfa_config": mfa_config, "precedence": precedence, "purpose_justification_prompt": purpose_justification_prompt, "purpose_justification_required": purpose_justification_required, diff --git a/src/cloudflare/resources/zero_trust/access/policies.py b/src/cloudflare/resources/zero_trust/access/policies.py index 8e80d9f3b1d..dbec3f35efd 100644 --- a/src/cloudflare/resources/zero_trust/access/policies.py +++ b/src/cloudflare/resources/zero_trust/access/policies.py @@ -63,6 +63,7 @@ def create( approval_required: bool | Omit = omit, exclude: Iterable[AccessRuleParam] | Omit = omit, isolation_required: bool | Omit = omit, + mfa_config: policy_create_params.MfaConfig | Omit = omit, purpose_justification_prompt: str | Omit = omit, purpose_justification_required: bool | Omit = omit, require: Iterable[AccessRuleParam] | Omit = omit, @@ -100,6 +101,8 @@ def create( this policy. 'Client Web Isolation' must be on for the account in order to use this feature. + mfa_config: Configures multi-factor authentication (MFA) settings. + purpose_justification_prompt: A custom message that will appear on the purpose justification screen. purpose_justification_required: Require users to enter a justification when they log in to the application. @@ -132,6 +135,7 @@ def create( "approval_required": approval_required, "exclude": exclude, "isolation_required": isolation_required, + "mfa_config": mfa_config, "purpose_justification_prompt": purpose_justification_prompt, "purpose_justification_required": purpose_justification_required, "require": require, @@ -161,6 +165,7 @@ def update( approval_required: bool | Omit = omit, exclude: Iterable[AccessRuleParam] | Omit = omit, isolation_required: bool | Omit = omit, + mfa_config: policy_update_params.MfaConfig | Omit = omit, purpose_justification_prompt: str | Omit = omit, purpose_justification_required: bool | Omit = omit, require: Iterable[AccessRuleParam] | Omit = omit, @@ -200,6 +205,8 @@ def update( this policy. 'Client Web Isolation' must be on for the account in order to use this feature. + mfa_config: Configures multi-factor authentication (MFA) settings. + purpose_justification_prompt: A custom message that will appear on the purpose justification screen. purpose_justification_required: Require users to enter a justification when they log in to the application. @@ -234,6 +241,7 @@ def update( "approval_required": approval_required, "exclude": exclude, "isolation_required": isolation_required, + "mfa_config": mfa_config, "purpose_justification_prompt": purpose_justification_prompt, "purpose_justification_required": purpose_justification_required, "require": require, @@ -423,6 +431,7 @@ async def create( approval_required: bool | Omit = omit, exclude: Iterable[AccessRuleParam] | Omit = omit, isolation_required: bool | Omit = omit, + mfa_config: policy_create_params.MfaConfig | Omit = omit, purpose_justification_prompt: str | Omit = omit, purpose_justification_required: bool | Omit = omit, require: Iterable[AccessRuleParam] | Omit = omit, @@ -460,6 +469,8 @@ async def create( this policy. 'Client Web Isolation' must be on for the account in order to use this feature. + mfa_config: Configures multi-factor authentication (MFA) settings. + purpose_justification_prompt: A custom message that will appear on the purpose justification screen. purpose_justification_required: Require users to enter a justification when they log in to the application. @@ -492,6 +503,7 @@ async def create( "approval_required": approval_required, "exclude": exclude, "isolation_required": isolation_required, + "mfa_config": mfa_config, "purpose_justification_prompt": purpose_justification_prompt, "purpose_justification_required": purpose_justification_required, "require": require, @@ -521,6 +533,7 @@ async def update( approval_required: bool | Omit = omit, exclude: Iterable[AccessRuleParam] | Omit = omit, isolation_required: bool | Omit = omit, + mfa_config: policy_update_params.MfaConfig | Omit = omit, purpose_justification_prompt: str | Omit = omit, purpose_justification_required: bool | Omit = omit, require: Iterable[AccessRuleParam] | Omit = omit, @@ -560,6 +573,8 @@ async def update( this policy. 'Client Web Isolation' must be on for the account in order to use this feature. + mfa_config: Configures multi-factor authentication (MFA) settings. + purpose_justification_prompt: A custom message that will appear on the purpose justification screen. purpose_justification_required: Require users to enter a justification when they log in to the application. @@ -594,6 +609,7 @@ async def update( "approval_required": approval_required, "exclude": exclude, "isolation_required": isolation_required, + "mfa_config": mfa_config, "purpose_justification_prompt": purpose_justification_prompt, "purpose_justification_required": purpose_justification_required, "require": require, diff --git a/src/cloudflare/resources/zero_trust/organizations/organizations.py b/src/cloudflare/resources/zero_trust/organizations/organizations.py index 322f37c0f13..9a5730fae56 100644 --- a/src/cloudflare/resources/zero_trust/organizations/organizations.py +++ b/src/cloudflare/resources/zero_trust/organizations/organizations.py @@ -75,6 +75,9 @@ def create( deny_unmatched_requests_exempted_zone_names: SequenceNotStr[str] | Omit = omit, is_ui_read_only: bool | Omit = omit, login_design: LoginDesignParam | Omit = omit, + mfa_config: organization_create_params.MfaConfig | Omit = omit, + mfa_configuration_allowed: bool | Omit = omit, + mfa_required_for_all_apps: bool | Omit = omit, session_duration: str | Omit = omit, ui_read_only_toggle_reason: str | Omit = omit, user_seat_expiration_inactive_time: str | Omit = omit, @@ -118,6 +121,15 @@ def create( is_ui_read_only: Lock all settings as Read-Only in the Dashboard, regardless of user permission. Updates may only be made via the API or Terraform for this account when enabled. + mfa_config: Configures multi-factor authentication (MFA) settings for an organization. + + mfa_configuration_allowed: Indicates if this organization can enforce multi-factor authentication (MFA) + requirements at the application and policy level. + + mfa_required_for_all_apps: Determines whether global MFA settings apply to applications by default. The + organization must have MFA enabled with at least one authentication method and a + session duration configured. + session_duration: The amount of time that tokens issued for applications will be valid. Must be in the format `300ms` or `2h45m`. Valid time units are: ns, us (or µs), ms, s, m, h. @@ -165,6 +177,9 @@ def create( "deny_unmatched_requests_exempted_zone_names": deny_unmatched_requests_exempted_zone_names, "is_ui_read_only": is_ui_read_only, "login_design": login_design, + "mfa_config": mfa_config, + "mfa_configuration_allowed": mfa_configuration_allowed, + "mfa_required_for_all_apps": mfa_required_for_all_apps, "session_duration": session_duration, "ui_read_only_toggle_reason": ui_read_only_toggle_reason, "user_seat_expiration_inactive_time": user_seat_expiration_inactive_time, @@ -195,6 +210,9 @@ def update( deny_unmatched_requests_exempted_zone_names: SequenceNotStr[str] | Omit = omit, is_ui_read_only: bool | Omit = omit, login_design: LoginDesignParam | Omit = omit, + mfa_config: organization_update_params.MfaConfig | Omit = omit, + mfa_configuration_allowed: bool | Omit = omit, + mfa_required_for_all_apps: bool | Omit = omit, name: str | Omit = omit, session_duration: str | Omit = omit, ui_read_only_toggle_reason: str | Omit = omit, @@ -237,6 +255,15 @@ def update( is_ui_read_only: Lock all settings as Read-Only in the Dashboard, regardless of user permission. Updates may only be made via the API or Terraform for this account when enabled. + mfa_config: Configures multi-factor authentication (MFA) settings for an organization. + + mfa_configuration_allowed: Indicates if this organization can enforce multi-factor authentication (MFA) + requirements at the application and policy level. + + mfa_required_for_all_apps: Determines whether global MFA settings apply to applications by default. The + organization must have MFA enabled with at least one authentication method and a + session duration configured. + name: The name of your Zero Trust organization. session_duration: The amount of time that tokens issued for applications will be valid. Must be in @@ -286,6 +313,9 @@ def update( "deny_unmatched_requests_exempted_zone_names": deny_unmatched_requests_exempted_zone_names, "is_ui_read_only": is_ui_read_only, "login_design": login_design, + "mfa_config": mfa_config, + "mfa_configuration_allowed": mfa_configuration_allowed, + "mfa_required_for_all_apps": mfa_required_for_all_apps, "name": name, "session_duration": session_duration, "ui_read_only_toggle_reason": ui_read_only_toggle_reason, @@ -477,6 +507,9 @@ async def create( deny_unmatched_requests_exempted_zone_names: SequenceNotStr[str] | Omit = omit, is_ui_read_only: bool | Omit = omit, login_design: LoginDesignParam | Omit = omit, + mfa_config: organization_create_params.MfaConfig | Omit = omit, + mfa_configuration_allowed: bool | Omit = omit, + mfa_required_for_all_apps: bool | Omit = omit, session_duration: str | Omit = omit, ui_read_only_toggle_reason: str | Omit = omit, user_seat_expiration_inactive_time: str | Omit = omit, @@ -520,6 +553,15 @@ async def create( is_ui_read_only: Lock all settings as Read-Only in the Dashboard, regardless of user permission. Updates may only be made via the API or Terraform for this account when enabled. + mfa_config: Configures multi-factor authentication (MFA) settings for an organization. + + mfa_configuration_allowed: Indicates if this organization can enforce multi-factor authentication (MFA) + requirements at the application and policy level. + + mfa_required_for_all_apps: Determines whether global MFA settings apply to applications by default. The + organization must have MFA enabled with at least one authentication method and a + session duration configured. + session_duration: The amount of time that tokens issued for applications will be valid. Must be in the format `300ms` or `2h45m`. Valid time units are: ns, us (or µs), ms, s, m, h. @@ -567,6 +609,9 @@ async def create( "deny_unmatched_requests_exempted_zone_names": deny_unmatched_requests_exempted_zone_names, "is_ui_read_only": is_ui_read_only, "login_design": login_design, + "mfa_config": mfa_config, + "mfa_configuration_allowed": mfa_configuration_allowed, + "mfa_required_for_all_apps": mfa_required_for_all_apps, "session_duration": session_duration, "ui_read_only_toggle_reason": ui_read_only_toggle_reason, "user_seat_expiration_inactive_time": user_seat_expiration_inactive_time, @@ -597,6 +642,9 @@ async def update( deny_unmatched_requests_exempted_zone_names: SequenceNotStr[str] | Omit = omit, is_ui_read_only: bool | Omit = omit, login_design: LoginDesignParam | Omit = omit, + mfa_config: organization_update_params.MfaConfig | Omit = omit, + mfa_configuration_allowed: bool | Omit = omit, + mfa_required_for_all_apps: bool | Omit = omit, name: str | Omit = omit, session_duration: str | Omit = omit, ui_read_only_toggle_reason: str | Omit = omit, @@ -639,6 +687,15 @@ async def update( is_ui_read_only: Lock all settings as Read-Only in the Dashboard, regardless of user permission. Updates may only be made via the API or Terraform for this account when enabled. + mfa_config: Configures multi-factor authentication (MFA) settings for an organization. + + mfa_configuration_allowed: Indicates if this organization can enforce multi-factor authentication (MFA) + requirements at the application and policy level. + + mfa_required_for_all_apps: Determines whether global MFA settings apply to applications by default. The + organization must have MFA enabled with at least one authentication method and a + session duration configured. + name: The name of your Zero Trust organization. session_duration: The amount of time that tokens issued for applications will be valid. Must be in @@ -688,6 +745,9 @@ async def update( "deny_unmatched_requests_exempted_zone_names": deny_unmatched_requests_exempted_zone_names, "is_ui_read_only": is_ui_read_only, "login_design": login_design, + "mfa_config": mfa_config, + "mfa_configuration_allowed": mfa_configuration_allowed, + "mfa_required_for_all_apps": mfa_required_for_all_apps, "name": name, "session_duration": session_duration, "ui_read_only_toggle_reason": ui_read_only_toggle_reason, diff --git a/src/cloudflare/types/zero_trust/access/application_create_params.py b/src/cloudflare/types/zero_trust/access/application_create_params.py index 499a81de9f2..34f8d715487 100644 --- a/src/cloudflare/types/zero_trust/access/application_create_params.py +++ b/src/cloudflare/types/zero_trust/access/application_create_params.py @@ -2,7 +2,7 @@ from __future__ import annotations -from typing import Dict, Union, Iterable +from typing import Dict, List, Union, Iterable from typing_extensions import Literal, Required, TypeAlias, TypedDict from .decision import Decision @@ -27,9 +27,14 @@ "SelfHostedApplicationDestinationPublicDestination", "SelfHostedApplicationDestinationPrivateDestination", "SelfHostedApplicationDestinationViaMcpServerPortalDestination", + "SelfHostedApplicationMfaConfig", + "SelfHostedApplicationOAuthConfiguration", + "SelfHostedApplicationOAuthConfigurationDynamicClientRegistration", + "SelfHostedApplicationOAuthConfigurationGrant", "SelfHostedApplicationPolicy", "SelfHostedApplicationPolicyAccessAppPolicyLink", "SelfHostedApplicationPolicyUnionMember2", + "SelfHostedApplicationPolicyUnionMember2MfaConfig", "SelfHostedApplicationSCIMConfig", "SelfHostedApplicationSCIMConfigAuthentication", "SelfHostedApplicationSCIMConfigAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken", @@ -39,6 +44,7 @@ "SaaSApplicationPolicy", "SaaSApplicationPolicyAccessAppPolicyLink", "SaaSApplicationPolicyUnionMember2", + "SaaSApplicationPolicyUnionMember2MfaConfig", "SaaSApplicationSaaSApp", "SaaSApplicationSCIMConfig", "SaaSApplicationSCIMConfigAuthentication", @@ -50,9 +56,14 @@ "BrowserSSHApplicationDestinationPublicDestination", "BrowserSSHApplicationDestinationPrivateDestination", "BrowserSSHApplicationDestinationViaMcpServerPortalDestination", + "BrowserSSHApplicationMfaConfig", + "BrowserSSHApplicationOAuthConfiguration", + "BrowserSSHApplicationOAuthConfigurationDynamicClientRegistration", + "BrowserSSHApplicationOAuthConfigurationGrant", "BrowserSSHApplicationPolicy", "BrowserSSHApplicationPolicyAccessAppPolicyLink", "BrowserSSHApplicationPolicyUnionMember2", + "BrowserSSHApplicationPolicyUnionMember2MfaConfig", "BrowserSSHApplicationSCIMConfig", "BrowserSSHApplicationSCIMConfigAuthentication", "BrowserSSHApplicationSCIMConfigAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken", @@ -63,9 +74,14 @@ "BrowserVNCApplicationDestinationPublicDestination", "BrowserVNCApplicationDestinationPrivateDestination", "BrowserVNCApplicationDestinationViaMcpServerPortalDestination", + "BrowserVNCApplicationMfaConfig", + "BrowserVNCApplicationOAuthConfiguration", + "BrowserVNCApplicationOAuthConfigurationDynamicClientRegistration", + "BrowserVNCApplicationOAuthConfigurationGrant", "BrowserVNCApplicationPolicy", "BrowserVNCApplicationPolicyAccessAppPolicyLink", "BrowserVNCApplicationPolicyUnionMember2", + "BrowserVNCApplicationPolicyUnionMember2MfaConfig", "BrowserVNCApplicationSCIMConfig", "BrowserVNCApplicationSCIMConfigAuthentication", "BrowserVNCApplicationSCIMConfigAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken", @@ -77,22 +93,27 @@ "AppLauncherApplicationPolicy", "AppLauncherApplicationPolicyAccessAppPolicyLink", "AppLauncherApplicationPolicyUnionMember2", + "AppLauncherApplicationPolicyUnionMember2MfaConfig", "DeviceEnrollmentPermissionsApplication", "DeviceEnrollmentPermissionsApplicationPolicy", "DeviceEnrollmentPermissionsApplicationPolicyAccessAppPolicyLink", "DeviceEnrollmentPermissionsApplicationPolicyUnionMember2", + "DeviceEnrollmentPermissionsApplicationPolicyUnionMember2MfaConfig", "BrowserIsolationPermissionsApplication", "BrowserIsolationPermissionsApplicationPolicy", "BrowserIsolationPermissionsApplicationPolicyAccessAppPolicyLink", "BrowserIsolationPermissionsApplicationPolicyUnionMember2", + "BrowserIsolationPermissionsApplicationPolicyUnionMember2MfaConfig", "GatewayIdentityProxyEndpointApplication", "GatewayIdentityProxyEndpointApplicationPolicy", "GatewayIdentityProxyEndpointApplicationPolicyAccessAppPolicyLink", "GatewayIdentityProxyEndpointApplicationPolicyUnionMember2", + "GatewayIdentityProxyEndpointApplicationPolicyUnionMember2MfaConfig", "BookmarkApplication", "BookmarkApplicationPolicy", "BookmarkApplicationPolicyAccessAppPolicyLink", "BookmarkApplicationPolicyUnionMember2", + "BookmarkApplicationPolicyUnionMember2MfaConfig", "InfrastructureApplication", "InfrastructureApplicationTargetCriterion", "InfrastructureApplicationPolicy", @@ -104,14 +125,53 @@ "BrowserRdpApplicationDestinationPublicDestination", "BrowserRdpApplicationDestinationPrivateDestination", "BrowserRdpApplicationDestinationViaMcpServerPortalDestination", + "BrowserRdpApplicationMfaConfig", + "BrowserRdpApplicationOAuthConfiguration", + "BrowserRdpApplicationOAuthConfigurationDynamicClientRegistration", + "BrowserRdpApplicationOAuthConfigurationGrant", "BrowserRdpApplicationPolicy", "BrowserRdpApplicationPolicyAccessAppPolicyLink", "BrowserRdpApplicationPolicyUnionMember2", + "BrowserRdpApplicationPolicyUnionMember2MfaConfig", "BrowserRdpApplicationSCIMConfig", "BrowserRdpApplicationSCIMConfigAuthentication", "BrowserRdpApplicationSCIMConfigAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken", "BrowserRdpApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthentication", "BrowserRdpApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken", + "McpServerApplication", + "McpServerApplicationDestination", + "McpServerApplicationDestinationPublicDestination", + "McpServerApplicationDestinationPrivateDestination", + "McpServerApplicationDestinationViaMcpServerPortalDestination", + "McpServerApplicationOAuthConfiguration", + "McpServerApplicationOAuthConfigurationDynamicClientRegistration", + "McpServerApplicationOAuthConfigurationGrant", + "McpServerApplicationPolicy", + "McpServerApplicationPolicyAccessAppPolicyLink", + "McpServerApplicationPolicyUnionMember2", + "McpServerApplicationPolicyUnionMember2MfaConfig", + "McpServerApplicationSCIMConfig", + "McpServerApplicationSCIMConfigAuthentication", + "McpServerApplicationSCIMConfigAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken", + "McpServerApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthentication", + "McpServerApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken", + "McpServerPortalApplication", + "McpServerPortalApplicationDestination", + "McpServerPortalApplicationDestinationPublicDestination", + "McpServerPortalApplicationDestinationPrivateDestination", + "McpServerPortalApplicationDestinationViaMcpServerPortalDestination", + "McpServerPortalApplicationOAuthConfiguration", + "McpServerPortalApplicationOAuthConfigurationDynamicClientRegistration", + "McpServerPortalApplicationOAuthConfigurationGrant", + "McpServerPortalApplicationPolicy", + "McpServerPortalApplicationPolicyAccessAppPolicyLink", + "McpServerPortalApplicationPolicyUnionMember2", + "McpServerPortalApplicationPolicyUnionMember2MfaConfig", + "McpServerPortalApplicationSCIMConfig", + "McpServerPortalApplicationSCIMConfigAuthentication", + "McpServerPortalApplicationSCIMConfigAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken", + "McpServerPortalApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthentication", + "McpServerPortalApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken", ] @@ -205,9 +265,21 @@ class SelfHostedApplication(TypedDict, total=False): logo_url: str """The image URL for the logo shown in the App Launcher dashboard.""" + mfa_config: SelfHostedApplicationMfaConfig + """Configures multi-factor authentication (MFA) settings.""" + name: str """The name of the application.""" + oauth_configuration: SelfHostedApplicationOAuthConfiguration + """ + **Beta:** Optional configuration for managing an OAuth authorization flow + controlled by Access. When set, Access will act as the OAuth authorization + server for this application. Only compatible with OAuth clients that support + [RFC 8707](https://datatracker.ietf.org/doc/html/rfc8707) (Resource Indicators + for OAuth 2.0). This feature is currently in beta. + """ + options_preflight_bypass: bool """ Allows options preflight requests to bypass Access authentication and go @@ -346,6 +418,82 @@ class SelfHostedApplicationDestinationViaMcpServerPortalDestination(TypedDict, t ] +class SelfHostedApplicationMfaConfig(TypedDict, total=False): + """Configures multi-factor authentication (MFA) settings.""" + + allowed_authenticators: List[Literal["totp", "biometrics", "security_key"]] + """Lists the MFA methods that users can authenticate with.""" + + mfa_bypass: bool + """Indicates whether to bypass MFA for this resource. + + This option is available at the application and policy level. + """ + + session_duration: str + """Defines the duration of an MFA session. + + Must be in minutes (m) or hours (h). Minimum: 0m. Maximum: 720h (30 days). + Examples:`5m` or `24h`. + """ + + +class SelfHostedApplicationOAuthConfigurationDynamicClientRegistration(TypedDict, total=False): + """Settings for OAuth dynamic client registration.""" + + allow_any_on_localhost: bool + """Allows any client with redirect URIs on localhost.""" + + allow_any_on_loopback: bool + """Allows any client with redirect URIs on 127.0.0.1.""" + + allowed_uris: SequenceNotStr[str] + """The URIs that are allowed as redirect URIs for dynamically registered clients. + + Must use the `https` protocol. Paths may end in `/*` to match all sub-paths. + """ + + enabled: bool + """Whether dynamic client registration is enabled.""" + + +class SelfHostedApplicationOAuthConfigurationGrant(TypedDict, total=False): + """Settings for OAuth grant behavior.""" + + access_token_lifetime: str + """The lifetime of the access token. + + Must be in the format `300ms` or `2h45m`. Valid time units are ns, us (or µs), + ms, s, m, h. + """ + + session_duration: str + """The duration of the OAuth session. + + Must be in the format `300ms` or `2h45m`. Valid time units are ns, us (or µs), + ms, s, m, h. + """ + + +class SelfHostedApplicationOAuthConfiguration(TypedDict, total=False): + """ + **Beta:** Optional configuration for managing an OAuth authorization flow controlled by Access. When set, Access will act as the OAuth authorization server for this application. Only compatible with OAuth clients that support [RFC 8707](https://datatracker.ietf.org/doc/html/rfc8707) (Resource Indicators for OAuth 2.0). This feature is currently in beta. + """ + + dynamic_client_registration: SelfHostedApplicationOAuthConfigurationDynamicClientRegistration + """Settings for OAuth dynamic client registration.""" + + enabled: bool + """Whether the OAuth configuration is enabled for this application. + + When set to `false`, Access will not handle OAuth for this application. Defaults + to `true` if omitted. + """ + + grant: SelfHostedApplicationOAuthConfigurationGrant + """Settings for OAuth grant behavior.""" + + class SelfHostedApplicationPolicyAccessAppPolicyLink(TypedDict, total=False): """A JSON that links a reusable policy to an application.""" @@ -359,6 +507,26 @@ class SelfHostedApplicationPolicyAccessAppPolicyLink(TypedDict, total=False): """ +class SelfHostedApplicationPolicyUnionMember2MfaConfig(TypedDict, total=False): + """Configures multi-factor authentication (MFA) settings.""" + + allowed_authenticators: List[Literal["totp", "biometrics", "security_key"]] + """Lists the MFA methods that users can authenticate with.""" + + mfa_bypass: bool + """Indicates whether to bypass MFA for this resource. + + This option is available at the application and policy level. + """ + + session_duration: str + """Defines the duration of an MFA session. + + Must be in minutes (m) or hours (h). Minimum: 0m. Maximum: 720h (30 days). + Examples:`5m` or `24h`. + """ + + class SelfHostedApplicationPolicyUnionMember2(TypedDict, total=False): id: str """The UUID of the policy""" @@ -379,6 +547,9 @@ class SelfHostedApplicationPolicyUnionMember2(TypedDict, total=False): this feature. """ + mfa_config: SelfHostedApplicationPolicyUnionMember2MfaConfig + """Configures multi-factor authentication (MFA) settings.""" + precedence: int """The order of execution for this policy. @@ -575,6 +746,26 @@ class SaaSApplicationPolicyAccessAppPolicyLink(TypedDict, total=False): """ +class SaaSApplicationPolicyUnionMember2MfaConfig(TypedDict, total=False): + """Configures multi-factor authentication (MFA) settings.""" + + allowed_authenticators: List[Literal["totp", "biometrics", "security_key"]] + """Lists the MFA methods that users can authenticate with.""" + + mfa_bypass: bool + """Indicates whether to bypass MFA for this resource. + + This option is available at the application and policy level. + """ + + session_duration: str + """Defines the duration of an MFA session. + + Must be in minutes (m) or hours (h). Minimum: 0m. Maximum: 720h (30 days). + Examples:`5m` or `24h`. + """ + + class SaaSApplicationPolicyUnionMember2(TypedDict, total=False): id: str """The UUID of the policy""" @@ -595,6 +786,9 @@ class SaaSApplicationPolicyUnionMember2(TypedDict, total=False): this feature. """ + mfa_config: SaaSApplicationPolicyUnionMember2MfaConfig + """Configures multi-factor authentication (MFA) settings.""" + precedence: int """The order of execution for this policy. @@ -827,9 +1021,21 @@ class BrowserSSHApplication(TypedDict, total=False): logo_url: str """The image URL for the logo shown in the App Launcher dashboard.""" + mfa_config: BrowserSSHApplicationMfaConfig + """Configures multi-factor authentication (MFA) settings.""" + name: str """The name of the application.""" + oauth_configuration: BrowserSSHApplicationOAuthConfiguration + """ + **Beta:** Optional configuration for managing an OAuth authorization flow + controlled by Access. When set, Access will act as the OAuth authorization + server for this application. Only compatible with OAuth clients that support + [RFC 8707](https://datatracker.ietf.org/doc/html/rfc8707) (Resource Indicators + for OAuth 2.0). This feature is currently in beta. + """ + options_preflight_bypass: bool """ Allows options preflight requests to bypass Access authentication and go @@ -968,6 +1174,82 @@ class BrowserSSHApplicationDestinationViaMcpServerPortalDestination(TypedDict, t ] +class BrowserSSHApplicationMfaConfig(TypedDict, total=False): + """Configures multi-factor authentication (MFA) settings.""" + + allowed_authenticators: List[Literal["totp", "biometrics", "security_key"]] + """Lists the MFA methods that users can authenticate with.""" + + mfa_bypass: bool + """Indicates whether to bypass MFA for this resource. + + This option is available at the application and policy level. + """ + + session_duration: str + """Defines the duration of an MFA session. + + Must be in minutes (m) or hours (h). Minimum: 0m. Maximum: 720h (30 days). + Examples:`5m` or `24h`. + """ + + +class BrowserSSHApplicationOAuthConfigurationDynamicClientRegistration(TypedDict, total=False): + """Settings for OAuth dynamic client registration.""" + + allow_any_on_localhost: bool + """Allows any client with redirect URIs on localhost.""" + + allow_any_on_loopback: bool + """Allows any client with redirect URIs on 127.0.0.1.""" + + allowed_uris: SequenceNotStr[str] + """The URIs that are allowed as redirect URIs for dynamically registered clients. + + Must use the `https` protocol. Paths may end in `/*` to match all sub-paths. + """ + + enabled: bool + """Whether dynamic client registration is enabled.""" + + +class BrowserSSHApplicationOAuthConfigurationGrant(TypedDict, total=False): + """Settings for OAuth grant behavior.""" + + access_token_lifetime: str + """The lifetime of the access token. + + Must be in the format `300ms` or `2h45m`. Valid time units are ns, us (or µs), + ms, s, m, h. + """ + + session_duration: str + """The duration of the OAuth session. + + Must be in the format `300ms` or `2h45m`. Valid time units are ns, us (or µs), + ms, s, m, h. + """ + + +class BrowserSSHApplicationOAuthConfiguration(TypedDict, total=False): + """ + **Beta:** Optional configuration for managing an OAuth authorization flow controlled by Access. When set, Access will act as the OAuth authorization server for this application. Only compatible with OAuth clients that support [RFC 8707](https://datatracker.ietf.org/doc/html/rfc8707) (Resource Indicators for OAuth 2.0). This feature is currently in beta. + """ + + dynamic_client_registration: BrowserSSHApplicationOAuthConfigurationDynamicClientRegistration + """Settings for OAuth dynamic client registration.""" + + enabled: bool + """Whether the OAuth configuration is enabled for this application. + + When set to `false`, Access will not handle OAuth for this application. Defaults + to `true` if omitted. + """ + + grant: BrowserSSHApplicationOAuthConfigurationGrant + """Settings for OAuth grant behavior.""" + + class BrowserSSHApplicationPolicyAccessAppPolicyLink(TypedDict, total=False): """A JSON that links a reusable policy to an application.""" @@ -981,6 +1263,26 @@ class BrowserSSHApplicationPolicyAccessAppPolicyLink(TypedDict, total=False): """ +class BrowserSSHApplicationPolicyUnionMember2MfaConfig(TypedDict, total=False): + """Configures multi-factor authentication (MFA) settings.""" + + allowed_authenticators: List[Literal["totp", "biometrics", "security_key"]] + """Lists the MFA methods that users can authenticate with.""" + + mfa_bypass: bool + """Indicates whether to bypass MFA for this resource. + + This option is available at the application and policy level. + """ + + session_duration: str + """Defines the duration of an MFA session. + + Must be in minutes (m) or hours (h). Minimum: 0m. Maximum: 720h (30 days). + Examples:`5m` or `24h`. + """ + + class BrowserSSHApplicationPolicyUnionMember2(TypedDict, total=False): id: str """The UUID of the policy""" @@ -1001,6 +1303,9 @@ class BrowserSSHApplicationPolicyUnionMember2(TypedDict, total=False): this feature. """ + mfa_config: BrowserSSHApplicationPolicyUnionMember2MfaConfig + """Configures multi-factor authentication (MFA) settings.""" + precedence: int """The order of execution for this policy. @@ -1233,9 +1538,21 @@ class BrowserVNCApplication(TypedDict, total=False): logo_url: str """The image URL for the logo shown in the App Launcher dashboard.""" + mfa_config: BrowserVNCApplicationMfaConfig + """Configures multi-factor authentication (MFA) settings.""" + name: str """The name of the application.""" + oauth_configuration: BrowserVNCApplicationOAuthConfiguration + """ + **Beta:** Optional configuration for managing an OAuth authorization flow + controlled by Access. When set, Access will act as the OAuth authorization + server for this application. Only compatible with OAuth clients that support + [RFC 8707](https://datatracker.ietf.org/doc/html/rfc8707) (Resource Indicators + for OAuth 2.0). This feature is currently in beta. + """ + options_preflight_bypass: bool """ Allows options preflight requests to bypass Access authentication and go @@ -1374,6 +1691,82 @@ class BrowserVNCApplicationDestinationViaMcpServerPortalDestination(TypedDict, t ] +class BrowserVNCApplicationMfaConfig(TypedDict, total=False): + """Configures multi-factor authentication (MFA) settings.""" + + allowed_authenticators: List[Literal["totp", "biometrics", "security_key"]] + """Lists the MFA methods that users can authenticate with.""" + + mfa_bypass: bool + """Indicates whether to bypass MFA for this resource. + + This option is available at the application and policy level. + """ + + session_duration: str + """Defines the duration of an MFA session. + + Must be in minutes (m) or hours (h). Minimum: 0m. Maximum: 720h (30 days). + Examples:`5m` or `24h`. + """ + + +class BrowserVNCApplicationOAuthConfigurationDynamicClientRegistration(TypedDict, total=False): + """Settings for OAuth dynamic client registration.""" + + allow_any_on_localhost: bool + """Allows any client with redirect URIs on localhost.""" + + allow_any_on_loopback: bool + """Allows any client with redirect URIs on 127.0.0.1.""" + + allowed_uris: SequenceNotStr[str] + """The URIs that are allowed as redirect URIs for dynamically registered clients. + + Must use the `https` protocol. Paths may end in `/*` to match all sub-paths. + """ + + enabled: bool + """Whether dynamic client registration is enabled.""" + + +class BrowserVNCApplicationOAuthConfigurationGrant(TypedDict, total=False): + """Settings for OAuth grant behavior.""" + + access_token_lifetime: str + """The lifetime of the access token. + + Must be in the format `300ms` or `2h45m`. Valid time units are ns, us (or µs), + ms, s, m, h. + """ + + session_duration: str + """The duration of the OAuth session. + + Must be in the format `300ms` or `2h45m`. Valid time units are ns, us (or µs), + ms, s, m, h. + """ + + +class BrowserVNCApplicationOAuthConfiguration(TypedDict, total=False): + """ + **Beta:** Optional configuration for managing an OAuth authorization flow controlled by Access. When set, Access will act as the OAuth authorization server for this application. Only compatible with OAuth clients that support [RFC 8707](https://datatracker.ietf.org/doc/html/rfc8707) (Resource Indicators for OAuth 2.0). This feature is currently in beta. + """ + + dynamic_client_registration: BrowserVNCApplicationOAuthConfigurationDynamicClientRegistration + """Settings for OAuth dynamic client registration.""" + + enabled: bool + """Whether the OAuth configuration is enabled for this application. + + When set to `false`, Access will not handle OAuth for this application. Defaults + to `true` if omitted. + """ + + grant: BrowserVNCApplicationOAuthConfigurationGrant + """Settings for OAuth grant behavior.""" + + class BrowserVNCApplicationPolicyAccessAppPolicyLink(TypedDict, total=False): """A JSON that links a reusable policy to an application.""" @@ -1387,6 +1780,26 @@ class BrowserVNCApplicationPolicyAccessAppPolicyLink(TypedDict, total=False): """ +class BrowserVNCApplicationPolicyUnionMember2MfaConfig(TypedDict, total=False): + """Configures multi-factor authentication (MFA) settings.""" + + allowed_authenticators: List[Literal["totp", "biometrics", "security_key"]] + """Lists the MFA methods that users can authenticate with.""" + + mfa_bypass: bool + """Indicates whether to bypass MFA for this resource. + + This option is available at the application and policy level. + """ + + session_duration: str + """Defines the duration of an MFA session. + + Must be in minutes (m) or hours (h). Minimum: 0m. Maximum: 720h (30 days). + Examples:`5m` or `24h`. + """ + + class BrowserVNCApplicationPolicyUnionMember2(TypedDict, total=False): id: str """The UUID of the policy""" @@ -1407,6 +1820,9 @@ class BrowserVNCApplicationPolicyUnionMember2(TypedDict, total=False): this feature. """ + mfa_config: BrowserVNCApplicationPolicyUnionMember2MfaConfig + """Configures multi-factor authentication (MFA) settings.""" + precedence: int """The order of execution for this policy. @@ -1661,6 +2077,26 @@ class AppLauncherApplicationPolicyAccessAppPolicyLink(TypedDict, total=False): """ +class AppLauncherApplicationPolicyUnionMember2MfaConfig(TypedDict, total=False): + """Configures multi-factor authentication (MFA) settings.""" + + allowed_authenticators: List[Literal["totp", "biometrics", "security_key"]] + """Lists the MFA methods that users can authenticate with.""" + + mfa_bypass: bool + """Indicates whether to bypass MFA for this resource. + + This option is available at the application and policy level. + """ + + session_duration: str + """Defines the duration of an MFA session. + + Must be in minutes (m) or hours (h). Minimum: 0m. Maximum: 720h (30 days). + Examples:`5m` or `24h`. + """ + + class AppLauncherApplicationPolicyUnionMember2(TypedDict, total=False): id: str """The UUID of the policy""" @@ -1681,6 +2117,9 @@ class AppLauncherApplicationPolicyUnionMember2(TypedDict, total=False): this feature. """ + mfa_config: AppLauncherApplicationPolicyUnionMember2MfaConfig + """Configures multi-factor authentication (MFA) settings.""" + precedence: int """The order of execution for this policy. @@ -1773,6 +2212,26 @@ class DeviceEnrollmentPermissionsApplicationPolicyAccessAppPolicyLink(TypedDict, """ +class DeviceEnrollmentPermissionsApplicationPolicyUnionMember2MfaConfig(TypedDict, total=False): + """Configures multi-factor authentication (MFA) settings.""" + + allowed_authenticators: List[Literal["totp", "biometrics", "security_key"]] + """Lists the MFA methods that users can authenticate with.""" + + mfa_bypass: bool + """Indicates whether to bypass MFA for this resource. + + This option is available at the application and policy level. + """ + + session_duration: str + """Defines the duration of an MFA session. + + Must be in minutes (m) or hours (h). Minimum: 0m. Maximum: 720h (30 days). + Examples:`5m` or `24h`. + """ + + class DeviceEnrollmentPermissionsApplicationPolicyUnionMember2(TypedDict, total=False): id: str """The UUID of the policy""" @@ -1793,6 +2252,9 @@ class DeviceEnrollmentPermissionsApplicationPolicyUnionMember2(TypedDict, total= this feature. """ + mfa_config: DeviceEnrollmentPermissionsApplicationPolicyUnionMember2MfaConfig + """Configures multi-factor authentication (MFA) settings.""" + precedence: int """The order of execution for this policy. @@ -1887,6 +2349,26 @@ class BrowserIsolationPermissionsApplicationPolicyAccessAppPolicyLink(TypedDict, """ +class BrowserIsolationPermissionsApplicationPolicyUnionMember2MfaConfig(TypedDict, total=False): + """Configures multi-factor authentication (MFA) settings.""" + + allowed_authenticators: List[Literal["totp", "biometrics", "security_key"]] + """Lists the MFA methods that users can authenticate with.""" + + mfa_bypass: bool + """Indicates whether to bypass MFA for this resource. + + This option is available at the application and policy level. + """ + + session_duration: str + """Defines the duration of an MFA session. + + Must be in minutes (m) or hours (h). Minimum: 0m. Maximum: 720h (30 days). + Examples:`5m` or `24h`. + """ + + class BrowserIsolationPermissionsApplicationPolicyUnionMember2(TypedDict, total=False): id: str """The UUID of the policy""" @@ -1907,6 +2389,9 @@ class BrowserIsolationPermissionsApplicationPolicyUnionMember2(TypedDict, total= this feature. """ + mfa_config: BrowserIsolationPermissionsApplicationPolicyUnionMember2MfaConfig + """Configures multi-factor authentication (MFA) settings.""" + precedence: int """The order of execution for this policy. @@ -2010,6 +2495,26 @@ class GatewayIdentityProxyEndpointApplicationPolicyAccessAppPolicyLink(TypedDict """ +class GatewayIdentityProxyEndpointApplicationPolicyUnionMember2MfaConfig(TypedDict, total=False): + """Configures multi-factor authentication (MFA) settings.""" + + allowed_authenticators: List[Literal["totp", "biometrics", "security_key"]] + """Lists the MFA methods that users can authenticate with.""" + + mfa_bypass: bool + """Indicates whether to bypass MFA for this resource. + + This option is available at the application and policy level. + """ + + session_duration: str + """Defines the duration of an MFA session. + + Must be in minutes (m) or hours (h). Minimum: 0m. Maximum: 720h (30 days). + Examples:`5m` or `24h`. + """ + + class GatewayIdentityProxyEndpointApplicationPolicyUnionMember2(TypedDict, total=False): id: str """The UUID of the policy""" @@ -2030,6 +2535,9 @@ class GatewayIdentityProxyEndpointApplicationPolicyUnionMember2(TypedDict, total this feature. """ + mfa_config: GatewayIdentityProxyEndpointApplicationPolicyUnionMember2MfaConfig + """Configures multi-factor authentication (MFA) settings.""" + precedence: int """The order of execution for this policy. @@ -2106,6 +2614,26 @@ class BookmarkApplicationPolicyAccessAppPolicyLink(TypedDict, total=False): """ +class BookmarkApplicationPolicyUnionMember2MfaConfig(TypedDict, total=False): + """Configures multi-factor authentication (MFA) settings.""" + + allowed_authenticators: List[Literal["totp", "biometrics", "security_key"]] + """Lists the MFA methods that users can authenticate with.""" + + mfa_bypass: bool + """Indicates whether to bypass MFA for this resource. + + This option is available at the application and policy level. + """ + + session_duration: str + """Defines the duration of an MFA session. + + Must be in minutes (m) or hours (h). Minimum: 0m. Maximum: 720h (30 days). + Examples:`5m` or `24h`. + """ + + class BookmarkApplicationPolicyUnionMember2(TypedDict, total=False): id: str """The UUID of the policy""" @@ -2126,6 +2654,9 @@ class BookmarkApplicationPolicyUnionMember2(TypedDict, total=False): this feature. """ + mfa_config: BookmarkApplicationPolicyUnionMember2MfaConfig + """Configures multi-factor authentication (MFA) settings.""" + precedence: int """The order of execution for this policy. @@ -2335,9 +2866,21 @@ class BrowserRdpApplication(TypedDict, total=False): logo_url: str """The image URL for the logo shown in the App Launcher dashboard.""" + mfa_config: BrowserRdpApplicationMfaConfig + """Configures multi-factor authentication (MFA) settings.""" + name: str """The name of the application.""" + oauth_configuration: BrowserRdpApplicationOAuthConfiguration + """ + **Beta:** Optional configuration for managing an OAuth authorization flow + controlled by Access. When set, Access will act as the OAuth authorization + server for this application. Only compatible with OAuth clients that support + [RFC 8707](https://datatracker.ietf.org/doc/html/rfc8707) (Resource Indicators + for OAuth 2.0). This feature is currently in beta. + """ + options_preflight_bypass: bool """ Allows options preflight requests to bypass Access authentication and go @@ -2490,39 +3033,138 @@ class BrowserRdpApplicationDestinationViaMcpServerPortalDestination(TypedDict, t ] -class BrowserRdpApplicationPolicyAccessAppPolicyLink(TypedDict, total=False): - """A JSON that links a reusable policy to an application.""" +class BrowserRdpApplicationMfaConfig(TypedDict, total=False): + """Configures multi-factor authentication (MFA) settings.""" - id: str - """The UUID of the policy""" + allowed_authenticators: List[Literal["totp", "biometrics", "security_key"]] + """Lists the MFA methods that users can authenticate with.""" - precedence: int - """The order of execution for this policy. + mfa_bypass: bool + """Indicates whether to bypass MFA for this resource. - Must be unique for each policy within an app. + This option is available at the application and policy level. """ + session_duration: str + """Defines the duration of an MFA session. -class BrowserRdpApplicationPolicyUnionMember2(TypedDict, total=False): - id: str - """The UUID of the policy""" + Must be in minutes (m) or hours (h). Minimum: 0m. Maximum: 720h (30 days). + Examples:`5m` or `24h`. + """ - approval_groups: Iterable[ApprovalGroupParam] - """Administrators who can approve a temporary authentication request.""" - approval_required: bool - """ - Requires the user to request access from an administrator at the start of each - session. - """ +class BrowserRdpApplicationOAuthConfigurationDynamicClientRegistration(TypedDict, total=False): + """Settings for OAuth dynamic client registration.""" - isolation_required: bool - """ + allow_any_on_localhost: bool + """Allows any client with redirect URIs on localhost.""" + + allow_any_on_loopback: bool + """Allows any client with redirect URIs on 127.0.0.1.""" + + allowed_uris: SequenceNotStr[str] + """The URIs that are allowed as redirect URIs for dynamically registered clients. + + Must use the `https` protocol. Paths may end in `/*` to match all sub-paths. + """ + + enabled: bool + """Whether dynamic client registration is enabled.""" + + +class BrowserRdpApplicationOAuthConfigurationGrant(TypedDict, total=False): + """Settings for OAuth grant behavior.""" + + access_token_lifetime: str + """The lifetime of the access token. + + Must be in the format `300ms` or `2h45m`. Valid time units are ns, us (or µs), + ms, s, m, h. + """ + + session_duration: str + """The duration of the OAuth session. + + Must be in the format `300ms` or `2h45m`. Valid time units are ns, us (or µs), + ms, s, m, h. + """ + + +class BrowserRdpApplicationOAuthConfiguration(TypedDict, total=False): + """ + **Beta:** Optional configuration for managing an OAuth authorization flow controlled by Access. When set, Access will act as the OAuth authorization server for this application. Only compatible with OAuth clients that support [RFC 8707](https://datatracker.ietf.org/doc/html/rfc8707) (Resource Indicators for OAuth 2.0). This feature is currently in beta. + """ + + dynamic_client_registration: BrowserRdpApplicationOAuthConfigurationDynamicClientRegistration + """Settings for OAuth dynamic client registration.""" + + enabled: bool + """Whether the OAuth configuration is enabled for this application. + + When set to `false`, Access will not handle OAuth for this application. Defaults + to `true` if omitted. + """ + + grant: BrowserRdpApplicationOAuthConfigurationGrant + """Settings for OAuth grant behavior.""" + + +class BrowserRdpApplicationPolicyAccessAppPolicyLink(TypedDict, total=False): + """A JSON that links a reusable policy to an application.""" + + id: str + """The UUID of the policy""" + + precedence: int + """The order of execution for this policy. + + Must be unique for each policy within an app. + """ + + +class BrowserRdpApplicationPolicyUnionMember2MfaConfig(TypedDict, total=False): + """Configures multi-factor authentication (MFA) settings.""" + + allowed_authenticators: List[Literal["totp", "biometrics", "security_key"]] + """Lists the MFA methods that users can authenticate with.""" + + mfa_bypass: bool + """Indicates whether to bypass MFA for this resource. + + This option is available at the application and policy level. + """ + + session_duration: str + """Defines the duration of an MFA session. + + Must be in minutes (m) or hours (h). Minimum: 0m. Maximum: 720h (30 days). + Examples:`5m` or `24h`. + """ + + +class BrowserRdpApplicationPolicyUnionMember2(TypedDict, total=False): + id: str + """The UUID of the policy""" + + approval_groups: Iterable[ApprovalGroupParam] + """Administrators who can approve a temporary authentication request.""" + + approval_required: bool + """ + Requires the user to request access from an administrator at the start of each + session. + """ + + isolation_required: bool + """ Require this application to be served in an isolated browser for users matching this policy. 'Client Web Isolation' must be on for the account in order to use this feature. """ + mfa_config: BrowserRdpApplicationPolicyUnionMember2MfaConfig + """Configures multi-factor authentication (MFA) settings.""" + precedence: int """The order of execution for this policy. @@ -2648,6 +3290,848 @@ class BrowserRdpApplicationSCIMConfig(TypedDict, total=False): """ +class McpServerApplication(TypedDict, total=False): + type: Required[ApplicationType] + """The application type.""" + + account_id: str + """The Account ID to use for this endpoint. Mutually exclusive with the Zone ID.""" + + zone_id: str + """The Zone ID to use for this endpoint. Mutually exclusive with the Account ID.""" + + allow_authenticate_via_warp: bool + """ + When set to true, users can authenticate to this application using their WARP + session. When set to false this application will always require direct IdP + authentication. This setting always overrides the organization setting for WARP + authentication. + """ + + allowed_idps: SequenceNotStr[AllowedIdPs] + """The identity providers your users can select when connecting to this + application. + + Defaults to all IdPs configured in your account. + """ + + auto_redirect_to_identity: bool + """When set to `true`, users skip the identity provider selection step during + login. + + You must specify only one identity provider in allowed_idps. + """ + + custom_deny_message: str + """ + The custom error message shown to a user when they are denied access to the + application. + """ + + custom_deny_url: str + """ + The custom URL a user is redirected to when they are denied access to the + application when failing identity-based rules. + """ + + custom_non_identity_deny_url: str + """ + The custom URL a user is redirected to when they are denied access to the + application when failing non-identity rules. + """ + + custom_pages: SequenceNotStr[str] + """The custom pages that will be displayed when applicable for this application""" + + destinations: Iterable[McpServerApplicationDestination] + """List of destinations secured by Access. + + This supersedes `self_hosted_domains` to allow for more flexibility in defining + different types of domains. If `destinations` are provided, then + `self_hosted_domains` will be ignored. + """ + + http_only_cookie_attribute: bool + """ + Enables the HttpOnly cookie attribute, which increases security against XSS + attacks. + """ + + logo_url: str + """The image URL for the logo shown in the App Launcher dashboard.""" + + name: str + """The name of the application.""" + + oauth_configuration: McpServerApplicationOAuthConfiguration + """ + **Beta:** Optional configuration for managing an OAuth authorization flow + controlled by Access. When set, Access will act as the OAuth authorization + server for this application. Only compatible with OAuth clients that support + [RFC 8707](https://datatracker.ietf.org/doc/html/rfc8707) (Resource Indicators + for OAuth 2.0). This feature is currently in beta. + """ + + options_preflight_bypass: bool + """ + Allows options preflight requests to bypass Access authentication and go + directly to the origin. Cannot turn on if cors_headers is set. + """ + + policies: SequenceNotStr[McpServerApplicationPolicy] + """ + The policies that Access applies to the application, in ascending order of + precedence. Items can reference existing policies or create new policies + exclusive to the application. + """ + + same_site_cookie_attribute: str + """ + Sets the SameSite cookie setting, which provides increased security against CSRF + attacks. + """ + + scim_config: McpServerApplicationSCIMConfig + """Configuration for provisioning to this application via SCIM. + + This is currently in closed beta. + """ + + session_duration: str + """The amount of time that tokens issued for this application will be valid. + + Must be in the format `300ms` or `2h45m`. Valid time units are: ns, us (or µs), + ms, s, m, h. Note: unsupported for infrastructure type applications. + """ + + tags: SequenceNotStr[str] + """The tags you want assigned to an application. + + Tags are used to filter applications in the App Launcher dashboard. + """ + + +class McpServerApplicationDestinationPublicDestination(TypedDict, total=False): + """A public hostname that Access will secure. + + Public destinations support sub-domain and path. Wildcard '*' can be used in the definition. + """ + + type: Literal["public"] + + uri: str + """The URI of the destination. + + Public destinations' URIs can include a domain and path with + [wildcards](https://developers.cloudflare.com/cloudflare-one/policies/access/app-paths/). + """ + + +class McpServerApplicationDestinationPrivateDestination(TypedDict, total=False): + cidr: str + """The CIDR range of the destination. Single IPs will be computed as /32.""" + + hostname: str + """The hostname of the destination. Matches a valid SNI served by an HTTPS origin.""" + + l4_protocol: Literal["tcp", "udp"] + """The L4 protocol of the destination. + + When omitted, both UDP and TCP traffic will match. + """ + + port_range: str + """The port range of the destination. + + Can be a single port or a range of ports. When omitted, all ports will match. + """ + + type: Literal["private"] + + vnet_id: str + """The VNET ID to match the destination. When omitted, all VNETs will match.""" + + +class McpServerApplicationDestinationViaMcpServerPortalDestination(TypedDict, total=False): + """A MCP server id configured in ai-controls. + + Access will secure the MCP server if accessed through a MCP portal. + """ + + mcp_server_id: str + """The MCP server id configured in ai-controls.""" + + type: Literal["via_mcp_server_portal"] + + +McpServerApplicationDestination: TypeAlias = Union[ + McpServerApplicationDestinationPublicDestination, + McpServerApplicationDestinationPrivateDestination, + McpServerApplicationDestinationViaMcpServerPortalDestination, +] + + +class McpServerApplicationOAuthConfigurationDynamicClientRegistration(TypedDict, total=False): + """Settings for OAuth dynamic client registration.""" + + allow_any_on_localhost: bool + """Allows any client with redirect URIs on localhost.""" + + allow_any_on_loopback: bool + """Allows any client with redirect URIs on 127.0.0.1.""" + + allowed_uris: SequenceNotStr[str] + """The URIs that are allowed as redirect URIs for dynamically registered clients. + + Must use the `https` protocol. Paths may end in `/*` to match all sub-paths. + """ + + enabled: bool + """Whether dynamic client registration is enabled.""" + + +class McpServerApplicationOAuthConfigurationGrant(TypedDict, total=False): + """Settings for OAuth grant behavior.""" + + access_token_lifetime: str + """The lifetime of the access token. + + Must be in the format `300ms` or `2h45m`. Valid time units are ns, us (or µs), + ms, s, m, h. + """ + + session_duration: str + """The duration of the OAuth session. + + Must be in the format `300ms` or `2h45m`. Valid time units are ns, us (or µs), + ms, s, m, h. + """ + + +class McpServerApplicationOAuthConfiguration(TypedDict, total=False): + """ + **Beta:** Optional configuration for managing an OAuth authorization flow controlled by Access. When set, Access will act as the OAuth authorization server for this application. Only compatible with OAuth clients that support [RFC 8707](https://datatracker.ietf.org/doc/html/rfc8707) (Resource Indicators for OAuth 2.0). This feature is currently in beta. + """ + + dynamic_client_registration: McpServerApplicationOAuthConfigurationDynamicClientRegistration + """Settings for OAuth dynamic client registration.""" + + enabled: bool + """Whether the OAuth configuration is enabled for this application. + + When set to `false`, Access will not handle OAuth for this application. Defaults + to `true` if omitted. + """ + + grant: McpServerApplicationOAuthConfigurationGrant + """Settings for OAuth grant behavior.""" + + +class McpServerApplicationPolicyAccessAppPolicyLink(TypedDict, total=False): + """A JSON that links a reusable policy to an application.""" + + id: str + """The UUID of the policy""" + + precedence: int + """The order of execution for this policy. + + Must be unique for each policy within an app. + """ + + +class McpServerApplicationPolicyUnionMember2MfaConfig(TypedDict, total=False): + """Configures multi-factor authentication (MFA) settings.""" + + allowed_authenticators: List[Literal["totp", "biometrics", "security_key"]] + """Lists the MFA methods that users can authenticate with.""" + + mfa_bypass: bool + """Indicates whether to bypass MFA for this resource. + + This option is available at the application and policy level. + """ + + session_duration: str + """Defines the duration of an MFA session. + + Must be in minutes (m) or hours (h). Minimum: 0m. Maximum: 720h (30 days). + Examples:`5m` or `24h`. + """ + + +class McpServerApplicationPolicyUnionMember2(TypedDict, total=False): + id: str + """The UUID of the policy""" + + approval_groups: Iterable[ApprovalGroupParam] + """Administrators who can approve a temporary authentication request.""" + + approval_required: bool + """ + Requires the user to request access from an administrator at the start of each + session. + """ + + isolation_required: bool + """ + Require this application to be served in an isolated browser for users matching + this policy. 'Client Web Isolation' must be on for the account in order to use + this feature. + """ + + mfa_config: McpServerApplicationPolicyUnionMember2MfaConfig + """Configures multi-factor authentication (MFA) settings.""" + + precedence: int + """The order of execution for this policy. + + Must be unique for each policy within an app. + """ + + purpose_justification_prompt: str + """A custom message that will appear on the purpose justification screen.""" + + purpose_justification_required: bool + """Require users to enter a justification when they log in to the application.""" + + session_duration: str + """The amount of time that tokens issued for the application will be valid. + + Must be in the format `300ms` or `2h45m`. Valid time units are: ns, us (or µs), + ms, s, m, h. + """ + + +McpServerApplicationPolicy: TypeAlias = Union[ + McpServerApplicationPolicyAccessAppPolicyLink, str, McpServerApplicationPolicyUnionMember2 +] + + +class McpServerApplicationSCIMConfigAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken( + TypedDict, total=False +): + """ + Attributes for configuring Access Service Token authentication scheme for SCIM provisioning to an application. + """ + + client_id: Required[str] + """ + Client ID of the Access service token used to authenticate with the remote + service. + """ + + client_secret: Required[str] + """ + Client secret of the Access service token used to authenticate with the remote + service. + """ + + scheme: Required[Literal["access_service_token"]] + """The authentication scheme to use when making SCIM requests to this application.""" + + +class McpServerApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken( + TypedDict, total=False +): + """ + Attributes for configuring Access Service Token authentication scheme for SCIM provisioning to an application. + """ + + client_id: Required[str] + """ + Client ID of the Access service token used to authenticate with the remote + service. + """ + + client_secret: Required[str] + """ + Client secret of the Access service token used to authenticate with the remote + service. + """ + + scheme: Required[Literal["access_service_token"]] + """The authentication scheme to use when making SCIM requests to this application.""" + + +McpServerApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthentication: TypeAlias = Union[ + SCIMConfigAuthenticationHTTPBasicParam, + SCIMConfigAuthenticationOAuthBearerTokenParam, + SCIMConfigAuthenticationOauth2Param, + McpServerApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken, +] + +McpServerApplicationSCIMConfigAuthentication: TypeAlias = Union[ + SCIMConfigAuthenticationHTTPBasicParam, + SCIMConfigAuthenticationOAuthBearerTokenParam, + SCIMConfigAuthenticationOauth2Param, + McpServerApplicationSCIMConfigAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken, + Iterable[McpServerApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthentication], +] + + +class McpServerApplicationSCIMConfig(TypedDict, total=False): + """Configuration for provisioning to this application via SCIM. + + This is currently in closed beta. + """ + + idp_uid: Required[str] + """ + The UID of the IdP to use as the source for SCIM resources to provision to this + application. + """ + + remote_uri: Required[str] + """The base URI for the application's SCIM-compatible API.""" + + authentication: McpServerApplicationSCIMConfigAuthentication + """ + Attributes for configuring HTTP Basic authentication scheme for SCIM + provisioning to an application. + """ + + deactivate_on_delete: bool + """ + If false, propagates DELETE requests to the target application for SCIM + resources. If true, sets 'active' to false on the SCIM resource. Note: Some + targets do not support DELETE operations. + """ + + enabled: bool + """Whether SCIM provisioning is turned on for this application.""" + + mappings: Iterable[SCIMConfigMappingParam] + """ + A list of mappings to apply to SCIM resources before provisioning them in this + application. These can transform or filter the resources to be provisioned. + """ + + +class McpServerPortalApplication(TypedDict, total=False): + type: Required[ApplicationType] + """The application type.""" + + account_id: str + """The Account ID to use for this endpoint. Mutually exclusive with the Zone ID.""" + + zone_id: str + """The Zone ID to use for this endpoint. Mutually exclusive with the Account ID.""" + + allow_authenticate_via_warp: bool + """ + When set to true, users can authenticate to this application using their WARP + session. When set to false this application will always require direct IdP + authentication. This setting always overrides the organization setting for WARP + authentication. + """ + + allowed_idps: SequenceNotStr[AllowedIdPs] + """The identity providers your users can select when connecting to this + application. + + Defaults to all IdPs configured in your account. + """ + + auto_redirect_to_identity: bool + """When set to `true`, users skip the identity provider selection step during + login. + + You must specify only one identity provider in allowed_idps. + """ + + custom_deny_message: str + """ + The custom error message shown to a user when they are denied access to the + application. + """ + + custom_deny_url: str + """ + The custom URL a user is redirected to when they are denied access to the + application when failing identity-based rules. + """ + + custom_non_identity_deny_url: str + """ + The custom URL a user is redirected to when they are denied access to the + application when failing non-identity rules. + """ + + custom_pages: SequenceNotStr[str] + """The custom pages that will be displayed when applicable for this application""" + + destinations: Iterable[McpServerPortalApplicationDestination] + """List of destinations secured by Access. + + This supersedes `self_hosted_domains` to allow for more flexibility in defining + different types of domains. If `destinations` are provided, then + `self_hosted_domains` will be ignored. + """ + + domain: str + """The primary hostname and path secured by Access. + + This domain will be displayed if the app is visible in the App Launcher. + """ + + http_only_cookie_attribute: bool + """ + Enables the HttpOnly cookie attribute, which increases security against XSS + attacks. + """ + + logo_url: str + """The image URL for the logo shown in the App Launcher dashboard.""" + + name: str + """The name of the application.""" + + oauth_configuration: McpServerPortalApplicationOAuthConfiguration + """ + **Beta:** Optional configuration for managing an OAuth authorization flow + controlled by Access. When set, Access will act as the OAuth authorization + server for this application. Only compatible with OAuth clients that support + [RFC 8707](https://datatracker.ietf.org/doc/html/rfc8707) (Resource Indicators + for OAuth 2.0). This feature is currently in beta. + """ + + options_preflight_bypass: bool + """ + Allows options preflight requests to bypass Access authentication and go + directly to the origin. Cannot turn on if cors_headers is set. + """ + + policies: SequenceNotStr[McpServerPortalApplicationPolicy] + """ + The policies that Access applies to the application, in ascending order of + precedence. Items can reference existing policies or create new policies + exclusive to the application. + """ + + same_site_cookie_attribute: str + """ + Sets the SameSite cookie setting, which provides increased security against CSRF + attacks. + """ + + scim_config: McpServerPortalApplicationSCIMConfig + """Configuration for provisioning to this application via SCIM. + + This is currently in closed beta. + """ + + session_duration: str + """The amount of time that tokens issued for this application will be valid. + + Must be in the format `300ms` or `2h45m`. Valid time units are: ns, us (or µs), + ms, s, m, h. Note: unsupported for infrastructure type applications. + """ + + tags: SequenceNotStr[str] + """The tags you want assigned to an application. + + Tags are used to filter applications in the App Launcher dashboard. + """ + + +class McpServerPortalApplicationDestinationPublicDestination(TypedDict, total=False): + """A public hostname that Access will secure. + + Public destinations support sub-domain and path. Wildcard '*' can be used in the definition. + """ + + type: Literal["public"] + + uri: str + """The URI of the destination. + + Public destinations' URIs can include a domain and path with + [wildcards](https://developers.cloudflare.com/cloudflare-one/policies/access/app-paths/). + """ + + +class McpServerPortalApplicationDestinationPrivateDestination(TypedDict, total=False): + cidr: str + """The CIDR range of the destination. Single IPs will be computed as /32.""" + + hostname: str + """The hostname of the destination. Matches a valid SNI served by an HTTPS origin.""" + + l4_protocol: Literal["tcp", "udp"] + """The L4 protocol of the destination. + + When omitted, both UDP and TCP traffic will match. + """ + + port_range: str + """The port range of the destination. + + Can be a single port or a range of ports. When omitted, all ports will match. + """ + + type: Literal["private"] + + vnet_id: str + """The VNET ID to match the destination. When omitted, all VNETs will match.""" + + +class McpServerPortalApplicationDestinationViaMcpServerPortalDestination(TypedDict, total=False): + """A MCP server id configured in ai-controls. + + Access will secure the MCP server if accessed through a MCP portal. + """ + + mcp_server_id: str + """The MCP server id configured in ai-controls.""" + + type: Literal["via_mcp_server_portal"] + + +McpServerPortalApplicationDestination: TypeAlias = Union[ + McpServerPortalApplicationDestinationPublicDestination, + McpServerPortalApplicationDestinationPrivateDestination, + McpServerPortalApplicationDestinationViaMcpServerPortalDestination, +] + + +class McpServerPortalApplicationOAuthConfigurationDynamicClientRegistration(TypedDict, total=False): + """Settings for OAuth dynamic client registration.""" + + allow_any_on_localhost: bool + """Allows any client with redirect URIs on localhost.""" + + allow_any_on_loopback: bool + """Allows any client with redirect URIs on 127.0.0.1.""" + + allowed_uris: SequenceNotStr[str] + """The URIs that are allowed as redirect URIs for dynamically registered clients. + + Must use the `https` protocol. Paths may end in `/*` to match all sub-paths. + """ + + enabled: bool + """Whether dynamic client registration is enabled.""" + + +class McpServerPortalApplicationOAuthConfigurationGrant(TypedDict, total=False): + """Settings for OAuth grant behavior.""" + + access_token_lifetime: str + """The lifetime of the access token. + + Must be in the format `300ms` or `2h45m`. Valid time units are ns, us (or µs), + ms, s, m, h. + """ + + session_duration: str + """The duration of the OAuth session. + + Must be in the format `300ms` or `2h45m`. Valid time units are ns, us (or µs), + ms, s, m, h. + """ + + +class McpServerPortalApplicationOAuthConfiguration(TypedDict, total=False): + """ + **Beta:** Optional configuration for managing an OAuth authorization flow controlled by Access. When set, Access will act as the OAuth authorization server for this application. Only compatible with OAuth clients that support [RFC 8707](https://datatracker.ietf.org/doc/html/rfc8707) (Resource Indicators for OAuth 2.0). This feature is currently in beta. + """ + + dynamic_client_registration: McpServerPortalApplicationOAuthConfigurationDynamicClientRegistration + """Settings for OAuth dynamic client registration.""" + + enabled: bool + """Whether the OAuth configuration is enabled for this application. + + When set to `false`, Access will not handle OAuth for this application. Defaults + to `true` if omitted. + """ + + grant: McpServerPortalApplicationOAuthConfigurationGrant + """Settings for OAuth grant behavior.""" + + +class McpServerPortalApplicationPolicyAccessAppPolicyLink(TypedDict, total=False): + """A JSON that links a reusable policy to an application.""" + + id: str + """The UUID of the policy""" + + precedence: int + """The order of execution for this policy. + + Must be unique for each policy within an app. + """ + + +class McpServerPortalApplicationPolicyUnionMember2MfaConfig(TypedDict, total=False): + """Configures multi-factor authentication (MFA) settings.""" + + allowed_authenticators: List[Literal["totp", "biometrics", "security_key"]] + """Lists the MFA methods that users can authenticate with.""" + + mfa_bypass: bool + """Indicates whether to bypass MFA for this resource. + + This option is available at the application and policy level. + """ + + session_duration: str + """Defines the duration of an MFA session. + + Must be in minutes (m) or hours (h). Minimum: 0m. Maximum: 720h (30 days). + Examples:`5m` or `24h`. + """ + + +class McpServerPortalApplicationPolicyUnionMember2(TypedDict, total=False): + id: str + """The UUID of the policy""" + + approval_groups: Iterable[ApprovalGroupParam] + """Administrators who can approve a temporary authentication request.""" + + approval_required: bool + """ + Requires the user to request access from an administrator at the start of each + session. + """ + + isolation_required: bool + """ + Require this application to be served in an isolated browser for users matching + this policy. 'Client Web Isolation' must be on for the account in order to use + this feature. + """ + + mfa_config: McpServerPortalApplicationPolicyUnionMember2MfaConfig + """Configures multi-factor authentication (MFA) settings.""" + + precedence: int + """The order of execution for this policy. + + Must be unique for each policy within an app. + """ + + purpose_justification_prompt: str + """A custom message that will appear on the purpose justification screen.""" + + purpose_justification_required: bool + """Require users to enter a justification when they log in to the application.""" + + session_duration: str + """The amount of time that tokens issued for the application will be valid. + + Must be in the format `300ms` or `2h45m`. Valid time units are: ns, us (or µs), + ms, s, m, h. + """ + + +McpServerPortalApplicationPolicy: TypeAlias = Union[ + McpServerPortalApplicationPolicyAccessAppPolicyLink, str, McpServerPortalApplicationPolicyUnionMember2 +] + + +class McpServerPortalApplicationSCIMConfigAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken( + TypedDict, total=False +): + """ + Attributes for configuring Access Service Token authentication scheme for SCIM provisioning to an application. + """ + + client_id: Required[str] + """ + Client ID of the Access service token used to authenticate with the remote + service. + """ + + client_secret: Required[str] + """ + Client secret of the Access service token used to authenticate with the remote + service. + """ + + scheme: Required[Literal["access_service_token"]] + """The authentication scheme to use when making SCIM requests to this application.""" + + +class McpServerPortalApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken( + TypedDict, total=False +): + """ + Attributes for configuring Access Service Token authentication scheme for SCIM provisioning to an application. + """ + + client_id: Required[str] + """ + Client ID of the Access service token used to authenticate with the remote + service. + """ + + client_secret: Required[str] + """ + Client secret of the Access service token used to authenticate with the remote + service. + """ + + scheme: Required[Literal["access_service_token"]] + """The authentication scheme to use when making SCIM requests to this application.""" + + +McpServerPortalApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthentication: TypeAlias = Union[ + SCIMConfigAuthenticationHTTPBasicParam, + SCIMConfigAuthenticationOAuthBearerTokenParam, + SCIMConfigAuthenticationOauth2Param, + McpServerPortalApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken, +] + +McpServerPortalApplicationSCIMConfigAuthentication: TypeAlias = Union[ + SCIMConfigAuthenticationHTTPBasicParam, + SCIMConfigAuthenticationOAuthBearerTokenParam, + SCIMConfigAuthenticationOauth2Param, + McpServerPortalApplicationSCIMConfigAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken, + Iterable[McpServerPortalApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthentication], +] + + +class McpServerPortalApplicationSCIMConfig(TypedDict, total=False): + """Configuration for provisioning to this application via SCIM. + + This is currently in closed beta. + """ + + idp_uid: Required[str] + """ + The UID of the IdP to use as the source for SCIM resources to provision to this + application. + """ + + remote_uri: Required[str] + """The base URI for the application's SCIM-compatible API.""" + + authentication: McpServerPortalApplicationSCIMConfigAuthentication + """ + Attributes for configuring HTTP Basic authentication scheme for SCIM + provisioning to an application. + """ + + deactivate_on_delete: bool + """ + If false, propagates DELETE requests to the target application for SCIM + resources. If true, sets 'active' to false on the SCIM resource. Note: Some + targets do not support DELETE operations. + """ + + enabled: bool + """Whether SCIM provisioning is turned on for this application.""" + + mappings: Iterable[SCIMConfigMappingParam] + """ + A list of mappings to apply to SCIM resources before provisioning them in this + application. These can transform or filter the resources to be provisioned. + """ + + ApplicationCreateParams: TypeAlias = Union[ SelfHostedApplication, SaaSApplication, @@ -2660,4 +4144,6 @@ class BrowserRdpApplicationSCIMConfig(TypedDict, total=False): BookmarkApplication, InfrastructureApplication, BrowserRdpApplication, + McpServerApplication, + McpServerPortalApplication, ] diff --git a/src/cloudflare/types/zero_trust/access/application_create_response.py b/src/cloudflare/types/zero_trust/access/application_create_response.py index 6b51726834d..30a68f431f9 100644 --- a/src/cloudflare/types/zero_trust/access/application_create_response.py +++ b/src/cloudflare/types/zero_trust/access/application_create_response.py @@ -26,7 +26,12 @@ "SelfHostedApplicationDestinationPublicDestination", "SelfHostedApplicationDestinationPrivateDestination", "SelfHostedApplicationDestinationViaMcpServerPortalDestination", + "SelfHostedApplicationMfaConfig", + "SelfHostedApplicationOAuthConfiguration", + "SelfHostedApplicationOAuthConfigurationDynamicClientRegistration", + "SelfHostedApplicationOAuthConfigurationGrant", "SelfHostedApplicationPolicy", + "SelfHostedApplicationPolicyMfaConfig", "SelfHostedApplicationSCIMConfig", "SelfHostedApplicationSCIMConfigAuthentication", "SelfHostedApplicationSCIMConfigAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken", @@ -34,6 +39,7 @@ "SelfHostedApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken", "SaaSApplication", "SaaSApplicationPolicy", + "SaaSApplicationPolicyMfaConfig", "SaaSApplicationSaaSApp", "SaaSApplicationSCIMConfig", "SaaSApplicationSCIMConfigAuthentication", @@ -45,7 +51,12 @@ "BrowserSSHApplicationDestinationPublicDestination", "BrowserSSHApplicationDestinationPrivateDestination", "BrowserSSHApplicationDestinationViaMcpServerPortalDestination", + "BrowserSSHApplicationMfaConfig", + "BrowserSSHApplicationOAuthConfiguration", + "BrowserSSHApplicationOAuthConfigurationDynamicClientRegistration", + "BrowserSSHApplicationOAuthConfigurationGrant", "BrowserSSHApplicationPolicy", + "BrowserSSHApplicationPolicyMfaConfig", "BrowserSSHApplicationSCIMConfig", "BrowserSSHApplicationSCIMConfigAuthentication", "BrowserSSHApplicationSCIMConfigAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken", @@ -56,7 +67,12 @@ "BrowserVNCApplicationDestinationPublicDestination", "BrowserVNCApplicationDestinationPrivateDestination", "BrowserVNCApplicationDestinationViaMcpServerPortalDestination", + "BrowserVNCApplicationMfaConfig", + "BrowserVNCApplicationOAuthConfiguration", + "BrowserVNCApplicationOAuthConfigurationDynamicClientRegistration", + "BrowserVNCApplicationOAuthConfigurationGrant", "BrowserVNCApplicationPolicy", + "BrowserVNCApplicationPolicyMfaConfig", "BrowserVNCApplicationSCIMConfig", "BrowserVNCApplicationSCIMConfigAuthentication", "BrowserVNCApplicationSCIMConfigAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken", @@ -66,14 +82,19 @@ "AppLauncherApplicationFooterLink", "AppLauncherApplicationLandingPageDesign", "AppLauncherApplicationPolicy", + "AppLauncherApplicationPolicyMfaConfig", "DeviceEnrollmentPermissionsApplication", "DeviceEnrollmentPermissionsApplicationPolicy", + "DeviceEnrollmentPermissionsApplicationPolicyMfaConfig", "BrowserIsolationPermissionsApplication", "BrowserIsolationPermissionsApplicationPolicy", + "BrowserIsolationPermissionsApplicationPolicyMfaConfig", "GatewayIdentityProxyEndpointApplication", "GatewayIdentityProxyEndpointApplicationPolicy", + "GatewayIdentityProxyEndpointApplicationPolicyMfaConfig", "BookmarkApplication", "BookmarkApplicationPolicy", + "BookmarkApplicationPolicyMfaConfig", "InfrastructureApplication", "InfrastructureApplicationTargetCriterion", "InfrastructureApplicationPolicy", @@ -85,12 +106,47 @@ "BrowserRdpApplicationDestinationPublicDestination", "BrowserRdpApplicationDestinationPrivateDestination", "BrowserRdpApplicationDestinationViaMcpServerPortalDestination", + "BrowserRdpApplicationMfaConfig", + "BrowserRdpApplicationOAuthConfiguration", + "BrowserRdpApplicationOAuthConfigurationDynamicClientRegistration", + "BrowserRdpApplicationOAuthConfigurationGrant", "BrowserRdpApplicationPolicy", + "BrowserRdpApplicationPolicyMfaConfig", "BrowserRdpApplicationSCIMConfig", "BrowserRdpApplicationSCIMConfigAuthentication", "BrowserRdpApplicationSCIMConfigAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken", "BrowserRdpApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthentication", "BrowserRdpApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken", + "McpServerApplication", + "McpServerApplicationDestination", + "McpServerApplicationDestinationPublicDestination", + "McpServerApplicationDestinationPrivateDestination", + "McpServerApplicationDestinationViaMcpServerPortalDestination", + "McpServerApplicationOAuthConfiguration", + "McpServerApplicationOAuthConfigurationDynamicClientRegistration", + "McpServerApplicationOAuthConfigurationGrant", + "McpServerApplicationPolicy", + "McpServerApplicationPolicyMfaConfig", + "McpServerApplicationSCIMConfig", + "McpServerApplicationSCIMConfigAuthentication", + "McpServerApplicationSCIMConfigAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken", + "McpServerApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthentication", + "McpServerApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken", + "McpServerPortalApplication", + "McpServerPortalApplicationDestination", + "McpServerPortalApplicationDestinationPublicDestination", + "McpServerPortalApplicationDestinationPrivateDestination", + "McpServerPortalApplicationDestinationViaMcpServerPortalDestination", + "McpServerPortalApplicationOAuthConfiguration", + "McpServerPortalApplicationOAuthConfigurationDynamicClientRegistration", + "McpServerPortalApplicationOAuthConfigurationGrant", + "McpServerPortalApplicationPolicy", + "McpServerPortalApplicationPolicyMfaConfig", + "McpServerPortalApplicationSCIMConfig", + "McpServerPortalApplicationSCIMConfigAuthentication", + "McpServerPortalApplicationSCIMConfigAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken", + "McpServerPortalApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthentication", + "McpServerPortalApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken", ] @@ -154,6 +210,102 @@ class SelfHostedApplicationDestinationViaMcpServerPortalDestination(BaseModel): ] +class SelfHostedApplicationMfaConfig(BaseModel): + """Configures multi-factor authentication (MFA) settings.""" + + allowed_authenticators: Optional[List[Literal["totp", "biometrics", "security_key"]]] = None + """Lists the MFA methods that users can authenticate with.""" + + mfa_bypass: Optional[bool] = None + """Indicates whether to bypass MFA for this resource. + + This option is available at the application and policy level. + """ + + session_duration: Optional[str] = None + """Defines the duration of an MFA session. + + Must be in minutes (m) or hours (h). Minimum: 0m. Maximum: 720h (30 days). + Examples:`5m` or `24h`. + """ + + +class SelfHostedApplicationOAuthConfigurationDynamicClientRegistration(BaseModel): + """Settings for OAuth dynamic client registration.""" + + allow_any_on_localhost: Optional[bool] = None + """Allows any client with redirect URIs on localhost.""" + + allow_any_on_loopback: Optional[bool] = None + """Allows any client with redirect URIs on 127.0.0.1.""" + + allowed_uris: Optional[List[str]] = None + """The URIs that are allowed as redirect URIs for dynamically registered clients. + + Must use the `https` protocol. Paths may end in `/*` to match all sub-paths. + """ + + enabled: Optional[bool] = None + """Whether dynamic client registration is enabled.""" + + +class SelfHostedApplicationOAuthConfigurationGrant(BaseModel): + """Settings for OAuth grant behavior.""" + + access_token_lifetime: Optional[str] = None + """The lifetime of the access token. + + Must be in the format `300ms` or `2h45m`. Valid time units are ns, us (or µs), + ms, s, m, h. + """ + + session_duration: Optional[str] = None + """The duration of the OAuth session. + + Must be in the format `300ms` or `2h45m`. Valid time units are ns, us (or µs), + ms, s, m, h. + """ + + +class SelfHostedApplicationOAuthConfiguration(BaseModel): + """ + **Beta:** Optional configuration for managing an OAuth authorization flow controlled by Access. When set, Access will act as the OAuth authorization server for this application. Only compatible with OAuth clients that support [RFC 8707](https://datatracker.ietf.org/doc/html/rfc8707) (Resource Indicators for OAuth 2.0). This feature is currently in beta. + """ + + dynamic_client_registration: Optional[SelfHostedApplicationOAuthConfigurationDynamicClientRegistration] = None + """Settings for OAuth dynamic client registration.""" + + enabled: Optional[bool] = None + """Whether the OAuth configuration is enabled for this application. + + When set to `false`, Access will not handle OAuth for this application. Defaults + to `true` if omitted. + """ + + grant: Optional[SelfHostedApplicationOAuthConfigurationGrant] = None + """Settings for OAuth grant behavior.""" + + +class SelfHostedApplicationPolicyMfaConfig(BaseModel): + """Configures multi-factor authentication (MFA) settings.""" + + allowed_authenticators: Optional[List[Literal["totp", "biometrics", "security_key"]]] = None + """Lists the MFA methods that users can authenticate with.""" + + mfa_bypass: Optional[bool] = None + """Indicates whether to bypass MFA for this resource. + + This option is available at the application and policy level. + """ + + session_duration: Optional[str] = None + """Defines the duration of an MFA session. + + Must be in minutes (m) or hours (h). Minimum: 0m. Maximum: 720h (30 days). + Examples:`5m` or `24h`. + """ + + class SelfHostedApplicationPolicy(BaseModel): id: Optional[str] = None """The UUID of the policy""" @@ -194,6 +346,9 @@ class SelfHostedApplicationPolicy(BaseModel): this feature. """ + mfa_config: Optional[SelfHostedApplicationPolicyMfaConfig] = None + """Configures multi-factor authentication (MFA) settings.""" + name: Optional[str] = None """The name of the Access policy.""" @@ -413,9 +568,21 @@ class SelfHostedApplication(BaseModel): logo_url: Optional[str] = None """The image URL for the logo shown in the App Launcher dashboard.""" + mfa_config: Optional[SelfHostedApplicationMfaConfig] = None + """Configures multi-factor authentication (MFA) settings.""" + name: Optional[str] = None """The name of the application.""" + oauth_configuration: Optional[SelfHostedApplicationOAuthConfiguration] = None + """ + **Beta:** Optional configuration for managing an OAuth authorization flow + controlled by Access. When set, Access will act as the OAuth authorization + server for this application. Only compatible with OAuth clients that support + [RFC 8707](https://datatracker.ietf.org/doc/html/rfc8707) (Resource Indicators + for OAuth 2.0). This feature is currently in beta. + """ + options_preflight_bypass: Optional[bool] = None """ Allows options preflight requests to bypass Access authentication and go @@ -489,6 +656,26 @@ class SelfHostedApplication(BaseModel): """ +class SaaSApplicationPolicyMfaConfig(BaseModel): + """Configures multi-factor authentication (MFA) settings.""" + + allowed_authenticators: Optional[List[Literal["totp", "biometrics", "security_key"]]] = None + """Lists the MFA methods that users can authenticate with.""" + + mfa_bypass: Optional[bool] = None + """Indicates whether to bypass MFA for this resource. + + This option is available at the application and policy level. + """ + + session_duration: Optional[str] = None + """Defines the duration of an MFA session. + + Must be in minutes (m) or hours (h). Minimum: 0m. Maximum: 720h (30 days). + Examples:`5m` or `24h`. + """ + + class SaaSApplicationPolicy(BaseModel): id: Optional[str] = None """The UUID of the policy""" @@ -529,6 +716,9 @@ class SaaSApplicationPolicy(BaseModel): this feature. """ + mfa_config: Optional[SaaSApplicationPolicyMfaConfig] = None + """Configures multi-factor authentication (MFA) settings.""" + name: Optional[str] = None """The name of the Access policy.""" @@ -774,6 +964,102 @@ class BrowserSSHApplicationDestinationViaMcpServerPortalDestination(BaseModel): ] +class BrowserSSHApplicationMfaConfig(BaseModel): + """Configures multi-factor authentication (MFA) settings.""" + + allowed_authenticators: Optional[List[Literal["totp", "biometrics", "security_key"]]] = None + """Lists the MFA methods that users can authenticate with.""" + + mfa_bypass: Optional[bool] = None + """Indicates whether to bypass MFA for this resource. + + This option is available at the application and policy level. + """ + + session_duration: Optional[str] = None + """Defines the duration of an MFA session. + + Must be in minutes (m) or hours (h). Minimum: 0m. Maximum: 720h (30 days). + Examples:`5m` or `24h`. + """ + + +class BrowserSSHApplicationOAuthConfigurationDynamicClientRegistration(BaseModel): + """Settings for OAuth dynamic client registration.""" + + allow_any_on_localhost: Optional[bool] = None + """Allows any client with redirect URIs on localhost.""" + + allow_any_on_loopback: Optional[bool] = None + """Allows any client with redirect URIs on 127.0.0.1.""" + + allowed_uris: Optional[List[str]] = None + """The URIs that are allowed as redirect URIs for dynamically registered clients. + + Must use the `https` protocol. Paths may end in `/*` to match all sub-paths. + """ + + enabled: Optional[bool] = None + """Whether dynamic client registration is enabled.""" + + +class BrowserSSHApplicationOAuthConfigurationGrant(BaseModel): + """Settings for OAuth grant behavior.""" + + access_token_lifetime: Optional[str] = None + """The lifetime of the access token. + + Must be in the format `300ms` or `2h45m`. Valid time units are ns, us (or µs), + ms, s, m, h. + """ + + session_duration: Optional[str] = None + """The duration of the OAuth session. + + Must be in the format `300ms` or `2h45m`. Valid time units are ns, us (or µs), + ms, s, m, h. + """ + + +class BrowserSSHApplicationOAuthConfiguration(BaseModel): + """ + **Beta:** Optional configuration for managing an OAuth authorization flow controlled by Access. When set, Access will act as the OAuth authorization server for this application. Only compatible with OAuth clients that support [RFC 8707](https://datatracker.ietf.org/doc/html/rfc8707) (Resource Indicators for OAuth 2.0). This feature is currently in beta. + """ + + dynamic_client_registration: Optional[BrowserSSHApplicationOAuthConfigurationDynamicClientRegistration] = None + """Settings for OAuth dynamic client registration.""" + + enabled: Optional[bool] = None + """Whether the OAuth configuration is enabled for this application. + + When set to `false`, Access will not handle OAuth for this application. Defaults + to `true` if omitted. + """ + + grant: Optional[BrowserSSHApplicationOAuthConfigurationGrant] = None + """Settings for OAuth grant behavior.""" + + +class BrowserSSHApplicationPolicyMfaConfig(BaseModel): + """Configures multi-factor authentication (MFA) settings.""" + + allowed_authenticators: Optional[List[Literal["totp", "biometrics", "security_key"]]] = None + """Lists the MFA methods that users can authenticate with.""" + + mfa_bypass: Optional[bool] = None + """Indicates whether to bypass MFA for this resource. + + This option is available at the application and policy level. + """ + + session_duration: Optional[str] = None + """Defines the duration of an MFA session. + + Must be in minutes (m) or hours (h). Minimum: 0m. Maximum: 720h (30 days). + Examples:`5m` or `24h`. + """ + + class BrowserSSHApplicationPolicy(BaseModel): id: Optional[str] = None """The UUID of the policy""" @@ -814,6 +1100,9 @@ class BrowserSSHApplicationPolicy(BaseModel): this feature. """ + mfa_config: Optional[BrowserSSHApplicationPolicyMfaConfig] = None + """Configures multi-factor authentication (MFA) settings.""" + name: Optional[str] = None """The name of the Access policy.""" @@ -1048,9 +1337,21 @@ class BrowserSSHApplication(BaseModel): logo_url: Optional[str] = None """The image URL for the logo shown in the App Launcher dashboard.""" + mfa_config: Optional[BrowserSSHApplicationMfaConfig] = None + """Configures multi-factor authentication (MFA) settings.""" + name: Optional[str] = None """The name of the application.""" + oauth_configuration: Optional[BrowserSSHApplicationOAuthConfiguration] = None + """ + **Beta:** Optional configuration for managing an OAuth authorization flow + controlled by Access. When set, Access will act as the OAuth authorization + server for this application. Only compatible with OAuth clients that support + [RFC 8707](https://datatracker.ietf.org/doc/html/rfc8707) (Resource Indicators + for OAuth 2.0). This feature is currently in beta. + """ + options_preflight_bypass: Optional[bool] = None """ Allows options preflight requests to bypass Access authentication and go @@ -1184,6 +1485,102 @@ class BrowserVNCApplicationDestinationViaMcpServerPortalDestination(BaseModel): ] +class BrowserVNCApplicationMfaConfig(BaseModel): + """Configures multi-factor authentication (MFA) settings.""" + + allowed_authenticators: Optional[List[Literal["totp", "biometrics", "security_key"]]] = None + """Lists the MFA methods that users can authenticate with.""" + + mfa_bypass: Optional[bool] = None + """Indicates whether to bypass MFA for this resource. + + This option is available at the application and policy level. + """ + + session_duration: Optional[str] = None + """Defines the duration of an MFA session. + + Must be in minutes (m) or hours (h). Minimum: 0m. Maximum: 720h (30 days). + Examples:`5m` or `24h`. + """ + + +class BrowserVNCApplicationOAuthConfigurationDynamicClientRegistration(BaseModel): + """Settings for OAuth dynamic client registration.""" + + allow_any_on_localhost: Optional[bool] = None + """Allows any client with redirect URIs on localhost.""" + + allow_any_on_loopback: Optional[bool] = None + """Allows any client with redirect URIs on 127.0.0.1.""" + + allowed_uris: Optional[List[str]] = None + """The URIs that are allowed as redirect URIs for dynamically registered clients. + + Must use the `https` protocol. Paths may end in `/*` to match all sub-paths. + """ + + enabled: Optional[bool] = None + """Whether dynamic client registration is enabled.""" + + +class BrowserVNCApplicationOAuthConfigurationGrant(BaseModel): + """Settings for OAuth grant behavior.""" + + access_token_lifetime: Optional[str] = None + """The lifetime of the access token. + + Must be in the format `300ms` or `2h45m`. Valid time units are ns, us (or µs), + ms, s, m, h. + """ + + session_duration: Optional[str] = None + """The duration of the OAuth session. + + Must be in the format `300ms` or `2h45m`. Valid time units are ns, us (or µs), + ms, s, m, h. + """ + + +class BrowserVNCApplicationOAuthConfiguration(BaseModel): + """ + **Beta:** Optional configuration for managing an OAuth authorization flow controlled by Access. When set, Access will act as the OAuth authorization server for this application. Only compatible with OAuth clients that support [RFC 8707](https://datatracker.ietf.org/doc/html/rfc8707) (Resource Indicators for OAuth 2.0). This feature is currently in beta. + """ + + dynamic_client_registration: Optional[BrowserVNCApplicationOAuthConfigurationDynamicClientRegistration] = None + """Settings for OAuth dynamic client registration.""" + + enabled: Optional[bool] = None + """Whether the OAuth configuration is enabled for this application. + + When set to `false`, Access will not handle OAuth for this application. Defaults + to `true` if omitted. + """ + + grant: Optional[BrowserVNCApplicationOAuthConfigurationGrant] = None + """Settings for OAuth grant behavior.""" + + +class BrowserVNCApplicationPolicyMfaConfig(BaseModel): + """Configures multi-factor authentication (MFA) settings.""" + + allowed_authenticators: Optional[List[Literal["totp", "biometrics", "security_key"]]] = None + """Lists the MFA methods that users can authenticate with.""" + + mfa_bypass: Optional[bool] = None + """Indicates whether to bypass MFA for this resource. + + This option is available at the application and policy level. + """ + + session_duration: Optional[str] = None + """Defines the duration of an MFA session. + + Must be in minutes (m) or hours (h). Minimum: 0m. Maximum: 720h (30 days). + Examples:`5m` or `24h`. + """ + + class BrowserVNCApplicationPolicy(BaseModel): id: Optional[str] = None """The UUID of the policy""" @@ -1224,6 +1621,9 @@ class BrowserVNCApplicationPolicy(BaseModel): this feature. """ + mfa_config: Optional[BrowserVNCApplicationPolicyMfaConfig] = None + """Configures multi-factor authentication (MFA) settings.""" + name: Optional[str] = None """The name of the Access policy.""" @@ -1458,9 +1858,21 @@ class BrowserVNCApplication(BaseModel): logo_url: Optional[str] = None """The image URL for the logo shown in the App Launcher dashboard.""" + mfa_config: Optional[BrowserVNCApplicationMfaConfig] = None + """Configures multi-factor authentication (MFA) settings.""" + name: Optional[str] = None """The name of the application.""" + oauth_configuration: Optional[BrowserVNCApplicationOAuthConfiguration] = None + """ + **Beta:** Optional configuration for managing an OAuth authorization flow + controlled by Access. When set, Access will act as the OAuth authorization + server for this application. Only compatible with OAuth clients that support + [RFC 8707](https://datatracker.ietf.org/doc/html/rfc8707) (Resource Indicators + for OAuth 2.0). This feature is currently in beta. + """ + options_preflight_bypass: Optional[bool] = None """ Allows options preflight requests to bypass Access authentication and go @@ -1561,6 +1973,26 @@ class AppLauncherApplicationLandingPageDesign(BaseModel): """The title shown on the landing page.""" +class AppLauncherApplicationPolicyMfaConfig(BaseModel): + """Configures multi-factor authentication (MFA) settings.""" + + allowed_authenticators: Optional[List[Literal["totp", "biometrics", "security_key"]]] = None + """Lists the MFA methods that users can authenticate with.""" + + mfa_bypass: Optional[bool] = None + """Indicates whether to bypass MFA for this resource. + + This option is available at the application and policy level. + """ + + session_duration: Optional[str] = None + """Defines the duration of an MFA session. + + Must be in minutes (m) or hours (h). Minimum: 0m. Maximum: 720h (30 days). + Examples:`5m` or `24h`. + """ + + class AppLauncherApplicationPolicy(BaseModel): id: Optional[str] = None """The UUID of the policy""" @@ -1601,6 +2033,9 @@ class AppLauncherApplicationPolicy(BaseModel): this feature. """ + mfa_config: Optional[AppLauncherApplicationPolicyMfaConfig] = None + """Configures multi-factor authentication (MFA) settings.""" + name: Optional[str] = None """The name of the Access policy.""" @@ -1723,6 +2158,26 @@ class AppLauncherApplication(BaseModel): """Determines when to skip the App Launcher landing page.""" +class DeviceEnrollmentPermissionsApplicationPolicyMfaConfig(BaseModel): + """Configures multi-factor authentication (MFA) settings.""" + + allowed_authenticators: Optional[List[Literal["totp", "biometrics", "security_key"]]] = None + """Lists the MFA methods that users can authenticate with.""" + + mfa_bypass: Optional[bool] = None + """Indicates whether to bypass MFA for this resource. + + This option is available at the application and policy level. + """ + + session_duration: Optional[str] = None + """Defines the duration of an MFA session. + + Must be in minutes (m) or hours (h). Minimum: 0m. Maximum: 720h (30 days). + Examples:`5m` or `24h`. + """ + + class DeviceEnrollmentPermissionsApplicationPolicy(BaseModel): id: Optional[str] = None """The UUID of the policy""" @@ -1763,6 +2218,9 @@ class DeviceEnrollmentPermissionsApplicationPolicy(BaseModel): this feature. """ + mfa_config: Optional[DeviceEnrollmentPermissionsApplicationPolicyMfaConfig] = None + """Configures multi-factor authentication (MFA) settings.""" + name: Optional[str] = None """The name of the Access policy.""" @@ -1852,6 +2310,26 @@ class DeviceEnrollmentPermissionsApplication(BaseModel): """ +class BrowserIsolationPermissionsApplicationPolicyMfaConfig(BaseModel): + """Configures multi-factor authentication (MFA) settings.""" + + allowed_authenticators: Optional[List[Literal["totp", "biometrics", "security_key"]]] = None + """Lists the MFA methods that users can authenticate with.""" + + mfa_bypass: Optional[bool] = None + """Indicates whether to bypass MFA for this resource. + + This option is available at the application and policy level. + """ + + session_duration: Optional[str] = None + """Defines the duration of an MFA session. + + Must be in minutes (m) or hours (h). Minimum: 0m. Maximum: 720h (30 days). + Examples:`5m` or `24h`. + """ + + class BrowserIsolationPermissionsApplicationPolicy(BaseModel): id: Optional[str] = None """The UUID of the policy""" @@ -1892,6 +2370,9 @@ class BrowserIsolationPermissionsApplicationPolicy(BaseModel): this feature. """ + mfa_config: Optional[BrowserIsolationPermissionsApplicationPolicyMfaConfig] = None + """Configures multi-factor authentication (MFA) settings.""" + name: Optional[str] = None """The name of the Access policy.""" @@ -1981,6 +2462,26 @@ class BrowserIsolationPermissionsApplication(BaseModel): """ +class GatewayIdentityProxyEndpointApplicationPolicyMfaConfig(BaseModel): + """Configures multi-factor authentication (MFA) settings.""" + + allowed_authenticators: Optional[List[Literal["totp", "biometrics", "security_key"]]] = None + """Lists the MFA methods that users can authenticate with.""" + + mfa_bypass: Optional[bool] = None + """Indicates whether to bypass MFA for this resource. + + This option is available at the application and policy level. + """ + + session_duration: Optional[str] = None + """Defines the duration of an MFA session. + + Must be in minutes (m) or hours (h). Minimum: 0m. Maximum: 720h (30 days). + Examples:`5m` or `24h`. + """ + + class GatewayIdentityProxyEndpointApplicationPolicy(BaseModel): id: Optional[str] = None """The UUID of the policy""" @@ -2021,6 +2522,9 @@ class GatewayIdentityProxyEndpointApplicationPolicy(BaseModel): this feature. """ + mfa_config: Optional[GatewayIdentityProxyEndpointApplicationPolicyMfaConfig] = None + """Configures multi-factor authentication (MFA) settings.""" + name: Optional[str] = None """The name of the Access policy.""" @@ -2110,6 +2614,26 @@ class GatewayIdentityProxyEndpointApplication(BaseModel): """ +class BookmarkApplicationPolicyMfaConfig(BaseModel): + """Configures multi-factor authentication (MFA) settings.""" + + allowed_authenticators: Optional[List[Literal["totp", "biometrics", "security_key"]]] = None + """Lists the MFA methods that users can authenticate with.""" + + mfa_bypass: Optional[bool] = None + """Indicates whether to bypass MFA for this resource. + + This option is available at the application and policy level. + """ + + session_duration: Optional[str] = None + """Defines the duration of an MFA session. + + Must be in minutes (m) or hours (h). Minimum: 0m. Maximum: 720h (30 days). + Examples:`5m` or `24h`. + """ + + class BookmarkApplicationPolicy(BaseModel): id: Optional[str] = None """The UUID of the policy""" @@ -2150,6 +2674,9 @@ class BookmarkApplicationPolicy(BaseModel): this feature. """ + mfa_config: Optional[BookmarkApplicationPolicyMfaConfig] = None + """Configures multi-factor authentication (MFA) settings.""" + name: Optional[str] = None """The name of the Access policy.""" @@ -2384,37 +2911,133 @@ class BrowserRdpApplicationDestinationViaMcpServerPortalDestination(BaseModel): ] -class BrowserRdpApplicationPolicy(BaseModel): - id: Optional[str] = None - """The UUID of the policy""" +class BrowserRdpApplicationMfaConfig(BaseModel): + """Configures multi-factor authentication (MFA) settings.""" - approval_groups: Optional[List[ApprovalGroup]] = None - """Administrators who can approve a temporary authentication request.""" + allowed_authenticators: Optional[List[Literal["totp", "biometrics", "security_key"]]] = None + """Lists the MFA methods that users can authenticate with.""" - approval_required: Optional[bool] = None - """ - Requires the user to request access from an administrator at the start of each - session. - """ + mfa_bypass: Optional[bool] = None + """Indicates whether to bypass MFA for this resource. - created_at: Optional[datetime] = None + This option is available at the application and policy level. + """ - decision: Optional[Decision] = None - """The action Access will take if a user matches this policy. + session_duration: Optional[str] = None + """Defines the duration of an MFA session. - Infrastructure application policies can only use the Allow action. + Must be in minutes (m) or hours (h). Minimum: 0m. Maximum: 720h (30 days). + Examples:`5m` or `24h`. """ - exclude: Optional[List[AccessRule]] = None - """Rules evaluated with a NOT logical operator. - To match the policy, a user cannot meet any of the Exclude rules. - """ +class BrowserRdpApplicationOAuthConfigurationDynamicClientRegistration(BaseModel): + """Settings for OAuth dynamic client registration.""" - include: Optional[List[AccessRule]] = None - """Rules evaluated with an OR logical operator. + allow_any_on_localhost: Optional[bool] = None + """Allows any client with redirect URIs on localhost.""" - A user needs to meet only one of the Include rules. + allow_any_on_loopback: Optional[bool] = None + """Allows any client with redirect URIs on 127.0.0.1.""" + + allowed_uris: Optional[List[str]] = None + """The URIs that are allowed as redirect URIs for dynamically registered clients. + + Must use the `https` protocol. Paths may end in `/*` to match all sub-paths. + """ + + enabled: Optional[bool] = None + """Whether dynamic client registration is enabled.""" + + +class BrowserRdpApplicationOAuthConfigurationGrant(BaseModel): + """Settings for OAuth grant behavior.""" + + access_token_lifetime: Optional[str] = None + """The lifetime of the access token. + + Must be in the format `300ms` or `2h45m`. Valid time units are ns, us (or µs), + ms, s, m, h. + """ + + session_duration: Optional[str] = None + """The duration of the OAuth session. + + Must be in the format `300ms` or `2h45m`. Valid time units are ns, us (or µs), + ms, s, m, h. + """ + + +class BrowserRdpApplicationOAuthConfiguration(BaseModel): + """ + **Beta:** Optional configuration for managing an OAuth authorization flow controlled by Access. When set, Access will act as the OAuth authorization server for this application. Only compatible with OAuth clients that support [RFC 8707](https://datatracker.ietf.org/doc/html/rfc8707) (Resource Indicators for OAuth 2.0). This feature is currently in beta. + """ + + dynamic_client_registration: Optional[BrowserRdpApplicationOAuthConfigurationDynamicClientRegistration] = None + """Settings for OAuth dynamic client registration.""" + + enabled: Optional[bool] = None + """Whether the OAuth configuration is enabled for this application. + + When set to `false`, Access will not handle OAuth for this application. Defaults + to `true` if omitted. + """ + + grant: Optional[BrowserRdpApplicationOAuthConfigurationGrant] = None + """Settings for OAuth grant behavior.""" + + +class BrowserRdpApplicationPolicyMfaConfig(BaseModel): + """Configures multi-factor authentication (MFA) settings.""" + + allowed_authenticators: Optional[List[Literal["totp", "biometrics", "security_key"]]] = None + """Lists the MFA methods that users can authenticate with.""" + + mfa_bypass: Optional[bool] = None + """Indicates whether to bypass MFA for this resource. + + This option is available at the application and policy level. + """ + + session_duration: Optional[str] = None + """Defines the duration of an MFA session. + + Must be in minutes (m) or hours (h). Minimum: 0m. Maximum: 720h (30 days). + Examples:`5m` or `24h`. + """ + + +class BrowserRdpApplicationPolicy(BaseModel): + id: Optional[str] = None + """The UUID of the policy""" + + approval_groups: Optional[List[ApprovalGroup]] = None + """Administrators who can approve a temporary authentication request.""" + + approval_required: Optional[bool] = None + """ + Requires the user to request access from an administrator at the start of each + session. + """ + + created_at: Optional[datetime] = None + + decision: Optional[Decision] = None + """The action Access will take if a user matches this policy. + + Infrastructure application policies can only use the Allow action. + """ + + exclude: Optional[List[AccessRule]] = None + """Rules evaluated with a NOT logical operator. + + To match the policy, a user cannot meet any of the Exclude rules. + """ + + include: Optional[List[AccessRule]] = None + """Rules evaluated with an OR logical operator. + + A user needs to meet only one of the Include rules. """ isolation_required: Optional[bool] = None @@ -2424,6 +3047,9 @@ class BrowserRdpApplicationPolicy(BaseModel): this feature. """ + mfa_config: Optional[BrowserRdpApplicationPolicyMfaConfig] = None + """Configures multi-factor authentication (MFA) settings.""" + name: Optional[str] = None """The name of the Access policy.""" @@ -2645,9 +3271,21 @@ class BrowserRdpApplication(BaseModel): logo_url: Optional[str] = None """The image URL for the logo shown in the App Launcher dashboard.""" + mfa_config: Optional[BrowserRdpApplicationMfaConfig] = None + """Configures multi-factor authentication (MFA) settings.""" + name: Optional[str] = None """The name of the application.""" + oauth_configuration: Optional[BrowserRdpApplicationOAuthConfiguration] = None + """ + **Beta:** Optional configuration for managing an OAuth authorization flow + controlled by Access. When set, Access will act as the OAuth authorization + server for this application. Only compatible with OAuth clients that support + [RFC 8707](https://datatracker.ietf.org/doc/html/rfc8707) (Resource Indicators + for OAuth 2.0). This feature is currently in beta. + """ + options_preflight_bypass: Optional[bool] = None """ Allows options preflight requests to bypass Access authentication and go @@ -2721,6 +3359,860 @@ class BrowserRdpApplication(BaseModel): """ +class McpServerApplicationDestinationPublicDestination(BaseModel): + """A public hostname that Access will secure. + + Public destinations support sub-domain and path. Wildcard '*' can be used in the definition. + """ + + type: Optional[Literal["public"]] = None + + uri: Optional[str] = None + """The URI of the destination. + + Public destinations' URIs can include a domain and path with + [wildcards](https://developers.cloudflare.com/cloudflare-one/policies/access/app-paths/). + """ + + +class McpServerApplicationDestinationPrivateDestination(BaseModel): + cidr: Optional[str] = None + """The CIDR range of the destination. Single IPs will be computed as /32.""" + + hostname: Optional[str] = None + """The hostname of the destination. Matches a valid SNI served by an HTTPS origin.""" + + l4_protocol: Optional[Literal["tcp", "udp"]] = None + """The L4 protocol of the destination. + + When omitted, both UDP and TCP traffic will match. + """ + + port_range: Optional[str] = None + """The port range of the destination. + + Can be a single port or a range of ports. When omitted, all ports will match. + """ + + type: Optional[Literal["private"]] = None + + vnet_id: Optional[str] = None + """The VNET ID to match the destination. When omitted, all VNETs will match.""" + + +class McpServerApplicationDestinationViaMcpServerPortalDestination(BaseModel): + """A MCP server id configured in ai-controls. + + Access will secure the MCP server if accessed through a MCP portal. + """ + + mcp_server_id: Optional[str] = None + """The MCP server id configured in ai-controls.""" + + type: Optional[Literal["via_mcp_server_portal"]] = None + + +McpServerApplicationDestination: TypeAlias = Union[ + McpServerApplicationDestinationPublicDestination, + McpServerApplicationDestinationPrivateDestination, + McpServerApplicationDestinationViaMcpServerPortalDestination, +] + + +class McpServerApplicationOAuthConfigurationDynamicClientRegistration(BaseModel): + """Settings for OAuth dynamic client registration.""" + + allow_any_on_localhost: Optional[bool] = None + """Allows any client with redirect URIs on localhost.""" + + allow_any_on_loopback: Optional[bool] = None + """Allows any client with redirect URIs on 127.0.0.1.""" + + allowed_uris: Optional[List[str]] = None + """The URIs that are allowed as redirect URIs for dynamically registered clients. + + Must use the `https` protocol. Paths may end in `/*` to match all sub-paths. + """ + + enabled: Optional[bool] = None + """Whether dynamic client registration is enabled.""" + + +class McpServerApplicationOAuthConfigurationGrant(BaseModel): + """Settings for OAuth grant behavior.""" + + access_token_lifetime: Optional[str] = None + """The lifetime of the access token. + + Must be in the format `300ms` or `2h45m`. Valid time units are ns, us (or µs), + ms, s, m, h. + """ + + session_duration: Optional[str] = None + """The duration of the OAuth session. + + Must be in the format `300ms` or `2h45m`. Valid time units are ns, us (or µs), + ms, s, m, h. + """ + + +class McpServerApplicationOAuthConfiguration(BaseModel): + """ + **Beta:** Optional configuration for managing an OAuth authorization flow controlled by Access. When set, Access will act as the OAuth authorization server for this application. Only compatible with OAuth clients that support [RFC 8707](https://datatracker.ietf.org/doc/html/rfc8707) (Resource Indicators for OAuth 2.0). This feature is currently in beta. + """ + + dynamic_client_registration: Optional[McpServerApplicationOAuthConfigurationDynamicClientRegistration] = None + """Settings for OAuth dynamic client registration.""" + + enabled: Optional[bool] = None + """Whether the OAuth configuration is enabled for this application. + + When set to `false`, Access will not handle OAuth for this application. Defaults + to `true` if omitted. + """ + + grant: Optional[McpServerApplicationOAuthConfigurationGrant] = None + """Settings for OAuth grant behavior.""" + + +class McpServerApplicationPolicyMfaConfig(BaseModel): + """Configures multi-factor authentication (MFA) settings.""" + + allowed_authenticators: Optional[List[Literal["totp", "biometrics", "security_key"]]] = None + """Lists the MFA methods that users can authenticate with.""" + + mfa_bypass: Optional[bool] = None + """Indicates whether to bypass MFA for this resource. + + This option is available at the application and policy level. + """ + + session_duration: Optional[str] = None + """Defines the duration of an MFA session. + + Must be in minutes (m) or hours (h). Minimum: 0m. Maximum: 720h (30 days). + Examples:`5m` or `24h`. + """ + + +class McpServerApplicationPolicy(BaseModel): + id: Optional[str] = None + """The UUID of the policy""" + + approval_groups: Optional[List[ApprovalGroup]] = None + """Administrators who can approve a temporary authentication request.""" + + approval_required: Optional[bool] = None + """ + Requires the user to request access from an administrator at the start of each + session. + """ + + created_at: Optional[datetime] = None + + decision: Optional[Decision] = None + """The action Access will take if a user matches this policy. + + Infrastructure application policies can only use the Allow action. + """ + + exclude: Optional[List[AccessRule]] = None + """Rules evaluated with a NOT logical operator. + + To match the policy, a user cannot meet any of the Exclude rules. + """ + + include: Optional[List[AccessRule]] = None + """Rules evaluated with an OR logical operator. + + A user needs to meet only one of the Include rules. + """ + + isolation_required: Optional[bool] = None + """ + Require this application to be served in an isolated browser for users matching + this policy. 'Client Web Isolation' must be on for the account in order to use + this feature. + """ + + mfa_config: Optional[McpServerApplicationPolicyMfaConfig] = None + """Configures multi-factor authentication (MFA) settings.""" + + name: Optional[str] = None + """The name of the Access policy.""" + + precedence: Optional[int] = None + """The order of execution for this policy. + + Must be unique for each policy within an app. + """ + + purpose_justification_prompt: Optional[str] = None + """A custom message that will appear on the purpose justification screen.""" + + purpose_justification_required: Optional[bool] = None + """Require users to enter a justification when they log in to the application.""" + + require: Optional[List[AccessRule]] = None + """Rules evaluated with an AND logical operator. + + To match the policy, a user must meet all of the Require rules. + """ + + session_duration: Optional[str] = None + """The amount of time that tokens issued for the application will be valid. + + Must be in the format `300ms` or `2h45m`. Valid time units are: ns, us (or µs), + ms, s, m, h. + """ + + updated_at: Optional[datetime] = None + + +class McpServerApplicationSCIMConfigAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken(BaseModel): + """ + Attributes for configuring Access Service Token authentication scheme for SCIM provisioning to an application. + """ + + client_id: str + """ + Client ID of the Access service token used to authenticate with the remote + service. + """ + + client_secret: str + """ + Client secret of the Access service token used to authenticate with the remote + service. + """ + + scheme: Literal["access_service_token"] + """The authentication scheme to use when making SCIM requests to this application.""" + + +class McpServerApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken( + BaseModel +): + """ + Attributes for configuring Access Service Token authentication scheme for SCIM provisioning to an application. + """ + + client_id: str + """ + Client ID of the Access service token used to authenticate with the remote + service. + """ + + client_secret: str + """ + Client secret of the Access service token used to authenticate with the remote + service. + """ + + scheme: Literal["access_service_token"] + """The authentication scheme to use when making SCIM requests to this application.""" + + +McpServerApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthentication: TypeAlias = Union[ + SCIMConfigAuthenticationHTTPBasic, + SCIMConfigAuthenticationOAuthBearerToken, + SCIMConfigAuthenticationOauth2, + McpServerApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken, +] + +McpServerApplicationSCIMConfigAuthentication: TypeAlias = Union[ + SCIMConfigAuthenticationHTTPBasic, + SCIMConfigAuthenticationOAuthBearerToken, + SCIMConfigAuthenticationOauth2, + McpServerApplicationSCIMConfigAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken, + List[McpServerApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthentication], +] + + +class McpServerApplicationSCIMConfig(BaseModel): + """Configuration for provisioning to this application via SCIM. + + This is currently in closed beta. + """ + + idp_uid: str + """ + The UID of the IdP to use as the source for SCIM resources to provision to this + application. + """ + + remote_uri: str + """The base URI for the application's SCIM-compatible API.""" + + authentication: Optional[McpServerApplicationSCIMConfigAuthentication] = None + """ + Attributes for configuring HTTP Basic authentication scheme for SCIM + provisioning to an application. + """ + + deactivate_on_delete: Optional[bool] = None + """ + If false, propagates DELETE requests to the target application for SCIM + resources. If true, sets 'active' to false on the SCIM resource. Note: Some + targets do not support DELETE operations. + """ + + enabled: Optional[bool] = None + """Whether SCIM provisioning is turned on for this application.""" + + mappings: Optional[List[SCIMConfigMapping]] = None + """ + A list of mappings to apply to SCIM resources before provisioning them in this + application. These can transform or filter the resources to be provisioned. + """ + + +class McpServerApplication(BaseModel): + type: ApplicationType + """The application type.""" + + id: Optional[str] = None + """UUID.""" + + allow_authenticate_via_warp: Optional[bool] = None + """ + When set to true, users can authenticate to this application using their WARP + session. When set to false this application will always require direct IdP + authentication. This setting always overrides the organization setting for WARP + authentication. + """ + + allowed_idps: Optional[List[AllowedIdPs]] = None + """The identity providers your users can select when connecting to this + application. + + Defaults to all IdPs configured in your account. + """ + + aud: Optional[str] = None + """Audience tag.""" + + auto_redirect_to_identity: Optional[bool] = None + """When set to `true`, users skip the identity provider selection step during + login. + + You must specify only one identity provider in allowed_idps. + """ + + custom_deny_message: Optional[str] = None + """ + The custom error message shown to a user when they are denied access to the + application. + """ + + custom_deny_url: Optional[str] = None + """ + The custom URL a user is redirected to when they are denied access to the + application when failing identity-based rules. + """ + + custom_non_identity_deny_url: Optional[str] = None + """ + The custom URL a user is redirected to when they are denied access to the + application when failing non-identity rules. + """ + + custom_pages: Optional[List[str]] = None + """The custom pages that will be displayed when applicable for this application""" + + destinations: Optional[List[McpServerApplicationDestination]] = None + """List of destinations secured by Access. + + This supersedes `self_hosted_domains` to allow for more flexibility in defining + different types of domains. If `destinations` are provided, then + `self_hosted_domains` will be ignored. + """ + + http_only_cookie_attribute: Optional[bool] = None + """ + Enables the HttpOnly cookie attribute, which increases security against XSS + attacks. + """ + + logo_url: Optional[str] = None + """The image URL for the logo shown in the App Launcher dashboard.""" + + name: Optional[str] = None + """The name of the application.""" + + oauth_configuration: Optional[McpServerApplicationOAuthConfiguration] = None + """ + **Beta:** Optional configuration for managing an OAuth authorization flow + controlled by Access. When set, Access will act as the OAuth authorization + server for this application. Only compatible with OAuth clients that support + [RFC 8707](https://datatracker.ietf.org/doc/html/rfc8707) (Resource Indicators + for OAuth 2.0). This feature is currently in beta. + """ + + options_preflight_bypass: Optional[bool] = None + """ + Allows options preflight requests to bypass Access authentication and go + directly to the origin. Cannot turn on if cors_headers is set. + """ + + policies: Optional[List[McpServerApplicationPolicy]] = None + + same_site_cookie_attribute: Optional[str] = None + """ + Sets the SameSite cookie setting, which provides increased security against CSRF + attacks. + """ + + scim_config: Optional[McpServerApplicationSCIMConfig] = None + """Configuration for provisioning to this application via SCIM. + + This is currently in closed beta. + """ + + session_duration: Optional[str] = None + """The amount of time that tokens issued for this application will be valid. + + Must be in the format `300ms` or `2h45m`. Valid time units are: ns, us (or µs), + ms, s, m, h. Note: unsupported for infrastructure type applications. + """ + + tags: Optional[List[str]] = None + """The tags you want assigned to an application. + + Tags are used to filter applications in the App Launcher dashboard. + """ + + +class McpServerPortalApplicationDestinationPublicDestination(BaseModel): + """A public hostname that Access will secure. + + Public destinations support sub-domain and path. Wildcard '*' can be used in the definition. + """ + + type: Optional[Literal["public"]] = None + + uri: Optional[str] = None + """The URI of the destination. + + Public destinations' URIs can include a domain and path with + [wildcards](https://developers.cloudflare.com/cloudflare-one/policies/access/app-paths/). + """ + + +class McpServerPortalApplicationDestinationPrivateDestination(BaseModel): + cidr: Optional[str] = None + """The CIDR range of the destination. Single IPs will be computed as /32.""" + + hostname: Optional[str] = None + """The hostname of the destination. Matches a valid SNI served by an HTTPS origin.""" + + l4_protocol: Optional[Literal["tcp", "udp"]] = None + """The L4 protocol of the destination. + + When omitted, both UDP and TCP traffic will match. + """ + + port_range: Optional[str] = None + """The port range of the destination. + + Can be a single port or a range of ports. When omitted, all ports will match. + """ + + type: Optional[Literal["private"]] = None + + vnet_id: Optional[str] = None + """The VNET ID to match the destination. When omitted, all VNETs will match.""" + + +class McpServerPortalApplicationDestinationViaMcpServerPortalDestination(BaseModel): + """A MCP server id configured in ai-controls. + + Access will secure the MCP server if accessed through a MCP portal. + """ + + mcp_server_id: Optional[str] = None + """The MCP server id configured in ai-controls.""" + + type: Optional[Literal["via_mcp_server_portal"]] = None + + +McpServerPortalApplicationDestination: TypeAlias = Union[ + McpServerPortalApplicationDestinationPublicDestination, + McpServerPortalApplicationDestinationPrivateDestination, + McpServerPortalApplicationDestinationViaMcpServerPortalDestination, +] + + +class McpServerPortalApplicationOAuthConfigurationDynamicClientRegistration(BaseModel): + """Settings for OAuth dynamic client registration.""" + + allow_any_on_localhost: Optional[bool] = None + """Allows any client with redirect URIs on localhost.""" + + allow_any_on_loopback: Optional[bool] = None + """Allows any client with redirect URIs on 127.0.0.1.""" + + allowed_uris: Optional[List[str]] = None + """The URIs that are allowed as redirect URIs for dynamically registered clients. + + Must use the `https` protocol. Paths may end in `/*` to match all sub-paths. + """ + + enabled: Optional[bool] = None + """Whether dynamic client registration is enabled.""" + + +class McpServerPortalApplicationOAuthConfigurationGrant(BaseModel): + """Settings for OAuth grant behavior.""" + + access_token_lifetime: Optional[str] = None + """The lifetime of the access token. + + Must be in the format `300ms` or `2h45m`. Valid time units are ns, us (or µs), + ms, s, m, h. + """ + + session_duration: Optional[str] = None + """The duration of the OAuth session. + + Must be in the format `300ms` or `2h45m`. Valid time units are ns, us (or µs), + ms, s, m, h. + """ + + +class McpServerPortalApplicationOAuthConfiguration(BaseModel): + """ + **Beta:** Optional configuration for managing an OAuth authorization flow controlled by Access. When set, Access will act as the OAuth authorization server for this application. Only compatible with OAuth clients that support [RFC 8707](https://datatracker.ietf.org/doc/html/rfc8707) (Resource Indicators for OAuth 2.0). This feature is currently in beta. + """ + + dynamic_client_registration: Optional[McpServerPortalApplicationOAuthConfigurationDynamicClientRegistration] = None + """Settings for OAuth dynamic client registration.""" + + enabled: Optional[bool] = None + """Whether the OAuth configuration is enabled for this application. + + When set to `false`, Access will not handle OAuth for this application. Defaults + to `true` if omitted. + """ + + grant: Optional[McpServerPortalApplicationOAuthConfigurationGrant] = None + """Settings for OAuth grant behavior.""" + + +class McpServerPortalApplicationPolicyMfaConfig(BaseModel): + """Configures multi-factor authentication (MFA) settings.""" + + allowed_authenticators: Optional[List[Literal["totp", "biometrics", "security_key"]]] = None + """Lists the MFA methods that users can authenticate with.""" + + mfa_bypass: Optional[bool] = None + """Indicates whether to bypass MFA for this resource. + + This option is available at the application and policy level. + """ + + session_duration: Optional[str] = None + """Defines the duration of an MFA session. + + Must be in minutes (m) or hours (h). Minimum: 0m. Maximum: 720h (30 days). + Examples:`5m` or `24h`. + """ + + +class McpServerPortalApplicationPolicy(BaseModel): + id: Optional[str] = None + """The UUID of the policy""" + + approval_groups: Optional[List[ApprovalGroup]] = None + """Administrators who can approve a temporary authentication request.""" + + approval_required: Optional[bool] = None + """ + Requires the user to request access from an administrator at the start of each + session. + """ + + created_at: Optional[datetime] = None + + decision: Optional[Decision] = None + """The action Access will take if a user matches this policy. + + Infrastructure application policies can only use the Allow action. + """ + + exclude: Optional[List[AccessRule]] = None + """Rules evaluated with a NOT logical operator. + + To match the policy, a user cannot meet any of the Exclude rules. + """ + + include: Optional[List[AccessRule]] = None + """Rules evaluated with an OR logical operator. + + A user needs to meet only one of the Include rules. + """ + + isolation_required: Optional[bool] = None + """ + Require this application to be served in an isolated browser for users matching + this policy. 'Client Web Isolation' must be on for the account in order to use + this feature. + """ + + mfa_config: Optional[McpServerPortalApplicationPolicyMfaConfig] = None + """Configures multi-factor authentication (MFA) settings.""" + + name: Optional[str] = None + """The name of the Access policy.""" + + precedence: Optional[int] = None + """The order of execution for this policy. + + Must be unique for each policy within an app. + """ + + purpose_justification_prompt: Optional[str] = None + """A custom message that will appear on the purpose justification screen.""" + + purpose_justification_required: Optional[bool] = None + """Require users to enter a justification when they log in to the application.""" + + require: Optional[List[AccessRule]] = None + """Rules evaluated with an AND logical operator. + + To match the policy, a user must meet all of the Require rules. + """ + + session_duration: Optional[str] = None + """The amount of time that tokens issued for the application will be valid. + + Must be in the format `300ms` or `2h45m`. Valid time units are: ns, us (or µs), + ms, s, m, h. + """ + + updated_at: Optional[datetime] = None + + +class McpServerPortalApplicationSCIMConfigAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken(BaseModel): + """ + Attributes for configuring Access Service Token authentication scheme for SCIM provisioning to an application. + """ + + client_id: str + """ + Client ID of the Access service token used to authenticate with the remote + service. + """ + + client_secret: str + """ + Client secret of the Access service token used to authenticate with the remote + service. + """ + + scheme: Literal["access_service_token"] + """The authentication scheme to use when making SCIM requests to this application.""" + + +class McpServerPortalApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken( + BaseModel +): + """ + Attributes for configuring Access Service Token authentication scheme for SCIM provisioning to an application. + """ + + client_id: str + """ + Client ID of the Access service token used to authenticate with the remote + service. + """ + + client_secret: str + """ + Client secret of the Access service token used to authenticate with the remote + service. + """ + + scheme: Literal["access_service_token"] + """The authentication scheme to use when making SCIM requests to this application.""" + + +McpServerPortalApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthentication: TypeAlias = Union[ + SCIMConfigAuthenticationHTTPBasic, + SCIMConfigAuthenticationOAuthBearerToken, + SCIMConfigAuthenticationOauth2, + McpServerPortalApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken, +] + +McpServerPortalApplicationSCIMConfigAuthentication: TypeAlias = Union[ + SCIMConfigAuthenticationHTTPBasic, + SCIMConfigAuthenticationOAuthBearerToken, + SCIMConfigAuthenticationOauth2, + McpServerPortalApplicationSCIMConfigAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken, + List[McpServerPortalApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthentication], +] + + +class McpServerPortalApplicationSCIMConfig(BaseModel): + """Configuration for provisioning to this application via SCIM. + + This is currently in closed beta. + """ + + idp_uid: str + """ + The UID of the IdP to use as the source for SCIM resources to provision to this + application. + """ + + remote_uri: str + """The base URI for the application's SCIM-compatible API.""" + + authentication: Optional[McpServerPortalApplicationSCIMConfigAuthentication] = None + """ + Attributes for configuring HTTP Basic authentication scheme for SCIM + provisioning to an application. + """ + + deactivate_on_delete: Optional[bool] = None + """ + If false, propagates DELETE requests to the target application for SCIM + resources. If true, sets 'active' to false on the SCIM resource. Note: Some + targets do not support DELETE operations. + """ + + enabled: Optional[bool] = None + """Whether SCIM provisioning is turned on for this application.""" + + mappings: Optional[List[SCIMConfigMapping]] = None + """ + A list of mappings to apply to SCIM resources before provisioning them in this + application. These can transform or filter the resources to be provisioned. + """ + + +class McpServerPortalApplication(BaseModel): + type: ApplicationType + """The application type.""" + + id: Optional[str] = None + """UUID.""" + + allow_authenticate_via_warp: Optional[bool] = None + """ + When set to true, users can authenticate to this application using their WARP + session. When set to false this application will always require direct IdP + authentication. This setting always overrides the organization setting for WARP + authentication. + """ + + allowed_idps: Optional[List[AllowedIdPs]] = None + """The identity providers your users can select when connecting to this + application. + + Defaults to all IdPs configured in your account. + """ + + aud: Optional[str] = None + """Audience tag.""" + + auto_redirect_to_identity: Optional[bool] = None + """When set to `true`, users skip the identity provider selection step during + login. + + You must specify only one identity provider in allowed_idps. + """ + + custom_deny_message: Optional[str] = None + """ + The custom error message shown to a user when they are denied access to the + application. + """ + + custom_deny_url: Optional[str] = None + """ + The custom URL a user is redirected to when they are denied access to the + application when failing identity-based rules. + """ + + custom_non_identity_deny_url: Optional[str] = None + """ + The custom URL a user is redirected to when they are denied access to the + application when failing non-identity rules. + """ + + custom_pages: Optional[List[str]] = None + """The custom pages that will be displayed when applicable for this application""" + + destinations: Optional[List[McpServerPortalApplicationDestination]] = None + """List of destinations secured by Access. + + This supersedes `self_hosted_domains` to allow for more flexibility in defining + different types of domains. If `destinations` are provided, then + `self_hosted_domains` will be ignored. + """ + + domain: Optional[str] = None + """The primary hostname and path secured by Access. + + This domain will be displayed if the app is visible in the App Launcher. + """ + + http_only_cookie_attribute: Optional[bool] = None + """ + Enables the HttpOnly cookie attribute, which increases security against XSS + attacks. + """ + + logo_url: Optional[str] = None + """The image URL for the logo shown in the App Launcher dashboard.""" + + name: Optional[str] = None + """The name of the application.""" + + oauth_configuration: Optional[McpServerPortalApplicationOAuthConfiguration] = None + """ + **Beta:** Optional configuration for managing an OAuth authorization flow + controlled by Access. When set, Access will act as the OAuth authorization + server for this application. Only compatible with OAuth clients that support + [RFC 8707](https://datatracker.ietf.org/doc/html/rfc8707) (Resource Indicators + for OAuth 2.0). This feature is currently in beta. + """ + + options_preflight_bypass: Optional[bool] = None + """ + Allows options preflight requests to bypass Access authentication and go + directly to the origin. Cannot turn on if cors_headers is set. + """ + + policies: Optional[List[McpServerPortalApplicationPolicy]] = None + + same_site_cookie_attribute: Optional[str] = None + """ + Sets the SameSite cookie setting, which provides increased security against CSRF + attacks. + """ + + scim_config: Optional[McpServerPortalApplicationSCIMConfig] = None + """Configuration for provisioning to this application via SCIM. + + This is currently in closed beta. + """ + + session_duration: Optional[str] = None + """The amount of time that tokens issued for this application will be valid. + + Must be in the format `300ms` or `2h45m`. Valid time units are: ns, us (or µs), + ms, s, m, h. Note: unsupported for infrastructure type applications. + """ + + tags: Optional[List[str]] = None + """The tags you want assigned to an application. + + Tags are used to filter applications in the App Launcher dashboard. + """ + + ApplicationCreateResponse: TypeAlias = Union[ SelfHostedApplication, SaaSApplication, @@ -2733,4 +4225,6 @@ class BrowserRdpApplication(BaseModel): BookmarkApplication, InfrastructureApplication, BrowserRdpApplication, + McpServerApplication, + McpServerPortalApplication, ] diff --git a/src/cloudflare/types/zero_trust/access/application_get_response.py b/src/cloudflare/types/zero_trust/access/application_get_response.py index b4e1ccce576..62c9c99b07e 100644 --- a/src/cloudflare/types/zero_trust/access/application_get_response.py +++ b/src/cloudflare/types/zero_trust/access/application_get_response.py @@ -26,7 +26,12 @@ "SelfHostedApplicationDestinationPublicDestination", "SelfHostedApplicationDestinationPrivateDestination", "SelfHostedApplicationDestinationViaMcpServerPortalDestination", + "SelfHostedApplicationMfaConfig", + "SelfHostedApplicationOAuthConfiguration", + "SelfHostedApplicationOAuthConfigurationDynamicClientRegistration", + "SelfHostedApplicationOAuthConfigurationGrant", "SelfHostedApplicationPolicy", + "SelfHostedApplicationPolicyMfaConfig", "SelfHostedApplicationSCIMConfig", "SelfHostedApplicationSCIMConfigAuthentication", "SelfHostedApplicationSCIMConfigAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken", @@ -34,6 +39,7 @@ "SelfHostedApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken", "SaaSApplication", "SaaSApplicationPolicy", + "SaaSApplicationPolicyMfaConfig", "SaaSApplicationSaaSApp", "SaaSApplicationSCIMConfig", "SaaSApplicationSCIMConfigAuthentication", @@ -45,7 +51,12 @@ "BrowserSSHApplicationDestinationPublicDestination", "BrowserSSHApplicationDestinationPrivateDestination", "BrowserSSHApplicationDestinationViaMcpServerPortalDestination", + "BrowserSSHApplicationMfaConfig", + "BrowserSSHApplicationOAuthConfiguration", + "BrowserSSHApplicationOAuthConfigurationDynamicClientRegistration", + "BrowserSSHApplicationOAuthConfigurationGrant", "BrowserSSHApplicationPolicy", + "BrowserSSHApplicationPolicyMfaConfig", "BrowserSSHApplicationSCIMConfig", "BrowserSSHApplicationSCIMConfigAuthentication", "BrowserSSHApplicationSCIMConfigAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken", @@ -56,7 +67,12 @@ "BrowserVNCApplicationDestinationPublicDestination", "BrowserVNCApplicationDestinationPrivateDestination", "BrowserVNCApplicationDestinationViaMcpServerPortalDestination", + "BrowserVNCApplicationMfaConfig", + "BrowserVNCApplicationOAuthConfiguration", + "BrowserVNCApplicationOAuthConfigurationDynamicClientRegistration", + "BrowserVNCApplicationOAuthConfigurationGrant", "BrowserVNCApplicationPolicy", + "BrowserVNCApplicationPolicyMfaConfig", "BrowserVNCApplicationSCIMConfig", "BrowserVNCApplicationSCIMConfigAuthentication", "BrowserVNCApplicationSCIMConfigAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken", @@ -66,14 +82,19 @@ "AppLauncherApplicationFooterLink", "AppLauncherApplicationLandingPageDesign", "AppLauncherApplicationPolicy", + "AppLauncherApplicationPolicyMfaConfig", "DeviceEnrollmentPermissionsApplication", "DeviceEnrollmentPermissionsApplicationPolicy", + "DeviceEnrollmentPermissionsApplicationPolicyMfaConfig", "BrowserIsolationPermissionsApplication", "BrowserIsolationPermissionsApplicationPolicy", + "BrowserIsolationPermissionsApplicationPolicyMfaConfig", "GatewayIdentityProxyEndpointApplication", "GatewayIdentityProxyEndpointApplicationPolicy", + "GatewayIdentityProxyEndpointApplicationPolicyMfaConfig", "BookmarkApplication", "BookmarkApplicationPolicy", + "BookmarkApplicationPolicyMfaConfig", "InfrastructureApplication", "InfrastructureApplicationTargetCriterion", "InfrastructureApplicationPolicy", @@ -85,12 +106,47 @@ "BrowserRdpApplicationDestinationPublicDestination", "BrowserRdpApplicationDestinationPrivateDestination", "BrowserRdpApplicationDestinationViaMcpServerPortalDestination", + "BrowserRdpApplicationMfaConfig", + "BrowserRdpApplicationOAuthConfiguration", + "BrowserRdpApplicationOAuthConfigurationDynamicClientRegistration", + "BrowserRdpApplicationOAuthConfigurationGrant", "BrowserRdpApplicationPolicy", + "BrowserRdpApplicationPolicyMfaConfig", "BrowserRdpApplicationSCIMConfig", "BrowserRdpApplicationSCIMConfigAuthentication", "BrowserRdpApplicationSCIMConfigAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken", "BrowserRdpApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthentication", "BrowserRdpApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken", + "McpServerApplication", + "McpServerApplicationDestination", + "McpServerApplicationDestinationPublicDestination", + "McpServerApplicationDestinationPrivateDestination", + "McpServerApplicationDestinationViaMcpServerPortalDestination", + "McpServerApplicationOAuthConfiguration", + "McpServerApplicationOAuthConfigurationDynamicClientRegistration", + "McpServerApplicationOAuthConfigurationGrant", + "McpServerApplicationPolicy", + "McpServerApplicationPolicyMfaConfig", + "McpServerApplicationSCIMConfig", + "McpServerApplicationSCIMConfigAuthentication", + "McpServerApplicationSCIMConfigAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken", + "McpServerApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthentication", + "McpServerApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken", + "McpServerPortalApplication", + "McpServerPortalApplicationDestination", + "McpServerPortalApplicationDestinationPublicDestination", + "McpServerPortalApplicationDestinationPrivateDestination", + "McpServerPortalApplicationDestinationViaMcpServerPortalDestination", + "McpServerPortalApplicationOAuthConfiguration", + "McpServerPortalApplicationOAuthConfigurationDynamicClientRegistration", + "McpServerPortalApplicationOAuthConfigurationGrant", + "McpServerPortalApplicationPolicy", + "McpServerPortalApplicationPolicyMfaConfig", + "McpServerPortalApplicationSCIMConfig", + "McpServerPortalApplicationSCIMConfigAuthentication", + "McpServerPortalApplicationSCIMConfigAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken", + "McpServerPortalApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthentication", + "McpServerPortalApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken", ] @@ -154,6 +210,102 @@ class SelfHostedApplicationDestinationViaMcpServerPortalDestination(BaseModel): ] +class SelfHostedApplicationMfaConfig(BaseModel): + """Configures multi-factor authentication (MFA) settings.""" + + allowed_authenticators: Optional[List[Literal["totp", "biometrics", "security_key"]]] = None + """Lists the MFA methods that users can authenticate with.""" + + mfa_bypass: Optional[bool] = None + """Indicates whether to bypass MFA for this resource. + + This option is available at the application and policy level. + """ + + session_duration: Optional[str] = None + """Defines the duration of an MFA session. + + Must be in minutes (m) or hours (h). Minimum: 0m. Maximum: 720h (30 days). + Examples:`5m` or `24h`. + """ + + +class SelfHostedApplicationOAuthConfigurationDynamicClientRegistration(BaseModel): + """Settings for OAuth dynamic client registration.""" + + allow_any_on_localhost: Optional[bool] = None + """Allows any client with redirect URIs on localhost.""" + + allow_any_on_loopback: Optional[bool] = None + """Allows any client with redirect URIs on 127.0.0.1.""" + + allowed_uris: Optional[List[str]] = None + """The URIs that are allowed as redirect URIs for dynamically registered clients. + + Must use the `https` protocol. Paths may end in `/*` to match all sub-paths. + """ + + enabled: Optional[bool] = None + """Whether dynamic client registration is enabled.""" + + +class SelfHostedApplicationOAuthConfigurationGrant(BaseModel): + """Settings for OAuth grant behavior.""" + + access_token_lifetime: Optional[str] = None + """The lifetime of the access token. + + Must be in the format `300ms` or `2h45m`. Valid time units are ns, us (or µs), + ms, s, m, h. + """ + + session_duration: Optional[str] = None + """The duration of the OAuth session. + + Must be in the format `300ms` or `2h45m`. Valid time units are ns, us (or µs), + ms, s, m, h. + """ + + +class SelfHostedApplicationOAuthConfiguration(BaseModel): + """ + **Beta:** Optional configuration for managing an OAuth authorization flow controlled by Access. When set, Access will act as the OAuth authorization server for this application. Only compatible with OAuth clients that support [RFC 8707](https://datatracker.ietf.org/doc/html/rfc8707) (Resource Indicators for OAuth 2.0). This feature is currently in beta. + """ + + dynamic_client_registration: Optional[SelfHostedApplicationOAuthConfigurationDynamicClientRegistration] = None + """Settings for OAuth dynamic client registration.""" + + enabled: Optional[bool] = None + """Whether the OAuth configuration is enabled for this application. + + When set to `false`, Access will not handle OAuth for this application. Defaults + to `true` if omitted. + """ + + grant: Optional[SelfHostedApplicationOAuthConfigurationGrant] = None + """Settings for OAuth grant behavior.""" + + +class SelfHostedApplicationPolicyMfaConfig(BaseModel): + """Configures multi-factor authentication (MFA) settings.""" + + allowed_authenticators: Optional[List[Literal["totp", "biometrics", "security_key"]]] = None + """Lists the MFA methods that users can authenticate with.""" + + mfa_bypass: Optional[bool] = None + """Indicates whether to bypass MFA for this resource. + + This option is available at the application and policy level. + """ + + session_duration: Optional[str] = None + """Defines the duration of an MFA session. + + Must be in minutes (m) or hours (h). Minimum: 0m. Maximum: 720h (30 days). + Examples:`5m` or `24h`. + """ + + class SelfHostedApplicationPolicy(BaseModel): id: Optional[str] = None """The UUID of the policy""" @@ -194,6 +346,9 @@ class SelfHostedApplicationPolicy(BaseModel): this feature. """ + mfa_config: Optional[SelfHostedApplicationPolicyMfaConfig] = None + """Configures multi-factor authentication (MFA) settings.""" + name: Optional[str] = None """The name of the Access policy.""" @@ -413,9 +568,21 @@ class SelfHostedApplication(BaseModel): logo_url: Optional[str] = None """The image URL for the logo shown in the App Launcher dashboard.""" + mfa_config: Optional[SelfHostedApplicationMfaConfig] = None + """Configures multi-factor authentication (MFA) settings.""" + name: Optional[str] = None """The name of the application.""" + oauth_configuration: Optional[SelfHostedApplicationOAuthConfiguration] = None + """ + **Beta:** Optional configuration for managing an OAuth authorization flow + controlled by Access. When set, Access will act as the OAuth authorization + server for this application. Only compatible with OAuth clients that support + [RFC 8707](https://datatracker.ietf.org/doc/html/rfc8707) (Resource Indicators + for OAuth 2.0). This feature is currently in beta. + """ + options_preflight_bypass: Optional[bool] = None """ Allows options preflight requests to bypass Access authentication and go @@ -489,6 +656,26 @@ class SelfHostedApplication(BaseModel): """ +class SaaSApplicationPolicyMfaConfig(BaseModel): + """Configures multi-factor authentication (MFA) settings.""" + + allowed_authenticators: Optional[List[Literal["totp", "biometrics", "security_key"]]] = None + """Lists the MFA methods that users can authenticate with.""" + + mfa_bypass: Optional[bool] = None + """Indicates whether to bypass MFA for this resource. + + This option is available at the application and policy level. + """ + + session_duration: Optional[str] = None + """Defines the duration of an MFA session. + + Must be in minutes (m) or hours (h). Minimum: 0m. Maximum: 720h (30 days). + Examples:`5m` or `24h`. + """ + + class SaaSApplicationPolicy(BaseModel): id: Optional[str] = None """The UUID of the policy""" @@ -529,6 +716,9 @@ class SaaSApplicationPolicy(BaseModel): this feature. """ + mfa_config: Optional[SaaSApplicationPolicyMfaConfig] = None + """Configures multi-factor authentication (MFA) settings.""" + name: Optional[str] = None """The name of the Access policy.""" @@ -774,6 +964,102 @@ class BrowserSSHApplicationDestinationViaMcpServerPortalDestination(BaseModel): ] +class BrowserSSHApplicationMfaConfig(BaseModel): + """Configures multi-factor authentication (MFA) settings.""" + + allowed_authenticators: Optional[List[Literal["totp", "biometrics", "security_key"]]] = None + """Lists the MFA methods that users can authenticate with.""" + + mfa_bypass: Optional[bool] = None + """Indicates whether to bypass MFA for this resource. + + This option is available at the application and policy level. + """ + + session_duration: Optional[str] = None + """Defines the duration of an MFA session. + + Must be in minutes (m) or hours (h). Minimum: 0m. Maximum: 720h (30 days). + Examples:`5m` or `24h`. + """ + + +class BrowserSSHApplicationOAuthConfigurationDynamicClientRegistration(BaseModel): + """Settings for OAuth dynamic client registration.""" + + allow_any_on_localhost: Optional[bool] = None + """Allows any client with redirect URIs on localhost.""" + + allow_any_on_loopback: Optional[bool] = None + """Allows any client with redirect URIs on 127.0.0.1.""" + + allowed_uris: Optional[List[str]] = None + """The URIs that are allowed as redirect URIs for dynamically registered clients. + + Must use the `https` protocol. Paths may end in `/*` to match all sub-paths. + """ + + enabled: Optional[bool] = None + """Whether dynamic client registration is enabled.""" + + +class BrowserSSHApplicationOAuthConfigurationGrant(BaseModel): + """Settings for OAuth grant behavior.""" + + access_token_lifetime: Optional[str] = None + """The lifetime of the access token. + + Must be in the format `300ms` or `2h45m`. Valid time units are ns, us (or µs), + ms, s, m, h. + """ + + session_duration: Optional[str] = None + """The duration of the OAuth session. + + Must be in the format `300ms` or `2h45m`. Valid time units are ns, us (or µs), + ms, s, m, h. + """ + + +class BrowserSSHApplicationOAuthConfiguration(BaseModel): + """ + **Beta:** Optional configuration for managing an OAuth authorization flow controlled by Access. When set, Access will act as the OAuth authorization server for this application. Only compatible with OAuth clients that support [RFC 8707](https://datatracker.ietf.org/doc/html/rfc8707) (Resource Indicators for OAuth 2.0). This feature is currently in beta. + """ + + dynamic_client_registration: Optional[BrowserSSHApplicationOAuthConfigurationDynamicClientRegistration] = None + """Settings for OAuth dynamic client registration.""" + + enabled: Optional[bool] = None + """Whether the OAuth configuration is enabled for this application. + + When set to `false`, Access will not handle OAuth for this application. Defaults + to `true` if omitted. + """ + + grant: Optional[BrowserSSHApplicationOAuthConfigurationGrant] = None + """Settings for OAuth grant behavior.""" + + +class BrowserSSHApplicationPolicyMfaConfig(BaseModel): + """Configures multi-factor authentication (MFA) settings.""" + + allowed_authenticators: Optional[List[Literal["totp", "biometrics", "security_key"]]] = None + """Lists the MFA methods that users can authenticate with.""" + + mfa_bypass: Optional[bool] = None + """Indicates whether to bypass MFA for this resource. + + This option is available at the application and policy level. + """ + + session_duration: Optional[str] = None + """Defines the duration of an MFA session. + + Must be in minutes (m) or hours (h). Minimum: 0m. Maximum: 720h (30 days). + Examples:`5m` or `24h`. + """ + + class BrowserSSHApplicationPolicy(BaseModel): id: Optional[str] = None """The UUID of the policy""" @@ -814,6 +1100,9 @@ class BrowserSSHApplicationPolicy(BaseModel): this feature. """ + mfa_config: Optional[BrowserSSHApplicationPolicyMfaConfig] = None + """Configures multi-factor authentication (MFA) settings.""" + name: Optional[str] = None """The name of the Access policy.""" @@ -1048,9 +1337,21 @@ class BrowserSSHApplication(BaseModel): logo_url: Optional[str] = None """The image URL for the logo shown in the App Launcher dashboard.""" + mfa_config: Optional[BrowserSSHApplicationMfaConfig] = None + """Configures multi-factor authentication (MFA) settings.""" + name: Optional[str] = None """The name of the application.""" + oauth_configuration: Optional[BrowserSSHApplicationOAuthConfiguration] = None + """ + **Beta:** Optional configuration for managing an OAuth authorization flow + controlled by Access. When set, Access will act as the OAuth authorization + server for this application. Only compatible with OAuth clients that support + [RFC 8707](https://datatracker.ietf.org/doc/html/rfc8707) (Resource Indicators + for OAuth 2.0). This feature is currently in beta. + """ + options_preflight_bypass: Optional[bool] = None """ Allows options preflight requests to bypass Access authentication and go @@ -1184,6 +1485,102 @@ class BrowserVNCApplicationDestinationViaMcpServerPortalDestination(BaseModel): ] +class BrowserVNCApplicationMfaConfig(BaseModel): + """Configures multi-factor authentication (MFA) settings.""" + + allowed_authenticators: Optional[List[Literal["totp", "biometrics", "security_key"]]] = None + """Lists the MFA methods that users can authenticate with.""" + + mfa_bypass: Optional[bool] = None + """Indicates whether to bypass MFA for this resource. + + This option is available at the application and policy level. + """ + + session_duration: Optional[str] = None + """Defines the duration of an MFA session. + + Must be in minutes (m) or hours (h). Minimum: 0m. Maximum: 720h (30 days). + Examples:`5m` or `24h`. + """ + + +class BrowserVNCApplicationOAuthConfigurationDynamicClientRegistration(BaseModel): + """Settings for OAuth dynamic client registration.""" + + allow_any_on_localhost: Optional[bool] = None + """Allows any client with redirect URIs on localhost.""" + + allow_any_on_loopback: Optional[bool] = None + """Allows any client with redirect URIs on 127.0.0.1.""" + + allowed_uris: Optional[List[str]] = None + """The URIs that are allowed as redirect URIs for dynamically registered clients. + + Must use the `https` protocol. Paths may end in `/*` to match all sub-paths. + """ + + enabled: Optional[bool] = None + """Whether dynamic client registration is enabled.""" + + +class BrowserVNCApplicationOAuthConfigurationGrant(BaseModel): + """Settings for OAuth grant behavior.""" + + access_token_lifetime: Optional[str] = None + """The lifetime of the access token. + + Must be in the format `300ms` or `2h45m`. Valid time units are ns, us (or µs), + ms, s, m, h. + """ + + session_duration: Optional[str] = None + """The duration of the OAuth session. + + Must be in the format `300ms` or `2h45m`. Valid time units are ns, us (or µs), + ms, s, m, h. + """ + + +class BrowserVNCApplicationOAuthConfiguration(BaseModel): + """ + **Beta:** Optional configuration for managing an OAuth authorization flow controlled by Access. When set, Access will act as the OAuth authorization server for this application. Only compatible with OAuth clients that support [RFC 8707](https://datatracker.ietf.org/doc/html/rfc8707) (Resource Indicators for OAuth 2.0). This feature is currently in beta. + """ + + dynamic_client_registration: Optional[BrowserVNCApplicationOAuthConfigurationDynamicClientRegistration] = None + """Settings for OAuth dynamic client registration.""" + + enabled: Optional[bool] = None + """Whether the OAuth configuration is enabled for this application. + + When set to `false`, Access will not handle OAuth for this application. Defaults + to `true` if omitted. + """ + + grant: Optional[BrowserVNCApplicationOAuthConfigurationGrant] = None + """Settings for OAuth grant behavior.""" + + +class BrowserVNCApplicationPolicyMfaConfig(BaseModel): + """Configures multi-factor authentication (MFA) settings.""" + + allowed_authenticators: Optional[List[Literal["totp", "biometrics", "security_key"]]] = None + """Lists the MFA methods that users can authenticate with.""" + + mfa_bypass: Optional[bool] = None + """Indicates whether to bypass MFA for this resource. + + This option is available at the application and policy level. + """ + + session_duration: Optional[str] = None + """Defines the duration of an MFA session. + + Must be in minutes (m) or hours (h). Minimum: 0m. Maximum: 720h (30 days). + Examples:`5m` or `24h`. + """ + + class BrowserVNCApplicationPolicy(BaseModel): id: Optional[str] = None """The UUID of the policy""" @@ -1224,6 +1621,9 @@ class BrowserVNCApplicationPolicy(BaseModel): this feature. """ + mfa_config: Optional[BrowserVNCApplicationPolicyMfaConfig] = None + """Configures multi-factor authentication (MFA) settings.""" + name: Optional[str] = None """The name of the Access policy.""" @@ -1458,9 +1858,21 @@ class BrowserVNCApplication(BaseModel): logo_url: Optional[str] = None """The image URL for the logo shown in the App Launcher dashboard.""" + mfa_config: Optional[BrowserVNCApplicationMfaConfig] = None + """Configures multi-factor authentication (MFA) settings.""" + name: Optional[str] = None """The name of the application.""" + oauth_configuration: Optional[BrowserVNCApplicationOAuthConfiguration] = None + """ + **Beta:** Optional configuration for managing an OAuth authorization flow + controlled by Access. When set, Access will act as the OAuth authorization + server for this application. Only compatible with OAuth clients that support + [RFC 8707](https://datatracker.ietf.org/doc/html/rfc8707) (Resource Indicators + for OAuth 2.0). This feature is currently in beta. + """ + options_preflight_bypass: Optional[bool] = None """ Allows options preflight requests to bypass Access authentication and go @@ -1561,6 +1973,26 @@ class AppLauncherApplicationLandingPageDesign(BaseModel): """The title shown on the landing page.""" +class AppLauncherApplicationPolicyMfaConfig(BaseModel): + """Configures multi-factor authentication (MFA) settings.""" + + allowed_authenticators: Optional[List[Literal["totp", "biometrics", "security_key"]]] = None + """Lists the MFA methods that users can authenticate with.""" + + mfa_bypass: Optional[bool] = None + """Indicates whether to bypass MFA for this resource. + + This option is available at the application and policy level. + """ + + session_duration: Optional[str] = None + """Defines the duration of an MFA session. + + Must be in minutes (m) or hours (h). Minimum: 0m. Maximum: 720h (30 days). + Examples:`5m` or `24h`. + """ + + class AppLauncherApplicationPolicy(BaseModel): id: Optional[str] = None """The UUID of the policy""" @@ -1601,6 +2033,9 @@ class AppLauncherApplicationPolicy(BaseModel): this feature. """ + mfa_config: Optional[AppLauncherApplicationPolicyMfaConfig] = None + """Configures multi-factor authentication (MFA) settings.""" + name: Optional[str] = None """The name of the Access policy.""" @@ -1723,6 +2158,26 @@ class AppLauncherApplication(BaseModel): """Determines when to skip the App Launcher landing page.""" +class DeviceEnrollmentPermissionsApplicationPolicyMfaConfig(BaseModel): + """Configures multi-factor authentication (MFA) settings.""" + + allowed_authenticators: Optional[List[Literal["totp", "biometrics", "security_key"]]] = None + """Lists the MFA methods that users can authenticate with.""" + + mfa_bypass: Optional[bool] = None + """Indicates whether to bypass MFA for this resource. + + This option is available at the application and policy level. + """ + + session_duration: Optional[str] = None + """Defines the duration of an MFA session. + + Must be in minutes (m) or hours (h). Minimum: 0m. Maximum: 720h (30 days). + Examples:`5m` or `24h`. + """ + + class DeviceEnrollmentPermissionsApplicationPolicy(BaseModel): id: Optional[str] = None """The UUID of the policy""" @@ -1763,6 +2218,9 @@ class DeviceEnrollmentPermissionsApplicationPolicy(BaseModel): this feature. """ + mfa_config: Optional[DeviceEnrollmentPermissionsApplicationPolicyMfaConfig] = None + """Configures multi-factor authentication (MFA) settings.""" + name: Optional[str] = None """The name of the Access policy.""" @@ -1852,6 +2310,26 @@ class DeviceEnrollmentPermissionsApplication(BaseModel): """ +class BrowserIsolationPermissionsApplicationPolicyMfaConfig(BaseModel): + """Configures multi-factor authentication (MFA) settings.""" + + allowed_authenticators: Optional[List[Literal["totp", "biometrics", "security_key"]]] = None + """Lists the MFA methods that users can authenticate with.""" + + mfa_bypass: Optional[bool] = None + """Indicates whether to bypass MFA for this resource. + + This option is available at the application and policy level. + """ + + session_duration: Optional[str] = None + """Defines the duration of an MFA session. + + Must be in minutes (m) or hours (h). Minimum: 0m. Maximum: 720h (30 days). + Examples:`5m` or `24h`. + """ + + class BrowserIsolationPermissionsApplicationPolicy(BaseModel): id: Optional[str] = None """The UUID of the policy""" @@ -1892,6 +2370,9 @@ class BrowserIsolationPermissionsApplicationPolicy(BaseModel): this feature. """ + mfa_config: Optional[BrowserIsolationPermissionsApplicationPolicyMfaConfig] = None + """Configures multi-factor authentication (MFA) settings.""" + name: Optional[str] = None """The name of the Access policy.""" @@ -1981,6 +2462,26 @@ class BrowserIsolationPermissionsApplication(BaseModel): """ +class GatewayIdentityProxyEndpointApplicationPolicyMfaConfig(BaseModel): + """Configures multi-factor authentication (MFA) settings.""" + + allowed_authenticators: Optional[List[Literal["totp", "biometrics", "security_key"]]] = None + """Lists the MFA methods that users can authenticate with.""" + + mfa_bypass: Optional[bool] = None + """Indicates whether to bypass MFA for this resource. + + This option is available at the application and policy level. + """ + + session_duration: Optional[str] = None + """Defines the duration of an MFA session. + + Must be in minutes (m) or hours (h). Minimum: 0m. Maximum: 720h (30 days). + Examples:`5m` or `24h`. + """ + + class GatewayIdentityProxyEndpointApplicationPolicy(BaseModel): id: Optional[str] = None """The UUID of the policy""" @@ -2021,6 +2522,9 @@ class GatewayIdentityProxyEndpointApplicationPolicy(BaseModel): this feature. """ + mfa_config: Optional[GatewayIdentityProxyEndpointApplicationPolicyMfaConfig] = None + """Configures multi-factor authentication (MFA) settings.""" + name: Optional[str] = None """The name of the Access policy.""" @@ -2110,6 +2614,26 @@ class GatewayIdentityProxyEndpointApplication(BaseModel): """ +class BookmarkApplicationPolicyMfaConfig(BaseModel): + """Configures multi-factor authentication (MFA) settings.""" + + allowed_authenticators: Optional[List[Literal["totp", "biometrics", "security_key"]]] = None + """Lists the MFA methods that users can authenticate with.""" + + mfa_bypass: Optional[bool] = None + """Indicates whether to bypass MFA for this resource. + + This option is available at the application and policy level. + """ + + session_duration: Optional[str] = None + """Defines the duration of an MFA session. + + Must be in minutes (m) or hours (h). Minimum: 0m. Maximum: 720h (30 days). + Examples:`5m` or `24h`. + """ + + class BookmarkApplicationPolicy(BaseModel): id: Optional[str] = None """The UUID of the policy""" @@ -2150,6 +2674,9 @@ class BookmarkApplicationPolicy(BaseModel): this feature. """ + mfa_config: Optional[BookmarkApplicationPolicyMfaConfig] = None + """Configures multi-factor authentication (MFA) settings.""" + name: Optional[str] = None """The name of the Access policy.""" @@ -2384,37 +2911,133 @@ class BrowserRdpApplicationDestinationViaMcpServerPortalDestination(BaseModel): ] -class BrowserRdpApplicationPolicy(BaseModel): - id: Optional[str] = None - """The UUID of the policy""" +class BrowserRdpApplicationMfaConfig(BaseModel): + """Configures multi-factor authentication (MFA) settings.""" - approval_groups: Optional[List[ApprovalGroup]] = None - """Administrators who can approve a temporary authentication request.""" + allowed_authenticators: Optional[List[Literal["totp", "biometrics", "security_key"]]] = None + """Lists the MFA methods that users can authenticate with.""" - approval_required: Optional[bool] = None - """ - Requires the user to request access from an administrator at the start of each - session. - """ + mfa_bypass: Optional[bool] = None + """Indicates whether to bypass MFA for this resource. - created_at: Optional[datetime] = None + This option is available at the application and policy level. + """ - decision: Optional[Decision] = None - """The action Access will take if a user matches this policy. + session_duration: Optional[str] = None + """Defines the duration of an MFA session. - Infrastructure application policies can only use the Allow action. + Must be in minutes (m) or hours (h). Minimum: 0m. Maximum: 720h (30 days). + Examples:`5m` or `24h`. """ - exclude: Optional[List[AccessRule]] = None - """Rules evaluated with a NOT logical operator. - To match the policy, a user cannot meet any of the Exclude rules. - """ +class BrowserRdpApplicationOAuthConfigurationDynamicClientRegistration(BaseModel): + """Settings for OAuth dynamic client registration.""" - include: Optional[List[AccessRule]] = None - """Rules evaluated with an OR logical operator. + allow_any_on_localhost: Optional[bool] = None + """Allows any client with redirect URIs on localhost.""" - A user needs to meet only one of the Include rules. + allow_any_on_loopback: Optional[bool] = None + """Allows any client with redirect URIs on 127.0.0.1.""" + + allowed_uris: Optional[List[str]] = None + """The URIs that are allowed as redirect URIs for dynamically registered clients. + + Must use the `https` protocol. Paths may end in `/*` to match all sub-paths. + """ + + enabled: Optional[bool] = None + """Whether dynamic client registration is enabled.""" + + +class BrowserRdpApplicationOAuthConfigurationGrant(BaseModel): + """Settings for OAuth grant behavior.""" + + access_token_lifetime: Optional[str] = None + """The lifetime of the access token. + + Must be in the format `300ms` or `2h45m`. Valid time units are ns, us (or µs), + ms, s, m, h. + """ + + session_duration: Optional[str] = None + """The duration of the OAuth session. + + Must be in the format `300ms` or `2h45m`. Valid time units are ns, us (or µs), + ms, s, m, h. + """ + + +class BrowserRdpApplicationOAuthConfiguration(BaseModel): + """ + **Beta:** Optional configuration for managing an OAuth authorization flow controlled by Access. When set, Access will act as the OAuth authorization server for this application. Only compatible with OAuth clients that support [RFC 8707](https://datatracker.ietf.org/doc/html/rfc8707) (Resource Indicators for OAuth 2.0). This feature is currently in beta. + """ + + dynamic_client_registration: Optional[BrowserRdpApplicationOAuthConfigurationDynamicClientRegistration] = None + """Settings for OAuth dynamic client registration.""" + + enabled: Optional[bool] = None + """Whether the OAuth configuration is enabled for this application. + + When set to `false`, Access will not handle OAuth for this application. Defaults + to `true` if omitted. + """ + + grant: Optional[BrowserRdpApplicationOAuthConfigurationGrant] = None + """Settings for OAuth grant behavior.""" + + +class BrowserRdpApplicationPolicyMfaConfig(BaseModel): + """Configures multi-factor authentication (MFA) settings.""" + + allowed_authenticators: Optional[List[Literal["totp", "biometrics", "security_key"]]] = None + """Lists the MFA methods that users can authenticate with.""" + + mfa_bypass: Optional[bool] = None + """Indicates whether to bypass MFA for this resource. + + This option is available at the application and policy level. + """ + + session_duration: Optional[str] = None + """Defines the duration of an MFA session. + + Must be in minutes (m) or hours (h). Minimum: 0m. Maximum: 720h (30 days). + Examples:`5m` or `24h`. + """ + + +class BrowserRdpApplicationPolicy(BaseModel): + id: Optional[str] = None + """The UUID of the policy""" + + approval_groups: Optional[List[ApprovalGroup]] = None + """Administrators who can approve a temporary authentication request.""" + + approval_required: Optional[bool] = None + """ + Requires the user to request access from an administrator at the start of each + session. + """ + + created_at: Optional[datetime] = None + + decision: Optional[Decision] = None + """The action Access will take if a user matches this policy. + + Infrastructure application policies can only use the Allow action. + """ + + exclude: Optional[List[AccessRule]] = None + """Rules evaluated with a NOT logical operator. + + To match the policy, a user cannot meet any of the Exclude rules. + """ + + include: Optional[List[AccessRule]] = None + """Rules evaluated with an OR logical operator. + + A user needs to meet only one of the Include rules. """ isolation_required: Optional[bool] = None @@ -2424,6 +3047,9 @@ class BrowserRdpApplicationPolicy(BaseModel): this feature. """ + mfa_config: Optional[BrowserRdpApplicationPolicyMfaConfig] = None + """Configures multi-factor authentication (MFA) settings.""" + name: Optional[str] = None """The name of the Access policy.""" @@ -2645,9 +3271,21 @@ class BrowserRdpApplication(BaseModel): logo_url: Optional[str] = None """The image URL for the logo shown in the App Launcher dashboard.""" + mfa_config: Optional[BrowserRdpApplicationMfaConfig] = None + """Configures multi-factor authentication (MFA) settings.""" + name: Optional[str] = None """The name of the application.""" + oauth_configuration: Optional[BrowserRdpApplicationOAuthConfiguration] = None + """ + **Beta:** Optional configuration for managing an OAuth authorization flow + controlled by Access. When set, Access will act as the OAuth authorization + server for this application. Only compatible with OAuth clients that support + [RFC 8707](https://datatracker.ietf.org/doc/html/rfc8707) (Resource Indicators + for OAuth 2.0). This feature is currently in beta. + """ + options_preflight_bypass: Optional[bool] = None """ Allows options preflight requests to bypass Access authentication and go @@ -2721,6 +3359,860 @@ class BrowserRdpApplication(BaseModel): """ +class McpServerApplicationDestinationPublicDestination(BaseModel): + """A public hostname that Access will secure. + + Public destinations support sub-domain and path. Wildcard '*' can be used in the definition. + """ + + type: Optional[Literal["public"]] = None + + uri: Optional[str] = None + """The URI of the destination. + + Public destinations' URIs can include a domain and path with + [wildcards](https://developers.cloudflare.com/cloudflare-one/policies/access/app-paths/). + """ + + +class McpServerApplicationDestinationPrivateDestination(BaseModel): + cidr: Optional[str] = None + """The CIDR range of the destination. Single IPs will be computed as /32.""" + + hostname: Optional[str] = None + """The hostname of the destination. Matches a valid SNI served by an HTTPS origin.""" + + l4_protocol: Optional[Literal["tcp", "udp"]] = None + """The L4 protocol of the destination. + + When omitted, both UDP and TCP traffic will match. + """ + + port_range: Optional[str] = None + """The port range of the destination. + + Can be a single port or a range of ports. When omitted, all ports will match. + """ + + type: Optional[Literal["private"]] = None + + vnet_id: Optional[str] = None + """The VNET ID to match the destination. When omitted, all VNETs will match.""" + + +class McpServerApplicationDestinationViaMcpServerPortalDestination(BaseModel): + """A MCP server id configured in ai-controls. + + Access will secure the MCP server if accessed through a MCP portal. + """ + + mcp_server_id: Optional[str] = None + """The MCP server id configured in ai-controls.""" + + type: Optional[Literal["via_mcp_server_portal"]] = None + + +McpServerApplicationDestination: TypeAlias = Union[ + McpServerApplicationDestinationPublicDestination, + McpServerApplicationDestinationPrivateDestination, + McpServerApplicationDestinationViaMcpServerPortalDestination, +] + + +class McpServerApplicationOAuthConfigurationDynamicClientRegistration(BaseModel): + """Settings for OAuth dynamic client registration.""" + + allow_any_on_localhost: Optional[bool] = None + """Allows any client with redirect URIs on localhost.""" + + allow_any_on_loopback: Optional[bool] = None + """Allows any client with redirect URIs on 127.0.0.1.""" + + allowed_uris: Optional[List[str]] = None + """The URIs that are allowed as redirect URIs for dynamically registered clients. + + Must use the `https` protocol. Paths may end in `/*` to match all sub-paths. + """ + + enabled: Optional[bool] = None + """Whether dynamic client registration is enabled.""" + + +class McpServerApplicationOAuthConfigurationGrant(BaseModel): + """Settings for OAuth grant behavior.""" + + access_token_lifetime: Optional[str] = None + """The lifetime of the access token. + + Must be in the format `300ms` or `2h45m`. Valid time units are ns, us (or µs), + ms, s, m, h. + """ + + session_duration: Optional[str] = None + """The duration of the OAuth session. + + Must be in the format `300ms` or `2h45m`. Valid time units are ns, us (or µs), + ms, s, m, h. + """ + + +class McpServerApplicationOAuthConfiguration(BaseModel): + """ + **Beta:** Optional configuration for managing an OAuth authorization flow controlled by Access. When set, Access will act as the OAuth authorization server for this application. Only compatible with OAuth clients that support [RFC 8707](https://datatracker.ietf.org/doc/html/rfc8707) (Resource Indicators for OAuth 2.0). This feature is currently in beta. + """ + + dynamic_client_registration: Optional[McpServerApplicationOAuthConfigurationDynamicClientRegistration] = None + """Settings for OAuth dynamic client registration.""" + + enabled: Optional[bool] = None + """Whether the OAuth configuration is enabled for this application. + + When set to `false`, Access will not handle OAuth for this application. Defaults + to `true` if omitted. + """ + + grant: Optional[McpServerApplicationOAuthConfigurationGrant] = None + """Settings for OAuth grant behavior.""" + + +class McpServerApplicationPolicyMfaConfig(BaseModel): + """Configures multi-factor authentication (MFA) settings.""" + + allowed_authenticators: Optional[List[Literal["totp", "biometrics", "security_key"]]] = None + """Lists the MFA methods that users can authenticate with.""" + + mfa_bypass: Optional[bool] = None + """Indicates whether to bypass MFA for this resource. + + This option is available at the application and policy level. + """ + + session_duration: Optional[str] = None + """Defines the duration of an MFA session. + + Must be in minutes (m) or hours (h). Minimum: 0m. Maximum: 720h (30 days). + Examples:`5m` or `24h`. + """ + + +class McpServerApplicationPolicy(BaseModel): + id: Optional[str] = None + """The UUID of the policy""" + + approval_groups: Optional[List[ApprovalGroup]] = None + """Administrators who can approve a temporary authentication request.""" + + approval_required: Optional[bool] = None + """ + Requires the user to request access from an administrator at the start of each + session. + """ + + created_at: Optional[datetime] = None + + decision: Optional[Decision] = None + """The action Access will take if a user matches this policy. + + Infrastructure application policies can only use the Allow action. + """ + + exclude: Optional[List[AccessRule]] = None + """Rules evaluated with a NOT logical operator. + + To match the policy, a user cannot meet any of the Exclude rules. + """ + + include: Optional[List[AccessRule]] = None + """Rules evaluated with an OR logical operator. + + A user needs to meet only one of the Include rules. + """ + + isolation_required: Optional[bool] = None + """ + Require this application to be served in an isolated browser for users matching + this policy. 'Client Web Isolation' must be on for the account in order to use + this feature. + """ + + mfa_config: Optional[McpServerApplicationPolicyMfaConfig] = None + """Configures multi-factor authentication (MFA) settings.""" + + name: Optional[str] = None + """The name of the Access policy.""" + + precedence: Optional[int] = None + """The order of execution for this policy. + + Must be unique for each policy within an app. + """ + + purpose_justification_prompt: Optional[str] = None + """A custom message that will appear on the purpose justification screen.""" + + purpose_justification_required: Optional[bool] = None + """Require users to enter a justification when they log in to the application.""" + + require: Optional[List[AccessRule]] = None + """Rules evaluated with an AND logical operator. + + To match the policy, a user must meet all of the Require rules. + """ + + session_duration: Optional[str] = None + """The amount of time that tokens issued for the application will be valid. + + Must be in the format `300ms` or `2h45m`. Valid time units are: ns, us (or µs), + ms, s, m, h. + """ + + updated_at: Optional[datetime] = None + + +class McpServerApplicationSCIMConfigAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken(BaseModel): + """ + Attributes for configuring Access Service Token authentication scheme for SCIM provisioning to an application. + """ + + client_id: str + """ + Client ID of the Access service token used to authenticate with the remote + service. + """ + + client_secret: str + """ + Client secret of the Access service token used to authenticate with the remote + service. + """ + + scheme: Literal["access_service_token"] + """The authentication scheme to use when making SCIM requests to this application.""" + + +class McpServerApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken( + BaseModel +): + """ + Attributes for configuring Access Service Token authentication scheme for SCIM provisioning to an application. + """ + + client_id: str + """ + Client ID of the Access service token used to authenticate with the remote + service. + """ + + client_secret: str + """ + Client secret of the Access service token used to authenticate with the remote + service. + """ + + scheme: Literal["access_service_token"] + """The authentication scheme to use when making SCIM requests to this application.""" + + +McpServerApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthentication: TypeAlias = Union[ + SCIMConfigAuthenticationHTTPBasic, + SCIMConfigAuthenticationOAuthBearerToken, + SCIMConfigAuthenticationOauth2, + McpServerApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken, +] + +McpServerApplicationSCIMConfigAuthentication: TypeAlias = Union[ + SCIMConfigAuthenticationHTTPBasic, + SCIMConfigAuthenticationOAuthBearerToken, + SCIMConfigAuthenticationOauth2, + McpServerApplicationSCIMConfigAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken, + List[McpServerApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthentication], +] + + +class McpServerApplicationSCIMConfig(BaseModel): + """Configuration for provisioning to this application via SCIM. + + This is currently in closed beta. + """ + + idp_uid: str + """ + The UID of the IdP to use as the source for SCIM resources to provision to this + application. + """ + + remote_uri: str + """The base URI for the application's SCIM-compatible API.""" + + authentication: Optional[McpServerApplicationSCIMConfigAuthentication] = None + """ + Attributes for configuring HTTP Basic authentication scheme for SCIM + provisioning to an application. + """ + + deactivate_on_delete: Optional[bool] = None + """ + If false, propagates DELETE requests to the target application for SCIM + resources. If true, sets 'active' to false on the SCIM resource. Note: Some + targets do not support DELETE operations. + """ + + enabled: Optional[bool] = None + """Whether SCIM provisioning is turned on for this application.""" + + mappings: Optional[List[SCIMConfigMapping]] = None + """ + A list of mappings to apply to SCIM resources before provisioning them in this + application. These can transform or filter the resources to be provisioned. + """ + + +class McpServerApplication(BaseModel): + type: ApplicationType + """The application type.""" + + id: Optional[str] = None + """UUID.""" + + allow_authenticate_via_warp: Optional[bool] = None + """ + When set to true, users can authenticate to this application using their WARP + session. When set to false this application will always require direct IdP + authentication. This setting always overrides the organization setting for WARP + authentication. + """ + + allowed_idps: Optional[List[AllowedIdPs]] = None + """The identity providers your users can select when connecting to this + application. + + Defaults to all IdPs configured in your account. + """ + + aud: Optional[str] = None + """Audience tag.""" + + auto_redirect_to_identity: Optional[bool] = None + """When set to `true`, users skip the identity provider selection step during + login. + + You must specify only one identity provider in allowed_idps. + """ + + custom_deny_message: Optional[str] = None + """ + The custom error message shown to a user when they are denied access to the + application. + """ + + custom_deny_url: Optional[str] = None + """ + The custom URL a user is redirected to when they are denied access to the + application when failing identity-based rules. + """ + + custom_non_identity_deny_url: Optional[str] = None + """ + The custom URL a user is redirected to when they are denied access to the + application when failing non-identity rules. + """ + + custom_pages: Optional[List[str]] = None + """The custom pages that will be displayed when applicable for this application""" + + destinations: Optional[List[McpServerApplicationDestination]] = None + """List of destinations secured by Access. + + This supersedes `self_hosted_domains` to allow for more flexibility in defining + different types of domains. If `destinations` are provided, then + `self_hosted_domains` will be ignored. + """ + + http_only_cookie_attribute: Optional[bool] = None + """ + Enables the HttpOnly cookie attribute, which increases security against XSS + attacks. + """ + + logo_url: Optional[str] = None + """The image URL for the logo shown in the App Launcher dashboard.""" + + name: Optional[str] = None + """The name of the application.""" + + oauth_configuration: Optional[McpServerApplicationOAuthConfiguration] = None + """ + **Beta:** Optional configuration for managing an OAuth authorization flow + controlled by Access. When set, Access will act as the OAuth authorization + server for this application. Only compatible with OAuth clients that support + [RFC 8707](https://datatracker.ietf.org/doc/html/rfc8707) (Resource Indicators + for OAuth 2.0). This feature is currently in beta. + """ + + options_preflight_bypass: Optional[bool] = None + """ + Allows options preflight requests to bypass Access authentication and go + directly to the origin. Cannot turn on if cors_headers is set. + """ + + policies: Optional[List[McpServerApplicationPolicy]] = None + + same_site_cookie_attribute: Optional[str] = None + """ + Sets the SameSite cookie setting, which provides increased security against CSRF + attacks. + """ + + scim_config: Optional[McpServerApplicationSCIMConfig] = None + """Configuration for provisioning to this application via SCIM. + + This is currently in closed beta. + """ + + session_duration: Optional[str] = None + """The amount of time that tokens issued for this application will be valid. + + Must be in the format `300ms` or `2h45m`. Valid time units are: ns, us (or µs), + ms, s, m, h. Note: unsupported for infrastructure type applications. + """ + + tags: Optional[List[str]] = None + """The tags you want assigned to an application. + + Tags are used to filter applications in the App Launcher dashboard. + """ + + +class McpServerPortalApplicationDestinationPublicDestination(BaseModel): + """A public hostname that Access will secure. + + Public destinations support sub-domain and path. Wildcard '*' can be used in the definition. + """ + + type: Optional[Literal["public"]] = None + + uri: Optional[str] = None + """The URI of the destination. + + Public destinations' URIs can include a domain and path with + [wildcards](https://developers.cloudflare.com/cloudflare-one/policies/access/app-paths/). + """ + + +class McpServerPortalApplicationDestinationPrivateDestination(BaseModel): + cidr: Optional[str] = None + """The CIDR range of the destination. Single IPs will be computed as /32.""" + + hostname: Optional[str] = None + """The hostname of the destination. Matches a valid SNI served by an HTTPS origin.""" + + l4_protocol: Optional[Literal["tcp", "udp"]] = None + """The L4 protocol of the destination. + + When omitted, both UDP and TCP traffic will match. + """ + + port_range: Optional[str] = None + """The port range of the destination. + + Can be a single port or a range of ports. When omitted, all ports will match. + """ + + type: Optional[Literal["private"]] = None + + vnet_id: Optional[str] = None + """The VNET ID to match the destination. When omitted, all VNETs will match.""" + + +class McpServerPortalApplicationDestinationViaMcpServerPortalDestination(BaseModel): + """A MCP server id configured in ai-controls. + + Access will secure the MCP server if accessed through a MCP portal. + """ + + mcp_server_id: Optional[str] = None + """The MCP server id configured in ai-controls.""" + + type: Optional[Literal["via_mcp_server_portal"]] = None + + +McpServerPortalApplicationDestination: TypeAlias = Union[ + McpServerPortalApplicationDestinationPublicDestination, + McpServerPortalApplicationDestinationPrivateDestination, + McpServerPortalApplicationDestinationViaMcpServerPortalDestination, +] + + +class McpServerPortalApplicationOAuthConfigurationDynamicClientRegistration(BaseModel): + """Settings for OAuth dynamic client registration.""" + + allow_any_on_localhost: Optional[bool] = None + """Allows any client with redirect URIs on localhost.""" + + allow_any_on_loopback: Optional[bool] = None + """Allows any client with redirect URIs on 127.0.0.1.""" + + allowed_uris: Optional[List[str]] = None + """The URIs that are allowed as redirect URIs for dynamically registered clients. + + Must use the `https` protocol. Paths may end in `/*` to match all sub-paths. + """ + + enabled: Optional[bool] = None + """Whether dynamic client registration is enabled.""" + + +class McpServerPortalApplicationOAuthConfigurationGrant(BaseModel): + """Settings for OAuth grant behavior.""" + + access_token_lifetime: Optional[str] = None + """The lifetime of the access token. + + Must be in the format `300ms` or `2h45m`. Valid time units are ns, us (or µs), + ms, s, m, h. + """ + + session_duration: Optional[str] = None + """The duration of the OAuth session. + + Must be in the format `300ms` or `2h45m`. Valid time units are ns, us (or µs), + ms, s, m, h. + """ + + +class McpServerPortalApplicationOAuthConfiguration(BaseModel): + """ + **Beta:** Optional configuration for managing an OAuth authorization flow controlled by Access. When set, Access will act as the OAuth authorization server for this application. Only compatible with OAuth clients that support [RFC 8707](https://datatracker.ietf.org/doc/html/rfc8707) (Resource Indicators for OAuth 2.0). This feature is currently in beta. + """ + + dynamic_client_registration: Optional[McpServerPortalApplicationOAuthConfigurationDynamicClientRegistration] = None + """Settings for OAuth dynamic client registration.""" + + enabled: Optional[bool] = None + """Whether the OAuth configuration is enabled for this application. + + When set to `false`, Access will not handle OAuth for this application. Defaults + to `true` if omitted. + """ + + grant: Optional[McpServerPortalApplicationOAuthConfigurationGrant] = None + """Settings for OAuth grant behavior.""" + + +class McpServerPortalApplicationPolicyMfaConfig(BaseModel): + """Configures multi-factor authentication (MFA) settings.""" + + allowed_authenticators: Optional[List[Literal["totp", "biometrics", "security_key"]]] = None + """Lists the MFA methods that users can authenticate with.""" + + mfa_bypass: Optional[bool] = None + """Indicates whether to bypass MFA for this resource. + + This option is available at the application and policy level. + """ + + session_duration: Optional[str] = None + """Defines the duration of an MFA session. + + Must be in minutes (m) or hours (h). Minimum: 0m. Maximum: 720h (30 days). + Examples:`5m` or `24h`. + """ + + +class McpServerPortalApplicationPolicy(BaseModel): + id: Optional[str] = None + """The UUID of the policy""" + + approval_groups: Optional[List[ApprovalGroup]] = None + """Administrators who can approve a temporary authentication request.""" + + approval_required: Optional[bool] = None + """ + Requires the user to request access from an administrator at the start of each + session. + """ + + created_at: Optional[datetime] = None + + decision: Optional[Decision] = None + """The action Access will take if a user matches this policy. + + Infrastructure application policies can only use the Allow action. + """ + + exclude: Optional[List[AccessRule]] = None + """Rules evaluated with a NOT logical operator. + + To match the policy, a user cannot meet any of the Exclude rules. + """ + + include: Optional[List[AccessRule]] = None + """Rules evaluated with an OR logical operator. + + A user needs to meet only one of the Include rules. + """ + + isolation_required: Optional[bool] = None + """ + Require this application to be served in an isolated browser for users matching + this policy. 'Client Web Isolation' must be on for the account in order to use + this feature. + """ + + mfa_config: Optional[McpServerPortalApplicationPolicyMfaConfig] = None + """Configures multi-factor authentication (MFA) settings.""" + + name: Optional[str] = None + """The name of the Access policy.""" + + precedence: Optional[int] = None + """The order of execution for this policy. + + Must be unique for each policy within an app. + """ + + purpose_justification_prompt: Optional[str] = None + """A custom message that will appear on the purpose justification screen.""" + + purpose_justification_required: Optional[bool] = None + """Require users to enter a justification when they log in to the application.""" + + require: Optional[List[AccessRule]] = None + """Rules evaluated with an AND logical operator. + + To match the policy, a user must meet all of the Require rules. + """ + + session_duration: Optional[str] = None + """The amount of time that tokens issued for the application will be valid. + + Must be in the format `300ms` or `2h45m`. Valid time units are: ns, us (or µs), + ms, s, m, h. + """ + + updated_at: Optional[datetime] = None + + +class McpServerPortalApplicationSCIMConfigAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken(BaseModel): + """ + Attributes for configuring Access Service Token authentication scheme for SCIM provisioning to an application. + """ + + client_id: str + """ + Client ID of the Access service token used to authenticate with the remote + service. + """ + + client_secret: str + """ + Client secret of the Access service token used to authenticate with the remote + service. + """ + + scheme: Literal["access_service_token"] + """The authentication scheme to use when making SCIM requests to this application.""" + + +class McpServerPortalApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken( + BaseModel +): + """ + Attributes for configuring Access Service Token authentication scheme for SCIM provisioning to an application. + """ + + client_id: str + """ + Client ID of the Access service token used to authenticate with the remote + service. + """ + + client_secret: str + """ + Client secret of the Access service token used to authenticate with the remote + service. + """ + + scheme: Literal["access_service_token"] + """The authentication scheme to use when making SCIM requests to this application.""" + + +McpServerPortalApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthentication: TypeAlias = Union[ + SCIMConfigAuthenticationHTTPBasic, + SCIMConfigAuthenticationOAuthBearerToken, + SCIMConfigAuthenticationOauth2, + McpServerPortalApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken, +] + +McpServerPortalApplicationSCIMConfigAuthentication: TypeAlias = Union[ + SCIMConfigAuthenticationHTTPBasic, + SCIMConfigAuthenticationOAuthBearerToken, + SCIMConfigAuthenticationOauth2, + McpServerPortalApplicationSCIMConfigAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken, + List[McpServerPortalApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthentication], +] + + +class McpServerPortalApplicationSCIMConfig(BaseModel): + """Configuration for provisioning to this application via SCIM. + + This is currently in closed beta. + """ + + idp_uid: str + """ + The UID of the IdP to use as the source for SCIM resources to provision to this + application. + """ + + remote_uri: str + """The base URI for the application's SCIM-compatible API.""" + + authentication: Optional[McpServerPortalApplicationSCIMConfigAuthentication] = None + """ + Attributes for configuring HTTP Basic authentication scheme for SCIM + provisioning to an application. + """ + + deactivate_on_delete: Optional[bool] = None + """ + If false, propagates DELETE requests to the target application for SCIM + resources. If true, sets 'active' to false on the SCIM resource. Note: Some + targets do not support DELETE operations. + """ + + enabled: Optional[bool] = None + """Whether SCIM provisioning is turned on for this application.""" + + mappings: Optional[List[SCIMConfigMapping]] = None + """ + A list of mappings to apply to SCIM resources before provisioning them in this + application. These can transform or filter the resources to be provisioned. + """ + + +class McpServerPortalApplication(BaseModel): + type: ApplicationType + """The application type.""" + + id: Optional[str] = None + """UUID.""" + + allow_authenticate_via_warp: Optional[bool] = None + """ + When set to true, users can authenticate to this application using their WARP + session. When set to false this application will always require direct IdP + authentication. This setting always overrides the organization setting for WARP + authentication. + """ + + allowed_idps: Optional[List[AllowedIdPs]] = None + """The identity providers your users can select when connecting to this + application. + + Defaults to all IdPs configured in your account. + """ + + aud: Optional[str] = None + """Audience tag.""" + + auto_redirect_to_identity: Optional[bool] = None + """When set to `true`, users skip the identity provider selection step during + login. + + You must specify only one identity provider in allowed_idps. + """ + + custom_deny_message: Optional[str] = None + """ + The custom error message shown to a user when they are denied access to the + application. + """ + + custom_deny_url: Optional[str] = None + """ + The custom URL a user is redirected to when they are denied access to the + application when failing identity-based rules. + """ + + custom_non_identity_deny_url: Optional[str] = None + """ + The custom URL a user is redirected to when they are denied access to the + application when failing non-identity rules. + """ + + custom_pages: Optional[List[str]] = None + """The custom pages that will be displayed when applicable for this application""" + + destinations: Optional[List[McpServerPortalApplicationDestination]] = None + """List of destinations secured by Access. + + This supersedes `self_hosted_domains` to allow for more flexibility in defining + different types of domains. If `destinations` are provided, then + `self_hosted_domains` will be ignored. + """ + + domain: Optional[str] = None + """The primary hostname and path secured by Access. + + This domain will be displayed if the app is visible in the App Launcher. + """ + + http_only_cookie_attribute: Optional[bool] = None + """ + Enables the HttpOnly cookie attribute, which increases security against XSS + attacks. + """ + + logo_url: Optional[str] = None + """The image URL for the logo shown in the App Launcher dashboard.""" + + name: Optional[str] = None + """The name of the application.""" + + oauth_configuration: Optional[McpServerPortalApplicationOAuthConfiguration] = None + """ + **Beta:** Optional configuration for managing an OAuth authorization flow + controlled by Access. When set, Access will act as the OAuth authorization + server for this application. Only compatible with OAuth clients that support + [RFC 8707](https://datatracker.ietf.org/doc/html/rfc8707) (Resource Indicators + for OAuth 2.0). This feature is currently in beta. + """ + + options_preflight_bypass: Optional[bool] = None + """ + Allows options preflight requests to bypass Access authentication and go + directly to the origin. Cannot turn on if cors_headers is set. + """ + + policies: Optional[List[McpServerPortalApplicationPolicy]] = None + + same_site_cookie_attribute: Optional[str] = None + """ + Sets the SameSite cookie setting, which provides increased security against CSRF + attacks. + """ + + scim_config: Optional[McpServerPortalApplicationSCIMConfig] = None + """Configuration for provisioning to this application via SCIM. + + This is currently in closed beta. + """ + + session_duration: Optional[str] = None + """The amount of time that tokens issued for this application will be valid. + + Must be in the format `300ms` or `2h45m`. Valid time units are: ns, us (or µs), + ms, s, m, h. Note: unsupported for infrastructure type applications. + """ + + tags: Optional[List[str]] = None + """The tags you want assigned to an application. + + Tags are used to filter applications in the App Launcher dashboard. + """ + + ApplicationGetResponse: TypeAlias = Union[ SelfHostedApplication, SaaSApplication, @@ -2733,4 +4225,6 @@ class BrowserRdpApplication(BaseModel): BookmarkApplication, InfrastructureApplication, BrowserRdpApplication, + McpServerApplication, + McpServerPortalApplication, ] diff --git a/src/cloudflare/types/zero_trust/access/application_list_response.py b/src/cloudflare/types/zero_trust/access/application_list_response.py index 7878a02cfd8..f565fa37c5a 100644 --- a/src/cloudflare/types/zero_trust/access/application_list_response.py +++ b/src/cloudflare/types/zero_trust/access/application_list_response.py @@ -26,7 +26,12 @@ "SelfHostedApplicationDestinationPublicDestination", "SelfHostedApplicationDestinationPrivateDestination", "SelfHostedApplicationDestinationViaMcpServerPortalDestination", + "SelfHostedApplicationMfaConfig", + "SelfHostedApplicationOAuthConfiguration", + "SelfHostedApplicationOAuthConfigurationDynamicClientRegistration", + "SelfHostedApplicationOAuthConfigurationGrant", "SelfHostedApplicationPolicy", + "SelfHostedApplicationPolicyMfaConfig", "SelfHostedApplicationSCIMConfig", "SelfHostedApplicationSCIMConfigAuthentication", "SelfHostedApplicationSCIMConfigAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken", @@ -34,6 +39,7 @@ "SelfHostedApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken", "SaaSApplication", "SaaSApplicationPolicy", + "SaaSApplicationPolicyMfaConfig", "SaaSApplicationSaaSApp", "SaaSApplicationSCIMConfig", "SaaSApplicationSCIMConfigAuthentication", @@ -45,7 +51,12 @@ "BrowserSSHApplicationDestinationPublicDestination", "BrowserSSHApplicationDestinationPrivateDestination", "BrowserSSHApplicationDestinationViaMcpServerPortalDestination", + "BrowserSSHApplicationMfaConfig", + "BrowserSSHApplicationOAuthConfiguration", + "BrowserSSHApplicationOAuthConfigurationDynamicClientRegistration", + "BrowserSSHApplicationOAuthConfigurationGrant", "BrowserSSHApplicationPolicy", + "BrowserSSHApplicationPolicyMfaConfig", "BrowserSSHApplicationSCIMConfig", "BrowserSSHApplicationSCIMConfigAuthentication", "BrowserSSHApplicationSCIMConfigAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken", @@ -56,7 +67,12 @@ "BrowserVNCApplicationDestinationPublicDestination", "BrowserVNCApplicationDestinationPrivateDestination", "BrowserVNCApplicationDestinationViaMcpServerPortalDestination", + "BrowserVNCApplicationMfaConfig", + "BrowserVNCApplicationOAuthConfiguration", + "BrowserVNCApplicationOAuthConfigurationDynamicClientRegistration", + "BrowserVNCApplicationOAuthConfigurationGrant", "BrowserVNCApplicationPolicy", + "BrowserVNCApplicationPolicyMfaConfig", "BrowserVNCApplicationSCIMConfig", "BrowserVNCApplicationSCIMConfigAuthentication", "BrowserVNCApplicationSCIMConfigAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken", @@ -66,14 +82,19 @@ "AppLauncherApplicationFooterLink", "AppLauncherApplicationLandingPageDesign", "AppLauncherApplicationPolicy", + "AppLauncherApplicationPolicyMfaConfig", "DeviceEnrollmentPermissionsApplication", "DeviceEnrollmentPermissionsApplicationPolicy", + "DeviceEnrollmentPermissionsApplicationPolicyMfaConfig", "BrowserIsolationPermissionsApplication", "BrowserIsolationPermissionsApplicationPolicy", + "BrowserIsolationPermissionsApplicationPolicyMfaConfig", "GatewayIdentityProxyEndpointApplication", "GatewayIdentityProxyEndpointApplicationPolicy", + "GatewayIdentityProxyEndpointApplicationPolicyMfaConfig", "BookmarkApplication", "BookmarkApplicationPolicy", + "BookmarkApplicationPolicyMfaConfig", "InfrastructureApplication", "InfrastructureApplicationTargetCriterion", "InfrastructureApplicationPolicy", @@ -85,12 +106,47 @@ "BrowserRdpApplicationDestinationPublicDestination", "BrowserRdpApplicationDestinationPrivateDestination", "BrowserRdpApplicationDestinationViaMcpServerPortalDestination", + "BrowserRdpApplicationMfaConfig", + "BrowserRdpApplicationOAuthConfiguration", + "BrowserRdpApplicationOAuthConfigurationDynamicClientRegistration", + "BrowserRdpApplicationOAuthConfigurationGrant", "BrowserRdpApplicationPolicy", + "BrowserRdpApplicationPolicyMfaConfig", "BrowserRdpApplicationSCIMConfig", "BrowserRdpApplicationSCIMConfigAuthentication", "BrowserRdpApplicationSCIMConfigAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken", "BrowserRdpApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthentication", "BrowserRdpApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken", + "McpServerApplication", + "McpServerApplicationDestination", + "McpServerApplicationDestinationPublicDestination", + "McpServerApplicationDestinationPrivateDestination", + "McpServerApplicationDestinationViaMcpServerPortalDestination", + "McpServerApplicationOAuthConfiguration", + "McpServerApplicationOAuthConfigurationDynamicClientRegistration", + "McpServerApplicationOAuthConfigurationGrant", + "McpServerApplicationPolicy", + "McpServerApplicationPolicyMfaConfig", + "McpServerApplicationSCIMConfig", + "McpServerApplicationSCIMConfigAuthentication", + "McpServerApplicationSCIMConfigAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken", + "McpServerApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthentication", + "McpServerApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken", + "McpServerPortalApplication", + "McpServerPortalApplicationDestination", + "McpServerPortalApplicationDestinationPublicDestination", + "McpServerPortalApplicationDestinationPrivateDestination", + "McpServerPortalApplicationDestinationViaMcpServerPortalDestination", + "McpServerPortalApplicationOAuthConfiguration", + "McpServerPortalApplicationOAuthConfigurationDynamicClientRegistration", + "McpServerPortalApplicationOAuthConfigurationGrant", + "McpServerPortalApplicationPolicy", + "McpServerPortalApplicationPolicyMfaConfig", + "McpServerPortalApplicationSCIMConfig", + "McpServerPortalApplicationSCIMConfigAuthentication", + "McpServerPortalApplicationSCIMConfigAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken", + "McpServerPortalApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthentication", + "McpServerPortalApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken", ] @@ -154,6 +210,102 @@ class SelfHostedApplicationDestinationViaMcpServerPortalDestination(BaseModel): ] +class SelfHostedApplicationMfaConfig(BaseModel): + """Configures multi-factor authentication (MFA) settings.""" + + allowed_authenticators: Optional[List[Literal["totp", "biometrics", "security_key"]]] = None + """Lists the MFA methods that users can authenticate with.""" + + mfa_bypass: Optional[bool] = None + """Indicates whether to bypass MFA for this resource. + + This option is available at the application and policy level. + """ + + session_duration: Optional[str] = None + """Defines the duration of an MFA session. + + Must be in minutes (m) or hours (h). Minimum: 0m. Maximum: 720h (30 days). + Examples:`5m` or `24h`. + """ + + +class SelfHostedApplicationOAuthConfigurationDynamicClientRegistration(BaseModel): + """Settings for OAuth dynamic client registration.""" + + allow_any_on_localhost: Optional[bool] = None + """Allows any client with redirect URIs on localhost.""" + + allow_any_on_loopback: Optional[bool] = None + """Allows any client with redirect URIs on 127.0.0.1.""" + + allowed_uris: Optional[List[str]] = None + """The URIs that are allowed as redirect URIs for dynamically registered clients. + + Must use the `https` protocol. Paths may end in `/*` to match all sub-paths. + """ + + enabled: Optional[bool] = None + """Whether dynamic client registration is enabled.""" + + +class SelfHostedApplicationOAuthConfigurationGrant(BaseModel): + """Settings for OAuth grant behavior.""" + + access_token_lifetime: Optional[str] = None + """The lifetime of the access token. + + Must be in the format `300ms` or `2h45m`. Valid time units are ns, us (or µs), + ms, s, m, h. + """ + + session_duration: Optional[str] = None + """The duration of the OAuth session. + + Must be in the format `300ms` or `2h45m`. Valid time units are ns, us (or µs), + ms, s, m, h. + """ + + +class SelfHostedApplicationOAuthConfiguration(BaseModel): + """ + **Beta:** Optional configuration for managing an OAuth authorization flow controlled by Access. When set, Access will act as the OAuth authorization server for this application. Only compatible with OAuth clients that support [RFC 8707](https://datatracker.ietf.org/doc/html/rfc8707) (Resource Indicators for OAuth 2.0). This feature is currently in beta. + """ + + dynamic_client_registration: Optional[SelfHostedApplicationOAuthConfigurationDynamicClientRegistration] = None + """Settings for OAuth dynamic client registration.""" + + enabled: Optional[bool] = None + """Whether the OAuth configuration is enabled for this application. + + When set to `false`, Access will not handle OAuth for this application. Defaults + to `true` if omitted. + """ + + grant: Optional[SelfHostedApplicationOAuthConfigurationGrant] = None + """Settings for OAuth grant behavior.""" + + +class SelfHostedApplicationPolicyMfaConfig(BaseModel): + """Configures multi-factor authentication (MFA) settings.""" + + allowed_authenticators: Optional[List[Literal["totp", "biometrics", "security_key"]]] = None + """Lists the MFA methods that users can authenticate with.""" + + mfa_bypass: Optional[bool] = None + """Indicates whether to bypass MFA for this resource. + + This option is available at the application and policy level. + """ + + session_duration: Optional[str] = None + """Defines the duration of an MFA session. + + Must be in minutes (m) or hours (h). Minimum: 0m. Maximum: 720h (30 days). + Examples:`5m` or `24h`. + """ + + class SelfHostedApplicationPolicy(BaseModel): id: Optional[str] = None """The UUID of the policy""" @@ -194,6 +346,9 @@ class SelfHostedApplicationPolicy(BaseModel): this feature. """ + mfa_config: Optional[SelfHostedApplicationPolicyMfaConfig] = None + """Configures multi-factor authentication (MFA) settings.""" + name: Optional[str] = None """The name of the Access policy.""" @@ -413,9 +568,21 @@ class SelfHostedApplication(BaseModel): logo_url: Optional[str] = None """The image URL for the logo shown in the App Launcher dashboard.""" + mfa_config: Optional[SelfHostedApplicationMfaConfig] = None + """Configures multi-factor authentication (MFA) settings.""" + name: Optional[str] = None """The name of the application.""" + oauth_configuration: Optional[SelfHostedApplicationOAuthConfiguration] = None + """ + **Beta:** Optional configuration for managing an OAuth authorization flow + controlled by Access. When set, Access will act as the OAuth authorization + server for this application. Only compatible with OAuth clients that support + [RFC 8707](https://datatracker.ietf.org/doc/html/rfc8707) (Resource Indicators + for OAuth 2.0). This feature is currently in beta. + """ + options_preflight_bypass: Optional[bool] = None """ Allows options preflight requests to bypass Access authentication and go @@ -489,6 +656,26 @@ class SelfHostedApplication(BaseModel): """ +class SaaSApplicationPolicyMfaConfig(BaseModel): + """Configures multi-factor authentication (MFA) settings.""" + + allowed_authenticators: Optional[List[Literal["totp", "biometrics", "security_key"]]] = None + """Lists the MFA methods that users can authenticate with.""" + + mfa_bypass: Optional[bool] = None + """Indicates whether to bypass MFA for this resource. + + This option is available at the application and policy level. + """ + + session_duration: Optional[str] = None + """Defines the duration of an MFA session. + + Must be in minutes (m) or hours (h). Minimum: 0m. Maximum: 720h (30 days). + Examples:`5m` or `24h`. + """ + + class SaaSApplicationPolicy(BaseModel): id: Optional[str] = None """The UUID of the policy""" @@ -529,6 +716,9 @@ class SaaSApplicationPolicy(BaseModel): this feature. """ + mfa_config: Optional[SaaSApplicationPolicyMfaConfig] = None + """Configures multi-factor authentication (MFA) settings.""" + name: Optional[str] = None """The name of the Access policy.""" @@ -774,6 +964,102 @@ class BrowserSSHApplicationDestinationViaMcpServerPortalDestination(BaseModel): ] +class BrowserSSHApplicationMfaConfig(BaseModel): + """Configures multi-factor authentication (MFA) settings.""" + + allowed_authenticators: Optional[List[Literal["totp", "biometrics", "security_key"]]] = None + """Lists the MFA methods that users can authenticate with.""" + + mfa_bypass: Optional[bool] = None + """Indicates whether to bypass MFA for this resource. + + This option is available at the application and policy level. + """ + + session_duration: Optional[str] = None + """Defines the duration of an MFA session. + + Must be in minutes (m) or hours (h). Minimum: 0m. Maximum: 720h (30 days). + Examples:`5m` or `24h`. + """ + + +class BrowserSSHApplicationOAuthConfigurationDynamicClientRegistration(BaseModel): + """Settings for OAuth dynamic client registration.""" + + allow_any_on_localhost: Optional[bool] = None + """Allows any client with redirect URIs on localhost.""" + + allow_any_on_loopback: Optional[bool] = None + """Allows any client with redirect URIs on 127.0.0.1.""" + + allowed_uris: Optional[List[str]] = None + """The URIs that are allowed as redirect URIs for dynamically registered clients. + + Must use the `https` protocol. Paths may end in `/*` to match all sub-paths. + """ + + enabled: Optional[bool] = None + """Whether dynamic client registration is enabled.""" + + +class BrowserSSHApplicationOAuthConfigurationGrant(BaseModel): + """Settings for OAuth grant behavior.""" + + access_token_lifetime: Optional[str] = None + """The lifetime of the access token. + + Must be in the format `300ms` or `2h45m`. Valid time units are ns, us (or µs), + ms, s, m, h. + """ + + session_duration: Optional[str] = None + """The duration of the OAuth session. + + Must be in the format `300ms` or `2h45m`. Valid time units are ns, us (or µs), + ms, s, m, h. + """ + + +class BrowserSSHApplicationOAuthConfiguration(BaseModel): + """ + **Beta:** Optional configuration for managing an OAuth authorization flow controlled by Access. When set, Access will act as the OAuth authorization server for this application. Only compatible with OAuth clients that support [RFC 8707](https://datatracker.ietf.org/doc/html/rfc8707) (Resource Indicators for OAuth 2.0). This feature is currently in beta. + """ + + dynamic_client_registration: Optional[BrowserSSHApplicationOAuthConfigurationDynamicClientRegistration] = None + """Settings for OAuth dynamic client registration.""" + + enabled: Optional[bool] = None + """Whether the OAuth configuration is enabled for this application. + + When set to `false`, Access will not handle OAuth for this application. Defaults + to `true` if omitted. + """ + + grant: Optional[BrowserSSHApplicationOAuthConfigurationGrant] = None + """Settings for OAuth grant behavior.""" + + +class BrowserSSHApplicationPolicyMfaConfig(BaseModel): + """Configures multi-factor authentication (MFA) settings.""" + + allowed_authenticators: Optional[List[Literal["totp", "biometrics", "security_key"]]] = None + """Lists the MFA methods that users can authenticate with.""" + + mfa_bypass: Optional[bool] = None + """Indicates whether to bypass MFA for this resource. + + This option is available at the application and policy level. + """ + + session_duration: Optional[str] = None + """Defines the duration of an MFA session. + + Must be in minutes (m) or hours (h). Minimum: 0m. Maximum: 720h (30 days). + Examples:`5m` or `24h`. + """ + + class BrowserSSHApplicationPolicy(BaseModel): id: Optional[str] = None """The UUID of the policy""" @@ -814,6 +1100,9 @@ class BrowserSSHApplicationPolicy(BaseModel): this feature. """ + mfa_config: Optional[BrowserSSHApplicationPolicyMfaConfig] = None + """Configures multi-factor authentication (MFA) settings.""" + name: Optional[str] = None """The name of the Access policy.""" @@ -1048,9 +1337,21 @@ class BrowserSSHApplication(BaseModel): logo_url: Optional[str] = None """The image URL for the logo shown in the App Launcher dashboard.""" + mfa_config: Optional[BrowserSSHApplicationMfaConfig] = None + """Configures multi-factor authentication (MFA) settings.""" + name: Optional[str] = None """The name of the application.""" + oauth_configuration: Optional[BrowserSSHApplicationOAuthConfiguration] = None + """ + **Beta:** Optional configuration for managing an OAuth authorization flow + controlled by Access. When set, Access will act as the OAuth authorization + server for this application. Only compatible with OAuth clients that support + [RFC 8707](https://datatracker.ietf.org/doc/html/rfc8707) (Resource Indicators + for OAuth 2.0). This feature is currently in beta. + """ + options_preflight_bypass: Optional[bool] = None """ Allows options preflight requests to bypass Access authentication and go @@ -1184,6 +1485,102 @@ class BrowserVNCApplicationDestinationViaMcpServerPortalDestination(BaseModel): ] +class BrowserVNCApplicationMfaConfig(BaseModel): + """Configures multi-factor authentication (MFA) settings.""" + + allowed_authenticators: Optional[List[Literal["totp", "biometrics", "security_key"]]] = None + """Lists the MFA methods that users can authenticate with.""" + + mfa_bypass: Optional[bool] = None + """Indicates whether to bypass MFA for this resource. + + This option is available at the application and policy level. + """ + + session_duration: Optional[str] = None + """Defines the duration of an MFA session. + + Must be in minutes (m) or hours (h). Minimum: 0m. Maximum: 720h (30 days). + Examples:`5m` or `24h`. + """ + + +class BrowserVNCApplicationOAuthConfigurationDynamicClientRegistration(BaseModel): + """Settings for OAuth dynamic client registration.""" + + allow_any_on_localhost: Optional[bool] = None + """Allows any client with redirect URIs on localhost.""" + + allow_any_on_loopback: Optional[bool] = None + """Allows any client with redirect URIs on 127.0.0.1.""" + + allowed_uris: Optional[List[str]] = None + """The URIs that are allowed as redirect URIs for dynamically registered clients. + + Must use the `https` protocol. Paths may end in `/*` to match all sub-paths. + """ + + enabled: Optional[bool] = None + """Whether dynamic client registration is enabled.""" + + +class BrowserVNCApplicationOAuthConfigurationGrant(BaseModel): + """Settings for OAuth grant behavior.""" + + access_token_lifetime: Optional[str] = None + """The lifetime of the access token. + + Must be in the format `300ms` or `2h45m`. Valid time units are ns, us (or µs), + ms, s, m, h. + """ + + session_duration: Optional[str] = None + """The duration of the OAuth session. + + Must be in the format `300ms` or `2h45m`. Valid time units are ns, us (or µs), + ms, s, m, h. + """ + + +class BrowserVNCApplicationOAuthConfiguration(BaseModel): + """ + **Beta:** Optional configuration for managing an OAuth authorization flow controlled by Access. When set, Access will act as the OAuth authorization server for this application. Only compatible with OAuth clients that support [RFC 8707](https://datatracker.ietf.org/doc/html/rfc8707) (Resource Indicators for OAuth 2.0). This feature is currently in beta. + """ + + dynamic_client_registration: Optional[BrowserVNCApplicationOAuthConfigurationDynamicClientRegistration] = None + """Settings for OAuth dynamic client registration.""" + + enabled: Optional[bool] = None + """Whether the OAuth configuration is enabled for this application. + + When set to `false`, Access will not handle OAuth for this application. Defaults + to `true` if omitted. + """ + + grant: Optional[BrowserVNCApplicationOAuthConfigurationGrant] = None + """Settings for OAuth grant behavior.""" + + +class BrowserVNCApplicationPolicyMfaConfig(BaseModel): + """Configures multi-factor authentication (MFA) settings.""" + + allowed_authenticators: Optional[List[Literal["totp", "biometrics", "security_key"]]] = None + """Lists the MFA methods that users can authenticate with.""" + + mfa_bypass: Optional[bool] = None + """Indicates whether to bypass MFA for this resource. + + This option is available at the application and policy level. + """ + + session_duration: Optional[str] = None + """Defines the duration of an MFA session. + + Must be in minutes (m) or hours (h). Minimum: 0m. Maximum: 720h (30 days). + Examples:`5m` or `24h`. + """ + + class BrowserVNCApplicationPolicy(BaseModel): id: Optional[str] = None """The UUID of the policy""" @@ -1224,6 +1621,9 @@ class BrowserVNCApplicationPolicy(BaseModel): this feature. """ + mfa_config: Optional[BrowserVNCApplicationPolicyMfaConfig] = None + """Configures multi-factor authentication (MFA) settings.""" + name: Optional[str] = None """The name of the Access policy.""" @@ -1458,9 +1858,21 @@ class BrowserVNCApplication(BaseModel): logo_url: Optional[str] = None """The image URL for the logo shown in the App Launcher dashboard.""" + mfa_config: Optional[BrowserVNCApplicationMfaConfig] = None + """Configures multi-factor authentication (MFA) settings.""" + name: Optional[str] = None """The name of the application.""" + oauth_configuration: Optional[BrowserVNCApplicationOAuthConfiguration] = None + """ + **Beta:** Optional configuration for managing an OAuth authorization flow + controlled by Access. When set, Access will act as the OAuth authorization + server for this application. Only compatible with OAuth clients that support + [RFC 8707](https://datatracker.ietf.org/doc/html/rfc8707) (Resource Indicators + for OAuth 2.0). This feature is currently in beta. + """ + options_preflight_bypass: Optional[bool] = None """ Allows options preflight requests to bypass Access authentication and go @@ -1561,6 +1973,26 @@ class AppLauncherApplicationLandingPageDesign(BaseModel): """The title shown on the landing page.""" +class AppLauncherApplicationPolicyMfaConfig(BaseModel): + """Configures multi-factor authentication (MFA) settings.""" + + allowed_authenticators: Optional[List[Literal["totp", "biometrics", "security_key"]]] = None + """Lists the MFA methods that users can authenticate with.""" + + mfa_bypass: Optional[bool] = None + """Indicates whether to bypass MFA for this resource. + + This option is available at the application and policy level. + """ + + session_duration: Optional[str] = None + """Defines the duration of an MFA session. + + Must be in minutes (m) or hours (h). Minimum: 0m. Maximum: 720h (30 days). + Examples:`5m` or `24h`. + """ + + class AppLauncherApplicationPolicy(BaseModel): id: Optional[str] = None """The UUID of the policy""" @@ -1601,6 +2033,9 @@ class AppLauncherApplicationPolicy(BaseModel): this feature. """ + mfa_config: Optional[AppLauncherApplicationPolicyMfaConfig] = None + """Configures multi-factor authentication (MFA) settings.""" + name: Optional[str] = None """The name of the Access policy.""" @@ -1723,6 +2158,26 @@ class AppLauncherApplication(BaseModel): """Determines when to skip the App Launcher landing page.""" +class DeviceEnrollmentPermissionsApplicationPolicyMfaConfig(BaseModel): + """Configures multi-factor authentication (MFA) settings.""" + + allowed_authenticators: Optional[List[Literal["totp", "biometrics", "security_key"]]] = None + """Lists the MFA methods that users can authenticate with.""" + + mfa_bypass: Optional[bool] = None + """Indicates whether to bypass MFA for this resource. + + This option is available at the application and policy level. + """ + + session_duration: Optional[str] = None + """Defines the duration of an MFA session. + + Must be in minutes (m) or hours (h). Minimum: 0m. Maximum: 720h (30 days). + Examples:`5m` or `24h`. + """ + + class DeviceEnrollmentPermissionsApplicationPolicy(BaseModel): id: Optional[str] = None """The UUID of the policy""" @@ -1763,6 +2218,9 @@ class DeviceEnrollmentPermissionsApplicationPolicy(BaseModel): this feature. """ + mfa_config: Optional[DeviceEnrollmentPermissionsApplicationPolicyMfaConfig] = None + """Configures multi-factor authentication (MFA) settings.""" + name: Optional[str] = None """The name of the Access policy.""" @@ -1852,6 +2310,26 @@ class DeviceEnrollmentPermissionsApplication(BaseModel): """ +class BrowserIsolationPermissionsApplicationPolicyMfaConfig(BaseModel): + """Configures multi-factor authentication (MFA) settings.""" + + allowed_authenticators: Optional[List[Literal["totp", "biometrics", "security_key"]]] = None + """Lists the MFA methods that users can authenticate with.""" + + mfa_bypass: Optional[bool] = None + """Indicates whether to bypass MFA for this resource. + + This option is available at the application and policy level. + """ + + session_duration: Optional[str] = None + """Defines the duration of an MFA session. + + Must be in minutes (m) or hours (h). Minimum: 0m. Maximum: 720h (30 days). + Examples:`5m` or `24h`. + """ + + class BrowserIsolationPermissionsApplicationPolicy(BaseModel): id: Optional[str] = None """The UUID of the policy""" @@ -1892,6 +2370,9 @@ class BrowserIsolationPermissionsApplicationPolicy(BaseModel): this feature. """ + mfa_config: Optional[BrowserIsolationPermissionsApplicationPolicyMfaConfig] = None + """Configures multi-factor authentication (MFA) settings.""" + name: Optional[str] = None """The name of the Access policy.""" @@ -1981,6 +2462,26 @@ class BrowserIsolationPermissionsApplication(BaseModel): """ +class GatewayIdentityProxyEndpointApplicationPolicyMfaConfig(BaseModel): + """Configures multi-factor authentication (MFA) settings.""" + + allowed_authenticators: Optional[List[Literal["totp", "biometrics", "security_key"]]] = None + """Lists the MFA methods that users can authenticate with.""" + + mfa_bypass: Optional[bool] = None + """Indicates whether to bypass MFA for this resource. + + This option is available at the application and policy level. + """ + + session_duration: Optional[str] = None + """Defines the duration of an MFA session. + + Must be in minutes (m) or hours (h). Minimum: 0m. Maximum: 720h (30 days). + Examples:`5m` or `24h`. + """ + + class GatewayIdentityProxyEndpointApplicationPolicy(BaseModel): id: Optional[str] = None """The UUID of the policy""" @@ -2021,6 +2522,9 @@ class GatewayIdentityProxyEndpointApplicationPolicy(BaseModel): this feature. """ + mfa_config: Optional[GatewayIdentityProxyEndpointApplicationPolicyMfaConfig] = None + """Configures multi-factor authentication (MFA) settings.""" + name: Optional[str] = None """The name of the Access policy.""" @@ -2110,6 +2614,26 @@ class GatewayIdentityProxyEndpointApplication(BaseModel): """ +class BookmarkApplicationPolicyMfaConfig(BaseModel): + """Configures multi-factor authentication (MFA) settings.""" + + allowed_authenticators: Optional[List[Literal["totp", "biometrics", "security_key"]]] = None + """Lists the MFA methods that users can authenticate with.""" + + mfa_bypass: Optional[bool] = None + """Indicates whether to bypass MFA for this resource. + + This option is available at the application and policy level. + """ + + session_duration: Optional[str] = None + """Defines the duration of an MFA session. + + Must be in minutes (m) or hours (h). Minimum: 0m. Maximum: 720h (30 days). + Examples:`5m` or `24h`. + """ + + class BookmarkApplicationPolicy(BaseModel): id: Optional[str] = None """The UUID of the policy""" @@ -2150,6 +2674,9 @@ class BookmarkApplicationPolicy(BaseModel): this feature. """ + mfa_config: Optional[BookmarkApplicationPolicyMfaConfig] = None + """Configures multi-factor authentication (MFA) settings.""" + name: Optional[str] = None """The name of the Access policy.""" @@ -2384,37 +2911,133 @@ class BrowserRdpApplicationDestinationViaMcpServerPortalDestination(BaseModel): ] -class BrowserRdpApplicationPolicy(BaseModel): - id: Optional[str] = None - """The UUID of the policy""" +class BrowserRdpApplicationMfaConfig(BaseModel): + """Configures multi-factor authentication (MFA) settings.""" - approval_groups: Optional[List[ApprovalGroup]] = None - """Administrators who can approve a temporary authentication request.""" + allowed_authenticators: Optional[List[Literal["totp", "biometrics", "security_key"]]] = None + """Lists the MFA methods that users can authenticate with.""" - approval_required: Optional[bool] = None - """ - Requires the user to request access from an administrator at the start of each - session. - """ + mfa_bypass: Optional[bool] = None + """Indicates whether to bypass MFA for this resource. - created_at: Optional[datetime] = None + This option is available at the application and policy level. + """ - decision: Optional[Decision] = None - """The action Access will take if a user matches this policy. + session_duration: Optional[str] = None + """Defines the duration of an MFA session. - Infrastructure application policies can only use the Allow action. + Must be in minutes (m) or hours (h). Minimum: 0m. Maximum: 720h (30 days). + Examples:`5m` or `24h`. """ - exclude: Optional[List[AccessRule]] = None - """Rules evaluated with a NOT logical operator. - To match the policy, a user cannot meet any of the Exclude rules. - """ +class BrowserRdpApplicationOAuthConfigurationDynamicClientRegistration(BaseModel): + """Settings for OAuth dynamic client registration.""" - include: Optional[List[AccessRule]] = None - """Rules evaluated with an OR logical operator. + allow_any_on_localhost: Optional[bool] = None + """Allows any client with redirect URIs on localhost.""" - A user needs to meet only one of the Include rules. + allow_any_on_loopback: Optional[bool] = None + """Allows any client with redirect URIs on 127.0.0.1.""" + + allowed_uris: Optional[List[str]] = None + """The URIs that are allowed as redirect URIs for dynamically registered clients. + + Must use the `https` protocol. Paths may end in `/*` to match all sub-paths. + """ + + enabled: Optional[bool] = None + """Whether dynamic client registration is enabled.""" + + +class BrowserRdpApplicationOAuthConfigurationGrant(BaseModel): + """Settings for OAuth grant behavior.""" + + access_token_lifetime: Optional[str] = None + """The lifetime of the access token. + + Must be in the format `300ms` or `2h45m`. Valid time units are ns, us (or µs), + ms, s, m, h. + """ + + session_duration: Optional[str] = None + """The duration of the OAuth session. + + Must be in the format `300ms` or `2h45m`. Valid time units are ns, us (or µs), + ms, s, m, h. + """ + + +class BrowserRdpApplicationOAuthConfiguration(BaseModel): + """ + **Beta:** Optional configuration for managing an OAuth authorization flow controlled by Access. When set, Access will act as the OAuth authorization server for this application. Only compatible with OAuth clients that support [RFC 8707](https://datatracker.ietf.org/doc/html/rfc8707) (Resource Indicators for OAuth 2.0). This feature is currently in beta. + """ + + dynamic_client_registration: Optional[BrowserRdpApplicationOAuthConfigurationDynamicClientRegistration] = None + """Settings for OAuth dynamic client registration.""" + + enabled: Optional[bool] = None + """Whether the OAuth configuration is enabled for this application. + + When set to `false`, Access will not handle OAuth for this application. Defaults + to `true` if omitted. + """ + + grant: Optional[BrowserRdpApplicationOAuthConfigurationGrant] = None + """Settings for OAuth grant behavior.""" + + +class BrowserRdpApplicationPolicyMfaConfig(BaseModel): + """Configures multi-factor authentication (MFA) settings.""" + + allowed_authenticators: Optional[List[Literal["totp", "biometrics", "security_key"]]] = None + """Lists the MFA methods that users can authenticate with.""" + + mfa_bypass: Optional[bool] = None + """Indicates whether to bypass MFA for this resource. + + This option is available at the application and policy level. + """ + + session_duration: Optional[str] = None + """Defines the duration of an MFA session. + + Must be in minutes (m) or hours (h). Minimum: 0m. Maximum: 720h (30 days). + Examples:`5m` or `24h`. + """ + + +class BrowserRdpApplicationPolicy(BaseModel): + id: Optional[str] = None + """The UUID of the policy""" + + approval_groups: Optional[List[ApprovalGroup]] = None + """Administrators who can approve a temporary authentication request.""" + + approval_required: Optional[bool] = None + """ + Requires the user to request access from an administrator at the start of each + session. + """ + + created_at: Optional[datetime] = None + + decision: Optional[Decision] = None + """The action Access will take if a user matches this policy. + + Infrastructure application policies can only use the Allow action. + """ + + exclude: Optional[List[AccessRule]] = None + """Rules evaluated with a NOT logical operator. + + To match the policy, a user cannot meet any of the Exclude rules. + """ + + include: Optional[List[AccessRule]] = None + """Rules evaluated with an OR logical operator. + + A user needs to meet only one of the Include rules. """ isolation_required: Optional[bool] = None @@ -2424,6 +3047,9 @@ class BrowserRdpApplicationPolicy(BaseModel): this feature. """ + mfa_config: Optional[BrowserRdpApplicationPolicyMfaConfig] = None + """Configures multi-factor authentication (MFA) settings.""" + name: Optional[str] = None """The name of the Access policy.""" @@ -2645,9 +3271,21 @@ class BrowserRdpApplication(BaseModel): logo_url: Optional[str] = None """The image URL for the logo shown in the App Launcher dashboard.""" + mfa_config: Optional[BrowserRdpApplicationMfaConfig] = None + """Configures multi-factor authentication (MFA) settings.""" + name: Optional[str] = None """The name of the application.""" + oauth_configuration: Optional[BrowserRdpApplicationOAuthConfiguration] = None + """ + **Beta:** Optional configuration for managing an OAuth authorization flow + controlled by Access. When set, Access will act as the OAuth authorization + server for this application. Only compatible with OAuth clients that support + [RFC 8707](https://datatracker.ietf.org/doc/html/rfc8707) (Resource Indicators + for OAuth 2.0). This feature is currently in beta. + """ + options_preflight_bypass: Optional[bool] = None """ Allows options preflight requests to bypass Access authentication and go @@ -2721,6 +3359,860 @@ class BrowserRdpApplication(BaseModel): """ +class McpServerApplicationDestinationPublicDestination(BaseModel): + """A public hostname that Access will secure. + + Public destinations support sub-domain and path. Wildcard '*' can be used in the definition. + """ + + type: Optional[Literal["public"]] = None + + uri: Optional[str] = None + """The URI of the destination. + + Public destinations' URIs can include a domain and path with + [wildcards](https://developers.cloudflare.com/cloudflare-one/policies/access/app-paths/). + """ + + +class McpServerApplicationDestinationPrivateDestination(BaseModel): + cidr: Optional[str] = None + """The CIDR range of the destination. Single IPs will be computed as /32.""" + + hostname: Optional[str] = None + """The hostname of the destination. Matches a valid SNI served by an HTTPS origin.""" + + l4_protocol: Optional[Literal["tcp", "udp"]] = None + """The L4 protocol of the destination. + + When omitted, both UDP and TCP traffic will match. + """ + + port_range: Optional[str] = None + """The port range of the destination. + + Can be a single port or a range of ports. When omitted, all ports will match. + """ + + type: Optional[Literal["private"]] = None + + vnet_id: Optional[str] = None + """The VNET ID to match the destination. When omitted, all VNETs will match.""" + + +class McpServerApplicationDestinationViaMcpServerPortalDestination(BaseModel): + """A MCP server id configured in ai-controls. + + Access will secure the MCP server if accessed through a MCP portal. + """ + + mcp_server_id: Optional[str] = None + """The MCP server id configured in ai-controls.""" + + type: Optional[Literal["via_mcp_server_portal"]] = None + + +McpServerApplicationDestination: TypeAlias = Union[ + McpServerApplicationDestinationPublicDestination, + McpServerApplicationDestinationPrivateDestination, + McpServerApplicationDestinationViaMcpServerPortalDestination, +] + + +class McpServerApplicationOAuthConfigurationDynamicClientRegistration(BaseModel): + """Settings for OAuth dynamic client registration.""" + + allow_any_on_localhost: Optional[bool] = None + """Allows any client with redirect URIs on localhost.""" + + allow_any_on_loopback: Optional[bool] = None + """Allows any client with redirect URIs on 127.0.0.1.""" + + allowed_uris: Optional[List[str]] = None + """The URIs that are allowed as redirect URIs for dynamically registered clients. + + Must use the `https` protocol. Paths may end in `/*` to match all sub-paths. + """ + + enabled: Optional[bool] = None + """Whether dynamic client registration is enabled.""" + + +class McpServerApplicationOAuthConfigurationGrant(BaseModel): + """Settings for OAuth grant behavior.""" + + access_token_lifetime: Optional[str] = None + """The lifetime of the access token. + + Must be in the format `300ms` or `2h45m`. Valid time units are ns, us (or µs), + ms, s, m, h. + """ + + session_duration: Optional[str] = None + """The duration of the OAuth session. + + Must be in the format `300ms` or `2h45m`. Valid time units are ns, us (or µs), + ms, s, m, h. + """ + + +class McpServerApplicationOAuthConfiguration(BaseModel): + """ + **Beta:** Optional configuration for managing an OAuth authorization flow controlled by Access. When set, Access will act as the OAuth authorization server for this application. Only compatible with OAuth clients that support [RFC 8707](https://datatracker.ietf.org/doc/html/rfc8707) (Resource Indicators for OAuth 2.0). This feature is currently in beta. + """ + + dynamic_client_registration: Optional[McpServerApplicationOAuthConfigurationDynamicClientRegistration] = None + """Settings for OAuth dynamic client registration.""" + + enabled: Optional[bool] = None + """Whether the OAuth configuration is enabled for this application. + + When set to `false`, Access will not handle OAuth for this application. Defaults + to `true` if omitted. + """ + + grant: Optional[McpServerApplicationOAuthConfigurationGrant] = None + """Settings for OAuth grant behavior.""" + + +class McpServerApplicationPolicyMfaConfig(BaseModel): + """Configures multi-factor authentication (MFA) settings.""" + + allowed_authenticators: Optional[List[Literal["totp", "biometrics", "security_key"]]] = None + """Lists the MFA methods that users can authenticate with.""" + + mfa_bypass: Optional[bool] = None + """Indicates whether to bypass MFA for this resource. + + This option is available at the application and policy level. + """ + + session_duration: Optional[str] = None + """Defines the duration of an MFA session. + + Must be in minutes (m) or hours (h). Minimum: 0m. Maximum: 720h (30 days). + Examples:`5m` or `24h`. + """ + + +class McpServerApplicationPolicy(BaseModel): + id: Optional[str] = None + """The UUID of the policy""" + + approval_groups: Optional[List[ApprovalGroup]] = None + """Administrators who can approve a temporary authentication request.""" + + approval_required: Optional[bool] = None + """ + Requires the user to request access from an administrator at the start of each + session. + """ + + created_at: Optional[datetime] = None + + decision: Optional[Decision] = None + """The action Access will take if a user matches this policy. + + Infrastructure application policies can only use the Allow action. + """ + + exclude: Optional[List[AccessRule]] = None + """Rules evaluated with a NOT logical operator. + + To match the policy, a user cannot meet any of the Exclude rules. + """ + + include: Optional[List[AccessRule]] = None + """Rules evaluated with an OR logical operator. + + A user needs to meet only one of the Include rules. + """ + + isolation_required: Optional[bool] = None + """ + Require this application to be served in an isolated browser for users matching + this policy. 'Client Web Isolation' must be on for the account in order to use + this feature. + """ + + mfa_config: Optional[McpServerApplicationPolicyMfaConfig] = None + """Configures multi-factor authentication (MFA) settings.""" + + name: Optional[str] = None + """The name of the Access policy.""" + + precedence: Optional[int] = None + """The order of execution for this policy. + + Must be unique for each policy within an app. + """ + + purpose_justification_prompt: Optional[str] = None + """A custom message that will appear on the purpose justification screen.""" + + purpose_justification_required: Optional[bool] = None + """Require users to enter a justification when they log in to the application.""" + + require: Optional[List[AccessRule]] = None + """Rules evaluated with an AND logical operator. + + To match the policy, a user must meet all of the Require rules. + """ + + session_duration: Optional[str] = None + """The amount of time that tokens issued for the application will be valid. + + Must be in the format `300ms` or `2h45m`. Valid time units are: ns, us (or µs), + ms, s, m, h. + """ + + updated_at: Optional[datetime] = None + + +class McpServerApplicationSCIMConfigAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken(BaseModel): + """ + Attributes for configuring Access Service Token authentication scheme for SCIM provisioning to an application. + """ + + client_id: str + """ + Client ID of the Access service token used to authenticate with the remote + service. + """ + + client_secret: str + """ + Client secret of the Access service token used to authenticate with the remote + service. + """ + + scheme: Literal["access_service_token"] + """The authentication scheme to use when making SCIM requests to this application.""" + + +class McpServerApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken( + BaseModel +): + """ + Attributes for configuring Access Service Token authentication scheme for SCIM provisioning to an application. + """ + + client_id: str + """ + Client ID of the Access service token used to authenticate with the remote + service. + """ + + client_secret: str + """ + Client secret of the Access service token used to authenticate with the remote + service. + """ + + scheme: Literal["access_service_token"] + """The authentication scheme to use when making SCIM requests to this application.""" + + +McpServerApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthentication: TypeAlias = Union[ + SCIMConfigAuthenticationHTTPBasic, + SCIMConfigAuthenticationOAuthBearerToken, + SCIMConfigAuthenticationOauth2, + McpServerApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken, +] + +McpServerApplicationSCIMConfigAuthentication: TypeAlias = Union[ + SCIMConfigAuthenticationHTTPBasic, + SCIMConfigAuthenticationOAuthBearerToken, + SCIMConfigAuthenticationOauth2, + McpServerApplicationSCIMConfigAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken, + List[McpServerApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthentication], +] + + +class McpServerApplicationSCIMConfig(BaseModel): + """Configuration for provisioning to this application via SCIM. + + This is currently in closed beta. + """ + + idp_uid: str + """ + The UID of the IdP to use as the source for SCIM resources to provision to this + application. + """ + + remote_uri: str + """The base URI for the application's SCIM-compatible API.""" + + authentication: Optional[McpServerApplicationSCIMConfigAuthentication] = None + """ + Attributes for configuring HTTP Basic authentication scheme for SCIM + provisioning to an application. + """ + + deactivate_on_delete: Optional[bool] = None + """ + If false, propagates DELETE requests to the target application for SCIM + resources. If true, sets 'active' to false on the SCIM resource. Note: Some + targets do not support DELETE operations. + """ + + enabled: Optional[bool] = None + """Whether SCIM provisioning is turned on for this application.""" + + mappings: Optional[List[SCIMConfigMapping]] = None + """ + A list of mappings to apply to SCIM resources before provisioning them in this + application. These can transform or filter the resources to be provisioned. + """ + + +class McpServerApplication(BaseModel): + type: ApplicationType + """The application type.""" + + id: Optional[str] = None + """UUID.""" + + allow_authenticate_via_warp: Optional[bool] = None + """ + When set to true, users can authenticate to this application using their WARP + session. When set to false this application will always require direct IdP + authentication. This setting always overrides the organization setting for WARP + authentication. + """ + + allowed_idps: Optional[List[AllowedIdPs]] = None + """The identity providers your users can select when connecting to this + application. + + Defaults to all IdPs configured in your account. + """ + + aud: Optional[str] = None + """Audience tag.""" + + auto_redirect_to_identity: Optional[bool] = None + """When set to `true`, users skip the identity provider selection step during + login. + + You must specify only one identity provider in allowed_idps. + """ + + custom_deny_message: Optional[str] = None + """ + The custom error message shown to a user when they are denied access to the + application. + """ + + custom_deny_url: Optional[str] = None + """ + The custom URL a user is redirected to when they are denied access to the + application when failing identity-based rules. + """ + + custom_non_identity_deny_url: Optional[str] = None + """ + The custom URL a user is redirected to when they are denied access to the + application when failing non-identity rules. + """ + + custom_pages: Optional[List[str]] = None + """The custom pages that will be displayed when applicable for this application""" + + destinations: Optional[List[McpServerApplicationDestination]] = None + """List of destinations secured by Access. + + This supersedes `self_hosted_domains` to allow for more flexibility in defining + different types of domains. If `destinations` are provided, then + `self_hosted_domains` will be ignored. + """ + + http_only_cookie_attribute: Optional[bool] = None + """ + Enables the HttpOnly cookie attribute, which increases security against XSS + attacks. + """ + + logo_url: Optional[str] = None + """The image URL for the logo shown in the App Launcher dashboard.""" + + name: Optional[str] = None + """The name of the application.""" + + oauth_configuration: Optional[McpServerApplicationOAuthConfiguration] = None + """ + **Beta:** Optional configuration for managing an OAuth authorization flow + controlled by Access. When set, Access will act as the OAuth authorization + server for this application. Only compatible with OAuth clients that support + [RFC 8707](https://datatracker.ietf.org/doc/html/rfc8707) (Resource Indicators + for OAuth 2.0). This feature is currently in beta. + """ + + options_preflight_bypass: Optional[bool] = None + """ + Allows options preflight requests to bypass Access authentication and go + directly to the origin. Cannot turn on if cors_headers is set. + """ + + policies: Optional[List[McpServerApplicationPolicy]] = None + + same_site_cookie_attribute: Optional[str] = None + """ + Sets the SameSite cookie setting, which provides increased security against CSRF + attacks. + """ + + scim_config: Optional[McpServerApplicationSCIMConfig] = None + """Configuration for provisioning to this application via SCIM. + + This is currently in closed beta. + """ + + session_duration: Optional[str] = None + """The amount of time that tokens issued for this application will be valid. + + Must be in the format `300ms` or `2h45m`. Valid time units are: ns, us (or µs), + ms, s, m, h. Note: unsupported for infrastructure type applications. + """ + + tags: Optional[List[str]] = None + """The tags you want assigned to an application. + + Tags are used to filter applications in the App Launcher dashboard. + """ + + +class McpServerPortalApplicationDestinationPublicDestination(BaseModel): + """A public hostname that Access will secure. + + Public destinations support sub-domain and path. Wildcard '*' can be used in the definition. + """ + + type: Optional[Literal["public"]] = None + + uri: Optional[str] = None + """The URI of the destination. + + Public destinations' URIs can include a domain and path with + [wildcards](https://developers.cloudflare.com/cloudflare-one/policies/access/app-paths/). + """ + + +class McpServerPortalApplicationDestinationPrivateDestination(BaseModel): + cidr: Optional[str] = None + """The CIDR range of the destination. Single IPs will be computed as /32.""" + + hostname: Optional[str] = None + """The hostname of the destination. Matches a valid SNI served by an HTTPS origin.""" + + l4_protocol: Optional[Literal["tcp", "udp"]] = None + """The L4 protocol of the destination. + + When omitted, both UDP and TCP traffic will match. + """ + + port_range: Optional[str] = None + """The port range of the destination. + + Can be a single port or a range of ports. When omitted, all ports will match. + """ + + type: Optional[Literal["private"]] = None + + vnet_id: Optional[str] = None + """The VNET ID to match the destination. When omitted, all VNETs will match.""" + + +class McpServerPortalApplicationDestinationViaMcpServerPortalDestination(BaseModel): + """A MCP server id configured in ai-controls. + + Access will secure the MCP server if accessed through a MCP portal. + """ + + mcp_server_id: Optional[str] = None + """The MCP server id configured in ai-controls.""" + + type: Optional[Literal["via_mcp_server_portal"]] = None + + +McpServerPortalApplicationDestination: TypeAlias = Union[ + McpServerPortalApplicationDestinationPublicDestination, + McpServerPortalApplicationDestinationPrivateDestination, + McpServerPortalApplicationDestinationViaMcpServerPortalDestination, +] + + +class McpServerPortalApplicationOAuthConfigurationDynamicClientRegistration(BaseModel): + """Settings for OAuth dynamic client registration.""" + + allow_any_on_localhost: Optional[bool] = None + """Allows any client with redirect URIs on localhost.""" + + allow_any_on_loopback: Optional[bool] = None + """Allows any client with redirect URIs on 127.0.0.1.""" + + allowed_uris: Optional[List[str]] = None + """The URIs that are allowed as redirect URIs for dynamically registered clients. + + Must use the `https` protocol. Paths may end in `/*` to match all sub-paths. + """ + + enabled: Optional[bool] = None + """Whether dynamic client registration is enabled.""" + + +class McpServerPortalApplicationOAuthConfigurationGrant(BaseModel): + """Settings for OAuth grant behavior.""" + + access_token_lifetime: Optional[str] = None + """The lifetime of the access token. + + Must be in the format `300ms` or `2h45m`. Valid time units are ns, us (or µs), + ms, s, m, h. + """ + + session_duration: Optional[str] = None + """The duration of the OAuth session. + + Must be in the format `300ms` or `2h45m`. Valid time units are ns, us (or µs), + ms, s, m, h. + """ + + +class McpServerPortalApplicationOAuthConfiguration(BaseModel): + """ + **Beta:** Optional configuration for managing an OAuth authorization flow controlled by Access. When set, Access will act as the OAuth authorization server for this application. Only compatible with OAuth clients that support [RFC 8707](https://datatracker.ietf.org/doc/html/rfc8707) (Resource Indicators for OAuth 2.0). This feature is currently in beta. + """ + + dynamic_client_registration: Optional[McpServerPortalApplicationOAuthConfigurationDynamicClientRegistration] = None + """Settings for OAuth dynamic client registration.""" + + enabled: Optional[bool] = None + """Whether the OAuth configuration is enabled for this application. + + When set to `false`, Access will not handle OAuth for this application. Defaults + to `true` if omitted. + """ + + grant: Optional[McpServerPortalApplicationOAuthConfigurationGrant] = None + """Settings for OAuth grant behavior.""" + + +class McpServerPortalApplicationPolicyMfaConfig(BaseModel): + """Configures multi-factor authentication (MFA) settings.""" + + allowed_authenticators: Optional[List[Literal["totp", "biometrics", "security_key"]]] = None + """Lists the MFA methods that users can authenticate with.""" + + mfa_bypass: Optional[bool] = None + """Indicates whether to bypass MFA for this resource. + + This option is available at the application and policy level. + """ + + session_duration: Optional[str] = None + """Defines the duration of an MFA session. + + Must be in minutes (m) or hours (h). Minimum: 0m. Maximum: 720h (30 days). + Examples:`5m` or `24h`. + """ + + +class McpServerPortalApplicationPolicy(BaseModel): + id: Optional[str] = None + """The UUID of the policy""" + + approval_groups: Optional[List[ApprovalGroup]] = None + """Administrators who can approve a temporary authentication request.""" + + approval_required: Optional[bool] = None + """ + Requires the user to request access from an administrator at the start of each + session. + """ + + created_at: Optional[datetime] = None + + decision: Optional[Decision] = None + """The action Access will take if a user matches this policy. + + Infrastructure application policies can only use the Allow action. + """ + + exclude: Optional[List[AccessRule]] = None + """Rules evaluated with a NOT logical operator. + + To match the policy, a user cannot meet any of the Exclude rules. + """ + + include: Optional[List[AccessRule]] = None + """Rules evaluated with an OR logical operator. + + A user needs to meet only one of the Include rules. + """ + + isolation_required: Optional[bool] = None + """ + Require this application to be served in an isolated browser for users matching + this policy. 'Client Web Isolation' must be on for the account in order to use + this feature. + """ + + mfa_config: Optional[McpServerPortalApplicationPolicyMfaConfig] = None + """Configures multi-factor authentication (MFA) settings.""" + + name: Optional[str] = None + """The name of the Access policy.""" + + precedence: Optional[int] = None + """The order of execution for this policy. + + Must be unique for each policy within an app. + """ + + purpose_justification_prompt: Optional[str] = None + """A custom message that will appear on the purpose justification screen.""" + + purpose_justification_required: Optional[bool] = None + """Require users to enter a justification when they log in to the application.""" + + require: Optional[List[AccessRule]] = None + """Rules evaluated with an AND logical operator. + + To match the policy, a user must meet all of the Require rules. + """ + + session_duration: Optional[str] = None + """The amount of time that tokens issued for the application will be valid. + + Must be in the format `300ms` or `2h45m`. Valid time units are: ns, us (or µs), + ms, s, m, h. + """ + + updated_at: Optional[datetime] = None + + +class McpServerPortalApplicationSCIMConfigAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken(BaseModel): + """ + Attributes for configuring Access Service Token authentication scheme for SCIM provisioning to an application. + """ + + client_id: str + """ + Client ID of the Access service token used to authenticate with the remote + service. + """ + + client_secret: str + """ + Client secret of the Access service token used to authenticate with the remote + service. + """ + + scheme: Literal["access_service_token"] + """The authentication scheme to use when making SCIM requests to this application.""" + + +class McpServerPortalApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken( + BaseModel +): + """ + Attributes for configuring Access Service Token authentication scheme for SCIM provisioning to an application. + """ + + client_id: str + """ + Client ID of the Access service token used to authenticate with the remote + service. + """ + + client_secret: str + """ + Client secret of the Access service token used to authenticate with the remote + service. + """ + + scheme: Literal["access_service_token"] + """The authentication scheme to use when making SCIM requests to this application.""" + + +McpServerPortalApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthentication: TypeAlias = Union[ + SCIMConfigAuthenticationHTTPBasic, + SCIMConfigAuthenticationOAuthBearerToken, + SCIMConfigAuthenticationOauth2, + McpServerPortalApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken, +] + +McpServerPortalApplicationSCIMConfigAuthentication: TypeAlias = Union[ + SCIMConfigAuthenticationHTTPBasic, + SCIMConfigAuthenticationOAuthBearerToken, + SCIMConfigAuthenticationOauth2, + McpServerPortalApplicationSCIMConfigAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken, + List[McpServerPortalApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthentication], +] + + +class McpServerPortalApplicationSCIMConfig(BaseModel): + """Configuration for provisioning to this application via SCIM. + + This is currently in closed beta. + """ + + idp_uid: str + """ + The UID of the IdP to use as the source for SCIM resources to provision to this + application. + """ + + remote_uri: str + """The base URI for the application's SCIM-compatible API.""" + + authentication: Optional[McpServerPortalApplicationSCIMConfigAuthentication] = None + """ + Attributes for configuring HTTP Basic authentication scheme for SCIM + provisioning to an application. + """ + + deactivate_on_delete: Optional[bool] = None + """ + If false, propagates DELETE requests to the target application for SCIM + resources. If true, sets 'active' to false on the SCIM resource. Note: Some + targets do not support DELETE operations. + """ + + enabled: Optional[bool] = None + """Whether SCIM provisioning is turned on for this application.""" + + mappings: Optional[List[SCIMConfigMapping]] = None + """ + A list of mappings to apply to SCIM resources before provisioning them in this + application. These can transform or filter the resources to be provisioned. + """ + + +class McpServerPortalApplication(BaseModel): + type: ApplicationType + """The application type.""" + + id: Optional[str] = None + """UUID.""" + + allow_authenticate_via_warp: Optional[bool] = None + """ + When set to true, users can authenticate to this application using their WARP + session. When set to false this application will always require direct IdP + authentication. This setting always overrides the organization setting for WARP + authentication. + """ + + allowed_idps: Optional[List[AllowedIdPs]] = None + """The identity providers your users can select when connecting to this + application. + + Defaults to all IdPs configured in your account. + """ + + aud: Optional[str] = None + """Audience tag.""" + + auto_redirect_to_identity: Optional[bool] = None + """When set to `true`, users skip the identity provider selection step during + login. + + You must specify only one identity provider in allowed_idps. + """ + + custom_deny_message: Optional[str] = None + """ + The custom error message shown to a user when they are denied access to the + application. + """ + + custom_deny_url: Optional[str] = None + """ + The custom URL a user is redirected to when they are denied access to the + application when failing identity-based rules. + """ + + custom_non_identity_deny_url: Optional[str] = None + """ + The custom URL a user is redirected to when they are denied access to the + application when failing non-identity rules. + """ + + custom_pages: Optional[List[str]] = None + """The custom pages that will be displayed when applicable for this application""" + + destinations: Optional[List[McpServerPortalApplicationDestination]] = None + """List of destinations secured by Access. + + This supersedes `self_hosted_domains` to allow for more flexibility in defining + different types of domains. If `destinations` are provided, then + `self_hosted_domains` will be ignored. + """ + + domain: Optional[str] = None + """The primary hostname and path secured by Access. + + This domain will be displayed if the app is visible in the App Launcher. + """ + + http_only_cookie_attribute: Optional[bool] = None + """ + Enables the HttpOnly cookie attribute, which increases security against XSS + attacks. + """ + + logo_url: Optional[str] = None + """The image URL for the logo shown in the App Launcher dashboard.""" + + name: Optional[str] = None + """The name of the application.""" + + oauth_configuration: Optional[McpServerPortalApplicationOAuthConfiguration] = None + """ + **Beta:** Optional configuration for managing an OAuth authorization flow + controlled by Access. When set, Access will act as the OAuth authorization + server for this application. Only compatible with OAuth clients that support + [RFC 8707](https://datatracker.ietf.org/doc/html/rfc8707) (Resource Indicators + for OAuth 2.0). This feature is currently in beta. + """ + + options_preflight_bypass: Optional[bool] = None + """ + Allows options preflight requests to bypass Access authentication and go + directly to the origin. Cannot turn on if cors_headers is set. + """ + + policies: Optional[List[McpServerPortalApplicationPolicy]] = None + + same_site_cookie_attribute: Optional[str] = None + """ + Sets the SameSite cookie setting, which provides increased security against CSRF + attacks. + """ + + scim_config: Optional[McpServerPortalApplicationSCIMConfig] = None + """Configuration for provisioning to this application via SCIM. + + This is currently in closed beta. + """ + + session_duration: Optional[str] = None + """The amount of time that tokens issued for this application will be valid. + + Must be in the format `300ms` or `2h45m`. Valid time units are: ns, us (or µs), + ms, s, m, h. Note: unsupported for infrastructure type applications. + """ + + tags: Optional[List[str]] = None + """The tags you want assigned to an application. + + Tags are used to filter applications in the App Launcher dashboard. + """ + + ApplicationListResponse: TypeAlias = Union[ SelfHostedApplication, SaaSApplication, @@ -2733,4 +4225,6 @@ class BrowserRdpApplication(BaseModel): BookmarkApplication, InfrastructureApplication, BrowserRdpApplication, + McpServerApplication, + McpServerPortalApplication, ] diff --git a/src/cloudflare/types/zero_trust/access/application_update_params.py b/src/cloudflare/types/zero_trust/access/application_update_params.py index 3c113e23f22..b793abed2a7 100644 --- a/src/cloudflare/types/zero_trust/access/application_update_params.py +++ b/src/cloudflare/types/zero_trust/access/application_update_params.py @@ -2,7 +2,7 @@ from __future__ import annotations -from typing import Dict, Union, Iterable +from typing import Dict, List, Union, Iterable from typing_extensions import Literal, Required, TypeAlias, TypedDict from .decision import Decision @@ -27,9 +27,14 @@ "SelfHostedApplicationDestinationPublicDestination", "SelfHostedApplicationDestinationPrivateDestination", "SelfHostedApplicationDestinationViaMcpServerPortalDestination", + "SelfHostedApplicationMfaConfig", + "SelfHostedApplicationOAuthConfiguration", + "SelfHostedApplicationOAuthConfigurationDynamicClientRegistration", + "SelfHostedApplicationOAuthConfigurationGrant", "SelfHostedApplicationPolicy", "SelfHostedApplicationPolicyAccessAppPolicyLink", "SelfHostedApplicationPolicyUnionMember2", + "SelfHostedApplicationPolicyUnionMember2MfaConfig", "SelfHostedApplicationSCIMConfig", "SelfHostedApplicationSCIMConfigAuthentication", "SelfHostedApplicationSCIMConfigAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken", @@ -39,6 +44,7 @@ "SaaSApplicationPolicy", "SaaSApplicationPolicyAccessAppPolicyLink", "SaaSApplicationPolicyUnionMember2", + "SaaSApplicationPolicyUnionMember2MfaConfig", "SaaSApplicationSaaSApp", "SaaSApplicationSCIMConfig", "SaaSApplicationSCIMConfigAuthentication", @@ -50,9 +56,14 @@ "BrowserSSHApplicationDestinationPublicDestination", "BrowserSSHApplicationDestinationPrivateDestination", "BrowserSSHApplicationDestinationViaMcpServerPortalDestination", + "BrowserSSHApplicationMfaConfig", + "BrowserSSHApplicationOAuthConfiguration", + "BrowserSSHApplicationOAuthConfigurationDynamicClientRegistration", + "BrowserSSHApplicationOAuthConfigurationGrant", "BrowserSSHApplicationPolicy", "BrowserSSHApplicationPolicyAccessAppPolicyLink", "BrowserSSHApplicationPolicyUnionMember2", + "BrowserSSHApplicationPolicyUnionMember2MfaConfig", "BrowserSSHApplicationSCIMConfig", "BrowserSSHApplicationSCIMConfigAuthentication", "BrowserSSHApplicationSCIMConfigAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken", @@ -63,9 +74,14 @@ "BrowserVNCApplicationDestinationPublicDestination", "BrowserVNCApplicationDestinationPrivateDestination", "BrowserVNCApplicationDestinationViaMcpServerPortalDestination", + "BrowserVNCApplicationMfaConfig", + "BrowserVNCApplicationOAuthConfiguration", + "BrowserVNCApplicationOAuthConfigurationDynamicClientRegistration", + "BrowserVNCApplicationOAuthConfigurationGrant", "BrowserVNCApplicationPolicy", "BrowserVNCApplicationPolicyAccessAppPolicyLink", "BrowserVNCApplicationPolicyUnionMember2", + "BrowserVNCApplicationPolicyUnionMember2MfaConfig", "BrowserVNCApplicationSCIMConfig", "BrowserVNCApplicationSCIMConfigAuthentication", "BrowserVNCApplicationSCIMConfigAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken", @@ -77,22 +93,27 @@ "AppLauncherApplicationPolicy", "AppLauncherApplicationPolicyAccessAppPolicyLink", "AppLauncherApplicationPolicyUnionMember2", + "AppLauncherApplicationPolicyUnionMember2MfaConfig", "DeviceEnrollmentPermissionsApplication", "DeviceEnrollmentPermissionsApplicationPolicy", "DeviceEnrollmentPermissionsApplicationPolicyAccessAppPolicyLink", "DeviceEnrollmentPermissionsApplicationPolicyUnionMember2", + "DeviceEnrollmentPermissionsApplicationPolicyUnionMember2MfaConfig", "BrowserIsolationPermissionsApplication", "BrowserIsolationPermissionsApplicationPolicy", "BrowserIsolationPermissionsApplicationPolicyAccessAppPolicyLink", "BrowserIsolationPermissionsApplicationPolicyUnionMember2", + "BrowserIsolationPermissionsApplicationPolicyUnionMember2MfaConfig", "GatewayIdentityProxyEndpointApplication", "GatewayIdentityProxyEndpointApplicationPolicy", "GatewayIdentityProxyEndpointApplicationPolicyAccessAppPolicyLink", "GatewayIdentityProxyEndpointApplicationPolicyUnionMember2", + "GatewayIdentityProxyEndpointApplicationPolicyUnionMember2MfaConfig", "BookmarkApplication", "BookmarkApplicationPolicy", "BookmarkApplicationPolicyAccessAppPolicyLink", "BookmarkApplicationPolicyUnionMember2", + "BookmarkApplicationPolicyUnionMember2MfaConfig", "InfrastructureApplication", "InfrastructureApplicationTargetCriterion", "InfrastructureApplicationPolicy", @@ -104,14 +125,53 @@ "BrowserRdpApplicationDestinationPublicDestination", "BrowserRdpApplicationDestinationPrivateDestination", "BrowserRdpApplicationDestinationViaMcpServerPortalDestination", + "BrowserRdpApplicationMfaConfig", + "BrowserRdpApplicationOAuthConfiguration", + "BrowserRdpApplicationOAuthConfigurationDynamicClientRegistration", + "BrowserRdpApplicationOAuthConfigurationGrant", "BrowserRdpApplicationPolicy", "BrowserRdpApplicationPolicyAccessAppPolicyLink", "BrowserRdpApplicationPolicyUnionMember2", + "BrowserRdpApplicationPolicyUnionMember2MfaConfig", "BrowserRdpApplicationSCIMConfig", "BrowserRdpApplicationSCIMConfigAuthentication", "BrowserRdpApplicationSCIMConfigAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken", "BrowserRdpApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthentication", "BrowserRdpApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken", + "McpServerApplication", + "McpServerApplicationDestination", + "McpServerApplicationDestinationPublicDestination", + "McpServerApplicationDestinationPrivateDestination", + "McpServerApplicationDestinationViaMcpServerPortalDestination", + "McpServerApplicationOAuthConfiguration", + "McpServerApplicationOAuthConfigurationDynamicClientRegistration", + "McpServerApplicationOAuthConfigurationGrant", + "McpServerApplicationPolicy", + "McpServerApplicationPolicyAccessAppPolicyLink", + "McpServerApplicationPolicyUnionMember2", + "McpServerApplicationPolicyUnionMember2MfaConfig", + "McpServerApplicationSCIMConfig", + "McpServerApplicationSCIMConfigAuthentication", + "McpServerApplicationSCIMConfigAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken", + "McpServerApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthentication", + "McpServerApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken", + "McpServerPortalApplication", + "McpServerPortalApplicationDestination", + "McpServerPortalApplicationDestinationPublicDestination", + "McpServerPortalApplicationDestinationPrivateDestination", + "McpServerPortalApplicationDestinationViaMcpServerPortalDestination", + "McpServerPortalApplicationOAuthConfiguration", + "McpServerPortalApplicationOAuthConfigurationDynamicClientRegistration", + "McpServerPortalApplicationOAuthConfigurationGrant", + "McpServerPortalApplicationPolicy", + "McpServerPortalApplicationPolicyAccessAppPolicyLink", + "McpServerPortalApplicationPolicyUnionMember2", + "McpServerPortalApplicationPolicyUnionMember2MfaConfig", + "McpServerPortalApplicationSCIMConfig", + "McpServerPortalApplicationSCIMConfigAuthentication", + "McpServerPortalApplicationSCIMConfigAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken", + "McpServerPortalApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthentication", + "McpServerPortalApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken", ] @@ -205,9 +265,21 @@ class SelfHostedApplication(TypedDict, total=False): logo_url: str """The image URL for the logo shown in the App Launcher dashboard.""" + mfa_config: SelfHostedApplicationMfaConfig + """Configures multi-factor authentication (MFA) settings.""" + name: str """The name of the application.""" + oauth_configuration: SelfHostedApplicationOAuthConfiguration + """ + **Beta:** Optional configuration for managing an OAuth authorization flow + controlled by Access. When set, Access will act as the OAuth authorization + server for this application. Only compatible with OAuth clients that support + [RFC 8707](https://datatracker.ietf.org/doc/html/rfc8707) (Resource Indicators + for OAuth 2.0). This feature is currently in beta. + """ + options_preflight_bypass: bool """ Allows options preflight requests to bypass Access authentication and go @@ -346,6 +418,82 @@ class SelfHostedApplicationDestinationViaMcpServerPortalDestination(TypedDict, t ] +class SelfHostedApplicationMfaConfig(TypedDict, total=False): + """Configures multi-factor authentication (MFA) settings.""" + + allowed_authenticators: List[Literal["totp", "biometrics", "security_key"]] + """Lists the MFA methods that users can authenticate with.""" + + mfa_bypass: bool + """Indicates whether to bypass MFA for this resource. + + This option is available at the application and policy level. + """ + + session_duration: str + """Defines the duration of an MFA session. + + Must be in minutes (m) or hours (h). Minimum: 0m. Maximum: 720h (30 days). + Examples:`5m` or `24h`. + """ + + +class SelfHostedApplicationOAuthConfigurationDynamicClientRegistration(TypedDict, total=False): + """Settings for OAuth dynamic client registration.""" + + allow_any_on_localhost: bool + """Allows any client with redirect URIs on localhost.""" + + allow_any_on_loopback: bool + """Allows any client with redirect URIs on 127.0.0.1.""" + + allowed_uris: SequenceNotStr[str] + """The URIs that are allowed as redirect URIs for dynamically registered clients. + + Must use the `https` protocol. Paths may end in `/*` to match all sub-paths. + """ + + enabled: bool + """Whether dynamic client registration is enabled.""" + + +class SelfHostedApplicationOAuthConfigurationGrant(TypedDict, total=False): + """Settings for OAuth grant behavior.""" + + access_token_lifetime: str + """The lifetime of the access token. + + Must be in the format `300ms` or `2h45m`. Valid time units are ns, us (or µs), + ms, s, m, h. + """ + + session_duration: str + """The duration of the OAuth session. + + Must be in the format `300ms` or `2h45m`. Valid time units are ns, us (or µs), + ms, s, m, h. + """ + + +class SelfHostedApplicationOAuthConfiguration(TypedDict, total=False): + """ + **Beta:** Optional configuration for managing an OAuth authorization flow controlled by Access. When set, Access will act as the OAuth authorization server for this application. Only compatible with OAuth clients that support [RFC 8707](https://datatracker.ietf.org/doc/html/rfc8707) (Resource Indicators for OAuth 2.0). This feature is currently in beta. + """ + + dynamic_client_registration: SelfHostedApplicationOAuthConfigurationDynamicClientRegistration + """Settings for OAuth dynamic client registration.""" + + enabled: bool + """Whether the OAuth configuration is enabled for this application. + + When set to `false`, Access will not handle OAuth for this application. Defaults + to `true` if omitted. + """ + + grant: SelfHostedApplicationOAuthConfigurationGrant + """Settings for OAuth grant behavior.""" + + class SelfHostedApplicationPolicyAccessAppPolicyLink(TypedDict, total=False): """A JSON that links a reusable policy to an application.""" @@ -359,6 +507,26 @@ class SelfHostedApplicationPolicyAccessAppPolicyLink(TypedDict, total=False): """ +class SelfHostedApplicationPolicyUnionMember2MfaConfig(TypedDict, total=False): + """Configures multi-factor authentication (MFA) settings.""" + + allowed_authenticators: List[Literal["totp", "biometrics", "security_key"]] + """Lists the MFA methods that users can authenticate with.""" + + mfa_bypass: bool + """Indicates whether to bypass MFA for this resource. + + This option is available at the application and policy level. + """ + + session_duration: str + """Defines the duration of an MFA session. + + Must be in minutes (m) or hours (h). Minimum: 0m. Maximum: 720h (30 days). + Examples:`5m` or `24h`. + """ + + class SelfHostedApplicationPolicyUnionMember2(TypedDict, total=False): id: str """The UUID of the policy""" @@ -379,6 +547,9 @@ class SelfHostedApplicationPolicyUnionMember2(TypedDict, total=False): this feature. """ + mfa_config: SelfHostedApplicationPolicyUnionMember2MfaConfig + """Configures multi-factor authentication (MFA) settings.""" + precedence: int """The order of execution for this policy. @@ -575,6 +746,26 @@ class SaaSApplicationPolicyAccessAppPolicyLink(TypedDict, total=False): """ +class SaaSApplicationPolicyUnionMember2MfaConfig(TypedDict, total=False): + """Configures multi-factor authentication (MFA) settings.""" + + allowed_authenticators: List[Literal["totp", "biometrics", "security_key"]] + """Lists the MFA methods that users can authenticate with.""" + + mfa_bypass: bool + """Indicates whether to bypass MFA for this resource. + + This option is available at the application and policy level. + """ + + session_duration: str + """Defines the duration of an MFA session. + + Must be in minutes (m) or hours (h). Minimum: 0m. Maximum: 720h (30 days). + Examples:`5m` or `24h`. + """ + + class SaaSApplicationPolicyUnionMember2(TypedDict, total=False): id: str """The UUID of the policy""" @@ -595,6 +786,9 @@ class SaaSApplicationPolicyUnionMember2(TypedDict, total=False): this feature. """ + mfa_config: SaaSApplicationPolicyUnionMember2MfaConfig + """Configures multi-factor authentication (MFA) settings.""" + precedence: int """The order of execution for this policy. @@ -827,9 +1021,21 @@ class BrowserSSHApplication(TypedDict, total=False): logo_url: str """The image URL for the logo shown in the App Launcher dashboard.""" + mfa_config: BrowserSSHApplicationMfaConfig + """Configures multi-factor authentication (MFA) settings.""" + name: str """The name of the application.""" + oauth_configuration: BrowserSSHApplicationOAuthConfiguration + """ + **Beta:** Optional configuration for managing an OAuth authorization flow + controlled by Access. When set, Access will act as the OAuth authorization + server for this application. Only compatible with OAuth clients that support + [RFC 8707](https://datatracker.ietf.org/doc/html/rfc8707) (Resource Indicators + for OAuth 2.0). This feature is currently in beta. + """ + options_preflight_bypass: bool """ Allows options preflight requests to bypass Access authentication and go @@ -968,6 +1174,82 @@ class BrowserSSHApplicationDestinationViaMcpServerPortalDestination(TypedDict, t ] +class BrowserSSHApplicationMfaConfig(TypedDict, total=False): + """Configures multi-factor authentication (MFA) settings.""" + + allowed_authenticators: List[Literal["totp", "biometrics", "security_key"]] + """Lists the MFA methods that users can authenticate with.""" + + mfa_bypass: bool + """Indicates whether to bypass MFA for this resource. + + This option is available at the application and policy level. + """ + + session_duration: str + """Defines the duration of an MFA session. + + Must be in minutes (m) or hours (h). Minimum: 0m. Maximum: 720h (30 days). + Examples:`5m` or `24h`. + """ + + +class BrowserSSHApplicationOAuthConfigurationDynamicClientRegistration(TypedDict, total=False): + """Settings for OAuth dynamic client registration.""" + + allow_any_on_localhost: bool + """Allows any client with redirect URIs on localhost.""" + + allow_any_on_loopback: bool + """Allows any client with redirect URIs on 127.0.0.1.""" + + allowed_uris: SequenceNotStr[str] + """The URIs that are allowed as redirect URIs for dynamically registered clients. + + Must use the `https` protocol. Paths may end in `/*` to match all sub-paths. + """ + + enabled: bool + """Whether dynamic client registration is enabled.""" + + +class BrowserSSHApplicationOAuthConfigurationGrant(TypedDict, total=False): + """Settings for OAuth grant behavior.""" + + access_token_lifetime: str + """The lifetime of the access token. + + Must be in the format `300ms` or `2h45m`. Valid time units are ns, us (or µs), + ms, s, m, h. + """ + + session_duration: str + """The duration of the OAuth session. + + Must be in the format `300ms` or `2h45m`. Valid time units are ns, us (or µs), + ms, s, m, h. + """ + + +class BrowserSSHApplicationOAuthConfiguration(TypedDict, total=False): + """ + **Beta:** Optional configuration for managing an OAuth authorization flow controlled by Access. When set, Access will act as the OAuth authorization server for this application. Only compatible with OAuth clients that support [RFC 8707](https://datatracker.ietf.org/doc/html/rfc8707) (Resource Indicators for OAuth 2.0). This feature is currently in beta. + """ + + dynamic_client_registration: BrowserSSHApplicationOAuthConfigurationDynamicClientRegistration + """Settings for OAuth dynamic client registration.""" + + enabled: bool + """Whether the OAuth configuration is enabled for this application. + + When set to `false`, Access will not handle OAuth for this application. Defaults + to `true` if omitted. + """ + + grant: BrowserSSHApplicationOAuthConfigurationGrant + """Settings for OAuth grant behavior.""" + + class BrowserSSHApplicationPolicyAccessAppPolicyLink(TypedDict, total=False): """A JSON that links a reusable policy to an application.""" @@ -981,6 +1263,26 @@ class BrowserSSHApplicationPolicyAccessAppPolicyLink(TypedDict, total=False): """ +class BrowserSSHApplicationPolicyUnionMember2MfaConfig(TypedDict, total=False): + """Configures multi-factor authentication (MFA) settings.""" + + allowed_authenticators: List[Literal["totp", "biometrics", "security_key"]] + """Lists the MFA methods that users can authenticate with.""" + + mfa_bypass: bool + """Indicates whether to bypass MFA for this resource. + + This option is available at the application and policy level. + """ + + session_duration: str + """Defines the duration of an MFA session. + + Must be in minutes (m) or hours (h). Minimum: 0m. Maximum: 720h (30 days). + Examples:`5m` or `24h`. + """ + + class BrowserSSHApplicationPolicyUnionMember2(TypedDict, total=False): id: str """The UUID of the policy""" @@ -1001,6 +1303,9 @@ class BrowserSSHApplicationPolicyUnionMember2(TypedDict, total=False): this feature. """ + mfa_config: BrowserSSHApplicationPolicyUnionMember2MfaConfig + """Configures multi-factor authentication (MFA) settings.""" + precedence: int """The order of execution for this policy. @@ -1233,9 +1538,21 @@ class BrowserVNCApplication(TypedDict, total=False): logo_url: str """The image URL for the logo shown in the App Launcher dashboard.""" + mfa_config: BrowserVNCApplicationMfaConfig + """Configures multi-factor authentication (MFA) settings.""" + name: str """The name of the application.""" + oauth_configuration: BrowserVNCApplicationOAuthConfiguration + """ + **Beta:** Optional configuration for managing an OAuth authorization flow + controlled by Access. When set, Access will act as the OAuth authorization + server for this application. Only compatible with OAuth clients that support + [RFC 8707](https://datatracker.ietf.org/doc/html/rfc8707) (Resource Indicators + for OAuth 2.0). This feature is currently in beta. + """ + options_preflight_bypass: bool """ Allows options preflight requests to bypass Access authentication and go @@ -1374,6 +1691,82 @@ class BrowserVNCApplicationDestinationViaMcpServerPortalDestination(TypedDict, t ] +class BrowserVNCApplicationMfaConfig(TypedDict, total=False): + """Configures multi-factor authentication (MFA) settings.""" + + allowed_authenticators: List[Literal["totp", "biometrics", "security_key"]] + """Lists the MFA methods that users can authenticate with.""" + + mfa_bypass: bool + """Indicates whether to bypass MFA for this resource. + + This option is available at the application and policy level. + """ + + session_duration: str + """Defines the duration of an MFA session. + + Must be in minutes (m) or hours (h). Minimum: 0m. Maximum: 720h (30 days). + Examples:`5m` or `24h`. + """ + + +class BrowserVNCApplicationOAuthConfigurationDynamicClientRegistration(TypedDict, total=False): + """Settings for OAuth dynamic client registration.""" + + allow_any_on_localhost: bool + """Allows any client with redirect URIs on localhost.""" + + allow_any_on_loopback: bool + """Allows any client with redirect URIs on 127.0.0.1.""" + + allowed_uris: SequenceNotStr[str] + """The URIs that are allowed as redirect URIs for dynamically registered clients. + + Must use the `https` protocol. Paths may end in `/*` to match all sub-paths. + """ + + enabled: bool + """Whether dynamic client registration is enabled.""" + + +class BrowserVNCApplicationOAuthConfigurationGrant(TypedDict, total=False): + """Settings for OAuth grant behavior.""" + + access_token_lifetime: str + """The lifetime of the access token. + + Must be in the format `300ms` or `2h45m`. Valid time units are ns, us (or µs), + ms, s, m, h. + """ + + session_duration: str + """The duration of the OAuth session. + + Must be in the format `300ms` or `2h45m`. Valid time units are ns, us (or µs), + ms, s, m, h. + """ + + +class BrowserVNCApplicationOAuthConfiguration(TypedDict, total=False): + """ + **Beta:** Optional configuration for managing an OAuth authorization flow controlled by Access. When set, Access will act as the OAuth authorization server for this application. Only compatible with OAuth clients that support [RFC 8707](https://datatracker.ietf.org/doc/html/rfc8707) (Resource Indicators for OAuth 2.0). This feature is currently in beta. + """ + + dynamic_client_registration: BrowserVNCApplicationOAuthConfigurationDynamicClientRegistration + """Settings for OAuth dynamic client registration.""" + + enabled: bool + """Whether the OAuth configuration is enabled for this application. + + When set to `false`, Access will not handle OAuth for this application. Defaults + to `true` if omitted. + """ + + grant: BrowserVNCApplicationOAuthConfigurationGrant + """Settings for OAuth grant behavior.""" + + class BrowserVNCApplicationPolicyAccessAppPolicyLink(TypedDict, total=False): """A JSON that links a reusable policy to an application.""" @@ -1387,6 +1780,26 @@ class BrowserVNCApplicationPolicyAccessAppPolicyLink(TypedDict, total=False): """ +class BrowserVNCApplicationPolicyUnionMember2MfaConfig(TypedDict, total=False): + """Configures multi-factor authentication (MFA) settings.""" + + allowed_authenticators: List[Literal["totp", "biometrics", "security_key"]] + """Lists the MFA methods that users can authenticate with.""" + + mfa_bypass: bool + """Indicates whether to bypass MFA for this resource. + + This option is available at the application and policy level. + """ + + session_duration: str + """Defines the duration of an MFA session. + + Must be in minutes (m) or hours (h). Minimum: 0m. Maximum: 720h (30 days). + Examples:`5m` or `24h`. + """ + + class BrowserVNCApplicationPolicyUnionMember2(TypedDict, total=False): id: str """The UUID of the policy""" @@ -1407,6 +1820,9 @@ class BrowserVNCApplicationPolicyUnionMember2(TypedDict, total=False): this feature. """ + mfa_config: BrowserVNCApplicationPolicyUnionMember2MfaConfig + """Configures multi-factor authentication (MFA) settings.""" + precedence: int """The order of execution for this policy. @@ -1661,6 +2077,26 @@ class AppLauncherApplicationPolicyAccessAppPolicyLink(TypedDict, total=False): """ +class AppLauncherApplicationPolicyUnionMember2MfaConfig(TypedDict, total=False): + """Configures multi-factor authentication (MFA) settings.""" + + allowed_authenticators: List[Literal["totp", "biometrics", "security_key"]] + """Lists the MFA methods that users can authenticate with.""" + + mfa_bypass: bool + """Indicates whether to bypass MFA for this resource. + + This option is available at the application and policy level. + """ + + session_duration: str + """Defines the duration of an MFA session. + + Must be in minutes (m) or hours (h). Minimum: 0m. Maximum: 720h (30 days). + Examples:`5m` or `24h`. + """ + + class AppLauncherApplicationPolicyUnionMember2(TypedDict, total=False): id: str """The UUID of the policy""" @@ -1681,6 +2117,9 @@ class AppLauncherApplicationPolicyUnionMember2(TypedDict, total=False): this feature. """ + mfa_config: AppLauncherApplicationPolicyUnionMember2MfaConfig + """Configures multi-factor authentication (MFA) settings.""" + precedence: int """The order of execution for this policy. @@ -1773,6 +2212,26 @@ class DeviceEnrollmentPermissionsApplicationPolicyAccessAppPolicyLink(TypedDict, """ +class DeviceEnrollmentPermissionsApplicationPolicyUnionMember2MfaConfig(TypedDict, total=False): + """Configures multi-factor authentication (MFA) settings.""" + + allowed_authenticators: List[Literal["totp", "biometrics", "security_key"]] + """Lists the MFA methods that users can authenticate with.""" + + mfa_bypass: bool + """Indicates whether to bypass MFA for this resource. + + This option is available at the application and policy level. + """ + + session_duration: str + """Defines the duration of an MFA session. + + Must be in minutes (m) or hours (h). Minimum: 0m. Maximum: 720h (30 days). + Examples:`5m` or `24h`. + """ + + class DeviceEnrollmentPermissionsApplicationPolicyUnionMember2(TypedDict, total=False): id: str """The UUID of the policy""" @@ -1793,6 +2252,9 @@ class DeviceEnrollmentPermissionsApplicationPolicyUnionMember2(TypedDict, total= this feature. """ + mfa_config: DeviceEnrollmentPermissionsApplicationPolicyUnionMember2MfaConfig + """Configures multi-factor authentication (MFA) settings.""" + precedence: int """The order of execution for this policy. @@ -1887,6 +2349,26 @@ class BrowserIsolationPermissionsApplicationPolicyAccessAppPolicyLink(TypedDict, """ +class BrowserIsolationPermissionsApplicationPolicyUnionMember2MfaConfig(TypedDict, total=False): + """Configures multi-factor authentication (MFA) settings.""" + + allowed_authenticators: List[Literal["totp", "biometrics", "security_key"]] + """Lists the MFA methods that users can authenticate with.""" + + mfa_bypass: bool + """Indicates whether to bypass MFA for this resource. + + This option is available at the application and policy level. + """ + + session_duration: str + """Defines the duration of an MFA session. + + Must be in minutes (m) or hours (h). Minimum: 0m. Maximum: 720h (30 days). + Examples:`5m` or `24h`. + """ + + class BrowserIsolationPermissionsApplicationPolicyUnionMember2(TypedDict, total=False): id: str """The UUID of the policy""" @@ -1907,6 +2389,9 @@ class BrowserIsolationPermissionsApplicationPolicyUnionMember2(TypedDict, total= this feature. """ + mfa_config: BrowserIsolationPermissionsApplicationPolicyUnionMember2MfaConfig + """Configures multi-factor authentication (MFA) settings.""" + precedence: int """The order of execution for this policy. @@ -2010,6 +2495,26 @@ class GatewayIdentityProxyEndpointApplicationPolicyAccessAppPolicyLink(TypedDict """ +class GatewayIdentityProxyEndpointApplicationPolicyUnionMember2MfaConfig(TypedDict, total=False): + """Configures multi-factor authentication (MFA) settings.""" + + allowed_authenticators: List[Literal["totp", "biometrics", "security_key"]] + """Lists the MFA methods that users can authenticate with.""" + + mfa_bypass: bool + """Indicates whether to bypass MFA for this resource. + + This option is available at the application and policy level. + """ + + session_duration: str + """Defines the duration of an MFA session. + + Must be in minutes (m) or hours (h). Minimum: 0m. Maximum: 720h (30 days). + Examples:`5m` or `24h`. + """ + + class GatewayIdentityProxyEndpointApplicationPolicyUnionMember2(TypedDict, total=False): id: str """The UUID of the policy""" @@ -2030,6 +2535,9 @@ class GatewayIdentityProxyEndpointApplicationPolicyUnionMember2(TypedDict, total this feature. """ + mfa_config: GatewayIdentityProxyEndpointApplicationPolicyUnionMember2MfaConfig + """Configures multi-factor authentication (MFA) settings.""" + precedence: int """The order of execution for this policy. @@ -2106,6 +2614,26 @@ class BookmarkApplicationPolicyAccessAppPolicyLink(TypedDict, total=False): """ +class BookmarkApplicationPolicyUnionMember2MfaConfig(TypedDict, total=False): + """Configures multi-factor authentication (MFA) settings.""" + + allowed_authenticators: List[Literal["totp", "biometrics", "security_key"]] + """Lists the MFA methods that users can authenticate with.""" + + mfa_bypass: bool + """Indicates whether to bypass MFA for this resource. + + This option is available at the application and policy level. + """ + + session_duration: str + """Defines the duration of an MFA session. + + Must be in minutes (m) or hours (h). Minimum: 0m. Maximum: 720h (30 days). + Examples:`5m` or `24h`. + """ + + class BookmarkApplicationPolicyUnionMember2(TypedDict, total=False): id: str """The UUID of the policy""" @@ -2126,6 +2654,9 @@ class BookmarkApplicationPolicyUnionMember2(TypedDict, total=False): this feature. """ + mfa_config: BookmarkApplicationPolicyUnionMember2MfaConfig + """Configures multi-factor authentication (MFA) settings.""" + precedence: int """The order of execution for this policy. @@ -2335,9 +2866,21 @@ class BrowserRdpApplication(TypedDict, total=False): logo_url: str """The image URL for the logo shown in the App Launcher dashboard.""" + mfa_config: BrowserRdpApplicationMfaConfig + """Configures multi-factor authentication (MFA) settings.""" + name: str """The name of the application.""" + oauth_configuration: BrowserRdpApplicationOAuthConfiguration + """ + **Beta:** Optional configuration for managing an OAuth authorization flow + controlled by Access. When set, Access will act as the OAuth authorization + server for this application. Only compatible with OAuth clients that support + [RFC 8707](https://datatracker.ietf.org/doc/html/rfc8707) (Resource Indicators + for OAuth 2.0). This feature is currently in beta. + """ + options_preflight_bypass: bool """ Allows options preflight requests to bypass Access authentication and go @@ -2490,39 +3033,138 @@ class BrowserRdpApplicationDestinationViaMcpServerPortalDestination(TypedDict, t ] -class BrowserRdpApplicationPolicyAccessAppPolicyLink(TypedDict, total=False): - """A JSON that links a reusable policy to an application.""" +class BrowserRdpApplicationMfaConfig(TypedDict, total=False): + """Configures multi-factor authentication (MFA) settings.""" - id: str - """The UUID of the policy""" + allowed_authenticators: List[Literal["totp", "biometrics", "security_key"]] + """Lists the MFA methods that users can authenticate with.""" - precedence: int - """The order of execution for this policy. + mfa_bypass: bool + """Indicates whether to bypass MFA for this resource. - Must be unique for each policy within an app. + This option is available at the application and policy level. """ + session_duration: str + """Defines the duration of an MFA session. -class BrowserRdpApplicationPolicyUnionMember2(TypedDict, total=False): - id: str - """The UUID of the policy""" + Must be in minutes (m) or hours (h). Minimum: 0m. Maximum: 720h (30 days). + Examples:`5m` or `24h`. + """ - approval_groups: Iterable[ApprovalGroupParam] - """Administrators who can approve a temporary authentication request.""" - approval_required: bool - """ - Requires the user to request access from an administrator at the start of each - session. - """ +class BrowserRdpApplicationOAuthConfigurationDynamicClientRegistration(TypedDict, total=False): + """Settings for OAuth dynamic client registration.""" - isolation_required: bool - """ + allow_any_on_localhost: bool + """Allows any client with redirect URIs on localhost.""" + + allow_any_on_loopback: bool + """Allows any client with redirect URIs on 127.0.0.1.""" + + allowed_uris: SequenceNotStr[str] + """The URIs that are allowed as redirect URIs for dynamically registered clients. + + Must use the `https` protocol. Paths may end in `/*` to match all sub-paths. + """ + + enabled: bool + """Whether dynamic client registration is enabled.""" + + +class BrowserRdpApplicationOAuthConfigurationGrant(TypedDict, total=False): + """Settings for OAuth grant behavior.""" + + access_token_lifetime: str + """The lifetime of the access token. + + Must be in the format `300ms` or `2h45m`. Valid time units are ns, us (or µs), + ms, s, m, h. + """ + + session_duration: str + """The duration of the OAuth session. + + Must be in the format `300ms` or `2h45m`. Valid time units are ns, us (or µs), + ms, s, m, h. + """ + + +class BrowserRdpApplicationOAuthConfiguration(TypedDict, total=False): + """ + **Beta:** Optional configuration for managing an OAuth authorization flow controlled by Access. When set, Access will act as the OAuth authorization server for this application. Only compatible with OAuth clients that support [RFC 8707](https://datatracker.ietf.org/doc/html/rfc8707) (Resource Indicators for OAuth 2.0). This feature is currently in beta. + """ + + dynamic_client_registration: BrowserRdpApplicationOAuthConfigurationDynamicClientRegistration + """Settings for OAuth dynamic client registration.""" + + enabled: bool + """Whether the OAuth configuration is enabled for this application. + + When set to `false`, Access will not handle OAuth for this application. Defaults + to `true` if omitted. + """ + + grant: BrowserRdpApplicationOAuthConfigurationGrant + """Settings for OAuth grant behavior.""" + + +class BrowserRdpApplicationPolicyAccessAppPolicyLink(TypedDict, total=False): + """A JSON that links a reusable policy to an application.""" + + id: str + """The UUID of the policy""" + + precedence: int + """The order of execution for this policy. + + Must be unique for each policy within an app. + """ + + +class BrowserRdpApplicationPolicyUnionMember2MfaConfig(TypedDict, total=False): + """Configures multi-factor authentication (MFA) settings.""" + + allowed_authenticators: List[Literal["totp", "biometrics", "security_key"]] + """Lists the MFA methods that users can authenticate with.""" + + mfa_bypass: bool + """Indicates whether to bypass MFA for this resource. + + This option is available at the application and policy level. + """ + + session_duration: str + """Defines the duration of an MFA session. + + Must be in minutes (m) or hours (h). Minimum: 0m. Maximum: 720h (30 days). + Examples:`5m` or `24h`. + """ + + +class BrowserRdpApplicationPolicyUnionMember2(TypedDict, total=False): + id: str + """The UUID of the policy""" + + approval_groups: Iterable[ApprovalGroupParam] + """Administrators who can approve a temporary authentication request.""" + + approval_required: bool + """ + Requires the user to request access from an administrator at the start of each + session. + """ + + isolation_required: bool + """ Require this application to be served in an isolated browser for users matching this policy. 'Client Web Isolation' must be on for the account in order to use this feature. """ + mfa_config: BrowserRdpApplicationPolicyUnionMember2MfaConfig + """Configures multi-factor authentication (MFA) settings.""" + precedence: int """The order of execution for this policy. @@ -2648,6 +3290,848 @@ class BrowserRdpApplicationSCIMConfig(TypedDict, total=False): """ +class McpServerApplication(TypedDict, total=False): + type: Required[ApplicationType] + """The application type.""" + + account_id: str + """The Account ID to use for this endpoint. Mutually exclusive with the Zone ID.""" + + zone_id: str + """The Zone ID to use for this endpoint. Mutually exclusive with the Account ID.""" + + allow_authenticate_via_warp: bool + """ + When set to true, users can authenticate to this application using their WARP + session. When set to false this application will always require direct IdP + authentication. This setting always overrides the organization setting for WARP + authentication. + """ + + allowed_idps: SequenceNotStr[AllowedIdPs] + """The identity providers your users can select when connecting to this + application. + + Defaults to all IdPs configured in your account. + """ + + auto_redirect_to_identity: bool + """When set to `true`, users skip the identity provider selection step during + login. + + You must specify only one identity provider in allowed_idps. + """ + + custom_deny_message: str + """ + The custom error message shown to a user when they are denied access to the + application. + """ + + custom_deny_url: str + """ + The custom URL a user is redirected to when they are denied access to the + application when failing identity-based rules. + """ + + custom_non_identity_deny_url: str + """ + The custom URL a user is redirected to when they are denied access to the + application when failing non-identity rules. + """ + + custom_pages: SequenceNotStr[str] + """The custom pages that will be displayed when applicable for this application""" + + destinations: Iterable[McpServerApplicationDestination] + """List of destinations secured by Access. + + This supersedes `self_hosted_domains` to allow for more flexibility in defining + different types of domains. If `destinations` are provided, then + `self_hosted_domains` will be ignored. + """ + + http_only_cookie_attribute: bool + """ + Enables the HttpOnly cookie attribute, which increases security against XSS + attacks. + """ + + logo_url: str + """The image URL for the logo shown in the App Launcher dashboard.""" + + name: str + """The name of the application.""" + + oauth_configuration: McpServerApplicationOAuthConfiguration + """ + **Beta:** Optional configuration for managing an OAuth authorization flow + controlled by Access. When set, Access will act as the OAuth authorization + server for this application. Only compatible with OAuth clients that support + [RFC 8707](https://datatracker.ietf.org/doc/html/rfc8707) (Resource Indicators + for OAuth 2.0). This feature is currently in beta. + """ + + options_preflight_bypass: bool + """ + Allows options preflight requests to bypass Access authentication and go + directly to the origin. Cannot turn on if cors_headers is set. + """ + + policies: SequenceNotStr[McpServerApplicationPolicy] + """ + The policies that Access applies to the application, in ascending order of + precedence. Items can reference existing policies or create new policies + exclusive to the application. + """ + + same_site_cookie_attribute: str + """ + Sets the SameSite cookie setting, which provides increased security against CSRF + attacks. + """ + + scim_config: McpServerApplicationSCIMConfig + """Configuration for provisioning to this application via SCIM. + + This is currently in closed beta. + """ + + session_duration: str + """The amount of time that tokens issued for this application will be valid. + + Must be in the format `300ms` or `2h45m`. Valid time units are: ns, us (or µs), + ms, s, m, h. Note: unsupported for infrastructure type applications. + """ + + tags: SequenceNotStr[str] + """The tags you want assigned to an application. + + Tags are used to filter applications in the App Launcher dashboard. + """ + + +class McpServerApplicationDestinationPublicDestination(TypedDict, total=False): + """A public hostname that Access will secure. + + Public destinations support sub-domain and path. Wildcard '*' can be used in the definition. + """ + + type: Literal["public"] + + uri: str + """The URI of the destination. + + Public destinations' URIs can include a domain and path with + [wildcards](https://developers.cloudflare.com/cloudflare-one/policies/access/app-paths/). + """ + + +class McpServerApplicationDestinationPrivateDestination(TypedDict, total=False): + cidr: str + """The CIDR range of the destination. Single IPs will be computed as /32.""" + + hostname: str + """The hostname of the destination. Matches a valid SNI served by an HTTPS origin.""" + + l4_protocol: Literal["tcp", "udp"] + """The L4 protocol of the destination. + + When omitted, both UDP and TCP traffic will match. + """ + + port_range: str + """The port range of the destination. + + Can be a single port or a range of ports. When omitted, all ports will match. + """ + + type: Literal["private"] + + vnet_id: str + """The VNET ID to match the destination. When omitted, all VNETs will match.""" + + +class McpServerApplicationDestinationViaMcpServerPortalDestination(TypedDict, total=False): + """A MCP server id configured in ai-controls. + + Access will secure the MCP server if accessed through a MCP portal. + """ + + mcp_server_id: str + """The MCP server id configured in ai-controls.""" + + type: Literal["via_mcp_server_portal"] + + +McpServerApplicationDestination: TypeAlias = Union[ + McpServerApplicationDestinationPublicDestination, + McpServerApplicationDestinationPrivateDestination, + McpServerApplicationDestinationViaMcpServerPortalDestination, +] + + +class McpServerApplicationOAuthConfigurationDynamicClientRegistration(TypedDict, total=False): + """Settings for OAuth dynamic client registration.""" + + allow_any_on_localhost: bool + """Allows any client with redirect URIs on localhost.""" + + allow_any_on_loopback: bool + """Allows any client with redirect URIs on 127.0.0.1.""" + + allowed_uris: SequenceNotStr[str] + """The URIs that are allowed as redirect URIs for dynamically registered clients. + + Must use the `https` protocol. Paths may end in `/*` to match all sub-paths. + """ + + enabled: bool + """Whether dynamic client registration is enabled.""" + + +class McpServerApplicationOAuthConfigurationGrant(TypedDict, total=False): + """Settings for OAuth grant behavior.""" + + access_token_lifetime: str + """The lifetime of the access token. + + Must be in the format `300ms` or `2h45m`. Valid time units are ns, us (or µs), + ms, s, m, h. + """ + + session_duration: str + """The duration of the OAuth session. + + Must be in the format `300ms` or `2h45m`. Valid time units are ns, us (or µs), + ms, s, m, h. + """ + + +class McpServerApplicationOAuthConfiguration(TypedDict, total=False): + """ + **Beta:** Optional configuration for managing an OAuth authorization flow controlled by Access. When set, Access will act as the OAuth authorization server for this application. Only compatible with OAuth clients that support [RFC 8707](https://datatracker.ietf.org/doc/html/rfc8707) (Resource Indicators for OAuth 2.0). This feature is currently in beta. + """ + + dynamic_client_registration: McpServerApplicationOAuthConfigurationDynamicClientRegistration + """Settings for OAuth dynamic client registration.""" + + enabled: bool + """Whether the OAuth configuration is enabled for this application. + + When set to `false`, Access will not handle OAuth for this application. Defaults + to `true` if omitted. + """ + + grant: McpServerApplicationOAuthConfigurationGrant + """Settings for OAuth grant behavior.""" + + +class McpServerApplicationPolicyAccessAppPolicyLink(TypedDict, total=False): + """A JSON that links a reusable policy to an application.""" + + id: str + """The UUID of the policy""" + + precedence: int + """The order of execution for this policy. + + Must be unique for each policy within an app. + """ + + +class McpServerApplicationPolicyUnionMember2MfaConfig(TypedDict, total=False): + """Configures multi-factor authentication (MFA) settings.""" + + allowed_authenticators: List[Literal["totp", "biometrics", "security_key"]] + """Lists the MFA methods that users can authenticate with.""" + + mfa_bypass: bool + """Indicates whether to bypass MFA for this resource. + + This option is available at the application and policy level. + """ + + session_duration: str + """Defines the duration of an MFA session. + + Must be in minutes (m) or hours (h). Minimum: 0m. Maximum: 720h (30 days). + Examples:`5m` or `24h`. + """ + + +class McpServerApplicationPolicyUnionMember2(TypedDict, total=False): + id: str + """The UUID of the policy""" + + approval_groups: Iterable[ApprovalGroupParam] + """Administrators who can approve a temporary authentication request.""" + + approval_required: bool + """ + Requires the user to request access from an administrator at the start of each + session. + """ + + isolation_required: bool + """ + Require this application to be served in an isolated browser for users matching + this policy. 'Client Web Isolation' must be on for the account in order to use + this feature. + """ + + mfa_config: McpServerApplicationPolicyUnionMember2MfaConfig + """Configures multi-factor authentication (MFA) settings.""" + + precedence: int + """The order of execution for this policy. + + Must be unique for each policy within an app. + """ + + purpose_justification_prompt: str + """A custom message that will appear on the purpose justification screen.""" + + purpose_justification_required: bool + """Require users to enter a justification when they log in to the application.""" + + session_duration: str + """The amount of time that tokens issued for the application will be valid. + + Must be in the format `300ms` or `2h45m`. Valid time units are: ns, us (or µs), + ms, s, m, h. + """ + + +McpServerApplicationPolicy: TypeAlias = Union[ + McpServerApplicationPolicyAccessAppPolicyLink, str, McpServerApplicationPolicyUnionMember2 +] + + +class McpServerApplicationSCIMConfigAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken( + TypedDict, total=False +): + """ + Attributes for configuring Access Service Token authentication scheme for SCIM provisioning to an application. + """ + + client_id: Required[str] + """ + Client ID of the Access service token used to authenticate with the remote + service. + """ + + client_secret: Required[str] + """ + Client secret of the Access service token used to authenticate with the remote + service. + """ + + scheme: Required[Literal["access_service_token"]] + """The authentication scheme to use when making SCIM requests to this application.""" + + +class McpServerApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken( + TypedDict, total=False +): + """ + Attributes for configuring Access Service Token authentication scheme for SCIM provisioning to an application. + """ + + client_id: Required[str] + """ + Client ID of the Access service token used to authenticate with the remote + service. + """ + + client_secret: Required[str] + """ + Client secret of the Access service token used to authenticate with the remote + service. + """ + + scheme: Required[Literal["access_service_token"]] + """The authentication scheme to use when making SCIM requests to this application.""" + + +McpServerApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthentication: TypeAlias = Union[ + SCIMConfigAuthenticationHTTPBasicParam, + SCIMConfigAuthenticationOAuthBearerTokenParam, + SCIMConfigAuthenticationOauth2Param, + McpServerApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken, +] + +McpServerApplicationSCIMConfigAuthentication: TypeAlias = Union[ + SCIMConfigAuthenticationHTTPBasicParam, + SCIMConfigAuthenticationOAuthBearerTokenParam, + SCIMConfigAuthenticationOauth2Param, + McpServerApplicationSCIMConfigAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken, + Iterable[McpServerApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthentication], +] + + +class McpServerApplicationSCIMConfig(TypedDict, total=False): + """Configuration for provisioning to this application via SCIM. + + This is currently in closed beta. + """ + + idp_uid: Required[str] + """ + The UID of the IdP to use as the source for SCIM resources to provision to this + application. + """ + + remote_uri: Required[str] + """The base URI for the application's SCIM-compatible API.""" + + authentication: McpServerApplicationSCIMConfigAuthentication + """ + Attributes for configuring HTTP Basic authentication scheme for SCIM + provisioning to an application. + """ + + deactivate_on_delete: bool + """ + If false, propagates DELETE requests to the target application for SCIM + resources. If true, sets 'active' to false on the SCIM resource. Note: Some + targets do not support DELETE operations. + """ + + enabled: bool + """Whether SCIM provisioning is turned on for this application.""" + + mappings: Iterable[SCIMConfigMappingParam] + """ + A list of mappings to apply to SCIM resources before provisioning them in this + application. These can transform or filter the resources to be provisioned. + """ + + +class McpServerPortalApplication(TypedDict, total=False): + type: Required[ApplicationType] + """The application type.""" + + account_id: str + """The Account ID to use for this endpoint. Mutually exclusive with the Zone ID.""" + + zone_id: str + """The Zone ID to use for this endpoint. Mutually exclusive with the Account ID.""" + + allow_authenticate_via_warp: bool + """ + When set to true, users can authenticate to this application using their WARP + session. When set to false this application will always require direct IdP + authentication. This setting always overrides the organization setting for WARP + authentication. + """ + + allowed_idps: SequenceNotStr[AllowedIdPs] + """The identity providers your users can select when connecting to this + application. + + Defaults to all IdPs configured in your account. + """ + + auto_redirect_to_identity: bool + """When set to `true`, users skip the identity provider selection step during + login. + + You must specify only one identity provider in allowed_idps. + """ + + custom_deny_message: str + """ + The custom error message shown to a user when they are denied access to the + application. + """ + + custom_deny_url: str + """ + The custom URL a user is redirected to when they are denied access to the + application when failing identity-based rules. + """ + + custom_non_identity_deny_url: str + """ + The custom URL a user is redirected to when they are denied access to the + application when failing non-identity rules. + """ + + custom_pages: SequenceNotStr[str] + """The custom pages that will be displayed when applicable for this application""" + + destinations: Iterable[McpServerPortalApplicationDestination] + """List of destinations secured by Access. + + This supersedes `self_hosted_domains` to allow for more flexibility in defining + different types of domains. If `destinations` are provided, then + `self_hosted_domains` will be ignored. + """ + + domain: str + """The primary hostname and path secured by Access. + + This domain will be displayed if the app is visible in the App Launcher. + """ + + http_only_cookie_attribute: bool + """ + Enables the HttpOnly cookie attribute, which increases security against XSS + attacks. + """ + + logo_url: str + """The image URL for the logo shown in the App Launcher dashboard.""" + + name: str + """The name of the application.""" + + oauth_configuration: McpServerPortalApplicationOAuthConfiguration + """ + **Beta:** Optional configuration for managing an OAuth authorization flow + controlled by Access. When set, Access will act as the OAuth authorization + server for this application. Only compatible with OAuth clients that support + [RFC 8707](https://datatracker.ietf.org/doc/html/rfc8707) (Resource Indicators + for OAuth 2.0). This feature is currently in beta. + """ + + options_preflight_bypass: bool + """ + Allows options preflight requests to bypass Access authentication and go + directly to the origin. Cannot turn on if cors_headers is set. + """ + + policies: SequenceNotStr[McpServerPortalApplicationPolicy] + """ + The policies that Access applies to the application, in ascending order of + precedence. Items can reference existing policies or create new policies + exclusive to the application. + """ + + same_site_cookie_attribute: str + """ + Sets the SameSite cookie setting, which provides increased security against CSRF + attacks. + """ + + scim_config: McpServerPortalApplicationSCIMConfig + """Configuration for provisioning to this application via SCIM. + + This is currently in closed beta. + """ + + session_duration: str + """The amount of time that tokens issued for this application will be valid. + + Must be in the format `300ms` or `2h45m`. Valid time units are: ns, us (or µs), + ms, s, m, h. Note: unsupported for infrastructure type applications. + """ + + tags: SequenceNotStr[str] + """The tags you want assigned to an application. + + Tags are used to filter applications in the App Launcher dashboard. + """ + + +class McpServerPortalApplicationDestinationPublicDestination(TypedDict, total=False): + """A public hostname that Access will secure. + + Public destinations support sub-domain and path. Wildcard '*' can be used in the definition. + """ + + type: Literal["public"] + + uri: str + """The URI of the destination. + + Public destinations' URIs can include a domain and path with + [wildcards](https://developers.cloudflare.com/cloudflare-one/policies/access/app-paths/). + """ + + +class McpServerPortalApplicationDestinationPrivateDestination(TypedDict, total=False): + cidr: str + """The CIDR range of the destination. Single IPs will be computed as /32.""" + + hostname: str + """The hostname of the destination. Matches a valid SNI served by an HTTPS origin.""" + + l4_protocol: Literal["tcp", "udp"] + """The L4 protocol of the destination. + + When omitted, both UDP and TCP traffic will match. + """ + + port_range: str + """The port range of the destination. + + Can be a single port or a range of ports. When omitted, all ports will match. + """ + + type: Literal["private"] + + vnet_id: str + """The VNET ID to match the destination. When omitted, all VNETs will match.""" + + +class McpServerPortalApplicationDestinationViaMcpServerPortalDestination(TypedDict, total=False): + """A MCP server id configured in ai-controls. + + Access will secure the MCP server if accessed through a MCP portal. + """ + + mcp_server_id: str + """The MCP server id configured in ai-controls.""" + + type: Literal["via_mcp_server_portal"] + + +McpServerPortalApplicationDestination: TypeAlias = Union[ + McpServerPortalApplicationDestinationPublicDestination, + McpServerPortalApplicationDestinationPrivateDestination, + McpServerPortalApplicationDestinationViaMcpServerPortalDestination, +] + + +class McpServerPortalApplicationOAuthConfigurationDynamicClientRegistration(TypedDict, total=False): + """Settings for OAuth dynamic client registration.""" + + allow_any_on_localhost: bool + """Allows any client with redirect URIs on localhost.""" + + allow_any_on_loopback: bool + """Allows any client with redirect URIs on 127.0.0.1.""" + + allowed_uris: SequenceNotStr[str] + """The URIs that are allowed as redirect URIs for dynamically registered clients. + + Must use the `https` protocol. Paths may end in `/*` to match all sub-paths. + """ + + enabled: bool + """Whether dynamic client registration is enabled.""" + + +class McpServerPortalApplicationOAuthConfigurationGrant(TypedDict, total=False): + """Settings for OAuth grant behavior.""" + + access_token_lifetime: str + """The lifetime of the access token. + + Must be in the format `300ms` or `2h45m`. Valid time units are ns, us (or µs), + ms, s, m, h. + """ + + session_duration: str + """The duration of the OAuth session. + + Must be in the format `300ms` or `2h45m`. Valid time units are ns, us (or µs), + ms, s, m, h. + """ + + +class McpServerPortalApplicationOAuthConfiguration(TypedDict, total=False): + """ + **Beta:** Optional configuration for managing an OAuth authorization flow controlled by Access. When set, Access will act as the OAuth authorization server for this application. Only compatible with OAuth clients that support [RFC 8707](https://datatracker.ietf.org/doc/html/rfc8707) (Resource Indicators for OAuth 2.0). This feature is currently in beta. + """ + + dynamic_client_registration: McpServerPortalApplicationOAuthConfigurationDynamicClientRegistration + """Settings for OAuth dynamic client registration.""" + + enabled: bool + """Whether the OAuth configuration is enabled for this application. + + When set to `false`, Access will not handle OAuth for this application. Defaults + to `true` if omitted. + """ + + grant: McpServerPortalApplicationOAuthConfigurationGrant + """Settings for OAuth grant behavior.""" + + +class McpServerPortalApplicationPolicyAccessAppPolicyLink(TypedDict, total=False): + """A JSON that links a reusable policy to an application.""" + + id: str + """The UUID of the policy""" + + precedence: int + """The order of execution for this policy. + + Must be unique for each policy within an app. + """ + + +class McpServerPortalApplicationPolicyUnionMember2MfaConfig(TypedDict, total=False): + """Configures multi-factor authentication (MFA) settings.""" + + allowed_authenticators: List[Literal["totp", "biometrics", "security_key"]] + """Lists the MFA methods that users can authenticate with.""" + + mfa_bypass: bool + """Indicates whether to bypass MFA for this resource. + + This option is available at the application and policy level. + """ + + session_duration: str + """Defines the duration of an MFA session. + + Must be in minutes (m) or hours (h). Minimum: 0m. Maximum: 720h (30 days). + Examples:`5m` or `24h`. + """ + + +class McpServerPortalApplicationPolicyUnionMember2(TypedDict, total=False): + id: str + """The UUID of the policy""" + + approval_groups: Iterable[ApprovalGroupParam] + """Administrators who can approve a temporary authentication request.""" + + approval_required: bool + """ + Requires the user to request access from an administrator at the start of each + session. + """ + + isolation_required: bool + """ + Require this application to be served in an isolated browser for users matching + this policy. 'Client Web Isolation' must be on for the account in order to use + this feature. + """ + + mfa_config: McpServerPortalApplicationPolicyUnionMember2MfaConfig + """Configures multi-factor authentication (MFA) settings.""" + + precedence: int + """The order of execution for this policy. + + Must be unique for each policy within an app. + """ + + purpose_justification_prompt: str + """A custom message that will appear on the purpose justification screen.""" + + purpose_justification_required: bool + """Require users to enter a justification when they log in to the application.""" + + session_duration: str + """The amount of time that tokens issued for the application will be valid. + + Must be in the format `300ms` or `2h45m`. Valid time units are: ns, us (or µs), + ms, s, m, h. + """ + + +McpServerPortalApplicationPolicy: TypeAlias = Union[ + McpServerPortalApplicationPolicyAccessAppPolicyLink, str, McpServerPortalApplicationPolicyUnionMember2 +] + + +class McpServerPortalApplicationSCIMConfigAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken( + TypedDict, total=False +): + """ + Attributes for configuring Access Service Token authentication scheme for SCIM provisioning to an application. + """ + + client_id: Required[str] + """ + Client ID of the Access service token used to authenticate with the remote + service. + """ + + client_secret: Required[str] + """ + Client secret of the Access service token used to authenticate with the remote + service. + """ + + scheme: Required[Literal["access_service_token"]] + """The authentication scheme to use when making SCIM requests to this application.""" + + +class McpServerPortalApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken( + TypedDict, total=False +): + """ + Attributes for configuring Access Service Token authentication scheme for SCIM provisioning to an application. + """ + + client_id: Required[str] + """ + Client ID of the Access service token used to authenticate with the remote + service. + """ + + client_secret: Required[str] + """ + Client secret of the Access service token used to authenticate with the remote + service. + """ + + scheme: Required[Literal["access_service_token"]] + """The authentication scheme to use when making SCIM requests to this application.""" + + +McpServerPortalApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthentication: TypeAlias = Union[ + SCIMConfigAuthenticationHTTPBasicParam, + SCIMConfigAuthenticationOAuthBearerTokenParam, + SCIMConfigAuthenticationOauth2Param, + McpServerPortalApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken, +] + +McpServerPortalApplicationSCIMConfigAuthentication: TypeAlias = Union[ + SCIMConfigAuthenticationHTTPBasicParam, + SCIMConfigAuthenticationOAuthBearerTokenParam, + SCIMConfigAuthenticationOauth2Param, + McpServerPortalApplicationSCIMConfigAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken, + Iterable[McpServerPortalApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthentication], +] + + +class McpServerPortalApplicationSCIMConfig(TypedDict, total=False): + """Configuration for provisioning to this application via SCIM. + + This is currently in closed beta. + """ + + idp_uid: Required[str] + """ + The UID of the IdP to use as the source for SCIM resources to provision to this + application. + """ + + remote_uri: Required[str] + """The base URI for the application's SCIM-compatible API.""" + + authentication: McpServerPortalApplicationSCIMConfigAuthentication + """ + Attributes for configuring HTTP Basic authentication scheme for SCIM + provisioning to an application. + """ + + deactivate_on_delete: bool + """ + If false, propagates DELETE requests to the target application for SCIM + resources. If true, sets 'active' to false on the SCIM resource. Note: Some + targets do not support DELETE operations. + """ + + enabled: bool + """Whether SCIM provisioning is turned on for this application.""" + + mappings: Iterable[SCIMConfigMappingParam] + """ + A list of mappings to apply to SCIM resources before provisioning them in this + application. These can transform or filter the resources to be provisioned. + """ + + ApplicationUpdateParams: TypeAlias = Union[ SelfHostedApplication, SaaSApplication, @@ -2660,4 +4144,6 @@ class BrowserRdpApplicationSCIMConfig(TypedDict, total=False): BookmarkApplication, InfrastructureApplication, BrowserRdpApplication, + McpServerApplication, + McpServerPortalApplication, ] diff --git a/src/cloudflare/types/zero_trust/access/application_update_response.py b/src/cloudflare/types/zero_trust/access/application_update_response.py index f5fed2c82a5..8c71fca2752 100644 --- a/src/cloudflare/types/zero_trust/access/application_update_response.py +++ b/src/cloudflare/types/zero_trust/access/application_update_response.py @@ -26,7 +26,12 @@ "SelfHostedApplicationDestinationPublicDestination", "SelfHostedApplicationDestinationPrivateDestination", "SelfHostedApplicationDestinationViaMcpServerPortalDestination", + "SelfHostedApplicationMfaConfig", + "SelfHostedApplicationOAuthConfiguration", + "SelfHostedApplicationOAuthConfigurationDynamicClientRegistration", + "SelfHostedApplicationOAuthConfigurationGrant", "SelfHostedApplicationPolicy", + "SelfHostedApplicationPolicyMfaConfig", "SelfHostedApplicationSCIMConfig", "SelfHostedApplicationSCIMConfigAuthentication", "SelfHostedApplicationSCIMConfigAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken", @@ -34,6 +39,7 @@ "SelfHostedApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken", "SaaSApplication", "SaaSApplicationPolicy", + "SaaSApplicationPolicyMfaConfig", "SaaSApplicationSaaSApp", "SaaSApplicationSCIMConfig", "SaaSApplicationSCIMConfigAuthentication", @@ -45,7 +51,12 @@ "BrowserSSHApplicationDestinationPublicDestination", "BrowserSSHApplicationDestinationPrivateDestination", "BrowserSSHApplicationDestinationViaMcpServerPortalDestination", + "BrowserSSHApplicationMfaConfig", + "BrowserSSHApplicationOAuthConfiguration", + "BrowserSSHApplicationOAuthConfigurationDynamicClientRegistration", + "BrowserSSHApplicationOAuthConfigurationGrant", "BrowserSSHApplicationPolicy", + "BrowserSSHApplicationPolicyMfaConfig", "BrowserSSHApplicationSCIMConfig", "BrowserSSHApplicationSCIMConfigAuthentication", "BrowserSSHApplicationSCIMConfigAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken", @@ -56,7 +67,12 @@ "BrowserVNCApplicationDestinationPublicDestination", "BrowserVNCApplicationDestinationPrivateDestination", "BrowserVNCApplicationDestinationViaMcpServerPortalDestination", + "BrowserVNCApplicationMfaConfig", + "BrowserVNCApplicationOAuthConfiguration", + "BrowserVNCApplicationOAuthConfigurationDynamicClientRegistration", + "BrowserVNCApplicationOAuthConfigurationGrant", "BrowserVNCApplicationPolicy", + "BrowserVNCApplicationPolicyMfaConfig", "BrowserVNCApplicationSCIMConfig", "BrowserVNCApplicationSCIMConfigAuthentication", "BrowserVNCApplicationSCIMConfigAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken", @@ -66,14 +82,19 @@ "AppLauncherApplicationFooterLink", "AppLauncherApplicationLandingPageDesign", "AppLauncherApplicationPolicy", + "AppLauncherApplicationPolicyMfaConfig", "DeviceEnrollmentPermissionsApplication", "DeviceEnrollmentPermissionsApplicationPolicy", + "DeviceEnrollmentPermissionsApplicationPolicyMfaConfig", "BrowserIsolationPermissionsApplication", "BrowserIsolationPermissionsApplicationPolicy", + "BrowserIsolationPermissionsApplicationPolicyMfaConfig", "GatewayIdentityProxyEndpointApplication", "GatewayIdentityProxyEndpointApplicationPolicy", + "GatewayIdentityProxyEndpointApplicationPolicyMfaConfig", "BookmarkApplication", "BookmarkApplicationPolicy", + "BookmarkApplicationPolicyMfaConfig", "InfrastructureApplication", "InfrastructureApplicationTargetCriterion", "InfrastructureApplicationPolicy", @@ -85,12 +106,47 @@ "BrowserRdpApplicationDestinationPublicDestination", "BrowserRdpApplicationDestinationPrivateDestination", "BrowserRdpApplicationDestinationViaMcpServerPortalDestination", + "BrowserRdpApplicationMfaConfig", + "BrowserRdpApplicationOAuthConfiguration", + "BrowserRdpApplicationOAuthConfigurationDynamicClientRegistration", + "BrowserRdpApplicationOAuthConfigurationGrant", "BrowserRdpApplicationPolicy", + "BrowserRdpApplicationPolicyMfaConfig", "BrowserRdpApplicationSCIMConfig", "BrowserRdpApplicationSCIMConfigAuthentication", "BrowserRdpApplicationSCIMConfigAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken", "BrowserRdpApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthentication", "BrowserRdpApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken", + "McpServerApplication", + "McpServerApplicationDestination", + "McpServerApplicationDestinationPublicDestination", + "McpServerApplicationDestinationPrivateDestination", + "McpServerApplicationDestinationViaMcpServerPortalDestination", + "McpServerApplicationOAuthConfiguration", + "McpServerApplicationOAuthConfigurationDynamicClientRegistration", + "McpServerApplicationOAuthConfigurationGrant", + "McpServerApplicationPolicy", + "McpServerApplicationPolicyMfaConfig", + "McpServerApplicationSCIMConfig", + "McpServerApplicationSCIMConfigAuthentication", + "McpServerApplicationSCIMConfigAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken", + "McpServerApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthentication", + "McpServerApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken", + "McpServerPortalApplication", + "McpServerPortalApplicationDestination", + "McpServerPortalApplicationDestinationPublicDestination", + "McpServerPortalApplicationDestinationPrivateDestination", + "McpServerPortalApplicationDestinationViaMcpServerPortalDestination", + "McpServerPortalApplicationOAuthConfiguration", + "McpServerPortalApplicationOAuthConfigurationDynamicClientRegistration", + "McpServerPortalApplicationOAuthConfigurationGrant", + "McpServerPortalApplicationPolicy", + "McpServerPortalApplicationPolicyMfaConfig", + "McpServerPortalApplicationSCIMConfig", + "McpServerPortalApplicationSCIMConfigAuthentication", + "McpServerPortalApplicationSCIMConfigAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken", + "McpServerPortalApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthentication", + "McpServerPortalApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken", ] @@ -154,6 +210,102 @@ class SelfHostedApplicationDestinationViaMcpServerPortalDestination(BaseModel): ] +class SelfHostedApplicationMfaConfig(BaseModel): + """Configures multi-factor authentication (MFA) settings.""" + + allowed_authenticators: Optional[List[Literal["totp", "biometrics", "security_key"]]] = None + """Lists the MFA methods that users can authenticate with.""" + + mfa_bypass: Optional[bool] = None + """Indicates whether to bypass MFA for this resource. + + This option is available at the application and policy level. + """ + + session_duration: Optional[str] = None + """Defines the duration of an MFA session. + + Must be in minutes (m) or hours (h). Minimum: 0m. Maximum: 720h (30 days). + Examples:`5m` or `24h`. + """ + + +class SelfHostedApplicationOAuthConfigurationDynamicClientRegistration(BaseModel): + """Settings for OAuth dynamic client registration.""" + + allow_any_on_localhost: Optional[bool] = None + """Allows any client with redirect URIs on localhost.""" + + allow_any_on_loopback: Optional[bool] = None + """Allows any client with redirect URIs on 127.0.0.1.""" + + allowed_uris: Optional[List[str]] = None + """The URIs that are allowed as redirect URIs for dynamically registered clients. + + Must use the `https` protocol. Paths may end in `/*` to match all sub-paths. + """ + + enabled: Optional[bool] = None + """Whether dynamic client registration is enabled.""" + + +class SelfHostedApplicationOAuthConfigurationGrant(BaseModel): + """Settings for OAuth grant behavior.""" + + access_token_lifetime: Optional[str] = None + """The lifetime of the access token. + + Must be in the format `300ms` or `2h45m`. Valid time units are ns, us (or µs), + ms, s, m, h. + """ + + session_duration: Optional[str] = None + """The duration of the OAuth session. + + Must be in the format `300ms` or `2h45m`. Valid time units are ns, us (or µs), + ms, s, m, h. + """ + + +class SelfHostedApplicationOAuthConfiguration(BaseModel): + """ + **Beta:** Optional configuration for managing an OAuth authorization flow controlled by Access. When set, Access will act as the OAuth authorization server for this application. Only compatible with OAuth clients that support [RFC 8707](https://datatracker.ietf.org/doc/html/rfc8707) (Resource Indicators for OAuth 2.0). This feature is currently in beta. + """ + + dynamic_client_registration: Optional[SelfHostedApplicationOAuthConfigurationDynamicClientRegistration] = None + """Settings for OAuth dynamic client registration.""" + + enabled: Optional[bool] = None + """Whether the OAuth configuration is enabled for this application. + + When set to `false`, Access will not handle OAuth for this application. Defaults + to `true` if omitted. + """ + + grant: Optional[SelfHostedApplicationOAuthConfigurationGrant] = None + """Settings for OAuth grant behavior.""" + + +class SelfHostedApplicationPolicyMfaConfig(BaseModel): + """Configures multi-factor authentication (MFA) settings.""" + + allowed_authenticators: Optional[List[Literal["totp", "biometrics", "security_key"]]] = None + """Lists the MFA methods that users can authenticate with.""" + + mfa_bypass: Optional[bool] = None + """Indicates whether to bypass MFA for this resource. + + This option is available at the application and policy level. + """ + + session_duration: Optional[str] = None + """Defines the duration of an MFA session. + + Must be in minutes (m) or hours (h). Minimum: 0m. Maximum: 720h (30 days). + Examples:`5m` or `24h`. + """ + + class SelfHostedApplicationPolicy(BaseModel): id: Optional[str] = None """The UUID of the policy""" @@ -194,6 +346,9 @@ class SelfHostedApplicationPolicy(BaseModel): this feature. """ + mfa_config: Optional[SelfHostedApplicationPolicyMfaConfig] = None + """Configures multi-factor authentication (MFA) settings.""" + name: Optional[str] = None """The name of the Access policy.""" @@ -413,9 +568,21 @@ class SelfHostedApplication(BaseModel): logo_url: Optional[str] = None """The image URL for the logo shown in the App Launcher dashboard.""" + mfa_config: Optional[SelfHostedApplicationMfaConfig] = None + """Configures multi-factor authentication (MFA) settings.""" + name: Optional[str] = None """The name of the application.""" + oauth_configuration: Optional[SelfHostedApplicationOAuthConfiguration] = None + """ + **Beta:** Optional configuration for managing an OAuth authorization flow + controlled by Access. When set, Access will act as the OAuth authorization + server for this application. Only compatible with OAuth clients that support + [RFC 8707](https://datatracker.ietf.org/doc/html/rfc8707) (Resource Indicators + for OAuth 2.0). This feature is currently in beta. + """ + options_preflight_bypass: Optional[bool] = None """ Allows options preflight requests to bypass Access authentication and go @@ -489,6 +656,26 @@ class SelfHostedApplication(BaseModel): """ +class SaaSApplicationPolicyMfaConfig(BaseModel): + """Configures multi-factor authentication (MFA) settings.""" + + allowed_authenticators: Optional[List[Literal["totp", "biometrics", "security_key"]]] = None + """Lists the MFA methods that users can authenticate with.""" + + mfa_bypass: Optional[bool] = None + """Indicates whether to bypass MFA for this resource. + + This option is available at the application and policy level. + """ + + session_duration: Optional[str] = None + """Defines the duration of an MFA session. + + Must be in minutes (m) or hours (h). Minimum: 0m. Maximum: 720h (30 days). + Examples:`5m` or `24h`. + """ + + class SaaSApplicationPolicy(BaseModel): id: Optional[str] = None """The UUID of the policy""" @@ -529,6 +716,9 @@ class SaaSApplicationPolicy(BaseModel): this feature. """ + mfa_config: Optional[SaaSApplicationPolicyMfaConfig] = None + """Configures multi-factor authentication (MFA) settings.""" + name: Optional[str] = None """The name of the Access policy.""" @@ -774,6 +964,102 @@ class BrowserSSHApplicationDestinationViaMcpServerPortalDestination(BaseModel): ] +class BrowserSSHApplicationMfaConfig(BaseModel): + """Configures multi-factor authentication (MFA) settings.""" + + allowed_authenticators: Optional[List[Literal["totp", "biometrics", "security_key"]]] = None + """Lists the MFA methods that users can authenticate with.""" + + mfa_bypass: Optional[bool] = None + """Indicates whether to bypass MFA for this resource. + + This option is available at the application and policy level. + """ + + session_duration: Optional[str] = None + """Defines the duration of an MFA session. + + Must be in minutes (m) or hours (h). Minimum: 0m. Maximum: 720h (30 days). + Examples:`5m` or `24h`. + """ + + +class BrowserSSHApplicationOAuthConfigurationDynamicClientRegistration(BaseModel): + """Settings for OAuth dynamic client registration.""" + + allow_any_on_localhost: Optional[bool] = None + """Allows any client with redirect URIs on localhost.""" + + allow_any_on_loopback: Optional[bool] = None + """Allows any client with redirect URIs on 127.0.0.1.""" + + allowed_uris: Optional[List[str]] = None + """The URIs that are allowed as redirect URIs for dynamically registered clients. + + Must use the `https` protocol. Paths may end in `/*` to match all sub-paths. + """ + + enabled: Optional[bool] = None + """Whether dynamic client registration is enabled.""" + + +class BrowserSSHApplicationOAuthConfigurationGrant(BaseModel): + """Settings for OAuth grant behavior.""" + + access_token_lifetime: Optional[str] = None + """The lifetime of the access token. + + Must be in the format `300ms` or `2h45m`. Valid time units are ns, us (or µs), + ms, s, m, h. + """ + + session_duration: Optional[str] = None + """The duration of the OAuth session. + + Must be in the format `300ms` or `2h45m`. Valid time units are ns, us (or µs), + ms, s, m, h. + """ + + +class BrowserSSHApplicationOAuthConfiguration(BaseModel): + """ + **Beta:** Optional configuration for managing an OAuth authorization flow controlled by Access. When set, Access will act as the OAuth authorization server for this application. Only compatible with OAuth clients that support [RFC 8707](https://datatracker.ietf.org/doc/html/rfc8707) (Resource Indicators for OAuth 2.0). This feature is currently in beta. + """ + + dynamic_client_registration: Optional[BrowserSSHApplicationOAuthConfigurationDynamicClientRegistration] = None + """Settings for OAuth dynamic client registration.""" + + enabled: Optional[bool] = None + """Whether the OAuth configuration is enabled for this application. + + When set to `false`, Access will not handle OAuth for this application. Defaults + to `true` if omitted. + """ + + grant: Optional[BrowserSSHApplicationOAuthConfigurationGrant] = None + """Settings for OAuth grant behavior.""" + + +class BrowserSSHApplicationPolicyMfaConfig(BaseModel): + """Configures multi-factor authentication (MFA) settings.""" + + allowed_authenticators: Optional[List[Literal["totp", "biometrics", "security_key"]]] = None + """Lists the MFA methods that users can authenticate with.""" + + mfa_bypass: Optional[bool] = None + """Indicates whether to bypass MFA for this resource. + + This option is available at the application and policy level. + """ + + session_duration: Optional[str] = None + """Defines the duration of an MFA session. + + Must be in minutes (m) or hours (h). Minimum: 0m. Maximum: 720h (30 days). + Examples:`5m` or `24h`. + """ + + class BrowserSSHApplicationPolicy(BaseModel): id: Optional[str] = None """The UUID of the policy""" @@ -814,6 +1100,9 @@ class BrowserSSHApplicationPolicy(BaseModel): this feature. """ + mfa_config: Optional[BrowserSSHApplicationPolicyMfaConfig] = None + """Configures multi-factor authentication (MFA) settings.""" + name: Optional[str] = None """The name of the Access policy.""" @@ -1048,9 +1337,21 @@ class BrowserSSHApplication(BaseModel): logo_url: Optional[str] = None """The image URL for the logo shown in the App Launcher dashboard.""" + mfa_config: Optional[BrowserSSHApplicationMfaConfig] = None + """Configures multi-factor authentication (MFA) settings.""" + name: Optional[str] = None """The name of the application.""" + oauth_configuration: Optional[BrowserSSHApplicationOAuthConfiguration] = None + """ + **Beta:** Optional configuration for managing an OAuth authorization flow + controlled by Access. When set, Access will act as the OAuth authorization + server for this application. Only compatible with OAuth clients that support + [RFC 8707](https://datatracker.ietf.org/doc/html/rfc8707) (Resource Indicators + for OAuth 2.0). This feature is currently in beta. + """ + options_preflight_bypass: Optional[bool] = None """ Allows options preflight requests to bypass Access authentication and go @@ -1184,6 +1485,102 @@ class BrowserVNCApplicationDestinationViaMcpServerPortalDestination(BaseModel): ] +class BrowserVNCApplicationMfaConfig(BaseModel): + """Configures multi-factor authentication (MFA) settings.""" + + allowed_authenticators: Optional[List[Literal["totp", "biometrics", "security_key"]]] = None + """Lists the MFA methods that users can authenticate with.""" + + mfa_bypass: Optional[bool] = None + """Indicates whether to bypass MFA for this resource. + + This option is available at the application and policy level. + """ + + session_duration: Optional[str] = None + """Defines the duration of an MFA session. + + Must be in minutes (m) or hours (h). Minimum: 0m. Maximum: 720h (30 days). + Examples:`5m` or `24h`. + """ + + +class BrowserVNCApplicationOAuthConfigurationDynamicClientRegistration(BaseModel): + """Settings for OAuth dynamic client registration.""" + + allow_any_on_localhost: Optional[bool] = None + """Allows any client with redirect URIs on localhost.""" + + allow_any_on_loopback: Optional[bool] = None + """Allows any client with redirect URIs on 127.0.0.1.""" + + allowed_uris: Optional[List[str]] = None + """The URIs that are allowed as redirect URIs for dynamically registered clients. + + Must use the `https` protocol. Paths may end in `/*` to match all sub-paths. + """ + + enabled: Optional[bool] = None + """Whether dynamic client registration is enabled.""" + + +class BrowserVNCApplicationOAuthConfigurationGrant(BaseModel): + """Settings for OAuth grant behavior.""" + + access_token_lifetime: Optional[str] = None + """The lifetime of the access token. + + Must be in the format `300ms` or `2h45m`. Valid time units are ns, us (or µs), + ms, s, m, h. + """ + + session_duration: Optional[str] = None + """The duration of the OAuth session. + + Must be in the format `300ms` or `2h45m`. Valid time units are ns, us (or µs), + ms, s, m, h. + """ + + +class BrowserVNCApplicationOAuthConfiguration(BaseModel): + """ + **Beta:** Optional configuration for managing an OAuth authorization flow controlled by Access. When set, Access will act as the OAuth authorization server for this application. Only compatible with OAuth clients that support [RFC 8707](https://datatracker.ietf.org/doc/html/rfc8707) (Resource Indicators for OAuth 2.0). This feature is currently in beta. + """ + + dynamic_client_registration: Optional[BrowserVNCApplicationOAuthConfigurationDynamicClientRegistration] = None + """Settings for OAuth dynamic client registration.""" + + enabled: Optional[bool] = None + """Whether the OAuth configuration is enabled for this application. + + When set to `false`, Access will not handle OAuth for this application. Defaults + to `true` if omitted. + """ + + grant: Optional[BrowserVNCApplicationOAuthConfigurationGrant] = None + """Settings for OAuth grant behavior.""" + + +class BrowserVNCApplicationPolicyMfaConfig(BaseModel): + """Configures multi-factor authentication (MFA) settings.""" + + allowed_authenticators: Optional[List[Literal["totp", "biometrics", "security_key"]]] = None + """Lists the MFA methods that users can authenticate with.""" + + mfa_bypass: Optional[bool] = None + """Indicates whether to bypass MFA for this resource. + + This option is available at the application and policy level. + """ + + session_duration: Optional[str] = None + """Defines the duration of an MFA session. + + Must be in minutes (m) or hours (h). Minimum: 0m. Maximum: 720h (30 days). + Examples:`5m` or `24h`. + """ + + class BrowserVNCApplicationPolicy(BaseModel): id: Optional[str] = None """The UUID of the policy""" @@ -1224,6 +1621,9 @@ class BrowserVNCApplicationPolicy(BaseModel): this feature. """ + mfa_config: Optional[BrowserVNCApplicationPolicyMfaConfig] = None + """Configures multi-factor authentication (MFA) settings.""" + name: Optional[str] = None """The name of the Access policy.""" @@ -1458,9 +1858,21 @@ class BrowserVNCApplication(BaseModel): logo_url: Optional[str] = None """The image URL for the logo shown in the App Launcher dashboard.""" + mfa_config: Optional[BrowserVNCApplicationMfaConfig] = None + """Configures multi-factor authentication (MFA) settings.""" + name: Optional[str] = None """The name of the application.""" + oauth_configuration: Optional[BrowserVNCApplicationOAuthConfiguration] = None + """ + **Beta:** Optional configuration for managing an OAuth authorization flow + controlled by Access. When set, Access will act as the OAuth authorization + server for this application. Only compatible with OAuth clients that support + [RFC 8707](https://datatracker.ietf.org/doc/html/rfc8707) (Resource Indicators + for OAuth 2.0). This feature is currently in beta. + """ + options_preflight_bypass: Optional[bool] = None """ Allows options preflight requests to bypass Access authentication and go @@ -1561,6 +1973,26 @@ class AppLauncherApplicationLandingPageDesign(BaseModel): """The title shown on the landing page.""" +class AppLauncherApplicationPolicyMfaConfig(BaseModel): + """Configures multi-factor authentication (MFA) settings.""" + + allowed_authenticators: Optional[List[Literal["totp", "biometrics", "security_key"]]] = None + """Lists the MFA methods that users can authenticate with.""" + + mfa_bypass: Optional[bool] = None + """Indicates whether to bypass MFA for this resource. + + This option is available at the application and policy level. + """ + + session_duration: Optional[str] = None + """Defines the duration of an MFA session. + + Must be in minutes (m) or hours (h). Minimum: 0m. Maximum: 720h (30 days). + Examples:`5m` or `24h`. + """ + + class AppLauncherApplicationPolicy(BaseModel): id: Optional[str] = None """The UUID of the policy""" @@ -1601,6 +2033,9 @@ class AppLauncherApplicationPolicy(BaseModel): this feature. """ + mfa_config: Optional[AppLauncherApplicationPolicyMfaConfig] = None + """Configures multi-factor authentication (MFA) settings.""" + name: Optional[str] = None """The name of the Access policy.""" @@ -1723,6 +2158,26 @@ class AppLauncherApplication(BaseModel): """Determines when to skip the App Launcher landing page.""" +class DeviceEnrollmentPermissionsApplicationPolicyMfaConfig(BaseModel): + """Configures multi-factor authentication (MFA) settings.""" + + allowed_authenticators: Optional[List[Literal["totp", "biometrics", "security_key"]]] = None + """Lists the MFA methods that users can authenticate with.""" + + mfa_bypass: Optional[bool] = None + """Indicates whether to bypass MFA for this resource. + + This option is available at the application and policy level. + """ + + session_duration: Optional[str] = None + """Defines the duration of an MFA session. + + Must be in minutes (m) or hours (h). Minimum: 0m. Maximum: 720h (30 days). + Examples:`5m` or `24h`. + """ + + class DeviceEnrollmentPermissionsApplicationPolicy(BaseModel): id: Optional[str] = None """The UUID of the policy""" @@ -1763,6 +2218,9 @@ class DeviceEnrollmentPermissionsApplicationPolicy(BaseModel): this feature. """ + mfa_config: Optional[DeviceEnrollmentPermissionsApplicationPolicyMfaConfig] = None + """Configures multi-factor authentication (MFA) settings.""" + name: Optional[str] = None """The name of the Access policy.""" @@ -1852,6 +2310,26 @@ class DeviceEnrollmentPermissionsApplication(BaseModel): """ +class BrowserIsolationPermissionsApplicationPolicyMfaConfig(BaseModel): + """Configures multi-factor authentication (MFA) settings.""" + + allowed_authenticators: Optional[List[Literal["totp", "biometrics", "security_key"]]] = None + """Lists the MFA methods that users can authenticate with.""" + + mfa_bypass: Optional[bool] = None + """Indicates whether to bypass MFA for this resource. + + This option is available at the application and policy level. + """ + + session_duration: Optional[str] = None + """Defines the duration of an MFA session. + + Must be in minutes (m) or hours (h). Minimum: 0m. Maximum: 720h (30 days). + Examples:`5m` or `24h`. + """ + + class BrowserIsolationPermissionsApplicationPolicy(BaseModel): id: Optional[str] = None """The UUID of the policy""" @@ -1892,6 +2370,9 @@ class BrowserIsolationPermissionsApplicationPolicy(BaseModel): this feature. """ + mfa_config: Optional[BrowserIsolationPermissionsApplicationPolicyMfaConfig] = None + """Configures multi-factor authentication (MFA) settings.""" + name: Optional[str] = None """The name of the Access policy.""" @@ -1981,6 +2462,26 @@ class BrowserIsolationPermissionsApplication(BaseModel): """ +class GatewayIdentityProxyEndpointApplicationPolicyMfaConfig(BaseModel): + """Configures multi-factor authentication (MFA) settings.""" + + allowed_authenticators: Optional[List[Literal["totp", "biometrics", "security_key"]]] = None + """Lists the MFA methods that users can authenticate with.""" + + mfa_bypass: Optional[bool] = None + """Indicates whether to bypass MFA for this resource. + + This option is available at the application and policy level. + """ + + session_duration: Optional[str] = None + """Defines the duration of an MFA session. + + Must be in minutes (m) or hours (h). Minimum: 0m. Maximum: 720h (30 days). + Examples:`5m` or `24h`. + """ + + class GatewayIdentityProxyEndpointApplicationPolicy(BaseModel): id: Optional[str] = None """The UUID of the policy""" @@ -2021,6 +2522,9 @@ class GatewayIdentityProxyEndpointApplicationPolicy(BaseModel): this feature. """ + mfa_config: Optional[GatewayIdentityProxyEndpointApplicationPolicyMfaConfig] = None + """Configures multi-factor authentication (MFA) settings.""" + name: Optional[str] = None """The name of the Access policy.""" @@ -2110,6 +2614,26 @@ class GatewayIdentityProxyEndpointApplication(BaseModel): """ +class BookmarkApplicationPolicyMfaConfig(BaseModel): + """Configures multi-factor authentication (MFA) settings.""" + + allowed_authenticators: Optional[List[Literal["totp", "biometrics", "security_key"]]] = None + """Lists the MFA methods that users can authenticate with.""" + + mfa_bypass: Optional[bool] = None + """Indicates whether to bypass MFA for this resource. + + This option is available at the application and policy level. + """ + + session_duration: Optional[str] = None + """Defines the duration of an MFA session. + + Must be in minutes (m) or hours (h). Minimum: 0m. Maximum: 720h (30 days). + Examples:`5m` or `24h`. + """ + + class BookmarkApplicationPolicy(BaseModel): id: Optional[str] = None """The UUID of the policy""" @@ -2150,6 +2674,9 @@ class BookmarkApplicationPolicy(BaseModel): this feature. """ + mfa_config: Optional[BookmarkApplicationPolicyMfaConfig] = None + """Configures multi-factor authentication (MFA) settings.""" + name: Optional[str] = None """The name of the Access policy.""" @@ -2384,37 +2911,133 @@ class BrowserRdpApplicationDestinationViaMcpServerPortalDestination(BaseModel): ] -class BrowserRdpApplicationPolicy(BaseModel): - id: Optional[str] = None - """The UUID of the policy""" +class BrowserRdpApplicationMfaConfig(BaseModel): + """Configures multi-factor authentication (MFA) settings.""" - approval_groups: Optional[List[ApprovalGroup]] = None - """Administrators who can approve a temporary authentication request.""" + allowed_authenticators: Optional[List[Literal["totp", "biometrics", "security_key"]]] = None + """Lists the MFA methods that users can authenticate with.""" - approval_required: Optional[bool] = None - """ - Requires the user to request access from an administrator at the start of each - session. - """ + mfa_bypass: Optional[bool] = None + """Indicates whether to bypass MFA for this resource. - created_at: Optional[datetime] = None + This option is available at the application and policy level. + """ - decision: Optional[Decision] = None - """The action Access will take if a user matches this policy. + session_duration: Optional[str] = None + """Defines the duration of an MFA session. - Infrastructure application policies can only use the Allow action. + Must be in minutes (m) or hours (h). Minimum: 0m. Maximum: 720h (30 days). + Examples:`5m` or `24h`. """ - exclude: Optional[List[AccessRule]] = None - """Rules evaluated with a NOT logical operator. - To match the policy, a user cannot meet any of the Exclude rules. - """ +class BrowserRdpApplicationOAuthConfigurationDynamicClientRegistration(BaseModel): + """Settings for OAuth dynamic client registration.""" - include: Optional[List[AccessRule]] = None - """Rules evaluated with an OR logical operator. + allow_any_on_localhost: Optional[bool] = None + """Allows any client with redirect URIs on localhost.""" - A user needs to meet only one of the Include rules. + allow_any_on_loopback: Optional[bool] = None + """Allows any client with redirect URIs on 127.0.0.1.""" + + allowed_uris: Optional[List[str]] = None + """The URIs that are allowed as redirect URIs for dynamically registered clients. + + Must use the `https` protocol. Paths may end in `/*` to match all sub-paths. + """ + + enabled: Optional[bool] = None + """Whether dynamic client registration is enabled.""" + + +class BrowserRdpApplicationOAuthConfigurationGrant(BaseModel): + """Settings for OAuth grant behavior.""" + + access_token_lifetime: Optional[str] = None + """The lifetime of the access token. + + Must be in the format `300ms` or `2h45m`. Valid time units are ns, us (or µs), + ms, s, m, h. + """ + + session_duration: Optional[str] = None + """The duration of the OAuth session. + + Must be in the format `300ms` or `2h45m`. Valid time units are ns, us (or µs), + ms, s, m, h. + """ + + +class BrowserRdpApplicationOAuthConfiguration(BaseModel): + """ + **Beta:** Optional configuration for managing an OAuth authorization flow controlled by Access. When set, Access will act as the OAuth authorization server for this application. Only compatible with OAuth clients that support [RFC 8707](https://datatracker.ietf.org/doc/html/rfc8707) (Resource Indicators for OAuth 2.0). This feature is currently in beta. + """ + + dynamic_client_registration: Optional[BrowserRdpApplicationOAuthConfigurationDynamicClientRegistration] = None + """Settings for OAuth dynamic client registration.""" + + enabled: Optional[bool] = None + """Whether the OAuth configuration is enabled for this application. + + When set to `false`, Access will not handle OAuth for this application. Defaults + to `true` if omitted. + """ + + grant: Optional[BrowserRdpApplicationOAuthConfigurationGrant] = None + """Settings for OAuth grant behavior.""" + + +class BrowserRdpApplicationPolicyMfaConfig(BaseModel): + """Configures multi-factor authentication (MFA) settings.""" + + allowed_authenticators: Optional[List[Literal["totp", "biometrics", "security_key"]]] = None + """Lists the MFA methods that users can authenticate with.""" + + mfa_bypass: Optional[bool] = None + """Indicates whether to bypass MFA for this resource. + + This option is available at the application and policy level. + """ + + session_duration: Optional[str] = None + """Defines the duration of an MFA session. + + Must be in minutes (m) or hours (h). Minimum: 0m. Maximum: 720h (30 days). + Examples:`5m` or `24h`. + """ + + +class BrowserRdpApplicationPolicy(BaseModel): + id: Optional[str] = None + """The UUID of the policy""" + + approval_groups: Optional[List[ApprovalGroup]] = None + """Administrators who can approve a temporary authentication request.""" + + approval_required: Optional[bool] = None + """ + Requires the user to request access from an administrator at the start of each + session. + """ + + created_at: Optional[datetime] = None + + decision: Optional[Decision] = None + """The action Access will take if a user matches this policy. + + Infrastructure application policies can only use the Allow action. + """ + + exclude: Optional[List[AccessRule]] = None + """Rules evaluated with a NOT logical operator. + + To match the policy, a user cannot meet any of the Exclude rules. + """ + + include: Optional[List[AccessRule]] = None + """Rules evaluated with an OR logical operator. + + A user needs to meet only one of the Include rules. """ isolation_required: Optional[bool] = None @@ -2424,6 +3047,9 @@ class BrowserRdpApplicationPolicy(BaseModel): this feature. """ + mfa_config: Optional[BrowserRdpApplicationPolicyMfaConfig] = None + """Configures multi-factor authentication (MFA) settings.""" + name: Optional[str] = None """The name of the Access policy.""" @@ -2645,9 +3271,21 @@ class BrowserRdpApplication(BaseModel): logo_url: Optional[str] = None """The image URL for the logo shown in the App Launcher dashboard.""" + mfa_config: Optional[BrowserRdpApplicationMfaConfig] = None + """Configures multi-factor authentication (MFA) settings.""" + name: Optional[str] = None """The name of the application.""" + oauth_configuration: Optional[BrowserRdpApplicationOAuthConfiguration] = None + """ + **Beta:** Optional configuration for managing an OAuth authorization flow + controlled by Access. When set, Access will act as the OAuth authorization + server for this application. Only compatible with OAuth clients that support + [RFC 8707](https://datatracker.ietf.org/doc/html/rfc8707) (Resource Indicators + for OAuth 2.0). This feature is currently in beta. + """ + options_preflight_bypass: Optional[bool] = None """ Allows options preflight requests to bypass Access authentication and go @@ -2721,6 +3359,860 @@ class BrowserRdpApplication(BaseModel): """ +class McpServerApplicationDestinationPublicDestination(BaseModel): + """A public hostname that Access will secure. + + Public destinations support sub-domain and path. Wildcard '*' can be used in the definition. + """ + + type: Optional[Literal["public"]] = None + + uri: Optional[str] = None + """The URI of the destination. + + Public destinations' URIs can include a domain and path with + [wildcards](https://developers.cloudflare.com/cloudflare-one/policies/access/app-paths/). + """ + + +class McpServerApplicationDestinationPrivateDestination(BaseModel): + cidr: Optional[str] = None + """The CIDR range of the destination. Single IPs will be computed as /32.""" + + hostname: Optional[str] = None + """The hostname of the destination. Matches a valid SNI served by an HTTPS origin.""" + + l4_protocol: Optional[Literal["tcp", "udp"]] = None + """The L4 protocol of the destination. + + When omitted, both UDP and TCP traffic will match. + """ + + port_range: Optional[str] = None + """The port range of the destination. + + Can be a single port or a range of ports. When omitted, all ports will match. + """ + + type: Optional[Literal["private"]] = None + + vnet_id: Optional[str] = None + """The VNET ID to match the destination. When omitted, all VNETs will match.""" + + +class McpServerApplicationDestinationViaMcpServerPortalDestination(BaseModel): + """A MCP server id configured in ai-controls. + + Access will secure the MCP server if accessed through a MCP portal. + """ + + mcp_server_id: Optional[str] = None + """The MCP server id configured in ai-controls.""" + + type: Optional[Literal["via_mcp_server_portal"]] = None + + +McpServerApplicationDestination: TypeAlias = Union[ + McpServerApplicationDestinationPublicDestination, + McpServerApplicationDestinationPrivateDestination, + McpServerApplicationDestinationViaMcpServerPortalDestination, +] + + +class McpServerApplicationOAuthConfigurationDynamicClientRegistration(BaseModel): + """Settings for OAuth dynamic client registration.""" + + allow_any_on_localhost: Optional[bool] = None + """Allows any client with redirect URIs on localhost.""" + + allow_any_on_loopback: Optional[bool] = None + """Allows any client with redirect URIs on 127.0.0.1.""" + + allowed_uris: Optional[List[str]] = None + """The URIs that are allowed as redirect URIs for dynamically registered clients. + + Must use the `https` protocol. Paths may end in `/*` to match all sub-paths. + """ + + enabled: Optional[bool] = None + """Whether dynamic client registration is enabled.""" + + +class McpServerApplicationOAuthConfigurationGrant(BaseModel): + """Settings for OAuth grant behavior.""" + + access_token_lifetime: Optional[str] = None + """The lifetime of the access token. + + Must be in the format `300ms` or `2h45m`. Valid time units are ns, us (or µs), + ms, s, m, h. + """ + + session_duration: Optional[str] = None + """The duration of the OAuth session. + + Must be in the format `300ms` or `2h45m`. Valid time units are ns, us (or µs), + ms, s, m, h. + """ + + +class McpServerApplicationOAuthConfiguration(BaseModel): + """ + **Beta:** Optional configuration for managing an OAuth authorization flow controlled by Access. When set, Access will act as the OAuth authorization server for this application. Only compatible with OAuth clients that support [RFC 8707](https://datatracker.ietf.org/doc/html/rfc8707) (Resource Indicators for OAuth 2.0). This feature is currently in beta. + """ + + dynamic_client_registration: Optional[McpServerApplicationOAuthConfigurationDynamicClientRegistration] = None + """Settings for OAuth dynamic client registration.""" + + enabled: Optional[bool] = None + """Whether the OAuth configuration is enabled for this application. + + When set to `false`, Access will not handle OAuth for this application. Defaults + to `true` if omitted. + """ + + grant: Optional[McpServerApplicationOAuthConfigurationGrant] = None + """Settings for OAuth grant behavior.""" + + +class McpServerApplicationPolicyMfaConfig(BaseModel): + """Configures multi-factor authentication (MFA) settings.""" + + allowed_authenticators: Optional[List[Literal["totp", "biometrics", "security_key"]]] = None + """Lists the MFA methods that users can authenticate with.""" + + mfa_bypass: Optional[bool] = None + """Indicates whether to bypass MFA for this resource. + + This option is available at the application and policy level. + """ + + session_duration: Optional[str] = None + """Defines the duration of an MFA session. + + Must be in minutes (m) or hours (h). Minimum: 0m. Maximum: 720h (30 days). + Examples:`5m` or `24h`. + """ + + +class McpServerApplicationPolicy(BaseModel): + id: Optional[str] = None + """The UUID of the policy""" + + approval_groups: Optional[List[ApprovalGroup]] = None + """Administrators who can approve a temporary authentication request.""" + + approval_required: Optional[bool] = None + """ + Requires the user to request access from an administrator at the start of each + session. + """ + + created_at: Optional[datetime] = None + + decision: Optional[Decision] = None + """The action Access will take if a user matches this policy. + + Infrastructure application policies can only use the Allow action. + """ + + exclude: Optional[List[AccessRule]] = None + """Rules evaluated with a NOT logical operator. + + To match the policy, a user cannot meet any of the Exclude rules. + """ + + include: Optional[List[AccessRule]] = None + """Rules evaluated with an OR logical operator. + + A user needs to meet only one of the Include rules. + """ + + isolation_required: Optional[bool] = None + """ + Require this application to be served in an isolated browser for users matching + this policy. 'Client Web Isolation' must be on for the account in order to use + this feature. + """ + + mfa_config: Optional[McpServerApplicationPolicyMfaConfig] = None + """Configures multi-factor authentication (MFA) settings.""" + + name: Optional[str] = None + """The name of the Access policy.""" + + precedence: Optional[int] = None + """The order of execution for this policy. + + Must be unique for each policy within an app. + """ + + purpose_justification_prompt: Optional[str] = None + """A custom message that will appear on the purpose justification screen.""" + + purpose_justification_required: Optional[bool] = None + """Require users to enter a justification when they log in to the application.""" + + require: Optional[List[AccessRule]] = None + """Rules evaluated with an AND logical operator. + + To match the policy, a user must meet all of the Require rules. + """ + + session_duration: Optional[str] = None + """The amount of time that tokens issued for the application will be valid. + + Must be in the format `300ms` or `2h45m`. Valid time units are: ns, us (or µs), + ms, s, m, h. + """ + + updated_at: Optional[datetime] = None + + +class McpServerApplicationSCIMConfigAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken(BaseModel): + """ + Attributes for configuring Access Service Token authentication scheme for SCIM provisioning to an application. + """ + + client_id: str + """ + Client ID of the Access service token used to authenticate with the remote + service. + """ + + client_secret: str + """ + Client secret of the Access service token used to authenticate with the remote + service. + """ + + scheme: Literal["access_service_token"] + """The authentication scheme to use when making SCIM requests to this application.""" + + +class McpServerApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken( + BaseModel +): + """ + Attributes for configuring Access Service Token authentication scheme for SCIM provisioning to an application. + """ + + client_id: str + """ + Client ID of the Access service token used to authenticate with the remote + service. + """ + + client_secret: str + """ + Client secret of the Access service token used to authenticate with the remote + service. + """ + + scheme: Literal["access_service_token"] + """The authentication scheme to use when making SCIM requests to this application.""" + + +McpServerApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthentication: TypeAlias = Union[ + SCIMConfigAuthenticationHTTPBasic, + SCIMConfigAuthenticationOAuthBearerToken, + SCIMConfigAuthenticationOauth2, + McpServerApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken, +] + +McpServerApplicationSCIMConfigAuthentication: TypeAlias = Union[ + SCIMConfigAuthenticationHTTPBasic, + SCIMConfigAuthenticationOAuthBearerToken, + SCIMConfigAuthenticationOauth2, + McpServerApplicationSCIMConfigAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken, + List[McpServerApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthentication], +] + + +class McpServerApplicationSCIMConfig(BaseModel): + """Configuration for provisioning to this application via SCIM. + + This is currently in closed beta. + """ + + idp_uid: str + """ + The UID of the IdP to use as the source for SCIM resources to provision to this + application. + """ + + remote_uri: str + """The base URI for the application's SCIM-compatible API.""" + + authentication: Optional[McpServerApplicationSCIMConfigAuthentication] = None + """ + Attributes for configuring HTTP Basic authentication scheme for SCIM + provisioning to an application. + """ + + deactivate_on_delete: Optional[bool] = None + """ + If false, propagates DELETE requests to the target application for SCIM + resources. If true, sets 'active' to false on the SCIM resource. Note: Some + targets do not support DELETE operations. + """ + + enabled: Optional[bool] = None + """Whether SCIM provisioning is turned on for this application.""" + + mappings: Optional[List[SCIMConfigMapping]] = None + """ + A list of mappings to apply to SCIM resources before provisioning them in this + application. These can transform or filter the resources to be provisioned. + """ + + +class McpServerApplication(BaseModel): + type: ApplicationType + """The application type.""" + + id: Optional[str] = None + """UUID.""" + + allow_authenticate_via_warp: Optional[bool] = None + """ + When set to true, users can authenticate to this application using their WARP + session. When set to false this application will always require direct IdP + authentication. This setting always overrides the organization setting for WARP + authentication. + """ + + allowed_idps: Optional[List[AllowedIdPs]] = None + """The identity providers your users can select when connecting to this + application. + + Defaults to all IdPs configured in your account. + """ + + aud: Optional[str] = None + """Audience tag.""" + + auto_redirect_to_identity: Optional[bool] = None + """When set to `true`, users skip the identity provider selection step during + login. + + You must specify only one identity provider in allowed_idps. + """ + + custom_deny_message: Optional[str] = None + """ + The custom error message shown to a user when they are denied access to the + application. + """ + + custom_deny_url: Optional[str] = None + """ + The custom URL a user is redirected to when they are denied access to the + application when failing identity-based rules. + """ + + custom_non_identity_deny_url: Optional[str] = None + """ + The custom URL a user is redirected to when they are denied access to the + application when failing non-identity rules. + """ + + custom_pages: Optional[List[str]] = None + """The custom pages that will be displayed when applicable for this application""" + + destinations: Optional[List[McpServerApplicationDestination]] = None + """List of destinations secured by Access. + + This supersedes `self_hosted_domains` to allow for more flexibility in defining + different types of domains. If `destinations` are provided, then + `self_hosted_domains` will be ignored. + """ + + http_only_cookie_attribute: Optional[bool] = None + """ + Enables the HttpOnly cookie attribute, which increases security against XSS + attacks. + """ + + logo_url: Optional[str] = None + """The image URL for the logo shown in the App Launcher dashboard.""" + + name: Optional[str] = None + """The name of the application.""" + + oauth_configuration: Optional[McpServerApplicationOAuthConfiguration] = None + """ + **Beta:** Optional configuration for managing an OAuth authorization flow + controlled by Access. When set, Access will act as the OAuth authorization + server for this application. Only compatible with OAuth clients that support + [RFC 8707](https://datatracker.ietf.org/doc/html/rfc8707) (Resource Indicators + for OAuth 2.0). This feature is currently in beta. + """ + + options_preflight_bypass: Optional[bool] = None + """ + Allows options preflight requests to bypass Access authentication and go + directly to the origin. Cannot turn on if cors_headers is set. + """ + + policies: Optional[List[McpServerApplicationPolicy]] = None + + same_site_cookie_attribute: Optional[str] = None + """ + Sets the SameSite cookie setting, which provides increased security against CSRF + attacks. + """ + + scim_config: Optional[McpServerApplicationSCIMConfig] = None + """Configuration for provisioning to this application via SCIM. + + This is currently in closed beta. + """ + + session_duration: Optional[str] = None + """The amount of time that tokens issued for this application will be valid. + + Must be in the format `300ms` or `2h45m`. Valid time units are: ns, us (or µs), + ms, s, m, h. Note: unsupported for infrastructure type applications. + """ + + tags: Optional[List[str]] = None + """The tags you want assigned to an application. + + Tags are used to filter applications in the App Launcher dashboard. + """ + + +class McpServerPortalApplicationDestinationPublicDestination(BaseModel): + """A public hostname that Access will secure. + + Public destinations support sub-domain and path. Wildcard '*' can be used in the definition. + """ + + type: Optional[Literal["public"]] = None + + uri: Optional[str] = None + """The URI of the destination. + + Public destinations' URIs can include a domain and path with + [wildcards](https://developers.cloudflare.com/cloudflare-one/policies/access/app-paths/). + """ + + +class McpServerPortalApplicationDestinationPrivateDestination(BaseModel): + cidr: Optional[str] = None + """The CIDR range of the destination. Single IPs will be computed as /32.""" + + hostname: Optional[str] = None + """The hostname of the destination. Matches a valid SNI served by an HTTPS origin.""" + + l4_protocol: Optional[Literal["tcp", "udp"]] = None + """The L4 protocol of the destination. + + When omitted, both UDP and TCP traffic will match. + """ + + port_range: Optional[str] = None + """The port range of the destination. + + Can be a single port or a range of ports. When omitted, all ports will match. + """ + + type: Optional[Literal["private"]] = None + + vnet_id: Optional[str] = None + """The VNET ID to match the destination. When omitted, all VNETs will match.""" + + +class McpServerPortalApplicationDestinationViaMcpServerPortalDestination(BaseModel): + """A MCP server id configured in ai-controls. + + Access will secure the MCP server if accessed through a MCP portal. + """ + + mcp_server_id: Optional[str] = None + """The MCP server id configured in ai-controls.""" + + type: Optional[Literal["via_mcp_server_portal"]] = None + + +McpServerPortalApplicationDestination: TypeAlias = Union[ + McpServerPortalApplicationDestinationPublicDestination, + McpServerPortalApplicationDestinationPrivateDestination, + McpServerPortalApplicationDestinationViaMcpServerPortalDestination, +] + + +class McpServerPortalApplicationOAuthConfigurationDynamicClientRegistration(BaseModel): + """Settings for OAuth dynamic client registration.""" + + allow_any_on_localhost: Optional[bool] = None + """Allows any client with redirect URIs on localhost.""" + + allow_any_on_loopback: Optional[bool] = None + """Allows any client with redirect URIs on 127.0.0.1.""" + + allowed_uris: Optional[List[str]] = None + """The URIs that are allowed as redirect URIs for dynamically registered clients. + + Must use the `https` protocol. Paths may end in `/*` to match all sub-paths. + """ + + enabled: Optional[bool] = None + """Whether dynamic client registration is enabled.""" + + +class McpServerPortalApplicationOAuthConfigurationGrant(BaseModel): + """Settings for OAuth grant behavior.""" + + access_token_lifetime: Optional[str] = None + """The lifetime of the access token. + + Must be in the format `300ms` or `2h45m`. Valid time units are ns, us (or µs), + ms, s, m, h. + """ + + session_duration: Optional[str] = None + """The duration of the OAuth session. + + Must be in the format `300ms` or `2h45m`. Valid time units are ns, us (or µs), + ms, s, m, h. + """ + + +class McpServerPortalApplicationOAuthConfiguration(BaseModel): + """ + **Beta:** Optional configuration for managing an OAuth authorization flow controlled by Access. When set, Access will act as the OAuth authorization server for this application. Only compatible with OAuth clients that support [RFC 8707](https://datatracker.ietf.org/doc/html/rfc8707) (Resource Indicators for OAuth 2.0). This feature is currently in beta. + """ + + dynamic_client_registration: Optional[McpServerPortalApplicationOAuthConfigurationDynamicClientRegistration] = None + """Settings for OAuth dynamic client registration.""" + + enabled: Optional[bool] = None + """Whether the OAuth configuration is enabled for this application. + + When set to `false`, Access will not handle OAuth for this application. Defaults + to `true` if omitted. + """ + + grant: Optional[McpServerPortalApplicationOAuthConfigurationGrant] = None + """Settings for OAuth grant behavior.""" + + +class McpServerPortalApplicationPolicyMfaConfig(BaseModel): + """Configures multi-factor authentication (MFA) settings.""" + + allowed_authenticators: Optional[List[Literal["totp", "biometrics", "security_key"]]] = None + """Lists the MFA methods that users can authenticate with.""" + + mfa_bypass: Optional[bool] = None + """Indicates whether to bypass MFA for this resource. + + This option is available at the application and policy level. + """ + + session_duration: Optional[str] = None + """Defines the duration of an MFA session. + + Must be in minutes (m) or hours (h). Minimum: 0m. Maximum: 720h (30 days). + Examples:`5m` or `24h`. + """ + + +class McpServerPortalApplicationPolicy(BaseModel): + id: Optional[str] = None + """The UUID of the policy""" + + approval_groups: Optional[List[ApprovalGroup]] = None + """Administrators who can approve a temporary authentication request.""" + + approval_required: Optional[bool] = None + """ + Requires the user to request access from an administrator at the start of each + session. + """ + + created_at: Optional[datetime] = None + + decision: Optional[Decision] = None + """The action Access will take if a user matches this policy. + + Infrastructure application policies can only use the Allow action. + """ + + exclude: Optional[List[AccessRule]] = None + """Rules evaluated with a NOT logical operator. + + To match the policy, a user cannot meet any of the Exclude rules. + """ + + include: Optional[List[AccessRule]] = None + """Rules evaluated with an OR logical operator. + + A user needs to meet only one of the Include rules. + """ + + isolation_required: Optional[bool] = None + """ + Require this application to be served in an isolated browser for users matching + this policy. 'Client Web Isolation' must be on for the account in order to use + this feature. + """ + + mfa_config: Optional[McpServerPortalApplicationPolicyMfaConfig] = None + """Configures multi-factor authentication (MFA) settings.""" + + name: Optional[str] = None + """The name of the Access policy.""" + + precedence: Optional[int] = None + """The order of execution for this policy. + + Must be unique for each policy within an app. + """ + + purpose_justification_prompt: Optional[str] = None + """A custom message that will appear on the purpose justification screen.""" + + purpose_justification_required: Optional[bool] = None + """Require users to enter a justification when they log in to the application.""" + + require: Optional[List[AccessRule]] = None + """Rules evaluated with an AND logical operator. + + To match the policy, a user must meet all of the Require rules. + """ + + session_duration: Optional[str] = None + """The amount of time that tokens issued for the application will be valid. + + Must be in the format `300ms` or `2h45m`. Valid time units are: ns, us (or µs), + ms, s, m, h. + """ + + updated_at: Optional[datetime] = None + + +class McpServerPortalApplicationSCIMConfigAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken(BaseModel): + """ + Attributes for configuring Access Service Token authentication scheme for SCIM provisioning to an application. + """ + + client_id: str + """ + Client ID of the Access service token used to authenticate with the remote + service. + """ + + client_secret: str + """ + Client secret of the Access service token used to authenticate with the remote + service. + """ + + scheme: Literal["access_service_token"] + """The authentication scheme to use when making SCIM requests to this application.""" + + +class McpServerPortalApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken( + BaseModel +): + """ + Attributes for configuring Access Service Token authentication scheme for SCIM provisioning to an application. + """ + + client_id: str + """ + Client ID of the Access service token used to authenticate with the remote + service. + """ + + client_secret: str + """ + Client secret of the Access service token used to authenticate with the remote + service. + """ + + scheme: Literal["access_service_token"] + """The authentication scheme to use when making SCIM requests to this application.""" + + +McpServerPortalApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthentication: TypeAlias = Union[ + SCIMConfigAuthenticationHTTPBasic, + SCIMConfigAuthenticationOAuthBearerToken, + SCIMConfigAuthenticationOauth2, + McpServerPortalApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken, +] + +McpServerPortalApplicationSCIMConfigAuthentication: TypeAlias = Union[ + SCIMConfigAuthenticationHTTPBasic, + SCIMConfigAuthenticationOAuthBearerToken, + SCIMConfigAuthenticationOauth2, + McpServerPortalApplicationSCIMConfigAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken, + List[McpServerPortalApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthentication], +] + + +class McpServerPortalApplicationSCIMConfig(BaseModel): + """Configuration for provisioning to this application via SCIM. + + This is currently in closed beta. + """ + + idp_uid: str + """ + The UID of the IdP to use as the source for SCIM resources to provision to this + application. + """ + + remote_uri: str + """The base URI for the application's SCIM-compatible API.""" + + authentication: Optional[McpServerPortalApplicationSCIMConfigAuthentication] = None + """ + Attributes for configuring HTTP Basic authentication scheme for SCIM + provisioning to an application. + """ + + deactivate_on_delete: Optional[bool] = None + """ + If false, propagates DELETE requests to the target application for SCIM + resources. If true, sets 'active' to false on the SCIM resource. Note: Some + targets do not support DELETE operations. + """ + + enabled: Optional[bool] = None + """Whether SCIM provisioning is turned on for this application.""" + + mappings: Optional[List[SCIMConfigMapping]] = None + """ + A list of mappings to apply to SCIM resources before provisioning them in this + application. These can transform or filter the resources to be provisioned. + """ + + +class McpServerPortalApplication(BaseModel): + type: ApplicationType + """The application type.""" + + id: Optional[str] = None + """UUID.""" + + allow_authenticate_via_warp: Optional[bool] = None + """ + When set to true, users can authenticate to this application using their WARP + session. When set to false this application will always require direct IdP + authentication. This setting always overrides the organization setting for WARP + authentication. + """ + + allowed_idps: Optional[List[AllowedIdPs]] = None + """The identity providers your users can select when connecting to this + application. + + Defaults to all IdPs configured in your account. + """ + + aud: Optional[str] = None + """Audience tag.""" + + auto_redirect_to_identity: Optional[bool] = None + """When set to `true`, users skip the identity provider selection step during + login. + + You must specify only one identity provider in allowed_idps. + """ + + custom_deny_message: Optional[str] = None + """ + The custom error message shown to a user when they are denied access to the + application. + """ + + custom_deny_url: Optional[str] = None + """ + The custom URL a user is redirected to when they are denied access to the + application when failing identity-based rules. + """ + + custom_non_identity_deny_url: Optional[str] = None + """ + The custom URL a user is redirected to when they are denied access to the + application when failing non-identity rules. + """ + + custom_pages: Optional[List[str]] = None + """The custom pages that will be displayed when applicable for this application""" + + destinations: Optional[List[McpServerPortalApplicationDestination]] = None + """List of destinations secured by Access. + + This supersedes `self_hosted_domains` to allow for more flexibility in defining + different types of domains. If `destinations` are provided, then + `self_hosted_domains` will be ignored. + """ + + domain: Optional[str] = None + """The primary hostname and path secured by Access. + + This domain will be displayed if the app is visible in the App Launcher. + """ + + http_only_cookie_attribute: Optional[bool] = None + """ + Enables the HttpOnly cookie attribute, which increases security against XSS + attacks. + """ + + logo_url: Optional[str] = None + """The image URL for the logo shown in the App Launcher dashboard.""" + + name: Optional[str] = None + """The name of the application.""" + + oauth_configuration: Optional[McpServerPortalApplicationOAuthConfiguration] = None + """ + **Beta:** Optional configuration for managing an OAuth authorization flow + controlled by Access. When set, Access will act as the OAuth authorization + server for this application. Only compatible with OAuth clients that support + [RFC 8707](https://datatracker.ietf.org/doc/html/rfc8707) (Resource Indicators + for OAuth 2.0). This feature is currently in beta. + """ + + options_preflight_bypass: Optional[bool] = None + """ + Allows options preflight requests to bypass Access authentication and go + directly to the origin. Cannot turn on if cors_headers is set. + """ + + policies: Optional[List[McpServerPortalApplicationPolicy]] = None + + same_site_cookie_attribute: Optional[str] = None + """ + Sets the SameSite cookie setting, which provides increased security against CSRF + attacks. + """ + + scim_config: Optional[McpServerPortalApplicationSCIMConfig] = None + """Configuration for provisioning to this application via SCIM. + + This is currently in closed beta. + """ + + session_duration: Optional[str] = None + """The amount of time that tokens issued for this application will be valid. + + Must be in the format `300ms` or `2h45m`. Valid time units are: ns, us (or µs), + ms, s, m, h. Note: unsupported for infrastructure type applications. + """ + + tags: Optional[List[str]] = None + """The tags you want assigned to an application. + + Tags are used to filter applications in the App Launcher dashboard. + """ + + ApplicationUpdateResponse: TypeAlias = Union[ SelfHostedApplication, SaaSApplication, @@ -2733,4 +4225,6 @@ class BrowserRdpApplication(BaseModel): BookmarkApplication, InfrastructureApplication, BrowserRdpApplication, + McpServerApplication, + McpServerPortalApplication, ] diff --git a/src/cloudflare/types/zero_trust/access/applications/policy_create_params.py b/src/cloudflare/types/zero_trust/access/applications/policy_create_params.py index cce9bcc3c24..d75b1668c7d 100644 --- a/src/cloudflare/types/zero_trust/access/applications/policy_create_params.py +++ b/src/cloudflare/types/zero_trust/access/applications/policy_create_params.py @@ -2,12 +2,12 @@ from __future__ import annotations -from typing import Iterable -from typing_extensions import TypedDict +from typing import List, Iterable +from typing_extensions import Literal, TypedDict from ..approval_group_param import ApprovalGroupParam -__all__ = ["PolicyCreateParams"] +__all__ = ["PolicyCreateParams", "MfaConfig"] class PolicyCreateParams(TypedDict, total=False): @@ -33,6 +33,9 @@ class PolicyCreateParams(TypedDict, total=False): this feature. """ + mfa_config: MfaConfig + """Configures multi-factor authentication (MFA) settings.""" + precedence: int """The order of execution for this policy. @@ -51,3 +54,23 @@ class PolicyCreateParams(TypedDict, total=False): Must be in the format `300ms` or `2h45m`. Valid time units are: ns, us (or µs), ms, s, m, h. """ + + +class MfaConfig(TypedDict, total=False): + """Configures multi-factor authentication (MFA) settings.""" + + allowed_authenticators: List[Literal["totp", "biometrics", "security_key"]] + """Lists the MFA methods that users can authenticate with.""" + + mfa_bypass: bool + """Indicates whether to bypass MFA for this resource. + + This option is available at the application and policy level. + """ + + session_duration: str + """Defines the duration of an MFA session. + + Must be in minutes (m) or hours (h). Minimum: 0m. Maximum: 720h (30 days). + Examples:`5m` or `24h`. + """ diff --git a/src/cloudflare/types/zero_trust/access/applications/policy_create_response.py b/src/cloudflare/types/zero_trust/access/applications/policy_create_response.py index d96df3960f3..dd3818d5412 100644 --- a/src/cloudflare/types/zero_trust/access/applications/policy_create_response.py +++ b/src/cloudflare/types/zero_trust/access/applications/policy_create_response.py @@ -2,13 +2,34 @@ from typing import List, Optional from datetime import datetime +from typing_extensions import Literal from ..decision import Decision from ....._models import BaseModel from .access_rule import AccessRule from ..approval_group import ApprovalGroup -__all__ = ["PolicyCreateResponse"] +__all__ = ["PolicyCreateResponse", "MfaConfig"] + + +class MfaConfig(BaseModel): + """Configures multi-factor authentication (MFA) settings.""" + + allowed_authenticators: Optional[List[Literal["totp", "biometrics", "security_key"]]] = None + """Lists the MFA methods that users can authenticate with.""" + + mfa_bypass: Optional[bool] = None + """Indicates whether to bypass MFA for this resource. + + This option is available at the application and policy level. + """ + + session_duration: Optional[str] = None + """Defines the duration of an MFA session. + + Must be in minutes (m) or hours (h). Minimum: 0m. Maximum: 720h (30 days). + Examples:`5m` or `24h`. + """ class PolicyCreateResponse(BaseModel): @@ -51,6 +72,9 @@ class PolicyCreateResponse(BaseModel): this feature. """ + mfa_config: Optional[MfaConfig] = None + """Configures multi-factor authentication (MFA) settings.""" + name: Optional[str] = None """The name of the Access policy.""" diff --git a/src/cloudflare/types/zero_trust/access/applications/policy_get_response.py b/src/cloudflare/types/zero_trust/access/applications/policy_get_response.py index 7b27ed567d0..79b73f9a288 100644 --- a/src/cloudflare/types/zero_trust/access/applications/policy_get_response.py +++ b/src/cloudflare/types/zero_trust/access/applications/policy_get_response.py @@ -2,13 +2,34 @@ from typing import List, Optional from datetime import datetime +from typing_extensions import Literal from ..decision import Decision from ....._models import BaseModel from .access_rule import AccessRule from ..approval_group import ApprovalGroup -__all__ = ["PolicyGetResponse"] +__all__ = ["PolicyGetResponse", "MfaConfig"] + + +class MfaConfig(BaseModel): + """Configures multi-factor authentication (MFA) settings.""" + + allowed_authenticators: Optional[List[Literal["totp", "biometrics", "security_key"]]] = None + """Lists the MFA methods that users can authenticate with.""" + + mfa_bypass: Optional[bool] = None + """Indicates whether to bypass MFA for this resource. + + This option is available at the application and policy level. + """ + + session_duration: Optional[str] = None + """Defines the duration of an MFA session. + + Must be in minutes (m) or hours (h). Minimum: 0m. Maximum: 720h (30 days). + Examples:`5m` or `24h`. + """ class PolicyGetResponse(BaseModel): @@ -51,6 +72,9 @@ class PolicyGetResponse(BaseModel): this feature. """ + mfa_config: Optional[MfaConfig] = None + """Configures multi-factor authentication (MFA) settings.""" + name: Optional[str] = None """The name of the Access policy.""" diff --git a/src/cloudflare/types/zero_trust/access/applications/policy_list_response.py b/src/cloudflare/types/zero_trust/access/applications/policy_list_response.py index 1ff32096707..07e57c0935d 100644 --- a/src/cloudflare/types/zero_trust/access/applications/policy_list_response.py +++ b/src/cloudflare/types/zero_trust/access/applications/policy_list_response.py @@ -2,13 +2,34 @@ from typing import List, Optional from datetime import datetime +from typing_extensions import Literal from ..decision import Decision from ....._models import BaseModel from .access_rule import AccessRule from ..approval_group import ApprovalGroup -__all__ = ["PolicyListResponse"] +__all__ = ["PolicyListResponse", "MfaConfig"] + + +class MfaConfig(BaseModel): + """Configures multi-factor authentication (MFA) settings.""" + + allowed_authenticators: Optional[List[Literal["totp", "biometrics", "security_key"]]] = None + """Lists the MFA methods that users can authenticate with.""" + + mfa_bypass: Optional[bool] = None + """Indicates whether to bypass MFA for this resource. + + This option is available at the application and policy level. + """ + + session_duration: Optional[str] = None + """Defines the duration of an MFA session. + + Must be in minutes (m) or hours (h). Minimum: 0m. Maximum: 720h (30 days). + Examples:`5m` or `24h`. + """ class PolicyListResponse(BaseModel): @@ -51,6 +72,9 @@ class PolicyListResponse(BaseModel): this feature. """ + mfa_config: Optional[MfaConfig] = None + """Configures multi-factor authentication (MFA) settings.""" + name: Optional[str] = None """The name of the Access policy.""" 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 index 48bcd3e185d..724856aaa0a 100755 --- 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 @@ -2,15 +2,15 @@ from __future__ import annotations -from typing import Union, Iterable -from typing_extensions import Required, TypeAlias, TypedDict +from typing import List, Union, Iterable +from typing_extensions import Literal, Required, TypeAlias, TypedDict from ..decision import Decision from ....._types import SequenceNotStr from .access_rule_param import AccessRuleParam from ..approval_group_param import ApprovalGroupParam -__all__ = ["PolicyTestCreateParams", "Policy", "PolicyUnionMember0"] +__all__ = ["PolicyTestCreateParams", "Policy", "PolicyUnionMember0", "PolicyUnionMember0MfaConfig"] class PolicyTestCreateParams(TypedDict, total=False): @@ -20,6 +20,26 @@ class PolicyTestCreateParams(TypedDict, total=False): policies: SequenceNotStr[Policy] +class PolicyUnionMember0MfaConfig(TypedDict, total=False): + """Configures multi-factor authentication (MFA) settings.""" + + allowed_authenticators: List[Literal["totp", "biometrics", "security_key"]] + """Lists the MFA methods that users can authenticate with.""" + + mfa_bypass: bool + """Indicates whether to bypass MFA for this resource. + + This option is available at the application and policy level. + """ + + session_duration: str + """Defines the duration of an MFA session. + + Must be in minutes (m) or hours (h). Minimum: 0m. Maximum: 720h (30 days). + Examples:`5m` or `24h`. + """ + + class PolicyUnionMember0(TypedDict, total=False): decision: Required[Decision] """The action Access will take if a user matches this policy. @@ -58,6 +78,9 @@ class PolicyUnionMember0(TypedDict, total=False): this feature. """ + mfa_config: PolicyUnionMember0MfaConfig + """Configures multi-factor authentication (MFA) settings.""" + purpose_justification_prompt: str """A custom message that will appear on the purpose justification screen.""" diff --git a/src/cloudflare/types/zero_trust/access/applications/policy_update_params.py b/src/cloudflare/types/zero_trust/access/applications/policy_update_params.py index 20e48498060..ece38efad60 100644 --- a/src/cloudflare/types/zero_trust/access/applications/policy_update_params.py +++ b/src/cloudflare/types/zero_trust/access/applications/policy_update_params.py @@ -2,12 +2,12 @@ from __future__ import annotations -from typing import Iterable -from typing_extensions import Required, TypedDict +from typing import List, Iterable +from typing_extensions import Literal, Required, TypedDict from ..approval_group_param import ApprovalGroupParam -__all__ = ["PolicyUpdateParams"] +__all__ = ["PolicyUpdateParams", "MfaConfig"] class PolicyUpdateParams(TypedDict, total=False): @@ -36,6 +36,9 @@ class PolicyUpdateParams(TypedDict, total=False): this feature. """ + mfa_config: MfaConfig + """Configures multi-factor authentication (MFA) settings.""" + precedence: int """The order of execution for this policy. @@ -54,3 +57,23 @@ class PolicyUpdateParams(TypedDict, total=False): Must be in the format `300ms` or `2h45m`. Valid time units are: ns, us (or µs), ms, s, m, h. """ + + +class MfaConfig(TypedDict, total=False): + """Configures multi-factor authentication (MFA) settings.""" + + allowed_authenticators: List[Literal["totp", "biometrics", "security_key"]] + """Lists the MFA methods that users can authenticate with.""" + + mfa_bypass: bool + """Indicates whether to bypass MFA for this resource. + + This option is available at the application and policy level. + """ + + session_duration: str + """Defines the duration of an MFA session. + + Must be in minutes (m) or hours (h). Minimum: 0m. Maximum: 720h (30 days). + Examples:`5m` or `24h`. + """ diff --git a/src/cloudflare/types/zero_trust/access/applications/policy_update_response.py b/src/cloudflare/types/zero_trust/access/applications/policy_update_response.py index 1956319b54e..badcb18099f 100644 --- a/src/cloudflare/types/zero_trust/access/applications/policy_update_response.py +++ b/src/cloudflare/types/zero_trust/access/applications/policy_update_response.py @@ -2,13 +2,34 @@ from typing import List, Optional from datetime import datetime +from typing_extensions import Literal from ..decision import Decision from ....._models import BaseModel from .access_rule import AccessRule from ..approval_group import ApprovalGroup -__all__ = ["PolicyUpdateResponse"] +__all__ = ["PolicyUpdateResponse", "MfaConfig"] + + +class MfaConfig(BaseModel): + """Configures multi-factor authentication (MFA) settings.""" + + allowed_authenticators: Optional[List[Literal["totp", "biometrics", "security_key"]]] = None + """Lists the MFA methods that users can authenticate with.""" + + mfa_bypass: Optional[bool] = None + """Indicates whether to bypass MFA for this resource. + + This option is available at the application and policy level. + """ + + session_duration: Optional[str] = None + """Defines the duration of an MFA session. + + Must be in minutes (m) or hours (h). Minimum: 0m. Maximum: 720h (30 days). + Examples:`5m` or `24h`. + """ class PolicyUpdateResponse(BaseModel): @@ -51,6 +72,9 @@ class PolicyUpdateResponse(BaseModel): this feature. """ + mfa_config: Optional[MfaConfig] = None + """Configures multi-factor authentication (MFA) settings.""" + name: Optional[str] = None """The name of the Access policy.""" diff --git a/src/cloudflare/types/zero_trust/access/policy_create_params.py b/src/cloudflare/types/zero_trust/access/policy_create_params.py index abeceb70ae1..df7b8508c36 100644 --- a/src/cloudflare/types/zero_trust/access/policy_create_params.py +++ b/src/cloudflare/types/zero_trust/access/policy_create_params.py @@ -2,14 +2,14 @@ from __future__ import annotations -from typing import Iterable -from typing_extensions import Required, TypedDict +from typing import List, Iterable +from typing_extensions import Literal, Required, TypedDict from .decision import Decision from .approval_group_param import ApprovalGroupParam from .applications.access_rule_param import AccessRuleParam -__all__ = ["PolicyCreateParams"] +__all__ = ["PolicyCreateParams", "MfaConfig"] class PolicyCreateParams(TypedDict, total=False): @@ -53,6 +53,9 @@ class PolicyCreateParams(TypedDict, total=False): this feature. """ + mfa_config: MfaConfig + """Configures multi-factor authentication (MFA) settings.""" + purpose_justification_prompt: str """A custom message that will appear on the purpose justification screen.""" @@ -71,3 +74,23 @@ class PolicyCreateParams(TypedDict, total=False): Must be in the format `300ms` or `2h45m`. Valid time units are: ns, us (or µs), ms, s, m, h. """ + + +class MfaConfig(TypedDict, total=False): + """Configures multi-factor authentication (MFA) settings.""" + + allowed_authenticators: List[Literal["totp", "biometrics", "security_key"]] + """Lists the MFA methods that users can authenticate with.""" + + mfa_bypass: bool + """Indicates whether to bypass MFA for this resource. + + This option is available at the application and policy level. + """ + + session_duration: str + """Defines the duration of an MFA session. + + Must be in minutes (m) or hours (h). Minimum: 0m. Maximum: 720h (30 days). + Examples:`5m` or `24h`. + """ diff --git a/src/cloudflare/types/zero_trust/access/policy_create_response.py b/src/cloudflare/types/zero_trust/access/policy_create_response.py index 0b3aed6220d..b1a2325644d 100644 --- a/src/cloudflare/types/zero_trust/access/policy_create_response.py +++ b/src/cloudflare/types/zero_trust/access/policy_create_response.py @@ -9,7 +9,27 @@ from .approval_group import ApprovalGroup from .applications.access_rule import AccessRule -__all__ = ["PolicyCreateResponse"] +__all__ = ["PolicyCreateResponse", "MfaConfig"] + + +class MfaConfig(BaseModel): + """Configures multi-factor authentication (MFA) settings.""" + + allowed_authenticators: Optional[List[Literal["totp", "biometrics", "security_key"]]] = None + """Lists the MFA methods that users can authenticate with.""" + + mfa_bypass: Optional[bool] = None + """Indicates whether to bypass MFA for this resource. + + This option is available at the application and policy level. + """ + + session_duration: Optional[str] = None + """Defines the duration of an MFA session. + + Must be in minutes (m) or hours (h). Minimum: 0m. Maximum: 720h (30 days). + Examples:`5m` or `24h`. + """ class PolicyCreateResponse(BaseModel): @@ -55,6 +75,9 @@ class PolicyCreateResponse(BaseModel): this feature. """ + mfa_config: Optional[MfaConfig] = None + """Configures multi-factor authentication (MFA) settings.""" + name: Optional[str] = None """The name of the Access policy.""" diff --git a/src/cloudflare/types/zero_trust/access/policy_get_response.py b/src/cloudflare/types/zero_trust/access/policy_get_response.py index 0c51e5cca00..4a481e35b91 100644 --- a/src/cloudflare/types/zero_trust/access/policy_get_response.py +++ b/src/cloudflare/types/zero_trust/access/policy_get_response.py @@ -9,7 +9,27 @@ from .approval_group import ApprovalGroup from .applications.access_rule import AccessRule -__all__ = ["PolicyGetResponse"] +__all__ = ["PolicyGetResponse", "MfaConfig"] + + +class MfaConfig(BaseModel): + """Configures multi-factor authentication (MFA) settings.""" + + allowed_authenticators: Optional[List[Literal["totp", "biometrics", "security_key"]]] = None + """Lists the MFA methods that users can authenticate with.""" + + mfa_bypass: Optional[bool] = None + """Indicates whether to bypass MFA for this resource. + + This option is available at the application and policy level. + """ + + session_duration: Optional[str] = None + """Defines the duration of an MFA session. + + Must be in minutes (m) or hours (h). Minimum: 0m. Maximum: 720h (30 days). + Examples:`5m` or `24h`. + """ class PolicyGetResponse(BaseModel): @@ -55,6 +75,9 @@ class PolicyGetResponse(BaseModel): this feature. """ + mfa_config: Optional[MfaConfig] = None + """Configures multi-factor authentication (MFA) settings.""" + name: Optional[str] = None """The name of the Access policy.""" diff --git a/src/cloudflare/types/zero_trust/access/policy_list_response.py b/src/cloudflare/types/zero_trust/access/policy_list_response.py index af20dea0f36..67206475718 100644 --- a/src/cloudflare/types/zero_trust/access/policy_list_response.py +++ b/src/cloudflare/types/zero_trust/access/policy_list_response.py @@ -9,7 +9,27 @@ from .approval_group import ApprovalGroup from .applications.access_rule import AccessRule -__all__ = ["PolicyListResponse"] +__all__ = ["PolicyListResponse", "MfaConfig"] + + +class MfaConfig(BaseModel): + """Configures multi-factor authentication (MFA) settings.""" + + allowed_authenticators: Optional[List[Literal["totp", "biometrics", "security_key"]]] = None + """Lists the MFA methods that users can authenticate with.""" + + mfa_bypass: Optional[bool] = None + """Indicates whether to bypass MFA for this resource. + + This option is available at the application and policy level. + """ + + session_duration: Optional[str] = None + """Defines the duration of an MFA session. + + Must be in minutes (m) or hours (h). Minimum: 0m. Maximum: 720h (30 days). + Examples:`5m` or `24h`. + """ class PolicyListResponse(BaseModel): @@ -55,6 +75,9 @@ class PolicyListResponse(BaseModel): this feature. """ + mfa_config: Optional[MfaConfig] = None + """Configures multi-factor authentication (MFA) settings.""" + name: Optional[str] = None """The name of the Access policy.""" diff --git a/src/cloudflare/types/zero_trust/access/policy_update_params.py b/src/cloudflare/types/zero_trust/access/policy_update_params.py index 0d21a28107b..66493c65f90 100644 --- a/src/cloudflare/types/zero_trust/access/policy_update_params.py +++ b/src/cloudflare/types/zero_trust/access/policy_update_params.py @@ -2,14 +2,14 @@ from __future__ import annotations -from typing import Iterable -from typing_extensions import Required, TypedDict +from typing import List, Iterable +from typing_extensions import Literal, Required, TypedDict from .decision import Decision from .approval_group_param import ApprovalGroupParam from .applications.access_rule_param import AccessRuleParam -__all__ = ["PolicyUpdateParams"] +__all__ = ["PolicyUpdateParams", "MfaConfig"] class PolicyUpdateParams(TypedDict, total=False): @@ -53,6 +53,9 @@ class PolicyUpdateParams(TypedDict, total=False): this feature. """ + mfa_config: MfaConfig + """Configures multi-factor authentication (MFA) settings.""" + purpose_justification_prompt: str """A custom message that will appear on the purpose justification screen.""" @@ -71,3 +74,23 @@ class PolicyUpdateParams(TypedDict, total=False): Must be in the format `300ms` or `2h45m`. Valid time units are: ns, us (or µs), ms, s, m, h. """ + + +class MfaConfig(TypedDict, total=False): + """Configures multi-factor authentication (MFA) settings.""" + + allowed_authenticators: List[Literal["totp", "biometrics", "security_key"]] + """Lists the MFA methods that users can authenticate with.""" + + mfa_bypass: bool + """Indicates whether to bypass MFA for this resource. + + This option is available at the application and policy level. + """ + + session_duration: str + """Defines the duration of an MFA session. + + Must be in minutes (m) or hours (h). Minimum: 0m. Maximum: 720h (30 days). + Examples:`5m` or `24h`. + """ diff --git a/src/cloudflare/types/zero_trust/access/policy_update_response.py b/src/cloudflare/types/zero_trust/access/policy_update_response.py index bbd9d8cb480..cb9244b4e60 100644 --- a/src/cloudflare/types/zero_trust/access/policy_update_response.py +++ b/src/cloudflare/types/zero_trust/access/policy_update_response.py @@ -9,7 +9,27 @@ from .approval_group import ApprovalGroup from .applications.access_rule import AccessRule -__all__ = ["PolicyUpdateResponse"] +__all__ = ["PolicyUpdateResponse", "MfaConfig"] + + +class MfaConfig(BaseModel): + """Configures multi-factor authentication (MFA) settings.""" + + allowed_authenticators: Optional[List[Literal["totp", "biometrics", "security_key"]]] = None + """Lists the MFA methods that users can authenticate with.""" + + mfa_bypass: Optional[bool] = None + """Indicates whether to bypass MFA for this resource. + + This option is available at the application and policy level. + """ + + session_duration: Optional[str] = None + """Defines the duration of an MFA session. + + Must be in minutes (m) or hours (h). Minimum: 0m. Maximum: 720h (30 days). + Examples:`5m` or `24h`. + """ class PolicyUpdateResponse(BaseModel): @@ -55,6 +75,9 @@ class PolicyUpdateResponse(BaseModel): this feature. """ + mfa_config: Optional[MfaConfig] = None + """Configures multi-factor authentication (MFA) settings.""" + name: Optional[str] = None """The name of the Access policy.""" diff --git a/src/cloudflare/types/zero_trust/organization.py b/src/cloudflare/types/zero_trust/organization.py index 84943c2821b..7eb81796fec 100644 --- a/src/cloudflare/types/zero_trust/organization.py +++ b/src/cloudflare/types/zero_trust/organization.py @@ -1,11 +1,12 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. from typing import List, Optional +from typing_extensions import Literal from ..._models import BaseModel from .login_design import LoginDesign -__all__ = ["Organization", "CustomPages"] +__all__ = ["Organization", "CustomPages", "MfaConfig"] class CustomPages(BaseModel): @@ -19,6 +20,20 @@ class CustomPages(BaseModel): """The uid of the custom page to use when a user is denied access.""" +class MfaConfig(BaseModel): + """Configures multi-factor authentication (MFA) settings for an organization.""" + + allowed_authenticators: Optional[List[Literal["totp", "biometrics", "security_key"]]] = None + """Lists the MFA methods that users can authenticate with.""" + + session_duration: Optional[str] = None + """Defines the duration of an MFA session. + + Must be in minutes (m) or hours (h). Minimum: 0m. Maximum: 720h (30 days). + Examples:`5m` or `24h`. + """ + + class Organization(BaseModel): allow_authenticate_via_warp: Optional[bool] = None """ @@ -62,6 +77,22 @@ class Organization(BaseModel): login_design: Optional[LoginDesign] = None + mfa_config: Optional[MfaConfig] = None + """Configures multi-factor authentication (MFA) settings for an organization.""" + + mfa_configuration_allowed: Optional[bool] = None + """ + Indicates if this organization can enforce multi-factor authentication (MFA) + requirements at the application and policy level. + """ + + mfa_required_for_all_apps: Optional[bool] = None + """Determines whether global MFA settings apply to applications by default. + + The organization must have MFA enabled with at least one authentication method + and a session duration configured. + """ + name: Optional[str] = None """The name of your Zero Trust organization.""" diff --git a/src/cloudflare/types/zero_trust/organization_create_params.py b/src/cloudflare/types/zero_trust/organization_create_params.py index 6c445ec5a98..e01bbfb4c42 100644 --- a/src/cloudflare/types/zero_trust/organization_create_params.py +++ b/src/cloudflare/types/zero_trust/organization_create_params.py @@ -2,12 +2,13 @@ from __future__ import annotations -from typing_extensions import Required, TypedDict +from typing import List +from typing_extensions import Literal, Required, TypedDict from ..._types import SequenceNotStr from .login_design_param import LoginDesignParam -__all__ = ["OrganizationCreateParams"] +__all__ = ["OrganizationCreateParams", "MfaConfig"] class OrganizationCreateParams(TypedDict, total=False): @@ -60,6 +61,22 @@ class OrganizationCreateParams(TypedDict, total=False): login_design: LoginDesignParam + mfa_config: MfaConfig + """Configures multi-factor authentication (MFA) settings for an organization.""" + + mfa_configuration_allowed: bool + """ + Indicates if this organization can enforce multi-factor authentication (MFA) + requirements at the application and policy level. + """ + + mfa_required_for_all_apps: bool + """Determines whether global MFA settings apply to applications by default. + + The organization must have MFA enabled with at least one authentication method + and a session duration configured. + """ + session_duration: str """The amount of time that tokens issued for applications will be valid. @@ -84,3 +101,17 @@ class OrganizationCreateParams(TypedDict, total=False): Must be in the format `30m` or `2h45m`. Valid time units are: m, h. """ + + +class MfaConfig(TypedDict, total=False): + """Configures multi-factor authentication (MFA) settings for an organization.""" + + allowed_authenticators: List[Literal["totp", "biometrics", "security_key"]] + """Lists the MFA methods that users can authenticate with.""" + + session_duration: str + """Defines the duration of an MFA session. + + Must be in minutes (m) or hours (h). Minimum: 0m. Maximum: 720h (30 days). + Examples:`5m` or `24h`. + """ diff --git a/src/cloudflare/types/zero_trust/organization_update_params.py b/src/cloudflare/types/zero_trust/organization_update_params.py index 21cebff40bf..6654c9d2882 100644 --- a/src/cloudflare/types/zero_trust/organization_update_params.py +++ b/src/cloudflare/types/zero_trust/organization_update_params.py @@ -2,12 +2,13 @@ from __future__ import annotations -from typing_extensions import TypedDict +from typing import List +from typing_extensions import Literal, TypedDict from ..._types import SequenceNotStr from .login_design_param import LoginDesignParam -__all__ = ["OrganizationUpdateParams", "CustomPages"] +__all__ = ["OrganizationUpdateParams", "CustomPages", "MfaConfig"] class OrganizationUpdateParams(TypedDict, total=False): @@ -59,6 +60,22 @@ class OrganizationUpdateParams(TypedDict, total=False): login_design: LoginDesignParam + mfa_config: MfaConfig + """Configures multi-factor authentication (MFA) settings for an organization.""" + + mfa_configuration_allowed: bool + """ + Indicates if this organization can enforce multi-factor authentication (MFA) + requirements at the application and policy level. + """ + + mfa_required_for_all_apps: bool + """Determines whether global MFA settings apply to applications by default. + + The organization must have MFA enabled with at least one authentication method + and a session duration configured. + """ + name: str """The name of your Zero Trust organization.""" @@ -97,3 +114,17 @@ class CustomPages(TypedDict, total=False): identity_denied: str """The uid of the custom page to use when a user is denied access.""" + + +class MfaConfig(TypedDict, total=False): + """Configures multi-factor authentication (MFA) settings for an organization.""" + + allowed_authenticators: List[Literal["totp", "biometrics", "security_key"]] + """Lists the MFA methods that users can authenticate with.""" + + session_duration: str + """Defines the duration of an MFA session. + + Must be in minutes (m) or hours (h). Minimum: 0m. Maximum: 720h (30 days). + Examples:`5m` or `24h`. + """ diff --git a/tests/api_resources/zero_trust/access/applications/test_policies.py b/tests/api_resources/zero_trust/access/applications/test_policies.py index c855bb52247..6d3b3843f3b 100644 --- a/tests/api_resources/zero_trust/access/applications/test_policies.py +++ b/tests/api_resources/zero_trust/access/applications/test_policies.py @@ -53,6 +53,11 @@ def test_method_create_with_all_params(self, client: Cloudflare) -> None: ], approval_required=True, isolation_required=False, + mfa_config={ + "allowed_authenticators": ["totp", "biometrics", "security_key"], + "mfa_bypass": False, + "session_duration": "24h", + }, precedence=0, purpose_justification_prompt="Please enter a justification for entering this protected domain.", purpose_justification_required=True, @@ -140,6 +145,11 @@ def test_method_update_with_all_params(self, client: Cloudflare) -> None: ], approval_required=True, isolation_required=False, + mfa_config={ + "allowed_authenticators": ["totp", "biometrics", "security_key"], + "mfa_bypass": False, + "session_duration": "24h", + }, precedence=0, purpose_justification_prompt="Please enter a justification for entering this protected domain.", purpose_justification_required=True, @@ -474,6 +484,11 @@ async def test_method_create_with_all_params(self, async_client: AsyncCloudflare ], approval_required=True, isolation_required=False, + mfa_config={ + "allowed_authenticators": ["totp", "biometrics", "security_key"], + "mfa_bypass": False, + "session_duration": "24h", + }, precedence=0, purpose_justification_prompt="Please enter a justification for entering this protected domain.", purpose_justification_required=True, @@ -561,6 +576,11 @@ async def test_method_update_with_all_params(self, async_client: AsyncCloudflare ], approval_required=True, isolation_required=False, + mfa_config={ + "allowed_authenticators": ["totp", "biometrics", "security_key"], + "mfa_bypass": False, + "session_duration": "24h", + }, precedence=0, purpose_justification_prompt="Please enter a justification for entering this protected domain.", purpose_justification_required=True, diff --git a/tests/api_resources/zero_trust/access/applications/test_policy_tests.py b/tests/api_resources/zero_trust/access/applications/test_policy_tests.py index d4517ef3e31..4e47f184c2a 100755 --- a/tests/api_resources/zero_trust/access/applications/test_policy_tests.py +++ b/tests/api_resources/zero_trust/access/applications/test_policy_tests.py @@ -51,6 +51,11 @@ def test_method_create_with_all_params(self, client: Cloudflare) -> None: "approval_required": True, "exclude": [{"group": {"id": "aa0a4aab-672b-4bdb-bc33-a59f1130a11f"}}], "isolation_required": False, + "mfa_config": { + "allowed_authenticators": ["totp", "biometrics", "security_key"], + "mfa_bypass": False, + "session_duration": "24h", + }, "purpose_justification_prompt": "Please enter a justification for entering this protected domain.", "purpose_justification_required": True, "require": [{"group": {"id": "aa0a4aab-672b-4bdb-bc33-a59f1130a11f"}}], @@ -176,6 +181,11 @@ async def test_method_create_with_all_params(self, async_client: AsyncCloudflare "approval_required": True, "exclude": [{"group": {"id": "aa0a4aab-672b-4bdb-bc33-a59f1130a11f"}}], "isolation_required": False, + "mfa_config": { + "allowed_authenticators": ["totp", "biometrics", "security_key"], + "mfa_bypass": False, + "session_duration": "24h", + }, "purpose_justification_prompt": "Please enter a justification for entering this protected domain.", "purpose_justification_required": True, "require": [{"group": {"id": "aa0a4aab-672b-4bdb-bc33-a59f1130a11f"}}], diff --git a/tests/api_resources/zero_trust/access/test_applications.py b/tests/api_resources/zero_trust/access/test_applications.py index fc4136feece..89e7f8a31ce 100644 --- a/tests/api_resources/zero_trust/access/test_applications.py +++ b/tests/api_resources/zero_trust/access/test_applications.py @@ -101,7 +101,25 @@ def test_method_create_with_all_params_overload_1(self, client: Cloudflare) -> N enable_binding_cookie=True, http_only_cookie_attribute=True, logo_url="https://www.cloudflare.com/img/logo-web-badges/cf-logo-on-white-bg.svg", + mfa_config={ + "allowed_authenticators": ["totp", "biometrics", "security_key"], + "mfa_bypass": False, + "session_duration": "24h", + }, name="Admin Site", + oauth_configuration={ + "dynamic_client_registration": { + "allow_any_on_localhost": True, + "allow_any_on_loopback": True, + "allowed_uris": ["https://example.com/callback"], + "enabled": True, + }, + "enabled": True, + "grant": { + "access_token_lifetime": "5m", + "session_duration": "24h", + }, + }, options_preflight_bypass=True, path_cookie_attribute=True, policies=[ @@ -393,7 +411,25 @@ def test_method_create_with_all_params_overload_3(self, client: Cloudflare) -> N enable_binding_cookie=True, http_only_cookie_attribute=True, logo_url="https://www.cloudflare.com/img/logo-web-badges/cf-logo-on-white-bg.svg", + mfa_config={ + "allowed_authenticators": ["totp", "biometrics", "security_key"], + "mfa_bypass": False, + "session_duration": "24h", + }, name="Admin Site", + oauth_configuration={ + "dynamic_client_registration": { + "allow_any_on_localhost": True, + "allow_any_on_loopback": True, + "allowed_uris": ["https://example.com/callback"], + "enabled": True, + }, + "enabled": True, + "grant": { + "access_token_lifetime": "5m", + "session_duration": "24h", + }, + }, options_preflight_bypass=True, path_cookie_attribute=True, policies=[ @@ -562,7 +598,25 @@ def test_method_create_with_all_params_overload_4(self, client: Cloudflare) -> N enable_binding_cookie=True, http_only_cookie_attribute=True, logo_url="https://www.cloudflare.com/img/logo-web-badges/cf-logo-on-white-bg.svg", + mfa_config={ + "allowed_authenticators": ["totp", "biometrics", "security_key"], + "mfa_bypass": False, + "session_duration": "24h", + }, name="Admin Site", + oauth_configuration={ + "dynamic_client_registration": { + "allow_any_on_localhost": True, + "allow_any_on_loopback": True, + "allowed_uris": ["https://example.com/callback"], + "enabled": True, + }, + "enabled": True, + "grant": { + "access_token_lifetime": "5m", + "session_duration": "24h", + }, + }, options_preflight_bypass=True, path_cookie_attribute=True, policies=[ @@ -1242,7 +1296,25 @@ def test_method_create_with_all_params_overload_11(self, client: Cloudflare) -> enable_binding_cookie=True, http_only_cookie_attribute=True, logo_url="https://www.cloudflare.com/img/logo-web-badges/cf-logo-on-white-bg.svg", + mfa_config={ + "allowed_authenticators": ["totp", "biometrics", "security_key"], + "mfa_bypass": False, + "session_duration": "24h", + }, name="Admin Site", + oauth_configuration={ + "dynamic_client_registration": { + "allow_any_on_localhost": True, + "allow_any_on_loopback": True, + "allowed_uris": ["https://example.com/callback"], + "enabled": True, + }, + "enabled": True, + "grant": { + "access_token_lifetime": "5m", + "session_duration": "24h", + }, + }, options_preflight_bypass=True, path_cookie_attribute=True, policies=[ @@ -1364,38 +1436,22 @@ def test_path_params_create_overload_11(self, client: Cloudflare) -> None: @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize - def test_method_update_overload_1(self, client: Cloudflare) -> None: - application = client.zero_trust.access.applications.update( - app_id="023e105f4ecef8ad9ca31a8372d0c353", - domain="test.example.com/admin", - type="self_hosted", + def test_method_create_overload_12(self, client: Cloudflare) -> None: + application = client.zero_trust.access.applications.create( + type="mcp", account_id="account_id", ) - assert_matches_type(Optional[ApplicationUpdateResponse], application, path=["response"]) + assert_matches_type(Optional[ApplicationCreateResponse], application, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize - def test_method_update_with_all_params_overload_1(self, client: Cloudflare) -> None: - application = client.zero_trust.access.applications.update( - app_id="023e105f4ecef8ad9ca31a8372d0c353", - domain="test.example.com/admin", - type="self_hosted", + def test_method_create_with_all_params_overload_12(self, client: Cloudflare) -> None: + application = client.zero_trust.access.applications.create( + type="mcp", account_id="account_id", allow_authenticate_via_warp=True, - allow_iframe=True, allowed_idps=["699d98642c564d2e855e9661899b7252"], - app_launcher_visible=True, auto_redirect_to_identity=True, - cors_headers={ - "allow_all_headers": True, - "allow_all_methods": True, - "allow_all_origins": True, - "allow_credentials": True, - "allowed_headers": ["string"], - "allowed_methods": ["GET"], - "allowed_origins": ["https://example.com"], - "max_age": -1, - }, custom_deny_message="custom_deny_message", custom_deny_url="custom_deny_url", custom_non_identity_deny_url="custom_non_identity_deny_url", @@ -1438,19 +1494,29 @@ def test_method_update_with_all_params_overload_1(self, client: Cloudflare) -> N "type": "via_mcp_server_portal", }, ], - enable_binding_cookie=True, http_only_cookie_attribute=True, logo_url="https://www.cloudflare.com/img/logo-web-badges/cf-logo-on-white-bg.svg", name="Admin Site", + oauth_configuration={ + "dynamic_client_registration": { + "allow_any_on_localhost": True, + "allow_any_on_loopback": True, + "allowed_uris": ["https://example.com/callback"], + "enabled": True, + }, + "enabled": True, + "grant": { + "access_token_lifetime": "5m", + "session_duration": "24h", + }, + }, options_preflight_bypass=True, - path_cookie_attribute=True, policies=[ { "id": "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", "precedence": 0, } ], - read_service_tokens_from_header="Authorization", same_site_cookie_attribute="strict", scim_config={ "idp_uid": "idp_uid", @@ -1477,130 +1543,139 @@ def test_method_update_with_all_params_overload_1(self, client: Cloudflare) -> N } ], }, - self_hosted_domains=["test.example.com/admin", "test.anotherexample.com/staff"], - service_auth_401_redirect=True, session_duration="24h", - skip_interstitial=True, tags=["engineers"], - use_clientless_isolation_app_launcher_url=False, ) - assert_matches_type(Optional[ApplicationUpdateResponse], application, path=["response"]) + assert_matches_type(Optional[ApplicationCreateResponse], application, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize - def test_raw_response_update_overload_1(self, client: Cloudflare) -> None: - response = client.zero_trust.access.applications.with_raw_response.update( - app_id="023e105f4ecef8ad9ca31a8372d0c353", - domain="test.example.com/admin", - type="self_hosted", + def test_raw_response_create_overload_12(self, client: Cloudflare) -> None: + response = client.zero_trust.access.applications.with_raw_response.create( + type="mcp", account_id="account_id", ) assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" application = response.parse() - assert_matches_type(Optional[ApplicationUpdateResponse], application, path=["response"]) + assert_matches_type(Optional[ApplicationCreateResponse], application, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize - def test_streaming_response_update_overload_1(self, client: Cloudflare) -> None: - with client.zero_trust.access.applications.with_streaming_response.update( - app_id="023e105f4ecef8ad9ca31a8372d0c353", - domain="test.example.com/admin", - type="self_hosted", + def test_streaming_response_create_overload_12(self, client: Cloudflare) -> None: + with client.zero_trust.access.applications.with_streaming_response.create( + type="mcp", account_id="account_id", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" application = response.parse() - assert_matches_type(Optional[ApplicationUpdateResponse], application, path=["response"]) + assert_matches_type(Optional[ApplicationCreateResponse], application, path=["response"]) assert cast(Any, response.is_closed) is True @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize - def test_path_params_update_overload_1(self, client: Cloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `app_id` but received ''"): - client.zero_trust.access.applications.with_raw_response.update( - app_id="", - domain="test.example.com/admin", - type="self_hosted", - account_id="account_id", - ) - + def test_path_params_create_overload_12(self, client: Cloudflare) -> None: with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): - client.zero_trust.access.applications.with_raw_response.update( - app_id="023e105f4ecef8ad9ca31a8372d0c353", - domain="test.example.com/admin", - type="self_hosted", + client.zero_trust.access.applications.with_raw_response.create( + type="mcp", account_id="", ) with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): - client.zero_trust.access.applications.with_raw_response.update( - app_id="023e105f4ecef8ad9ca31a8372d0c353", - domain="test.example.com/admin", - type="self_hosted", + client.zero_trust.access.applications.with_raw_response.create( + type="mcp", account_id="account_id", ) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize - def test_method_update_overload_2(self, client: Cloudflare) -> None: - application = client.zero_trust.access.applications.update( - app_id="023e105f4ecef8ad9ca31a8372d0c353", + def test_method_create_overload_13(self, client: Cloudflare) -> None: + application = client.zero_trust.access.applications.create( + type="mcp_portal", account_id="account_id", ) - assert_matches_type(Optional[ApplicationUpdateResponse], application, path=["response"]) + assert_matches_type(Optional[ApplicationCreateResponse], application, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize - def test_method_update_with_all_params_overload_2(self, client: Cloudflare) -> None: - application = client.zero_trust.access.applications.update( - app_id="023e105f4ecef8ad9ca31a8372d0c353", + def test_method_create_with_all_params_overload_13(self, client: Cloudflare) -> None: + application = client.zero_trust.access.applications.create( + type="mcp_portal", account_id="account_id", + allow_authenticate_via_warp=True, allowed_idps=["699d98642c564d2e855e9661899b7252"], - app_launcher_visible=True, auto_redirect_to_identity=True, + custom_deny_message="custom_deny_message", + custom_deny_url="custom_deny_url", + custom_non_identity_deny_url="custom_non_identity_deny_url", custom_pages=["699d98642c564d2e855e9661899b7252"], + destinations=[ + { + "type": "public", + "uri": "test.example.com/admin", + }, + { + "type": "public", + "uri": "test.anotherexample.com/staff", + }, + { + "cidr": "10.5.0.0/24", + "hostname": "hostname", + "l4_protocol": "tcp", + "port_range": "80-90", + "type": "private", + "vnet_id": "vnet_id", + }, + { + "cidr": "10.5.0.3/32", + "hostname": "hostname", + "l4_protocol": "tcp", + "port_range": "80", + "type": "private", + "vnet_id": "vnet_id", + }, + { + "cidr": "cidr", + "hostname": "private-sni.example.com", + "l4_protocol": "tcp", + "port_range": "port_range", + "type": "private", + "vnet_id": "vnet_id", + }, + { + "mcp_server_id": "mcp-server-1", + "type": "via_mcp_server_portal", + }, + ], + domain="test.example.com/admin", + http_only_cookie_attribute=True, logo_url="https://www.cloudflare.com/img/logo-web-badges/cf-logo-on-white-bg.svg", name="Admin Site", + oauth_configuration={ + "dynamic_client_registration": { + "allow_any_on_localhost": True, + "allow_any_on_loopback": True, + "allowed_uris": ["https://example.com/callback"], + "enabled": True, + }, + "enabled": True, + "grant": { + "access_token_lifetime": "5m", + "session_duration": "24h", + }, + }, + options_preflight_bypass=True, policies=[ { "id": "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", "precedence": 0, } ], - saas_app={ - "auth_type": "saml", - "consumer_service_url": "https://example.com", - "custom_attributes": [ - { - "friendly_name": "Last Name", - "name": "family_name", - "name_format": "urn:oasis:names:tc:SAML:2.0:attrname-format:basic", - "required": True, - "source": { - "name": "last_name", - "name_by_idp": [ - { - "idp_id": "exampleIdPID1", - "source_name": "AttributeName1", - } - ], - }, - } - ], - "default_relay_state": "https://example.com", - "idp_entity_id": "https://example.cloudflareaccess.com", - "name_id_format": "id", - "name_id_transform_jsonata": "$substringBefore(email, '@') & '+sandbox@' & $substringAfter(email, '@')", - "public_key": "example unique name", - "saml_attribute_transform_jsonata": "$ ~>| groups | {'group_name': name} |", - "sp_entity_id": "example unique name", - "sso_endpoint": "https://example.cloudflareaccess.com/cdn-cgi/access/sso/saml/b3f58a2b414e0b51d45c8c2af26fccca0e27c63763c426fa52f98dcf0b3b3bfd", - }, + same_site_cookie_attribute="strict", scim_config={ "idp_uid": "idp_uid", "remote_uri": "remote_uri", @@ -1626,63 +1701,57 @@ def test_method_update_with_all_params_overload_2(self, client: Cloudflare) -> N } ], }, + session_duration="24h", tags=["engineers"], - type="saas", ) - assert_matches_type(Optional[ApplicationUpdateResponse], application, path=["response"]) + assert_matches_type(Optional[ApplicationCreateResponse], application, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize - def test_raw_response_update_overload_2(self, client: Cloudflare) -> None: - response = client.zero_trust.access.applications.with_raw_response.update( - app_id="023e105f4ecef8ad9ca31a8372d0c353", + def test_raw_response_create_overload_13(self, client: Cloudflare) -> None: + response = client.zero_trust.access.applications.with_raw_response.create( + type="mcp_portal", account_id="account_id", ) assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" application = response.parse() - assert_matches_type(Optional[ApplicationUpdateResponse], application, path=["response"]) + assert_matches_type(Optional[ApplicationCreateResponse], application, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize - def test_streaming_response_update_overload_2(self, client: Cloudflare) -> None: - with client.zero_trust.access.applications.with_streaming_response.update( - app_id="023e105f4ecef8ad9ca31a8372d0c353", + def test_streaming_response_create_overload_13(self, client: Cloudflare) -> None: + with client.zero_trust.access.applications.with_streaming_response.create( + type="mcp_portal", account_id="account_id", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" application = response.parse() - assert_matches_type(Optional[ApplicationUpdateResponse], application, path=["response"]) + assert_matches_type(Optional[ApplicationCreateResponse], application, path=["response"]) assert cast(Any, response.is_closed) is True @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize - def test_path_params_update_overload_2(self, client: Cloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `app_id` but received ''"): - client.zero_trust.access.applications.with_raw_response.update( - app_id="", - account_id="account_id", - ) - + def test_path_params_create_overload_13(self, client: Cloudflare) -> None: with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): - client.zero_trust.access.applications.with_raw_response.update( - app_id="023e105f4ecef8ad9ca31a8372d0c353", + client.zero_trust.access.applications.with_raw_response.create( + type="mcp_portal", account_id="", ) with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): - client.zero_trust.access.applications.with_raw_response.update( - app_id="023e105f4ecef8ad9ca31a8372d0c353", + client.zero_trust.access.applications.with_raw_response.create( + type="mcp_portal", account_id="account_id", ) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize - def test_method_update_overload_3(self, client: Cloudflare) -> None: + def test_method_update_overload_1(self, client: Cloudflare) -> None: application = client.zero_trust.access.applications.update( app_id="023e105f4ecef8ad9ca31a8372d0c353", domain="test.example.com/admin", @@ -1693,7 +1762,7 @@ def test_method_update_overload_3(self, client: Cloudflare) -> None: @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize - def test_method_update_with_all_params_overload_3(self, client: Cloudflare) -> None: + def test_method_update_with_all_params_overload_1(self, client: Cloudflare) -> None: application = client.zero_trust.access.applications.update( app_id="023e105f4ecef8ad9ca31a8372d0c353", domain="test.example.com/admin", @@ -1759,7 +1828,25 @@ def test_method_update_with_all_params_overload_3(self, client: Cloudflare) -> N enable_binding_cookie=True, http_only_cookie_attribute=True, logo_url="https://www.cloudflare.com/img/logo-web-badges/cf-logo-on-white-bg.svg", + mfa_config={ + "allowed_authenticators": ["totp", "biometrics", "security_key"], + "mfa_bypass": False, + "session_duration": "24h", + }, name="Admin Site", + oauth_configuration={ + "dynamic_client_registration": { + "allow_any_on_localhost": True, + "allow_any_on_loopback": True, + "allowed_uris": ["https://example.com/callback"], + "enabled": True, + }, + "enabled": True, + "grant": { + "access_token_lifetime": "5m", + "session_duration": "24h", + }, + }, options_preflight_bypass=True, path_cookie_attribute=True, policies=[ @@ -1806,7 +1893,7 @@ def test_method_update_with_all_params_overload_3(self, client: Cloudflare) -> N @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize - def test_raw_response_update_overload_3(self, client: Cloudflare) -> None: + def test_raw_response_update_overload_1(self, client: Cloudflare) -> None: response = client.zero_trust.access.applications.with_raw_response.update( app_id="023e105f4ecef8ad9ca31a8372d0c353", domain="test.example.com/admin", @@ -1821,7 +1908,7 @@ def test_raw_response_update_overload_3(self, client: Cloudflare) -> None: @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize - def test_streaming_response_update_overload_3(self, client: Cloudflare) -> None: + def test_streaming_response_update_overload_1(self, client: Cloudflare) -> None: with client.zero_trust.access.applications.with_streaming_response.update( app_id="023e105f4ecef8ad9ca31a8372d0c353", domain="test.example.com/admin", @@ -1838,7 +1925,7 @@ def test_streaming_response_update_overload_3(self, client: Cloudflare) -> None: @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize - def test_path_params_update_overload_3(self, client: Cloudflare) -> None: + def test_path_params_update_overload_1(self, client: Cloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `app_id` but received ''"): client.zero_trust.access.applications.with_raw_response.update( app_id="", @@ -1865,94 +1952,60 @@ def test_path_params_update_overload_3(self, client: Cloudflare) -> None: @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize - def test_method_update_overload_4(self, client: Cloudflare) -> None: + def test_method_update_overload_2(self, client: Cloudflare) -> None: application = client.zero_trust.access.applications.update( app_id="023e105f4ecef8ad9ca31a8372d0c353", - domain="test.example.com/admin", - type="self_hosted", account_id="account_id", ) assert_matches_type(Optional[ApplicationUpdateResponse], application, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize - def test_method_update_with_all_params_overload_4(self, client: Cloudflare) -> None: + def test_method_update_with_all_params_overload_2(self, client: Cloudflare) -> None: application = client.zero_trust.access.applications.update( app_id="023e105f4ecef8ad9ca31a8372d0c353", - domain="test.example.com/admin", - type="self_hosted", account_id="account_id", - allow_authenticate_via_warp=True, - allow_iframe=True, allowed_idps=["699d98642c564d2e855e9661899b7252"], app_launcher_visible=True, auto_redirect_to_identity=True, - cors_headers={ - "allow_all_headers": True, - "allow_all_methods": True, - "allow_all_origins": True, - "allow_credentials": True, - "allowed_headers": ["string"], - "allowed_methods": ["GET"], - "allowed_origins": ["https://example.com"], - "max_age": -1, - }, - custom_deny_message="custom_deny_message", - custom_deny_url="custom_deny_url", - custom_non_identity_deny_url="custom_non_identity_deny_url", custom_pages=["699d98642c564d2e855e9661899b7252"], - destinations=[ - { - "type": "public", - "uri": "test.example.com/admin", - }, - { - "type": "public", - "uri": "test.anotherexample.com/staff", - }, - { - "cidr": "10.5.0.0/24", - "hostname": "hostname", - "l4_protocol": "tcp", - "port_range": "80-90", - "type": "private", - "vnet_id": "vnet_id", - }, - { - "cidr": "10.5.0.3/32", - "hostname": "hostname", - "l4_protocol": "tcp", - "port_range": "80", - "type": "private", - "vnet_id": "vnet_id", - }, - { - "cidr": "cidr", - "hostname": "private-sni.example.com", - "l4_protocol": "tcp", - "port_range": "port_range", - "type": "private", - "vnet_id": "vnet_id", - }, - { - "mcp_server_id": "mcp-server-1", - "type": "via_mcp_server_portal", - }, - ], - enable_binding_cookie=True, - http_only_cookie_attribute=True, - logo_url="https://www.cloudflare.com/img/logo-web-badges/cf-logo-on-white-bg.svg", - name="Admin Site", - options_preflight_bypass=True, - path_cookie_attribute=True, - policies=[ + logo_url="https://www.cloudflare.com/img/logo-web-badges/cf-logo-on-white-bg.svg", + name="Admin Site", + policies=[ { "id": "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", "precedence": 0, } ], - read_service_tokens_from_header="Authorization", - same_site_cookie_attribute="strict", + saas_app={ + "auth_type": "saml", + "consumer_service_url": "https://example.com", + "custom_attributes": [ + { + "friendly_name": "Last Name", + "name": "family_name", + "name_format": "urn:oasis:names:tc:SAML:2.0:attrname-format:basic", + "required": True, + "source": { + "name": "last_name", + "name_by_idp": [ + { + "idp_id": "exampleIdPID1", + "source_name": "AttributeName1", + } + ], + }, + } + ], + "default_relay_state": "https://example.com", + "idp_entity_id": "https://example.cloudflareaccess.com", + "name_id_format": "id", + "name_id_transform_jsonata": "$substringBefore(email, '@') & '+sandbox@' & $substringAfter(email, '@')", + "public_key": "example unique name", + "saml_attribute_transform_jsonata": "$ ~>| groups | {'group_name': name} |", + "sp_entity_id": "example unique name", + "sso_endpoint": "https://example.cloudflareaccess.com/cdn-cgi/access/sso/saml/b3f58a2b414e0b51d45c8c2af26fccca0e27c63763c426fa52f98dcf0b3b3bfd", + }, scim_config={ "idp_uid": "idp_uid", "remote_uri": "remote_uri", @@ -1978,22 +2031,16 @@ def test_method_update_with_all_params_overload_4(self, client: Cloudflare) -> N } ], }, - self_hosted_domains=["test.example.com/admin", "test.anotherexample.com/staff"], - service_auth_401_redirect=True, - session_duration="24h", - skip_interstitial=True, tags=["engineers"], - use_clientless_isolation_app_launcher_url=False, + type="saas", ) assert_matches_type(Optional[ApplicationUpdateResponse], application, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize - def test_raw_response_update_overload_4(self, client: Cloudflare) -> None: + def test_raw_response_update_overload_2(self, client: Cloudflare) -> None: response = client.zero_trust.access.applications.with_raw_response.update( app_id="023e105f4ecef8ad9ca31a8372d0c353", - domain="test.example.com/admin", - type="self_hosted", account_id="account_id", ) @@ -2004,11 +2051,9 @@ def test_raw_response_update_overload_4(self, client: Cloudflare) -> None: @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize - def test_streaming_response_update_overload_4(self, client: Cloudflare) -> None: + def test_streaming_response_update_overload_2(self, client: Cloudflare) -> None: with client.zero_trust.access.applications.with_streaming_response.update( app_id="023e105f4ecef8ad9ca31a8372d0c353", - domain="test.example.com/admin", - type="self_hosted", account_id="account_id", ) as response: assert not response.is_closed @@ -2021,36 +2066,31 @@ def test_streaming_response_update_overload_4(self, client: Cloudflare) -> None: @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize - def test_path_params_update_overload_4(self, client: Cloudflare) -> None: + def test_path_params_update_overload_2(self, client: Cloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `app_id` but received ''"): client.zero_trust.access.applications.with_raw_response.update( app_id="", - domain="test.example.com/admin", - type="self_hosted", account_id="account_id", ) with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): client.zero_trust.access.applications.with_raw_response.update( app_id="023e105f4ecef8ad9ca31a8372d0c353", - domain="test.example.com/admin", - type="self_hosted", account_id="", ) with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): client.zero_trust.access.applications.with_raw_response.update( app_id="023e105f4ecef8ad9ca31a8372d0c353", - domain="test.example.com/admin", - type="self_hosted", account_id="account_id", ) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize - def test_method_update_overload_5(self, client: Cloudflare) -> None: + def test_method_update_overload_3(self, client: Cloudflare) -> None: application = client.zero_trust.access.applications.update( app_id="023e105f4ecef8ad9ca31a8372d0c353", + domain="test.example.com/admin", type="self_hosted", account_id="account_id", ) @@ -2058,48 +2098,141 @@ def test_method_update_overload_5(self, client: Cloudflare) -> None: @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize - def test_method_update_with_all_params_overload_5(self, client: Cloudflare) -> None: + def test_method_update_with_all_params_overload_3(self, client: Cloudflare) -> None: application = client.zero_trust.access.applications.update( app_id="023e105f4ecef8ad9ca31a8372d0c353", + domain="test.example.com/admin", type="self_hosted", account_id="account_id", + allow_authenticate_via_warp=True, + allow_iframe=True, allowed_idps=["699d98642c564d2e855e9661899b7252"], - app_launcher_logo_url="https://www.cloudflare.com/img/logo-web-badges/cf-logo-on-white-bg.svg", + app_launcher_visible=True, auto_redirect_to_identity=True, - bg_color="#ff0000", + cors_headers={ + "allow_all_headers": True, + "allow_all_methods": True, + "allow_all_origins": True, + "allow_credentials": True, + "allowed_headers": ["string"], + "allowed_methods": ["GET"], + "allowed_origins": ["https://example.com"], + "max_age": -1, + }, + custom_deny_message="custom_deny_message", custom_deny_url="custom_deny_url", custom_non_identity_deny_url="custom_non_identity_deny_url", custom_pages=["699d98642c564d2e855e9661899b7252"], - footer_links=[ + destinations=[ { - "name": "Cloudflare's Privacy Policy", - "url": "https://www.cloudflare.com/privacypolicy/", - } + "type": "public", + "uri": "test.example.com/admin", + }, + { + "type": "public", + "uri": "test.anotherexample.com/staff", + }, + { + "cidr": "10.5.0.0/24", + "hostname": "hostname", + "l4_protocol": "tcp", + "port_range": "80-90", + "type": "private", + "vnet_id": "vnet_id", + }, + { + "cidr": "10.5.0.3/32", + "hostname": "hostname", + "l4_protocol": "tcp", + "port_range": "80", + "type": "private", + "vnet_id": "vnet_id", + }, + { + "cidr": "cidr", + "hostname": "private-sni.example.com", + "l4_protocol": "tcp", + "port_range": "port_range", + "type": "private", + "vnet_id": "vnet_id", + }, + { + "mcp_server_id": "mcp-server-1", + "type": "via_mcp_server_portal", + }, ], - header_bg_color="#ff0000", - landing_page_design={ - "button_color": "#ff0000", - "button_text_color": "#ff0000", - "image_url": "https://www.cloudflare.com/img/logo-web-badges/cf-logo-on-white-bg.svg", - "message": "Log in below to reach your applications behind Access.", - "title": "Welcome back!", + enable_binding_cookie=True, + http_only_cookie_attribute=True, + logo_url="https://www.cloudflare.com/img/logo-web-badges/cf-logo-on-white-bg.svg", + mfa_config={ + "allowed_authenticators": ["totp", "biometrics", "security_key"], + "mfa_bypass": False, + "session_duration": "24h", }, + name="Admin Site", + oauth_configuration={ + "dynamic_client_registration": { + "allow_any_on_localhost": True, + "allow_any_on_loopback": True, + "allowed_uris": ["https://example.com/callback"], + "enabled": True, + }, + "enabled": True, + "grant": { + "access_token_lifetime": "5m", + "session_duration": "24h", + }, + }, + options_preflight_bypass=True, + path_cookie_attribute=True, policies=[ { "id": "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", "precedence": 0, } ], + read_service_tokens_from_header="Authorization", + same_site_cookie_attribute="strict", + scim_config={ + "idp_uid": "idp_uid", + "remote_uri": "remote_uri", + "authentication": { + "password": "password", + "scheme": "httpbasic", + "user": "user", + }, + "deactivate_on_delete": True, + "enabled": True, + "mappings": [ + { + "schema": "urn:ietf:params:scim:schemas:core:2.0:User", + "enabled": True, + "filter": 'title pr or userType eq "Intern"', + "operations": { + "create": True, + "delete": True, + "update": True, + }, + "strictness": "strict", + "transform_jsonata": "$merge([$, {'userName': $substringBefore($.userName, '@') & '+test@' & $substringAfter($.userName, '@')}])", + } + ], + }, + self_hosted_domains=["test.example.com/admin", "test.anotherexample.com/staff"], + service_auth_401_redirect=True, session_duration="24h", - skip_app_launcher_login_page=True, + skip_interstitial=True, + tags=["engineers"], + use_clientless_isolation_app_launcher_url=False, ) assert_matches_type(Optional[ApplicationUpdateResponse], application, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize - def test_raw_response_update_overload_5(self, client: Cloudflare) -> None: + def test_raw_response_update_overload_3(self, client: Cloudflare) -> None: response = client.zero_trust.access.applications.with_raw_response.update( app_id="023e105f4ecef8ad9ca31a8372d0c353", + domain="test.example.com/admin", type="self_hosted", account_id="account_id", ) @@ -2111,9 +2244,10 @@ def test_raw_response_update_overload_5(self, client: Cloudflare) -> None: @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize - def test_streaming_response_update_overload_5(self, client: Cloudflare) -> None: + def test_streaming_response_update_overload_3(self, client: Cloudflare) -> None: with client.zero_trust.access.applications.with_streaming_response.update( app_id="023e105f4ecef8ad9ca31a8372d0c353", + domain="test.example.com/admin", type="self_hosted", account_id="account_id", ) as response: @@ -2127,10 +2261,11 @@ def test_streaming_response_update_overload_5(self, client: Cloudflare) -> None: @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize - def test_path_params_update_overload_5(self, client: Cloudflare) -> None: + def test_path_params_update_overload_3(self, client: Cloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `app_id` but received ''"): client.zero_trust.access.applications.with_raw_response.update( app_id="", + domain="test.example.com/admin", type="self_hosted", account_id="account_id", ) @@ -2138,6 +2273,7 @@ def test_path_params_update_overload_5(self, client: Cloudflare) -> None: with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): client.zero_trust.access.applications.with_raw_response.update( app_id="023e105f4ecef8ad9ca31a8372d0c353", + domain="test.example.com/admin", type="self_hosted", account_id="", ) @@ -2145,15 +2281,17 @@ def test_path_params_update_overload_5(self, client: Cloudflare) -> None: with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): client.zero_trust.access.applications.with_raw_response.update( app_id="023e105f4ecef8ad9ca31a8372d0c353", + domain="test.example.com/admin", type="self_hosted", account_id="account_id", ) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize - def test_method_update_overload_6(self, client: Cloudflare) -> None: + def test_method_update_overload_4(self, client: Cloudflare) -> None: application = client.zero_trust.access.applications.update( app_id="023e105f4ecef8ad9ca31a8372d0c353", + domain="test.example.com/admin", type="self_hosted", account_id="account_id", ) @@ -2161,33 +2299,143 @@ def test_method_update_overload_6(self, client: Cloudflare) -> None: @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize - def test_method_update_with_all_params_overload_6(self, client: Cloudflare) -> None: + def test_method_update_with_all_params_overload_4(self, client: Cloudflare) -> None: application = client.zero_trust.access.applications.update( app_id="023e105f4ecef8ad9ca31a8372d0c353", + domain="test.example.com/admin", type="self_hosted", account_id="account_id", + allow_authenticate_via_warp=True, + allow_iframe=True, allowed_idps=["699d98642c564d2e855e9661899b7252"], + app_launcher_visible=True, auto_redirect_to_identity=True, + cors_headers={ + "allow_all_headers": True, + "allow_all_methods": True, + "allow_all_origins": True, + "allow_credentials": True, + "allowed_headers": ["string"], + "allowed_methods": ["GET"], + "allowed_origins": ["https://example.com"], + "max_age": -1, + }, + custom_deny_message="custom_deny_message", custom_deny_url="custom_deny_url", custom_non_identity_deny_url="custom_non_identity_deny_url", custom_pages=["699d98642c564d2e855e9661899b7252"], - policies=[ + destinations=[ { - "id": "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", - "precedence": 0, - } - ], - session_duration="24h", - ) - assert_matches_type(Optional[ApplicationUpdateResponse], application, path=["response"]) - - @pytest.mark.skip(reason="TODO: investigate broken test") - @parametrize - def test_raw_response_update_overload_6(self, client: Cloudflare) -> None: - response = client.zero_trust.access.applications.with_raw_response.update( - app_id="023e105f4ecef8ad9ca31a8372d0c353", - type="self_hosted", - account_id="account_id", + "type": "public", + "uri": "test.example.com/admin", + }, + { + "type": "public", + "uri": "test.anotherexample.com/staff", + }, + { + "cidr": "10.5.0.0/24", + "hostname": "hostname", + "l4_protocol": "tcp", + "port_range": "80-90", + "type": "private", + "vnet_id": "vnet_id", + }, + { + "cidr": "10.5.0.3/32", + "hostname": "hostname", + "l4_protocol": "tcp", + "port_range": "80", + "type": "private", + "vnet_id": "vnet_id", + }, + { + "cidr": "cidr", + "hostname": "private-sni.example.com", + "l4_protocol": "tcp", + "port_range": "port_range", + "type": "private", + "vnet_id": "vnet_id", + }, + { + "mcp_server_id": "mcp-server-1", + "type": "via_mcp_server_portal", + }, + ], + enable_binding_cookie=True, + http_only_cookie_attribute=True, + logo_url="https://www.cloudflare.com/img/logo-web-badges/cf-logo-on-white-bg.svg", + mfa_config={ + "allowed_authenticators": ["totp", "biometrics", "security_key"], + "mfa_bypass": False, + "session_duration": "24h", + }, + name="Admin Site", + oauth_configuration={ + "dynamic_client_registration": { + "allow_any_on_localhost": True, + "allow_any_on_loopback": True, + "allowed_uris": ["https://example.com/callback"], + "enabled": True, + }, + "enabled": True, + "grant": { + "access_token_lifetime": "5m", + "session_duration": "24h", + }, + }, + options_preflight_bypass=True, + path_cookie_attribute=True, + policies=[ + { + "id": "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", + "precedence": 0, + } + ], + read_service_tokens_from_header="Authorization", + same_site_cookie_attribute="strict", + scim_config={ + "idp_uid": "idp_uid", + "remote_uri": "remote_uri", + "authentication": { + "password": "password", + "scheme": "httpbasic", + "user": "user", + }, + "deactivate_on_delete": True, + "enabled": True, + "mappings": [ + { + "schema": "urn:ietf:params:scim:schemas:core:2.0:User", + "enabled": True, + "filter": 'title pr or userType eq "Intern"', + "operations": { + "create": True, + "delete": True, + "update": True, + }, + "strictness": "strict", + "transform_jsonata": "$merge([$, {'userName': $substringBefore($.userName, '@') & '+test@' & $substringAfter($.userName, '@')}])", + } + ], + }, + self_hosted_domains=["test.example.com/admin", "test.anotherexample.com/staff"], + service_auth_401_redirect=True, + session_duration="24h", + skip_interstitial=True, + tags=["engineers"], + use_clientless_isolation_app_launcher_url=False, + ) + assert_matches_type(Optional[ApplicationUpdateResponse], application, path=["response"]) + + @pytest.mark.skip(reason="TODO: investigate broken test") + @parametrize + def test_raw_response_update_overload_4(self, client: Cloudflare) -> None: + response = client.zero_trust.access.applications.with_raw_response.update( + app_id="023e105f4ecef8ad9ca31a8372d0c353", + domain="test.example.com/admin", + type="self_hosted", + account_id="account_id", ) assert response.is_closed is True @@ -2197,9 +2445,10 @@ def test_raw_response_update_overload_6(self, client: Cloudflare) -> None: @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize - def test_streaming_response_update_overload_6(self, client: Cloudflare) -> None: + def test_streaming_response_update_overload_4(self, client: Cloudflare) -> None: with client.zero_trust.access.applications.with_streaming_response.update( app_id="023e105f4ecef8ad9ca31a8372d0c353", + domain="test.example.com/admin", type="self_hosted", account_id="account_id", ) as response: @@ -2213,10 +2462,11 @@ def test_streaming_response_update_overload_6(self, client: Cloudflare) -> None: @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize - def test_path_params_update_overload_6(self, client: Cloudflare) -> None: + def test_path_params_update_overload_4(self, client: Cloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `app_id` but received ''"): client.zero_trust.access.applications.with_raw_response.update( app_id="", + domain="test.example.com/admin", type="self_hosted", account_id="account_id", ) @@ -2224,6 +2474,7 @@ def test_path_params_update_overload_6(self, client: Cloudflare) -> None: with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): client.zero_trust.access.applications.with_raw_response.update( app_id="023e105f4ecef8ad9ca31a8372d0c353", + domain="test.example.com/admin", type="self_hosted", account_id="", ) @@ -2231,13 +2482,14 @@ def test_path_params_update_overload_6(self, client: Cloudflare) -> None: with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): client.zero_trust.access.applications.with_raw_response.update( app_id="023e105f4ecef8ad9ca31a8372d0c353", + domain="test.example.com/admin", type="self_hosted", account_id="account_id", ) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize - def test_method_update_overload_7(self, client: Cloudflare) -> None: + def test_method_update_overload_5(self, client: Cloudflare) -> None: application = client.zero_trust.access.applications.update( app_id="023e105f4ecef8ad9ca31a8372d0c353", type="self_hosted", @@ -2247,16 +2499,32 @@ def test_method_update_overload_7(self, client: Cloudflare) -> None: @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize - def test_method_update_with_all_params_overload_7(self, client: Cloudflare) -> None: + def test_method_update_with_all_params_overload_5(self, client: Cloudflare) -> None: application = client.zero_trust.access.applications.update( app_id="023e105f4ecef8ad9ca31a8372d0c353", type="self_hosted", account_id="account_id", allowed_idps=["699d98642c564d2e855e9661899b7252"], + app_launcher_logo_url="https://www.cloudflare.com/img/logo-web-badges/cf-logo-on-white-bg.svg", auto_redirect_to_identity=True, + bg_color="#ff0000", custom_deny_url="custom_deny_url", custom_non_identity_deny_url="custom_non_identity_deny_url", custom_pages=["699d98642c564d2e855e9661899b7252"], + footer_links=[ + { + "name": "Cloudflare's Privacy Policy", + "url": "https://www.cloudflare.com/privacypolicy/", + } + ], + header_bg_color="#ff0000", + landing_page_design={ + "button_color": "#ff0000", + "button_text_color": "#ff0000", + "image_url": "https://www.cloudflare.com/img/logo-web-badges/cf-logo-on-white-bg.svg", + "message": "Log in below to reach your applications behind Access.", + "title": "Welcome back!", + }, policies=[ { "id": "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", @@ -2264,12 +2532,13 @@ def test_method_update_with_all_params_overload_7(self, client: Cloudflare) -> N } ], session_duration="24h", + skip_app_launcher_login_page=True, ) assert_matches_type(Optional[ApplicationUpdateResponse], application, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize - def test_raw_response_update_overload_7(self, client: Cloudflare) -> None: + def test_raw_response_update_overload_5(self, client: Cloudflare) -> None: response = client.zero_trust.access.applications.with_raw_response.update( app_id="023e105f4ecef8ad9ca31a8372d0c353", type="self_hosted", @@ -2283,7 +2552,7 @@ def test_raw_response_update_overload_7(self, client: Cloudflare) -> None: @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize - def test_streaming_response_update_overload_7(self, client: Cloudflare) -> None: + def test_streaming_response_update_overload_5(self, client: Cloudflare) -> None: with client.zero_trust.access.applications.with_streaming_response.update( app_id="023e105f4ecef8ad9ca31a8372d0c353", type="self_hosted", @@ -2299,7 +2568,7 @@ def test_streaming_response_update_overload_7(self, client: Cloudflare) -> None: @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize - def test_path_params_update_overload_7(self, client: Cloudflare) -> None: + def test_path_params_update_overload_5(self, client: Cloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `app_id` but received ''"): client.zero_trust.access.applications.with_raw_response.update( app_id="", @@ -2323,7 +2592,7 @@ def test_path_params_update_overload_7(self, client: Cloudflare) -> None: @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize - def test_method_update_overload_8(self, client: Cloudflare) -> None: + def test_method_update_overload_6(self, client: Cloudflare) -> None: application = client.zero_trust.access.applications.update( app_id="023e105f4ecef8ad9ca31a8372d0c353", type="self_hosted", @@ -2333,7 +2602,7 @@ def test_method_update_overload_8(self, client: Cloudflare) -> None: @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize - def test_method_update_with_all_params_overload_8(self, client: Cloudflare) -> None: + def test_method_update_with_all_params_overload_6(self, client: Cloudflare) -> None: application = client.zero_trust.access.applications.update( app_id="023e105f4ecef8ad9ca31a8372d0c353", type="self_hosted", @@ -2343,8 +2612,6 @@ def test_method_update_with_all_params_overload_8(self, client: Cloudflare) -> N custom_deny_url="custom_deny_url", custom_non_identity_deny_url="custom_non_identity_deny_url", custom_pages=["699d98642c564d2e855e9661899b7252"], - domain="abcd123456.proxy.cloudflare-gateway.com", - name="Gateway Proxy", policies=[ { "id": "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", @@ -2357,7 +2624,7 @@ def test_method_update_with_all_params_overload_8(self, client: Cloudflare) -> N @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize - def test_raw_response_update_overload_8(self, client: Cloudflare) -> None: + def test_raw_response_update_overload_6(self, client: Cloudflare) -> None: response = client.zero_trust.access.applications.with_raw_response.update( app_id="023e105f4ecef8ad9ca31a8372d0c353", type="self_hosted", @@ -2371,7 +2638,7 @@ def test_raw_response_update_overload_8(self, client: Cloudflare) -> None: @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize - def test_streaming_response_update_overload_8(self, client: Cloudflare) -> None: + def test_streaming_response_update_overload_6(self, client: Cloudflare) -> None: with client.zero_trust.access.applications.with_streaming_response.update( app_id="023e105f4ecef8ad9ca31a8372d0c353", type="self_hosted", @@ -2387,7 +2654,7 @@ def test_streaming_response_update_overload_8(self, client: Cloudflare) -> None: @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize - def test_path_params_update_overload_8(self, client: Cloudflare) -> None: + def test_path_params_update_overload_6(self, client: Cloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `app_id` but received ''"): client.zero_trust.access.applications.with_raw_response.update( app_id="", @@ -2411,39 +2678,42 @@ def test_path_params_update_overload_8(self, client: Cloudflare) -> None: @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize - def test_method_update_overload_9(self, client: Cloudflare) -> None: + def test_method_update_overload_7(self, client: Cloudflare) -> None: application = client.zero_trust.access.applications.update( app_id="023e105f4ecef8ad9ca31a8372d0c353", + type="self_hosted", account_id="account_id", ) assert_matches_type(Optional[ApplicationUpdateResponse], application, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize - def test_method_update_with_all_params_overload_9(self, client: Cloudflare) -> None: + def test_method_update_with_all_params_overload_7(self, client: Cloudflare) -> None: application = client.zero_trust.access.applications.update( app_id="023e105f4ecef8ad9ca31a8372d0c353", + type="self_hosted", account_id="account_id", - app_launcher_visible=True, - domain="https://mybookmark.com", - logo_url="https://www.cloudflare.com/img/logo-web-badges/cf-logo-on-white-bg.svg", - name="Admin Site", + allowed_idps=["699d98642c564d2e855e9661899b7252"], + auto_redirect_to_identity=True, + custom_deny_url="custom_deny_url", + custom_non_identity_deny_url="custom_non_identity_deny_url", + custom_pages=["699d98642c564d2e855e9661899b7252"], policies=[ { "id": "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", "precedence": 0, } ], - tags=["engineers"], - type="bookmark", + session_duration="24h", ) assert_matches_type(Optional[ApplicationUpdateResponse], application, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize - def test_raw_response_update_overload_9(self, client: Cloudflare) -> None: + def test_raw_response_update_overload_7(self, client: Cloudflare) -> None: response = client.zero_trust.access.applications.with_raw_response.update( app_id="023e105f4ecef8ad9ca31a8372d0c353", + type="self_hosted", account_id="account_id", ) @@ -2454,9 +2724,10 @@ def test_raw_response_update_overload_9(self, client: Cloudflare) -> None: @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize - def test_streaming_response_update_overload_9(self, client: Cloudflare) -> None: + def test_streaming_response_update_overload_7(self, client: Cloudflare) -> None: with client.zero_trust.access.applications.with_streaming_response.update( app_id="023e105f4ecef8ad9ca31a8372d0c353", + type="self_hosted", account_id="account_id", ) as response: assert not response.is_closed @@ -2469,88 +2740,68 @@ def test_streaming_response_update_overload_9(self, client: Cloudflare) -> None: @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize - def test_path_params_update_overload_9(self, client: Cloudflare) -> None: + def test_path_params_update_overload_7(self, client: Cloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `app_id` but received ''"): client.zero_trust.access.applications.with_raw_response.update( app_id="", + type="self_hosted", account_id="account_id", ) with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): client.zero_trust.access.applications.with_raw_response.update( app_id="023e105f4ecef8ad9ca31a8372d0c353", + type="self_hosted", account_id="", ) with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): client.zero_trust.access.applications.with_raw_response.update( app_id="023e105f4ecef8ad9ca31a8372d0c353", + type="self_hosted", account_id="account_id", ) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize - def test_method_update_overload_10(self, client: Cloudflare) -> None: + def test_method_update_overload_8(self, client: Cloudflare) -> None: application = client.zero_trust.access.applications.update( app_id="023e105f4ecef8ad9ca31a8372d0c353", - target_criteria=[ - { - "port": 22, - "protocol": "SSH", - "target_attributes": {"hostname": ["test-server", "production-server"]}, - } - ], - type="infrastructure", + type="self_hosted", account_id="account_id", ) assert_matches_type(Optional[ApplicationUpdateResponse], application, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize - def test_method_update_with_all_params_overload_10(self, client: Cloudflare) -> None: + def test_method_update_with_all_params_overload_8(self, client: Cloudflare) -> None: application = client.zero_trust.access.applications.update( app_id="023e105f4ecef8ad9ca31a8372d0c353", - target_criteria=[ - { - "port": 22, - "protocol": "SSH", - "target_attributes": {"hostname": ["test-server", "production-server"]}, - } - ], - type="infrastructure", + type="self_hosted", account_id="account_id", - name="Admin Site", + allowed_idps=["699d98642c564d2e855e9661899b7252"], + auto_redirect_to_identity=True, + custom_deny_url="custom_deny_url", + custom_non_identity_deny_url="custom_non_identity_deny_url", + custom_pages=["699d98642c564d2e855e9661899b7252"], + domain="abcd123456.proxy.cloudflare-gateway.com", + name="Gateway Proxy", policies=[ { - "decision": "allow", - "include": [{"group": {"id": "aa0a4aab-672b-4bdb-bc33-a59f1130a11f"}}], - "name": "Allow devs", - "connection_rules": { - "ssh": { - "usernames": ["root", "ubuntu"], - "allow_email_alias": True, - } - }, - "exclude": [{"group": {"id": "aa0a4aab-672b-4bdb-bc33-a59f1130a11f"}}], - "require": [{"group": {"id": "aa0a4aab-672b-4bdb-bc33-a59f1130a11f"}}], + "id": "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", + "precedence": 0, } ], + session_duration="24h", ) assert_matches_type(Optional[ApplicationUpdateResponse], application, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize - def test_raw_response_update_overload_10(self, client: Cloudflare) -> None: + def test_raw_response_update_overload_8(self, client: Cloudflare) -> None: response = client.zero_trust.access.applications.with_raw_response.update( app_id="023e105f4ecef8ad9ca31a8372d0c353", - target_criteria=[ - { - "port": 22, - "protocol": "SSH", - "target_attributes": {"hostname": ["test-server", "production-server"]}, - } - ], - type="infrastructure", + type="self_hosted", account_id="account_id", ) @@ -2561,17 +2812,10 @@ def test_raw_response_update_overload_10(self, client: Cloudflare) -> None: @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize - def test_streaming_response_update_overload_10(self, client: Cloudflare) -> None: + def test_streaming_response_update_overload_8(self, client: Cloudflare) -> None: with client.zero_trust.access.applications.with_streaming_response.update( app_id="023e105f4ecef8ad9ca31a8372d0c353", - target_criteria=[ - { - "port": 22, - "protocol": "SSH", - "target_attributes": {"hostname": ["test-server", "production-server"]}, - } - ], - type="infrastructure", + type="self_hosted", account_id="account_id", ) as response: assert not response.is_closed @@ -2584,30 +2828,227 @@ def test_streaming_response_update_overload_10(self, client: Cloudflare) -> None @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize - def test_path_params_update_overload_10(self, client: Cloudflare) -> None: + def test_path_params_update_overload_8(self, client: Cloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `app_id` but received ''"): client.zero_trust.access.applications.with_raw_response.update( app_id="", - target_criteria=[ - { - "port": 22, - "protocol": "SSH", - "target_attributes": {"hostname": ["test-server", "production-server"]}, - } - ], - type="infrastructure", + type="self_hosted", account_id="account_id", ) with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): client.zero_trust.access.applications.with_raw_response.update( app_id="023e105f4ecef8ad9ca31a8372d0c353", - target_criteria=[ - { - "port": 22, - "protocol": "SSH", - "target_attributes": {"hostname": ["test-server", "production-server"]}, - } + type="self_hosted", + account_id="", + ) + + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): + client.zero_trust.access.applications.with_raw_response.update( + app_id="023e105f4ecef8ad9ca31a8372d0c353", + type="self_hosted", + account_id="account_id", + ) + + @pytest.mark.skip(reason="TODO: investigate broken test") + @parametrize + def test_method_update_overload_9(self, client: Cloudflare) -> None: + application = client.zero_trust.access.applications.update( + app_id="023e105f4ecef8ad9ca31a8372d0c353", + account_id="account_id", + ) + assert_matches_type(Optional[ApplicationUpdateResponse], application, path=["response"]) + + @pytest.mark.skip(reason="TODO: investigate broken test") + @parametrize + def test_method_update_with_all_params_overload_9(self, client: Cloudflare) -> None: + application = client.zero_trust.access.applications.update( + app_id="023e105f4ecef8ad9ca31a8372d0c353", + account_id="account_id", + app_launcher_visible=True, + domain="https://mybookmark.com", + logo_url="https://www.cloudflare.com/img/logo-web-badges/cf-logo-on-white-bg.svg", + name="Admin Site", + policies=[ + { + "id": "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", + "precedence": 0, + } + ], + tags=["engineers"], + type="bookmark", + ) + assert_matches_type(Optional[ApplicationUpdateResponse], application, path=["response"]) + + @pytest.mark.skip(reason="TODO: investigate broken test") + @parametrize + def test_raw_response_update_overload_9(self, client: Cloudflare) -> None: + response = client.zero_trust.access.applications.with_raw_response.update( + app_id="023e105f4ecef8ad9ca31a8372d0c353", + account_id="account_id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + application = response.parse() + assert_matches_type(Optional[ApplicationUpdateResponse], application, path=["response"]) + + @pytest.mark.skip(reason="TODO: investigate broken test") + @parametrize + def test_streaming_response_update_overload_9(self, client: Cloudflare) -> None: + with client.zero_trust.access.applications.with_streaming_response.update( + app_id="023e105f4ecef8ad9ca31a8372d0c353", + account_id="account_id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + application = response.parse() + assert_matches_type(Optional[ApplicationUpdateResponse], application, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip(reason="TODO: investigate broken test") + @parametrize + def test_path_params_update_overload_9(self, client: Cloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `app_id` but received ''"): + client.zero_trust.access.applications.with_raw_response.update( + app_id="", + account_id="account_id", + ) + + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): + client.zero_trust.access.applications.with_raw_response.update( + app_id="023e105f4ecef8ad9ca31a8372d0c353", + account_id="", + ) + + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): + client.zero_trust.access.applications.with_raw_response.update( + app_id="023e105f4ecef8ad9ca31a8372d0c353", + account_id="account_id", + ) + + @pytest.mark.skip(reason="TODO: investigate broken test") + @parametrize + def test_method_update_overload_10(self, client: Cloudflare) -> None: + application = client.zero_trust.access.applications.update( + app_id="023e105f4ecef8ad9ca31a8372d0c353", + target_criteria=[ + { + "port": 22, + "protocol": "SSH", + "target_attributes": {"hostname": ["test-server", "production-server"]}, + } + ], + type="infrastructure", + account_id="account_id", + ) + assert_matches_type(Optional[ApplicationUpdateResponse], application, path=["response"]) + + @pytest.mark.skip(reason="TODO: investigate broken test") + @parametrize + def test_method_update_with_all_params_overload_10(self, client: Cloudflare) -> None: + application = client.zero_trust.access.applications.update( + app_id="023e105f4ecef8ad9ca31a8372d0c353", + target_criteria=[ + { + "port": 22, + "protocol": "SSH", + "target_attributes": {"hostname": ["test-server", "production-server"]}, + } + ], + type="infrastructure", + account_id="account_id", + name="Admin Site", + policies=[ + { + "decision": "allow", + "include": [{"group": {"id": "aa0a4aab-672b-4bdb-bc33-a59f1130a11f"}}], + "name": "Allow devs", + "connection_rules": { + "ssh": { + "usernames": ["root", "ubuntu"], + "allow_email_alias": True, + } + }, + "exclude": [{"group": {"id": "aa0a4aab-672b-4bdb-bc33-a59f1130a11f"}}], + "require": [{"group": {"id": "aa0a4aab-672b-4bdb-bc33-a59f1130a11f"}}], + } + ], + ) + assert_matches_type(Optional[ApplicationUpdateResponse], application, path=["response"]) + + @pytest.mark.skip(reason="TODO: investigate broken test") + @parametrize + def test_raw_response_update_overload_10(self, client: Cloudflare) -> None: + response = client.zero_trust.access.applications.with_raw_response.update( + app_id="023e105f4ecef8ad9ca31a8372d0c353", + target_criteria=[ + { + "port": 22, + "protocol": "SSH", + "target_attributes": {"hostname": ["test-server", "production-server"]}, + } + ], + type="infrastructure", + account_id="account_id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + application = response.parse() + assert_matches_type(Optional[ApplicationUpdateResponse], application, path=["response"]) + + @pytest.mark.skip(reason="TODO: investigate broken test") + @parametrize + def test_streaming_response_update_overload_10(self, client: Cloudflare) -> None: + with client.zero_trust.access.applications.with_streaming_response.update( + app_id="023e105f4ecef8ad9ca31a8372d0c353", + target_criteria=[ + { + "port": 22, + "protocol": "SSH", + "target_attributes": {"hostname": ["test-server", "production-server"]}, + } + ], + type="infrastructure", + account_id="account_id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + application = response.parse() + assert_matches_type(Optional[ApplicationUpdateResponse], application, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip(reason="TODO: investigate broken test") + @parametrize + def test_path_params_update_overload_10(self, client: Cloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `app_id` but received ''"): + client.zero_trust.access.applications.with_raw_response.update( + app_id="", + target_criteria=[ + { + "port": 22, + "protocol": "SSH", + "target_attributes": {"hostname": ["test-server", "production-server"]}, + } + ], + type="infrastructure", + account_id="account_id", + ) + + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): + client.zero_trust.access.applications.with_raw_response.update( + app_id="023e105f4ecef8ad9ca31a8372d0c353", + target_criteria=[ + { + "port": 22, + "protocol": "SSH", + "target_attributes": {"hostname": ["test-server", "production-server"]}, + } ], type="infrastructure", account_id="", @@ -2720,7 +3161,25 @@ def test_method_update_with_all_params_overload_11(self, client: Cloudflare) -> enable_binding_cookie=True, http_only_cookie_attribute=True, logo_url="https://www.cloudflare.com/img/logo-web-badges/cf-logo-on-white-bg.svg", + mfa_config={ + "allowed_authenticators": ["totp", "biometrics", "security_key"], + "mfa_bypass": False, + "session_duration": "24h", + }, name="Admin Site", + oauth_configuration={ + "dynamic_client_registration": { + "allow_any_on_localhost": True, + "allow_any_on_loopback": True, + "allowed_uris": ["https://example.com/callback"], + "enabled": True, + }, + "enabled": True, + "grant": { + "access_token_lifetime": "5m", + "session_duration": "24h", + }, + }, options_preflight_bypass=True, path_cookie_attribute=True, policies=[ @@ -2861,48 +3320,389 @@ def test_path_params_update_overload_11(self, client: Cloudflare) -> None: @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize - def test_method_list(self, client: Cloudflare) -> None: - application = client.zero_trust.access.applications.list( - account_id="account_id", - ) - assert_matches_type(SyncV4PagePaginationArray[ApplicationListResponse], application, path=["response"]) - - @pytest.mark.skip(reason="TODO: investigate broken test") - @parametrize - def test_method_list_with_all_params(self, client: Cloudflare) -> None: - application = client.zero_trust.access.applications.list( - account_id="account_id", - aud="aud", - domain="domain", - exact=True, - name="name", - page=0, - per_page=0, - search="search", - target_attributes="target_attributes", - ) - assert_matches_type(SyncV4PagePaginationArray[ApplicationListResponse], application, path=["response"]) - - @pytest.mark.skip(reason="TODO: investigate broken test") - @parametrize - def test_raw_response_list(self, client: Cloudflare) -> None: - response = client.zero_trust.access.applications.with_raw_response.list( + def test_method_update_overload_12(self, client: Cloudflare) -> None: + application = client.zero_trust.access.applications.update( + app_id="023e105f4ecef8ad9ca31a8372d0c353", + type="mcp", account_id="account_id", ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - application = response.parse() - assert_matches_type(SyncV4PagePaginationArray[ApplicationListResponse], application, path=["response"]) + assert_matches_type(Optional[ApplicationUpdateResponse], application, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize - def test_streaming_response_list(self, client: Cloudflare) -> None: - with client.zero_trust.access.applications.with_streaming_response.list( + def test_method_update_with_all_params_overload_12(self, client: Cloudflare) -> None: + application = client.zero_trust.access.applications.update( + app_id="023e105f4ecef8ad9ca31a8372d0c353", + type="mcp", account_id="account_id", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" + allow_authenticate_via_warp=True, + allowed_idps=["699d98642c564d2e855e9661899b7252"], + auto_redirect_to_identity=True, + custom_deny_message="custom_deny_message", + custom_deny_url="custom_deny_url", + custom_non_identity_deny_url="custom_non_identity_deny_url", + custom_pages=["699d98642c564d2e855e9661899b7252"], + destinations=[ + { + "type": "public", + "uri": "test.example.com/admin", + }, + { + "type": "public", + "uri": "test.anotherexample.com/staff", + }, + { + "cidr": "10.5.0.0/24", + "hostname": "hostname", + "l4_protocol": "tcp", + "port_range": "80-90", + "type": "private", + "vnet_id": "vnet_id", + }, + { + "cidr": "10.5.0.3/32", + "hostname": "hostname", + "l4_protocol": "tcp", + "port_range": "80", + "type": "private", + "vnet_id": "vnet_id", + }, + { + "cidr": "cidr", + "hostname": "private-sni.example.com", + "l4_protocol": "tcp", + "port_range": "port_range", + "type": "private", + "vnet_id": "vnet_id", + }, + { + "mcp_server_id": "mcp-server-1", + "type": "via_mcp_server_portal", + }, + ], + http_only_cookie_attribute=True, + logo_url="https://www.cloudflare.com/img/logo-web-badges/cf-logo-on-white-bg.svg", + name="Admin Site", + oauth_configuration={ + "dynamic_client_registration": { + "allow_any_on_localhost": True, + "allow_any_on_loopback": True, + "allowed_uris": ["https://example.com/callback"], + "enabled": True, + }, + "enabled": True, + "grant": { + "access_token_lifetime": "5m", + "session_duration": "24h", + }, + }, + options_preflight_bypass=True, + policies=[ + { + "id": "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", + "precedence": 0, + } + ], + same_site_cookie_attribute="strict", + scim_config={ + "idp_uid": "idp_uid", + "remote_uri": "remote_uri", + "authentication": { + "password": "password", + "scheme": "httpbasic", + "user": "user", + }, + "deactivate_on_delete": True, + "enabled": True, + "mappings": [ + { + "schema": "urn:ietf:params:scim:schemas:core:2.0:User", + "enabled": True, + "filter": 'title pr or userType eq "Intern"', + "operations": { + "create": True, + "delete": True, + "update": True, + }, + "strictness": "strict", + "transform_jsonata": "$merge([$, {'userName': $substringBefore($.userName, '@') & '+test@' & $substringAfter($.userName, '@')}])", + } + ], + }, + session_duration="24h", + tags=["engineers"], + ) + assert_matches_type(Optional[ApplicationUpdateResponse], application, path=["response"]) + + @pytest.mark.skip(reason="TODO: investigate broken test") + @parametrize + def test_raw_response_update_overload_12(self, client: Cloudflare) -> None: + response = client.zero_trust.access.applications.with_raw_response.update( + app_id="023e105f4ecef8ad9ca31a8372d0c353", + type="mcp", + account_id="account_id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + application = response.parse() + assert_matches_type(Optional[ApplicationUpdateResponse], application, path=["response"]) + + @pytest.mark.skip(reason="TODO: investigate broken test") + @parametrize + def test_streaming_response_update_overload_12(self, client: Cloudflare) -> None: + with client.zero_trust.access.applications.with_streaming_response.update( + app_id="023e105f4ecef8ad9ca31a8372d0c353", + type="mcp", + account_id="account_id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + application = response.parse() + assert_matches_type(Optional[ApplicationUpdateResponse], application, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip(reason="TODO: investigate broken test") + @parametrize + def test_path_params_update_overload_12(self, client: Cloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `app_id` but received ''"): + client.zero_trust.access.applications.with_raw_response.update( + app_id="", + type="mcp", + account_id="account_id", + ) + + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): + client.zero_trust.access.applications.with_raw_response.update( + app_id="023e105f4ecef8ad9ca31a8372d0c353", + type="mcp", + account_id="", + ) + + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): + client.zero_trust.access.applications.with_raw_response.update( + app_id="023e105f4ecef8ad9ca31a8372d0c353", + type="mcp", + account_id="account_id", + ) + + @pytest.mark.skip(reason="TODO: investigate broken test") + @parametrize + def test_method_update_overload_13(self, client: Cloudflare) -> None: + application = client.zero_trust.access.applications.update( + app_id="023e105f4ecef8ad9ca31a8372d0c353", + type="mcp_portal", + account_id="account_id", + ) + assert_matches_type(Optional[ApplicationUpdateResponse], application, path=["response"]) + + @pytest.mark.skip(reason="TODO: investigate broken test") + @parametrize + def test_method_update_with_all_params_overload_13(self, client: Cloudflare) -> None: + application = client.zero_trust.access.applications.update( + app_id="023e105f4ecef8ad9ca31a8372d0c353", + type="mcp_portal", + account_id="account_id", + allow_authenticate_via_warp=True, + allowed_idps=["699d98642c564d2e855e9661899b7252"], + auto_redirect_to_identity=True, + custom_deny_message="custom_deny_message", + custom_deny_url="custom_deny_url", + custom_non_identity_deny_url="custom_non_identity_deny_url", + custom_pages=["699d98642c564d2e855e9661899b7252"], + destinations=[ + { + "type": "public", + "uri": "test.example.com/admin", + }, + { + "type": "public", + "uri": "test.anotherexample.com/staff", + }, + { + "cidr": "10.5.0.0/24", + "hostname": "hostname", + "l4_protocol": "tcp", + "port_range": "80-90", + "type": "private", + "vnet_id": "vnet_id", + }, + { + "cidr": "10.5.0.3/32", + "hostname": "hostname", + "l4_protocol": "tcp", + "port_range": "80", + "type": "private", + "vnet_id": "vnet_id", + }, + { + "cidr": "cidr", + "hostname": "private-sni.example.com", + "l4_protocol": "tcp", + "port_range": "port_range", + "type": "private", + "vnet_id": "vnet_id", + }, + { + "mcp_server_id": "mcp-server-1", + "type": "via_mcp_server_portal", + }, + ], + domain="test.example.com/admin", + http_only_cookie_attribute=True, + logo_url="https://www.cloudflare.com/img/logo-web-badges/cf-logo-on-white-bg.svg", + name="Admin Site", + oauth_configuration={ + "dynamic_client_registration": { + "allow_any_on_localhost": True, + "allow_any_on_loopback": True, + "allowed_uris": ["https://example.com/callback"], + "enabled": True, + }, + "enabled": True, + "grant": { + "access_token_lifetime": "5m", + "session_duration": "24h", + }, + }, + options_preflight_bypass=True, + policies=[ + { + "id": "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", + "precedence": 0, + } + ], + same_site_cookie_attribute="strict", + scim_config={ + "idp_uid": "idp_uid", + "remote_uri": "remote_uri", + "authentication": { + "password": "password", + "scheme": "httpbasic", + "user": "user", + }, + "deactivate_on_delete": True, + "enabled": True, + "mappings": [ + { + "schema": "urn:ietf:params:scim:schemas:core:2.0:User", + "enabled": True, + "filter": 'title pr or userType eq "Intern"', + "operations": { + "create": True, + "delete": True, + "update": True, + }, + "strictness": "strict", + "transform_jsonata": "$merge([$, {'userName': $substringBefore($.userName, '@') & '+test@' & $substringAfter($.userName, '@')}])", + } + ], + }, + session_duration="24h", + tags=["engineers"], + ) + assert_matches_type(Optional[ApplicationUpdateResponse], application, path=["response"]) + + @pytest.mark.skip(reason="TODO: investigate broken test") + @parametrize + def test_raw_response_update_overload_13(self, client: Cloudflare) -> None: + response = client.zero_trust.access.applications.with_raw_response.update( + app_id="023e105f4ecef8ad9ca31a8372d0c353", + type="mcp_portal", + account_id="account_id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + application = response.parse() + assert_matches_type(Optional[ApplicationUpdateResponse], application, path=["response"]) + + @pytest.mark.skip(reason="TODO: investigate broken test") + @parametrize + def test_streaming_response_update_overload_13(self, client: Cloudflare) -> None: + with client.zero_trust.access.applications.with_streaming_response.update( + app_id="023e105f4ecef8ad9ca31a8372d0c353", + type="mcp_portal", + account_id="account_id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + application = response.parse() + assert_matches_type(Optional[ApplicationUpdateResponse], application, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip(reason="TODO: investigate broken test") + @parametrize + def test_path_params_update_overload_13(self, client: Cloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `app_id` but received ''"): + client.zero_trust.access.applications.with_raw_response.update( + app_id="", + type="mcp_portal", + account_id="account_id", + ) + + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): + client.zero_trust.access.applications.with_raw_response.update( + app_id="023e105f4ecef8ad9ca31a8372d0c353", + type="mcp_portal", + account_id="", + ) + + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): + client.zero_trust.access.applications.with_raw_response.update( + app_id="023e105f4ecef8ad9ca31a8372d0c353", + type="mcp_portal", + account_id="account_id", + ) + + @pytest.mark.skip(reason="TODO: investigate broken test") + @parametrize + def test_method_list(self, client: Cloudflare) -> None: + application = client.zero_trust.access.applications.list( + account_id="account_id", + ) + assert_matches_type(SyncV4PagePaginationArray[ApplicationListResponse], application, path=["response"]) + + @pytest.mark.skip(reason="TODO: investigate broken test") + @parametrize + def test_method_list_with_all_params(self, client: Cloudflare) -> None: + application = client.zero_trust.access.applications.list( + account_id="account_id", + aud="aud", + domain="domain", + exact=True, + name="name", + page=0, + per_page=0, + search="search", + target_attributes="target_attributes", + ) + assert_matches_type(SyncV4PagePaginationArray[ApplicationListResponse], application, path=["response"]) + + @pytest.mark.skip(reason="TODO: investigate broken test") + @parametrize + def test_raw_response_list(self, client: Cloudflare) -> None: + response = client.zero_trust.access.applications.with_raw_response.list( + account_id="account_id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + application = response.parse() + assert_matches_type(SyncV4PagePaginationArray[ApplicationListResponse], application, path=["response"]) + + @pytest.mark.skip(reason="TODO: investigate broken test") + @parametrize + def test_streaming_response_list(self, client: Cloudflare) -> None: + with client.zero_trust.access.applications.with_streaming_response.list( + account_id="account_id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" application = response.parse() assert_matches_type(SyncV4PagePaginationArray[ApplicationListResponse], application, path=["response"]) @@ -3206,7 +4006,25 @@ async def test_method_create_with_all_params_overload_1(self, async_client: Asyn enable_binding_cookie=True, http_only_cookie_attribute=True, logo_url="https://www.cloudflare.com/img/logo-web-badges/cf-logo-on-white-bg.svg", + mfa_config={ + "allowed_authenticators": ["totp", "biometrics", "security_key"], + "mfa_bypass": False, + "session_duration": "24h", + }, name="Admin Site", + oauth_configuration={ + "dynamic_client_registration": { + "allow_any_on_localhost": True, + "allow_any_on_loopback": True, + "allowed_uris": ["https://example.com/callback"], + "enabled": True, + }, + "enabled": True, + "grant": { + "access_token_lifetime": "5m", + "session_duration": "24h", + }, + }, options_preflight_bypass=True, path_cookie_attribute=True, policies=[ @@ -3498,7 +4316,25 @@ async def test_method_create_with_all_params_overload_3(self, async_client: Asyn enable_binding_cookie=True, http_only_cookie_attribute=True, logo_url="https://www.cloudflare.com/img/logo-web-badges/cf-logo-on-white-bg.svg", + mfa_config={ + "allowed_authenticators": ["totp", "biometrics", "security_key"], + "mfa_bypass": False, + "session_duration": "24h", + }, name="Admin Site", + oauth_configuration={ + "dynamic_client_registration": { + "allow_any_on_localhost": True, + "allow_any_on_loopback": True, + "allowed_uris": ["https://example.com/callback"], + "enabled": True, + }, + "enabled": True, + "grant": { + "access_token_lifetime": "5m", + "session_duration": "24h", + }, + }, options_preflight_bypass=True, path_cookie_attribute=True, policies=[ @@ -3667,7 +4503,25 @@ async def test_method_create_with_all_params_overload_4(self, async_client: Asyn enable_binding_cookie=True, http_only_cookie_attribute=True, logo_url="https://www.cloudflare.com/img/logo-web-badges/cf-logo-on-white-bg.svg", + mfa_config={ + "allowed_authenticators": ["totp", "biometrics", "security_key"], + "mfa_bypass": False, + "session_duration": "24h", + }, name="Admin Site", + oauth_configuration={ + "dynamic_client_registration": { + "allow_any_on_localhost": True, + "allow_any_on_loopback": True, + "allowed_uris": ["https://example.com/callback"], + "enabled": True, + }, + "enabled": True, + "grant": { + "access_token_lifetime": "5m", + "session_duration": "24h", + }, + }, options_preflight_bypass=True, path_cookie_attribute=True, policies=[ @@ -4094,14 +4948,335 @@ async def test_method_create_with_all_params_overload_9(self, async_client: Asyn } ], tags=["engineers"], - type="bookmark", + type="bookmark", + ) + assert_matches_type(Optional[ApplicationCreateResponse], application, path=["response"]) + + @pytest.mark.skip(reason="TODO: investigate broken test") + @parametrize + async def test_raw_response_create_overload_9(self, async_client: AsyncCloudflare) -> None: + response = await async_client.zero_trust.access.applications.with_raw_response.create( + account_id="account_id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + application = await response.parse() + assert_matches_type(Optional[ApplicationCreateResponse], application, path=["response"]) + + @pytest.mark.skip(reason="TODO: investigate broken test") + @parametrize + async def test_streaming_response_create_overload_9(self, async_client: AsyncCloudflare) -> None: + async with async_client.zero_trust.access.applications.with_streaming_response.create( + account_id="account_id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + application = await response.parse() + assert_matches_type(Optional[ApplicationCreateResponse], application, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip(reason="TODO: investigate broken test") + @parametrize + async def test_path_params_create_overload_9(self, async_client: AsyncCloudflare) -> None: + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): + await async_client.zero_trust.access.applications.with_raw_response.create( + account_id="", + ) + + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): + await async_client.zero_trust.access.applications.with_raw_response.create( + account_id="account_id", + ) + + @pytest.mark.skip(reason="TODO: investigate broken test") + @parametrize + async def test_method_create_overload_10(self, async_client: AsyncCloudflare) -> None: + application = await async_client.zero_trust.access.applications.create( + target_criteria=[ + { + "port": 22, + "protocol": "SSH", + "target_attributes": {"hostname": ["test-server", "production-server"]}, + } + ], + type="infrastructure", + account_id="account_id", + ) + assert_matches_type(Optional[ApplicationCreateResponse], application, path=["response"]) + + @pytest.mark.skip(reason="TODO: investigate broken test") + @parametrize + async def test_method_create_with_all_params_overload_10(self, async_client: AsyncCloudflare) -> None: + application = await async_client.zero_trust.access.applications.create( + target_criteria=[ + { + "port": 22, + "protocol": "SSH", + "target_attributes": {"hostname": ["test-server", "production-server"]}, + } + ], + type="infrastructure", + account_id="account_id", + name="Admin Site", + policies=[ + { + "decision": "allow", + "include": [{"group": {"id": "aa0a4aab-672b-4bdb-bc33-a59f1130a11f"}}], + "name": "Allow devs", + "connection_rules": { + "ssh": { + "usernames": ["root", "ubuntu"], + "allow_email_alias": True, + } + }, + "exclude": [{"group": {"id": "aa0a4aab-672b-4bdb-bc33-a59f1130a11f"}}], + "require": [{"group": {"id": "aa0a4aab-672b-4bdb-bc33-a59f1130a11f"}}], + } + ], + ) + assert_matches_type(Optional[ApplicationCreateResponse], application, path=["response"]) + + @pytest.mark.skip(reason="TODO: investigate broken test") + @parametrize + async def test_raw_response_create_overload_10(self, async_client: AsyncCloudflare) -> None: + response = await async_client.zero_trust.access.applications.with_raw_response.create( + target_criteria=[ + { + "port": 22, + "protocol": "SSH", + "target_attributes": {"hostname": ["test-server", "production-server"]}, + } + ], + type="infrastructure", + account_id="account_id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + application = await response.parse() + assert_matches_type(Optional[ApplicationCreateResponse], application, path=["response"]) + + @pytest.mark.skip(reason="TODO: investigate broken test") + @parametrize + async def test_streaming_response_create_overload_10(self, async_client: AsyncCloudflare) -> None: + async with async_client.zero_trust.access.applications.with_streaming_response.create( + target_criteria=[ + { + "port": 22, + "protocol": "SSH", + "target_attributes": {"hostname": ["test-server", "production-server"]}, + } + ], + type="infrastructure", + account_id="account_id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + application = await response.parse() + assert_matches_type(Optional[ApplicationCreateResponse], application, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip(reason="TODO: investigate broken test") + @parametrize + async def test_path_params_create_overload_10(self, async_client: AsyncCloudflare) -> None: + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): + await async_client.zero_trust.access.applications.with_raw_response.create( + target_criteria=[ + { + "port": 22, + "protocol": "SSH", + "target_attributes": {"hostname": ["test-server", "production-server"]}, + } + ], + type="infrastructure", + account_id="", + ) + + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): + await async_client.zero_trust.access.applications.with_raw_response.create( + target_criteria=[ + { + "port": 22, + "protocol": "SSH", + "target_attributes": {"hostname": ["test-server", "production-server"]}, + } + ], + type="infrastructure", + account_id="account_id", + ) + + @pytest.mark.skip(reason="TODO: investigate broken test") + @parametrize + async def test_method_create_overload_11(self, async_client: AsyncCloudflare) -> None: + application = await async_client.zero_trust.access.applications.create( + domain="test.example.com/admin", + target_criteria=[ + { + "port": 22, + "protocol": "RDP", + "target_attributes": {"hostname": ["test-server", "production-server"]}, + } + ], + type="self_hosted", + account_id="account_id", + ) + assert_matches_type(Optional[ApplicationCreateResponse], application, path=["response"]) + + @pytest.mark.skip(reason="TODO: investigate broken test") + @parametrize + async def test_method_create_with_all_params_overload_11(self, async_client: AsyncCloudflare) -> None: + application = await async_client.zero_trust.access.applications.create( + domain="test.example.com/admin", + target_criteria=[ + { + "port": 22, + "protocol": "RDP", + "target_attributes": {"hostname": ["test-server", "production-server"]}, + } + ], + type="self_hosted", + account_id="account_id", + allow_authenticate_via_warp=True, + allow_iframe=True, + allowed_idps=["699d98642c564d2e855e9661899b7252"], + app_launcher_visible=True, + auto_redirect_to_identity=True, + cors_headers={ + "allow_all_headers": True, + "allow_all_methods": True, + "allow_all_origins": True, + "allow_credentials": True, + "allowed_headers": ["string"], + "allowed_methods": ["GET"], + "allowed_origins": ["https://example.com"], + "max_age": -1, + }, + custom_deny_message="custom_deny_message", + custom_deny_url="custom_deny_url", + custom_non_identity_deny_url="custom_non_identity_deny_url", + custom_pages=["699d98642c564d2e855e9661899b7252"], + destinations=[ + { + "type": "public", + "uri": "test.example.com/admin", + }, + { + "type": "public", + "uri": "test.anotherexample.com/staff", + }, + { + "cidr": "10.5.0.0/24", + "hostname": "hostname", + "l4_protocol": "tcp", + "port_range": "80-90", + "type": "private", + "vnet_id": "vnet_id", + }, + { + "cidr": "10.5.0.3/32", + "hostname": "hostname", + "l4_protocol": "tcp", + "port_range": "80", + "type": "private", + "vnet_id": "vnet_id", + }, + { + "cidr": "cidr", + "hostname": "private-sni.example.com", + "l4_protocol": "tcp", + "port_range": "port_range", + "type": "private", + "vnet_id": "vnet_id", + }, + { + "mcp_server_id": "mcp-server-1", + "type": "via_mcp_server_portal", + }, + ], + enable_binding_cookie=True, + http_only_cookie_attribute=True, + logo_url="https://www.cloudflare.com/img/logo-web-badges/cf-logo-on-white-bg.svg", + mfa_config={ + "allowed_authenticators": ["totp", "biometrics", "security_key"], + "mfa_bypass": False, + "session_duration": "24h", + }, + name="Admin Site", + oauth_configuration={ + "dynamic_client_registration": { + "allow_any_on_localhost": True, + "allow_any_on_loopback": True, + "allowed_uris": ["https://example.com/callback"], + "enabled": True, + }, + "enabled": True, + "grant": { + "access_token_lifetime": "5m", + "session_duration": "24h", + }, + }, + options_preflight_bypass=True, + path_cookie_attribute=True, + policies=[ + { + "id": "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", + "precedence": 0, + } + ], + read_service_tokens_from_header="Authorization", + same_site_cookie_attribute="strict", + scim_config={ + "idp_uid": "idp_uid", + "remote_uri": "remote_uri", + "authentication": { + "password": "password", + "scheme": "httpbasic", + "user": "user", + }, + "deactivate_on_delete": True, + "enabled": True, + "mappings": [ + { + "schema": "urn:ietf:params:scim:schemas:core:2.0:User", + "enabled": True, + "filter": 'title pr or userType eq "Intern"', + "operations": { + "create": True, + "delete": True, + "update": True, + }, + "strictness": "strict", + "transform_jsonata": "$merge([$, {'userName': $substringBefore($.userName, '@') & '+test@' & $substringAfter($.userName, '@')}])", + } + ], + }, + self_hosted_domains=["test.example.com/admin", "test.anotherexample.com/staff"], + service_auth_401_redirect=True, + session_duration="24h", + skip_interstitial=True, + tags=["engineers"], + use_clientless_isolation_app_launcher_url=False, ) assert_matches_type(Optional[ApplicationCreateResponse], application, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize - async def test_raw_response_create_overload_9(self, async_client: AsyncCloudflare) -> None: + async def test_raw_response_create_overload_11(self, async_client: AsyncCloudflare) -> None: response = await async_client.zero_trust.access.applications.with_raw_response.create( + domain="test.example.com/admin", + target_criteria=[ + { + "port": 22, + "protocol": "RDP", + "target_attributes": {"hostname": ["test-server", "production-server"]}, + } + ], + type="self_hosted", account_id="account_id", ) @@ -4112,8 +5287,17 @@ async def test_raw_response_create_overload_9(self, async_client: AsyncCloudflar @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize - async def test_streaming_response_create_overload_9(self, async_client: AsyncCloudflare) -> None: + async def test_streaming_response_create_overload_11(self, async_client: AsyncCloudflare) -> None: async with async_client.zero_trust.access.applications.with_streaming_response.create( + domain="test.example.com/admin", + target_criteria=[ + { + "port": 22, + "protocol": "RDP", + "target_attributes": {"hostname": ["test-server", "production-server"]}, + } + ], + type="self_hosted", account_id="account_id", ) as response: assert not response.is_closed @@ -4126,77 +5310,154 @@ async def test_streaming_response_create_overload_9(self, async_client: AsyncClo @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize - async def test_path_params_create_overload_9(self, async_client: AsyncCloudflare) -> None: + async def test_path_params_create_overload_11(self, async_client: AsyncCloudflare) -> None: with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): await async_client.zero_trust.access.applications.with_raw_response.create( + domain="test.example.com/admin", + target_criteria=[ + { + "port": 22, + "protocol": "RDP", + "target_attributes": {"hostname": ["test-server", "production-server"]}, + } + ], + type="self_hosted", account_id="", ) with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): await async_client.zero_trust.access.applications.with_raw_response.create( + domain="test.example.com/admin", + target_criteria=[ + { + "port": 22, + "protocol": "RDP", + "target_attributes": {"hostname": ["test-server", "production-server"]}, + } + ], + type="self_hosted", account_id="account_id", ) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize - async def test_method_create_overload_10(self, async_client: AsyncCloudflare) -> None: + async def test_method_create_overload_12(self, async_client: AsyncCloudflare) -> None: application = await async_client.zero_trust.access.applications.create( - target_criteria=[ - { - "port": 22, - "protocol": "SSH", - "target_attributes": {"hostname": ["test-server", "production-server"]}, - } - ], - type="infrastructure", + type="mcp", account_id="account_id", ) assert_matches_type(Optional[ApplicationCreateResponse], application, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize - async def test_method_create_with_all_params_overload_10(self, async_client: AsyncCloudflare) -> None: + async def test_method_create_with_all_params_overload_12(self, async_client: AsyncCloudflare) -> None: application = await async_client.zero_trust.access.applications.create( - target_criteria=[ + type="mcp", + account_id="account_id", + allow_authenticate_via_warp=True, + allowed_idps=["699d98642c564d2e855e9661899b7252"], + auto_redirect_to_identity=True, + custom_deny_message="custom_deny_message", + custom_deny_url="custom_deny_url", + custom_non_identity_deny_url="custom_non_identity_deny_url", + custom_pages=["699d98642c564d2e855e9661899b7252"], + destinations=[ { - "port": 22, - "protocol": "SSH", - "target_attributes": {"hostname": ["test-server", "production-server"]}, - } + "type": "public", + "uri": "test.example.com/admin", + }, + { + "type": "public", + "uri": "test.anotherexample.com/staff", + }, + { + "cidr": "10.5.0.0/24", + "hostname": "hostname", + "l4_protocol": "tcp", + "port_range": "80-90", + "type": "private", + "vnet_id": "vnet_id", + }, + { + "cidr": "10.5.0.3/32", + "hostname": "hostname", + "l4_protocol": "tcp", + "port_range": "80", + "type": "private", + "vnet_id": "vnet_id", + }, + { + "cidr": "cidr", + "hostname": "private-sni.example.com", + "l4_protocol": "tcp", + "port_range": "port_range", + "type": "private", + "vnet_id": "vnet_id", + }, + { + "mcp_server_id": "mcp-server-1", + "type": "via_mcp_server_portal", + }, ], - type="infrastructure", - account_id="account_id", + http_only_cookie_attribute=True, + logo_url="https://www.cloudflare.com/img/logo-web-badges/cf-logo-on-white-bg.svg", name="Admin Site", + oauth_configuration={ + "dynamic_client_registration": { + "allow_any_on_localhost": True, + "allow_any_on_loopback": True, + "allowed_uris": ["https://example.com/callback"], + "enabled": True, + }, + "enabled": True, + "grant": { + "access_token_lifetime": "5m", + "session_duration": "24h", + }, + }, + options_preflight_bypass=True, policies=[ { - "decision": "allow", - "include": [{"group": {"id": "aa0a4aab-672b-4bdb-bc33-a59f1130a11f"}}], - "name": "Allow devs", - "connection_rules": { - "ssh": { - "usernames": ["root", "ubuntu"], - "allow_email_alias": True, - } - }, - "exclude": [{"group": {"id": "aa0a4aab-672b-4bdb-bc33-a59f1130a11f"}}], - "require": [{"group": {"id": "aa0a4aab-672b-4bdb-bc33-a59f1130a11f"}}], + "id": "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", + "precedence": 0, } ], + same_site_cookie_attribute="strict", + scim_config={ + "idp_uid": "idp_uid", + "remote_uri": "remote_uri", + "authentication": { + "password": "password", + "scheme": "httpbasic", + "user": "user", + }, + "deactivate_on_delete": True, + "enabled": True, + "mappings": [ + { + "schema": "urn:ietf:params:scim:schemas:core:2.0:User", + "enabled": True, + "filter": 'title pr or userType eq "Intern"', + "operations": { + "create": True, + "delete": True, + "update": True, + }, + "strictness": "strict", + "transform_jsonata": "$merge([$, {'userName': $substringBefore($.userName, '@') & '+test@' & $substringAfter($.userName, '@')}])", + } + ], + }, + session_duration="24h", + tags=["engineers"], ) assert_matches_type(Optional[ApplicationCreateResponse], application, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize - async def test_raw_response_create_overload_10(self, async_client: AsyncCloudflare) -> None: + async def test_raw_response_create_overload_12(self, async_client: AsyncCloudflare) -> None: response = await async_client.zero_trust.access.applications.with_raw_response.create( - target_criteria=[ - { - "port": 22, - "protocol": "SSH", - "target_attributes": {"hostname": ["test-server", "production-server"]}, - } - ], - type="infrastructure", + type="mcp", account_id="account_id", ) @@ -4207,16 +5468,9 @@ async def test_raw_response_create_overload_10(self, async_client: AsyncCloudfla @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize - async def test_streaming_response_create_overload_10(self, async_client: AsyncCloudflare) -> None: + async def test_streaming_response_create_overload_12(self, async_client: AsyncCloudflare) -> None: async with async_client.zero_trust.access.applications.with_streaming_response.create( - target_criteria=[ - { - "port": 22, - "protocol": "SSH", - "target_attributes": {"hostname": ["test-server", "production-server"]}, - } - ], - type="infrastructure", + type="mcp", account_id="account_id", ) as response: assert not response.is_closed @@ -4229,79 +5483,37 @@ async def test_streaming_response_create_overload_10(self, async_client: AsyncCl @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize - async def test_path_params_create_overload_10(self, async_client: AsyncCloudflare) -> None: + async def test_path_params_create_overload_12(self, async_client: AsyncCloudflare) -> None: with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): await async_client.zero_trust.access.applications.with_raw_response.create( - target_criteria=[ - { - "port": 22, - "protocol": "SSH", - "target_attributes": {"hostname": ["test-server", "production-server"]}, - } - ], - type="infrastructure", + type="mcp", account_id="", ) with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): await async_client.zero_trust.access.applications.with_raw_response.create( - target_criteria=[ - { - "port": 22, - "protocol": "SSH", - "target_attributes": {"hostname": ["test-server", "production-server"]}, - } - ], - type="infrastructure", + type="mcp", account_id="account_id", ) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize - async def test_method_create_overload_11(self, async_client: AsyncCloudflare) -> None: + async def test_method_create_overload_13(self, async_client: AsyncCloudflare) -> None: application = await async_client.zero_trust.access.applications.create( - domain="test.example.com/admin", - target_criteria=[ - { - "port": 22, - "protocol": "RDP", - "target_attributes": {"hostname": ["test-server", "production-server"]}, - } - ], - type="self_hosted", + type="mcp_portal", account_id="account_id", ) assert_matches_type(Optional[ApplicationCreateResponse], application, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize - async def test_method_create_with_all_params_overload_11(self, async_client: AsyncCloudflare) -> None: + async def test_method_create_with_all_params_overload_13(self, async_client: AsyncCloudflare) -> None: application = await async_client.zero_trust.access.applications.create( - domain="test.example.com/admin", - target_criteria=[ - { - "port": 22, - "protocol": "RDP", - "target_attributes": {"hostname": ["test-server", "production-server"]}, - } - ], - type="self_hosted", + type="mcp_portal", account_id="account_id", allow_authenticate_via_warp=True, - allow_iframe=True, allowed_idps=["699d98642c564d2e855e9661899b7252"], - app_launcher_visible=True, auto_redirect_to_identity=True, - cors_headers={ - "allow_all_headers": True, - "allow_all_methods": True, - "allow_all_origins": True, - "allow_credentials": True, - "allowed_headers": ["string"], - "allowed_methods": ["GET"], - "allowed_origins": ["https://example.com"], - "max_age": -1, - }, custom_deny_message="custom_deny_message", custom_deny_url="custom_deny_url", custom_non_identity_deny_url="custom_non_identity_deny_url", @@ -4344,19 +5556,30 @@ async def test_method_create_with_all_params_overload_11(self, async_client: Asy "type": "via_mcp_server_portal", }, ], - enable_binding_cookie=True, + domain="test.example.com/admin", http_only_cookie_attribute=True, logo_url="https://www.cloudflare.com/img/logo-web-badges/cf-logo-on-white-bg.svg", name="Admin Site", + oauth_configuration={ + "dynamic_client_registration": { + "allow_any_on_localhost": True, + "allow_any_on_loopback": True, + "allowed_uris": ["https://example.com/callback"], + "enabled": True, + }, + "enabled": True, + "grant": { + "access_token_lifetime": "5m", + "session_duration": "24h", + }, + }, options_preflight_bypass=True, - path_cookie_attribute=True, policies=[ { "id": "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", "precedence": 0, } ], - read_service_tokens_from_header="Authorization", same_site_cookie_attribute="strict", scim_config={ "idp_uid": "idp_uid", @@ -4383,28 +5606,16 @@ async def test_method_create_with_all_params_overload_11(self, async_client: Asy } ], }, - self_hosted_domains=["test.example.com/admin", "test.anotherexample.com/staff"], - service_auth_401_redirect=True, session_duration="24h", - skip_interstitial=True, tags=["engineers"], - use_clientless_isolation_app_launcher_url=False, ) assert_matches_type(Optional[ApplicationCreateResponse], application, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize - async def test_raw_response_create_overload_11(self, async_client: AsyncCloudflare) -> None: + async def test_raw_response_create_overload_13(self, async_client: AsyncCloudflare) -> None: response = await async_client.zero_trust.access.applications.with_raw_response.create( - domain="test.example.com/admin", - target_criteria=[ - { - "port": 22, - "protocol": "RDP", - "target_attributes": {"hostname": ["test-server", "production-server"]}, - } - ], - type="self_hosted", + type="mcp_portal", account_id="account_id", ) @@ -4415,17 +5626,9 @@ async def test_raw_response_create_overload_11(self, async_client: AsyncCloudfla @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize - async def test_streaming_response_create_overload_11(self, async_client: AsyncCloudflare) -> None: + async def test_streaming_response_create_overload_13(self, async_client: AsyncCloudflare) -> None: async with async_client.zero_trust.access.applications.with_streaming_response.create( - domain="test.example.com/admin", - target_criteria=[ - { - "port": 22, - "protocol": "RDP", - "target_attributes": {"hostname": ["test-server", "production-server"]}, - } - ], - type="self_hosted", + type="mcp_portal", account_id="account_id", ) as response: assert not response.is_closed @@ -4438,32 +5641,16 @@ async def test_streaming_response_create_overload_11(self, async_client: AsyncCl @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize - async def test_path_params_create_overload_11(self, async_client: AsyncCloudflare) -> None: + async def test_path_params_create_overload_13(self, async_client: AsyncCloudflare) -> None: with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): await async_client.zero_trust.access.applications.with_raw_response.create( - domain="test.example.com/admin", - target_criteria=[ - { - "port": 22, - "protocol": "RDP", - "target_attributes": {"hostname": ["test-server", "production-server"]}, - } - ], - type="self_hosted", + type="mcp_portal", account_id="", ) with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): await async_client.zero_trust.access.applications.with_raw_response.create( - domain="test.example.com/admin", - target_criteria=[ - { - "port": 22, - "protocol": "RDP", - "target_attributes": {"hostname": ["test-server", "production-server"]}, - } - ], - type="self_hosted", + type="mcp_portal", account_id="account_id", ) @@ -4546,7 +5733,25 @@ async def test_method_update_with_all_params_overload_1(self, async_client: Asyn enable_binding_cookie=True, http_only_cookie_attribute=True, logo_url="https://www.cloudflare.com/img/logo-web-badges/cf-logo-on-white-bg.svg", + mfa_config={ + "allowed_authenticators": ["totp", "biometrics", "security_key"], + "mfa_bypass": False, + "session_duration": "24h", + }, name="Admin Site", + oauth_configuration={ + "dynamic_client_registration": { + "allow_any_on_localhost": True, + "allow_any_on_loopback": True, + "allowed_uris": ["https://example.com/callback"], + "enabled": True, + }, + "enabled": True, + "grant": { + "access_token_lifetime": "5m", + "session_duration": "24h", + }, + }, options_preflight_bypass=True, path_cookie_attribute=True, policies=[ @@ -4864,7 +6069,25 @@ async def test_method_update_with_all_params_overload_3(self, async_client: Asyn enable_binding_cookie=True, http_only_cookie_attribute=True, logo_url="https://www.cloudflare.com/img/logo-web-badges/cf-logo-on-white-bg.svg", + mfa_config={ + "allowed_authenticators": ["totp", "biometrics", "security_key"], + "mfa_bypass": False, + "session_duration": "24h", + }, name="Admin Site", + oauth_configuration={ + "dynamic_client_registration": { + "allow_any_on_localhost": True, + "allow_any_on_loopback": True, + "allowed_uris": ["https://example.com/callback"], + "enabled": True, + }, + "enabled": True, + "grant": { + "access_token_lifetime": "5m", + "session_duration": "24h", + }, + }, options_preflight_bypass=True, path_cookie_attribute=True, policies=[ @@ -5047,7 +6270,25 @@ async def test_method_update_with_all_params_overload_4(self, async_client: Asyn enable_binding_cookie=True, http_only_cookie_attribute=True, logo_url="https://www.cloudflare.com/img/logo-web-badges/cf-logo-on-white-bg.svg", + mfa_config={ + "allowed_authenticators": ["totp", "biometrics", "security_key"], + "mfa_bypass": False, + "session_duration": "24h", + }, name="Admin Site", + oauth_configuration={ + "dynamic_client_registration": { + "allow_any_on_localhost": True, + "allow_any_on_loopback": True, + "allowed_uris": ["https://example.com/callback"], + "enabled": True, + }, + "enabled": True, + "grant": { + "access_token_lifetime": "5m", + "session_duration": "24h", + }, + }, options_preflight_bypass=True, path_cookie_attribute=True, policies=[ @@ -5422,50 +6663,240 @@ async def test_path_params_update_overload_7(self, async_client: AsyncCloudflare with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): await async_client.zero_trust.access.applications.with_raw_response.update( app_id="023e105f4ecef8ad9ca31a8372d0c353", - type="self_hosted", + type="self_hosted", + account_id="account_id", + ) + + @pytest.mark.skip(reason="TODO: investigate broken test") + @parametrize + async def test_method_update_overload_8(self, async_client: AsyncCloudflare) -> None: + application = await async_client.zero_trust.access.applications.update( + app_id="023e105f4ecef8ad9ca31a8372d0c353", + type="self_hosted", + account_id="account_id", + ) + assert_matches_type(Optional[ApplicationUpdateResponse], application, path=["response"]) + + @pytest.mark.skip(reason="TODO: investigate broken test") + @parametrize + async def test_method_update_with_all_params_overload_8(self, async_client: AsyncCloudflare) -> None: + application = await async_client.zero_trust.access.applications.update( + app_id="023e105f4ecef8ad9ca31a8372d0c353", + type="self_hosted", + account_id="account_id", + allowed_idps=["699d98642c564d2e855e9661899b7252"], + auto_redirect_to_identity=True, + custom_deny_url="custom_deny_url", + custom_non_identity_deny_url="custom_non_identity_deny_url", + custom_pages=["699d98642c564d2e855e9661899b7252"], + domain="abcd123456.proxy.cloudflare-gateway.com", + name="Gateway Proxy", + policies=[ + { + "id": "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", + "precedence": 0, + } + ], + session_duration="24h", + ) + assert_matches_type(Optional[ApplicationUpdateResponse], application, path=["response"]) + + @pytest.mark.skip(reason="TODO: investigate broken test") + @parametrize + async def test_raw_response_update_overload_8(self, async_client: AsyncCloudflare) -> None: + response = await async_client.zero_trust.access.applications.with_raw_response.update( + app_id="023e105f4ecef8ad9ca31a8372d0c353", + type="self_hosted", + account_id="account_id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + application = await response.parse() + assert_matches_type(Optional[ApplicationUpdateResponse], application, path=["response"]) + + @pytest.mark.skip(reason="TODO: investigate broken test") + @parametrize + async def test_streaming_response_update_overload_8(self, async_client: AsyncCloudflare) -> None: + async with async_client.zero_trust.access.applications.with_streaming_response.update( + app_id="023e105f4ecef8ad9ca31a8372d0c353", + type="self_hosted", + account_id="account_id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + application = await response.parse() + assert_matches_type(Optional[ApplicationUpdateResponse], application, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip(reason="TODO: investigate broken test") + @parametrize + async def test_path_params_update_overload_8(self, async_client: AsyncCloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `app_id` but received ''"): + await async_client.zero_trust.access.applications.with_raw_response.update( + app_id="", + type="self_hosted", + account_id="account_id", + ) + + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): + await async_client.zero_trust.access.applications.with_raw_response.update( + app_id="023e105f4ecef8ad9ca31a8372d0c353", + type="self_hosted", + account_id="", + ) + + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): + await async_client.zero_trust.access.applications.with_raw_response.update( + app_id="023e105f4ecef8ad9ca31a8372d0c353", + type="self_hosted", + account_id="account_id", + ) + + @pytest.mark.skip(reason="TODO: investigate broken test") + @parametrize + async def test_method_update_overload_9(self, async_client: AsyncCloudflare) -> None: + application = await async_client.zero_trust.access.applications.update( + app_id="023e105f4ecef8ad9ca31a8372d0c353", + account_id="account_id", + ) + assert_matches_type(Optional[ApplicationUpdateResponse], application, path=["response"]) + + @pytest.mark.skip(reason="TODO: investigate broken test") + @parametrize + async def test_method_update_with_all_params_overload_9(self, async_client: AsyncCloudflare) -> None: + application = await async_client.zero_trust.access.applications.update( + app_id="023e105f4ecef8ad9ca31a8372d0c353", + account_id="account_id", + app_launcher_visible=True, + domain="https://mybookmark.com", + logo_url="https://www.cloudflare.com/img/logo-web-badges/cf-logo-on-white-bg.svg", + name="Admin Site", + policies=[ + { + "id": "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", + "precedence": 0, + } + ], + tags=["engineers"], + type="bookmark", + ) + assert_matches_type(Optional[ApplicationUpdateResponse], application, path=["response"]) + + @pytest.mark.skip(reason="TODO: investigate broken test") + @parametrize + async def test_raw_response_update_overload_9(self, async_client: AsyncCloudflare) -> None: + response = await async_client.zero_trust.access.applications.with_raw_response.update( + app_id="023e105f4ecef8ad9ca31a8372d0c353", + account_id="account_id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + application = await response.parse() + assert_matches_type(Optional[ApplicationUpdateResponse], application, path=["response"]) + + @pytest.mark.skip(reason="TODO: investigate broken test") + @parametrize + async def test_streaming_response_update_overload_9(self, async_client: AsyncCloudflare) -> None: + async with async_client.zero_trust.access.applications.with_streaming_response.update( + app_id="023e105f4ecef8ad9ca31a8372d0c353", + account_id="account_id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + application = await response.parse() + assert_matches_type(Optional[ApplicationUpdateResponse], application, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip(reason="TODO: investigate broken test") + @parametrize + async def test_path_params_update_overload_9(self, async_client: AsyncCloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `app_id` but received ''"): + await async_client.zero_trust.access.applications.with_raw_response.update( + app_id="", + account_id="account_id", + ) + + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): + await async_client.zero_trust.access.applications.with_raw_response.update( + app_id="023e105f4ecef8ad9ca31a8372d0c353", + account_id="", + ) + + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): + await async_client.zero_trust.access.applications.with_raw_response.update( + app_id="023e105f4ecef8ad9ca31a8372d0c353", account_id="account_id", ) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize - async def test_method_update_overload_8(self, async_client: AsyncCloudflare) -> None: + async def test_method_update_overload_10(self, async_client: AsyncCloudflare) -> None: application = await async_client.zero_trust.access.applications.update( app_id="023e105f4ecef8ad9ca31a8372d0c353", - type="self_hosted", + target_criteria=[ + { + "port": 22, + "protocol": "SSH", + "target_attributes": {"hostname": ["test-server", "production-server"]}, + } + ], + type="infrastructure", account_id="account_id", ) assert_matches_type(Optional[ApplicationUpdateResponse], application, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize - async def test_method_update_with_all_params_overload_8(self, async_client: AsyncCloudflare) -> None: + async def test_method_update_with_all_params_overload_10(self, async_client: AsyncCloudflare) -> None: application = await async_client.zero_trust.access.applications.update( app_id="023e105f4ecef8ad9ca31a8372d0c353", - type="self_hosted", + target_criteria=[ + { + "port": 22, + "protocol": "SSH", + "target_attributes": {"hostname": ["test-server", "production-server"]}, + } + ], + type="infrastructure", account_id="account_id", - allowed_idps=["699d98642c564d2e855e9661899b7252"], - auto_redirect_to_identity=True, - custom_deny_url="custom_deny_url", - custom_non_identity_deny_url="custom_non_identity_deny_url", - custom_pages=["699d98642c564d2e855e9661899b7252"], - domain="abcd123456.proxy.cloudflare-gateway.com", - name="Gateway Proxy", + name="Admin Site", policies=[ { - "id": "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", - "precedence": 0, + "decision": "allow", + "include": [{"group": {"id": "aa0a4aab-672b-4bdb-bc33-a59f1130a11f"}}], + "name": "Allow devs", + "connection_rules": { + "ssh": { + "usernames": ["root", "ubuntu"], + "allow_email_alias": True, + } + }, + "exclude": [{"group": {"id": "aa0a4aab-672b-4bdb-bc33-a59f1130a11f"}}], + "require": [{"group": {"id": "aa0a4aab-672b-4bdb-bc33-a59f1130a11f"}}], } ], - session_duration="24h", ) assert_matches_type(Optional[ApplicationUpdateResponse], application, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize - async def test_raw_response_update_overload_8(self, async_client: AsyncCloudflare) -> None: + async def test_raw_response_update_overload_10(self, async_client: AsyncCloudflare) -> None: response = await async_client.zero_trust.access.applications.with_raw_response.update( app_id="023e105f4ecef8ad9ca31a8372d0c353", - type="self_hosted", + target_criteria=[ + { + "port": 22, + "protocol": "SSH", + "target_attributes": {"hostname": ["test-server", "production-server"]}, + } + ], + type="infrastructure", account_id="account_id", ) @@ -5476,10 +6907,17 @@ async def test_raw_response_update_overload_8(self, async_client: AsyncCloudflar @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize - async def test_streaming_response_update_overload_8(self, async_client: AsyncCloudflare) -> None: + async def test_streaming_response_update_overload_10(self, async_client: AsyncCloudflare) -> None: async with async_client.zero_trust.access.applications.with_streaming_response.update( app_id="023e105f4ecef8ad9ca31a8372d0c353", - type="self_hosted", + target_criteria=[ + { + "port": 22, + "protocol": "SSH", + "target_attributes": {"hostname": ["test-server", "production-server"]}, + } + ], + type="infrastructure", account_id="account_id", ) as response: assert not response.is_closed @@ -5492,63 +6930,219 @@ async def test_streaming_response_update_overload_8(self, async_client: AsyncClo @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize - async def test_path_params_update_overload_8(self, async_client: AsyncCloudflare) -> None: + async def test_path_params_update_overload_10(self, async_client: AsyncCloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `app_id` but received ''"): await async_client.zero_trust.access.applications.with_raw_response.update( app_id="", - type="self_hosted", + target_criteria=[ + { + "port": 22, + "protocol": "SSH", + "target_attributes": {"hostname": ["test-server", "production-server"]}, + } + ], + type="infrastructure", account_id="account_id", ) with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): await async_client.zero_trust.access.applications.with_raw_response.update( app_id="023e105f4ecef8ad9ca31a8372d0c353", - type="self_hosted", + target_criteria=[ + { + "port": 22, + "protocol": "SSH", + "target_attributes": {"hostname": ["test-server", "production-server"]}, + } + ], + type="infrastructure", account_id="", ) with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): await async_client.zero_trust.access.applications.with_raw_response.update( app_id="023e105f4ecef8ad9ca31a8372d0c353", - type="self_hosted", + target_criteria=[ + { + "port": 22, + "protocol": "SSH", + "target_attributes": {"hostname": ["test-server", "production-server"]}, + } + ], + type="infrastructure", account_id="account_id", ) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize - async def test_method_update_overload_9(self, async_client: AsyncCloudflare) -> None: + async def test_method_update_overload_11(self, async_client: AsyncCloudflare) -> None: application = await async_client.zero_trust.access.applications.update( app_id="023e105f4ecef8ad9ca31a8372d0c353", + domain="test.example.com/admin", + target_criteria=[ + { + "port": 22, + "protocol": "RDP", + "target_attributes": {"hostname": ["test-server", "production-server"]}, + } + ], + type="self_hosted", account_id="account_id", ) assert_matches_type(Optional[ApplicationUpdateResponse], application, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize - async def test_method_update_with_all_params_overload_9(self, async_client: AsyncCloudflare) -> None: + async def test_method_update_with_all_params_overload_11(self, async_client: AsyncCloudflare) -> None: application = await async_client.zero_trust.access.applications.update( app_id="023e105f4ecef8ad9ca31a8372d0c353", + domain="test.example.com/admin", + target_criteria=[ + { + "port": 22, + "protocol": "RDP", + "target_attributes": {"hostname": ["test-server", "production-server"]}, + } + ], + type="self_hosted", account_id="account_id", + allow_authenticate_via_warp=True, + allow_iframe=True, + allowed_idps=["699d98642c564d2e855e9661899b7252"], app_launcher_visible=True, - domain="https://mybookmark.com", + auto_redirect_to_identity=True, + cors_headers={ + "allow_all_headers": True, + "allow_all_methods": True, + "allow_all_origins": True, + "allow_credentials": True, + "allowed_headers": ["string"], + "allowed_methods": ["GET"], + "allowed_origins": ["https://example.com"], + "max_age": -1, + }, + custom_deny_message="custom_deny_message", + custom_deny_url="custom_deny_url", + custom_non_identity_deny_url="custom_non_identity_deny_url", + custom_pages=["699d98642c564d2e855e9661899b7252"], + destinations=[ + { + "type": "public", + "uri": "test.example.com/admin", + }, + { + "type": "public", + "uri": "test.anotherexample.com/staff", + }, + { + "cidr": "10.5.0.0/24", + "hostname": "hostname", + "l4_protocol": "tcp", + "port_range": "80-90", + "type": "private", + "vnet_id": "vnet_id", + }, + { + "cidr": "10.5.0.3/32", + "hostname": "hostname", + "l4_protocol": "tcp", + "port_range": "80", + "type": "private", + "vnet_id": "vnet_id", + }, + { + "cidr": "cidr", + "hostname": "private-sni.example.com", + "l4_protocol": "tcp", + "port_range": "port_range", + "type": "private", + "vnet_id": "vnet_id", + }, + { + "mcp_server_id": "mcp-server-1", + "type": "via_mcp_server_portal", + }, + ], + enable_binding_cookie=True, + http_only_cookie_attribute=True, logo_url="https://www.cloudflare.com/img/logo-web-badges/cf-logo-on-white-bg.svg", + mfa_config={ + "allowed_authenticators": ["totp", "biometrics", "security_key"], + "mfa_bypass": False, + "session_duration": "24h", + }, name="Admin Site", + oauth_configuration={ + "dynamic_client_registration": { + "allow_any_on_localhost": True, + "allow_any_on_loopback": True, + "allowed_uris": ["https://example.com/callback"], + "enabled": True, + }, + "enabled": True, + "grant": { + "access_token_lifetime": "5m", + "session_duration": "24h", + }, + }, + options_preflight_bypass=True, + path_cookie_attribute=True, policies=[ { "id": "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", "precedence": 0, } ], + read_service_tokens_from_header="Authorization", + same_site_cookie_attribute="strict", + scim_config={ + "idp_uid": "idp_uid", + "remote_uri": "remote_uri", + "authentication": { + "password": "password", + "scheme": "httpbasic", + "user": "user", + }, + "deactivate_on_delete": True, + "enabled": True, + "mappings": [ + { + "schema": "urn:ietf:params:scim:schemas:core:2.0:User", + "enabled": True, + "filter": 'title pr or userType eq "Intern"', + "operations": { + "create": True, + "delete": True, + "update": True, + }, + "strictness": "strict", + "transform_jsonata": "$merge([$, {'userName': $substringBefore($.userName, '@') & '+test@' & $substringAfter($.userName, '@')}])", + } + ], + }, + self_hosted_domains=["test.example.com/admin", "test.anotherexample.com/staff"], + service_auth_401_redirect=True, + session_duration="24h", + skip_interstitial=True, tags=["engineers"], - type="bookmark", + use_clientless_isolation_app_launcher_url=False, ) assert_matches_type(Optional[ApplicationUpdateResponse], application, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize - async def test_raw_response_update_overload_9(self, async_client: AsyncCloudflare) -> None: + async def test_raw_response_update_overload_11(self, async_client: AsyncCloudflare) -> None: response = await async_client.zero_trust.access.applications.with_raw_response.update( app_id="023e105f4ecef8ad9ca31a8372d0c353", + domain="test.example.com/admin", + target_criteria=[ + { + "port": 22, + "protocol": "RDP", + "target_attributes": {"hostname": ["test-server", "production-server"]}, + } + ], + type="self_hosted", account_id="account_id", ) @@ -5559,9 +7153,18 @@ async def test_raw_response_update_overload_9(self, async_client: AsyncCloudflar @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize - async def test_streaming_response_update_overload_9(self, async_client: AsyncCloudflare) -> None: + async def test_streaming_response_update_overload_11(self, async_client: AsyncCloudflare) -> None: async with async_client.zero_trust.access.applications.with_streaming_response.update( app_id="023e105f4ecef8ad9ca31a8372d0c353", + domain="test.example.com/admin", + target_criteria=[ + { + "port": 22, + "protocol": "RDP", + "target_attributes": {"hostname": ["test-server", "production-server"]}, + } + ], + type="self_hosted", account_id="account_id", ) as response: assert not response.is_closed @@ -5574,88 +7177,174 @@ async def test_streaming_response_update_overload_9(self, async_client: AsyncClo @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize - async def test_path_params_update_overload_9(self, async_client: AsyncCloudflare) -> None: + async def test_path_params_update_overload_11(self, async_client: AsyncCloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `app_id` but received ''"): await async_client.zero_trust.access.applications.with_raw_response.update( app_id="", + domain="test.example.com/admin", + target_criteria=[ + { + "port": 22, + "protocol": "RDP", + "target_attributes": {"hostname": ["test-server", "production-server"]}, + } + ], + type="self_hosted", account_id="account_id", ) with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): await async_client.zero_trust.access.applications.with_raw_response.update( app_id="023e105f4ecef8ad9ca31a8372d0c353", + domain="test.example.com/admin", + target_criteria=[ + { + "port": 22, + "protocol": "RDP", + "target_attributes": {"hostname": ["test-server", "production-server"]}, + } + ], + type="self_hosted", account_id="", ) with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): await async_client.zero_trust.access.applications.with_raw_response.update( app_id="023e105f4ecef8ad9ca31a8372d0c353", + domain="test.example.com/admin", + target_criteria=[ + { + "port": 22, + "protocol": "RDP", + "target_attributes": {"hostname": ["test-server", "production-server"]}, + } + ], + type="self_hosted", account_id="account_id", ) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize - async def test_method_update_overload_10(self, async_client: AsyncCloudflare) -> None: + async def test_method_update_overload_12(self, async_client: AsyncCloudflare) -> None: application = await async_client.zero_trust.access.applications.update( app_id="023e105f4ecef8ad9ca31a8372d0c353", - target_criteria=[ - { - "port": 22, - "protocol": "SSH", - "target_attributes": {"hostname": ["test-server", "production-server"]}, - } - ], - type="infrastructure", + type="mcp", account_id="account_id", ) assert_matches_type(Optional[ApplicationUpdateResponse], application, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize - async def test_method_update_with_all_params_overload_10(self, async_client: AsyncCloudflare) -> None: + async def test_method_update_with_all_params_overload_12(self, async_client: AsyncCloudflare) -> None: application = await async_client.zero_trust.access.applications.update( app_id="023e105f4ecef8ad9ca31a8372d0c353", - target_criteria=[ + type="mcp", + account_id="account_id", + allow_authenticate_via_warp=True, + allowed_idps=["699d98642c564d2e855e9661899b7252"], + auto_redirect_to_identity=True, + custom_deny_message="custom_deny_message", + custom_deny_url="custom_deny_url", + custom_non_identity_deny_url="custom_non_identity_deny_url", + custom_pages=["699d98642c564d2e855e9661899b7252"], + destinations=[ { - "port": 22, - "protocol": "SSH", - "target_attributes": {"hostname": ["test-server", "production-server"]}, - } + "type": "public", + "uri": "test.example.com/admin", + }, + { + "type": "public", + "uri": "test.anotherexample.com/staff", + }, + { + "cidr": "10.5.0.0/24", + "hostname": "hostname", + "l4_protocol": "tcp", + "port_range": "80-90", + "type": "private", + "vnet_id": "vnet_id", + }, + { + "cidr": "10.5.0.3/32", + "hostname": "hostname", + "l4_protocol": "tcp", + "port_range": "80", + "type": "private", + "vnet_id": "vnet_id", + }, + { + "cidr": "cidr", + "hostname": "private-sni.example.com", + "l4_protocol": "tcp", + "port_range": "port_range", + "type": "private", + "vnet_id": "vnet_id", + }, + { + "mcp_server_id": "mcp-server-1", + "type": "via_mcp_server_portal", + }, ], - type="infrastructure", - account_id="account_id", + http_only_cookie_attribute=True, + logo_url="https://www.cloudflare.com/img/logo-web-badges/cf-logo-on-white-bg.svg", name="Admin Site", + oauth_configuration={ + "dynamic_client_registration": { + "allow_any_on_localhost": True, + "allow_any_on_loopback": True, + "allowed_uris": ["https://example.com/callback"], + "enabled": True, + }, + "enabled": True, + "grant": { + "access_token_lifetime": "5m", + "session_duration": "24h", + }, + }, + options_preflight_bypass=True, policies=[ { - "decision": "allow", - "include": [{"group": {"id": "aa0a4aab-672b-4bdb-bc33-a59f1130a11f"}}], - "name": "Allow devs", - "connection_rules": { - "ssh": { - "usernames": ["root", "ubuntu"], - "allow_email_alias": True, - } - }, - "exclude": [{"group": {"id": "aa0a4aab-672b-4bdb-bc33-a59f1130a11f"}}], - "require": [{"group": {"id": "aa0a4aab-672b-4bdb-bc33-a59f1130a11f"}}], + "id": "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", + "precedence": 0, } ], + same_site_cookie_attribute="strict", + scim_config={ + "idp_uid": "idp_uid", + "remote_uri": "remote_uri", + "authentication": { + "password": "password", + "scheme": "httpbasic", + "user": "user", + }, + "deactivate_on_delete": True, + "enabled": True, + "mappings": [ + { + "schema": "urn:ietf:params:scim:schemas:core:2.0:User", + "enabled": True, + "filter": 'title pr or userType eq "Intern"', + "operations": { + "create": True, + "delete": True, + "update": True, + }, + "strictness": "strict", + "transform_jsonata": "$merge([$, {'userName': $substringBefore($.userName, '@') & '+test@' & $substringAfter($.userName, '@')}])", + } + ], + }, + session_duration="24h", + tags=["engineers"], ) assert_matches_type(Optional[ApplicationUpdateResponse], application, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize - async def test_raw_response_update_overload_10(self, async_client: AsyncCloudflare) -> None: + async def test_raw_response_update_overload_12(self, async_client: AsyncCloudflare) -> None: response = await async_client.zero_trust.access.applications.with_raw_response.update( app_id="023e105f4ecef8ad9ca31a8372d0c353", - target_criteria=[ - { - "port": 22, - "protocol": "SSH", - "target_attributes": {"hostname": ["test-server", "production-server"]}, - } - ], - type="infrastructure", + type="mcp", account_id="account_id", ) @@ -5666,17 +7355,10 @@ async def test_raw_response_update_overload_10(self, async_client: AsyncCloudfla @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize - async def test_streaming_response_update_overload_10(self, async_client: AsyncCloudflare) -> None: + async def test_streaming_response_update_overload_12(self, async_client: AsyncCloudflare) -> None: async with async_client.zero_trust.access.applications.with_streaming_response.update( app_id="023e105f4ecef8ad9ca31a8372d0c353", - target_criteria=[ - { - "port": 22, - "protocol": "SSH", - "target_attributes": {"hostname": ["test-server", "production-server"]}, - } - ], - type="infrastructure", + type="mcp", account_id="account_id", ) as response: assert not response.is_closed @@ -5689,97 +7371,48 @@ async def test_streaming_response_update_overload_10(self, async_client: AsyncCl @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize - async def test_path_params_update_overload_10(self, async_client: AsyncCloudflare) -> None: + async def test_path_params_update_overload_12(self, async_client: AsyncCloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `app_id` but received ''"): await async_client.zero_trust.access.applications.with_raw_response.update( app_id="", - target_criteria=[ - { - "port": 22, - "protocol": "SSH", - "target_attributes": {"hostname": ["test-server", "production-server"]}, - } - ], - type="infrastructure", + type="mcp", account_id="account_id", ) with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): await async_client.zero_trust.access.applications.with_raw_response.update( app_id="023e105f4ecef8ad9ca31a8372d0c353", - target_criteria=[ - { - "port": 22, - "protocol": "SSH", - "target_attributes": {"hostname": ["test-server", "production-server"]}, - } - ], - type="infrastructure", + type="mcp", account_id="", ) with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): await async_client.zero_trust.access.applications.with_raw_response.update( app_id="023e105f4ecef8ad9ca31a8372d0c353", - target_criteria=[ - { - "port": 22, - "protocol": "SSH", - "target_attributes": {"hostname": ["test-server", "production-server"]}, - } - ], - type="infrastructure", + type="mcp", account_id="account_id", ) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize - async def test_method_update_overload_11(self, async_client: AsyncCloudflare) -> None: + async def test_method_update_overload_13(self, async_client: AsyncCloudflare) -> None: application = await async_client.zero_trust.access.applications.update( app_id="023e105f4ecef8ad9ca31a8372d0c353", - domain="test.example.com/admin", - target_criteria=[ - { - "port": 22, - "protocol": "RDP", - "target_attributes": {"hostname": ["test-server", "production-server"]}, - } - ], - type="self_hosted", + type="mcp_portal", account_id="account_id", ) assert_matches_type(Optional[ApplicationUpdateResponse], application, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize - async def test_method_update_with_all_params_overload_11(self, async_client: AsyncCloudflare) -> None: + async def test_method_update_with_all_params_overload_13(self, async_client: AsyncCloudflare) -> None: application = await async_client.zero_trust.access.applications.update( app_id="023e105f4ecef8ad9ca31a8372d0c353", - domain="test.example.com/admin", - target_criteria=[ - { - "port": 22, - "protocol": "RDP", - "target_attributes": {"hostname": ["test-server", "production-server"]}, - } - ], - type="self_hosted", + type="mcp_portal", account_id="account_id", allow_authenticate_via_warp=True, - allow_iframe=True, allowed_idps=["699d98642c564d2e855e9661899b7252"], - app_launcher_visible=True, auto_redirect_to_identity=True, - cors_headers={ - "allow_all_headers": True, - "allow_all_methods": True, - "allow_all_origins": True, - "allow_credentials": True, - "allowed_headers": ["string"], - "allowed_methods": ["GET"], - "allowed_origins": ["https://example.com"], - "max_age": -1, - }, custom_deny_message="custom_deny_message", custom_deny_url="custom_deny_url", custom_non_identity_deny_url="custom_non_identity_deny_url", @@ -5822,19 +7455,30 @@ async def test_method_update_with_all_params_overload_11(self, async_client: Asy "type": "via_mcp_server_portal", }, ], - enable_binding_cookie=True, + domain="test.example.com/admin", http_only_cookie_attribute=True, logo_url="https://www.cloudflare.com/img/logo-web-badges/cf-logo-on-white-bg.svg", name="Admin Site", + oauth_configuration={ + "dynamic_client_registration": { + "allow_any_on_localhost": True, + "allow_any_on_loopback": True, + "allowed_uris": ["https://example.com/callback"], + "enabled": True, + }, + "enabled": True, + "grant": { + "access_token_lifetime": "5m", + "session_duration": "24h", + }, + }, options_preflight_bypass=True, - path_cookie_attribute=True, policies=[ { "id": "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", "precedence": 0, } ], - read_service_tokens_from_header="Authorization", same_site_cookie_attribute="strict", scim_config={ "idp_uid": "idp_uid", @@ -5861,29 +7505,17 @@ async def test_method_update_with_all_params_overload_11(self, async_client: Asy } ], }, - self_hosted_domains=["test.example.com/admin", "test.anotherexample.com/staff"], - service_auth_401_redirect=True, session_duration="24h", - skip_interstitial=True, tags=["engineers"], - use_clientless_isolation_app_launcher_url=False, ) assert_matches_type(Optional[ApplicationUpdateResponse], application, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize - async def test_raw_response_update_overload_11(self, async_client: AsyncCloudflare) -> None: + async def test_raw_response_update_overload_13(self, async_client: AsyncCloudflare) -> None: response = await async_client.zero_trust.access.applications.with_raw_response.update( app_id="023e105f4ecef8ad9ca31a8372d0c353", - domain="test.example.com/admin", - target_criteria=[ - { - "port": 22, - "protocol": "RDP", - "target_attributes": {"hostname": ["test-server", "production-server"]}, - } - ], - type="self_hosted", + type="mcp_portal", account_id="account_id", ) @@ -5894,18 +7526,10 @@ async def test_raw_response_update_overload_11(self, async_client: AsyncCloudfla @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize - async def test_streaming_response_update_overload_11(self, async_client: AsyncCloudflare) -> None: + async def test_streaming_response_update_overload_13(self, async_client: AsyncCloudflare) -> None: async with async_client.zero_trust.access.applications.with_streaming_response.update( app_id="023e105f4ecef8ad9ca31a8372d0c353", - domain="test.example.com/admin", - target_criteria=[ - { - "port": 22, - "protocol": "RDP", - "target_attributes": {"hostname": ["test-server", "production-server"]}, - } - ], - type="self_hosted", + type="mcp_portal", account_id="account_id", ) as response: assert not response.is_closed @@ -5918,49 +7542,25 @@ async def test_streaming_response_update_overload_11(self, async_client: AsyncCl @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize - async def test_path_params_update_overload_11(self, async_client: AsyncCloudflare) -> None: + async def test_path_params_update_overload_13(self, async_client: AsyncCloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `app_id` but received ''"): await async_client.zero_trust.access.applications.with_raw_response.update( app_id="", - domain="test.example.com/admin", - target_criteria=[ - { - "port": 22, - "protocol": "RDP", - "target_attributes": {"hostname": ["test-server", "production-server"]}, - } - ], - type="self_hosted", + type="mcp_portal", account_id="account_id", ) with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): await async_client.zero_trust.access.applications.with_raw_response.update( app_id="023e105f4ecef8ad9ca31a8372d0c353", - domain="test.example.com/admin", - target_criteria=[ - { - "port": 22, - "protocol": "RDP", - "target_attributes": {"hostname": ["test-server", "production-server"]}, - } - ], - type="self_hosted", + type="mcp_portal", account_id="", ) with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): await async_client.zero_trust.access.applications.with_raw_response.update( app_id="023e105f4ecef8ad9ca31a8372d0c353", - domain="test.example.com/admin", - target_criteria=[ - { - "port": 22, - "protocol": "RDP", - "target_attributes": {"hostname": ["test-server", "production-server"]}, - } - ], - type="self_hosted", + type="mcp_portal", account_id="account_id", ) diff --git a/tests/api_resources/zero_trust/access/test_policies.py b/tests/api_resources/zero_trust/access/test_policies.py index d03deaa1b48..cd626396e31 100644 --- a/tests/api_resources/zero_trust/access/test_policies.py +++ b/tests/api_resources/zero_trust/access/test_policies.py @@ -56,6 +56,11 @@ def test_method_create_with_all_params(self, client: Cloudflare) -> None: approval_required=True, exclude=[{"group": {"id": "aa0a4aab-672b-4bdb-bc33-a59f1130a11f"}}], isolation_required=False, + mfa_config={ + "allowed_authenticators": ["totp", "biometrics", "security_key"], + "mfa_bypass": False, + "session_duration": "24h", + }, purpose_justification_prompt="Please enter a justification for entering this protected domain.", purpose_justification_required=True, require=[{"group": {"id": "aa0a4aab-672b-4bdb-bc33-a59f1130a11f"}}], @@ -137,6 +142,11 @@ def test_method_update_with_all_params(self, client: Cloudflare) -> None: approval_required=True, exclude=[{"group": {"id": "aa0a4aab-672b-4bdb-bc33-a59f1130a11f"}}], isolation_required=False, + mfa_config={ + "allowed_authenticators": ["totp", "biometrics", "security_key"], + "mfa_bypass": False, + "session_duration": "24h", + }, purpose_justification_prompt="Please enter a justification for entering this protected domain.", purpose_justification_required=True, require=[{"group": {"id": "aa0a4aab-672b-4bdb-bc33-a59f1130a11f"}}], @@ -377,6 +387,11 @@ async def test_method_create_with_all_params(self, async_client: AsyncCloudflare approval_required=True, exclude=[{"group": {"id": "aa0a4aab-672b-4bdb-bc33-a59f1130a11f"}}], isolation_required=False, + mfa_config={ + "allowed_authenticators": ["totp", "biometrics", "security_key"], + "mfa_bypass": False, + "session_duration": "24h", + }, purpose_justification_prompt="Please enter a justification for entering this protected domain.", purpose_justification_required=True, require=[{"group": {"id": "aa0a4aab-672b-4bdb-bc33-a59f1130a11f"}}], @@ -458,6 +473,11 @@ async def test_method_update_with_all_params(self, async_client: AsyncCloudflare approval_required=True, exclude=[{"group": {"id": "aa0a4aab-672b-4bdb-bc33-a59f1130a11f"}}], isolation_required=False, + mfa_config={ + "allowed_authenticators": ["totp", "biometrics", "security_key"], + "mfa_bypass": False, + "session_duration": "24h", + }, purpose_justification_prompt="Please enter a justification for entering this protected domain.", purpose_justification_required=True, require=[{"group": {"id": "aa0a4aab-672b-4bdb-bc33-a59f1130a11f"}}], diff --git a/tests/api_resources/zero_trust/test_organizations.py b/tests/api_resources/zero_trust/test_organizations.py index 655886e4e5c..b8030ef3754 100644 --- a/tests/api_resources/zero_trust/test_organizations.py +++ b/tests/api_resources/zero_trust/test_organizations.py @@ -49,6 +49,12 @@ def test_method_create_with_all_params(self, client: Cloudflare) -> None: "logo_path": "https://example.com/logo.png", "text_color": "#c5ed1b", }, + mfa_config={ + "allowed_authenticators": ["totp", "biometrics", "security_key"], + "session_duration": "24h", + }, + mfa_configuration_allowed=True, + mfa_required_for_all_apps=False, session_duration="24h", ui_read_only_toggle_reason="Temporarily turn off the UI read only lock to make a change via the UI", user_seat_expiration_inactive_time="730h", @@ -133,6 +139,12 @@ def test_method_update_with_all_params(self, client: Cloudflare) -> None: "logo_path": "https://example.com/logo.png", "text_color": "#c5ed1b", }, + mfa_config={ + "allowed_authenticators": ["totp", "biometrics", "security_key"], + "session_duration": "24h", + }, + mfa_configuration_allowed=True, + mfa_required_for_all_apps=False, name="Widget Corps Internal Applications", session_duration="24h", ui_read_only_toggle_reason="Temporarily turn off the UI read only lock to make a change via the UI", @@ -335,6 +347,12 @@ async def test_method_create_with_all_params(self, async_client: AsyncCloudflare "logo_path": "https://example.com/logo.png", "text_color": "#c5ed1b", }, + mfa_config={ + "allowed_authenticators": ["totp", "biometrics", "security_key"], + "session_duration": "24h", + }, + mfa_configuration_allowed=True, + mfa_required_for_all_apps=False, session_duration="24h", ui_read_only_toggle_reason="Temporarily turn off the UI read only lock to make a change via the UI", user_seat_expiration_inactive_time="730h", @@ -419,6 +437,12 @@ async def test_method_update_with_all_params(self, async_client: AsyncCloudflare "logo_path": "https://example.com/logo.png", "text_color": "#c5ed1b", }, + mfa_config={ + "allowed_authenticators": ["totp", "biometrics", "security_key"], + "session_duration": "24h", + }, + mfa_configuration_allowed=True, + mfa_required_for_all_apps=False, name="Widget Corps Internal Applications", session_duration="24h", ui_read_only_toggle_reason="Temporarily turn off the UI read only lock to make a change via the UI", From 90d7acdb5dc0cb0e27e1dde183b46cc579233f37 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 20 Feb 2026 14:14:03 +0000 Subject: [PATCH 022/279] chore(api): update composite API spec --- .stats.yml | 6 +- api.md | 20 + src/cloudflare/resources/workers/__init__.py | 14 + .../workers/observability/__init__.py | 33 + .../workers/observability/observability.py | 102 ++ .../workers/observability/telemetry.py | 560 +++++++++++ src/cloudflare/resources/workers/workers.py | 32 + .../types/workers/observability/__init__.py | 7 + .../observability/telemetry_keys_params.py | 92 ++ .../observability/telemetry_keys_response.py | 17 + .../observability/telemetry_query_params.py | 249 +++++ .../observability/telemetry_query_response.py | 931 ++++++++++++++++++ .../observability/telemetry_values_params.py | 94 ++ .../telemetry_values_response.py | 18 + .../workers/observability/__init__.py | 1 + .../workers/observability/test_telemetry.py | 599 +++++++++++ 16 files changed, 2772 insertions(+), 3 deletions(-) create mode 100644 src/cloudflare/resources/workers/observability/__init__.py create mode 100644 src/cloudflare/resources/workers/observability/observability.py create mode 100644 src/cloudflare/resources/workers/observability/telemetry.py create mode 100644 src/cloudflare/types/workers/observability/telemetry_keys_params.py create mode 100644 src/cloudflare/types/workers/observability/telemetry_keys_response.py create mode 100644 src/cloudflare/types/workers/observability/telemetry_query_params.py create mode 100644 src/cloudflare/types/workers/observability/telemetry_query_response.py create mode 100644 src/cloudflare/types/workers/observability/telemetry_values_params.py create mode 100644 src/cloudflare/types/workers/observability/telemetry_values_response.py create mode 100644 tests/api_resources/workers/observability/__init__.py create mode 100644 tests/api_resources/workers/observability/test_telemetry.py diff --git a/.stats.yml b/.stats.yml index 0e13f2d3de8..354e7898ee1 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ -configured_endpoints: 2025 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-e59c7f0b24659cdde1fce6c38749064dab4ba61506ed74ee410fc6c8b914ea47.yml -openapi_spec_hash: 2550b01c6b4c864c766537327894b8e0 +configured_endpoints: 2028 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-85baac7d01af38270e23adc0ba636483e3b77d113bebc5414bb0bc2a6411f6bc.yml +openapi_spec_hash: a949b858ee079d2be5cf16d6da8d8c18 config_hash: 7a70007089f586cc7b1ebd1808030dd1 diff --git a/api.md b/api.md index e6d030e975e..7eb2c108767 100644 --- a/api.md +++ b/api.md @@ -2623,6 +2623,26 @@ Methods: - client.workers.subdomains.delete(\*, account_id) -> None - client.workers.subdomains.get(\*, account_id) -> SubdomainGetResponse +## Observability + +### Telemetry + +Types: + +```python +from cloudflare.types.workers.observability import ( + TelemetryKeysResponse, + TelemetryQueryResponse, + TelemetryValuesResponse, +) +``` + +Methods: + +- client.workers.observability.telemetry.keys(\*, account_id, \*\*params) -> SyncSinglePage[TelemetryKeysResponse] +- client.workers.observability.telemetry.query(\*, account_id, \*\*params) -> TelemetryQueryResponse +- client.workers.observability.telemetry.values(\*, account_id, \*\*params) -> SyncSinglePage[TelemetryValuesResponse] + # KV ## Namespaces diff --git a/src/cloudflare/resources/workers/__init__.py b/src/cloudflare/resources/workers/__init__.py index a54a129fd66..67e210847ab 100644 --- a/src/cloudflare/resources/workers/__init__.py +++ b/src/cloudflare/resources/workers/__init__.py @@ -56,6 +56,14 @@ SubdomainsResourceWithStreamingResponse, AsyncSubdomainsResourceWithStreamingResponse, ) +from .observability import ( + ObservabilityResource, + AsyncObservabilityResource, + ObservabilityResourceWithRawResponse, + AsyncObservabilityResourceWithRawResponse, + ObservabilityResourceWithStreamingResponse, + AsyncObservabilityResourceWithStreamingResponse, +) from .account_settings import ( AccountSettingsResource, AsyncAccountSettingsResource, @@ -108,6 +116,12 @@ "AsyncSubdomainsResourceWithRawResponse", "SubdomainsResourceWithStreamingResponse", "AsyncSubdomainsResourceWithStreamingResponse", + "ObservabilityResource", + "AsyncObservabilityResource", + "ObservabilityResourceWithRawResponse", + "AsyncObservabilityResourceWithRawResponse", + "ObservabilityResourceWithStreamingResponse", + "AsyncObservabilityResourceWithStreamingResponse", "WorkersResource", "AsyncWorkersResource", "WorkersResourceWithRawResponse", diff --git a/src/cloudflare/resources/workers/observability/__init__.py b/src/cloudflare/resources/workers/observability/__init__.py new file mode 100644 index 00000000000..aa9190629cd --- /dev/null +++ b/src/cloudflare/resources/workers/observability/__init__.py @@ -0,0 +1,33 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from .telemetry import ( + TelemetryResource, + AsyncTelemetryResource, + TelemetryResourceWithRawResponse, + AsyncTelemetryResourceWithRawResponse, + TelemetryResourceWithStreamingResponse, + AsyncTelemetryResourceWithStreamingResponse, +) +from .observability import ( + ObservabilityResource, + AsyncObservabilityResource, + ObservabilityResourceWithRawResponse, + AsyncObservabilityResourceWithRawResponse, + ObservabilityResourceWithStreamingResponse, + AsyncObservabilityResourceWithStreamingResponse, +) + +__all__ = [ + "TelemetryResource", + "AsyncTelemetryResource", + "TelemetryResourceWithRawResponse", + "AsyncTelemetryResourceWithRawResponse", + "TelemetryResourceWithStreamingResponse", + "AsyncTelemetryResourceWithStreamingResponse", + "ObservabilityResource", + "AsyncObservabilityResource", + "ObservabilityResourceWithRawResponse", + "AsyncObservabilityResourceWithRawResponse", + "ObservabilityResourceWithStreamingResponse", + "AsyncObservabilityResourceWithStreamingResponse", +] diff --git a/src/cloudflare/resources/workers/observability/observability.py b/src/cloudflare/resources/workers/observability/observability.py new file mode 100644 index 00000000000..7e09842a71a --- /dev/null +++ b/src/cloudflare/resources/workers/observability/observability.py @@ -0,0 +1,102 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from .telemetry import ( + TelemetryResource, + AsyncTelemetryResource, + TelemetryResourceWithRawResponse, + AsyncTelemetryResourceWithRawResponse, + TelemetryResourceWithStreamingResponse, + AsyncTelemetryResourceWithStreamingResponse, +) +from ...._compat import cached_property +from ...._resource import SyncAPIResource, AsyncAPIResource + +__all__ = ["ObservabilityResource", "AsyncObservabilityResource"] + + +class ObservabilityResource(SyncAPIResource): + @cached_property + def telemetry(self) -> TelemetryResource: + return TelemetryResource(self._client) + + @cached_property + def with_raw_response(self) -> ObservabilityResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers + """ + return ObservabilityResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> ObservabilityResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/cloudflare/cloudflare-python#with_streaming_response + """ + return ObservabilityResourceWithStreamingResponse(self) + + +class AsyncObservabilityResource(AsyncAPIResource): + @cached_property + def telemetry(self) -> AsyncTelemetryResource: + return AsyncTelemetryResource(self._client) + + @cached_property + def with_raw_response(self) -> AsyncObservabilityResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers + """ + return AsyncObservabilityResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> AsyncObservabilityResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/cloudflare/cloudflare-python#with_streaming_response + """ + return AsyncObservabilityResourceWithStreamingResponse(self) + + +class ObservabilityResourceWithRawResponse: + def __init__(self, observability: ObservabilityResource) -> None: + self._observability = observability + + @cached_property + def telemetry(self) -> TelemetryResourceWithRawResponse: + return TelemetryResourceWithRawResponse(self._observability.telemetry) + + +class AsyncObservabilityResourceWithRawResponse: + def __init__(self, observability: AsyncObservabilityResource) -> None: + self._observability = observability + + @cached_property + def telemetry(self) -> AsyncTelemetryResourceWithRawResponse: + return AsyncTelemetryResourceWithRawResponse(self._observability.telemetry) + + +class ObservabilityResourceWithStreamingResponse: + def __init__(self, observability: ObservabilityResource) -> None: + self._observability = observability + + @cached_property + def telemetry(self) -> TelemetryResourceWithStreamingResponse: + return TelemetryResourceWithStreamingResponse(self._observability.telemetry) + + +class AsyncObservabilityResourceWithStreamingResponse: + def __init__(self, observability: AsyncObservabilityResource) -> None: + self._observability = observability + + @cached_property + def telemetry(self) -> AsyncTelemetryResourceWithStreamingResponse: + return AsyncTelemetryResourceWithStreamingResponse(self._observability.telemetry) diff --git a/src/cloudflare/resources/workers/observability/telemetry.py b/src/cloudflare/resources/workers/observability/telemetry.py new file mode 100644 index 00000000000..7e3e42469d4 --- /dev/null +++ b/src/cloudflare/resources/workers/observability/telemetry.py @@ -0,0 +1,560 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Type, Iterable, cast +from typing_extensions import Literal + +import httpx + +from ...._types import Body, Omit, Query, Headers, NotGiven, SequenceNotStr, omit, not_given +from ...._utils import maybe_transform, async_maybe_transform +from ...._compat import cached_property +from ...._resource import SyncAPIResource, AsyncAPIResource +from ...._response import ( + to_raw_response_wrapper, + to_streamed_response_wrapper, + 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.workers.observability import telemetry_keys_params, telemetry_query_params, telemetry_values_params +from ....types.workers.observability.telemetry_keys_response import TelemetryKeysResponse +from ....types.workers.observability.telemetry_query_response import TelemetryQueryResponse +from ....types.workers.observability.telemetry_values_response import TelemetryValuesResponse + +__all__ = ["TelemetryResource", "AsyncTelemetryResource"] + + +class TelemetryResource(SyncAPIResource): + @cached_property + def with_raw_response(self) -> TelemetryResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers + """ + return TelemetryResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> TelemetryResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/cloudflare/cloudflare-python#with_streaming_response + """ + return TelemetryResourceWithStreamingResponse(self) + + def keys( + self, + *, + account_id: str, + datasets: SequenceNotStr[str] | Omit = omit, + filters: Iterable[telemetry_keys_params.Filter] | Omit = omit, + from_: float | Omit = omit, + key_needle: telemetry_keys_params.KeyNeedle | Omit = omit, + limit: float | Omit = omit, + needle: telemetry_keys_params.Needle | Omit = omit, + to: float | 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, + ) -> SyncSinglePage[TelemetryKeysResponse]: + """ + List all the keys in your telemetry events. + + Args: + key_needle: Search for a specific substring in the keys. + + needle: Search for a specific substring in any of the events + + 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( + f"/accounts/{account_id}/workers/observability/telemetry/keys", + page=SyncSinglePage[TelemetryKeysResponse], + body=maybe_transform( + { + "datasets": datasets, + "filters": filters, + "from_": from_, + "key_needle": key_needle, + "limit": limit, + "needle": needle, + "to": to, + }, + telemetry_keys_params.TelemetryKeysParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + model=TelemetryKeysResponse, + method="post", + ) + + def query( + self, + *, + account_id: str, + query_id: str, + timeframe: telemetry_query_params.Timeframe, + chart: bool | Omit = omit, + compare: bool | Omit = omit, + dry: bool | Omit = omit, + granularity: float | Omit = omit, + ignore_series: bool | Omit = omit, + limit: float | Omit = omit, + offset: str | Omit = omit, + offset_by: float | Omit = omit, + offset_direction: str | Omit = omit, + parameters: telemetry_query_params.Parameters | Omit = omit, + pattern_type: Literal["message", "error"] | Omit = omit, + view: Literal["traces", "events", "calculations", "invocations", "requests", "patterns"] | 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, + ) -> TelemetryQueryResponse: + """ + Run a temporary or saved query. + + Args: + query_id: Unique identifier for the query to execute + + timeframe: Time range for the query execution + + chart: Whether to include timeseties data in the response + + compare: Whether to include comparison data with previous time periods + + dry: Whether to perform a dry run without saving the results of the query. Useful for + validation + + granularity: Time granularity for aggregating results (in milliseconds). Controls the + bucketing of time-series data + + ignore_series: Whether to ignore time-series data in the results and return only aggregated + values + + limit: Maximum number of events to return. + + offset: Cursor for pagination to retrieve the next set of results + + offset_by: Number of events to skip for pagination. Used in conjunction with offset + + offset_direction: Direction for offset-based pagination (e.g., 'next', 'prev') + + parameters: Optional parameters to pass to the query execution + + pattern_type: Type of pattern to search for when using pattern-based views + + view: View type for presenting the query results. + + 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._post( + f"/accounts/{account_id}/workers/observability/telemetry/query", + body=maybe_transform( + { + "query_id": query_id, + "timeframe": timeframe, + "chart": chart, + "compare": compare, + "dry": dry, + "granularity": granularity, + "ignore_series": ignore_series, + "limit": limit, + "offset": offset, + "offset_by": offset_by, + "offset_direction": offset_direction, + "parameters": parameters, + "pattern_type": pattern_type, + "view": view, + }, + telemetry_query_params.TelemetryQueryParams, + ), + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + post_parser=ResultWrapper[TelemetryQueryResponse]._unwrapper, + ), + cast_to=cast(Type[TelemetryQueryResponse], ResultWrapper[TelemetryQueryResponse]), + ) + + def values( + self, + *, + account_id: str, + datasets: SequenceNotStr[str], + key: str, + timeframe: telemetry_values_params.Timeframe, + type: Literal["string", "boolean", "number"], + filters: Iterable[telemetry_values_params.Filter] | Omit = omit, + limit: float | Omit = omit, + needle: telemetry_values_params.Needle | 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, + ) -> SyncSinglePage[TelemetryValuesResponse]: + """ + List unique values found in your events. + + Args: + needle: Search for a specific substring in the event. + + 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( + f"/accounts/{account_id}/workers/observability/telemetry/values", + page=SyncSinglePage[TelemetryValuesResponse], + body=maybe_transform( + { + "datasets": datasets, + "key": key, + "timeframe": timeframe, + "type": type, + "filters": filters, + "limit": limit, + "needle": needle, + }, + telemetry_values_params.TelemetryValuesParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + model=TelemetryValuesResponse, + method="post", + ) + + +class AsyncTelemetryResource(AsyncAPIResource): + @cached_property + def with_raw_response(self) -> AsyncTelemetryResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers + """ + return AsyncTelemetryResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> AsyncTelemetryResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/cloudflare/cloudflare-python#with_streaming_response + """ + return AsyncTelemetryResourceWithStreamingResponse(self) + + def keys( + self, + *, + account_id: str, + datasets: SequenceNotStr[str] | Omit = omit, + filters: Iterable[telemetry_keys_params.Filter] | Omit = omit, + from_: float | Omit = omit, + key_needle: telemetry_keys_params.KeyNeedle | Omit = omit, + limit: float | Omit = omit, + needle: telemetry_keys_params.Needle | Omit = omit, + to: float | 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, + ) -> AsyncPaginator[TelemetryKeysResponse, AsyncSinglePage[TelemetryKeysResponse]]: + """ + List all the keys in your telemetry events. + + Args: + key_needle: Search for a specific substring in the keys. + + needle: Search for a specific substring in any of the events + + 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( + f"/accounts/{account_id}/workers/observability/telemetry/keys", + page=AsyncSinglePage[TelemetryKeysResponse], + body=maybe_transform( + { + "datasets": datasets, + "filters": filters, + "from_": from_, + "key_needle": key_needle, + "limit": limit, + "needle": needle, + "to": to, + }, + telemetry_keys_params.TelemetryKeysParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + model=TelemetryKeysResponse, + method="post", + ) + + async def query( + self, + *, + account_id: str, + query_id: str, + timeframe: telemetry_query_params.Timeframe, + chart: bool | Omit = omit, + compare: bool | Omit = omit, + dry: bool | Omit = omit, + granularity: float | Omit = omit, + ignore_series: bool | Omit = omit, + limit: float | Omit = omit, + offset: str | Omit = omit, + offset_by: float | Omit = omit, + offset_direction: str | Omit = omit, + parameters: telemetry_query_params.Parameters | Omit = omit, + pattern_type: Literal["message", "error"] | Omit = omit, + view: Literal["traces", "events", "calculations", "invocations", "requests", "patterns"] | 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, + ) -> TelemetryQueryResponse: + """ + Run a temporary or saved query. + + Args: + query_id: Unique identifier for the query to execute + + timeframe: Time range for the query execution + + chart: Whether to include timeseties data in the response + + compare: Whether to include comparison data with previous time periods + + dry: Whether to perform a dry run without saving the results of the query. Useful for + validation + + granularity: Time granularity for aggregating results (in milliseconds). Controls the + bucketing of time-series data + + ignore_series: Whether to ignore time-series data in the results and return only aggregated + values + + limit: Maximum number of events to return. + + offset: Cursor for pagination to retrieve the next set of results + + offset_by: Number of events to skip for pagination. Used in conjunction with offset + + offset_direction: Direction for offset-based pagination (e.g., 'next', 'prev') + + parameters: Optional parameters to pass to the query execution + + pattern_type: Type of pattern to search for when using pattern-based views + + view: View type for presenting the query results. + + 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 await self._post( + f"/accounts/{account_id}/workers/observability/telemetry/query", + body=await async_maybe_transform( + { + "query_id": query_id, + "timeframe": timeframe, + "chart": chart, + "compare": compare, + "dry": dry, + "granularity": granularity, + "ignore_series": ignore_series, + "limit": limit, + "offset": offset, + "offset_by": offset_by, + "offset_direction": offset_direction, + "parameters": parameters, + "pattern_type": pattern_type, + "view": view, + }, + telemetry_query_params.TelemetryQueryParams, + ), + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + post_parser=ResultWrapper[TelemetryQueryResponse]._unwrapper, + ), + cast_to=cast(Type[TelemetryQueryResponse], ResultWrapper[TelemetryQueryResponse]), + ) + + def values( + self, + *, + account_id: str, + datasets: SequenceNotStr[str], + key: str, + timeframe: telemetry_values_params.Timeframe, + type: Literal["string", "boolean", "number"], + filters: Iterable[telemetry_values_params.Filter] | Omit = omit, + limit: float | Omit = omit, + needle: telemetry_values_params.Needle | 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, + ) -> AsyncPaginator[TelemetryValuesResponse, AsyncSinglePage[TelemetryValuesResponse]]: + """ + List unique values found in your events. + + Args: + needle: Search for a specific substring in the event. + + 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( + f"/accounts/{account_id}/workers/observability/telemetry/values", + page=AsyncSinglePage[TelemetryValuesResponse], + body=maybe_transform( + { + "datasets": datasets, + "key": key, + "timeframe": timeframe, + "type": type, + "filters": filters, + "limit": limit, + "needle": needle, + }, + telemetry_values_params.TelemetryValuesParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + model=TelemetryValuesResponse, + method="post", + ) + + +class TelemetryResourceWithRawResponse: + def __init__(self, telemetry: TelemetryResource) -> None: + self._telemetry = telemetry + + self.keys = to_raw_response_wrapper( + telemetry.keys, + ) + self.query = to_raw_response_wrapper( + telemetry.query, + ) + self.values = to_raw_response_wrapper( + telemetry.values, + ) + + +class AsyncTelemetryResourceWithRawResponse: + def __init__(self, telemetry: AsyncTelemetryResource) -> None: + self._telemetry = telemetry + + self.keys = async_to_raw_response_wrapper( + telemetry.keys, + ) + self.query = async_to_raw_response_wrapper( + telemetry.query, + ) + self.values = async_to_raw_response_wrapper( + telemetry.values, + ) + + +class TelemetryResourceWithStreamingResponse: + def __init__(self, telemetry: TelemetryResource) -> None: + self._telemetry = telemetry + + self.keys = to_streamed_response_wrapper( + telemetry.keys, + ) + self.query = to_streamed_response_wrapper( + telemetry.query, + ) + self.values = to_streamed_response_wrapper( + telemetry.values, + ) + + +class AsyncTelemetryResourceWithStreamingResponse: + def __init__(self, telemetry: AsyncTelemetryResource) -> None: + self._telemetry = telemetry + + self.keys = async_to_streamed_response_wrapper( + telemetry.keys, + ) + self.query = async_to_streamed_response_wrapper( + telemetry.query, + ) + self.values = async_to_streamed_response_wrapper( + telemetry.values, + ) diff --git a/src/cloudflare/resources/workers/workers.py b/src/cloudflare/resources/workers/workers.py index c28090c1f2d..971c066d436 100644 --- a/src/cloudflare/resources/workers/workers.py +++ b/src/cloudflare/resources/workers/workers.py @@ -60,6 +60,14 @@ AccountSettingsResourceWithStreamingResponse, AsyncAccountSettingsResourceWithStreamingResponse, ) +from .observability.observability import ( + ObservabilityResource, + AsyncObservabilityResource, + ObservabilityResourceWithRawResponse, + AsyncObservabilityResourceWithRawResponse, + ObservabilityResourceWithStreamingResponse, + AsyncObservabilityResourceWithStreamingResponse, +) __all__ = ["WorkersResource", "AsyncWorkersResource"] @@ -93,6 +101,10 @@ def domains(self) -> DomainsResource: def subdomains(self) -> SubdomainsResource: return SubdomainsResource(self._client) + @cached_property + def observability(self) -> ObservabilityResource: + return ObservabilityResource(self._client) + @cached_property def with_raw_response(self) -> WorkersResourceWithRawResponse: """ @@ -142,6 +154,10 @@ def domains(self) -> AsyncDomainsResource: def subdomains(self) -> AsyncSubdomainsResource: return AsyncSubdomainsResource(self._client) + @cached_property + def observability(self) -> AsyncObservabilityResource: + return AsyncObservabilityResource(self._client) + @cached_property def with_raw_response(self) -> AsyncWorkersResourceWithRawResponse: """ @@ -194,6 +210,10 @@ def domains(self) -> DomainsResourceWithRawResponse: def subdomains(self) -> SubdomainsResourceWithRawResponse: return SubdomainsResourceWithRawResponse(self._workers.subdomains) + @cached_property + def observability(self) -> ObservabilityResourceWithRawResponse: + return ObservabilityResourceWithRawResponse(self._workers.observability) + class AsyncWorkersResourceWithRawResponse: def __init__(self, workers: AsyncWorkersResource) -> None: @@ -227,6 +247,10 @@ def domains(self) -> AsyncDomainsResourceWithRawResponse: def subdomains(self) -> AsyncSubdomainsResourceWithRawResponse: return AsyncSubdomainsResourceWithRawResponse(self._workers.subdomains) + @cached_property + def observability(self) -> AsyncObservabilityResourceWithRawResponse: + return AsyncObservabilityResourceWithRawResponse(self._workers.observability) + class WorkersResourceWithStreamingResponse: def __init__(self, workers: WorkersResource) -> None: @@ -260,6 +284,10 @@ def domains(self) -> DomainsResourceWithStreamingResponse: def subdomains(self) -> SubdomainsResourceWithStreamingResponse: return SubdomainsResourceWithStreamingResponse(self._workers.subdomains) + @cached_property + def observability(self) -> ObservabilityResourceWithStreamingResponse: + return ObservabilityResourceWithStreamingResponse(self._workers.observability) + class AsyncWorkersResourceWithStreamingResponse: def __init__(self, workers: AsyncWorkersResource) -> None: @@ -292,3 +320,7 @@ def domains(self) -> AsyncDomainsResourceWithStreamingResponse: @cached_property def subdomains(self) -> AsyncSubdomainsResourceWithStreamingResponse: return AsyncSubdomainsResourceWithStreamingResponse(self._workers.subdomains) + + @cached_property + def observability(self) -> AsyncObservabilityResourceWithStreamingResponse: + return AsyncObservabilityResourceWithStreamingResponse(self._workers.observability) diff --git a/src/cloudflare/types/workers/observability/__init__.py b/src/cloudflare/types/workers/observability/__init__.py index f8ee8b14b1c..0aaa1d0adea 100644 --- a/src/cloudflare/types/workers/observability/__init__.py +++ b/src/cloudflare/types/workers/observability/__init__.py @@ -1,3 +1,10 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. from __future__ import annotations + +from .telemetry_keys_params import TelemetryKeysParams as TelemetryKeysParams +from .telemetry_query_params import TelemetryQueryParams as TelemetryQueryParams +from .telemetry_keys_response import TelemetryKeysResponse as TelemetryKeysResponse +from .telemetry_values_params import TelemetryValuesParams as TelemetryValuesParams +from .telemetry_query_response import TelemetryQueryResponse as TelemetryQueryResponse +from .telemetry_values_response import TelemetryValuesResponse as TelemetryValuesResponse diff --git a/src/cloudflare/types/workers/observability/telemetry_keys_params.py b/src/cloudflare/types/workers/observability/telemetry_keys_params.py new file mode 100644 index 00000000000..df515b7c392 --- /dev/null +++ b/src/cloudflare/types/workers/observability/telemetry_keys_params.py @@ -0,0 +1,92 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Union, Iterable +from typing_extensions import Literal, Required, Annotated, TypedDict + +from ...._types import SequenceNotStr +from ...._utils import PropertyInfo + +__all__ = ["TelemetryKeysParams", "Filter", "KeyNeedle", "Needle"] + + +class TelemetryKeysParams(TypedDict, total=False): + account_id: Required[str] + + datasets: SequenceNotStr[str] + + filters: Iterable[Filter] + + from_: Annotated[float, PropertyInfo(alias="from")] + + key_needle: Annotated[KeyNeedle, PropertyInfo(alias="keyNeedle")] + """Search for a specific substring in the keys.""" + + limit: float + + needle: Needle + """Search for a specific substring in any of the events""" + + to: float + + +class Filter(TypedDict, total=False): + key: Required[str] + + 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", + ] + ] + + type: Required[Literal["string", "number", "boolean"]] + + value: Union[str, float, bool] + + +class KeyNeedle(TypedDict, total=False): + """Search for a specific substring in the keys.""" + + value: Required[Union[str, float, bool]] + + is_regex: Annotated[bool, PropertyInfo(alias="isRegex")] + + match_case: Annotated[bool, PropertyInfo(alias="matchCase")] + + +class Needle(TypedDict, total=False): + """Search for a specific substring in any of the events""" + + value: Required[Union[str, float, bool]] + + is_regex: Annotated[bool, PropertyInfo(alias="isRegex")] + + match_case: Annotated[bool, PropertyInfo(alias="matchCase")] diff --git a/src/cloudflare/types/workers/observability/telemetry_keys_response.py b/src/cloudflare/types/workers/observability/telemetry_keys_response.py new file mode 100644 index 00000000000..ebe8e775743 --- /dev/null +++ b/src/cloudflare/types/workers/observability/telemetry_keys_response.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal + +from pydantic import Field as FieldInfo + +from ...._models import BaseModel + +__all__ = ["TelemetryKeysResponse"] + + +class TelemetryKeysResponse(BaseModel): + key: str + + last_seen_at: float = FieldInfo(alias="lastSeenAt") + + type: Literal["string", "boolean", "number"] diff --git a/src/cloudflare/types/workers/observability/telemetry_query_params.py b/src/cloudflare/types/workers/observability/telemetry_query_params.py new file mode 100644 index 00000000000..7b81dadee5e --- /dev/null +++ b/src/cloudflare/types/workers/observability/telemetry_query_params.py @@ -0,0 +1,249 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Union, Iterable +from typing_extensions import Literal, Required, Annotated, TypedDict + +from ...._types import SequenceNotStr +from ...._utils import PropertyInfo + +__all__ = [ + "TelemetryQueryParams", + "Timeframe", + "Parameters", + "ParametersCalculation", + "ParametersFilter", + "ParametersGroupBy", + "ParametersHaving", + "ParametersNeedle", + "ParametersOrderBy", +] + + +class TelemetryQueryParams(TypedDict, total=False): + account_id: Required[str] + + query_id: Required[Annotated[str, PropertyInfo(alias="queryId")]] + """Unique identifier for the query to execute""" + + timeframe: Required[Timeframe] + """Time range for the query execution""" + + chart: bool + """Whether to include timeseties data in the response""" + + compare: bool + """Whether to include comparison data with previous time periods""" + + dry: bool + """Whether to perform a dry run without saving the results of the query. + + Useful for validation + """ + + granularity: float + """Time granularity for aggregating results (in milliseconds). + + Controls the bucketing of time-series data + """ + + ignore_series: Annotated[bool, PropertyInfo(alias="ignoreSeries")] + """ + Whether to ignore time-series data in the results and return only aggregated + values + """ + + limit: float + """Maximum number of events to return.""" + + offset: str + """Cursor for pagination to retrieve the next set of results""" + + offset_by: Annotated[float, PropertyInfo(alias="offsetBy")] + """Number of events to skip for pagination. Used in conjunction with offset""" + + offset_direction: Annotated[str, PropertyInfo(alias="offsetDirection")] + """Direction for offset-based pagination (e.g., 'next', 'prev')""" + + parameters: Parameters + """Optional parameters to pass to the query execution""" + + pattern_type: Annotated[Literal["message", "error"], PropertyInfo(alias="patternType")] + """Type of pattern to search for when using pattern-based views""" + + view: Literal["traces", "events", "calculations", "invocations", "requests", "patterns"] + """View type for presenting the query results.""" + + +_TimeframeReservedKeywords = TypedDict( + "_TimeframeReservedKeywords", + { + "from": float, + }, + total=False, +) + + +class Timeframe(_TimeframeReservedKeywords, total=False): + """Time range for the query execution""" + + to: Required[float] + """End timestamp for the query timeframe (Unix timestamp in milliseconds)""" + + +class ParametersCalculation(TypedDict, total=False): + operator: Required[ + Literal[ + "uniq", + "count", + "max", + "min", + "sum", + "avg", + "median", + "p001", + "p01", + "p05", + "p10", + "p25", + "p75", + "p90", + "p95", + "p99", + "p999", + "stddev", + "variance", + "COUNT_DISTINCT", + "COUNT", + "MAX", + "MIN", + "SUM", + "AVG", + "MEDIAN", + "P001", + "P01", + "P05", + "P10", + "P25", + "P75", + "P90", + "P95", + "P99", + "P999", + "STDDEV", + "VARIANCE", + ] + ] + + alias: str + + key: str + + key_type: Annotated[Literal["string", "number", "boolean"], PropertyInfo(alias="keyType")] + + +class ParametersFilter(TypedDict, total=False): + key: Required[str] + + 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", + ] + ] + + type: Required[Literal["string", "number", "boolean"]] + + value: Union[str, float, bool] + + +class ParametersGroupBy(TypedDict, total=False): + type: Required[Literal["string", "number", "boolean"]] + + value: Required[str] + + +class ParametersHaving(TypedDict, total=False): + key: Required[str] + + operation: Required[Literal["eq", "neq", "gt", "gte", "lt", "lte"]] + + value: Required[float] + + +class ParametersNeedle(TypedDict, total=False): + """Define an expression to search using full-text search.""" + + value: Required[Union[str, float, bool]] + + is_regex: Annotated[bool, PropertyInfo(alias="isRegex")] + + match_case: Annotated[bool, PropertyInfo(alias="matchCase")] + + +class ParametersOrderBy(TypedDict, total=False): + """Configure the order of the results returned by the query.""" + + value: Required[str] + """Configure which Calculation to order the results by.""" + + order: Literal["asc", "desc"] + """Set the order of the results""" + + +class Parameters(TypedDict, total=False): + """Optional parameters to pass to the query execution""" + + calculations: Iterable[ParametersCalculation] + """Create Calculations to compute as part of the query.""" + + datasets: SequenceNotStr[str] + """Set the Datasets to query. Leave it empty to query all the 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.""" + + filters: Iterable[ParametersFilter] + """Configure the Filters to apply to the query.""" + + group_bys: Annotated[Iterable[ParametersGroupBy], PropertyInfo(alias="groupBys")] + """Define how to group the results of the query.""" + + havings: Iterable[ParametersHaving] + """Configure the Having clauses that filter on calculations in the query result.""" + + limit: int + """Set a limit on the number of results / records returned by the query""" + + needle: ParametersNeedle + """Define an expression to search using full-text search.""" + + order_by: Annotated[ParametersOrderBy, PropertyInfo(alias="orderBy")] + """Configure the order of the results returned by the query.""" diff --git a/src/cloudflare/types/workers/observability/telemetry_query_response.py b/src/cloudflare/types/workers/observability/telemetry_query_response.py new file mode 100644 index 00000000000..6b147257fd0 --- /dev/null +++ b/src/cloudflare/types/workers/observability/telemetry_query_response.py @@ -0,0 +1,931 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Dict, List, Union, Optional +from typing_extensions import Literal, TypeAlias + +from pydantic import Field as FieldInfo + +from ...._models import BaseModel + +__all__ = [ + "TelemetryQueryResponse", + "Run", + "RunQuery", + "RunQueryParameters", + "RunQueryParametersCalculation", + "RunQueryParametersFilter", + "RunQueryParametersGroupBy", + "RunQueryParametersHaving", + "RunQueryParametersNeedle", + "RunQueryParametersOrderBy", + "RunTimeframe", + "RunStatistics", + "Statistics", + "Calculation", + "CalculationAggregate", + "CalculationAggregateGroup", + "CalculationSeries", + "CalculationSeriesData", + "CalculationSeriesDataGroup", + "Compare", + "CompareAggregate", + "CompareAggregateGroup", + "CompareSeries", + "CompareSeriesData", + "CompareSeriesDataGroup", + "Events", + "EventsEvent", + "EventsEventMetadata", + "EventsEventWorkers", + "EventsEventWorkersUnionMember0", + "EventsEventWorkersUnionMember0ScriptVersion", + "EventsEventWorkersUnionMember1", + "EventsEventWorkersUnionMember1DiagnosticsChannelEvent", + "EventsEventWorkersUnionMember1ScriptVersion", + "EventsField", + "EventsSeries", + "EventsSeriesData", + "EventsSeriesDataAggregates", + "Invocation", + "InvocationMetadata", + "InvocationWorkers", + "InvocationWorkersUnionMember0", + "InvocationWorkersUnionMember0ScriptVersion", + "InvocationWorkersUnionMember1", + "InvocationWorkersUnionMember1DiagnosticsChannelEvent", + "InvocationWorkersUnionMember1ScriptVersion", + "Pattern", + "PatternSeries", + "PatternSeriesData", + "PatternSeriesDataGroup", + "Trace", +] + + +class RunQueryParametersCalculation(BaseModel): + operator: Literal[ + "uniq", + "count", + "max", + "min", + "sum", + "avg", + "median", + "p001", + "p01", + "p05", + "p10", + "p25", + "p75", + "p90", + "p95", + "p99", + "p999", + "stddev", + "variance", + "COUNT_DISTINCT", + "COUNT", + "MAX", + "MIN", + "SUM", + "AVG", + "MEDIAN", + "P001", + "P01", + "P05", + "P10", + "P25", + "P75", + "P90", + "P95", + "P99", + "P999", + "STDDEV", + "VARIANCE", + ] + + alias: Optional[str] = None + + key: Optional[str] = None + + key_type: Optional[Literal["string", "number", "boolean"]] = FieldInfo(alias="keyType", default=None) + + +class RunQueryParametersFilter(BaseModel): + key: str + + operation: 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", + ] + + type: Literal["string", "number", "boolean"] + + value: Union[str, float, bool, None] = None + + +class RunQueryParametersGroupBy(BaseModel): + type: Literal["string", "number", "boolean"] + + value: str + + +class RunQueryParametersHaving(BaseModel): + key: str + + operation: Literal["eq", "neq", "gt", "gte", "lt", "lte"] + + value: float + + +class RunQueryParametersNeedle(BaseModel): + """Define an expression to search using full-text search.""" + + value: Union[str, float, bool] + + is_regex: Optional[bool] = FieldInfo(alias="isRegex", default=None) + + match_case: Optional[bool] = FieldInfo(alias="matchCase", default=None) + + +class RunQueryParametersOrderBy(BaseModel): + """Configure the order of the results returned by the query.""" + + value: str + """Configure which Calculation to order the results by.""" + + order: Optional[Literal["asc", "desc"]] = None + """Set the order of the results""" + + +class RunQueryParameters(BaseModel): + calculations: Optional[List[RunQueryParametersCalculation]] = None + """Create Calculations to compute as part of the query.""" + + datasets: Optional[List[str]] = None + """Set the Datasets to query. Leave it empty to query all the datasets.""" + + filter_combination: Optional[Literal["and", "or", "AND", "OR"]] = FieldInfo(alias="filterCombination", default=None) + """Set a Flag to describe how to combine the filters on the query.""" + + filters: Optional[List[RunQueryParametersFilter]] = None + """Configure the Filters to apply to the query.""" + + group_bys: Optional[List[RunQueryParametersGroupBy]] = FieldInfo(alias="groupBys", default=None) + """Define how to group the results of the query.""" + + havings: Optional[List[RunQueryParametersHaving]] = None + """Configure the Having clauses that filter on calculations in the query result.""" + + limit: Optional[int] = None + """Set a limit on the number of results / records returned by the query""" + + needle: Optional[RunQueryParametersNeedle] = None + """Define an expression to search using full-text search.""" + + order_by: Optional[RunQueryParametersOrderBy] = FieldInfo(alias="orderBy", default=None) + """Configure the order of the results returned by the query.""" + + +class RunQuery(BaseModel): + id: str + """ID of the query""" + + created: str + + description: Optional[str] = None + + environment_id: str = FieldInfo(alias="environmentId") + """ID of your environment""" + + generated: Optional[bool] = None + """Flag for alerts automatically created""" + + name: Optional[str] = None + """Query name""" + + parameters: RunQueryParameters + + updated: str + + user_id: str = FieldInfo(alias="userId") + + workspace_id: str = FieldInfo(alias="workspaceId") + """ID of your workspace""" + + +class RunTimeframe(BaseModel): + """Time range for the query execution""" + + from_: float = FieldInfo(alias="from") + """Start timestamp for the query timeframe (Unix timestamp in milliseconds)""" + + to: float + """End timestamp for the query timeframe (Unix timestamp in milliseconds)""" + + +class RunStatistics(BaseModel): + bytes_read: float + """Number of uncompressed bytes read from the table.""" + + elapsed: float + """Time in seconds for the query to run.""" + + rows_read: float + """Number of rows scanned from the table.""" + + abr_level: Optional[float] = None + """The level of Adaptive Bit Rate (ABR) sampling used for the query. + + If empty the ABR level is 1 + """ + + +class Run(BaseModel): + """A Workers Observability Query Object""" + + id: str + + account_id: str = FieldInfo(alias="accountId") + + dry: bool + + environment_id: str = FieldInfo(alias="environmentId") + + granularity: float + + query: RunQuery + + status: Literal["STARTED", "COMPLETED"] + + timeframe: RunTimeframe + """Time range for the query execution""" + + user_id: str = FieldInfo(alias="userId") + + workspace_id: str = FieldInfo(alias="workspaceId") + + created: Optional[str] = None + + statistics: Optional[RunStatistics] = None + + updated: Optional[str] = None + + +class Statistics(BaseModel): + """ + The statistics object contains information about query performance from the database, it does not include any network latency + """ + + bytes_read: float + """Number of uncompressed bytes read from the table.""" + + elapsed: float + """Time in seconds for the query to run.""" + + rows_read: float + """Number of rows scanned from the table.""" + + abr_level: Optional[float] = None + """The level of Adaptive Bit Rate (ABR) sampling used for the query. + + If empty the ABR level is 1 + """ + + +class CalculationAggregateGroup(BaseModel): + key: str + + value: Union[str, float, bool] + + +class CalculationAggregate(BaseModel): + count: float + + interval: float + + sample_interval: float = FieldInfo(alias="sampleInterval") + + value: float + + groups: Optional[List[CalculationAggregateGroup]] = None + + +class CalculationSeriesDataGroup(BaseModel): + key: str + + value: Union[str, float, bool] + + +class CalculationSeriesData(BaseModel): + count: float + + first_seen: str = FieldInfo(alias="firstSeen") + + interval: float + + last_seen: str = FieldInfo(alias="lastSeen") + + sample_interval: float = FieldInfo(alias="sampleInterval") + + value: float + + groups: Optional[List[CalculationSeriesDataGroup]] = None + + +class CalculationSeries(BaseModel): + data: List[CalculationSeriesData] + + time: str + + +class Calculation(BaseModel): + aggregates: List[CalculationAggregate] + + calculation: str + + series: List[CalculationSeries] + + alias: Optional[str] = None + + +class CompareAggregateGroup(BaseModel): + key: str + + value: Union[str, float, bool] + + +class CompareAggregate(BaseModel): + count: float + + interval: float + + sample_interval: float = FieldInfo(alias="sampleInterval") + + value: float + + groups: Optional[List[CompareAggregateGroup]] = None + + +class CompareSeriesDataGroup(BaseModel): + key: str + + value: Union[str, float, bool] + + +class CompareSeriesData(BaseModel): + count: float + + first_seen: str = FieldInfo(alias="firstSeen") + + interval: float + + last_seen: str = FieldInfo(alias="lastSeen") + + sample_interval: float = FieldInfo(alias="sampleInterval") + + value: float + + groups: Optional[List[CompareSeriesDataGroup]] = None + + +class CompareSeries(BaseModel): + data: List[CompareSeriesData] + + time: str + + +class Compare(BaseModel): + aggregates: List[CompareAggregate] + + calculation: str + + series: List[CompareSeries] + + alias: Optional[str] = None + + +class EventsEventMetadata(BaseModel): + id: str + + account: Optional[str] = None + + cloud_service: Optional[str] = FieldInfo(alias="cloudService", default=None) + + cold_start: Optional[int] = FieldInfo(alias="coldStart", default=None) + + cost: Optional[int] = None + + duration: Optional[int] = None + + end_time: Optional[int] = FieldInfo(alias="endTime", default=None) + + error: Optional[str] = None + + error_template: Optional[str] = FieldInfo(alias="errorTemplate", default=None) + + fingerprint: Optional[str] = None + + level: Optional[str] = None + + message: Optional[str] = None + + message_template: Optional[str] = FieldInfo(alias="messageTemplate", default=None) + + metric_name: Optional[str] = FieldInfo(alias="metricName", default=None) + + origin: Optional[str] = None + + parent_span_id: Optional[str] = FieldInfo(alias="parentSpanId", default=None) + + provider: Optional[str] = None + + region: Optional[str] = None + + request_id: Optional[str] = FieldInfo(alias="requestId", default=None) + + service: Optional[str] = None + + span_id: Optional[str] = FieldInfo(alias="spanId", default=None) + + span_name: Optional[str] = FieldInfo(alias="spanName", default=None) + + stack_id: Optional[str] = FieldInfo(alias="stackId", default=None) + + start_time: Optional[int] = FieldInfo(alias="startTime", default=None) + + status_code: Optional[int] = FieldInfo(alias="statusCode", default=None) + + trace_duration: Optional[int] = FieldInfo(alias="traceDuration", default=None) + + trace_id: Optional[str] = FieldInfo(alias="traceId", default=None) + + transaction_name: Optional[str] = FieldInfo(alias="transactionName", default=None) + + trigger: Optional[str] = None + + type: Optional[str] = None + + url: Optional[str] = None + + +class EventsEventWorkersUnionMember0ScriptVersion(BaseModel): + id: Optional[str] = None + + message: Optional[str] = None + + tag: Optional[str] = None + + +class EventsEventWorkersUnionMember0(BaseModel): + event_type: Literal[ + "fetch", "scheduled", "alarm", "cron", "queue", "email", "tail", "rpc", "websocket", "unknown" + ] = FieldInfo(alias="eventType") + + request_id: str = FieldInfo(alias="requestId") + + script_name: str = FieldInfo(alias="scriptName") + + durable_object_id: Optional[str] = FieldInfo(alias="durableObjectId", default=None) + + entrypoint: Optional[str] = None + + event: Optional[ + Dict[ + str, + Union[ + str, + float, + bool, + Dict[str, Union[str, float, bool, Dict[str, Union[List[Union[str, float, bool]], str, float, bool]]]], + ], + ] + ] = None + + execution_model: Optional[Literal["durableObject", "stateless"]] = FieldInfo(alias="executionModel", default=None) + + outcome: Optional[str] = None + + script_version: Optional[EventsEventWorkersUnionMember0ScriptVersion] = FieldInfo( + alias="scriptVersion", default=None + ) + + truncated: Optional[bool] = None + + +class EventsEventWorkersUnionMember1DiagnosticsChannelEvent(BaseModel): + channel: str + + message: str + + timestamp: float + + +class EventsEventWorkersUnionMember1ScriptVersion(BaseModel): + id: Optional[str] = None + + message: Optional[str] = None + + tag: Optional[str] = None + + +class EventsEventWorkersUnionMember1(BaseModel): + cpu_time_ms: float = FieldInfo(alias="cpuTimeMs") + + event_type: Literal[ + "fetch", "scheduled", "alarm", "cron", "queue", "email", "tail", "rpc", "websocket", "unknown" + ] = FieldInfo(alias="eventType") + + outcome: str + + request_id: str = FieldInfo(alias="requestId") + + script_name: str = FieldInfo(alias="scriptName") + + wall_time_ms: float = FieldInfo(alias="wallTimeMs") + + diagnostics_channel_events: Optional[List[EventsEventWorkersUnionMember1DiagnosticsChannelEvent]] = FieldInfo( + alias="diagnosticsChannelEvents", default=None + ) + + dispatch_namespace: Optional[str] = FieldInfo(alias="dispatchNamespace", default=None) + + durable_object_id: Optional[str] = FieldInfo(alias="durableObjectId", default=None) + + entrypoint: Optional[str] = None + + event: Optional[Dict[str, Union[str, float, bool]]] = None + + execution_model: Optional[Literal["durableObject", "stateless"]] = FieldInfo(alias="executionModel", default=None) + + script_version: Optional[EventsEventWorkersUnionMember1ScriptVersion] = FieldInfo( + alias="scriptVersion", default=None + ) + + truncated: Optional[bool] = None + + +EventsEventWorkers: TypeAlias = Union[EventsEventWorkersUnionMember0, EventsEventWorkersUnionMember1] + + +class EventsEvent(BaseModel): + """The data structure of a telemetry event""" + + metadata: EventsEventMetadata = FieldInfo(alias="$metadata") + + dataset: str + + source: Union[str, object] + + timestamp: int + + containers: Optional[object] = FieldInfo(alias="$containers", default=None) + """ + Cloudflare Containers event information enriches your logs so you can easily + identify and debug issues. + """ + + workers: Optional[EventsEventWorkers] = FieldInfo(alias="$workers", default=None) + """ + Cloudflare Workers event information enriches your logs so you can easily + identify and debug issues. + """ + + +class EventsField(BaseModel): + key: str + + type: str + + +class EventsSeriesDataAggregates(BaseModel): + api_count: int = FieldInfo(alias="_count") + + api_first_seen: str = FieldInfo(alias="_firstSeen") + + api_interval: int = FieldInfo(alias="_interval") + + api_last_seen: str = FieldInfo(alias="_lastSeen") + + bin: Optional[object] = None + + +class EventsSeriesData(BaseModel): + aggregates: EventsSeriesDataAggregates + + count: float + + interval: float + + sample_interval: float = FieldInfo(alias="sampleInterval") + + errors: Optional[float] = None + + groups: Optional[Dict[str, Union[str, float, bool]]] = None + """Groups in the query results.""" + + +class EventsSeries(BaseModel): + data: List[EventsSeriesData] + + time: str + + +class Events(BaseModel): + count: Optional[float] = None + + events: Optional[List[EventsEvent]] = None + + fields: Optional[List[EventsField]] = None + + series: Optional[List[EventsSeries]] = None + + +class InvocationMetadata(BaseModel): + id: str + + account: Optional[str] = None + + cloud_service: Optional[str] = FieldInfo(alias="cloudService", default=None) + + cold_start: Optional[int] = FieldInfo(alias="coldStart", default=None) + + cost: Optional[int] = None + + duration: Optional[int] = None + + end_time: Optional[int] = FieldInfo(alias="endTime", default=None) + + error: Optional[str] = None + + error_template: Optional[str] = FieldInfo(alias="errorTemplate", default=None) + + fingerprint: Optional[str] = None + + level: Optional[str] = None + + message: Optional[str] = None + + message_template: Optional[str] = FieldInfo(alias="messageTemplate", default=None) + + metric_name: Optional[str] = FieldInfo(alias="metricName", default=None) + + origin: Optional[str] = None + + parent_span_id: Optional[str] = FieldInfo(alias="parentSpanId", default=None) + + provider: Optional[str] = None + + region: Optional[str] = None + + request_id: Optional[str] = FieldInfo(alias="requestId", default=None) + + service: Optional[str] = None + + span_id: Optional[str] = FieldInfo(alias="spanId", default=None) + + span_name: Optional[str] = FieldInfo(alias="spanName", default=None) + + stack_id: Optional[str] = FieldInfo(alias="stackId", default=None) + + start_time: Optional[int] = FieldInfo(alias="startTime", default=None) + + status_code: Optional[int] = FieldInfo(alias="statusCode", default=None) + + trace_duration: Optional[int] = FieldInfo(alias="traceDuration", default=None) + + trace_id: Optional[str] = FieldInfo(alias="traceId", default=None) + + transaction_name: Optional[str] = FieldInfo(alias="transactionName", default=None) + + trigger: Optional[str] = None + + type: Optional[str] = None + + url: Optional[str] = None + + +class InvocationWorkersUnionMember0ScriptVersion(BaseModel): + id: Optional[str] = None + + message: Optional[str] = None + + tag: Optional[str] = None + + +class InvocationWorkersUnionMember0(BaseModel): + event_type: Literal[ + "fetch", "scheduled", "alarm", "cron", "queue", "email", "tail", "rpc", "websocket", "unknown" + ] = FieldInfo(alias="eventType") + + request_id: str = FieldInfo(alias="requestId") + + script_name: str = FieldInfo(alias="scriptName") + + durable_object_id: Optional[str] = FieldInfo(alias="durableObjectId", default=None) + + entrypoint: Optional[str] = None + + event: Optional[ + Dict[ + str, + Union[ + str, + float, + bool, + Dict[str, Union[str, float, bool, Dict[str, Union[List[Union[str, float, bool]], str, float, bool]]]], + ], + ] + ] = None + + execution_model: Optional[Literal["durableObject", "stateless"]] = FieldInfo(alias="executionModel", default=None) + + outcome: Optional[str] = None + + script_version: Optional[InvocationWorkersUnionMember0ScriptVersion] = FieldInfo( + alias="scriptVersion", default=None + ) + + truncated: Optional[bool] = None + + +class InvocationWorkersUnionMember1DiagnosticsChannelEvent(BaseModel): + channel: str + + message: str + + timestamp: float + + +class InvocationWorkersUnionMember1ScriptVersion(BaseModel): + id: Optional[str] = None + + message: Optional[str] = None + + tag: Optional[str] = None + + +class InvocationWorkersUnionMember1(BaseModel): + cpu_time_ms: float = FieldInfo(alias="cpuTimeMs") + + event_type: Literal[ + "fetch", "scheduled", "alarm", "cron", "queue", "email", "tail", "rpc", "websocket", "unknown" + ] = FieldInfo(alias="eventType") + + outcome: str + + request_id: str = FieldInfo(alias="requestId") + + script_name: str = FieldInfo(alias="scriptName") + + wall_time_ms: float = FieldInfo(alias="wallTimeMs") + + diagnostics_channel_events: Optional[List[InvocationWorkersUnionMember1DiagnosticsChannelEvent]] = FieldInfo( + alias="diagnosticsChannelEvents", default=None + ) + + dispatch_namespace: Optional[str] = FieldInfo(alias="dispatchNamespace", default=None) + + durable_object_id: Optional[str] = FieldInfo(alias="durableObjectId", default=None) + + entrypoint: Optional[str] = None + + event: Optional[Dict[str, Union[str, float, bool]]] = None + + execution_model: Optional[Literal["durableObject", "stateless"]] = FieldInfo(alias="executionModel", default=None) + + script_version: Optional[InvocationWorkersUnionMember1ScriptVersion] = FieldInfo( + alias="scriptVersion", default=None + ) + + truncated: Optional[bool] = None + + +InvocationWorkers: TypeAlias = Union[InvocationWorkersUnionMember0, InvocationWorkersUnionMember1] + + +class Invocation(BaseModel): + """The data structure of a telemetry event""" + + metadata: InvocationMetadata = FieldInfo(alias="$metadata") + + dataset: str + + source: Union[str, object] + + timestamp: int + + containers: Optional[object] = FieldInfo(alias="$containers", default=None) + """ + Cloudflare Containers event information enriches your logs so you can easily + identify and debug issues. + """ + + workers: Optional[InvocationWorkers] = FieldInfo(alias="$workers", default=None) + """ + Cloudflare Workers event information enriches your logs so you can easily + identify and debug issues. + """ + + +class PatternSeriesDataGroup(BaseModel): + key: str + + value: Union[str, float, bool] + + +class PatternSeriesData(BaseModel): + count: float + + interval: float + + sample_interval: float = FieldInfo(alias="sampleInterval") + + value: float + + groups: Optional[List[PatternSeriesDataGroup]] = None + + +class PatternSeries(BaseModel): + data: PatternSeriesData + + time: str + + +class Pattern(BaseModel): + count: float + + pattern: str + + series: List[PatternSeries] + + service: str + + +class Trace(BaseModel): + root_span_name: str = FieldInfo(alias="rootSpanName") + + root_transaction_name: str = FieldInfo(alias="rootTransactionName") + + service: List[str] + + spans: float + + trace_duration_ms: float = FieldInfo(alias="traceDurationMs") + + trace_end_ms: float = FieldInfo(alias="traceEndMs") + + trace_id: str = FieldInfo(alias="traceId") + + trace_start_ms: float = FieldInfo(alias="traceStartMs") + + errors: Optional[List[str]] = None + + +class TelemetryQueryResponse(BaseModel): + run: Run + """A Workers Observability Query Object""" + + statistics: Statistics + """ + The statistics object contains information about query performance from the + database, it does not include any network latency + """ + + calculations: Optional[List[Calculation]] = None + + compare: Optional[List[Compare]] = None + + events: Optional[Events] = None + + invocations: Optional[Dict[str, List[Invocation]]] = None + + patterns: Optional[List[Pattern]] = None + + traces: Optional[List[Trace]] = None diff --git a/src/cloudflare/types/workers/observability/telemetry_values_params.py b/src/cloudflare/types/workers/observability/telemetry_values_params.py new file mode 100644 index 00000000000..8c5e881ddff --- /dev/null +++ b/src/cloudflare/types/workers/observability/telemetry_values_params.py @@ -0,0 +1,94 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Union, Iterable +from typing_extensions import Literal, Required, Annotated, TypedDict + +from ...._types import SequenceNotStr +from ...._utils import PropertyInfo + +__all__ = ["TelemetryValuesParams", "Timeframe", "Filter", "Needle"] + + +class TelemetryValuesParams(TypedDict, total=False): + account_id: Required[str] + + datasets: Required[SequenceNotStr[str]] + + key: Required[str] + + timeframe: Required[Timeframe] + + type: Required[Literal["string", "boolean", "number"]] + + filters: Iterable[Filter] + + limit: float + + needle: Needle + """Search for a specific substring in the event.""" + + +_TimeframeReservedKeywords = TypedDict( + "_TimeframeReservedKeywords", + { + "from": float, + }, + total=False, +) + + +class Timeframe(_TimeframeReservedKeywords, total=False): + to: Required[float] + + +class Filter(TypedDict, total=False): + key: Required[str] + + 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", + ] + ] + + type: Required[Literal["string", "number", "boolean"]] + + value: Union[str, float, bool] + + +class Needle(TypedDict, total=False): + """Search for a specific substring in the event.""" + + value: Required[Union[str, float, bool]] + + is_regex: Annotated[bool, PropertyInfo(alias="isRegex")] + + match_case: Annotated[bool, PropertyInfo(alias="matchCase")] diff --git a/src/cloudflare/types/workers/observability/telemetry_values_response.py b/src/cloudflare/types/workers/observability/telemetry_values_response.py new file mode 100644 index 00000000000..1d7d431f350 --- /dev/null +++ b/src/cloudflare/types/workers/observability/telemetry_values_response.py @@ -0,0 +1,18 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Union +from typing_extensions import Literal + +from ...._models import BaseModel + +__all__ = ["TelemetryValuesResponse"] + + +class TelemetryValuesResponse(BaseModel): + dataset: str + + key: str + + type: Literal["string", "boolean", "number"] + + value: Union[str, float, bool] diff --git a/tests/api_resources/workers/observability/__init__.py b/tests/api_resources/workers/observability/__init__.py new file mode 100644 index 00000000000..fd8019a9a1a --- /dev/null +++ b/tests/api_resources/workers/observability/__init__.py @@ -0,0 +1 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. diff --git a/tests/api_resources/workers/observability/test_telemetry.py b/tests/api_resources/workers/observability/test_telemetry.py new file mode 100644 index 00000000000..ca10671a97e --- /dev/null +++ b/tests/api_resources/workers/observability/test_telemetry.py @@ -0,0 +1,599 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +import os +from typing import Any, cast + +import pytest + +from cloudflare import Cloudflare, AsyncCloudflare +from tests.utils import assert_matches_type +from cloudflare.pagination import SyncSinglePage, AsyncSinglePage +from cloudflare.types.workers.observability import ( + TelemetryKeysResponse, + TelemetryQueryResponse, + TelemetryValuesResponse, +) + +base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") + + +class TestTelemetry: + parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) + + @parametrize + def test_method_keys(self, client: Cloudflare) -> None: + telemetry = client.workers.observability.telemetry.keys( + account_id="account_id", + ) + assert_matches_type(SyncSinglePage[TelemetryKeysResponse], telemetry, path=["response"]) + + @parametrize + def test_method_keys_with_all_params(self, client: Cloudflare) -> None: + telemetry = client.workers.observability.telemetry.keys( + account_id="account_id", + datasets=["string"], + filters=[ + { + "key": "key", + "operation": "includes", + "type": "string", + "value": "string", + } + ], + from_=0, + key_needle={ + "value": "string", + "is_regex": True, + "match_case": True, + }, + limit=0, + needle={ + "value": "string", + "is_regex": True, + "match_case": True, + }, + to=0, + ) + assert_matches_type(SyncSinglePage[TelemetryKeysResponse], telemetry, path=["response"]) + + @parametrize + def test_raw_response_keys(self, client: Cloudflare) -> None: + response = client.workers.observability.telemetry.with_raw_response.keys( + account_id="account_id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + telemetry = response.parse() + assert_matches_type(SyncSinglePage[TelemetryKeysResponse], telemetry, path=["response"]) + + @parametrize + def test_streaming_response_keys(self, client: Cloudflare) -> None: + with client.workers.observability.telemetry.with_streaming_response.keys( + account_id="account_id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + telemetry = response.parse() + assert_matches_type(SyncSinglePage[TelemetryKeysResponse], telemetry, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_keys(self, client: Cloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + client.workers.observability.telemetry.with_raw_response.keys( + account_id="", + ) + + @parametrize + def test_method_query(self, client: Cloudflare) -> None: + telemetry = client.workers.observability.telemetry.query( + account_id="account_id", + query_id="queryId", + timeframe={ + "from": 0, + "to": 0, + }, + ) + assert_matches_type(TelemetryQueryResponse, telemetry, path=["response"]) + + @parametrize + def test_method_query_with_all_params(self, client: Cloudflare) -> None: + telemetry = client.workers.observability.telemetry.query( + account_id="account_id", + query_id="queryId", + timeframe={ + "from": 0, + "to": 0, + }, + chart=True, + compare=True, + dry=True, + granularity=0, + ignore_series=True, + limit=2000, + offset="offset", + offset_by=0, + offset_direction="offsetDirection", + parameters={ + "calculations": [ + { + "operator": "uniq", + "alias": "alias", + "key": "key", + "key_type": "string", + } + ], + "datasets": ["string"], + "filter_combination": "and", + "filters": [ + { + "key": "key", + "operation": "includes", + "type": "string", + "value": "string", + } + ], + "group_bys": [ + { + "type": "string", + "value": "value", + } + ], + "havings": [ + { + "key": "key", + "operation": "eq", + "value": 0, + } + ], + "limit": 0, + "needle": { + "value": "string", + "is_regex": True, + "match_case": True, + }, + "order_by": { + "value": "value", + "order": "asc", + }, + }, + pattern_type="message", + view="traces", + ) + assert_matches_type(TelemetryQueryResponse, telemetry, path=["response"]) + + @parametrize + def test_raw_response_query(self, client: Cloudflare) -> None: + response = client.workers.observability.telemetry.with_raw_response.query( + account_id="account_id", + query_id="queryId", + timeframe={ + "from": 0, + "to": 0, + }, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + telemetry = response.parse() + assert_matches_type(TelemetryQueryResponse, telemetry, path=["response"]) + + @parametrize + def test_streaming_response_query(self, client: Cloudflare) -> None: + with client.workers.observability.telemetry.with_streaming_response.query( + account_id="account_id", + query_id="queryId", + timeframe={ + "from": 0, + "to": 0, + }, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + telemetry = response.parse() + assert_matches_type(TelemetryQueryResponse, telemetry, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_query(self, client: Cloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + client.workers.observability.telemetry.with_raw_response.query( + account_id="", + query_id="queryId", + timeframe={ + "from": 0, + "to": 0, + }, + ) + + @parametrize + def test_method_values(self, client: Cloudflare) -> None: + telemetry = client.workers.observability.telemetry.values( + account_id="account_id", + datasets=["string"], + key="key", + timeframe={ + "from": 0, + "to": 0, + }, + type="string", + ) + assert_matches_type(SyncSinglePage[TelemetryValuesResponse], telemetry, path=["response"]) + + @parametrize + def test_method_values_with_all_params(self, client: Cloudflare) -> None: + telemetry = client.workers.observability.telemetry.values( + account_id="account_id", + datasets=["string"], + key="key", + timeframe={ + "from": 0, + "to": 0, + }, + type="string", + filters=[ + { + "key": "key", + "operation": "includes", + "type": "string", + "value": "string", + } + ], + limit=0, + needle={ + "value": "string", + "is_regex": True, + "match_case": True, + }, + ) + assert_matches_type(SyncSinglePage[TelemetryValuesResponse], telemetry, path=["response"]) + + @parametrize + def test_raw_response_values(self, client: Cloudflare) -> None: + response = client.workers.observability.telemetry.with_raw_response.values( + account_id="account_id", + datasets=["string"], + key="key", + timeframe={ + "from": 0, + "to": 0, + }, + type="string", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + telemetry = response.parse() + assert_matches_type(SyncSinglePage[TelemetryValuesResponse], telemetry, path=["response"]) + + @parametrize + def test_streaming_response_values(self, client: Cloudflare) -> None: + with client.workers.observability.telemetry.with_streaming_response.values( + account_id="account_id", + datasets=["string"], + key="key", + timeframe={ + "from": 0, + "to": 0, + }, + type="string", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + telemetry = response.parse() + assert_matches_type(SyncSinglePage[TelemetryValuesResponse], telemetry, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_values(self, client: Cloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + client.workers.observability.telemetry.with_raw_response.values( + account_id="", + datasets=["string"], + key="key", + timeframe={ + "from": 0, + "to": 0, + }, + type="string", + ) + + +class TestAsyncTelemetry: + parametrize = pytest.mark.parametrize( + "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"] + ) + + @parametrize + async def test_method_keys(self, async_client: AsyncCloudflare) -> None: + telemetry = await async_client.workers.observability.telemetry.keys( + account_id="account_id", + ) + assert_matches_type(AsyncSinglePage[TelemetryKeysResponse], telemetry, path=["response"]) + + @parametrize + async def test_method_keys_with_all_params(self, async_client: AsyncCloudflare) -> None: + telemetry = await async_client.workers.observability.telemetry.keys( + account_id="account_id", + datasets=["string"], + filters=[ + { + "key": "key", + "operation": "includes", + "type": "string", + "value": "string", + } + ], + from_=0, + key_needle={ + "value": "string", + "is_regex": True, + "match_case": True, + }, + limit=0, + needle={ + "value": "string", + "is_regex": True, + "match_case": True, + }, + to=0, + ) + assert_matches_type(AsyncSinglePage[TelemetryKeysResponse], telemetry, path=["response"]) + + @parametrize + async def test_raw_response_keys(self, async_client: AsyncCloudflare) -> None: + response = await async_client.workers.observability.telemetry.with_raw_response.keys( + account_id="account_id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + telemetry = await response.parse() + assert_matches_type(AsyncSinglePage[TelemetryKeysResponse], telemetry, path=["response"]) + + @parametrize + async def test_streaming_response_keys(self, async_client: AsyncCloudflare) -> None: + async with async_client.workers.observability.telemetry.with_streaming_response.keys( + account_id="account_id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + telemetry = await response.parse() + assert_matches_type(AsyncSinglePage[TelemetryKeysResponse], telemetry, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_keys(self, async_client: AsyncCloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + await async_client.workers.observability.telemetry.with_raw_response.keys( + account_id="", + ) + + @parametrize + async def test_method_query(self, async_client: AsyncCloudflare) -> None: + telemetry = await async_client.workers.observability.telemetry.query( + account_id="account_id", + query_id="queryId", + timeframe={ + "from": 0, + "to": 0, + }, + ) + assert_matches_type(TelemetryQueryResponse, telemetry, path=["response"]) + + @parametrize + async def test_method_query_with_all_params(self, async_client: AsyncCloudflare) -> None: + telemetry = await async_client.workers.observability.telemetry.query( + account_id="account_id", + query_id="queryId", + timeframe={ + "from": 0, + "to": 0, + }, + chart=True, + compare=True, + dry=True, + granularity=0, + ignore_series=True, + limit=2000, + offset="offset", + offset_by=0, + offset_direction="offsetDirection", + parameters={ + "calculations": [ + { + "operator": "uniq", + "alias": "alias", + "key": "key", + "key_type": "string", + } + ], + "datasets": ["string"], + "filter_combination": "and", + "filters": [ + { + "key": "key", + "operation": "includes", + "type": "string", + "value": "string", + } + ], + "group_bys": [ + { + "type": "string", + "value": "value", + } + ], + "havings": [ + { + "key": "key", + "operation": "eq", + "value": 0, + } + ], + "limit": 0, + "needle": { + "value": "string", + "is_regex": True, + "match_case": True, + }, + "order_by": { + "value": "value", + "order": "asc", + }, + }, + pattern_type="message", + view="traces", + ) + assert_matches_type(TelemetryQueryResponse, telemetry, path=["response"]) + + @parametrize + async def test_raw_response_query(self, async_client: AsyncCloudflare) -> None: + response = await async_client.workers.observability.telemetry.with_raw_response.query( + account_id="account_id", + query_id="queryId", + timeframe={ + "from": 0, + "to": 0, + }, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + telemetry = await response.parse() + assert_matches_type(TelemetryQueryResponse, telemetry, path=["response"]) + + @parametrize + async def test_streaming_response_query(self, async_client: AsyncCloudflare) -> None: + async with async_client.workers.observability.telemetry.with_streaming_response.query( + account_id="account_id", + query_id="queryId", + timeframe={ + "from": 0, + "to": 0, + }, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + telemetry = await response.parse() + assert_matches_type(TelemetryQueryResponse, telemetry, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_query(self, async_client: AsyncCloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + await async_client.workers.observability.telemetry.with_raw_response.query( + account_id="", + query_id="queryId", + timeframe={ + "from": 0, + "to": 0, + }, + ) + + @parametrize + async def test_method_values(self, async_client: AsyncCloudflare) -> None: + telemetry = await async_client.workers.observability.telemetry.values( + account_id="account_id", + datasets=["string"], + key="key", + timeframe={ + "from": 0, + "to": 0, + }, + type="string", + ) + assert_matches_type(AsyncSinglePage[TelemetryValuesResponse], telemetry, path=["response"]) + + @parametrize + async def test_method_values_with_all_params(self, async_client: AsyncCloudflare) -> None: + telemetry = await async_client.workers.observability.telemetry.values( + account_id="account_id", + datasets=["string"], + key="key", + timeframe={ + "from": 0, + "to": 0, + }, + type="string", + filters=[ + { + "key": "key", + "operation": "includes", + "type": "string", + "value": "string", + } + ], + limit=0, + needle={ + "value": "string", + "is_regex": True, + "match_case": True, + }, + ) + assert_matches_type(AsyncSinglePage[TelemetryValuesResponse], telemetry, path=["response"]) + + @parametrize + async def test_raw_response_values(self, async_client: AsyncCloudflare) -> None: + response = await async_client.workers.observability.telemetry.with_raw_response.values( + account_id="account_id", + datasets=["string"], + key="key", + timeframe={ + "from": 0, + "to": 0, + }, + type="string", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + telemetry = await response.parse() + assert_matches_type(AsyncSinglePage[TelemetryValuesResponse], telemetry, path=["response"]) + + @parametrize + async def test_streaming_response_values(self, async_client: AsyncCloudflare) -> None: + async with async_client.workers.observability.telemetry.with_streaming_response.values( + account_id="account_id", + datasets=["string"], + key="key", + timeframe={ + "from": 0, + "to": 0, + }, + type="string", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + telemetry = await response.parse() + assert_matches_type(AsyncSinglePage[TelemetryValuesResponse], telemetry, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_values(self, async_client: AsyncCloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + await async_client.workers.observability.telemetry.with_raw_response.values( + account_id="", + datasets=["string"], + key="key", + timeframe={ + "from": 0, + "to": 0, + }, + type="string", + ) From 763829c95421b3cffacb7c04aaca1a64fd9a806c Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 20 Feb 2026 14:51:21 +0000 Subject: [PATCH 023/279] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 354e7898ee1..ac7f053f7de 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 2028 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-85baac7d01af38270e23adc0ba636483e3b77d113bebc5414bb0bc2a6411f6bc.yml -openapi_spec_hash: a949b858ee079d2be5cf16d6da8d8c18 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-e8f3032e68d3763a847cee8685c7083ef9e52cca2457e88598afdbac8b64187d.yml +openapi_spec_hash: cad13093a7aacb69e6a73f3ec5bb9c77 config_hash: 7a70007089f586cc7b1ebd1808030dd1 From 174f4add3df8acfc85df10ad0d2cf1962c6de2e9 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 23 Feb 2026 12:51:17 +0000 Subject: [PATCH 024/279] chore(api): update composite API spec --- .stats.yml | 4 ++-- .../resources/aisearch/instances/instances.py | 8 ++++++++ .../instance_chat_completions_params.py | 7 +++++++ .../types/aisearch/instance_create_params.py | 12 +++++++++++ .../aisearch/instance_create_response.py | 12 +++++++++++ .../aisearch/instance_delete_response.py | 12 +++++++++++ .../types/aisearch/instance_list_response.py | 12 +++++++++++ .../types/aisearch/instance_read_response.py | 12 +++++++++++ .../types/aisearch/instance_search_params.py | 7 +++++++ .../types/aisearch/instance_update_params.py | 12 +++++++++++ .../aisearch/instance_update_response.py | 12 +++++++++++ .../aisearch/instances/item_get_response.py | 20 +++++++++++++++---- .../aisearch/instances/item_list_response.py | 20 +++++++++++++++---- .../api_resources/aisearch/test_instances.py | 8 ++++++++ 14 files changed, 148 insertions(+), 10 deletions(-) diff --git a/.stats.yml b/.stats.yml index ac7f053f7de..e294c849da0 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 2028 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-e8f3032e68d3763a847cee8685c7083ef9e52cca2457e88598afdbac8b64187d.yml -openapi_spec_hash: cad13093a7aacb69e6a73f3ec5bb9c77 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-cc19f43f4f1f0456814c677a65a8194e7a7af581005420212f2dbdb8609767f7.yml +openapi_spec_hash: ef7df6ac6af0ebee0bbc0dd8225cff0a config_hash: 7a70007089f586cc7b1ebd1808030dd1 diff --git a/src/cloudflare/resources/aisearch/instances/instances.py b/src/cloudflare/resources/aisearch/instances/instances.py index d4e0631289b..648c0dadf83 100644 --- a/src/cloudflare/resources/aisearch/instances/instances.py +++ b/src/cloudflare/resources/aisearch/instances/instances.py @@ -144,6 +144,7 @@ def create( public_endpoint_params: instance_create_params.PublicEndpointParams | Omit = omit, reranking: bool | Omit = omit, reranking_model: Literal["@cf/baai/bge-reranker-base", ""] | Omit = omit, + retrieval_options: Optional[instance_create_params.RetrievalOptions] | Omit = omit, rewrite_model: Literal[ "@cf/meta/llama-3.3-70b-instruct-fp8-fast", "@cf/zai-org/glm-4.7-flash", @@ -223,6 +224,7 @@ def create( "public_endpoint_params": public_endpoint_params, "reranking": reranking, "reranking_model": reranking_model, + "retrieval_options": retrieval_options, "rewrite_model": rewrite_model, "rewrite_query": rewrite_query, "score_threshold": score_threshold, @@ -304,6 +306,7 @@ def update( public_endpoint_params: instance_update_params.PublicEndpointParams | Omit = omit, reranking: bool | Omit = omit, reranking_model: Literal["@cf/baai/bge-reranker-base", ""] | Omit = omit, + retrieval_options: Optional[instance_update_params.RetrievalOptions] | Omit = omit, rewrite_model: Literal[ "@cf/meta/llama-3.3-70b-instruct-fp8-fast", "@cf/zai-org/glm-4.7-flash", @@ -420,6 +423,7 @@ def update( "public_endpoint_params": public_endpoint_params, "reranking": reranking, "reranking_model": reranking_model, + "retrieval_options": retrieval_options, "rewrite_model": rewrite_model, "rewrite_query": rewrite_query, "score_threshold": score_threshold, @@ -841,6 +845,7 @@ async def create( public_endpoint_params: instance_create_params.PublicEndpointParams | Omit = omit, reranking: bool | Omit = omit, reranking_model: Literal["@cf/baai/bge-reranker-base", ""] | Omit = omit, + retrieval_options: Optional[instance_create_params.RetrievalOptions] | Omit = omit, rewrite_model: Literal[ "@cf/meta/llama-3.3-70b-instruct-fp8-fast", "@cf/zai-org/glm-4.7-flash", @@ -920,6 +925,7 @@ async def create( "public_endpoint_params": public_endpoint_params, "reranking": reranking, "reranking_model": reranking_model, + "retrieval_options": retrieval_options, "rewrite_model": rewrite_model, "rewrite_query": rewrite_query, "score_threshold": score_threshold, @@ -1001,6 +1007,7 @@ async def update( public_endpoint_params: instance_update_params.PublicEndpointParams | Omit = omit, reranking: bool | Omit = omit, reranking_model: Literal["@cf/baai/bge-reranker-base", ""] | Omit = omit, + retrieval_options: Optional[instance_update_params.RetrievalOptions] | Omit = omit, rewrite_model: Literal[ "@cf/meta/llama-3.3-70b-instruct-fp8-fast", "@cf/zai-org/glm-4.7-flash", @@ -1117,6 +1124,7 @@ async def update( "public_endpoint_params": public_endpoint_params, "reranking": reranking, "reranking_model": reranking_model, + "retrieval_options": retrieval_options, "rewrite_model": rewrite_model, "rewrite_query": rewrite_query, "score_threshold": score_threshold, diff --git a/src/cloudflare/types/aisearch/instance_chat_completions_params.py b/src/cloudflare/types/aisearch/instance_chat_completions_params.py index 77b605c707b..a60d3a9a458 100644 --- a/src/cloudflare/types/aisearch/instance_chat_completions_params.py +++ b/src/cloudflare/types/aisearch/instance_chat_completions_params.py @@ -119,6 +119,13 @@ class AISearchOptionsRetrieval(TypedDict, total=False): fusion_method: Literal["max", "rrf"] + keyword_match_mode: Literal["exact_match", "fuzzy_match"] + """Controls how keyword search terms are matched. + + exact_match requires all terms to appear (AND); fuzzy_match returns results + containing any term (OR). Defaults to exact_match. + """ + match_threshold: float max_num_results: int diff --git a/src/cloudflare/types/aisearch/instance_create_params.py b/src/cloudflare/types/aisearch/instance_create_params.py index aca06fc17e3..19f94e53997 100644 --- a/src/cloudflare/types/aisearch/instance_create_params.py +++ b/src/cloudflare/types/aisearch/instance_create_params.py @@ -18,6 +18,7 @@ "PublicEndpointParamsMcp", "PublicEndpointParamsRateLimit", "PublicEndpointParamsSearchEndpoint", + "RetrievalOptions", "SourceParams", "SourceParamsWebCrawler", "SourceParamsWebCrawlerParseOptions", @@ -104,6 +105,8 @@ class InstanceCreateParams(TypedDict, total=False): reranking_model: Literal["@cf/baai/bge-reranker-base", ""] + retrieval_options: Optional[RetrievalOptions] + rewrite_model: Literal[ "@cf/meta/llama-3.3-70b-instruct-fp8-fast", "@cf/zai-org/glm-4.7-flash", @@ -195,6 +198,15 @@ class PublicEndpointParams(TypedDict, total=False): search_endpoint: PublicEndpointParamsSearchEndpoint +class RetrievalOptions(TypedDict, total=False): + keyword_match_mode: Literal["exact_match", "fuzzy_match"] + """Controls how keyword search terms are matched. + + exact_match requires all terms to appear (AND); fuzzy_match returns results + containing any term (OR). Defaults to exact_match. + """ + + class SourceParamsWebCrawlerParseOptions(TypedDict, total=False): include_headers: Dict[str, str] diff --git a/src/cloudflare/types/aisearch/instance_create_response.py b/src/cloudflare/types/aisearch/instance_create_response.py index d1b004bea04..4a81cf1c492 100644 --- a/src/cloudflare/types/aisearch/instance_create_response.py +++ b/src/cloudflare/types/aisearch/instance_create_response.py @@ -18,6 +18,7 @@ "PublicEndpointParamsMcp", "PublicEndpointParamsRateLimit", "PublicEndpointParamsSearchEndpoint", + "RetrievalOptions", "SourceParams", "SourceParamsWebCrawler", "SourceParamsWebCrawlerParseOptions", @@ -76,6 +77,15 @@ class PublicEndpointParams(BaseModel): search_endpoint: Optional[PublicEndpointParamsSearchEndpoint] = None +class RetrievalOptions(BaseModel): + keyword_match_mode: Optional[Literal["exact_match", "fuzzy_match"]] = None + """Controls how keyword search terms are matched. + + exact_match requires all terms to appear (AND); fuzzy_match returns results + containing any term (OR). Defaults to exact_match. + """ + + class SourceParamsWebCrawlerParseOptions(BaseModel): include_headers: Optional[Dict[str, str]] = None @@ -227,6 +237,8 @@ class InstanceCreateResponse(BaseModel): reranking_model: Optional[Literal["@cf/baai/bge-reranker-base", ""]] = None + retrieval_options: Optional[RetrievalOptions] = None + rewrite_model: Optional[ Literal[ "@cf/meta/llama-3.3-70b-instruct-fp8-fast", diff --git a/src/cloudflare/types/aisearch/instance_delete_response.py b/src/cloudflare/types/aisearch/instance_delete_response.py index 74e64f5597f..8c19423fa88 100644 --- a/src/cloudflare/types/aisearch/instance_delete_response.py +++ b/src/cloudflare/types/aisearch/instance_delete_response.py @@ -18,6 +18,7 @@ "PublicEndpointParamsMcp", "PublicEndpointParamsRateLimit", "PublicEndpointParamsSearchEndpoint", + "RetrievalOptions", "SourceParams", "SourceParamsWebCrawler", "SourceParamsWebCrawlerParseOptions", @@ -76,6 +77,15 @@ class PublicEndpointParams(BaseModel): search_endpoint: Optional[PublicEndpointParamsSearchEndpoint] = None +class RetrievalOptions(BaseModel): + keyword_match_mode: Optional[Literal["exact_match", "fuzzy_match"]] = None + """Controls how keyword search terms are matched. + + exact_match requires all terms to appear (AND); fuzzy_match returns results + containing any term (OR). Defaults to exact_match. + """ + + class SourceParamsWebCrawlerParseOptions(BaseModel): include_headers: Optional[Dict[str, str]] = None @@ -227,6 +237,8 @@ class InstanceDeleteResponse(BaseModel): reranking_model: Optional[Literal["@cf/baai/bge-reranker-base", ""]] = None + retrieval_options: Optional[RetrievalOptions] = None + rewrite_model: Optional[ Literal[ "@cf/meta/llama-3.3-70b-instruct-fp8-fast", diff --git a/src/cloudflare/types/aisearch/instance_list_response.py b/src/cloudflare/types/aisearch/instance_list_response.py index 6ada27e5d12..5a72892e3aa 100644 --- a/src/cloudflare/types/aisearch/instance_list_response.py +++ b/src/cloudflare/types/aisearch/instance_list_response.py @@ -18,6 +18,7 @@ "PublicEndpointParamsMcp", "PublicEndpointParamsRateLimit", "PublicEndpointParamsSearchEndpoint", + "RetrievalOptions", "SourceParams", "SourceParamsWebCrawler", "SourceParamsWebCrawlerParseOptions", @@ -76,6 +77,15 @@ class PublicEndpointParams(BaseModel): search_endpoint: Optional[PublicEndpointParamsSearchEndpoint] = None +class RetrievalOptions(BaseModel): + keyword_match_mode: Optional[Literal["exact_match", "fuzzy_match"]] = None + """Controls how keyword search terms are matched. + + exact_match requires all terms to appear (AND); fuzzy_match returns results + containing any term (OR). Defaults to exact_match. + """ + + class SourceParamsWebCrawlerParseOptions(BaseModel): include_headers: Optional[Dict[str, str]] = None @@ -227,6 +237,8 @@ class InstanceListResponse(BaseModel): reranking_model: Optional[Literal["@cf/baai/bge-reranker-base", ""]] = None + retrieval_options: Optional[RetrievalOptions] = None + rewrite_model: Optional[ Literal[ "@cf/meta/llama-3.3-70b-instruct-fp8-fast", diff --git a/src/cloudflare/types/aisearch/instance_read_response.py b/src/cloudflare/types/aisearch/instance_read_response.py index 96061c431e3..b0d3f5996d9 100644 --- a/src/cloudflare/types/aisearch/instance_read_response.py +++ b/src/cloudflare/types/aisearch/instance_read_response.py @@ -18,6 +18,7 @@ "PublicEndpointParamsMcp", "PublicEndpointParamsRateLimit", "PublicEndpointParamsSearchEndpoint", + "RetrievalOptions", "SourceParams", "SourceParamsWebCrawler", "SourceParamsWebCrawlerParseOptions", @@ -76,6 +77,15 @@ class PublicEndpointParams(BaseModel): search_endpoint: Optional[PublicEndpointParamsSearchEndpoint] = None +class RetrievalOptions(BaseModel): + keyword_match_mode: Optional[Literal["exact_match", "fuzzy_match"]] = None + """Controls how keyword search terms are matched. + + exact_match requires all terms to appear (AND); fuzzy_match returns results + containing any term (OR). Defaults to exact_match. + """ + + class SourceParamsWebCrawlerParseOptions(BaseModel): include_headers: Optional[Dict[str, str]] = None @@ -227,6 +237,8 @@ class InstanceReadResponse(BaseModel): reranking_model: Optional[Literal["@cf/baai/bge-reranker-base", ""]] = None + retrieval_options: Optional[RetrievalOptions] = None + rewrite_model: Optional[ Literal[ "@cf/meta/llama-3.3-70b-instruct-fp8-fast", diff --git a/src/cloudflare/types/aisearch/instance_search_params.py b/src/cloudflare/types/aisearch/instance_search_params.py index 26fecab2e4a..fba9dbe2f6a 100644 --- a/src/cloudflare/types/aisearch/instance_search_params.py +++ b/src/cloudflare/types/aisearch/instance_search_params.py @@ -86,6 +86,13 @@ class AISearchOptionsRetrieval(TypedDict, total=False): fusion_method: Literal["max", "rrf"] + keyword_match_mode: Literal["exact_match", "fuzzy_match"] + """Controls how keyword search terms are matched. + + exact_match requires all terms to appear (AND); fuzzy_match returns results + containing any term (OR). Defaults to exact_match. + """ + match_threshold: float max_num_results: int diff --git a/src/cloudflare/types/aisearch/instance_update_params.py b/src/cloudflare/types/aisearch/instance_update_params.py index 7241fc42bc7..e1d481fb7ac 100644 --- a/src/cloudflare/types/aisearch/instance_update_params.py +++ b/src/cloudflare/types/aisearch/instance_update_params.py @@ -18,6 +18,7 @@ "PublicEndpointParamsMcp", "PublicEndpointParamsRateLimit", "PublicEndpointParamsSearchEndpoint", + "RetrievalOptions", "SourceParams", "SourceParamsWebCrawler", "SourceParamsWebCrawlerParseOptions", @@ -103,6 +104,8 @@ class InstanceUpdateParams(TypedDict, total=False): reranking_model: Literal["@cf/baai/bge-reranker-base", ""] + retrieval_options: Optional[RetrievalOptions] + rewrite_model: Literal[ "@cf/meta/llama-3.3-70b-instruct-fp8-fast", "@cf/zai-org/glm-4.7-flash", @@ -233,6 +236,15 @@ class PublicEndpointParams(TypedDict, total=False): search_endpoint: PublicEndpointParamsSearchEndpoint +class RetrievalOptions(TypedDict, total=False): + keyword_match_mode: Literal["exact_match", "fuzzy_match"] + """Controls how keyword search terms are matched. + + exact_match requires all terms to appear (AND); fuzzy_match returns results + containing any term (OR). Defaults to exact_match. + """ + + class SourceParamsWebCrawlerParseOptions(TypedDict, total=False): include_headers: Dict[str, str] diff --git a/src/cloudflare/types/aisearch/instance_update_response.py b/src/cloudflare/types/aisearch/instance_update_response.py index 77d41a7ee23..712c2a7bc1e 100644 --- a/src/cloudflare/types/aisearch/instance_update_response.py +++ b/src/cloudflare/types/aisearch/instance_update_response.py @@ -18,6 +18,7 @@ "PublicEndpointParamsMcp", "PublicEndpointParamsRateLimit", "PublicEndpointParamsSearchEndpoint", + "RetrievalOptions", "SourceParams", "SourceParamsWebCrawler", "SourceParamsWebCrawlerParseOptions", @@ -76,6 +77,15 @@ class PublicEndpointParams(BaseModel): search_endpoint: Optional[PublicEndpointParamsSearchEndpoint] = None +class RetrievalOptions(BaseModel): + keyword_match_mode: Optional[Literal["exact_match", "fuzzy_match"]] = None + """Controls how keyword search terms are matched. + + exact_match requires all terms to appear (AND); fuzzy_match returns results + containing any term (OR). Defaults to exact_match. + """ + + class SourceParamsWebCrawlerParseOptions(BaseModel): include_headers: Optional[Dict[str, str]] = None @@ -227,6 +237,8 @@ class InstanceUpdateResponse(BaseModel): reranking_model: Optional[Literal["@cf/baai/bge-reranker-base", ""]] = None + retrieval_options: Optional[RetrievalOptions] = None + rewrite_model: Optional[ Literal[ "@cf/meta/llama-3.3-70b-instruct-fp8-fast", diff --git a/src/cloudflare/types/aisearch/instances/item_get_response.py b/src/cloudflare/types/aisearch/instances/item_get_response.py index 4df3c0b94a8..50eaf709682 100644 --- a/src/cloudflare/types/aisearch/instances/item_get_response.py +++ b/src/cloudflare/types/aisearch/instances/item_get_response.py @@ -10,14 +10,26 @@ class ItemGetResponse(BaseModel): - id: str + id: float + + checksum: str + + chunks_count: Optional[int] = None + + created_at: datetime + + file_size: Optional[float] = None key: str + last_seen_at: datetime + + namespace: str + + next_action: Optional[Literal["INDEX", "DELETE"]] = None + status: Literal["queued", "running", "completed", "error", "skipped"] error: Optional[str] = None - last_seen_at: Optional[datetime] = None - - next_action: Optional[str] = None + public_id: Optional[str] = None diff --git a/src/cloudflare/types/aisearch/instances/item_list_response.py b/src/cloudflare/types/aisearch/instances/item_list_response.py index ff22e5ab677..5054e8ad74d 100644 --- a/src/cloudflare/types/aisearch/instances/item_list_response.py +++ b/src/cloudflare/types/aisearch/instances/item_list_response.py @@ -10,14 +10,26 @@ class ItemListResponse(BaseModel): - id: str + id: float + + checksum: str + + chunks_count: Optional[int] = None + + created_at: datetime + + file_size: Optional[float] = None key: str + last_seen_at: datetime + + namespace: str + + next_action: Optional[Literal["INDEX", "DELETE"]] = None + status: Literal["queued", "running", "completed", "error", "skipped"] error: Optional[str] = None - last_seen_at: Optional[datetime] = None - - next_action: Optional[str] = None + public_id: Optional[str] = None diff --git a/tests/api_resources/aisearch/test_instances.py b/tests/api_resources/aisearch/test_instances.py index fa6c398b25a..e65fdf05082 100644 --- a/tests/api_resources/aisearch/test_instances.py +++ b/tests/api_resources/aisearch/test_instances.py @@ -80,6 +80,7 @@ def test_method_create_with_all_params(self, client: Cloudflare) -> None: }, reranking=True, reranking_model="@cf/baai/bge-reranker-base", + retrieval_options={"keyword_match_mode": "exact_match"}, rewrite_model="@cf/meta/llama-3.3-70b-instruct-fp8-fast", rewrite_query=True, score_threshold=0, @@ -202,6 +203,7 @@ def test_method_update_with_all_params(self, client: Cloudflare) -> None: }, reranking=True, reranking_model="@cf/baai/bge-reranker-base", + retrieval_options={"keyword_match_mode": "exact_match"}, rewrite_model="@cf/meta/llama-3.3-70b-instruct-fp8-fast", rewrite_query=True, score_threshold=0, @@ -413,6 +415,7 @@ def test_method_chat_completions_with_all_params(self, client: Cloudflare) -> No "context_expansion": 0, "filters": {"foo": "bar"}, "fusion_method": "max", + "keyword_match_mode": "exact_match", "match_threshold": 0, "max_num_results": 1, "retrieval_type": "vector", @@ -576,6 +579,7 @@ def test_method_search_with_all_params(self, client: Cloudflare) -> None: "context_expansion": 0, "filters": {"foo": "bar"}, "fusion_method": "max", + "keyword_match_mode": "exact_match", "match_threshold": 0, "max_num_results": 1, "retrieval_type": "vector", @@ -756,6 +760,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncCloudflare }, reranking=True, reranking_model="@cf/baai/bge-reranker-base", + retrieval_options={"keyword_match_mode": "exact_match"}, rewrite_model="@cf/meta/llama-3.3-70b-instruct-fp8-fast", rewrite_query=True, score_threshold=0, @@ -878,6 +883,7 @@ async def test_method_update_with_all_params(self, async_client: AsyncCloudflare }, reranking=True, reranking_model="@cf/baai/bge-reranker-base", + retrieval_options={"keyword_match_mode": "exact_match"}, rewrite_model="@cf/meta/llama-3.3-70b-instruct-fp8-fast", rewrite_query=True, score_threshold=0, @@ -1089,6 +1095,7 @@ async def test_method_chat_completions_with_all_params(self, async_client: Async "context_expansion": 0, "filters": {"foo": "bar"}, "fusion_method": "max", + "keyword_match_mode": "exact_match", "match_threshold": 0, "max_num_results": 1, "retrieval_type": "vector", @@ -1252,6 +1259,7 @@ async def test_method_search_with_all_params(self, async_client: AsyncCloudflare "context_expansion": 0, "filters": {"foo": "bar"}, "fusion_method": "max", + "keyword_match_mode": "exact_match", "match_threshold": 0, "max_num_results": 1, "retrieval_type": "vector", From 6aa3d76abe6fa2f81bf62b603caacd3f41ccf0cb Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 23 Feb 2026 14:49:00 +0000 Subject: [PATCH 025/279] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index e294c849da0..cfd604a7cf3 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 2028 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-cc19f43f4f1f0456814c677a65a8194e7a7af581005420212f2dbdb8609767f7.yml -openapi_spec_hash: ef7df6ac6af0ebee0bbc0dd8225cff0a +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-f8d2c9c7d48eda10698b995ed7b3437329e0a7a1bdf56a51dce5f2aefd939027.yml +openapi_spec_hash: c8fd4e707d73fc672ddcc67ef1d699c6 config_hash: 7a70007089f586cc7b1ebd1808030dd1 From 0f390d2655e10178e65f5eb59ccf363d18144378 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 23 Feb 2026 16:34:00 +0000 Subject: [PATCH 026/279] chore(api): update composite API spec --- .stats.yml | 4 ++-- .../resources/radar/entities/locations.py | 24 +++++++++++++++++++ .../radar/entities/location_get_response.py | 2 ++ .../radar/entities/location_list_params.py | 9 +++++++ .../radar/entities/location_list_response.py | 6 +++++ .../radar/entities/test_locations.py | 6 +++++ 6 files changed, 49 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index cfd604a7cf3..048dfa31519 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 2028 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-f8d2c9c7d48eda10698b995ed7b3437329e0a7a1bdf56a51dce5f2aefd939027.yml -openapi_spec_hash: c8fd4e707d73fc672ddcc67ef1d699c6 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-a909b87c05e478194e997f18d24300cff7cf8cf978d8fbc45af8866c5575bf63.yml +openapi_spec_hash: 4989f8168da4edbbb107a55e74690fe0 config_hash: 7a70007089f586cc7b1ebd1808030dd1 diff --git a/src/cloudflare/resources/radar/entities/locations.py b/src/cloudflare/resources/radar/entities/locations.py index 594c5078309..51e63d24533 100644 --- a/src/cloudflare/resources/radar/entities/locations.py +++ b/src/cloudflare/resources/radar/entities/locations.py @@ -49,10 +49,13 @@ def with_streaming_response(self) -> LocationsResourceWithStreamingResponse: def list( self, *, + continent: Literal["AF", "AS", "EU", "NA", "OC", "SA"] | Omit = omit, format: Literal["JSON", "CSV"] | Omit = omit, limit: int | Omit = omit, location: str | Omit = omit, offset: int | Omit = omit, + region: str | Omit = omit, + subregion: str | 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, @@ -64,6 +67,8 @@ def list( Retrieves a list of locations. Args: + continent: Filters results by continent code. + format: Format in which results will be returned. limit: Limits the number of objects returned in the response. @@ -73,6 +78,10 @@ def list( offset: Skips the specified number of objects before fetching the results. + region: Filters results by region. + + subregion: Filters results by subregion. + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -90,10 +99,13 @@ def list( timeout=timeout, query=maybe_transform( { + "continent": continent, "format": format, "limit": limit, "location": location, "offset": offset, + "region": region, + "subregion": subregion, }, location_list_params.LocationListParams, ), @@ -172,10 +184,13 @@ def with_streaming_response(self) -> AsyncLocationsResourceWithStreamingResponse async def list( self, *, + continent: Literal["AF", "AS", "EU", "NA", "OC", "SA"] | Omit = omit, format: Literal["JSON", "CSV"] | Omit = omit, limit: int | Omit = omit, location: str | Omit = omit, offset: int | Omit = omit, + region: str | Omit = omit, + subregion: str | 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, @@ -187,6 +202,8 @@ async def list( Retrieves a list of locations. Args: + continent: Filters results by continent code. + format: Format in which results will be returned. limit: Limits the number of objects returned in the response. @@ -196,6 +213,10 @@ async def list( offset: Skips the specified number of objects before fetching the results. + region: Filters results by region. + + subregion: Filters results by subregion. + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -213,10 +234,13 @@ async def list( timeout=timeout, query=await async_maybe_transform( { + "continent": continent, "format": format, "limit": limit, "location": location, "offset": offset, + "region": region, + "subregion": subregion, }, location_list_params.LocationListParams, ), diff --git a/src/cloudflare/types/radar/entities/location_get_response.py b/src/cloudflare/types/radar/entities/location_get_response.py index 0341e6df340..b93d87ec918 100644 --- a/src/cloudflare/types/radar/entities/location_get_response.py +++ b/src/cloudflare/types/radar/entities/location_get_response.py @@ -12,6 +12,8 @@ class Location(BaseModel): confidence_level: int = FieldInfo(alias="confidenceLevel") + continent: str + latitude: str """A numeric string.""" diff --git a/src/cloudflare/types/radar/entities/location_list_params.py b/src/cloudflare/types/radar/entities/location_list_params.py index b276685eb71..f448948d6c8 100644 --- a/src/cloudflare/types/radar/entities/location_list_params.py +++ b/src/cloudflare/types/radar/entities/location_list_params.py @@ -8,6 +8,9 @@ class LocationListParams(TypedDict, total=False): + continent: Literal["AF", "AS", "EU", "NA", "OC", "SA"] + """Filters results by continent code.""" + format: Literal["JSON", "CSV"] """Format in which results will be returned.""" @@ -22,3 +25,9 @@ class LocationListParams(TypedDict, total=False): offset: int """Skips the specified number of objects before fetching the results.""" + + region: str + """Filters results by region.""" + + subregion: str + """Filters results by subregion.""" diff --git a/src/cloudflare/types/radar/entities/location_list_response.py b/src/cloudflare/types/radar/entities/location_list_response.py index 11030b01b7a..e7fe1aab221 100644 --- a/src/cloudflare/types/radar/entities/location_list_response.py +++ b/src/cloudflare/types/radar/entities/location_list_response.py @@ -10,6 +10,8 @@ class Location(BaseModel): alpha2: str + continent: str + latitude: str """A numeric string.""" @@ -18,6 +20,10 @@ class Location(BaseModel): name: str + region: str + + subregion: str + class LocationListResponse(BaseModel): locations: List[Location] diff --git a/tests/api_resources/radar/entities/test_locations.py b/tests/api_resources/radar/entities/test_locations.py index 0cf9c0fc608..0e974220e63 100644 --- a/tests/api_resources/radar/entities/test_locations.py +++ b/tests/api_resources/radar/entities/test_locations.py @@ -28,10 +28,13 @@ def test_method_list(self, client: Cloudflare) -> None: @parametrize def test_method_list_with_all_params(self, client: Cloudflare) -> None: location = client.radar.entities.locations.list( + continent="EU", format="JSON", limit=1, location="US,CA", offset=0, + region="Middle East", + subregion="Southern Europe", ) assert_matches_type(LocationListResponse, location, path=["response"]) @@ -115,10 +118,13 @@ async def test_method_list(self, async_client: AsyncCloudflare) -> None: @parametrize async def test_method_list_with_all_params(self, async_client: AsyncCloudflare) -> None: location = await async_client.radar.entities.locations.list( + continent="EU", format="JSON", limit=1, location="US,CA", offset=0, + region="Middle East", + subregion="Southern Europe", ) assert_matches_type(LocationListResponse, location, path=["response"]) From ec3681f12a7c0335a60b0778190c80b72f76422b Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 23 Feb 2026 17:49:59 +0000 Subject: [PATCH 027/279] feat: feat(radar): Add Botnet and PQ Endpoints to developer docs * feat(radar): Add PQ Endpoints feat(radar): Add Botnet Threat Feed endpoint --- .stats.yml | 4 +- api.md | 32 ++ src/cloudflare/resources/radar/__init__.py | 14 + .../resources/radar/entities/asns.py | 193 ++++++++- .../resources/radar/post_quantum/__init__.py | 47 +++ .../resources/radar/post_quantum/origin.py | 385 ++++++++++++++++++ .../radar/post_quantum/post_quantum.py | 134 ++++++ .../resources/radar/post_quantum/tls.py | 184 +++++++++ src/cloudflare/resources/radar/radar.py | 32 ++ .../types/radar/entities/__init__.py | 2 + .../entities/asn_botnet_threat_feed_params.py | 52 +++ .../asn_botnet_threat_feed_response.py | 35 ++ .../types/radar/post_quantum/__init__.py | 10 + .../post_quantum/origin_summary_params.py | 34 ++ .../post_quantum/origin_summary_response.py | 125 ++++++ .../origin_timeseries_groups_params.py | 34 ++ .../origin_timeseries_groups_response.py | 151 +++++++ .../radar/post_quantum/tls_support_params.py | 15 + .../post_quantum/tls_support_response.py | 21 + .../api_resources/radar/entities/test_asns.py | 82 ++++ .../radar/post_quantum/__init__.py | 1 + .../radar/post_quantum/test_origin.py | 200 +++++++++ .../radar/post_quantum/test_tls.py | 86 ++++ 23 files changed, 1868 insertions(+), 5 deletions(-) create mode 100644 src/cloudflare/resources/radar/post_quantum/__init__.py create mode 100644 src/cloudflare/resources/radar/post_quantum/origin.py create mode 100644 src/cloudflare/resources/radar/post_quantum/post_quantum.py create mode 100644 src/cloudflare/resources/radar/post_quantum/tls.py create mode 100644 src/cloudflare/types/radar/entities/asn_botnet_threat_feed_params.py create mode 100644 src/cloudflare/types/radar/entities/asn_botnet_threat_feed_response.py create mode 100644 src/cloudflare/types/radar/post_quantum/__init__.py create mode 100644 src/cloudflare/types/radar/post_quantum/origin_summary_params.py create mode 100644 src/cloudflare/types/radar/post_quantum/origin_summary_response.py create mode 100644 src/cloudflare/types/radar/post_quantum/origin_timeseries_groups_params.py create mode 100644 src/cloudflare/types/radar/post_quantum/origin_timeseries_groups_response.py create mode 100644 src/cloudflare/types/radar/post_quantum/tls_support_params.py create mode 100644 src/cloudflare/types/radar/post_quantum/tls_support_response.py create mode 100644 tests/api_resources/radar/post_quantum/__init__.py create mode 100644 tests/api_resources/radar/post_quantum/test_origin.py create mode 100644 tests/api_resources/radar/post_quantum/test_tls.py diff --git a/.stats.yml b/.stats.yml index 048dfa31519..9362ade0e75 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ -configured_endpoints: 2028 +configured_endpoints: 2032 openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-a909b87c05e478194e997f18d24300cff7cf8cf978d8fbc45af8866c5575bf63.yml openapi_spec_hash: 4989f8168da4edbbb107a55e74690fe0 -config_hash: 7a70007089f586cc7b1ebd1808030dd1 +config_hash: 405e0229a3b5214d99c53598e78f85a1 diff --git a/api.md b/api.md index 7eb2c108767..3d2192a97e5 100644 --- a/api.md +++ b/api.md @@ -8126,6 +8126,36 @@ Methods: - client.radar.netflows.top.ases(\*\*params) -> TopAsesResponse - client.radar.netflows.top.locations(\*\*params) -> TopLocationsResponse +## PostQuantum + +### Origin + +Types: + +```python +from cloudflare.types.radar.post_quantum import ( + OriginSummaryResponse, + OriginTimeseriesGroupsResponse, +) +``` + +Methods: + +- client.radar.post_quantum.origin.summary(dimension, \*\*params) -> OriginSummaryResponse +- client.radar.post_quantum.origin.timeseries_groups(dimension, \*\*params) -> OriginTimeseriesGroupsResponse + +### TLS + +Types: + +```python +from cloudflare.types.radar.post_quantum import TLSSupportResponse +``` + +Methods: + +- client.radar.post_quantum.tls.support(\*\*params) -> TLSSupportResponse + ## Search Types: @@ -8670,6 +8700,7 @@ Types: from cloudflare.types.radar.entities import ( ASNListResponse, ASNAsSetResponse, + ASNBotnetThreatFeedResponse, ASNGetResponse, ASNIPResponse, ASNRelResponse, @@ -8680,6 +8711,7 @@ Methods: - client.radar.entities.asns.list(\*\*params) -> ASNListResponse - client.radar.entities.asns.as_set(asn, \*\*params) -> ASNAsSetResponse +- client.radar.entities.asns.botnet_threat_feed(\*\*params) -> ASNBotnetThreatFeedResponse - client.radar.entities.asns.get(asn, \*\*params) -> ASNGetResponse - client.radar.entities.asns.ip(\*\*params) -> ASNIPResponse - client.radar.entities.asns.rel(asn, \*\*params) -> ASNRelResponse diff --git a/src/cloudflare/resources/radar/__init__.py b/src/cloudflare/resources/radar/__init__.py index b4245d8dc48..2c3d00a3fd1 100644 --- a/src/cloudflare/resources/radar/__init__.py +++ b/src/cloudflare/resources/radar/__init__.py @@ -152,6 +152,14 @@ GeolocationsResourceWithStreamingResponse, AsyncGeolocationsResourceWithStreamingResponse, ) +from .post_quantum import ( + PostQuantumResource, + AsyncPostQuantumResource, + PostQuantumResourceWithRawResponse, + AsyncPostQuantumResourceWithRawResponse, + PostQuantumResourceWithStreamingResponse, + AsyncPostQuantumResourceWithStreamingResponse, +) from .verified_bots import ( VerifiedBotsResource, AsyncVerifiedBotsResource, @@ -234,6 +242,12 @@ "AsyncNetFlowsResourceWithRawResponse", "NetFlowsResourceWithStreamingResponse", "AsyncNetFlowsResourceWithStreamingResponse", + "PostQuantumResource", + "AsyncPostQuantumResource", + "PostQuantumResourceWithRawResponse", + "AsyncPostQuantumResourceWithRawResponse", + "PostQuantumResourceWithStreamingResponse", + "AsyncPostQuantumResourceWithStreamingResponse", "SearchResource", "AsyncSearchResource", "SearchResourceWithRawResponse", diff --git a/src/cloudflare/resources/radar/entities/asns.py b/src/cloudflare/resources/radar/entities/asns.py index 3e20efe46e0..8654bd4fadc 100644 --- a/src/cloudflare/resources/radar/entities/asns.py +++ b/src/cloudflare/resources/radar/entities/asns.py @@ -2,12 +2,13 @@ from __future__ import annotations -from typing import Type, cast +from typing import Type, Union, cast +from datetime import date from typing_extensions import Literal import httpx -from ...._types import Body, Omit, Query, Headers, NotGiven, omit, not_given +from ...._types import Body, Omit, Query, Headers, NotGiven, SequenceNotStr, omit, not_given from ...._utils import maybe_transform, async_maybe_transform from ...._compat import cached_property from ...._resource import SyncAPIResource, AsyncAPIResource @@ -19,12 +20,20 @@ ) from ...._wrappers import ResultWrapper from ...._base_client import make_request_options -from ....types.radar.entities import asn_ip_params, asn_get_params, asn_rel_params, asn_list_params, asn_as_set_params +from ....types.radar.entities import ( + asn_ip_params, + asn_get_params, + asn_rel_params, + asn_list_params, + asn_as_set_params, + asn_botnet_threat_feed_params, +) from ....types.radar.entities.asn_ip_response import ASNIPResponse from ....types.radar.entities.asn_get_response import ASNGetResponse from ....types.radar.entities.asn_rel_response import ASNRelResponse from ....types.radar.entities.asn_list_response import ASNListResponse from ....types.radar.entities.asn_as_set_response import ASNAsSetResponse +from ....types.radar.entities.asn_botnet_threat_feed_response import ASNBotnetThreatFeedResponse __all__ = ["ASNsResource", "AsyncASNsResource"] @@ -154,6 +163,89 @@ def as_set( cast_to=cast(Type[ASNAsSetResponse], ResultWrapper[ASNAsSetResponse]), ) + def botnet_threat_feed( + self, + *, + asn: SequenceNotStr[str] | Omit = omit, + compare_date_range: str | Omit = omit, + date: Union[str, date] | Omit = omit, + format: Literal["JSON", "CSV"] | Omit = omit, + limit: int | Omit = omit, + location: str | Omit = omit, + metric: Literal["OFFENSE_COUNT", "NUMBER_OF_OFFENDING_IPS"] | Omit = omit, + offset: int | Omit = omit, + sort_order: Literal["ASC", "DESC"] | 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, + ) -> ASNBotnetThreatFeedResponse: + """ + Retrieves a ranked list of Autonomous Systems based on their presence in the + Cloudflare Botnet Threat Feed. Rankings can be sorted by offense count or number + of bad IPs. Optionally compare to a previous date to see rank changes. + + Args: + asn: Filters results by Autonomous System. Specify one or more Autonomous System + Numbers (ASNs) as a comma-separated list. Prefix with `-` to exclude ASNs from + results. For example, `-174, 3356` excludes results from AS174, but includes + results from AS3356. + + compare_date_range: Relative date range for rank change comparison (e.g., "1d", "7d", "30d"). + + date: The date to retrieve (YYYY-MM-DD format). If not specified, returns the most + recent available data. Note: This is the date the report was generated. The + report is generated from information collected from the previous day (e.g., the + 2026-02-23 entry contains data from 2026-02-22). + + format: Format in which results will be returned. + + limit: Limits the number of objects returned in the response. + + location: Filters results by location. Specify an alpha-2 location code. + + metric: Metric to rank ASNs by. + + offset: Skips the specified number of objects before fetching the results. + + sort_order: Sort order. + + 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 + """ + return self._get( + "/radar/entities/asns/botnet_threat_feed", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=maybe_transform( + { + "asn": asn, + "compare_date_range": compare_date_range, + "date": date, + "format": format, + "limit": limit, + "location": location, + "metric": metric, + "offset": offset, + "sort_order": sort_order, + }, + asn_botnet_threat_feed_params.ASNBotnetThreatFeedParams, + ), + post_parser=ResultWrapper[ASNBotnetThreatFeedResponse]._unwrapper, + ), + cast_to=cast(Type[ASNBotnetThreatFeedResponse], ResultWrapper[ASNBotnetThreatFeedResponse]), + ) + def get( self, asn: int, @@ -424,6 +516,89 @@ async def as_set( cast_to=cast(Type[ASNAsSetResponse], ResultWrapper[ASNAsSetResponse]), ) + async def botnet_threat_feed( + self, + *, + asn: SequenceNotStr[str] | Omit = omit, + compare_date_range: str | Omit = omit, + date: Union[str, date] | Omit = omit, + format: Literal["JSON", "CSV"] | Omit = omit, + limit: int | Omit = omit, + location: str | Omit = omit, + metric: Literal["OFFENSE_COUNT", "NUMBER_OF_OFFENDING_IPS"] | Omit = omit, + offset: int | Omit = omit, + sort_order: Literal["ASC", "DESC"] | 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, + ) -> ASNBotnetThreatFeedResponse: + """ + Retrieves a ranked list of Autonomous Systems based on their presence in the + Cloudflare Botnet Threat Feed. Rankings can be sorted by offense count or number + of bad IPs. Optionally compare to a previous date to see rank changes. + + Args: + asn: Filters results by Autonomous System. Specify one or more Autonomous System + Numbers (ASNs) as a comma-separated list. Prefix with `-` to exclude ASNs from + results. For example, `-174, 3356` excludes results from AS174, but includes + results from AS3356. + + compare_date_range: Relative date range for rank change comparison (e.g., "1d", "7d", "30d"). + + date: The date to retrieve (YYYY-MM-DD format). If not specified, returns the most + recent available data. Note: This is the date the report was generated. The + report is generated from information collected from the previous day (e.g., the + 2026-02-23 entry contains data from 2026-02-22). + + format: Format in which results will be returned. + + limit: Limits the number of objects returned in the response. + + location: Filters results by location. Specify an alpha-2 location code. + + metric: Metric to rank ASNs by. + + offset: Skips the specified number of objects before fetching the results. + + sort_order: Sort order. + + 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 + """ + return await self._get( + "/radar/entities/asns/botnet_threat_feed", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=await async_maybe_transform( + { + "asn": asn, + "compare_date_range": compare_date_range, + "date": date, + "format": format, + "limit": limit, + "location": location, + "metric": metric, + "offset": offset, + "sort_order": sort_order, + }, + asn_botnet_threat_feed_params.ASNBotnetThreatFeedParams, + ), + post_parser=ResultWrapper[ASNBotnetThreatFeedResponse]._unwrapper, + ), + cast_to=cast(Type[ASNBotnetThreatFeedResponse], ResultWrapper[ASNBotnetThreatFeedResponse]), + ) + async def get( self, asn: int, @@ -579,6 +754,9 @@ def __init__(self, asns: ASNsResource) -> None: self.as_set = to_raw_response_wrapper( asns.as_set, ) + self.botnet_threat_feed = to_raw_response_wrapper( + asns.botnet_threat_feed, + ) self.get = to_raw_response_wrapper( asns.get, ) @@ -600,6 +778,9 @@ def __init__(self, asns: AsyncASNsResource) -> None: self.as_set = async_to_raw_response_wrapper( asns.as_set, ) + self.botnet_threat_feed = async_to_raw_response_wrapper( + asns.botnet_threat_feed, + ) self.get = async_to_raw_response_wrapper( asns.get, ) @@ -621,6 +802,9 @@ def __init__(self, asns: ASNsResource) -> None: self.as_set = to_streamed_response_wrapper( asns.as_set, ) + self.botnet_threat_feed = to_streamed_response_wrapper( + asns.botnet_threat_feed, + ) self.get = to_streamed_response_wrapper( asns.get, ) @@ -642,6 +826,9 @@ def __init__(self, asns: AsyncASNsResource) -> None: self.as_set = async_to_streamed_response_wrapper( asns.as_set, ) + self.botnet_threat_feed = async_to_streamed_response_wrapper( + asns.botnet_threat_feed, + ) self.get = async_to_streamed_response_wrapper( asns.get, ) diff --git a/src/cloudflare/resources/radar/post_quantum/__init__.py b/src/cloudflare/resources/radar/post_quantum/__init__.py new file mode 100644 index 00000000000..1b6ec0920cd --- /dev/null +++ b/src/cloudflare/resources/radar/post_quantum/__init__.py @@ -0,0 +1,47 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from .tls import ( + TLSResource, + AsyncTLSResource, + TLSResourceWithRawResponse, + AsyncTLSResourceWithRawResponse, + TLSResourceWithStreamingResponse, + AsyncTLSResourceWithStreamingResponse, +) +from .origin import ( + OriginResource, + AsyncOriginResource, + OriginResourceWithRawResponse, + AsyncOriginResourceWithRawResponse, + OriginResourceWithStreamingResponse, + AsyncOriginResourceWithStreamingResponse, +) +from .post_quantum import ( + PostQuantumResource, + AsyncPostQuantumResource, + PostQuantumResourceWithRawResponse, + AsyncPostQuantumResourceWithRawResponse, + PostQuantumResourceWithStreamingResponse, + AsyncPostQuantumResourceWithStreamingResponse, +) + +__all__ = [ + "OriginResource", + "AsyncOriginResource", + "OriginResourceWithRawResponse", + "AsyncOriginResourceWithRawResponse", + "OriginResourceWithStreamingResponse", + "AsyncOriginResourceWithStreamingResponse", + "TLSResource", + "AsyncTLSResource", + "TLSResourceWithRawResponse", + "AsyncTLSResourceWithRawResponse", + "TLSResourceWithStreamingResponse", + "AsyncTLSResourceWithStreamingResponse", + "PostQuantumResource", + "AsyncPostQuantumResource", + "PostQuantumResourceWithRawResponse", + "AsyncPostQuantumResourceWithRawResponse", + "PostQuantumResourceWithStreamingResponse", + "AsyncPostQuantumResourceWithStreamingResponse", +] diff --git a/src/cloudflare/resources/radar/post_quantum/origin.py b/src/cloudflare/resources/radar/post_quantum/origin.py new file mode 100644 index 00000000000..87f5ad54f8f --- /dev/null +++ b/src/cloudflare/resources/radar/post_quantum/origin.py @@ -0,0 +1,385 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Type, Union, cast +from datetime import datetime +from typing_extensions import Literal + +import httpx + +from ...._types import Body, Omit, Query, Headers, NotGiven, SequenceNotStr, omit, not_given +from ...._utils import maybe_transform, async_maybe_transform +from ...._compat import cached_property +from ...._resource import SyncAPIResource, AsyncAPIResource +from ...._response import ( + to_raw_response_wrapper, + to_streamed_response_wrapper, + async_to_raw_response_wrapper, + async_to_streamed_response_wrapper, +) +from ...._wrappers import ResultWrapper +from ...._base_client import make_request_options +from ....types.radar.post_quantum import origin_summary_params, origin_timeseries_groups_params +from ....types.radar.post_quantum.origin_summary_response import OriginSummaryResponse +from ....types.radar.post_quantum.origin_timeseries_groups_response import OriginTimeseriesGroupsResponse + +__all__ = ["OriginResource", "AsyncOriginResource"] + + +class OriginResource(SyncAPIResource): + @cached_property + def with_raw_response(self) -> OriginResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers + """ + return OriginResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> OriginResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/cloudflare/cloudflare-python#with_streaming_response + """ + return OriginResourceWithStreamingResponse(self) + + def summary( + self, + dimension: Literal["KEY_AGREEMENT"], + *, + date_end: SequenceNotStr[Union[str, datetime]] | Omit = omit, + date_range: SequenceNotStr[str] | Omit = omit, + date_start: SequenceNotStr[Union[str, datetime]] | Omit = omit, + format: Literal["JSON", "CSV"] | Omit = omit, + name: SequenceNotStr[str] | 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, + ) -> OriginSummaryResponse: + """ + Returns a summary of origin post-quantum data grouped by the specified + dimension. + + Args: + dimension: Specifies the origin post-quantum data dimension by which to group the results. + + date_end: End of the date range (inclusive). + + date_range: Filters results by date range. For example, use `7d` and `7dcontrol` to compare + this week with the previous week. Use this parameter or set specific start and + end dates (`dateStart` and `dateEnd` parameters). + + date_start: Start of the date range. + + format: Format in which results will be returned. + + name: Array of names used to label the series in the response. + + 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 dimension: + raise ValueError(f"Expected a non-empty value for `dimension` but received {dimension!r}") + return self._get( + f"/radar/post_quantum/origin/summary/{dimension}", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=maybe_transform( + { + "date_end": date_end, + "date_range": date_range, + "date_start": date_start, + "format": format, + "name": name, + }, + origin_summary_params.OriginSummaryParams, + ), + post_parser=ResultWrapper[OriginSummaryResponse]._unwrapper, + ), + cast_to=cast(Type[OriginSummaryResponse], ResultWrapper[OriginSummaryResponse]), + ) + + def timeseries_groups( + self, + dimension: Literal["KEY_AGREEMENT"], + *, + date_end: SequenceNotStr[Union[str, datetime]] | Omit = omit, + date_range: SequenceNotStr[str] | Omit = omit, + date_start: SequenceNotStr[Union[str, datetime]] | Omit = omit, + format: Literal["JSON", "CSV"] | Omit = omit, + name: SequenceNotStr[str] | 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, + ) -> OriginTimeseriesGroupsResponse: + """ + Returns a timeseries of origin post-quantum data grouped by the specified + dimension. + + Args: + dimension: Specifies the origin post-quantum data dimension by which to group the results. + + date_end: End of the date range (inclusive). + + date_range: Filters results by date range. For example, use `7d` and `7dcontrol` to compare + this week with the previous week. Use this parameter or set specific start and + end dates (`dateStart` and `dateEnd` parameters). + + date_start: Start of the date range. + + format: Format in which results will be returned. + + name: Array of names used to label the series in the response. + + 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 dimension: + raise ValueError(f"Expected a non-empty value for `dimension` but received {dimension!r}") + return self._get( + f"/radar/post_quantum/origin/timeseries_groups/{dimension}", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=maybe_transform( + { + "date_end": date_end, + "date_range": date_range, + "date_start": date_start, + "format": format, + "name": name, + }, + origin_timeseries_groups_params.OriginTimeseriesGroupsParams, + ), + post_parser=ResultWrapper[OriginTimeseriesGroupsResponse]._unwrapper, + ), + cast_to=cast(Type[OriginTimeseriesGroupsResponse], ResultWrapper[OriginTimeseriesGroupsResponse]), + ) + + +class AsyncOriginResource(AsyncAPIResource): + @cached_property + def with_raw_response(self) -> AsyncOriginResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers + """ + return AsyncOriginResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> AsyncOriginResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/cloudflare/cloudflare-python#with_streaming_response + """ + return AsyncOriginResourceWithStreamingResponse(self) + + async def summary( + self, + dimension: Literal["KEY_AGREEMENT"], + *, + date_end: SequenceNotStr[Union[str, datetime]] | Omit = omit, + date_range: SequenceNotStr[str] | Omit = omit, + date_start: SequenceNotStr[Union[str, datetime]] | Omit = omit, + format: Literal["JSON", "CSV"] | Omit = omit, + name: SequenceNotStr[str] | 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, + ) -> OriginSummaryResponse: + """ + Returns a summary of origin post-quantum data grouped by the specified + dimension. + + Args: + dimension: Specifies the origin post-quantum data dimension by which to group the results. + + date_end: End of the date range (inclusive). + + date_range: Filters results by date range. For example, use `7d` and `7dcontrol` to compare + this week with the previous week. Use this parameter or set specific start and + end dates (`dateStart` and `dateEnd` parameters). + + date_start: Start of the date range. + + format: Format in which results will be returned. + + name: Array of names used to label the series in the response. + + 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 dimension: + raise ValueError(f"Expected a non-empty value for `dimension` but received {dimension!r}") + return await self._get( + f"/radar/post_quantum/origin/summary/{dimension}", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=await async_maybe_transform( + { + "date_end": date_end, + "date_range": date_range, + "date_start": date_start, + "format": format, + "name": name, + }, + origin_summary_params.OriginSummaryParams, + ), + post_parser=ResultWrapper[OriginSummaryResponse]._unwrapper, + ), + cast_to=cast(Type[OriginSummaryResponse], ResultWrapper[OriginSummaryResponse]), + ) + + async def timeseries_groups( + self, + dimension: Literal["KEY_AGREEMENT"], + *, + date_end: SequenceNotStr[Union[str, datetime]] | Omit = omit, + date_range: SequenceNotStr[str] | Omit = omit, + date_start: SequenceNotStr[Union[str, datetime]] | Omit = omit, + format: Literal["JSON", "CSV"] | Omit = omit, + name: SequenceNotStr[str] | 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, + ) -> OriginTimeseriesGroupsResponse: + """ + Returns a timeseries of origin post-quantum data grouped by the specified + dimension. + + Args: + dimension: Specifies the origin post-quantum data dimension by which to group the results. + + date_end: End of the date range (inclusive). + + date_range: Filters results by date range. For example, use `7d` and `7dcontrol` to compare + this week with the previous week. Use this parameter or set specific start and + end dates (`dateStart` and `dateEnd` parameters). + + date_start: Start of the date range. + + format: Format in which results will be returned. + + name: Array of names used to label the series in the response. + + 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 dimension: + raise ValueError(f"Expected a non-empty value for `dimension` but received {dimension!r}") + return await self._get( + f"/radar/post_quantum/origin/timeseries_groups/{dimension}", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=await async_maybe_transform( + { + "date_end": date_end, + "date_range": date_range, + "date_start": date_start, + "format": format, + "name": name, + }, + origin_timeseries_groups_params.OriginTimeseriesGroupsParams, + ), + post_parser=ResultWrapper[OriginTimeseriesGroupsResponse]._unwrapper, + ), + cast_to=cast(Type[OriginTimeseriesGroupsResponse], ResultWrapper[OriginTimeseriesGroupsResponse]), + ) + + +class OriginResourceWithRawResponse: + def __init__(self, origin: OriginResource) -> None: + self._origin = origin + + self.summary = to_raw_response_wrapper( + origin.summary, + ) + self.timeseries_groups = to_raw_response_wrapper( + origin.timeseries_groups, + ) + + +class AsyncOriginResourceWithRawResponse: + def __init__(self, origin: AsyncOriginResource) -> None: + self._origin = origin + + self.summary = async_to_raw_response_wrapper( + origin.summary, + ) + self.timeseries_groups = async_to_raw_response_wrapper( + origin.timeseries_groups, + ) + + +class OriginResourceWithStreamingResponse: + def __init__(self, origin: OriginResource) -> None: + self._origin = origin + + self.summary = to_streamed_response_wrapper( + origin.summary, + ) + self.timeseries_groups = to_streamed_response_wrapper( + origin.timeseries_groups, + ) + + +class AsyncOriginResourceWithStreamingResponse: + def __init__(self, origin: AsyncOriginResource) -> None: + self._origin = origin + + self.summary = async_to_streamed_response_wrapper( + origin.summary, + ) + self.timeseries_groups = async_to_streamed_response_wrapper( + origin.timeseries_groups, + ) diff --git a/src/cloudflare/resources/radar/post_quantum/post_quantum.py b/src/cloudflare/resources/radar/post_quantum/post_quantum.py new file mode 100644 index 00000000000..3860bba6380 --- /dev/null +++ b/src/cloudflare/resources/radar/post_quantum/post_quantum.py @@ -0,0 +1,134 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from .tls import ( + TLSResource, + AsyncTLSResource, + TLSResourceWithRawResponse, + AsyncTLSResourceWithRawResponse, + TLSResourceWithStreamingResponse, + AsyncTLSResourceWithStreamingResponse, +) +from .origin import ( + OriginResource, + AsyncOriginResource, + OriginResourceWithRawResponse, + AsyncOriginResourceWithRawResponse, + OriginResourceWithStreamingResponse, + AsyncOriginResourceWithStreamingResponse, +) +from ...._compat import cached_property +from ...._resource import SyncAPIResource, AsyncAPIResource + +__all__ = ["PostQuantumResource", "AsyncPostQuantumResource"] + + +class PostQuantumResource(SyncAPIResource): + @cached_property + def origin(self) -> OriginResource: + return OriginResource(self._client) + + @cached_property + def tls(self) -> TLSResource: + return TLSResource(self._client) + + @cached_property + def with_raw_response(self) -> PostQuantumResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers + """ + return PostQuantumResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> PostQuantumResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/cloudflare/cloudflare-python#with_streaming_response + """ + return PostQuantumResourceWithStreamingResponse(self) + + +class AsyncPostQuantumResource(AsyncAPIResource): + @cached_property + def origin(self) -> AsyncOriginResource: + return AsyncOriginResource(self._client) + + @cached_property + def tls(self) -> AsyncTLSResource: + return AsyncTLSResource(self._client) + + @cached_property + def with_raw_response(self) -> AsyncPostQuantumResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers + """ + return AsyncPostQuantumResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> AsyncPostQuantumResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/cloudflare/cloudflare-python#with_streaming_response + """ + return AsyncPostQuantumResourceWithStreamingResponse(self) + + +class PostQuantumResourceWithRawResponse: + def __init__(self, post_quantum: PostQuantumResource) -> None: + self._post_quantum = post_quantum + + @cached_property + def origin(self) -> OriginResourceWithRawResponse: + return OriginResourceWithRawResponse(self._post_quantum.origin) + + @cached_property + def tls(self) -> TLSResourceWithRawResponse: + return TLSResourceWithRawResponse(self._post_quantum.tls) + + +class AsyncPostQuantumResourceWithRawResponse: + def __init__(self, post_quantum: AsyncPostQuantumResource) -> None: + self._post_quantum = post_quantum + + @cached_property + def origin(self) -> AsyncOriginResourceWithRawResponse: + return AsyncOriginResourceWithRawResponse(self._post_quantum.origin) + + @cached_property + def tls(self) -> AsyncTLSResourceWithRawResponse: + return AsyncTLSResourceWithRawResponse(self._post_quantum.tls) + + +class PostQuantumResourceWithStreamingResponse: + def __init__(self, post_quantum: PostQuantumResource) -> None: + self._post_quantum = post_quantum + + @cached_property + def origin(self) -> OriginResourceWithStreamingResponse: + return OriginResourceWithStreamingResponse(self._post_quantum.origin) + + @cached_property + def tls(self) -> TLSResourceWithStreamingResponse: + return TLSResourceWithStreamingResponse(self._post_quantum.tls) + + +class AsyncPostQuantumResourceWithStreamingResponse: + def __init__(self, post_quantum: AsyncPostQuantumResource) -> None: + self._post_quantum = post_quantum + + @cached_property + def origin(self) -> AsyncOriginResourceWithStreamingResponse: + return AsyncOriginResourceWithStreamingResponse(self._post_quantum.origin) + + @cached_property + def tls(self) -> AsyncTLSResourceWithStreamingResponse: + return AsyncTLSResourceWithStreamingResponse(self._post_quantum.tls) diff --git a/src/cloudflare/resources/radar/post_quantum/tls.py b/src/cloudflare/resources/radar/post_quantum/tls.py new file mode 100644 index 00000000000..e10649bee1d --- /dev/null +++ b/src/cloudflare/resources/radar/post_quantum/tls.py @@ -0,0 +1,184 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Type, cast + +import httpx + +from ...._types import Body, Query, Headers, NotGiven, not_given +from ...._utils import maybe_transform, async_maybe_transform +from ...._compat import cached_property +from ...._resource import SyncAPIResource, AsyncAPIResource +from ...._response import ( + to_raw_response_wrapper, + to_streamed_response_wrapper, + async_to_raw_response_wrapper, + async_to_streamed_response_wrapper, +) +from ...._wrappers import ResultWrapper +from ...._base_client import make_request_options +from ....types.radar.post_quantum import tls_support_params +from ....types.radar.post_quantum.tls_support_response import TLSSupportResponse + +__all__ = ["TLSResource", "AsyncTLSResource"] + + +class TLSResource(SyncAPIResource): + @cached_property + def with_raw_response(self) -> TLSResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers + """ + return TLSResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> TLSResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/cloudflare/cloudflare-python#with_streaming_response + """ + return TLSResourceWithStreamingResponse(self) + + def support( + self, + *, + host: 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, + ) -> TLSSupportResponse: + """ + Tests whether a hostname or IP address supports Post-Quantum (PQ) TLS key + exchange. Returns information about the negotiated key exchange algorithm and + whether it uses PQ cryptography. + + Args: + host: Hostname or IP address to test for Post-Quantum TLS support, optionally with + port (defaults to 443). + + 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 + """ + return self._get( + "/radar/post_quantum/tls/support", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=maybe_transform({"host": host}, tls_support_params.TLSSupportParams), + post_parser=ResultWrapper[TLSSupportResponse]._unwrapper, + ), + cast_to=cast(Type[TLSSupportResponse], ResultWrapper[TLSSupportResponse]), + ) + + +class AsyncTLSResource(AsyncAPIResource): + @cached_property + def with_raw_response(self) -> AsyncTLSResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers + """ + return AsyncTLSResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> AsyncTLSResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/cloudflare/cloudflare-python#with_streaming_response + """ + return AsyncTLSResourceWithStreamingResponse(self) + + async def support( + self, + *, + host: 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, + ) -> TLSSupportResponse: + """ + Tests whether a hostname or IP address supports Post-Quantum (PQ) TLS key + exchange. Returns information about the negotiated key exchange algorithm and + whether it uses PQ cryptography. + + Args: + host: Hostname or IP address to test for Post-Quantum TLS support, optionally with + port (defaults to 443). + + 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 + """ + return await self._get( + "/radar/post_quantum/tls/support", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=await async_maybe_transform({"host": host}, tls_support_params.TLSSupportParams), + post_parser=ResultWrapper[TLSSupportResponse]._unwrapper, + ), + cast_to=cast(Type[TLSSupportResponse], ResultWrapper[TLSSupportResponse]), + ) + + +class TLSResourceWithRawResponse: + def __init__(self, tls: TLSResource) -> None: + self._tls = tls + + self.support = to_raw_response_wrapper( + tls.support, + ) + + +class AsyncTLSResourceWithRawResponse: + def __init__(self, tls: AsyncTLSResource) -> None: + self._tls = tls + + self.support = async_to_raw_response_wrapper( + tls.support, + ) + + +class TLSResourceWithStreamingResponse: + def __init__(self, tls: TLSResource) -> None: + self._tls = tls + + self.support = to_streamed_response_wrapper( + tls.support, + ) + + +class AsyncTLSResourceWithStreamingResponse: + def __init__(self, tls: AsyncTLSResource) -> None: + self._tls = tls + + self.support = async_to_streamed_response_wrapper( + tls.support, + ) diff --git a/src/cloudflare/resources/radar/radar.py b/src/cloudflare/resources/radar/radar.py index 8cc06d6d13d..8663fda883b 100644 --- a/src/cloudflare/resources/radar/radar.py +++ b/src/cloudflare/resources/radar/radar.py @@ -156,6 +156,14 @@ AnnotationsResourceWithStreamingResponse, AsyncAnnotationsResourceWithStreamingResponse, ) +from .post_quantum.post_quantum import ( + PostQuantumResource, + AsyncPostQuantumResource, + PostQuantumResourceWithRawResponse, + AsyncPostQuantumResourceWithRawResponse, + PostQuantumResourceWithStreamingResponse, + AsyncPostQuantumResourceWithStreamingResponse, +) from .verified_bots.verified_bots import ( VerifiedBotsResource, AsyncVerifiedBotsResource, @@ -217,6 +225,10 @@ def dns(self) -> DNSResource: def netflows(self) -> NetFlowsResource: return NetFlowsResource(self._client) + @cached_property + def post_quantum(self) -> PostQuantumResource: + return PostQuantumResource(self._client) + @cached_property def search(self) -> SearchResource: return SearchResource(self._client) @@ -326,6 +338,10 @@ def dns(self) -> AsyncDNSResource: def netflows(self) -> AsyncNetFlowsResource: return AsyncNetFlowsResource(self._client) + @cached_property + def post_quantum(self) -> AsyncPostQuantumResource: + return AsyncPostQuantumResource(self._client) + @cached_property def search(self) -> AsyncSearchResource: return AsyncSearchResource(self._client) @@ -438,6 +454,10 @@ def dns(self) -> DNSResourceWithRawResponse: def netflows(self) -> NetFlowsResourceWithRawResponse: return NetFlowsResourceWithRawResponse(self._radar.netflows) + @cached_property + def post_quantum(self) -> PostQuantumResourceWithRawResponse: + return PostQuantumResourceWithRawResponse(self._radar.post_quantum) + @cached_property def search(self) -> SearchResourceWithRawResponse: return SearchResourceWithRawResponse(self._radar.search) @@ -531,6 +551,10 @@ def dns(self) -> AsyncDNSResourceWithRawResponse: def netflows(self) -> AsyncNetFlowsResourceWithRawResponse: return AsyncNetFlowsResourceWithRawResponse(self._radar.netflows) + @cached_property + def post_quantum(self) -> AsyncPostQuantumResourceWithRawResponse: + return AsyncPostQuantumResourceWithRawResponse(self._radar.post_quantum) + @cached_property def search(self) -> AsyncSearchResourceWithRawResponse: return AsyncSearchResourceWithRawResponse(self._radar.search) @@ -624,6 +648,10 @@ def dns(self) -> DNSResourceWithStreamingResponse: def netflows(self) -> NetFlowsResourceWithStreamingResponse: return NetFlowsResourceWithStreamingResponse(self._radar.netflows) + @cached_property + def post_quantum(self) -> PostQuantumResourceWithStreamingResponse: + return PostQuantumResourceWithStreamingResponse(self._radar.post_quantum) + @cached_property def search(self) -> SearchResourceWithStreamingResponse: return SearchResourceWithStreamingResponse(self._radar.search) @@ -717,6 +745,10 @@ def dns(self) -> AsyncDNSResourceWithStreamingResponse: def netflows(self) -> AsyncNetFlowsResourceWithStreamingResponse: return AsyncNetFlowsResourceWithStreamingResponse(self._radar.netflows) + @cached_property + def post_quantum(self) -> AsyncPostQuantumResourceWithStreamingResponse: + return AsyncPostQuantumResourceWithStreamingResponse(self._radar.post_quantum) + @cached_property def search(self) -> AsyncSearchResourceWithStreamingResponse: return AsyncSearchResourceWithStreamingResponse(self._radar.search) diff --git a/src/cloudflare/types/radar/entities/__init__.py b/src/cloudflare/types/radar/entities/__init__.py index 6c5003d8aab..24752ba6bf2 100644 --- a/src/cloudflare/types/radar/entities/__init__.py +++ b/src/cloudflare/types/radar/entities/__init__.py @@ -16,3 +16,5 @@ from .location_list_params import LocationListParams as LocationListParams from .location_get_response import LocationGetResponse as LocationGetResponse from .location_list_response import LocationListResponse as LocationListResponse +from .asn_botnet_threat_feed_params import ASNBotnetThreatFeedParams as ASNBotnetThreatFeedParams +from .asn_botnet_threat_feed_response import ASNBotnetThreatFeedResponse as ASNBotnetThreatFeedResponse diff --git a/src/cloudflare/types/radar/entities/asn_botnet_threat_feed_params.py b/src/cloudflare/types/radar/entities/asn_botnet_threat_feed_params.py new file mode 100644 index 00000000000..3fa0068d4a6 --- /dev/null +++ b/src/cloudflare/types/radar/entities/asn_botnet_threat_feed_params.py @@ -0,0 +1,52 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +import datetime +from typing import Union +from typing_extensions import Literal, Annotated, TypedDict + +from ...._types import SequenceNotStr +from ...._utils import PropertyInfo + +__all__ = ["ASNBotnetThreatFeedParams"] + + +class ASNBotnetThreatFeedParams(TypedDict, total=False): + asn: SequenceNotStr[str] + """Filters results by Autonomous System. + + Specify one or more Autonomous System Numbers (ASNs) as a comma-separated list. + Prefix with `-` to exclude ASNs from results. For example, `-174, 3356` excludes + results from AS174, but includes results from AS3356. + """ + + compare_date_range: Annotated[str, PropertyInfo(alias="compareDateRange")] + """Relative date range for rank change comparison (e.g., "1d", "7d", "30d").""" + + date: Annotated[Union[str, datetime.date], PropertyInfo(format="iso8601")] + """The date to retrieve (YYYY-MM-DD format). + + If not specified, returns the most recent available data. Note: This is the date + the report was generated. The report is generated from information collected + from the previous day (e.g., the 2026-02-23 entry contains data from + 2026-02-22). + """ + + format: Literal["JSON", "CSV"] + """Format in which results will be returned.""" + + limit: int + """Limits the number of objects returned in the response.""" + + location: str + """Filters results by location. Specify an alpha-2 location code.""" + + metric: Literal["OFFENSE_COUNT", "NUMBER_OF_OFFENDING_IPS"] + """Metric to rank ASNs by.""" + + offset: int + """Skips the specified number of objects before fetching the results.""" + + sort_order: Annotated[Literal["ASC", "DESC"], PropertyInfo(alias="sortOrder")] + """Sort order.""" diff --git a/src/cloudflare/types/radar/entities/asn_botnet_threat_feed_response.py b/src/cloudflare/types/radar/entities/asn_botnet_threat_feed_response.py new file mode 100644 index 00000000000..55c12b616a9 --- /dev/null +++ b/src/cloudflare/types/radar/entities/asn_botnet_threat_feed_response.py @@ -0,0 +1,35 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional + +from pydantic import Field as FieldInfo + +from ...._models import BaseModel + +__all__ = ["ASNBotnetThreatFeedResponse", "Ase", "Meta"] + + +class Ase(BaseModel): + asn: int + + country: str + + name: str + + rank: int + + rank_change: Optional[int] = FieldInfo(alias="rankChange", default=None) + + +class Meta(BaseModel): + date: str + + total: int + + compare_date: Optional[str] = FieldInfo(alias="compareDate", default=None) + + +class ASNBotnetThreatFeedResponse(BaseModel): + ases: List[Ase] + + meta: Meta diff --git a/src/cloudflare/types/radar/post_quantum/__init__.py b/src/cloudflare/types/radar/post_quantum/__init__.py new file mode 100644 index 00000000000..c0a2df15901 --- /dev/null +++ b/src/cloudflare/types/radar/post_quantum/__init__.py @@ -0,0 +1,10 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from .tls_support_params import TLSSupportParams as TLSSupportParams +from .tls_support_response import TLSSupportResponse as TLSSupportResponse +from .origin_summary_params import OriginSummaryParams as OriginSummaryParams +from .origin_summary_response import OriginSummaryResponse as OriginSummaryResponse +from .origin_timeseries_groups_params import OriginTimeseriesGroupsParams as OriginTimeseriesGroupsParams +from .origin_timeseries_groups_response import OriginTimeseriesGroupsResponse as OriginTimeseriesGroupsResponse diff --git a/src/cloudflare/types/radar/post_quantum/origin_summary_params.py b/src/cloudflare/types/radar/post_quantum/origin_summary_params.py new file mode 100644 index 00000000000..b13676cd872 --- /dev/null +++ b/src/cloudflare/types/radar/post_quantum/origin_summary_params.py @@ -0,0 +1,34 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Union +from datetime import datetime +from typing_extensions import Literal, Annotated, TypedDict + +from ...._types import SequenceNotStr +from ...._utils import PropertyInfo + +__all__ = ["OriginSummaryParams"] + + +class OriginSummaryParams(TypedDict, total=False): + date_end: Annotated[SequenceNotStr[Union[str, datetime]], PropertyInfo(alias="dateEnd", format="iso8601")] + """End of the date range (inclusive).""" + + date_range: Annotated[SequenceNotStr[str], PropertyInfo(alias="dateRange")] + """Filters results by date range. + + For example, use `7d` and `7dcontrol` to compare this week with the previous + week. Use this parameter or set specific start and end dates (`dateStart` and + `dateEnd` parameters). + """ + + date_start: Annotated[SequenceNotStr[Union[str, datetime]], PropertyInfo(alias="dateStart", format="iso8601")] + """Start of the date range.""" + + format: Literal["JSON", "CSV"] + """Format in which results will be returned.""" + + name: SequenceNotStr[str] + """Array of names used to label the series in the response.""" diff --git a/src/cloudflare/types/radar/post_quantum/origin_summary_response.py b/src/cloudflare/types/radar/post_quantum/origin_summary_response.py new file mode 100644 index 00000000000..13c6f1e4089 --- /dev/null +++ b/src/cloudflare/types/radar/post_quantum/origin_summary_response.py @@ -0,0 +1,125 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Dict, List +from datetime import datetime +from typing_extensions import Literal + +from pydantic import Field as FieldInfo + +from ...._models import BaseModel + +__all__ = [ + "OriginSummaryResponse", + "Meta", + "MetaConfidenceInfo", + "MetaConfidenceInfoAnnotation", + "MetaDateRange", + "MetaUnit", +] + + +class MetaConfidenceInfoAnnotation(BaseModel): + """Annotation associated with the result (e.g. outage or other type of event).""" + + data_source: Literal[ + "ALL", + "AI_BOTS", + "AI_GATEWAY", + "BGP", + "BOTS", + "CONNECTION_ANOMALY", + "CT", + "DNS", + "DNS_MAGNITUDE", + "DNS_AS112", + "DOS", + "EMAIL_ROUTING", + "EMAIL_SECURITY", + "FW", + "FW_PG", + "HTTP", + "HTTP_CONTROL", + "HTTP_CRAWLER_REFERER", + "HTTP_ORIGINS", + "IQI", + "LEAKED_CREDENTIALS", + "NET", + "ROBOTS_TXT", + "SPEED", + "WORKERS_AI", + ] = FieldInfo(alias="dataSource") + """Data source for annotations.""" + + description: str + + end_date: datetime = FieldInfo(alias="endDate") + + event_type: Literal["EVENT", "GENERAL", "OUTAGE", "PARTIAL_PROJECTION", "PIPELINE", "TRAFFIC_ANOMALY"] = FieldInfo( + alias="eventType" + ) + """Event type for annotations.""" + + is_instantaneous: bool = FieldInfo(alias="isInstantaneous") + """Whether event is a single point in time or a time range.""" + + linked_url: str = FieldInfo(alias="linkedUrl") + + start_date: datetime = FieldInfo(alias="startDate") + + +class MetaConfidenceInfo(BaseModel): + annotations: List[MetaConfidenceInfoAnnotation] + + level: int + """Provides an indication of how much confidence Cloudflare has in the data.""" + + +class MetaDateRange(BaseModel): + end_time: datetime = FieldInfo(alias="endTime") + """Adjusted end of date range.""" + + start_time: datetime = FieldInfo(alias="startTime") + """Adjusted start of date range.""" + + +class MetaUnit(BaseModel): + name: str + + value: str + + +class Meta(BaseModel): + """Metadata for the results.""" + + confidence_info: MetaConfidenceInfo = FieldInfo(alias="confidenceInfo") + + date_range: List[MetaDateRange] = FieldInfo(alias="dateRange") + + last_updated: datetime = FieldInfo(alias="lastUpdated") + """Timestamp of the last dataset update.""" + + normalization: Literal[ + "PERCENTAGE", + "MIN0_MAX", + "MIN_MAX", + "RAW_VALUES", + "PERCENTAGE_CHANGE", + "ROLLING_AVERAGE", + "OVERLAPPED_PERCENTAGE", + "RATIO", + ] + """Normalization method applied to the results. + + Refer to + [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/). + """ + + units: List[MetaUnit] + """Measurement units for the results.""" + + +class OriginSummaryResponse(BaseModel): + meta: Meta + """Metadata for the results.""" + + summary_0: Dict[str, str] diff --git a/src/cloudflare/types/radar/post_quantum/origin_timeseries_groups_params.py b/src/cloudflare/types/radar/post_quantum/origin_timeseries_groups_params.py new file mode 100644 index 00000000000..9abc011f5c0 --- /dev/null +++ b/src/cloudflare/types/radar/post_quantum/origin_timeseries_groups_params.py @@ -0,0 +1,34 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Union +from datetime import datetime +from typing_extensions import Literal, Annotated, TypedDict + +from ...._types import SequenceNotStr +from ...._utils import PropertyInfo + +__all__ = ["OriginTimeseriesGroupsParams"] + + +class OriginTimeseriesGroupsParams(TypedDict, total=False): + date_end: Annotated[SequenceNotStr[Union[str, datetime]], PropertyInfo(alias="dateEnd", format="iso8601")] + """End of the date range (inclusive).""" + + date_range: Annotated[SequenceNotStr[str], PropertyInfo(alias="dateRange")] + """Filters results by date range. + + For example, use `7d` and `7dcontrol` to compare this week with the previous + week. Use this parameter or set specific start and end dates (`dateStart` and + `dateEnd` parameters). + """ + + date_start: Annotated[SequenceNotStr[Union[str, datetime]], PropertyInfo(alias="dateStart", format="iso8601")] + """Start of the date range.""" + + format: Literal["JSON", "CSV"] + """Format in which results will be returned.""" + + name: SequenceNotStr[str] + """Array of names used to label the series in the response.""" diff --git a/src/cloudflare/types/radar/post_quantum/origin_timeseries_groups_response.py b/src/cloudflare/types/radar/post_quantum/origin_timeseries_groups_response.py new file mode 100644 index 00000000000..90d8e47485d --- /dev/null +++ b/src/cloudflare/types/radar/post_quantum/origin_timeseries_groups_response.py @@ -0,0 +1,151 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import TYPE_CHECKING, Dict, List +from datetime import datetime +from typing_extensions import Literal + +from pydantic import Field as FieldInfo + +from ...._models import BaseModel + +__all__ = [ + "OriginTimeseriesGroupsResponse", + "Meta", + "MetaConfidenceInfo", + "MetaConfidenceInfoAnnotation", + "MetaDateRange", + "MetaUnit", + "Serie0", +] + + +class MetaConfidenceInfoAnnotation(BaseModel): + """Annotation associated with the result (e.g. outage or other type of event).""" + + data_source: Literal[ + "ALL", + "AI_BOTS", + "AI_GATEWAY", + "BGP", + "BOTS", + "CONNECTION_ANOMALY", + "CT", + "DNS", + "DNS_MAGNITUDE", + "DNS_AS112", + "DOS", + "EMAIL_ROUTING", + "EMAIL_SECURITY", + "FW", + "FW_PG", + "HTTP", + "HTTP_CONTROL", + "HTTP_CRAWLER_REFERER", + "HTTP_ORIGINS", + "IQI", + "LEAKED_CREDENTIALS", + "NET", + "ROBOTS_TXT", + "SPEED", + "WORKERS_AI", + ] = FieldInfo(alias="dataSource") + """Data source for annotations.""" + + description: str + + end_date: datetime = FieldInfo(alias="endDate") + + event_type: Literal["EVENT", "GENERAL", "OUTAGE", "PARTIAL_PROJECTION", "PIPELINE", "TRAFFIC_ANOMALY"] = FieldInfo( + alias="eventType" + ) + """Event type for annotations.""" + + is_instantaneous: bool = FieldInfo(alias="isInstantaneous") + """Whether event is a single point in time or a time range.""" + + linked_url: str = FieldInfo(alias="linkedUrl") + + start_date: datetime = FieldInfo(alias="startDate") + + +class MetaConfidenceInfo(BaseModel): + annotations: List[MetaConfidenceInfoAnnotation] + + level: int + """Provides an indication of how much confidence Cloudflare has in the data.""" + + +class MetaDateRange(BaseModel): + end_time: datetime = FieldInfo(alias="endTime") + """Adjusted end of date range.""" + + start_time: datetime = FieldInfo(alias="startTime") + """Adjusted start of date range.""" + + +class MetaUnit(BaseModel): + name: str + + value: str + + +class Meta(BaseModel): + """Metadata for the results.""" + + agg_interval: Literal["FIFTEEN_MINUTES", "ONE_HOUR", "ONE_DAY", "ONE_WEEK", "ONE_MONTH"] = FieldInfo( + alias="aggInterval" + ) + """Aggregation interval of the results (e.g., in 15 minutes or 1 hour intervals). + + Refer to + [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/). + """ + + confidence_info: MetaConfidenceInfo = FieldInfo(alias="confidenceInfo") + + date_range: List[MetaDateRange] = FieldInfo(alias="dateRange") + + last_updated: datetime = FieldInfo(alias="lastUpdated") + """Timestamp of the last dataset update.""" + + normalization: Literal[ + "PERCENTAGE", + "MIN0_MAX", + "MIN_MAX", + "RAW_VALUES", + "PERCENTAGE_CHANGE", + "ROLLING_AVERAGE", + "OVERLAPPED_PERCENTAGE", + "RATIO", + ] + """Normalization method applied to the results. + + Refer to + [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/). + """ + + units: List[MetaUnit] + """Measurement units for the results.""" + + +class Serie0(BaseModel): + timestamps: List[datetime] + + if TYPE_CHECKING: + # Some versions of Pydantic <2.8.0 have a bug and don’t allow assigning a + # value to this field, so for compatibility we avoid doing it at runtime. + __pydantic_extra__: Dict[str, List[str]] = FieldInfo(init=False) # pyright: ignore[reportIncompatibleVariableOverride] + + # Stub to indicate that arbitrary properties are accepted. + # To access properties that are not valid identifiers you can use `getattr`, e.g. + # `getattr(obj, '$type')` + def __getattr__(self, attr: str) -> List[str]: ... + else: + __pydantic_extra__: Dict[str, List[str]] + + +class OriginTimeseriesGroupsResponse(BaseModel): + meta: Meta + """Metadata for the results.""" + + serie_0: Serie0 diff --git a/src/cloudflare/types/radar/post_quantum/tls_support_params.py b/src/cloudflare/types/radar/post_quantum/tls_support_params.py new file mode 100644 index 00000000000..9f0384ab7ed --- /dev/null +++ b/src/cloudflare/types/radar/post_quantum/tls_support_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 Required, TypedDict + +__all__ = ["TLSSupportParams"] + + +class TLSSupportParams(TypedDict, total=False): + host: Required[str] + """ + Hostname or IP address to test for Post-Quantum TLS support, optionally with + port (defaults to 443). + """ diff --git a/src/cloudflare/types/radar/post_quantum/tls_support_response.py b/src/cloudflare/types/radar/post_quantum/tls_support_response.py new file mode 100644 index 00000000000..dc66cee82cf --- /dev/null +++ b/src/cloudflare/types/radar/post_quantum/tls_support_response.py @@ -0,0 +1,21 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from pydantic import Field as FieldInfo + +from ...._models import BaseModel + +__all__ = ["TLSSupportResponse"] + + +class TLSSupportResponse(BaseModel): + host: str + """The host that was tested""" + + kex: float + """TLS CurveID of the negotiated key exchange""" + + kex_name: str = FieldInfo(alias="kexName") + """Human-readable name of the key exchange algorithm""" + + pq: bool + """Whether the negotiated key exchange uses Post-Quantum cryptography""" diff --git a/tests/api_resources/radar/entities/test_asns.py b/tests/api_resources/radar/entities/test_asns.py index f5e50b1cce8..993d4320fc1 100644 --- a/tests/api_resources/radar/entities/test_asns.py +++ b/tests/api_resources/radar/entities/test_asns.py @@ -9,12 +9,14 @@ from cloudflare import Cloudflare, AsyncCloudflare from tests.utils import assert_matches_type +from cloudflare._utils import parse_date from cloudflare.types.radar.entities import ( ASNIPResponse, ASNGetResponse, ASNRelResponse, ASNListResponse, ASNAsSetResponse, + ASNBotnetThreatFeedResponse, ) base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") @@ -99,6 +101,46 @@ def test_streaming_response_as_set(self, client: Cloudflare) -> None: assert cast(Any, response.is_closed) is True + @parametrize + def test_method_botnet_threat_feed(self, client: Cloudflare) -> None: + asn = client.radar.entities.asns.botnet_threat_feed() + assert_matches_type(ASNBotnetThreatFeedResponse, asn, path=["response"]) + + @parametrize + def test_method_botnet_threat_feed_with_all_params(self, client: Cloudflare) -> None: + asn = client.radar.entities.asns.botnet_threat_feed( + asn=["string"], + compare_date_range="7d", + date=parse_date("2026-02-04"), + format="JSON", + limit=1, + location="US", + metric="OFFENSE_COUNT", + offset=0, + sort_order="ASC", + ) + assert_matches_type(ASNBotnetThreatFeedResponse, asn, path=["response"]) + + @parametrize + def test_raw_response_botnet_threat_feed(self, client: Cloudflare) -> None: + response = client.radar.entities.asns.with_raw_response.botnet_threat_feed() + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + asn = response.parse() + assert_matches_type(ASNBotnetThreatFeedResponse, asn, path=["response"]) + + @parametrize + def test_streaming_response_botnet_threat_feed(self, client: Cloudflare) -> None: + with client.radar.entities.asns.with_streaming_response.botnet_threat_feed() as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + asn = response.parse() + assert_matches_type(ASNBotnetThreatFeedResponse, asn, path=["response"]) + + assert cast(Any, response.is_closed) is True + @parametrize def test_method_get(self, client: Cloudflare) -> None: asn = client.radar.entities.asns.get( @@ -299,6 +341,46 @@ async def test_streaming_response_as_set(self, async_client: AsyncCloudflare) -> assert cast(Any, response.is_closed) is True + @parametrize + async def test_method_botnet_threat_feed(self, async_client: AsyncCloudflare) -> None: + asn = await async_client.radar.entities.asns.botnet_threat_feed() + assert_matches_type(ASNBotnetThreatFeedResponse, asn, path=["response"]) + + @parametrize + async def test_method_botnet_threat_feed_with_all_params(self, async_client: AsyncCloudflare) -> None: + asn = await async_client.radar.entities.asns.botnet_threat_feed( + asn=["string"], + compare_date_range="7d", + date=parse_date("2026-02-04"), + format="JSON", + limit=1, + location="US", + metric="OFFENSE_COUNT", + offset=0, + sort_order="ASC", + ) + assert_matches_type(ASNBotnetThreatFeedResponse, asn, path=["response"]) + + @parametrize + async def test_raw_response_botnet_threat_feed(self, async_client: AsyncCloudflare) -> None: + response = await async_client.radar.entities.asns.with_raw_response.botnet_threat_feed() + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + asn = await response.parse() + assert_matches_type(ASNBotnetThreatFeedResponse, asn, path=["response"]) + + @parametrize + async def test_streaming_response_botnet_threat_feed(self, async_client: AsyncCloudflare) -> None: + async with async_client.radar.entities.asns.with_streaming_response.botnet_threat_feed() as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + asn = await response.parse() + assert_matches_type(ASNBotnetThreatFeedResponse, asn, path=["response"]) + + assert cast(Any, response.is_closed) is True + @parametrize async def test_method_get(self, async_client: AsyncCloudflare) -> None: asn = await async_client.radar.entities.asns.get( diff --git a/tests/api_resources/radar/post_quantum/__init__.py b/tests/api_resources/radar/post_quantum/__init__.py new file mode 100644 index 00000000000..fd8019a9a1a --- /dev/null +++ b/tests/api_resources/radar/post_quantum/__init__.py @@ -0,0 +1 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. diff --git a/tests/api_resources/radar/post_quantum/test_origin.py b/tests/api_resources/radar/post_quantum/test_origin.py new file mode 100644 index 00000000000..fb008d46924 --- /dev/null +++ b/tests/api_resources/radar/post_quantum/test_origin.py @@ -0,0 +1,200 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +import os +from typing import Any, cast + +import pytest + +from cloudflare import Cloudflare, AsyncCloudflare +from tests.utils import assert_matches_type +from cloudflare._utils import parse_datetime +from cloudflare.types.radar.post_quantum import ( + OriginSummaryResponse, + OriginTimeseriesGroupsResponse, +) + +base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") + + +class TestOrigin: + parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) + + @parametrize + def test_method_summary(self, client: Cloudflare) -> None: + origin = client.radar.post_quantum.origin.summary( + dimension="KEY_AGREEMENT", + ) + assert_matches_type(OriginSummaryResponse, origin, path=["response"]) + + @parametrize + def test_method_summary_with_all_params(self, client: Cloudflare) -> None: + origin = client.radar.post_quantum.origin.summary( + dimension="KEY_AGREEMENT", + date_end=[parse_datetime("2019-12-27T18:11:19.117Z")], + date_range=["7d"], + date_start=[parse_datetime("2019-12-27T18:11:19.117Z")], + format="JSON", + name=["main_series"], + ) + assert_matches_type(OriginSummaryResponse, origin, path=["response"]) + + @parametrize + def test_raw_response_summary(self, client: Cloudflare) -> None: + response = client.radar.post_quantum.origin.with_raw_response.summary( + dimension="KEY_AGREEMENT", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + origin = response.parse() + assert_matches_type(OriginSummaryResponse, origin, path=["response"]) + + @parametrize + def test_streaming_response_summary(self, client: Cloudflare) -> None: + with client.radar.post_quantum.origin.with_streaming_response.summary( + dimension="KEY_AGREEMENT", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + origin = response.parse() + assert_matches_type(OriginSummaryResponse, origin, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_method_timeseries_groups(self, client: Cloudflare) -> None: + origin = client.radar.post_quantum.origin.timeseries_groups( + dimension="KEY_AGREEMENT", + ) + assert_matches_type(OriginTimeseriesGroupsResponse, origin, path=["response"]) + + @parametrize + def test_method_timeseries_groups_with_all_params(self, client: Cloudflare) -> None: + origin = client.radar.post_quantum.origin.timeseries_groups( + dimension="KEY_AGREEMENT", + date_end=[parse_datetime("2019-12-27T18:11:19.117Z")], + date_range=["7d"], + date_start=[parse_datetime("2019-12-27T18:11:19.117Z")], + format="JSON", + name=["main_series"], + ) + assert_matches_type(OriginTimeseriesGroupsResponse, origin, path=["response"]) + + @parametrize + def test_raw_response_timeseries_groups(self, client: Cloudflare) -> None: + response = client.radar.post_quantum.origin.with_raw_response.timeseries_groups( + dimension="KEY_AGREEMENT", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + origin = response.parse() + assert_matches_type(OriginTimeseriesGroupsResponse, origin, path=["response"]) + + @parametrize + def test_streaming_response_timeseries_groups(self, client: Cloudflare) -> None: + with client.radar.post_quantum.origin.with_streaming_response.timeseries_groups( + dimension="KEY_AGREEMENT", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + origin = response.parse() + assert_matches_type(OriginTimeseriesGroupsResponse, origin, path=["response"]) + + assert cast(Any, response.is_closed) is True + + +class TestAsyncOrigin: + parametrize = pytest.mark.parametrize( + "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"] + ) + + @parametrize + async def test_method_summary(self, async_client: AsyncCloudflare) -> None: + origin = await async_client.radar.post_quantum.origin.summary( + dimension="KEY_AGREEMENT", + ) + assert_matches_type(OriginSummaryResponse, origin, path=["response"]) + + @parametrize + async def test_method_summary_with_all_params(self, async_client: AsyncCloudflare) -> None: + origin = await async_client.radar.post_quantum.origin.summary( + dimension="KEY_AGREEMENT", + date_end=[parse_datetime("2019-12-27T18:11:19.117Z")], + date_range=["7d"], + date_start=[parse_datetime("2019-12-27T18:11:19.117Z")], + format="JSON", + name=["main_series"], + ) + assert_matches_type(OriginSummaryResponse, origin, path=["response"]) + + @parametrize + async def test_raw_response_summary(self, async_client: AsyncCloudflare) -> None: + response = await async_client.radar.post_quantum.origin.with_raw_response.summary( + dimension="KEY_AGREEMENT", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + origin = await response.parse() + assert_matches_type(OriginSummaryResponse, origin, path=["response"]) + + @parametrize + async def test_streaming_response_summary(self, async_client: AsyncCloudflare) -> None: + async with async_client.radar.post_quantum.origin.with_streaming_response.summary( + dimension="KEY_AGREEMENT", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + origin = await response.parse() + assert_matches_type(OriginSummaryResponse, origin, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_method_timeseries_groups(self, async_client: AsyncCloudflare) -> None: + origin = await async_client.radar.post_quantum.origin.timeseries_groups( + dimension="KEY_AGREEMENT", + ) + assert_matches_type(OriginTimeseriesGroupsResponse, origin, path=["response"]) + + @parametrize + async def test_method_timeseries_groups_with_all_params(self, async_client: AsyncCloudflare) -> None: + origin = await async_client.radar.post_quantum.origin.timeseries_groups( + dimension="KEY_AGREEMENT", + date_end=[parse_datetime("2019-12-27T18:11:19.117Z")], + date_range=["7d"], + date_start=[parse_datetime("2019-12-27T18:11:19.117Z")], + format="JSON", + name=["main_series"], + ) + assert_matches_type(OriginTimeseriesGroupsResponse, origin, path=["response"]) + + @parametrize + async def test_raw_response_timeseries_groups(self, async_client: AsyncCloudflare) -> None: + response = await async_client.radar.post_quantum.origin.with_raw_response.timeseries_groups( + dimension="KEY_AGREEMENT", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + origin = await response.parse() + assert_matches_type(OriginTimeseriesGroupsResponse, origin, path=["response"]) + + @parametrize + async def test_streaming_response_timeseries_groups(self, async_client: AsyncCloudflare) -> None: + async with async_client.radar.post_quantum.origin.with_streaming_response.timeseries_groups( + dimension="KEY_AGREEMENT", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + origin = await response.parse() + assert_matches_type(OriginTimeseriesGroupsResponse, origin, path=["response"]) + + assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/radar/post_quantum/test_tls.py b/tests/api_resources/radar/post_quantum/test_tls.py new file mode 100644 index 00000000000..6b5a79f2552 --- /dev/null +++ b/tests/api_resources/radar/post_quantum/test_tls.py @@ -0,0 +1,86 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +import os +from typing import Any, cast + +import pytest + +from cloudflare import Cloudflare, AsyncCloudflare +from tests.utils import assert_matches_type +from cloudflare.types.radar.post_quantum import TLSSupportResponse + +base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") + + +class TestTLS: + parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) + + @parametrize + def test_method_support(self, client: Cloudflare) -> None: + tls = client.radar.post_quantum.tls.support( + host="cloudflare.com", + ) + assert_matches_type(TLSSupportResponse, tls, path=["response"]) + + @parametrize + def test_raw_response_support(self, client: Cloudflare) -> None: + response = client.radar.post_quantum.tls.with_raw_response.support( + host="cloudflare.com", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + tls = response.parse() + assert_matches_type(TLSSupportResponse, tls, path=["response"]) + + @parametrize + def test_streaming_response_support(self, client: Cloudflare) -> None: + with client.radar.post_quantum.tls.with_streaming_response.support( + host="cloudflare.com", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + tls = response.parse() + assert_matches_type(TLSSupportResponse, tls, path=["response"]) + + assert cast(Any, response.is_closed) is True + + +class TestAsyncTLS: + parametrize = pytest.mark.parametrize( + "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"] + ) + + @parametrize + async def test_method_support(self, async_client: AsyncCloudflare) -> None: + tls = await async_client.radar.post_quantum.tls.support( + host="cloudflare.com", + ) + assert_matches_type(TLSSupportResponse, tls, path=["response"]) + + @parametrize + async def test_raw_response_support(self, async_client: AsyncCloudflare) -> None: + response = await async_client.radar.post_quantum.tls.with_raw_response.support( + host="cloudflare.com", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + tls = await response.parse() + assert_matches_type(TLSSupportResponse, tls, path=["response"]) + + @parametrize + async def test_streaming_response_support(self, async_client: AsyncCloudflare) -> None: + async with async_client.radar.post_quantum.tls.with_streaming_response.support( + host="cloudflare.com", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + tls = await response.parse() + assert_matches_type(TLSSupportResponse, tls, path=["response"]) + + assert cast(Any, response.is_closed) is True From d69da3279597672cfe526d542ebcf1fed45db06d Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 23 Feb 2026 18:42:34 +0000 Subject: [PATCH 028/279] chore(api): update composite API spec --- .stats.yml | 4 ++-- .../resources/custom_certificates/custom_certificates.py | 8 ++++---- .../custom_certificate_create_params.py | 2 +- .../custom_certificates/custom_certificate_edit_params.py | 2 +- tests/api_resources/test_custom_certificates.py | 8 ++++---- 5 files changed, 12 insertions(+), 12 deletions(-) diff --git a/.stats.yml b/.stats.yml index 9362ade0e75..1107570d739 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 2032 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-a909b87c05e478194e997f18d24300cff7cf8cf978d8fbc45af8866c5575bf63.yml -openapi_spec_hash: 4989f8168da4edbbb107a55e74690fe0 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-47c3013dc4a5b8cc36be89820ac1c7796381d066ea449fbd7d364cd5975459fe.yml +openapi_spec_hash: 3c4555eada595eca0e994e36cc98200b config_hash: 405e0229a3b5214d99c53598e78f85a1 diff --git a/src/cloudflare/resources/custom_certificates/custom_certificates.py b/src/cloudflare/resources/custom_certificates/custom_certificates.py index 23b2b41c180..683568fa652 100644 --- a/src/cloudflare/resources/custom_certificates/custom_certificates.py +++ b/src/cloudflare/resources/custom_certificates/custom_certificates.py @@ -119,7 +119,7 @@ def create( the EU region. If there are too few data centers satisfying the policy, it will be rejected. Note: The API accepts this field as either "policy" or "policy_restrictions" in requests. Responses return this field as - "policy_restrictions". example: "(country: US) or (region: EU)" + "policy_restrictions". type: The type 'legacy_custom' enables support for legacy clients which do not include SNI in the TLS handshake. @@ -325,7 +325,7 @@ def edit( the EU region. If there are too few data centers satisfying the policy, it will be rejected. Note: The API accepts this field as either "policy" or "policy_restrictions" in requests. Responses return this field as - "policy_restrictions". example: "(country: US) or (region: EU)" + "policy_restrictions". private_key: The zone's private key. @@ -490,7 +490,7 @@ async def create( the EU region. If there are too few data centers satisfying the policy, it will be rejected. Note: The API accepts this field as either "policy" or "policy_restrictions" in requests. Responses return this field as - "policy_restrictions". example: "(country: US) or (region: EU)" + "policy_restrictions". type: The type 'legacy_custom' enables support for legacy clients which do not include SNI in the TLS handshake. @@ -696,7 +696,7 @@ async def edit( the EU region. If there are too few data centers satisfying the policy, it will be rejected. Note: The API accepts this field as either "policy" or "policy_restrictions" in requests. Responses return this field as - "policy_restrictions". example: "(country: US) or (region: EU)" + "policy_restrictions". private_key: The zone's private key. diff --git a/src/cloudflare/types/custom_certificates/custom_certificate_create_params.py b/src/cloudflare/types/custom_certificates/custom_certificate_create_params.py index a14fc7f78de..a5de8bba80e 100644 --- a/src/cloudflare/types/custom_certificates/custom_certificate_create_params.py +++ b/src/cloudflare/types/custom_certificates/custom_certificate_create_params.py @@ -54,7 +54,7 @@ class CustomCertificateCreateParams(TypedDict, total=False): the EU region. If there are too few data centers satisfying the policy, it will be rejected. Note: The API accepts this field as either "policy" or "policy_restrictions" in requests. Responses return this field as - "policy_restrictions". example: "(country: US) or (region: EU)" + "policy_restrictions". """ type: Literal["legacy_custom", "sni_custom"] diff --git a/src/cloudflare/types/custom_certificates/custom_certificate_edit_params.py b/src/cloudflare/types/custom_certificates/custom_certificate_edit_params.py index 37fafb42372..e94fb516789 100644 --- a/src/cloudflare/types/custom_certificates/custom_certificate_edit_params.py +++ b/src/cloudflare/types/custom_certificates/custom_certificate_edit_params.py @@ -51,7 +51,7 @@ class CustomCertificateEditParams(TypedDict, total=False): the EU region. If there are too few data centers satisfying the policy, it will be rejected. Note: The API accepts this field as either "policy" or "policy_restrictions" in requests. Responses return this field as - "policy_restrictions". example: "(country: US) or (region: EU)" + "policy_restrictions". """ private_key: str diff --git a/tests/api_resources/test_custom_certificates.py b/tests/api_resources/test_custom_certificates.py index a2ab6d927f5..3109f005ac6 100644 --- a/tests/api_resources/test_custom_certificates.py +++ b/tests/api_resources/test_custom_certificates.py @@ -39,7 +39,7 @@ def test_method_create_with_all_params(self, client: Cloudflare) -> None: bundle_method="ubiquitous", deploy="staging", geo_restrictions={"label": "us"}, - policy="policy", + policy="(country: US) or (region: EU)", type="sni_custom", ) assert_matches_type(Optional[CustomCertificate], custom_certificate, path=["response"]) @@ -196,7 +196,7 @@ def test_method_edit_with_all_params(self, client: Cloudflare) -> None: certificate="-----BEGIN CERTIFICATE-----\nMIIDtTCCAp2gAwIBAgIJAMHAwfXZ5/PWMA0GCSqGSIb3DQEBCwUAMEUxCzAJBgNV\nBAYTAkFVMRMwEQYDVQQIEwpTb21lLVN0YXRlMSEwHwYDVQQKExhJbnRlcm5ldCBX\naWRnaXRzIFB0eSBMdGQwHhcNMTYwODI0MTY0MzAxWhcNMTYxMTIyMTY0MzAxWjBF\nMQswCQYDVQQGEwJBVTETMBEGA1UECBMKU29tZS1TdGF0ZTEhMB8GA1UEChMYSW50\nZXJuZXQgV2lkZ2l0cyBQdHkgTHRkMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIB\nCgKCAQEAwQHoetcl9+5ikGzV6cMzWtWPJHqXT3wpbEkRU9Yz7lgvddmGdtcGbg/1\nCGZu0jJGkMoppoUo4c3dts3iwqRYmBikUP77wwY2QGmDZw2FvkJCJlKnabIRuGvB\nKwzESIXgKk2016aTP6/dAjEHyo6SeoK8lkIySUvK0fyOVlsiEsCmOpidtnKX/a+5\n0GjB79CJH4ER2lLVZnhePFR/zUOyPxZQQ4naHf7yu/b5jhO0f8fwt+pyFxIXjbEI\ndZliWRkRMtzrHOJIhrmJ2A1J7iOrirbbwillwjjNVUWPf3IJ3M12S9pEewooaeO2\nizNTERcG9HzAacbVRn2Y2SWIyT/18QIDAQABo4GnMIGkMB0GA1UdDgQWBBT/LbE4\n9rWf288N6sJA5BRb6FJIGDB1BgNVHSMEbjBsgBT/LbE49rWf288N6sJA5BRb6FJI\nGKFJpEcwRTELMAkGA1UEBhMCQVUxEzARBgNVBAgTClNvbWUtU3RhdGUxITAfBgNV\nBAoTGEludGVybmV0IFdpZGdpdHMgUHR5IEx0ZIIJAMHAwfXZ5/PWMAwGA1UdEwQF\nMAMBAf8wDQYJKoZIhvcNAQELBQADggEBAHHFwl0tH0quUYZYO0dZYt4R7SJ0pCm2\n2satiyzHl4OnXcHDpekAo7/a09c6Lz6AU83cKy/+x3/djYHXWba7HpEu0dR3ugQP\nMlr4zrhd9xKZ0KZKiYmtJH+ak4OM4L3FbT0owUZPyjLSlhMtJVcoRp5CJsjAMBUG\nSvD8RX+T01wzox/Qb+lnnNnOlaWpqu8eoOenybxKp1a9ULzIVvN/LAcc+14vioFq\n2swRWtmocBAs8QR9n4uvbpiYvS8eYueDCWMM4fvFfBhaDZ3N9IbtySh3SpFdQDhw\nYbjM2rxXiyLGxB4Bol7QTv4zHif7Zt89FReT/NBy4rzaskDJY5L6xmY=\n-----END CERTIFICATE-----\n", deploy="staging", geo_restrictions={"label": "us"}, - policy="policy", + policy="(country: US) or (region: EU)", private_key="-----BEGIN RSA PRIVATE KEY-----\nMIIEowIBAAKCAQEAwQHoetcl9+5ikGzV6cMzWtWPJHqXT3wpbEkRU9Yz7lgvddmG\ndtcGbg/1CGZu0jJGkMoppoUo4c3dts3iwqRYmBikUP77wwY2QGmDZw2FvkJCJlKn\nabIRuGvBKwzESIXgKk2016aTP6/dAjEHyo6SeoK8lkIySUvK0fyOVlsiEsCmOpid\ntnKX/a+50GjB79CJH4ER2lLVZnhePFR/zUOyPxZQQ4naHf7yu/b5jhO0f8fwt+py\nFxIXjbEIdZliWRkRMtzrHOJIhrmJ2A1J7iOrirbbwillwjjNVUWPf3IJ3M12S9pE\newooaeO2izNTERcG9HzAacbVRn2Y2SWIyT/18QIDAQABAoIBACbhTYXBZYKmYPCb\nHBR1IBlCQA2nLGf0qRuJNJZg5iEzXows/6tc8YymZkQE7nolapWsQ+upk2y5Xdp/\naxiuprIs9JzkYK8Ox0r+dlwCG1kSW+UAbX0bQ/qUqlsTvU6muVuMP8vZYHxJ3wmb\n+ufRBKztPTQ/rYWaYQcgC0RWI20HTFBMxlTAyNxYNWzX7RKFkGVVyB9RsAtmcc8g\n+j4OdosbfNoJPS0HeIfNpAznDfHKdxDk2Yc1tV6RHBrC1ynyLE9+TaflIAdo2MVv\nKLMLq51GqYKtgJFIlBRPQqKoyXdz3fGvXrTkf/WY9QNq0J1Vk5ERePZ54mN8iZB7\n9lwy/AkCgYEA6FXzosxswaJ2wQLeoYc7ceaweX/SwTvxHgXzRyJIIT0eJWgx13Wo\n/WA3Iziimsjf6qE+SI/8laxPp2A86VMaIt3Z3mJN/CqSVGw8LK2AQst+OwdPyDMu\niacE8lj/IFGC8mwNUAb9CzGU3JpU4PxxGFjS/eMtGeRXCWkK4NE+G08CgYEA1Kp9\nN2JrVlqUz+gAX+LPmE9OEMAS9WQSQsfCHGogIFDGGcNf7+uwBM7GAaSJIP01zcoe\nVAgWdzXCv3FLhsaZoJ6RyLOLay5phbu1iaTr4UNYm5WtYTzMzqh8l1+MFFDl9xDB\nvULuCIIrglM5MeS/qnSg1uMoH2oVPj9TVst/ir8CgYEAxrI7Ws9Zc4Bt70N1As+U\nlySjaEVZCMkqvHJ6TCuVZFfQoE0r0whdLdRLU2PsLFP+q7qaeZQqgBaNSKeVcDYR\n9B+nY/jOmQoPewPVsp/vQTCnE/R81spu0mp0YI6cIheT1Z9zAy322svcc43JaWB7\nmEbeqyLOP4Z4qSOcmghZBSECgYACvR9Xs0DGn+wCsW4vze/2ei77MD4OQvepPIFX\ndFZtlBy5ADcgE9z0cuVB6CiL8DbdK5kwY9pGNr8HUCI03iHkW6Zs+0L0YmihfEVe\nPG19PSzK9CaDdhD9KFZSbLyVFmWfxOt50H7YRTTiPMgjyFpfi5j2q348yVT0tEQS\nfhRqaQKBgAcWPokmJ7EbYQGeMbS7HC8eWO/RyamlnSffdCdSc7ue3zdVJxpAkQ8W\nqu80pEIF6raIQfAf8MXiiZ7auFOSnHQTXUbhCpvDLKi0Mwq3G8Pl07l+2s6dQG6T\nlv6XTQaMyf6n1yjzL+fzDrH3qXMxHMO/b13EePXpDMpY7HQpoLDi\n-----END RSA PRIVATE KEY-----\n", ) assert_matches_type(Optional[CustomCertificate], custom_certificate, path=["response"]) @@ -315,7 +315,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncCloudflare bundle_method="ubiquitous", deploy="staging", geo_restrictions={"label": "us"}, - policy="policy", + policy="(country: US) or (region: EU)", type="sni_custom", ) assert_matches_type(Optional[CustomCertificate], custom_certificate, path=["response"]) @@ -472,7 +472,7 @@ async def test_method_edit_with_all_params(self, async_client: AsyncCloudflare) certificate="-----BEGIN CERTIFICATE-----\nMIIDtTCCAp2gAwIBAgIJAMHAwfXZ5/PWMA0GCSqGSIb3DQEBCwUAMEUxCzAJBgNV\nBAYTAkFVMRMwEQYDVQQIEwpTb21lLVN0YXRlMSEwHwYDVQQKExhJbnRlcm5ldCBX\naWRnaXRzIFB0eSBMdGQwHhcNMTYwODI0MTY0MzAxWhcNMTYxMTIyMTY0MzAxWjBF\nMQswCQYDVQQGEwJBVTETMBEGA1UECBMKU29tZS1TdGF0ZTEhMB8GA1UEChMYSW50\nZXJuZXQgV2lkZ2l0cyBQdHkgTHRkMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIB\nCgKCAQEAwQHoetcl9+5ikGzV6cMzWtWPJHqXT3wpbEkRU9Yz7lgvddmGdtcGbg/1\nCGZu0jJGkMoppoUo4c3dts3iwqRYmBikUP77wwY2QGmDZw2FvkJCJlKnabIRuGvB\nKwzESIXgKk2016aTP6/dAjEHyo6SeoK8lkIySUvK0fyOVlsiEsCmOpidtnKX/a+5\n0GjB79CJH4ER2lLVZnhePFR/zUOyPxZQQ4naHf7yu/b5jhO0f8fwt+pyFxIXjbEI\ndZliWRkRMtzrHOJIhrmJ2A1J7iOrirbbwillwjjNVUWPf3IJ3M12S9pEewooaeO2\nizNTERcG9HzAacbVRn2Y2SWIyT/18QIDAQABo4GnMIGkMB0GA1UdDgQWBBT/LbE4\n9rWf288N6sJA5BRb6FJIGDB1BgNVHSMEbjBsgBT/LbE49rWf288N6sJA5BRb6FJI\nGKFJpEcwRTELMAkGA1UEBhMCQVUxEzARBgNVBAgTClNvbWUtU3RhdGUxITAfBgNV\nBAoTGEludGVybmV0IFdpZGdpdHMgUHR5IEx0ZIIJAMHAwfXZ5/PWMAwGA1UdEwQF\nMAMBAf8wDQYJKoZIhvcNAQELBQADggEBAHHFwl0tH0quUYZYO0dZYt4R7SJ0pCm2\n2satiyzHl4OnXcHDpekAo7/a09c6Lz6AU83cKy/+x3/djYHXWba7HpEu0dR3ugQP\nMlr4zrhd9xKZ0KZKiYmtJH+ak4OM4L3FbT0owUZPyjLSlhMtJVcoRp5CJsjAMBUG\nSvD8RX+T01wzox/Qb+lnnNnOlaWpqu8eoOenybxKp1a9ULzIVvN/LAcc+14vioFq\n2swRWtmocBAs8QR9n4uvbpiYvS8eYueDCWMM4fvFfBhaDZ3N9IbtySh3SpFdQDhw\nYbjM2rxXiyLGxB4Bol7QTv4zHif7Zt89FReT/NBy4rzaskDJY5L6xmY=\n-----END CERTIFICATE-----\n", deploy="staging", geo_restrictions={"label": "us"}, - policy="policy", + policy="(country: US) or (region: EU)", private_key="-----BEGIN RSA PRIVATE KEY-----\nMIIEowIBAAKCAQEAwQHoetcl9+5ikGzV6cMzWtWPJHqXT3wpbEkRU9Yz7lgvddmG\ndtcGbg/1CGZu0jJGkMoppoUo4c3dts3iwqRYmBikUP77wwY2QGmDZw2FvkJCJlKn\nabIRuGvBKwzESIXgKk2016aTP6/dAjEHyo6SeoK8lkIySUvK0fyOVlsiEsCmOpid\ntnKX/a+50GjB79CJH4ER2lLVZnhePFR/zUOyPxZQQ4naHf7yu/b5jhO0f8fwt+py\nFxIXjbEIdZliWRkRMtzrHOJIhrmJ2A1J7iOrirbbwillwjjNVUWPf3IJ3M12S9pE\newooaeO2izNTERcG9HzAacbVRn2Y2SWIyT/18QIDAQABAoIBACbhTYXBZYKmYPCb\nHBR1IBlCQA2nLGf0qRuJNJZg5iEzXows/6tc8YymZkQE7nolapWsQ+upk2y5Xdp/\naxiuprIs9JzkYK8Ox0r+dlwCG1kSW+UAbX0bQ/qUqlsTvU6muVuMP8vZYHxJ3wmb\n+ufRBKztPTQ/rYWaYQcgC0RWI20HTFBMxlTAyNxYNWzX7RKFkGVVyB9RsAtmcc8g\n+j4OdosbfNoJPS0HeIfNpAznDfHKdxDk2Yc1tV6RHBrC1ynyLE9+TaflIAdo2MVv\nKLMLq51GqYKtgJFIlBRPQqKoyXdz3fGvXrTkf/WY9QNq0J1Vk5ERePZ54mN8iZB7\n9lwy/AkCgYEA6FXzosxswaJ2wQLeoYc7ceaweX/SwTvxHgXzRyJIIT0eJWgx13Wo\n/WA3Iziimsjf6qE+SI/8laxPp2A86VMaIt3Z3mJN/CqSVGw8LK2AQst+OwdPyDMu\niacE8lj/IFGC8mwNUAb9CzGU3JpU4PxxGFjS/eMtGeRXCWkK4NE+G08CgYEA1Kp9\nN2JrVlqUz+gAX+LPmE9OEMAS9WQSQsfCHGogIFDGGcNf7+uwBM7GAaSJIP01zcoe\nVAgWdzXCv3FLhsaZoJ6RyLOLay5phbu1iaTr4UNYm5WtYTzMzqh8l1+MFFDl9xDB\nvULuCIIrglM5MeS/qnSg1uMoH2oVPj9TVst/ir8CgYEAxrI7Ws9Zc4Bt70N1As+U\nlySjaEVZCMkqvHJ6TCuVZFfQoE0r0whdLdRLU2PsLFP+q7qaeZQqgBaNSKeVcDYR\n9B+nY/jOmQoPewPVsp/vQTCnE/R81spu0mp0YI6cIheT1Z9zAy322svcc43JaWB7\nmEbeqyLOP4Z4qSOcmghZBSECgYACvR9Xs0DGn+wCsW4vze/2ei77MD4OQvepPIFX\ndFZtlBy5ADcgE9z0cuVB6CiL8DbdK5kwY9pGNr8HUCI03iHkW6Zs+0L0YmihfEVe\nPG19PSzK9CaDdhD9KFZSbLyVFmWfxOt50H7YRTTiPMgjyFpfi5j2q348yVT0tEQS\nfhRqaQKBgAcWPokmJ7EbYQGeMbS7HC8eWO/RyamlnSffdCdSc7ue3zdVJxpAkQ8W\nqu80pEIF6raIQfAf8MXiiZ7auFOSnHQTXUbhCpvDLKi0Mwq3G8Pl07l+2s6dQG6T\nlv6XTQaMyf6n1yjzL+fzDrH3qXMxHMO/b13EePXpDMpY7HQpoLDi\n-----END RSA PRIVATE KEY-----\n", ) assert_matches_type(Optional[CustomCertificate], custom_certificate, path=["response"]) From f05b0113c65d29cd633a391f4dc0e8cd3f77d7c4 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 23 Feb 2026 20:58:59 +0000 Subject: [PATCH 029/279] chore(api): update composite API spec --- .stats.yml | 4 +- api.md | 58 +- .../zero_trust/dlp/datasets/datasets.py | 40 +- .../zero_trust/dlp/datasets/upload.py | 28 +- .../zero_trust/dlp/profiles/custom.py | 52 +- .../zero_trust/dlp/profiles/predefined.py | 27 +- .../zero_trust/dlp/profiles/profiles.py | 17 +- .../types/zero_trust/dlp/__init__.py | 6 +- .../types/zero_trust/dlp/dataset_array.py | 10 + ...create_response.py => dataset_creation.py} | 4 +- .../zero_trust/dlp/dataset_get_response.py | 58 -- .../zero_trust/dlp/dataset_update_response.py | 58 -- .../types/zero_trust/dlp/datasets/__init__.py | 3 +- ...load_create_response.py => new_version.py} | 4 +- .../dlp/datasets/upload_edit_response.py | 58 -- .../dlp/entries/custom_list_response.py | 38 +- .../dlp/entries/integration_list_response.py | 38 +- .../dlp/entries/predefined_list_response.py | 38 +- .../zero_trust/dlp/entry_list_response.py | 40 +- .../zero_trust/dlp/entry_update_response.py | 43 +- .../zero_trust/dlp/profile_get_response.py | 826 ------------------ .../types/zero_trust/dlp/profiles/__init__.py | 6 +- .../dlp/profiles/custom_create_response.py | 826 ------------------ .../dlp/profiles/custom_get_response.py | 826 ------------------ .../dlp/profiles/custom_update_response.py | 826 ------------------ ..._get_response.py => predefined_profile.py} | 4 +- .../profiles/predefined_update_response.py | 184 ---- .../zero_trust/dlp/datasets/test_upload.py | 27 +- .../zero_trust/dlp/profiles/test_custom.py | 50 +- .../dlp/profiles/test_predefined.py | 33 +- .../zero_trust/dlp/test_datasets.py | 51 +- .../zero_trust/dlp/test_profiles.py | 14 +- 32 files changed, 296 insertions(+), 4001 deletions(-) create mode 100644 src/cloudflare/types/zero_trust/dlp/dataset_array.py rename src/cloudflare/types/zero_trust/dlp/{dataset_create_response.py => dataset_creation.py} (87%) delete mode 100644 src/cloudflare/types/zero_trust/dlp/dataset_get_response.py delete mode 100644 src/cloudflare/types/zero_trust/dlp/dataset_update_response.py rename src/cloudflare/types/zero_trust/dlp/datasets/{upload_create_response.py => new_version.py} (87%) delete mode 100644 src/cloudflare/types/zero_trust/dlp/datasets/upload_edit_response.py delete mode 100644 src/cloudflare/types/zero_trust/dlp/profile_get_response.py delete mode 100644 src/cloudflare/types/zero_trust/dlp/profiles/custom_create_response.py delete mode 100644 src/cloudflare/types/zero_trust/dlp/profiles/custom_get_response.py delete mode 100644 src/cloudflare/types/zero_trust/dlp/profiles/custom_update_response.py rename src/cloudflare/types/zero_trust/dlp/profiles/{predefined_get_response.py => predefined_profile.py} (97%) delete mode 100644 src/cloudflare/types/zero_trust/dlp/profiles/predefined_update_response.py diff --git a/.stats.yml b/.stats.yml index 1107570d739..1107a369d1a 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 2032 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-47c3013dc4a5b8cc36be89820ac1c7796381d066ea449fbd7d364cd5975459fe.yml -openapi_spec_hash: 3c4555eada595eca0e994e36cc98200b +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-6b090e02d25a0793e53cd3275fbb806e07b5bd482cab8a8878ceac32ff63133d.yml +openapi_spec_hash: cb863232a9866a40347fffed09421037 config_hash: 405e0229a3b5214d99c53598e78f85a1 diff --git a/api.md b/api.md index 3d2192a97e5..87fd3ad0568 100644 --- a/api.md +++ b/api.md @@ -6744,40 +6744,29 @@ Methods: Types: ```python -from cloudflare.types.zero_trust.dlp import ( - Dataset, - DatasetArray, - DatasetCreation, - DatasetCreateResponse, - DatasetUpdateResponse, - DatasetGetResponse, -) +from cloudflare.types.zero_trust.dlp import Dataset, DatasetArray, DatasetCreation ``` Methods: -- client.zero_trust.dlp.datasets.create(\*, account_id, \*\*params) -> Optional[DatasetCreateResponse] -- client.zero_trust.dlp.datasets.update(dataset_id, \*, account_id, \*\*params) -> Optional[DatasetUpdateResponse] +- client.zero_trust.dlp.datasets.create(\*, account_id, \*\*params) -> Optional[DatasetCreation] +- client.zero_trust.dlp.datasets.update(dataset_id, \*, account_id, \*\*params) -> Optional[Dataset] - client.zero_trust.dlp.datasets.list(\*, account_id) -> SyncSinglePage[Dataset] - client.zero_trust.dlp.datasets.delete(dataset_id, \*, account_id) -> None -- client.zero_trust.dlp.datasets.get(dataset_id, \*, account_id) -> Optional[DatasetGetResponse] +- client.zero_trust.dlp.datasets.get(dataset_id, \*, account_id) -> Optional[Dataset] #### Upload Types: ```python -from cloudflare.types.zero_trust.dlp.datasets import ( - NewVersion, - UploadCreateResponse, - UploadEditResponse, -) +from cloudflare.types.zero_trust.dlp.datasets import NewVersion ``` Methods: -- client.zero_trust.dlp.datasets.upload.create(dataset_id, \*, account_id) -> Optional[UploadCreateResponse] -- client.zero_trust.dlp.datasets.upload.edit(version, dataset, \*, account_id, dataset_id, \*\*params) -> Optional[UploadEditResponse] +- client.zero_trust.dlp.datasets.upload.create(dataset_id, \*, account_id) -> Optional[NewVersion] +- client.zero_trust.dlp.datasets.upload.edit(version, dataset, \*, account_id, dataset_id, \*\*params) -> Optional[Dataset] #### Versions @@ -6875,57 +6864,42 @@ Methods: Types: ```python -from cloudflare.types.zero_trust.dlp import ( - ContextAwareness, - Profile, - SkipConfiguration, - ProfileGetResponse, -) +from cloudflare.types.zero_trust.dlp import ContextAwareness, Profile, SkipConfiguration ``` Methods: - client.zero_trust.dlp.profiles.list(\*, account_id, \*\*params) -> SyncSinglePage[Profile] -- client.zero_trust.dlp.profiles.get(profile_id, \*, account_id) -> Optional[ProfileGetResponse] +- client.zero_trust.dlp.profiles.get(profile_id, \*, account_id) -> Optional[Profile] #### Custom Types: ```python -from cloudflare.types.zero_trust.dlp.profiles import ( - CustomProfile, - Pattern, - CustomCreateResponse, - CustomUpdateResponse, - CustomGetResponse, -) +from cloudflare.types.zero_trust.dlp.profiles import CustomProfile, Pattern ``` Methods: -- client.zero_trust.dlp.profiles.custom.create(\*, account_id, \*\*params) -> Optional[CustomCreateResponse] -- client.zero_trust.dlp.profiles.custom.update(profile_id, \*, account_id, \*\*params) -> Optional[CustomUpdateResponse] +- client.zero_trust.dlp.profiles.custom.create(\*, account_id, \*\*params) -> Optional[Profile] +- client.zero_trust.dlp.profiles.custom.update(profile_id, \*, account_id, \*\*params) -> Optional[Profile] - client.zero_trust.dlp.profiles.custom.delete(profile_id, \*, account_id) -> object -- client.zero_trust.dlp.profiles.custom.get(profile_id, \*, account_id) -> Optional[CustomGetResponse] +- client.zero_trust.dlp.profiles.custom.get(profile_id, \*, account_id) -> Optional[Profile] #### Predefined Types: ```python -from cloudflare.types.zero_trust.dlp.profiles import ( - PredefinedProfile, - PredefinedUpdateResponse, - PredefinedGetResponse, -) +from cloudflare.types.zero_trust.dlp.profiles import PredefinedProfile ``` Methods: -- client.zero_trust.dlp.profiles.predefined.update(profile_id, \*, account_id, \*\*params) -> Optional[PredefinedUpdateResponse] +- client.zero_trust.dlp.profiles.predefined.update(profile_id, \*, account_id, \*\*params) -> Optional[PredefinedProfile] - client.zero_trust.dlp.profiles.predefined.delete(profile_id, \*, account_id) -> object -- client.zero_trust.dlp.profiles.predefined.get(profile_id, \*, account_id) -> Optional[PredefinedGetResponse] +- client.zero_trust.dlp.profiles.predefined.get(profile_id, \*, account_id) -> Optional[PredefinedProfile] ### Limits diff --git a/src/cloudflare/resources/zero_trust/dlp/datasets/datasets.py b/src/cloudflare/resources/zero_trust/dlp/datasets/datasets.py index 7a8a7aff008..6aa79dd7ef5 100644 --- a/src/cloudflare/resources/zero_trust/dlp/datasets/datasets.py +++ b/src/cloudflare/resources/zero_trust/dlp/datasets/datasets.py @@ -37,9 +37,7 @@ ) from .....types.zero_trust.dlp import dataset_create_params, dataset_update_params from .....types.zero_trust.dlp.dataset import Dataset -from .....types.zero_trust.dlp.dataset_get_response import DatasetGetResponse -from .....types.zero_trust.dlp.dataset_create_response import DatasetCreateResponse -from .....types.zero_trust.dlp.dataset_update_response import DatasetUpdateResponse +from .....types.zero_trust.dlp.dataset_creation import DatasetCreation __all__ = ["DatasetsResource", "AsyncDatasetsResource"] @@ -87,7 +85,7 @@ def create( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, - ) -> Optional[DatasetCreateResponse]: + ) -> Optional[DatasetCreation]: """Create a new dataset Args: @@ -137,9 +135,9 @@ def create( extra_query=extra_query, extra_body=extra_body, timeout=timeout, - post_parser=ResultWrapper[Optional[DatasetCreateResponse]]._unwrapper, + post_parser=ResultWrapper[Optional[DatasetCreation]]._unwrapper, ), - cast_to=cast(Type[Optional[DatasetCreateResponse]], ResultWrapper[DatasetCreateResponse]), + cast_to=cast(Type[Optional[DatasetCreation]], ResultWrapper[DatasetCreation]), ) def update( @@ -156,7 +154,7 @@ def update( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, - ) -> Optional[DatasetUpdateResponse]: + ) -> Optional[Dataset]: """ Update details about a dataset @@ -196,9 +194,9 @@ def update( extra_query=extra_query, extra_body=extra_body, timeout=timeout, - post_parser=ResultWrapper[Optional[DatasetUpdateResponse]]._unwrapper, + post_parser=ResultWrapper[Optional[Dataset]]._unwrapper, ), - cast_to=cast(Type[Optional[DatasetUpdateResponse]], ResultWrapper[DatasetUpdateResponse]), + cast_to=cast(Type[Optional[Dataset]], ResultWrapper[Dataset]), ) def list( @@ -283,7 +281,7 @@ def get( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, - ) -> Optional[DatasetGetResponse]: + ) -> Optional[Dataset]: """ Fetch a specific dataset @@ -307,9 +305,9 @@ def get( extra_query=extra_query, extra_body=extra_body, timeout=timeout, - post_parser=ResultWrapper[Optional[DatasetGetResponse]]._unwrapper, + post_parser=ResultWrapper[Optional[Dataset]]._unwrapper, ), - cast_to=cast(Type[Optional[DatasetGetResponse]], ResultWrapper[DatasetGetResponse]), + cast_to=cast(Type[Optional[Dataset]], ResultWrapper[Dataset]), ) @@ -356,7 +354,7 @@ async def create( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, - ) -> Optional[DatasetCreateResponse]: + ) -> Optional[DatasetCreation]: """Create a new dataset Args: @@ -406,9 +404,9 @@ async def create( extra_query=extra_query, extra_body=extra_body, timeout=timeout, - post_parser=ResultWrapper[Optional[DatasetCreateResponse]]._unwrapper, + post_parser=ResultWrapper[Optional[DatasetCreation]]._unwrapper, ), - cast_to=cast(Type[Optional[DatasetCreateResponse]], ResultWrapper[DatasetCreateResponse]), + cast_to=cast(Type[Optional[DatasetCreation]], ResultWrapper[DatasetCreation]), ) async def update( @@ -425,7 +423,7 @@ async def update( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, - ) -> Optional[DatasetUpdateResponse]: + ) -> Optional[Dataset]: """ Update details about a dataset @@ -465,9 +463,9 @@ async def update( extra_query=extra_query, extra_body=extra_body, timeout=timeout, - post_parser=ResultWrapper[Optional[DatasetUpdateResponse]]._unwrapper, + post_parser=ResultWrapper[Optional[Dataset]]._unwrapper, ), - cast_to=cast(Type[Optional[DatasetUpdateResponse]], ResultWrapper[DatasetUpdateResponse]), + cast_to=cast(Type[Optional[Dataset]], ResultWrapper[Dataset]), ) def list( @@ -552,7 +550,7 @@ async def get( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, - ) -> Optional[DatasetGetResponse]: + ) -> Optional[Dataset]: """ Fetch a specific dataset @@ -576,9 +574,9 @@ async def get( extra_query=extra_query, extra_body=extra_body, timeout=timeout, - post_parser=ResultWrapper[Optional[DatasetGetResponse]]._unwrapper, + post_parser=ResultWrapper[Optional[Dataset]]._unwrapper, ), - cast_to=cast(Type[Optional[DatasetGetResponse]], ResultWrapper[DatasetGetResponse]), + cast_to=cast(Type[Optional[Dataset]], ResultWrapper[Dataset]), ) diff --git a/src/cloudflare/resources/zero_trust/dlp/datasets/upload.py b/src/cloudflare/resources/zero_trust/dlp/datasets/upload.py index 12a6ca39c94..089d3a8a166 100644 --- a/src/cloudflare/resources/zero_trust/dlp/datasets/upload.py +++ b/src/cloudflare/resources/zero_trust/dlp/datasets/upload.py @@ -28,8 +28,8 @@ ) from ....._wrappers import ResultWrapper from ....._base_client import make_request_options -from .....types.zero_trust.dlp.datasets.upload_edit_response import UploadEditResponse -from .....types.zero_trust.dlp.datasets.upload_create_response import UploadCreateResponse +from .....types.zero_trust.dlp.dataset import Dataset +from .....types.zero_trust.dlp.datasets.new_version import NewVersion __all__ = ["UploadResource", "AsyncUploadResource"] @@ -65,7 +65,7 @@ def create( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, - ) -> Optional[UploadCreateResponse]: + ) -> Optional[NewVersion]: """ Prepare to upload a new version of a dataset @@ -89,9 +89,9 @@ def create( extra_query=extra_query, extra_body=extra_body, timeout=timeout, - post_parser=ResultWrapper[Optional[UploadCreateResponse]]._unwrapper, + post_parser=ResultWrapper[Optional[NewVersion]]._unwrapper, ), - cast_to=cast(Type[Optional[UploadCreateResponse]], ResultWrapper[UploadCreateResponse]), + cast_to=cast(Type[Optional[NewVersion]], ResultWrapper[NewVersion]), ) def edit( @@ -107,7 +107,7 @@ def edit( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, - ) -> Optional[UploadEditResponse]: + ) -> Optional[Dataset]: """This is used for single-column EDMv1 and Custom Word Lists. The EDM format can @@ -137,9 +137,9 @@ def edit( extra_query=extra_query, extra_body=extra_body, timeout=timeout, - post_parser=ResultWrapper[Optional[UploadEditResponse]]._unwrapper, + post_parser=ResultWrapper[Optional[Dataset]]._unwrapper, ), - cast_to=cast(Type[Optional[UploadEditResponse]], ResultWrapper[UploadEditResponse]), + cast_to=cast(Type[Optional[Dataset]], ResultWrapper[Dataset]), ) @@ -174,7 +174,7 @@ async def create( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, - ) -> Optional[UploadCreateResponse]: + ) -> Optional[NewVersion]: """ Prepare to upload a new version of a dataset @@ -198,9 +198,9 @@ async def create( extra_query=extra_query, extra_body=extra_body, timeout=timeout, - post_parser=ResultWrapper[Optional[UploadCreateResponse]]._unwrapper, + post_parser=ResultWrapper[Optional[NewVersion]]._unwrapper, ), - cast_to=cast(Type[Optional[UploadCreateResponse]], ResultWrapper[UploadCreateResponse]), + cast_to=cast(Type[Optional[NewVersion]], ResultWrapper[NewVersion]), ) async def edit( @@ -216,7 +216,7 @@ async def edit( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, - ) -> Optional[UploadEditResponse]: + ) -> Optional[Dataset]: """This is used for single-column EDMv1 and Custom Word Lists. The EDM format can @@ -246,9 +246,9 @@ async def edit( extra_query=extra_query, extra_body=extra_body, timeout=timeout, - post_parser=ResultWrapper[Optional[UploadEditResponse]]._unwrapper, + post_parser=ResultWrapper[Optional[Dataset]]._unwrapper, ), - cast_to=cast(Type[Optional[UploadEditResponse]], ResultWrapper[UploadEditResponse]), + cast_to=cast(Type[Optional[Dataset]], ResultWrapper[Dataset]), ) diff --git a/src/cloudflare/resources/zero_trust/dlp/profiles/custom.py b/src/cloudflare/resources/zero_trust/dlp/profiles/custom.py index 4b0ee289b78..586ccceee16 100644 --- a/src/cloudflare/resources/zero_trust/dlp/profiles/custom.py +++ b/src/cloudflare/resources/zero_trust/dlp/profiles/custom.py @@ -18,11 +18,9 @@ ) from ....._wrappers import ResultWrapper from ....._base_client import make_request_options +from .....types.zero_trust.dlp.profile import Profile from .....types.zero_trust.dlp.profiles import custom_create_params, custom_update_params from .....types.zero_trust.dlp.context_awareness_param import ContextAwarenessParam -from .....types.zero_trust.dlp.profiles.custom_get_response import CustomGetResponse -from .....types.zero_trust.dlp.profiles.custom_create_response import CustomCreateResponse -from .....types.zero_trust.dlp.profiles.custom_update_response import CustomUpdateResponse __all__ = ["CustomResource", "AsyncCustomResource"] @@ -66,7 +64,7 @@ def create( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, - ) -> Optional[CustomCreateResponse]: + ) -> Optional[Profile]: """ Creates a DLP custom profile. @@ -92,7 +90,7 @@ def create( if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return cast( - Optional[CustomCreateResponse], + Optional[Profile], self._post( f"/accounts/{account_id}/dlp/profiles/custom", body=maybe_transform( @@ -114,10 +112,10 @@ def create( extra_query=extra_query, extra_body=extra_body, timeout=timeout, - post_parser=ResultWrapper[Optional[CustomCreateResponse]]._unwrapper, + post_parser=ResultWrapper[Optional[Profile]]._unwrapper, ), cast_to=cast( - Any, ResultWrapper[CustomCreateResponse] + Any, ResultWrapper[Profile] ), # Union types cannot be passed in as arguments in the type system ), ) @@ -142,7 +140,7 @@ def update( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, - ) -> Optional[CustomUpdateResponse]: + ) -> Optional[Profile]: """ Updates a DLP custom profile. @@ -170,7 +168,7 @@ def update( if not profile_id: raise ValueError(f"Expected a non-empty value for `profile_id` but received {profile_id!r}") return cast( - Optional[CustomUpdateResponse], + Optional[Profile], self._put( f"/accounts/{account_id}/dlp/profiles/custom/{profile_id}", body=maybe_transform( @@ -192,10 +190,10 @@ def update( extra_query=extra_query, extra_body=extra_body, timeout=timeout, - post_parser=ResultWrapper[Optional[CustomUpdateResponse]]._unwrapper, + post_parser=ResultWrapper[Optional[Profile]]._unwrapper, ), cast_to=cast( - Any, ResultWrapper[CustomUpdateResponse] + Any, ResultWrapper[Profile] ), # Union types cannot be passed in as arguments in the type system ), ) @@ -251,7 +249,7 @@ def get( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, - ) -> Optional[CustomGetResponse]: + ) -> Optional[Profile]: """ Fetches a custom DLP profile by id. @@ -269,7 +267,7 @@ def get( if not profile_id: raise ValueError(f"Expected a non-empty value for `profile_id` but received {profile_id!r}") return cast( - Optional[CustomGetResponse], + Optional[Profile], self._get( f"/accounts/{account_id}/dlp/profiles/custom/{profile_id}", options=make_request_options( @@ -277,10 +275,10 @@ def get( extra_query=extra_query, extra_body=extra_body, timeout=timeout, - post_parser=ResultWrapper[Optional[CustomGetResponse]]._unwrapper, + post_parser=ResultWrapper[Optional[Profile]]._unwrapper, ), cast_to=cast( - Any, ResultWrapper[CustomGetResponse] + Any, ResultWrapper[Profile] ), # Union types cannot be passed in as arguments in the type system ), ) @@ -325,7 +323,7 @@ async def create( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, - ) -> Optional[CustomCreateResponse]: + ) -> Optional[Profile]: """ Creates a DLP custom profile. @@ -351,7 +349,7 @@ async def create( if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return cast( - Optional[CustomCreateResponse], + Optional[Profile], await self._post( f"/accounts/{account_id}/dlp/profiles/custom", body=await async_maybe_transform( @@ -373,10 +371,10 @@ async def create( extra_query=extra_query, extra_body=extra_body, timeout=timeout, - post_parser=ResultWrapper[Optional[CustomCreateResponse]]._unwrapper, + post_parser=ResultWrapper[Optional[Profile]]._unwrapper, ), cast_to=cast( - Any, ResultWrapper[CustomCreateResponse] + Any, ResultWrapper[Profile] ), # Union types cannot be passed in as arguments in the type system ), ) @@ -401,7 +399,7 @@ async def update( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, - ) -> Optional[CustomUpdateResponse]: + ) -> Optional[Profile]: """ Updates a DLP custom profile. @@ -429,7 +427,7 @@ async def update( if not profile_id: raise ValueError(f"Expected a non-empty value for `profile_id` but received {profile_id!r}") return cast( - Optional[CustomUpdateResponse], + Optional[Profile], await self._put( f"/accounts/{account_id}/dlp/profiles/custom/{profile_id}", body=await async_maybe_transform( @@ -451,10 +449,10 @@ async def update( extra_query=extra_query, extra_body=extra_body, timeout=timeout, - post_parser=ResultWrapper[Optional[CustomUpdateResponse]]._unwrapper, + post_parser=ResultWrapper[Optional[Profile]]._unwrapper, ), cast_to=cast( - Any, ResultWrapper[CustomUpdateResponse] + Any, ResultWrapper[Profile] ), # Union types cannot be passed in as arguments in the type system ), ) @@ -510,7 +508,7 @@ async def get( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, - ) -> Optional[CustomGetResponse]: + ) -> Optional[Profile]: """ Fetches a custom DLP profile by id. @@ -528,7 +526,7 @@ async def get( if not profile_id: raise ValueError(f"Expected a non-empty value for `profile_id` but received {profile_id!r}") return cast( - Optional[CustomGetResponse], + Optional[Profile], await self._get( f"/accounts/{account_id}/dlp/profiles/custom/{profile_id}", options=make_request_options( @@ -536,10 +534,10 @@ async def get( extra_query=extra_query, extra_body=extra_body, timeout=timeout, - post_parser=ResultWrapper[Optional[CustomGetResponse]]._unwrapper, + post_parser=ResultWrapper[Optional[Profile]]._unwrapper, ), cast_to=cast( - Any, ResultWrapper[CustomGetResponse] + Any, ResultWrapper[Profile] ), # Union types cannot be passed in as arguments in the type system ), ) diff --git a/src/cloudflare/resources/zero_trust/dlp/profiles/predefined.py b/src/cloudflare/resources/zero_trust/dlp/profiles/predefined.py index aec84a044a9..acd8781e73a 100644 --- a/src/cloudflare/resources/zero_trust/dlp/profiles/predefined.py +++ b/src/cloudflare/resources/zero_trust/dlp/profiles/predefined.py @@ -19,8 +19,7 @@ from ....._wrappers import ResultWrapper from ....._base_client import make_request_options from .....types.zero_trust.dlp.profiles import predefined_update_params -from .....types.zero_trust.dlp.profiles.predefined_get_response import PredefinedGetResponse -from .....types.zero_trust.dlp.profiles.predefined_update_response import PredefinedUpdateResponse +from .....types.zero_trust.dlp.profiles.predefined_profile import PredefinedProfile __all__ = ["PredefinedResource", "AsyncPredefinedResource"] @@ -62,7 +61,7 @@ def update( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, - ) -> Optional[PredefinedUpdateResponse]: + ) -> Optional[PredefinedProfile]: """This is similar to `update_predefined` but only returns entries that are enabled. @@ -100,9 +99,9 @@ def update( extra_query=extra_query, extra_body=extra_body, timeout=timeout, - post_parser=ResultWrapper[Optional[PredefinedUpdateResponse]]._unwrapper, + post_parser=ResultWrapper[Optional[PredefinedProfile]]._unwrapper, ), - cast_to=cast(Type[Optional[PredefinedUpdateResponse]], ResultWrapper[PredefinedUpdateResponse]), + cast_to=cast(Type[Optional[PredefinedProfile]], ResultWrapper[PredefinedProfile]), ) def delete( @@ -157,7 +156,7 @@ def get( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, - ) -> Optional[PredefinedGetResponse]: + ) -> Optional[PredefinedProfile]: """ This is similar to `get_predefined` but only returns entries that are enabled. This is needed for our terraform API Fetches a predefined DLP profile by id. @@ -182,9 +181,9 @@ def get( extra_query=extra_query, extra_body=extra_body, timeout=timeout, - post_parser=ResultWrapper[Optional[PredefinedGetResponse]]._unwrapper, + post_parser=ResultWrapper[Optional[PredefinedProfile]]._unwrapper, ), - cast_to=cast(Type[Optional[PredefinedGetResponse]], ResultWrapper[PredefinedGetResponse]), + cast_to=cast(Type[Optional[PredefinedProfile]], ResultWrapper[PredefinedProfile]), ) @@ -225,7 +224,7 @@ async def update( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, - ) -> Optional[PredefinedUpdateResponse]: + ) -> Optional[PredefinedProfile]: """This is similar to `update_predefined` but only returns entries that are enabled. @@ -263,9 +262,9 @@ async def update( extra_query=extra_query, extra_body=extra_body, timeout=timeout, - post_parser=ResultWrapper[Optional[PredefinedUpdateResponse]]._unwrapper, + post_parser=ResultWrapper[Optional[PredefinedProfile]]._unwrapper, ), - cast_to=cast(Type[Optional[PredefinedUpdateResponse]], ResultWrapper[PredefinedUpdateResponse]), + cast_to=cast(Type[Optional[PredefinedProfile]], ResultWrapper[PredefinedProfile]), ) async def delete( @@ -320,7 +319,7 @@ async def get( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, - ) -> Optional[PredefinedGetResponse]: + ) -> Optional[PredefinedProfile]: """ This is similar to `get_predefined` but only returns entries that are enabled. This is needed for our terraform API Fetches a predefined DLP profile by id. @@ -345,9 +344,9 @@ async def get( extra_query=extra_query, extra_body=extra_body, timeout=timeout, - post_parser=ResultWrapper[Optional[PredefinedGetResponse]]._unwrapper, + post_parser=ResultWrapper[Optional[PredefinedProfile]]._unwrapper, ), - cast_to=cast(Type[Optional[PredefinedGetResponse]], ResultWrapper[PredefinedGetResponse]), + cast_to=cast(Type[Optional[PredefinedProfile]], ResultWrapper[PredefinedProfile]), ) diff --git a/src/cloudflare/resources/zero_trust/dlp/profiles/profiles.py b/src/cloudflare/resources/zero_trust/dlp/profiles/profiles.py index 096173e5b54..cb224c7e480 100644 --- a/src/cloudflare/resources/zero_trust/dlp/profiles/profiles.py +++ b/src/cloudflare/resources/zero_trust/dlp/profiles/profiles.py @@ -37,7 +37,6 @@ from ....._base_client import AsyncPaginator, make_request_options from .....types.zero_trust.dlp import profile_list_params from .....types.zero_trust.dlp.profile import Profile -from .....types.zero_trust.dlp.profile_get_response import ProfileGetResponse __all__ = ["ProfilesResource", "AsyncProfilesResource"] @@ -123,7 +122,7 @@ def get( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, - ) -> Optional[ProfileGetResponse]: + ) -> Optional[Profile]: """ Fetches a DLP profile by ID. @@ -141,7 +140,7 @@ def get( if not profile_id: raise ValueError(f"Expected a non-empty value for `profile_id` but received {profile_id!r}") return cast( - Optional[ProfileGetResponse], + Optional[Profile], self._get( f"/accounts/{account_id}/dlp/profiles/{profile_id}", options=make_request_options( @@ -149,10 +148,10 @@ def get( extra_query=extra_query, extra_body=extra_body, timeout=timeout, - post_parser=ResultWrapper[Optional[ProfileGetResponse]]._unwrapper, + post_parser=ResultWrapper[Optional[Profile]]._unwrapper, ), cast_to=cast( - Any, ResultWrapper[ProfileGetResponse] + Any, ResultWrapper[Profile] ), # Union types cannot be passed in as arguments in the type system ), ) @@ -239,7 +238,7 @@ async def get( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, - ) -> Optional[ProfileGetResponse]: + ) -> Optional[Profile]: """ Fetches a DLP profile by ID. @@ -257,7 +256,7 @@ async def get( if not profile_id: raise ValueError(f"Expected a non-empty value for `profile_id` but received {profile_id!r}") return cast( - Optional[ProfileGetResponse], + Optional[Profile], await self._get( f"/accounts/{account_id}/dlp/profiles/{profile_id}", options=make_request_options( @@ -265,10 +264,10 @@ async def get( extra_query=extra_query, extra_body=extra_body, timeout=timeout, - post_parser=ResultWrapper[Optional[ProfileGetResponse]]._unwrapper, + post_parser=ResultWrapper[Optional[Profile]]._unwrapper, ), cast_to=cast( - Any, ResultWrapper[ProfileGetResponse] + Any, ResultWrapper[Profile] ), # Union types cannot be passed in as arguments in the type system ), ) diff --git a/src/cloudflare/types/zero_trust/dlp/__init__.py b/src/cloudflare/types/zero_trust/dlp/__init__.py index 1967c3f7f17..fa6d87dbb47 100644 --- a/src/cloudflare/types/zero_trust/dlp/__init__.py +++ b/src/cloudflare/types/zero_trust/dlp/__init__.py @@ -4,6 +4,8 @@ from .dataset import Dataset as Dataset from .profile import Profile as Profile +from .dataset_array import DatasetArray as DatasetArray +from .dataset_creation import DatasetCreation as DatasetCreation from .context_awareness import ContextAwareness as ContextAwareness from .entry_get_response import EntryGetResponse as EntryGetResponse from .skip_configuration import SkipConfiguration as SkipConfiguration @@ -12,15 +14,11 @@ from .entry_update_params import EntryUpdateParams as EntryUpdateParams from .limit_list_response import LimitListResponse as LimitListResponse from .profile_list_params import ProfileListParams as ProfileListParams -from .dataset_get_response import DatasetGetResponse as DatasetGetResponse -from .profile_get_response import ProfileGetResponse as ProfileGetResponse from .dataset_create_params import DatasetCreateParams as DatasetCreateParams from .dataset_update_params import DatasetUpdateParams as DatasetUpdateParams from .entry_create_response import EntryCreateResponse as EntryCreateResponse from .entry_update_response import EntryUpdateResponse as EntryUpdateResponse from .context_awareness_param import ContextAwarenessParam as ContextAwarenessParam -from .dataset_create_response import DatasetCreateResponse as DatasetCreateResponse -from .dataset_update_response import DatasetUpdateResponse as DatasetUpdateResponse from .pattern_validate_params import PatternValidateParams as PatternValidateParams from .payload_log_get_response import PayloadLogGetResponse as PayloadLogGetResponse from .skip_configuration_param import SkipConfigurationParam as SkipConfigurationParam diff --git a/src/cloudflare/types/zero_trust/dlp/dataset_array.py b/src/cloudflare/types/zero_trust/dlp/dataset_array.py new file mode 100644 index 00000000000..92e05fadd7a --- /dev/null +++ b/src/cloudflare/types/zero_trust/dlp/dataset_array.py @@ -0,0 +1,10 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List +from typing_extensions import TypeAlias + +from .dataset import Dataset + +__all__ = ["DatasetArray"] + +DatasetArray: TypeAlias = List[Dataset] diff --git a/src/cloudflare/types/zero_trust/dlp/dataset_create_response.py b/src/cloudflare/types/zero_trust/dlp/dataset_creation.py similarity index 87% rename from src/cloudflare/types/zero_trust/dlp/dataset_create_response.py rename to src/cloudflare/types/zero_trust/dlp/dataset_creation.py index 41c574f0e2d..072c00e83ee 100644 --- a/src/cloudflare/types/zero_trust/dlp/dataset_create_response.py +++ b/src/cloudflare/types/zero_trust/dlp/dataset_creation.py @@ -5,10 +5,10 @@ from .dataset import Dataset from ...._models import BaseModel -__all__ = ["DatasetCreateResponse"] +__all__ = ["DatasetCreation"] -class DatasetCreateResponse(BaseModel): +class DatasetCreation(BaseModel): dataset: Dataset encoding_version: int diff --git a/src/cloudflare/types/zero_trust/dlp/dataset_get_response.py b/src/cloudflare/types/zero_trust/dlp/dataset_get_response.py deleted file mode 100644 index 3d05e3ef4a3..00000000000 --- a/src/cloudflare/types/zero_trust/dlp/dataset_get_response.py +++ /dev/null @@ -1,58 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Optional -from datetime import datetime -from typing_extensions import Literal - -from ...._models import BaseModel - -__all__ = ["DatasetGetResponse", "Column", "Upload"] - - -class Column(BaseModel): - entry_id: str - - header_name: str - - num_cells: int - - upload_status: Literal["empty", "uploading", "pending", "processing", "failed", "complete"] - - -class Upload(BaseModel): - num_cells: int - - status: Literal["empty", "uploading", "pending", "processing", "failed", "complete"] - - version: int - - -class DatasetGetResponse(BaseModel): - id: str - - columns: List[Column] - - created_at: datetime - - encoding_version: int - - name: str - - num_cells: int - - secret: bool - - status: Literal["empty", "uploading", "pending", "processing", "failed", "complete"] - - updated_at: datetime - """Stores when the dataset was last updated. - - This includes name or description changes as well as uploads. - """ - - uploads: List[Upload] - - case_sensitive: Optional[bool] = None - - description: Optional[str] = None - """The description of the dataset.""" diff --git a/src/cloudflare/types/zero_trust/dlp/dataset_update_response.py b/src/cloudflare/types/zero_trust/dlp/dataset_update_response.py deleted file mode 100644 index 04816f455dd..00000000000 --- a/src/cloudflare/types/zero_trust/dlp/dataset_update_response.py +++ /dev/null @@ -1,58 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Optional -from datetime import datetime -from typing_extensions import Literal - -from ...._models import BaseModel - -__all__ = ["DatasetUpdateResponse", "Column", "Upload"] - - -class Column(BaseModel): - entry_id: str - - header_name: str - - num_cells: int - - upload_status: Literal["empty", "uploading", "pending", "processing", "failed", "complete"] - - -class Upload(BaseModel): - num_cells: int - - status: Literal["empty", "uploading", "pending", "processing", "failed", "complete"] - - version: int - - -class DatasetUpdateResponse(BaseModel): - id: str - - columns: List[Column] - - created_at: datetime - - encoding_version: int - - name: str - - num_cells: int - - secret: bool - - status: Literal["empty", "uploading", "pending", "processing", "failed", "complete"] - - updated_at: datetime - """Stores when the dataset was last updated. - - This includes name or description changes as well as uploads. - """ - - uploads: List[Upload] - - case_sensitive: Optional[bool] = None - - description: Optional[str] = None - """The description of the dataset.""" diff --git a/src/cloudflare/types/zero_trust/dlp/datasets/__init__.py b/src/cloudflare/types/zero_trust/dlp/datasets/__init__.py index bc1e3874a3a..bfb205bbab6 100644 --- a/src/cloudflare/types/zero_trust/dlp/datasets/__init__.py +++ b/src/cloudflare/types/zero_trust/dlp/datasets/__init__.py @@ -2,8 +2,7 @@ from __future__ import annotations +from .new_version import NewVersion as NewVersion from .upload_edit_params import UploadEditParams as UploadEditParams -from .upload_edit_response import UploadEditResponse as UploadEditResponse from .version_create_params import VersionCreateParams as VersionCreateParams -from .upload_create_response import UploadCreateResponse as UploadCreateResponse from .version_create_response import VersionCreateResponse as VersionCreateResponse diff --git a/src/cloudflare/types/zero_trust/dlp/datasets/upload_create_response.py b/src/cloudflare/types/zero_trust/dlp/datasets/new_version.py similarity index 87% rename from src/cloudflare/types/zero_trust/dlp/datasets/upload_create_response.py rename to src/cloudflare/types/zero_trust/dlp/datasets/new_version.py index 18728ec12d8..2e10d4c3770 100644 --- a/src/cloudflare/types/zero_trust/dlp/datasets/upload_create_response.py +++ b/src/cloudflare/types/zero_trust/dlp/datasets/new_version.py @@ -5,7 +5,7 @@ from ....._models import BaseModel -__all__ = ["UploadCreateResponse", "Column"] +__all__ = ["NewVersion", "Column"] class Column(BaseModel): @@ -18,7 +18,7 @@ class Column(BaseModel): upload_status: Literal["empty", "uploading", "pending", "processing", "failed", "complete"] -class UploadCreateResponse(BaseModel): +class NewVersion(BaseModel): encoding_version: int max_cells: int diff --git a/src/cloudflare/types/zero_trust/dlp/datasets/upload_edit_response.py b/src/cloudflare/types/zero_trust/dlp/datasets/upload_edit_response.py deleted file mode 100644 index d61fc6dc4ac..00000000000 --- a/src/cloudflare/types/zero_trust/dlp/datasets/upload_edit_response.py +++ /dev/null @@ -1,58 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Optional -from datetime import datetime -from typing_extensions import Literal - -from ....._models import BaseModel - -__all__ = ["UploadEditResponse", "Column", "Upload"] - - -class Column(BaseModel): - entry_id: str - - header_name: str - - num_cells: int - - upload_status: Literal["empty", "uploading", "pending", "processing", "failed", "complete"] - - -class Upload(BaseModel): - num_cells: int - - status: Literal["empty", "uploading", "pending", "processing", "failed", "complete"] - - version: int - - -class UploadEditResponse(BaseModel): - id: str - - columns: List[Column] - - created_at: datetime - - encoding_version: int - - name: str - - num_cells: int - - secret: bool - - status: Literal["empty", "uploading", "pending", "processing", "failed", "complete"] - - updated_at: datetime - """Stores when the dataset was last updated. - - This includes name or description changes as well as uploads. - """ - - uploads: List[Upload] - - case_sensitive: Optional[bool] = None - - description: Optional[str] = None - """The description of the dataset.""" 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 ae6c5f56e7e..af4e3334fbc 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 @@ -9,18 +9,18 @@ __all__ = [ "CustomListResponse", - "CustomEntry", - "PredefinedEntry", - "PredefinedEntryConfidence", - "PredefinedEntryVariant", - "IntegrationEntry", - "ExactDataEntry", - "DocumentFingerprintEntry", - "WordListEntry", + "UnionMember0", + "UnionMember1", + "UnionMember1Confidence", + "UnionMember1Variant", + "UnionMember2", + "UnionMember3", + "UnionMember4", + "UnionMember5", ] -class CustomEntry(BaseModel): +class UnionMember0(BaseModel): id: str created_at: datetime @@ -42,7 +42,7 @@ class CustomEntry(BaseModel): upload_status: Optional[Literal["empty", "uploading", "pending", "processing", "failed", "complete"]] = None -class PredefinedEntryConfidence(BaseModel): +class UnionMember1Confidence(BaseModel): ai_context_available: bool """Indicates whether this entry has AI remote service validation.""" @@ -53,7 +53,7 @@ class PredefinedEntryConfidence(BaseModel): """ -class PredefinedEntryVariant(BaseModel): +class UnionMember1Variant(BaseModel): topic_type: Literal["Intent", "Content"] type: Literal["PromptTopic"] @@ -61,10 +61,10 @@ class PredefinedEntryVariant(BaseModel): description: Optional[str] = None -class PredefinedEntry(BaseModel): +class UnionMember1(BaseModel): id: str - confidence: PredefinedEntryConfidence + confidence: UnionMember1Confidence enabled: bool @@ -76,10 +76,10 @@ class PredefinedEntry(BaseModel): upload_status: Optional[Literal["empty", "uploading", "pending", "processing", "failed", "complete"]] = None - variant: Optional[PredefinedEntryVariant] = None + variant: Optional[UnionMember1Variant] = None -class IntegrationEntry(BaseModel): +class UnionMember2(BaseModel): id: str created_at: datetime @@ -97,7 +97,7 @@ class IntegrationEntry(BaseModel): upload_status: Optional[Literal["empty", "uploading", "pending", "processing", "failed", "complete"]] = None -class ExactDataEntry(BaseModel): +class UnionMember3(BaseModel): id: str case_sensitive: bool @@ -121,7 +121,7 @@ class ExactDataEntry(BaseModel): upload_status: Optional[Literal["empty", "uploading", "pending", "processing", "failed", "complete"]] = None -class DocumentFingerprintEntry(BaseModel): +class UnionMember4(BaseModel): id: str created_at: datetime @@ -137,7 +137,7 @@ class DocumentFingerprintEntry(BaseModel): upload_status: Optional[Literal["empty", "uploading", "pending", "processing", "failed", "complete"]] = None -class WordListEntry(BaseModel): +class UnionMember5(BaseModel): id: str created_at: datetime @@ -158,5 +158,5 @@ class WordListEntry(BaseModel): CustomListResponse: TypeAlias = Union[ - CustomEntry, PredefinedEntry, IntegrationEntry, ExactDataEntry, DocumentFingerprintEntry, WordListEntry + UnionMember0, UnionMember1, UnionMember2, UnionMember3, UnionMember4, UnionMember5 ] 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 79a8312ce3b..ea7214a2153 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 @@ -9,18 +9,18 @@ __all__ = [ "IntegrationListResponse", - "CustomEntry", - "PredefinedEntry", - "PredefinedEntryConfidence", - "PredefinedEntryVariant", - "IntegrationEntry", - "ExactDataEntry", - "DocumentFingerprintEntry", - "WordListEntry", + "UnionMember0", + "UnionMember1", + "UnionMember1Confidence", + "UnionMember1Variant", + "UnionMember2", + "UnionMember3", + "UnionMember4", + "UnionMember5", ] -class CustomEntry(BaseModel): +class UnionMember0(BaseModel): id: str created_at: datetime @@ -42,7 +42,7 @@ class CustomEntry(BaseModel): upload_status: Optional[Literal["empty", "uploading", "pending", "processing", "failed", "complete"]] = None -class PredefinedEntryConfidence(BaseModel): +class UnionMember1Confidence(BaseModel): ai_context_available: bool """Indicates whether this entry has AI remote service validation.""" @@ -53,7 +53,7 @@ class PredefinedEntryConfidence(BaseModel): """ -class PredefinedEntryVariant(BaseModel): +class UnionMember1Variant(BaseModel): topic_type: Literal["Intent", "Content"] type: Literal["PromptTopic"] @@ -61,10 +61,10 @@ class PredefinedEntryVariant(BaseModel): description: Optional[str] = None -class PredefinedEntry(BaseModel): +class UnionMember1(BaseModel): id: str - confidence: PredefinedEntryConfidence + confidence: UnionMember1Confidence enabled: bool @@ -76,10 +76,10 @@ class PredefinedEntry(BaseModel): upload_status: Optional[Literal["empty", "uploading", "pending", "processing", "failed", "complete"]] = None - variant: Optional[PredefinedEntryVariant] = None + variant: Optional[UnionMember1Variant] = None -class IntegrationEntry(BaseModel): +class UnionMember2(BaseModel): id: str created_at: datetime @@ -97,7 +97,7 @@ class IntegrationEntry(BaseModel): upload_status: Optional[Literal["empty", "uploading", "pending", "processing", "failed", "complete"]] = None -class ExactDataEntry(BaseModel): +class UnionMember3(BaseModel): id: str case_sensitive: bool @@ -121,7 +121,7 @@ class ExactDataEntry(BaseModel): upload_status: Optional[Literal["empty", "uploading", "pending", "processing", "failed", "complete"]] = None -class DocumentFingerprintEntry(BaseModel): +class UnionMember4(BaseModel): id: str created_at: datetime @@ -137,7 +137,7 @@ class DocumentFingerprintEntry(BaseModel): upload_status: Optional[Literal["empty", "uploading", "pending", "processing", "failed", "complete"]] = None -class WordListEntry(BaseModel): +class UnionMember5(BaseModel): id: str created_at: datetime @@ -158,5 +158,5 @@ class WordListEntry(BaseModel): IntegrationListResponse: TypeAlias = Union[ - CustomEntry, PredefinedEntry, IntegrationEntry, ExactDataEntry, DocumentFingerprintEntry, WordListEntry + UnionMember0, UnionMember1, UnionMember2, UnionMember3, UnionMember4, UnionMember5 ] 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 2f9571fe90b..2dcfabd8dc1 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 @@ -9,18 +9,18 @@ __all__ = [ "PredefinedListResponse", - "CustomEntry", - "PredefinedEntry", - "PredefinedEntryConfidence", - "PredefinedEntryVariant", - "IntegrationEntry", - "ExactDataEntry", - "DocumentFingerprintEntry", - "WordListEntry", + "UnionMember0", + "UnionMember1", + "UnionMember1Confidence", + "UnionMember1Variant", + "UnionMember2", + "UnionMember3", + "UnionMember4", + "UnionMember5", ] -class CustomEntry(BaseModel): +class UnionMember0(BaseModel): id: str created_at: datetime @@ -42,7 +42,7 @@ class CustomEntry(BaseModel): upload_status: Optional[Literal["empty", "uploading", "pending", "processing", "failed", "complete"]] = None -class PredefinedEntryConfidence(BaseModel): +class UnionMember1Confidence(BaseModel): ai_context_available: bool """Indicates whether this entry has AI remote service validation.""" @@ -53,7 +53,7 @@ class PredefinedEntryConfidence(BaseModel): """ -class PredefinedEntryVariant(BaseModel): +class UnionMember1Variant(BaseModel): topic_type: Literal["Intent", "Content"] type: Literal["PromptTopic"] @@ -61,10 +61,10 @@ class PredefinedEntryVariant(BaseModel): description: Optional[str] = None -class PredefinedEntry(BaseModel): +class UnionMember1(BaseModel): id: str - confidence: PredefinedEntryConfidence + confidence: UnionMember1Confidence enabled: bool @@ -76,10 +76,10 @@ class PredefinedEntry(BaseModel): upload_status: Optional[Literal["empty", "uploading", "pending", "processing", "failed", "complete"]] = None - variant: Optional[PredefinedEntryVariant] = None + variant: Optional[UnionMember1Variant] = None -class IntegrationEntry(BaseModel): +class UnionMember2(BaseModel): id: str created_at: datetime @@ -97,7 +97,7 @@ class IntegrationEntry(BaseModel): upload_status: Optional[Literal["empty", "uploading", "pending", "processing", "failed", "complete"]] = None -class ExactDataEntry(BaseModel): +class UnionMember3(BaseModel): id: str case_sensitive: bool @@ -121,7 +121,7 @@ class ExactDataEntry(BaseModel): upload_status: Optional[Literal["empty", "uploading", "pending", "processing", "failed", "complete"]] = None -class DocumentFingerprintEntry(BaseModel): +class UnionMember4(BaseModel): id: str created_at: datetime @@ -137,7 +137,7 @@ class DocumentFingerprintEntry(BaseModel): upload_status: Optional[Literal["empty", "uploading", "pending", "processing", "failed", "complete"]] = None -class WordListEntry(BaseModel): +class UnionMember5(BaseModel): id: str created_at: datetime @@ -158,5 +158,5 @@ class WordListEntry(BaseModel): PredefinedListResponse: TypeAlias = Union[ - CustomEntry, PredefinedEntry, IntegrationEntry, ExactDataEntry, DocumentFingerprintEntry, WordListEntry + UnionMember0, UnionMember1, UnionMember2, UnionMember3, UnionMember4, UnionMember5 ] 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 a762e734404..c0e6b250d00 100644 --- a/src/cloudflare/types/zero_trust/dlp/entry_list_response.py +++ b/src/cloudflare/types/zero_trust/dlp/entry_list_response.py @@ -9,18 +9,18 @@ __all__ = [ "EntryListResponse", - "CustomEntry", - "PredefinedEntry", - "PredefinedEntryConfidence", - "PredefinedEntryVariant", - "IntegrationEntry", - "ExactDataEntry", - "DocumentFingerprintEntry", - "WordListEntry", + "UnionMember0", + "UnionMember1", + "UnionMember1Confidence", + "UnionMember1Variant", + "UnionMember2", + "UnionMember3", + "UnionMember4", + "UnionMember5", ] -class CustomEntry(BaseModel): +class UnionMember0(BaseModel): id: str created_at: datetime @@ -42,7 +42,7 @@ class CustomEntry(BaseModel): upload_status: Optional[Literal["empty", "uploading", "pending", "processing", "failed", "complete"]] = None -class PredefinedEntryConfidence(BaseModel): +class UnionMember1Confidence(BaseModel): ai_context_available: bool """Indicates whether this entry has AI remote service validation.""" @@ -53,7 +53,7 @@ class PredefinedEntryConfidence(BaseModel): """ -class PredefinedEntryVariant(BaseModel): +class UnionMember1Variant(BaseModel): topic_type: Literal["Intent", "Content"] type: Literal["PromptTopic"] @@ -61,10 +61,10 @@ class PredefinedEntryVariant(BaseModel): description: Optional[str] = None -class PredefinedEntry(BaseModel): +class UnionMember1(BaseModel): id: str - confidence: PredefinedEntryConfidence + confidence: UnionMember1Confidence enabled: bool @@ -76,10 +76,10 @@ class PredefinedEntry(BaseModel): upload_status: Optional[Literal["empty", "uploading", "pending", "processing", "failed", "complete"]] = None - variant: Optional[PredefinedEntryVariant] = None + variant: Optional[UnionMember1Variant] = None -class IntegrationEntry(BaseModel): +class UnionMember2(BaseModel): id: str created_at: datetime @@ -97,7 +97,7 @@ class IntegrationEntry(BaseModel): upload_status: Optional[Literal["empty", "uploading", "pending", "processing", "failed", "complete"]] = None -class ExactDataEntry(BaseModel): +class UnionMember3(BaseModel): id: str case_sensitive: bool @@ -121,7 +121,7 @@ class ExactDataEntry(BaseModel): upload_status: Optional[Literal["empty", "uploading", "pending", "processing", "failed", "complete"]] = None -class DocumentFingerprintEntry(BaseModel): +class UnionMember4(BaseModel): id: str created_at: datetime @@ -137,7 +137,7 @@ class DocumentFingerprintEntry(BaseModel): upload_status: Optional[Literal["empty", "uploading", "pending", "processing", "failed", "complete"]] = None -class WordListEntry(BaseModel): +class UnionMember5(BaseModel): id: str created_at: datetime @@ -157,6 +157,4 @@ class WordListEntry(BaseModel): upload_status: Optional[Literal["empty", "uploading", "pending", "processing", "failed", "complete"]] = None -EntryListResponse: TypeAlias = Union[ - CustomEntry, PredefinedEntry, IntegrationEntry, ExactDataEntry, DocumentFingerprintEntry, WordListEntry -] +EntryListResponse: TypeAlias = Union[UnionMember0, UnionMember1, UnionMember2, UnionMember3, UnionMember4, UnionMember5] 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 9e608c2eb48..0e256a22386 100644 --- a/src/cloudflare/types/zero_trust/dlp/entry_update_response.py +++ b/src/cloudflare/types/zero_trust/dlp/entry_update_response.py @@ -2,26 +2,25 @@ from typing import Union, Optional from datetime import datetime -from typing_extensions import Literal, Annotated, TypeAlias +from typing_extensions import Literal, TypeAlias -from ...._utils import PropertyInfo from ...._models import BaseModel from .profiles.pattern import Pattern __all__ = [ "EntryUpdateResponse", - "Custom", - "Predefined", - "PredefinedConfidence", - "PredefinedVariant", - "Integration", - "ExactData", - "DocumentFingerprint", - "WordList", + "CustomEntry", + "PredefinedEntry", + "PredefinedEntryConfidence", + "PredefinedEntryVariant", + "IntegrationEntry", + "ExactDataEntry", + "DocumentFingerprintEntry", + "WordListEntry", ] -class Custom(BaseModel): +class CustomEntry(BaseModel): id: str created_at: datetime @@ -41,7 +40,7 @@ class Custom(BaseModel): profile_id: Optional[str] = None -class PredefinedConfidence(BaseModel): +class PredefinedEntryConfidence(BaseModel): ai_context_available: bool """Indicates whether this entry has AI remote service validation.""" @@ -52,7 +51,7 @@ class PredefinedConfidence(BaseModel): """ -class PredefinedVariant(BaseModel): +class PredefinedEntryVariant(BaseModel): topic_type: Literal["Intent", "Content"] type: Literal["PromptTopic"] @@ -60,10 +59,10 @@ class PredefinedVariant(BaseModel): description: Optional[str] = None -class Predefined(BaseModel): +class PredefinedEntry(BaseModel): id: str - confidence: PredefinedConfidence + confidence: PredefinedEntryConfidence enabled: bool @@ -73,10 +72,10 @@ class Predefined(BaseModel): profile_id: Optional[str] = None - variant: Optional[PredefinedVariant] = None + variant: Optional[PredefinedEntryVariant] = None -class Integration(BaseModel): +class IntegrationEntry(BaseModel): id: str created_at: datetime @@ -92,7 +91,7 @@ class Integration(BaseModel): profile_id: Optional[str] = None -class ExactData(BaseModel): +class ExactDataEntry(BaseModel): id: str case_sensitive: bool @@ -114,7 +113,7 @@ class ExactData(BaseModel): updated_at: datetime -class DocumentFingerprint(BaseModel): +class DocumentFingerprintEntry(BaseModel): id: str created_at: datetime @@ -128,7 +127,7 @@ class DocumentFingerprint(BaseModel): updated_at: datetime -class WordList(BaseModel): +class WordListEntry(BaseModel): id: str created_at: datetime @@ -146,6 +145,6 @@ class WordList(BaseModel): profile_id: Optional[str] = None -EntryUpdateResponse: TypeAlias = Annotated[ - Union[Custom, Predefined, Integration, ExactData, DocumentFingerprint, WordList], PropertyInfo(discriminator="type") +EntryUpdateResponse: TypeAlias = Union[ + CustomEntry, PredefinedEntry, IntegrationEntry, ExactDataEntry, DocumentFingerprintEntry, WordListEntry ] diff --git a/src/cloudflare/types/zero_trust/dlp/profile_get_response.py b/src/cloudflare/types/zero_trust/dlp/profile_get_response.py deleted file mode 100644 index aba07605c6a..00000000000 --- a/src/cloudflare/types/zero_trust/dlp/profile_get_response.py +++ /dev/null @@ -1,826 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Union, Optional -from datetime import datetime -from typing_extensions import Literal, Annotated, TypeAlias - -from ...._utils import PropertyInfo -from ...._models import BaseModel -from .profiles.pattern import Pattern -from .context_awareness import ContextAwareness - -__all__ = [ - "ProfileGetResponse", - "Custom", - "CustomEntry", - "CustomEntryCustomEntry", - "CustomEntryPredefinedEntry", - "CustomEntryPredefinedEntryConfidence", - "CustomEntryPredefinedEntryVariant", - "CustomEntryIntegrationEntry", - "CustomEntryExactDataEntry", - "CustomEntryDocumentFingerprintEntry", - "CustomEntryWordListEntry", - "CustomSharedEntry", - "CustomSharedEntryCustomEntry", - "CustomSharedEntryPredefinedEntry", - "CustomSharedEntryPredefinedEntryConfidence", - "CustomSharedEntryPredefinedEntryVariant", - "CustomSharedEntryIntegrationEntry", - "CustomSharedEntryExactDataEntry", - "CustomSharedEntryDocumentFingerprintEntry", - "CustomSharedEntryWordListEntry", - "Predefined", - "PredefinedEntry", - "PredefinedEntryCustomEntry", - "PredefinedEntryPredefinedEntry", - "PredefinedEntryPredefinedEntryConfidence", - "PredefinedEntryPredefinedEntryVariant", - "PredefinedEntryIntegrationEntry", - "PredefinedEntryExactDataEntry", - "PredefinedEntryDocumentFingerprintEntry", - "PredefinedEntryWordListEntry", - "Integration", - "IntegrationEntry", - "IntegrationEntryCustomEntry", - "IntegrationEntryPredefinedEntry", - "IntegrationEntryPredefinedEntryConfidence", - "IntegrationEntryPredefinedEntryVariant", - "IntegrationEntryIntegrationEntry", - "IntegrationEntryExactDataEntry", - "IntegrationEntryDocumentFingerprintEntry", - "IntegrationEntryWordListEntry", - "IntegrationSharedEntry", - "IntegrationSharedEntryCustomEntry", - "IntegrationSharedEntryPredefinedEntry", - "IntegrationSharedEntryPredefinedEntryConfidence", - "IntegrationSharedEntryPredefinedEntryVariant", - "IntegrationSharedEntryIntegrationEntry", - "IntegrationSharedEntryExactDataEntry", - "IntegrationSharedEntryDocumentFingerprintEntry", - "IntegrationSharedEntryWordListEntry", -] - - -class CustomEntryCustomEntry(BaseModel): - id: str - - created_at: datetime - - enabled: bool - - name: str - - pattern: Pattern - - type: Literal["custom"] - - updated_at: datetime - - description: Optional[str] = None - - profile_id: Optional[str] = None - - -class CustomEntryPredefinedEntryConfidence(BaseModel): - ai_context_available: bool - """Indicates whether this entry has AI remote service validation.""" - - available: bool - """ - Indicates whether this entry has any form of validation that is not an AI remote - service. - """ - - -class CustomEntryPredefinedEntryVariant(BaseModel): - topic_type: Literal["Intent", "Content"] - - type: Literal["PromptTopic"] - - description: Optional[str] = None - - -class CustomEntryPredefinedEntry(BaseModel): - id: str - - confidence: CustomEntryPredefinedEntryConfidence - - enabled: bool - - name: str - - type: Literal["predefined"] - - profile_id: Optional[str] = None - - variant: Optional[CustomEntryPredefinedEntryVariant] = None - - -class CustomEntryIntegrationEntry(BaseModel): - id: str - - created_at: datetime - - enabled: bool - - name: str - - type: Literal["integration"] - - updated_at: datetime - - profile_id: Optional[str] = None - - -class CustomEntryExactDataEntry(BaseModel): - id: str - - case_sensitive: bool - """ - Only applies to custom word lists. Determines if the words should be matched in - a case-sensitive manner Cannot be set to false if secret is true - """ - - created_at: datetime - - enabled: bool - - name: str - - secret: bool - - type: Literal["exact_data"] - - updated_at: datetime - - -class CustomEntryDocumentFingerprintEntry(BaseModel): - id: str - - created_at: datetime - - enabled: bool - - name: str - - type: Literal["document_fingerprint"] - - updated_at: datetime - - -class CustomEntryWordListEntry(BaseModel): - id: str - - created_at: datetime - - enabled: bool - - name: str - - type: Literal["word_list"] - - updated_at: datetime - - word_list: object - - profile_id: Optional[str] = None - - -CustomEntry: TypeAlias = Union[ - CustomEntryCustomEntry, - CustomEntryPredefinedEntry, - CustomEntryIntegrationEntry, - CustomEntryExactDataEntry, - CustomEntryDocumentFingerprintEntry, - CustomEntryWordListEntry, -] - - -class CustomSharedEntryCustomEntry(BaseModel): - id: str - - created_at: datetime - - enabled: bool - - name: str - - pattern: Pattern - - type: Literal["custom"] - - updated_at: datetime - - description: Optional[str] = None - - profile_id: Optional[str] = None - - -class CustomSharedEntryPredefinedEntryConfidence(BaseModel): - ai_context_available: bool - """Indicates whether this entry has AI remote service validation.""" - - available: bool - """ - Indicates whether this entry has any form of validation that is not an AI remote - service. - """ - - -class CustomSharedEntryPredefinedEntryVariant(BaseModel): - topic_type: Literal["Intent", "Content"] - - type: Literal["PromptTopic"] - - description: Optional[str] = None - - -class CustomSharedEntryPredefinedEntry(BaseModel): - id: str - - confidence: CustomSharedEntryPredefinedEntryConfidence - - enabled: bool - - name: str - - type: Literal["predefined"] - - profile_id: Optional[str] = None - - variant: Optional[CustomSharedEntryPredefinedEntryVariant] = None - - -class CustomSharedEntryIntegrationEntry(BaseModel): - id: str - - created_at: datetime - - enabled: bool - - name: str - - type: Literal["integration"] - - updated_at: datetime - - profile_id: Optional[str] = None - - -class CustomSharedEntryExactDataEntry(BaseModel): - id: str - - case_sensitive: bool - """ - Only applies to custom word lists. Determines if the words should be matched in - a case-sensitive manner Cannot be set to false if secret is true - """ - - created_at: datetime - - enabled: bool - - name: str - - secret: bool - - type: Literal["exact_data"] - - updated_at: datetime - - -class CustomSharedEntryDocumentFingerprintEntry(BaseModel): - id: str - - created_at: datetime - - enabled: bool - - name: str - - type: Literal["document_fingerprint"] - - updated_at: datetime - - -class CustomSharedEntryWordListEntry(BaseModel): - id: str - - created_at: datetime - - enabled: bool - - name: str - - type: Literal["word_list"] - - updated_at: datetime - - word_list: object - - profile_id: Optional[str] = None - - -CustomSharedEntry: TypeAlias = Union[ - CustomSharedEntryCustomEntry, - CustomSharedEntryPredefinedEntry, - CustomSharedEntryIntegrationEntry, - CustomSharedEntryExactDataEntry, - CustomSharedEntryDocumentFingerprintEntry, - CustomSharedEntryWordListEntry, -] - - -class Custom(BaseModel): - id: str - """The id of the profile (uuid).""" - - allowed_match_count: int - """Related DLP policies will trigger when the match count exceeds the number set.""" - - created_at: datetime - """When the profile was created.""" - - name: str - """The name of the profile.""" - - ocr_enabled: bool - - type: Literal["custom"] - - updated_at: datetime - """When the profile was lasted updated.""" - - ai_context_enabled: Optional[bool] = None - - confidence_threshold: Optional[Literal["low", "medium", "high", "very_high"]] = None - - context_awareness: Optional[ContextAwareness] = None - """ - Scan the context of predefined entries to only return matches surrounded by - keywords. - """ - - description: Optional[str] = None - """The description of the profile.""" - - entries: Optional[List[CustomEntry]] = None - - shared_entries: Optional[List[CustomSharedEntry]] = None - - -class PredefinedEntryCustomEntry(BaseModel): - id: str - - created_at: datetime - - enabled: bool - - name: str - - pattern: Pattern - - type: Literal["custom"] - - updated_at: datetime - - description: Optional[str] = None - - profile_id: Optional[str] = None - - -class PredefinedEntryPredefinedEntryConfidence(BaseModel): - ai_context_available: bool - """Indicates whether this entry has AI remote service validation.""" - - available: bool - """ - Indicates whether this entry has any form of validation that is not an AI remote - service. - """ - - -class PredefinedEntryPredefinedEntryVariant(BaseModel): - topic_type: Literal["Intent", "Content"] - - type: Literal["PromptTopic"] - - description: Optional[str] = None - - -class PredefinedEntryPredefinedEntry(BaseModel): - id: str - - confidence: PredefinedEntryPredefinedEntryConfidence - - enabled: bool - - name: str - - type: Literal["predefined"] - - profile_id: Optional[str] = None - - variant: Optional[PredefinedEntryPredefinedEntryVariant] = None - - -class PredefinedEntryIntegrationEntry(BaseModel): - id: str - - created_at: datetime - - enabled: bool - - name: str - - type: Literal["integration"] - - updated_at: datetime - - profile_id: Optional[str] = None - - -class PredefinedEntryExactDataEntry(BaseModel): - id: str - - case_sensitive: bool - """ - Only applies to custom word lists. Determines if the words should be matched in - a case-sensitive manner Cannot be set to false if secret is true - """ - - created_at: datetime - - enabled: bool - - name: str - - secret: bool - - type: Literal["exact_data"] - - updated_at: datetime - - -class PredefinedEntryDocumentFingerprintEntry(BaseModel): - id: str - - created_at: datetime - - enabled: bool - - name: str - - type: Literal["document_fingerprint"] - - updated_at: datetime - - -class PredefinedEntryWordListEntry(BaseModel): - id: str - - created_at: datetime - - enabled: bool - - name: str - - type: Literal["word_list"] - - updated_at: datetime - - word_list: object - - profile_id: Optional[str] = None - - -PredefinedEntry: TypeAlias = Union[ - PredefinedEntryCustomEntry, - PredefinedEntryPredefinedEntry, - PredefinedEntryIntegrationEntry, - PredefinedEntryExactDataEntry, - PredefinedEntryDocumentFingerprintEntry, - PredefinedEntryWordListEntry, -] - - -class Predefined(BaseModel): - id: str - """The id of the predefined profile (uuid).""" - - allowed_match_count: int - - entries: List[PredefinedEntry] - - name: str - """The name of the predefined profile.""" - - type: Literal["predefined"] - - ai_context_enabled: Optional[bool] = None - - confidence_threshold: Optional[Literal["low", "medium", "high", "very_high"]] = None - - context_awareness: Optional[ContextAwareness] = None - """ - Scan the context of predefined entries to only return matches surrounded by - keywords. - """ - - ocr_enabled: Optional[bool] = None - - open_access: Optional[bool] = None - """Whether this profile can be accessed by anyone.""" - - -class IntegrationEntryCustomEntry(BaseModel): - id: str - - created_at: datetime - - enabled: bool - - name: str - - pattern: Pattern - - type: Literal["custom"] - - updated_at: datetime - - description: Optional[str] = None - - profile_id: Optional[str] = None - - -class IntegrationEntryPredefinedEntryConfidence(BaseModel): - ai_context_available: bool - """Indicates whether this entry has AI remote service validation.""" - - available: bool - """ - Indicates whether this entry has any form of validation that is not an AI remote - service. - """ - - -class IntegrationEntryPredefinedEntryVariant(BaseModel): - topic_type: Literal["Intent", "Content"] - - type: Literal["PromptTopic"] - - description: Optional[str] = None - - -class IntegrationEntryPredefinedEntry(BaseModel): - id: str - - confidence: IntegrationEntryPredefinedEntryConfidence - - enabled: bool - - name: str - - type: Literal["predefined"] - - profile_id: Optional[str] = None - - variant: Optional[IntegrationEntryPredefinedEntryVariant] = None - - -class IntegrationEntryIntegrationEntry(BaseModel): - id: str - - created_at: datetime - - enabled: bool - - name: str - - type: Literal["integration"] - - updated_at: datetime - - profile_id: Optional[str] = None - - -class IntegrationEntryExactDataEntry(BaseModel): - id: str - - case_sensitive: bool - """ - Only applies to custom word lists. Determines if the words should be matched in - a case-sensitive manner Cannot be set to false if secret is true - """ - - created_at: datetime - - enabled: bool - - name: str - - secret: bool - - type: Literal["exact_data"] - - updated_at: datetime - - -class IntegrationEntryDocumentFingerprintEntry(BaseModel): - id: str - - created_at: datetime - - enabled: bool - - name: str - - type: Literal["document_fingerprint"] - - updated_at: datetime - - -class IntegrationEntryWordListEntry(BaseModel): - id: str - - created_at: datetime - - enabled: bool - - name: str - - type: Literal["word_list"] - - updated_at: datetime - - word_list: object - - profile_id: Optional[str] = None - - -IntegrationEntry: TypeAlias = Union[ - IntegrationEntryCustomEntry, - IntegrationEntryPredefinedEntry, - IntegrationEntryIntegrationEntry, - IntegrationEntryExactDataEntry, - IntegrationEntryDocumentFingerprintEntry, - IntegrationEntryWordListEntry, -] - - -class IntegrationSharedEntryCustomEntry(BaseModel): - id: str - - created_at: datetime - - enabled: bool - - name: str - - pattern: Pattern - - type: Literal["custom"] - - updated_at: datetime - - description: Optional[str] = None - - profile_id: Optional[str] = None - - -class IntegrationSharedEntryPredefinedEntryConfidence(BaseModel): - ai_context_available: bool - """Indicates whether this entry has AI remote service validation.""" - - available: bool - """ - Indicates whether this entry has any form of validation that is not an AI remote - service. - """ - - -class IntegrationSharedEntryPredefinedEntryVariant(BaseModel): - topic_type: Literal["Intent", "Content"] - - type: Literal["PromptTopic"] - - description: Optional[str] = None - - -class IntegrationSharedEntryPredefinedEntry(BaseModel): - id: str - - confidence: IntegrationSharedEntryPredefinedEntryConfidence - - enabled: bool - - name: str - - type: Literal["predefined"] - - profile_id: Optional[str] = None - - variant: Optional[IntegrationSharedEntryPredefinedEntryVariant] = None - - -class IntegrationSharedEntryIntegrationEntry(BaseModel): - id: str - - created_at: datetime - - enabled: bool - - name: str - - type: Literal["integration"] - - updated_at: datetime - - profile_id: Optional[str] = None - - -class IntegrationSharedEntryExactDataEntry(BaseModel): - id: str - - case_sensitive: bool - """ - Only applies to custom word lists. Determines if the words should be matched in - a case-sensitive manner Cannot be set to false if secret is true - """ - - created_at: datetime - - enabled: bool - - name: str - - secret: bool - - type: Literal["exact_data"] - - updated_at: datetime - - -class IntegrationSharedEntryDocumentFingerprintEntry(BaseModel): - id: str - - created_at: datetime - - enabled: bool - - name: str - - type: Literal["document_fingerprint"] - - updated_at: datetime - - -class IntegrationSharedEntryWordListEntry(BaseModel): - id: str - - created_at: datetime - - enabled: bool - - name: str - - type: Literal["word_list"] - - updated_at: datetime - - word_list: object - - profile_id: Optional[str] = None - - -IntegrationSharedEntry: TypeAlias = Union[ - IntegrationSharedEntryCustomEntry, - IntegrationSharedEntryPredefinedEntry, - IntegrationSharedEntryIntegrationEntry, - IntegrationSharedEntryExactDataEntry, - IntegrationSharedEntryDocumentFingerprintEntry, - IntegrationSharedEntryWordListEntry, -] - - -class Integration(BaseModel): - id: str - - created_at: datetime - - entries: List[IntegrationEntry] - - name: str - - shared_entries: List[IntegrationSharedEntry] - - type: Literal["integration"] - - updated_at: datetime - - description: Optional[str] = None - """The description of the profile.""" - - -ProfileGetResponse: TypeAlias = Annotated[Union[Custom, Predefined, Integration], PropertyInfo(discriminator="type")] diff --git a/src/cloudflare/types/zero_trust/dlp/profiles/__init__.py b/src/cloudflare/types/zero_trust/dlp/profiles/__init__.py index 79e08403dc0..b5a089b62b7 100644 --- a/src/cloudflare/types/zero_trust/dlp/profiles/__init__.py +++ b/src/cloudflare/types/zero_trust/dlp/profiles/__init__.py @@ -4,11 +4,7 @@ from .pattern import Pattern as Pattern from .pattern_param import PatternParam as PatternParam -from .custom_get_response import CustomGetResponse as CustomGetResponse +from .predefined_profile import PredefinedProfile as PredefinedProfile from .custom_create_params import CustomCreateParams as CustomCreateParams from .custom_update_params import CustomUpdateParams as CustomUpdateParams -from .custom_create_response import CustomCreateResponse as CustomCreateResponse -from .custom_update_response import CustomUpdateResponse as CustomUpdateResponse -from .predefined_get_response import PredefinedGetResponse as PredefinedGetResponse from .predefined_update_params import PredefinedUpdateParams as PredefinedUpdateParams -from .predefined_update_response import PredefinedUpdateResponse as PredefinedUpdateResponse diff --git a/src/cloudflare/types/zero_trust/dlp/profiles/custom_create_response.py b/src/cloudflare/types/zero_trust/dlp/profiles/custom_create_response.py deleted file mode 100644 index 5dfc1701c04..00000000000 --- a/src/cloudflare/types/zero_trust/dlp/profiles/custom_create_response.py +++ /dev/null @@ -1,826 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Union, Optional -from datetime import datetime -from typing_extensions import Literal, Annotated, TypeAlias - -from .pattern import Pattern -from ....._utils import PropertyInfo -from ....._models import BaseModel -from ..context_awareness import ContextAwareness - -__all__ = [ - "CustomCreateResponse", - "Custom", - "CustomEntry", - "CustomEntryCustomEntry", - "CustomEntryPredefinedEntry", - "CustomEntryPredefinedEntryConfidence", - "CustomEntryPredefinedEntryVariant", - "CustomEntryIntegrationEntry", - "CustomEntryExactDataEntry", - "CustomEntryDocumentFingerprintEntry", - "CustomEntryWordListEntry", - "CustomSharedEntry", - "CustomSharedEntryCustomEntry", - "CustomSharedEntryPredefinedEntry", - "CustomSharedEntryPredefinedEntryConfidence", - "CustomSharedEntryPredefinedEntryVariant", - "CustomSharedEntryIntegrationEntry", - "CustomSharedEntryExactDataEntry", - "CustomSharedEntryDocumentFingerprintEntry", - "CustomSharedEntryWordListEntry", - "Predefined", - "PredefinedEntry", - "PredefinedEntryCustomEntry", - "PredefinedEntryPredefinedEntry", - "PredefinedEntryPredefinedEntryConfidence", - "PredefinedEntryPredefinedEntryVariant", - "PredefinedEntryIntegrationEntry", - "PredefinedEntryExactDataEntry", - "PredefinedEntryDocumentFingerprintEntry", - "PredefinedEntryWordListEntry", - "Integration", - "IntegrationEntry", - "IntegrationEntryCustomEntry", - "IntegrationEntryPredefinedEntry", - "IntegrationEntryPredefinedEntryConfidence", - "IntegrationEntryPredefinedEntryVariant", - "IntegrationEntryIntegrationEntry", - "IntegrationEntryExactDataEntry", - "IntegrationEntryDocumentFingerprintEntry", - "IntegrationEntryWordListEntry", - "IntegrationSharedEntry", - "IntegrationSharedEntryCustomEntry", - "IntegrationSharedEntryPredefinedEntry", - "IntegrationSharedEntryPredefinedEntryConfidence", - "IntegrationSharedEntryPredefinedEntryVariant", - "IntegrationSharedEntryIntegrationEntry", - "IntegrationSharedEntryExactDataEntry", - "IntegrationSharedEntryDocumentFingerprintEntry", - "IntegrationSharedEntryWordListEntry", -] - - -class CustomEntryCustomEntry(BaseModel): - id: str - - created_at: datetime - - enabled: bool - - name: str - - pattern: Pattern - - type: Literal["custom"] - - updated_at: datetime - - description: Optional[str] = None - - profile_id: Optional[str] = None - - -class CustomEntryPredefinedEntryConfidence(BaseModel): - ai_context_available: bool - """Indicates whether this entry has AI remote service validation.""" - - available: bool - """ - Indicates whether this entry has any form of validation that is not an AI remote - service. - """ - - -class CustomEntryPredefinedEntryVariant(BaseModel): - topic_type: Literal["Intent", "Content"] - - type: Literal["PromptTopic"] - - description: Optional[str] = None - - -class CustomEntryPredefinedEntry(BaseModel): - id: str - - confidence: CustomEntryPredefinedEntryConfidence - - enabled: bool - - name: str - - type: Literal["predefined"] - - profile_id: Optional[str] = None - - variant: Optional[CustomEntryPredefinedEntryVariant] = None - - -class CustomEntryIntegrationEntry(BaseModel): - id: str - - created_at: datetime - - enabled: bool - - name: str - - type: Literal["integration"] - - updated_at: datetime - - profile_id: Optional[str] = None - - -class CustomEntryExactDataEntry(BaseModel): - id: str - - case_sensitive: bool - """ - Only applies to custom word lists. Determines if the words should be matched in - a case-sensitive manner Cannot be set to false if secret is true - """ - - created_at: datetime - - enabled: bool - - name: str - - secret: bool - - type: Literal["exact_data"] - - updated_at: datetime - - -class CustomEntryDocumentFingerprintEntry(BaseModel): - id: str - - created_at: datetime - - enabled: bool - - name: str - - type: Literal["document_fingerprint"] - - updated_at: datetime - - -class CustomEntryWordListEntry(BaseModel): - id: str - - created_at: datetime - - enabled: bool - - name: str - - type: Literal["word_list"] - - updated_at: datetime - - word_list: object - - profile_id: Optional[str] = None - - -CustomEntry: TypeAlias = Union[ - CustomEntryCustomEntry, - CustomEntryPredefinedEntry, - CustomEntryIntegrationEntry, - CustomEntryExactDataEntry, - CustomEntryDocumentFingerprintEntry, - CustomEntryWordListEntry, -] - - -class CustomSharedEntryCustomEntry(BaseModel): - id: str - - created_at: datetime - - enabled: bool - - name: str - - pattern: Pattern - - type: Literal["custom"] - - updated_at: datetime - - description: Optional[str] = None - - profile_id: Optional[str] = None - - -class CustomSharedEntryPredefinedEntryConfidence(BaseModel): - ai_context_available: bool - """Indicates whether this entry has AI remote service validation.""" - - available: bool - """ - Indicates whether this entry has any form of validation that is not an AI remote - service. - """ - - -class CustomSharedEntryPredefinedEntryVariant(BaseModel): - topic_type: Literal["Intent", "Content"] - - type: Literal["PromptTopic"] - - description: Optional[str] = None - - -class CustomSharedEntryPredefinedEntry(BaseModel): - id: str - - confidence: CustomSharedEntryPredefinedEntryConfidence - - enabled: bool - - name: str - - type: Literal["predefined"] - - profile_id: Optional[str] = None - - variant: Optional[CustomSharedEntryPredefinedEntryVariant] = None - - -class CustomSharedEntryIntegrationEntry(BaseModel): - id: str - - created_at: datetime - - enabled: bool - - name: str - - type: Literal["integration"] - - updated_at: datetime - - profile_id: Optional[str] = None - - -class CustomSharedEntryExactDataEntry(BaseModel): - id: str - - case_sensitive: bool - """ - Only applies to custom word lists. Determines if the words should be matched in - a case-sensitive manner Cannot be set to false if secret is true - """ - - created_at: datetime - - enabled: bool - - name: str - - secret: bool - - type: Literal["exact_data"] - - updated_at: datetime - - -class CustomSharedEntryDocumentFingerprintEntry(BaseModel): - id: str - - created_at: datetime - - enabled: bool - - name: str - - type: Literal["document_fingerprint"] - - updated_at: datetime - - -class CustomSharedEntryWordListEntry(BaseModel): - id: str - - created_at: datetime - - enabled: bool - - name: str - - type: Literal["word_list"] - - updated_at: datetime - - word_list: object - - profile_id: Optional[str] = None - - -CustomSharedEntry: TypeAlias = Union[ - CustomSharedEntryCustomEntry, - CustomSharedEntryPredefinedEntry, - CustomSharedEntryIntegrationEntry, - CustomSharedEntryExactDataEntry, - CustomSharedEntryDocumentFingerprintEntry, - CustomSharedEntryWordListEntry, -] - - -class Custom(BaseModel): - id: str - """The id of the profile (uuid).""" - - allowed_match_count: int - """Related DLP policies will trigger when the match count exceeds the number set.""" - - created_at: datetime - """When the profile was created.""" - - name: str - """The name of the profile.""" - - ocr_enabled: bool - - type: Literal["custom"] - - updated_at: datetime - """When the profile was lasted updated.""" - - ai_context_enabled: Optional[bool] = None - - confidence_threshold: Optional[Literal["low", "medium", "high", "very_high"]] = None - - context_awareness: Optional[ContextAwareness] = None - """ - Scan the context of predefined entries to only return matches surrounded by - keywords. - """ - - description: Optional[str] = None - """The description of the profile.""" - - entries: Optional[List[CustomEntry]] = None - - shared_entries: Optional[List[CustomSharedEntry]] = None - - -class PredefinedEntryCustomEntry(BaseModel): - id: str - - created_at: datetime - - enabled: bool - - name: str - - pattern: Pattern - - type: Literal["custom"] - - updated_at: datetime - - description: Optional[str] = None - - profile_id: Optional[str] = None - - -class PredefinedEntryPredefinedEntryConfidence(BaseModel): - ai_context_available: bool - """Indicates whether this entry has AI remote service validation.""" - - available: bool - """ - Indicates whether this entry has any form of validation that is not an AI remote - service. - """ - - -class PredefinedEntryPredefinedEntryVariant(BaseModel): - topic_type: Literal["Intent", "Content"] - - type: Literal["PromptTopic"] - - description: Optional[str] = None - - -class PredefinedEntryPredefinedEntry(BaseModel): - id: str - - confidence: PredefinedEntryPredefinedEntryConfidence - - enabled: bool - - name: str - - type: Literal["predefined"] - - profile_id: Optional[str] = None - - variant: Optional[PredefinedEntryPredefinedEntryVariant] = None - - -class PredefinedEntryIntegrationEntry(BaseModel): - id: str - - created_at: datetime - - enabled: bool - - name: str - - type: Literal["integration"] - - updated_at: datetime - - profile_id: Optional[str] = None - - -class PredefinedEntryExactDataEntry(BaseModel): - id: str - - case_sensitive: bool - """ - Only applies to custom word lists. Determines if the words should be matched in - a case-sensitive manner Cannot be set to false if secret is true - """ - - created_at: datetime - - enabled: bool - - name: str - - secret: bool - - type: Literal["exact_data"] - - updated_at: datetime - - -class PredefinedEntryDocumentFingerprintEntry(BaseModel): - id: str - - created_at: datetime - - enabled: bool - - name: str - - type: Literal["document_fingerprint"] - - updated_at: datetime - - -class PredefinedEntryWordListEntry(BaseModel): - id: str - - created_at: datetime - - enabled: bool - - name: str - - type: Literal["word_list"] - - updated_at: datetime - - word_list: object - - profile_id: Optional[str] = None - - -PredefinedEntry: TypeAlias = Union[ - PredefinedEntryCustomEntry, - PredefinedEntryPredefinedEntry, - PredefinedEntryIntegrationEntry, - PredefinedEntryExactDataEntry, - PredefinedEntryDocumentFingerprintEntry, - PredefinedEntryWordListEntry, -] - - -class Predefined(BaseModel): - id: str - """The id of the predefined profile (uuid).""" - - allowed_match_count: int - - entries: List[PredefinedEntry] - - name: str - """The name of the predefined profile.""" - - type: Literal["predefined"] - - ai_context_enabled: Optional[bool] = None - - confidence_threshold: Optional[Literal["low", "medium", "high", "very_high"]] = None - - context_awareness: Optional[ContextAwareness] = None - """ - Scan the context of predefined entries to only return matches surrounded by - keywords. - """ - - ocr_enabled: Optional[bool] = None - - open_access: Optional[bool] = None - """Whether this profile can be accessed by anyone.""" - - -class IntegrationEntryCustomEntry(BaseModel): - id: str - - created_at: datetime - - enabled: bool - - name: str - - pattern: Pattern - - type: Literal["custom"] - - updated_at: datetime - - description: Optional[str] = None - - profile_id: Optional[str] = None - - -class IntegrationEntryPredefinedEntryConfidence(BaseModel): - ai_context_available: bool - """Indicates whether this entry has AI remote service validation.""" - - available: bool - """ - Indicates whether this entry has any form of validation that is not an AI remote - service. - """ - - -class IntegrationEntryPredefinedEntryVariant(BaseModel): - topic_type: Literal["Intent", "Content"] - - type: Literal["PromptTopic"] - - description: Optional[str] = None - - -class IntegrationEntryPredefinedEntry(BaseModel): - id: str - - confidence: IntegrationEntryPredefinedEntryConfidence - - enabled: bool - - name: str - - type: Literal["predefined"] - - profile_id: Optional[str] = None - - variant: Optional[IntegrationEntryPredefinedEntryVariant] = None - - -class IntegrationEntryIntegrationEntry(BaseModel): - id: str - - created_at: datetime - - enabled: bool - - name: str - - type: Literal["integration"] - - updated_at: datetime - - profile_id: Optional[str] = None - - -class IntegrationEntryExactDataEntry(BaseModel): - id: str - - case_sensitive: bool - """ - Only applies to custom word lists. Determines if the words should be matched in - a case-sensitive manner Cannot be set to false if secret is true - """ - - created_at: datetime - - enabled: bool - - name: str - - secret: bool - - type: Literal["exact_data"] - - updated_at: datetime - - -class IntegrationEntryDocumentFingerprintEntry(BaseModel): - id: str - - created_at: datetime - - enabled: bool - - name: str - - type: Literal["document_fingerprint"] - - updated_at: datetime - - -class IntegrationEntryWordListEntry(BaseModel): - id: str - - created_at: datetime - - enabled: bool - - name: str - - type: Literal["word_list"] - - updated_at: datetime - - word_list: object - - profile_id: Optional[str] = None - - -IntegrationEntry: TypeAlias = Union[ - IntegrationEntryCustomEntry, - IntegrationEntryPredefinedEntry, - IntegrationEntryIntegrationEntry, - IntegrationEntryExactDataEntry, - IntegrationEntryDocumentFingerprintEntry, - IntegrationEntryWordListEntry, -] - - -class IntegrationSharedEntryCustomEntry(BaseModel): - id: str - - created_at: datetime - - enabled: bool - - name: str - - pattern: Pattern - - type: Literal["custom"] - - updated_at: datetime - - description: Optional[str] = None - - profile_id: Optional[str] = None - - -class IntegrationSharedEntryPredefinedEntryConfidence(BaseModel): - ai_context_available: bool - """Indicates whether this entry has AI remote service validation.""" - - available: bool - """ - Indicates whether this entry has any form of validation that is not an AI remote - service. - """ - - -class IntegrationSharedEntryPredefinedEntryVariant(BaseModel): - topic_type: Literal["Intent", "Content"] - - type: Literal["PromptTopic"] - - description: Optional[str] = None - - -class IntegrationSharedEntryPredefinedEntry(BaseModel): - id: str - - confidence: IntegrationSharedEntryPredefinedEntryConfidence - - enabled: bool - - name: str - - type: Literal["predefined"] - - profile_id: Optional[str] = None - - variant: Optional[IntegrationSharedEntryPredefinedEntryVariant] = None - - -class IntegrationSharedEntryIntegrationEntry(BaseModel): - id: str - - created_at: datetime - - enabled: bool - - name: str - - type: Literal["integration"] - - updated_at: datetime - - profile_id: Optional[str] = None - - -class IntegrationSharedEntryExactDataEntry(BaseModel): - id: str - - case_sensitive: bool - """ - Only applies to custom word lists. Determines if the words should be matched in - a case-sensitive manner Cannot be set to false if secret is true - """ - - created_at: datetime - - enabled: bool - - name: str - - secret: bool - - type: Literal["exact_data"] - - updated_at: datetime - - -class IntegrationSharedEntryDocumentFingerprintEntry(BaseModel): - id: str - - created_at: datetime - - enabled: bool - - name: str - - type: Literal["document_fingerprint"] - - updated_at: datetime - - -class IntegrationSharedEntryWordListEntry(BaseModel): - id: str - - created_at: datetime - - enabled: bool - - name: str - - type: Literal["word_list"] - - updated_at: datetime - - word_list: object - - profile_id: Optional[str] = None - - -IntegrationSharedEntry: TypeAlias = Union[ - IntegrationSharedEntryCustomEntry, - IntegrationSharedEntryPredefinedEntry, - IntegrationSharedEntryIntegrationEntry, - IntegrationSharedEntryExactDataEntry, - IntegrationSharedEntryDocumentFingerprintEntry, - IntegrationSharedEntryWordListEntry, -] - - -class Integration(BaseModel): - id: str - - created_at: datetime - - entries: List[IntegrationEntry] - - name: str - - shared_entries: List[IntegrationSharedEntry] - - type: Literal["integration"] - - updated_at: datetime - - description: Optional[str] = None - """The description of the profile.""" - - -CustomCreateResponse: TypeAlias = Annotated[Union[Custom, Predefined, Integration], PropertyInfo(discriminator="type")] diff --git a/src/cloudflare/types/zero_trust/dlp/profiles/custom_get_response.py b/src/cloudflare/types/zero_trust/dlp/profiles/custom_get_response.py deleted file mode 100644 index bd9fc1744f3..00000000000 --- a/src/cloudflare/types/zero_trust/dlp/profiles/custom_get_response.py +++ /dev/null @@ -1,826 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Union, Optional -from datetime import datetime -from typing_extensions import Literal, Annotated, TypeAlias - -from .pattern import Pattern -from ....._utils import PropertyInfo -from ....._models import BaseModel -from ..context_awareness import ContextAwareness - -__all__ = [ - "CustomGetResponse", - "Custom", - "CustomEntry", - "CustomEntryCustomEntry", - "CustomEntryPredefinedEntry", - "CustomEntryPredefinedEntryConfidence", - "CustomEntryPredefinedEntryVariant", - "CustomEntryIntegrationEntry", - "CustomEntryExactDataEntry", - "CustomEntryDocumentFingerprintEntry", - "CustomEntryWordListEntry", - "CustomSharedEntry", - "CustomSharedEntryCustomEntry", - "CustomSharedEntryPredefinedEntry", - "CustomSharedEntryPredefinedEntryConfidence", - "CustomSharedEntryPredefinedEntryVariant", - "CustomSharedEntryIntegrationEntry", - "CustomSharedEntryExactDataEntry", - "CustomSharedEntryDocumentFingerprintEntry", - "CustomSharedEntryWordListEntry", - "Predefined", - "PredefinedEntry", - "PredefinedEntryCustomEntry", - "PredefinedEntryPredefinedEntry", - "PredefinedEntryPredefinedEntryConfidence", - "PredefinedEntryPredefinedEntryVariant", - "PredefinedEntryIntegrationEntry", - "PredefinedEntryExactDataEntry", - "PredefinedEntryDocumentFingerprintEntry", - "PredefinedEntryWordListEntry", - "Integration", - "IntegrationEntry", - "IntegrationEntryCustomEntry", - "IntegrationEntryPredefinedEntry", - "IntegrationEntryPredefinedEntryConfidence", - "IntegrationEntryPredefinedEntryVariant", - "IntegrationEntryIntegrationEntry", - "IntegrationEntryExactDataEntry", - "IntegrationEntryDocumentFingerprintEntry", - "IntegrationEntryWordListEntry", - "IntegrationSharedEntry", - "IntegrationSharedEntryCustomEntry", - "IntegrationSharedEntryPredefinedEntry", - "IntegrationSharedEntryPredefinedEntryConfidence", - "IntegrationSharedEntryPredefinedEntryVariant", - "IntegrationSharedEntryIntegrationEntry", - "IntegrationSharedEntryExactDataEntry", - "IntegrationSharedEntryDocumentFingerprintEntry", - "IntegrationSharedEntryWordListEntry", -] - - -class CustomEntryCustomEntry(BaseModel): - id: str - - created_at: datetime - - enabled: bool - - name: str - - pattern: Pattern - - type: Literal["custom"] - - updated_at: datetime - - description: Optional[str] = None - - profile_id: Optional[str] = None - - -class CustomEntryPredefinedEntryConfidence(BaseModel): - ai_context_available: bool - """Indicates whether this entry has AI remote service validation.""" - - available: bool - """ - Indicates whether this entry has any form of validation that is not an AI remote - service. - """ - - -class CustomEntryPredefinedEntryVariant(BaseModel): - topic_type: Literal["Intent", "Content"] - - type: Literal["PromptTopic"] - - description: Optional[str] = None - - -class CustomEntryPredefinedEntry(BaseModel): - id: str - - confidence: CustomEntryPredefinedEntryConfidence - - enabled: bool - - name: str - - type: Literal["predefined"] - - profile_id: Optional[str] = None - - variant: Optional[CustomEntryPredefinedEntryVariant] = None - - -class CustomEntryIntegrationEntry(BaseModel): - id: str - - created_at: datetime - - enabled: bool - - name: str - - type: Literal["integration"] - - updated_at: datetime - - profile_id: Optional[str] = None - - -class CustomEntryExactDataEntry(BaseModel): - id: str - - case_sensitive: bool - """ - Only applies to custom word lists. Determines if the words should be matched in - a case-sensitive manner Cannot be set to false if secret is true - """ - - created_at: datetime - - enabled: bool - - name: str - - secret: bool - - type: Literal["exact_data"] - - updated_at: datetime - - -class CustomEntryDocumentFingerprintEntry(BaseModel): - id: str - - created_at: datetime - - enabled: bool - - name: str - - type: Literal["document_fingerprint"] - - updated_at: datetime - - -class CustomEntryWordListEntry(BaseModel): - id: str - - created_at: datetime - - enabled: bool - - name: str - - type: Literal["word_list"] - - updated_at: datetime - - word_list: object - - profile_id: Optional[str] = None - - -CustomEntry: TypeAlias = Union[ - CustomEntryCustomEntry, - CustomEntryPredefinedEntry, - CustomEntryIntegrationEntry, - CustomEntryExactDataEntry, - CustomEntryDocumentFingerprintEntry, - CustomEntryWordListEntry, -] - - -class CustomSharedEntryCustomEntry(BaseModel): - id: str - - created_at: datetime - - enabled: bool - - name: str - - pattern: Pattern - - type: Literal["custom"] - - updated_at: datetime - - description: Optional[str] = None - - profile_id: Optional[str] = None - - -class CustomSharedEntryPredefinedEntryConfidence(BaseModel): - ai_context_available: bool - """Indicates whether this entry has AI remote service validation.""" - - available: bool - """ - Indicates whether this entry has any form of validation that is not an AI remote - service. - """ - - -class CustomSharedEntryPredefinedEntryVariant(BaseModel): - topic_type: Literal["Intent", "Content"] - - type: Literal["PromptTopic"] - - description: Optional[str] = None - - -class CustomSharedEntryPredefinedEntry(BaseModel): - id: str - - confidence: CustomSharedEntryPredefinedEntryConfidence - - enabled: bool - - name: str - - type: Literal["predefined"] - - profile_id: Optional[str] = None - - variant: Optional[CustomSharedEntryPredefinedEntryVariant] = None - - -class CustomSharedEntryIntegrationEntry(BaseModel): - id: str - - created_at: datetime - - enabled: bool - - name: str - - type: Literal["integration"] - - updated_at: datetime - - profile_id: Optional[str] = None - - -class CustomSharedEntryExactDataEntry(BaseModel): - id: str - - case_sensitive: bool - """ - Only applies to custom word lists. Determines if the words should be matched in - a case-sensitive manner Cannot be set to false if secret is true - """ - - created_at: datetime - - enabled: bool - - name: str - - secret: bool - - type: Literal["exact_data"] - - updated_at: datetime - - -class CustomSharedEntryDocumentFingerprintEntry(BaseModel): - id: str - - created_at: datetime - - enabled: bool - - name: str - - type: Literal["document_fingerprint"] - - updated_at: datetime - - -class CustomSharedEntryWordListEntry(BaseModel): - id: str - - created_at: datetime - - enabled: bool - - name: str - - type: Literal["word_list"] - - updated_at: datetime - - word_list: object - - profile_id: Optional[str] = None - - -CustomSharedEntry: TypeAlias = Union[ - CustomSharedEntryCustomEntry, - CustomSharedEntryPredefinedEntry, - CustomSharedEntryIntegrationEntry, - CustomSharedEntryExactDataEntry, - CustomSharedEntryDocumentFingerprintEntry, - CustomSharedEntryWordListEntry, -] - - -class Custom(BaseModel): - id: str - """The id of the profile (uuid).""" - - allowed_match_count: int - """Related DLP policies will trigger when the match count exceeds the number set.""" - - created_at: datetime - """When the profile was created.""" - - name: str - """The name of the profile.""" - - ocr_enabled: bool - - type: Literal["custom"] - - updated_at: datetime - """When the profile was lasted updated.""" - - ai_context_enabled: Optional[bool] = None - - confidence_threshold: Optional[Literal["low", "medium", "high", "very_high"]] = None - - context_awareness: Optional[ContextAwareness] = None - """ - Scan the context of predefined entries to only return matches surrounded by - keywords. - """ - - description: Optional[str] = None - """The description of the profile.""" - - entries: Optional[List[CustomEntry]] = None - - shared_entries: Optional[List[CustomSharedEntry]] = None - - -class PredefinedEntryCustomEntry(BaseModel): - id: str - - created_at: datetime - - enabled: bool - - name: str - - pattern: Pattern - - type: Literal["custom"] - - updated_at: datetime - - description: Optional[str] = None - - profile_id: Optional[str] = None - - -class PredefinedEntryPredefinedEntryConfidence(BaseModel): - ai_context_available: bool - """Indicates whether this entry has AI remote service validation.""" - - available: bool - """ - Indicates whether this entry has any form of validation that is not an AI remote - service. - """ - - -class PredefinedEntryPredefinedEntryVariant(BaseModel): - topic_type: Literal["Intent", "Content"] - - type: Literal["PromptTopic"] - - description: Optional[str] = None - - -class PredefinedEntryPredefinedEntry(BaseModel): - id: str - - confidence: PredefinedEntryPredefinedEntryConfidence - - enabled: bool - - name: str - - type: Literal["predefined"] - - profile_id: Optional[str] = None - - variant: Optional[PredefinedEntryPredefinedEntryVariant] = None - - -class PredefinedEntryIntegrationEntry(BaseModel): - id: str - - created_at: datetime - - enabled: bool - - name: str - - type: Literal["integration"] - - updated_at: datetime - - profile_id: Optional[str] = None - - -class PredefinedEntryExactDataEntry(BaseModel): - id: str - - case_sensitive: bool - """ - Only applies to custom word lists. Determines if the words should be matched in - a case-sensitive manner Cannot be set to false if secret is true - """ - - created_at: datetime - - enabled: bool - - name: str - - secret: bool - - type: Literal["exact_data"] - - updated_at: datetime - - -class PredefinedEntryDocumentFingerprintEntry(BaseModel): - id: str - - created_at: datetime - - enabled: bool - - name: str - - type: Literal["document_fingerprint"] - - updated_at: datetime - - -class PredefinedEntryWordListEntry(BaseModel): - id: str - - created_at: datetime - - enabled: bool - - name: str - - type: Literal["word_list"] - - updated_at: datetime - - word_list: object - - profile_id: Optional[str] = None - - -PredefinedEntry: TypeAlias = Union[ - PredefinedEntryCustomEntry, - PredefinedEntryPredefinedEntry, - PredefinedEntryIntegrationEntry, - PredefinedEntryExactDataEntry, - PredefinedEntryDocumentFingerprintEntry, - PredefinedEntryWordListEntry, -] - - -class Predefined(BaseModel): - id: str - """The id of the predefined profile (uuid).""" - - allowed_match_count: int - - entries: List[PredefinedEntry] - - name: str - """The name of the predefined profile.""" - - type: Literal["predefined"] - - ai_context_enabled: Optional[bool] = None - - confidence_threshold: Optional[Literal["low", "medium", "high", "very_high"]] = None - - context_awareness: Optional[ContextAwareness] = None - """ - Scan the context of predefined entries to only return matches surrounded by - keywords. - """ - - ocr_enabled: Optional[bool] = None - - open_access: Optional[bool] = None - """Whether this profile can be accessed by anyone.""" - - -class IntegrationEntryCustomEntry(BaseModel): - id: str - - created_at: datetime - - enabled: bool - - name: str - - pattern: Pattern - - type: Literal["custom"] - - updated_at: datetime - - description: Optional[str] = None - - profile_id: Optional[str] = None - - -class IntegrationEntryPredefinedEntryConfidence(BaseModel): - ai_context_available: bool - """Indicates whether this entry has AI remote service validation.""" - - available: bool - """ - Indicates whether this entry has any form of validation that is not an AI remote - service. - """ - - -class IntegrationEntryPredefinedEntryVariant(BaseModel): - topic_type: Literal["Intent", "Content"] - - type: Literal["PromptTopic"] - - description: Optional[str] = None - - -class IntegrationEntryPredefinedEntry(BaseModel): - id: str - - confidence: IntegrationEntryPredefinedEntryConfidence - - enabled: bool - - name: str - - type: Literal["predefined"] - - profile_id: Optional[str] = None - - variant: Optional[IntegrationEntryPredefinedEntryVariant] = None - - -class IntegrationEntryIntegrationEntry(BaseModel): - id: str - - created_at: datetime - - enabled: bool - - name: str - - type: Literal["integration"] - - updated_at: datetime - - profile_id: Optional[str] = None - - -class IntegrationEntryExactDataEntry(BaseModel): - id: str - - case_sensitive: bool - """ - Only applies to custom word lists. Determines if the words should be matched in - a case-sensitive manner Cannot be set to false if secret is true - """ - - created_at: datetime - - enabled: bool - - name: str - - secret: bool - - type: Literal["exact_data"] - - updated_at: datetime - - -class IntegrationEntryDocumentFingerprintEntry(BaseModel): - id: str - - created_at: datetime - - enabled: bool - - name: str - - type: Literal["document_fingerprint"] - - updated_at: datetime - - -class IntegrationEntryWordListEntry(BaseModel): - id: str - - created_at: datetime - - enabled: bool - - name: str - - type: Literal["word_list"] - - updated_at: datetime - - word_list: object - - profile_id: Optional[str] = None - - -IntegrationEntry: TypeAlias = Union[ - IntegrationEntryCustomEntry, - IntegrationEntryPredefinedEntry, - IntegrationEntryIntegrationEntry, - IntegrationEntryExactDataEntry, - IntegrationEntryDocumentFingerprintEntry, - IntegrationEntryWordListEntry, -] - - -class IntegrationSharedEntryCustomEntry(BaseModel): - id: str - - created_at: datetime - - enabled: bool - - name: str - - pattern: Pattern - - type: Literal["custom"] - - updated_at: datetime - - description: Optional[str] = None - - profile_id: Optional[str] = None - - -class IntegrationSharedEntryPredefinedEntryConfidence(BaseModel): - ai_context_available: bool - """Indicates whether this entry has AI remote service validation.""" - - available: bool - """ - Indicates whether this entry has any form of validation that is not an AI remote - service. - """ - - -class IntegrationSharedEntryPredefinedEntryVariant(BaseModel): - topic_type: Literal["Intent", "Content"] - - type: Literal["PromptTopic"] - - description: Optional[str] = None - - -class IntegrationSharedEntryPredefinedEntry(BaseModel): - id: str - - confidence: IntegrationSharedEntryPredefinedEntryConfidence - - enabled: bool - - name: str - - type: Literal["predefined"] - - profile_id: Optional[str] = None - - variant: Optional[IntegrationSharedEntryPredefinedEntryVariant] = None - - -class IntegrationSharedEntryIntegrationEntry(BaseModel): - id: str - - created_at: datetime - - enabled: bool - - name: str - - type: Literal["integration"] - - updated_at: datetime - - profile_id: Optional[str] = None - - -class IntegrationSharedEntryExactDataEntry(BaseModel): - id: str - - case_sensitive: bool - """ - Only applies to custom word lists. Determines if the words should be matched in - a case-sensitive manner Cannot be set to false if secret is true - """ - - created_at: datetime - - enabled: bool - - name: str - - secret: bool - - type: Literal["exact_data"] - - updated_at: datetime - - -class IntegrationSharedEntryDocumentFingerprintEntry(BaseModel): - id: str - - created_at: datetime - - enabled: bool - - name: str - - type: Literal["document_fingerprint"] - - updated_at: datetime - - -class IntegrationSharedEntryWordListEntry(BaseModel): - id: str - - created_at: datetime - - enabled: bool - - name: str - - type: Literal["word_list"] - - updated_at: datetime - - word_list: object - - profile_id: Optional[str] = None - - -IntegrationSharedEntry: TypeAlias = Union[ - IntegrationSharedEntryCustomEntry, - IntegrationSharedEntryPredefinedEntry, - IntegrationSharedEntryIntegrationEntry, - IntegrationSharedEntryExactDataEntry, - IntegrationSharedEntryDocumentFingerprintEntry, - IntegrationSharedEntryWordListEntry, -] - - -class Integration(BaseModel): - id: str - - created_at: datetime - - entries: List[IntegrationEntry] - - name: str - - shared_entries: List[IntegrationSharedEntry] - - type: Literal["integration"] - - updated_at: datetime - - description: Optional[str] = None - """The description of the profile.""" - - -CustomGetResponse: TypeAlias = Annotated[Union[Custom, Predefined, Integration], PropertyInfo(discriminator="type")] diff --git a/src/cloudflare/types/zero_trust/dlp/profiles/custom_update_response.py b/src/cloudflare/types/zero_trust/dlp/profiles/custom_update_response.py deleted file mode 100644 index 8d6f93a5487..00000000000 --- a/src/cloudflare/types/zero_trust/dlp/profiles/custom_update_response.py +++ /dev/null @@ -1,826 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Union, Optional -from datetime import datetime -from typing_extensions import Literal, Annotated, TypeAlias - -from .pattern import Pattern -from ....._utils import PropertyInfo -from ....._models import BaseModel -from ..context_awareness import ContextAwareness - -__all__ = [ - "CustomUpdateResponse", - "Custom", - "CustomEntry", - "CustomEntryCustomEntry", - "CustomEntryPredefinedEntry", - "CustomEntryPredefinedEntryConfidence", - "CustomEntryPredefinedEntryVariant", - "CustomEntryIntegrationEntry", - "CustomEntryExactDataEntry", - "CustomEntryDocumentFingerprintEntry", - "CustomEntryWordListEntry", - "CustomSharedEntry", - "CustomSharedEntryCustomEntry", - "CustomSharedEntryPredefinedEntry", - "CustomSharedEntryPredefinedEntryConfidence", - "CustomSharedEntryPredefinedEntryVariant", - "CustomSharedEntryIntegrationEntry", - "CustomSharedEntryExactDataEntry", - "CustomSharedEntryDocumentFingerprintEntry", - "CustomSharedEntryWordListEntry", - "Predefined", - "PredefinedEntry", - "PredefinedEntryCustomEntry", - "PredefinedEntryPredefinedEntry", - "PredefinedEntryPredefinedEntryConfidence", - "PredefinedEntryPredefinedEntryVariant", - "PredefinedEntryIntegrationEntry", - "PredefinedEntryExactDataEntry", - "PredefinedEntryDocumentFingerprintEntry", - "PredefinedEntryWordListEntry", - "Integration", - "IntegrationEntry", - "IntegrationEntryCustomEntry", - "IntegrationEntryPredefinedEntry", - "IntegrationEntryPredefinedEntryConfidence", - "IntegrationEntryPredefinedEntryVariant", - "IntegrationEntryIntegrationEntry", - "IntegrationEntryExactDataEntry", - "IntegrationEntryDocumentFingerprintEntry", - "IntegrationEntryWordListEntry", - "IntegrationSharedEntry", - "IntegrationSharedEntryCustomEntry", - "IntegrationSharedEntryPredefinedEntry", - "IntegrationSharedEntryPredefinedEntryConfidence", - "IntegrationSharedEntryPredefinedEntryVariant", - "IntegrationSharedEntryIntegrationEntry", - "IntegrationSharedEntryExactDataEntry", - "IntegrationSharedEntryDocumentFingerprintEntry", - "IntegrationSharedEntryWordListEntry", -] - - -class CustomEntryCustomEntry(BaseModel): - id: str - - created_at: datetime - - enabled: bool - - name: str - - pattern: Pattern - - type: Literal["custom"] - - updated_at: datetime - - description: Optional[str] = None - - profile_id: Optional[str] = None - - -class CustomEntryPredefinedEntryConfidence(BaseModel): - ai_context_available: bool - """Indicates whether this entry has AI remote service validation.""" - - available: bool - """ - Indicates whether this entry has any form of validation that is not an AI remote - service. - """ - - -class CustomEntryPredefinedEntryVariant(BaseModel): - topic_type: Literal["Intent", "Content"] - - type: Literal["PromptTopic"] - - description: Optional[str] = None - - -class CustomEntryPredefinedEntry(BaseModel): - id: str - - confidence: CustomEntryPredefinedEntryConfidence - - enabled: bool - - name: str - - type: Literal["predefined"] - - profile_id: Optional[str] = None - - variant: Optional[CustomEntryPredefinedEntryVariant] = None - - -class CustomEntryIntegrationEntry(BaseModel): - id: str - - created_at: datetime - - enabled: bool - - name: str - - type: Literal["integration"] - - updated_at: datetime - - profile_id: Optional[str] = None - - -class CustomEntryExactDataEntry(BaseModel): - id: str - - case_sensitive: bool - """ - Only applies to custom word lists. Determines if the words should be matched in - a case-sensitive manner Cannot be set to false if secret is true - """ - - created_at: datetime - - enabled: bool - - name: str - - secret: bool - - type: Literal["exact_data"] - - updated_at: datetime - - -class CustomEntryDocumentFingerprintEntry(BaseModel): - id: str - - created_at: datetime - - enabled: bool - - name: str - - type: Literal["document_fingerprint"] - - updated_at: datetime - - -class CustomEntryWordListEntry(BaseModel): - id: str - - created_at: datetime - - enabled: bool - - name: str - - type: Literal["word_list"] - - updated_at: datetime - - word_list: object - - profile_id: Optional[str] = None - - -CustomEntry: TypeAlias = Union[ - CustomEntryCustomEntry, - CustomEntryPredefinedEntry, - CustomEntryIntegrationEntry, - CustomEntryExactDataEntry, - CustomEntryDocumentFingerprintEntry, - CustomEntryWordListEntry, -] - - -class CustomSharedEntryCustomEntry(BaseModel): - id: str - - created_at: datetime - - enabled: bool - - name: str - - pattern: Pattern - - type: Literal["custom"] - - updated_at: datetime - - description: Optional[str] = None - - profile_id: Optional[str] = None - - -class CustomSharedEntryPredefinedEntryConfidence(BaseModel): - ai_context_available: bool - """Indicates whether this entry has AI remote service validation.""" - - available: bool - """ - Indicates whether this entry has any form of validation that is not an AI remote - service. - """ - - -class CustomSharedEntryPredefinedEntryVariant(BaseModel): - topic_type: Literal["Intent", "Content"] - - type: Literal["PromptTopic"] - - description: Optional[str] = None - - -class CustomSharedEntryPredefinedEntry(BaseModel): - id: str - - confidence: CustomSharedEntryPredefinedEntryConfidence - - enabled: bool - - name: str - - type: Literal["predefined"] - - profile_id: Optional[str] = None - - variant: Optional[CustomSharedEntryPredefinedEntryVariant] = None - - -class CustomSharedEntryIntegrationEntry(BaseModel): - id: str - - created_at: datetime - - enabled: bool - - name: str - - type: Literal["integration"] - - updated_at: datetime - - profile_id: Optional[str] = None - - -class CustomSharedEntryExactDataEntry(BaseModel): - id: str - - case_sensitive: bool - """ - Only applies to custom word lists. Determines if the words should be matched in - a case-sensitive manner Cannot be set to false if secret is true - """ - - created_at: datetime - - enabled: bool - - name: str - - secret: bool - - type: Literal["exact_data"] - - updated_at: datetime - - -class CustomSharedEntryDocumentFingerprintEntry(BaseModel): - id: str - - created_at: datetime - - enabled: bool - - name: str - - type: Literal["document_fingerprint"] - - updated_at: datetime - - -class CustomSharedEntryWordListEntry(BaseModel): - id: str - - created_at: datetime - - enabled: bool - - name: str - - type: Literal["word_list"] - - updated_at: datetime - - word_list: object - - profile_id: Optional[str] = None - - -CustomSharedEntry: TypeAlias = Union[ - CustomSharedEntryCustomEntry, - CustomSharedEntryPredefinedEntry, - CustomSharedEntryIntegrationEntry, - CustomSharedEntryExactDataEntry, - CustomSharedEntryDocumentFingerprintEntry, - CustomSharedEntryWordListEntry, -] - - -class Custom(BaseModel): - id: str - """The id of the profile (uuid).""" - - allowed_match_count: int - """Related DLP policies will trigger when the match count exceeds the number set.""" - - created_at: datetime - """When the profile was created.""" - - name: str - """The name of the profile.""" - - ocr_enabled: bool - - type: Literal["custom"] - - updated_at: datetime - """When the profile was lasted updated.""" - - ai_context_enabled: Optional[bool] = None - - confidence_threshold: Optional[Literal["low", "medium", "high", "very_high"]] = None - - context_awareness: Optional[ContextAwareness] = None - """ - Scan the context of predefined entries to only return matches surrounded by - keywords. - """ - - description: Optional[str] = None - """The description of the profile.""" - - entries: Optional[List[CustomEntry]] = None - - shared_entries: Optional[List[CustomSharedEntry]] = None - - -class PredefinedEntryCustomEntry(BaseModel): - id: str - - created_at: datetime - - enabled: bool - - name: str - - pattern: Pattern - - type: Literal["custom"] - - updated_at: datetime - - description: Optional[str] = None - - profile_id: Optional[str] = None - - -class PredefinedEntryPredefinedEntryConfidence(BaseModel): - ai_context_available: bool - """Indicates whether this entry has AI remote service validation.""" - - available: bool - """ - Indicates whether this entry has any form of validation that is not an AI remote - service. - """ - - -class PredefinedEntryPredefinedEntryVariant(BaseModel): - topic_type: Literal["Intent", "Content"] - - type: Literal["PromptTopic"] - - description: Optional[str] = None - - -class PredefinedEntryPredefinedEntry(BaseModel): - id: str - - confidence: PredefinedEntryPredefinedEntryConfidence - - enabled: bool - - name: str - - type: Literal["predefined"] - - profile_id: Optional[str] = None - - variant: Optional[PredefinedEntryPredefinedEntryVariant] = None - - -class PredefinedEntryIntegrationEntry(BaseModel): - id: str - - created_at: datetime - - enabled: bool - - name: str - - type: Literal["integration"] - - updated_at: datetime - - profile_id: Optional[str] = None - - -class PredefinedEntryExactDataEntry(BaseModel): - id: str - - case_sensitive: bool - """ - Only applies to custom word lists. Determines if the words should be matched in - a case-sensitive manner Cannot be set to false if secret is true - """ - - created_at: datetime - - enabled: bool - - name: str - - secret: bool - - type: Literal["exact_data"] - - updated_at: datetime - - -class PredefinedEntryDocumentFingerprintEntry(BaseModel): - id: str - - created_at: datetime - - enabled: bool - - name: str - - type: Literal["document_fingerprint"] - - updated_at: datetime - - -class PredefinedEntryWordListEntry(BaseModel): - id: str - - created_at: datetime - - enabled: bool - - name: str - - type: Literal["word_list"] - - updated_at: datetime - - word_list: object - - profile_id: Optional[str] = None - - -PredefinedEntry: TypeAlias = Union[ - PredefinedEntryCustomEntry, - PredefinedEntryPredefinedEntry, - PredefinedEntryIntegrationEntry, - PredefinedEntryExactDataEntry, - PredefinedEntryDocumentFingerprintEntry, - PredefinedEntryWordListEntry, -] - - -class Predefined(BaseModel): - id: str - """The id of the predefined profile (uuid).""" - - allowed_match_count: int - - entries: List[PredefinedEntry] - - name: str - """The name of the predefined profile.""" - - type: Literal["predefined"] - - ai_context_enabled: Optional[bool] = None - - confidence_threshold: Optional[Literal["low", "medium", "high", "very_high"]] = None - - context_awareness: Optional[ContextAwareness] = None - """ - Scan the context of predefined entries to only return matches surrounded by - keywords. - """ - - ocr_enabled: Optional[bool] = None - - open_access: Optional[bool] = None - """Whether this profile can be accessed by anyone.""" - - -class IntegrationEntryCustomEntry(BaseModel): - id: str - - created_at: datetime - - enabled: bool - - name: str - - pattern: Pattern - - type: Literal["custom"] - - updated_at: datetime - - description: Optional[str] = None - - profile_id: Optional[str] = None - - -class IntegrationEntryPredefinedEntryConfidence(BaseModel): - ai_context_available: bool - """Indicates whether this entry has AI remote service validation.""" - - available: bool - """ - Indicates whether this entry has any form of validation that is not an AI remote - service. - """ - - -class IntegrationEntryPredefinedEntryVariant(BaseModel): - topic_type: Literal["Intent", "Content"] - - type: Literal["PromptTopic"] - - description: Optional[str] = None - - -class IntegrationEntryPredefinedEntry(BaseModel): - id: str - - confidence: IntegrationEntryPredefinedEntryConfidence - - enabled: bool - - name: str - - type: Literal["predefined"] - - profile_id: Optional[str] = None - - variant: Optional[IntegrationEntryPredefinedEntryVariant] = None - - -class IntegrationEntryIntegrationEntry(BaseModel): - id: str - - created_at: datetime - - enabled: bool - - name: str - - type: Literal["integration"] - - updated_at: datetime - - profile_id: Optional[str] = None - - -class IntegrationEntryExactDataEntry(BaseModel): - id: str - - case_sensitive: bool - """ - Only applies to custom word lists. Determines if the words should be matched in - a case-sensitive manner Cannot be set to false if secret is true - """ - - created_at: datetime - - enabled: bool - - name: str - - secret: bool - - type: Literal["exact_data"] - - updated_at: datetime - - -class IntegrationEntryDocumentFingerprintEntry(BaseModel): - id: str - - created_at: datetime - - enabled: bool - - name: str - - type: Literal["document_fingerprint"] - - updated_at: datetime - - -class IntegrationEntryWordListEntry(BaseModel): - id: str - - created_at: datetime - - enabled: bool - - name: str - - type: Literal["word_list"] - - updated_at: datetime - - word_list: object - - profile_id: Optional[str] = None - - -IntegrationEntry: TypeAlias = Union[ - IntegrationEntryCustomEntry, - IntegrationEntryPredefinedEntry, - IntegrationEntryIntegrationEntry, - IntegrationEntryExactDataEntry, - IntegrationEntryDocumentFingerprintEntry, - IntegrationEntryWordListEntry, -] - - -class IntegrationSharedEntryCustomEntry(BaseModel): - id: str - - created_at: datetime - - enabled: bool - - name: str - - pattern: Pattern - - type: Literal["custom"] - - updated_at: datetime - - description: Optional[str] = None - - profile_id: Optional[str] = None - - -class IntegrationSharedEntryPredefinedEntryConfidence(BaseModel): - ai_context_available: bool - """Indicates whether this entry has AI remote service validation.""" - - available: bool - """ - Indicates whether this entry has any form of validation that is not an AI remote - service. - """ - - -class IntegrationSharedEntryPredefinedEntryVariant(BaseModel): - topic_type: Literal["Intent", "Content"] - - type: Literal["PromptTopic"] - - description: Optional[str] = None - - -class IntegrationSharedEntryPredefinedEntry(BaseModel): - id: str - - confidence: IntegrationSharedEntryPredefinedEntryConfidence - - enabled: bool - - name: str - - type: Literal["predefined"] - - profile_id: Optional[str] = None - - variant: Optional[IntegrationSharedEntryPredefinedEntryVariant] = None - - -class IntegrationSharedEntryIntegrationEntry(BaseModel): - id: str - - created_at: datetime - - enabled: bool - - name: str - - type: Literal["integration"] - - updated_at: datetime - - profile_id: Optional[str] = None - - -class IntegrationSharedEntryExactDataEntry(BaseModel): - id: str - - case_sensitive: bool - """ - Only applies to custom word lists. Determines if the words should be matched in - a case-sensitive manner Cannot be set to false if secret is true - """ - - created_at: datetime - - enabled: bool - - name: str - - secret: bool - - type: Literal["exact_data"] - - updated_at: datetime - - -class IntegrationSharedEntryDocumentFingerprintEntry(BaseModel): - id: str - - created_at: datetime - - enabled: bool - - name: str - - type: Literal["document_fingerprint"] - - updated_at: datetime - - -class IntegrationSharedEntryWordListEntry(BaseModel): - id: str - - created_at: datetime - - enabled: bool - - name: str - - type: Literal["word_list"] - - updated_at: datetime - - word_list: object - - profile_id: Optional[str] = None - - -IntegrationSharedEntry: TypeAlias = Union[ - IntegrationSharedEntryCustomEntry, - IntegrationSharedEntryPredefinedEntry, - IntegrationSharedEntryIntegrationEntry, - IntegrationSharedEntryExactDataEntry, - IntegrationSharedEntryDocumentFingerprintEntry, - IntegrationSharedEntryWordListEntry, -] - - -class Integration(BaseModel): - id: str - - created_at: datetime - - entries: List[IntegrationEntry] - - name: str - - shared_entries: List[IntegrationSharedEntry] - - type: Literal["integration"] - - updated_at: datetime - - description: Optional[str] = None - """The description of the profile.""" - - -CustomUpdateResponse: TypeAlias = Annotated[Union[Custom, Predefined, Integration], PropertyInfo(discriminator="type")] diff --git a/src/cloudflare/types/zero_trust/dlp/profiles/predefined_get_response.py b/src/cloudflare/types/zero_trust/dlp/profiles/predefined_profile.py similarity index 97% rename from src/cloudflare/types/zero_trust/dlp/profiles/predefined_get_response.py rename to src/cloudflare/types/zero_trust/dlp/profiles/predefined_profile.py index 89b8fecbff3..b3c97b85ffc 100644 --- a/src/cloudflare/types/zero_trust/dlp/profiles/predefined_get_response.py +++ b/src/cloudflare/types/zero_trust/dlp/profiles/predefined_profile.py @@ -8,7 +8,7 @@ from ....._models import BaseModel __all__ = [ - "PredefinedGetResponse", + "PredefinedProfile", "Entry", "EntryCustomEntry", "EntryPredefinedEntry", @@ -156,7 +156,7 @@ class EntryWordListEntry(BaseModel): ] -class PredefinedGetResponse(BaseModel): +class PredefinedProfile(BaseModel): id: str """The id of the predefined profile (uuid).""" diff --git a/src/cloudflare/types/zero_trust/dlp/profiles/predefined_update_response.py b/src/cloudflare/types/zero_trust/dlp/profiles/predefined_update_response.py deleted file mode 100644 index ce5b00b8600..00000000000 --- a/src/cloudflare/types/zero_trust/dlp/profiles/predefined_update_response.py +++ /dev/null @@ -1,184 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List, Union, Optional -from datetime import datetime -from typing_extensions import Literal, TypeAlias - -from .pattern import Pattern -from ....._models import BaseModel - -__all__ = [ - "PredefinedUpdateResponse", - "Entry", - "EntryCustomEntry", - "EntryPredefinedEntry", - "EntryPredefinedEntryConfidence", - "EntryPredefinedEntryVariant", - "EntryIntegrationEntry", - "EntryExactDataEntry", - "EntryDocumentFingerprintEntry", - "EntryWordListEntry", -] - - -class EntryCustomEntry(BaseModel): - id: str - - created_at: datetime - - enabled: bool - - name: str - - pattern: Pattern - - type: Literal["custom"] - - updated_at: datetime - - description: Optional[str] = None - - profile_id: Optional[str] = None - - -class EntryPredefinedEntryConfidence(BaseModel): - ai_context_available: bool - """Indicates whether this entry has AI remote service validation.""" - - available: bool - """ - Indicates whether this entry has any form of validation that is not an AI remote - service. - """ - - -class EntryPredefinedEntryVariant(BaseModel): - topic_type: Literal["Intent", "Content"] - - type: Literal["PromptTopic"] - - description: Optional[str] = None - - -class EntryPredefinedEntry(BaseModel): - id: str - - confidence: EntryPredefinedEntryConfidence - - enabled: bool - - name: str - - type: Literal["predefined"] - - profile_id: Optional[str] = None - - variant: Optional[EntryPredefinedEntryVariant] = None - - -class EntryIntegrationEntry(BaseModel): - id: str - - created_at: datetime - - enabled: bool - - name: str - - type: Literal["integration"] - - updated_at: datetime - - profile_id: Optional[str] = None - - -class EntryExactDataEntry(BaseModel): - id: str - - case_sensitive: bool - """ - Only applies to custom word lists. Determines if the words should be matched in - a case-sensitive manner Cannot be set to false if secret is true - """ - - created_at: datetime - - enabled: bool - - name: str - - secret: bool - - type: Literal["exact_data"] - - updated_at: datetime - - -class EntryDocumentFingerprintEntry(BaseModel): - id: str - - created_at: datetime - - enabled: bool - - name: str - - type: Literal["document_fingerprint"] - - updated_at: datetime - - -class EntryWordListEntry(BaseModel): - id: str - - created_at: datetime - - enabled: bool - - name: str - - type: Literal["word_list"] - - updated_at: datetime - - word_list: object - - profile_id: Optional[str] = None - - -Entry: TypeAlias = Union[ - EntryCustomEntry, - EntryPredefinedEntry, - EntryIntegrationEntry, - EntryExactDataEntry, - EntryDocumentFingerprintEntry, - EntryWordListEntry, -] - - -class PredefinedUpdateResponse(BaseModel): - id: str - """The id of the predefined profile (uuid).""" - - allowed_match_count: int - - confidence_threshold: Optional[str] = None - - enabled_entries: List[str] - """Entries to enable for this predefined profile. - - Any entries not provided will be disabled. - """ - - entries: List[Entry] - """This field has been deprecated for `enabled_entries`.""" - - name: str - """The name of the predefined profile.""" - - ai_context_enabled: Optional[bool] = None - - ocr_enabled: Optional[bool] = None - - open_access: Optional[bool] = None - """Whether this profile can be accessed by anyone.""" diff --git a/tests/api_resources/zero_trust/dlp/datasets/test_upload.py b/tests/api_resources/zero_trust/dlp/datasets/test_upload.py index 2fb28f81f23..8402e87a1fa 100644 --- a/tests/api_resources/zero_trust/dlp/datasets/test_upload.py +++ b/tests/api_resources/zero_trust/dlp/datasets/test_upload.py @@ -9,7 +9,8 @@ from cloudflare import Cloudflare, AsyncCloudflare from tests.utils import assert_matches_type -from cloudflare.types.zero_trust.dlp.datasets import UploadEditResponse, UploadCreateResponse +from cloudflare.types.zero_trust.dlp import Dataset +from cloudflare.types.zero_trust.dlp.datasets import NewVersion base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") @@ -23,7 +24,7 @@ def test_method_create(self, client: Cloudflare) -> None: dataset_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", account_id="account_id", ) - assert_matches_type(Optional[UploadCreateResponse], upload, path=["response"]) + assert_matches_type(Optional[NewVersion], upload, path=["response"]) @parametrize def test_raw_response_create(self, client: Cloudflare) -> None: @@ -35,7 +36,7 @@ def test_raw_response_create(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" upload = response.parse() - assert_matches_type(Optional[UploadCreateResponse], upload, path=["response"]) + assert_matches_type(Optional[NewVersion], upload, path=["response"]) @parametrize def test_streaming_response_create(self, client: Cloudflare) -> None: @@ -47,7 +48,7 @@ def test_streaming_response_create(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" upload = response.parse() - assert_matches_type(Optional[UploadCreateResponse], upload, path=["response"]) + assert_matches_type(Optional[NewVersion], upload, path=["response"]) assert cast(Any, response.is_closed) is True @@ -74,7 +75,7 @@ def test_method_edit(self, client: Cloudflare) -> None: account_id="account_id", dataset_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", ) - assert_matches_type(Optional[UploadEditResponse], upload, path=["response"]) + assert_matches_type(Optional[Dataset], upload, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -89,7 +90,7 @@ def test_raw_response_edit(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" upload = response.parse() - assert_matches_type(Optional[UploadEditResponse], upload, path=["response"]) + assert_matches_type(Optional[Dataset], upload, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -104,7 +105,7 @@ def test_streaming_response_edit(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" upload = response.parse() - assert_matches_type(Optional[UploadEditResponse], upload, path=["response"]) + assert_matches_type(Optional[Dataset], upload, path=["response"]) assert cast(Any, response.is_closed) is True @@ -139,7 +140,7 @@ async def test_method_create(self, async_client: AsyncCloudflare) -> None: dataset_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", account_id="account_id", ) - assert_matches_type(Optional[UploadCreateResponse], upload, path=["response"]) + assert_matches_type(Optional[NewVersion], upload, path=["response"]) @parametrize async def test_raw_response_create(self, async_client: AsyncCloudflare) -> None: @@ -151,7 +152,7 @@ async def test_raw_response_create(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" upload = await response.parse() - assert_matches_type(Optional[UploadCreateResponse], upload, path=["response"]) + assert_matches_type(Optional[NewVersion], upload, path=["response"]) @parametrize async def test_streaming_response_create(self, async_client: AsyncCloudflare) -> None: @@ -163,7 +164,7 @@ async def test_streaming_response_create(self, async_client: AsyncCloudflare) -> assert response.http_request.headers.get("X-Stainless-Lang") == "python" upload = await response.parse() - assert_matches_type(Optional[UploadCreateResponse], upload, path=["response"]) + assert_matches_type(Optional[NewVersion], upload, path=["response"]) assert cast(Any, response.is_closed) is True @@ -190,7 +191,7 @@ async def test_method_edit(self, async_client: AsyncCloudflare) -> None: account_id="account_id", dataset_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", ) - assert_matches_type(Optional[UploadEditResponse], upload, path=["response"]) + assert_matches_type(Optional[Dataset], upload, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -205,7 +206,7 @@ async def test_raw_response_edit(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" upload = await response.parse() - assert_matches_type(Optional[UploadEditResponse], upload, path=["response"]) + assert_matches_type(Optional[Dataset], upload, path=["response"]) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize @@ -220,7 +221,7 @@ async def test_streaming_response_edit(self, async_client: AsyncCloudflare) -> N assert response.http_request.headers.get("X-Stainless-Lang") == "python" upload = await response.parse() - assert_matches_type(Optional[UploadEditResponse], upload, path=["response"]) + assert_matches_type(Optional[Dataset], upload, path=["response"]) assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/zero_trust/dlp/profiles/test_custom.py b/tests/api_resources/zero_trust/dlp/profiles/test_custom.py index 6c5feaff7fb..f26540bad38 100644 --- a/tests/api_resources/zero_trust/dlp/profiles/test_custom.py +++ b/tests/api_resources/zero_trust/dlp/profiles/test_custom.py @@ -9,11 +9,7 @@ from cloudflare import Cloudflare, AsyncCloudflare from tests.utils import assert_matches_type -from cloudflare.types.zero_trust.dlp.profiles import ( - CustomGetResponse, - CustomCreateResponse, - CustomUpdateResponse, -) +from cloudflare.types.zero_trust.dlp import Profile base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") @@ -27,7 +23,7 @@ def test_method_create(self, client: Cloudflare) -> None: account_id="account_id", name="name", ) - assert_matches_type(Optional[CustomCreateResponse], custom, path=["response"]) + assert_matches_type(Optional[Profile], custom, path=["response"]) @parametrize def test_method_create_with_all_params(self, client: Cloudflare) -> None: @@ -61,7 +57,7 @@ def test_method_create_with_all_params(self, client: Cloudflare) -> None: } ], ) - assert_matches_type(Optional[CustomCreateResponse], custom, path=["response"]) + assert_matches_type(Optional[Profile], custom, path=["response"]) @parametrize def test_raw_response_create(self, client: Cloudflare) -> None: @@ -73,7 +69,7 @@ def test_raw_response_create(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" custom = response.parse() - assert_matches_type(Optional[CustomCreateResponse], custom, path=["response"]) + assert_matches_type(Optional[Profile], custom, path=["response"]) @parametrize def test_streaming_response_create(self, client: Cloudflare) -> None: @@ -85,7 +81,7 @@ def test_streaming_response_create(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" custom = response.parse() - assert_matches_type(Optional[CustomCreateResponse], custom, path=["response"]) + assert_matches_type(Optional[Profile], custom, path=["response"]) assert cast(Any, response.is_closed) is True @@ -104,7 +100,7 @@ def test_method_update(self, client: Cloudflare) -> None: account_id="account_id", name="name", ) - assert_matches_type(Optional[CustomUpdateResponse], custom, path=["response"]) + assert_matches_type(Optional[Profile], custom, path=["response"]) @parametrize def test_method_update_with_all_params(self, client: Cloudflare) -> None: @@ -140,7 +136,7 @@ def test_method_update_with_all_params(self, client: Cloudflare) -> None: } ], ) - assert_matches_type(Optional[CustomUpdateResponse], custom, path=["response"]) + assert_matches_type(Optional[Profile], custom, path=["response"]) @parametrize def test_raw_response_update(self, client: Cloudflare) -> None: @@ -153,7 +149,7 @@ def test_raw_response_update(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" custom = response.parse() - assert_matches_type(Optional[CustomUpdateResponse], custom, path=["response"]) + assert_matches_type(Optional[Profile], custom, path=["response"]) @parametrize def test_streaming_response_update(self, client: Cloudflare) -> None: @@ -166,7 +162,7 @@ def test_streaming_response_update(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" custom = response.parse() - assert_matches_type(Optional[CustomUpdateResponse], custom, path=["response"]) + assert_matches_type(Optional[Profile], custom, path=["response"]) assert cast(Any, response.is_closed) is True @@ -240,7 +236,7 @@ def test_method_get(self, client: Cloudflare) -> None: profile_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", account_id="account_id", ) - assert_matches_type(Optional[CustomGetResponse], custom, path=["response"]) + assert_matches_type(Optional[Profile], custom, path=["response"]) @parametrize def test_raw_response_get(self, client: Cloudflare) -> None: @@ -252,7 +248,7 @@ def test_raw_response_get(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" custom = response.parse() - assert_matches_type(Optional[CustomGetResponse], custom, path=["response"]) + assert_matches_type(Optional[Profile], custom, path=["response"]) @parametrize def test_streaming_response_get(self, client: Cloudflare) -> None: @@ -264,7 +260,7 @@ def test_streaming_response_get(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" custom = response.parse() - assert_matches_type(Optional[CustomGetResponse], custom, path=["response"]) + assert_matches_type(Optional[Profile], custom, path=["response"]) assert cast(Any, response.is_closed) is True @@ -294,7 +290,7 @@ async def test_method_create(self, async_client: AsyncCloudflare) -> None: account_id="account_id", name="name", ) - assert_matches_type(Optional[CustomCreateResponse], custom, path=["response"]) + assert_matches_type(Optional[Profile], custom, path=["response"]) @parametrize async def test_method_create_with_all_params(self, async_client: AsyncCloudflare) -> None: @@ -328,7 +324,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncCloudflare } ], ) - assert_matches_type(Optional[CustomCreateResponse], custom, path=["response"]) + assert_matches_type(Optional[Profile], custom, path=["response"]) @parametrize async def test_raw_response_create(self, async_client: AsyncCloudflare) -> None: @@ -340,7 +336,7 @@ async def test_raw_response_create(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" custom = await response.parse() - assert_matches_type(Optional[CustomCreateResponse], custom, path=["response"]) + assert_matches_type(Optional[Profile], custom, path=["response"]) @parametrize async def test_streaming_response_create(self, async_client: AsyncCloudflare) -> None: @@ -352,7 +348,7 @@ async def test_streaming_response_create(self, async_client: AsyncCloudflare) -> assert response.http_request.headers.get("X-Stainless-Lang") == "python" custom = await response.parse() - assert_matches_type(Optional[CustomCreateResponse], custom, path=["response"]) + assert_matches_type(Optional[Profile], custom, path=["response"]) assert cast(Any, response.is_closed) is True @@ -371,7 +367,7 @@ async def test_method_update(self, async_client: AsyncCloudflare) -> None: account_id="account_id", name="name", ) - assert_matches_type(Optional[CustomUpdateResponse], custom, path=["response"]) + assert_matches_type(Optional[Profile], custom, path=["response"]) @parametrize async def test_method_update_with_all_params(self, async_client: AsyncCloudflare) -> None: @@ -407,7 +403,7 @@ async def test_method_update_with_all_params(self, async_client: AsyncCloudflare } ], ) - assert_matches_type(Optional[CustomUpdateResponse], custom, path=["response"]) + assert_matches_type(Optional[Profile], custom, path=["response"]) @parametrize async def test_raw_response_update(self, async_client: AsyncCloudflare) -> None: @@ -420,7 +416,7 @@ async def test_raw_response_update(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" custom = await response.parse() - assert_matches_type(Optional[CustomUpdateResponse], custom, path=["response"]) + assert_matches_type(Optional[Profile], custom, path=["response"]) @parametrize async def test_streaming_response_update(self, async_client: AsyncCloudflare) -> None: @@ -433,7 +429,7 @@ async def test_streaming_response_update(self, async_client: AsyncCloudflare) -> assert response.http_request.headers.get("X-Stainless-Lang") == "python" custom = await response.parse() - assert_matches_type(Optional[CustomUpdateResponse], custom, path=["response"]) + assert_matches_type(Optional[Profile], custom, path=["response"]) assert cast(Any, response.is_closed) is True @@ -507,7 +503,7 @@ async def test_method_get(self, async_client: AsyncCloudflare) -> None: profile_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", account_id="account_id", ) - assert_matches_type(Optional[CustomGetResponse], custom, path=["response"]) + assert_matches_type(Optional[Profile], custom, path=["response"]) @parametrize async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: @@ -519,7 +515,7 @@ async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" custom = await response.parse() - assert_matches_type(Optional[CustomGetResponse], custom, path=["response"]) + assert_matches_type(Optional[Profile], custom, path=["response"]) @parametrize async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> None: @@ -531,7 +527,7 @@ async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> No assert response.http_request.headers.get("X-Stainless-Lang") == "python" custom = await response.parse() - assert_matches_type(Optional[CustomGetResponse], custom, path=["response"]) + assert_matches_type(Optional[Profile], custom, path=["response"]) assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/zero_trust/dlp/profiles/test_predefined.py b/tests/api_resources/zero_trust/dlp/profiles/test_predefined.py index eedab1cb0a2..07e58ff339c 100644 --- a/tests/api_resources/zero_trust/dlp/profiles/test_predefined.py +++ b/tests/api_resources/zero_trust/dlp/profiles/test_predefined.py @@ -9,10 +9,7 @@ from cloudflare import Cloudflare, AsyncCloudflare from tests.utils import assert_matches_type -from cloudflare.types.zero_trust.dlp.profiles import ( - PredefinedGetResponse, - PredefinedUpdateResponse, -) +from cloudflare.types.zero_trust.dlp.profiles import PredefinedProfile base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") @@ -26,7 +23,7 @@ def test_method_update(self, client: Cloudflare) -> None: profile_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", account_id="account_id", ) - assert_matches_type(Optional[PredefinedUpdateResponse], predefined, path=["response"]) + assert_matches_type(Optional[PredefinedProfile], predefined, path=["response"]) @parametrize def test_method_update_with_all_params(self, client: Cloudflare) -> None: @@ -45,7 +42,7 @@ def test_method_update_with_all_params(self, client: Cloudflare) -> None: ], ocr_enabled=True, ) - assert_matches_type(Optional[PredefinedUpdateResponse], predefined, path=["response"]) + assert_matches_type(Optional[PredefinedProfile], predefined, path=["response"]) @parametrize def test_raw_response_update(self, client: Cloudflare) -> None: @@ -57,7 +54,7 @@ def test_raw_response_update(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" predefined = response.parse() - assert_matches_type(Optional[PredefinedUpdateResponse], predefined, path=["response"]) + assert_matches_type(Optional[PredefinedProfile], predefined, path=["response"]) @parametrize def test_streaming_response_update(self, client: Cloudflare) -> None: @@ -69,7 +66,7 @@ def test_streaming_response_update(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" predefined = response.parse() - assert_matches_type(Optional[PredefinedUpdateResponse], predefined, path=["response"]) + assert_matches_type(Optional[PredefinedProfile], predefined, path=["response"]) assert cast(Any, response.is_closed) is True @@ -141,7 +138,7 @@ def test_method_get(self, client: Cloudflare) -> None: profile_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", account_id="account_id", ) - assert_matches_type(Optional[PredefinedGetResponse], predefined, path=["response"]) + assert_matches_type(Optional[PredefinedProfile], predefined, path=["response"]) @parametrize def test_raw_response_get(self, client: Cloudflare) -> None: @@ -153,7 +150,7 @@ def test_raw_response_get(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" predefined = response.parse() - assert_matches_type(Optional[PredefinedGetResponse], predefined, path=["response"]) + assert_matches_type(Optional[PredefinedProfile], predefined, path=["response"]) @parametrize def test_streaming_response_get(self, client: Cloudflare) -> None: @@ -165,7 +162,7 @@ def test_streaming_response_get(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" predefined = response.parse() - assert_matches_type(Optional[PredefinedGetResponse], predefined, path=["response"]) + assert_matches_type(Optional[PredefinedProfile], predefined, path=["response"]) assert cast(Any, response.is_closed) is True @@ -195,7 +192,7 @@ async def test_method_update(self, async_client: AsyncCloudflare) -> None: profile_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", account_id="account_id", ) - assert_matches_type(Optional[PredefinedUpdateResponse], predefined, path=["response"]) + assert_matches_type(Optional[PredefinedProfile], predefined, path=["response"]) @parametrize async def test_method_update_with_all_params(self, async_client: AsyncCloudflare) -> None: @@ -214,7 +211,7 @@ async def test_method_update_with_all_params(self, async_client: AsyncCloudflare ], ocr_enabled=True, ) - assert_matches_type(Optional[PredefinedUpdateResponse], predefined, path=["response"]) + assert_matches_type(Optional[PredefinedProfile], predefined, path=["response"]) @parametrize async def test_raw_response_update(self, async_client: AsyncCloudflare) -> None: @@ -226,7 +223,7 @@ async def test_raw_response_update(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" predefined = await response.parse() - assert_matches_type(Optional[PredefinedUpdateResponse], predefined, path=["response"]) + assert_matches_type(Optional[PredefinedProfile], predefined, path=["response"]) @parametrize async def test_streaming_response_update(self, async_client: AsyncCloudflare) -> None: @@ -238,7 +235,7 @@ async def test_streaming_response_update(self, async_client: AsyncCloudflare) -> assert response.http_request.headers.get("X-Stainless-Lang") == "python" predefined = await response.parse() - assert_matches_type(Optional[PredefinedUpdateResponse], predefined, path=["response"]) + assert_matches_type(Optional[PredefinedProfile], predefined, path=["response"]) assert cast(Any, response.is_closed) is True @@ -310,7 +307,7 @@ async def test_method_get(self, async_client: AsyncCloudflare) -> None: profile_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", account_id="account_id", ) - assert_matches_type(Optional[PredefinedGetResponse], predefined, path=["response"]) + assert_matches_type(Optional[PredefinedProfile], predefined, path=["response"]) @parametrize async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: @@ -322,7 +319,7 @@ async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" predefined = await response.parse() - assert_matches_type(Optional[PredefinedGetResponse], predefined, path=["response"]) + assert_matches_type(Optional[PredefinedProfile], predefined, path=["response"]) @parametrize async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> None: @@ -334,7 +331,7 @@ async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> No assert response.http_request.headers.get("X-Stainless-Lang") == "python" predefined = await response.parse() - assert_matches_type(Optional[PredefinedGetResponse], predefined, path=["response"]) + assert_matches_type(Optional[PredefinedProfile], predefined, path=["response"]) assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/zero_trust/dlp/test_datasets.py b/tests/api_resources/zero_trust/dlp/test_datasets.py index dd38cd45612..6c5abd035ac 100644 --- a/tests/api_resources/zero_trust/dlp/test_datasets.py +++ b/tests/api_resources/zero_trust/dlp/test_datasets.py @@ -10,12 +10,7 @@ from cloudflare import Cloudflare, AsyncCloudflare from tests.utils import assert_matches_type from cloudflare.pagination import SyncSinglePage, AsyncSinglePage -from cloudflare.types.zero_trust.dlp import ( - Dataset, - DatasetGetResponse, - DatasetCreateResponse, - DatasetUpdateResponse, -) +from cloudflare.types.zero_trust.dlp import Dataset, DatasetCreation base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") @@ -29,7 +24,7 @@ def test_method_create(self, client: Cloudflare) -> None: account_id="account_id", name="name", ) - assert_matches_type(Optional[DatasetCreateResponse], dataset, path=["response"]) + assert_matches_type(Optional[DatasetCreation], dataset, path=["response"]) @parametrize def test_method_create_with_all_params(self, client: Cloudflare) -> None: @@ -41,7 +36,7 @@ def test_method_create_with_all_params(self, client: Cloudflare) -> None: encoding_version=0, secret=True, ) - assert_matches_type(Optional[DatasetCreateResponse], dataset, path=["response"]) + assert_matches_type(Optional[DatasetCreation], dataset, path=["response"]) @parametrize def test_raw_response_create(self, client: Cloudflare) -> None: @@ -53,7 +48,7 @@ def test_raw_response_create(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" dataset = response.parse() - assert_matches_type(Optional[DatasetCreateResponse], dataset, path=["response"]) + assert_matches_type(Optional[DatasetCreation], dataset, path=["response"]) @parametrize def test_streaming_response_create(self, client: Cloudflare) -> None: @@ -65,7 +60,7 @@ def test_streaming_response_create(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" dataset = response.parse() - assert_matches_type(Optional[DatasetCreateResponse], dataset, path=["response"]) + assert_matches_type(Optional[DatasetCreation], dataset, path=["response"]) assert cast(Any, response.is_closed) is True @@ -83,7 +78,7 @@ def test_method_update(self, client: Cloudflare) -> None: dataset_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", account_id="account_id", ) - assert_matches_type(Optional[DatasetUpdateResponse], dataset, path=["response"]) + assert_matches_type(Optional[Dataset], dataset, path=["response"]) @parametrize def test_method_update_with_all_params(self, client: Cloudflare) -> None: @@ -94,7 +89,7 @@ def test_method_update_with_all_params(self, client: Cloudflare) -> None: description="description", name="name", ) - assert_matches_type(Optional[DatasetUpdateResponse], dataset, path=["response"]) + assert_matches_type(Optional[Dataset], dataset, path=["response"]) @parametrize def test_raw_response_update(self, client: Cloudflare) -> None: @@ -106,7 +101,7 @@ def test_raw_response_update(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" dataset = response.parse() - assert_matches_type(Optional[DatasetUpdateResponse], dataset, path=["response"]) + assert_matches_type(Optional[Dataset], dataset, path=["response"]) @parametrize def test_streaming_response_update(self, client: Cloudflare) -> None: @@ -118,7 +113,7 @@ def test_streaming_response_update(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" dataset = response.parse() - assert_matches_type(Optional[DatasetUpdateResponse], dataset, path=["response"]) + assert_matches_type(Optional[Dataset], dataset, path=["response"]) assert cast(Any, response.is_closed) is True @@ -228,7 +223,7 @@ def test_method_get(self, client: Cloudflare) -> None: dataset_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", account_id="account_id", ) - assert_matches_type(Optional[DatasetGetResponse], dataset, path=["response"]) + assert_matches_type(Optional[Dataset], dataset, path=["response"]) @parametrize def test_raw_response_get(self, client: Cloudflare) -> None: @@ -240,7 +235,7 @@ def test_raw_response_get(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" dataset = response.parse() - assert_matches_type(Optional[DatasetGetResponse], dataset, path=["response"]) + assert_matches_type(Optional[Dataset], dataset, path=["response"]) @parametrize def test_streaming_response_get(self, client: Cloudflare) -> None: @@ -252,7 +247,7 @@ def test_streaming_response_get(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" dataset = response.parse() - assert_matches_type(Optional[DatasetGetResponse], dataset, path=["response"]) + assert_matches_type(Optional[Dataset], dataset, path=["response"]) assert cast(Any, response.is_closed) is True @@ -282,7 +277,7 @@ async def test_method_create(self, async_client: AsyncCloudflare) -> None: account_id="account_id", name="name", ) - assert_matches_type(Optional[DatasetCreateResponse], dataset, path=["response"]) + assert_matches_type(Optional[DatasetCreation], dataset, path=["response"]) @parametrize async def test_method_create_with_all_params(self, async_client: AsyncCloudflare) -> None: @@ -294,7 +289,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncCloudflare encoding_version=0, secret=True, ) - assert_matches_type(Optional[DatasetCreateResponse], dataset, path=["response"]) + assert_matches_type(Optional[DatasetCreation], dataset, path=["response"]) @parametrize async def test_raw_response_create(self, async_client: AsyncCloudflare) -> None: @@ -306,7 +301,7 @@ async def test_raw_response_create(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" dataset = await response.parse() - assert_matches_type(Optional[DatasetCreateResponse], dataset, path=["response"]) + assert_matches_type(Optional[DatasetCreation], dataset, path=["response"]) @parametrize async def test_streaming_response_create(self, async_client: AsyncCloudflare) -> None: @@ -318,7 +313,7 @@ async def test_streaming_response_create(self, async_client: AsyncCloudflare) -> assert response.http_request.headers.get("X-Stainless-Lang") == "python" dataset = await response.parse() - assert_matches_type(Optional[DatasetCreateResponse], dataset, path=["response"]) + assert_matches_type(Optional[DatasetCreation], dataset, path=["response"]) assert cast(Any, response.is_closed) is True @@ -336,7 +331,7 @@ async def test_method_update(self, async_client: AsyncCloudflare) -> None: dataset_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", account_id="account_id", ) - assert_matches_type(Optional[DatasetUpdateResponse], dataset, path=["response"]) + assert_matches_type(Optional[Dataset], dataset, path=["response"]) @parametrize async def test_method_update_with_all_params(self, async_client: AsyncCloudflare) -> None: @@ -347,7 +342,7 @@ async def test_method_update_with_all_params(self, async_client: AsyncCloudflare description="description", name="name", ) - assert_matches_type(Optional[DatasetUpdateResponse], dataset, path=["response"]) + assert_matches_type(Optional[Dataset], dataset, path=["response"]) @parametrize async def test_raw_response_update(self, async_client: AsyncCloudflare) -> None: @@ -359,7 +354,7 @@ async def test_raw_response_update(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" dataset = await response.parse() - assert_matches_type(Optional[DatasetUpdateResponse], dataset, path=["response"]) + assert_matches_type(Optional[Dataset], dataset, path=["response"]) @parametrize async def test_streaming_response_update(self, async_client: AsyncCloudflare) -> None: @@ -371,7 +366,7 @@ async def test_streaming_response_update(self, async_client: AsyncCloudflare) -> assert response.http_request.headers.get("X-Stainless-Lang") == "python" dataset = await response.parse() - assert_matches_type(Optional[DatasetUpdateResponse], dataset, path=["response"]) + assert_matches_type(Optional[Dataset], dataset, path=["response"]) assert cast(Any, response.is_closed) is True @@ -481,7 +476,7 @@ async def test_method_get(self, async_client: AsyncCloudflare) -> None: dataset_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", account_id="account_id", ) - assert_matches_type(Optional[DatasetGetResponse], dataset, path=["response"]) + assert_matches_type(Optional[Dataset], dataset, path=["response"]) @parametrize async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: @@ -493,7 +488,7 @@ async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" dataset = await response.parse() - assert_matches_type(Optional[DatasetGetResponse], dataset, path=["response"]) + assert_matches_type(Optional[Dataset], dataset, path=["response"]) @parametrize async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> None: @@ -505,7 +500,7 @@ async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> No assert response.http_request.headers.get("X-Stainless-Lang") == "python" dataset = await response.parse() - assert_matches_type(Optional[DatasetGetResponse], dataset, path=["response"]) + assert_matches_type(Optional[Dataset], dataset, path=["response"]) assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/zero_trust/dlp/test_profiles.py b/tests/api_resources/zero_trust/dlp/test_profiles.py index b18ba097e90..33177649778 100644 --- a/tests/api_resources/zero_trust/dlp/test_profiles.py +++ b/tests/api_resources/zero_trust/dlp/test_profiles.py @@ -10,7 +10,7 @@ from cloudflare import Cloudflare, AsyncCloudflare from tests.utils import assert_matches_type from cloudflare.pagination import SyncSinglePage, AsyncSinglePage -from cloudflare.types.zero_trust.dlp import Profile, ProfileGetResponse +from cloudflare.types.zero_trust.dlp import Profile base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") @@ -70,7 +70,7 @@ def test_method_get(self, client: Cloudflare) -> None: profile_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", account_id="account_id", ) - assert_matches_type(Optional[ProfileGetResponse], profile, path=["response"]) + assert_matches_type(Optional[Profile], profile, path=["response"]) @parametrize def test_raw_response_get(self, client: Cloudflare) -> None: @@ -82,7 +82,7 @@ def test_raw_response_get(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" profile = response.parse() - assert_matches_type(Optional[ProfileGetResponse], profile, path=["response"]) + assert_matches_type(Optional[Profile], profile, path=["response"]) @parametrize def test_streaming_response_get(self, client: Cloudflare) -> None: @@ -94,7 +94,7 @@ def test_streaming_response_get(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" profile = response.parse() - assert_matches_type(Optional[ProfileGetResponse], profile, path=["response"]) + assert_matches_type(Optional[Profile], profile, path=["response"]) assert cast(Any, response.is_closed) is True @@ -170,7 +170,7 @@ async def test_method_get(self, async_client: AsyncCloudflare) -> None: profile_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", account_id="account_id", ) - assert_matches_type(Optional[ProfileGetResponse], profile, path=["response"]) + assert_matches_type(Optional[Profile], profile, path=["response"]) @parametrize async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: @@ -182,7 +182,7 @@ async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" profile = await response.parse() - assert_matches_type(Optional[ProfileGetResponse], profile, path=["response"]) + assert_matches_type(Optional[Profile], profile, path=["response"]) @parametrize async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> None: @@ -194,7 +194,7 @@ async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> No assert response.http_request.headers.get("X-Stainless-Lang") == "python" profile = await response.parse() - assert_matches_type(Optional[ProfileGetResponse], profile, path=["response"]) + assert_matches_type(Optional[Profile], profile, path=["response"]) assert cast(Any, response.is_closed) is True From 6135f31e65e5d7e4e3d0f2aad4061ffd9a1991b7 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 24 Feb 2026 00:03:06 +0000 Subject: [PATCH 030/279] chore(api): update composite API spec --- .stats.yml | 4 ++-- .../resources/workers/scripts/scripts.py | 14 ++++++++++++++ .../resources/workers/scripts/versions.py | 17 +++++++++++++++++ .../dispatch/namespaces/scripts/scripts.py | 15 +++++++++++++++ .../types/workers/script_update_params.py | 7 +++++++ .../workers/scripts/version_create_params.py | 7 +++++++ .../dispatch/namespaces/script_update_params.py | 7 +++++++ .../workers/scripts/test_versions.py | 2 ++ tests/api_resources/workers/test_scripts.py | 2 ++ .../dispatch/namespaces/test_scripts.py | 2 ++ 10 files changed, 75 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 1107a369d1a..efd2ad82090 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 2032 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-6b090e02d25a0793e53cd3275fbb806e07b5bd482cab8a8878ceac32ff63133d.yml -openapi_spec_hash: cb863232a9866a40347fffed09421037 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-5af3d0808c800cfdd014e153ae6d5f7e68963e86ba3ed8ea63a9d2fbcf7fb412.yml +openapi_spec_hash: 8b8b7ba494d2c1087814c805e0779ff2 config_hash: 405e0229a3b5214d99c53598e78f85a1 diff --git a/src/cloudflare/resources/workers/scripts/scripts.py b/src/cloudflare/resources/workers/scripts/scripts.py index 8b39ff1240d..f4f5877b34f 100644 --- a/src/cloudflare/resources/workers/scripts/scripts.py +++ b/src/cloudflare/resources/workers/scripts/scripts.py @@ -184,6 +184,7 @@ def update( *, account_id: str, metadata: script_update_params.Metadata, + bindings_inherit: Literal["strict"] | Omit = omit, files: SequenceNotStr[FileTypes] | 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. @@ -205,6 +206,10 @@ def update( metadata: JSON-encoded metadata about the uploaded parts and Worker configuration. + bindings_inherit: When set to "strict", the upload will fail if any `inherit` type bindings cannot + be resolved against the previous version of the Worker. Without this, + unresolvable inherit bindings are silently dropped. + files: An array of modules (often JavaScript files) comprising a Worker script. At least one module must be present and referenced in the metadata as `main_module` or `body_part` by filename.
Possible Content-Type(s) are: @@ -246,6 +251,7 @@ def update( extra_body=extra_body, timeout=timeout, multipart_syntax="json", + query=maybe_transform({"bindings_inherit": bindings_inherit}, script_update_params.ScriptUpdateParams), post_parser=ResultWrapper[ScriptUpdateResponse]._unwrapper, ), cast_to=cast(Type[ScriptUpdateResponse], ResultWrapper[ScriptUpdateResponse]), @@ -520,6 +526,7 @@ async def update( *, account_id: str, metadata: script_update_params.Metadata, + bindings_inherit: Literal["strict"] | Omit = omit, files: SequenceNotStr[FileTypes] | 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. @@ -541,6 +548,10 @@ async def update( metadata: JSON-encoded metadata about the uploaded parts and Worker configuration. + bindings_inherit: When set to "strict", the upload will fail if any `inherit` type bindings cannot + be resolved against the previous version of the Worker. Without this, + unresolvable inherit bindings are silently dropped. + files: An array of modules (often JavaScript files) comprising a Worker script. At least one module must be present and referenced in the metadata as `main_module` or `body_part` by filename.
Possible Content-Type(s) are: @@ -582,6 +593,9 @@ async def update( extra_body=extra_body, timeout=timeout, multipart_syntax="json", + query=await async_maybe_transform( + {"bindings_inherit": bindings_inherit}, script_update_params.ScriptUpdateParams + ), post_parser=ResultWrapper[ScriptUpdateResponse]._unwrapper, ), cast_to=cast(Type[ScriptUpdateResponse], ResultWrapper[ScriptUpdateResponse]), diff --git a/src/cloudflare/resources/workers/scripts/versions.py b/src/cloudflare/resources/workers/scripts/versions.py index 503c9871299..bb39678aaa4 100644 --- a/src/cloudflare/resources/workers/scripts/versions.py +++ b/src/cloudflare/resources/workers/scripts/versions.py @@ -3,6 +3,7 @@ from __future__ import annotations from typing import Type, cast +from typing_extensions import Literal import httpx @@ -63,6 +64,7 @@ def create( *, account_id: str, metadata: version_create_params.Metadata, + bindings_inherit: Literal["strict"] | Omit = omit, files: SequenceNotStr[FileTypes] | 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. @@ -84,6 +86,10 @@ def create( metadata: JSON-encoded metadata about the uploaded parts and Worker configuration. + bindings_inherit: When set to "strict", the upload will fail if any `inherit` type bindings cannot + be resolved against the previous version of the Worker. Without this, + unresolvable inherit bindings are silently dropped. + files: An array of modules (often JavaScript files) comprising a Worker script. At least one module must be present and referenced in the metadata as `main_module` or `body_part` by filename.
Possible Content-Type(s) are: @@ -125,6 +131,9 @@ def create( extra_body=extra_body, timeout=timeout, multipart_syntax="json", + query=maybe_transform( + {"bindings_inherit": bindings_inherit}, version_create_params.VersionCreateParams + ), post_parser=ResultWrapper[VersionCreateResponse]._unwrapper, ), cast_to=cast(Type[VersionCreateResponse], ResultWrapper[VersionCreateResponse]), @@ -266,6 +275,7 @@ async def create( *, account_id: str, metadata: version_create_params.Metadata, + bindings_inherit: Literal["strict"] | Omit = omit, files: SequenceNotStr[FileTypes] | 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. @@ -287,6 +297,10 @@ async def create( metadata: JSON-encoded metadata about the uploaded parts and Worker configuration. + bindings_inherit: When set to "strict", the upload will fail if any `inherit` type bindings cannot + be resolved against the previous version of the Worker. Without this, + unresolvable inherit bindings are silently dropped. + files: An array of modules (often JavaScript files) comprising a Worker script. At least one module must be present and referenced in the metadata as `main_module` or `body_part` by filename.
Possible Content-Type(s) are: @@ -327,6 +341,9 @@ async def create( extra_body=extra_body, timeout=timeout, multipart_syntax="json", + query=await async_maybe_transform( + {"bindings_inherit": bindings_inherit}, version_create_params.VersionCreateParams + ), post_parser=ResultWrapper[VersionCreateResponse]._unwrapper, ), cast_to=cast(Type[VersionCreateResponse], ResultWrapper[VersionCreateResponse]), diff --git a/src/cloudflare/resources/workers_for_platforms/dispatch/namespaces/scripts/scripts.py b/src/cloudflare/resources/workers_for_platforms/dispatch/namespaces/scripts/scripts.py index 04c42ec677a..268afbd1f05 100644 --- a/src/cloudflare/resources/workers_for_platforms/dispatch/namespaces/scripts/scripts.py +++ b/src/cloudflare/resources/workers_for_platforms/dispatch/namespaces/scripts/scripts.py @@ -3,6 +3,7 @@ from __future__ import annotations from typing import Type, Optional, cast +from typing_extensions import Literal import httpx @@ -134,6 +135,7 @@ def update( account_id: str, dispatch_namespace: str, metadata: script_update_params.Metadata, + bindings_inherit: Literal["strict"] | Omit = omit, files: SequenceNotStr[FileTypes] | 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. @@ -157,6 +159,10 @@ def update( metadata: JSON-encoded metadata about the uploaded parts and Worker configuration. + bindings_inherit: When set to "strict", the upload will fail if any `inherit` type bindings cannot + be resolved against the previous version of the script. Without this, + unresolvable inherit bindings are silently dropped. + files: An array of modules (often JavaScript files) comprising a Worker script. At least one module must be present and referenced in the metadata as `main_module` or `body_part` by filename.
Possible Content-Type(s) are: @@ -200,6 +206,7 @@ def update( extra_body=extra_body, timeout=timeout, multipart_syntax="json", + query=maybe_transform({"bindings_inherit": bindings_inherit}, script_update_params.ScriptUpdateParams), post_parser=ResultWrapper[ScriptUpdateResponse]._unwrapper, ), cast_to=cast(Type[ScriptUpdateResponse], ResultWrapper[ScriptUpdateResponse]), @@ -363,6 +370,7 @@ async def update( account_id: str, dispatch_namespace: str, metadata: script_update_params.Metadata, + bindings_inherit: Literal["strict"] | Omit = omit, files: SequenceNotStr[FileTypes] | 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. @@ -386,6 +394,10 @@ async def update( metadata: JSON-encoded metadata about the uploaded parts and Worker configuration. + bindings_inherit: When set to "strict", the upload will fail if any `inherit` type bindings cannot + be resolved against the previous version of the script. Without this, + unresolvable inherit bindings are silently dropped. + files: An array of modules (often JavaScript files) comprising a Worker script. At least one module must be present and referenced in the metadata as `main_module` or `body_part` by filename.
Possible Content-Type(s) are: @@ -429,6 +441,9 @@ async def update( extra_body=extra_body, timeout=timeout, multipart_syntax="json", + query=await async_maybe_transform( + {"bindings_inherit": bindings_inherit}, script_update_params.ScriptUpdateParams + ), post_parser=ResultWrapper[ScriptUpdateResponse]._unwrapper, ), cast_to=cast(Type[ScriptUpdateResponse], ResultWrapper[ScriptUpdateResponse]), diff --git a/src/cloudflare/types/workers/script_update_params.py b/src/cloudflare/types/workers/script_update_params.py index 68ac120a7a1..88b7317ca68 100644 --- a/src/cloudflare/types/workers/script_update_params.py +++ b/src/cloudflare/types/workers/script_update_params.py @@ -79,6 +79,13 @@ class ScriptUpdateParams(TypedDict, total=False): metadata: Required[Metadata] """JSON-encoded metadata about the uploaded parts and Worker configuration.""" + bindings_inherit: Literal["strict"] + """ + When set to "strict", the upload will fail if any `inherit` type bindings cannot + be resolved against the previous version of the Worker. Without this, + unresolvable inherit bindings are silently dropped. + """ + files: SequenceNotStr[FileTypes] """An array of modules (often JavaScript files) comprising a Worker script. diff --git a/src/cloudflare/types/workers/scripts/version_create_params.py b/src/cloudflare/types/workers/scripts/version_create_params.py index 0a489692df3..2699aed3f2d 100644 --- a/src/cloudflare/types/workers/scripts/version_create_params.py +++ b/src/cloudflare/types/workers/scripts/version_create_params.py @@ -56,6 +56,13 @@ class VersionCreateParams(TypedDict, total=False): metadata: Required[Metadata] """JSON-encoded metadata about the uploaded parts and Worker configuration.""" + bindings_inherit: Literal["strict"] + """ + When set to "strict", the upload will fail if any `inherit` type bindings cannot + be resolved against the previous version of the Worker. Without this, + unresolvable inherit bindings are silently dropped. + """ + files: SequenceNotStr[FileTypes] """An array of modules (often JavaScript files) comprising a Worker script. diff --git a/src/cloudflare/types/workers_for_platforms/dispatch/namespaces/script_update_params.py b/src/cloudflare/types/workers_for_platforms/dispatch/namespaces/script_update_params.py index 7ce23ec5cb8..fec52d30d9b 100644 --- a/src/cloudflare/types/workers_for_platforms/dispatch/namespaces/script_update_params.py +++ b/src/cloudflare/types/workers_for_platforms/dispatch/namespaces/script_update_params.py @@ -80,6 +80,13 @@ class ScriptUpdateParams(TypedDict, total=False): metadata: Required[Metadata] """JSON-encoded metadata about the uploaded parts and Worker configuration.""" + bindings_inherit: Literal["strict"] + """ + When set to "strict", the upload will fail if any `inherit` type bindings cannot + be resolved against the previous version of the script. Without this, + unresolvable inherit bindings are silently dropped. + """ + files: SequenceNotStr[FileTypes] """An array of modules (often JavaScript files) comprising a Worker script. diff --git a/tests/api_resources/workers/scripts/test_versions.py b/tests/api_resources/workers/scripts/test_versions.py index fc58f6530c4..5c75f7d38cf 100644 --- a/tests/api_resources/workers/scripts/test_versions.py +++ b/tests/api_resources/workers/scripts/test_versions.py @@ -57,6 +57,7 @@ def test_method_create_with_all_params(self, client: Cloudflare) -> None: "keep_bindings": ["string"], "usage_model": "standard", }, + bindings_inherit="strict", files=[b"raw file contents"], ) assert_matches_type(VersionCreateResponse, version, path=["response"]) @@ -268,6 +269,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncCloudflare "keep_bindings": ["string"], "usage_model": "standard", }, + bindings_inherit="strict", files=[b"raw file contents"], ) assert_matches_type(VersionCreateResponse, version, path=["response"]) diff --git a/tests/api_resources/workers/test_scripts.py b/tests/api_resources/workers/test_scripts.py index 918d9381e43..040d7f2a6f5 100644 --- a/tests/api_resources/workers/test_scripts.py +++ b/tests/api_resources/workers/test_scripts.py @@ -111,6 +111,7 @@ def test_method_update_with_all_params(self, client: Cloudflare) -> None: ], "usage_model": "standard", }, + bindings_inherit="strict", files=[b"raw file contents"], ) assert_matches_type(ScriptUpdateResponse, script, path=["response"]) @@ -462,6 +463,7 @@ async def test_method_update_with_all_params(self, async_client: AsyncCloudflare ], "usage_model": "standard", }, + bindings_inherit="strict", files=[b"raw file contents"], ) assert_matches_type(ScriptUpdateResponse, script, path=["response"]) diff --git a/tests/api_resources/workers_for_platforms/dispatch/namespaces/test_scripts.py b/tests/api_resources/workers_for_platforms/dispatch/namespaces/test_scripts.py index a2c8aea6fa7..9c271540255 100644 --- a/tests/api_resources/workers_for_platforms/dispatch/namespaces/test_scripts.py +++ b/tests/api_resources/workers_for_platforms/dispatch/namespaces/test_scripts.py @@ -107,6 +107,7 @@ def test_method_update_with_all_params(self, client: Cloudflare) -> None: ], "usage_model": "standard", }, + bindings_inherit="strict", files=[b"raw file contents"], ) assert_matches_type(ScriptUpdateResponse, script, path=["response"]) @@ -393,6 +394,7 @@ async def test_method_update_with_all_params(self, async_client: AsyncCloudflare ], "usage_model": "standard", }, + bindings_inherit="strict", files=[b"raw file contents"], ) assert_matches_type(ScriptUpdateResponse, script, path=["response"]) From 77984d017d5233928992070f2bb2053aba7bdc99 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 24 Feb 2026 15:14:17 +0000 Subject: [PATCH 031/279] chore(api): update composite API spec --- .stats.yml | 4 ++-- .../resources/aisearch/instances/instances.py | 20 +++++++++++-------- .../resources/aisearch/instances/items.py | 8 ++++---- .../resources/aisearch/instances/jobs.py | 16 +++++++-------- src/cloudflare/resources/aisearch/tokens.py | 4 ++-- .../maintenance_config_get_response.py | 6 +++--- .../maintenance_config_update_response.py | 6 +++--- .../tables/maintenance_config_get_response.py | 6 +++--- .../maintenance_config_update_response.py | 6 +++--- .../r2_data_catalog_get_response.py | 6 +++--- .../r2_data_catalog_list_response.py | 6 +++--- 11 files changed, 46 insertions(+), 42 deletions(-) diff --git a/.stats.yml b/.stats.yml index efd2ad82090..17647131876 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 2032 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-5af3d0808c800cfdd014e153ae6d5f7e68963e86ba3ed8ea63a9d2fbcf7fb412.yml -openapi_spec_hash: 8b8b7ba494d2c1087814c805e0779ff2 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-51e2a9cabf927a3a5ef51f73605970ce7f031ad42beb85053bfafce88bb44b13.yml +openapi_spec_hash: 03e9bc6c527a7fa74366ec0b131d4304 config_hash: 405e0229a3b5214d99c53598e78f85a1 diff --git a/src/cloudflare/resources/aisearch/instances/instances.py b/src/cloudflare/resources/aisearch/instances/instances.py index 648c0dadf83..256d55b0ba3 100644 --- a/src/cloudflare/resources/aisearch/instances/instances.py +++ b/src/cloudflare/resources/aisearch/instances/instances.py @@ -188,7 +188,7 @@ def create( timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> InstanceCreateResponse: """ - Create new instances. + Create a new instances. Args: id: Use your AI Search ID. @@ -586,7 +586,8 @@ def chat_completions( timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> InstanceChatCompletionsResponse: """ - Chat Completions + Performs a chat completion request against an AI Search instance, using indexed + content as context for generating responses. Args: id: Use your AI Search ID. @@ -677,7 +678,8 @@ def search( timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> InstanceSearchResponse: """ - Search + Executes a semantic search query against an AI Search instance to find relevant + indexed content. Args: id: Use your AI Search ID. @@ -726,7 +728,7 @@ def stats( timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> InstanceStatsResponse: """ - Stats + Retrieves usage statistics for AI Search instances. Args: id: Use your AI Search ID. @@ -889,7 +891,7 @@ async def create( timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> InstanceCreateResponse: """ - Create new instances. + Create a new instances. Args: id: Use your AI Search ID. @@ -1287,7 +1289,8 @@ async def chat_completions( timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> InstanceChatCompletionsResponse: """ - Chat Completions + Performs a chat completion request against an AI Search instance, using indexed + content as context for generating responses. Args: id: Use your AI Search ID. @@ -1378,7 +1381,8 @@ async def search( timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> InstanceSearchResponse: """ - Search + Executes a semantic search query against an AI Search instance to find relevant + indexed content. Args: id: Use your AI Search ID. @@ -1427,7 +1431,7 @@ async def stats( timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> InstanceStatsResponse: """ - Stats + Retrieves usage statistics for AI Search instances. Args: id: Use your AI Search ID. diff --git a/src/cloudflare/resources/aisearch/instances/items.py b/src/cloudflare/resources/aisearch/instances/items.py index 7ed961721d2..eaa492c2593 100644 --- a/src/cloudflare/resources/aisearch/instances/items.py +++ b/src/cloudflare/resources/aisearch/instances/items.py @@ -64,7 +64,7 @@ def list( timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SyncV4PagePaginationArray[ItemListResponse]: """ - Items List. + Lists indexed items in an AI Search instance. Args: id: Use your AI Search ID. @@ -116,7 +116,7 @@ def get( timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> ItemGetResponse: """ - Get Item. + Retrieves a specific indexed item from an AI Search instance. Args: id: Use your AI Search ID. @@ -185,7 +185,7 @@ def list( timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AsyncPaginator[ItemListResponse, AsyncV4PagePaginationArray[ItemListResponse]]: """ - Items List. + Lists indexed items in an AI Search instance. Args: id: Use your AI Search ID. @@ -237,7 +237,7 @@ async def get( timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> ItemGetResponse: """ - Get Item. + Retrieves a specific indexed item from an AI Search instance. Args: id: Use your AI Search ID. diff --git a/src/cloudflare/resources/aisearch/instances/jobs.py b/src/cloudflare/resources/aisearch/instances/jobs.py index 2c6bb4226f5..d5c03bf6e7a 100644 --- a/src/cloudflare/resources/aisearch/instances/jobs.py +++ b/src/cloudflare/resources/aisearch/instances/jobs.py @@ -61,7 +61,7 @@ def create( timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> JobCreateResponse: """ - Create new job + Creates a new indexing job for an AI Search instance. Args: id: Use your AI Search ID. @@ -105,7 +105,7 @@ def list( timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SyncV4PagePaginationArray[JobListResponse]: """ - List Jobs + Lists indexing jobs for an AI Search instance. Args: id: Use your AI Search ID. @@ -155,7 +155,7 @@ def get( timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> JobGetResponse: """ - Get a Job Details + Retrieves details for a specific AI Search indexing job. Args: id: Use your AI Search ID. @@ -202,7 +202,7 @@ def logs( timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> JobLogsResponse: """ - List Job Logs + Lists log entries for an AI Search indexing job. Args: id: Use your AI Search ID. @@ -274,7 +274,7 @@ async def create( timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> JobCreateResponse: """ - Create new job + Creates a new indexing job for an AI Search instance. Args: id: Use your AI Search ID. @@ -318,7 +318,7 @@ def list( timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AsyncPaginator[JobListResponse, AsyncV4PagePaginationArray[JobListResponse]]: """ - List Jobs + Lists indexing jobs for an AI Search instance. Args: id: Use your AI Search ID. @@ -368,7 +368,7 @@ async def get( timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> JobGetResponse: """ - Get a Job Details + Retrieves details for a specific AI Search indexing job. Args: id: Use your AI Search ID. @@ -415,7 +415,7 @@ async def logs( timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> JobLogsResponse: """ - List Job Logs + Lists log entries for an AI Search indexing job. Args: id: Use your AI Search ID. diff --git a/src/cloudflare/resources/aisearch/tokens.py b/src/cloudflare/resources/aisearch/tokens.py index 1834a9b0c6a..8916dfecec0 100644 --- a/src/cloudflare/resources/aisearch/tokens.py +++ b/src/cloudflare/resources/aisearch/tokens.py @@ -64,7 +64,7 @@ def create( timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> TokenCreateResponse: """ - Create new tokens. + Create a new tokens. Args: extra_headers: Send extra headers @@ -310,7 +310,7 @@ async def create( timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> TokenCreateResponse: """ - Create new tokens. + Create a new tokens. Args: extra_headers: Send extra headers diff --git a/src/cloudflare/types/r2_data_catalog/maintenance_config_get_response.py b/src/cloudflare/types/r2_data_catalog/maintenance_config_get_response.py index 9ebe48d78ea..c432da1104a 100644 --- a/src/cloudflare/types/r2_data_catalog/maintenance_config_get_response.py +++ b/src/cloudflare/types/r2_data_catalog/maintenance_config_get_response.py @@ -20,7 +20,7 @@ class MaintenanceConfigCompaction(BaseModel): """Specifies the state of maintenance operations.""" target_size_mb: Literal["64", "128", "256", "512"] - """Sets the target file size for compaction in megabytes.""" + """Sets the target file size for compaction in megabytes. Defaults to "128".""" class MaintenanceConfigSnapshotExpiration(BaseModel): @@ -31,11 +31,11 @@ class MaintenanceConfigSnapshotExpiration(BaseModel): The system deletes snapshots older than this age. Format: where unit is d (days), h (hours), m (minutes), or s (seconds). Examples: "7d" (7 - days), "48h" (48 hours), "2880m" (2,880 minutes). + days), "48h" (48 hours), "2880m" (2,880 minutes). Defaults to "7d". """ min_snapshots_to_keep: int - """Specifies the minimum number of snapshots to retain.""" + """Specifies the minimum number of snapshots to retain. Defaults to 100.""" state: Literal["enabled", "disabled"] """Specifies the state of maintenance operations.""" diff --git a/src/cloudflare/types/r2_data_catalog/maintenance_config_update_response.py b/src/cloudflare/types/r2_data_catalog/maintenance_config_update_response.py index bdb91220498..31c1e36fe18 100644 --- a/src/cloudflare/types/r2_data_catalog/maintenance_config_update_response.py +++ b/src/cloudflare/types/r2_data_catalog/maintenance_config_update_response.py @@ -15,7 +15,7 @@ class Compaction(BaseModel): """Specifies the state of maintenance operations.""" target_size_mb: Literal["64", "128", "256", "512"] - """Sets the target file size for compaction in megabytes.""" + """Sets the target file size for compaction in megabytes. Defaults to "128".""" class SnapshotExpiration(BaseModel): @@ -26,11 +26,11 @@ class SnapshotExpiration(BaseModel): The system deletes snapshots older than this age. Format: where unit is d (days), h (hours), m (minutes), or s (seconds). Examples: "7d" (7 - days), "48h" (48 hours), "2880m" (2,880 minutes). + days), "48h" (48 hours), "2880m" (2,880 minutes). Defaults to "7d". """ min_snapshots_to_keep: int - """Specifies the minimum number of snapshots to retain.""" + """Specifies the minimum number of snapshots to retain. Defaults to 100.""" state: Literal["enabled", "disabled"] """Specifies the state of maintenance operations.""" diff --git a/src/cloudflare/types/r2_data_catalog/namespaces/tables/maintenance_config_get_response.py b/src/cloudflare/types/r2_data_catalog/namespaces/tables/maintenance_config_get_response.py index 89cb6fa5e7c..e637e1a7ade 100644 --- a/src/cloudflare/types/r2_data_catalog/namespaces/tables/maintenance_config_get_response.py +++ b/src/cloudflare/types/r2_data_catalog/namespaces/tables/maintenance_config_get_response.py @@ -20,7 +20,7 @@ class MaintenanceConfigCompaction(BaseModel): """Specifies the state of maintenance operations.""" target_size_mb: Literal["64", "128", "256", "512"] - """Sets the target file size for compaction in megabytes.""" + """Sets the target file size for compaction in megabytes. Defaults to "128".""" class MaintenanceConfigSnapshotExpiration(BaseModel): @@ -31,11 +31,11 @@ class MaintenanceConfigSnapshotExpiration(BaseModel): The system deletes snapshots older than this age. Format: where unit is d (days), h (hours), m (minutes), or s (seconds). Examples: "7d" (7 - days), "48h" (48 hours), "2880m" (2,880 minutes). + days), "48h" (48 hours), "2880m" (2,880 minutes). Defaults to "7d". """ min_snapshots_to_keep: int - """Specifies the minimum number of snapshots to retain.""" + """Specifies the minimum number of snapshots to retain. Defaults to 100.""" state: Literal["enabled", "disabled"] """Specifies the state of maintenance operations.""" diff --git a/src/cloudflare/types/r2_data_catalog/namespaces/tables/maintenance_config_update_response.py b/src/cloudflare/types/r2_data_catalog/namespaces/tables/maintenance_config_update_response.py index 776dbd6865f..fb164d53be7 100644 --- a/src/cloudflare/types/r2_data_catalog/namespaces/tables/maintenance_config_update_response.py +++ b/src/cloudflare/types/r2_data_catalog/namespaces/tables/maintenance_config_update_response.py @@ -15,7 +15,7 @@ class Compaction(BaseModel): """Specifies the state of maintenance operations.""" target_size_mb: Literal["64", "128", "256", "512"] - """Sets the target file size for compaction in megabytes.""" + """Sets the target file size for compaction in megabytes. Defaults to "128".""" class SnapshotExpiration(BaseModel): @@ -26,11 +26,11 @@ class SnapshotExpiration(BaseModel): The system deletes snapshots older than this age. Format: where unit is d (days), h (hours), m (minutes), or s (seconds). Examples: "7d" (7 - days), "48h" (48 hours), "2880m" (2,880 minutes). + days), "48h" (48 hours), "2880m" (2,880 minutes). Defaults to "7d". """ min_snapshots_to_keep: int - """Specifies the minimum number of snapshots to retain.""" + """Specifies the minimum number of snapshots to retain. Defaults to 100.""" state: Literal["enabled", "disabled"] """Specifies the state of maintenance operations.""" diff --git a/src/cloudflare/types/r2_data_catalog/r2_data_catalog_get_response.py b/src/cloudflare/types/r2_data_catalog/r2_data_catalog_get_response.py index ff9070993a4..e5e3bf0cad3 100644 --- a/src/cloudflare/types/r2_data_catalog/r2_data_catalog_get_response.py +++ b/src/cloudflare/types/r2_data_catalog/r2_data_catalog_get_response.py @@ -20,7 +20,7 @@ class MaintenanceConfigCompaction(BaseModel): """Specifies the state of maintenance operations.""" target_size_mb: Literal["64", "128", "256", "512"] - """Sets the target file size for compaction in megabytes.""" + """Sets the target file size for compaction in megabytes. Defaults to "128".""" class MaintenanceConfigSnapshotExpiration(BaseModel): @@ -31,11 +31,11 @@ class MaintenanceConfigSnapshotExpiration(BaseModel): The system deletes snapshots older than this age. Format: where unit is d (days), h (hours), m (minutes), or s (seconds). Examples: "7d" (7 - days), "48h" (48 hours), "2880m" (2,880 minutes). + days), "48h" (48 hours), "2880m" (2,880 minutes). Defaults to "7d". """ min_snapshots_to_keep: int - """Specifies the minimum number of snapshots to retain.""" + """Specifies the minimum number of snapshots to retain. Defaults to 100.""" state: Literal["enabled", "disabled"] """Specifies the state of maintenance operations.""" diff --git a/src/cloudflare/types/r2_data_catalog/r2_data_catalog_list_response.py b/src/cloudflare/types/r2_data_catalog/r2_data_catalog_list_response.py index 42451956047..4425a6794dc 100644 --- a/src/cloudflare/types/r2_data_catalog/r2_data_catalog_list_response.py +++ b/src/cloudflare/types/r2_data_catalog/r2_data_catalog_list_response.py @@ -21,7 +21,7 @@ class WarehouseMaintenanceConfigCompaction(BaseModel): """Specifies the state of maintenance operations.""" target_size_mb: Literal["64", "128", "256", "512"] - """Sets the target file size for compaction in megabytes.""" + """Sets the target file size for compaction in megabytes. Defaults to "128".""" class WarehouseMaintenanceConfigSnapshotExpiration(BaseModel): @@ -32,11 +32,11 @@ class WarehouseMaintenanceConfigSnapshotExpiration(BaseModel): The system deletes snapshots older than this age. Format: where unit is d (days), h (hours), m (minutes), or s (seconds). Examples: "7d" (7 - days), "48h" (48 hours), "2880m" (2,880 minutes). + days), "48h" (48 hours), "2880m" (2,880 minutes). Defaults to "7d". """ min_snapshots_to_keep: int - """Specifies the minimum number of snapshots to retain.""" + """Specifies the minimum number of snapshots to retain. Defaults to 100.""" state: Literal["enabled", "disabled"] """Specifies the state of maintenance operations.""" From 4d0d80ec8abc912f36a3c903070d9b6bb3190b24 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 24 Feb 2026 15:56:42 +0000 Subject: [PATCH 032/279] chore(api): update composite API spec --- .stats.yml | 4 +-- .../custom_certificates.py | 8 +++-- .../custom_hostnames/custom_hostnames.py | 12 ++++--- .../custom_hostnames/fallback_origin.py | 32 +++++++++++++------ .../resources/keyless_certificates.py | 18 +++++++---- .../hostname_certificates.py | 18 ++++++++--- .../origin_tls_client_auth/hostnames.py | 6 ++-- .../origin_tls_client_auth.py | 16 ++++++---- .../zone_certificates.py | 16 ++++++---- 9 files changed, 88 insertions(+), 42 deletions(-) diff --git a/.stats.yml b/.stats.yml index 17647131876..110e8004d7f 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 2032 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-51e2a9cabf927a3a5ef51f73605970ce7f031ad42beb85053bfafce88bb44b13.yml -openapi_spec_hash: 03e9bc6c527a7fa74366ec0b131d4304 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-3f05b0cfd63f8ee055d6fa2eff6e93835eb8ccee8c1562257fbb7704e7908ad3.yml +openapi_spec_hash: c58887a3642414381c0f2b4218b26ea9 config_hash: 405e0229a3b5214d99c53598e78f85a1 diff --git a/src/cloudflare/resources/custom_certificates/custom_certificates.py b/src/cloudflare/resources/custom_certificates/custom_certificates.py index 683568fa652..2e9c11871fd 100644 --- a/src/cloudflare/resources/custom_certificates/custom_certificates.py +++ b/src/cloudflare/resources/custom_certificates/custom_certificates.py @@ -379,7 +379,9 @@ def get( timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[CustomCertificate]: """ - SSL Configuration Details + Retrieves details for a specific custom SSL certificate, including certificate + metadata, bundle method, geographic restrictions, and associated keyless server + configuration. Args: zone_id: Identifier. @@ -750,7 +752,9 @@ async def get( timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[CustomCertificate]: """ - SSL Configuration Details + Retrieves details for a specific custom SSL certificate, including certificate + metadata, bundle method, geographic restrictions, and associated keyless server + configuration. Args: zone_id: Identifier. diff --git a/src/cloudflare/resources/custom_hostnames/custom_hostnames.py b/src/cloudflare/resources/custom_hostnames/custom_hostnames.py index aa342d44e05..2600edcb6dd 100644 --- a/src/cloudflare/resources/custom_hostnames/custom_hostnames.py +++ b/src/cloudflare/resources/custom_hostnames/custom_hostnames.py @@ -232,7 +232,8 @@ def delete( timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> CustomHostnameDeleteResponse: """ - Delete Custom Hostname (and any issued SSL certificates) + Permanently deletes a custom hostname and revokes any SSL certificates that were + issued for it. This action cannot be undone. Args: zone_id: Identifier. @@ -350,7 +351,8 @@ def get( timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[CustomHostnameGetResponse]: """ - Custom Hostname Details + Retrieves detailed information about a specific custom hostname, including SSL + certificate status, ownership verification, and origin configuration. Args: zone_id: Identifier. @@ -564,7 +566,8 @@ async def delete( timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> CustomHostnameDeleteResponse: """ - Delete Custom Hostname (and any issued SSL certificates) + Permanently deletes a custom hostname and revokes any SSL certificates that were + issued for it. This action cannot be undone. Args: zone_id: Identifier. @@ -682,7 +685,8 @@ async def get( timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[CustomHostnameGetResponse]: """ - Custom Hostname Details + Retrieves detailed information about a specific custom hostname, including SSL + certificate status, ownership verification, and origin configuration. Args: zone_id: Identifier. diff --git a/src/cloudflare/resources/custom_hostnames/fallback_origin.py b/src/cloudflare/resources/custom_hostnames/fallback_origin.py index 3fec4f02098..97e7faf3aff 100644 --- a/src/cloudflare/resources/custom_hostnames/fallback_origin.py +++ b/src/cloudflare/resources/custom_hostnames/fallback_origin.py @@ -58,8 +58,10 @@ def update( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[FallbackOriginUpdateResponse]: - """ - Update Fallback Origin for Custom Hostnames + """Updates the fallback origin configuration for custom hostnames on a zone. + + Sets + the default origin server for custom hostname traffic. Args: zone_id: Identifier. @@ -100,8 +102,10 @@ def delete( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[FallbackOriginDeleteResponse]: - """ - Delete Fallback Origin for Custom Hostnames + """Removes the fallback origin configuration for custom hostnames on a zone. + + Custom + hostnames without specific origins will no longer have a fallback. Args: zone_id: Identifier. @@ -140,7 +144,9 @@ def get( timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[FallbackOriginGetResponse]: """ - Get Fallback Origin for Custom Hostnames + Retrieves the current fallback origin configuration for custom hostnames on a + zone. The fallback origin handles traffic when specific custom hostname origins + are unavailable. Args: zone_id: Identifier. @@ -200,8 +206,10 @@ async def update( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[FallbackOriginUpdateResponse]: - """ - Update Fallback Origin for Custom Hostnames + """Updates the fallback origin configuration for custom hostnames on a zone. + + Sets + the default origin server for custom hostname traffic. Args: zone_id: Identifier. @@ -244,8 +252,10 @@ async def delete( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[FallbackOriginDeleteResponse]: - """ - Delete Fallback Origin for Custom Hostnames + """Removes the fallback origin configuration for custom hostnames on a zone. + + Custom + hostnames without specific origins will no longer have a fallback. Args: zone_id: Identifier. @@ -284,7 +294,9 @@ async def get( timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[FallbackOriginGetResponse]: """ - Get Fallback Origin for Custom Hostnames + Retrieves the current fallback origin configuration for custom hostnames on a + zone. The fallback origin handles traffic when specific custom hostname origins + are unavailable. Args: zone_id: Identifier. diff --git a/src/cloudflare/resources/keyless_certificates.py b/src/cloudflare/resources/keyless_certificates.py index e7406b9ad41..8b0180c31d5 100644 --- a/src/cloudflare/resources/keyless_certificates.py +++ b/src/cloudflare/resources/keyless_certificates.py @@ -67,7 +67,8 @@ def create( timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[KeylessCertificate]: """ - Create Keyless SSL Configuration + Creates a Keyless SSL configuration that allows SSL/TLS termination without + exposing private keys to Cloudflare. Keys remain on your infrastructure. Args: zone_id: Identifier. @@ -169,8 +170,10 @@ def delete( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[KeylessCertificateDeleteResponse]: - """ - Delete Keyless SSL Configuration + """Removes a Keyless SSL configuration. + + SSL connections will no longer use the + keyless server for cryptographic operations. Args: zone_id: Identifier. @@ -364,7 +367,8 @@ async def create( timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[KeylessCertificate]: """ - Create Keyless SSL Configuration + Creates a Keyless SSL configuration that allows SSL/TLS termination without + exposing private keys to Cloudflare. Keys remain on your infrastructure. Args: zone_id: Identifier. @@ -466,8 +470,10 @@ async def delete( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[KeylessCertificateDeleteResponse]: - """ - Delete Keyless SSL Configuration + """Removes a Keyless SSL configuration. + + SSL connections will no longer use the + keyless server for cryptographic operations. Args: zone_id: Identifier. diff --git a/src/cloudflare/resources/origin_tls_client_auth/hostname_certificates.py b/src/cloudflare/resources/origin_tls_client_auth/hostname_certificates.py index f95b8739151..34a887f7db5 100644 --- a/src/cloudflare/resources/origin_tls_client_auth/hostname_certificates.py +++ b/src/cloudflare/resources/origin_tls_client_auth/hostname_certificates.py @@ -116,7 +116,8 @@ def list( timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SyncSinglePage[HostnameCertificateListResponse]: """ - List Certificates + Lists all client certificates configured for per-hostname authenticated origin + pulls on the zone. Args: zone_id: Identifier. @@ -153,7 +154,11 @@ def delete( timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[HostnameCertificateDeleteResponse]: """ - Delete Hostname Client Certificate + Removes a client certificate used for authenticated origin pulls on a specific + hostname. Note: Before deleting the certificate, you must first invalidate the + hostname for client authentication by sending a PUT request with `enabled` set + to null. After invalidating the association, the certificate can be safely + deleted. Args: zone_id: Identifier. @@ -319,7 +324,8 @@ def list( timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AsyncPaginator[HostnameCertificateListResponse, AsyncSinglePage[HostnameCertificateListResponse]]: """ - List Certificates + Lists all client certificates configured for per-hostname authenticated origin + pulls on the zone. Args: zone_id: Identifier. @@ -356,7 +362,11 @@ async def delete( timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[HostnameCertificateDeleteResponse]: """ - Delete Hostname Client Certificate + Removes a client certificate used for authenticated origin pulls on a specific + hostname. Note: Before deleting the certificate, you must first invalidate the + hostname for client authentication by sending a PUT request with `enabled` set + to null. After invalidating the association, the certificate can be safely + deleted. Args: zone_id: Identifier. diff --git a/src/cloudflare/resources/origin_tls_client_auth/hostnames.py b/src/cloudflare/resources/origin_tls_client_auth/hostnames.py index a4f59591ae7..7ea1313f8e5 100644 --- a/src/cloudflare/resources/origin_tls_client_auth/hostnames.py +++ b/src/cloudflare/resources/origin_tls_client_auth/hostnames.py @@ -102,7 +102,8 @@ def get( timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[AuthenticatedOriginPull]: """ - Get the Hostname Status for Client Authentication + Retrieves the client certificate authentication status for a specific hostname, + showing whether authenticated origin pulls are enabled. Args: zone_id: Identifier. @@ -211,7 +212,8 @@ async def get( timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[AuthenticatedOriginPull]: """ - Get the Hostname Status for Client Authentication + Retrieves the client certificate authentication status for a specific hostname, + showing whether authenticated origin pulls are enabled. Args: zone_id: Identifier. diff --git a/src/cloudflare/resources/origin_tls_client_auth/origin_tls_client_auth.py b/src/cloudflare/resources/origin_tls_client_auth/origin_tls_client_auth.py index 1f418d7b2c4..7db340c4549 100644 --- a/src/cloudflare/resources/origin_tls_client_auth/origin_tls_client_auth.py +++ b/src/cloudflare/resources/origin_tls_client_auth/origin_tls_client_auth.py @@ -173,7 +173,8 @@ def list( timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SyncSinglePage[OriginTLSClientAuthListResponse]: """ - List Certificates + Lists all client certificates configured for zone-level authenticated origin + pulls. Args: zone_id: Identifier. @@ -213,7 +214,7 @@ def delete( timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[OriginTLSClientAuthDeleteResponse]: """ - Delete Certificate + Removes a client certificate used for zone-level authenticated origin pulls. Args: zone_id: Identifier. @@ -262,7 +263,8 @@ def get( timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[OriginTLSClientAuthGetResponse]: """ - Get Certificate Details + Retrieves details for a specific client certificate used in zone-level + authenticated origin pulls. Args: zone_id: Identifier. @@ -406,7 +408,8 @@ def list( timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AsyncPaginator[OriginTLSClientAuthListResponse, AsyncSinglePage[OriginTLSClientAuthListResponse]]: """ - List Certificates + Lists all client certificates configured for zone-level authenticated origin + pulls. Args: zone_id: Identifier. @@ -446,7 +449,7 @@ async def delete( timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[OriginTLSClientAuthDeleteResponse]: """ - Delete Certificate + Removes a client certificate used for zone-level authenticated origin pulls. Args: zone_id: Identifier. @@ -495,7 +498,8 @@ async def get( timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[OriginTLSClientAuthGetResponse]: """ - Get Certificate Details + Retrieves details for a specific client certificate used in zone-level + authenticated origin pulls. Args: zone_id: Identifier. diff --git a/src/cloudflare/resources/origin_tls_client_auth/zone_certificates.py b/src/cloudflare/resources/origin_tls_client_auth/zone_certificates.py index 8056208ce43..b424f4e36f0 100644 --- a/src/cloudflare/resources/origin_tls_client_auth/zone_certificates.py +++ b/src/cloudflare/resources/origin_tls_client_auth/zone_certificates.py @@ -116,7 +116,8 @@ def list( timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SyncSinglePage[ZoneCertificateListResponse]: """ - List Certificates + Lists all client certificates configured for zone-level authenticated origin + pulls. Args: zone_id: Identifier. @@ -153,7 +154,7 @@ def delete( timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[ZoneCertificateDeleteResponse]: """ - Delete Certificate + Removes a client certificate used for zone-level authenticated origin pulls. Args: zone_id: Identifier. @@ -197,7 +198,8 @@ def get( timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[ZoneCertificateGetResponse]: """ - Get Certificate Details + Retrieves details for a specific client certificate used in zone-level + authenticated origin pulls. Args: zone_id: Identifier. @@ -317,7 +319,8 @@ def list( timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AsyncPaginator[ZoneCertificateListResponse, AsyncSinglePage[ZoneCertificateListResponse]]: """ - List Certificates + Lists all client certificates configured for zone-level authenticated origin + pulls. Args: zone_id: Identifier. @@ -354,7 +357,7 @@ async def delete( timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[ZoneCertificateDeleteResponse]: """ - Delete Certificate + Removes a client certificate used for zone-level authenticated origin pulls. Args: zone_id: Identifier. @@ -398,7 +401,8 @@ async def get( timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[ZoneCertificateGetResponse]: """ - Get Certificate Details + Retrieves details for a specific client certificate used in zone-level + authenticated origin pulls. Args: zone_id: Identifier. From dd86a6d78421df0c111d6890c28cd44e1b6ac9bc Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 24 Feb 2026 17:02:50 +0000 Subject: [PATCH 033/279] chore(api): update composite API spec --- .stats.yml | 4 ++-- src/cloudflare/resources/resource_sharing/recipients.py | 6 ++++-- .../resources/resource_sharing/resource_sharing.py | 6 ++++-- src/cloudflare/resources/resource_sharing/resources.py | 4 ++-- 4 files changed, 12 insertions(+), 8 deletions(-) diff --git a/.stats.yml b/.stats.yml index 110e8004d7f..cee615f0470 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 2032 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-3f05b0cfd63f8ee055d6fa2eff6e93835eb8ccee8c1562257fbb7704e7908ad3.yml -openapi_spec_hash: c58887a3642414381c0f2b4218b26ea9 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-e5f96bc0311217f8e6279d00e26b25b7a4646f7e8b64f4b2756abc7ca1680d80.yml +openapi_spec_hash: b0bf6a07e46bb34b268c8147c4572447 config_hash: 405e0229a3b5214d99c53598e78f85a1 diff --git a/src/cloudflare/resources/resource_sharing/recipients.py b/src/cloudflare/resources/resource_sharing/recipients.py index 317084c89ac..828a348060a 100644 --- a/src/cloudflare/resources/resource_sharing/recipients.py +++ b/src/cloudflare/resources/resource_sharing/recipients.py @@ -63,7 +63,8 @@ def create( timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[RecipientCreateResponse]: """ - Create a new share recipient + Adds a recipient to a resource share, granting them access to the shared + resources. Args: path_account_id: Account identifier. @@ -307,7 +308,8 @@ async def create( timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[RecipientCreateResponse]: """ - Create a new share recipient + Adds a recipient to a resource share, granting them access to the shared + resources. Args: path_account_id: Account identifier. diff --git a/src/cloudflare/resources/resource_sharing/resource_sharing.py b/src/cloudflare/resources/resource_sharing/resource_sharing.py index 88d07b557b1..0ad7712a109 100644 --- a/src/cloudflare/resources/resource_sharing/resource_sharing.py +++ b/src/cloudflare/resources/resource_sharing/resource_sharing.py @@ -94,7 +94,8 @@ def create( timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[ResourceSharingCreateResponse]: """ - Create a new share + Creates a new resource share for sharing Cloudflare resources with other + accounts or organizations. Args: account_id: Account identifier. @@ -420,7 +421,8 @@ async def create( timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[ResourceSharingCreateResponse]: """ - Create a new share + Creates a new resource share for sharing Cloudflare resources with other + accounts or organizations. Args: account_id: Account identifier. diff --git a/src/cloudflare/resources/resource_sharing/resources.py b/src/cloudflare/resources/resource_sharing/resources.py index ec35ed84afd..98f316493b6 100644 --- a/src/cloudflare/resources/resource_sharing/resources.py +++ b/src/cloudflare/resources/resource_sharing/resources.py @@ -74,7 +74,7 @@ def create( timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[ResourceCreateResponse]: """ - Create a new share resource + Adds a resource to an existing share, making it available to share recipients. Args: account_id: Account identifier. @@ -393,7 +393,7 @@ async def create( timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[ResourceCreateResponse]: """ - Create a new share resource + Adds a resource to an existing share, making it available to share recipients. Args: account_id: Account identifier. From 81877fbdfb72658e98d681562970c83a9726b965 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 24 Feb 2026 17:25:04 +0000 Subject: [PATCH 034/279] chore(api): update composite API spec --- .stats.yml | 4 ++-- .../intel/indicator_feeds/indicator_feeds.py | 20 +++++++++---------- .../intel/indicator_feeds/permissions.py | 12 +++++------ .../intel/indicator_feeds/snapshots.py | 4 ++-- 4 files changed, 20 insertions(+), 20 deletions(-) diff --git a/.stats.yml b/.stats.yml index cee615f0470..905bbee2f12 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 2032 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-e5f96bc0311217f8e6279d00e26b25b7a4646f7e8b64f4b2756abc7ca1680d80.yml -openapi_spec_hash: b0bf6a07e46bb34b268c8147c4572447 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-0cc9fbc9b8f8013e721d0f8aeda101d140180c403351a773d7b8f381ffdf8ee3.yml +openapi_spec_hash: d6351a383c11f634a5607aa46deb4169 config_hash: 405e0229a3b5214d99c53598e78f85a1 diff --git a/src/cloudflare/resources/intel/indicator_feeds/indicator_feeds.py b/src/cloudflare/resources/intel/indicator_feeds/indicator_feeds.py index 4123cc30790..a7e90acb640 100644 --- a/src/cloudflare/resources/intel/indicator_feeds/indicator_feeds.py +++ b/src/cloudflare/resources/intel/indicator_feeds/indicator_feeds.py @@ -86,7 +86,7 @@ def create( timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[IndicatorFeedCreateResponse]: """ - Create new indicator feed + Creates a new custom threat indicator feed for sharing threat intelligence data. Args: account_id: Identifier @@ -142,7 +142,7 @@ def update( timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[IndicatorFeedUpdateResponse]: """ - Update indicator feed metadata + Retrieves the raw data entries in a custom threat indicator feed. Args: account_id: Identifier @@ -203,7 +203,7 @@ def list( timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SyncSinglePage[IndicatorFeedListResponse]: """ - Get indicator feeds owned by this account + Retrieves details for a specific custom threat indicator feed. Args: account_id: Identifier @@ -240,7 +240,7 @@ def data( timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> str: """ - Get indicator feed data + Retrieves the raw data entries in a custom threat indicator feed. Args: account_id: Identifier @@ -279,7 +279,7 @@ def get( timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[IndicatorFeedGetResponse]: """ - Get indicator feed metadata + Retrieves the raw data entries in a custom threat indicator feed. Args: account_id: Identifier @@ -351,7 +351,7 @@ async def create( timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[IndicatorFeedCreateResponse]: """ - Create new indicator feed + Creates a new custom threat indicator feed for sharing threat intelligence data. Args: account_id: Identifier @@ -407,7 +407,7 @@ async def update( timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[IndicatorFeedUpdateResponse]: """ - Update indicator feed metadata + Retrieves the raw data entries in a custom threat indicator feed. Args: account_id: Identifier @@ -468,7 +468,7 @@ def list( timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AsyncPaginator[IndicatorFeedListResponse, AsyncSinglePage[IndicatorFeedListResponse]]: """ - Get indicator feeds owned by this account + Retrieves details for a specific custom threat indicator feed. Args: account_id: Identifier @@ -505,7 +505,7 @@ async def data( timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> str: """ - Get indicator feed data + Retrieves the raw data entries in a custom threat indicator feed. Args: account_id: Identifier @@ -544,7 +544,7 @@ async def get( timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[IndicatorFeedGetResponse]: """ - Get indicator feed metadata + Retrieves the raw data entries in a custom threat indicator feed. Args: account_id: Identifier diff --git a/src/cloudflare/resources/intel/indicator_feeds/permissions.py b/src/cloudflare/resources/intel/indicator_feeds/permissions.py index fc98e15a3a9..678794ced06 100644 --- a/src/cloudflare/resources/intel/indicator_feeds/permissions.py +++ b/src/cloudflare/resources/intel/indicator_feeds/permissions.py @@ -60,7 +60,7 @@ def create( timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[PermissionCreateResponse]: """ - Grant permission to indicator feed + Grants access permissions for a custom threat indicator feed to other accounts. Args: account_id: Identifier @@ -110,7 +110,7 @@ def list( timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[PermissionListResponse]: """ - List indicator feed permissions + Lists current access permissions for custom threat indicator feeds. Args: account_id: Identifier @@ -151,7 +151,7 @@ def delete( timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[PermissionDeleteResponse]: """ - Revoke permission to indicator feed + Revokes access permissions for a custom threat indicator feed. Args: account_id: Identifier @@ -224,7 +224,7 @@ async def create( timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[PermissionCreateResponse]: """ - Grant permission to indicator feed + Grants access permissions for a custom threat indicator feed to other accounts. Args: account_id: Identifier @@ -274,7 +274,7 @@ async def list( timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[PermissionListResponse]: """ - List indicator feed permissions + Lists current access permissions for custom threat indicator feeds. Args: account_id: Identifier @@ -315,7 +315,7 @@ async def delete( timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[PermissionDeleteResponse]: """ - Revoke permission to indicator feed + Revokes access permissions for a custom threat indicator feed. Args: account_id: Identifier diff --git a/src/cloudflare/resources/intel/indicator_feeds/snapshots.py b/src/cloudflare/resources/intel/indicator_feeds/snapshots.py index 0dc19ac33f9..5e73856ec48 100644 --- a/src/cloudflare/resources/intel/indicator_feeds/snapshots.py +++ b/src/cloudflare/resources/intel/indicator_feeds/snapshots.py @@ -58,7 +58,7 @@ def update( timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[SnapshotUpdateResponse]: """ - Update indicator feed data + Retrieves the raw data entries in a custom threat indicator feed. Args: account_id: Identifier @@ -129,7 +129,7 @@ async def update( timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[SnapshotUpdateResponse]: """ - Update indicator feed data + Retrieves the raw data entries in a custom threat indicator feed. Args: account_id: Identifier From 7871f72d038e64e238a37208ed3b2b426502ae40 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 24 Feb 2026 18:10:38 +0000 Subject: [PATCH 035/279] chore(api): update composite API spec --- .stats.yml | 4 +- .../access/applications/policies.py | 20 + .../resources/zero_trust/access/policies.py | 20 + .../access/application_create_params.py | 372 ++++++++++++++++++ .../access/application_create_response.py | 372 ++++++++++++++++++ .../access/application_get_response.py | 372 ++++++++++++++++++ .../access/application_list_response.py | 372 ++++++++++++++++++ .../access/application_update_params.py | 372 ++++++++++++++++++ .../access/application_update_response.py | 372 ++++++++++++++++++ .../applications/policy_create_params.py | 31 +- .../applications/policy_create_response.py | 31 +- .../applications/policy_get_response.py | 31 +- .../applications/policy_list_response.py | 31 +- .../applications/policy_test_create_params.py | 38 +- .../applications/policy_update_params.py | 31 +- .../applications/policy_update_response.py | 31 +- .../zero_trust/access/policy_create_params.py | 31 +- .../access/policy_create_response.py | 31 +- .../zero_trust/access/policy_get_response.py | 31 +- .../zero_trust/access/policy_list_response.py | 31 +- .../zero_trust/access/policy_update_params.py | 31 +- .../access/policy_update_response.py | 31 +- .../access/applications/test_policies.py | 24 ++ .../access/applications/test_policy_tests.py | 12 + .../zero_trust/access/test_policies.py | 24 ++ 25 files changed, 2731 insertions(+), 15 deletions(-) diff --git a/.stats.yml b/.stats.yml index 905bbee2f12..6189990b2e9 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 2032 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-0cc9fbc9b8f8013e721d0f8aeda101d140180c403351a773d7b8f381ffdf8ee3.yml -openapi_spec_hash: d6351a383c11f634a5607aa46deb4169 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-3dd655c9a1d26faa8cf47065b3d5f9e5df4771a8586806ef2d074dd3ca629389.yml +openapi_spec_hash: e83ddc1a7d9777031551bbc9ceb1d377 config_hash: 405e0229a3b5214d99c53598e78f85a1 diff --git a/src/cloudflare/resources/zero_trust/access/applications/policies.py b/src/cloudflare/resources/zero_trust/access/applications/policies.py index dc4e33c1cf2..8d7dc0d9675 100644 --- a/src/cloudflare/resources/zero_trust/access/applications/policies.py +++ b/src/cloudflare/resources/zero_trust/access/applications/policies.py @@ -58,6 +58,7 @@ def create( zone_id: str | Omit = omit, approval_groups: Iterable[ApprovalGroupParam] | Omit = omit, approval_required: bool | Omit = omit, + connection_rules: policy_create_params.ConnectionRules | Omit = omit, isolation_required: bool | Omit = omit, mfa_config: policy_create_params.MfaConfig | Omit = omit, precedence: int | Omit = omit, @@ -89,6 +90,9 @@ def create( approval_required: Requires the user to request access from an administrator at the start of each session. + connection_rules: The rules that define how users may connect to targets secured by your + application. + isolation_required: Require this application to be served in an isolated browser for users matching this policy. 'Client Web Isolation' must be on for the account in order to use this feature. @@ -134,6 +138,7 @@ def create( { "approval_groups": approval_groups, "approval_required": approval_required, + "connection_rules": connection_rules, "isolation_required": isolation_required, "mfa_config": mfa_config, "precedence": precedence, @@ -162,6 +167,7 @@ def update( zone_id: str | Omit = omit, approval_groups: Iterable[ApprovalGroupParam] | Omit = omit, approval_required: bool | Omit = omit, + connection_rules: policy_update_params.ConnectionRules | Omit = omit, isolation_required: bool | Omit = omit, mfa_config: policy_update_params.MfaConfig | Omit = omit, precedence: int | Omit = omit, @@ -194,6 +200,9 @@ def update( approval_required: Requires the user to request access from an administrator at the start of each session. + connection_rules: The rules that define how users may connect to targets secured by your + application. + isolation_required: Require this application to be served in an isolated browser for users matching this policy. 'Client Web Isolation' must be on for the account in order to use this feature. @@ -241,6 +250,7 @@ def update( { "approval_groups": approval_groups, "approval_required": approval_required, + "connection_rules": connection_rules, "isolation_required": isolation_required, "mfa_config": mfa_config, "precedence": precedence, @@ -489,6 +499,7 @@ async def create( zone_id: str | Omit = omit, approval_groups: Iterable[ApprovalGroupParam] | Omit = omit, approval_required: bool | Omit = omit, + connection_rules: policy_create_params.ConnectionRules | Omit = omit, isolation_required: bool | Omit = omit, mfa_config: policy_create_params.MfaConfig | Omit = omit, precedence: int | Omit = omit, @@ -520,6 +531,9 @@ async def create( approval_required: Requires the user to request access from an administrator at the start of each session. + connection_rules: The rules that define how users may connect to targets secured by your + application. + isolation_required: Require this application to be served in an isolated browser for users matching this policy. 'Client Web Isolation' must be on for the account in order to use this feature. @@ -565,6 +579,7 @@ async def create( { "approval_groups": approval_groups, "approval_required": approval_required, + "connection_rules": connection_rules, "isolation_required": isolation_required, "mfa_config": mfa_config, "precedence": precedence, @@ -593,6 +608,7 @@ async def update( zone_id: str | Omit = omit, approval_groups: Iterable[ApprovalGroupParam] | Omit = omit, approval_required: bool | Omit = omit, + connection_rules: policy_update_params.ConnectionRules | Omit = omit, isolation_required: bool | Omit = omit, mfa_config: policy_update_params.MfaConfig | Omit = omit, precedence: int | Omit = omit, @@ -625,6 +641,9 @@ async def update( approval_required: Requires the user to request access from an administrator at the start of each session. + connection_rules: The rules that define how users may connect to targets secured by your + application. + isolation_required: Require this application to be served in an isolated browser for users matching this policy. 'Client Web Isolation' must be on for the account in order to use this feature. @@ -672,6 +691,7 @@ async def update( { "approval_groups": approval_groups, "approval_required": approval_required, + "connection_rules": connection_rules, "isolation_required": isolation_required, "mfa_config": mfa_config, "precedence": precedence, diff --git a/src/cloudflare/resources/zero_trust/access/policies.py b/src/cloudflare/resources/zero_trust/access/policies.py index dbec3f35efd..691667fd3bc 100644 --- a/src/cloudflare/resources/zero_trust/access/policies.py +++ b/src/cloudflare/resources/zero_trust/access/policies.py @@ -61,6 +61,7 @@ def create( name: str, approval_groups: Iterable[ApprovalGroupParam] | Omit = omit, approval_required: bool | Omit = omit, + connection_rules: policy_create_params.ConnectionRules | Omit = omit, exclude: Iterable[AccessRuleParam] | Omit = omit, isolation_required: bool | Omit = omit, mfa_config: policy_create_params.MfaConfig | Omit = omit, @@ -94,6 +95,9 @@ def create( approval_required: Requires the user to request access from an administrator at the start of each session. + connection_rules: The rules that define how users may connect to targets secured by your + application. + exclude: Rules evaluated with a NOT logical operator. To match the policy, a user cannot meet any of the Exclude rules. @@ -133,6 +137,7 @@ def create( "name": name, "approval_groups": approval_groups, "approval_required": approval_required, + "connection_rules": connection_rules, "exclude": exclude, "isolation_required": isolation_required, "mfa_config": mfa_config, @@ -163,6 +168,7 @@ def update( name: str, approval_groups: Iterable[ApprovalGroupParam] | Omit = omit, approval_required: bool | Omit = omit, + connection_rules: policy_update_params.ConnectionRules | Omit = omit, exclude: Iterable[AccessRuleParam] | Omit = omit, isolation_required: bool | Omit = omit, mfa_config: policy_update_params.MfaConfig | Omit = omit, @@ -198,6 +204,9 @@ def update( approval_required: Requires the user to request access from an administrator at the start of each session. + connection_rules: The rules that define how users may connect to targets secured by your + application. + exclude: Rules evaluated with a NOT logical operator. To match the policy, a user cannot meet any of the Exclude rules. @@ -239,6 +248,7 @@ def update( "name": name, "approval_groups": approval_groups, "approval_required": approval_required, + "connection_rules": connection_rules, "exclude": exclude, "isolation_required": isolation_required, "mfa_config": mfa_config, @@ -429,6 +439,7 @@ async def create( name: str, approval_groups: Iterable[ApprovalGroupParam] | Omit = omit, approval_required: bool | Omit = omit, + connection_rules: policy_create_params.ConnectionRules | Omit = omit, exclude: Iterable[AccessRuleParam] | Omit = omit, isolation_required: bool | Omit = omit, mfa_config: policy_create_params.MfaConfig | Omit = omit, @@ -462,6 +473,9 @@ async def create( approval_required: Requires the user to request access from an administrator at the start of each session. + connection_rules: The rules that define how users may connect to targets secured by your + application. + exclude: Rules evaluated with a NOT logical operator. To match the policy, a user cannot meet any of the Exclude rules. @@ -501,6 +515,7 @@ async def create( "name": name, "approval_groups": approval_groups, "approval_required": approval_required, + "connection_rules": connection_rules, "exclude": exclude, "isolation_required": isolation_required, "mfa_config": mfa_config, @@ -531,6 +546,7 @@ async def update( name: str, approval_groups: Iterable[ApprovalGroupParam] | Omit = omit, approval_required: bool | Omit = omit, + connection_rules: policy_update_params.ConnectionRules | Omit = omit, exclude: Iterable[AccessRuleParam] | Omit = omit, isolation_required: bool | Omit = omit, mfa_config: policy_update_params.MfaConfig | Omit = omit, @@ -566,6 +582,9 @@ async def update( approval_required: Requires the user to request access from an administrator at the start of each session. + connection_rules: The rules that define how users may connect to targets secured by your + application. + exclude: Rules evaluated with a NOT logical operator. To match the policy, a user cannot meet any of the Exclude rules. @@ -607,6 +626,7 @@ async def update( "name": name, "approval_groups": approval_groups, "approval_required": approval_required, + "connection_rules": connection_rules, "exclude": exclude, "isolation_required": isolation_required, "mfa_config": mfa_config, diff --git a/src/cloudflare/types/zero_trust/access/application_create_params.py b/src/cloudflare/types/zero_trust/access/application_create_params.py index 34f8d715487..2c78b1acc10 100644 --- a/src/cloudflare/types/zero_trust/access/application_create_params.py +++ b/src/cloudflare/types/zero_trust/access/application_create_params.py @@ -34,6 +34,8 @@ "SelfHostedApplicationPolicy", "SelfHostedApplicationPolicyAccessAppPolicyLink", "SelfHostedApplicationPolicyUnionMember2", + "SelfHostedApplicationPolicyUnionMember2ConnectionRules", + "SelfHostedApplicationPolicyUnionMember2ConnectionRulesRdp", "SelfHostedApplicationPolicyUnionMember2MfaConfig", "SelfHostedApplicationSCIMConfig", "SelfHostedApplicationSCIMConfigAuthentication", @@ -44,6 +46,8 @@ "SaaSApplicationPolicy", "SaaSApplicationPolicyAccessAppPolicyLink", "SaaSApplicationPolicyUnionMember2", + "SaaSApplicationPolicyUnionMember2ConnectionRules", + "SaaSApplicationPolicyUnionMember2ConnectionRulesRdp", "SaaSApplicationPolicyUnionMember2MfaConfig", "SaaSApplicationSaaSApp", "SaaSApplicationSCIMConfig", @@ -63,6 +67,8 @@ "BrowserSSHApplicationPolicy", "BrowserSSHApplicationPolicyAccessAppPolicyLink", "BrowserSSHApplicationPolicyUnionMember2", + "BrowserSSHApplicationPolicyUnionMember2ConnectionRules", + "BrowserSSHApplicationPolicyUnionMember2ConnectionRulesRdp", "BrowserSSHApplicationPolicyUnionMember2MfaConfig", "BrowserSSHApplicationSCIMConfig", "BrowserSSHApplicationSCIMConfigAuthentication", @@ -81,6 +87,8 @@ "BrowserVNCApplicationPolicy", "BrowserVNCApplicationPolicyAccessAppPolicyLink", "BrowserVNCApplicationPolicyUnionMember2", + "BrowserVNCApplicationPolicyUnionMember2ConnectionRules", + "BrowserVNCApplicationPolicyUnionMember2ConnectionRulesRdp", "BrowserVNCApplicationPolicyUnionMember2MfaConfig", "BrowserVNCApplicationSCIMConfig", "BrowserVNCApplicationSCIMConfigAuthentication", @@ -93,26 +101,36 @@ "AppLauncherApplicationPolicy", "AppLauncherApplicationPolicyAccessAppPolicyLink", "AppLauncherApplicationPolicyUnionMember2", + "AppLauncherApplicationPolicyUnionMember2ConnectionRules", + "AppLauncherApplicationPolicyUnionMember2ConnectionRulesRdp", "AppLauncherApplicationPolicyUnionMember2MfaConfig", "DeviceEnrollmentPermissionsApplication", "DeviceEnrollmentPermissionsApplicationPolicy", "DeviceEnrollmentPermissionsApplicationPolicyAccessAppPolicyLink", "DeviceEnrollmentPermissionsApplicationPolicyUnionMember2", + "DeviceEnrollmentPermissionsApplicationPolicyUnionMember2ConnectionRules", + "DeviceEnrollmentPermissionsApplicationPolicyUnionMember2ConnectionRulesRdp", "DeviceEnrollmentPermissionsApplicationPolicyUnionMember2MfaConfig", "BrowserIsolationPermissionsApplication", "BrowserIsolationPermissionsApplicationPolicy", "BrowserIsolationPermissionsApplicationPolicyAccessAppPolicyLink", "BrowserIsolationPermissionsApplicationPolicyUnionMember2", + "BrowserIsolationPermissionsApplicationPolicyUnionMember2ConnectionRules", + "BrowserIsolationPermissionsApplicationPolicyUnionMember2ConnectionRulesRdp", "BrowserIsolationPermissionsApplicationPolicyUnionMember2MfaConfig", "GatewayIdentityProxyEndpointApplication", "GatewayIdentityProxyEndpointApplicationPolicy", "GatewayIdentityProxyEndpointApplicationPolicyAccessAppPolicyLink", "GatewayIdentityProxyEndpointApplicationPolicyUnionMember2", + "GatewayIdentityProxyEndpointApplicationPolicyUnionMember2ConnectionRules", + "GatewayIdentityProxyEndpointApplicationPolicyUnionMember2ConnectionRulesRdp", "GatewayIdentityProxyEndpointApplicationPolicyUnionMember2MfaConfig", "BookmarkApplication", "BookmarkApplicationPolicy", "BookmarkApplicationPolicyAccessAppPolicyLink", "BookmarkApplicationPolicyUnionMember2", + "BookmarkApplicationPolicyUnionMember2ConnectionRules", + "BookmarkApplicationPolicyUnionMember2ConnectionRulesRdp", "BookmarkApplicationPolicyUnionMember2MfaConfig", "InfrastructureApplication", "InfrastructureApplicationTargetCriterion", @@ -132,6 +150,8 @@ "BrowserRdpApplicationPolicy", "BrowserRdpApplicationPolicyAccessAppPolicyLink", "BrowserRdpApplicationPolicyUnionMember2", + "BrowserRdpApplicationPolicyUnionMember2ConnectionRules", + "BrowserRdpApplicationPolicyUnionMember2ConnectionRulesRdp", "BrowserRdpApplicationPolicyUnionMember2MfaConfig", "BrowserRdpApplicationSCIMConfig", "BrowserRdpApplicationSCIMConfigAuthentication", @@ -149,6 +169,8 @@ "McpServerApplicationPolicy", "McpServerApplicationPolicyAccessAppPolicyLink", "McpServerApplicationPolicyUnionMember2", + "McpServerApplicationPolicyUnionMember2ConnectionRules", + "McpServerApplicationPolicyUnionMember2ConnectionRulesRdp", "McpServerApplicationPolicyUnionMember2MfaConfig", "McpServerApplicationSCIMConfig", "McpServerApplicationSCIMConfigAuthentication", @@ -166,6 +188,8 @@ "McpServerPortalApplicationPolicy", "McpServerPortalApplicationPolicyAccessAppPolicyLink", "McpServerPortalApplicationPolicyUnionMember2", + "McpServerPortalApplicationPolicyUnionMember2ConnectionRules", + "McpServerPortalApplicationPolicyUnionMember2ConnectionRulesRdp", "McpServerPortalApplicationPolicyUnionMember2MfaConfig", "McpServerPortalApplicationSCIMConfig", "McpServerPortalApplicationSCIMConfigAuthentication", @@ -507,6 +531,29 @@ class SelfHostedApplicationPolicyAccessAppPolicyLink(TypedDict, total=False): """ +class SelfHostedApplicationPolicyUnionMember2ConnectionRulesRdp(TypedDict, total=False): + """The RDP-specific rules that define clipboard behavior for RDP connections.""" + + allowed_clipboard_local_to_remote_formats: List[Literal["text"]] + """ + Clipboard formats allowed when copying from local machine to remote RDP session. + """ + + allowed_clipboard_remote_to_local_formats: List[Literal["text"]] + """ + Clipboard formats allowed when copying from remote RDP session to local machine. + """ + + +class SelfHostedApplicationPolicyUnionMember2ConnectionRules(TypedDict, total=False): + """ + The rules that define how users may connect to targets secured by your application. + """ + + rdp: SelfHostedApplicationPolicyUnionMember2ConnectionRulesRdp + """The RDP-specific rules that define clipboard behavior for RDP connections.""" + + class SelfHostedApplicationPolicyUnionMember2MfaConfig(TypedDict, total=False): """Configures multi-factor authentication (MFA) settings.""" @@ -540,6 +587,12 @@ class SelfHostedApplicationPolicyUnionMember2(TypedDict, total=False): session. """ + connection_rules: SelfHostedApplicationPolicyUnionMember2ConnectionRules + """ + The rules that define how users may connect to targets secured by your + application. + """ + isolation_required: bool """ Require this application to be served in an isolated browser for users matching @@ -746,6 +799,29 @@ class SaaSApplicationPolicyAccessAppPolicyLink(TypedDict, total=False): """ +class SaaSApplicationPolicyUnionMember2ConnectionRulesRdp(TypedDict, total=False): + """The RDP-specific rules that define clipboard behavior for RDP connections.""" + + allowed_clipboard_local_to_remote_formats: List[Literal["text"]] + """ + Clipboard formats allowed when copying from local machine to remote RDP session. + """ + + allowed_clipboard_remote_to_local_formats: List[Literal["text"]] + """ + Clipboard formats allowed when copying from remote RDP session to local machine. + """ + + +class SaaSApplicationPolicyUnionMember2ConnectionRules(TypedDict, total=False): + """ + The rules that define how users may connect to targets secured by your application. + """ + + rdp: SaaSApplicationPolicyUnionMember2ConnectionRulesRdp + """The RDP-specific rules that define clipboard behavior for RDP connections.""" + + class SaaSApplicationPolicyUnionMember2MfaConfig(TypedDict, total=False): """Configures multi-factor authentication (MFA) settings.""" @@ -779,6 +855,12 @@ class SaaSApplicationPolicyUnionMember2(TypedDict, total=False): session. """ + connection_rules: SaaSApplicationPolicyUnionMember2ConnectionRules + """ + The rules that define how users may connect to targets secured by your + application. + """ + isolation_required: bool """ Require this application to be served in an isolated browser for users matching @@ -1263,6 +1345,29 @@ class BrowserSSHApplicationPolicyAccessAppPolicyLink(TypedDict, total=False): """ +class BrowserSSHApplicationPolicyUnionMember2ConnectionRulesRdp(TypedDict, total=False): + """The RDP-specific rules that define clipboard behavior for RDP connections.""" + + allowed_clipboard_local_to_remote_formats: List[Literal["text"]] + """ + Clipboard formats allowed when copying from local machine to remote RDP session. + """ + + allowed_clipboard_remote_to_local_formats: List[Literal["text"]] + """ + Clipboard formats allowed when copying from remote RDP session to local machine. + """ + + +class BrowserSSHApplicationPolicyUnionMember2ConnectionRules(TypedDict, total=False): + """ + The rules that define how users may connect to targets secured by your application. + """ + + rdp: BrowserSSHApplicationPolicyUnionMember2ConnectionRulesRdp + """The RDP-specific rules that define clipboard behavior for RDP connections.""" + + class BrowserSSHApplicationPolicyUnionMember2MfaConfig(TypedDict, total=False): """Configures multi-factor authentication (MFA) settings.""" @@ -1296,6 +1401,12 @@ class BrowserSSHApplicationPolicyUnionMember2(TypedDict, total=False): session. """ + connection_rules: BrowserSSHApplicationPolicyUnionMember2ConnectionRules + """ + The rules that define how users may connect to targets secured by your + application. + """ + isolation_required: bool """ Require this application to be served in an isolated browser for users matching @@ -1780,6 +1891,29 @@ class BrowserVNCApplicationPolicyAccessAppPolicyLink(TypedDict, total=False): """ +class BrowserVNCApplicationPolicyUnionMember2ConnectionRulesRdp(TypedDict, total=False): + """The RDP-specific rules that define clipboard behavior for RDP connections.""" + + allowed_clipboard_local_to_remote_formats: List[Literal["text"]] + """ + Clipboard formats allowed when copying from local machine to remote RDP session. + """ + + allowed_clipboard_remote_to_local_formats: List[Literal["text"]] + """ + Clipboard formats allowed when copying from remote RDP session to local machine. + """ + + +class BrowserVNCApplicationPolicyUnionMember2ConnectionRules(TypedDict, total=False): + """ + The rules that define how users may connect to targets secured by your application. + """ + + rdp: BrowserVNCApplicationPolicyUnionMember2ConnectionRulesRdp + """The RDP-specific rules that define clipboard behavior for RDP connections.""" + + class BrowserVNCApplicationPolicyUnionMember2MfaConfig(TypedDict, total=False): """Configures multi-factor authentication (MFA) settings.""" @@ -1813,6 +1947,12 @@ class BrowserVNCApplicationPolicyUnionMember2(TypedDict, total=False): session. """ + connection_rules: BrowserVNCApplicationPolicyUnionMember2ConnectionRules + """ + The rules that define how users may connect to targets secured by your + application. + """ + isolation_required: bool """ Require this application to be served in an isolated browser for users matching @@ -2077,6 +2217,29 @@ class AppLauncherApplicationPolicyAccessAppPolicyLink(TypedDict, total=False): """ +class AppLauncherApplicationPolicyUnionMember2ConnectionRulesRdp(TypedDict, total=False): + """The RDP-specific rules that define clipboard behavior for RDP connections.""" + + allowed_clipboard_local_to_remote_formats: List[Literal["text"]] + """ + Clipboard formats allowed when copying from local machine to remote RDP session. + """ + + allowed_clipboard_remote_to_local_formats: List[Literal["text"]] + """ + Clipboard formats allowed when copying from remote RDP session to local machine. + """ + + +class AppLauncherApplicationPolicyUnionMember2ConnectionRules(TypedDict, total=False): + """ + The rules that define how users may connect to targets secured by your application. + """ + + rdp: AppLauncherApplicationPolicyUnionMember2ConnectionRulesRdp + """The RDP-specific rules that define clipboard behavior for RDP connections.""" + + class AppLauncherApplicationPolicyUnionMember2MfaConfig(TypedDict, total=False): """Configures multi-factor authentication (MFA) settings.""" @@ -2110,6 +2273,12 @@ class AppLauncherApplicationPolicyUnionMember2(TypedDict, total=False): session. """ + connection_rules: AppLauncherApplicationPolicyUnionMember2ConnectionRules + """ + The rules that define how users may connect to targets secured by your + application. + """ + isolation_required: bool """ Require this application to be served in an isolated browser for users matching @@ -2212,6 +2381,29 @@ class DeviceEnrollmentPermissionsApplicationPolicyAccessAppPolicyLink(TypedDict, """ +class DeviceEnrollmentPermissionsApplicationPolicyUnionMember2ConnectionRulesRdp(TypedDict, total=False): + """The RDP-specific rules that define clipboard behavior for RDP connections.""" + + allowed_clipboard_local_to_remote_formats: List[Literal["text"]] + """ + Clipboard formats allowed when copying from local machine to remote RDP session. + """ + + allowed_clipboard_remote_to_local_formats: List[Literal["text"]] + """ + Clipboard formats allowed when copying from remote RDP session to local machine. + """ + + +class DeviceEnrollmentPermissionsApplicationPolicyUnionMember2ConnectionRules(TypedDict, total=False): + """ + The rules that define how users may connect to targets secured by your application. + """ + + rdp: DeviceEnrollmentPermissionsApplicationPolicyUnionMember2ConnectionRulesRdp + """The RDP-specific rules that define clipboard behavior for RDP connections.""" + + class DeviceEnrollmentPermissionsApplicationPolicyUnionMember2MfaConfig(TypedDict, total=False): """Configures multi-factor authentication (MFA) settings.""" @@ -2245,6 +2437,12 @@ class DeviceEnrollmentPermissionsApplicationPolicyUnionMember2(TypedDict, total= session. """ + connection_rules: DeviceEnrollmentPermissionsApplicationPolicyUnionMember2ConnectionRules + """ + The rules that define how users may connect to targets secured by your + application. + """ + isolation_required: bool """ Require this application to be served in an isolated browser for users matching @@ -2349,6 +2547,29 @@ class BrowserIsolationPermissionsApplicationPolicyAccessAppPolicyLink(TypedDict, """ +class BrowserIsolationPermissionsApplicationPolicyUnionMember2ConnectionRulesRdp(TypedDict, total=False): + """The RDP-specific rules that define clipboard behavior for RDP connections.""" + + allowed_clipboard_local_to_remote_formats: List[Literal["text"]] + """ + Clipboard formats allowed when copying from local machine to remote RDP session. + """ + + allowed_clipboard_remote_to_local_formats: List[Literal["text"]] + """ + Clipboard formats allowed when copying from remote RDP session to local machine. + """ + + +class BrowserIsolationPermissionsApplicationPolicyUnionMember2ConnectionRules(TypedDict, total=False): + """ + The rules that define how users may connect to targets secured by your application. + """ + + rdp: BrowserIsolationPermissionsApplicationPolicyUnionMember2ConnectionRulesRdp + """The RDP-specific rules that define clipboard behavior for RDP connections.""" + + class BrowserIsolationPermissionsApplicationPolicyUnionMember2MfaConfig(TypedDict, total=False): """Configures multi-factor authentication (MFA) settings.""" @@ -2382,6 +2603,12 @@ class BrowserIsolationPermissionsApplicationPolicyUnionMember2(TypedDict, total= session. """ + connection_rules: BrowserIsolationPermissionsApplicationPolicyUnionMember2ConnectionRules + """ + The rules that define how users may connect to targets secured by your + application. + """ + isolation_required: bool """ Require this application to be served in an isolated browser for users matching @@ -2495,6 +2722,29 @@ class GatewayIdentityProxyEndpointApplicationPolicyAccessAppPolicyLink(TypedDict """ +class GatewayIdentityProxyEndpointApplicationPolicyUnionMember2ConnectionRulesRdp(TypedDict, total=False): + """The RDP-specific rules that define clipboard behavior for RDP connections.""" + + allowed_clipboard_local_to_remote_formats: List[Literal["text"]] + """ + Clipboard formats allowed when copying from local machine to remote RDP session. + """ + + allowed_clipboard_remote_to_local_formats: List[Literal["text"]] + """ + Clipboard formats allowed when copying from remote RDP session to local machine. + """ + + +class GatewayIdentityProxyEndpointApplicationPolicyUnionMember2ConnectionRules(TypedDict, total=False): + """ + The rules that define how users may connect to targets secured by your application. + """ + + rdp: GatewayIdentityProxyEndpointApplicationPolicyUnionMember2ConnectionRulesRdp + """The RDP-specific rules that define clipboard behavior for RDP connections.""" + + class GatewayIdentityProxyEndpointApplicationPolicyUnionMember2MfaConfig(TypedDict, total=False): """Configures multi-factor authentication (MFA) settings.""" @@ -2528,6 +2778,12 @@ class GatewayIdentityProxyEndpointApplicationPolicyUnionMember2(TypedDict, total session. """ + connection_rules: GatewayIdentityProxyEndpointApplicationPolicyUnionMember2ConnectionRules + """ + The rules that define how users may connect to targets secured by your + application. + """ + isolation_required: bool """ Require this application to be served in an isolated browser for users matching @@ -2614,6 +2870,29 @@ class BookmarkApplicationPolicyAccessAppPolicyLink(TypedDict, total=False): """ +class BookmarkApplicationPolicyUnionMember2ConnectionRulesRdp(TypedDict, total=False): + """The RDP-specific rules that define clipboard behavior for RDP connections.""" + + allowed_clipboard_local_to_remote_formats: List[Literal["text"]] + """ + Clipboard formats allowed when copying from local machine to remote RDP session. + """ + + allowed_clipboard_remote_to_local_formats: List[Literal["text"]] + """ + Clipboard formats allowed when copying from remote RDP session to local machine. + """ + + +class BookmarkApplicationPolicyUnionMember2ConnectionRules(TypedDict, total=False): + """ + The rules that define how users may connect to targets secured by your application. + """ + + rdp: BookmarkApplicationPolicyUnionMember2ConnectionRulesRdp + """The RDP-specific rules that define clipboard behavior for RDP connections.""" + + class BookmarkApplicationPolicyUnionMember2MfaConfig(TypedDict, total=False): """Configures multi-factor authentication (MFA) settings.""" @@ -2647,6 +2926,12 @@ class BookmarkApplicationPolicyUnionMember2(TypedDict, total=False): session. """ + connection_rules: BookmarkApplicationPolicyUnionMember2ConnectionRules + """ + The rules that define how users may connect to targets secured by your + application. + """ + isolation_required: bool """ Require this application to be served in an isolated browser for users matching @@ -3122,6 +3407,29 @@ class BrowserRdpApplicationPolicyAccessAppPolicyLink(TypedDict, total=False): """ +class BrowserRdpApplicationPolicyUnionMember2ConnectionRulesRdp(TypedDict, total=False): + """The RDP-specific rules that define clipboard behavior for RDP connections.""" + + allowed_clipboard_local_to_remote_formats: List[Literal["text"]] + """ + Clipboard formats allowed when copying from local machine to remote RDP session. + """ + + allowed_clipboard_remote_to_local_formats: List[Literal["text"]] + """ + Clipboard formats allowed when copying from remote RDP session to local machine. + """ + + +class BrowserRdpApplicationPolicyUnionMember2ConnectionRules(TypedDict, total=False): + """ + The rules that define how users may connect to targets secured by your application. + """ + + rdp: BrowserRdpApplicationPolicyUnionMember2ConnectionRulesRdp + """The RDP-specific rules that define clipboard behavior for RDP connections.""" + + class BrowserRdpApplicationPolicyUnionMember2MfaConfig(TypedDict, total=False): """Configures multi-factor authentication (MFA) settings.""" @@ -3155,6 +3463,12 @@ class BrowserRdpApplicationPolicyUnionMember2(TypedDict, total=False): session. """ + connection_rules: BrowserRdpApplicationPolicyUnionMember2ConnectionRules + """ + The rules that define how users may connect to targets secured by your + application. + """ + isolation_required: bool """ Require this application to be served in an isolated browser for users matching @@ -3540,6 +3854,29 @@ class McpServerApplicationPolicyAccessAppPolicyLink(TypedDict, total=False): """ +class McpServerApplicationPolicyUnionMember2ConnectionRulesRdp(TypedDict, total=False): + """The RDP-specific rules that define clipboard behavior for RDP connections.""" + + allowed_clipboard_local_to_remote_formats: List[Literal["text"]] + """ + Clipboard formats allowed when copying from local machine to remote RDP session. + """ + + allowed_clipboard_remote_to_local_formats: List[Literal["text"]] + """ + Clipboard formats allowed when copying from remote RDP session to local machine. + """ + + +class McpServerApplicationPolicyUnionMember2ConnectionRules(TypedDict, total=False): + """ + The rules that define how users may connect to targets secured by your application. + """ + + rdp: McpServerApplicationPolicyUnionMember2ConnectionRulesRdp + """The RDP-specific rules that define clipboard behavior for RDP connections.""" + + class McpServerApplicationPolicyUnionMember2MfaConfig(TypedDict, total=False): """Configures multi-factor authentication (MFA) settings.""" @@ -3573,6 +3910,12 @@ class McpServerApplicationPolicyUnionMember2(TypedDict, total=False): session. """ + connection_rules: McpServerApplicationPolicyUnionMember2ConnectionRules + """ + The rules that define how users may connect to targets secured by your + application. + """ + isolation_required: bool """ Require this application to be served in an isolated browser for users matching @@ -3964,6 +4307,29 @@ class McpServerPortalApplicationPolicyAccessAppPolicyLink(TypedDict, total=False """ +class McpServerPortalApplicationPolicyUnionMember2ConnectionRulesRdp(TypedDict, total=False): + """The RDP-specific rules that define clipboard behavior for RDP connections.""" + + allowed_clipboard_local_to_remote_formats: List[Literal["text"]] + """ + Clipboard formats allowed when copying from local machine to remote RDP session. + """ + + allowed_clipboard_remote_to_local_formats: List[Literal["text"]] + """ + Clipboard formats allowed when copying from remote RDP session to local machine. + """ + + +class McpServerPortalApplicationPolicyUnionMember2ConnectionRules(TypedDict, total=False): + """ + The rules that define how users may connect to targets secured by your application. + """ + + rdp: McpServerPortalApplicationPolicyUnionMember2ConnectionRulesRdp + """The RDP-specific rules that define clipboard behavior for RDP connections.""" + + class McpServerPortalApplicationPolicyUnionMember2MfaConfig(TypedDict, total=False): """Configures multi-factor authentication (MFA) settings.""" @@ -3997,6 +4363,12 @@ class McpServerPortalApplicationPolicyUnionMember2(TypedDict, total=False): session. """ + connection_rules: McpServerPortalApplicationPolicyUnionMember2ConnectionRules + """ + The rules that define how users may connect to targets secured by your + application. + """ + isolation_required: bool """ Require this application to be served in an isolated browser for users matching diff --git a/src/cloudflare/types/zero_trust/access/application_create_response.py b/src/cloudflare/types/zero_trust/access/application_create_response.py index 30a68f431f9..f70d6c04489 100644 --- a/src/cloudflare/types/zero_trust/access/application_create_response.py +++ b/src/cloudflare/types/zero_trust/access/application_create_response.py @@ -31,6 +31,8 @@ "SelfHostedApplicationOAuthConfigurationDynamicClientRegistration", "SelfHostedApplicationOAuthConfigurationGrant", "SelfHostedApplicationPolicy", + "SelfHostedApplicationPolicyConnectionRules", + "SelfHostedApplicationPolicyConnectionRulesRdp", "SelfHostedApplicationPolicyMfaConfig", "SelfHostedApplicationSCIMConfig", "SelfHostedApplicationSCIMConfigAuthentication", @@ -39,6 +41,8 @@ "SelfHostedApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken", "SaaSApplication", "SaaSApplicationPolicy", + "SaaSApplicationPolicyConnectionRules", + "SaaSApplicationPolicyConnectionRulesRdp", "SaaSApplicationPolicyMfaConfig", "SaaSApplicationSaaSApp", "SaaSApplicationSCIMConfig", @@ -56,6 +60,8 @@ "BrowserSSHApplicationOAuthConfigurationDynamicClientRegistration", "BrowserSSHApplicationOAuthConfigurationGrant", "BrowserSSHApplicationPolicy", + "BrowserSSHApplicationPolicyConnectionRules", + "BrowserSSHApplicationPolicyConnectionRulesRdp", "BrowserSSHApplicationPolicyMfaConfig", "BrowserSSHApplicationSCIMConfig", "BrowserSSHApplicationSCIMConfigAuthentication", @@ -72,6 +78,8 @@ "BrowserVNCApplicationOAuthConfigurationDynamicClientRegistration", "BrowserVNCApplicationOAuthConfigurationGrant", "BrowserVNCApplicationPolicy", + "BrowserVNCApplicationPolicyConnectionRules", + "BrowserVNCApplicationPolicyConnectionRulesRdp", "BrowserVNCApplicationPolicyMfaConfig", "BrowserVNCApplicationSCIMConfig", "BrowserVNCApplicationSCIMConfigAuthentication", @@ -82,18 +90,28 @@ "AppLauncherApplicationFooterLink", "AppLauncherApplicationLandingPageDesign", "AppLauncherApplicationPolicy", + "AppLauncherApplicationPolicyConnectionRules", + "AppLauncherApplicationPolicyConnectionRulesRdp", "AppLauncherApplicationPolicyMfaConfig", "DeviceEnrollmentPermissionsApplication", "DeviceEnrollmentPermissionsApplicationPolicy", + "DeviceEnrollmentPermissionsApplicationPolicyConnectionRules", + "DeviceEnrollmentPermissionsApplicationPolicyConnectionRulesRdp", "DeviceEnrollmentPermissionsApplicationPolicyMfaConfig", "BrowserIsolationPermissionsApplication", "BrowserIsolationPermissionsApplicationPolicy", + "BrowserIsolationPermissionsApplicationPolicyConnectionRules", + "BrowserIsolationPermissionsApplicationPolicyConnectionRulesRdp", "BrowserIsolationPermissionsApplicationPolicyMfaConfig", "GatewayIdentityProxyEndpointApplication", "GatewayIdentityProxyEndpointApplicationPolicy", + "GatewayIdentityProxyEndpointApplicationPolicyConnectionRules", + "GatewayIdentityProxyEndpointApplicationPolicyConnectionRulesRdp", "GatewayIdentityProxyEndpointApplicationPolicyMfaConfig", "BookmarkApplication", "BookmarkApplicationPolicy", + "BookmarkApplicationPolicyConnectionRules", + "BookmarkApplicationPolicyConnectionRulesRdp", "BookmarkApplicationPolicyMfaConfig", "InfrastructureApplication", "InfrastructureApplicationTargetCriterion", @@ -111,6 +129,8 @@ "BrowserRdpApplicationOAuthConfigurationDynamicClientRegistration", "BrowserRdpApplicationOAuthConfigurationGrant", "BrowserRdpApplicationPolicy", + "BrowserRdpApplicationPolicyConnectionRules", + "BrowserRdpApplicationPolicyConnectionRulesRdp", "BrowserRdpApplicationPolicyMfaConfig", "BrowserRdpApplicationSCIMConfig", "BrowserRdpApplicationSCIMConfigAuthentication", @@ -126,6 +146,8 @@ "McpServerApplicationOAuthConfigurationDynamicClientRegistration", "McpServerApplicationOAuthConfigurationGrant", "McpServerApplicationPolicy", + "McpServerApplicationPolicyConnectionRules", + "McpServerApplicationPolicyConnectionRulesRdp", "McpServerApplicationPolicyMfaConfig", "McpServerApplicationSCIMConfig", "McpServerApplicationSCIMConfigAuthentication", @@ -141,6 +163,8 @@ "McpServerPortalApplicationOAuthConfigurationDynamicClientRegistration", "McpServerPortalApplicationOAuthConfigurationGrant", "McpServerPortalApplicationPolicy", + "McpServerPortalApplicationPolicyConnectionRules", + "McpServerPortalApplicationPolicyConnectionRulesRdp", "McpServerPortalApplicationPolicyMfaConfig", "McpServerPortalApplicationSCIMConfig", "McpServerPortalApplicationSCIMConfigAuthentication", @@ -286,6 +310,29 @@ class SelfHostedApplicationOAuthConfiguration(BaseModel): """Settings for OAuth grant behavior.""" +class SelfHostedApplicationPolicyConnectionRulesRdp(BaseModel): + """The RDP-specific rules that define clipboard behavior for RDP connections.""" + + allowed_clipboard_local_to_remote_formats: Optional[List[Literal["text"]]] = None + """ + Clipboard formats allowed when copying from local machine to remote RDP session. + """ + + allowed_clipboard_remote_to_local_formats: Optional[List[Literal["text"]]] = None + """ + Clipboard formats allowed when copying from remote RDP session to local machine. + """ + + +class SelfHostedApplicationPolicyConnectionRules(BaseModel): + """ + The rules that define how users may connect to targets secured by your application. + """ + + rdp: Optional[SelfHostedApplicationPolicyConnectionRulesRdp] = None + """The RDP-specific rules that define clipboard behavior for RDP connections.""" + + class SelfHostedApplicationPolicyMfaConfig(BaseModel): """Configures multi-factor authentication (MFA) settings.""" @@ -319,6 +366,12 @@ class SelfHostedApplicationPolicy(BaseModel): session. """ + connection_rules: Optional[SelfHostedApplicationPolicyConnectionRules] = None + """ + The rules that define how users may connect to targets secured by your + application. + """ + created_at: Optional[datetime] = None decision: Optional[Decision] = None @@ -656,6 +709,29 @@ class SelfHostedApplication(BaseModel): """ +class SaaSApplicationPolicyConnectionRulesRdp(BaseModel): + """The RDP-specific rules that define clipboard behavior for RDP connections.""" + + allowed_clipboard_local_to_remote_formats: Optional[List[Literal["text"]]] = None + """ + Clipboard formats allowed when copying from local machine to remote RDP session. + """ + + allowed_clipboard_remote_to_local_formats: Optional[List[Literal["text"]]] = None + """ + Clipboard formats allowed when copying from remote RDP session to local machine. + """ + + +class SaaSApplicationPolicyConnectionRules(BaseModel): + """ + The rules that define how users may connect to targets secured by your application. + """ + + rdp: Optional[SaaSApplicationPolicyConnectionRulesRdp] = None + """The RDP-specific rules that define clipboard behavior for RDP connections.""" + + class SaaSApplicationPolicyMfaConfig(BaseModel): """Configures multi-factor authentication (MFA) settings.""" @@ -689,6 +765,12 @@ class SaaSApplicationPolicy(BaseModel): session. """ + connection_rules: Optional[SaaSApplicationPolicyConnectionRules] = None + """ + The rules that define how users may connect to targets secured by your + application. + """ + created_at: Optional[datetime] = None decision: Optional[Decision] = None @@ -1040,6 +1122,29 @@ class BrowserSSHApplicationOAuthConfiguration(BaseModel): """Settings for OAuth grant behavior.""" +class BrowserSSHApplicationPolicyConnectionRulesRdp(BaseModel): + """The RDP-specific rules that define clipboard behavior for RDP connections.""" + + allowed_clipboard_local_to_remote_formats: Optional[List[Literal["text"]]] = None + """ + Clipboard formats allowed when copying from local machine to remote RDP session. + """ + + allowed_clipboard_remote_to_local_formats: Optional[List[Literal["text"]]] = None + """ + Clipboard formats allowed when copying from remote RDP session to local machine. + """ + + +class BrowserSSHApplicationPolicyConnectionRules(BaseModel): + """ + The rules that define how users may connect to targets secured by your application. + """ + + rdp: Optional[BrowserSSHApplicationPolicyConnectionRulesRdp] = None + """The RDP-specific rules that define clipboard behavior for RDP connections.""" + + class BrowserSSHApplicationPolicyMfaConfig(BaseModel): """Configures multi-factor authentication (MFA) settings.""" @@ -1073,6 +1178,12 @@ class BrowserSSHApplicationPolicy(BaseModel): session. """ + connection_rules: Optional[BrowserSSHApplicationPolicyConnectionRules] = None + """ + The rules that define how users may connect to targets secured by your + application. + """ + created_at: Optional[datetime] = None decision: Optional[Decision] = None @@ -1561,6 +1672,29 @@ class BrowserVNCApplicationOAuthConfiguration(BaseModel): """Settings for OAuth grant behavior.""" +class BrowserVNCApplicationPolicyConnectionRulesRdp(BaseModel): + """The RDP-specific rules that define clipboard behavior for RDP connections.""" + + allowed_clipboard_local_to_remote_formats: Optional[List[Literal["text"]]] = None + """ + Clipboard formats allowed when copying from local machine to remote RDP session. + """ + + allowed_clipboard_remote_to_local_formats: Optional[List[Literal["text"]]] = None + """ + Clipboard formats allowed when copying from remote RDP session to local machine. + """ + + +class BrowserVNCApplicationPolicyConnectionRules(BaseModel): + """ + The rules that define how users may connect to targets secured by your application. + """ + + rdp: Optional[BrowserVNCApplicationPolicyConnectionRulesRdp] = None + """The RDP-specific rules that define clipboard behavior for RDP connections.""" + + class BrowserVNCApplicationPolicyMfaConfig(BaseModel): """Configures multi-factor authentication (MFA) settings.""" @@ -1594,6 +1728,12 @@ class BrowserVNCApplicationPolicy(BaseModel): session. """ + connection_rules: Optional[BrowserVNCApplicationPolicyConnectionRules] = None + """ + The rules that define how users may connect to targets secured by your + application. + """ + created_at: Optional[datetime] = None decision: Optional[Decision] = None @@ -1973,6 +2113,29 @@ class AppLauncherApplicationLandingPageDesign(BaseModel): """The title shown on the landing page.""" +class AppLauncherApplicationPolicyConnectionRulesRdp(BaseModel): + """The RDP-specific rules that define clipboard behavior for RDP connections.""" + + allowed_clipboard_local_to_remote_formats: Optional[List[Literal["text"]]] = None + """ + Clipboard formats allowed when copying from local machine to remote RDP session. + """ + + allowed_clipboard_remote_to_local_formats: Optional[List[Literal["text"]]] = None + """ + Clipboard formats allowed when copying from remote RDP session to local machine. + """ + + +class AppLauncherApplicationPolicyConnectionRules(BaseModel): + """ + The rules that define how users may connect to targets secured by your application. + """ + + rdp: Optional[AppLauncherApplicationPolicyConnectionRulesRdp] = None + """The RDP-specific rules that define clipboard behavior for RDP connections.""" + + class AppLauncherApplicationPolicyMfaConfig(BaseModel): """Configures multi-factor authentication (MFA) settings.""" @@ -2006,6 +2169,12 @@ class AppLauncherApplicationPolicy(BaseModel): session. """ + connection_rules: Optional[AppLauncherApplicationPolicyConnectionRules] = None + """ + The rules that define how users may connect to targets secured by your + application. + """ + created_at: Optional[datetime] = None decision: Optional[Decision] = None @@ -2158,6 +2327,29 @@ class AppLauncherApplication(BaseModel): """Determines when to skip the App Launcher landing page.""" +class DeviceEnrollmentPermissionsApplicationPolicyConnectionRulesRdp(BaseModel): + """The RDP-specific rules that define clipboard behavior for RDP connections.""" + + allowed_clipboard_local_to_remote_formats: Optional[List[Literal["text"]]] = None + """ + Clipboard formats allowed when copying from local machine to remote RDP session. + """ + + allowed_clipboard_remote_to_local_formats: Optional[List[Literal["text"]]] = None + """ + Clipboard formats allowed when copying from remote RDP session to local machine. + """ + + +class DeviceEnrollmentPermissionsApplicationPolicyConnectionRules(BaseModel): + """ + The rules that define how users may connect to targets secured by your application. + """ + + rdp: Optional[DeviceEnrollmentPermissionsApplicationPolicyConnectionRulesRdp] = None + """The RDP-specific rules that define clipboard behavior for RDP connections.""" + + class DeviceEnrollmentPermissionsApplicationPolicyMfaConfig(BaseModel): """Configures multi-factor authentication (MFA) settings.""" @@ -2191,6 +2383,12 @@ class DeviceEnrollmentPermissionsApplicationPolicy(BaseModel): session. """ + connection_rules: Optional[DeviceEnrollmentPermissionsApplicationPolicyConnectionRules] = None + """ + The rules that define how users may connect to targets secured by your + application. + """ + created_at: Optional[datetime] = None decision: Optional[Decision] = None @@ -2310,6 +2508,29 @@ class DeviceEnrollmentPermissionsApplication(BaseModel): """ +class BrowserIsolationPermissionsApplicationPolicyConnectionRulesRdp(BaseModel): + """The RDP-specific rules that define clipboard behavior for RDP connections.""" + + allowed_clipboard_local_to_remote_formats: Optional[List[Literal["text"]]] = None + """ + Clipboard formats allowed when copying from local machine to remote RDP session. + """ + + allowed_clipboard_remote_to_local_formats: Optional[List[Literal["text"]]] = None + """ + Clipboard formats allowed when copying from remote RDP session to local machine. + """ + + +class BrowserIsolationPermissionsApplicationPolicyConnectionRules(BaseModel): + """ + The rules that define how users may connect to targets secured by your application. + """ + + rdp: Optional[BrowserIsolationPermissionsApplicationPolicyConnectionRulesRdp] = None + """The RDP-specific rules that define clipboard behavior for RDP connections.""" + + class BrowserIsolationPermissionsApplicationPolicyMfaConfig(BaseModel): """Configures multi-factor authentication (MFA) settings.""" @@ -2343,6 +2564,12 @@ class BrowserIsolationPermissionsApplicationPolicy(BaseModel): session. """ + connection_rules: Optional[BrowserIsolationPermissionsApplicationPolicyConnectionRules] = None + """ + The rules that define how users may connect to targets secured by your + application. + """ + created_at: Optional[datetime] = None decision: Optional[Decision] = None @@ -2462,6 +2689,29 @@ class BrowserIsolationPermissionsApplication(BaseModel): """ +class GatewayIdentityProxyEndpointApplicationPolicyConnectionRulesRdp(BaseModel): + """The RDP-specific rules that define clipboard behavior for RDP connections.""" + + allowed_clipboard_local_to_remote_formats: Optional[List[Literal["text"]]] = None + """ + Clipboard formats allowed when copying from local machine to remote RDP session. + """ + + allowed_clipboard_remote_to_local_formats: Optional[List[Literal["text"]]] = None + """ + Clipboard formats allowed when copying from remote RDP session to local machine. + """ + + +class GatewayIdentityProxyEndpointApplicationPolicyConnectionRules(BaseModel): + """ + The rules that define how users may connect to targets secured by your application. + """ + + rdp: Optional[GatewayIdentityProxyEndpointApplicationPolicyConnectionRulesRdp] = None + """The RDP-specific rules that define clipboard behavior for RDP connections.""" + + class GatewayIdentityProxyEndpointApplicationPolicyMfaConfig(BaseModel): """Configures multi-factor authentication (MFA) settings.""" @@ -2495,6 +2745,12 @@ class GatewayIdentityProxyEndpointApplicationPolicy(BaseModel): session. """ + connection_rules: Optional[GatewayIdentityProxyEndpointApplicationPolicyConnectionRules] = None + """ + The rules that define how users may connect to targets secured by your + application. + """ + created_at: Optional[datetime] = None decision: Optional[Decision] = None @@ -2614,6 +2870,29 @@ class GatewayIdentityProxyEndpointApplication(BaseModel): """ +class BookmarkApplicationPolicyConnectionRulesRdp(BaseModel): + """The RDP-specific rules that define clipboard behavior for RDP connections.""" + + allowed_clipboard_local_to_remote_formats: Optional[List[Literal["text"]]] = None + """ + Clipboard formats allowed when copying from local machine to remote RDP session. + """ + + allowed_clipboard_remote_to_local_formats: Optional[List[Literal["text"]]] = None + """ + Clipboard formats allowed when copying from remote RDP session to local machine. + """ + + +class BookmarkApplicationPolicyConnectionRules(BaseModel): + """ + The rules that define how users may connect to targets secured by your application. + """ + + rdp: Optional[BookmarkApplicationPolicyConnectionRulesRdp] = None + """The RDP-specific rules that define clipboard behavior for RDP connections.""" + + class BookmarkApplicationPolicyMfaConfig(BaseModel): """Configures multi-factor authentication (MFA) settings.""" @@ -2647,6 +2926,12 @@ class BookmarkApplicationPolicy(BaseModel): session. """ + connection_rules: Optional[BookmarkApplicationPolicyConnectionRules] = None + """ + The rules that define how users may connect to targets secured by your + application. + """ + created_at: Optional[datetime] = None decision: Optional[Decision] = None @@ -2987,6 +3272,29 @@ class BrowserRdpApplicationOAuthConfiguration(BaseModel): """Settings for OAuth grant behavior.""" +class BrowserRdpApplicationPolicyConnectionRulesRdp(BaseModel): + """The RDP-specific rules that define clipboard behavior for RDP connections.""" + + allowed_clipboard_local_to_remote_formats: Optional[List[Literal["text"]]] = None + """ + Clipboard formats allowed when copying from local machine to remote RDP session. + """ + + allowed_clipboard_remote_to_local_formats: Optional[List[Literal["text"]]] = None + """ + Clipboard formats allowed when copying from remote RDP session to local machine. + """ + + +class BrowserRdpApplicationPolicyConnectionRules(BaseModel): + """ + The rules that define how users may connect to targets secured by your application. + """ + + rdp: Optional[BrowserRdpApplicationPolicyConnectionRulesRdp] = None + """The RDP-specific rules that define clipboard behavior for RDP connections.""" + + class BrowserRdpApplicationPolicyMfaConfig(BaseModel): """Configures multi-factor authentication (MFA) settings.""" @@ -3020,6 +3328,12 @@ class BrowserRdpApplicationPolicy(BaseModel): session. """ + connection_rules: Optional[BrowserRdpApplicationPolicyConnectionRules] = None + """ + The rules that define how users may connect to targets secured by your + application. + """ + created_at: Optional[datetime] = None decision: Optional[Decision] = None @@ -3475,6 +3789,29 @@ class McpServerApplicationOAuthConfiguration(BaseModel): """Settings for OAuth grant behavior.""" +class McpServerApplicationPolicyConnectionRulesRdp(BaseModel): + """The RDP-specific rules that define clipboard behavior for RDP connections.""" + + allowed_clipboard_local_to_remote_formats: Optional[List[Literal["text"]]] = None + """ + Clipboard formats allowed when copying from local machine to remote RDP session. + """ + + allowed_clipboard_remote_to_local_formats: Optional[List[Literal["text"]]] = None + """ + Clipboard formats allowed when copying from remote RDP session to local machine. + """ + + +class McpServerApplicationPolicyConnectionRules(BaseModel): + """ + The rules that define how users may connect to targets secured by your application. + """ + + rdp: Optional[McpServerApplicationPolicyConnectionRulesRdp] = None + """The RDP-specific rules that define clipboard behavior for RDP connections.""" + + class McpServerApplicationPolicyMfaConfig(BaseModel): """Configures multi-factor authentication (MFA) settings.""" @@ -3508,6 +3845,12 @@ class McpServerApplicationPolicy(BaseModel): session. """ + connection_rules: Optional[McpServerApplicationPolicyConnectionRules] = None + """ + The rules that define how users may connect to targets secured by your + application. + """ + created_at: Optional[datetime] = None decision: Optional[Decision] = None @@ -3899,6 +4242,29 @@ class McpServerPortalApplicationOAuthConfiguration(BaseModel): """Settings for OAuth grant behavior.""" +class McpServerPortalApplicationPolicyConnectionRulesRdp(BaseModel): + """The RDP-specific rules that define clipboard behavior for RDP connections.""" + + allowed_clipboard_local_to_remote_formats: Optional[List[Literal["text"]]] = None + """ + Clipboard formats allowed when copying from local machine to remote RDP session. + """ + + allowed_clipboard_remote_to_local_formats: Optional[List[Literal["text"]]] = None + """ + Clipboard formats allowed when copying from remote RDP session to local machine. + """ + + +class McpServerPortalApplicationPolicyConnectionRules(BaseModel): + """ + The rules that define how users may connect to targets secured by your application. + """ + + rdp: Optional[McpServerPortalApplicationPolicyConnectionRulesRdp] = None + """The RDP-specific rules that define clipboard behavior for RDP connections.""" + + class McpServerPortalApplicationPolicyMfaConfig(BaseModel): """Configures multi-factor authentication (MFA) settings.""" @@ -3932,6 +4298,12 @@ class McpServerPortalApplicationPolicy(BaseModel): session. """ + connection_rules: Optional[McpServerPortalApplicationPolicyConnectionRules] = None + """ + The rules that define how users may connect to targets secured by your + application. + """ + created_at: Optional[datetime] = None decision: Optional[Decision] = None diff --git a/src/cloudflare/types/zero_trust/access/application_get_response.py b/src/cloudflare/types/zero_trust/access/application_get_response.py index 62c9c99b07e..e9d06e36f7c 100644 --- a/src/cloudflare/types/zero_trust/access/application_get_response.py +++ b/src/cloudflare/types/zero_trust/access/application_get_response.py @@ -31,6 +31,8 @@ "SelfHostedApplicationOAuthConfigurationDynamicClientRegistration", "SelfHostedApplicationOAuthConfigurationGrant", "SelfHostedApplicationPolicy", + "SelfHostedApplicationPolicyConnectionRules", + "SelfHostedApplicationPolicyConnectionRulesRdp", "SelfHostedApplicationPolicyMfaConfig", "SelfHostedApplicationSCIMConfig", "SelfHostedApplicationSCIMConfigAuthentication", @@ -39,6 +41,8 @@ "SelfHostedApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken", "SaaSApplication", "SaaSApplicationPolicy", + "SaaSApplicationPolicyConnectionRules", + "SaaSApplicationPolicyConnectionRulesRdp", "SaaSApplicationPolicyMfaConfig", "SaaSApplicationSaaSApp", "SaaSApplicationSCIMConfig", @@ -56,6 +60,8 @@ "BrowserSSHApplicationOAuthConfigurationDynamicClientRegistration", "BrowserSSHApplicationOAuthConfigurationGrant", "BrowserSSHApplicationPolicy", + "BrowserSSHApplicationPolicyConnectionRules", + "BrowserSSHApplicationPolicyConnectionRulesRdp", "BrowserSSHApplicationPolicyMfaConfig", "BrowserSSHApplicationSCIMConfig", "BrowserSSHApplicationSCIMConfigAuthentication", @@ -72,6 +78,8 @@ "BrowserVNCApplicationOAuthConfigurationDynamicClientRegistration", "BrowserVNCApplicationOAuthConfigurationGrant", "BrowserVNCApplicationPolicy", + "BrowserVNCApplicationPolicyConnectionRules", + "BrowserVNCApplicationPolicyConnectionRulesRdp", "BrowserVNCApplicationPolicyMfaConfig", "BrowserVNCApplicationSCIMConfig", "BrowserVNCApplicationSCIMConfigAuthentication", @@ -82,18 +90,28 @@ "AppLauncherApplicationFooterLink", "AppLauncherApplicationLandingPageDesign", "AppLauncherApplicationPolicy", + "AppLauncherApplicationPolicyConnectionRules", + "AppLauncherApplicationPolicyConnectionRulesRdp", "AppLauncherApplicationPolicyMfaConfig", "DeviceEnrollmentPermissionsApplication", "DeviceEnrollmentPermissionsApplicationPolicy", + "DeviceEnrollmentPermissionsApplicationPolicyConnectionRules", + "DeviceEnrollmentPermissionsApplicationPolicyConnectionRulesRdp", "DeviceEnrollmentPermissionsApplicationPolicyMfaConfig", "BrowserIsolationPermissionsApplication", "BrowserIsolationPermissionsApplicationPolicy", + "BrowserIsolationPermissionsApplicationPolicyConnectionRules", + "BrowserIsolationPermissionsApplicationPolicyConnectionRulesRdp", "BrowserIsolationPermissionsApplicationPolicyMfaConfig", "GatewayIdentityProxyEndpointApplication", "GatewayIdentityProxyEndpointApplicationPolicy", + "GatewayIdentityProxyEndpointApplicationPolicyConnectionRules", + "GatewayIdentityProxyEndpointApplicationPolicyConnectionRulesRdp", "GatewayIdentityProxyEndpointApplicationPolicyMfaConfig", "BookmarkApplication", "BookmarkApplicationPolicy", + "BookmarkApplicationPolicyConnectionRules", + "BookmarkApplicationPolicyConnectionRulesRdp", "BookmarkApplicationPolicyMfaConfig", "InfrastructureApplication", "InfrastructureApplicationTargetCriterion", @@ -111,6 +129,8 @@ "BrowserRdpApplicationOAuthConfigurationDynamicClientRegistration", "BrowserRdpApplicationOAuthConfigurationGrant", "BrowserRdpApplicationPolicy", + "BrowserRdpApplicationPolicyConnectionRules", + "BrowserRdpApplicationPolicyConnectionRulesRdp", "BrowserRdpApplicationPolicyMfaConfig", "BrowserRdpApplicationSCIMConfig", "BrowserRdpApplicationSCIMConfigAuthentication", @@ -126,6 +146,8 @@ "McpServerApplicationOAuthConfigurationDynamicClientRegistration", "McpServerApplicationOAuthConfigurationGrant", "McpServerApplicationPolicy", + "McpServerApplicationPolicyConnectionRules", + "McpServerApplicationPolicyConnectionRulesRdp", "McpServerApplicationPolicyMfaConfig", "McpServerApplicationSCIMConfig", "McpServerApplicationSCIMConfigAuthentication", @@ -141,6 +163,8 @@ "McpServerPortalApplicationOAuthConfigurationDynamicClientRegistration", "McpServerPortalApplicationOAuthConfigurationGrant", "McpServerPortalApplicationPolicy", + "McpServerPortalApplicationPolicyConnectionRules", + "McpServerPortalApplicationPolicyConnectionRulesRdp", "McpServerPortalApplicationPolicyMfaConfig", "McpServerPortalApplicationSCIMConfig", "McpServerPortalApplicationSCIMConfigAuthentication", @@ -286,6 +310,29 @@ class SelfHostedApplicationOAuthConfiguration(BaseModel): """Settings for OAuth grant behavior.""" +class SelfHostedApplicationPolicyConnectionRulesRdp(BaseModel): + """The RDP-specific rules that define clipboard behavior for RDP connections.""" + + allowed_clipboard_local_to_remote_formats: Optional[List[Literal["text"]]] = None + """ + Clipboard formats allowed when copying from local machine to remote RDP session. + """ + + allowed_clipboard_remote_to_local_formats: Optional[List[Literal["text"]]] = None + """ + Clipboard formats allowed when copying from remote RDP session to local machine. + """ + + +class SelfHostedApplicationPolicyConnectionRules(BaseModel): + """ + The rules that define how users may connect to targets secured by your application. + """ + + rdp: Optional[SelfHostedApplicationPolicyConnectionRulesRdp] = None + """The RDP-specific rules that define clipboard behavior for RDP connections.""" + + class SelfHostedApplicationPolicyMfaConfig(BaseModel): """Configures multi-factor authentication (MFA) settings.""" @@ -319,6 +366,12 @@ class SelfHostedApplicationPolicy(BaseModel): session. """ + connection_rules: Optional[SelfHostedApplicationPolicyConnectionRules] = None + """ + The rules that define how users may connect to targets secured by your + application. + """ + created_at: Optional[datetime] = None decision: Optional[Decision] = None @@ -656,6 +709,29 @@ class SelfHostedApplication(BaseModel): """ +class SaaSApplicationPolicyConnectionRulesRdp(BaseModel): + """The RDP-specific rules that define clipboard behavior for RDP connections.""" + + allowed_clipboard_local_to_remote_formats: Optional[List[Literal["text"]]] = None + """ + Clipboard formats allowed when copying from local machine to remote RDP session. + """ + + allowed_clipboard_remote_to_local_formats: Optional[List[Literal["text"]]] = None + """ + Clipboard formats allowed when copying from remote RDP session to local machine. + """ + + +class SaaSApplicationPolicyConnectionRules(BaseModel): + """ + The rules that define how users may connect to targets secured by your application. + """ + + rdp: Optional[SaaSApplicationPolicyConnectionRulesRdp] = None + """The RDP-specific rules that define clipboard behavior for RDP connections.""" + + class SaaSApplicationPolicyMfaConfig(BaseModel): """Configures multi-factor authentication (MFA) settings.""" @@ -689,6 +765,12 @@ class SaaSApplicationPolicy(BaseModel): session. """ + connection_rules: Optional[SaaSApplicationPolicyConnectionRules] = None + """ + The rules that define how users may connect to targets secured by your + application. + """ + created_at: Optional[datetime] = None decision: Optional[Decision] = None @@ -1040,6 +1122,29 @@ class BrowserSSHApplicationOAuthConfiguration(BaseModel): """Settings for OAuth grant behavior.""" +class BrowserSSHApplicationPolicyConnectionRulesRdp(BaseModel): + """The RDP-specific rules that define clipboard behavior for RDP connections.""" + + allowed_clipboard_local_to_remote_formats: Optional[List[Literal["text"]]] = None + """ + Clipboard formats allowed when copying from local machine to remote RDP session. + """ + + allowed_clipboard_remote_to_local_formats: Optional[List[Literal["text"]]] = None + """ + Clipboard formats allowed when copying from remote RDP session to local machine. + """ + + +class BrowserSSHApplicationPolicyConnectionRules(BaseModel): + """ + The rules that define how users may connect to targets secured by your application. + """ + + rdp: Optional[BrowserSSHApplicationPolicyConnectionRulesRdp] = None + """The RDP-specific rules that define clipboard behavior for RDP connections.""" + + class BrowserSSHApplicationPolicyMfaConfig(BaseModel): """Configures multi-factor authentication (MFA) settings.""" @@ -1073,6 +1178,12 @@ class BrowserSSHApplicationPolicy(BaseModel): session. """ + connection_rules: Optional[BrowserSSHApplicationPolicyConnectionRules] = None + """ + The rules that define how users may connect to targets secured by your + application. + """ + created_at: Optional[datetime] = None decision: Optional[Decision] = None @@ -1561,6 +1672,29 @@ class BrowserVNCApplicationOAuthConfiguration(BaseModel): """Settings for OAuth grant behavior.""" +class BrowserVNCApplicationPolicyConnectionRulesRdp(BaseModel): + """The RDP-specific rules that define clipboard behavior for RDP connections.""" + + allowed_clipboard_local_to_remote_formats: Optional[List[Literal["text"]]] = None + """ + Clipboard formats allowed when copying from local machine to remote RDP session. + """ + + allowed_clipboard_remote_to_local_formats: Optional[List[Literal["text"]]] = None + """ + Clipboard formats allowed when copying from remote RDP session to local machine. + """ + + +class BrowserVNCApplicationPolicyConnectionRules(BaseModel): + """ + The rules that define how users may connect to targets secured by your application. + """ + + rdp: Optional[BrowserVNCApplicationPolicyConnectionRulesRdp] = None + """The RDP-specific rules that define clipboard behavior for RDP connections.""" + + class BrowserVNCApplicationPolicyMfaConfig(BaseModel): """Configures multi-factor authentication (MFA) settings.""" @@ -1594,6 +1728,12 @@ class BrowserVNCApplicationPolicy(BaseModel): session. """ + connection_rules: Optional[BrowserVNCApplicationPolicyConnectionRules] = None + """ + The rules that define how users may connect to targets secured by your + application. + """ + created_at: Optional[datetime] = None decision: Optional[Decision] = None @@ -1973,6 +2113,29 @@ class AppLauncherApplicationLandingPageDesign(BaseModel): """The title shown on the landing page.""" +class AppLauncherApplicationPolicyConnectionRulesRdp(BaseModel): + """The RDP-specific rules that define clipboard behavior for RDP connections.""" + + allowed_clipboard_local_to_remote_formats: Optional[List[Literal["text"]]] = None + """ + Clipboard formats allowed when copying from local machine to remote RDP session. + """ + + allowed_clipboard_remote_to_local_formats: Optional[List[Literal["text"]]] = None + """ + Clipboard formats allowed when copying from remote RDP session to local machine. + """ + + +class AppLauncherApplicationPolicyConnectionRules(BaseModel): + """ + The rules that define how users may connect to targets secured by your application. + """ + + rdp: Optional[AppLauncherApplicationPolicyConnectionRulesRdp] = None + """The RDP-specific rules that define clipboard behavior for RDP connections.""" + + class AppLauncherApplicationPolicyMfaConfig(BaseModel): """Configures multi-factor authentication (MFA) settings.""" @@ -2006,6 +2169,12 @@ class AppLauncherApplicationPolicy(BaseModel): session. """ + connection_rules: Optional[AppLauncherApplicationPolicyConnectionRules] = None + """ + The rules that define how users may connect to targets secured by your + application. + """ + created_at: Optional[datetime] = None decision: Optional[Decision] = None @@ -2158,6 +2327,29 @@ class AppLauncherApplication(BaseModel): """Determines when to skip the App Launcher landing page.""" +class DeviceEnrollmentPermissionsApplicationPolicyConnectionRulesRdp(BaseModel): + """The RDP-specific rules that define clipboard behavior for RDP connections.""" + + allowed_clipboard_local_to_remote_formats: Optional[List[Literal["text"]]] = None + """ + Clipboard formats allowed when copying from local machine to remote RDP session. + """ + + allowed_clipboard_remote_to_local_formats: Optional[List[Literal["text"]]] = None + """ + Clipboard formats allowed when copying from remote RDP session to local machine. + """ + + +class DeviceEnrollmentPermissionsApplicationPolicyConnectionRules(BaseModel): + """ + The rules that define how users may connect to targets secured by your application. + """ + + rdp: Optional[DeviceEnrollmentPermissionsApplicationPolicyConnectionRulesRdp] = None + """The RDP-specific rules that define clipboard behavior for RDP connections.""" + + class DeviceEnrollmentPermissionsApplicationPolicyMfaConfig(BaseModel): """Configures multi-factor authentication (MFA) settings.""" @@ -2191,6 +2383,12 @@ class DeviceEnrollmentPermissionsApplicationPolicy(BaseModel): session. """ + connection_rules: Optional[DeviceEnrollmentPermissionsApplicationPolicyConnectionRules] = None + """ + The rules that define how users may connect to targets secured by your + application. + """ + created_at: Optional[datetime] = None decision: Optional[Decision] = None @@ -2310,6 +2508,29 @@ class DeviceEnrollmentPermissionsApplication(BaseModel): """ +class BrowserIsolationPermissionsApplicationPolicyConnectionRulesRdp(BaseModel): + """The RDP-specific rules that define clipboard behavior for RDP connections.""" + + allowed_clipboard_local_to_remote_formats: Optional[List[Literal["text"]]] = None + """ + Clipboard formats allowed when copying from local machine to remote RDP session. + """ + + allowed_clipboard_remote_to_local_formats: Optional[List[Literal["text"]]] = None + """ + Clipboard formats allowed when copying from remote RDP session to local machine. + """ + + +class BrowserIsolationPermissionsApplicationPolicyConnectionRules(BaseModel): + """ + The rules that define how users may connect to targets secured by your application. + """ + + rdp: Optional[BrowserIsolationPermissionsApplicationPolicyConnectionRulesRdp] = None + """The RDP-specific rules that define clipboard behavior for RDP connections.""" + + class BrowserIsolationPermissionsApplicationPolicyMfaConfig(BaseModel): """Configures multi-factor authentication (MFA) settings.""" @@ -2343,6 +2564,12 @@ class BrowserIsolationPermissionsApplicationPolicy(BaseModel): session. """ + connection_rules: Optional[BrowserIsolationPermissionsApplicationPolicyConnectionRules] = None + """ + The rules that define how users may connect to targets secured by your + application. + """ + created_at: Optional[datetime] = None decision: Optional[Decision] = None @@ -2462,6 +2689,29 @@ class BrowserIsolationPermissionsApplication(BaseModel): """ +class GatewayIdentityProxyEndpointApplicationPolicyConnectionRulesRdp(BaseModel): + """The RDP-specific rules that define clipboard behavior for RDP connections.""" + + allowed_clipboard_local_to_remote_formats: Optional[List[Literal["text"]]] = None + """ + Clipboard formats allowed when copying from local machine to remote RDP session. + """ + + allowed_clipboard_remote_to_local_formats: Optional[List[Literal["text"]]] = None + """ + Clipboard formats allowed when copying from remote RDP session to local machine. + """ + + +class GatewayIdentityProxyEndpointApplicationPolicyConnectionRules(BaseModel): + """ + The rules that define how users may connect to targets secured by your application. + """ + + rdp: Optional[GatewayIdentityProxyEndpointApplicationPolicyConnectionRulesRdp] = None + """The RDP-specific rules that define clipboard behavior for RDP connections.""" + + class GatewayIdentityProxyEndpointApplicationPolicyMfaConfig(BaseModel): """Configures multi-factor authentication (MFA) settings.""" @@ -2495,6 +2745,12 @@ class GatewayIdentityProxyEndpointApplicationPolicy(BaseModel): session. """ + connection_rules: Optional[GatewayIdentityProxyEndpointApplicationPolicyConnectionRules] = None + """ + The rules that define how users may connect to targets secured by your + application. + """ + created_at: Optional[datetime] = None decision: Optional[Decision] = None @@ -2614,6 +2870,29 @@ class GatewayIdentityProxyEndpointApplication(BaseModel): """ +class BookmarkApplicationPolicyConnectionRulesRdp(BaseModel): + """The RDP-specific rules that define clipboard behavior for RDP connections.""" + + allowed_clipboard_local_to_remote_formats: Optional[List[Literal["text"]]] = None + """ + Clipboard formats allowed when copying from local machine to remote RDP session. + """ + + allowed_clipboard_remote_to_local_formats: Optional[List[Literal["text"]]] = None + """ + Clipboard formats allowed when copying from remote RDP session to local machine. + """ + + +class BookmarkApplicationPolicyConnectionRules(BaseModel): + """ + The rules that define how users may connect to targets secured by your application. + """ + + rdp: Optional[BookmarkApplicationPolicyConnectionRulesRdp] = None + """The RDP-specific rules that define clipboard behavior for RDP connections.""" + + class BookmarkApplicationPolicyMfaConfig(BaseModel): """Configures multi-factor authentication (MFA) settings.""" @@ -2647,6 +2926,12 @@ class BookmarkApplicationPolicy(BaseModel): session. """ + connection_rules: Optional[BookmarkApplicationPolicyConnectionRules] = None + """ + The rules that define how users may connect to targets secured by your + application. + """ + created_at: Optional[datetime] = None decision: Optional[Decision] = None @@ -2987,6 +3272,29 @@ class BrowserRdpApplicationOAuthConfiguration(BaseModel): """Settings for OAuth grant behavior.""" +class BrowserRdpApplicationPolicyConnectionRulesRdp(BaseModel): + """The RDP-specific rules that define clipboard behavior for RDP connections.""" + + allowed_clipboard_local_to_remote_formats: Optional[List[Literal["text"]]] = None + """ + Clipboard formats allowed when copying from local machine to remote RDP session. + """ + + allowed_clipboard_remote_to_local_formats: Optional[List[Literal["text"]]] = None + """ + Clipboard formats allowed when copying from remote RDP session to local machine. + """ + + +class BrowserRdpApplicationPolicyConnectionRules(BaseModel): + """ + The rules that define how users may connect to targets secured by your application. + """ + + rdp: Optional[BrowserRdpApplicationPolicyConnectionRulesRdp] = None + """The RDP-specific rules that define clipboard behavior for RDP connections.""" + + class BrowserRdpApplicationPolicyMfaConfig(BaseModel): """Configures multi-factor authentication (MFA) settings.""" @@ -3020,6 +3328,12 @@ class BrowserRdpApplicationPolicy(BaseModel): session. """ + connection_rules: Optional[BrowserRdpApplicationPolicyConnectionRules] = None + """ + The rules that define how users may connect to targets secured by your + application. + """ + created_at: Optional[datetime] = None decision: Optional[Decision] = None @@ -3475,6 +3789,29 @@ class McpServerApplicationOAuthConfiguration(BaseModel): """Settings for OAuth grant behavior.""" +class McpServerApplicationPolicyConnectionRulesRdp(BaseModel): + """The RDP-specific rules that define clipboard behavior for RDP connections.""" + + allowed_clipboard_local_to_remote_formats: Optional[List[Literal["text"]]] = None + """ + Clipboard formats allowed when copying from local machine to remote RDP session. + """ + + allowed_clipboard_remote_to_local_formats: Optional[List[Literal["text"]]] = None + """ + Clipboard formats allowed when copying from remote RDP session to local machine. + """ + + +class McpServerApplicationPolicyConnectionRules(BaseModel): + """ + The rules that define how users may connect to targets secured by your application. + """ + + rdp: Optional[McpServerApplicationPolicyConnectionRulesRdp] = None + """The RDP-specific rules that define clipboard behavior for RDP connections.""" + + class McpServerApplicationPolicyMfaConfig(BaseModel): """Configures multi-factor authentication (MFA) settings.""" @@ -3508,6 +3845,12 @@ class McpServerApplicationPolicy(BaseModel): session. """ + connection_rules: Optional[McpServerApplicationPolicyConnectionRules] = None + """ + The rules that define how users may connect to targets secured by your + application. + """ + created_at: Optional[datetime] = None decision: Optional[Decision] = None @@ -3899,6 +4242,29 @@ class McpServerPortalApplicationOAuthConfiguration(BaseModel): """Settings for OAuth grant behavior.""" +class McpServerPortalApplicationPolicyConnectionRulesRdp(BaseModel): + """The RDP-specific rules that define clipboard behavior for RDP connections.""" + + allowed_clipboard_local_to_remote_formats: Optional[List[Literal["text"]]] = None + """ + Clipboard formats allowed when copying from local machine to remote RDP session. + """ + + allowed_clipboard_remote_to_local_formats: Optional[List[Literal["text"]]] = None + """ + Clipboard formats allowed when copying from remote RDP session to local machine. + """ + + +class McpServerPortalApplicationPolicyConnectionRules(BaseModel): + """ + The rules that define how users may connect to targets secured by your application. + """ + + rdp: Optional[McpServerPortalApplicationPolicyConnectionRulesRdp] = None + """The RDP-specific rules that define clipboard behavior for RDP connections.""" + + class McpServerPortalApplicationPolicyMfaConfig(BaseModel): """Configures multi-factor authentication (MFA) settings.""" @@ -3932,6 +4298,12 @@ class McpServerPortalApplicationPolicy(BaseModel): session. """ + connection_rules: Optional[McpServerPortalApplicationPolicyConnectionRules] = None + """ + The rules that define how users may connect to targets secured by your + application. + """ + created_at: Optional[datetime] = None decision: Optional[Decision] = None diff --git a/src/cloudflare/types/zero_trust/access/application_list_response.py b/src/cloudflare/types/zero_trust/access/application_list_response.py index f565fa37c5a..554619c1efb 100644 --- a/src/cloudflare/types/zero_trust/access/application_list_response.py +++ b/src/cloudflare/types/zero_trust/access/application_list_response.py @@ -31,6 +31,8 @@ "SelfHostedApplicationOAuthConfigurationDynamicClientRegistration", "SelfHostedApplicationOAuthConfigurationGrant", "SelfHostedApplicationPolicy", + "SelfHostedApplicationPolicyConnectionRules", + "SelfHostedApplicationPolicyConnectionRulesRdp", "SelfHostedApplicationPolicyMfaConfig", "SelfHostedApplicationSCIMConfig", "SelfHostedApplicationSCIMConfigAuthentication", @@ -39,6 +41,8 @@ "SelfHostedApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken", "SaaSApplication", "SaaSApplicationPolicy", + "SaaSApplicationPolicyConnectionRules", + "SaaSApplicationPolicyConnectionRulesRdp", "SaaSApplicationPolicyMfaConfig", "SaaSApplicationSaaSApp", "SaaSApplicationSCIMConfig", @@ -56,6 +60,8 @@ "BrowserSSHApplicationOAuthConfigurationDynamicClientRegistration", "BrowserSSHApplicationOAuthConfigurationGrant", "BrowserSSHApplicationPolicy", + "BrowserSSHApplicationPolicyConnectionRules", + "BrowserSSHApplicationPolicyConnectionRulesRdp", "BrowserSSHApplicationPolicyMfaConfig", "BrowserSSHApplicationSCIMConfig", "BrowserSSHApplicationSCIMConfigAuthentication", @@ -72,6 +78,8 @@ "BrowserVNCApplicationOAuthConfigurationDynamicClientRegistration", "BrowserVNCApplicationOAuthConfigurationGrant", "BrowserVNCApplicationPolicy", + "BrowserVNCApplicationPolicyConnectionRules", + "BrowserVNCApplicationPolicyConnectionRulesRdp", "BrowserVNCApplicationPolicyMfaConfig", "BrowserVNCApplicationSCIMConfig", "BrowserVNCApplicationSCIMConfigAuthentication", @@ -82,18 +90,28 @@ "AppLauncherApplicationFooterLink", "AppLauncherApplicationLandingPageDesign", "AppLauncherApplicationPolicy", + "AppLauncherApplicationPolicyConnectionRules", + "AppLauncherApplicationPolicyConnectionRulesRdp", "AppLauncherApplicationPolicyMfaConfig", "DeviceEnrollmentPermissionsApplication", "DeviceEnrollmentPermissionsApplicationPolicy", + "DeviceEnrollmentPermissionsApplicationPolicyConnectionRules", + "DeviceEnrollmentPermissionsApplicationPolicyConnectionRulesRdp", "DeviceEnrollmentPermissionsApplicationPolicyMfaConfig", "BrowserIsolationPermissionsApplication", "BrowserIsolationPermissionsApplicationPolicy", + "BrowserIsolationPermissionsApplicationPolicyConnectionRules", + "BrowserIsolationPermissionsApplicationPolicyConnectionRulesRdp", "BrowserIsolationPermissionsApplicationPolicyMfaConfig", "GatewayIdentityProxyEndpointApplication", "GatewayIdentityProxyEndpointApplicationPolicy", + "GatewayIdentityProxyEndpointApplicationPolicyConnectionRules", + "GatewayIdentityProxyEndpointApplicationPolicyConnectionRulesRdp", "GatewayIdentityProxyEndpointApplicationPolicyMfaConfig", "BookmarkApplication", "BookmarkApplicationPolicy", + "BookmarkApplicationPolicyConnectionRules", + "BookmarkApplicationPolicyConnectionRulesRdp", "BookmarkApplicationPolicyMfaConfig", "InfrastructureApplication", "InfrastructureApplicationTargetCriterion", @@ -111,6 +129,8 @@ "BrowserRdpApplicationOAuthConfigurationDynamicClientRegistration", "BrowserRdpApplicationOAuthConfigurationGrant", "BrowserRdpApplicationPolicy", + "BrowserRdpApplicationPolicyConnectionRules", + "BrowserRdpApplicationPolicyConnectionRulesRdp", "BrowserRdpApplicationPolicyMfaConfig", "BrowserRdpApplicationSCIMConfig", "BrowserRdpApplicationSCIMConfigAuthentication", @@ -126,6 +146,8 @@ "McpServerApplicationOAuthConfigurationDynamicClientRegistration", "McpServerApplicationOAuthConfigurationGrant", "McpServerApplicationPolicy", + "McpServerApplicationPolicyConnectionRules", + "McpServerApplicationPolicyConnectionRulesRdp", "McpServerApplicationPolicyMfaConfig", "McpServerApplicationSCIMConfig", "McpServerApplicationSCIMConfigAuthentication", @@ -141,6 +163,8 @@ "McpServerPortalApplicationOAuthConfigurationDynamicClientRegistration", "McpServerPortalApplicationOAuthConfigurationGrant", "McpServerPortalApplicationPolicy", + "McpServerPortalApplicationPolicyConnectionRules", + "McpServerPortalApplicationPolicyConnectionRulesRdp", "McpServerPortalApplicationPolicyMfaConfig", "McpServerPortalApplicationSCIMConfig", "McpServerPortalApplicationSCIMConfigAuthentication", @@ -286,6 +310,29 @@ class SelfHostedApplicationOAuthConfiguration(BaseModel): """Settings for OAuth grant behavior.""" +class SelfHostedApplicationPolicyConnectionRulesRdp(BaseModel): + """The RDP-specific rules that define clipboard behavior for RDP connections.""" + + allowed_clipboard_local_to_remote_formats: Optional[List[Literal["text"]]] = None + """ + Clipboard formats allowed when copying from local machine to remote RDP session. + """ + + allowed_clipboard_remote_to_local_formats: Optional[List[Literal["text"]]] = None + """ + Clipboard formats allowed when copying from remote RDP session to local machine. + """ + + +class SelfHostedApplicationPolicyConnectionRules(BaseModel): + """ + The rules that define how users may connect to targets secured by your application. + """ + + rdp: Optional[SelfHostedApplicationPolicyConnectionRulesRdp] = None + """The RDP-specific rules that define clipboard behavior for RDP connections.""" + + class SelfHostedApplicationPolicyMfaConfig(BaseModel): """Configures multi-factor authentication (MFA) settings.""" @@ -319,6 +366,12 @@ class SelfHostedApplicationPolicy(BaseModel): session. """ + connection_rules: Optional[SelfHostedApplicationPolicyConnectionRules] = None + """ + The rules that define how users may connect to targets secured by your + application. + """ + created_at: Optional[datetime] = None decision: Optional[Decision] = None @@ -656,6 +709,29 @@ class SelfHostedApplication(BaseModel): """ +class SaaSApplicationPolicyConnectionRulesRdp(BaseModel): + """The RDP-specific rules that define clipboard behavior for RDP connections.""" + + allowed_clipboard_local_to_remote_formats: Optional[List[Literal["text"]]] = None + """ + Clipboard formats allowed when copying from local machine to remote RDP session. + """ + + allowed_clipboard_remote_to_local_formats: Optional[List[Literal["text"]]] = None + """ + Clipboard formats allowed when copying from remote RDP session to local machine. + """ + + +class SaaSApplicationPolicyConnectionRules(BaseModel): + """ + The rules that define how users may connect to targets secured by your application. + """ + + rdp: Optional[SaaSApplicationPolicyConnectionRulesRdp] = None + """The RDP-specific rules that define clipboard behavior for RDP connections.""" + + class SaaSApplicationPolicyMfaConfig(BaseModel): """Configures multi-factor authentication (MFA) settings.""" @@ -689,6 +765,12 @@ class SaaSApplicationPolicy(BaseModel): session. """ + connection_rules: Optional[SaaSApplicationPolicyConnectionRules] = None + """ + The rules that define how users may connect to targets secured by your + application. + """ + created_at: Optional[datetime] = None decision: Optional[Decision] = None @@ -1040,6 +1122,29 @@ class BrowserSSHApplicationOAuthConfiguration(BaseModel): """Settings for OAuth grant behavior.""" +class BrowserSSHApplicationPolicyConnectionRulesRdp(BaseModel): + """The RDP-specific rules that define clipboard behavior for RDP connections.""" + + allowed_clipboard_local_to_remote_formats: Optional[List[Literal["text"]]] = None + """ + Clipboard formats allowed when copying from local machine to remote RDP session. + """ + + allowed_clipboard_remote_to_local_formats: Optional[List[Literal["text"]]] = None + """ + Clipboard formats allowed when copying from remote RDP session to local machine. + """ + + +class BrowserSSHApplicationPolicyConnectionRules(BaseModel): + """ + The rules that define how users may connect to targets secured by your application. + """ + + rdp: Optional[BrowserSSHApplicationPolicyConnectionRulesRdp] = None + """The RDP-specific rules that define clipboard behavior for RDP connections.""" + + class BrowserSSHApplicationPolicyMfaConfig(BaseModel): """Configures multi-factor authentication (MFA) settings.""" @@ -1073,6 +1178,12 @@ class BrowserSSHApplicationPolicy(BaseModel): session. """ + connection_rules: Optional[BrowserSSHApplicationPolicyConnectionRules] = None + """ + The rules that define how users may connect to targets secured by your + application. + """ + created_at: Optional[datetime] = None decision: Optional[Decision] = None @@ -1561,6 +1672,29 @@ class BrowserVNCApplicationOAuthConfiguration(BaseModel): """Settings for OAuth grant behavior.""" +class BrowserVNCApplicationPolicyConnectionRulesRdp(BaseModel): + """The RDP-specific rules that define clipboard behavior for RDP connections.""" + + allowed_clipboard_local_to_remote_formats: Optional[List[Literal["text"]]] = None + """ + Clipboard formats allowed when copying from local machine to remote RDP session. + """ + + allowed_clipboard_remote_to_local_formats: Optional[List[Literal["text"]]] = None + """ + Clipboard formats allowed when copying from remote RDP session to local machine. + """ + + +class BrowserVNCApplicationPolicyConnectionRules(BaseModel): + """ + The rules that define how users may connect to targets secured by your application. + """ + + rdp: Optional[BrowserVNCApplicationPolicyConnectionRulesRdp] = None + """The RDP-specific rules that define clipboard behavior for RDP connections.""" + + class BrowserVNCApplicationPolicyMfaConfig(BaseModel): """Configures multi-factor authentication (MFA) settings.""" @@ -1594,6 +1728,12 @@ class BrowserVNCApplicationPolicy(BaseModel): session. """ + connection_rules: Optional[BrowserVNCApplicationPolicyConnectionRules] = None + """ + The rules that define how users may connect to targets secured by your + application. + """ + created_at: Optional[datetime] = None decision: Optional[Decision] = None @@ -1973,6 +2113,29 @@ class AppLauncherApplicationLandingPageDesign(BaseModel): """The title shown on the landing page.""" +class AppLauncherApplicationPolicyConnectionRulesRdp(BaseModel): + """The RDP-specific rules that define clipboard behavior for RDP connections.""" + + allowed_clipboard_local_to_remote_formats: Optional[List[Literal["text"]]] = None + """ + Clipboard formats allowed when copying from local machine to remote RDP session. + """ + + allowed_clipboard_remote_to_local_formats: Optional[List[Literal["text"]]] = None + """ + Clipboard formats allowed when copying from remote RDP session to local machine. + """ + + +class AppLauncherApplicationPolicyConnectionRules(BaseModel): + """ + The rules that define how users may connect to targets secured by your application. + """ + + rdp: Optional[AppLauncherApplicationPolicyConnectionRulesRdp] = None + """The RDP-specific rules that define clipboard behavior for RDP connections.""" + + class AppLauncherApplicationPolicyMfaConfig(BaseModel): """Configures multi-factor authentication (MFA) settings.""" @@ -2006,6 +2169,12 @@ class AppLauncherApplicationPolicy(BaseModel): session. """ + connection_rules: Optional[AppLauncherApplicationPolicyConnectionRules] = None + """ + The rules that define how users may connect to targets secured by your + application. + """ + created_at: Optional[datetime] = None decision: Optional[Decision] = None @@ -2158,6 +2327,29 @@ class AppLauncherApplication(BaseModel): """Determines when to skip the App Launcher landing page.""" +class DeviceEnrollmentPermissionsApplicationPolicyConnectionRulesRdp(BaseModel): + """The RDP-specific rules that define clipboard behavior for RDP connections.""" + + allowed_clipboard_local_to_remote_formats: Optional[List[Literal["text"]]] = None + """ + Clipboard formats allowed when copying from local machine to remote RDP session. + """ + + allowed_clipboard_remote_to_local_formats: Optional[List[Literal["text"]]] = None + """ + Clipboard formats allowed when copying from remote RDP session to local machine. + """ + + +class DeviceEnrollmentPermissionsApplicationPolicyConnectionRules(BaseModel): + """ + The rules that define how users may connect to targets secured by your application. + """ + + rdp: Optional[DeviceEnrollmentPermissionsApplicationPolicyConnectionRulesRdp] = None + """The RDP-specific rules that define clipboard behavior for RDP connections.""" + + class DeviceEnrollmentPermissionsApplicationPolicyMfaConfig(BaseModel): """Configures multi-factor authentication (MFA) settings.""" @@ -2191,6 +2383,12 @@ class DeviceEnrollmentPermissionsApplicationPolicy(BaseModel): session. """ + connection_rules: Optional[DeviceEnrollmentPermissionsApplicationPolicyConnectionRules] = None + """ + The rules that define how users may connect to targets secured by your + application. + """ + created_at: Optional[datetime] = None decision: Optional[Decision] = None @@ -2310,6 +2508,29 @@ class DeviceEnrollmentPermissionsApplication(BaseModel): """ +class BrowserIsolationPermissionsApplicationPolicyConnectionRulesRdp(BaseModel): + """The RDP-specific rules that define clipboard behavior for RDP connections.""" + + allowed_clipboard_local_to_remote_formats: Optional[List[Literal["text"]]] = None + """ + Clipboard formats allowed when copying from local machine to remote RDP session. + """ + + allowed_clipboard_remote_to_local_formats: Optional[List[Literal["text"]]] = None + """ + Clipboard formats allowed when copying from remote RDP session to local machine. + """ + + +class BrowserIsolationPermissionsApplicationPolicyConnectionRules(BaseModel): + """ + The rules that define how users may connect to targets secured by your application. + """ + + rdp: Optional[BrowserIsolationPermissionsApplicationPolicyConnectionRulesRdp] = None + """The RDP-specific rules that define clipboard behavior for RDP connections.""" + + class BrowserIsolationPermissionsApplicationPolicyMfaConfig(BaseModel): """Configures multi-factor authentication (MFA) settings.""" @@ -2343,6 +2564,12 @@ class BrowserIsolationPermissionsApplicationPolicy(BaseModel): session. """ + connection_rules: Optional[BrowserIsolationPermissionsApplicationPolicyConnectionRules] = None + """ + The rules that define how users may connect to targets secured by your + application. + """ + created_at: Optional[datetime] = None decision: Optional[Decision] = None @@ -2462,6 +2689,29 @@ class BrowserIsolationPermissionsApplication(BaseModel): """ +class GatewayIdentityProxyEndpointApplicationPolicyConnectionRulesRdp(BaseModel): + """The RDP-specific rules that define clipboard behavior for RDP connections.""" + + allowed_clipboard_local_to_remote_formats: Optional[List[Literal["text"]]] = None + """ + Clipboard formats allowed when copying from local machine to remote RDP session. + """ + + allowed_clipboard_remote_to_local_formats: Optional[List[Literal["text"]]] = None + """ + Clipboard formats allowed when copying from remote RDP session to local machine. + """ + + +class GatewayIdentityProxyEndpointApplicationPolicyConnectionRules(BaseModel): + """ + The rules that define how users may connect to targets secured by your application. + """ + + rdp: Optional[GatewayIdentityProxyEndpointApplicationPolicyConnectionRulesRdp] = None + """The RDP-specific rules that define clipboard behavior for RDP connections.""" + + class GatewayIdentityProxyEndpointApplicationPolicyMfaConfig(BaseModel): """Configures multi-factor authentication (MFA) settings.""" @@ -2495,6 +2745,12 @@ class GatewayIdentityProxyEndpointApplicationPolicy(BaseModel): session. """ + connection_rules: Optional[GatewayIdentityProxyEndpointApplicationPolicyConnectionRules] = None + """ + The rules that define how users may connect to targets secured by your + application. + """ + created_at: Optional[datetime] = None decision: Optional[Decision] = None @@ -2614,6 +2870,29 @@ class GatewayIdentityProxyEndpointApplication(BaseModel): """ +class BookmarkApplicationPolicyConnectionRulesRdp(BaseModel): + """The RDP-specific rules that define clipboard behavior for RDP connections.""" + + allowed_clipboard_local_to_remote_formats: Optional[List[Literal["text"]]] = None + """ + Clipboard formats allowed when copying from local machine to remote RDP session. + """ + + allowed_clipboard_remote_to_local_formats: Optional[List[Literal["text"]]] = None + """ + Clipboard formats allowed when copying from remote RDP session to local machine. + """ + + +class BookmarkApplicationPolicyConnectionRules(BaseModel): + """ + The rules that define how users may connect to targets secured by your application. + """ + + rdp: Optional[BookmarkApplicationPolicyConnectionRulesRdp] = None + """The RDP-specific rules that define clipboard behavior for RDP connections.""" + + class BookmarkApplicationPolicyMfaConfig(BaseModel): """Configures multi-factor authentication (MFA) settings.""" @@ -2647,6 +2926,12 @@ class BookmarkApplicationPolicy(BaseModel): session. """ + connection_rules: Optional[BookmarkApplicationPolicyConnectionRules] = None + """ + The rules that define how users may connect to targets secured by your + application. + """ + created_at: Optional[datetime] = None decision: Optional[Decision] = None @@ -2987,6 +3272,29 @@ class BrowserRdpApplicationOAuthConfiguration(BaseModel): """Settings for OAuth grant behavior.""" +class BrowserRdpApplicationPolicyConnectionRulesRdp(BaseModel): + """The RDP-specific rules that define clipboard behavior for RDP connections.""" + + allowed_clipboard_local_to_remote_formats: Optional[List[Literal["text"]]] = None + """ + Clipboard formats allowed when copying from local machine to remote RDP session. + """ + + allowed_clipboard_remote_to_local_formats: Optional[List[Literal["text"]]] = None + """ + Clipboard formats allowed when copying from remote RDP session to local machine. + """ + + +class BrowserRdpApplicationPolicyConnectionRules(BaseModel): + """ + The rules that define how users may connect to targets secured by your application. + """ + + rdp: Optional[BrowserRdpApplicationPolicyConnectionRulesRdp] = None + """The RDP-specific rules that define clipboard behavior for RDP connections.""" + + class BrowserRdpApplicationPolicyMfaConfig(BaseModel): """Configures multi-factor authentication (MFA) settings.""" @@ -3020,6 +3328,12 @@ class BrowserRdpApplicationPolicy(BaseModel): session. """ + connection_rules: Optional[BrowserRdpApplicationPolicyConnectionRules] = None + """ + The rules that define how users may connect to targets secured by your + application. + """ + created_at: Optional[datetime] = None decision: Optional[Decision] = None @@ -3475,6 +3789,29 @@ class McpServerApplicationOAuthConfiguration(BaseModel): """Settings for OAuth grant behavior.""" +class McpServerApplicationPolicyConnectionRulesRdp(BaseModel): + """The RDP-specific rules that define clipboard behavior for RDP connections.""" + + allowed_clipboard_local_to_remote_formats: Optional[List[Literal["text"]]] = None + """ + Clipboard formats allowed when copying from local machine to remote RDP session. + """ + + allowed_clipboard_remote_to_local_formats: Optional[List[Literal["text"]]] = None + """ + Clipboard formats allowed when copying from remote RDP session to local machine. + """ + + +class McpServerApplicationPolicyConnectionRules(BaseModel): + """ + The rules that define how users may connect to targets secured by your application. + """ + + rdp: Optional[McpServerApplicationPolicyConnectionRulesRdp] = None + """The RDP-specific rules that define clipboard behavior for RDP connections.""" + + class McpServerApplicationPolicyMfaConfig(BaseModel): """Configures multi-factor authentication (MFA) settings.""" @@ -3508,6 +3845,12 @@ class McpServerApplicationPolicy(BaseModel): session. """ + connection_rules: Optional[McpServerApplicationPolicyConnectionRules] = None + """ + The rules that define how users may connect to targets secured by your + application. + """ + created_at: Optional[datetime] = None decision: Optional[Decision] = None @@ -3899,6 +4242,29 @@ class McpServerPortalApplicationOAuthConfiguration(BaseModel): """Settings for OAuth grant behavior.""" +class McpServerPortalApplicationPolicyConnectionRulesRdp(BaseModel): + """The RDP-specific rules that define clipboard behavior for RDP connections.""" + + allowed_clipboard_local_to_remote_formats: Optional[List[Literal["text"]]] = None + """ + Clipboard formats allowed when copying from local machine to remote RDP session. + """ + + allowed_clipboard_remote_to_local_formats: Optional[List[Literal["text"]]] = None + """ + Clipboard formats allowed when copying from remote RDP session to local machine. + """ + + +class McpServerPortalApplicationPolicyConnectionRules(BaseModel): + """ + The rules that define how users may connect to targets secured by your application. + """ + + rdp: Optional[McpServerPortalApplicationPolicyConnectionRulesRdp] = None + """The RDP-specific rules that define clipboard behavior for RDP connections.""" + + class McpServerPortalApplicationPolicyMfaConfig(BaseModel): """Configures multi-factor authentication (MFA) settings.""" @@ -3932,6 +4298,12 @@ class McpServerPortalApplicationPolicy(BaseModel): session. """ + connection_rules: Optional[McpServerPortalApplicationPolicyConnectionRules] = None + """ + The rules that define how users may connect to targets secured by your + application. + """ + created_at: Optional[datetime] = None decision: Optional[Decision] = None diff --git a/src/cloudflare/types/zero_trust/access/application_update_params.py b/src/cloudflare/types/zero_trust/access/application_update_params.py index b793abed2a7..7b542310189 100644 --- a/src/cloudflare/types/zero_trust/access/application_update_params.py +++ b/src/cloudflare/types/zero_trust/access/application_update_params.py @@ -34,6 +34,8 @@ "SelfHostedApplicationPolicy", "SelfHostedApplicationPolicyAccessAppPolicyLink", "SelfHostedApplicationPolicyUnionMember2", + "SelfHostedApplicationPolicyUnionMember2ConnectionRules", + "SelfHostedApplicationPolicyUnionMember2ConnectionRulesRdp", "SelfHostedApplicationPolicyUnionMember2MfaConfig", "SelfHostedApplicationSCIMConfig", "SelfHostedApplicationSCIMConfigAuthentication", @@ -44,6 +46,8 @@ "SaaSApplicationPolicy", "SaaSApplicationPolicyAccessAppPolicyLink", "SaaSApplicationPolicyUnionMember2", + "SaaSApplicationPolicyUnionMember2ConnectionRules", + "SaaSApplicationPolicyUnionMember2ConnectionRulesRdp", "SaaSApplicationPolicyUnionMember2MfaConfig", "SaaSApplicationSaaSApp", "SaaSApplicationSCIMConfig", @@ -63,6 +67,8 @@ "BrowserSSHApplicationPolicy", "BrowserSSHApplicationPolicyAccessAppPolicyLink", "BrowserSSHApplicationPolicyUnionMember2", + "BrowserSSHApplicationPolicyUnionMember2ConnectionRules", + "BrowserSSHApplicationPolicyUnionMember2ConnectionRulesRdp", "BrowserSSHApplicationPolicyUnionMember2MfaConfig", "BrowserSSHApplicationSCIMConfig", "BrowserSSHApplicationSCIMConfigAuthentication", @@ -81,6 +87,8 @@ "BrowserVNCApplicationPolicy", "BrowserVNCApplicationPolicyAccessAppPolicyLink", "BrowserVNCApplicationPolicyUnionMember2", + "BrowserVNCApplicationPolicyUnionMember2ConnectionRules", + "BrowserVNCApplicationPolicyUnionMember2ConnectionRulesRdp", "BrowserVNCApplicationPolicyUnionMember2MfaConfig", "BrowserVNCApplicationSCIMConfig", "BrowserVNCApplicationSCIMConfigAuthentication", @@ -93,26 +101,36 @@ "AppLauncherApplicationPolicy", "AppLauncherApplicationPolicyAccessAppPolicyLink", "AppLauncherApplicationPolicyUnionMember2", + "AppLauncherApplicationPolicyUnionMember2ConnectionRules", + "AppLauncherApplicationPolicyUnionMember2ConnectionRulesRdp", "AppLauncherApplicationPolicyUnionMember2MfaConfig", "DeviceEnrollmentPermissionsApplication", "DeviceEnrollmentPermissionsApplicationPolicy", "DeviceEnrollmentPermissionsApplicationPolicyAccessAppPolicyLink", "DeviceEnrollmentPermissionsApplicationPolicyUnionMember2", + "DeviceEnrollmentPermissionsApplicationPolicyUnionMember2ConnectionRules", + "DeviceEnrollmentPermissionsApplicationPolicyUnionMember2ConnectionRulesRdp", "DeviceEnrollmentPermissionsApplicationPolicyUnionMember2MfaConfig", "BrowserIsolationPermissionsApplication", "BrowserIsolationPermissionsApplicationPolicy", "BrowserIsolationPermissionsApplicationPolicyAccessAppPolicyLink", "BrowserIsolationPermissionsApplicationPolicyUnionMember2", + "BrowserIsolationPermissionsApplicationPolicyUnionMember2ConnectionRules", + "BrowserIsolationPermissionsApplicationPolicyUnionMember2ConnectionRulesRdp", "BrowserIsolationPermissionsApplicationPolicyUnionMember2MfaConfig", "GatewayIdentityProxyEndpointApplication", "GatewayIdentityProxyEndpointApplicationPolicy", "GatewayIdentityProxyEndpointApplicationPolicyAccessAppPolicyLink", "GatewayIdentityProxyEndpointApplicationPolicyUnionMember2", + "GatewayIdentityProxyEndpointApplicationPolicyUnionMember2ConnectionRules", + "GatewayIdentityProxyEndpointApplicationPolicyUnionMember2ConnectionRulesRdp", "GatewayIdentityProxyEndpointApplicationPolicyUnionMember2MfaConfig", "BookmarkApplication", "BookmarkApplicationPolicy", "BookmarkApplicationPolicyAccessAppPolicyLink", "BookmarkApplicationPolicyUnionMember2", + "BookmarkApplicationPolicyUnionMember2ConnectionRules", + "BookmarkApplicationPolicyUnionMember2ConnectionRulesRdp", "BookmarkApplicationPolicyUnionMember2MfaConfig", "InfrastructureApplication", "InfrastructureApplicationTargetCriterion", @@ -132,6 +150,8 @@ "BrowserRdpApplicationPolicy", "BrowserRdpApplicationPolicyAccessAppPolicyLink", "BrowserRdpApplicationPolicyUnionMember2", + "BrowserRdpApplicationPolicyUnionMember2ConnectionRules", + "BrowserRdpApplicationPolicyUnionMember2ConnectionRulesRdp", "BrowserRdpApplicationPolicyUnionMember2MfaConfig", "BrowserRdpApplicationSCIMConfig", "BrowserRdpApplicationSCIMConfigAuthentication", @@ -149,6 +169,8 @@ "McpServerApplicationPolicy", "McpServerApplicationPolicyAccessAppPolicyLink", "McpServerApplicationPolicyUnionMember2", + "McpServerApplicationPolicyUnionMember2ConnectionRules", + "McpServerApplicationPolicyUnionMember2ConnectionRulesRdp", "McpServerApplicationPolicyUnionMember2MfaConfig", "McpServerApplicationSCIMConfig", "McpServerApplicationSCIMConfigAuthentication", @@ -166,6 +188,8 @@ "McpServerPortalApplicationPolicy", "McpServerPortalApplicationPolicyAccessAppPolicyLink", "McpServerPortalApplicationPolicyUnionMember2", + "McpServerPortalApplicationPolicyUnionMember2ConnectionRules", + "McpServerPortalApplicationPolicyUnionMember2ConnectionRulesRdp", "McpServerPortalApplicationPolicyUnionMember2MfaConfig", "McpServerPortalApplicationSCIMConfig", "McpServerPortalApplicationSCIMConfigAuthentication", @@ -507,6 +531,29 @@ class SelfHostedApplicationPolicyAccessAppPolicyLink(TypedDict, total=False): """ +class SelfHostedApplicationPolicyUnionMember2ConnectionRulesRdp(TypedDict, total=False): + """The RDP-specific rules that define clipboard behavior for RDP connections.""" + + allowed_clipboard_local_to_remote_formats: List[Literal["text"]] + """ + Clipboard formats allowed when copying from local machine to remote RDP session. + """ + + allowed_clipboard_remote_to_local_formats: List[Literal["text"]] + """ + Clipboard formats allowed when copying from remote RDP session to local machine. + """ + + +class SelfHostedApplicationPolicyUnionMember2ConnectionRules(TypedDict, total=False): + """ + The rules that define how users may connect to targets secured by your application. + """ + + rdp: SelfHostedApplicationPolicyUnionMember2ConnectionRulesRdp + """The RDP-specific rules that define clipboard behavior for RDP connections.""" + + class SelfHostedApplicationPolicyUnionMember2MfaConfig(TypedDict, total=False): """Configures multi-factor authentication (MFA) settings.""" @@ -540,6 +587,12 @@ class SelfHostedApplicationPolicyUnionMember2(TypedDict, total=False): session. """ + connection_rules: SelfHostedApplicationPolicyUnionMember2ConnectionRules + """ + The rules that define how users may connect to targets secured by your + application. + """ + isolation_required: bool """ Require this application to be served in an isolated browser for users matching @@ -746,6 +799,29 @@ class SaaSApplicationPolicyAccessAppPolicyLink(TypedDict, total=False): """ +class SaaSApplicationPolicyUnionMember2ConnectionRulesRdp(TypedDict, total=False): + """The RDP-specific rules that define clipboard behavior for RDP connections.""" + + allowed_clipboard_local_to_remote_formats: List[Literal["text"]] + """ + Clipboard formats allowed when copying from local machine to remote RDP session. + """ + + allowed_clipboard_remote_to_local_formats: List[Literal["text"]] + """ + Clipboard formats allowed when copying from remote RDP session to local machine. + """ + + +class SaaSApplicationPolicyUnionMember2ConnectionRules(TypedDict, total=False): + """ + The rules that define how users may connect to targets secured by your application. + """ + + rdp: SaaSApplicationPolicyUnionMember2ConnectionRulesRdp + """The RDP-specific rules that define clipboard behavior for RDP connections.""" + + class SaaSApplicationPolicyUnionMember2MfaConfig(TypedDict, total=False): """Configures multi-factor authentication (MFA) settings.""" @@ -779,6 +855,12 @@ class SaaSApplicationPolicyUnionMember2(TypedDict, total=False): session. """ + connection_rules: SaaSApplicationPolicyUnionMember2ConnectionRules + """ + The rules that define how users may connect to targets secured by your + application. + """ + isolation_required: bool """ Require this application to be served in an isolated browser for users matching @@ -1263,6 +1345,29 @@ class BrowserSSHApplicationPolicyAccessAppPolicyLink(TypedDict, total=False): """ +class BrowserSSHApplicationPolicyUnionMember2ConnectionRulesRdp(TypedDict, total=False): + """The RDP-specific rules that define clipboard behavior for RDP connections.""" + + allowed_clipboard_local_to_remote_formats: List[Literal["text"]] + """ + Clipboard formats allowed when copying from local machine to remote RDP session. + """ + + allowed_clipboard_remote_to_local_formats: List[Literal["text"]] + """ + Clipboard formats allowed when copying from remote RDP session to local machine. + """ + + +class BrowserSSHApplicationPolicyUnionMember2ConnectionRules(TypedDict, total=False): + """ + The rules that define how users may connect to targets secured by your application. + """ + + rdp: BrowserSSHApplicationPolicyUnionMember2ConnectionRulesRdp + """The RDP-specific rules that define clipboard behavior for RDP connections.""" + + class BrowserSSHApplicationPolicyUnionMember2MfaConfig(TypedDict, total=False): """Configures multi-factor authentication (MFA) settings.""" @@ -1296,6 +1401,12 @@ class BrowserSSHApplicationPolicyUnionMember2(TypedDict, total=False): session. """ + connection_rules: BrowserSSHApplicationPolicyUnionMember2ConnectionRules + """ + The rules that define how users may connect to targets secured by your + application. + """ + isolation_required: bool """ Require this application to be served in an isolated browser for users matching @@ -1780,6 +1891,29 @@ class BrowserVNCApplicationPolicyAccessAppPolicyLink(TypedDict, total=False): """ +class BrowserVNCApplicationPolicyUnionMember2ConnectionRulesRdp(TypedDict, total=False): + """The RDP-specific rules that define clipboard behavior for RDP connections.""" + + allowed_clipboard_local_to_remote_formats: List[Literal["text"]] + """ + Clipboard formats allowed when copying from local machine to remote RDP session. + """ + + allowed_clipboard_remote_to_local_formats: List[Literal["text"]] + """ + Clipboard formats allowed when copying from remote RDP session to local machine. + """ + + +class BrowserVNCApplicationPolicyUnionMember2ConnectionRules(TypedDict, total=False): + """ + The rules that define how users may connect to targets secured by your application. + """ + + rdp: BrowserVNCApplicationPolicyUnionMember2ConnectionRulesRdp + """The RDP-specific rules that define clipboard behavior for RDP connections.""" + + class BrowserVNCApplicationPolicyUnionMember2MfaConfig(TypedDict, total=False): """Configures multi-factor authentication (MFA) settings.""" @@ -1813,6 +1947,12 @@ class BrowserVNCApplicationPolicyUnionMember2(TypedDict, total=False): session. """ + connection_rules: BrowserVNCApplicationPolicyUnionMember2ConnectionRules + """ + The rules that define how users may connect to targets secured by your + application. + """ + isolation_required: bool """ Require this application to be served in an isolated browser for users matching @@ -2077,6 +2217,29 @@ class AppLauncherApplicationPolicyAccessAppPolicyLink(TypedDict, total=False): """ +class AppLauncherApplicationPolicyUnionMember2ConnectionRulesRdp(TypedDict, total=False): + """The RDP-specific rules that define clipboard behavior for RDP connections.""" + + allowed_clipboard_local_to_remote_formats: List[Literal["text"]] + """ + Clipboard formats allowed when copying from local machine to remote RDP session. + """ + + allowed_clipboard_remote_to_local_formats: List[Literal["text"]] + """ + Clipboard formats allowed when copying from remote RDP session to local machine. + """ + + +class AppLauncherApplicationPolicyUnionMember2ConnectionRules(TypedDict, total=False): + """ + The rules that define how users may connect to targets secured by your application. + """ + + rdp: AppLauncherApplicationPolicyUnionMember2ConnectionRulesRdp + """The RDP-specific rules that define clipboard behavior for RDP connections.""" + + class AppLauncherApplicationPolicyUnionMember2MfaConfig(TypedDict, total=False): """Configures multi-factor authentication (MFA) settings.""" @@ -2110,6 +2273,12 @@ class AppLauncherApplicationPolicyUnionMember2(TypedDict, total=False): session. """ + connection_rules: AppLauncherApplicationPolicyUnionMember2ConnectionRules + """ + The rules that define how users may connect to targets secured by your + application. + """ + isolation_required: bool """ Require this application to be served in an isolated browser for users matching @@ -2212,6 +2381,29 @@ class DeviceEnrollmentPermissionsApplicationPolicyAccessAppPolicyLink(TypedDict, """ +class DeviceEnrollmentPermissionsApplicationPolicyUnionMember2ConnectionRulesRdp(TypedDict, total=False): + """The RDP-specific rules that define clipboard behavior for RDP connections.""" + + allowed_clipboard_local_to_remote_formats: List[Literal["text"]] + """ + Clipboard formats allowed when copying from local machine to remote RDP session. + """ + + allowed_clipboard_remote_to_local_formats: List[Literal["text"]] + """ + Clipboard formats allowed when copying from remote RDP session to local machine. + """ + + +class DeviceEnrollmentPermissionsApplicationPolicyUnionMember2ConnectionRules(TypedDict, total=False): + """ + The rules that define how users may connect to targets secured by your application. + """ + + rdp: DeviceEnrollmentPermissionsApplicationPolicyUnionMember2ConnectionRulesRdp + """The RDP-specific rules that define clipboard behavior for RDP connections.""" + + class DeviceEnrollmentPermissionsApplicationPolicyUnionMember2MfaConfig(TypedDict, total=False): """Configures multi-factor authentication (MFA) settings.""" @@ -2245,6 +2437,12 @@ class DeviceEnrollmentPermissionsApplicationPolicyUnionMember2(TypedDict, total= session. """ + connection_rules: DeviceEnrollmentPermissionsApplicationPolicyUnionMember2ConnectionRules + """ + The rules that define how users may connect to targets secured by your + application. + """ + isolation_required: bool """ Require this application to be served in an isolated browser for users matching @@ -2349,6 +2547,29 @@ class BrowserIsolationPermissionsApplicationPolicyAccessAppPolicyLink(TypedDict, """ +class BrowserIsolationPermissionsApplicationPolicyUnionMember2ConnectionRulesRdp(TypedDict, total=False): + """The RDP-specific rules that define clipboard behavior for RDP connections.""" + + allowed_clipboard_local_to_remote_formats: List[Literal["text"]] + """ + Clipboard formats allowed when copying from local machine to remote RDP session. + """ + + allowed_clipboard_remote_to_local_formats: List[Literal["text"]] + """ + Clipboard formats allowed when copying from remote RDP session to local machine. + """ + + +class BrowserIsolationPermissionsApplicationPolicyUnionMember2ConnectionRules(TypedDict, total=False): + """ + The rules that define how users may connect to targets secured by your application. + """ + + rdp: BrowserIsolationPermissionsApplicationPolicyUnionMember2ConnectionRulesRdp + """The RDP-specific rules that define clipboard behavior for RDP connections.""" + + class BrowserIsolationPermissionsApplicationPolicyUnionMember2MfaConfig(TypedDict, total=False): """Configures multi-factor authentication (MFA) settings.""" @@ -2382,6 +2603,12 @@ class BrowserIsolationPermissionsApplicationPolicyUnionMember2(TypedDict, total= session. """ + connection_rules: BrowserIsolationPermissionsApplicationPolicyUnionMember2ConnectionRules + """ + The rules that define how users may connect to targets secured by your + application. + """ + isolation_required: bool """ Require this application to be served in an isolated browser for users matching @@ -2495,6 +2722,29 @@ class GatewayIdentityProxyEndpointApplicationPolicyAccessAppPolicyLink(TypedDict """ +class GatewayIdentityProxyEndpointApplicationPolicyUnionMember2ConnectionRulesRdp(TypedDict, total=False): + """The RDP-specific rules that define clipboard behavior for RDP connections.""" + + allowed_clipboard_local_to_remote_formats: List[Literal["text"]] + """ + Clipboard formats allowed when copying from local machine to remote RDP session. + """ + + allowed_clipboard_remote_to_local_formats: List[Literal["text"]] + """ + Clipboard formats allowed when copying from remote RDP session to local machine. + """ + + +class GatewayIdentityProxyEndpointApplicationPolicyUnionMember2ConnectionRules(TypedDict, total=False): + """ + The rules that define how users may connect to targets secured by your application. + """ + + rdp: GatewayIdentityProxyEndpointApplicationPolicyUnionMember2ConnectionRulesRdp + """The RDP-specific rules that define clipboard behavior for RDP connections.""" + + class GatewayIdentityProxyEndpointApplicationPolicyUnionMember2MfaConfig(TypedDict, total=False): """Configures multi-factor authentication (MFA) settings.""" @@ -2528,6 +2778,12 @@ class GatewayIdentityProxyEndpointApplicationPolicyUnionMember2(TypedDict, total session. """ + connection_rules: GatewayIdentityProxyEndpointApplicationPolicyUnionMember2ConnectionRules + """ + The rules that define how users may connect to targets secured by your + application. + """ + isolation_required: bool """ Require this application to be served in an isolated browser for users matching @@ -2614,6 +2870,29 @@ class BookmarkApplicationPolicyAccessAppPolicyLink(TypedDict, total=False): """ +class BookmarkApplicationPolicyUnionMember2ConnectionRulesRdp(TypedDict, total=False): + """The RDP-specific rules that define clipboard behavior for RDP connections.""" + + allowed_clipboard_local_to_remote_formats: List[Literal["text"]] + """ + Clipboard formats allowed when copying from local machine to remote RDP session. + """ + + allowed_clipboard_remote_to_local_formats: List[Literal["text"]] + """ + Clipboard formats allowed when copying from remote RDP session to local machine. + """ + + +class BookmarkApplicationPolicyUnionMember2ConnectionRules(TypedDict, total=False): + """ + The rules that define how users may connect to targets secured by your application. + """ + + rdp: BookmarkApplicationPolicyUnionMember2ConnectionRulesRdp + """The RDP-specific rules that define clipboard behavior for RDP connections.""" + + class BookmarkApplicationPolicyUnionMember2MfaConfig(TypedDict, total=False): """Configures multi-factor authentication (MFA) settings.""" @@ -2647,6 +2926,12 @@ class BookmarkApplicationPolicyUnionMember2(TypedDict, total=False): session. """ + connection_rules: BookmarkApplicationPolicyUnionMember2ConnectionRules + """ + The rules that define how users may connect to targets secured by your + application. + """ + isolation_required: bool """ Require this application to be served in an isolated browser for users matching @@ -3122,6 +3407,29 @@ class BrowserRdpApplicationPolicyAccessAppPolicyLink(TypedDict, total=False): """ +class BrowserRdpApplicationPolicyUnionMember2ConnectionRulesRdp(TypedDict, total=False): + """The RDP-specific rules that define clipboard behavior for RDP connections.""" + + allowed_clipboard_local_to_remote_formats: List[Literal["text"]] + """ + Clipboard formats allowed when copying from local machine to remote RDP session. + """ + + allowed_clipboard_remote_to_local_formats: List[Literal["text"]] + """ + Clipboard formats allowed when copying from remote RDP session to local machine. + """ + + +class BrowserRdpApplicationPolicyUnionMember2ConnectionRules(TypedDict, total=False): + """ + The rules that define how users may connect to targets secured by your application. + """ + + rdp: BrowserRdpApplicationPolicyUnionMember2ConnectionRulesRdp + """The RDP-specific rules that define clipboard behavior for RDP connections.""" + + class BrowserRdpApplicationPolicyUnionMember2MfaConfig(TypedDict, total=False): """Configures multi-factor authentication (MFA) settings.""" @@ -3155,6 +3463,12 @@ class BrowserRdpApplicationPolicyUnionMember2(TypedDict, total=False): session. """ + connection_rules: BrowserRdpApplicationPolicyUnionMember2ConnectionRules + """ + The rules that define how users may connect to targets secured by your + application. + """ + isolation_required: bool """ Require this application to be served in an isolated browser for users matching @@ -3540,6 +3854,29 @@ class McpServerApplicationPolicyAccessAppPolicyLink(TypedDict, total=False): """ +class McpServerApplicationPolicyUnionMember2ConnectionRulesRdp(TypedDict, total=False): + """The RDP-specific rules that define clipboard behavior for RDP connections.""" + + allowed_clipboard_local_to_remote_formats: List[Literal["text"]] + """ + Clipboard formats allowed when copying from local machine to remote RDP session. + """ + + allowed_clipboard_remote_to_local_formats: List[Literal["text"]] + """ + Clipboard formats allowed when copying from remote RDP session to local machine. + """ + + +class McpServerApplicationPolicyUnionMember2ConnectionRules(TypedDict, total=False): + """ + The rules that define how users may connect to targets secured by your application. + """ + + rdp: McpServerApplicationPolicyUnionMember2ConnectionRulesRdp + """The RDP-specific rules that define clipboard behavior for RDP connections.""" + + class McpServerApplicationPolicyUnionMember2MfaConfig(TypedDict, total=False): """Configures multi-factor authentication (MFA) settings.""" @@ -3573,6 +3910,12 @@ class McpServerApplicationPolicyUnionMember2(TypedDict, total=False): session. """ + connection_rules: McpServerApplicationPolicyUnionMember2ConnectionRules + """ + The rules that define how users may connect to targets secured by your + application. + """ + isolation_required: bool """ Require this application to be served in an isolated browser for users matching @@ -3964,6 +4307,29 @@ class McpServerPortalApplicationPolicyAccessAppPolicyLink(TypedDict, total=False """ +class McpServerPortalApplicationPolicyUnionMember2ConnectionRulesRdp(TypedDict, total=False): + """The RDP-specific rules that define clipboard behavior for RDP connections.""" + + allowed_clipboard_local_to_remote_formats: List[Literal["text"]] + """ + Clipboard formats allowed when copying from local machine to remote RDP session. + """ + + allowed_clipboard_remote_to_local_formats: List[Literal["text"]] + """ + Clipboard formats allowed when copying from remote RDP session to local machine. + """ + + +class McpServerPortalApplicationPolicyUnionMember2ConnectionRules(TypedDict, total=False): + """ + The rules that define how users may connect to targets secured by your application. + """ + + rdp: McpServerPortalApplicationPolicyUnionMember2ConnectionRulesRdp + """The RDP-specific rules that define clipboard behavior for RDP connections.""" + + class McpServerPortalApplicationPolicyUnionMember2MfaConfig(TypedDict, total=False): """Configures multi-factor authentication (MFA) settings.""" @@ -3997,6 +4363,12 @@ class McpServerPortalApplicationPolicyUnionMember2(TypedDict, total=False): session. """ + connection_rules: McpServerPortalApplicationPolicyUnionMember2ConnectionRules + """ + The rules that define how users may connect to targets secured by your + application. + """ + isolation_required: bool """ Require this application to be served in an isolated browser for users matching diff --git a/src/cloudflare/types/zero_trust/access/application_update_response.py b/src/cloudflare/types/zero_trust/access/application_update_response.py index 8c71fca2752..4c98dbc4372 100644 --- a/src/cloudflare/types/zero_trust/access/application_update_response.py +++ b/src/cloudflare/types/zero_trust/access/application_update_response.py @@ -31,6 +31,8 @@ "SelfHostedApplicationOAuthConfigurationDynamicClientRegistration", "SelfHostedApplicationOAuthConfigurationGrant", "SelfHostedApplicationPolicy", + "SelfHostedApplicationPolicyConnectionRules", + "SelfHostedApplicationPolicyConnectionRulesRdp", "SelfHostedApplicationPolicyMfaConfig", "SelfHostedApplicationSCIMConfig", "SelfHostedApplicationSCIMConfigAuthentication", @@ -39,6 +41,8 @@ "SelfHostedApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken", "SaaSApplication", "SaaSApplicationPolicy", + "SaaSApplicationPolicyConnectionRules", + "SaaSApplicationPolicyConnectionRulesRdp", "SaaSApplicationPolicyMfaConfig", "SaaSApplicationSaaSApp", "SaaSApplicationSCIMConfig", @@ -56,6 +60,8 @@ "BrowserSSHApplicationOAuthConfigurationDynamicClientRegistration", "BrowserSSHApplicationOAuthConfigurationGrant", "BrowserSSHApplicationPolicy", + "BrowserSSHApplicationPolicyConnectionRules", + "BrowserSSHApplicationPolicyConnectionRulesRdp", "BrowserSSHApplicationPolicyMfaConfig", "BrowserSSHApplicationSCIMConfig", "BrowserSSHApplicationSCIMConfigAuthentication", @@ -72,6 +78,8 @@ "BrowserVNCApplicationOAuthConfigurationDynamicClientRegistration", "BrowserVNCApplicationOAuthConfigurationGrant", "BrowserVNCApplicationPolicy", + "BrowserVNCApplicationPolicyConnectionRules", + "BrowserVNCApplicationPolicyConnectionRulesRdp", "BrowserVNCApplicationPolicyMfaConfig", "BrowserVNCApplicationSCIMConfig", "BrowserVNCApplicationSCIMConfigAuthentication", @@ -82,18 +90,28 @@ "AppLauncherApplicationFooterLink", "AppLauncherApplicationLandingPageDesign", "AppLauncherApplicationPolicy", + "AppLauncherApplicationPolicyConnectionRules", + "AppLauncherApplicationPolicyConnectionRulesRdp", "AppLauncherApplicationPolicyMfaConfig", "DeviceEnrollmentPermissionsApplication", "DeviceEnrollmentPermissionsApplicationPolicy", + "DeviceEnrollmentPermissionsApplicationPolicyConnectionRules", + "DeviceEnrollmentPermissionsApplicationPolicyConnectionRulesRdp", "DeviceEnrollmentPermissionsApplicationPolicyMfaConfig", "BrowserIsolationPermissionsApplication", "BrowserIsolationPermissionsApplicationPolicy", + "BrowserIsolationPermissionsApplicationPolicyConnectionRules", + "BrowserIsolationPermissionsApplicationPolicyConnectionRulesRdp", "BrowserIsolationPermissionsApplicationPolicyMfaConfig", "GatewayIdentityProxyEndpointApplication", "GatewayIdentityProxyEndpointApplicationPolicy", + "GatewayIdentityProxyEndpointApplicationPolicyConnectionRules", + "GatewayIdentityProxyEndpointApplicationPolicyConnectionRulesRdp", "GatewayIdentityProxyEndpointApplicationPolicyMfaConfig", "BookmarkApplication", "BookmarkApplicationPolicy", + "BookmarkApplicationPolicyConnectionRules", + "BookmarkApplicationPolicyConnectionRulesRdp", "BookmarkApplicationPolicyMfaConfig", "InfrastructureApplication", "InfrastructureApplicationTargetCriterion", @@ -111,6 +129,8 @@ "BrowserRdpApplicationOAuthConfigurationDynamicClientRegistration", "BrowserRdpApplicationOAuthConfigurationGrant", "BrowserRdpApplicationPolicy", + "BrowserRdpApplicationPolicyConnectionRules", + "BrowserRdpApplicationPolicyConnectionRulesRdp", "BrowserRdpApplicationPolicyMfaConfig", "BrowserRdpApplicationSCIMConfig", "BrowserRdpApplicationSCIMConfigAuthentication", @@ -126,6 +146,8 @@ "McpServerApplicationOAuthConfigurationDynamicClientRegistration", "McpServerApplicationOAuthConfigurationGrant", "McpServerApplicationPolicy", + "McpServerApplicationPolicyConnectionRules", + "McpServerApplicationPolicyConnectionRulesRdp", "McpServerApplicationPolicyMfaConfig", "McpServerApplicationSCIMConfig", "McpServerApplicationSCIMConfigAuthentication", @@ -141,6 +163,8 @@ "McpServerPortalApplicationOAuthConfigurationDynamicClientRegistration", "McpServerPortalApplicationOAuthConfigurationGrant", "McpServerPortalApplicationPolicy", + "McpServerPortalApplicationPolicyConnectionRules", + "McpServerPortalApplicationPolicyConnectionRulesRdp", "McpServerPortalApplicationPolicyMfaConfig", "McpServerPortalApplicationSCIMConfig", "McpServerPortalApplicationSCIMConfigAuthentication", @@ -286,6 +310,29 @@ class SelfHostedApplicationOAuthConfiguration(BaseModel): """Settings for OAuth grant behavior.""" +class SelfHostedApplicationPolicyConnectionRulesRdp(BaseModel): + """The RDP-specific rules that define clipboard behavior for RDP connections.""" + + allowed_clipboard_local_to_remote_formats: Optional[List[Literal["text"]]] = None + """ + Clipboard formats allowed when copying from local machine to remote RDP session. + """ + + allowed_clipboard_remote_to_local_formats: Optional[List[Literal["text"]]] = None + """ + Clipboard formats allowed when copying from remote RDP session to local machine. + """ + + +class SelfHostedApplicationPolicyConnectionRules(BaseModel): + """ + The rules that define how users may connect to targets secured by your application. + """ + + rdp: Optional[SelfHostedApplicationPolicyConnectionRulesRdp] = None + """The RDP-specific rules that define clipboard behavior for RDP connections.""" + + class SelfHostedApplicationPolicyMfaConfig(BaseModel): """Configures multi-factor authentication (MFA) settings.""" @@ -319,6 +366,12 @@ class SelfHostedApplicationPolicy(BaseModel): session. """ + connection_rules: Optional[SelfHostedApplicationPolicyConnectionRules] = None + """ + The rules that define how users may connect to targets secured by your + application. + """ + created_at: Optional[datetime] = None decision: Optional[Decision] = None @@ -656,6 +709,29 @@ class SelfHostedApplication(BaseModel): """ +class SaaSApplicationPolicyConnectionRulesRdp(BaseModel): + """The RDP-specific rules that define clipboard behavior for RDP connections.""" + + allowed_clipboard_local_to_remote_formats: Optional[List[Literal["text"]]] = None + """ + Clipboard formats allowed when copying from local machine to remote RDP session. + """ + + allowed_clipboard_remote_to_local_formats: Optional[List[Literal["text"]]] = None + """ + Clipboard formats allowed when copying from remote RDP session to local machine. + """ + + +class SaaSApplicationPolicyConnectionRules(BaseModel): + """ + The rules that define how users may connect to targets secured by your application. + """ + + rdp: Optional[SaaSApplicationPolicyConnectionRulesRdp] = None + """The RDP-specific rules that define clipboard behavior for RDP connections.""" + + class SaaSApplicationPolicyMfaConfig(BaseModel): """Configures multi-factor authentication (MFA) settings.""" @@ -689,6 +765,12 @@ class SaaSApplicationPolicy(BaseModel): session. """ + connection_rules: Optional[SaaSApplicationPolicyConnectionRules] = None + """ + The rules that define how users may connect to targets secured by your + application. + """ + created_at: Optional[datetime] = None decision: Optional[Decision] = None @@ -1040,6 +1122,29 @@ class BrowserSSHApplicationOAuthConfiguration(BaseModel): """Settings for OAuth grant behavior.""" +class BrowserSSHApplicationPolicyConnectionRulesRdp(BaseModel): + """The RDP-specific rules that define clipboard behavior for RDP connections.""" + + allowed_clipboard_local_to_remote_formats: Optional[List[Literal["text"]]] = None + """ + Clipboard formats allowed when copying from local machine to remote RDP session. + """ + + allowed_clipboard_remote_to_local_formats: Optional[List[Literal["text"]]] = None + """ + Clipboard formats allowed when copying from remote RDP session to local machine. + """ + + +class BrowserSSHApplicationPolicyConnectionRules(BaseModel): + """ + The rules that define how users may connect to targets secured by your application. + """ + + rdp: Optional[BrowserSSHApplicationPolicyConnectionRulesRdp] = None + """The RDP-specific rules that define clipboard behavior for RDP connections.""" + + class BrowserSSHApplicationPolicyMfaConfig(BaseModel): """Configures multi-factor authentication (MFA) settings.""" @@ -1073,6 +1178,12 @@ class BrowserSSHApplicationPolicy(BaseModel): session. """ + connection_rules: Optional[BrowserSSHApplicationPolicyConnectionRules] = None + """ + The rules that define how users may connect to targets secured by your + application. + """ + created_at: Optional[datetime] = None decision: Optional[Decision] = None @@ -1561,6 +1672,29 @@ class BrowserVNCApplicationOAuthConfiguration(BaseModel): """Settings for OAuth grant behavior.""" +class BrowserVNCApplicationPolicyConnectionRulesRdp(BaseModel): + """The RDP-specific rules that define clipboard behavior for RDP connections.""" + + allowed_clipboard_local_to_remote_formats: Optional[List[Literal["text"]]] = None + """ + Clipboard formats allowed when copying from local machine to remote RDP session. + """ + + allowed_clipboard_remote_to_local_formats: Optional[List[Literal["text"]]] = None + """ + Clipboard formats allowed when copying from remote RDP session to local machine. + """ + + +class BrowserVNCApplicationPolicyConnectionRules(BaseModel): + """ + The rules that define how users may connect to targets secured by your application. + """ + + rdp: Optional[BrowserVNCApplicationPolicyConnectionRulesRdp] = None + """The RDP-specific rules that define clipboard behavior for RDP connections.""" + + class BrowserVNCApplicationPolicyMfaConfig(BaseModel): """Configures multi-factor authentication (MFA) settings.""" @@ -1594,6 +1728,12 @@ class BrowserVNCApplicationPolicy(BaseModel): session. """ + connection_rules: Optional[BrowserVNCApplicationPolicyConnectionRules] = None + """ + The rules that define how users may connect to targets secured by your + application. + """ + created_at: Optional[datetime] = None decision: Optional[Decision] = None @@ -1973,6 +2113,29 @@ class AppLauncherApplicationLandingPageDesign(BaseModel): """The title shown on the landing page.""" +class AppLauncherApplicationPolicyConnectionRulesRdp(BaseModel): + """The RDP-specific rules that define clipboard behavior for RDP connections.""" + + allowed_clipboard_local_to_remote_formats: Optional[List[Literal["text"]]] = None + """ + Clipboard formats allowed when copying from local machine to remote RDP session. + """ + + allowed_clipboard_remote_to_local_formats: Optional[List[Literal["text"]]] = None + """ + Clipboard formats allowed when copying from remote RDP session to local machine. + """ + + +class AppLauncherApplicationPolicyConnectionRules(BaseModel): + """ + The rules that define how users may connect to targets secured by your application. + """ + + rdp: Optional[AppLauncherApplicationPolicyConnectionRulesRdp] = None + """The RDP-specific rules that define clipboard behavior for RDP connections.""" + + class AppLauncherApplicationPolicyMfaConfig(BaseModel): """Configures multi-factor authentication (MFA) settings.""" @@ -2006,6 +2169,12 @@ class AppLauncherApplicationPolicy(BaseModel): session. """ + connection_rules: Optional[AppLauncherApplicationPolicyConnectionRules] = None + """ + The rules that define how users may connect to targets secured by your + application. + """ + created_at: Optional[datetime] = None decision: Optional[Decision] = None @@ -2158,6 +2327,29 @@ class AppLauncherApplication(BaseModel): """Determines when to skip the App Launcher landing page.""" +class DeviceEnrollmentPermissionsApplicationPolicyConnectionRulesRdp(BaseModel): + """The RDP-specific rules that define clipboard behavior for RDP connections.""" + + allowed_clipboard_local_to_remote_formats: Optional[List[Literal["text"]]] = None + """ + Clipboard formats allowed when copying from local machine to remote RDP session. + """ + + allowed_clipboard_remote_to_local_formats: Optional[List[Literal["text"]]] = None + """ + Clipboard formats allowed when copying from remote RDP session to local machine. + """ + + +class DeviceEnrollmentPermissionsApplicationPolicyConnectionRules(BaseModel): + """ + The rules that define how users may connect to targets secured by your application. + """ + + rdp: Optional[DeviceEnrollmentPermissionsApplicationPolicyConnectionRulesRdp] = None + """The RDP-specific rules that define clipboard behavior for RDP connections.""" + + class DeviceEnrollmentPermissionsApplicationPolicyMfaConfig(BaseModel): """Configures multi-factor authentication (MFA) settings.""" @@ -2191,6 +2383,12 @@ class DeviceEnrollmentPermissionsApplicationPolicy(BaseModel): session. """ + connection_rules: Optional[DeviceEnrollmentPermissionsApplicationPolicyConnectionRules] = None + """ + The rules that define how users may connect to targets secured by your + application. + """ + created_at: Optional[datetime] = None decision: Optional[Decision] = None @@ -2310,6 +2508,29 @@ class DeviceEnrollmentPermissionsApplication(BaseModel): """ +class BrowserIsolationPermissionsApplicationPolicyConnectionRulesRdp(BaseModel): + """The RDP-specific rules that define clipboard behavior for RDP connections.""" + + allowed_clipboard_local_to_remote_formats: Optional[List[Literal["text"]]] = None + """ + Clipboard formats allowed when copying from local machine to remote RDP session. + """ + + allowed_clipboard_remote_to_local_formats: Optional[List[Literal["text"]]] = None + """ + Clipboard formats allowed when copying from remote RDP session to local machine. + """ + + +class BrowserIsolationPermissionsApplicationPolicyConnectionRules(BaseModel): + """ + The rules that define how users may connect to targets secured by your application. + """ + + rdp: Optional[BrowserIsolationPermissionsApplicationPolicyConnectionRulesRdp] = None + """The RDP-specific rules that define clipboard behavior for RDP connections.""" + + class BrowserIsolationPermissionsApplicationPolicyMfaConfig(BaseModel): """Configures multi-factor authentication (MFA) settings.""" @@ -2343,6 +2564,12 @@ class BrowserIsolationPermissionsApplicationPolicy(BaseModel): session. """ + connection_rules: Optional[BrowserIsolationPermissionsApplicationPolicyConnectionRules] = None + """ + The rules that define how users may connect to targets secured by your + application. + """ + created_at: Optional[datetime] = None decision: Optional[Decision] = None @@ -2462,6 +2689,29 @@ class BrowserIsolationPermissionsApplication(BaseModel): """ +class GatewayIdentityProxyEndpointApplicationPolicyConnectionRulesRdp(BaseModel): + """The RDP-specific rules that define clipboard behavior for RDP connections.""" + + allowed_clipboard_local_to_remote_formats: Optional[List[Literal["text"]]] = None + """ + Clipboard formats allowed when copying from local machine to remote RDP session. + """ + + allowed_clipboard_remote_to_local_formats: Optional[List[Literal["text"]]] = None + """ + Clipboard formats allowed when copying from remote RDP session to local machine. + """ + + +class GatewayIdentityProxyEndpointApplicationPolicyConnectionRules(BaseModel): + """ + The rules that define how users may connect to targets secured by your application. + """ + + rdp: Optional[GatewayIdentityProxyEndpointApplicationPolicyConnectionRulesRdp] = None + """The RDP-specific rules that define clipboard behavior for RDP connections.""" + + class GatewayIdentityProxyEndpointApplicationPolicyMfaConfig(BaseModel): """Configures multi-factor authentication (MFA) settings.""" @@ -2495,6 +2745,12 @@ class GatewayIdentityProxyEndpointApplicationPolicy(BaseModel): session. """ + connection_rules: Optional[GatewayIdentityProxyEndpointApplicationPolicyConnectionRules] = None + """ + The rules that define how users may connect to targets secured by your + application. + """ + created_at: Optional[datetime] = None decision: Optional[Decision] = None @@ -2614,6 +2870,29 @@ class GatewayIdentityProxyEndpointApplication(BaseModel): """ +class BookmarkApplicationPolicyConnectionRulesRdp(BaseModel): + """The RDP-specific rules that define clipboard behavior for RDP connections.""" + + allowed_clipboard_local_to_remote_formats: Optional[List[Literal["text"]]] = None + """ + Clipboard formats allowed when copying from local machine to remote RDP session. + """ + + allowed_clipboard_remote_to_local_formats: Optional[List[Literal["text"]]] = None + """ + Clipboard formats allowed when copying from remote RDP session to local machine. + """ + + +class BookmarkApplicationPolicyConnectionRules(BaseModel): + """ + The rules that define how users may connect to targets secured by your application. + """ + + rdp: Optional[BookmarkApplicationPolicyConnectionRulesRdp] = None + """The RDP-specific rules that define clipboard behavior for RDP connections.""" + + class BookmarkApplicationPolicyMfaConfig(BaseModel): """Configures multi-factor authentication (MFA) settings.""" @@ -2647,6 +2926,12 @@ class BookmarkApplicationPolicy(BaseModel): session. """ + connection_rules: Optional[BookmarkApplicationPolicyConnectionRules] = None + """ + The rules that define how users may connect to targets secured by your + application. + """ + created_at: Optional[datetime] = None decision: Optional[Decision] = None @@ -2987,6 +3272,29 @@ class BrowserRdpApplicationOAuthConfiguration(BaseModel): """Settings for OAuth grant behavior.""" +class BrowserRdpApplicationPolicyConnectionRulesRdp(BaseModel): + """The RDP-specific rules that define clipboard behavior for RDP connections.""" + + allowed_clipboard_local_to_remote_formats: Optional[List[Literal["text"]]] = None + """ + Clipboard formats allowed when copying from local machine to remote RDP session. + """ + + allowed_clipboard_remote_to_local_formats: Optional[List[Literal["text"]]] = None + """ + Clipboard formats allowed when copying from remote RDP session to local machine. + """ + + +class BrowserRdpApplicationPolicyConnectionRules(BaseModel): + """ + The rules that define how users may connect to targets secured by your application. + """ + + rdp: Optional[BrowserRdpApplicationPolicyConnectionRulesRdp] = None + """The RDP-specific rules that define clipboard behavior for RDP connections.""" + + class BrowserRdpApplicationPolicyMfaConfig(BaseModel): """Configures multi-factor authentication (MFA) settings.""" @@ -3020,6 +3328,12 @@ class BrowserRdpApplicationPolicy(BaseModel): session. """ + connection_rules: Optional[BrowserRdpApplicationPolicyConnectionRules] = None + """ + The rules that define how users may connect to targets secured by your + application. + """ + created_at: Optional[datetime] = None decision: Optional[Decision] = None @@ -3475,6 +3789,29 @@ class McpServerApplicationOAuthConfiguration(BaseModel): """Settings for OAuth grant behavior.""" +class McpServerApplicationPolicyConnectionRulesRdp(BaseModel): + """The RDP-specific rules that define clipboard behavior for RDP connections.""" + + allowed_clipboard_local_to_remote_formats: Optional[List[Literal["text"]]] = None + """ + Clipboard formats allowed when copying from local machine to remote RDP session. + """ + + allowed_clipboard_remote_to_local_formats: Optional[List[Literal["text"]]] = None + """ + Clipboard formats allowed when copying from remote RDP session to local machine. + """ + + +class McpServerApplicationPolicyConnectionRules(BaseModel): + """ + The rules that define how users may connect to targets secured by your application. + """ + + rdp: Optional[McpServerApplicationPolicyConnectionRulesRdp] = None + """The RDP-specific rules that define clipboard behavior for RDP connections.""" + + class McpServerApplicationPolicyMfaConfig(BaseModel): """Configures multi-factor authentication (MFA) settings.""" @@ -3508,6 +3845,12 @@ class McpServerApplicationPolicy(BaseModel): session. """ + connection_rules: Optional[McpServerApplicationPolicyConnectionRules] = None + """ + The rules that define how users may connect to targets secured by your + application. + """ + created_at: Optional[datetime] = None decision: Optional[Decision] = None @@ -3899,6 +4242,29 @@ class McpServerPortalApplicationOAuthConfiguration(BaseModel): """Settings for OAuth grant behavior.""" +class McpServerPortalApplicationPolicyConnectionRulesRdp(BaseModel): + """The RDP-specific rules that define clipboard behavior for RDP connections.""" + + allowed_clipboard_local_to_remote_formats: Optional[List[Literal["text"]]] = None + """ + Clipboard formats allowed when copying from local machine to remote RDP session. + """ + + allowed_clipboard_remote_to_local_formats: Optional[List[Literal["text"]]] = None + """ + Clipboard formats allowed when copying from remote RDP session to local machine. + """ + + +class McpServerPortalApplicationPolicyConnectionRules(BaseModel): + """ + The rules that define how users may connect to targets secured by your application. + """ + + rdp: Optional[McpServerPortalApplicationPolicyConnectionRulesRdp] = None + """The RDP-specific rules that define clipboard behavior for RDP connections.""" + + class McpServerPortalApplicationPolicyMfaConfig(BaseModel): """Configures multi-factor authentication (MFA) settings.""" @@ -3932,6 +4298,12 @@ class McpServerPortalApplicationPolicy(BaseModel): session. """ + connection_rules: Optional[McpServerPortalApplicationPolicyConnectionRules] = None + """ + The rules that define how users may connect to targets secured by your + application. + """ + created_at: Optional[datetime] = None decision: Optional[Decision] = None diff --git a/src/cloudflare/types/zero_trust/access/applications/policy_create_params.py b/src/cloudflare/types/zero_trust/access/applications/policy_create_params.py index d75b1668c7d..7fdbf35a278 100644 --- a/src/cloudflare/types/zero_trust/access/applications/policy_create_params.py +++ b/src/cloudflare/types/zero_trust/access/applications/policy_create_params.py @@ -7,7 +7,7 @@ from ..approval_group_param import ApprovalGroupParam -__all__ = ["PolicyCreateParams", "MfaConfig"] +__all__ = ["PolicyCreateParams", "ConnectionRules", "ConnectionRulesRdp", "MfaConfig"] class PolicyCreateParams(TypedDict, total=False): @@ -26,6 +26,12 @@ class PolicyCreateParams(TypedDict, total=False): session. """ + connection_rules: ConnectionRules + """ + The rules that define how users may connect to targets secured by your + application. + """ + isolation_required: bool """ Require this application to be served in an isolated browser for users matching @@ -56,6 +62,29 @@ class PolicyCreateParams(TypedDict, total=False): """ +class ConnectionRulesRdp(TypedDict, total=False): + """The RDP-specific rules that define clipboard behavior for RDP connections.""" + + allowed_clipboard_local_to_remote_formats: List[Literal["text"]] + """ + Clipboard formats allowed when copying from local machine to remote RDP session. + """ + + allowed_clipboard_remote_to_local_formats: List[Literal["text"]] + """ + Clipboard formats allowed when copying from remote RDP session to local machine. + """ + + +class ConnectionRules(TypedDict, total=False): + """ + The rules that define how users may connect to targets secured by your application. + """ + + rdp: ConnectionRulesRdp + """The RDP-specific rules that define clipboard behavior for RDP connections.""" + + class MfaConfig(TypedDict, total=False): """Configures multi-factor authentication (MFA) settings.""" diff --git a/src/cloudflare/types/zero_trust/access/applications/policy_create_response.py b/src/cloudflare/types/zero_trust/access/applications/policy_create_response.py index dd3818d5412..c5f38f54f39 100644 --- a/src/cloudflare/types/zero_trust/access/applications/policy_create_response.py +++ b/src/cloudflare/types/zero_trust/access/applications/policy_create_response.py @@ -9,7 +9,30 @@ from .access_rule import AccessRule from ..approval_group import ApprovalGroup -__all__ = ["PolicyCreateResponse", "MfaConfig"] +__all__ = ["PolicyCreateResponse", "ConnectionRules", "ConnectionRulesRdp", "MfaConfig"] + + +class ConnectionRulesRdp(BaseModel): + """The RDP-specific rules that define clipboard behavior for RDP connections.""" + + allowed_clipboard_local_to_remote_formats: Optional[List[Literal["text"]]] = None + """ + Clipboard formats allowed when copying from local machine to remote RDP session. + """ + + allowed_clipboard_remote_to_local_formats: Optional[List[Literal["text"]]] = None + """ + Clipboard formats allowed when copying from remote RDP session to local machine. + """ + + +class ConnectionRules(BaseModel): + """ + The rules that define how users may connect to targets secured by your application. + """ + + rdp: Optional[ConnectionRulesRdp] = None + """The RDP-specific rules that define clipboard behavior for RDP connections.""" class MfaConfig(BaseModel): @@ -45,6 +68,12 @@ class PolicyCreateResponse(BaseModel): session. """ + connection_rules: Optional[ConnectionRules] = None + """ + The rules that define how users may connect to targets secured by your + application. + """ + created_at: Optional[datetime] = None decision: Optional[Decision] = None diff --git a/src/cloudflare/types/zero_trust/access/applications/policy_get_response.py b/src/cloudflare/types/zero_trust/access/applications/policy_get_response.py index 79b73f9a288..3e434898e01 100644 --- a/src/cloudflare/types/zero_trust/access/applications/policy_get_response.py +++ b/src/cloudflare/types/zero_trust/access/applications/policy_get_response.py @@ -9,7 +9,30 @@ from .access_rule import AccessRule from ..approval_group import ApprovalGroup -__all__ = ["PolicyGetResponse", "MfaConfig"] +__all__ = ["PolicyGetResponse", "ConnectionRules", "ConnectionRulesRdp", "MfaConfig"] + + +class ConnectionRulesRdp(BaseModel): + """The RDP-specific rules that define clipboard behavior for RDP connections.""" + + allowed_clipboard_local_to_remote_formats: Optional[List[Literal["text"]]] = None + """ + Clipboard formats allowed when copying from local machine to remote RDP session. + """ + + allowed_clipboard_remote_to_local_formats: Optional[List[Literal["text"]]] = None + """ + Clipboard formats allowed when copying from remote RDP session to local machine. + """ + + +class ConnectionRules(BaseModel): + """ + The rules that define how users may connect to targets secured by your application. + """ + + rdp: Optional[ConnectionRulesRdp] = None + """The RDP-specific rules that define clipboard behavior for RDP connections.""" class MfaConfig(BaseModel): @@ -45,6 +68,12 @@ class PolicyGetResponse(BaseModel): session. """ + connection_rules: Optional[ConnectionRules] = None + """ + The rules that define how users may connect to targets secured by your + application. + """ + created_at: Optional[datetime] = None decision: Optional[Decision] = None diff --git a/src/cloudflare/types/zero_trust/access/applications/policy_list_response.py b/src/cloudflare/types/zero_trust/access/applications/policy_list_response.py index 07e57c0935d..a292107a2e6 100644 --- a/src/cloudflare/types/zero_trust/access/applications/policy_list_response.py +++ b/src/cloudflare/types/zero_trust/access/applications/policy_list_response.py @@ -9,7 +9,30 @@ from .access_rule import AccessRule from ..approval_group import ApprovalGroup -__all__ = ["PolicyListResponse", "MfaConfig"] +__all__ = ["PolicyListResponse", "ConnectionRules", "ConnectionRulesRdp", "MfaConfig"] + + +class ConnectionRulesRdp(BaseModel): + """The RDP-specific rules that define clipboard behavior for RDP connections.""" + + allowed_clipboard_local_to_remote_formats: Optional[List[Literal["text"]]] = None + """ + Clipboard formats allowed when copying from local machine to remote RDP session. + """ + + allowed_clipboard_remote_to_local_formats: Optional[List[Literal["text"]]] = None + """ + Clipboard formats allowed when copying from remote RDP session to local machine. + """ + + +class ConnectionRules(BaseModel): + """ + The rules that define how users may connect to targets secured by your application. + """ + + rdp: Optional[ConnectionRulesRdp] = None + """The RDP-specific rules that define clipboard behavior for RDP connections.""" class MfaConfig(BaseModel): @@ -45,6 +68,12 @@ class PolicyListResponse(BaseModel): session. """ + connection_rules: Optional[ConnectionRules] = None + """ + The rules that define how users may connect to targets secured by your + application. + """ + created_at: Optional[datetime] = None decision: Optional[Decision] = None 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 index 724856aaa0a..5582c6c66e2 100755 --- 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 @@ -10,7 +10,14 @@ from .access_rule_param import AccessRuleParam from ..approval_group_param import ApprovalGroupParam -__all__ = ["PolicyTestCreateParams", "Policy", "PolicyUnionMember0", "PolicyUnionMember0MfaConfig"] +__all__ = [ + "PolicyTestCreateParams", + "Policy", + "PolicyUnionMember0", + "PolicyUnionMember0ConnectionRules", + "PolicyUnionMember0ConnectionRulesRdp", + "PolicyUnionMember0MfaConfig", +] class PolicyTestCreateParams(TypedDict, total=False): @@ -20,6 +27,29 @@ class PolicyTestCreateParams(TypedDict, total=False): policies: SequenceNotStr[Policy] +class PolicyUnionMember0ConnectionRulesRdp(TypedDict, total=False): + """The RDP-specific rules that define clipboard behavior for RDP connections.""" + + allowed_clipboard_local_to_remote_formats: List[Literal["text"]] + """ + Clipboard formats allowed when copying from local machine to remote RDP session. + """ + + allowed_clipboard_remote_to_local_formats: List[Literal["text"]] + """ + Clipboard formats allowed when copying from remote RDP session to local machine. + """ + + +class PolicyUnionMember0ConnectionRules(TypedDict, total=False): + """ + The rules that define how users may connect to targets secured by your application. + """ + + rdp: PolicyUnionMember0ConnectionRulesRdp + """The RDP-specific rules that define clipboard behavior for RDP connections.""" + + class PolicyUnionMember0MfaConfig(TypedDict, total=False): """Configures multi-factor authentication (MFA) settings.""" @@ -65,6 +95,12 @@ class PolicyUnionMember0(TypedDict, total=False): session. """ + connection_rules: PolicyUnionMember0ConnectionRules + """ + The rules that define how users may connect to targets secured by your + application. + """ + exclude: Iterable[AccessRuleParam] """Rules evaluated with a NOT logical operator. diff --git a/src/cloudflare/types/zero_trust/access/applications/policy_update_params.py b/src/cloudflare/types/zero_trust/access/applications/policy_update_params.py index ece38efad60..3359f30a1be 100644 --- a/src/cloudflare/types/zero_trust/access/applications/policy_update_params.py +++ b/src/cloudflare/types/zero_trust/access/applications/policy_update_params.py @@ -7,7 +7,7 @@ from ..approval_group_param import ApprovalGroupParam -__all__ = ["PolicyUpdateParams", "MfaConfig"] +__all__ = ["PolicyUpdateParams", "ConnectionRules", "ConnectionRulesRdp", "MfaConfig"] class PolicyUpdateParams(TypedDict, total=False): @@ -29,6 +29,12 @@ class PolicyUpdateParams(TypedDict, total=False): session. """ + connection_rules: ConnectionRules + """ + The rules that define how users may connect to targets secured by your + application. + """ + isolation_required: bool """ Require this application to be served in an isolated browser for users matching @@ -59,6 +65,29 @@ class PolicyUpdateParams(TypedDict, total=False): """ +class ConnectionRulesRdp(TypedDict, total=False): + """The RDP-specific rules that define clipboard behavior for RDP connections.""" + + allowed_clipboard_local_to_remote_formats: List[Literal["text"]] + """ + Clipboard formats allowed when copying from local machine to remote RDP session. + """ + + allowed_clipboard_remote_to_local_formats: List[Literal["text"]] + """ + Clipboard formats allowed when copying from remote RDP session to local machine. + """ + + +class ConnectionRules(TypedDict, total=False): + """ + The rules that define how users may connect to targets secured by your application. + """ + + rdp: ConnectionRulesRdp + """The RDP-specific rules that define clipboard behavior for RDP connections.""" + + class MfaConfig(TypedDict, total=False): """Configures multi-factor authentication (MFA) settings.""" diff --git a/src/cloudflare/types/zero_trust/access/applications/policy_update_response.py b/src/cloudflare/types/zero_trust/access/applications/policy_update_response.py index badcb18099f..be8d01e8de9 100644 --- a/src/cloudflare/types/zero_trust/access/applications/policy_update_response.py +++ b/src/cloudflare/types/zero_trust/access/applications/policy_update_response.py @@ -9,7 +9,30 @@ from .access_rule import AccessRule from ..approval_group import ApprovalGroup -__all__ = ["PolicyUpdateResponse", "MfaConfig"] +__all__ = ["PolicyUpdateResponse", "ConnectionRules", "ConnectionRulesRdp", "MfaConfig"] + + +class ConnectionRulesRdp(BaseModel): + """The RDP-specific rules that define clipboard behavior for RDP connections.""" + + allowed_clipboard_local_to_remote_formats: Optional[List[Literal["text"]]] = None + """ + Clipboard formats allowed when copying from local machine to remote RDP session. + """ + + allowed_clipboard_remote_to_local_formats: Optional[List[Literal["text"]]] = None + """ + Clipboard formats allowed when copying from remote RDP session to local machine. + """ + + +class ConnectionRules(BaseModel): + """ + The rules that define how users may connect to targets secured by your application. + """ + + rdp: Optional[ConnectionRulesRdp] = None + """The RDP-specific rules that define clipboard behavior for RDP connections.""" class MfaConfig(BaseModel): @@ -45,6 +68,12 @@ class PolicyUpdateResponse(BaseModel): session. """ + connection_rules: Optional[ConnectionRules] = None + """ + The rules that define how users may connect to targets secured by your + application. + """ + created_at: Optional[datetime] = None decision: Optional[Decision] = None diff --git a/src/cloudflare/types/zero_trust/access/policy_create_params.py b/src/cloudflare/types/zero_trust/access/policy_create_params.py index df7b8508c36..3825b9f7f13 100644 --- a/src/cloudflare/types/zero_trust/access/policy_create_params.py +++ b/src/cloudflare/types/zero_trust/access/policy_create_params.py @@ -9,7 +9,7 @@ from .approval_group_param import ApprovalGroupParam from .applications.access_rule_param import AccessRuleParam -__all__ = ["PolicyCreateParams", "MfaConfig"] +__all__ = ["PolicyCreateParams", "ConnectionRules", "ConnectionRulesRdp", "MfaConfig"] class PolicyCreateParams(TypedDict, total=False): @@ -40,6 +40,12 @@ class PolicyCreateParams(TypedDict, total=False): session. """ + connection_rules: ConnectionRules + """ + The rules that define how users may connect to targets secured by your + application. + """ + exclude: Iterable[AccessRuleParam] """Rules evaluated with a NOT logical operator. @@ -76,6 +82,29 @@ class PolicyCreateParams(TypedDict, total=False): """ +class ConnectionRulesRdp(TypedDict, total=False): + """The RDP-specific rules that define clipboard behavior for RDP connections.""" + + allowed_clipboard_local_to_remote_formats: List[Literal["text"]] + """ + Clipboard formats allowed when copying from local machine to remote RDP session. + """ + + allowed_clipboard_remote_to_local_formats: List[Literal["text"]] + """ + Clipboard formats allowed when copying from remote RDP session to local machine. + """ + + +class ConnectionRules(TypedDict, total=False): + """ + The rules that define how users may connect to targets secured by your application. + """ + + rdp: ConnectionRulesRdp + """The RDP-specific rules that define clipboard behavior for RDP connections.""" + + class MfaConfig(TypedDict, total=False): """Configures multi-factor authentication (MFA) settings.""" diff --git a/src/cloudflare/types/zero_trust/access/policy_create_response.py b/src/cloudflare/types/zero_trust/access/policy_create_response.py index b1a2325644d..e8106fbec7a 100644 --- a/src/cloudflare/types/zero_trust/access/policy_create_response.py +++ b/src/cloudflare/types/zero_trust/access/policy_create_response.py @@ -9,7 +9,30 @@ from .approval_group import ApprovalGroup from .applications.access_rule import AccessRule -__all__ = ["PolicyCreateResponse", "MfaConfig"] +__all__ = ["PolicyCreateResponse", "ConnectionRules", "ConnectionRulesRdp", "MfaConfig"] + + +class ConnectionRulesRdp(BaseModel): + """The RDP-specific rules that define clipboard behavior for RDP connections.""" + + allowed_clipboard_local_to_remote_formats: Optional[List[Literal["text"]]] = None + """ + Clipboard formats allowed when copying from local machine to remote RDP session. + """ + + allowed_clipboard_remote_to_local_formats: Optional[List[Literal["text"]]] = None + """ + Clipboard formats allowed when copying from remote RDP session to local machine. + """ + + +class ConnectionRules(BaseModel): + """ + The rules that define how users may connect to targets secured by your application. + """ + + rdp: Optional[ConnectionRulesRdp] = None + """The RDP-specific rules that define clipboard behavior for RDP connections.""" class MfaConfig(BaseModel): @@ -48,6 +71,12 @@ class PolicyCreateResponse(BaseModel): session. """ + connection_rules: Optional[ConnectionRules] = None + """ + The rules that define how users may connect to targets secured by your + application. + """ + created_at: Optional[datetime] = None decision: Optional[Decision] = None diff --git a/src/cloudflare/types/zero_trust/access/policy_get_response.py b/src/cloudflare/types/zero_trust/access/policy_get_response.py index 4a481e35b91..bbfb04669b6 100644 --- a/src/cloudflare/types/zero_trust/access/policy_get_response.py +++ b/src/cloudflare/types/zero_trust/access/policy_get_response.py @@ -9,7 +9,30 @@ from .approval_group import ApprovalGroup from .applications.access_rule import AccessRule -__all__ = ["PolicyGetResponse", "MfaConfig"] +__all__ = ["PolicyGetResponse", "ConnectionRules", "ConnectionRulesRdp", "MfaConfig"] + + +class ConnectionRulesRdp(BaseModel): + """The RDP-specific rules that define clipboard behavior for RDP connections.""" + + allowed_clipboard_local_to_remote_formats: Optional[List[Literal["text"]]] = None + """ + Clipboard formats allowed when copying from local machine to remote RDP session. + """ + + allowed_clipboard_remote_to_local_formats: Optional[List[Literal["text"]]] = None + """ + Clipboard formats allowed when copying from remote RDP session to local machine. + """ + + +class ConnectionRules(BaseModel): + """ + The rules that define how users may connect to targets secured by your application. + """ + + rdp: Optional[ConnectionRulesRdp] = None + """The RDP-specific rules that define clipboard behavior for RDP connections.""" class MfaConfig(BaseModel): @@ -48,6 +71,12 @@ class PolicyGetResponse(BaseModel): session. """ + connection_rules: Optional[ConnectionRules] = None + """ + The rules that define how users may connect to targets secured by your + application. + """ + created_at: Optional[datetime] = None decision: Optional[Decision] = None diff --git a/src/cloudflare/types/zero_trust/access/policy_list_response.py b/src/cloudflare/types/zero_trust/access/policy_list_response.py index 67206475718..2aa0e8371e8 100644 --- a/src/cloudflare/types/zero_trust/access/policy_list_response.py +++ b/src/cloudflare/types/zero_trust/access/policy_list_response.py @@ -9,7 +9,30 @@ from .approval_group import ApprovalGroup from .applications.access_rule import AccessRule -__all__ = ["PolicyListResponse", "MfaConfig"] +__all__ = ["PolicyListResponse", "ConnectionRules", "ConnectionRulesRdp", "MfaConfig"] + + +class ConnectionRulesRdp(BaseModel): + """The RDP-specific rules that define clipboard behavior for RDP connections.""" + + allowed_clipboard_local_to_remote_formats: Optional[List[Literal["text"]]] = None + """ + Clipboard formats allowed when copying from local machine to remote RDP session. + """ + + allowed_clipboard_remote_to_local_formats: Optional[List[Literal["text"]]] = None + """ + Clipboard formats allowed when copying from remote RDP session to local machine. + """ + + +class ConnectionRules(BaseModel): + """ + The rules that define how users may connect to targets secured by your application. + """ + + rdp: Optional[ConnectionRulesRdp] = None + """The RDP-specific rules that define clipboard behavior for RDP connections.""" class MfaConfig(BaseModel): @@ -48,6 +71,12 @@ class PolicyListResponse(BaseModel): session. """ + connection_rules: Optional[ConnectionRules] = None + """ + The rules that define how users may connect to targets secured by your + application. + """ + created_at: Optional[datetime] = None decision: Optional[Decision] = None diff --git a/src/cloudflare/types/zero_trust/access/policy_update_params.py b/src/cloudflare/types/zero_trust/access/policy_update_params.py index 66493c65f90..830fc9e9f98 100644 --- a/src/cloudflare/types/zero_trust/access/policy_update_params.py +++ b/src/cloudflare/types/zero_trust/access/policy_update_params.py @@ -9,7 +9,7 @@ from .approval_group_param import ApprovalGroupParam from .applications.access_rule_param import AccessRuleParam -__all__ = ["PolicyUpdateParams", "MfaConfig"] +__all__ = ["PolicyUpdateParams", "ConnectionRules", "ConnectionRulesRdp", "MfaConfig"] class PolicyUpdateParams(TypedDict, total=False): @@ -40,6 +40,12 @@ class PolicyUpdateParams(TypedDict, total=False): session. """ + connection_rules: ConnectionRules + """ + The rules that define how users may connect to targets secured by your + application. + """ + exclude: Iterable[AccessRuleParam] """Rules evaluated with a NOT logical operator. @@ -76,6 +82,29 @@ class PolicyUpdateParams(TypedDict, total=False): """ +class ConnectionRulesRdp(TypedDict, total=False): + """The RDP-specific rules that define clipboard behavior for RDP connections.""" + + allowed_clipboard_local_to_remote_formats: List[Literal["text"]] + """ + Clipboard formats allowed when copying from local machine to remote RDP session. + """ + + allowed_clipboard_remote_to_local_formats: List[Literal["text"]] + """ + Clipboard formats allowed when copying from remote RDP session to local machine. + """ + + +class ConnectionRules(TypedDict, total=False): + """ + The rules that define how users may connect to targets secured by your application. + """ + + rdp: ConnectionRulesRdp + """The RDP-specific rules that define clipboard behavior for RDP connections.""" + + class MfaConfig(TypedDict, total=False): """Configures multi-factor authentication (MFA) settings.""" diff --git a/src/cloudflare/types/zero_trust/access/policy_update_response.py b/src/cloudflare/types/zero_trust/access/policy_update_response.py index cb9244b4e60..c0eb5d220ed 100644 --- a/src/cloudflare/types/zero_trust/access/policy_update_response.py +++ b/src/cloudflare/types/zero_trust/access/policy_update_response.py @@ -9,7 +9,30 @@ from .approval_group import ApprovalGroup from .applications.access_rule import AccessRule -__all__ = ["PolicyUpdateResponse", "MfaConfig"] +__all__ = ["PolicyUpdateResponse", "ConnectionRules", "ConnectionRulesRdp", "MfaConfig"] + + +class ConnectionRulesRdp(BaseModel): + """The RDP-specific rules that define clipboard behavior for RDP connections.""" + + allowed_clipboard_local_to_remote_formats: Optional[List[Literal["text"]]] = None + """ + Clipboard formats allowed when copying from local machine to remote RDP session. + """ + + allowed_clipboard_remote_to_local_formats: Optional[List[Literal["text"]]] = None + """ + Clipboard formats allowed when copying from remote RDP session to local machine. + """ + + +class ConnectionRules(BaseModel): + """ + The rules that define how users may connect to targets secured by your application. + """ + + rdp: Optional[ConnectionRulesRdp] = None + """The RDP-specific rules that define clipboard behavior for RDP connections.""" class MfaConfig(BaseModel): @@ -48,6 +71,12 @@ class PolicyUpdateResponse(BaseModel): session. """ + connection_rules: Optional[ConnectionRules] = None + """ + The rules that define how users may connect to targets secured by your + application. + """ + created_at: Optional[datetime] = None decision: Optional[Decision] = None diff --git a/tests/api_resources/zero_trust/access/applications/test_policies.py b/tests/api_resources/zero_trust/access/applications/test_policies.py index 6d3b3843f3b..52266e52dda 100644 --- a/tests/api_resources/zero_trust/access/applications/test_policies.py +++ b/tests/api_resources/zero_trust/access/applications/test_policies.py @@ -52,6 +52,12 @@ def test_method_create_with_all_params(self, client: Cloudflare) -> None: }, ], approval_required=True, + connection_rules={ + "rdp": { + "allowed_clipboard_local_to_remote_formats": ["text"], + "allowed_clipboard_remote_to_local_formats": ["text"], + } + }, isolation_required=False, mfa_config={ "allowed_authenticators": ["totp", "biometrics", "security_key"], @@ -144,6 +150,12 @@ def test_method_update_with_all_params(self, client: Cloudflare) -> None: }, ], approval_required=True, + connection_rules={ + "rdp": { + "allowed_clipboard_local_to_remote_formats": ["text"], + "allowed_clipboard_remote_to_local_formats": ["text"], + } + }, isolation_required=False, mfa_config={ "allowed_authenticators": ["totp", "biometrics", "security_key"], @@ -483,6 +495,12 @@ async def test_method_create_with_all_params(self, async_client: AsyncCloudflare }, ], approval_required=True, + connection_rules={ + "rdp": { + "allowed_clipboard_local_to_remote_formats": ["text"], + "allowed_clipboard_remote_to_local_formats": ["text"], + } + }, isolation_required=False, mfa_config={ "allowed_authenticators": ["totp", "biometrics", "security_key"], @@ -575,6 +593,12 @@ async def test_method_update_with_all_params(self, async_client: AsyncCloudflare }, ], approval_required=True, + connection_rules={ + "rdp": { + "allowed_clipboard_local_to_remote_formats": ["text"], + "allowed_clipboard_remote_to_local_formats": ["text"], + } + }, isolation_required=False, mfa_config={ "allowed_authenticators": ["totp", "biometrics", "security_key"], diff --git a/tests/api_resources/zero_trust/access/applications/test_policy_tests.py b/tests/api_resources/zero_trust/access/applications/test_policy_tests.py index 4e47f184c2a..5cd0138cda0 100755 --- a/tests/api_resources/zero_trust/access/applications/test_policy_tests.py +++ b/tests/api_resources/zero_trust/access/applications/test_policy_tests.py @@ -49,6 +49,12 @@ def test_method_create_with_all_params(self, client: Cloudflare) -> None: }, ], "approval_required": True, + "connection_rules": { + "rdp": { + "allowed_clipboard_local_to_remote_formats": ["text"], + "allowed_clipboard_remote_to_local_formats": ["text"], + } + }, "exclude": [{"group": {"id": "aa0a4aab-672b-4bdb-bc33-a59f1130a11f"}}], "isolation_required": False, "mfa_config": { @@ -179,6 +185,12 @@ async def test_method_create_with_all_params(self, async_client: AsyncCloudflare }, ], "approval_required": True, + "connection_rules": { + "rdp": { + "allowed_clipboard_local_to_remote_formats": ["text"], + "allowed_clipboard_remote_to_local_formats": ["text"], + } + }, "exclude": [{"group": {"id": "aa0a4aab-672b-4bdb-bc33-a59f1130a11f"}}], "isolation_required": False, "mfa_config": { diff --git a/tests/api_resources/zero_trust/access/test_policies.py b/tests/api_resources/zero_trust/access/test_policies.py index cd626396e31..5f4a60a6752 100644 --- a/tests/api_resources/zero_trust/access/test_policies.py +++ b/tests/api_resources/zero_trust/access/test_policies.py @@ -54,6 +54,12 @@ def test_method_create_with_all_params(self, client: Cloudflare) -> None: }, ], approval_required=True, + connection_rules={ + "rdp": { + "allowed_clipboard_local_to_remote_formats": ["text"], + "allowed_clipboard_remote_to_local_formats": ["text"], + } + }, exclude=[{"group": {"id": "aa0a4aab-672b-4bdb-bc33-a59f1130a11f"}}], isolation_required=False, mfa_config={ @@ -140,6 +146,12 @@ def test_method_update_with_all_params(self, client: Cloudflare) -> None: }, ], approval_required=True, + connection_rules={ + "rdp": { + "allowed_clipboard_local_to_remote_formats": ["text"], + "allowed_clipboard_remote_to_local_formats": ["text"], + } + }, exclude=[{"group": {"id": "aa0a4aab-672b-4bdb-bc33-a59f1130a11f"}}], isolation_required=False, mfa_config={ @@ -385,6 +397,12 @@ async def test_method_create_with_all_params(self, async_client: AsyncCloudflare }, ], approval_required=True, + connection_rules={ + "rdp": { + "allowed_clipboard_local_to_remote_formats": ["text"], + "allowed_clipboard_remote_to_local_formats": ["text"], + } + }, exclude=[{"group": {"id": "aa0a4aab-672b-4bdb-bc33-a59f1130a11f"}}], isolation_required=False, mfa_config={ @@ -471,6 +489,12 @@ async def test_method_update_with_all_params(self, async_client: AsyncCloudflare }, ], approval_required=True, + connection_rules={ + "rdp": { + "allowed_clipboard_local_to_remote_formats": ["text"], + "allowed_clipboard_remote_to_local_formats": ["text"], + } + }, exclude=[{"group": {"id": "aa0a4aab-672b-4bdb-bc33-a59f1130a11f"}}], isolation_required=False, mfa_config={ From 6d6d5539bbcd680f4b7088ae907652f13654b293 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 24 Feb 2026 18:33:06 +0000 Subject: [PATCH 036/279] chore(api): update composite API spec --- .stats.yml | 4 ++-- .../intel/indicator_feeds/indicator_feeds.py | 12 ++++++------ .../resources/intel/indicator_feeds/snapshots.py | 4 ++-- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/.stats.yml b/.stats.yml index 6189990b2e9..151564b5ab5 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 2032 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-3dd655c9a1d26faa8cf47065b3d5f9e5df4771a8586806ef2d074dd3ca629389.yml -openapi_spec_hash: e83ddc1a7d9777031551bbc9ceb1d377 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-9ba099b7936091cc984d2a24fc4d32c3ffcb1d71d86412c8c9084d201e16b3ac.yml +openapi_spec_hash: 45edc9a107cf5a5e3b204b230b0d336d config_hash: 405e0229a3b5214d99c53598e78f85a1 diff --git a/src/cloudflare/resources/intel/indicator_feeds/indicator_feeds.py b/src/cloudflare/resources/intel/indicator_feeds/indicator_feeds.py index a7e90acb640..bf6f0191b47 100644 --- a/src/cloudflare/resources/intel/indicator_feeds/indicator_feeds.py +++ b/src/cloudflare/resources/intel/indicator_feeds/indicator_feeds.py @@ -142,7 +142,7 @@ def update( timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[IndicatorFeedUpdateResponse]: """ - Retrieves the raw data entries in a custom threat indicator feed. + Revises details for a specific custom threat indicator feed. Args: account_id: Identifier @@ -203,7 +203,7 @@ def list( timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SyncSinglePage[IndicatorFeedListResponse]: """ - Retrieves details for a specific custom threat indicator feed. + Retrieves details for all accessible custom threat indicator feeds. Args: account_id: Identifier @@ -279,7 +279,7 @@ def get( timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[IndicatorFeedGetResponse]: """ - Retrieves the raw data entries in a custom threat indicator feed. + Retrieves details for a specific custom threat indicator feed. Args: account_id: Identifier @@ -407,7 +407,7 @@ async def update( timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[IndicatorFeedUpdateResponse]: """ - Retrieves the raw data entries in a custom threat indicator feed. + Revises details for a specific custom threat indicator feed. Args: account_id: Identifier @@ -468,7 +468,7 @@ def list( timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AsyncPaginator[IndicatorFeedListResponse, AsyncSinglePage[IndicatorFeedListResponse]]: """ - Retrieves details for a specific custom threat indicator feed. + Retrieves details for all accessible custom threat indicator feeds. Args: account_id: Identifier @@ -544,7 +544,7 @@ async def get( timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[IndicatorFeedGetResponse]: """ - Retrieves the raw data entries in a custom threat indicator feed. + Retrieves details for a specific custom threat indicator feed. Args: account_id: Identifier diff --git a/src/cloudflare/resources/intel/indicator_feeds/snapshots.py b/src/cloudflare/resources/intel/indicator_feeds/snapshots.py index 5e73856ec48..a92b19cfd1b 100644 --- a/src/cloudflare/resources/intel/indicator_feeds/snapshots.py +++ b/src/cloudflare/resources/intel/indicator_feeds/snapshots.py @@ -58,7 +58,7 @@ def update( timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[SnapshotUpdateResponse]: """ - Retrieves the raw data entries in a custom threat indicator feed. + Revises the raw data entries in a custom threat indicator feed. Args: account_id: Identifier @@ -129,7 +129,7 @@ async def update( timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Optional[SnapshotUpdateResponse]: """ - Retrieves the raw data entries in a custom threat indicator feed. + Revises the raw data entries in a custom threat indicator feed. Args: account_id: Identifier From 52a4415eb345c4316b353404bfe9bf228573a197 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 24 Feb 2026 21:29:51 +0000 Subject: [PATCH 037/279] feat: feat(stainless): AUTH-7071 Complete Access Users endpoint * feat(stainless): AUTH-7071 Complete Access Users endpoint --- .stats.yml | 4 +- api.md | 12 +- .../zero_trust/access/users/users.py | 460 +++++++++++++++++- .../types/zero_trust/access/__init__.py | 5 + .../zero_trust/access/user_create_params.py | 18 + .../zero_trust/access/user_create_response.py | 41 ++ .../zero_trust/access/user_get_response.py | 41 ++ .../zero_trust/access/user_update_params.py | 18 + .../zero_trust/access/user_update_response.py | 41 ++ .../zero_trust/access/test_users.py | 419 +++++++++++++++- 10 files changed, 1052 insertions(+), 7 deletions(-) create mode 100644 src/cloudflare/types/zero_trust/access/user_create_params.py create mode 100644 src/cloudflare/types/zero_trust/access/user_create_response.py create mode 100644 src/cloudflare/types/zero_trust/access/user_get_response.py create mode 100644 src/cloudflare/types/zero_trust/access/user_update_params.py create mode 100644 src/cloudflare/types/zero_trust/access/user_update_response.py diff --git a/.stats.yml b/.stats.yml index 151564b5ab5..c963b2ec00e 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ -configured_endpoints: 2032 +configured_endpoints: 2036 openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-9ba099b7936091cc984d2a24fc4d32c3ffcb1d71d86412c8c9084d201e16b3ac.yml openapi_spec_hash: 45edc9a107cf5a5e3b204b230b0d336d -config_hash: 405e0229a3b5214d99c53598e78f85a1 +config_hash: 4036b2ef5ec580fd7955f59e1e1547e2 diff --git a/api.md b/api.md index 87fd3ad0568..6ce81a035fc 100644 --- a/api.md +++ b/api.md @@ -6292,12 +6292,22 @@ Methods: Types: ```python -from cloudflare.types.zero_trust.access import AccessUser, UserListResponse +from cloudflare.types.zero_trust.access import ( + AccessUser, + UserCreateResponse, + UserUpdateResponse, + UserListResponse, + UserGetResponse, +) ``` Methods: +- client.zero_trust.access.users.create(\*, account_id, \*\*params) -> Optional[UserCreateResponse] +- client.zero_trust.access.users.update(user_id, \*, account_id, \*\*params) -> Optional[UserUpdateResponse] - client.zero_trust.access.users.list(\*, account_id, \*\*params) -> SyncV4PagePaginationArray[UserListResponse] +- client.zero_trust.access.users.delete(user_id, \*, account_id) -> object +- client.zero_trust.access.users.get(user_id, \*, account_id) -> Optional[UserGetResponse] #### ActiveSessions diff --git a/src/cloudflare/resources/zero_trust/access/users/users.py b/src/cloudflare/resources/zero_trust/access/users/users.py index 515fed442eb..2a0b9cc6a98 100644 --- a/src/cloudflare/resources/zero_trust/access/users/users.py +++ b/src/cloudflare/resources/zero_trust/access/users/users.py @@ -2,10 +2,12 @@ from __future__ import annotations +from typing import Type, Optional, cast + import httpx from ....._types import Body, Omit, Query, Headers, NotGiven, omit, not_given -from ....._utils import maybe_transform +from ....._utils import maybe_transform, async_maybe_transform from ....._compat import cached_property from ....._resource import SyncAPIResource, AsyncAPIResource from ....._response import ( @@ -14,6 +16,7 @@ async_to_raw_response_wrapper, async_to_streamed_response_wrapper, ) +from ....._wrappers import ResultWrapper from .failed_logins import ( FailedLoginsResource, AsyncFailedLoginsResource, @@ -40,8 +43,11 @@ LastSeenIdentityResourceWithStreamingResponse, AsyncLastSeenIdentityResourceWithStreamingResponse, ) -from .....types.zero_trust.access import user_list_params +from .....types.zero_trust.access import user_list_params, user_create_params, user_update_params +from .....types.zero_trust.access.user_get_response import UserGetResponse from .....types.zero_trust.access.user_list_response import UserListResponse +from .....types.zero_trust.access.user_create_response import UserCreateResponse +from .....types.zero_trust.access.user_update_response import UserUpdateResponse __all__ = ["UsersResource", "AsyncUsersResource"] @@ -78,6 +84,117 @@ def with_streaming_response(self) -> UsersResourceWithStreamingResponse: """ return UsersResourceWithStreamingResponse(self) + def create( + self, + *, + account_id: str, + email: str, + name: str | 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, + ) -> Optional[UserCreateResponse]: + """ + Creates a new user. + + Args: + account_id: Identifier. + + email: The email of the user. + + name: The name of the user. + + 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._post( + f"/accounts/{account_id}/access/users", + body=maybe_transform( + { + "email": email, + "name": name, + }, + user_create_params.UserCreateParams, + ), + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + post_parser=ResultWrapper[Optional[UserCreateResponse]]._unwrapper, + ), + cast_to=cast(Type[Optional[UserCreateResponse]], ResultWrapper[UserCreateResponse]), + ) + + def update( + self, + user_id: str, + *, + account_id: str, + email: str, + name: 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[UserUpdateResponse]: + """Updates a specific user's name for an account. + + Requires the user's current email + as confirmation (email cannot be changed). + + Args: + account_id: Identifier. + + user_id: UUID. + + email: The email of the user. + + name: The name of the user. + + 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 user_id: + raise ValueError(f"Expected a non-empty value for `user_id` but received {user_id!r}") + return self._put( + f"/accounts/{account_id}/access/users/{user_id}", + body=maybe_transform( + { + "email": email, + "name": name, + }, + user_update_params.UserUpdateParams, + ), + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + post_parser=ResultWrapper[Optional[UserUpdateResponse]]._unwrapper, + ), + cast_to=cast(Type[Optional[UserUpdateResponse]], ResultWrapper[UserUpdateResponse]), + ) + def list( self, *, @@ -142,6 +259,96 @@ def list( model=UserListResponse, ) + def delete( + self, + user_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, + ) -> object: + """Deletes a specific user for an account. + + This will also revoke any active seats + and tokens for the user. + + Args: + account_id: Identifier. + + user_id: UUID. + + 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 user_id: + raise ValueError(f"Expected a non-empty value for `user_id` but received {user_id!r}") + return self._delete( + f"/accounts/{account_id}/access/users/{user_id}", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + post_parser=ResultWrapper[Optional[object]]._unwrapper, + ), + cast_to=cast(Type[object], ResultWrapper[object]), + ) + + def get( + self, + user_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[UserGetResponse]: + """ + Gets a specific user for an account. + + Args: + account_id: Identifier. + + user_id: UUID. + + 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 user_id: + raise ValueError(f"Expected a non-empty value for `user_id` but received {user_id!r}") + return self._get( + f"/accounts/{account_id}/access/users/{user_id}", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + post_parser=ResultWrapper[Optional[UserGetResponse]]._unwrapper, + ), + cast_to=cast(Type[Optional[UserGetResponse]], ResultWrapper[UserGetResponse]), + ) + class AsyncUsersResource(AsyncAPIResource): @cached_property @@ -175,6 +382,117 @@ def with_streaming_response(self) -> AsyncUsersResourceWithStreamingResponse: """ return AsyncUsersResourceWithStreamingResponse(self) + async def create( + self, + *, + account_id: str, + email: str, + name: str | 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, + ) -> Optional[UserCreateResponse]: + """ + Creates a new user. + + Args: + account_id: Identifier. + + email: The email of the user. + + name: The name of the user. + + 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 await self._post( + f"/accounts/{account_id}/access/users", + body=await async_maybe_transform( + { + "email": email, + "name": name, + }, + user_create_params.UserCreateParams, + ), + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + post_parser=ResultWrapper[Optional[UserCreateResponse]]._unwrapper, + ), + cast_to=cast(Type[Optional[UserCreateResponse]], ResultWrapper[UserCreateResponse]), + ) + + async def update( + self, + user_id: str, + *, + account_id: str, + email: str, + name: 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[UserUpdateResponse]: + """Updates a specific user's name for an account. + + Requires the user's current email + as confirmation (email cannot be changed). + + Args: + account_id: Identifier. + + user_id: UUID. + + email: The email of the user. + + name: The name of the user. + + 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 user_id: + raise ValueError(f"Expected a non-empty value for `user_id` but received {user_id!r}") + return await self._put( + f"/accounts/{account_id}/access/users/{user_id}", + body=await async_maybe_transform( + { + "email": email, + "name": name, + }, + user_update_params.UserUpdateParams, + ), + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + post_parser=ResultWrapper[Optional[UserUpdateResponse]]._unwrapper, + ), + cast_to=cast(Type[Optional[UserUpdateResponse]], ResultWrapper[UserUpdateResponse]), + ) + def list( self, *, @@ -239,14 +557,116 @@ def list( model=UserListResponse, ) + async def delete( + self, + user_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, + ) -> object: + """Deletes a specific user for an account. + + This will also revoke any active seats + and tokens for the user. + + Args: + account_id: Identifier. + + user_id: UUID. + + 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 user_id: + raise ValueError(f"Expected a non-empty value for `user_id` but received {user_id!r}") + return await self._delete( + f"/accounts/{account_id}/access/users/{user_id}", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + post_parser=ResultWrapper[Optional[object]]._unwrapper, + ), + cast_to=cast(Type[object], ResultWrapper[object]), + ) + + async def get( + self, + user_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[UserGetResponse]: + """ + Gets a specific user for an account. + + Args: + account_id: Identifier. + + user_id: UUID. + + 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 user_id: + raise ValueError(f"Expected a non-empty value for `user_id` but received {user_id!r}") + return await self._get( + f"/accounts/{account_id}/access/users/{user_id}", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + post_parser=ResultWrapper[Optional[UserGetResponse]]._unwrapper, + ), + cast_to=cast(Type[Optional[UserGetResponse]], ResultWrapper[UserGetResponse]), + ) + class UsersResourceWithRawResponse: def __init__(self, users: UsersResource) -> None: self._users = users + self.create = to_raw_response_wrapper( + users.create, + ) + self.update = to_raw_response_wrapper( + users.update, + ) self.list = to_raw_response_wrapper( users.list, ) + self.delete = to_raw_response_wrapper( + users.delete, + ) + self.get = to_raw_response_wrapper( + users.get, + ) @cached_property def active_sessions(self) -> ActiveSessionsResourceWithRawResponse: @@ -265,9 +685,21 @@ class AsyncUsersResourceWithRawResponse: def __init__(self, users: AsyncUsersResource) -> None: self._users = users + self.create = async_to_raw_response_wrapper( + users.create, + ) + self.update = async_to_raw_response_wrapper( + users.update, + ) self.list = async_to_raw_response_wrapper( users.list, ) + self.delete = async_to_raw_response_wrapper( + users.delete, + ) + self.get = async_to_raw_response_wrapper( + users.get, + ) @cached_property def active_sessions(self) -> AsyncActiveSessionsResourceWithRawResponse: @@ -286,9 +718,21 @@ class UsersResourceWithStreamingResponse: def __init__(self, users: UsersResource) -> None: self._users = users + self.create = to_streamed_response_wrapper( + users.create, + ) + self.update = to_streamed_response_wrapper( + users.update, + ) self.list = to_streamed_response_wrapper( users.list, ) + self.delete = to_streamed_response_wrapper( + users.delete, + ) + self.get = to_streamed_response_wrapper( + users.get, + ) @cached_property def active_sessions(self) -> ActiveSessionsResourceWithStreamingResponse: @@ -307,9 +751,21 @@ class AsyncUsersResourceWithStreamingResponse: def __init__(self, users: AsyncUsersResource) -> None: self._users = users + self.create = async_to_streamed_response_wrapper( + users.create, + ) + self.update = async_to_streamed_response_wrapper( + users.update, + ) self.list = async_to_streamed_response_wrapper( users.list, ) + self.delete = async_to_streamed_response_wrapper( + users.delete, + ) + self.get = async_to_streamed_response_wrapper( + users.get, + ) @cached_property def active_sessions(self) -> AsyncActiveSessionsResourceWithStreamingResponse: diff --git a/src/cloudflare/types/zero_trust/access/__init__.py b/src/cloudflare/types/zero_trust/access/__init__.py index beac853e2ff..2f5c7f04df1 100644 --- a/src/cloudflare/types/zero_trust/access/__init__.py +++ b/src/cloudflare/types/zero_trust/access/__init__.py @@ -27,10 +27,13 @@ from .key_update_params import KeyUpdateParams as KeyUpdateParams from .tag_create_params import TagCreateParams as TagCreateParams from .tag_update_params import TagUpdateParams as TagUpdateParams +from .user_get_response import UserGetResponse as UserGetResponse from .cors_headers_param import CORSHeadersParam as CORSHeadersParam from .group_get_response import GroupGetResponse as GroupGetResponse from .policy_list_params import PolicyListParams as PolicyListParams +from .user_create_params import UserCreateParams as UserCreateParams from .user_list_response import UserListResponse as UserListResponse +from .user_update_params import UserUpdateParams as UserUpdateParams from .group_create_params import GroupCreateParams as GroupCreateParams from .group_list_response import GroupListResponse as GroupListResponse from .group_update_params import GroupUpdateParams as GroupUpdateParams @@ -47,6 +50,8 @@ from .policy_create_params import PolicyCreateParams as PolicyCreateParams from .policy_list_response import PolicyListResponse as PolicyListResponse from .policy_update_params import PolicyUpdateParams as PolicyUpdateParams +from .user_create_response import UserCreateResponse as UserCreateResponse +from .user_update_response import UserUpdateResponse as UserUpdateResponse from .group_create_response import GroupCreateResponse as GroupCreateResponse from .group_delete_response import GroupDeleteResponse as GroupDeleteResponse from .group_update_response import GroupUpdateResponse as GroupUpdateResponse diff --git a/src/cloudflare/types/zero_trust/access/user_create_params.py b/src/cloudflare/types/zero_trust/access/user_create_params.py new file mode 100644 index 00000000000..dcbedcff9d8 --- /dev/null +++ b/src/cloudflare/types/zero_trust/access/user_create_params.py @@ -0,0 +1,18 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +__all__ = ["UserCreateParams"] + + +class UserCreateParams(TypedDict, total=False): + account_id: Required[str] + """Identifier.""" + + email: Required[str] + """The email of the user.""" + + name: str + """The name of the user.""" diff --git a/src/cloudflare/types/zero_trust/access/user_create_response.py b/src/cloudflare/types/zero_trust/access/user_create_response.py new file mode 100644 index 00000000000..c9f6cde0e5a --- /dev/null +++ b/src/cloudflare/types/zero_trust/access/user_create_response.py @@ -0,0 +1,41 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional +from datetime import datetime + +from ...._models import BaseModel + +__all__ = ["UserCreateResponse"] + + +class UserCreateResponse(BaseModel): + id: Optional[str] = None + """UUID.""" + + access_seat: Optional[bool] = None + """True if the user has authenticated with Cloudflare Access.""" + + active_device_count: Optional[float] = None + """The number of active devices registered to the user.""" + + created_at: Optional[datetime] = None + + email: Optional[str] = None + """The email of the user.""" + + gateway_seat: Optional[bool] = None + """True if the user has logged into the WARP client.""" + + last_successful_login: Optional[datetime] = None + """The time at which the user last successfully logged in.""" + + name: Optional[str] = None + """The name of the user.""" + + seat_uid: Optional[str] = None + """The unique API identifier for the Zero Trust seat.""" + + uid: Optional[str] = None + """The unique API identifier for the user.""" + + updated_at: Optional[datetime] = None diff --git a/src/cloudflare/types/zero_trust/access/user_get_response.py b/src/cloudflare/types/zero_trust/access/user_get_response.py new file mode 100644 index 00000000000..9422adac87f --- /dev/null +++ b/src/cloudflare/types/zero_trust/access/user_get_response.py @@ -0,0 +1,41 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional +from datetime import datetime + +from ...._models import BaseModel + +__all__ = ["UserGetResponse"] + + +class UserGetResponse(BaseModel): + id: Optional[str] = None + """UUID.""" + + access_seat: Optional[bool] = None + """True if the user has authenticated with Cloudflare Access.""" + + active_device_count: Optional[float] = None + """The number of active devices registered to the user.""" + + created_at: Optional[datetime] = None + + email: Optional[str] = None + """The email of the user.""" + + gateway_seat: Optional[bool] = None + """True if the user has logged into the WARP client.""" + + last_successful_login: Optional[datetime] = None + """The time at which the user last successfully logged in.""" + + name: Optional[str] = None + """The name of the user.""" + + seat_uid: Optional[str] = None + """The unique API identifier for the Zero Trust seat.""" + + uid: Optional[str] = None + """The unique API identifier for the user.""" + + updated_at: Optional[datetime] = None diff --git a/src/cloudflare/types/zero_trust/access/user_update_params.py b/src/cloudflare/types/zero_trust/access/user_update_params.py new file mode 100644 index 00000000000..8501df104cc --- /dev/null +++ b/src/cloudflare/types/zero_trust/access/user_update_params.py @@ -0,0 +1,18 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +__all__ = ["UserUpdateParams"] + + +class UserUpdateParams(TypedDict, total=False): + account_id: Required[str] + """Identifier.""" + + email: Required[str] + """The email of the user.""" + + name: Required[str] + """The name of the user.""" diff --git a/src/cloudflare/types/zero_trust/access/user_update_response.py b/src/cloudflare/types/zero_trust/access/user_update_response.py new file mode 100644 index 00000000000..cf26f9b54ad --- /dev/null +++ b/src/cloudflare/types/zero_trust/access/user_update_response.py @@ -0,0 +1,41 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional +from datetime import datetime + +from ...._models import BaseModel + +__all__ = ["UserUpdateResponse"] + + +class UserUpdateResponse(BaseModel): + id: Optional[str] = None + """UUID.""" + + access_seat: Optional[bool] = None + """True if the user has authenticated with Cloudflare Access.""" + + active_device_count: Optional[float] = None + """The number of active devices registered to the user.""" + + created_at: Optional[datetime] = None + + email: Optional[str] = None + """The email of the user.""" + + gateway_seat: Optional[bool] = None + """True if the user has logged into the WARP client.""" + + last_successful_login: Optional[datetime] = None + """The time at which the user last successfully logged in.""" + + name: Optional[str] = None + """The name of the user.""" + + seat_uid: Optional[str] = None + """The unique API identifier for the Zero Trust seat.""" + + uid: Optional[str] = None + """The unique API identifier for the user.""" + + updated_at: Optional[datetime] = None diff --git a/tests/api_resources/zero_trust/access/test_users.py b/tests/api_resources/zero_trust/access/test_users.py index f71989026d0..2c1028d7c92 100644 --- a/tests/api_resources/zero_trust/access/test_users.py +++ b/tests/api_resources/zero_trust/access/test_users.py @@ -3,14 +3,19 @@ from __future__ import annotations import os -from typing import Any, cast +from typing import Any, Optional, cast import pytest from cloudflare import Cloudflare, AsyncCloudflare from tests.utils import assert_matches_type from cloudflare.pagination import SyncV4PagePaginationArray, AsyncV4PagePaginationArray -from cloudflare.types.zero_trust.access import UserListResponse +from cloudflare.types.zero_trust.access import ( + UserGetResponse, + UserListResponse, + UserCreateResponse, + UserUpdateResponse, +) base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") @@ -18,6 +23,115 @@ class TestUsers: parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) + @parametrize + def test_method_create(self, client: Cloudflare) -> None: + user = client.zero_trust.access.users.create( + account_id="023e105f4ecef8ad9ca31a8372d0c353", + email="jdoe@example.com", + ) + assert_matches_type(Optional[UserCreateResponse], user, path=["response"]) + + @parametrize + def test_method_create_with_all_params(self, client: Cloudflare) -> None: + user = client.zero_trust.access.users.create( + account_id="023e105f4ecef8ad9ca31a8372d0c353", + email="jdoe@example.com", + name="Jane Doe", + ) + assert_matches_type(Optional[UserCreateResponse], user, path=["response"]) + + @parametrize + def test_raw_response_create(self, client: Cloudflare) -> None: + response = client.zero_trust.access.users.with_raw_response.create( + account_id="023e105f4ecef8ad9ca31a8372d0c353", + email="jdoe@example.com", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + user = response.parse() + assert_matches_type(Optional[UserCreateResponse], user, path=["response"]) + + @parametrize + def test_streaming_response_create(self, client: Cloudflare) -> None: + with client.zero_trust.access.users.with_streaming_response.create( + account_id="023e105f4ecef8ad9ca31a8372d0c353", + email="jdoe@example.com", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + user = response.parse() + assert_matches_type(Optional[UserCreateResponse], user, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_create(self, client: Cloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + client.zero_trust.access.users.with_raw_response.create( + account_id="", + email="jdoe@example.com", + ) + + @parametrize + def test_method_update(self, client: Cloudflare) -> None: + user = client.zero_trust.access.users.update( + user_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + email="jdoe@example.com", + name="Jane Doe", + ) + assert_matches_type(Optional[UserUpdateResponse], user, path=["response"]) + + @parametrize + def test_raw_response_update(self, client: Cloudflare) -> None: + response = client.zero_trust.access.users.with_raw_response.update( + user_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + email="jdoe@example.com", + name="Jane Doe", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + user = response.parse() + assert_matches_type(Optional[UserUpdateResponse], user, path=["response"]) + + @parametrize + def test_streaming_response_update(self, client: Cloudflare) -> None: + with client.zero_trust.access.users.with_streaming_response.update( + user_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + email="jdoe@example.com", + name="Jane Doe", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + user = response.parse() + assert_matches_type(Optional[UserUpdateResponse], user, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_update(self, client: Cloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + client.zero_trust.access.users.with_raw_response.update( + user_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", + account_id="", + email="jdoe@example.com", + name="Jane Doe", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `user_id` but received ''"): + client.zero_trust.access.users.with_raw_response.update( + user_id="", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + email="jdoe@example.com", + name="Jane Doe", + ) + @parametrize def test_method_list(self, client: Cloudflare) -> None: user = client.zero_trust.access.users.list( @@ -68,12 +182,217 @@ def test_path_params_list(self, client: Cloudflare) -> None: account_id="", ) + @parametrize + def test_method_delete(self, client: Cloudflare) -> None: + user = client.zero_trust.access.users.delete( + user_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + ) + assert_matches_type(object, user, path=["response"]) + + @parametrize + def test_raw_response_delete(self, client: Cloudflare) -> None: + response = client.zero_trust.access.users.with_raw_response.delete( + user_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + user = response.parse() + assert_matches_type(object, user, path=["response"]) + + @parametrize + def test_streaming_response_delete(self, client: Cloudflare) -> None: + with client.zero_trust.access.users.with_streaming_response.delete( + user_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + user = response.parse() + assert_matches_type(object, user, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_delete(self, client: Cloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + client.zero_trust.access.users.with_raw_response.delete( + user_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", + account_id="", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `user_id` but received ''"): + client.zero_trust.access.users.with_raw_response.delete( + user_id="", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + ) + + @parametrize + def test_method_get(self, client: Cloudflare) -> None: + user = client.zero_trust.access.users.get( + user_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + ) + assert_matches_type(Optional[UserGetResponse], user, path=["response"]) + + @parametrize + def test_raw_response_get(self, client: Cloudflare) -> None: + response = client.zero_trust.access.users.with_raw_response.get( + user_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + user = response.parse() + assert_matches_type(Optional[UserGetResponse], user, path=["response"]) + + @parametrize + def test_streaming_response_get(self, client: Cloudflare) -> None: + with client.zero_trust.access.users.with_streaming_response.get( + user_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + user = response.parse() + assert_matches_type(Optional[UserGetResponse], user, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_get(self, client: Cloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + client.zero_trust.access.users.with_raw_response.get( + user_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", + account_id="", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `user_id` but received ''"): + client.zero_trust.access.users.with_raw_response.get( + user_id="", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + ) + class TestAsyncUsers: parametrize = pytest.mark.parametrize( "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"] ) + @parametrize + async def test_method_create(self, async_client: AsyncCloudflare) -> None: + user = await async_client.zero_trust.access.users.create( + account_id="023e105f4ecef8ad9ca31a8372d0c353", + email="jdoe@example.com", + ) + assert_matches_type(Optional[UserCreateResponse], user, path=["response"]) + + @parametrize + async def test_method_create_with_all_params(self, async_client: AsyncCloudflare) -> None: + user = await async_client.zero_trust.access.users.create( + account_id="023e105f4ecef8ad9ca31a8372d0c353", + email="jdoe@example.com", + name="Jane Doe", + ) + assert_matches_type(Optional[UserCreateResponse], user, path=["response"]) + + @parametrize + async def test_raw_response_create(self, async_client: AsyncCloudflare) -> None: + response = await async_client.zero_trust.access.users.with_raw_response.create( + account_id="023e105f4ecef8ad9ca31a8372d0c353", + email="jdoe@example.com", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + user = await response.parse() + assert_matches_type(Optional[UserCreateResponse], user, path=["response"]) + + @parametrize + async def test_streaming_response_create(self, async_client: AsyncCloudflare) -> None: + async with async_client.zero_trust.access.users.with_streaming_response.create( + account_id="023e105f4ecef8ad9ca31a8372d0c353", + email="jdoe@example.com", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + user = await response.parse() + assert_matches_type(Optional[UserCreateResponse], user, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_create(self, async_client: AsyncCloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + await async_client.zero_trust.access.users.with_raw_response.create( + account_id="", + email="jdoe@example.com", + ) + + @parametrize + async def test_method_update(self, async_client: AsyncCloudflare) -> None: + user = await async_client.zero_trust.access.users.update( + user_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + email="jdoe@example.com", + name="Jane Doe", + ) + assert_matches_type(Optional[UserUpdateResponse], user, path=["response"]) + + @parametrize + async def test_raw_response_update(self, async_client: AsyncCloudflare) -> None: + response = await async_client.zero_trust.access.users.with_raw_response.update( + user_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + email="jdoe@example.com", + name="Jane Doe", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + user = await response.parse() + assert_matches_type(Optional[UserUpdateResponse], user, path=["response"]) + + @parametrize + async def test_streaming_response_update(self, async_client: AsyncCloudflare) -> None: + async with async_client.zero_trust.access.users.with_streaming_response.update( + user_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + email="jdoe@example.com", + name="Jane Doe", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + user = await response.parse() + assert_matches_type(Optional[UserUpdateResponse], user, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_update(self, async_client: AsyncCloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + await async_client.zero_trust.access.users.with_raw_response.update( + user_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", + account_id="", + email="jdoe@example.com", + name="Jane Doe", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `user_id` but received ''"): + await async_client.zero_trust.access.users.with_raw_response.update( + user_id="", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + email="jdoe@example.com", + name="Jane Doe", + ) + @parametrize async def test_method_list(self, async_client: AsyncCloudflare) -> None: user = await async_client.zero_trust.access.users.list( @@ -123,3 +442,99 @@ async def test_path_params_list(self, async_client: AsyncCloudflare) -> None: await async_client.zero_trust.access.users.with_raw_response.list( account_id="", ) + + @parametrize + async def test_method_delete(self, async_client: AsyncCloudflare) -> None: + user = await async_client.zero_trust.access.users.delete( + user_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + ) + assert_matches_type(object, user, path=["response"]) + + @parametrize + async def test_raw_response_delete(self, async_client: AsyncCloudflare) -> None: + response = await async_client.zero_trust.access.users.with_raw_response.delete( + user_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + user = await response.parse() + assert_matches_type(object, user, path=["response"]) + + @parametrize + async def test_streaming_response_delete(self, async_client: AsyncCloudflare) -> None: + async with async_client.zero_trust.access.users.with_streaming_response.delete( + user_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + user = await response.parse() + assert_matches_type(object, user, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_delete(self, async_client: AsyncCloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + await async_client.zero_trust.access.users.with_raw_response.delete( + user_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", + account_id="", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `user_id` but received ''"): + await async_client.zero_trust.access.users.with_raw_response.delete( + user_id="", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + ) + + @parametrize + async def test_method_get(self, async_client: AsyncCloudflare) -> None: + user = await async_client.zero_trust.access.users.get( + user_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + ) + assert_matches_type(Optional[UserGetResponse], user, path=["response"]) + + @parametrize + async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: + response = await async_client.zero_trust.access.users.with_raw_response.get( + user_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + user = await response.parse() + assert_matches_type(Optional[UserGetResponse], user, path=["response"]) + + @parametrize + async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> None: + async with async_client.zero_trust.access.users.with_streaming_response.get( + user_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + user = await response.parse() + assert_matches_type(Optional[UserGetResponse], user, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_get(self, async_client: AsyncCloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + await async_client.zero_trust.access.users.with_raw_response.get( + user_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", + account_id="", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `user_id` but received ''"): + await async_client.zero_trust.access.users.with_raw_response.get( + user_id="", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + ) From e7c939ecfa41ca7c825b3d4ff592c62619d26c31 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 25 Feb 2026 14:10:48 +0000 Subject: [PATCH 038/279] feat: feat(email_security): Add phishguard reports endpoint * feat(email_security): Add phishguard reports endpoint --- .stats.yml | 4 +- api.md | 14 ++ .../resources/email_security/__init__.py | 14 ++ .../email_security/email_security.py | 32 +++ .../email_security/phishguard/__init__.py | 33 +++ .../email_security/phishguard/phishguard.py | 102 +++++++++ .../email_security/phishguard/reports.py | 215 ++++++++++++++++++ .../email_security/phishguard/__init__.py | 6 + .../phishguard/report_list_params.py | 26 +++ .../phishguard/report_list_response.py | 51 +++++ .../email_security/phishguard/__init__.py | 1 + .../email_security/phishguard/test_reports.py | 124 ++++++++++ 12 files changed, 620 insertions(+), 2 deletions(-) create mode 100644 src/cloudflare/resources/email_security/phishguard/__init__.py create mode 100644 src/cloudflare/resources/email_security/phishguard/phishguard.py create mode 100644 src/cloudflare/resources/email_security/phishguard/reports.py create mode 100644 src/cloudflare/types/email_security/phishguard/__init__.py create mode 100644 src/cloudflare/types/email_security/phishguard/report_list_params.py create mode 100644 src/cloudflare/types/email_security/phishguard/report_list_response.py create mode 100644 tests/api_resources/email_security/phishguard/__init__.py create mode 100644 tests/api_resources/email_security/phishguard/test_reports.py diff --git a/.stats.yml b/.stats.yml index c963b2ec00e..98f9859157a 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ -configured_endpoints: 2036 +configured_endpoints: 2037 openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-9ba099b7936091cc984d2a24fc4d32c3ffcb1d71d86412c8c9084d201e16b3ac.yml openapi_spec_hash: 45edc9a107cf5a5e3b204b230b0d336d -config_hash: 4036b2ef5ec580fd7955f59e1e1547e2 +config_hash: ff14fec6c5fcb182b433bbc41609608b diff --git a/api.md b/api.md index 6ce81a035fc..7b709567bd9 100644 --- a/api.md +++ b/api.md @@ -1450,6 +1450,20 @@ Methods: - client.email_security.investigate.release.bulk(\*, account_id, \*\*params) -> SyncSinglePage[ReleaseBulkResponse] +## Phishguard + +### Reports + +Types: + +```python +from cloudflare.types.email_security.phishguard import ReportListResponse +``` + +Methods: + +- client.email_security.phishguard.reports.list(\*, account_id, \*\*params) -> SyncSinglePage[ReportListResponse] + ## Settings ### AllowPolicies diff --git a/src/cloudflare/resources/email_security/__init__.py b/src/cloudflare/resources/email_security/__init__.py index 092b0ddf17c..a9983bf300c 100644 --- a/src/cloudflare/resources/email_security/__init__.py +++ b/src/cloudflare/resources/email_security/__init__.py @@ -8,6 +8,14 @@ SettingsResourceWithStreamingResponse, AsyncSettingsResourceWithStreamingResponse, ) +from .phishguard import ( + PhishguardResource, + AsyncPhishguardResource, + PhishguardResourceWithRawResponse, + AsyncPhishguardResourceWithRawResponse, + PhishguardResourceWithStreamingResponse, + AsyncPhishguardResourceWithStreamingResponse, +) from .investigate import ( InvestigateResource, AsyncInvestigateResource, @@ -40,6 +48,12 @@ "AsyncInvestigateResourceWithRawResponse", "InvestigateResourceWithStreamingResponse", "AsyncInvestigateResourceWithStreamingResponse", + "PhishguardResource", + "AsyncPhishguardResource", + "PhishguardResourceWithRawResponse", + "AsyncPhishguardResourceWithRawResponse", + "PhishguardResourceWithStreamingResponse", + "AsyncPhishguardResourceWithStreamingResponse", "SettingsResource", "AsyncSettingsResource", "SettingsResourceWithRawResponse", diff --git a/src/cloudflare/resources/email_security/email_security.py b/src/cloudflare/resources/email_security/email_security.py index e66c2ed32c6..82f8770b88f 100644 --- a/src/cloudflare/resources/email_security/email_security.py +++ b/src/cloudflare/resources/email_security/email_security.py @@ -20,6 +20,14 @@ SettingsResourceWithStreamingResponse, AsyncSettingsResourceWithStreamingResponse, ) +from .phishguard.phishguard import ( + PhishguardResource, + AsyncPhishguardResource, + PhishguardResourceWithRawResponse, + AsyncPhishguardResourceWithRawResponse, + PhishguardResourceWithStreamingResponse, + AsyncPhishguardResourceWithStreamingResponse, +) from .investigate.investigate import ( InvestigateResource, AsyncInvestigateResource, @@ -37,6 +45,10 @@ class EmailSecurityResource(SyncAPIResource): def investigate(self) -> InvestigateResource: return InvestigateResource(self._client) + @cached_property + def phishguard(self) -> PhishguardResource: + return PhishguardResource(self._client) + @cached_property def settings(self) -> SettingsResource: return SettingsResource(self._client) @@ -70,6 +82,10 @@ class AsyncEmailSecurityResource(AsyncAPIResource): def investigate(self) -> AsyncInvestigateResource: return AsyncInvestigateResource(self._client) + @cached_property + def phishguard(self) -> AsyncPhishguardResource: + return AsyncPhishguardResource(self._client) + @cached_property def settings(self) -> AsyncSettingsResource: return AsyncSettingsResource(self._client) @@ -106,6 +122,10 @@ def __init__(self, email_security: EmailSecurityResource) -> None: def investigate(self) -> InvestigateResourceWithRawResponse: return InvestigateResourceWithRawResponse(self._email_security.investigate) + @cached_property + def phishguard(self) -> PhishguardResourceWithRawResponse: + return PhishguardResourceWithRawResponse(self._email_security.phishguard) + @cached_property def settings(self) -> SettingsResourceWithRawResponse: return SettingsResourceWithRawResponse(self._email_security.settings) @@ -123,6 +143,10 @@ def __init__(self, email_security: AsyncEmailSecurityResource) -> None: def investigate(self) -> AsyncInvestigateResourceWithRawResponse: return AsyncInvestigateResourceWithRawResponse(self._email_security.investigate) + @cached_property + def phishguard(self) -> AsyncPhishguardResourceWithRawResponse: + return AsyncPhishguardResourceWithRawResponse(self._email_security.phishguard) + @cached_property def settings(self) -> AsyncSettingsResourceWithRawResponse: return AsyncSettingsResourceWithRawResponse(self._email_security.settings) @@ -140,6 +164,10 @@ def __init__(self, email_security: EmailSecurityResource) -> None: def investigate(self) -> InvestigateResourceWithStreamingResponse: return InvestigateResourceWithStreamingResponse(self._email_security.investigate) + @cached_property + def phishguard(self) -> PhishguardResourceWithStreamingResponse: + return PhishguardResourceWithStreamingResponse(self._email_security.phishguard) + @cached_property def settings(self) -> SettingsResourceWithStreamingResponse: return SettingsResourceWithStreamingResponse(self._email_security.settings) @@ -157,6 +185,10 @@ def __init__(self, email_security: AsyncEmailSecurityResource) -> None: def investigate(self) -> AsyncInvestigateResourceWithStreamingResponse: return AsyncInvestigateResourceWithStreamingResponse(self._email_security.investigate) + @cached_property + def phishguard(self) -> AsyncPhishguardResourceWithStreamingResponse: + return AsyncPhishguardResourceWithStreamingResponse(self._email_security.phishguard) + @cached_property def settings(self) -> AsyncSettingsResourceWithStreamingResponse: return AsyncSettingsResourceWithStreamingResponse(self._email_security.settings) diff --git a/src/cloudflare/resources/email_security/phishguard/__init__.py b/src/cloudflare/resources/email_security/phishguard/__init__.py new file mode 100644 index 00000000000..ee970b25eb1 --- /dev/null +++ b/src/cloudflare/resources/email_security/phishguard/__init__.py @@ -0,0 +1,33 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from .reports import ( + ReportsResource, + AsyncReportsResource, + ReportsResourceWithRawResponse, + AsyncReportsResourceWithRawResponse, + ReportsResourceWithStreamingResponse, + AsyncReportsResourceWithStreamingResponse, +) +from .phishguard import ( + PhishguardResource, + AsyncPhishguardResource, + PhishguardResourceWithRawResponse, + AsyncPhishguardResourceWithRawResponse, + PhishguardResourceWithStreamingResponse, + AsyncPhishguardResourceWithStreamingResponse, +) + +__all__ = [ + "ReportsResource", + "AsyncReportsResource", + "ReportsResourceWithRawResponse", + "AsyncReportsResourceWithRawResponse", + "ReportsResourceWithStreamingResponse", + "AsyncReportsResourceWithStreamingResponse", + "PhishguardResource", + "AsyncPhishguardResource", + "PhishguardResourceWithRawResponse", + "AsyncPhishguardResourceWithRawResponse", + "PhishguardResourceWithStreamingResponse", + "AsyncPhishguardResourceWithStreamingResponse", +] diff --git a/src/cloudflare/resources/email_security/phishguard/phishguard.py b/src/cloudflare/resources/email_security/phishguard/phishguard.py new file mode 100644 index 00000000000..2b2e99a5db5 --- /dev/null +++ b/src/cloudflare/resources/email_security/phishguard/phishguard.py @@ -0,0 +1,102 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from .reports import ( + ReportsResource, + AsyncReportsResource, + ReportsResourceWithRawResponse, + AsyncReportsResourceWithRawResponse, + ReportsResourceWithStreamingResponse, + AsyncReportsResourceWithStreamingResponse, +) +from ...._compat import cached_property +from ...._resource import SyncAPIResource, AsyncAPIResource + +__all__ = ["PhishguardResource", "AsyncPhishguardResource"] + + +class PhishguardResource(SyncAPIResource): + @cached_property + def reports(self) -> ReportsResource: + return ReportsResource(self._client) + + @cached_property + def with_raw_response(self) -> PhishguardResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers + """ + return PhishguardResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> PhishguardResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/cloudflare/cloudflare-python#with_streaming_response + """ + return PhishguardResourceWithStreamingResponse(self) + + +class AsyncPhishguardResource(AsyncAPIResource): + @cached_property + def reports(self) -> AsyncReportsResource: + return AsyncReportsResource(self._client) + + @cached_property + def with_raw_response(self) -> AsyncPhishguardResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers + """ + return AsyncPhishguardResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> AsyncPhishguardResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/cloudflare/cloudflare-python#with_streaming_response + """ + return AsyncPhishguardResourceWithStreamingResponse(self) + + +class PhishguardResourceWithRawResponse: + def __init__(self, phishguard: PhishguardResource) -> None: + self._phishguard = phishguard + + @cached_property + def reports(self) -> ReportsResourceWithRawResponse: + return ReportsResourceWithRawResponse(self._phishguard.reports) + + +class AsyncPhishguardResourceWithRawResponse: + def __init__(self, phishguard: AsyncPhishguardResource) -> None: + self._phishguard = phishguard + + @cached_property + def reports(self) -> AsyncReportsResourceWithRawResponse: + return AsyncReportsResourceWithRawResponse(self._phishguard.reports) + + +class PhishguardResourceWithStreamingResponse: + def __init__(self, phishguard: PhishguardResource) -> None: + self._phishguard = phishguard + + @cached_property + def reports(self) -> ReportsResourceWithStreamingResponse: + return ReportsResourceWithStreamingResponse(self._phishguard.reports) + + +class AsyncPhishguardResourceWithStreamingResponse: + def __init__(self, phishguard: AsyncPhishguardResource) -> None: + self._phishguard = phishguard + + @cached_property + def reports(self) -> AsyncReportsResourceWithStreamingResponse: + return AsyncReportsResourceWithStreamingResponse(self._phishguard.reports) diff --git a/src/cloudflare/resources/email_security/phishguard/reports.py b/src/cloudflare/resources/email_security/phishguard/reports.py new file mode 100644 index 00000000000..880fe8397f2 --- /dev/null +++ b/src/cloudflare/resources/email_security/phishguard/reports.py @@ -0,0 +1,215 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Union +from datetime import date, datetime + +import httpx + +from ...._types import Body, Omit, Query, Headers, NotGiven, omit, not_given +from ...._utils import maybe_transform +from ...._compat import cached_property +from ...._resource import SyncAPIResource, AsyncAPIResource +from ...._response import ( + to_raw_response_wrapper, + to_streamed_response_wrapper, + async_to_raw_response_wrapper, + async_to_streamed_response_wrapper, +) +from ....pagination import SyncSinglePage, AsyncSinglePage +from ...._base_client import AsyncPaginator, make_request_options +from ....types.email_security.phishguard import report_list_params +from ....types.email_security.phishguard.report_list_response import ReportListResponse + +__all__ = ["ReportsResource", "AsyncReportsResource"] + + +class ReportsResource(SyncAPIResource): + @cached_property + def with_raw_response(self) -> ReportsResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers + """ + return ReportsResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> ReportsResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/cloudflare/cloudflare-python#with_streaming_response + """ + return ReportsResourceWithStreamingResponse(self) + + def list( + self, + *, + account_id: str, + end: Union[str, datetime] | Omit = omit, + from_date: Union[str, date] | Omit = omit, + start: Union[str, datetime] | Omit = omit, + to_date: Union[str, date] | 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, + ) -> SyncSinglePage[ReportListResponse]: + """ + Get `PhishGuard` reports + + Args: + account_id: Account Identifier + + end: The end of the search date range (RFC3339 format). + + start: The beginning of the search date range (RFC3339 format). + + 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( + f"/accounts/{account_id}/email-security/phishguard/reports", + page=SyncSinglePage[ReportListResponse], + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=maybe_transform( + { + "end": end, + "from_date": from_date, + "start": start, + "to_date": to_date, + }, + report_list_params.ReportListParams, + ), + ), + model=ReportListResponse, + ) + + +class AsyncReportsResource(AsyncAPIResource): + @cached_property + def with_raw_response(self) -> AsyncReportsResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers + """ + return AsyncReportsResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> AsyncReportsResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/cloudflare/cloudflare-python#with_streaming_response + """ + return AsyncReportsResourceWithStreamingResponse(self) + + def list( + self, + *, + account_id: str, + end: Union[str, datetime] | Omit = omit, + from_date: Union[str, date] | Omit = omit, + start: Union[str, datetime] | Omit = omit, + to_date: Union[str, date] | 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, + ) -> AsyncPaginator[ReportListResponse, AsyncSinglePage[ReportListResponse]]: + """ + Get `PhishGuard` reports + + Args: + account_id: Account Identifier + + end: The end of the search date range (RFC3339 format). + + start: The beginning of the search date range (RFC3339 format). + + 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( + f"/accounts/{account_id}/email-security/phishguard/reports", + page=AsyncSinglePage[ReportListResponse], + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=maybe_transform( + { + "end": end, + "from_date": from_date, + "start": start, + "to_date": to_date, + }, + report_list_params.ReportListParams, + ), + ), + model=ReportListResponse, + ) + + +class ReportsResourceWithRawResponse: + def __init__(self, reports: ReportsResource) -> None: + self._reports = reports + + self.list = to_raw_response_wrapper( + reports.list, + ) + + +class AsyncReportsResourceWithRawResponse: + def __init__(self, reports: AsyncReportsResource) -> None: + self._reports = reports + + self.list = async_to_raw_response_wrapper( + reports.list, + ) + + +class ReportsResourceWithStreamingResponse: + def __init__(self, reports: ReportsResource) -> None: + self._reports = reports + + self.list = to_streamed_response_wrapper( + reports.list, + ) + + +class AsyncReportsResourceWithStreamingResponse: + def __init__(self, reports: AsyncReportsResource) -> None: + self._reports = reports + + self.list = async_to_streamed_response_wrapper( + reports.list, + ) diff --git a/src/cloudflare/types/email_security/phishguard/__init__.py b/src/cloudflare/types/email_security/phishguard/__init__.py new file mode 100644 index 00000000000..884bcc397d5 --- /dev/null +++ b/src/cloudflare/types/email_security/phishguard/__init__.py @@ -0,0 +1,6 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from .report_list_params import ReportListParams as ReportListParams +from .report_list_response import ReportListResponse as ReportListResponse diff --git a/src/cloudflare/types/email_security/phishguard/report_list_params.py b/src/cloudflare/types/email_security/phishguard/report_list_params.py new file mode 100644 index 00000000000..d138ab6e96c --- /dev/null +++ b/src/cloudflare/types/email_security/phishguard/report_list_params.py @@ -0,0 +1,26 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Union +from datetime import date, datetime +from typing_extensions import Required, Annotated, TypedDict + +from ...._utils import PropertyInfo + +__all__ = ["ReportListParams"] + + +class ReportListParams(TypedDict, total=False): + account_id: Required[str] + """Account Identifier""" + + end: Annotated[Union[str, datetime], PropertyInfo(format="iso8601")] + """The end of the search date range (RFC3339 format).""" + + from_date: Annotated[Union[str, date], PropertyInfo(format="iso8601")] + + start: Annotated[Union[str, datetime], PropertyInfo(format="iso8601")] + """The beginning of the search date range (RFC3339 format).""" + + to_date: Annotated[Union[str, date], PropertyInfo(format="iso8601")] diff --git a/src/cloudflare/types/email_security/phishguard/report_list_response.py b/src/cloudflare/types/email_security/phishguard/report_list_response.py new file mode 100644 index 00000000000..2f8b6b21cf2 --- /dev/null +++ b/src/cloudflare/types/email_security/phishguard/report_list_response.py @@ -0,0 +1,51 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional +from datetime import datetime +from typing_extensions import Literal + +from pydantic import Field as FieldInfo + +from ...._models import BaseModel + +__all__ = ["ReportListResponse", "Fields", "Tag"] + + +class Fields(BaseModel): + to: List[str] + + ts: datetime + + from_: Optional[str] = FieldInfo(alias="from", default=None) + + postfix_id: Optional[str] = None + + +class Tag(BaseModel): + category: str + + value: str + + +class ReportListResponse(BaseModel): + id: int + + content: str + + created_at: datetime + + disposition: Literal[ + "MALICIOUS", "MALICIOUS-BEC", "SUSPICIOUS", "SPOOF", "SPAM", "BULK", "ENCRYPTED", "EXTERNAL", "UNKNOWN", "NONE" + ] + + fields: Fields + + priority: str + + title: str + + ts: datetime + + updated_at: datetime + + tags: Optional[List[Tag]] = None diff --git a/tests/api_resources/email_security/phishguard/__init__.py b/tests/api_resources/email_security/phishguard/__init__.py new file mode 100644 index 00000000000..fd8019a9a1a --- /dev/null +++ b/tests/api_resources/email_security/phishguard/__init__.py @@ -0,0 +1 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. diff --git a/tests/api_resources/email_security/phishguard/test_reports.py b/tests/api_resources/email_security/phishguard/test_reports.py new file mode 100644 index 00000000000..da4c9544f3a --- /dev/null +++ b/tests/api_resources/email_security/phishguard/test_reports.py @@ -0,0 +1,124 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +import os +from typing import Any, cast + +import pytest + +from cloudflare import Cloudflare, AsyncCloudflare +from tests.utils import assert_matches_type +from cloudflare._utils import parse_date, parse_datetime +from cloudflare.pagination import SyncSinglePage, AsyncSinglePage +from cloudflare.types.email_security.phishguard import ReportListResponse + +base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") + + +class TestReports: + parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) + + @parametrize + def test_method_list(self, client: Cloudflare) -> None: + report = client.email_security.phishguard.reports.list( + account_id="023e105f4ecef8ad9ca31a8372d0c353", + ) + assert_matches_type(SyncSinglePage[ReportListResponse], report, path=["response"]) + + @parametrize + def test_method_list_with_all_params(self, client: Cloudflare) -> None: + report = client.email_security.phishguard.reports.list( + account_id="023e105f4ecef8ad9ca31a8372d0c353", + end=parse_datetime("2019-12-27T18:11:19.117Z"), + from_date=parse_date("2019-12-27"), + start=parse_datetime("2019-12-27T18:11:19.117Z"), + to_date=parse_date("2019-12-27"), + ) + assert_matches_type(SyncSinglePage[ReportListResponse], report, path=["response"]) + + @parametrize + def test_raw_response_list(self, client: Cloudflare) -> None: + response = client.email_security.phishguard.reports.with_raw_response.list( + account_id="023e105f4ecef8ad9ca31a8372d0c353", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + report = response.parse() + assert_matches_type(SyncSinglePage[ReportListResponse], report, path=["response"]) + + @parametrize + def test_streaming_response_list(self, client: Cloudflare) -> None: + with client.email_security.phishguard.reports.with_streaming_response.list( + account_id="023e105f4ecef8ad9ca31a8372d0c353", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + report = response.parse() + assert_matches_type(SyncSinglePage[ReportListResponse], report, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_list(self, client: Cloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + client.email_security.phishguard.reports.with_raw_response.list( + account_id="", + ) + + +class TestAsyncReports: + parametrize = pytest.mark.parametrize( + "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"] + ) + + @parametrize + async def test_method_list(self, async_client: AsyncCloudflare) -> None: + report = await async_client.email_security.phishguard.reports.list( + account_id="023e105f4ecef8ad9ca31a8372d0c353", + ) + assert_matches_type(AsyncSinglePage[ReportListResponse], report, path=["response"]) + + @parametrize + async def test_method_list_with_all_params(self, async_client: AsyncCloudflare) -> None: + report = await async_client.email_security.phishguard.reports.list( + account_id="023e105f4ecef8ad9ca31a8372d0c353", + end=parse_datetime("2019-12-27T18:11:19.117Z"), + from_date=parse_date("2019-12-27"), + start=parse_datetime("2019-12-27T18:11:19.117Z"), + to_date=parse_date("2019-12-27"), + ) + assert_matches_type(AsyncSinglePage[ReportListResponse], report, path=["response"]) + + @parametrize + async def test_raw_response_list(self, async_client: AsyncCloudflare) -> None: + response = await async_client.email_security.phishguard.reports.with_raw_response.list( + account_id="023e105f4ecef8ad9ca31a8372d0c353", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + report = await response.parse() + assert_matches_type(AsyncSinglePage[ReportListResponse], report, path=["response"]) + + @parametrize + async def test_streaming_response_list(self, async_client: AsyncCloudflare) -> None: + async with async_client.email_security.phishguard.reports.with_streaming_response.list( + account_id="023e105f4ecef8ad9ca31a8372d0c353", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + report = await response.parse() + assert_matches_type(AsyncSinglePage[ReportListResponse], report, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_list(self, async_client: AsyncCloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + await async_client.email_security.phishguard.reports.with_raw_response.list( + account_id="", + ) From 3f5cf39405b6b38fc594ce348d93a6e7da92c276 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 25 Feb 2026 23:24:59 +0000 Subject: [PATCH 039/279] feat: fix: broken reference for the queues 'consumer' model --- .stats.yml | 2 +- api.md | 16 +-- src/cloudflare/resources/queues/consumers.py | 81 +++++++------- src/cloudflare/types/queues/__init__.py | 5 +- .../{consumer_get_response.py => consumer.py} | 4 +- .../types/queues/consumer_create_response.py | 102 ----------------- .../types/queues/consumer_list_response.py | 102 ----------------- .../types/queues/consumer_update_response.py | 102 ----------------- src/cloudflare/types/queues/queue.py | 104 +----------------- tests/api_resources/queues/test_consumers.py | 96 ++++++++-------- 10 files changed, 96 insertions(+), 518 deletions(-) rename src/cloudflare/types/queues/{consumer_get_response.py => consumer.py} (97%) delete mode 100644 src/cloudflare/types/queues/consumer_create_response.py delete mode 100644 src/cloudflare/types/queues/consumer_list_response.py delete mode 100644 src/cloudflare/types/queues/consumer_update_response.py diff --git a/.stats.yml b/.stats.yml index 98f9859157a..0b21ce70104 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 2037 openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-9ba099b7936091cc984d2a24fc4d32c3ffcb1d71d86412c8c9084d201e16b3ac.yml openapi_spec_hash: 45edc9a107cf5a5e3b204b230b0d336d -config_hash: ff14fec6c5fcb182b433bbc41609608b +config_hash: e3be580c8a7e39157925fab6ac9dd3ad diff --git a/api.md b/api.md index 7b709567bd9..7bb3f9cf49d 100644 --- a/api.md +++ b/api.md @@ -2805,22 +2805,16 @@ Methods: Types: ```python -from cloudflare.types.queues import ( - ConsumerCreateResponse, - ConsumerUpdateResponse, - ConsumerListResponse, - ConsumerDeleteResponse, - ConsumerGetResponse, -) +from cloudflare.types.queues import Consumer, ConsumerDeleteResponse ``` Methods: -- client.queues.consumers.create(queue_id, \*, account_id, \*\*params) -> Optional[ConsumerCreateResponse] -- client.queues.consumers.update(consumer_id, \*, account_id, queue_id, \*\*params) -> Optional[ConsumerUpdateResponse] -- client.queues.consumers.list(queue_id, \*, account_id) -> SyncSinglePage[ConsumerListResponse] +- client.queues.consumers.create(queue_id, \*, account_id, \*\*params) -> Optional[Consumer] +- client.queues.consumers.update(consumer_id, \*, account_id, queue_id, \*\*params) -> Optional[Consumer] +- client.queues.consumers.list(queue_id, \*, account_id) -> SyncSinglePage[Consumer] - client.queues.consumers.delete(consumer_id, \*, account_id, queue_id) -> ConsumerDeleteResponse -- client.queues.consumers.get(consumer_id, \*, account_id, queue_id) -> Optional[ConsumerGetResponse] +- client.queues.consumers.get(consumer_id, \*, account_id, queue_id) -> Optional[Consumer] ## Subscriptions diff --git a/src/cloudflare/resources/queues/consumers.py b/src/cloudflare/resources/queues/consumers.py index 8bd97a1f72d..109a2646d75 100644 --- a/src/cloudflare/resources/queues/consumers.py +++ b/src/cloudflare/resources/queues/consumers.py @@ -21,11 +21,8 @@ from ...pagination import SyncSinglePage, AsyncSinglePage from ..._base_client import AsyncPaginator, make_request_options from ...types.queues import consumer_create_params, consumer_update_params -from ...types.queues.consumer_get_response import ConsumerGetResponse -from ...types.queues.consumer_list_response import ConsumerListResponse -from ...types.queues.consumer_create_response import ConsumerCreateResponse +from ...types.queues.consumer import Consumer from ...types.queues.consumer_delete_response import ConsumerDeleteResponse -from ...types.queues.consumer_update_response import ConsumerUpdateResponse __all__ = ["ConsumersResource", "AsyncConsumersResource"] @@ -66,7 +63,7 @@ def create( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, - ) -> Optional[ConsumerCreateResponse]: + ) -> Optional[Consumer]: """ Creates a new consumer for a Queue @@ -102,7 +99,7 @@ def create( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, - ) -> Optional[ConsumerCreateResponse]: + ) -> Optional[Consumer]: """ Creates a new consumer for a Queue @@ -139,13 +136,13 @@ def create( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, - ) -> Optional[ConsumerCreateResponse]: + ) -> Optional[Consumer]: 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 cast( - Optional[ConsumerCreateResponse], + Optional[Consumer], self._post( f"/accounts/{account_id}/queues/{queue_id}/consumers", body=maybe_transform( @@ -162,10 +159,10 @@ def create( extra_query=extra_query, extra_body=extra_body, timeout=timeout, - post_parser=ResultWrapper[Optional[ConsumerCreateResponse]]._unwrapper, + post_parser=ResultWrapper[Optional[Consumer]]._unwrapper, ), cast_to=cast( - Any, ResultWrapper[ConsumerCreateResponse] + Any, ResultWrapper[Consumer] ), # Union types cannot be passed in as arguments in the type system ), ) @@ -187,7 +184,7 @@ def update( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, - ) -> Optional[ConsumerUpdateResponse]: + ) -> Optional[Consumer]: """ Updates the consumer for a queue, or creates one if it does not exist. @@ -226,7 +223,7 @@ def update( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, - ) -> Optional[ConsumerUpdateResponse]: + ) -> Optional[Consumer]: """ Updates the consumer for a queue, or creates one if it does not exist. @@ -266,7 +263,7 @@ def update( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, - ) -> Optional[ConsumerUpdateResponse]: + ) -> Optional[Consumer]: if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not queue_id: @@ -274,7 +271,7 @@ def update( if not consumer_id: raise ValueError(f"Expected a non-empty value for `consumer_id` but received {consumer_id!r}") return cast( - Optional[ConsumerUpdateResponse], + Optional[Consumer], self._put( f"/accounts/{account_id}/queues/{queue_id}/consumers/{consumer_id}", body=maybe_transform( @@ -291,10 +288,10 @@ def update( extra_query=extra_query, extra_body=extra_body, timeout=timeout, - post_parser=ResultWrapper[Optional[ConsumerUpdateResponse]]._unwrapper, + post_parser=ResultWrapper[Optional[Consumer]]._unwrapper, ), cast_to=cast( - Any, ResultWrapper[ConsumerUpdateResponse] + Any, ResultWrapper[Consumer] ), # Union types cannot be passed in as arguments in the type system ), ) @@ -310,7 +307,7 @@ def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, - ) -> SyncSinglePage[ConsumerListResponse]: + ) -> SyncSinglePage[Consumer]: """ Returns the consumers for a Queue @@ -333,11 +330,11 @@ def list( raise ValueError(f"Expected a non-empty value for `queue_id` but received {queue_id!r}") return self._get_api_list( f"/accounts/{account_id}/queues/{queue_id}/consumers", - page=SyncSinglePage[ConsumerListResponse], + page=SyncSinglePage[Consumer], options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - model=cast(Any, ConsumerListResponse), # Union types cannot be passed in as arguments in the type system + model=cast(Any, Consumer), # Union types cannot be passed in as arguments in the type system ) def delete( @@ -397,7 +394,7 @@ def get( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, - ) -> Optional[ConsumerGetResponse]: + ) -> Optional[Consumer]: """ Fetches the consumer for a queue by consumer id @@ -423,7 +420,7 @@ def get( if not consumer_id: raise ValueError(f"Expected a non-empty value for `consumer_id` but received {consumer_id!r}") return cast( - Optional[ConsumerGetResponse], + Optional[Consumer], self._get( f"/accounts/{account_id}/queues/{queue_id}/consumers/{consumer_id}", options=make_request_options( @@ -431,10 +428,10 @@ def get( extra_query=extra_query, extra_body=extra_body, timeout=timeout, - post_parser=ResultWrapper[Optional[ConsumerGetResponse]]._unwrapper, + post_parser=ResultWrapper[Optional[Consumer]]._unwrapper, ), cast_to=cast( - Any, ResultWrapper[ConsumerGetResponse] + Any, ResultWrapper[Consumer] ), # Union types cannot be passed in as arguments in the type system ), ) @@ -476,7 +473,7 @@ async def create( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, - ) -> Optional[ConsumerCreateResponse]: + ) -> Optional[Consumer]: """ Creates a new consumer for a Queue @@ -512,7 +509,7 @@ async def create( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, - ) -> Optional[ConsumerCreateResponse]: + ) -> Optional[Consumer]: """ Creates a new consumer for a Queue @@ -549,13 +546,13 @@ async def create( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, - ) -> Optional[ConsumerCreateResponse]: + ) -> Optional[Consumer]: 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 cast( - Optional[ConsumerCreateResponse], + Optional[Consumer], await self._post( f"/accounts/{account_id}/queues/{queue_id}/consumers", body=await async_maybe_transform( @@ -572,10 +569,10 @@ async def create( extra_query=extra_query, extra_body=extra_body, timeout=timeout, - post_parser=ResultWrapper[Optional[ConsumerCreateResponse]]._unwrapper, + post_parser=ResultWrapper[Optional[Consumer]]._unwrapper, ), cast_to=cast( - Any, ResultWrapper[ConsumerCreateResponse] + Any, ResultWrapper[Consumer] ), # Union types cannot be passed in as arguments in the type system ), ) @@ -597,7 +594,7 @@ async def update( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, - ) -> Optional[ConsumerUpdateResponse]: + ) -> Optional[Consumer]: """ Updates the consumer for a queue, or creates one if it does not exist. @@ -636,7 +633,7 @@ async def update( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, - ) -> Optional[ConsumerUpdateResponse]: + ) -> Optional[Consumer]: """ Updates the consumer for a queue, or creates one if it does not exist. @@ -676,7 +673,7 @@ async def update( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, - ) -> Optional[ConsumerUpdateResponse]: + ) -> Optional[Consumer]: if not account_id: raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") if not queue_id: @@ -684,7 +681,7 @@ async def update( if not consumer_id: raise ValueError(f"Expected a non-empty value for `consumer_id` but received {consumer_id!r}") return cast( - Optional[ConsumerUpdateResponse], + Optional[Consumer], await self._put( f"/accounts/{account_id}/queues/{queue_id}/consumers/{consumer_id}", body=await async_maybe_transform( @@ -701,10 +698,10 @@ async def update( extra_query=extra_query, extra_body=extra_body, timeout=timeout, - post_parser=ResultWrapper[Optional[ConsumerUpdateResponse]]._unwrapper, + post_parser=ResultWrapper[Optional[Consumer]]._unwrapper, ), cast_to=cast( - Any, ResultWrapper[ConsumerUpdateResponse] + Any, ResultWrapper[Consumer] ), # Union types cannot be passed in as arguments in the type system ), ) @@ -720,7 +717,7 @@ def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, - ) -> AsyncPaginator[ConsumerListResponse, AsyncSinglePage[ConsumerListResponse]]: + ) -> AsyncPaginator[Consumer, AsyncSinglePage[Consumer]]: """ Returns the consumers for a Queue @@ -743,11 +740,11 @@ def list( raise ValueError(f"Expected a non-empty value for `queue_id` but received {queue_id!r}") return self._get_api_list( f"/accounts/{account_id}/queues/{queue_id}/consumers", - page=AsyncSinglePage[ConsumerListResponse], + page=AsyncSinglePage[Consumer], options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - model=cast(Any, ConsumerListResponse), # Union types cannot be passed in as arguments in the type system + model=cast(Any, Consumer), # Union types cannot be passed in as arguments in the type system ) async def delete( @@ -807,7 +804,7 @@ async def get( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, - ) -> Optional[ConsumerGetResponse]: + ) -> Optional[Consumer]: """ Fetches the consumer for a queue by consumer id @@ -833,7 +830,7 @@ async def get( if not consumer_id: raise ValueError(f"Expected a non-empty value for `consumer_id` but received {consumer_id!r}") return cast( - Optional[ConsumerGetResponse], + Optional[Consumer], await self._get( f"/accounts/{account_id}/queues/{queue_id}/consumers/{consumer_id}", options=make_request_options( @@ -841,10 +838,10 @@ async def get( extra_query=extra_query, extra_body=extra_body, timeout=timeout, - post_parser=ResultWrapper[Optional[ConsumerGetResponse]]._unwrapper, + post_parser=ResultWrapper[Optional[Consumer]]._unwrapper, ), cast_to=cast( - Any, ResultWrapper[ConsumerGetResponse] + Any, ResultWrapper[Consumer] ), # Union types cannot be passed in as arguments in the type system ), ) diff --git a/src/cloudflare/types/queues/__init__.py b/src/cloudflare/types/queues/__init__.py index 422b48fbad6..2d25382356d 100644 --- a/src/cloudflare/types/queues/__init__.py +++ b/src/cloudflare/types/queues/__init__.py @@ -3,6 +3,7 @@ from __future__ import annotations from .queue import Queue as Queue +from .consumer import Consumer as Consumer from .queue_edit_params import QueueEditParams as QueueEditParams from .message_ack_params import MessageAckParams as MessageAckParams from .purge_start_params import PurgeStartParams as PurgeStartParams @@ -11,17 +12,13 @@ from .queue_create_params import QueueCreateParams as QueueCreateParams from .queue_update_params import QueueUpdateParams as QueueUpdateParams from .message_ack_response import MessageAckResponse as MessageAckResponse -from .consumer_get_response import ConsumerGetResponse as ConsumerGetResponse from .message_pull_response import MessagePullResponse as MessagePullResponse from .message_push_response import MessagePushResponse as MessagePushResponse from .purge_status_response import PurgeStatusResponse as PurgeStatusResponse from .queue_delete_response import QueueDeleteResponse as QueueDeleteResponse from .consumer_create_params import ConsumerCreateParams as ConsumerCreateParams -from .consumer_list_response import ConsumerListResponse as ConsumerListResponse from .consumer_update_params import ConsumerUpdateParams as ConsumerUpdateParams -from .consumer_create_response import ConsumerCreateResponse as ConsumerCreateResponse from .consumer_delete_response import ConsumerDeleteResponse as ConsumerDeleteResponse -from .consumer_update_response import ConsumerUpdateResponse as ConsumerUpdateResponse from .message_bulk_push_params import MessageBulkPushParams as MessageBulkPushParams from .subscription_list_params import SubscriptionListParams as SubscriptionListParams from .subscription_get_response import SubscriptionGetResponse as SubscriptionGetResponse diff --git a/src/cloudflare/types/queues/consumer_get_response.py b/src/cloudflare/types/queues/consumer.py similarity index 97% rename from src/cloudflare/types/queues/consumer_get_response.py rename to src/cloudflare/types/queues/consumer.py index 7e71f34fa48..53956c9c689 100644 --- a/src/cloudflare/types/queues/consumer_get_response.py +++ b/src/cloudflare/types/queues/consumer.py @@ -8,7 +8,7 @@ from ..._models import BaseModel __all__ = [ - "ConsumerGetResponse", + "Consumer", "MqWorkerConsumerResponse", "MqWorkerConsumerResponseSettings", "MqHTTPConsumerResponse", @@ -97,6 +97,6 @@ class MqHTTPConsumerResponse(BaseModel): type: Optional[Literal["http_pull"]] = None -ConsumerGetResponse: TypeAlias = Annotated[ +Consumer: TypeAlias = Annotated[ Union[MqWorkerConsumerResponse, MqHTTPConsumerResponse], PropertyInfo(discriminator="type") ] diff --git a/src/cloudflare/types/queues/consumer_create_response.py b/src/cloudflare/types/queues/consumer_create_response.py deleted file mode 100644 index d72756d1a80..00000000000 --- a/src/cloudflare/types/queues/consumer_create_response.py +++ /dev/null @@ -1,102 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Union, Optional -from datetime import datetime -from typing_extensions import Literal, Annotated, TypeAlias - -from ..._utils import PropertyInfo -from ..._models import BaseModel - -__all__ = [ - "ConsumerCreateResponse", - "MqWorkerConsumerResponse", - "MqWorkerConsumerResponseSettings", - "MqHTTPConsumerResponse", - "MqHTTPConsumerResponseSettings", -] - - -class MqWorkerConsumerResponseSettings(BaseModel): - batch_size: Optional[float] = None - """The maximum number of messages to include in a batch.""" - - max_concurrency: Optional[float] = None - """Maximum number of concurrent consumers that may consume from this Queue. - - Set to `null` to automatically opt in to the platform's maximum (recommended). - """ - - max_retries: Optional[float] = None - """The maximum number of retries""" - - max_wait_time_ms: Optional[float] = None - """ - The number of milliseconds to wait for a batch to fill up before attempting to - deliver it - """ - - retry_delay: Optional[float] = None - """ - The number of seconds to delay before making the message available for another - attempt. - """ - - -class MqWorkerConsumerResponse(BaseModel): - consumer_id: Optional[str] = None - """A Resource identifier.""" - - created_on: Optional[datetime] = None - - dead_letter_queue: Optional[str] = None - """Name of the dead letter queue, or empty string if not configured""" - - queue_name: Optional[str] = None - - script_name: Optional[str] = None - """Name of a Worker""" - - settings: Optional[MqWorkerConsumerResponseSettings] = None - - type: Optional[Literal["worker"]] = None - - -class MqHTTPConsumerResponseSettings(BaseModel): - batch_size: Optional[float] = None - """The maximum number of messages to include in a batch.""" - - max_retries: Optional[float] = None - """The maximum number of retries""" - - retry_delay: Optional[float] = None - """ - The number of seconds to delay before making the message available for another - attempt. - """ - - visibility_timeout_ms: Optional[float] = None - """The number of milliseconds that a message is exclusively leased. - - After the timeout, the message becomes available for another attempt. - """ - - -class MqHTTPConsumerResponse(BaseModel): - consumer_id: Optional[str] = None - """A Resource identifier.""" - - created_on: Optional[datetime] = None - - dead_letter_queue: Optional[str] = None - """Name of the dead letter queue, or empty string if not configured""" - - queue_name: Optional[str] = None - - settings: Optional[MqHTTPConsumerResponseSettings] = None - - type: Optional[Literal["http_pull"]] = None - - -ConsumerCreateResponse: TypeAlias = Annotated[ - Union[MqWorkerConsumerResponse, MqHTTPConsumerResponse], PropertyInfo(discriminator="type") -] diff --git a/src/cloudflare/types/queues/consumer_list_response.py b/src/cloudflare/types/queues/consumer_list_response.py deleted file mode 100644 index 3e2a54834f7..00000000000 --- a/src/cloudflare/types/queues/consumer_list_response.py +++ /dev/null @@ -1,102 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Union, Optional -from datetime import datetime -from typing_extensions import Literal, Annotated, TypeAlias - -from ..._utils import PropertyInfo -from ..._models import BaseModel - -__all__ = [ - "ConsumerListResponse", - "MqWorkerConsumerResponse", - "MqWorkerConsumerResponseSettings", - "MqHTTPConsumerResponse", - "MqHTTPConsumerResponseSettings", -] - - -class MqWorkerConsumerResponseSettings(BaseModel): - batch_size: Optional[float] = None - """The maximum number of messages to include in a batch.""" - - max_concurrency: Optional[float] = None - """Maximum number of concurrent consumers that may consume from this Queue. - - Set to `null` to automatically opt in to the platform's maximum (recommended). - """ - - max_retries: Optional[float] = None - """The maximum number of retries""" - - max_wait_time_ms: Optional[float] = None - """ - The number of milliseconds to wait for a batch to fill up before attempting to - deliver it - """ - - retry_delay: Optional[float] = None - """ - The number of seconds to delay before making the message available for another - attempt. - """ - - -class MqWorkerConsumerResponse(BaseModel): - consumer_id: Optional[str] = None - """A Resource identifier.""" - - created_on: Optional[datetime] = None - - dead_letter_queue: Optional[str] = None - """Name of the dead letter queue, or empty string if not configured""" - - queue_name: Optional[str] = None - - script_name: Optional[str] = None - """Name of a Worker""" - - settings: Optional[MqWorkerConsumerResponseSettings] = None - - type: Optional[Literal["worker"]] = None - - -class MqHTTPConsumerResponseSettings(BaseModel): - batch_size: Optional[float] = None - """The maximum number of messages to include in a batch.""" - - max_retries: Optional[float] = None - """The maximum number of retries""" - - retry_delay: Optional[float] = None - """ - The number of seconds to delay before making the message available for another - attempt. - """ - - visibility_timeout_ms: Optional[float] = None - """The number of milliseconds that a message is exclusively leased. - - After the timeout, the message becomes available for another attempt. - """ - - -class MqHTTPConsumerResponse(BaseModel): - consumer_id: Optional[str] = None - """A Resource identifier.""" - - created_on: Optional[datetime] = None - - dead_letter_queue: Optional[str] = None - """Name of the dead letter queue, or empty string if not configured""" - - queue_name: Optional[str] = None - - settings: Optional[MqHTTPConsumerResponseSettings] = None - - type: Optional[Literal["http_pull"]] = None - - -ConsumerListResponse: TypeAlias = Annotated[ - Union[MqWorkerConsumerResponse, MqHTTPConsumerResponse], PropertyInfo(discriminator="type") -] diff --git a/src/cloudflare/types/queues/consumer_update_response.py b/src/cloudflare/types/queues/consumer_update_response.py deleted file mode 100644 index fb09236fdf5..00000000000 --- a/src/cloudflare/types/queues/consumer_update_response.py +++ /dev/null @@ -1,102 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Union, Optional -from datetime import datetime -from typing_extensions import Literal, Annotated, TypeAlias - -from ..._utils import PropertyInfo -from ..._models import BaseModel - -__all__ = [ - "ConsumerUpdateResponse", - "MqWorkerConsumerResponse", - "MqWorkerConsumerResponseSettings", - "MqHTTPConsumerResponse", - "MqHTTPConsumerResponseSettings", -] - - -class MqWorkerConsumerResponseSettings(BaseModel): - batch_size: Optional[float] = None - """The maximum number of messages to include in a batch.""" - - max_concurrency: Optional[float] = None - """Maximum number of concurrent consumers that may consume from this Queue. - - Set to `null` to automatically opt in to the platform's maximum (recommended). - """ - - max_retries: Optional[float] = None - """The maximum number of retries""" - - max_wait_time_ms: Optional[float] = None - """ - The number of milliseconds to wait for a batch to fill up before attempting to - deliver it - """ - - retry_delay: Optional[float] = None - """ - The number of seconds to delay before making the message available for another - attempt. - """ - - -class MqWorkerConsumerResponse(BaseModel): - consumer_id: Optional[str] = None - """A Resource identifier.""" - - created_on: Optional[datetime] = None - - dead_letter_queue: Optional[str] = None - """Name of the dead letter queue, or empty string if not configured""" - - queue_name: Optional[str] = None - - script_name: Optional[str] = None - """Name of a Worker""" - - settings: Optional[MqWorkerConsumerResponseSettings] = None - - type: Optional[Literal["worker"]] = None - - -class MqHTTPConsumerResponseSettings(BaseModel): - batch_size: Optional[float] = None - """The maximum number of messages to include in a batch.""" - - max_retries: Optional[float] = None - """The maximum number of retries""" - - retry_delay: Optional[float] = None - """ - The number of seconds to delay before making the message available for another - attempt. - """ - - visibility_timeout_ms: Optional[float] = None - """The number of milliseconds that a message is exclusively leased. - - After the timeout, the message becomes available for another attempt. - """ - - -class MqHTTPConsumerResponse(BaseModel): - consumer_id: Optional[str] = None - """A Resource identifier.""" - - created_on: Optional[datetime] = None - - dead_letter_queue: Optional[str] = None - """Name of the dead letter queue, or empty string if not configured""" - - queue_name: Optional[str] = None - - settings: Optional[MqHTTPConsumerResponseSettings] = None - - type: Optional[Literal["http_pull"]] = None - - -ConsumerUpdateResponse: TypeAlias = Annotated[ - Union[MqWorkerConsumerResponse, MqHTTPConsumerResponse], PropertyInfo(discriminator="type") -] diff --git a/src/cloudflare/types/queues/queue.py b/src/cloudflare/types/queues/queue.py index fc351960f97..9db9ab26583 100644 --- a/src/cloudflare/types/queues/queue.py +++ b/src/cloudflare/types/queues/queue.py @@ -1,110 +1,12 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. from typing import List, Union, Optional -from datetime import datetime -from typing_extensions import Literal, Annotated, TypeAlias +from typing_extensions import Literal, TypeAlias -from ..._utils import PropertyInfo +from .consumer import Consumer from ..._models import BaseModel -__all__ = [ - "Queue", - "Consumer", - "ConsumerMqWorkerConsumerResponse", - "ConsumerMqWorkerConsumerResponseSettings", - "ConsumerMqHTTPConsumerResponse", - "ConsumerMqHTTPConsumerResponseSettings", - "Producer", - "ProducerMqWorkerProducer", - "ProducerMqR2Producer", - "Settings", -] - - -class ConsumerMqWorkerConsumerResponseSettings(BaseModel): - batch_size: Optional[float] = None - """The maximum number of messages to include in a batch.""" - - max_concurrency: Optional[float] = None - """Maximum number of concurrent consumers that may consume from this Queue. - - Set to `null` to automatically opt in to the platform's maximum (recommended). - """ - - max_retries: Optional[float] = None - """The maximum number of retries""" - - max_wait_time_ms: Optional[float] = None - """ - The number of milliseconds to wait for a batch to fill up before attempting to - deliver it - """ - - retry_delay: Optional[float] = None - """ - The number of seconds to delay before making the message available for another - attempt. - """ - - -class ConsumerMqWorkerConsumerResponse(BaseModel): - consumer_id: Optional[str] = None - """A Resource identifier.""" - - created_on: Optional[datetime] = None - - dead_letter_queue: Optional[str] = None - """Name of the dead letter queue, or empty string if not configured""" - - queue_name: Optional[str] = None - - script_name: Optional[str] = None - """Name of a Worker""" - - settings: Optional[ConsumerMqWorkerConsumerResponseSettings] = None - - type: Optional[Literal["worker"]] = None - - -class ConsumerMqHTTPConsumerResponseSettings(BaseModel): - batch_size: Optional[float] = None - """The maximum number of messages to include in a batch.""" - - max_retries: Optional[float] = None - """The maximum number of retries""" - - retry_delay: Optional[float] = None - """ - The number of seconds to delay before making the message available for another - attempt. - """ - - visibility_timeout_ms: Optional[float] = None - """The number of milliseconds that a message is exclusively leased. - - After the timeout, the message becomes available for another attempt. - """ - - -class ConsumerMqHTTPConsumerResponse(BaseModel): - consumer_id: Optional[str] = None - """A Resource identifier.""" - - created_on: Optional[datetime] = None - - dead_letter_queue: Optional[str] = None - """Name of the dead letter queue, or empty string if not configured""" - - queue_name: Optional[str] = None - - settings: Optional[ConsumerMqHTTPConsumerResponseSettings] = None - - type: Optional[Literal["http_pull"]] = None - - -Consumer: TypeAlias = Annotated[ - Union[ConsumerMqWorkerConsumerResponse, ConsumerMqHTTPConsumerResponse], PropertyInfo(discriminator="type") -] +__all__ = ["Queue", "Producer", "ProducerMqWorkerProducer", "ProducerMqR2Producer", "Settings"] class ProducerMqWorkerProducer(BaseModel): diff --git a/tests/api_resources/queues/test_consumers.py b/tests/api_resources/queues/test_consumers.py index 813728fba35..b7c0b9a70fa 100644 --- a/tests/api_resources/queues/test_consumers.py +++ b/tests/api_resources/queues/test_consumers.py @@ -10,13 +10,7 @@ from cloudflare import Cloudflare, AsyncCloudflare from tests.utils import assert_matches_type from cloudflare.pagination import SyncSinglePage, AsyncSinglePage -from cloudflare.types.queues import ( - ConsumerGetResponse, - ConsumerListResponse, - ConsumerCreateResponse, - ConsumerDeleteResponse, - ConsumerUpdateResponse, -) +from cloudflare.types.queues import Consumer, ConsumerDeleteResponse base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") @@ -32,7 +26,7 @@ def test_method_create_overload_1(self, client: Cloudflare) -> None: script_name="my-consumer-worker", type="worker", ) - assert_matches_type(Optional[ConsumerCreateResponse], consumer, path=["response"]) + assert_matches_type(Optional[Consumer], consumer, path=["response"]) @parametrize def test_method_create_with_all_params_overload_1(self, client: Cloudflare) -> None: @@ -50,7 +44,7 @@ def test_method_create_with_all_params_overload_1(self, client: Cloudflare) -> N "retry_delay": 10, }, ) - assert_matches_type(Optional[ConsumerCreateResponse], consumer, path=["response"]) + assert_matches_type(Optional[Consumer], consumer, path=["response"]) @parametrize def test_raw_response_create_overload_1(self, client: Cloudflare) -> None: @@ -64,7 +58,7 @@ def test_raw_response_create_overload_1(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" consumer = response.parse() - assert_matches_type(Optional[ConsumerCreateResponse], consumer, path=["response"]) + assert_matches_type(Optional[Consumer], consumer, path=["response"]) @parametrize def test_streaming_response_create_overload_1(self, client: Cloudflare) -> None: @@ -78,7 +72,7 @@ def test_streaming_response_create_overload_1(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" consumer = response.parse() - assert_matches_type(Optional[ConsumerCreateResponse], consumer, path=["response"]) + assert_matches_type(Optional[Consumer], consumer, path=["response"]) assert cast(Any, response.is_closed) is True @@ -107,7 +101,7 @@ def test_method_create_overload_2(self, client: Cloudflare) -> None: account_id="023e105f4ecef8ad9ca31a8372d0c353", type="http_pull", ) - assert_matches_type(Optional[ConsumerCreateResponse], consumer, path=["response"]) + assert_matches_type(Optional[Consumer], consumer, path=["response"]) @parametrize def test_method_create_with_all_params_overload_2(self, client: Cloudflare) -> None: @@ -123,7 +117,7 @@ def test_method_create_with_all_params_overload_2(self, client: Cloudflare) -> N "visibility_timeout_ms": 6000, }, ) - assert_matches_type(Optional[ConsumerCreateResponse], consumer, path=["response"]) + assert_matches_type(Optional[Consumer], consumer, path=["response"]) @parametrize def test_raw_response_create_overload_2(self, client: Cloudflare) -> None: @@ -136,7 +130,7 @@ def test_raw_response_create_overload_2(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" consumer = response.parse() - assert_matches_type(Optional[ConsumerCreateResponse], consumer, path=["response"]) + assert_matches_type(Optional[Consumer], consumer, path=["response"]) @parametrize def test_streaming_response_create_overload_2(self, client: Cloudflare) -> None: @@ -149,7 +143,7 @@ def test_streaming_response_create_overload_2(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" consumer = response.parse() - assert_matches_type(Optional[ConsumerCreateResponse], consumer, path=["response"]) + assert_matches_type(Optional[Consumer], consumer, path=["response"]) assert cast(Any, response.is_closed) is True @@ -178,7 +172,7 @@ def test_method_update_overload_1(self, client: Cloudflare) -> None: script_name="my-consumer-worker", type="worker", ) - assert_matches_type(Optional[ConsumerUpdateResponse], consumer, path=["response"]) + assert_matches_type(Optional[Consumer], consumer, path=["response"]) @parametrize def test_method_update_with_all_params_overload_1(self, client: Cloudflare) -> None: @@ -197,7 +191,7 @@ def test_method_update_with_all_params_overload_1(self, client: Cloudflare) -> N "retry_delay": 10, }, ) - assert_matches_type(Optional[ConsumerUpdateResponse], consumer, path=["response"]) + assert_matches_type(Optional[Consumer], consumer, path=["response"]) @parametrize def test_raw_response_update_overload_1(self, client: Cloudflare) -> None: @@ -212,7 +206,7 @@ def test_raw_response_update_overload_1(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" consumer = response.parse() - assert_matches_type(Optional[ConsumerUpdateResponse], consumer, path=["response"]) + assert_matches_type(Optional[Consumer], consumer, path=["response"]) @parametrize def test_streaming_response_update_overload_1(self, client: Cloudflare) -> None: @@ -227,7 +221,7 @@ def test_streaming_response_update_overload_1(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" consumer = response.parse() - assert_matches_type(Optional[ConsumerUpdateResponse], consumer, path=["response"]) + assert_matches_type(Optional[Consumer], consumer, path=["response"]) assert cast(Any, response.is_closed) is True @@ -268,7 +262,7 @@ def test_method_update_overload_2(self, client: Cloudflare) -> None: queue_id="023e105f4ecef8ad9ca31a8372d0c353", type="http_pull", ) - assert_matches_type(Optional[ConsumerUpdateResponse], consumer, path=["response"]) + assert_matches_type(Optional[Consumer], consumer, path=["response"]) @parametrize def test_method_update_with_all_params_overload_2(self, client: Cloudflare) -> None: @@ -285,7 +279,7 @@ def test_method_update_with_all_params_overload_2(self, client: Cloudflare) -> N "visibility_timeout_ms": 6000, }, ) - assert_matches_type(Optional[ConsumerUpdateResponse], consumer, path=["response"]) + assert_matches_type(Optional[Consumer], consumer, path=["response"]) @parametrize def test_raw_response_update_overload_2(self, client: Cloudflare) -> None: @@ -299,7 +293,7 @@ def test_raw_response_update_overload_2(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" consumer = response.parse() - assert_matches_type(Optional[ConsumerUpdateResponse], consumer, path=["response"]) + assert_matches_type(Optional[Consumer], consumer, path=["response"]) @parametrize def test_streaming_response_update_overload_2(self, client: Cloudflare) -> None: @@ -313,7 +307,7 @@ def test_streaming_response_update_overload_2(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" consumer = response.parse() - assert_matches_type(Optional[ConsumerUpdateResponse], consumer, path=["response"]) + assert_matches_type(Optional[Consumer], consumer, path=["response"]) assert cast(Any, response.is_closed) is True @@ -349,7 +343,7 @@ def test_method_list(self, client: Cloudflare) -> None: queue_id="023e105f4ecef8ad9ca31a8372d0c353", account_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(SyncSinglePage[ConsumerListResponse], consumer, path=["response"]) + assert_matches_type(SyncSinglePage[Consumer], consumer, path=["response"]) @parametrize def test_raw_response_list(self, client: Cloudflare) -> None: @@ -361,7 +355,7 @@ def test_raw_response_list(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" consumer = response.parse() - assert_matches_type(SyncSinglePage[ConsumerListResponse], consumer, path=["response"]) + assert_matches_type(SyncSinglePage[Consumer], consumer, path=["response"]) @parametrize def test_streaming_response_list(self, client: Cloudflare) -> None: @@ -373,7 +367,7 @@ def test_streaming_response_list(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" consumer = response.parse() - assert_matches_type(SyncSinglePage[ConsumerListResponse], consumer, path=["response"]) + assert_matches_type(SyncSinglePage[Consumer], consumer, path=["response"]) assert cast(Any, response.is_closed) is True @@ -458,7 +452,7 @@ def test_method_get(self, client: Cloudflare) -> None: account_id="023e105f4ecef8ad9ca31a8372d0c353", queue_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(Optional[ConsumerGetResponse], consumer, path=["response"]) + assert_matches_type(Optional[Consumer], consumer, path=["response"]) @parametrize def test_raw_response_get(self, client: Cloudflare) -> None: @@ -471,7 +465,7 @@ def test_raw_response_get(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" consumer = response.parse() - assert_matches_type(Optional[ConsumerGetResponse], consumer, path=["response"]) + assert_matches_type(Optional[Consumer], consumer, path=["response"]) @parametrize def test_streaming_response_get(self, client: Cloudflare) -> None: @@ -484,7 +478,7 @@ def test_streaming_response_get(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" consumer = response.parse() - assert_matches_type(Optional[ConsumerGetResponse], consumer, path=["response"]) + assert_matches_type(Optional[Consumer], consumer, path=["response"]) assert cast(Any, response.is_closed) is True @@ -525,7 +519,7 @@ async def test_method_create_overload_1(self, async_client: AsyncCloudflare) -> script_name="my-consumer-worker", type="worker", ) - assert_matches_type(Optional[ConsumerCreateResponse], consumer, path=["response"]) + assert_matches_type(Optional[Consumer], consumer, path=["response"]) @parametrize async def test_method_create_with_all_params_overload_1(self, async_client: AsyncCloudflare) -> None: @@ -543,7 +537,7 @@ async def test_method_create_with_all_params_overload_1(self, async_client: Asyn "retry_delay": 10, }, ) - assert_matches_type(Optional[ConsumerCreateResponse], consumer, path=["response"]) + assert_matches_type(Optional[Consumer], consumer, path=["response"]) @parametrize async def test_raw_response_create_overload_1(self, async_client: AsyncCloudflare) -> None: @@ -557,7 +551,7 @@ async def test_raw_response_create_overload_1(self, async_client: AsyncCloudflar assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" consumer = await response.parse() - assert_matches_type(Optional[ConsumerCreateResponse], consumer, path=["response"]) + assert_matches_type(Optional[Consumer], consumer, path=["response"]) @parametrize async def test_streaming_response_create_overload_1(self, async_client: AsyncCloudflare) -> None: @@ -571,7 +565,7 @@ async def test_streaming_response_create_overload_1(self, async_client: AsyncClo assert response.http_request.headers.get("X-Stainless-Lang") == "python" consumer = await response.parse() - assert_matches_type(Optional[ConsumerCreateResponse], consumer, path=["response"]) + assert_matches_type(Optional[Consumer], consumer, path=["response"]) assert cast(Any, response.is_closed) is True @@ -600,7 +594,7 @@ async def test_method_create_overload_2(self, async_client: AsyncCloudflare) -> account_id="023e105f4ecef8ad9ca31a8372d0c353", type="http_pull", ) - assert_matches_type(Optional[ConsumerCreateResponse], consumer, path=["response"]) + assert_matches_type(Optional[Consumer], consumer, path=["response"]) @parametrize async def test_method_create_with_all_params_overload_2(self, async_client: AsyncCloudflare) -> None: @@ -616,7 +610,7 @@ async def test_method_create_with_all_params_overload_2(self, async_client: Asyn "visibility_timeout_ms": 6000, }, ) - assert_matches_type(Optional[ConsumerCreateResponse], consumer, path=["response"]) + assert_matches_type(Optional[Consumer], consumer, path=["response"]) @parametrize async def test_raw_response_create_overload_2(self, async_client: AsyncCloudflare) -> None: @@ -629,7 +623,7 @@ async def test_raw_response_create_overload_2(self, async_client: AsyncCloudflar assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" consumer = await response.parse() - assert_matches_type(Optional[ConsumerCreateResponse], consumer, path=["response"]) + assert_matches_type(Optional[Consumer], consumer, path=["response"]) @parametrize async def test_streaming_response_create_overload_2(self, async_client: AsyncCloudflare) -> None: @@ -642,7 +636,7 @@ async def test_streaming_response_create_overload_2(self, async_client: AsyncClo assert response.http_request.headers.get("X-Stainless-Lang") == "python" consumer = await response.parse() - assert_matches_type(Optional[ConsumerCreateResponse], consumer, path=["response"]) + assert_matches_type(Optional[Consumer], consumer, path=["response"]) assert cast(Any, response.is_closed) is True @@ -671,7 +665,7 @@ async def test_method_update_overload_1(self, async_client: AsyncCloudflare) -> script_name="my-consumer-worker", type="worker", ) - assert_matches_type(Optional[ConsumerUpdateResponse], consumer, path=["response"]) + assert_matches_type(Optional[Consumer], consumer, path=["response"]) @parametrize async def test_method_update_with_all_params_overload_1(self, async_client: AsyncCloudflare) -> None: @@ -690,7 +684,7 @@ async def test_method_update_with_all_params_overload_1(self, async_client: Asyn "retry_delay": 10, }, ) - assert_matches_type(Optional[ConsumerUpdateResponse], consumer, path=["response"]) + assert_matches_type(Optional[Consumer], consumer, path=["response"]) @parametrize async def test_raw_response_update_overload_1(self, async_client: AsyncCloudflare) -> None: @@ -705,7 +699,7 @@ async def test_raw_response_update_overload_1(self, async_client: AsyncCloudflar assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" consumer = await response.parse() - assert_matches_type(Optional[ConsumerUpdateResponse], consumer, path=["response"]) + assert_matches_type(Optional[Consumer], consumer, path=["response"]) @parametrize async def test_streaming_response_update_overload_1(self, async_client: AsyncCloudflare) -> None: @@ -720,7 +714,7 @@ async def test_streaming_response_update_overload_1(self, async_client: AsyncClo assert response.http_request.headers.get("X-Stainless-Lang") == "python" consumer = await response.parse() - assert_matches_type(Optional[ConsumerUpdateResponse], consumer, path=["response"]) + assert_matches_type(Optional[Consumer], consumer, path=["response"]) assert cast(Any, response.is_closed) is True @@ -761,7 +755,7 @@ async def test_method_update_overload_2(self, async_client: AsyncCloudflare) -> queue_id="023e105f4ecef8ad9ca31a8372d0c353", type="http_pull", ) - assert_matches_type(Optional[ConsumerUpdateResponse], consumer, path=["response"]) + assert_matches_type(Optional[Consumer], consumer, path=["response"]) @parametrize async def test_method_update_with_all_params_overload_2(self, async_client: AsyncCloudflare) -> None: @@ -778,7 +772,7 @@ async def test_method_update_with_all_params_overload_2(self, async_client: Asyn "visibility_timeout_ms": 6000, }, ) - assert_matches_type(Optional[ConsumerUpdateResponse], consumer, path=["response"]) + assert_matches_type(Optional[Consumer], consumer, path=["response"]) @parametrize async def test_raw_response_update_overload_2(self, async_client: AsyncCloudflare) -> None: @@ -792,7 +786,7 @@ async def test_raw_response_update_overload_2(self, async_client: AsyncCloudflar assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" consumer = await response.parse() - assert_matches_type(Optional[ConsumerUpdateResponse], consumer, path=["response"]) + assert_matches_type(Optional[Consumer], consumer, path=["response"]) @parametrize async def test_streaming_response_update_overload_2(self, async_client: AsyncCloudflare) -> None: @@ -806,7 +800,7 @@ async def test_streaming_response_update_overload_2(self, async_client: AsyncClo assert response.http_request.headers.get("X-Stainless-Lang") == "python" consumer = await response.parse() - assert_matches_type(Optional[ConsumerUpdateResponse], consumer, path=["response"]) + assert_matches_type(Optional[Consumer], consumer, path=["response"]) assert cast(Any, response.is_closed) is True @@ -842,7 +836,7 @@ async def test_method_list(self, async_client: AsyncCloudflare) -> None: queue_id="023e105f4ecef8ad9ca31a8372d0c353", account_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(AsyncSinglePage[ConsumerListResponse], consumer, path=["response"]) + assert_matches_type(AsyncSinglePage[Consumer], consumer, path=["response"]) @parametrize async def test_raw_response_list(self, async_client: AsyncCloudflare) -> None: @@ -854,7 +848,7 @@ async def test_raw_response_list(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" consumer = await response.parse() - assert_matches_type(AsyncSinglePage[ConsumerListResponse], consumer, path=["response"]) + assert_matches_type(AsyncSinglePage[Consumer], consumer, path=["response"]) @parametrize async def test_streaming_response_list(self, async_client: AsyncCloudflare) -> None: @@ -866,7 +860,7 @@ async def test_streaming_response_list(self, async_client: AsyncCloudflare) -> N assert response.http_request.headers.get("X-Stainless-Lang") == "python" consumer = await response.parse() - assert_matches_type(AsyncSinglePage[ConsumerListResponse], consumer, path=["response"]) + assert_matches_type(AsyncSinglePage[Consumer], consumer, path=["response"]) assert cast(Any, response.is_closed) is True @@ -951,7 +945,7 @@ async def test_method_get(self, async_client: AsyncCloudflare) -> None: account_id="023e105f4ecef8ad9ca31a8372d0c353", queue_id="023e105f4ecef8ad9ca31a8372d0c353", ) - assert_matches_type(Optional[ConsumerGetResponse], consumer, path=["response"]) + assert_matches_type(Optional[Consumer], consumer, path=["response"]) @parametrize async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: @@ -964,7 +958,7 @@ async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" consumer = await response.parse() - assert_matches_type(Optional[ConsumerGetResponse], consumer, path=["response"]) + assert_matches_type(Optional[Consumer], consumer, path=["response"]) @parametrize async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> None: @@ -977,7 +971,7 @@ async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> No assert response.http_request.headers.get("X-Stainless-Lang") == "python" consumer = await response.parse() - assert_matches_type(Optional[ConsumerGetResponse], consumer, path=["response"]) + assert_matches_type(Optional[Consumer], consumer, path=["response"]) assert cast(Any, response.is_closed) is True From 62e214f88abd1f3779be73679fd22da25e6483fd Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 26 Feb 2026 14:50:45 +0000 Subject: [PATCH 040/279] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index 0b21ce70104..fb894cc5ba7 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 2037 openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-9ba099b7936091cc984d2a24fc4d32c3ffcb1d71d86412c8c9084d201e16b3ac.yml openapi_spec_hash: 45edc9a107cf5a5e3b204b230b0d336d -config_hash: e3be580c8a7e39157925fab6ac9dd3ad +config_hash: c6a9054e0a48c4e893e91035a4604be5 From cdd791622949bc966a60d3d5c616563973643272 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 26 Feb 2026 16:37:49 +0000 Subject: [PATCH 041/279] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index fb894cc5ba7..799d6067c27 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 2037 openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-9ba099b7936091cc984d2a24fc4d32c3ffcb1d71d86412c8c9084d201e16b3ac.yml openapi_spec_hash: 45edc9a107cf5a5e3b204b230b0d336d -config_hash: c6a9054e0a48c4e893e91035a4604be5 +config_hash: b593692e46f6317685cfeecd6531ecc8 From 6242c20ec596748717cddaadd9999738cb924b8f Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 26 Feb 2026 20:06:44 +0000 Subject: [PATCH 042/279] feat: fix: add 'rdp' as an initialism * fix: add 'rdp' as an initialism --- .stats.yml | 2 +- .../access/applications/applications.py | 96 ++++----- .../access/application_create_params.py | 190 +++++++++--------- .../access/application_create_response.py | 180 ++++++++--------- .../access/application_get_response.py | 180 ++++++++--------- .../access/application_list_response.py | 180 ++++++++--------- .../access/application_update_params.py | 190 +++++++++--------- .../access/application_update_response.py | 180 ++++++++--------- .../applications/policy_create_params.py | 6 +- .../applications/policy_create_response.py | 6 +- .../applications/policy_get_response.py | 6 +- .../applications/policy_list_response.py | 6 +- .../applications/policy_test_create_params.py | 6 +- .../applications/policy_update_params.py | 6 +- .../applications/policy_update_response.py | 6 +- .../zero_trust/access/policy_create_params.py | 6 +- .../access/policy_create_response.py | 6 +- .../zero_trust/access/policy_get_response.py | 6 +- .../zero_trust/access/policy_list_response.py | 6 +- .../zero_trust/access/policy_update_params.py | 6 +- .../access/policy_update_response.py | 6 +- 21 files changed, 638 insertions(+), 638 deletions(-) diff --git a/.stats.yml b/.stats.yml index 799d6067c27..fc1621cc01b 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 2037 openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-9ba099b7936091cc984d2a24fc4d32c3ffcb1d71d86412c8c9084d201e16b3ac.yml openapi_spec_hash: 45edc9a107cf5a5e3b204b230b0d336d -config_hash: b593692e46f6317685cfeecd6531ecc8 +config_hash: 81958bc903eb981010e617c06d49bd80 diff --git a/src/cloudflare/resources/zero_trust/access/applications/applications.py b/src/cloudflare/resources/zero_trust/access/applications/applications.py index 59439d9322c..bf6af193bac 100644 --- a/src/cloudflare/resources/zero_trust/access/applications/applications.py +++ b/src/cloudflare/resources/zero_trust/access/applications/applications.py @@ -1089,7 +1089,7 @@ def create( self, *, domain: str, - target_criteria: Iterable[application_create_params.BrowserRdpApplicationTargetCriterion], + target_criteria: Iterable[application_create_params.BrowserRDPApplicationTargetCriterion], type: ApplicationType, account_id: str | Omit = omit, zone_id: str | Omit = omit, @@ -1103,19 +1103,19 @@ def create( custom_deny_url: str | Omit = omit, custom_non_identity_deny_url: str | Omit = omit, custom_pages: SequenceNotStr[str] | Omit = omit, - destinations: Iterable[application_create_params.BrowserRdpApplicationDestination] | Omit = omit, + destinations: Iterable[application_create_params.BrowserRDPApplicationDestination] | Omit = omit, enable_binding_cookie: bool | Omit = omit, http_only_cookie_attribute: bool | Omit = omit, logo_url: str | Omit = omit, - mfa_config: application_create_params.BrowserRdpApplicationMfaConfig | Omit = omit, + mfa_config: application_create_params.BrowserRDPApplicationMfaConfig | Omit = omit, name: str | Omit = omit, - oauth_configuration: application_create_params.BrowserRdpApplicationOAuthConfiguration | Omit = omit, + oauth_configuration: application_create_params.BrowserRDPApplicationOAuthConfiguration | Omit = omit, options_preflight_bypass: bool | Omit = omit, path_cookie_attribute: bool | Omit = omit, - policies: SequenceNotStr[application_create_params.BrowserRdpApplicationPolicy] | Omit = omit, + policies: SequenceNotStr[application_create_params.BrowserRDPApplicationPolicy] | Omit = omit, read_service_tokens_from_header: str | Omit = omit, same_site_cookie_attribute: str | Omit = omit, - scim_config: application_create_params.BrowserRdpApplicationSCIMConfig | Omit = omit, + scim_config: application_create_params.BrowserRDPApplicationSCIMConfig | Omit = omit, self_hosted_domains: SequenceNotStr[SelfHostedDomains] | Omit = omit, service_auth_401_redirect: bool | Omit = omit, session_duration: str | Omit = omit, @@ -1507,7 +1507,7 @@ def create( destinations: Iterable[application_create_params.SelfHostedApplicationDestination] | Iterable[application_create_params.BrowserSSHApplicationDestination] | Iterable[application_create_params.BrowserVNCApplicationDestination] - | Iterable[application_create_params.BrowserRdpApplicationDestination] + | Iterable[application_create_params.BrowserRDPApplicationDestination] | Iterable[application_create_params.McpServerApplicationDestination] | Iterable[application_create_params.McpServerPortalApplicationDestination] | Omit = omit, @@ -1517,13 +1517,13 @@ def create( mfa_config: application_create_params.SelfHostedApplicationMfaConfig | application_create_params.BrowserSSHApplicationMfaConfig | application_create_params.BrowserVNCApplicationMfaConfig - | application_create_params.BrowserRdpApplicationMfaConfig + | application_create_params.BrowserRDPApplicationMfaConfig | Omit = omit, name: str | Omit = omit, oauth_configuration: application_create_params.SelfHostedApplicationOAuthConfiguration | application_create_params.BrowserSSHApplicationOAuthConfiguration | application_create_params.BrowserVNCApplicationOAuthConfiguration - | application_create_params.BrowserRdpApplicationOAuthConfiguration + | application_create_params.BrowserRDPApplicationOAuthConfiguration | application_create_params.McpServerApplicationOAuthConfiguration | application_create_params.McpServerPortalApplicationOAuthConfiguration | Omit = omit, @@ -1539,7 +1539,7 @@ def create( | SequenceNotStr[application_create_params.GatewayIdentityProxyEndpointApplicationPolicy] | SequenceNotStr[application_create_params.BookmarkApplicationPolicy] | Iterable[application_create_params.InfrastructureApplicationPolicy] - | SequenceNotStr[application_create_params.BrowserRdpApplicationPolicy] + | SequenceNotStr[application_create_params.BrowserRDPApplicationPolicy] | SequenceNotStr[application_create_params.McpServerApplicationPolicy] | SequenceNotStr[application_create_params.McpServerPortalApplicationPolicy] | Omit = omit, @@ -1549,7 +1549,7 @@ def create( | application_create_params.SaaSApplicationSCIMConfig | application_create_params.BrowserSSHApplicationSCIMConfig | application_create_params.BrowserVNCApplicationSCIMConfig - | application_create_params.BrowserRdpApplicationSCIMConfig + | application_create_params.BrowserRDPApplicationSCIMConfig | application_create_params.McpServerApplicationSCIMConfig | application_create_params.McpServerPortalApplicationSCIMConfig | Omit = omit, @@ -1567,7 +1567,7 @@ def create( landing_page_design: application_create_params.AppLauncherApplicationLandingPageDesign | Omit = omit, skip_app_launcher_login_page: bool | Omit = omit, target_criteria: Iterable[application_create_params.InfrastructureApplicationTargetCriterion] - | Iterable[application_create_params.BrowserRdpApplicationTargetCriterion] + | Iterable[application_create_params.BrowserRDPApplicationTargetCriterion] | 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. @@ -2648,7 +2648,7 @@ def update( app_id: AppID, *, domain: str, - target_criteria: Iterable[application_update_params.BrowserRdpApplicationTargetCriterion], + target_criteria: Iterable[application_update_params.BrowserRDPApplicationTargetCriterion], type: ApplicationType, account_id: str | Omit = omit, zone_id: str | Omit = omit, @@ -2662,19 +2662,19 @@ def update( custom_deny_url: str | Omit = omit, custom_non_identity_deny_url: str | Omit = omit, custom_pages: SequenceNotStr[str] | Omit = omit, - destinations: Iterable[application_update_params.BrowserRdpApplicationDestination] | Omit = omit, + destinations: Iterable[application_update_params.BrowserRDPApplicationDestination] | Omit = omit, enable_binding_cookie: bool | Omit = omit, http_only_cookie_attribute: bool | Omit = omit, logo_url: str | Omit = omit, - mfa_config: application_update_params.BrowserRdpApplicationMfaConfig | Omit = omit, + mfa_config: application_update_params.BrowserRDPApplicationMfaConfig | Omit = omit, name: str | Omit = omit, - oauth_configuration: application_update_params.BrowserRdpApplicationOAuthConfiguration | Omit = omit, + oauth_configuration: application_update_params.BrowserRDPApplicationOAuthConfiguration | Omit = omit, options_preflight_bypass: bool | Omit = omit, path_cookie_attribute: bool | Omit = omit, - policies: SequenceNotStr[application_update_params.BrowserRdpApplicationPolicy] | Omit = omit, + policies: SequenceNotStr[application_update_params.BrowserRDPApplicationPolicy] | Omit = omit, read_service_tokens_from_header: str | Omit = omit, same_site_cookie_attribute: str | Omit = omit, - scim_config: application_update_params.BrowserRdpApplicationSCIMConfig | Omit = omit, + scim_config: application_update_params.BrowserRDPApplicationSCIMConfig | Omit = omit, self_hosted_domains: SequenceNotStr[SelfHostedDomains] | Omit = omit, service_auth_401_redirect: bool | Omit = omit, session_duration: str | Omit = omit, @@ -3075,7 +3075,7 @@ def update( destinations: Iterable[application_update_params.SelfHostedApplicationDestination] | Iterable[application_update_params.BrowserSSHApplicationDestination] | Iterable[application_update_params.BrowserVNCApplicationDestination] - | Iterable[application_update_params.BrowserRdpApplicationDestination] + | Iterable[application_update_params.BrowserRDPApplicationDestination] | Iterable[application_update_params.McpServerApplicationDestination] | Iterable[application_update_params.McpServerPortalApplicationDestination] | Omit = omit, @@ -3085,13 +3085,13 @@ def update( mfa_config: application_update_params.SelfHostedApplicationMfaConfig | application_update_params.BrowserSSHApplicationMfaConfig | application_update_params.BrowserVNCApplicationMfaConfig - | application_update_params.BrowserRdpApplicationMfaConfig + | application_update_params.BrowserRDPApplicationMfaConfig | Omit = omit, name: str | Omit = omit, oauth_configuration: application_update_params.SelfHostedApplicationOAuthConfiguration | application_update_params.BrowserSSHApplicationOAuthConfiguration | application_update_params.BrowserVNCApplicationOAuthConfiguration - | application_update_params.BrowserRdpApplicationOAuthConfiguration + | application_update_params.BrowserRDPApplicationOAuthConfiguration | application_update_params.McpServerApplicationOAuthConfiguration | application_update_params.McpServerPortalApplicationOAuthConfiguration | Omit = omit, @@ -3107,7 +3107,7 @@ def update( | SequenceNotStr[application_update_params.GatewayIdentityProxyEndpointApplicationPolicy] | SequenceNotStr[application_update_params.BookmarkApplicationPolicy] | Iterable[application_update_params.InfrastructureApplicationPolicy] - | SequenceNotStr[application_update_params.BrowserRdpApplicationPolicy] + | SequenceNotStr[application_update_params.BrowserRDPApplicationPolicy] | SequenceNotStr[application_update_params.McpServerApplicationPolicy] | SequenceNotStr[application_update_params.McpServerPortalApplicationPolicy] | Omit = omit, @@ -3117,7 +3117,7 @@ def update( | application_update_params.SaaSApplicationSCIMConfig | application_update_params.BrowserSSHApplicationSCIMConfig | application_update_params.BrowserVNCApplicationSCIMConfig - | application_update_params.BrowserRdpApplicationSCIMConfig + | application_update_params.BrowserRDPApplicationSCIMConfig | application_update_params.McpServerApplicationSCIMConfig | application_update_params.McpServerPortalApplicationSCIMConfig | Omit = omit, @@ -3135,7 +3135,7 @@ def update( landing_page_design: application_update_params.AppLauncherApplicationLandingPageDesign | Omit = omit, skip_app_launcher_login_page: bool | Omit = omit, target_criteria: Iterable[application_update_params.InfrastructureApplicationTargetCriterion] - | Iterable[application_update_params.BrowserRdpApplicationTargetCriterion] + | Iterable[application_update_params.BrowserRDPApplicationTargetCriterion] | 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. @@ -4493,7 +4493,7 @@ async def create( self, *, domain: str, - target_criteria: Iterable[application_create_params.BrowserRdpApplicationTargetCriterion], + target_criteria: Iterable[application_create_params.BrowserRDPApplicationTargetCriterion], type: ApplicationType, account_id: str | Omit = omit, zone_id: str | Omit = omit, @@ -4507,19 +4507,19 @@ async def create( custom_deny_url: str | Omit = omit, custom_non_identity_deny_url: str | Omit = omit, custom_pages: SequenceNotStr[str] | Omit = omit, - destinations: Iterable[application_create_params.BrowserRdpApplicationDestination] | Omit = omit, + destinations: Iterable[application_create_params.BrowserRDPApplicationDestination] | Omit = omit, enable_binding_cookie: bool | Omit = omit, http_only_cookie_attribute: bool | Omit = omit, logo_url: str | Omit = omit, - mfa_config: application_create_params.BrowserRdpApplicationMfaConfig | Omit = omit, + mfa_config: application_create_params.BrowserRDPApplicationMfaConfig | Omit = omit, name: str | Omit = omit, - oauth_configuration: application_create_params.BrowserRdpApplicationOAuthConfiguration | Omit = omit, + oauth_configuration: application_create_params.BrowserRDPApplicationOAuthConfiguration | Omit = omit, options_preflight_bypass: bool | Omit = omit, path_cookie_attribute: bool | Omit = omit, - policies: SequenceNotStr[application_create_params.BrowserRdpApplicationPolicy] | Omit = omit, + policies: SequenceNotStr[application_create_params.BrowserRDPApplicationPolicy] | Omit = omit, read_service_tokens_from_header: str | Omit = omit, same_site_cookie_attribute: str | Omit = omit, - scim_config: application_create_params.BrowserRdpApplicationSCIMConfig | Omit = omit, + scim_config: application_create_params.BrowserRDPApplicationSCIMConfig | Omit = omit, self_hosted_domains: SequenceNotStr[SelfHostedDomains] | Omit = omit, service_auth_401_redirect: bool | Omit = omit, session_duration: str | Omit = omit, @@ -4911,7 +4911,7 @@ async def create( destinations: Iterable[application_create_params.SelfHostedApplicationDestination] | Iterable[application_create_params.BrowserSSHApplicationDestination] | Iterable[application_create_params.BrowserVNCApplicationDestination] - | Iterable[application_create_params.BrowserRdpApplicationDestination] + | Iterable[application_create_params.BrowserRDPApplicationDestination] | Iterable[application_create_params.McpServerApplicationDestination] | Iterable[application_create_params.McpServerPortalApplicationDestination] | Omit = omit, @@ -4921,13 +4921,13 @@ async def create( mfa_config: application_create_params.SelfHostedApplicationMfaConfig | application_create_params.BrowserSSHApplicationMfaConfig | application_create_params.BrowserVNCApplicationMfaConfig - | application_create_params.BrowserRdpApplicationMfaConfig + | application_create_params.BrowserRDPApplicationMfaConfig | Omit = omit, name: str | Omit = omit, oauth_configuration: application_create_params.SelfHostedApplicationOAuthConfiguration | application_create_params.BrowserSSHApplicationOAuthConfiguration | application_create_params.BrowserVNCApplicationOAuthConfiguration - | application_create_params.BrowserRdpApplicationOAuthConfiguration + | application_create_params.BrowserRDPApplicationOAuthConfiguration | application_create_params.McpServerApplicationOAuthConfiguration | application_create_params.McpServerPortalApplicationOAuthConfiguration | Omit = omit, @@ -4943,7 +4943,7 @@ async def create( | SequenceNotStr[application_create_params.GatewayIdentityProxyEndpointApplicationPolicy] | SequenceNotStr[application_create_params.BookmarkApplicationPolicy] | Iterable[application_create_params.InfrastructureApplicationPolicy] - | SequenceNotStr[application_create_params.BrowserRdpApplicationPolicy] + | SequenceNotStr[application_create_params.BrowserRDPApplicationPolicy] | SequenceNotStr[application_create_params.McpServerApplicationPolicy] | SequenceNotStr[application_create_params.McpServerPortalApplicationPolicy] | Omit = omit, @@ -4953,7 +4953,7 @@ async def create( | application_create_params.SaaSApplicationSCIMConfig | application_create_params.BrowserSSHApplicationSCIMConfig | application_create_params.BrowserVNCApplicationSCIMConfig - | application_create_params.BrowserRdpApplicationSCIMConfig + | application_create_params.BrowserRDPApplicationSCIMConfig | application_create_params.McpServerApplicationSCIMConfig | application_create_params.McpServerPortalApplicationSCIMConfig | Omit = omit, @@ -4971,7 +4971,7 @@ async def create( landing_page_design: application_create_params.AppLauncherApplicationLandingPageDesign | Omit = omit, skip_app_launcher_login_page: bool | Omit = omit, target_criteria: Iterable[application_create_params.InfrastructureApplicationTargetCriterion] - | Iterable[application_create_params.BrowserRdpApplicationTargetCriterion] + | Iterable[application_create_params.BrowserRDPApplicationTargetCriterion] | 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. @@ -6052,7 +6052,7 @@ async def update( app_id: AppID, *, domain: str, - target_criteria: Iterable[application_update_params.BrowserRdpApplicationTargetCriterion], + target_criteria: Iterable[application_update_params.BrowserRDPApplicationTargetCriterion], type: ApplicationType, account_id: str | Omit = omit, zone_id: str | Omit = omit, @@ -6066,19 +6066,19 @@ async def update( custom_deny_url: str | Omit = omit, custom_non_identity_deny_url: str | Omit = omit, custom_pages: SequenceNotStr[str] | Omit = omit, - destinations: Iterable[application_update_params.BrowserRdpApplicationDestination] | Omit = omit, + destinations: Iterable[application_update_params.BrowserRDPApplicationDestination] | Omit = omit, enable_binding_cookie: bool | Omit = omit, http_only_cookie_attribute: bool | Omit = omit, logo_url: str | Omit = omit, - mfa_config: application_update_params.BrowserRdpApplicationMfaConfig | Omit = omit, + mfa_config: application_update_params.BrowserRDPApplicationMfaConfig | Omit = omit, name: str | Omit = omit, - oauth_configuration: application_update_params.BrowserRdpApplicationOAuthConfiguration | Omit = omit, + oauth_configuration: application_update_params.BrowserRDPApplicationOAuthConfiguration | Omit = omit, options_preflight_bypass: bool | Omit = omit, path_cookie_attribute: bool | Omit = omit, - policies: SequenceNotStr[application_update_params.BrowserRdpApplicationPolicy] | Omit = omit, + policies: SequenceNotStr[application_update_params.BrowserRDPApplicationPolicy] | Omit = omit, read_service_tokens_from_header: str | Omit = omit, same_site_cookie_attribute: str | Omit = omit, - scim_config: application_update_params.BrowserRdpApplicationSCIMConfig | Omit = omit, + scim_config: application_update_params.BrowserRDPApplicationSCIMConfig | Omit = omit, self_hosted_domains: SequenceNotStr[SelfHostedDomains] | Omit = omit, service_auth_401_redirect: bool | Omit = omit, session_duration: str | Omit = omit, @@ -6479,7 +6479,7 @@ async def update( destinations: Iterable[application_update_params.SelfHostedApplicationDestination] | Iterable[application_update_params.BrowserSSHApplicationDestination] | Iterable[application_update_params.BrowserVNCApplicationDestination] - | Iterable[application_update_params.BrowserRdpApplicationDestination] + | Iterable[application_update_params.BrowserRDPApplicationDestination] | Iterable[application_update_params.McpServerApplicationDestination] | Iterable[application_update_params.McpServerPortalApplicationDestination] | Omit = omit, @@ -6489,13 +6489,13 @@ async def update( mfa_config: application_update_params.SelfHostedApplicationMfaConfig | application_update_params.BrowserSSHApplicationMfaConfig | application_update_params.BrowserVNCApplicationMfaConfig - | application_update_params.BrowserRdpApplicationMfaConfig + | application_update_params.BrowserRDPApplicationMfaConfig | Omit = omit, name: str | Omit = omit, oauth_configuration: application_update_params.SelfHostedApplicationOAuthConfiguration | application_update_params.BrowserSSHApplicationOAuthConfiguration | application_update_params.BrowserVNCApplicationOAuthConfiguration - | application_update_params.BrowserRdpApplicationOAuthConfiguration + | application_update_params.BrowserRDPApplicationOAuthConfiguration | application_update_params.McpServerApplicationOAuthConfiguration | application_update_params.McpServerPortalApplicationOAuthConfiguration | Omit = omit, @@ -6511,7 +6511,7 @@ async def update( | SequenceNotStr[application_update_params.GatewayIdentityProxyEndpointApplicationPolicy] | SequenceNotStr[application_update_params.BookmarkApplicationPolicy] | Iterable[application_update_params.InfrastructureApplicationPolicy] - | SequenceNotStr[application_update_params.BrowserRdpApplicationPolicy] + | SequenceNotStr[application_update_params.BrowserRDPApplicationPolicy] | SequenceNotStr[application_update_params.McpServerApplicationPolicy] | SequenceNotStr[application_update_params.McpServerPortalApplicationPolicy] | Omit = omit, @@ -6521,7 +6521,7 @@ async def update( | application_update_params.SaaSApplicationSCIMConfig | application_update_params.BrowserSSHApplicationSCIMConfig | application_update_params.BrowserVNCApplicationSCIMConfig - | application_update_params.BrowserRdpApplicationSCIMConfig + | application_update_params.BrowserRDPApplicationSCIMConfig | application_update_params.McpServerApplicationSCIMConfig | application_update_params.McpServerPortalApplicationSCIMConfig | Omit = omit, @@ -6539,7 +6539,7 @@ async def update( landing_page_design: application_update_params.AppLauncherApplicationLandingPageDesign | Omit = omit, skip_app_launcher_login_page: bool | Omit = omit, target_criteria: Iterable[application_update_params.InfrastructureApplicationTargetCriterion] - | Iterable[application_update_params.BrowserRdpApplicationTargetCriterion] + | Iterable[application_update_params.BrowserRDPApplicationTargetCriterion] | 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. diff --git a/src/cloudflare/types/zero_trust/access/application_create_params.py b/src/cloudflare/types/zero_trust/access/application_create_params.py index 2c78b1acc10..c1c5b442226 100644 --- a/src/cloudflare/types/zero_trust/access/application_create_params.py +++ b/src/cloudflare/types/zero_trust/access/application_create_params.py @@ -35,7 +35,7 @@ "SelfHostedApplicationPolicyAccessAppPolicyLink", "SelfHostedApplicationPolicyUnionMember2", "SelfHostedApplicationPolicyUnionMember2ConnectionRules", - "SelfHostedApplicationPolicyUnionMember2ConnectionRulesRdp", + "SelfHostedApplicationPolicyUnionMember2ConnectionRulesRDP", "SelfHostedApplicationPolicyUnionMember2MfaConfig", "SelfHostedApplicationSCIMConfig", "SelfHostedApplicationSCIMConfigAuthentication", @@ -47,7 +47,7 @@ "SaaSApplicationPolicyAccessAppPolicyLink", "SaaSApplicationPolicyUnionMember2", "SaaSApplicationPolicyUnionMember2ConnectionRules", - "SaaSApplicationPolicyUnionMember2ConnectionRulesRdp", + "SaaSApplicationPolicyUnionMember2ConnectionRulesRDP", "SaaSApplicationPolicyUnionMember2MfaConfig", "SaaSApplicationSaaSApp", "SaaSApplicationSCIMConfig", @@ -68,7 +68,7 @@ "BrowserSSHApplicationPolicyAccessAppPolicyLink", "BrowserSSHApplicationPolicyUnionMember2", "BrowserSSHApplicationPolicyUnionMember2ConnectionRules", - "BrowserSSHApplicationPolicyUnionMember2ConnectionRulesRdp", + "BrowserSSHApplicationPolicyUnionMember2ConnectionRulesRDP", "BrowserSSHApplicationPolicyUnionMember2MfaConfig", "BrowserSSHApplicationSCIMConfig", "BrowserSSHApplicationSCIMConfigAuthentication", @@ -88,7 +88,7 @@ "BrowserVNCApplicationPolicyAccessAppPolicyLink", "BrowserVNCApplicationPolicyUnionMember2", "BrowserVNCApplicationPolicyUnionMember2ConnectionRules", - "BrowserVNCApplicationPolicyUnionMember2ConnectionRulesRdp", + "BrowserVNCApplicationPolicyUnionMember2ConnectionRulesRDP", "BrowserVNCApplicationPolicyUnionMember2MfaConfig", "BrowserVNCApplicationSCIMConfig", "BrowserVNCApplicationSCIMConfigAuthentication", @@ -102,62 +102,62 @@ "AppLauncherApplicationPolicyAccessAppPolicyLink", "AppLauncherApplicationPolicyUnionMember2", "AppLauncherApplicationPolicyUnionMember2ConnectionRules", - "AppLauncherApplicationPolicyUnionMember2ConnectionRulesRdp", + "AppLauncherApplicationPolicyUnionMember2ConnectionRulesRDP", "AppLauncherApplicationPolicyUnionMember2MfaConfig", "DeviceEnrollmentPermissionsApplication", "DeviceEnrollmentPermissionsApplicationPolicy", "DeviceEnrollmentPermissionsApplicationPolicyAccessAppPolicyLink", "DeviceEnrollmentPermissionsApplicationPolicyUnionMember2", "DeviceEnrollmentPermissionsApplicationPolicyUnionMember2ConnectionRules", - "DeviceEnrollmentPermissionsApplicationPolicyUnionMember2ConnectionRulesRdp", + "DeviceEnrollmentPermissionsApplicationPolicyUnionMember2ConnectionRulesRDP", "DeviceEnrollmentPermissionsApplicationPolicyUnionMember2MfaConfig", "BrowserIsolationPermissionsApplication", "BrowserIsolationPermissionsApplicationPolicy", "BrowserIsolationPermissionsApplicationPolicyAccessAppPolicyLink", "BrowserIsolationPermissionsApplicationPolicyUnionMember2", "BrowserIsolationPermissionsApplicationPolicyUnionMember2ConnectionRules", - "BrowserIsolationPermissionsApplicationPolicyUnionMember2ConnectionRulesRdp", + "BrowserIsolationPermissionsApplicationPolicyUnionMember2ConnectionRulesRDP", "BrowserIsolationPermissionsApplicationPolicyUnionMember2MfaConfig", "GatewayIdentityProxyEndpointApplication", "GatewayIdentityProxyEndpointApplicationPolicy", "GatewayIdentityProxyEndpointApplicationPolicyAccessAppPolicyLink", "GatewayIdentityProxyEndpointApplicationPolicyUnionMember2", "GatewayIdentityProxyEndpointApplicationPolicyUnionMember2ConnectionRules", - "GatewayIdentityProxyEndpointApplicationPolicyUnionMember2ConnectionRulesRdp", + "GatewayIdentityProxyEndpointApplicationPolicyUnionMember2ConnectionRulesRDP", "GatewayIdentityProxyEndpointApplicationPolicyUnionMember2MfaConfig", "BookmarkApplication", "BookmarkApplicationPolicy", "BookmarkApplicationPolicyAccessAppPolicyLink", "BookmarkApplicationPolicyUnionMember2", "BookmarkApplicationPolicyUnionMember2ConnectionRules", - "BookmarkApplicationPolicyUnionMember2ConnectionRulesRdp", + "BookmarkApplicationPolicyUnionMember2ConnectionRulesRDP", "BookmarkApplicationPolicyUnionMember2MfaConfig", "InfrastructureApplication", "InfrastructureApplicationTargetCriterion", "InfrastructureApplicationPolicy", "InfrastructureApplicationPolicyConnectionRules", "InfrastructureApplicationPolicyConnectionRulesSSH", - "BrowserRdpApplication", - "BrowserRdpApplicationTargetCriterion", - "BrowserRdpApplicationDestination", - "BrowserRdpApplicationDestinationPublicDestination", - "BrowserRdpApplicationDestinationPrivateDestination", - "BrowserRdpApplicationDestinationViaMcpServerPortalDestination", - "BrowserRdpApplicationMfaConfig", - "BrowserRdpApplicationOAuthConfiguration", - "BrowserRdpApplicationOAuthConfigurationDynamicClientRegistration", - "BrowserRdpApplicationOAuthConfigurationGrant", - "BrowserRdpApplicationPolicy", - "BrowserRdpApplicationPolicyAccessAppPolicyLink", - "BrowserRdpApplicationPolicyUnionMember2", - "BrowserRdpApplicationPolicyUnionMember2ConnectionRules", - "BrowserRdpApplicationPolicyUnionMember2ConnectionRulesRdp", - "BrowserRdpApplicationPolicyUnionMember2MfaConfig", - "BrowserRdpApplicationSCIMConfig", - "BrowserRdpApplicationSCIMConfigAuthentication", - "BrowserRdpApplicationSCIMConfigAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken", - "BrowserRdpApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthentication", - "BrowserRdpApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken", + "BrowserRDPApplication", + "BrowserRDPApplicationTargetCriterion", + "BrowserRDPApplicationDestination", + "BrowserRDPApplicationDestinationPublicDestination", + "BrowserRDPApplicationDestinationPrivateDestination", + "BrowserRDPApplicationDestinationViaMcpServerPortalDestination", + "BrowserRDPApplicationMfaConfig", + "BrowserRDPApplicationOAuthConfiguration", + "BrowserRDPApplicationOAuthConfigurationDynamicClientRegistration", + "BrowserRDPApplicationOAuthConfigurationGrant", + "BrowserRDPApplicationPolicy", + "BrowserRDPApplicationPolicyAccessAppPolicyLink", + "BrowserRDPApplicationPolicyUnionMember2", + "BrowserRDPApplicationPolicyUnionMember2ConnectionRules", + "BrowserRDPApplicationPolicyUnionMember2ConnectionRulesRDP", + "BrowserRDPApplicationPolicyUnionMember2MfaConfig", + "BrowserRDPApplicationSCIMConfig", + "BrowserRDPApplicationSCIMConfigAuthentication", + "BrowserRDPApplicationSCIMConfigAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken", + "BrowserRDPApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthentication", + "BrowserRDPApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken", "McpServerApplication", "McpServerApplicationDestination", "McpServerApplicationDestinationPublicDestination", @@ -170,7 +170,7 @@ "McpServerApplicationPolicyAccessAppPolicyLink", "McpServerApplicationPolicyUnionMember2", "McpServerApplicationPolicyUnionMember2ConnectionRules", - "McpServerApplicationPolicyUnionMember2ConnectionRulesRdp", + "McpServerApplicationPolicyUnionMember2ConnectionRulesRDP", "McpServerApplicationPolicyUnionMember2MfaConfig", "McpServerApplicationSCIMConfig", "McpServerApplicationSCIMConfigAuthentication", @@ -189,7 +189,7 @@ "McpServerPortalApplicationPolicyAccessAppPolicyLink", "McpServerPortalApplicationPolicyUnionMember2", "McpServerPortalApplicationPolicyUnionMember2ConnectionRules", - "McpServerPortalApplicationPolicyUnionMember2ConnectionRulesRdp", + "McpServerPortalApplicationPolicyUnionMember2ConnectionRulesRDP", "McpServerPortalApplicationPolicyUnionMember2MfaConfig", "McpServerPortalApplicationSCIMConfig", "McpServerPortalApplicationSCIMConfigAuthentication", @@ -531,7 +531,7 @@ class SelfHostedApplicationPolicyAccessAppPolicyLink(TypedDict, total=False): """ -class SelfHostedApplicationPolicyUnionMember2ConnectionRulesRdp(TypedDict, total=False): +class SelfHostedApplicationPolicyUnionMember2ConnectionRulesRDP(TypedDict, total=False): """The RDP-specific rules that define clipboard behavior for RDP connections.""" allowed_clipboard_local_to_remote_formats: List[Literal["text"]] @@ -550,7 +550,7 @@ class SelfHostedApplicationPolicyUnionMember2ConnectionRules(TypedDict, total=Fa The rules that define how users may connect to targets secured by your application. """ - rdp: SelfHostedApplicationPolicyUnionMember2ConnectionRulesRdp + rdp: SelfHostedApplicationPolicyUnionMember2ConnectionRulesRDP """The RDP-specific rules that define clipboard behavior for RDP connections.""" @@ -799,7 +799,7 @@ class SaaSApplicationPolicyAccessAppPolicyLink(TypedDict, total=False): """ -class SaaSApplicationPolicyUnionMember2ConnectionRulesRdp(TypedDict, total=False): +class SaaSApplicationPolicyUnionMember2ConnectionRulesRDP(TypedDict, total=False): """The RDP-specific rules that define clipboard behavior for RDP connections.""" allowed_clipboard_local_to_remote_formats: List[Literal["text"]] @@ -818,7 +818,7 @@ class SaaSApplicationPolicyUnionMember2ConnectionRules(TypedDict, total=False): The rules that define how users may connect to targets secured by your application. """ - rdp: SaaSApplicationPolicyUnionMember2ConnectionRulesRdp + rdp: SaaSApplicationPolicyUnionMember2ConnectionRulesRDP """The RDP-specific rules that define clipboard behavior for RDP connections.""" @@ -1345,7 +1345,7 @@ class BrowserSSHApplicationPolicyAccessAppPolicyLink(TypedDict, total=False): """ -class BrowserSSHApplicationPolicyUnionMember2ConnectionRulesRdp(TypedDict, total=False): +class BrowserSSHApplicationPolicyUnionMember2ConnectionRulesRDP(TypedDict, total=False): """The RDP-specific rules that define clipboard behavior for RDP connections.""" allowed_clipboard_local_to_remote_formats: List[Literal["text"]] @@ -1364,7 +1364,7 @@ class BrowserSSHApplicationPolicyUnionMember2ConnectionRules(TypedDict, total=Fa The rules that define how users may connect to targets secured by your application. """ - rdp: BrowserSSHApplicationPolicyUnionMember2ConnectionRulesRdp + rdp: BrowserSSHApplicationPolicyUnionMember2ConnectionRulesRDP """The RDP-specific rules that define clipboard behavior for RDP connections.""" @@ -1891,7 +1891,7 @@ class BrowserVNCApplicationPolicyAccessAppPolicyLink(TypedDict, total=False): """ -class BrowserVNCApplicationPolicyUnionMember2ConnectionRulesRdp(TypedDict, total=False): +class BrowserVNCApplicationPolicyUnionMember2ConnectionRulesRDP(TypedDict, total=False): """The RDP-specific rules that define clipboard behavior for RDP connections.""" allowed_clipboard_local_to_remote_formats: List[Literal["text"]] @@ -1910,7 +1910,7 @@ class BrowserVNCApplicationPolicyUnionMember2ConnectionRules(TypedDict, total=Fa The rules that define how users may connect to targets secured by your application. """ - rdp: BrowserVNCApplicationPolicyUnionMember2ConnectionRulesRdp + rdp: BrowserVNCApplicationPolicyUnionMember2ConnectionRulesRDP """The RDP-specific rules that define clipboard behavior for RDP connections.""" @@ -2217,7 +2217,7 @@ class AppLauncherApplicationPolicyAccessAppPolicyLink(TypedDict, total=False): """ -class AppLauncherApplicationPolicyUnionMember2ConnectionRulesRdp(TypedDict, total=False): +class AppLauncherApplicationPolicyUnionMember2ConnectionRulesRDP(TypedDict, total=False): """The RDP-specific rules that define clipboard behavior for RDP connections.""" allowed_clipboard_local_to_remote_formats: List[Literal["text"]] @@ -2236,7 +2236,7 @@ class AppLauncherApplicationPolicyUnionMember2ConnectionRules(TypedDict, total=F The rules that define how users may connect to targets secured by your application. """ - rdp: AppLauncherApplicationPolicyUnionMember2ConnectionRulesRdp + rdp: AppLauncherApplicationPolicyUnionMember2ConnectionRulesRDP """The RDP-specific rules that define clipboard behavior for RDP connections.""" @@ -2381,7 +2381,7 @@ class DeviceEnrollmentPermissionsApplicationPolicyAccessAppPolicyLink(TypedDict, """ -class DeviceEnrollmentPermissionsApplicationPolicyUnionMember2ConnectionRulesRdp(TypedDict, total=False): +class DeviceEnrollmentPermissionsApplicationPolicyUnionMember2ConnectionRulesRDP(TypedDict, total=False): """The RDP-specific rules that define clipboard behavior for RDP connections.""" allowed_clipboard_local_to_remote_formats: List[Literal["text"]] @@ -2400,7 +2400,7 @@ class DeviceEnrollmentPermissionsApplicationPolicyUnionMember2ConnectionRules(Ty The rules that define how users may connect to targets secured by your application. """ - rdp: DeviceEnrollmentPermissionsApplicationPolicyUnionMember2ConnectionRulesRdp + rdp: DeviceEnrollmentPermissionsApplicationPolicyUnionMember2ConnectionRulesRDP """The RDP-specific rules that define clipboard behavior for RDP connections.""" @@ -2547,7 +2547,7 @@ class BrowserIsolationPermissionsApplicationPolicyAccessAppPolicyLink(TypedDict, """ -class BrowserIsolationPermissionsApplicationPolicyUnionMember2ConnectionRulesRdp(TypedDict, total=False): +class BrowserIsolationPermissionsApplicationPolicyUnionMember2ConnectionRulesRDP(TypedDict, total=False): """The RDP-specific rules that define clipboard behavior for RDP connections.""" allowed_clipboard_local_to_remote_formats: List[Literal["text"]] @@ -2566,7 +2566,7 @@ class BrowserIsolationPermissionsApplicationPolicyUnionMember2ConnectionRules(Ty The rules that define how users may connect to targets secured by your application. """ - rdp: BrowserIsolationPermissionsApplicationPolicyUnionMember2ConnectionRulesRdp + rdp: BrowserIsolationPermissionsApplicationPolicyUnionMember2ConnectionRulesRDP """The RDP-specific rules that define clipboard behavior for RDP connections.""" @@ -2722,7 +2722,7 @@ class GatewayIdentityProxyEndpointApplicationPolicyAccessAppPolicyLink(TypedDict """ -class GatewayIdentityProxyEndpointApplicationPolicyUnionMember2ConnectionRulesRdp(TypedDict, total=False): +class GatewayIdentityProxyEndpointApplicationPolicyUnionMember2ConnectionRulesRDP(TypedDict, total=False): """The RDP-specific rules that define clipboard behavior for RDP connections.""" allowed_clipboard_local_to_remote_formats: List[Literal["text"]] @@ -2741,7 +2741,7 @@ class GatewayIdentityProxyEndpointApplicationPolicyUnionMember2ConnectionRules(T The rules that define how users may connect to targets secured by your application. """ - rdp: GatewayIdentityProxyEndpointApplicationPolicyUnionMember2ConnectionRulesRdp + rdp: GatewayIdentityProxyEndpointApplicationPolicyUnionMember2ConnectionRulesRDP """The RDP-specific rules that define clipboard behavior for RDP connections.""" @@ -2870,7 +2870,7 @@ class BookmarkApplicationPolicyAccessAppPolicyLink(TypedDict, total=False): """ -class BookmarkApplicationPolicyUnionMember2ConnectionRulesRdp(TypedDict, total=False): +class BookmarkApplicationPolicyUnionMember2ConnectionRulesRDP(TypedDict, total=False): """The RDP-specific rules that define clipboard behavior for RDP connections.""" allowed_clipboard_local_to_remote_formats: List[Literal["text"]] @@ -2889,7 +2889,7 @@ class BookmarkApplicationPolicyUnionMember2ConnectionRules(TypedDict, total=Fals The rules that define how users may connect to targets secured by your application. """ - rdp: BookmarkApplicationPolicyUnionMember2ConnectionRulesRdp + rdp: BookmarkApplicationPolicyUnionMember2ConnectionRulesRDP """The RDP-specific rules that define clipboard behavior for RDP connections.""" @@ -3059,14 +3059,14 @@ class InfrastructureApplicationPolicy(TypedDict, total=False): """ -class BrowserRdpApplication(TypedDict, total=False): +class BrowserRDPApplication(TypedDict, total=False): domain: Required[str] """The primary hostname and path secured by Access. This domain will be displayed if the app is visible in the App Launcher. """ - target_criteria: Required[Iterable[BrowserRdpApplicationTargetCriterion]] + target_criteria: Required[Iterable[BrowserRDPApplicationTargetCriterion]] type: Required[ApplicationType] """The application type.""" @@ -3128,7 +3128,7 @@ class BrowserRdpApplication(TypedDict, total=False): custom_pages: SequenceNotStr[str] """The custom pages that will be displayed when applicable for this application""" - destinations: Iterable[BrowserRdpApplicationDestination] + destinations: Iterable[BrowserRDPApplicationDestination] """List of destinations secured by Access. This supersedes `self_hosted_domains` to allow for more flexibility in defining @@ -3151,13 +3151,13 @@ class BrowserRdpApplication(TypedDict, total=False): logo_url: str """The image URL for the logo shown in the App Launcher dashboard.""" - mfa_config: BrowserRdpApplicationMfaConfig + mfa_config: BrowserRDPApplicationMfaConfig """Configures multi-factor authentication (MFA) settings.""" name: str """The name of the application.""" - oauth_configuration: BrowserRdpApplicationOAuthConfiguration + oauth_configuration: BrowserRDPApplicationOAuthConfiguration """ **Beta:** Optional configuration for managing an OAuth authorization flow controlled by Access. When set, Access will act as the OAuth authorization @@ -3178,7 +3178,7 @@ class BrowserRdpApplication(TypedDict, total=False): If disabled, the JWT will scope to the hostname by default """ - policies: SequenceNotStr[BrowserRdpApplicationPolicy] + policies: SequenceNotStr[BrowserRDPApplicationPolicy] """ The policies that Access applies to the application, in ascending order of precedence. Items can reference existing policies or create new policies @@ -3202,7 +3202,7 @@ class BrowserRdpApplication(TypedDict, total=False): attacks. """ - scim_config: BrowserRdpApplicationSCIMConfig + scim_config: BrowserRDPApplicationSCIMConfig """Configuration for provisioning to this application via SCIM. This is currently in closed beta. @@ -3244,7 +3244,7 @@ class BrowserRdpApplication(TypedDict, total=False): """ -class BrowserRdpApplicationTargetCriterion(TypedDict, total=False): +class BrowserRDPApplicationTargetCriterion(TypedDict, total=False): port: Required[int] """The port that the targets use for the chosen communication protocol. @@ -3258,7 +3258,7 @@ class BrowserRdpApplicationTargetCriterion(TypedDict, total=False): """Contains a map of target attribute keys to target attribute values.""" -class BrowserRdpApplicationDestinationPublicDestination(TypedDict, total=False): +class BrowserRDPApplicationDestinationPublicDestination(TypedDict, total=False): """A public hostname that Access will secure. Public destinations support sub-domain and path. Wildcard '*' can be used in the definition. @@ -3274,7 +3274,7 @@ class BrowserRdpApplicationDestinationPublicDestination(TypedDict, total=False): """ -class BrowserRdpApplicationDestinationPrivateDestination(TypedDict, total=False): +class BrowserRDPApplicationDestinationPrivateDestination(TypedDict, total=False): cidr: str """The CIDR range of the destination. Single IPs will be computed as /32.""" @@ -3299,7 +3299,7 @@ class BrowserRdpApplicationDestinationPrivateDestination(TypedDict, total=False) """The VNET ID to match the destination. When omitted, all VNETs will match.""" -class BrowserRdpApplicationDestinationViaMcpServerPortalDestination(TypedDict, total=False): +class BrowserRDPApplicationDestinationViaMcpServerPortalDestination(TypedDict, total=False): """A MCP server id configured in ai-controls. Access will secure the MCP server if accessed through a MCP portal. @@ -3311,14 +3311,14 @@ class BrowserRdpApplicationDestinationViaMcpServerPortalDestination(TypedDict, t type: Literal["via_mcp_server_portal"] -BrowserRdpApplicationDestination: TypeAlias = Union[ - BrowserRdpApplicationDestinationPublicDestination, - BrowserRdpApplicationDestinationPrivateDestination, - BrowserRdpApplicationDestinationViaMcpServerPortalDestination, +BrowserRDPApplicationDestination: TypeAlias = Union[ + BrowserRDPApplicationDestinationPublicDestination, + BrowserRDPApplicationDestinationPrivateDestination, + BrowserRDPApplicationDestinationViaMcpServerPortalDestination, ] -class BrowserRdpApplicationMfaConfig(TypedDict, total=False): +class BrowserRDPApplicationMfaConfig(TypedDict, total=False): """Configures multi-factor authentication (MFA) settings.""" allowed_authenticators: List[Literal["totp", "biometrics", "security_key"]] @@ -3338,7 +3338,7 @@ class BrowserRdpApplicationMfaConfig(TypedDict, total=False): """ -class BrowserRdpApplicationOAuthConfigurationDynamicClientRegistration(TypedDict, total=False): +class BrowserRDPApplicationOAuthConfigurationDynamicClientRegistration(TypedDict, total=False): """Settings for OAuth dynamic client registration.""" allow_any_on_localhost: bool @@ -3357,7 +3357,7 @@ class BrowserRdpApplicationOAuthConfigurationDynamicClientRegistration(TypedDict """Whether dynamic client registration is enabled.""" -class BrowserRdpApplicationOAuthConfigurationGrant(TypedDict, total=False): +class BrowserRDPApplicationOAuthConfigurationGrant(TypedDict, total=False): """Settings for OAuth grant behavior.""" access_token_lifetime: str @@ -3375,12 +3375,12 @@ class BrowserRdpApplicationOAuthConfigurationGrant(TypedDict, total=False): """ -class BrowserRdpApplicationOAuthConfiguration(TypedDict, total=False): +class BrowserRDPApplicationOAuthConfiguration(TypedDict, total=False): """ **Beta:** Optional configuration for managing an OAuth authorization flow controlled by Access. When set, Access will act as the OAuth authorization server for this application. Only compatible with OAuth clients that support [RFC 8707](https://datatracker.ietf.org/doc/html/rfc8707) (Resource Indicators for OAuth 2.0). This feature is currently in beta. """ - dynamic_client_registration: BrowserRdpApplicationOAuthConfigurationDynamicClientRegistration + dynamic_client_registration: BrowserRDPApplicationOAuthConfigurationDynamicClientRegistration """Settings for OAuth dynamic client registration.""" enabled: bool @@ -3390,11 +3390,11 @@ class BrowserRdpApplicationOAuthConfiguration(TypedDict, total=False): to `true` if omitted. """ - grant: BrowserRdpApplicationOAuthConfigurationGrant + grant: BrowserRDPApplicationOAuthConfigurationGrant """Settings for OAuth grant behavior.""" -class BrowserRdpApplicationPolicyAccessAppPolicyLink(TypedDict, total=False): +class BrowserRDPApplicationPolicyAccessAppPolicyLink(TypedDict, total=False): """A JSON that links a reusable policy to an application.""" id: str @@ -3407,7 +3407,7 @@ class BrowserRdpApplicationPolicyAccessAppPolicyLink(TypedDict, total=False): """ -class BrowserRdpApplicationPolicyUnionMember2ConnectionRulesRdp(TypedDict, total=False): +class BrowserRDPApplicationPolicyUnionMember2ConnectionRulesRDP(TypedDict, total=False): """The RDP-specific rules that define clipboard behavior for RDP connections.""" allowed_clipboard_local_to_remote_formats: List[Literal["text"]] @@ -3421,16 +3421,16 @@ class BrowserRdpApplicationPolicyUnionMember2ConnectionRulesRdp(TypedDict, total """ -class BrowserRdpApplicationPolicyUnionMember2ConnectionRules(TypedDict, total=False): +class BrowserRDPApplicationPolicyUnionMember2ConnectionRules(TypedDict, total=False): """ The rules that define how users may connect to targets secured by your application. """ - rdp: BrowserRdpApplicationPolicyUnionMember2ConnectionRulesRdp + rdp: BrowserRDPApplicationPolicyUnionMember2ConnectionRulesRDP """The RDP-specific rules that define clipboard behavior for RDP connections.""" -class BrowserRdpApplicationPolicyUnionMember2MfaConfig(TypedDict, total=False): +class BrowserRDPApplicationPolicyUnionMember2MfaConfig(TypedDict, total=False): """Configures multi-factor authentication (MFA) settings.""" allowed_authenticators: List[Literal["totp", "biometrics", "security_key"]] @@ -3450,7 +3450,7 @@ class BrowserRdpApplicationPolicyUnionMember2MfaConfig(TypedDict, total=False): """ -class BrowserRdpApplicationPolicyUnionMember2(TypedDict, total=False): +class BrowserRDPApplicationPolicyUnionMember2(TypedDict, total=False): id: str """The UUID of the policy""" @@ -3463,7 +3463,7 @@ class BrowserRdpApplicationPolicyUnionMember2(TypedDict, total=False): session. """ - connection_rules: BrowserRdpApplicationPolicyUnionMember2ConnectionRules + connection_rules: BrowserRDPApplicationPolicyUnionMember2ConnectionRules """ The rules that define how users may connect to targets secured by your application. @@ -3476,7 +3476,7 @@ class BrowserRdpApplicationPolicyUnionMember2(TypedDict, total=False): this feature. """ - mfa_config: BrowserRdpApplicationPolicyUnionMember2MfaConfig + mfa_config: BrowserRDPApplicationPolicyUnionMember2MfaConfig """Configures multi-factor authentication (MFA) settings.""" precedence: int @@ -3499,12 +3499,12 @@ class BrowserRdpApplicationPolicyUnionMember2(TypedDict, total=False): """ -BrowserRdpApplicationPolicy: TypeAlias = Union[ - BrowserRdpApplicationPolicyAccessAppPolicyLink, str, BrowserRdpApplicationPolicyUnionMember2 +BrowserRDPApplicationPolicy: TypeAlias = Union[ + BrowserRDPApplicationPolicyAccessAppPolicyLink, str, BrowserRDPApplicationPolicyUnionMember2 ] -class BrowserRdpApplicationSCIMConfigAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken( +class BrowserRDPApplicationSCIMConfigAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken( TypedDict, total=False ): """ @@ -3527,7 +3527,7 @@ class BrowserRdpApplicationSCIMConfigAuthenticationAccessSCIMConfigAuthenticatio """The authentication scheme to use when making SCIM requests to this application.""" -class BrowserRdpApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken( +class BrowserRDPApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken( TypedDict, total=False ): """ @@ -3550,23 +3550,23 @@ class BrowserRdpApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthenti """The authentication scheme to use when making SCIM requests to this application.""" -BrowserRdpApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthentication: TypeAlias = Union[ +BrowserRDPApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthentication: TypeAlias = Union[ SCIMConfigAuthenticationHTTPBasicParam, SCIMConfigAuthenticationOAuthBearerTokenParam, SCIMConfigAuthenticationOauth2Param, - BrowserRdpApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken, + BrowserRDPApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken, ] -BrowserRdpApplicationSCIMConfigAuthentication: TypeAlias = Union[ +BrowserRDPApplicationSCIMConfigAuthentication: TypeAlias = Union[ SCIMConfigAuthenticationHTTPBasicParam, SCIMConfigAuthenticationOAuthBearerTokenParam, SCIMConfigAuthenticationOauth2Param, - BrowserRdpApplicationSCIMConfigAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken, - Iterable[BrowserRdpApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthentication], + BrowserRDPApplicationSCIMConfigAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken, + Iterable[BrowserRDPApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthentication], ] -class BrowserRdpApplicationSCIMConfig(TypedDict, total=False): +class BrowserRDPApplicationSCIMConfig(TypedDict, total=False): """Configuration for provisioning to this application via SCIM. This is currently in closed beta. @@ -3581,7 +3581,7 @@ class BrowserRdpApplicationSCIMConfig(TypedDict, total=False): remote_uri: Required[str] """The base URI for the application's SCIM-compatible API.""" - authentication: BrowserRdpApplicationSCIMConfigAuthentication + authentication: BrowserRDPApplicationSCIMConfigAuthentication """ Attributes for configuring HTTP Basic authentication scheme for SCIM provisioning to an application. @@ -3854,7 +3854,7 @@ class McpServerApplicationPolicyAccessAppPolicyLink(TypedDict, total=False): """ -class McpServerApplicationPolicyUnionMember2ConnectionRulesRdp(TypedDict, total=False): +class McpServerApplicationPolicyUnionMember2ConnectionRulesRDP(TypedDict, total=False): """The RDP-specific rules that define clipboard behavior for RDP connections.""" allowed_clipboard_local_to_remote_formats: List[Literal["text"]] @@ -3873,7 +3873,7 @@ class McpServerApplicationPolicyUnionMember2ConnectionRules(TypedDict, total=Fal The rules that define how users may connect to targets secured by your application. """ - rdp: McpServerApplicationPolicyUnionMember2ConnectionRulesRdp + rdp: McpServerApplicationPolicyUnionMember2ConnectionRulesRDP """The RDP-specific rules that define clipboard behavior for RDP connections.""" @@ -4307,7 +4307,7 @@ class McpServerPortalApplicationPolicyAccessAppPolicyLink(TypedDict, total=False """ -class McpServerPortalApplicationPolicyUnionMember2ConnectionRulesRdp(TypedDict, total=False): +class McpServerPortalApplicationPolicyUnionMember2ConnectionRulesRDP(TypedDict, total=False): """The RDP-specific rules that define clipboard behavior for RDP connections.""" allowed_clipboard_local_to_remote_formats: List[Literal["text"]] @@ -4326,7 +4326,7 @@ class McpServerPortalApplicationPolicyUnionMember2ConnectionRules(TypedDict, tot The rules that define how users may connect to targets secured by your application. """ - rdp: McpServerPortalApplicationPolicyUnionMember2ConnectionRulesRdp + rdp: McpServerPortalApplicationPolicyUnionMember2ConnectionRulesRDP """The RDP-specific rules that define clipboard behavior for RDP connections.""" @@ -4515,7 +4515,7 @@ class McpServerPortalApplicationSCIMConfig(TypedDict, total=False): GatewayIdentityProxyEndpointApplication, BookmarkApplication, InfrastructureApplication, - BrowserRdpApplication, + BrowserRDPApplication, McpServerApplication, McpServerPortalApplication, ] diff --git a/src/cloudflare/types/zero_trust/access/application_create_response.py b/src/cloudflare/types/zero_trust/access/application_create_response.py index f70d6c04489..55500554b08 100644 --- a/src/cloudflare/types/zero_trust/access/application_create_response.py +++ b/src/cloudflare/types/zero_trust/access/application_create_response.py @@ -32,7 +32,7 @@ "SelfHostedApplicationOAuthConfigurationGrant", "SelfHostedApplicationPolicy", "SelfHostedApplicationPolicyConnectionRules", - "SelfHostedApplicationPolicyConnectionRulesRdp", + "SelfHostedApplicationPolicyConnectionRulesRDP", "SelfHostedApplicationPolicyMfaConfig", "SelfHostedApplicationSCIMConfig", "SelfHostedApplicationSCIMConfigAuthentication", @@ -42,7 +42,7 @@ "SaaSApplication", "SaaSApplicationPolicy", "SaaSApplicationPolicyConnectionRules", - "SaaSApplicationPolicyConnectionRulesRdp", + "SaaSApplicationPolicyConnectionRulesRDP", "SaaSApplicationPolicyMfaConfig", "SaaSApplicationSaaSApp", "SaaSApplicationSCIMConfig", @@ -61,7 +61,7 @@ "BrowserSSHApplicationOAuthConfigurationGrant", "BrowserSSHApplicationPolicy", "BrowserSSHApplicationPolicyConnectionRules", - "BrowserSSHApplicationPolicyConnectionRulesRdp", + "BrowserSSHApplicationPolicyConnectionRulesRDP", "BrowserSSHApplicationPolicyMfaConfig", "BrowserSSHApplicationSCIMConfig", "BrowserSSHApplicationSCIMConfigAuthentication", @@ -79,7 +79,7 @@ "BrowserVNCApplicationOAuthConfigurationGrant", "BrowserVNCApplicationPolicy", "BrowserVNCApplicationPolicyConnectionRules", - "BrowserVNCApplicationPolicyConnectionRulesRdp", + "BrowserVNCApplicationPolicyConnectionRulesRDP", "BrowserVNCApplicationPolicyMfaConfig", "BrowserVNCApplicationSCIMConfig", "BrowserVNCApplicationSCIMConfigAuthentication", @@ -91,52 +91,52 @@ "AppLauncherApplicationLandingPageDesign", "AppLauncherApplicationPolicy", "AppLauncherApplicationPolicyConnectionRules", - "AppLauncherApplicationPolicyConnectionRulesRdp", + "AppLauncherApplicationPolicyConnectionRulesRDP", "AppLauncherApplicationPolicyMfaConfig", "DeviceEnrollmentPermissionsApplication", "DeviceEnrollmentPermissionsApplicationPolicy", "DeviceEnrollmentPermissionsApplicationPolicyConnectionRules", - "DeviceEnrollmentPermissionsApplicationPolicyConnectionRulesRdp", + "DeviceEnrollmentPermissionsApplicationPolicyConnectionRulesRDP", "DeviceEnrollmentPermissionsApplicationPolicyMfaConfig", "BrowserIsolationPermissionsApplication", "BrowserIsolationPermissionsApplicationPolicy", "BrowserIsolationPermissionsApplicationPolicyConnectionRules", - "BrowserIsolationPermissionsApplicationPolicyConnectionRulesRdp", + "BrowserIsolationPermissionsApplicationPolicyConnectionRulesRDP", "BrowserIsolationPermissionsApplicationPolicyMfaConfig", "GatewayIdentityProxyEndpointApplication", "GatewayIdentityProxyEndpointApplicationPolicy", "GatewayIdentityProxyEndpointApplicationPolicyConnectionRules", - "GatewayIdentityProxyEndpointApplicationPolicyConnectionRulesRdp", + "GatewayIdentityProxyEndpointApplicationPolicyConnectionRulesRDP", "GatewayIdentityProxyEndpointApplicationPolicyMfaConfig", "BookmarkApplication", "BookmarkApplicationPolicy", "BookmarkApplicationPolicyConnectionRules", - "BookmarkApplicationPolicyConnectionRulesRdp", + "BookmarkApplicationPolicyConnectionRulesRDP", "BookmarkApplicationPolicyMfaConfig", "InfrastructureApplication", "InfrastructureApplicationTargetCriterion", "InfrastructureApplicationPolicy", "InfrastructureApplicationPolicyConnectionRules", "InfrastructureApplicationPolicyConnectionRulesSSH", - "BrowserRdpApplication", - "BrowserRdpApplicationTargetCriterion", - "BrowserRdpApplicationDestination", - "BrowserRdpApplicationDestinationPublicDestination", - "BrowserRdpApplicationDestinationPrivateDestination", - "BrowserRdpApplicationDestinationViaMcpServerPortalDestination", - "BrowserRdpApplicationMfaConfig", - "BrowserRdpApplicationOAuthConfiguration", - "BrowserRdpApplicationOAuthConfigurationDynamicClientRegistration", - "BrowserRdpApplicationOAuthConfigurationGrant", - "BrowserRdpApplicationPolicy", - "BrowserRdpApplicationPolicyConnectionRules", - "BrowserRdpApplicationPolicyConnectionRulesRdp", - "BrowserRdpApplicationPolicyMfaConfig", - "BrowserRdpApplicationSCIMConfig", - "BrowserRdpApplicationSCIMConfigAuthentication", - "BrowserRdpApplicationSCIMConfigAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken", - "BrowserRdpApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthentication", - "BrowserRdpApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken", + "BrowserRDPApplication", + "BrowserRDPApplicationTargetCriterion", + "BrowserRDPApplicationDestination", + "BrowserRDPApplicationDestinationPublicDestination", + "BrowserRDPApplicationDestinationPrivateDestination", + "BrowserRDPApplicationDestinationViaMcpServerPortalDestination", + "BrowserRDPApplicationMfaConfig", + "BrowserRDPApplicationOAuthConfiguration", + "BrowserRDPApplicationOAuthConfigurationDynamicClientRegistration", + "BrowserRDPApplicationOAuthConfigurationGrant", + "BrowserRDPApplicationPolicy", + "BrowserRDPApplicationPolicyConnectionRules", + "BrowserRDPApplicationPolicyConnectionRulesRDP", + "BrowserRDPApplicationPolicyMfaConfig", + "BrowserRDPApplicationSCIMConfig", + "BrowserRDPApplicationSCIMConfigAuthentication", + "BrowserRDPApplicationSCIMConfigAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken", + "BrowserRDPApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthentication", + "BrowserRDPApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken", "McpServerApplication", "McpServerApplicationDestination", "McpServerApplicationDestinationPublicDestination", @@ -147,7 +147,7 @@ "McpServerApplicationOAuthConfigurationGrant", "McpServerApplicationPolicy", "McpServerApplicationPolicyConnectionRules", - "McpServerApplicationPolicyConnectionRulesRdp", + "McpServerApplicationPolicyConnectionRulesRDP", "McpServerApplicationPolicyMfaConfig", "McpServerApplicationSCIMConfig", "McpServerApplicationSCIMConfigAuthentication", @@ -164,7 +164,7 @@ "McpServerPortalApplicationOAuthConfigurationGrant", "McpServerPortalApplicationPolicy", "McpServerPortalApplicationPolicyConnectionRules", - "McpServerPortalApplicationPolicyConnectionRulesRdp", + "McpServerPortalApplicationPolicyConnectionRulesRDP", "McpServerPortalApplicationPolicyMfaConfig", "McpServerPortalApplicationSCIMConfig", "McpServerPortalApplicationSCIMConfigAuthentication", @@ -310,7 +310,7 @@ class SelfHostedApplicationOAuthConfiguration(BaseModel): """Settings for OAuth grant behavior.""" -class SelfHostedApplicationPolicyConnectionRulesRdp(BaseModel): +class SelfHostedApplicationPolicyConnectionRulesRDP(BaseModel): """The RDP-specific rules that define clipboard behavior for RDP connections.""" allowed_clipboard_local_to_remote_formats: Optional[List[Literal["text"]]] = None @@ -329,7 +329,7 @@ class SelfHostedApplicationPolicyConnectionRules(BaseModel): The rules that define how users may connect to targets secured by your application. """ - rdp: Optional[SelfHostedApplicationPolicyConnectionRulesRdp] = None + rdp: Optional[SelfHostedApplicationPolicyConnectionRulesRDP] = None """The RDP-specific rules that define clipboard behavior for RDP connections.""" @@ -709,7 +709,7 @@ class SelfHostedApplication(BaseModel): """ -class SaaSApplicationPolicyConnectionRulesRdp(BaseModel): +class SaaSApplicationPolicyConnectionRulesRDP(BaseModel): """The RDP-specific rules that define clipboard behavior for RDP connections.""" allowed_clipboard_local_to_remote_formats: Optional[List[Literal["text"]]] = None @@ -728,7 +728,7 @@ class SaaSApplicationPolicyConnectionRules(BaseModel): The rules that define how users may connect to targets secured by your application. """ - rdp: Optional[SaaSApplicationPolicyConnectionRulesRdp] = None + rdp: Optional[SaaSApplicationPolicyConnectionRulesRDP] = None """The RDP-specific rules that define clipboard behavior for RDP connections.""" @@ -1122,7 +1122,7 @@ class BrowserSSHApplicationOAuthConfiguration(BaseModel): """Settings for OAuth grant behavior.""" -class BrowserSSHApplicationPolicyConnectionRulesRdp(BaseModel): +class BrowserSSHApplicationPolicyConnectionRulesRDP(BaseModel): """The RDP-specific rules that define clipboard behavior for RDP connections.""" allowed_clipboard_local_to_remote_formats: Optional[List[Literal["text"]]] = None @@ -1141,7 +1141,7 @@ class BrowserSSHApplicationPolicyConnectionRules(BaseModel): The rules that define how users may connect to targets secured by your application. """ - rdp: Optional[BrowserSSHApplicationPolicyConnectionRulesRdp] = None + rdp: Optional[BrowserSSHApplicationPolicyConnectionRulesRDP] = None """The RDP-specific rules that define clipboard behavior for RDP connections.""" @@ -1672,7 +1672,7 @@ class BrowserVNCApplicationOAuthConfiguration(BaseModel): """Settings for OAuth grant behavior.""" -class BrowserVNCApplicationPolicyConnectionRulesRdp(BaseModel): +class BrowserVNCApplicationPolicyConnectionRulesRDP(BaseModel): """The RDP-specific rules that define clipboard behavior for RDP connections.""" allowed_clipboard_local_to_remote_formats: Optional[List[Literal["text"]]] = None @@ -1691,7 +1691,7 @@ class BrowserVNCApplicationPolicyConnectionRules(BaseModel): The rules that define how users may connect to targets secured by your application. """ - rdp: Optional[BrowserVNCApplicationPolicyConnectionRulesRdp] = None + rdp: Optional[BrowserVNCApplicationPolicyConnectionRulesRDP] = None """The RDP-specific rules that define clipboard behavior for RDP connections.""" @@ -2113,7 +2113,7 @@ class AppLauncherApplicationLandingPageDesign(BaseModel): """The title shown on the landing page.""" -class AppLauncherApplicationPolicyConnectionRulesRdp(BaseModel): +class AppLauncherApplicationPolicyConnectionRulesRDP(BaseModel): """The RDP-specific rules that define clipboard behavior for RDP connections.""" allowed_clipboard_local_to_remote_formats: Optional[List[Literal["text"]]] = None @@ -2132,7 +2132,7 @@ class AppLauncherApplicationPolicyConnectionRules(BaseModel): The rules that define how users may connect to targets secured by your application. """ - rdp: Optional[AppLauncherApplicationPolicyConnectionRulesRdp] = None + rdp: Optional[AppLauncherApplicationPolicyConnectionRulesRDP] = None """The RDP-specific rules that define clipboard behavior for RDP connections.""" @@ -2327,7 +2327,7 @@ class AppLauncherApplication(BaseModel): """Determines when to skip the App Launcher landing page.""" -class DeviceEnrollmentPermissionsApplicationPolicyConnectionRulesRdp(BaseModel): +class DeviceEnrollmentPermissionsApplicationPolicyConnectionRulesRDP(BaseModel): """The RDP-specific rules that define clipboard behavior for RDP connections.""" allowed_clipboard_local_to_remote_formats: Optional[List[Literal["text"]]] = None @@ -2346,7 +2346,7 @@ class DeviceEnrollmentPermissionsApplicationPolicyConnectionRules(BaseModel): The rules that define how users may connect to targets secured by your application. """ - rdp: Optional[DeviceEnrollmentPermissionsApplicationPolicyConnectionRulesRdp] = None + rdp: Optional[DeviceEnrollmentPermissionsApplicationPolicyConnectionRulesRDP] = None """The RDP-specific rules that define clipboard behavior for RDP connections.""" @@ -2508,7 +2508,7 @@ class DeviceEnrollmentPermissionsApplication(BaseModel): """ -class BrowserIsolationPermissionsApplicationPolicyConnectionRulesRdp(BaseModel): +class BrowserIsolationPermissionsApplicationPolicyConnectionRulesRDP(BaseModel): """The RDP-specific rules that define clipboard behavior for RDP connections.""" allowed_clipboard_local_to_remote_formats: Optional[List[Literal["text"]]] = None @@ -2527,7 +2527,7 @@ class BrowserIsolationPermissionsApplicationPolicyConnectionRules(BaseModel): The rules that define how users may connect to targets secured by your application. """ - rdp: Optional[BrowserIsolationPermissionsApplicationPolicyConnectionRulesRdp] = None + rdp: Optional[BrowserIsolationPermissionsApplicationPolicyConnectionRulesRDP] = None """The RDP-specific rules that define clipboard behavior for RDP connections.""" @@ -2689,7 +2689,7 @@ class BrowserIsolationPermissionsApplication(BaseModel): """ -class GatewayIdentityProxyEndpointApplicationPolicyConnectionRulesRdp(BaseModel): +class GatewayIdentityProxyEndpointApplicationPolicyConnectionRulesRDP(BaseModel): """The RDP-specific rules that define clipboard behavior for RDP connections.""" allowed_clipboard_local_to_remote_formats: Optional[List[Literal["text"]]] = None @@ -2708,7 +2708,7 @@ class GatewayIdentityProxyEndpointApplicationPolicyConnectionRules(BaseModel): The rules that define how users may connect to targets secured by your application. """ - rdp: Optional[GatewayIdentityProxyEndpointApplicationPolicyConnectionRulesRdp] = None + rdp: Optional[GatewayIdentityProxyEndpointApplicationPolicyConnectionRulesRDP] = None """The RDP-specific rules that define clipboard behavior for RDP connections.""" @@ -2870,7 +2870,7 @@ class GatewayIdentityProxyEndpointApplication(BaseModel): """ -class BookmarkApplicationPolicyConnectionRulesRdp(BaseModel): +class BookmarkApplicationPolicyConnectionRulesRDP(BaseModel): """The RDP-specific rules that define clipboard behavior for RDP connections.""" allowed_clipboard_local_to_remote_formats: Optional[List[Literal["text"]]] = None @@ -2889,7 +2889,7 @@ class BookmarkApplicationPolicyConnectionRules(BaseModel): The rules that define how users may connect to targets secured by your application. """ - rdp: Optional[BookmarkApplicationPolicyConnectionRulesRdp] = None + rdp: Optional[BookmarkApplicationPolicyConnectionRulesRDP] = None """The RDP-specific rules that define clipboard behavior for RDP connections.""" @@ -3122,7 +3122,7 @@ class InfrastructureApplication(BaseModel): policies: Optional[List[InfrastructureApplicationPolicy]] = None -class BrowserRdpApplicationTargetCriterion(BaseModel): +class BrowserRDPApplicationTargetCriterion(BaseModel): port: int """The port that the targets use for the chosen communication protocol. @@ -3136,7 +3136,7 @@ class BrowserRdpApplicationTargetCriterion(BaseModel): """Contains a map of target attribute keys to target attribute values.""" -class BrowserRdpApplicationDestinationPublicDestination(BaseModel): +class BrowserRDPApplicationDestinationPublicDestination(BaseModel): """A public hostname that Access will secure. Public destinations support sub-domain and path. Wildcard '*' can be used in the definition. @@ -3152,7 +3152,7 @@ class BrowserRdpApplicationDestinationPublicDestination(BaseModel): """ -class BrowserRdpApplicationDestinationPrivateDestination(BaseModel): +class BrowserRDPApplicationDestinationPrivateDestination(BaseModel): cidr: Optional[str] = None """The CIDR range of the destination. Single IPs will be computed as /32.""" @@ -3177,7 +3177,7 @@ class BrowserRdpApplicationDestinationPrivateDestination(BaseModel): """The VNET ID to match the destination. When omitted, all VNETs will match.""" -class BrowserRdpApplicationDestinationViaMcpServerPortalDestination(BaseModel): +class BrowserRDPApplicationDestinationViaMcpServerPortalDestination(BaseModel): """A MCP server id configured in ai-controls. Access will secure the MCP server if accessed through a MCP portal. @@ -3189,14 +3189,14 @@ class BrowserRdpApplicationDestinationViaMcpServerPortalDestination(BaseModel): type: Optional[Literal["via_mcp_server_portal"]] = None -BrowserRdpApplicationDestination: TypeAlias = Union[ - BrowserRdpApplicationDestinationPublicDestination, - BrowserRdpApplicationDestinationPrivateDestination, - BrowserRdpApplicationDestinationViaMcpServerPortalDestination, +BrowserRDPApplicationDestination: TypeAlias = Union[ + BrowserRDPApplicationDestinationPublicDestination, + BrowserRDPApplicationDestinationPrivateDestination, + BrowserRDPApplicationDestinationViaMcpServerPortalDestination, ] -class BrowserRdpApplicationMfaConfig(BaseModel): +class BrowserRDPApplicationMfaConfig(BaseModel): """Configures multi-factor authentication (MFA) settings.""" allowed_authenticators: Optional[List[Literal["totp", "biometrics", "security_key"]]] = None @@ -3216,7 +3216,7 @@ class BrowserRdpApplicationMfaConfig(BaseModel): """ -class BrowserRdpApplicationOAuthConfigurationDynamicClientRegistration(BaseModel): +class BrowserRDPApplicationOAuthConfigurationDynamicClientRegistration(BaseModel): """Settings for OAuth dynamic client registration.""" allow_any_on_localhost: Optional[bool] = None @@ -3235,7 +3235,7 @@ class BrowserRdpApplicationOAuthConfigurationDynamicClientRegistration(BaseModel """Whether dynamic client registration is enabled.""" -class BrowserRdpApplicationOAuthConfigurationGrant(BaseModel): +class BrowserRDPApplicationOAuthConfigurationGrant(BaseModel): """Settings for OAuth grant behavior.""" access_token_lifetime: Optional[str] = None @@ -3253,12 +3253,12 @@ class BrowserRdpApplicationOAuthConfigurationGrant(BaseModel): """ -class BrowserRdpApplicationOAuthConfiguration(BaseModel): +class BrowserRDPApplicationOAuthConfiguration(BaseModel): """ **Beta:** Optional configuration for managing an OAuth authorization flow controlled by Access. When set, Access will act as the OAuth authorization server for this application. Only compatible with OAuth clients that support [RFC 8707](https://datatracker.ietf.org/doc/html/rfc8707) (Resource Indicators for OAuth 2.0). This feature is currently in beta. """ - dynamic_client_registration: Optional[BrowserRdpApplicationOAuthConfigurationDynamicClientRegistration] = None + dynamic_client_registration: Optional[BrowserRDPApplicationOAuthConfigurationDynamicClientRegistration] = None """Settings for OAuth dynamic client registration.""" enabled: Optional[bool] = None @@ -3268,11 +3268,11 @@ class BrowserRdpApplicationOAuthConfiguration(BaseModel): to `true` if omitted. """ - grant: Optional[BrowserRdpApplicationOAuthConfigurationGrant] = None + grant: Optional[BrowserRDPApplicationOAuthConfigurationGrant] = None """Settings for OAuth grant behavior.""" -class BrowserRdpApplicationPolicyConnectionRulesRdp(BaseModel): +class BrowserRDPApplicationPolicyConnectionRulesRDP(BaseModel): """The RDP-specific rules that define clipboard behavior for RDP connections.""" allowed_clipboard_local_to_remote_formats: Optional[List[Literal["text"]]] = None @@ -3286,16 +3286,16 @@ class BrowserRdpApplicationPolicyConnectionRulesRdp(BaseModel): """ -class BrowserRdpApplicationPolicyConnectionRules(BaseModel): +class BrowserRDPApplicationPolicyConnectionRules(BaseModel): """ The rules that define how users may connect to targets secured by your application. """ - rdp: Optional[BrowserRdpApplicationPolicyConnectionRulesRdp] = None + rdp: Optional[BrowserRDPApplicationPolicyConnectionRulesRDP] = None """The RDP-specific rules that define clipboard behavior for RDP connections.""" -class BrowserRdpApplicationPolicyMfaConfig(BaseModel): +class BrowserRDPApplicationPolicyMfaConfig(BaseModel): """Configures multi-factor authentication (MFA) settings.""" allowed_authenticators: Optional[List[Literal["totp", "biometrics", "security_key"]]] = None @@ -3315,7 +3315,7 @@ class BrowserRdpApplicationPolicyMfaConfig(BaseModel): """ -class BrowserRdpApplicationPolicy(BaseModel): +class BrowserRDPApplicationPolicy(BaseModel): id: Optional[str] = None """The UUID of the policy""" @@ -3328,7 +3328,7 @@ class BrowserRdpApplicationPolicy(BaseModel): session. """ - connection_rules: Optional[BrowserRdpApplicationPolicyConnectionRules] = None + connection_rules: Optional[BrowserRDPApplicationPolicyConnectionRules] = None """ The rules that define how users may connect to targets secured by your application. @@ -3361,7 +3361,7 @@ class BrowserRdpApplicationPolicy(BaseModel): this feature. """ - mfa_config: Optional[BrowserRdpApplicationPolicyMfaConfig] = None + mfa_config: Optional[BrowserRDPApplicationPolicyMfaConfig] = None """Configures multi-factor authentication (MFA) settings.""" name: Optional[str] = None @@ -3395,7 +3395,7 @@ class BrowserRdpApplicationPolicy(BaseModel): updated_at: Optional[datetime] = None -class BrowserRdpApplicationSCIMConfigAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken(BaseModel): +class BrowserRDPApplicationSCIMConfigAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken(BaseModel): """ Attributes for configuring Access Service Token authentication scheme for SCIM provisioning to an application. """ @@ -3416,7 +3416,7 @@ class BrowserRdpApplicationSCIMConfigAuthenticationAccessSCIMConfigAuthenticatio """The authentication scheme to use when making SCIM requests to this application.""" -class BrowserRdpApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken( +class BrowserRDPApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken( BaseModel ): """ @@ -3439,23 +3439,23 @@ class BrowserRdpApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthenti """The authentication scheme to use when making SCIM requests to this application.""" -BrowserRdpApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthentication: TypeAlias = Union[ +BrowserRDPApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthentication: TypeAlias = Union[ SCIMConfigAuthenticationHTTPBasic, SCIMConfigAuthenticationOAuthBearerToken, SCIMConfigAuthenticationOauth2, - BrowserRdpApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken, + BrowserRDPApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken, ] -BrowserRdpApplicationSCIMConfigAuthentication: TypeAlias = Union[ +BrowserRDPApplicationSCIMConfigAuthentication: TypeAlias = Union[ SCIMConfigAuthenticationHTTPBasic, SCIMConfigAuthenticationOAuthBearerToken, SCIMConfigAuthenticationOauth2, - BrowserRdpApplicationSCIMConfigAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken, - List[BrowserRdpApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthentication], + BrowserRDPApplicationSCIMConfigAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken, + List[BrowserRDPApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthentication], ] -class BrowserRdpApplicationSCIMConfig(BaseModel): +class BrowserRDPApplicationSCIMConfig(BaseModel): """Configuration for provisioning to this application via SCIM. This is currently in closed beta. @@ -3470,7 +3470,7 @@ class BrowserRdpApplicationSCIMConfig(BaseModel): remote_uri: str """The base URI for the application's SCIM-compatible API.""" - authentication: Optional[BrowserRdpApplicationSCIMConfigAuthentication] = None + authentication: Optional[BrowserRDPApplicationSCIMConfigAuthentication] = None """ Attributes for configuring HTTP Basic authentication scheme for SCIM provisioning to an application. @@ -3493,14 +3493,14 @@ class BrowserRdpApplicationSCIMConfig(BaseModel): """ -class BrowserRdpApplication(BaseModel): +class BrowserRDPApplication(BaseModel): domain: str """The primary hostname and path secured by Access. This domain will be displayed if the app is visible in the App Launcher. """ - target_criteria: List[BrowserRdpApplicationTargetCriterion] + target_criteria: List[BrowserRDPApplicationTargetCriterion] type: ApplicationType """The application type.""" @@ -3562,7 +3562,7 @@ class BrowserRdpApplication(BaseModel): custom_pages: Optional[List[str]] = None """The custom pages that will be displayed when applicable for this application""" - destinations: Optional[List[BrowserRdpApplicationDestination]] = None + destinations: Optional[List[BrowserRDPApplicationDestination]] = None """List of destinations secured by Access. This supersedes `self_hosted_domains` to allow for more flexibility in defining @@ -3585,13 +3585,13 @@ class BrowserRdpApplication(BaseModel): logo_url: Optional[str] = None """The image URL for the logo shown in the App Launcher dashboard.""" - mfa_config: Optional[BrowserRdpApplicationMfaConfig] = None + mfa_config: Optional[BrowserRDPApplicationMfaConfig] = None """Configures multi-factor authentication (MFA) settings.""" name: Optional[str] = None """The name of the application.""" - oauth_configuration: Optional[BrowserRdpApplicationOAuthConfiguration] = None + oauth_configuration: Optional[BrowserRDPApplicationOAuthConfiguration] = None """ **Beta:** Optional configuration for managing an OAuth authorization flow controlled by Access. When set, Access will act as the OAuth authorization @@ -3612,7 +3612,7 @@ class BrowserRdpApplication(BaseModel): If disabled, the JWT will scope to the hostname by default """ - policies: Optional[List[BrowserRdpApplicationPolicy]] = None + policies: Optional[List[BrowserRDPApplicationPolicy]] = None read_service_tokens_from_header: Optional[str] = None """ @@ -3631,7 +3631,7 @@ class BrowserRdpApplication(BaseModel): attacks. """ - scim_config: Optional[BrowserRdpApplicationSCIMConfig] = None + scim_config: Optional[BrowserRDPApplicationSCIMConfig] = None """Configuration for provisioning to this application via SCIM. This is currently in closed beta. @@ -3789,7 +3789,7 @@ class McpServerApplicationOAuthConfiguration(BaseModel): """Settings for OAuth grant behavior.""" -class McpServerApplicationPolicyConnectionRulesRdp(BaseModel): +class McpServerApplicationPolicyConnectionRulesRDP(BaseModel): """The RDP-specific rules that define clipboard behavior for RDP connections.""" allowed_clipboard_local_to_remote_formats: Optional[List[Literal["text"]]] = None @@ -3808,7 +3808,7 @@ class McpServerApplicationPolicyConnectionRules(BaseModel): The rules that define how users may connect to targets secured by your application. """ - rdp: Optional[McpServerApplicationPolicyConnectionRulesRdp] = None + rdp: Optional[McpServerApplicationPolicyConnectionRulesRDP] = None """The RDP-specific rules that define clipboard behavior for RDP connections.""" @@ -4242,7 +4242,7 @@ class McpServerPortalApplicationOAuthConfiguration(BaseModel): """Settings for OAuth grant behavior.""" -class McpServerPortalApplicationPolicyConnectionRulesRdp(BaseModel): +class McpServerPortalApplicationPolicyConnectionRulesRDP(BaseModel): """The RDP-specific rules that define clipboard behavior for RDP connections.""" allowed_clipboard_local_to_remote_formats: Optional[List[Literal["text"]]] = None @@ -4261,7 +4261,7 @@ class McpServerPortalApplicationPolicyConnectionRules(BaseModel): The rules that define how users may connect to targets secured by your application. """ - rdp: Optional[McpServerPortalApplicationPolicyConnectionRulesRdp] = None + rdp: Optional[McpServerPortalApplicationPolicyConnectionRulesRDP] = None """The RDP-specific rules that define clipboard behavior for RDP connections.""" @@ -4596,7 +4596,7 @@ class McpServerPortalApplication(BaseModel): GatewayIdentityProxyEndpointApplication, BookmarkApplication, InfrastructureApplication, - BrowserRdpApplication, + BrowserRDPApplication, McpServerApplication, McpServerPortalApplication, ] diff --git a/src/cloudflare/types/zero_trust/access/application_get_response.py b/src/cloudflare/types/zero_trust/access/application_get_response.py index e9d06e36f7c..18fe3f2a3d6 100644 --- a/src/cloudflare/types/zero_trust/access/application_get_response.py +++ b/src/cloudflare/types/zero_trust/access/application_get_response.py @@ -32,7 +32,7 @@ "SelfHostedApplicationOAuthConfigurationGrant", "SelfHostedApplicationPolicy", "SelfHostedApplicationPolicyConnectionRules", - "SelfHostedApplicationPolicyConnectionRulesRdp", + "SelfHostedApplicationPolicyConnectionRulesRDP", "SelfHostedApplicationPolicyMfaConfig", "SelfHostedApplicationSCIMConfig", "SelfHostedApplicationSCIMConfigAuthentication", @@ -42,7 +42,7 @@ "SaaSApplication", "SaaSApplicationPolicy", "SaaSApplicationPolicyConnectionRules", - "SaaSApplicationPolicyConnectionRulesRdp", + "SaaSApplicationPolicyConnectionRulesRDP", "SaaSApplicationPolicyMfaConfig", "SaaSApplicationSaaSApp", "SaaSApplicationSCIMConfig", @@ -61,7 +61,7 @@ "BrowserSSHApplicationOAuthConfigurationGrant", "BrowserSSHApplicationPolicy", "BrowserSSHApplicationPolicyConnectionRules", - "BrowserSSHApplicationPolicyConnectionRulesRdp", + "BrowserSSHApplicationPolicyConnectionRulesRDP", "BrowserSSHApplicationPolicyMfaConfig", "BrowserSSHApplicationSCIMConfig", "BrowserSSHApplicationSCIMConfigAuthentication", @@ -79,7 +79,7 @@ "BrowserVNCApplicationOAuthConfigurationGrant", "BrowserVNCApplicationPolicy", "BrowserVNCApplicationPolicyConnectionRules", - "BrowserVNCApplicationPolicyConnectionRulesRdp", + "BrowserVNCApplicationPolicyConnectionRulesRDP", "BrowserVNCApplicationPolicyMfaConfig", "BrowserVNCApplicationSCIMConfig", "BrowserVNCApplicationSCIMConfigAuthentication", @@ -91,52 +91,52 @@ "AppLauncherApplicationLandingPageDesign", "AppLauncherApplicationPolicy", "AppLauncherApplicationPolicyConnectionRules", - "AppLauncherApplicationPolicyConnectionRulesRdp", + "AppLauncherApplicationPolicyConnectionRulesRDP", "AppLauncherApplicationPolicyMfaConfig", "DeviceEnrollmentPermissionsApplication", "DeviceEnrollmentPermissionsApplicationPolicy", "DeviceEnrollmentPermissionsApplicationPolicyConnectionRules", - "DeviceEnrollmentPermissionsApplicationPolicyConnectionRulesRdp", + "DeviceEnrollmentPermissionsApplicationPolicyConnectionRulesRDP", "DeviceEnrollmentPermissionsApplicationPolicyMfaConfig", "BrowserIsolationPermissionsApplication", "BrowserIsolationPermissionsApplicationPolicy", "BrowserIsolationPermissionsApplicationPolicyConnectionRules", - "BrowserIsolationPermissionsApplicationPolicyConnectionRulesRdp", + "BrowserIsolationPermissionsApplicationPolicyConnectionRulesRDP", "BrowserIsolationPermissionsApplicationPolicyMfaConfig", "GatewayIdentityProxyEndpointApplication", "GatewayIdentityProxyEndpointApplicationPolicy", "GatewayIdentityProxyEndpointApplicationPolicyConnectionRules", - "GatewayIdentityProxyEndpointApplicationPolicyConnectionRulesRdp", + "GatewayIdentityProxyEndpointApplicationPolicyConnectionRulesRDP", "GatewayIdentityProxyEndpointApplicationPolicyMfaConfig", "BookmarkApplication", "BookmarkApplicationPolicy", "BookmarkApplicationPolicyConnectionRules", - "BookmarkApplicationPolicyConnectionRulesRdp", + "BookmarkApplicationPolicyConnectionRulesRDP", "BookmarkApplicationPolicyMfaConfig", "InfrastructureApplication", "InfrastructureApplicationTargetCriterion", "InfrastructureApplicationPolicy", "InfrastructureApplicationPolicyConnectionRules", "InfrastructureApplicationPolicyConnectionRulesSSH", - "BrowserRdpApplication", - "BrowserRdpApplicationTargetCriterion", - "BrowserRdpApplicationDestination", - "BrowserRdpApplicationDestinationPublicDestination", - "BrowserRdpApplicationDestinationPrivateDestination", - "BrowserRdpApplicationDestinationViaMcpServerPortalDestination", - "BrowserRdpApplicationMfaConfig", - "BrowserRdpApplicationOAuthConfiguration", - "BrowserRdpApplicationOAuthConfigurationDynamicClientRegistration", - "BrowserRdpApplicationOAuthConfigurationGrant", - "BrowserRdpApplicationPolicy", - "BrowserRdpApplicationPolicyConnectionRules", - "BrowserRdpApplicationPolicyConnectionRulesRdp", - "BrowserRdpApplicationPolicyMfaConfig", - "BrowserRdpApplicationSCIMConfig", - "BrowserRdpApplicationSCIMConfigAuthentication", - "BrowserRdpApplicationSCIMConfigAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken", - "BrowserRdpApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthentication", - "BrowserRdpApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken", + "BrowserRDPApplication", + "BrowserRDPApplicationTargetCriterion", + "BrowserRDPApplicationDestination", + "BrowserRDPApplicationDestinationPublicDestination", + "BrowserRDPApplicationDestinationPrivateDestination", + "BrowserRDPApplicationDestinationViaMcpServerPortalDestination", + "BrowserRDPApplicationMfaConfig", + "BrowserRDPApplicationOAuthConfiguration", + "BrowserRDPApplicationOAuthConfigurationDynamicClientRegistration", + "BrowserRDPApplicationOAuthConfigurationGrant", + "BrowserRDPApplicationPolicy", + "BrowserRDPApplicationPolicyConnectionRules", + "BrowserRDPApplicationPolicyConnectionRulesRDP", + "BrowserRDPApplicationPolicyMfaConfig", + "BrowserRDPApplicationSCIMConfig", + "BrowserRDPApplicationSCIMConfigAuthentication", + "BrowserRDPApplicationSCIMConfigAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken", + "BrowserRDPApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthentication", + "BrowserRDPApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken", "McpServerApplication", "McpServerApplicationDestination", "McpServerApplicationDestinationPublicDestination", @@ -147,7 +147,7 @@ "McpServerApplicationOAuthConfigurationGrant", "McpServerApplicationPolicy", "McpServerApplicationPolicyConnectionRules", - "McpServerApplicationPolicyConnectionRulesRdp", + "McpServerApplicationPolicyConnectionRulesRDP", "McpServerApplicationPolicyMfaConfig", "McpServerApplicationSCIMConfig", "McpServerApplicationSCIMConfigAuthentication", @@ -164,7 +164,7 @@ "McpServerPortalApplicationOAuthConfigurationGrant", "McpServerPortalApplicationPolicy", "McpServerPortalApplicationPolicyConnectionRules", - "McpServerPortalApplicationPolicyConnectionRulesRdp", + "McpServerPortalApplicationPolicyConnectionRulesRDP", "McpServerPortalApplicationPolicyMfaConfig", "McpServerPortalApplicationSCIMConfig", "McpServerPortalApplicationSCIMConfigAuthentication", @@ -310,7 +310,7 @@ class SelfHostedApplicationOAuthConfiguration(BaseModel): """Settings for OAuth grant behavior.""" -class SelfHostedApplicationPolicyConnectionRulesRdp(BaseModel): +class SelfHostedApplicationPolicyConnectionRulesRDP(BaseModel): """The RDP-specific rules that define clipboard behavior for RDP connections.""" allowed_clipboard_local_to_remote_formats: Optional[List[Literal["text"]]] = None @@ -329,7 +329,7 @@ class SelfHostedApplicationPolicyConnectionRules(BaseModel): The rules that define how users may connect to targets secured by your application. """ - rdp: Optional[SelfHostedApplicationPolicyConnectionRulesRdp] = None + rdp: Optional[SelfHostedApplicationPolicyConnectionRulesRDP] = None """The RDP-specific rules that define clipboard behavior for RDP connections.""" @@ -709,7 +709,7 @@ class SelfHostedApplication(BaseModel): """ -class SaaSApplicationPolicyConnectionRulesRdp(BaseModel): +class SaaSApplicationPolicyConnectionRulesRDP(BaseModel): """The RDP-specific rules that define clipboard behavior for RDP connections.""" allowed_clipboard_local_to_remote_formats: Optional[List[Literal["text"]]] = None @@ -728,7 +728,7 @@ class SaaSApplicationPolicyConnectionRules(BaseModel): The rules that define how users may connect to targets secured by your application. """ - rdp: Optional[SaaSApplicationPolicyConnectionRulesRdp] = None + rdp: Optional[SaaSApplicationPolicyConnectionRulesRDP] = None """The RDP-specific rules that define clipboard behavior for RDP connections.""" @@ -1122,7 +1122,7 @@ class BrowserSSHApplicationOAuthConfiguration(BaseModel): """Settings for OAuth grant behavior.""" -class BrowserSSHApplicationPolicyConnectionRulesRdp(BaseModel): +class BrowserSSHApplicationPolicyConnectionRulesRDP(BaseModel): """The RDP-specific rules that define clipboard behavior for RDP connections.""" allowed_clipboard_local_to_remote_formats: Optional[List[Literal["text"]]] = None @@ -1141,7 +1141,7 @@ class BrowserSSHApplicationPolicyConnectionRules(BaseModel): The rules that define how users may connect to targets secured by your application. """ - rdp: Optional[BrowserSSHApplicationPolicyConnectionRulesRdp] = None + rdp: Optional[BrowserSSHApplicationPolicyConnectionRulesRDP] = None """The RDP-specific rules that define clipboard behavior for RDP connections.""" @@ -1672,7 +1672,7 @@ class BrowserVNCApplicationOAuthConfiguration(BaseModel): """Settings for OAuth grant behavior.""" -class BrowserVNCApplicationPolicyConnectionRulesRdp(BaseModel): +class BrowserVNCApplicationPolicyConnectionRulesRDP(BaseModel): """The RDP-specific rules that define clipboard behavior for RDP connections.""" allowed_clipboard_local_to_remote_formats: Optional[List[Literal["text"]]] = None @@ -1691,7 +1691,7 @@ class BrowserVNCApplicationPolicyConnectionRules(BaseModel): The rules that define how users may connect to targets secured by your application. """ - rdp: Optional[BrowserVNCApplicationPolicyConnectionRulesRdp] = None + rdp: Optional[BrowserVNCApplicationPolicyConnectionRulesRDP] = None """The RDP-specific rules that define clipboard behavior for RDP connections.""" @@ -2113,7 +2113,7 @@ class AppLauncherApplicationLandingPageDesign(BaseModel): """The title shown on the landing page.""" -class AppLauncherApplicationPolicyConnectionRulesRdp(BaseModel): +class AppLauncherApplicationPolicyConnectionRulesRDP(BaseModel): """The RDP-specific rules that define clipboard behavior for RDP connections.""" allowed_clipboard_local_to_remote_formats: Optional[List[Literal["text"]]] = None @@ -2132,7 +2132,7 @@ class AppLauncherApplicationPolicyConnectionRules(BaseModel): The rules that define how users may connect to targets secured by your application. """ - rdp: Optional[AppLauncherApplicationPolicyConnectionRulesRdp] = None + rdp: Optional[AppLauncherApplicationPolicyConnectionRulesRDP] = None """The RDP-specific rules that define clipboard behavior for RDP connections.""" @@ -2327,7 +2327,7 @@ class AppLauncherApplication(BaseModel): """Determines when to skip the App Launcher landing page.""" -class DeviceEnrollmentPermissionsApplicationPolicyConnectionRulesRdp(BaseModel): +class DeviceEnrollmentPermissionsApplicationPolicyConnectionRulesRDP(BaseModel): """The RDP-specific rules that define clipboard behavior for RDP connections.""" allowed_clipboard_local_to_remote_formats: Optional[List[Literal["text"]]] = None @@ -2346,7 +2346,7 @@ class DeviceEnrollmentPermissionsApplicationPolicyConnectionRules(BaseModel): The rules that define how users may connect to targets secured by your application. """ - rdp: Optional[DeviceEnrollmentPermissionsApplicationPolicyConnectionRulesRdp] = None + rdp: Optional[DeviceEnrollmentPermissionsApplicationPolicyConnectionRulesRDP] = None """The RDP-specific rules that define clipboard behavior for RDP connections.""" @@ -2508,7 +2508,7 @@ class DeviceEnrollmentPermissionsApplication(BaseModel): """ -class BrowserIsolationPermissionsApplicationPolicyConnectionRulesRdp(BaseModel): +class BrowserIsolationPermissionsApplicationPolicyConnectionRulesRDP(BaseModel): """The RDP-specific rules that define clipboard behavior for RDP connections.""" allowed_clipboard_local_to_remote_formats: Optional[List[Literal["text"]]] = None @@ -2527,7 +2527,7 @@ class BrowserIsolationPermissionsApplicationPolicyConnectionRules(BaseModel): The rules that define how users may connect to targets secured by your application. """ - rdp: Optional[BrowserIsolationPermissionsApplicationPolicyConnectionRulesRdp] = None + rdp: Optional[BrowserIsolationPermissionsApplicationPolicyConnectionRulesRDP] = None """The RDP-specific rules that define clipboard behavior for RDP connections.""" @@ -2689,7 +2689,7 @@ class BrowserIsolationPermissionsApplication(BaseModel): """ -class GatewayIdentityProxyEndpointApplicationPolicyConnectionRulesRdp(BaseModel): +class GatewayIdentityProxyEndpointApplicationPolicyConnectionRulesRDP(BaseModel): """The RDP-specific rules that define clipboard behavior for RDP connections.""" allowed_clipboard_local_to_remote_formats: Optional[List[Literal["text"]]] = None @@ -2708,7 +2708,7 @@ class GatewayIdentityProxyEndpointApplicationPolicyConnectionRules(BaseModel): The rules that define how users may connect to targets secured by your application. """ - rdp: Optional[GatewayIdentityProxyEndpointApplicationPolicyConnectionRulesRdp] = None + rdp: Optional[GatewayIdentityProxyEndpointApplicationPolicyConnectionRulesRDP] = None """The RDP-specific rules that define clipboard behavior for RDP connections.""" @@ -2870,7 +2870,7 @@ class GatewayIdentityProxyEndpointApplication(BaseModel): """ -class BookmarkApplicationPolicyConnectionRulesRdp(BaseModel): +class BookmarkApplicationPolicyConnectionRulesRDP(BaseModel): """The RDP-specific rules that define clipboard behavior for RDP connections.""" allowed_clipboard_local_to_remote_formats: Optional[List[Literal["text"]]] = None @@ -2889,7 +2889,7 @@ class BookmarkApplicationPolicyConnectionRules(BaseModel): The rules that define how users may connect to targets secured by your application. """ - rdp: Optional[BookmarkApplicationPolicyConnectionRulesRdp] = None + rdp: Optional[BookmarkApplicationPolicyConnectionRulesRDP] = None """The RDP-specific rules that define clipboard behavior for RDP connections.""" @@ -3122,7 +3122,7 @@ class InfrastructureApplication(BaseModel): policies: Optional[List[InfrastructureApplicationPolicy]] = None -class BrowserRdpApplicationTargetCriterion(BaseModel): +class BrowserRDPApplicationTargetCriterion(BaseModel): port: int """The port that the targets use for the chosen communication protocol. @@ -3136,7 +3136,7 @@ class BrowserRdpApplicationTargetCriterion(BaseModel): """Contains a map of target attribute keys to target attribute values.""" -class BrowserRdpApplicationDestinationPublicDestination(BaseModel): +class BrowserRDPApplicationDestinationPublicDestination(BaseModel): """A public hostname that Access will secure. Public destinations support sub-domain and path. Wildcard '*' can be used in the definition. @@ -3152,7 +3152,7 @@ class BrowserRdpApplicationDestinationPublicDestination(BaseModel): """ -class BrowserRdpApplicationDestinationPrivateDestination(BaseModel): +class BrowserRDPApplicationDestinationPrivateDestination(BaseModel): cidr: Optional[str] = None """The CIDR range of the destination. Single IPs will be computed as /32.""" @@ -3177,7 +3177,7 @@ class BrowserRdpApplicationDestinationPrivateDestination(BaseModel): """The VNET ID to match the destination. When omitted, all VNETs will match.""" -class BrowserRdpApplicationDestinationViaMcpServerPortalDestination(BaseModel): +class BrowserRDPApplicationDestinationViaMcpServerPortalDestination(BaseModel): """A MCP server id configured in ai-controls. Access will secure the MCP server if accessed through a MCP portal. @@ -3189,14 +3189,14 @@ class BrowserRdpApplicationDestinationViaMcpServerPortalDestination(BaseModel): type: Optional[Literal["via_mcp_server_portal"]] = None -BrowserRdpApplicationDestination: TypeAlias = Union[ - BrowserRdpApplicationDestinationPublicDestination, - BrowserRdpApplicationDestinationPrivateDestination, - BrowserRdpApplicationDestinationViaMcpServerPortalDestination, +BrowserRDPApplicationDestination: TypeAlias = Union[ + BrowserRDPApplicationDestinationPublicDestination, + BrowserRDPApplicationDestinationPrivateDestination, + BrowserRDPApplicationDestinationViaMcpServerPortalDestination, ] -class BrowserRdpApplicationMfaConfig(BaseModel): +class BrowserRDPApplicationMfaConfig(BaseModel): """Configures multi-factor authentication (MFA) settings.""" allowed_authenticators: Optional[List[Literal["totp", "biometrics", "security_key"]]] = None @@ -3216,7 +3216,7 @@ class BrowserRdpApplicationMfaConfig(BaseModel): """ -class BrowserRdpApplicationOAuthConfigurationDynamicClientRegistration(BaseModel): +class BrowserRDPApplicationOAuthConfigurationDynamicClientRegistration(BaseModel): """Settings for OAuth dynamic client registration.""" allow_any_on_localhost: Optional[bool] = None @@ -3235,7 +3235,7 @@ class BrowserRdpApplicationOAuthConfigurationDynamicClientRegistration(BaseModel """Whether dynamic client registration is enabled.""" -class BrowserRdpApplicationOAuthConfigurationGrant(BaseModel): +class BrowserRDPApplicationOAuthConfigurationGrant(BaseModel): """Settings for OAuth grant behavior.""" access_token_lifetime: Optional[str] = None @@ -3253,12 +3253,12 @@ class BrowserRdpApplicationOAuthConfigurationGrant(BaseModel): """ -class BrowserRdpApplicationOAuthConfiguration(BaseModel): +class BrowserRDPApplicationOAuthConfiguration(BaseModel): """ **Beta:** Optional configuration for managing an OAuth authorization flow controlled by Access. When set, Access will act as the OAuth authorization server for this application. Only compatible with OAuth clients that support [RFC 8707](https://datatracker.ietf.org/doc/html/rfc8707) (Resource Indicators for OAuth 2.0). This feature is currently in beta. """ - dynamic_client_registration: Optional[BrowserRdpApplicationOAuthConfigurationDynamicClientRegistration] = None + dynamic_client_registration: Optional[BrowserRDPApplicationOAuthConfigurationDynamicClientRegistration] = None """Settings for OAuth dynamic client registration.""" enabled: Optional[bool] = None @@ -3268,11 +3268,11 @@ class BrowserRdpApplicationOAuthConfiguration(BaseModel): to `true` if omitted. """ - grant: Optional[BrowserRdpApplicationOAuthConfigurationGrant] = None + grant: Optional[BrowserRDPApplicationOAuthConfigurationGrant] = None """Settings for OAuth grant behavior.""" -class BrowserRdpApplicationPolicyConnectionRulesRdp(BaseModel): +class BrowserRDPApplicationPolicyConnectionRulesRDP(BaseModel): """The RDP-specific rules that define clipboard behavior for RDP connections.""" allowed_clipboard_local_to_remote_formats: Optional[List[Literal["text"]]] = None @@ -3286,16 +3286,16 @@ class BrowserRdpApplicationPolicyConnectionRulesRdp(BaseModel): """ -class BrowserRdpApplicationPolicyConnectionRules(BaseModel): +class BrowserRDPApplicationPolicyConnectionRules(BaseModel): """ The rules that define how users may connect to targets secured by your application. """ - rdp: Optional[BrowserRdpApplicationPolicyConnectionRulesRdp] = None + rdp: Optional[BrowserRDPApplicationPolicyConnectionRulesRDP] = None """The RDP-specific rules that define clipboard behavior for RDP connections.""" -class BrowserRdpApplicationPolicyMfaConfig(BaseModel): +class BrowserRDPApplicationPolicyMfaConfig(BaseModel): """Configures multi-factor authentication (MFA) settings.""" allowed_authenticators: Optional[List[Literal["totp", "biometrics", "security_key"]]] = None @@ -3315,7 +3315,7 @@ class BrowserRdpApplicationPolicyMfaConfig(BaseModel): """ -class BrowserRdpApplicationPolicy(BaseModel): +class BrowserRDPApplicationPolicy(BaseModel): id: Optional[str] = None """The UUID of the policy""" @@ -3328,7 +3328,7 @@ class BrowserRdpApplicationPolicy(BaseModel): session. """ - connection_rules: Optional[BrowserRdpApplicationPolicyConnectionRules] = None + connection_rules: Optional[BrowserRDPApplicationPolicyConnectionRules] = None """ The rules that define how users may connect to targets secured by your application. @@ -3361,7 +3361,7 @@ class BrowserRdpApplicationPolicy(BaseModel): this feature. """ - mfa_config: Optional[BrowserRdpApplicationPolicyMfaConfig] = None + mfa_config: Optional[BrowserRDPApplicationPolicyMfaConfig] = None """Configures multi-factor authentication (MFA) settings.""" name: Optional[str] = None @@ -3395,7 +3395,7 @@ class BrowserRdpApplicationPolicy(BaseModel): updated_at: Optional[datetime] = None -class BrowserRdpApplicationSCIMConfigAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken(BaseModel): +class BrowserRDPApplicationSCIMConfigAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken(BaseModel): """ Attributes for configuring Access Service Token authentication scheme for SCIM provisioning to an application. """ @@ -3416,7 +3416,7 @@ class BrowserRdpApplicationSCIMConfigAuthenticationAccessSCIMConfigAuthenticatio """The authentication scheme to use when making SCIM requests to this application.""" -class BrowserRdpApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken( +class BrowserRDPApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken( BaseModel ): """ @@ -3439,23 +3439,23 @@ class BrowserRdpApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthenti """The authentication scheme to use when making SCIM requests to this application.""" -BrowserRdpApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthentication: TypeAlias = Union[ +BrowserRDPApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthentication: TypeAlias = Union[ SCIMConfigAuthenticationHTTPBasic, SCIMConfigAuthenticationOAuthBearerToken, SCIMConfigAuthenticationOauth2, - BrowserRdpApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken, + BrowserRDPApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken, ] -BrowserRdpApplicationSCIMConfigAuthentication: TypeAlias = Union[ +BrowserRDPApplicationSCIMConfigAuthentication: TypeAlias = Union[ SCIMConfigAuthenticationHTTPBasic, SCIMConfigAuthenticationOAuthBearerToken, SCIMConfigAuthenticationOauth2, - BrowserRdpApplicationSCIMConfigAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken, - List[BrowserRdpApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthentication], + BrowserRDPApplicationSCIMConfigAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken, + List[BrowserRDPApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthentication], ] -class BrowserRdpApplicationSCIMConfig(BaseModel): +class BrowserRDPApplicationSCIMConfig(BaseModel): """Configuration for provisioning to this application via SCIM. This is currently in closed beta. @@ -3470,7 +3470,7 @@ class BrowserRdpApplicationSCIMConfig(BaseModel): remote_uri: str """The base URI for the application's SCIM-compatible API.""" - authentication: Optional[BrowserRdpApplicationSCIMConfigAuthentication] = None + authentication: Optional[BrowserRDPApplicationSCIMConfigAuthentication] = None """ Attributes for configuring HTTP Basic authentication scheme for SCIM provisioning to an application. @@ -3493,14 +3493,14 @@ class BrowserRdpApplicationSCIMConfig(BaseModel): """ -class BrowserRdpApplication(BaseModel): +class BrowserRDPApplication(BaseModel): domain: str """The primary hostname and path secured by Access. This domain will be displayed if the app is visible in the App Launcher. """ - target_criteria: List[BrowserRdpApplicationTargetCriterion] + target_criteria: List[BrowserRDPApplicationTargetCriterion] type: ApplicationType """The application type.""" @@ -3562,7 +3562,7 @@ class BrowserRdpApplication(BaseModel): custom_pages: Optional[List[str]] = None """The custom pages that will be displayed when applicable for this application""" - destinations: Optional[List[BrowserRdpApplicationDestination]] = None + destinations: Optional[List[BrowserRDPApplicationDestination]] = None """List of destinations secured by Access. This supersedes `self_hosted_domains` to allow for more flexibility in defining @@ -3585,13 +3585,13 @@ class BrowserRdpApplication(BaseModel): logo_url: Optional[str] = None """The image URL for the logo shown in the App Launcher dashboard.""" - mfa_config: Optional[BrowserRdpApplicationMfaConfig] = None + mfa_config: Optional[BrowserRDPApplicationMfaConfig] = None """Configures multi-factor authentication (MFA) settings.""" name: Optional[str] = None """The name of the application.""" - oauth_configuration: Optional[BrowserRdpApplicationOAuthConfiguration] = None + oauth_configuration: Optional[BrowserRDPApplicationOAuthConfiguration] = None """ **Beta:** Optional configuration for managing an OAuth authorization flow controlled by Access. When set, Access will act as the OAuth authorization @@ -3612,7 +3612,7 @@ class BrowserRdpApplication(BaseModel): If disabled, the JWT will scope to the hostname by default """ - policies: Optional[List[BrowserRdpApplicationPolicy]] = None + policies: Optional[List[BrowserRDPApplicationPolicy]] = None read_service_tokens_from_header: Optional[str] = None """ @@ -3631,7 +3631,7 @@ class BrowserRdpApplication(BaseModel): attacks. """ - scim_config: Optional[BrowserRdpApplicationSCIMConfig] = None + scim_config: Optional[BrowserRDPApplicationSCIMConfig] = None """Configuration for provisioning to this application via SCIM. This is currently in closed beta. @@ -3789,7 +3789,7 @@ class McpServerApplicationOAuthConfiguration(BaseModel): """Settings for OAuth grant behavior.""" -class McpServerApplicationPolicyConnectionRulesRdp(BaseModel): +class McpServerApplicationPolicyConnectionRulesRDP(BaseModel): """The RDP-specific rules that define clipboard behavior for RDP connections.""" allowed_clipboard_local_to_remote_formats: Optional[List[Literal["text"]]] = None @@ -3808,7 +3808,7 @@ class McpServerApplicationPolicyConnectionRules(BaseModel): The rules that define how users may connect to targets secured by your application. """ - rdp: Optional[McpServerApplicationPolicyConnectionRulesRdp] = None + rdp: Optional[McpServerApplicationPolicyConnectionRulesRDP] = None """The RDP-specific rules that define clipboard behavior for RDP connections.""" @@ -4242,7 +4242,7 @@ class McpServerPortalApplicationOAuthConfiguration(BaseModel): """Settings for OAuth grant behavior.""" -class McpServerPortalApplicationPolicyConnectionRulesRdp(BaseModel): +class McpServerPortalApplicationPolicyConnectionRulesRDP(BaseModel): """The RDP-specific rules that define clipboard behavior for RDP connections.""" allowed_clipboard_local_to_remote_formats: Optional[List[Literal["text"]]] = None @@ -4261,7 +4261,7 @@ class McpServerPortalApplicationPolicyConnectionRules(BaseModel): The rules that define how users may connect to targets secured by your application. """ - rdp: Optional[McpServerPortalApplicationPolicyConnectionRulesRdp] = None + rdp: Optional[McpServerPortalApplicationPolicyConnectionRulesRDP] = None """The RDP-specific rules that define clipboard behavior for RDP connections.""" @@ -4596,7 +4596,7 @@ class McpServerPortalApplication(BaseModel): GatewayIdentityProxyEndpointApplication, BookmarkApplication, InfrastructureApplication, - BrowserRdpApplication, + BrowserRDPApplication, McpServerApplication, McpServerPortalApplication, ] diff --git a/src/cloudflare/types/zero_trust/access/application_list_response.py b/src/cloudflare/types/zero_trust/access/application_list_response.py index 554619c1efb..4b779844b2b 100644 --- a/src/cloudflare/types/zero_trust/access/application_list_response.py +++ b/src/cloudflare/types/zero_trust/access/application_list_response.py @@ -32,7 +32,7 @@ "SelfHostedApplicationOAuthConfigurationGrant", "SelfHostedApplicationPolicy", "SelfHostedApplicationPolicyConnectionRules", - "SelfHostedApplicationPolicyConnectionRulesRdp", + "SelfHostedApplicationPolicyConnectionRulesRDP", "SelfHostedApplicationPolicyMfaConfig", "SelfHostedApplicationSCIMConfig", "SelfHostedApplicationSCIMConfigAuthentication", @@ -42,7 +42,7 @@ "SaaSApplication", "SaaSApplicationPolicy", "SaaSApplicationPolicyConnectionRules", - "SaaSApplicationPolicyConnectionRulesRdp", + "SaaSApplicationPolicyConnectionRulesRDP", "SaaSApplicationPolicyMfaConfig", "SaaSApplicationSaaSApp", "SaaSApplicationSCIMConfig", @@ -61,7 +61,7 @@ "BrowserSSHApplicationOAuthConfigurationGrant", "BrowserSSHApplicationPolicy", "BrowserSSHApplicationPolicyConnectionRules", - "BrowserSSHApplicationPolicyConnectionRulesRdp", + "BrowserSSHApplicationPolicyConnectionRulesRDP", "BrowserSSHApplicationPolicyMfaConfig", "BrowserSSHApplicationSCIMConfig", "BrowserSSHApplicationSCIMConfigAuthentication", @@ -79,7 +79,7 @@ "BrowserVNCApplicationOAuthConfigurationGrant", "BrowserVNCApplicationPolicy", "BrowserVNCApplicationPolicyConnectionRules", - "BrowserVNCApplicationPolicyConnectionRulesRdp", + "BrowserVNCApplicationPolicyConnectionRulesRDP", "BrowserVNCApplicationPolicyMfaConfig", "BrowserVNCApplicationSCIMConfig", "BrowserVNCApplicationSCIMConfigAuthentication", @@ -91,52 +91,52 @@ "AppLauncherApplicationLandingPageDesign", "AppLauncherApplicationPolicy", "AppLauncherApplicationPolicyConnectionRules", - "AppLauncherApplicationPolicyConnectionRulesRdp", + "AppLauncherApplicationPolicyConnectionRulesRDP", "AppLauncherApplicationPolicyMfaConfig", "DeviceEnrollmentPermissionsApplication", "DeviceEnrollmentPermissionsApplicationPolicy", "DeviceEnrollmentPermissionsApplicationPolicyConnectionRules", - "DeviceEnrollmentPermissionsApplicationPolicyConnectionRulesRdp", + "DeviceEnrollmentPermissionsApplicationPolicyConnectionRulesRDP", "DeviceEnrollmentPermissionsApplicationPolicyMfaConfig", "BrowserIsolationPermissionsApplication", "BrowserIsolationPermissionsApplicationPolicy", "BrowserIsolationPermissionsApplicationPolicyConnectionRules", - "BrowserIsolationPermissionsApplicationPolicyConnectionRulesRdp", + "BrowserIsolationPermissionsApplicationPolicyConnectionRulesRDP", "BrowserIsolationPermissionsApplicationPolicyMfaConfig", "GatewayIdentityProxyEndpointApplication", "GatewayIdentityProxyEndpointApplicationPolicy", "GatewayIdentityProxyEndpointApplicationPolicyConnectionRules", - "GatewayIdentityProxyEndpointApplicationPolicyConnectionRulesRdp", + "GatewayIdentityProxyEndpointApplicationPolicyConnectionRulesRDP", "GatewayIdentityProxyEndpointApplicationPolicyMfaConfig", "BookmarkApplication", "BookmarkApplicationPolicy", "BookmarkApplicationPolicyConnectionRules", - "BookmarkApplicationPolicyConnectionRulesRdp", + "BookmarkApplicationPolicyConnectionRulesRDP", "BookmarkApplicationPolicyMfaConfig", "InfrastructureApplication", "InfrastructureApplicationTargetCriterion", "InfrastructureApplicationPolicy", "InfrastructureApplicationPolicyConnectionRules", "InfrastructureApplicationPolicyConnectionRulesSSH", - "BrowserRdpApplication", - "BrowserRdpApplicationTargetCriterion", - "BrowserRdpApplicationDestination", - "BrowserRdpApplicationDestinationPublicDestination", - "BrowserRdpApplicationDestinationPrivateDestination", - "BrowserRdpApplicationDestinationViaMcpServerPortalDestination", - "BrowserRdpApplicationMfaConfig", - "BrowserRdpApplicationOAuthConfiguration", - "BrowserRdpApplicationOAuthConfigurationDynamicClientRegistration", - "BrowserRdpApplicationOAuthConfigurationGrant", - "BrowserRdpApplicationPolicy", - "BrowserRdpApplicationPolicyConnectionRules", - "BrowserRdpApplicationPolicyConnectionRulesRdp", - "BrowserRdpApplicationPolicyMfaConfig", - "BrowserRdpApplicationSCIMConfig", - "BrowserRdpApplicationSCIMConfigAuthentication", - "BrowserRdpApplicationSCIMConfigAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken", - "BrowserRdpApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthentication", - "BrowserRdpApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken", + "BrowserRDPApplication", + "BrowserRDPApplicationTargetCriterion", + "BrowserRDPApplicationDestination", + "BrowserRDPApplicationDestinationPublicDestination", + "BrowserRDPApplicationDestinationPrivateDestination", + "BrowserRDPApplicationDestinationViaMcpServerPortalDestination", + "BrowserRDPApplicationMfaConfig", + "BrowserRDPApplicationOAuthConfiguration", + "BrowserRDPApplicationOAuthConfigurationDynamicClientRegistration", + "BrowserRDPApplicationOAuthConfigurationGrant", + "BrowserRDPApplicationPolicy", + "BrowserRDPApplicationPolicyConnectionRules", + "BrowserRDPApplicationPolicyConnectionRulesRDP", + "BrowserRDPApplicationPolicyMfaConfig", + "BrowserRDPApplicationSCIMConfig", + "BrowserRDPApplicationSCIMConfigAuthentication", + "BrowserRDPApplicationSCIMConfigAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken", + "BrowserRDPApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthentication", + "BrowserRDPApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken", "McpServerApplication", "McpServerApplicationDestination", "McpServerApplicationDestinationPublicDestination", @@ -147,7 +147,7 @@ "McpServerApplicationOAuthConfigurationGrant", "McpServerApplicationPolicy", "McpServerApplicationPolicyConnectionRules", - "McpServerApplicationPolicyConnectionRulesRdp", + "McpServerApplicationPolicyConnectionRulesRDP", "McpServerApplicationPolicyMfaConfig", "McpServerApplicationSCIMConfig", "McpServerApplicationSCIMConfigAuthentication", @@ -164,7 +164,7 @@ "McpServerPortalApplicationOAuthConfigurationGrant", "McpServerPortalApplicationPolicy", "McpServerPortalApplicationPolicyConnectionRules", - "McpServerPortalApplicationPolicyConnectionRulesRdp", + "McpServerPortalApplicationPolicyConnectionRulesRDP", "McpServerPortalApplicationPolicyMfaConfig", "McpServerPortalApplicationSCIMConfig", "McpServerPortalApplicationSCIMConfigAuthentication", @@ -310,7 +310,7 @@ class SelfHostedApplicationOAuthConfiguration(BaseModel): """Settings for OAuth grant behavior.""" -class SelfHostedApplicationPolicyConnectionRulesRdp(BaseModel): +class SelfHostedApplicationPolicyConnectionRulesRDP(BaseModel): """The RDP-specific rules that define clipboard behavior for RDP connections.""" allowed_clipboard_local_to_remote_formats: Optional[List[Literal["text"]]] = None @@ -329,7 +329,7 @@ class SelfHostedApplicationPolicyConnectionRules(BaseModel): The rules that define how users may connect to targets secured by your application. """ - rdp: Optional[SelfHostedApplicationPolicyConnectionRulesRdp] = None + rdp: Optional[SelfHostedApplicationPolicyConnectionRulesRDP] = None """The RDP-specific rules that define clipboard behavior for RDP connections.""" @@ -709,7 +709,7 @@ class SelfHostedApplication(BaseModel): """ -class SaaSApplicationPolicyConnectionRulesRdp(BaseModel): +class SaaSApplicationPolicyConnectionRulesRDP(BaseModel): """The RDP-specific rules that define clipboard behavior for RDP connections.""" allowed_clipboard_local_to_remote_formats: Optional[List[Literal["text"]]] = None @@ -728,7 +728,7 @@ class SaaSApplicationPolicyConnectionRules(BaseModel): The rules that define how users may connect to targets secured by your application. """ - rdp: Optional[SaaSApplicationPolicyConnectionRulesRdp] = None + rdp: Optional[SaaSApplicationPolicyConnectionRulesRDP] = None """The RDP-specific rules that define clipboard behavior for RDP connections.""" @@ -1122,7 +1122,7 @@ class BrowserSSHApplicationOAuthConfiguration(BaseModel): """Settings for OAuth grant behavior.""" -class BrowserSSHApplicationPolicyConnectionRulesRdp(BaseModel): +class BrowserSSHApplicationPolicyConnectionRulesRDP(BaseModel): """The RDP-specific rules that define clipboard behavior for RDP connections.""" allowed_clipboard_local_to_remote_formats: Optional[List[Literal["text"]]] = None @@ -1141,7 +1141,7 @@ class BrowserSSHApplicationPolicyConnectionRules(BaseModel): The rules that define how users may connect to targets secured by your application. """ - rdp: Optional[BrowserSSHApplicationPolicyConnectionRulesRdp] = None + rdp: Optional[BrowserSSHApplicationPolicyConnectionRulesRDP] = None """The RDP-specific rules that define clipboard behavior for RDP connections.""" @@ -1672,7 +1672,7 @@ class BrowserVNCApplicationOAuthConfiguration(BaseModel): """Settings for OAuth grant behavior.""" -class BrowserVNCApplicationPolicyConnectionRulesRdp(BaseModel): +class BrowserVNCApplicationPolicyConnectionRulesRDP(BaseModel): """The RDP-specific rules that define clipboard behavior for RDP connections.""" allowed_clipboard_local_to_remote_formats: Optional[List[Literal["text"]]] = None @@ -1691,7 +1691,7 @@ class BrowserVNCApplicationPolicyConnectionRules(BaseModel): The rules that define how users may connect to targets secured by your application. """ - rdp: Optional[BrowserVNCApplicationPolicyConnectionRulesRdp] = None + rdp: Optional[BrowserVNCApplicationPolicyConnectionRulesRDP] = None """The RDP-specific rules that define clipboard behavior for RDP connections.""" @@ -2113,7 +2113,7 @@ class AppLauncherApplicationLandingPageDesign(BaseModel): """The title shown on the landing page.""" -class AppLauncherApplicationPolicyConnectionRulesRdp(BaseModel): +class AppLauncherApplicationPolicyConnectionRulesRDP(BaseModel): """The RDP-specific rules that define clipboard behavior for RDP connections.""" allowed_clipboard_local_to_remote_formats: Optional[List[Literal["text"]]] = None @@ -2132,7 +2132,7 @@ class AppLauncherApplicationPolicyConnectionRules(BaseModel): The rules that define how users may connect to targets secured by your application. """ - rdp: Optional[AppLauncherApplicationPolicyConnectionRulesRdp] = None + rdp: Optional[AppLauncherApplicationPolicyConnectionRulesRDP] = None """The RDP-specific rules that define clipboard behavior for RDP connections.""" @@ -2327,7 +2327,7 @@ class AppLauncherApplication(BaseModel): """Determines when to skip the App Launcher landing page.""" -class DeviceEnrollmentPermissionsApplicationPolicyConnectionRulesRdp(BaseModel): +class DeviceEnrollmentPermissionsApplicationPolicyConnectionRulesRDP(BaseModel): """The RDP-specific rules that define clipboard behavior for RDP connections.""" allowed_clipboard_local_to_remote_formats: Optional[List[Literal["text"]]] = None @@ -2346,7 +2346,7 @@ class DeviceEnrollmentPermissionsApplicationPolicyConnectionRules(BaseModel): The rules that define how users may connect to targets secured by your application. """ - rdp: Optional[DeviceEnrollmentPermissionsApplicationPolicyConnectionRulesRdp] = None + rdp: Optional[DeviceEnrollmentPermissionsApplicationPolicyConnectionRulesRDP] = None """The RDP-specific rules that define clipboard behavior for RDP connections.""" @@ -2508,7 +2508,7 @@ class DeviceEnrollmentPermissionsApplication(BaseModel): """ -class BrowserIsolationPermissionsApplicationPolicyConnectionRulesRdp(BaseModel): +class BrowserIsolationPermissionsApplicationPolicyConnectionRulesRDP(BaseModel): """The RDP-specific rules that define clipboard behavior for RDP connections.""" allowed_clipboard_local_to_remote_formats: Optional[List[Literal["text"]]] = None @@ -2527,7 +2527,7 @@ class BrowserIsolationPermissionsApplicationPolicyConnectionRules(BaseModel): The rules that define how users may connect to targets secured by your application. """ - rdp: Optional[BrowserIsolationPermissionsApplicationPolicyConnectionRulesRdp] = None + rdp: Optional[BrowserIsolationPermissionsApplicationPolicyConnectionRulesRDP] = None """The RDP-specific rules that define clipboard behavior for RDP connections.""" @@ -2689,7 +2689,7 @@ class BrowserIsolationPermissionsApplication(BaseModel): """ -class GatewayIdentityProxyEndpointApplicationPolicyConnectionRulesRdp(BaseModel): +class GatewayIdentityProxyEndpointApplicationPolicyConnectionRulesRDP(BaseModel): """The RDP-specific rules that define clipboard behavior for RDP connections.""" allowed_clipboard_local_to_remote_formats: Optional[List[Literal["text"]]] = None @@ -2708,7 +2708,7 @@ class GatewayIdentityProxyEndpointApplicationPolicyConnectionRules(BaseModel): The rules that define how users may connect to targets secured by your application. """ - rdp: Optional[GatewayIdentityProxyEndpointApplicationPolicyConnectionRulesRdp] = None + rdp: Optional[GatewayIdentityProxyEndpointApplicationPolicyConnectionRulesRDP] = None """The RDP-specific rules that define clipboard behavior for RDP connections.""" @@ -2870,7 +2870,7 @@ class GatewayIdentityProxyEndpointApplication(BaseModel): """ -class BookmarkApplicationPolicyConnectionRulesRdp(BaseModel): +class BookmarkApplicationPolicyConnectionRulesRDP(BaseModel): """The RDP-specific rules that define clipboard behavior for RDP connections.""" allowed_clipboard_local_to_remote_formats: Optional[List[Literal["text"]]] = None @@ -2889,7 +2889,7 @@ class BookmarkApplicationPolicyConnectionRules(BaseModel): The rules that define how users may connect to targets secured by your application. """ - rdp: Optional[BookmarkApplicationPolicyConnectionRulesRdp] = None + rdp: Optional[BookmarkApplicationPolicyConnectionRulesRDP] = None """The RDP-specific rules that define clipboard behavior for RDP connections.""" @@ -3122,7 +3122,7 @@ class InfrastructureApplication(BaseModel): policies: Optional[List[InfrastructureApplicationPolicy]] = None -class BrowserRdpApplicationTargetCriterion(BaseModel): +class BrowserRDPApplicationTargetCriterion(BaseModel): port: int """The port that the targets use for the chosen communication protocol. @@ -3136,7 +3136,7 @@ class BrowserRdpApplicationTargetCriterion(BaseModel): """Contains a map of target attribute keys to target attribute values.""" -class BrowserRdpApplicationDestinationPublicDestination(BaseModel): +class BrowserRDPApplicationDestinationPublicDestination(BaseModel): """A public hostname that Access will secure. Public destinations support sub-domain and path. Wildcard '*' can be used in the definition. @@ -3152,7 +3152,7 @@ class BrowserRdpApplicationDestinationPublicDestination(BaseModel): """ -class BrowserRdpApplicationDestinationPrivateDestination(BaseModel): +class BrowserRDPApplicationDestinationPrivateDestination(BaseModel): cidr: Optional[str] = None """The CIDR range of the destination. Single IPs will be computed as /32.""" @@ -3177,7 +3177,7 @@ class BrowserRdpApplicationDestinationPrivateDestination(BaseModel): """The VNET ID to match the destination. When omitted, all VNETs will match.""" -class BrowserRdpApplicationDestinationViaMcpServerPortalDestination(BaseModel): +class BrowserRDPApplicationDestinationViaMcpServerPortalDestination(BaseModel): """A MCP server id configured in ai-controls. Access will secure the MCP server if accessed through a MCP portal. @@ -3189,14 +3189,14 @@ class BrowserRdpApplicationDestinationViaMcpServerPortalDestination(BaseModel): type: Optional[Literal["via_mcp_server_portal"]] = None -BrowserRdpApplicationDestination: TypeAlias = Union[ - BrowserRdpApplicationDestinationPublicDestination, - BrowserRdpApplicationDestinationPrivateDestination, - BrowserRdpApplicationDestinationViaMcpServerPortalDestination, +BrowserRDPApplicationDestination: TypeAlias = Union[ + BrowserRDPApplicationDestinationPublicDestination, + BrowserRDPApplicationDestinationPrivateDestination, + BrowserRDPApplicationDestinationViaMcpServerPortalDestination, ] -class BrowserRdpApplicationMfaConfig(BaseModel): +class BrowserRDPApplicationMfaConfig(BaseModel): """Configures multi-factor authentication (MFA) settings.""" allowed_authenticators: Optional[List[Literal["totp", "biometrics", "security_key"]]] = None @@ -3216,7 +3216,7 @@ class BrowserRdpApplicationMfaConfig(BaseModel): """ -class BrowserRdpApplicationOAuthConfigurationDynamicClientRegistration(BaseModel): +class BrowserRDPApplicationOAuthConfigurationDynamicClientRegistration(BaseModel): """Settings for OAuth dynamic client registration.""" allow_any_on_localhost: Optional[bool] = None @@ -3235,7 +3235,7 @@ class BrowserRdpApplicationOAuthConfigurationDynamicClientRegistration(BaseModel """Whether dynamic client registration is enabled.""" -class BrowserRdpApplicationOAuthConfigurationGrant(BaseModel): +class BrowserRDPApplicationOAuthConfigurationGrant(BaseModel): """Settings for OAuth grant behavior.""" access_token_lifetime: Optional[str] = None @@ -3253,12 +3253,12 @@ class BrowserRdpApplicationOAuthConfigurationGrant(BaseModel): """ -class BrowserRdpApplicationOAuthConfiguration(BaseModel): +class BrowserRDPApplicationOAuthConfiguration(BaseModel): """ **Beta:** Optional configuration for managing an OAuth authorization flow controlled by Access. When set, Access will act as the OAuth authorization server for this application. Only compatible with OAuth clients that support [RFC 8707](https://datatracker.ietf.org/doc/html/rfc8707) (Resource Indicators for OAuth 2.0). This feature is currently in beta. """ - dynamic_client_registration: Optional[BrowserRdpApplicationOAuthConfigurationDynamicClientRegistration] = None + dynamic_client_registration: Optional[BrowserRDPApplicationOAuthConfigurationDynamicClientRegistration] = None """Settings for OAuth dynamic client registration.""" enabled: Optional[bool] = None @@ -3268,11 +3268,11 @@ class BrowserRdpApplicationOAuthConfiguration(BaseModel): to `true` if omitted. """ - grant: Optional[BrowserRdpApplicationOAuthConfigurationGrant] = None + grant: Optional[BrowserRDPApplicationOAuthConfigurationGrant] = None """Settings for OAuth grant behavior.""" -class BrowserRdpApplicationPolicyConnectionRulesRdp(BaseModel): +class BrowserRDPApplicationPolicyConnectionRulesRDP(BaseModel): """The RDP-specific rules that define clipboard behavior for RDP connections.""" allowed_clipboard_local_to_remote_formats: Optional[List[Literal["text"]]] = None @@ -3286,16 +3286,16 @@ class BrowserRdpApplicationPolicyConnectionRulesRdp(BaseModel): """ -class BrowserRdpApplicationPolicyConnectionRules(BaseModel): +class BrowserRDPApplicationPolicyConnectionRules(BaseModel): """ The rules that define how users may connect to targets secured by your application. """ - rdp: Optional[BrowserRdpApplicationPolicyConnectionRulesRdp] = None + rdp: Optional[BrowserRDPApplicationPolicyConnectionRulesRDP] = None """The RDP-specific rules that define clipboard behavior for RDP connections.""" -class BrowserRdpApplicationPolicyMfaConfig(BaseModel): +class BrowserRDPApplicationPolicyMfaConfig(BaseModel): """Configures multi-factor authentication (MFA) settings.""" allowed_authenticators: Optional[List[Literal["totp", "biometrics", "security_key"]]] = None @@ -3315,7 +3315,7 @@ class BrowserRdpApplicationPolicyMfaConfig(BaseModel): """ -class BrowserRdpApplicationPolicy(BaseModel): +class BrowserRDPApplicationPolicy(BaseModel): id: Optional[str] = None """The UUID of the policy""" @@ -3328,7 +3328,7 @@ class BrowserRdpApplicationPolicy(BaseModel): session. """ - connection_rules: Optional[BrowserRdpApplicationPolicyConnectionRules] = None + connection_rules: Optional[BrowserRDPApplicationPolicyConnectionRules] = None """ The rules that define how users may connect to targets secured by your application. @@ -3361,7 +3361,7 @@ class BrowserRdpApplicationPolicy(BaseModel): this feature. """ - mfa_config: Optional[BrowserRdpApplicationPolicyMfaConfig] = None + mfa_config: Optional[BrowserRDPApplicationPolicyMfaConfig] = None """Configures multi-factor authentication (MFA) settings.""" name: Optional[str] = None @@ -3395,7 +3395,7 @@ class BrowserRdpApplicationPolicy(BaseModel): updated_at: Optional[datetime] = None -class BrowserRdpApplicationSCIMConfigAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken(BaseModel): +class BrowserRDPApplicationSCIMConfigAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken(BaseModel): """ Attributes for configuring Access Service Token authentication scheme for SCIM provisioning to an application. """ @@ -3416,7 +3416,7 @@ class BrowserRdpApplicationSCIMConfigAuthenticationAccessSCIMConfigAuthenticatio """The authentication scheme to use when making SCIM requests to this application.""" -class BrowserRdpApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken( +class BrowserRDPApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken( BaseModel ): """ @@ -3439,23 +3439,23 @@ class BrowserRdpApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthenti """The authentication scheme to use when making SCIM requests to this application.""" -BrowserRdpApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthentication: TypeAlias = Union[ +BrowserRDPApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthentication: TypeAlias = Union[ SCIMConfigAuthenticationHTTPBasic, SCIMConfigAuthenticationOAuthBearerToken, SCIMConfigAuthenticationOauth2, - BrowserRdpApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken, + BrowserRDPApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken, ] -BrowserRdpApplicationSCIMConfigAuthentication: TypeAlias = Union[ +BrowserRDPApplicationSCIMConfigAuthentication: TypeAlias = Union[ SCIMConfigAuthenticationHTTPBasic, SCIMConfigAuthenticationOAuthBearerToken, SCIMConfigAuthenticationOauth2, - BrowserRdpApplicationSCIMConfigAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken, - List[BrowserRdpApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthentication], + BrowserRDPApplicationSCIMConfigAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken, + List[BrowserRDPApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthentication], ] -class BrowserRdpApplicationSCIMConfig(BaseModel): +class BrowserRDPApplicationSCIMConfig(BaseModel): """Configuration for provisioning to this application via SCIM. This is currently in closed beta. @@ -3470,7 +3470,7 @@ class BrowserRdpApplicationSCIMConfig(BaseModel): remote_uri: str """The base URI for the application's SCIM-compatible API.""" - authentication: Optional[BrowserRdpApplicationSCIMConfigAuthentication] = None + authentication: Optional[BrowserRDPApplicationSCIMConfigAuthentication] = None """ Attributes for configuring HTTP Basic authentication scheme for SCIM provisioning to an application. @@ -3493,14 +3493,14 @@ class BrowserRdpApplicationSCIMConfig(BaseModel): """ -class BrowserRdpApplication(BaseModel): +class BrowserRDPApplication(BaseModel): domain: str """The primary hostname and path secured by Access. This domain will be displayed if the app is visible in the App Launcher. """ - target_criteria: List[BrowserRdpApplicationTargetCriterion] + target_criteria: List[BrowserRDPApplicationTargetCriterion] type: ApplicationType """The application type.""" @@ -3562,7 +3562,7 @@ class BrowserRdpApplication(BaseModel): custom_pages: Optional[List[str]] = None """The custom pages that will be displayed when applicable for this application""" - destinations: Optional[List[BrowserRdpApplicationDestination]] = None + destinations: Optional[List[BrowserRDPApplicationDestination]] = None """List of destinations secured by Access. This supersedes `self_hosted_domains` to allow for more flexibility in defining @@ -3585,13 +3585,13 @@ class BrowserRdpApplication(BaseModel): logo_url: Optional[str] = None """The image URL for the logo shown in the App Launcher dashboard.""" - mfa_config: Optional[BrowserRdpApplicationMfaConfig] = None + mfa_config: Optional[BrowserRDPApplicationMfaConfig] = None """Configures multi-factor authentication (MFA) settings.""" name: Optional[str] = None """The name of the application.""" - oauth_configuration: Optional[BrowserRdpApplicationOAuthConfiguration] = None + oauth_configuration: Optional[BrowserRDPApplicationOAuthConfiguration] = None """ **Beta:** Optional configuration for managing an OAuth authorization flow controlled by Access. When set, Access will act as the OAuth authorization @@ -3612,7 +3612,7 @@ class BrowserRdpApplication(BaseModel): If disabled, the JWT will scope to the hostname by default """ - policies: Optional[List[BrowserRdpApplicationPolicy]] = None + policies: Optional[List[BrowserRDPApplicationPolicy]] = None read_service_tokens_from_header: Optional[str] = None """ @@ -3631,7 +3631,7 @@ class BrowserRdpApplication(BaseModel): attacks. """ - scim_config: Optional[BrowserRdpApplicationSCIMConfig] = None + scim_config: Optional[BrowserRDPApplicationSCIMConfig] = None """Configuration for provisioning to this application via SCIM. This is currently in closed beta. @@ -3789,7 +3789,7 @@ class McpServerApplicationOAuthConfiguration(BaseModel): """Settings for OAuth grant behavior.""" -class McpServerApplicationPolicyConnectionRulesRdp(BaseModel): +class McpServerApplicationPolicyConnectionRulesRDP(BaseModel): """The RDP-specific rules that define clipboard behavior for RDP connections.""" allowed_clipboard_local_to_remote_formats: Optional[List[Literal["text"]]] = None @@ -3808,7 +3808,7 @@ class McpServerApplicationPolicyConnectionRules(BaseModel): The rules that define how users may connect to targets secured by your application. """ - rdp: Optional[McpServerApplicationPolicyConnectionRulesRdp] = None + rdp: Optional[McpServerApplicationPolicyConnectionRulesRDP] = None """The RDP-specific rules that define clipboard behavior for RDP connections.""" @@ -4242,7 +4242,7 @@ class McpServerPortalApplicationOAuthConfiguration(BaseModel): """Settings for OAuth grant behavior.""" -class McpServerPortalApplicationPolicyConnectionRulesRdp(BaseModel): +class McpServerPortalApplicationPolicyConnectionRulesRDP(BaseModel): """The RDP-specific rules that define clipboard behavior for RDP connections.""" allowed_clipboard_local_to_remote_formats: Optional[List[Literal["text"]]] = None @@ -4261,7 +4261,7 @@ class McpServerPortalApplicationPolicyConnectionRules(BaseModel): The rules that define how users may connect to targets secured by your application. """ - rdp: Optional[McpServerPortalApplicationPolicyConnectionRulesRdp] = None + rdp: Optional[McpServerPortalApplicationPolicyConnectionRulesRDP] = None """The RDP-specific rules that define clipboard behavior for RDP connections.""" @@ -4596,7 +4596,7 @@ class McpServerPortalApplication(BaseModel): GatewayIdentityProxyEndpointApplication, BookmarkApplication, InfrastructureApplication, - BrowserRdpApplication, + BrowserRDPApplication, McpServerApplication, McpServerPortalApplication, ] diff --git a/src/cloudflare/types/zero_trust/access/application_update_params.py b/src/cloudflare/types/zero_trust/access/application_update_params.py index 7b542310189..03c6de94cb4 100644 --- a/src/cloudflare/types/zero_trust/access/application_update_params.py +++ b/src/cloudflare/types/zero_trust/access/application_update_params.py @@ -35,7 +35,7 @@ "SelfHostedApplicationPolicyAccessAppPolicyLink", "SelfHostedApplicationPolicyUnionMember2", "SelfHostedApplicationPolicyUnionMember2ConnectionRules", - "SelfHostedApplicationPolicyUnionMember2ConnectionRulesRdp", + "SelfHostedApplicationPolicyUnionMember2ConnectionRulesRDP", "SelfHostedApplicationPolicyUnionMember2MfaConfig", "SelfHostedApplicationSCIMConfig", "SelfHostedApplicationSCIMConfigAuthentication", @@ -47,7 +47,7 @@ "SaaSApplicationPolicyAccessAppPolicyLink", "SaaSApplicationPolicyUnionMember2", "SaaSApplicationPolicyUnionMember2ConnectionRules", - "SaaSApplicationPolicyUnionMember2ConnectionRulesRdp", + "SaaSApplicationPolicyUnionMember2ConnectionRulesRDP", "SaaSApplicationPolicyUnionMember2MfaConfig", "SaaSApplicationSaaSApp", "SaaSApplicationSCIMConfig", @@ -68,7 +68,7 @@ "BrowserSSHApplicationPolicyAccessAppPolicyLink", "BrowserSSHApplicationPolicyUnionMember2", "BrowserSSHApplicationPolicyUnionMember2ConnectionRules", - "BrowserSSHApplicationPolicyUnionMember2ConnectionRulesRdp", + "BrowserSSHApplicationPolicyUnionMember2ConnectionRulesRDP", "BrowserSSHApplicationPolicyUnionMember2MfaConfig", "BrowserSSHApplicationSCIMConfig", "BrowserSSHApplicationSCIMConfigAuthentication", @@ -88,7 +88,7 @@ "BrowserVNCApplicationPolicyAccessAppPolicyLink", "BrowserVNCApplicationPolicyUnionMember2", "BrowserVNCApplicationPolicyUnionMember2ConnectionRules", - "BrowserVNCApplicationPolicyUnionMember2ConnectionRulesRdp", + "BrowserVNCApplicationPolicyUnionMember2ConnectionRulesRDP", "BrowserVNCApplicationPolicyUnionMember2MfaConfig", "BrowserVNCApplicationSCIMConfig", "BrowserVNCApplicationSCIMConfigAuthentication", @@ -102,62 +102,62 @@ "AppLauncherApplicationPolicyAccessAppPolicyLink", "AppLauncherApplicationPolicyUnionMember2", "AppLauncherApplicationPolicyUnionMember2ConnectionRules", - "AppLauncherApplicationPolicyUnionMember2ConnectionRulesRdp", + "AppLauncherApplicationPolicyUnionMember2ConnectionRulesRDP", "AppLauncherApplicationPolicyUnionMember2MfaConfig", "DeviceEnrollmentPermissionsApplication", "DeviceEnrollmentPermissionsApplicationPolicy", "DeviceEnrollmentPermissionsApplicationPolicyAccessAppPolicyLink", "DeviceEnrollmentPermissionsApplicationPolicyUnionMember2", "DeviceEnrollmentPermissionsApplicationPolicyUnionMember2ConnectionRules", - "DeviceEnrollmentPermissionsApplicationPolicyUnionMember2ConnectionRulesRdp", + "DeviceEnrollmentPermissionsApplicationPolicyUnionMember2ConnectionRulesRDP", "DeviceEnrollmentPermissionsApplicationPolicyUnionMember2MfaConfig", "BrowserIsolationPermissionsApplication", "BrowserIsolationPermissionsApplicationPolicy", "BrowserIsolationPermissionsApplicationPolicyAccessAppPolicyLink", "BrowserIsolationPermissionsApplicationPolicyUnionMember2", "BrowserIsolationPermissionsApplicationPolicyUnionMember2ConnectionRules", - "BrowserIsolationPermissionsApplicationPolicyUnionMember2ConnectionRulesRdp", + "BrowserIsolationPermissionsApplicationPolicyUnionMember2ConnectionRulesRDP", "BrowserIsolationPermissionsApplicationPolicyUnionMember2MfaConfig", "GatewayIdentityProxyEndpointApplication", "GatewayIdentityProxyEndpointApplicationPolicy", "GatewayIdentityProxyEndpointApplicationPolicyAccessAppPolicyLink", "GatewayIdentityProxyEndpointApplicationPolicyUnionMember2", "GatewayIdentityProxyEndpointApplicationPolicyUnionMember2ConnectionRules", - "GatewayIdentityProxyEndpointApplicationPolicyUnionMember2ConnectionRulesRdp", + "GatewayIdentityProxyEndpointApplicationPolicyUnionMember2ConnectionRulesRDP", "GatewayIdentityProxyEndpointApplicationPolicyUnionMember2MfaConfig", "BookmarkApplication", "BookmarkApplicationPolicy", "BookmarkApplicationPolicyAccessAppPolicyLink", "BookmarkApplicationPolicyUnionMember2", "BookmarkApplicationPolicyUnionMember2ConnectionRules", - "BookmarkApplicationPolicyUnionMember2ConnectionRulesRdp", + "BookmarkApplicationPolicyUnionMember2ConnectionRulesRDP", "BookmarkApplicationPolicyUnionMember2MfaConfig", "InfrastructureApplication", "InfrastructureApplicationTargetCriterion", "InfrastructureApplicationPolicy", "InfrastructureApplicationPolicyConnectionRules", "InfrastructureApplicationPolicyConnectionRulesSSH", - "BrowserRdpApplication", - "BrowserRdpApplicationTargetCriterion", - "BrowserRdpApplicationDestination", - "BrowserRdpApplicationDestinationPublicDestination", - "BrowserRdpApplicationDestinationPrivateDestination", - "BrowserRdpApplicationDestinationViaMcpServerPortalDestination", - "BrowserRdpApplicationMfaConfig", - "BrowserRdpApplicationOAuthConfiguration", - "BrowserRdpApplicationOAuthConfigurationDynamicClientRegistration", - "BrowserRdpApplicationOAuthConfigurationGrant", - "BrowserRdpApplicationPolicy", - "BrowserRdpApplicationPolicyAccessAppPolicyLink", - "BrowserRdpApplicationPolicyUnionMember2", - "BrowserRdpApplicationPolicyUnionMember2ConnectionRules", - "BrowserRdpApplicationPolicyUnionMember2ConnectionRulesRdp", - "BrowserRdpApplicationPolicyUnionMember2MfaConfig", - "BrowserRdpApplicationSCIMConfig", - "BrowserRdpApplicationSCIMConfigAuthentication", - "BrowserRdpApplicationSCIMConfigAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken", - "BrowserRdpApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthentication", - "BrowserRdpApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken", + "BrowserRDPApplication", + "BrowserRDPApplicationTargetCriterion", + "BrowserRDPApplicationDestination", + "BrowserRDPApplicationDestinationPublicDestination", + "BrowserRDPApplicationDestinationPrivateDestination", + "BrowserRDPApplicationDestinationViaMcpServerPortalDestination", + "BrowserRDPApplicationMfaConfig", + "BrowserRDPApplicationOAuthConfiguration", + "BrowserRDPApplicationOAuthConfigurationDynamicClientRegistration", + "BrowserRDPApplicationOAuthConfigurationGrant", + "BrowserRDPApplicationPolicy", + "BrowserRDPApplicationPolicyAccessAppPolicyLink", + "BrowserRDPApplicationPolicyUnionMember2", + "BrowserRDPApplicationPolicyUnionMember2ConnectionRules", + "BrowserRDPApplicationPolicyUnionMember2ConnectionRulesRDP", + "BrowserRDPApplicationPolicyUnionMember2MfaConfig", + "BrowserRDPApplicationSCIMConfig", + "BrowserRDPApplicationSCIMConfigAuthentication", + "BrowserRDPApplicationSCIMConfigAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken", + "BrowserRDPApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthentication", + "BrowserRDPApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken", "McpServerApplication", "McpServerApplicationDestination", "McpServerApplicationDestinationPublicDestination", @@ -170,7 +170,7 @@ "McpServerApplicationPolicyAccessAppPolicyLink", "McpServerApplicationPolicyUnionMember2", "McpServerApplicationPolicyUnionMember2ConnectionRules", - "McpServerApplicationPolicyUnionMember2ConnectionRulesRdp", + "McpServerApplicationPolicyUnionMember2ConnectionRulesRDP", "McpServerApplicationPolicyUnionMember2MfaConfig", "McpServerApplicationSCIMConfig", "McpServerApplicationSCIMConfigAuthentication", @@ -189,7 +189,7 @@ "McpServerPortalApplicationPolicyAccessAppPolicyLink", "McpServerPortalApplicationPolicyUnionMember2", "McpServerPortalApplicationPolicyUnionMember2ConnectionRules", - "McpServerPortalApplicationPolicyUnionMember2ConnectionRulesRdp", + "McpServerPortalApplicationPolicyUnionMember2ConnectionRulesRDP", "McpServerPortalApplicationPolicyUnionMember2MfaConfig", "McpServerPortalApplicationSCIMConfig", "McpServerPortalApplicationSCIMConfigAuthentication", @@ -531,7 +531,7 @@ class SelfHostedApplicationPolicyAccessAppPolicyLink(TypedDict, total=False): """ -class SelfHostedApplicationPolicyUnionMember2ConnectionRulesRdp(TypedDict, total=False): +class SelfHostedApplicationPolicyUnionMember2ConnectionRulesRDP(TypedDict, total=False): """The RDP-specific rules that define clipboard behavior for RDP connections.""" allowed_clipboard_local_to_remote_formats: List[Literal["text"]] @@ -550,7 +550,7 @@ class SelfHostedApplicationPolicyUnionMember2ConnectionRules(TypedDict, total=Fa The rules that define how users may connect to targets secured by your application. """ - rdp: SelfHostedApplicationPolicyUnionMember2ConnectionRulesRdp + rdp: SelfHostedApplicationPolicyUnionMember2ConnectionRulesRDP """The RDP-specific rules that define clipboard behavior for RDP connections.""" @@ -799,7 +799,7 @@ class SaaSApplicationPolicyAccessAppPolicyLink(TypedDict, total=False): """ -class SaaSApplicationPolicyUnionMember2ConnectionRulesRdp(TypedDict, total=False): +class SaaSApplicationPolicyUnionMember2ConnectionRulesRDP(TypedDict, total=False): """The RDP-specific rules that define clipboard behavior for RDP connections.""" allowed_clipboard_local_to_remote_formats: List[Literal["text"]] @@ -818,7 +818,7 @@ class SaaSApplicationPolicyUnionMember2ConnectionRules(TypedDict, total=False): The rules that define how users may connect to targets secured by your application. """ - rdp: SaaSApplicationPolicyUnionMember2ConnectionRulesRdp + rdp: SaaSApplicationPolicyUnionMember2ConnectionRulesRDP """The RDP-specific rules that define clipboard behavior for RDP connections.""" @@ -1345,7 +1345,7 @@ class BrowserSSHApplicationPolicyAccessAppPolicyLink(TypedDict, total=False): """ -class BrowserSSHApplicationPolicyUnionMember2ConnectionRulesRdp(TypedDict, total=False): +class BrowserSSHApplicationPolicyUnionMember2ConnectionRulesRDP(TypedDict, total=False): """The RDP-specific rules that define clipboard behavior for RDP connections.""" allowed_clipboard_local_to_remote_formats: List[Literal["text"]] @@ -1364,7 +1364,7 @@ class BrowserSSHApplicationPolicyUnionMember2ConnectionRules(TypedDict, total=Fa The rules that define how users may connect to targets secured by your application. """ - rdp: BrowserSSHApplicationPolicyUnionMember2ConnectionRulesRdp + rdp: BrowserSSHApplicationPolicyUnionMember2ConnectionRulesRDP """The RDP-specific rules that define clipboard behavior for RDP connections.""" @@ -1891,7 +1891,7 @@ class BrowserVNCApplicationPolicyAccessAppPolicyLink(TypedDict, total=False): """ -class BrowserVNCApplicationPolicyUnionMember2ConnectionRulesRdp(TypedDict, total=False): +class BrowserVNCApplicationPolicyUnionMember2ConnectionRulesRDP(TypedDict, total=False): """The RDP-specific rules that define clipboard behavior for RDP connections.""" allowed_clipboard_local_to_remote_formats: List[Literal["text"]] @@ -1910,7 +1910,7 @@ class BrowserVNCApplicationPolicyUnionMember2ConnectionRules(TypedDict, total=Fa The rules that define how users may connect to targets secured by your application. """ - rdp: BrowserVNCApplicationPolicyUnionMember2ConnectionRulesRdp + rdp: BrowserVNCApplicationPolicyUnionMember2ConnectionRulesRDP """The RDP-specific rules that define clipboard behavior for RDP connections.""" @@ -2217,7 +2217,7 @@ class AppLauncherApplicationPolicyAccessAppPolicyLink(TypedDict, total=False): """ -class AppLauncherApplicationPolicyUnionMember2ConnectionRulesRdp(TypedDict, total=False): +class AppLauncherApplicationPolicyUnionMember2ConnectionRulesRDP(TypedDict, total=False): """The RDP-specific rules that define clipboard behavior for RDP connections.""" allowed_clipboard_local_to_remote_formats: List[Literal["text"]] @@ -2236,7 +2236,7 @@ class AppLauncherApplicationPolicyUnionMember2ConnectionRules(TypedDict, total=F The rules that define how users may connect to targets secured by your application. """ - rdp: AppLauncherApplicationPolicyUnionMember2ConnectionRulesRdp + rdp: AppLauncherApplicationPolicyUnionMember2ConnectionRulesRDP """The RDP-specific rules that define clipboard behavior for RDP connections.""" @@ -2381,7 +2381,7 @@ class DeviceEnrollmentPermissionsApplicationPolicyAccessAppPolicyLink(TypedDict, """ -class DeviceEnrollmentPermissionsApplicationPolicyUnionMember2ConnectionRulesRdp(TypedDict, total=False): +class DeviceEnrollmentPermissionsApplicationPolicyUnionMember2ConnectionRulesRDP(TypedDict, total=False): """The RDP-specific rules that define clipboard behavior for RDP connections.""" allowed_clipboard_local_to_remote_formats: List[Literal["text"]] @@ -2400,7 +2400,7 @@ class DeviceEnrollmentPermissionsApplicationPolicyUnionMember2ConnectionRules(Ty The rules that define how users may connect to targets secured by your application. """ - rdp: DeviceEnrollmentPermissionsApplicationPolicyUnionMember2ConnectionRulesRdp + rdp: DeviceEnrollmentPermissionsApplicationPolicyUnionMember2ConnectionRulesRDP """The RDP-specific rules that define clipboard behavior for RDP connections.""" @@ -2547,7 +2547,7 @@ class BrowserIsolationPermissionsApplicationPolicyAccessAppPolicyLink(TypedDict, """ -class BrowserIsolationPermissionsApplicationPolicyUnionMember2ConnectionRulesRdp(TypedDict, total=False): +class BrowserIsolationPermissionsApplicationPolicyUnionMember2ConnectionRulesRDP(TypedDict, total=False): """The RDP-specific rules that define clipboard behavior for RDP connections.""" allowed_clipboard_local_to_remote_formats: List[Literal["text"]] @@ -2566,7 +2566,7 @@ class BrowserIsolationPermissionsApplicationPolicyUnionMember2ConnectionRules(Ty The rules that define how users may connect to targets secured by your application. """ - rdp: BrowserIsolationPermissionsApplicationPolicyUnionMember2ConnectionRulesRdp + rdp: BrowserIsolationPermissionsApplicationPolicyUnionMember2ConnectionRulesRDP """The RDP-specific rules that define clipboard behavior for RDP connections.""" @@ -2722,7 +2722,7 @@ class GatewayIdentityProxyEndpointApplicationPolicyAccessAppPolicyLink(TypedDict """ -class GatewayIdentityProxyEndpointApplicationPolicyUnionMember2ConnectionRulesRdp(TypedDict, total=False): +class GatewayIdentityProxyEndpointApplicationPolicyUnionMember2ConnectionRulesRDP(TypedDict, total=False): """The RDP-specific rules that define clipboard behavior for RDP connections.""" allowed_clipboard_local_to_remote_formats: List[Literal["text"]] @@ -2741,7 +2741,7 @@ class GatewayIdentityProxyEndpointApplicationPolicyUnionMember2ConnectionRules(T The rules that define how users may connect to targets secured by your application. """ - rdp: GatewayIdentityProxyEndpointApplicationPolicyUnionMember2ConnectionRulesRdp + rdp: GatewayIdentityProxyEndpointApplicationPolicyUnionMember2ConnectionRulesRDP """The RDP-specific rules that define clipboard behavior for RDP connections.""" @@ -2870,7 +2870,7 @@ class BookmarkApplicationPolicyAccessAppPolicyLink(TypedDict, total=False): """ -class BookmarkApplicationPolicyUnionMember2ConnectionRulesRdp(TypedDict, total=False): +class BookmarkApplicationPolicyUnionMember2ConnectionRulesRDP(TypedDict, total=False): """The RDP-specific rules that define clipboard behavior for RDP connections.""" allowed_clipboard_local_to_remote_formats: List[Literal["text"]] @@ -2889,7 +2889,7 @@ class BookmarkApplicationPolicyUnionMember2ConnectionRules(TypedDict, total=Fals The rules that define how users may connect to targets secured by your application. """ - rdp: BookmarkApplicationPolicyUnionMember2ConnectionRulesRdp + rdp: BookmarkApplicationPolicyUnionMember2ConnectionRulesRDP """The RDP-specific rules that define clipboard behavior for RDP connections.""" @@ -3059,14 +3059,14 @@ class InfrastructureApplicationPolicy(TypedDict, total=False): """ -class BrowserRdpApplication(TypedDict, total=False): +class BrowserRDPApplication(TypedDict, total=False): domain: Required[str] """The primary hostname and path secured by Access. This domain will be displayed if the app is visible in the App Launcher. """ - target_criteria: Required[Iterable[BrowserRdpApplicationTargetCriterion]] + target_criteria: Required[Iterable[BrowserRDPApplicationTargetCriterion]] type: Required[ApplicationType] """The application type.""" @@ -3128,7 +3128,7 @@ class BrowserRdpApplication(TypedDict, total=False): custom_pages: SequenceNotStr[str] """The custom pages that will be displayed when applicable for this application""" - destinations: Iterable[BrowserRdpApplicationDestination] + destinations: Iterable[BrowserRDPApplicationDestination] """List of destinations secured by Access. This supersedes `self_hosted_domains` to allow for more flexibility in defining @@ -3151,13 +3151,13 @@ class BrowserRdpApplication(TypedDict, total=False): logo_url: str """The image URL for the logo shown in the App Launcher dashboard.""" - mfa_config: BrowserRdpApplicationMfaConfig + mfa_config: BrowserRDPApplicationMfaConfig """Configures multi-factor authentication (MFA) settings.""" name: str """The name of the application.""" - oauth_configuration: BrowserRdpApplicationOAuthConfiguration + oauth_configuration: BrowserRDPApplicationOAuthConfiguration """ **Beta:** Optional configuration for managing an OAuth authorization flow controlled by Access. When set, Access will act as the OAuth authorization @@ -3178,7 +3178,7 @@ class BrowserRdpApplication(TypedDict, total=False): If disabled, the JWT will scope to the hostname by default """ - policies: SequenceNotStr[BrowserRdpApplicationPolicy] + policies: SequenceNotStr[BrowserRDPApplicationPolicy] """ The policies that Access applies to the application, in ascending order of precedence. Items can reference existing policies or create new policies @@ -3202,7 +3202,7 @@ class BrowserRdpApplication(TypedDict, total=False): attacks. """ - scim_config: BrowserRdpApplicationSCIMConfig + scim_config: BrowserRDPApplicationSCIMConfig """Configuration for provisioning to this application via SCIM. This is currently in closed beta. @@ -3244,7 +3244,7 @@ class BrowserRdpApplication(TypedDict, total=False): """ -class BrowserRdpApplicationTargetCriterion(TypedDict, total=False): +class BrowserRDPApplicationTargetCriterion(TypedDict, total=False): port: Required[int] """The port that the targets use for the chosen communication protocol. @@ -3258,7 +3258,7 @@ class BrowserRdpApplicationTargetCriterion(TypedDict, total=False): """Contains a map of target attribute keys to target attribute values.""" -class BrowserRdpApplicationDestinationPublicDestination(TypedDict, total=False): +class BrowserRDPApplicationDestinationPublicDestination(TypedDict, total=False): """A public hostname that Access will secure. Public destinations support sub-domain and path. Wildcard '*' can be used in the definition. @@ -3274,7 +3274,7 @@ class BrowserRdpApplicationDestinationPublicDestination(TypedDict, total=False): """ -class BrowserRdpApplicationDestinationPrivateDestination(TypedDict, total=False): +class BrowserRDPApplicationDestinationPrivateDestination(TypedDict, total=False): cidr: str """The CIDR range of the destination. Single IPs will be computed as /32.""" @@ -3299,7 +3299,7 @@ class BrowserRdpApplicationDestinationPrivateDestination(TypedDict, total=False) """The VNET ID to match the destination. When omitted, all VNETs will match.""" -class BrowserRdpApplicationDestinationViaMcpServerPortalDestination(TypedDict, total=False): +class BrowserRDPApplicationDestinationViaMcpServerPortalDestination(TypedDict, total=False): """A MCP server id configured in ai-controls. Access will secure the MCP server if accessed through a MCP portal. @@ -3311,14 +3311,14 @@ class BrowserRdpApplicationDestinationViaMcpServerPortalDestination(TypedDict, t type: Literal["via_mcp_server_portal"] -BrowserRdpApplicationDestination: TypeAlias = Union[ - BrowserRdpApplicationDestinationPublicDestination, - BrowserRdpApplicationDestinationPrivateDestination, - BrowserRdpApplicationDestinationViaMcpServerPortalDestination, +BrowserRDPApplicationDestination: TypeAlias = Union[ + BrowserRDPApplicationDestinationPublicDestination, + BrowserRDPApplicationDestinationPrivateDestination, + BrowserRDPApplicationDestinationViaMcpServerPortalDestination, ] -class BrowserRdpApplicationMfaConfig(TypedDict, total=False): +class BrowserRDPApplicationMfaConfig(TypedDict, total=False): """Configures multi-factor authentication (MFA) settings.""" allowed_authenticators: List[Literal["totp", "biometrics", "security_key"]] @@ -3338,7 +3338,7 @@ class BrowserRdpApplicationMfaConfig(TypedDict, total=False): """ -class BrowserRdpApplicationOAuthConfigurationDynamicClientRegistration(TypedDict, total=False): +class BrowserRDPApplicationOAuthConfigurationDynamicClientRegistration(TypedDict, total=False): """Settings for OAuth dynamic client registration.""" allow_any_on_localhost: bool @@ -3357,7 +3357,7 @@ class BrowserRdpApplicationOAuthConfigurationDynamicClientRegistration(TypedDict """Whether dynamic client registration is enabled.""" -class BrowserRdpApplicationOAuthConfigurationGrant(TypedDict, total=False): +class BrowserRDPApplicationOAuthConfigurationGrant(TypedDict, total=False): """Settings for OAuth grant behavior.""" access_token_lifetime: str @@ -3375,12 +3375,12 @@ class BrowserRdpApplicationOAuthConfigurationGrant(TypedDict, total=False): """ -class BrowserRdpApplicationOAuthConfiguration(TypedDict, total=False): +class BrowserRDPApplicationOAuthConfiguration(TypedDict, total=False): """ **Beta:** Optional configuration for managing an OAuth authorization flow controlled by Access. When set, Access will act as the OAuth authorization server for this application. Only compatible with OAuth clients that support [RFC 8707](https://datatracker.ietf.org/doc/html/rfc8707) (Resource Indicators for OAuth 2.0). This feature is currently in beta. """ - dynamic_client_registration: BrowserRdpApplicationOAuthConfigurationDynamicClientRegistration + dynamic_client_registration: BrowserRDPApplicationOAuthConfigurationDynamicClientRegistration """Settings for OAuth dynamic client registration.""" enabled: bool @@ -3390,11 +3390,11 @@ class BrowserRdpApplicationOAuthConfiguration(TypedDict, total=False): to `true` if omitted. """ - grant: BrowserRdpApplicationOAuthConfigurationGrant + grant: BrowserRDPApplicationOAuthConfigurationGrant """Settings for OAuth grant behavior.""" -class BrowserRdpApplicationPolicyAccessAppPolicyLink(TypedDict, total=False): +class BrowserRDPApplicationPolicyAccessAppPolicyLink(TypedDict, total=False): """A JSON that links a reusable policy to an application.""" id: str @@ -3407,7 +3407,7 @@ class BrowserRdpApplicationPolicyAccessAppPolicyLink(TypedDict, total=False): """ -class BrowserRdpApplicationPolicyUnionMember2ConnectionRulesRdp(TypedDict, total=False): +class BrowserRDPApplicationPolicyUnionMember2ConnectionRulesRDP(TypedDict, total=False): """The RDP-specific rules that define clipboard behavior for RDP connections.""" allowed_clipboard_local_to_remote_formats: List[Literal["text"]] @@ -3421,16 +3421,16 @@ class BrowserRdpApplicationPolicyUnionMember2ConnectionRulesRdp(TypedDict, total """ -class BrowserRdpApplicationPolicyUnionMember2ConnectionRules(TypedDict, total=False): +class BrowserRDPApplicationPolicyUnionMember2ConnectionRules(TypedDict, total=False): """ The rules that define how users may connect to targets secured by your application. """ - rdp: BrowserRdpApplicationPolicyUnionMember2ConnectionRulesRdp + rdp: BrowserRDPApplicationPolicyUnionMember2ConnectionRulesRDP """The RDP-specific rules that define clipboard behavior for RDP connections.""" -class BrowserRdpApplicationPolicyUnionMember2MfaConfig(TypedDict, total=False): +class BrowserRDPApplicationPolicyUnionMember2MfaConfig(TypedDict, total=False): """Configures multi-factor authentication (MFA) settings.""" allowed_authenticators: List[Literal["totp", "biometrics", "security_key"]] @@ -3450,7 +3450,7 @@ class BrowserRdpApplicationPolicyUnionMember2MfaConfig(TypedDict, total=False): """ -class BrowserRdpApplicationPolicyUnionMember2(TypedDict, total=False): +class BrowserRDPApplicationPolicyUnionMember2(TypedDict, total=False): id: str """The UUID of the policy""" @@ -3463,7 +3463,7 @@ class BrowserRdpApplicationPolicyUnionMember2(TypedDict, total=False): session. """ - connection_rules: BrowserRdpApplicationPolicyUnionMember2ConnectionRules + connection_rules: BrowserRDPApplicationPolicyUnionMember2ConnectionRules """ The rules that define how users may connect to targets secured by your application. @@ -3476,7 +3476,7 @@ class BrowserRdpApplicationPolicyUnionMember2(TypedDict, total=False): this feature. """ - mfa_config: BrowserRdpApplicationPolicyUnionMember2MfaConfig + mfa_config: BrowserRDPApplicationPolicyUnionMember2MfaConfig """Configures multi-factor authentication (MFA) settings.""" precedence: int @@ -3499,12 +3499,12 @@ class BrowserRdpApplicationPolicyUnionMember2(TypedDict, total=False): """ -BrowserRdpApplicationPolicy: TypeAlias = Union[ - BrowserRdpApplicationPolicyAccessAppPolicyLink, str, BrowserRdpApplicationPolicyUnionMember2 +BrowserRDPApplicationPolicy: TypeAlias = Union[ + BrowserRDPApplicationPolicyAccessAppPolicyLink, str, BrowserRDPApplicationPolicyUnionMember2 ] -class BrowserRdpApplicationSCIMConfigAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken( +class BrowserRDPApplicationSCIMConfigAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken( TypedDict, total=False ): """ @@ -3527,7 +3527,7 @@ class BrowserRdpApplicationSCIMConfigAuthenticationAccessSCIMConfigAuthenticatio """The authentication scheme to use when making SCIM requests to this application.""" -class BrowserRdpApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken( +class BrowserRDPApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken( TypedDict, total=False ): """ @@ -3550,23 +3550,23 @@ class BrowserRdpApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthenti """The authentication scheme to use when making SCIM requests to this application.""" -BrowserRdpApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthentication: TypeAlias = Union[ +BrowserRDPApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthentication: TypeAlias = Union[ SCIMConfigAuthenticationHTTPBasicParam, SCIMConfigAuthenticationOAuthBearerTokenParam, SCIMConfigAuthenticationOauth2Param, - BrowserRdpApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken, + BrowserRDPApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken, ] -BrowserRdpApplicationSCIMConfigAuthentication: TypeAlias = Union[ +BrowserRDPApplicationSCIMConfigAuthentication: TypeAlias = Union[ SCIMConfigAuthenticationHTTPBasicParam, SCIMConfigAuthenticationOAuthBearerTokenParam, SCIMConfigAuthenticationOauth2Param, - BrowserRdpApplicationSCIMConfigAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken, - Iterable[BrowserRdpApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthentication], + BrowserRDPApplicationSCIMConfigAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken, + Iterable[BrowserRDPApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthentication], ] -class BrowserRdpApplicationSCIMConfig(TypedDict, total=False): +class BrowserRDPApplicationSCIMConfig(TypedDict, total=False): """Configuration for provisioning to this application via SCIM. This is currently in closed beta. @@ -3581,7 +3581,7 @@ class BrowserRdpApplicationSCIMConfig(TypedDict, total=False): remote_uri: Required[str] """The base URI for the application's SCIM-compatible API.""" - authentication: BrowserRdpApplicationSCIMConfigAuthentication + authentication: BrowserRDPApplicationSCIMConfigAuthentication """ Attributes for configuring HTTP Basic authentication scheme for SCIM provisioning to an application. @@ -3854,7 +3854,7 @@ class McpServerApplicationPolicyAccessAppPolicyLink(TypedDict, total=False): """ -class McpServerApplicationPolicyUnionMember2ConnectionRulesRdp(TypedDict, total=False): +class McpServerApplicationPolicyUnionMember2ConnectionRulesRDP(TypedDict, total=False): """The RDP-specific rules that define clipboard behavior for RDP connections.""" allowed_clipboard_local_to_remote_formats: List[Literal["text"]] @@ -3873,7 +3873,7 @@ class McpServerApplicationPolicyUnionMember2ConnectionRules(TypedDict, total=Fal The rules that define how users may connect to targets secured by your application. """ - rdp: McpServerApplicationPolicyUnionMember2ConnectionRulesRdp + rdp: McpServerApplicationPolicyUnionMember2ConnectionRulesRDP """The RDP-specific rules that define clipboard behavior for RDP connections.""" @@ -4307,7 +4307,7 @@ class McpServerPortalApplicationPolicyAccessAppPolicyLink(TypedDict, total=False """ -class McpServerPortalApplicationPolicyUnionMember2ConnectionRulesRdp(TypedDict, total=False): +class McpServerPortalApplicationPolicyUnionMember2ConnectionRulesRDP(TypedDict, total=False): """The RDP-specific rules that define clipboard behavior for RDP connections.""" allowed_clipboard_local_to_remote_formats: List[Literal["text"]] @@ -4326,7 +4326,7 @@ class McpServerPortalApplicationPolicyUnionMember2ConnectionRules(TypedDict, tot The rules that define how users may connect to targets secured by your application. """ - rdp: McpServerPortalApplicationPolicyUnionMember2ConnectionRulesRdp + rdp: McpServerPortalApplicationPolicyUnionMember2ConnectionRulesRDP """The RDP-specific rules that define clipboard behavior for RDP connections.""" @@ -4515,7 +4515,7 @@ class McpServerPortalApplicationSCIMConfig(TypedDict, total=False): GatewayIdentityProxyEndpointApplication, BookmarkApplication, InfrastructureApplication, - BrowserRdpApplication, + BrowserRDPApplication, McpServerApplication, McpServerPortalApplication, ] diff --git a/src/cloudflare/types/zero_trust/access/application_update_response.py b/src/cloudflare/types/zero_trust/access/application_update_response.py index 4c98dbc4372..fb3ebf8f7bf 100644 --- a/src/cloudflare/types/zero_trust/access/application_update_response.py +++ b/src/cloudflare/types/zero_trust/access/application_update_response.py @@ -32,7 +32,7 @@ "SelfHostedApplicationOAuthConfigurationGrant", "SelfHostedApplicationPolicy", "SelfHostedApplicationPolicyConnectionRules", - "SelfHostedApplicationPolicyConnectionRulesRdp", + "SelfHostedApplicationPolicyConnectionRulesRDP", "SelfHostedApplicationPolicyMfaConfig", "SelfHostedApplicationSCIMConfig", "SelfHostedApplicationSCIMConfigAuthentication", @@ -42,7 +42,7 @@ "SaaSApplication", "SaaSApplicationPolicy", "SaaSApplicationPolicyConnectionRules", - "SaaSApplicationPolicyConnectionRulesRdp", + "SaaSApplicationPolicyConnectionRulesRDP", "SaaSApplicationPolicyMfaConfig", "SaaSApplicationSaaSApp", "SaaSApplicationSCIMConfig", @@ -61,7 +61,7 @@ "BrowserSSHApplicationOAuthConfigurationGrant", "BrowserSSHApplicationPolicy", "BrowserSSHApplicationPolicyConnectionRules", - "BrowserSSHApplicationPolicyConnectionRulesRdp", + "BrowserSSHApplicationPolicyConnectionRulesRDP", "BrowserSSHApplicationPolicyMfaConfig", "BrowserSSHApplicationSCIMConfig", "BrowserSSHApplicationSCIMConfigAuthentication", @@ -79,7 +79,7 @@ "BrowserVNCApplicationOAuthConfigurationGrant", "BrowserVNCApplicationPolicy", "BrowserVNCApplicationPolicyConnectionRules", - "BrowserVNCApplicationPolicyConnectionRulesRdp", + "BrowserVNCApplicationPolicyConnectionRulesRDP", "BrowserVNCApplicationPolicyMfaConfig", "BrowserVNCApplicationSCIMConfig", "BrowserVNCApplicationSCIMConfigAuthentication", @@ -91,52 +91,52 @@ "AppLauncherApplicationLandingPageDesign", "AppLauncherApplicationPolicy", "AppLauncherApplicationPolicyConnectionRules", - "AppLauncherApplicationPolicyConnectionRulesRdp", + "AppLauncherApplicationPolicyConnectionRulesRDP", "AppLauncherApplicationPolicyMfaConfig", "DeviceEnrollmentPermissionsApplication", "DeviceEnrollmentPermissionsApplicationPolicy", "DeviceEnrollmentPermissionsApplicationPolicyConnectionRules", - "DeviceEnrollmentPermissionsApplicationPolicyConnectionRulesRdp", + "DeviceEnrollmentPermissionsApplicationPolicyConnectionRulesRDP", "DeviceEnrollmentPermissionsApplicationPolicyMfaConfig", "BrowserIsolationPermissionsApplication", "BrowserIsolationPermissionsApplicationPolicy", "BrowserIsolationPermissionsApplicationPolicyConnectionRules", - "BrowserIsolationPermissionsApplicationPolicyConnectionRulesRdp", + "BrowserIsolationPermissionsApplicationPolicyConnectionRulesRDP", "BrowserIsolationPermissionsApplicationPolicyMfaConfig", "GatewayIdentityProxyEndpointApplication", "GatewayIdentityProxyEndpointApplicationPolicy", "GatewayIdentityProxyEndpointApplicationPolicyConnectionRules", - "GatewayIdentityProxyEndpointApplicationPolicyConnectionRulesRdp", + "GatewayIdentityProxyEndpointApplicationPolicyConnectionRulesRDP", "GatewayIdentityProxyEndpointApplicationPolicyMfaConfig", "BookmarkApplication", "BookmarkApplicationPolicy", "BookmarkApplicationPolicyConnectionRules", - "BookmarkApplicationPolicyConnectionRulesRdp", + "BookmarkApplicationPolicyConnectionRulesRDP", "BookmarkApplicationPolicyMfaConfig", "InfrastructureApplication", "InfrastructureApplicationTargetCriterion", "InfrastructureApplicationPolicy", "InfrastructureApplicationPolicyConnectionRules", "InfrastructureApplicationPolicyConnectionRulesSSH", - "BrowserRdpApplication", - "BrowserRdpApplicationTargetCriterion", - "BrowserRdpApplicationDestination", - "BrowserRdpApplicationDestinationPublicDestination", - "BrowserRdpApplicationDestinationPrivateDestination", - "BrowserRdpApplicationDestinationViaMcpServerPortalDestination", - "BrowserRdpApplicationMfaConfig", - "BrowserRdpApplicationOAuthConfiguration", - "BrowserRdpApplicationOAuthConfigurationDynamicClientRegistration", - "BrowserRdpApplicationOAuthConfigurationGrant", - "BrowserRdpApplicationPolicy", - "BrowserRdpApplicationPolicyConnectionRules", - "BrowserRdpApplicationPolicyConnectionRulesRdp", - "BrowserRdpApplicationPolicyMfaConfig", - "BrowserRdpApplicationSCIMConfig", - "BrowserRdpApplicationSCIMConfigAuthentication", - "BrowserRdpApplicationSCIMConfigAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken", - "BrowserRdpApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthentication", - "BrowserRdpApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken", + "BrowserRDPApplication", + "BrowserRDPApplicationTargetCriterion", + "BrowserRDPApplicationDestination", + "BrowserRDPApplicationDestinationPublicDestination", + "BrowserRDPApplicationDestinationPrivateDestination", + "BrowserRDPApplicationDestinationViaMcpServerPortalDestination", + "BrowserRDPApplicationMfaConfig", + "BrowserRDPApplicationOAuthConfiguration", + "BrowserRDPApplicationOAuthConfigurationDynamicClientRegistration", + "BrowserRDPApplicationOAuthConfigurationGrant", + "BrowserRDPApplicationPolicy", + "BrowserRDPApplicationPolicyConnectionRules", + "BrowserRDPApplicationPolicyConnectionRulesRDP", + "BrowserRDPApplicationPolicyMfaConfig", + "BrowserRDPApplicationSCIMConfig", + "BrowserRDPApplicationSCIMConfigAuthentication", + "BrowserRDPApplicationSCIMConfigAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken", + "BrowserRDPApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthentication", + "BrowserRDPApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken", "McpServerApplication", "McpServerApplicationDestination", "McpServerApplicationDestinationPublicDestination", @@ -147,7 +147,7 @@ "McpServerApplicationOAuthConfigurationGrant", "McpServerApplicationPolicy", "McpServerApplicationPolicyConnectionRules", - "McpServerApplicationPolicyConnectionRulesRdp", + "McpServerApplicationPolicyConnectionRulesRDP", "McpServerApplicationPolicyMfaConfig", "McpServerApplicationSCIMConfig", "McpServerApplicationSCIMConfigAuthentication", @@ -164,7 +164,7 @@ "McpServerPortalApplicationOAuthConfigurationGrant", "McpServerPortalApplicationPolicy", "McpServerPortalApplicationPolicyConnectionRules", - "McpServerPortalApplicationPolicyConnectionRulesRdp", + "McpServerPortalApplicationPolicyConnectionRulesRDP", "McpServerPortalApplicationPolicyMfaConfig", "McpServerPortalApplicationSCIMConfig", "McpServerPortalApplicationSCIMConfigAuthentication", @@ -310,7 +310,7 @@ class SelfHostedApplicationOAuthConfiguration(BaseModel): """Settings for OAuth grant behavior.""" -class SelfHostedApplicationPolicyConnectionRulesRdp(BaseModel): +class SelfHostedApplicationPolicyConnectionRulesRDP(BaseModel): """The RDP-specific rules that define clipboard behavior for RDP connections.""" allowed_clipboard_local_to_remote_formats: Optional[List[Literal["text"]]] = None @@ -329,7 +329,7 @@ class SelfHostedApplicationPolicyConnectionRules(BaseModel): The rules that define how users may connect to targets secured by your application. """ - rdp: Optional[SelfHostedApplicationPolicyConnectionRulesRdp] = None + rdp: Optional[SelfHostedApplicationPolicyConnectionRulesRDP] = None """The RDP-specific rules that define clipboard behavior for RDP connections.""" @@ -709,7 +709,7 @@ class SelfHostedApplication(BaseModel): """ -class SaaSApplicationPolicyConnectionRulesRdp(BaseModel): +class SaaSApplicationPolicyConnectionRulesRDP(BaseModel): """The RDP-specific rules that define clipboard behavior for RDP connections.""" allowed_clipboard_local_to_remote_formats: Optional[List[Literal["text"]]] = None @@ -728,7 +728,7 @@ class SaaSApplicationPolicyConnectionRules(BaseModel): The rules that define how users may connect to targets secured by your application. """ - rdp: Optional[SaaSApplicationPolicyConnectionRulesRdp] = None + rdp: Optional[SaaSApplicationPolicyConnectionRulesRDP] = None """The RDP-specific rules that define clipboard behavior for RDP connections.""" @@ -1122,7 +1122,7 @@ class BrowserSSHApplicationOAuthConfiguration(BaseModel): """Settings for OAuth grant behavior.""" -class BrowserSSHApplicationPolicyConnectionRulesRdp(BaseModel): +class BrowserSSHApplicationPolicyConnectionRulesRDP(BaseModel): """The RDP-specific rules that define clipboard behavior for RDP connections.""" allowed_clipboard_local_to_remote_formats: Optional[List[Literal["text"]]] = None @@ -1141,7 +1141,7 @@ class BrowserSSHApplicationPolicyConnectionRules(BaseModel): The rules that define how users may connect to targets secured by your application. """ - rdp: Optional[BrowserSSHApplicationPolicyConnectionRulesRdp] = None + rdp: Optional[BrowserSSHApplicationPolicyConnectionRulesRDP] = None """The RDP-specific rules that define clipboard behavior for RDP connections.""" @@ -1672,7 +1672,7 @@ class BrowserVNCApplicationOAuthConfiguration(BaseModel): """Settings for OAuth grant behavior.""" -class BrowserVNCApplicationPolicyConnectionRulesRdp(BaseModel): +class BrowserVNCApplicationPolicyConnectionRulesRDP(BaseModel): """The RDP-specific rules that define clipboard behavior for RDP connections.""" allowed_clipboard_local_to_remote_formats: Optional[List[Literal["text"]]] = None @@ -1691,7 +1691,7 @@ class BrowserVNCApplicationPolicyConnectionRules(BaseModel): The rules that define how users may connect to targets secured by your application. """ - rdp: Optional[BrowserVNCApplicationPolicyConnectionRulesRdp] = None + rdp: Optional[BrowserVNCApplicationPolicyConnectionRulesRDP] = None """The RDP-specific rules that define clipboard behavior for RDP connections.""" @@ -2113,7 +2113,7 @@ class AppLauncherApplicationLandingPageDesign(BaseModel): """The title shown on the landing page.""" -class AppLauncherApplicationPolicyConnectionRulesRdp(BaseModel): +class AppLauncherApplicationPolicyConnectionRulesRDP(BaseModel): """The RDP-specific rules that define clipboard behavior for RDP connections.""" allowed_clipboard_local_to_remote_formats: Optional[List[Literal["text"]]] = None @@ -2132,7 +2132,7 @@ class AppLauncherApplicationPolicyConnectionRules(BaseModel): The rules that define how users may connect to targets secured by your application. """ - rdp: Optional[AppLauncherApplicationPolicyConnectionRulesRdp] = None + rdp: Optional[AppLauncherApplicationPolicyConnectionRulesRDP] = None """The RDP-specific rules that define clipboard behavior for RDP connections.""" @@ -2327,7 +2327,7 @@ class AppLauncherApplication(BaseModel): """Determines when to skip the App Launcher landing page.""" -class DeviceEnrollmentPermissionsApplicationPolicyConnectionRulesRdp(BaseModel): +class DeviceEnrollmentPermissionsApplicationPolicyConnectionRulesRDP(BaseModel): """The RDP-specific rules that define clipboard behavior for RDP connections.""" allowed_clipboard_local_to_remote_formats: Optional[List[Literal["text"]]] = None @@ -2346,7 +2346,7 @@ class DeviceEnrollmentPermissionsApplicationPolicyConnectionRules(BaseModel): The rules that define how users may connect to targets secured by your application. """ - rdp: Optional[DeviceEnrollmentPermissionsApplicationPolicyConnectionRulesRdp] = None + rdp: Optional[DeviceEnrollmentPermissionsApplicationPolicyConnectionRulesRDP] = None """The RDP-specific rules that define clipboard behavior for RDP connections.""" @@ -2508,7 +2508,7 @@ class DeviceEnrollmentPermissionsApplication(BaseModel): """ -class BrowserIsolationPermissionsApplicationPolicyConnectionRulesRdp(BaseModel): +class BrowserIsolationPermissionsApplicationPolicyConnectionRulesRDP(BaseModel): """The RDP-specific rules that define clipboard behavior for RDP connections.""" allowed_clipboard_local_to_remote_formats: Optional[List[Literal["text"]]] = None @@ -2527,7 +2527,7 @@ class BrowserIsolationPermissionsApplicationPolicyConnectionRules(BaseModel): The rules that define how users may connect to targets secured by your application. """ - rdp: Optional[BrowserIsolationPermissionsApplicationPolicyConnectionRulesRdp] = None + rdp: Optional[BrowserIsolationPermissionsApplicationPolicyConnectionRulesRDP] = None """The RDP-specific rules that define clipboard behavior for RDP connections.""" @@ -2689,7 +2689,7 @@ class BrowserIsolationPermissionsApplication(BaseModel): """ -class GatewayIdentityProxyEndpointApplicationPolicyConnectionRulesRdp(BaseModel): +class GatewayIdentityProxyEndpointApplicationPolicyConnectionRulesRDP(BaseModel): """The RDP-specific rules that define clipboard behavior for RDP connections.""" allowed_clipboard_local_to_remote_formats: Optional[List[Literal["text"]]] = None @@ -2708,7 +2708,7 @@ class GatewayIdentityProxyEndpointApplicationPolicyConnectionRules(BaseModel): The rules that define how users may connect to targets secured by your application. """ - rdp: Optional[GatewayIdentityProxyEndpointApplicationPolicyConnectionRulesRdp] = None + rdp: Optional[GatewayIdentityProxyEndpointApplicationPolicyConnectionRulesRDP] = None """The RDP-specific rules that define clipboard behavior for RDP connections.""" @@ -2870,7 +2870,7 @@ class GatewayIdentityProxyEndpointApplication(BaseModel): """ -class BookmarkApplicationPolicyConnectionRulesRdp(BaseModel): +class BookmarkApplicationPolicyConnectionRulesRDP(BaseModel): """The RDP-specific rules that define clipboard behavior for RDP connections.""" allowed_clipboard_local_to_remote_formats: Optional[List[Literal["text"]]] = None @@ -2889,7 +2889,7 @@ class BookmarkApplicationPolicyConnectionRules(BaseModel): The rules that define how users may connect to targets secured by your application. """ - rdp: Optional[BookmarkApplicationPolicyConnectionRulesRdp] = None + rdp: Optional[BookmarkApplicationPolicyConnectionRulesRDP] = None """The RDP-specific rules that define clipboard behavior for RDP connections.""" @@ -3122,7 +3122,7 @@ class InfrastructureApplication(BaseModel): policies: Optional[List[InfrastructureApplicationPolicy]] = None -class BrowserRdpApplicationTargetCriterion(BaseModel): +class BrowserRDPApplicationTargetCriterion(BaseModel): port: int """The port that the targets use for the chosen communication protocol. @@ -3136,7 +3136,7 @@ class BrowserRdpApplicationTargetCriterion(BaseModel): """Contains a map of target attribute keys to target attribute values.""" -class BrowserRdpApplicationDestinationPublicDestination(BaseModel): +class BrowserRDPApplicationDestinationPublicDestination(BaseModel): """A public hostname that Access will secure. Public destinations support sub-domain and path. Wildcard '*' can be used in the definition. @@ -3152,7 +3152,7 @@ class BrowserRdpApplicationDestinationPublicDestination(BaseModel): """ -class BrowserRdpApplicationDestinationPrivateDestination(BaseModel): +class BrowserRDPApplicationDestinationPrivateDestination(BaseModel): cidr: Optional[str] = None """The CIDR range of the destination. Single IPs will be computed as /32.""" @@ -3177,7 +3177,7 @@ class BrowserRdpApplicationDestinationPrivateDestination(BaseModel): """The VNET ID to match the destination. When omitted, all VNETs will match.""" -class BrowserRdpApplicationDestinationViaMcpServerPortalDestination(BaseModel): +class BrowserRDPApplicationDestinationViaMcpServerPortalDestination(BaseModel): """A MCP server id configured in ai-controls. Access will secure the MCP server if accessed through a MCP portal. @@ -3189,14 +3189,14 @@ class BrowserRdpApplicationDestinationViaMcpServerPortalDestination(BaseModel): type: Optional[Literal["via_mcp_server_portal"]] = None -BrowserRdpApplicationDestination: TypeAlias = Union[ - BrowserRdpApplicationDestinationPublicDestination, - BrowserRdpApplicationDestinationPrivateDestination, - BrowserRdpApplicationDestinationViaMcpServerPortalDestination, +BrowserRDPApplicationDestination: TypeAlias = Union[ + BrowserRDPApplicationDestinationPublicDestination, + BrowserRDPApplicationDestinationPrivateDestination, + BrowserRDPApplicationDestinationViaMcpServerPortalDestination, ] -class BrowserRdpApplicationMfaConfig(BaseModel): +class BrowserRDPApplicationMfaConfig(BaseModel): """Configures multi-factor authentication (MFA) settings.""" allowed_authenticators: Optional[List[Literal["totp", "biometrics", "security_key"]]] = None @@ -3216,7 +3216,7 @@ class BrowserRdpApplicationMfaConfig(BaseModel): """ -class BrowserRdpApplicationOAuthConfigurationDynamicClientRegistration(BaseModel): +class BrowserRDPApplicationOAuthConfigurationDynamicClientRegistration(BaseModel): """Settings for OAuth dynamic client registration.""" allow_any_on_localhost: Optional[bool] = None @@ -3235,7 +3235,7 @@ class BrowserRdpApplicationOAuthConfigurationDynamicClientRegistration(BaseModel """Whether dynamic client registration is enabled.""" -class BrowserRdpApplicationOAuthConfigurationGrant(BaseModel): +class BrowserRDPApplicationOAuthConfigurationGrant(BaseModel): """Settings for OAuth grant behavior.""" access_token_lifetime: Optional[str] = None @@ -3253,12 +3253,12 @@ class BrowserRdpApplicationOAuthConfigurationGrant(BaseModel): """ -class BrowserRdpApplicationOAuthConfiguration(BaseModel): +class BrowserRDPApplicationOAuthConfiguration(BaseModel): """ **Beta:** Optional configuration for managing an OAuth authorization flow controlled by Access. When set, Access will act as the OAuth authorization server for this application. Only compatible with OAuth clients that support [RFC 8707](https://datatracker.ietf.org/doc/html/rfc8707) (Resource Indicators for OAuth 2.0). This feature is currently in beta. """ - dynamic_client_registration: Optional[BrowserRdpApplicationOAuthConfigurationDynamicClientRegistration] = None + dynamic_client_registration: Optional[BrowserRDPApplicationOAuthConfigurationDynamicClientRegistration] = None """Settings for OAuth dynamic client registration.""" enabled: Optional[bool] = None @@ -3268,11 +3268,11 @@ class BrowserRdpApplicationOAuthConfiguration(BaseModel): to `true` if omitted. """ - grant: Optional[BrowserRdpApplicationOAuthConfigurationGrant] = None + grant: Optional[BrowserRDPApplicationOAuthConfigurationGrant] = None """Settings for OAuth grant behavior.""" -class BrowserRdpApplicationPolicyConnectionRulesRdp(BaseModel): +class BrowserRDPApplicationPolicyConnectionRulesRDP(BaseModel): """The RDP-specific rules that define clipboard behavior for RDP connections.""" allowed_clipboard_local_to_remote_formats: Optional[List[Literal["text"]]] = None @@ -3286,16 +3286,16 @@ class BrowserRdpApplicationPolicyConnectionRulesRdp(BaseModel): """ -class BrowserRdpApplicationPolicyConnectionRules(BaseModel): +class BrowserRDPApplicationPolicyConnectionRules(BaseModel): """ The rules that define how users may connect to targets secured by your application. """ - rdp: Optional[BrowserRdpApplicationPolicyConnectionRulesRdp] = None + rdp: Optional[BrowserRDPApplicationPolicyConnectionRulesRDP] = None """The RDP-specific rules that define clipboard behavior for RDP connections.""" -class BrowserRdpApplicationPolicyMfaConfig(BaseModel): +class BrowserRDPApplicationPolicyMfaConfig(BaseModel): """Configures multi-factor authentication (MFA) settings.""" allowed_authenticators: Optional[List[Literal["totp", "biometrics", "security_key"]]] = None @@ -3315,7 +3315,7 @@ class BrowserRdpApplicationPolicyMfaConfig(BaseModel): """ -class BrowserRdpApplicationPolicy(BaseModel): +class BrowserRDPApplicationPolicy(BaseModel): id: Optional[str] = None """The UUID of the policy""" @@ -3328,7 +3328,7 @@ class BrowserRdpApplicationPolicy(BaseModel): session. """ - connection_rules: Optional[BrowserRdpApplicationPolicyConnectionRules] = None + connection_rules: Optional[BrowserRDPApplicationPolicyConnectionRules] = None """ The rules that define how users may connect to targets secured by your application. @@ -3361,7 +3361,7 @@ class BrowserRdpApplicationPolicy(BaseModel): this feature. """ - mfa_config: Optional[BrowserRdpApplicationPolicyMfaConfig] = None + mfa_config: Optional[BrowserRDPApplicationPolicyMfaConfig] = None """Configures multi-factor authentication (MFA) settings.""" name: Optional[str] = None @@ -3395,7 +3395,7 @@ class BrowserRdpApplicationPolicy(BaseModel): updated_at: Optional[datetime] = None -class BrowserRdpApplicationSCIMConfigAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken(BaseModel): +class BrowserRDPApplicationSCIMConfigAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken(BaseModel): """ Attributes for configuring Access Service Token authentication scheme for SCIM provisioning to an application. """ @@ -3416,7 +3416,7 @@ class BrowserRdpApplicationSCIMConfigAuthenticationAccessSCIMConfigAuthenticatio """The authentication scheme to use when making SCIM requests to this application.""" -class BrowserRdpApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken( +class BrowserRDPApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken( BaseModel ): """ @@ -3439,23 +3439,23 @@ class BrowserRdpApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthenti """The authentication scheme to use when making SCIM requests to this application.""" -BrowserRdpApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthentication: TypeAlias = Union[ +BrowserRDPApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthentication: TypeAlias = Union[ SCIMConfigAuthenticationHTTPBasic, SCIMConfigAuthenticationOAuthBearerToken, SCIMConfigAuthenticationOauth2, - BrowserRdpApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken, + BrowserRDPApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken, ] -BrowserRdpApplicationSCIMConfigAuthentication: TypeAlias = Union[ +BrowserRDPApplicationSCIMConfigAuthentication: TypeAlias = Union[ SCIMConfigAuthenticationHTTPBasic, SCIMConfigAuthenticationOAuthBearerToken, SCIMConfigAuthenticationOauth2, - BrowserRdpApplicationSCIMConfigAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken, - List[BrowserRdpApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthentication], + BrowserRDPApplicationSCIMConfigAuthenticationAccessSCIMConfigAuthenticationAccessServiceToken, + List[BrowserRDPApplicationSCIMConfigAuthenticationAccessSCIMConfigMultiAuthentication], ] -class BrowserRdpApplicationSCIMConfig(BaseModel): +class BrowserRDPApplicationSCIMConfig(BaseModel): """Configuration for provisioning to this application via SCIM. This is currently in closed beta. @@ -3470,7 +3470,7 @@ class BrowserRdpApplicationSCIMConfig(BaseModel): remote_uri: str """The base URI for the application's SCIM-compatible API.""" - authentication: Optional[BrowserRdpApplicationSCIMConfigAuthentication] = None + authentication: Optional[BrowserRDPApplicationSCIMConfigAuthentication] = None """ Attributes for configuring HTTP Basic authentication scheme for SCIM provisioning to an application. @@ -3493,14 +3493,14 @@ class BrowserRdpApplicationSCIMConfig(BaseModel): """ -class BrowserRdpApplication(BaseModel): +class BrowserRDPApplication(BaseModel): domain: str """The primary hostname and path secured by Access. This domain will be displayed if the app is visible in the App Launcher. """ - target_criteria: List[BrowserRdpApplicationTargetCriterion] + target_criteria: List[BrowserRDPApplicationTargetCriterion] type: ApplicationType """The application type.""" @@ -3562,7 +3562,7 @@ class BrowserRdpApplication(BaseModel): custom_pages: Optional[List[str]] = None """The custom pages that will be displayed when applicable for this application""" - destinations: Optional[List[BrowserRdpApplicationDestination]] = None + destinations: Optional[List[BrowserRDPApplicationDestination]] = None """List of destinations secured by Access. This supersedes `self_hosted_domains` to allow for more flexibility in defining @@ -3585,13 +3585,13 @@ class BrowserRdpApplication(BaseModel): logo_url: Optional[str] = None """The image URL for the logo shown in the App Launcher dashboard.""" - mfa_config: Optional[BrowserRdpApplicationMfaConfig] = None + mfa_config: Optional[BrowserRDPApplicationMfaConfig] = None """Configures multi-factor authentication (MFA) settings.""" name: Optional[str] = None """The name of the application.""" - oauth_configuration: Optional[BrowserRdpApplicationOAuthConfiguration] = None + oauth_configuration: Optional[BrowserRDPApplicationOAuthConfiguration] = None """ **Beta:** Optional configuration for managing an OAuth authorization flow controlled by Access. When set, Access will act as the OAuth authorization @@ -3612,7 +3612,7 @@ class BrowserRdpApplication(BaseModel): If disabled, the JWT will scope to the hostname by default """ - policies: Optional[List[BrowserRdpApplicationPolicy]] = None + policies: Optional[List[BrowserRDPApplicationPolicy]] = None read_service_tokens_from_header: Optional[str] = None """ @@ -3631,7 +3631,7 @@ class BrowserRdpApplication(BaseModel): attacks. """ - scim_config: Optional[BrowserRdpApplicationSCIMConfig] = None + scim_config: Optional[BrowserRDPApplicationSCIMConfig] = None """Configuration for provisioning to this application via SCIM. This is currently in closed beta. @@ -3789,7 +3789,7 @@ class McpServerApplicationOAuthConfiguration(BaseModel): """Settings for OAuth grant behavior.""" -class McpServerApplicationPolicyConnectionRulesRdp(BaseModel): +class McpServerApplicationPolicyConnectionRulesRDP(BaseModel): """The RDP-specific rules that define clipboard behavior for RDP connections.""" allowed_clipboard_local_to_remote_formats: Optional[List[Literal["text"]]] = None @@ -3808,7 +3808,7 @@ class McpServerApplicationPolicyConnectionRules(BaseModel): The rules that define how users may connect to targets secured by your application. """ - rdp: Optional[McpServerApplicationPolicyConnectionRulesRdp] = None + rdp: Optional[McpServerApplicationPolicyConnectionRulesRDP] = None """The RDP-specific rules that define clipboard behavior for RDP connections.""" @@ -4242,7 +4242,7 @@ class McpServerPortalApplicationOAuthConfiguration(BaseModel): """Settings for OAuth grant behavior.""" -class McpServerPortalApplicationPolicyConnectionRulesRdp(BaseModel): +class McpServerPortalApplicationPolicyConnectionRulesRDP(BaseModel): """The RDP-specific rules that define clipboard behavior for RDP connections.""" allowed_clipboard_local_to_remote_formats: Optional[List[Literal["text"]]] = None @@ -4261,7 +4261,7 @@ class McpServerPortalApplicationPolicyConnectionRules(BaseModel): The rules that define how users may connect to targets secured by your application. """ - rdp: Optional[McpServerPortalApplicationPolicyConnectionRulesRdp] = None + rdp: Optional[McpServerPortalApplicationPolicyConnectionRulesRDP] = None """The RDP-specific rules that define clipboard behavior for RDP connections.""" @@ -4596,7 +4596,7 @@ class McpServerPortalApplication(BaseModel): GatewayIdentityProxyEndpointApplication, BookmarkApplication, InfrastructureApplication, - BrowserRdpApplication, + BrowserRDPApplication, McpServerApplication, McpServerPortalApplication, ] diff --git a/src/cloudflare/types/zero_trust/access/applications/policy_create_params.py b/src/cloudflare/types/zero_trust/access/applications/policy_create_params.py index 7fdbf35a278..9dd797afa07 100644 --- a/src/cloudflare/types/zero_trust/access/applications/policy_create_params.py +++ b/src/cloudflare/types/zero_trust/access/applications/policy_create_params.py @@ -7,7 +7,7 @@ from ..approval_group_param import ApprovalGroupParam -__all__ = ["PolicyCreateParams", "ConnectionRules", "ConnectionRulesRdp", "MfaConfig"] +__all__ = ["PolicyCreateParams", "ConnectionRules", "ConnectionRulesRDP", "MfaConfig"] class PolicyCreateParams(TypedDict, total=False): @@ -62,7 +62,7 @@ class PolicyCreateParams(TypedDict, total=False): """ -class ConnectionRulesRdp(TypedDict, total=False): +class ConnectionRulesRDP(TypedDict, total=False): """The RDP-specific rules that define clipboard behavior for RDP connections.""" allowed_clipboard_local_to_remote_formats: List[Literal["text"]] @@ -81,7 +81,7 @@ class ConnectionRules(TypedDict, total=False): The rules that define how users may connect to targets secured by your application. """ - rdp: ConnectionRulesRdp + rdp: ConnectionRulesRDP """The RDP-specific rules that define clipboard behavior for RDP connections.""" diff --git a/src/cloudflare/types/zero_trust/access/applications/policy_create_response.py b/src/cloudflare/types/zero_trust/access/applications/policy_create_response.py index c5f38f54f39..05d87c5ee24 100644 --- a/src/cloudflare/types/zero_trust/access/applications/policy_create_response.py +++ b/src/cloudflare/types/zero_trust/access/applications/policy_create_response.py @@ -9,10 +9,10 @@ from .access_rule import AccessRule from ..approval_group import ApprovalGroup -__all__ = ["PolicyCreateResponse", "ConnectionRules", "ConnectionRulesRdp", "MfaConfig"] +__all__ = ["PolicyCreateResponse", "ConnectionRules", "ConnectionRulesRDP", "MfaConfig"] -class ConnectionRulesRdp(BaseModel): +class ConnectionRulesRDP(BaseModel): """The RDP-specific rules that define clipboard behavior for RDP connections.""" allowed_clipboard_local_to_remote_formats: Optional[List[Literal["text"]]] = None @@ -31,7 +31,7 @@ class ConnectionRules(BaseModel): The rules that define how users may connect to targets secured by your application. """ - rdp: Optional[ConnectionRulesRdp] = None + rdp: Optional[ConnectionRulesRDP] = None """The RDP-specific rules that define clipboard behavior for RDP connections.""" diff --git a/src/cloudflare/types/zero_trust/access/applications/policy_get_response.py b/src/cloudflare/types/zero_trust/access/applications/policy_get_response.py index 3e434898e01..4bc53c6fe31 100644 --- a/src/cloudflare/types/zero_trust/access/applications/policy_get_response.py +++ b/src/cloudflare/types/zero_trust/access/applications/policy_get_response.py @@ -9,10 +9,10 @@ from .access_rule import AccessRule from ..approval_group import ApprovalGroup -__all__ = ["PolicyGetResponse", "ConnectionRules", "ConnectionRulesRdp", "MfaConfig"] +__all__ = ["PolicyGetResponse", "ConnectionRules", "ConnectionRulesRDP", "MfaConfig"] -class ConnectionRulesRdp(BaseModel): +class ConnectionRulesRDP(BaseModel): """The RDP-specific rules that define clipboard behavior for RDP connections.""" allowed_clipboard_local_to_remote_formats: Optional[List[Literal["text"]]] = None @@ -31,7 +31,7 @@ class ConnectionRules(BaseModel): The rules that define how users may connect to targets secured by your application. """ - rdp: Optional[ConnectionRulesRdp] = None + rdp: Optional[ConnectionRulesRDP] = None """The RDP-specific rules that define clipboard behavior for RDP connections.""" diff --git a/src/cloudflare/types/zero_trust/access/applications/policy_list_response.py b/src/cloudflare/types/zero_trust/access/applications/policy_list_response.py index a292107a2e6..2ab9487d994 100644 --- a/src/cloudflare/types/zero_trust/access/applications/policy_list_response.py +++ b/src/cloudflare/types/zero_trust/access/applications/policy_list_response.py @@ -9,10 +9,10 @@ from .access_rule import AccessRule from ..approval_group import ApprovalGroup -__all__ = ["PolicyListResponse", "ConnectionRules", "ConnectionRulesRdp", "MfaConfig"] +__all__ = ["PolicyListResponse", "ConnectionRules", "ConnectionRulesRDP", "MfaConfig"] -class ConnectionRulesRdp(BaseModel): +class ConnectionRulesRDP(BaseModel): """The RDP-specific rules that define clipboard behavior for RDP connections.""" allowed_clipboard_local_to_remote_formats: Optional[List[Literal["text"]]] = None @@ -31,7 +31,7 @@ class ConnectionRules(BaseModel): The rules that define how users may connect to targets secured by your application. """ - rdp: Optional[ConnectionRulesRdp] = None + rdp: Optional[ConnectionRulesRDP] = None """The RDP-specific rules that define clipboard behavior for RDP connections.""" 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 index 5582c6c66e2..26bb9d12cda 100755 --- 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 @@ -15,7 +15,7 @@ "Policy", "PolicyUnionMember0", "PolicyUnionMember0ConnectionRules", - "PolicyUnionMember0ConnectionRulesRdp", + "PolicyUnionMember0ConnectionRulesRDP", "PolicyUnionMember0MfaConfig", ] @@ -27,7 +27,7 @@ class PolicyTestCreateParams(TypedDict, total=False): policies: SequenceNotStr[Policy] -class PolicyUnionMember0ConnectionRulesRdp(TypedDict, total=False): +class PolicyUnionMember0ConnectionRulesRDP(TypedDict, total=False): """The RDP-specific rules that define clipboard behavior for RDP connections.""" allowed_clipboard_local_to_remote_formats: List[Literal["text"]] @@ -46,7 +46,7 @@ class PolicyUnionMember0ConnectionRules(TypedDict, total=False): The rules that define how users may connect to targets secured by your application. """ - rdp: PolicyUnionMember0ConnectionRulesRdp + rdp: PolicyUnionMember0ConnectionRulesRDP """The RDP-specific rules that define clipboard behavior for RDP connections.""" diff --git a/src/cloudflare/types/zero_trust/access/applications/policy_update_params.py b/src/cloudflare/types/zero_trust/access/applications/policy_update_params.py index 3359f30a1be..c659d26c501 100644 --- a/src/cloudflare/types/zero_trust/access/applications/policy_update_params.py +++ b/src/cloudflare/types/zero_trust/access/applications/policy_update_params.py @@ -7,7 +7,7 @@ from ..approval_group_param import ApprovalGroupParam -__all__ = ["PolicyUpdateParams", "ConnectionRules", "ConnectionRulesRdp", "MfaConfig"] +__all__ = ["PolicyUpdateParams", "ConnectionRules", "ConnectionRulesRDP", "MfaConfig"] class PolicyUpdateParams(TypedDict, total=False): @@ -65,7 +65,7 @@ class PolicyUpdateParams(TypedDict, total=False): """ -class ConnectionRulesRdp(TypedDict, total=False): +class ConnectionRulesRDP(TypedDict, total=False): """The RDP-specific rules that define clipboard behavior for RDP connections.""" allowed_clipboard_local_to_remote_formats: List[Literal["text"]] @@ -84,7 +84,7 @@ class ConnectionRules(TypedDict, total=False): The rules that define how users may connect to targets secured by your application. """ - rdp: ConnectionRulesRdp + rdp: ConnectionRulesRDP """The RDP-specific rules that define clipboard behavior for RDP connections.""" diff --git a/src/cloudflare/types/zero_trust/access/applications/policy_update_response.py b/src/cloudflare/types/zero_trust/access/applications/policy_update_response.py index be8d01e8de9..00c9ac9a19a 100644 --- a/src/cloudflare/types/zero_trust/access/applications/policy_update_response.py +++ b/src/cloudflare/types/zero_trust/access/applications/policy_update_response.py @@ -9,10 +9,10 @@ from .access_rule import AccessRule from ..approval_group import ApprovalGroup -__all__ = ["PolicyUpdateResponse", "ConnectionRules", "ConnectionRulesRdp", "MfaConfig"] +__all__ = ["PolicyUpdateResponse", "ConnectionRules", "ConnectionRulesRDP", "MfaConfig"] -class ConnectionRulesRdp(BaseModel): +class ConnectionRulesRDP(BaseModel): """The RDP-specific rules that define clipboard behavior for RDP connections.""" allowed_clipboard_local_to_remote_formats: Optional[List[Literal["text"]]] = None @@ -31,7 +31,7 @@ class ConnectionRules(BaseModel): The rules that define how users may connect to targets secured by your application. """ - rdp: Optional[ConnectionRulesRdp] = None + rdp: Optional[ConnectionRulesRDP] = None """The RDP-specific rules that define clipboard behavior for RDP connections.""" diff --git a/src/cloudflare/types/zero_trust/access/policy_create_params.py b/src/cloudflare/types/zero_trust/access/policy_create_params.py index 3825b9f7f13..a9c3015f40a 100644 --- a/src/cloudflare/types/zero_trust/access/policy_create_params.py +++ b/src/cloudflare/types/zero_trust/access/policy_create_params.py @@ -9,7 +9,7 @@ from .approval_group_param import ApprovalGroupParam from .applications.access_rule_param import AccessRuleParam -__all__ = ["PolicyCreateParams", "ConnectionRules", "ConnectionRulesRdp", "MfaConfig"] +__all__ = ["PolicyCreateParams", "ConnectionRules", "ConnectionRulesRDP", "MfaConfig"] class PolicyCreateParams(TypedDict, total=False): @@ -82,7 +82,7 @@ class PolicyCreateParams(TypedDict, total=False): """ -class ConnectionRulesRdp(TypedDict, total=False): +class ConnectionRulesRDP(TypedDict, total=False): """The RDP-specific rules that define clipboard behavior for RDP connections.""" allowed_clipboard_local_to_remote_formats: List[Literal["text"]] @@ -101,7 +101,7 @@ class ConnectionRules(TypedDict, total=False): The rules that define how users may connect to targets secured by your application. """ - rdp: ConnectionRulesRdp + rdp: ConnectionRulesRDP """The RDP-specific rules that define clipboard behavior for RDP connections.""" diff --git a/src/cloudflare/types/zero_trust/access/policy_create_response.py b/src/cloudflare/types/zero_trust/access/policy_create_response.py index e8106fbec7a..aec26906ba5 100644 --- a/src/cloudflare/types/zero_trust/access/policy_create_response.py +++ b/src/cloudflare/types/zero_trust/access/policy_create_response.py @@ -9,10 +9,10 @@ from .approval_group import ApprovalGroup from .applications.access_rule import AccessRule -__all__ = ["PolicyCreateResponse", "ConnectionRules", "ConnectionRulesRdp", "MfaConfig"] +__all__ = ["PolicyCreateResponse", "ConnectionRules", "ConnectionRulesRDP", "MfaConfig"] -class ConnectionRulesRdp(BaseModel): +class ConnectionRulesRDP(BaseModel): """The RDP-specific rules that define clipboard behavior for RDP connections.""" allowed_clipboard_local_to_remote_formats: Optional[List[Literal["text"]]] = None @@ -31,7 +31,7 @@ class ConnectionRules(BaseModel): The rules that define how users may connect to targets secured by your application. """ - rdp: Optional[ConnectionRulesRdp] = None + rdp: Optional[ConnectionRulesRDP] = None """The RDP-specific rules that define clipboard behavior for RDP connections.""" diff --git a/src/cloudflare/types/zero_trust/access/policy_get_response.py b/src/cloudflare/types/zero_trust/access/policy_get_response.py index bbfb04669b6..966a199fbe6 100644 --- a/src/cloudflare/types/zero_trust/access/policy_get_response.py +++ b/src/cloudflare/types/zero_trust/access/policy_get_response.py @@ -9,10 +9,10 @@ from .approval_group import ApprovalGroup from .applications.access_rule import AccessRule -__all__ = ["PolicyGetResponse", "ConnectionRules", "ConnectionRulesRdp", "MfaConfig"] +__all__ = ["PolicyGetResponse", "ConnectionRules", "ConnectionRulesRDP", "MfaConfig"] -class ConnectionRulesRdp(BaseModel): +class ConnectionRulesRDP(BaseModel): """The RDP-specific rules that define clipboard behavior for RDP connections.""" allowed_clipboard_local_to_remote_formats: Optional[List[Literal["text"]]] = None @@ -31,7 +31,7 @@ class ConnectionRules(BaseModel): The rules that define how users may connect to targets secured by your application. """ - rdp: Optional[ConnectionRulesRdp] = None + rdp: Optional[ConnectionRulesRDP] = None """The RDP-specific rules that define clipboard behavior for RDP connections.""" diff --git a/src/cloudflare/types/zero_trust/access/policy_list_response.py b/src/cloudflare/types/zero_trust/access/policy_list_response.py index 2aa0e8371e8..39477e671db 100644 --- a/src/cloudflare/types/zero_trust/access/policy_list_response.py +++ b/src/cloudflare/types/zero_trust/access/policy_list_response.py @@ -9,10 +9,10 @@ from .approval_group import ApprovalGroup from .applications.access_rule import AccessRule -__all__ = ["PolicyListResponse", "ConnectionRules", "ConnectionRulesRdp", "MfaConfig"] +__all__ = ["PolicyListResponse", "ConnectionRules", "ConnectionRulesRDP", "MfaConfig"] -class ConnectionRulesRdp(BaseModel): +class ConnectionRulesRDP(BaseModel): """The RDP-specific rules that define clipboard behavior for RDP connections.""" allowed_clipboard_local_to_remote_formats: Optional[List[Literal["text"]]] = None @@ -31,7 +31,7 @@ class ConnectionRules(BaseModel): The rules that define how users may connect to targets secured by your application. """ - rdp: Optional[ConnectionRulesRdp] = None + rdp: Optional[ConnectionRulesRDP] = None """The RDP-specific rules that define clipboard behavior for RDP connections.""" diff --git a/src/cloudflare/types/zero_trust/access/policy_update_params.py b/src/cloudflare/types/zero_trust/access/policy_update_params.py index 830fc9e9f98..6ac7aea58d4 100644 --- a/src/cloudflare/types/zero_trust/access/policy_update_params.py +++ b/src/cloudflare/types/zero_trust/access/policy_update_params.py @@ -9,7 +9,7 @@ from .approval_group_param import ApprovalGroupParam from .applications.access_rule_param import AccessRuleParam -__all__ = ["PolicyUpdateParams", "ConnectionRules", "ConnectionRulesRdp", "MfaConfig"] +__all__ = ["PolicyUpdateParams", "ConnectionRules", "ConnectionRulesRDP", "MfaConfig"] class PolicyUpdateParams(TypedDict, total=False): @@ -82,7 +82,7 @@ class PolicyUpdateParams(TypedDict, total=False): """ -class ConnectionRulesRdp(TypedDict, total=False): +class ConnectionRulesRDP(TypedDict, total=False): """The RDP-specific rules that define clipboard behavior for RDP connections.""" allowed_clipboard_local_to_remote_formats: List[Literal["text"]] @@ -101,7 +101,7 @@ class ConnectionRules(TypedDict, total=False): The rules that define how users may connect to targets secured by your application. """ - rdp: ConnectionRulesRdp + rdp: ConnectionRulesRDP """The RDP-specific rules that define clipboard behavior for RDP connections.""" diff --git a/src/cloudflare/types/zero_trust/access/policy_update_response.py b/src/cloudflare/types/zero_trust/access/policy_update_response.py index c0eb5d220ed..9da2c852379 100644 --- a/src/cloudflare/types/zero_trust/access/policy_update_response.py +++ b/src/cloudflare/types/zero_trust/access/policy_update_response.py @@ -9,10 +9,10 @@ from .approval_group import ApprovalGroup from .applications.access_rule import AccessRule -__all__ = ["PolicyUpdateResponse", "ConnectionRules", "ConnectionRulesRdp", "MfaConfig"] +__all__ = ["PolicyUpdateResponse", "ConnectionRules", "ConnectionRulesRDP", "MfaConfig"] -class ConnectionRulesRdp(BaseModel): +class ConnectionRulesRDP(BaseModel): """The RDP-specific rules that define clipboard behavior for RDP connections.""" allowed_clipboard_local_to_remote_formats: Optional[List[Literal["text"]]] = None @@ -31,7 +31,7 @@ class ConnectionRules(BaseModel): The rules that define how users may connect to targets secured by your application. """ - rdp: Optional[ConnectionRulesRdp] = None + rdp: Optional[ConnectionRulesRDP] = None """The RDP-specific rules that define clipboard behavior for RDP connections.""" From 631d664d36c72148726a7261839ad0f6d24b7ac4 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 26 Feb 2026 20:32:31 +0000 Subject: [PATCH 043/279] feat: test: skip prism tests for endpoints with non-JSON content types * test: skip prism tests for endpoints with non-JSON content types --- .stats.yml | 2 +- tests/api_resources/queues/test_consumers.py | 40 ++++++++++++++++++++ 2 files changed, 41 insertions(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index fc1621cc01b..48e80732193 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 2037 openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-9ba099b7936091cc984d2a24fc4d32c3ffcb1d71d86412c8c9084d201e16b3ac.yml openapi_spec_hash: 45edc9a107cf5a5e3b204b230b0d336d -config_hash: 81958bc903eb981010e617c06d49bd80 +config_hash: 5f007a422214096ce0e6b80b4b2d2539 diff --git a/tests/api_resources/queues/test_consumers.py b/tests/api_resources/queues/test_consumers.py index b7c0b9a70fa..b6ed048000d 100644 --- a/tests/api_resources/queues/test_consumers.py +++ b/tests/api_resources/queues/test_consumers.py @@ -18,6 +18,7 @@ class TestConsumers: parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) + @pytest.mark.skip(reason="422 status codes in prism tests") @parametrize def test_method_create_overload_1(self, client: Cloudflare) -> None: consumer = client.queues.consumers.create( @@ -28,6 +29,7 @@ def test_method_create_overload_1(self, client: Cloudflare) -> None: ) assert_matches_type(Optional[Consumer], consumer, path=["response"]) + @pytest.mark.skip(reason="422 status codes in prism tests") @parametrize def test_method_create_with_all_params_overload_1(self, client: Cloudflare) -> None: consumer = client.queues.consumers.create( @@ -46,6 +48,7 @@ def test_method_create_with_all_params_overload_1(self, client: Cloudflare) -> N ) assert_matches_type(Optional[Consumer], consumer, path=["response"]) + @pytest.mark.skip(reason="422 status codes in prism tests") @parametrize def test_raw_response_create_overload_1(self, client: Cloudflare) -> None: response = client.queues.consumers.with_raw_response.create( @@ -60,6 +63,7 @@ def test_raw_response_create_overload_1(self, client: Cloudflare) -> None: consumer = response.parse() assert_matches_type(Optional[Consumer], consumer, path=["response"]) + @pytest.mark.skip(reason="422 status codes in prism tests") @parametrize def test_streaming_response_create_overload_1(self, client: Cloudflare) -> None: with client.queues.consumers.with_streaming_response.create( @@ -76,6 +80,7 @@ def test_streaming_response_create_overload_1(self, client: Cloudflare) -> None: assert cast(Any, response.is_closed) is True + @pytest.mark.skip(reason="422 status codes in prism tests") @parametrize def test_path_params_create_overload_1(self, client: Cloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): @@ -94,6 +99,7 @@ def test_path_params_create_overload_1(self, client: Cloudflare) -> None: type="worker", ) + @pytest.mark.skip(reason="422 status codes in prism tests") @parametrize def test_method_create_overload_2(self, client: Cloudflare) -> None: consumer = client.queues.consumers.create( @@ -103,6 +109,7 @@ def test_method_create_overload_2(self, client: Cloudflare) -> None: ) assert_matches_type(Optional[Consumer], consumer, path=["response"]) + @pytest.mark.skip(reason="422 status codes in prism tests") @parametrize def test_method_create_with_all_params_overload_2(self, client: Cloudflare) -> None: consumer = client.queues.consumers.create( @@ -119,6 +126,7 @@ def test_method_create_with_all_params_overload_2(self, client: Cloudflare) -> N ) assert_matches_type(Optional[Consumer], consumer, path=["response"]) + @pytest.mark.skip(reason="422 status codes in prism tests") @parametrize def test_raw_response_create_overload_2(self, client: Cloudflare) -> None: response = client.queues.consumers.with_raw_response.create( @@ -132,6 +140,7 @@ def test_raw_response_create_overload_2(self, client: Cloudflare) -> None: consumer = response.parse() assert_matches_type(Optional[Consumer], consumer, path=["response"]) + @pytest.mark.skip(reason="422 status codes in prism tests") @parametrize def test_streaming_response_create_overload_2(self, client: Cloudflare) -> None: with client.queues.consumers.with_streaming_response.create( @@ -147,6 +156,7 @@ def test_streaming_response_create_overload_2(self, client: Cloudflare) -> None: assert cast(Any, response.is_closed) is True + @pytest.mark.skip(reason="422 status codes in prism tests") @parametrize def test_path_params_create_overload_2(self, client: Cloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): @@ -163,6 +173,7 @@ def test_path_params_create_overload_2(self, client: Cloudflare) -> None: type="http_pull", ) + @pytest.mark.skip(reason="422 status codes in prism tests") @parametrize def test_method_update_overload_1(self, client: Cloudflare) -> None: consumer = client.queues.consumers.update( @@ -174,6 +185,7 @@ def test_method_update_overload_1(self, client: Cloudflare) -> None: ) assert_matches_type(Optional[Consumer], consumer, path=["response"]) + @pytest.mark.skip(reason="422 status codes in prism tests") @parametrize def test_method_update_with_all_params_overload_1(self, client: Cloudflare) -> None: consumer = client.queues.consumers.update( @@ -193,6 +205,7 @@ def test_method_update_with_all_params_overload_1(self, client: Cloudflare) -> N ) assert_matches_type(Optional[Consumer], consumer, path=["response"]) + @pytest.mark.skip(reason="422 status codes in prism tests") @parametrize def test_raw_response_update_overload_1(self, client: Cloudflare) -> None: response = client.queues.consumers.with_raw_response.update( @@ -208,6 +221,7 @@ def test_raw_response_update_overload_1(self, client: Cloudflare) -> None: consumer = response.parse() assert_matches_type(Optional[Consumer], consumer, path=["response"]) + @pytest.mark.skip(reason="422 status codes in prism tests") @parametrize def test_streaming_response_update_overload_1(self, client: Cloudflare) -> None: with client.queues.consumers.with_streaming_response.update( @@ -225,6 +239,7 @@ def test_streaming_response_update_overload_1(self, client: Cloudflare) -> None: assert cast(Any, response.is_closed) is True + @pytest.mark.skip(reason="422 status codes in prism tests") @parametrize def test_path_params_update_overload_1(self, client: Cloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): @@ -254,6 +269,7 @@ def test_path_params_update_overload_1(self, client: Cloudflare) -> None: type="worker", ) + @pytest.mark.skip(reason="422 status codes in prism tests") @parametrize def test_method_update_overload_2(self, client: Cloudflare) -> None: consumer = client.queues.consumers.update( @@ -264,6 +280,7 @@ def test_method_update_overload_2(self, client: Cloudflare) -> None: ) assert_matches_type(Optional[Consumer], consumer, path=["response"]) + @pytest.mark.skip(reason="422 status codes in prism tests") @parametrize def test_method_update_with_all_params_overload_2(self, client: Cloudflare) -> None: consumer = client.queues.consumers.update( @@ -281,6 +298,7 @@ def test_method_update_with_all_params_overload_2(self, client: Cloudflare) -> N ) assert_matches_type(Optional[Consumer], consumer, path=["response"]) + @pytest.mark.skip(reason="422 status codes in prism tests") @parametrize def test_raw_response_update_overload_2(self, client: Cloudflare) -> None: response = client.queues.consumers.with_raw_response.update( @@ -295,6 +313,7 @@ def test_raw_response_update_overload_2(self, client: Cloudflare) -> None: consumer = response.parse() assert_matches_type(Optional[Consumer], consumer, path=["response"]) + @pytest.mark.skip(reason="422 status codes in prism tests") @parametrize def test_streaming_response_update_overload_2(self, client: Cloudflare) -> None: with client.queues.consumers.with_streaming_response.update( @@ -311,6 +330,7 @@ def test_streaming_response_update_overload_2(self, client: Cloudflare) -> None: assert cast(Any, response.is_closed) is True + @pytest.mark.skip(reason="422 status codes in prism tests") @parametrize def test_path_params_update_overload_2(self, client: Cloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): @@ -511,6 +531,7 @@ class TestAsyncConsumers: "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"] ) + @pytest.mark.skip(reason="422 status codes in prism tests") @parametrize async def test_method_create_overload_1(self, async_client: AsyncCloudflare) -> None: consumer = await async_client.queues.consumers.create( @@ -521,6 +542,7 @@ async def test_method_create_overload_1(self, async_client: AsyncCloudflare) -> ) assert_matches_type(Optional[Consumer], consumer, path=["response"]) + @pytest.mark.skip(reason="422 status codes in prism tests") @parametrize async def test_method_create_with_all_params_overload_1(self, async_client: AsyncCloudflare) -> None: consumer = await async_client.queues.consumers.create( @@ -539,6 +561,7 @@ async def test_method_create_with_all_params_overload_1(self, async_client: Asyn ) assert_matches_type(Optional[Consumer], consumer, path=["response"]) + @pytest.mark.skip(reason="422 status codes in prism tests") @parametrize async def test_raw_response_create_overload_1(self, async_client: AsyncCloudflare) -> None: response = await async_client.queues.consumers.with_raw_response.create( @@ -553,6 +576,7 @@ async def test_raw_response_create_overload_1(self, async_client: AsyncCloudflar consumer = await response.parse() assert_matches_type(Optional[Consumer], consumer, path=["response"]) + @pytest.mark.skip(reason="422 status codes in prism tests") @parametrize async def test_streaming_response_create_overload_1(self, async_client: AsyncCloudflare) -> None: async with async_client.queues.consumers.with_streaming_response.create( @@ -569,6 +593,7 @@ async def test_streaming_response_create_overload_1(self, async_client: AsyncClo assert cast(Any, response.is_closed) is True + @pytest.mark.skip(reason="422 status codes in prism tests") @parametrize async def test_path_params_create_overload_1(self, async_client: AsyncCloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): @@ -587,6 +612,7 @@ async def test_path_params_create_overload_1(self, async_client: AsyncCloudflare type="worker", ) + @pytest.mark.skip(reason="422 status codes in prism tests") @parametrize async def test_method_create_overload_2(self, async_client: AsyncCloudflare) -> None: consumer = await async_client.queues.consumers.create( @@ -596,6 +622,7 @@ async def test_method_create_overload_2(self, async_client: AsyncCloudflare) -> ) assert_matches_type(Optional[Consumer], consumer, path=["response"]) + @pytest.mark.skip(reason="422 status codes in prism tests") @parametrize async def test_method_create_with_all_params_overload_2(self, async_client: AsyncCloudflare) -> None: consumer = await async_client.queues.consumers.create( @@ -612,6 +639,7 @@ async def test_method_create_with_all_params_overload_2(self, async_client: Asyn ) assert_matches_type(Optional[Consumer], consumer, path=["response"]) + @pytest.mark.skip(reason="422 status codes in prism tests") @parametrize async def test_raw_response_create_overload_2(self, async_client: AsyncCloudflare) -> None: response = await async_client.queues.consumers.with_raw_response.create( @@ -625,6 +653,7 @@ async def test_raw_response_create_overload_2(self, async_client: AsyncCloudflar consumer = await response.parse() assert_matches_type(Optional[Consumer], consumer, path=["response"]) + @pytest.mark.skip(reason="422 status codes in prism tests") @parametrize async def test_streaming_response_create_overload_2(self, async_client: AsyncCloudflare) -> None: async with async_client.queues.consumers.with_streaming_response.create( @@ -640,6 +669,7 @@ async def test_streaming_response_create_overload_2(self, async_client: AsyncClo assert cast(Any, response.is_closed) is True + @pytest.mark.skip(reason="422 status codes in prism tests") @parametrize async def test_path_params_create_overload_2(self, async_client: AsyncCloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): @@ -656,6 +686,7 @@ async def test_path_params_create_overload_2(self, async_client: AsyncCloudflare type="http_pull", ) + @pytest.mark.skip(reason="422 status codes in prism tests") @parametrize async def test_method_update_overload_1(self, async_client: AsyncCloudflare) -> None: consumer = await async_client.queues.consumers.update( @@ -667,6 +698,7 @@ async def test_method_update_overload_1(self, async_client: AsyncCloudflare) -> ) assert_matches_type(Optional[Consumer], consumer, path=["response"]) + @pytest.mark.skip(reason="422 status codes in prism tests") @parametrize async def test_method_update_with_all_params_overload_1(self, async_client: AsyncCloudflare) -> None: consumer = await async_client.queues.consumers.update( @@ -686,6 +718,7 @@ async def test_method_update_with_all_params_overload_1(self, async_client: Asyn ) assert_matches_type(Optional[Consumer], consumer, path=["response"]) + @pytest.mark.skip(reason="422 status codes in prism tests") @parametrize async def test_raw_response_update_overload_1(self, async_client: AsyncCloudflare) -> None: response = await async_client.queues.consumers.with_raw_response.update( @@ -701,6 +734,7 @@ async def test_raw_response_update_overload_1(self, async_client: AsyncCloudflar consumer = await response.parse() assert_matches_type(Optional[Consumer], consumer, path=["response"]) + @pytest.mark.skip(reason="422 status codes in prism tests") @parametrize async def test_streaming_response_update_overload_1(self, async_client: AsyncCloudflare) -> None: async with async_client.queues.consumers.with_streaming_response.update( @@ -718,6 +752,7 @@ async def test_streaming_response_update_overload_1(self, async_client: AsyncClo assert cast(Any, response.is_closed) is True + @pytest.mark.skip(reason="422 status codes in prism tests") @parametrize async def test_path_params_update_overload_1(self, async_client: AsyncCloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): @@ -747,6 +782,7 @@ async def test_path_params_update_overload_1(self, async_client: AsyncCloudflare type="worker", ) + @pytest.mark.skip(reason="422 status codes in prism tests") @parametrize async def test_method_update_overload_2(self, async_client: AsyncCloudflare) -> None: consumer = await async_client.queues.consumers.update( @@ -757,6 +793,7 @@ async def test_method_update_overload_2(self, async_client: AsyncCloudflare) -> ) assert_matches_type(Optional[Consumer], consumer, path=["response"]) + @pytest.mark.skip(reason="422 status codes in prism tests") @parametrize async def test_method_update_with_all_params_overload_2(self, async_client: AsyncCloudflare) -> None: consumer = await async_client.queues.consumers.update( @@ -774,6 +811,7 @@ async def test_method_update_with_all_params_overload_2(self, async_client: Asyn ) assert_matches_type(Optional[Consumer], consumer, path=["response"]) + @pytest.mark.skip(reason="422 status codes in prism tests") @parametrize async def test_raw_response_update_overload_2(self, async_client: AsyncCloudflare) -> None: response = await async_client.queues.consumers.with_raw_response.update( @@ -788,6 +826,7 @@ async def test_raw_response_update_overload_2(self, async_client: AsyncCloudflar consumer = await response.parse() assert_matches_type(Optional[Consumer], consumer, path=["response"]) + @pytest.mark.skip(reason="422 status codes in prism tests") @parametrize async def test_streaming_response_update_overload_2(self, async_client: AsyncCloudflare) -> None: async with async_client.queues.consumers.with_streaming_response.update( @@ -804,6 +843,7 @@ async def test_streaming_response_update_overload_2(self, async_client: AsyncClo assert cast(Any, response.is_closed) is True + @pytest.mark.skip(reason="422 status codes in prism tests") @parametrize async def test_path_params_update_overload_2(self, async_client: AsyncCloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): From 23094425d29e7fffdd5bf82d326aa7ec7e929f6f Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 26 Feb 2026 20:39:16 +0000 Subject: [PATCH 044/279] feat: feat(custom_origin_trust_store): enable custom_origin_trust_store * feat(custom_origin_trust_store): enable custom_origin_trust_store --- .stats.yml | 4 +- api.md | 15 + src/cloudflare/resources/acm/__init__.py | 14 + src/cloudflare/resources/acm/acm.py | 32 ++ .../resources/acm/custom_trust_store.py | 540 ++++++++++++++++++ src/cloudflare/types/acm/__init__.py | 4 + .../types/acm/custom_trust_store.py | 34 ++ .../acm/custom_trust_store_create_params.py | 15 + .../acm/custom_trust_store_delete_response.py | 12 + .../acm/custom_trust_store_list_params.py | 24 + .../acm/test_custom_trust_store.py | 410 +++++++++++++ 11 files changed, 1102 insertions(+), 2 deletions(-) create mode 100644 src/cloudflare/resources/acm/custom_trust_store.py create mode 100644 src/cloudflare/types/acm/custom_trust_store.py create mode 100644 src/cloudflare/types/acm/custom_trust_store_create_params.py create mode 100644 src/cloudflare/types/acm/custom_trust_store_delete_response.py create mode 100644 src/cloudflare/types/acm/custom_trust_store_list_params.py create mode 100644 tests/api_resources/acm/test_custom_trust_store.py diff --git a/.stats.yml b/.stats.yml index 48e80732193..d9cbe86d437 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ -configured_endpoints: 2037 +configured_endpoints: 2041 openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-9ba099b7936091cc984d2a24fc4d32c3ffcb1d71d86412c8c9084d201e16b3ac.yml openapi_spec_hash: 45edc9a107cf5a5e3b204b230b0d336d -config_hash: 5f007a422214096ce0e6b80b4b2d2539 +config_hash: 7b60c75a2413402168b11558e43ba3f3 diff --git a/api.md b/api.md index 7bb3f9cf49d..3f5cd6f421a 100644 --- a/api.md +++ b/api.md @@ -869,6 +869,21 @@ Methods: - client.acm.total_tls.edit(\*, zone_id, \*\*params) -> Optional[TotalTLSEditResponse] - client.acm.total_tls.get(\*, zone_id) -> Optional[TotalTLSGetResponse] +## CustomTrustStore + +Types: + +```python +from cloudflare.types.acm import CustomTrustStore, CustomTrustStoreDeleteResponse +``` + +Methods: + +- client.acm.custom_trust_store.create(\*, zone_id, \*\*params) -> Optional[CustomTrustStore] +- client.acm.custom_trust_store.list(\*, zone_id, \*\*params) -> SyncV4PagePaginationArray[CustomTrustStore] +- client.acm.custom_trust_store.delete(custom_origin_trust_store_id, \*, zone_id) -> Optional[CustomTrustStoreDeleteResponse] +- client.acm.custom_trust_store.get(custom_origin_trust_store_id, \*, zone_id) -> Optional[CustomTrustStore] + # Argo ## SmartRouting diff --git a/src/cloudflare/resources/acm/__init__.py b/src/cloudflare/resources/acm/__init__.py index ed969a286c5..c4b907c8226 100644 --- a/src/cloudflare/resources/acm/__init__.py +++ b/src/cloudflare/resources/acm/__init__.py @@ -16,6 +16,14 @@ TotalTLSResourceWithStreamingResponse, AsyncTotalTLSResourceWithStreamingResponse, ) +from .custom_trust_store import ( + CustomTrustStoreResource, + AsyncCustomTrustStoreResource, + CustomTrustStoreResourceWithRawResponse, + AsyncCustomTrustStoreResourceWithRawResponse, + CustomTrustStoreResourceWithStreamingResponse, + AsyncCustomTrustStoreResourceWithStreamingResponse, +) __all__ = [ "TotalTLSResource", @@ -24,6 +32,12 @@ "AsyncTotalTLSResourceWithRawResponse", "TotalTLSResourceWithStreamingResponse", "AsyncTotalTLSResourceWithStreamingResponse", + "CustomTrustStoreResource", + "AsyncCustomTrustStoreResource", + "CustomTrustStoreResourceWithRawResponse", + "AsyncCustomTrustStoreResourceWithRawResponse", + "CustomTrustStoreResourceWithStreamingResponse", + "AsyncCustomTrustStoreResourceWithStreamingResponse", "ACMResource", "AsyncACMResource", "ACMResourceWithRawResponse", diff --git a/src/cloudflare/resources/acm/acm.py b/src/cloudflare/resources/acm/acm.py index 4d576c8fa13..ec37c76a47b 100644 --- a/src/cloudflare/resources/acm/acm.py +++ b/src/cloudflare/resources/acm/acm.py @@ -12,6 +12,14 @@ AsyncTotalTLSResourceWithStreamingResponse, ) from ..._resource import SyncAPIResource, AsyncAPIResource +from .custom_trust_store import ( + CustomTrustStoreResource, + AsyncCustomTrustStoreResource, + CustomTrustStoreResourceWithRawResponse, + AsyncCustomTrustStoreResourceWithRawResponse, + CustomTrustStoreResourceWithStreamingResponse, + AsyncCustomTrustStoreResourceWithStreamingResponse, +) __all__ = ["ACMResource", "AsyncACMResource"] @@ -21,6 +29,10 @@ class ACMResource(SyncAPIResource): def total_tls(self) -> TotalTLSResource: return TotalTLSResource(self._client) + @cached_property + def custom_trust_store(self) -> CustomTrustStoreResource: + return CustomTrustStoreResource(self._client) + @cached_property def with_raw_response(self) -> ACMResourceWithRawResponse: """ @@ -46,6 +58,10 @@ class AsyncACMResource(AsyncAPIResource): def total_tls(self) -> AsyncTotalTLSResource: return AsyncTotalTLSResource(self._client) + @cached_property + def custom_trust_store(self) -> AsyncCustomTrustStoreResource: + return AsyncCustomTrustStoreResource(self._client) + @cached_property def with_raw_response(self) -> AsyncACMResourceWithRawResponse: """ @@ -74,6 +90,10 @@ def __init__(self, acm: ACMResource) -> None: def total_tls(self) -> TotalTLSResourceWithRawResponse: return TotalTLSResourceWithRawResponse(self._acm.total_tls) + @cached_property + def custom_trust_store(self) -> CustomTrustStoreResourceWithRawResponse: + return CustomTrustStoreResourceWithRawResponse(self._acm.custom_trust_store) + class AsyncACMResourceWithRawResponse: def __init__(self, acm: AsyncACMResource) -> None: @@ -83,6 +103,10 @@ def __init__(self, acm: AsyncACMResource) -> None: def total_tls(self) -> AsyncTotalTLSResourceWithRawResponse: return AsyncTotalTLSResourceWithRawResponse(self._acm.total_tls) + @cached_property + def custom_trust_store(self) -> AsyncCustomTrustStoreResourceWithRawResponse: + return AsyncCustomTrustStoreResourceWithRawResponse(self._acm.custom_trust_store) + class ACMResourceWithStreamingResponse: def __init__(self, acm: ACMResource) -> None: @@ -92,6 +116,10 @@ def __init__(self, acm: ACMResource) -> None: def total_tls(self) -> TotalTLSResourceWithStreamingResponse: return TotalTLSResourceWithStreamingResponse(self._acm.total_tls) + @cached_property + def custom_trust_store(self) -> CustomTrustStoreResourceWithStreamingResponse: + return CustomTrustStoreResourceWithStreamingResponse(self._acm.custom_trust_store) + class AsyncACMResourceWithStreamingResponse: def __init__(self, acm: AsyncACMResource) -> None: @@ -100,3 +128,7 @@ def __init__(self, acm: AsyncACMResource) -> None: @cached_property def total_tls(self) -> AsyncTotalTLSResourceWithStreamingResponse: return AsyncTotalTLSResourceWithStreamingResponse(self._acm.total_tls) + + @cached_property + def custom_trust_store(self) -> AsyncCustomTrustStoreResourceWithStreamingResponse: + return AsyncCustomTrustStoreResourceWithStreamingResponse(self._acm.custom_trust_store) diff --git a/src/cloudflare/resources/acm/custom_trust_store.py b/src/cloudflare/resources/acm/custom_trust_store.py new file mode 100644 index 00000000000..d7b87885150 --- /dev/null +++ b/src/cloudflare/resources/acm/custom_trust_store.py @@ -0,0 +1,540 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Type, Optional, cast + +import httpx + +from ..._types import Body, Omit, Query, Headers, NotGiven, omit, not_given +from ..._utils import maybe_transform, async_maybe_transform +from ..._compat import cached_property +from ..._resource import SyncAPIResource, AsyncAPIResource +from ..._response import ( + to_raw_response_wrapper, + to_streamed_response_wrapper, + async_to_raw_response_wrapper, + async_to_streamed_response_wrapper, +) +from ..._wrappers import ResultWrapper +from ...types.acm import custom_trust_store_list_params, custom_trust_store_create_params +from ...pagination import SyncV4PagePaginationArray, AsyncV4PagePaginationArray +from ..._base_client import AsyncPaginator, make_request_options +from ...types.acm.custom_trust_store import CustomTrustStore +from ...types.acm.custom_trust_store_delete_response import CustomTrustStoreDeleteResponse + +__all__ = ["CustomTrustStoreResource", "AsyncCustomTrustStoreResource"] + + +class CustomTrustStoreResource(SyncAPIResource): + @cached_property + def with_raw_response(self) -> CustomTrustStoreResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers + """ + return CustomTrustStoreResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> CustomTrustStoreResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/cloudflare/cloudflare-python#with_streaming_response + """ + return CustomTrustStoreResourceWithStreamingResponse(self) + + def create( + self, + *, + zone_id: str, + certificate: 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[CustomTrustStore]: + """ + Add Custom Origin Trust Store for a Zone. + + Args: + zone_id: Identifier. + + certificate: The zone's SSL certificate or certificate and the intermediate(s). + + 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 zone_id: + raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") + return self._post( + f"/zones/{zone_id}/acm/custom_trust_store", + body=maybe_transform( + {"certificate": certificate}, custom_trust_store_create_params.CustomTrustStoreCreateParams + ), + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + post_parser=ResultWrapper[Optional[CustomTrustStore]]._unwrapper, + ), + cast_to=cast(Type[Optional[CustomTrustStore]], ResultWrapper[CustomTrustStore]), + ) + + def list( + self, + *, + zone_id: str, + limit: int | Omit = omit, + offset: int | Omit = omit, + page: float | Omit = omit, + per_page: float | 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, + ) -> SyncV4PagePaginationArray[CustomTrustStore]: + """ + Get Custom Origin Trust Store for a Zone. + + Args: + zone_id: Identifier. + + limit: Limit to the number of records returned. + + offset: Offset the results + + page: Page number of paginated results. + + per_page: Number of records per page. + + 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 zone_id: + raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") + return self._get_api_list( + f"/zones/{zone_id}/acm/custom_trust_store", + page=SyncV4PagePaginationArray[CustomTrustStore], + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=maybe_transform( + { + "limit": limit, + "offset": offset, + "page": page, + "per_page": per_page, + }, + custom_trust_store_list_params.CustomTrustStoreListParams, + ), + ), + model=CustomTrustStore, + ) + + def delete( + self, + custom_origin_trust_store_id: str, + *, + zone_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[CustomTrustStoreDeleteResponse]: + """Removes a CA certificate from the custom origin trust store. + + Origins using + certificates signed by this CA will no longer be trusted. + + Args: + zone_id: Identifier. + + custom_origin_trust_store_id: 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 zone_id: + raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") + if not custom_origin_trust_store_id: + raise ValueError( + f"Expected a non-empty value for `custom_origin_trust_store_id` but received {custom_origin_trust_store_id!r}" + ) + return self._delete( + f"/zones/{zone_id}/acm/custom_trust_store/{custom_origin_trust_store_id}", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + post_parser=ResultWrapper[Optional[CustomTrustStoreDeleteResponse]]._unwrapper, + ), + cast_to=cast(Type[Optional[CustomTrustStoreDeleteResponse]], ResultWrapper[CustomTrustStoreDeleteResponse]), + ) + + def get( + self, + custom_origin_trust_store_id: str, + *, + zone_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[CustomTrustStore]: + """ + Retrieves details about a specific certificate in the custom origin trust store, + including expiration and subject information. + + Args: + zone_id: Identifier. + + custom_origin_trust_store_id: 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 zone_id: + raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") + if not custom_origin_trust_store_id: + raise ValueError( + f"Expected a non-empty value for `custom_origin_trust_store_id` but received {custom_origin_trust_store_id!r}" + ) + return self._get( + f"/zones/{zone_id}/acm/custom_trust_store/{custom_origin_trust_store_id}", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + post_parser=ResultWrapper[Optional[CustomTrustStore]]._unwrapper, + ), + cast_to=cast(Type[Optional[CustomTrustStore]], ResultWrapper[CustomTrustStore]), + ) + + +class AsyncCustomTrustStoreResource(AsyncAPIResource): + @cached_property + def with_raw_response(self) -> AsyncCustomTrustStoreResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers + """ + return AsyncCustomTrustStoreResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> AsyncCustomTrustStoreResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/cloudflare/cloudflare-python#with_streaming_response + """ + return AsyncCustomTrustStoreResourceWithStreamingResponse(self) + + async def create( + self, + *, + zone_id: str, + certificate: 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[CustomTrustStore]: + """ + Add Custom Origin Trust Store for a Zone. + + Args: + zone_id: Identifier. + + certificate: The zone's SSL certificate or certificate and the intermediate(s). + + 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 zone_id: + raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") + return await self._post( + f"/zones/{zone_id}/acm/custom_trust_store", + body=await async_maybe_transform( + {"certificate": certificate}, custom_trust_store_create_params.CustomTrustStoreCreateParams + ), + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + post_parser=ResultWrapper[Optional[CustomTrustStore]]._unwrapper, + ), + cast_to=cast(Type[Optional[CustomTrustStore]], ResultWrapper[CustomTrustStore]), + ) + + def list( + self, + *, + zone_id: str, + limit: int | Omit = omit, + offset: int | Omit = omit, + page: float | Omit = omit, + per_page: float | 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, + ) -> AsyncPaginator[CustomTrustStore, AsyncV4PagePaginationArray[CustomTrustStore]]: + """ + Get Custom Origin Trust Store for a Zone. + + Args: + zone_id: Identifier. + + limit: Limit to the number of records returned. + + offset: Offset the results + + page: Page number of paginated results. + + per_page: Number of records per page. + + 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 zone_id: + raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") + return self._get_api_list( + f"/zones/{zone_id}/acm/custom_trust_store", + page=AsyncV4PagePaginationArray[CustomTrustStore], + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=maybe_transform( + { + "limit": limit, + "offset": offset, + "page": page, + "per_page": per_page, + }, + custom_trust_store_list_params.CustomTrustStoreListParams, + ), + ), + model=CustomTrustStore, + ) + + async def delete( + self, + custom_origin_trust_store_id: str, + *, + zone_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[CustomTrustStoreDeleteResponse]: + """Removes a CA certificate from the custom origin trust store. + + Origins using + certificates signed by this CA will no longer be trusted. + + Args: + zone_id: Identifier. + + custom_origin_trust_store_id: 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 zone_id: + raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") + if not custom_origin_trust_store_id: + raise ValueError( + f"Expected a non-empty value for `custom_origin_trust_store_id` but received {custom_origin_trust_store_id!r}" + ) + return await self._delete( + f"/zones/{zone_id}/acm/custom_trust_store/{custom_origin_trust_store_id}", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + post_parser=ResultWrapper[Optional[CustomTrustStoreDeleteResponse]]._unwrapper, + ), + cast_to=cast(Type[Optional[CustomTrustStoreDeleteResponse]], ResultWrapper[CustomTrustStoreDeleteResponse]), + ) + + async def get( + self, + custom_origin_trust_store_id: str, + *, + zone_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[CustomTrustStore]: + """ + Retrieves details about a specific certificate in the custom origin trust store, + including expiration and subject information. + + Args: + zone_id: Identifier. + + custom_origin_trust_store_id: 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 zone_id: + raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") + if not custom_origin_trust_store_id: + raise ValueError( + f"Expected a non-empty value for `custom_origin_trust_store_id` but received {custom_origin_trust_store_id!r}" + ) + return await self._get( + f"/zones/{zone_id}/acm/custom_trust_store/{custom_origin_trust_store_id}", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + post_parser=ResultWrapper[Optional[CustomTrustStore]]._unwrapper, + ), + cast_to=cast(Type[Optional[CustomTrustStore]], ResultWrapper[CustomTrustStore]), + ) + + +class CustomTrustStoreResourceWithRawResponse: + def __init__(self, custom_trust_store: CustomTrustStoreResource) -> None: + self._custom_trust_store = custom_trust_store + + self.create = to_raw_response_wrapper( + custom_trust_store.create, + ) + self.list = to_raw_response_wrapper( + custom_trust_store.list, + ) + self.delete = to_raw_response_wrapper( + custom_trust_store.delete, + ) + self.get = to_raw_response_wrapper( + custom_trust_store.get, + ) + + +class AsyncCustomTrustStoreResourceWithRawResponse: + def __init__(self, custom_trust_store: AsyncCustomTrustStoreResource) -> None: + self._custom_trust_store = custom_trust_store + + self.create = async_to_raw_response_wrapper( + custom_trust_store.create, + ) + self.list = async_to_raw_response_wrapper( + custom_trust_store.list, + ) + self.delete = async_to_raw_response_wrapper( + custom_trust_store.delete, + ) + self.get = async_to_raw_response_wrapper( + custom_trust_store.get, + ) + + +class CustomTrustStoreResourceWithStreamingResponse: + def __init__(self, custom_trust_store: CustomTrustStoreResource) -> None: + self._custom_trust_store = custom_trust_store + + self.create = to_streamed_response_wrapper( + custom_trust_store.create, + ) + self.list = to_streamed_response_wrapper( + custom_trust_store.list, + ) + self.delete = to_streamed_response_wrapper( + custom_trust_store.delete, + ) + self.get = to_streamed_response_wrapper( + custom_trust_store.get, + ) + + +class AsyncCustomTrustStoreResourceWithStreamingResponse: + def __init__(self, custom_trust_store: AsyncCustomTrustStoreResource) -> None: + self._custom_trust_store = custom_trust_store + + self.create = async_to_streamed_response_wrapper( + custom_trust_store.create, + ) + self.list = async_to_streamed_response_wrapper( + custom_trust_store.list, + ) + self.delete = async_to_streamed_response_wrapper( + custom_trust_store.delete, + ) + self.get = async_to_streamed_response_wrapper( + custom_trust_store.get, + ) diff --git a/src/cloudflare/types/acm/__init__.py b/src/cloudflare/types/acm/__init__.py index 9a1d8d08f7f..cb5eb45f418 100644 --- a/src/cloudflare/types/acm/__init__.py +++ b/src/cloudflare/types/acm/__init__.py @@ -2,9 +2,13 @@ from __future__ import annotations +from .custom_trust_store import CustomTrustStore as CustomTrustStore from .certificate_authority import CertificateAuthority as CertificateAuthority from .total_tls_edit_params import TotalTLSEditParams as TotalTLSEditParams from .total_tls_get_response import TotalTLSGetResponse as TotalTLSGetResponse from .total_tls_edit_response import TotalTLSEditResponse as TotalTLSEditResponse from .total_tls_update_params import TotalTLSUpdateParams as TotalTLSUpdateParams from .total_tls_update_response import TotalTLSUpdateResponse as TotalTLSUpdateResponse +from .custom_trust_store_list_params import CustomTrustStoreListParams as CustomTrustStoreListParams +from .custom_trust_store_create_params import CustomTrustStoreCreateParams as CustomTrustStoreCreateParams +from .custom_trust_store_delete_response import CustomTrustStoreDeleteResponse as CustomTrustStoreDeleteResponse diff --git a/src/cloudflare/types/acm/custom_trust_store.py b/src/cloudflare/types/acm/custom_trust_store.py new file mode 100644 index 00000000000..24871405329 --- /dev/null +++ b/src/cloudflare/types/acm/custom_trust_store.py @@ -0,0 +1,34 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from datetime import datetime +from typing_extensions import Literal + +from ..._models import BaseModel + +__all__ = ["CustomTrustStore"] + + +class CustomTrustStore(BaseModel): + id: str + """Identifier.""" + + certificate: str + """The zone's SSL certificate or certificate and the intermediate(s).""" + + expires_on: datetime + """When the certificate expires.""" + + issuer: str + """The certificate authority that issued the certificate.""" + + signature: str + """The type of hash used for the certificate.""" + + status: Literal["initializing", "pending_deployment", "active", "pending_deletion", "deleted", "expired"] + """Status of the zone's custom SSL.""" + + updated_at: datetime + """When the certificate was last modified.""" + + uploaded_on: datetime + """When the certificate was uploaded to Cloudflare.""" diff --git a/src/cloudflare/types/acm/custom_trust_store_create_params.py b/src/cloudflare/types/acm/custom_trust_store_create_params.py new file mode 100644 index 00000000000..38498ed17fa --- /dev/null +++ b/src/cloudflare/types/acm/custom_trust_store_create_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 Required, TypedDict + +__all__ = ["CustomTrustStoreCreateParams"] + + +class CustomTrustStoreCreateParams(TypedDict, total=False): + zone_id: Required[str] + """Identifier.""" + + certificate: Required[str] + """The zone's SSL certificate or certificate and the intermediate(s).""" diff --git a/src/cloudflare/types/acm/custom_trust_store_delete_response.py b/src/cloudflare/types/acm/custom_trust_store_delete_response.py new file mode 100644 index 00000000000..804ac6f88ba --- /dev/null +++ b/src/cloudflare/types/acm/custom_trust_store_delete_response.py @@ -0,0 +1,12 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional + +from ..._models import BaseModel + +__all__ = ["CustomTrustStoreDeleteResponse"] + + +class CustomTrustStoreDeleteResponse(BaseModel): + id: Optional[str] = None + """Identifier.""" diff --git a/src/cloudflare/types/acm/custom_trust_store_list_params.py b/src/cloudflare/types/acm/custom_trust_store_list_params.py new file mode 100644 index 00000000000..065c67d4223 --- /dev/null +++ b/src/cloudflare/types/acm/custom_trust_store_list_params.py @@ -0,0 +1,24 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +__all__ = ["CustomTrustStoreListParams"] + + +class CustomTrustStoreListParams(TypedDict, total=False): + zone_id: Required[str] + """Identifier.""" + + limit: int + """Limit to the number of records returned.""" + + offset: int + """Offset the results""" + + page: float + """Page number of paginated results.""" + + per_page: float + """Number of records per page.""" diff --git a/tests/api_resources/acm/test_custom_trust_store.py b/tests/api_resources/acm/test_custom_trust_store.py new file mode 100644 index 00000000000..bfa9608db77 --- /dev/null +++ b/tests/api_resources/acm/test_custom_trust_store.py @@ -0,0 +1,410 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +import os +from typing import Any, Optional, cast + +import pytest + +from cloudflare import Cloudflare, AsyncCloudflare +from tests.utils import assert_matches_type +from cloudflare.types.acm import ( + CustomTrustStore, + CustomTrustStoreDeleteResponse, +) +from cloudflare.pagination import SyncV4PagePaginationArray, AsyncV4PagePaginationArray + +base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") + + +class TestCustomTrustStore: + parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) + + @parametrize + def test_method_create(self, client: Cloudflare) -> None: + custom_trust_store = client.acm.custom_trust_store.create( + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + certificate="-----BEGIN CERTIFICATE-----\nMIIDdjCCAl6gAwIBAgIJAPnMg0Fs+/B0MA0GCSqGSIb3DQEBCwUAMFsx...\n-----END CERTIFICATE-----\n", + ) + assert_matches_type(Optional[CustomTrustStore], custom_trust_store, path=["response"]) + + @parametrize + def test_raw_response_create(self, client: Cloudflare) -> None: + response = client.acm.custom_trust_store.with_raw_response.create( + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + certificate="-----BEGIN CERTIFICATE-----\nMIIDdjCCAl6gAwIBAgIJAPnMg0Fs+/B0MA0GCSqGSIb3DQEBCwUAMFsx...\n-----END CERTIFICATE-----\n", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + custom_trust_store = response.parse() + assert_matches_type(Optional[CustomTrustStore], custom_trust_store, path=["response"]) + + @parametrize + def test_streaming_response_create(self, client: Cloudflare) -> None: + with client.acm.custom_trust_store.with_streaming_response.create( + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + certificate="-----BEGIN CERTIFICATE-----\nMIIDdjCCAl6gAwIBAgIJAPnMg0Fs+/B0MA0GCSqGSIb3DQEBCwUAMFsx...\n-----END CERTIFICATE-----\n", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + custom_trust_store = response.parse() + assert_matches_type(Optional[CustomTrustStore], custom_trust_store, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_create(self, client: Cloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + client.acm.custom_trust_store.with_raw_response.create( + zone_id="", + certificate="-----BEGIN CERTIFICATE-----\nMIIDdjCCAl6gAwIBAgIJAPnMg0Fs+/B0MA0GCSqGSIb3DQEBCwUAMFsx...\n-----END CERTIFICATE-----\n", + ) + + @parametrize + def test_method_list(self, client: Cloudflare) -> None: + custom_trust_store = client.acm.custom_trust_store.list( + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + ) + assert_matches_type(SyncV4PagePaginationArray[CustomTrustStore], custom_trust_store, path=["response"]) + + @parametrize + def test_method_list_with_all_params(self, client: Cloudflare) -> None: + custom_trust_store = client.acm.custom_trust_store.list( + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + limit=10, + offset=10, + page=1, + per_page=5, + ) + assert_matches_type(SyncV4PagePaginationArray[CustomTrustStore], custom_trust_store, path=["response"]) + + @parametrize + def test_raw_response_list(self, client: Cloudflare) -> None: + response = client.acm.custom_trust_store.with_raw_response.list( + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + custom_trust_store = response.parse() + assert_matches_type(SyncV4PagePaginationArray[CustomTrustStore], custom_trust_store, path=["response"]) + + @parametrize + def test_streaming_response_list(self, client: Cloudflare) -> None: + with client.acm.custom_trust_store.with_streaming_response.list( + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + custom_trust_store = response.parse() + assert_matches_type(SyncV4PagePaginationArray[CustomTrustStore], custom_trust_store, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_list(self, client: Cloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + client.acm.custom_trust_store.with_raw_response.list( + zone_id="", + ) + + @parametrize + def test_method_delete(self, client: Cloudflare) -> None: + custom_trust_store = client.acm.custom_trust_store.delete( + custom_origin_trust_store_id="023e105f4ecef8ad9ca31a8372d0c353", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + ) + assert_matches_type(Optional[CustomTrustStoreDeleteResponse], custom_trust_store, path=["response"]) + + @parametrize + def test_raw_response_delete(self, client: Cloudflare) -> None: + response = client.acm.custom_trust_store.with_raw_response.delete( + custom_origin_trust_store_id="023e105f4ecef8ad9ca31a8372d0c353", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + custom_trust_store = response.parse() + assert_matches_type(Optional[CustomTrustStoreDeleteResponse], custom_trust_store, path=["response"]) + + @parametrize + def test_streaming_response_delete(self, client: Cloudflare) -> None: + with client.acm.custom_trust_store.with_streaming_response.delete( + custom_origin_trust_store_id="023e105f4ecef8ad9ca31a8372d0c353", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + custom_trust_store = response.parse() + assert_matches_type(Optional[CustomTrustStoreDeleteResponse], custom_trust_store, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_delete(self, client: Cloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + client.acm.custom_trust_store.with_raw_response.delete( + custom_origin_trust_store_id="023e105f4ecef8ad9ca31a8372d0c353", + zone_id="", + ) + + with pytest.raises( + ValueError, match=r"Expected a non-empty value for `custom_origin_trust_store_id` but received ''" + ): + client.acm.custom_trust_store.with_raw_response.delete( + custom_origin_trust_store_id="", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + ) + + @parametrize + def test_method_get(self, client: Cloudflare) -> None: + custom_trust_store = client.acm.custom_trust_store.get( + custom_origin_trust_store_id="023e105f4ecef8ad9ca31a8372d0c353", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + ) + assert_matches_type(Optional[CustomTrustStore], custom_trust_store, path=["response"]) + + @parametrize + def test_raw_response_get(self, client: Cloudflare) -> None: + response = client.acm.custom_trust_store.with_raw_response.get( + custom_origin_trust_store_id="023e105f4ecef8ad9ca31a8372d0c353", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + custom_trust_store = response.parse() + assert_matches_type(Optional[CustomTrustStore], custom_trust_store, path=["response"]) + + @parametrize + def test_streaming_response_get(self, client: Cloudflare) -> None: + with client.acm.custom_trust_store.with_streaming_response.get( + custom_origin_trust_store_id="023e105f4ecef8ad9ca31a8372d0c353", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + custom_trust_store = response.parse() + assert_matches_type(Optional[CustomTrustStore], custom_trust_store, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_get(self, client: Cloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + client.acm.custom_trust_store.with_raw_response.get( + custom_origin_trust_store_id="023e105f4ecef8ad9ca31a8372d0c353", + zone_id="", + ) + + with pytest.raises( + ValueError, match=r"Expected a non-empty value for `custom_origin_trust_store_id` but received ''" + ): + client.acm.custom_trust_store.with_raw_response.get( + custom_origin_trust_store_id="", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + ) + + +class TestAsyncCustomTrustStore: + parametrize = pytest.mark.parametrize( + "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"] + ) + + @parametrize + async def test_method_create(self, async_client: AsyncCloudflare) -> None: + custom_trust_store = await async_client.acm.custom_trust_store.create( + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + certificate="-----BEGIN CERTIFICATE-----\nMIIDdjCCAl6gAwIBAgIJAPnMg0Fs+/B0MA0GCSqGSIb3DQEBCwUAMFsx...\n-----END CERTIFICATE-----\n", + ) + assert_matches_type(Optional[CustomTrustStore], custom_trust_store, path=["response"]) + + @parametrize + async def test_raw_response_create(self, async_client: AsyncCloudflare) -> None: + response = await async_client.acm.custom_trust_store.with_raw_response.create( + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + certificate="-----BEGIN CERTIFICATE-----\nMIIDdjCCAl6gAwIBAgIJAPnMg0Fs+/B0MA0GCSqGSIb3DQEBCwUAMFsx...\n-----END CERTIFICATE-----\n", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + custom_trust_store = await response.parse() + assert_matches_type(Optional[CustomTrustStore], custom_trust_store, path=["response"]) + + @parametrize + async def test_streaming_response_create(self, async_client: AsyncCloudflare) -> None: + async with async_client.acm.custom_trust_store.with_streaming_response.create( + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + certificate="-----BEGIN CERTIFICATE-----\nMIIDdjCCAl6gAwIBAgIJAPnMg0Fs+/B0MA0GCSqGSIb3DQEBCwUAMFsx...\n-----END CERTIFICATE-----\n", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + custom_trust_store = await response.parse() + assert_matches_type(Optional[CustomTrustStore], custom_trust_store, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_create(self, async_client: AsyncCloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + await async_client.acm.custom_trust_store.with_raw_response.create( + zone_id="", + certificate="-----BEGIN CERTIFICATE-----\nMIIDdjCCAl6gAwIBAgIJAPnMg0Fs+/B0MA0GCSqGSIb3DQEBCwUAMFsx...\n-----END CERTIFICATE-----\n", + ) + + @parametrize + async def test_method_list(self, async_client: AsyncCloudflare) -> None: + custom_trust_store = await async_client.acm.custom_trust_store.list( + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + ) + assert_matches_type(AsyncV4PagePaginationArray[CustomTrustStore], custom_trust_store, path=["response"]) + + @parametrize + async def test_method_list_with_all_params(self, async_client: AsyncCloudflare) -> None: + custom_trust_store = await async_client.acm.custom_trust_store.list( + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + limit=10, + offset=10, + page=1, + per_page=5, + ) + assert_matches_type(AsyncV4PagePaginationArray[CustomTrustStore], custom_trust_store, path=["response"]) + + @parametrize + async def test_raw_response_list(self, async_client: AsyncCloudflare) -> None: + response = await async_client.acm.custom_trust_store.with_raw_response.list( + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + custom_trust_store = await response.parse() + assert_matches_type(AsyncV4PagePaginationArray[CustomTrustStore], custom_trust_store, path=["response"]) + + @parametrize + async def test_streaming_response_list(self, async_client: AsyncCloudflare) -> None: + async with async_client.acm.custom_trust_store.with_streaming_response.list( + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + custom_trust_store = await response.parse() + assert_matches_type(AsyncV4PagePaginationArray[CustomTrustStore], custom_trust_store, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_list(self, async_client: AsyncCloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + await async_client.acm.custom_trust_store.with_raw_response.list( + zone_id="", + ) + + @parametrize + async def test_method_delete(self, async_client: AsyncCloudflare) -> None: + custom_trust_store = await async_client.acm.custom_trust_store.delete( + custom_origin_trust_store_id="023e105f4ecef8ad9ca31a8372d0c353", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + ) + assert_matches_type(Optional[CustomTrustStoreDeleteResponse], custom_trust_store, path=["response"]) + + @parametrize + async def test_raw_response_delete(self, async_client: AsyncCloudflare) -> None: + response = await async_client.acm.custom_trust_store.with_raw_response.delete( + custom_origin_trust_store_id="023e105f4ecef8ad9ca31a8372d0c353", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + custom_trust_store = await response.parse() + assert_matches_type(Optional[CustomTrustStoreDeleteResponse], custom_trust_store, path=["response"]) + + @parametrize + async def test_streaming_response_delete(self, async_client: AsyncCloudflare) -> None: + async with async_client.acm.custom_trust_store.with_streaming_response.delete( + custom_origin_trust_store_id="023e105f4ecef8ad9ca31a8372d0c353", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + custom_trust_store = await response.parse() + assert_matches_type(Optional[CustomTrustStoreDeleteResponse], custom_trust_store, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_delete(self, async_client: AsyncCloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + await async_client.acm.custom_trust_store.with_raw_response.delete( + custom_origin_trust_store_id="023e105f4ecef8ad9ca31a8372d0c353", + zone_id="", + ) + + with pytest.raises( + ValueError, match=r"Expected a non-empty value for `custom_origin_trust_store_id` but received ''" + ): + await async_client.acm.custom_trust_store.with_raw_response.delete( + custom_origin_trust_store_id="", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + ) + + @parametrize + async def test_method_get(self, async_client: AsyncCloudflare) -> None: + custom_trust_store = await async_client.acm.custom_trust_store.get( + custom_origin_trust_store_id="023e105f4ecef8ad9ca31a8372d0c353", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + ) + assert_matches_type(Optional[CustomTrustStore], custom_trust_store, path=["response"]) + + @parametrize + async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: + response = await async_client.acm.custom_trust_store.with_raw_response.get( + custom_origin_trust_store_id="023e105f4ecef8ad9ca31a8372d0c353", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + custom_trust_store = await response.parse() + assert_matches_type(Optional[CustomTrustStore], custom_trust_store, path=["response"]) + + @parametrize + async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> None: + async with async_client.acm.custom_trust_store.with_streaming_response.get( + custom_origin_trust_store_id="023e105f4ecef8ad9ca31a8372d0c353", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + custom_trust_store = await response.parse() + assert_matches_type(Optional[CustomTrustStore], custom_trust_store, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_get(self, async_client: AsyncCloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + await async_client.acm.custom_trust_store.with_raw_response.get( + custom_origin_trust_store_id="023e105f4ecef8ad9ca31a8372d0c353", + zone_id="", + ) + + with pytest.raises( + ValueError, match=r"Expected a non-empty value for `custom_origin_trust_store_id` but received ''" + ): + await async_client.acm.custom_trust_store.with_raw_response.get( + custom_origin_trust_store_id="", + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + ) From 506aedb6d9b5a83b4ef979f2d926723946fb4af1 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 27 Feb 2026 18:43:13 +0000 Subject: [PATCH 045/279] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index d9cbe86d437..b047b943714 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 2041 openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-9ba099b7936091cc984d2a24fc4d32c3ffcb1d71d86412c8c9084d201e16b3ac.yml openapi_spec_hash: 45edc9a107cf5a5e3b204b230b0d336d -config_hash: 7b60c75a2413402168b11558e43ba3f3 +config_hash: be3f6e9410db673744447f9dbe92d922 From 0be54b1440ab2ef694c7fef167409d8450ee37d4 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 2 Mar 2026 22:19:39 +0000 Subject: [PATCH 046/279] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index b047b943714..2353815a6b9 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 2041 openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-9ba099b7936091cc984d2a24fc4d32c3ffcb1d71d86412c8c9084d201e16b3ac.yml openapi_spec_hash: 45edc9a107cf5a5e3b204b230b0d336d -config_hash: be3f6e9410db673744447f9dbe92d922 +config_hash: 5d8bd5002a6f78b6f162dc0420e905bf From c5144a0ae90e1f21df2916fe9624b4dcd5af1967 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 2 Mar 2026 22:38:34 +0000 Subject: [PATCH 047/279] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index 2353815a6b9..f3fc049aeb0 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 2041 openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-9ba099b7936091cc984d2a24fc4d32c3ffcb1d71d86412c8c9084d201e16b3ac.yml openapi_spec_hash: 45edc9a107cf5a5e3b204b230b0d336d -config_hash: 5d8bd5002a6f78b6f162dc0420e905bf +config_hash: 96b952e0e131fab925a95b84c093c64e From 3ed409f13d288ae7b9d31adadd6ffa1309b2a6ba Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 3 Mar 2026 15:38:45 +0000 Subject: [PATCH 048/279] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index f3fc049aeb0..70ac7864dee 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 2041 openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-9ba099b7936091cc984d2a24fc4d32c3ffcb1d71d86412c8c9084d201e16b3ac.yml openapi_spec_hash: 45edc9a107cf5a5e3b204b230b0d336d -config_hash: 96b952e0e131fab925a95b84c093c64e +config_hash: 9ee8129db73d90fd901d8b8a6ad1f3c2 From 559adb6b91ad5904b0aaac575ce02e0bbfdb6584 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 4 Mar 2026 18:02:38 +0000 Subject: [PATCH 049/279] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index 70ac7864dee..a779a860942 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 2041 openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-9ba099b7936091cc984d2a24fc4d32c3ffcb1d71d86412c8c9084d201e16b3ac.yml openapi_spec_hash: 45edc9a107cf5a5e3b204b230b0d336d -config_hash: 9ee8129db73d90fd901d8b8a6ad1f3c2 +config_hash: 0768e14fdc9dec28e0031cf533c601e6 From c1fdeae1ec8cb33145101286fcd97576e36f532d Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 4 Mar 2026 19:02:02 +0000 Subject: [PATCH 050/279] feat: feat(workers): WO-989 Adds Workers>Observability>Destinations resources * feat(workers): WO-989 Adds Workers>Observability>Destinations resources --- .stats.yml | 4 +- api.md | 20 + .../workers/observability/__init__.py | 14 + .../workers/observability/destinations.py | 525 +++++++++++++++++ .../workers/observability/observability.py | 32 + .../types/workers/observability/__init__.py | 7 + .../destination_create_params.py | 34 ++ .../destination_create_response.py | 34 ++ .../destination_delete_response.py | 34 ++ .../observability/destination_list_params.py | 21 + .../destination_list_response.py | 44 ++ .../destination_update_params.py | 24 + .../destination_update_response.py | 34 ++ .../observability/test_destinations.py | 552 ++++++++++++++++++ 14 files changed, 1377 insertions(+), 2 deletions(-) create mode 100644 src/cloudflare/resources/workers/observability/destinations.py create mode 100644 src/cloudflare/types/workers/observability/destination_create_params.py create mode 100644 src/cloudflare/types/workers/observability/destination_create_response.py create mode 100644 src/cloudflare/types/workers/observability/destination_delete_response.py create mode 100644 src/cloudflare/types/workers/observability/destination_list_params.py create mode 100644 src/cloudflare/types/workers/observability/destination_list_response.py create mode 100644 src/cloudflare/types/workers/observability/destination_update_params.py create mode 100644 src/cloudflare/types/workers/observability/destination_update_response.py create mode 100644 tests/api_resources/workers/observability/test_destinations.py diff --git a/.stats.yml b/.stats.yml index a779a860942..ba380523a09 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ -configured_endpoints: 2041 +configured_endpoints: 2045 openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-9ba099b7936091cc984d2a24fc4d32c3ffcb1d71d86412c8c9084d201e16b3ac.yml openapi_spec_hash: 45edc9a107cf5a5e3b204b230b0d336d -config_hash: 0768e14fdc9dec28e0031cf533c601e6 +config_hash: c8f6f451ad44a8349b1876f50735189a diff --git a/api.md b/api.md index 3f5cd6f421a..75d39498134 100644 --- a/api.md +++ b/api.md @@ -2672,6 +2672,26 @@ Methods: - client.workers.observability.telemetry.query(\*, account_id, \*\*params) -> TelemetryQueryResponse - client.workers.observability.telemetry.values(\*, account_id, \*\*params) -> SyncSinglePage[TelemetryValuesResponse] +### Destinations + +Types: + +```python +from cloudflare.types.workers.observability import ( + DestinationCreateResponse, + DestinationUpdateResponse, + DestinationListResponse, + DestinationDeleteResponse, +) +``` + +Methods: + +- client.workers.observability.destinations.create(\*, account_id, \*\*params) -> DestinationCreateResponse +- client.workers.observability.destinations.update(slug, \*, account_id, \*\*params) -> DestinationUpdateResponse +- client.workers.observability.destinations.list(\*, account_id, \*\*params) -> SyncSinglePage[DestinationListResponse] +- client.workers.observability.destinations.delete(slug, \*, account_id) -> Optional[DestinationDeleteResponse] + # KV ## Namespaces diff --git a/src/cloudflare/resources/workers/observability/__init__.py b/src/cloudflare/resources/workers/observability/__init__.py index aa9190629cd..1e48df79576 100644 --- a/src/cloudflare/resources/workers/observability/__init__.py +++ b/src/cloudflare/resources/workers/observability/__init__.py @@ -8,6 +8,14 @@ TelemetryResourceWithStreamingResponse, AsyncTelemetryResourceWithStreamingResponse, ) +from .destinations import ( + DestinationsResource, + AsyncDestinationsResource, + DestinationsResourceWithRawResponse, + AsyncDestinationsResourceWithRawResponse, + DestinationsResourceWithStreamingResponse, + AsyncDestinationsResourceWithStreamingResponse, +) from .observability import ( ObservabilityResource, AsyncObservabilityResource, @@ -24,6 +32,12 @@ "AsyncTelemetryResourceWithRawResponse", "TelemetryResourceWithStreamingResponse", "AsyncTelemetryResourceWithStreamingResponse", + "DestinationsResource", + "AsyncDestinationsResource", + "DestinationsResourceWithRawResponse", + "AsyncDestinationsResourceWithRawResponse", + "DestinationsResourceWithStreamingResponse", + "AsyncDestinationsResourceWithStreamingResponse", "ObservabilityResource", "AsyncObservabilityResource", "ObservabilityResourceWithRawResponse", diff --git a/src/cloudflare/resources/workers/observability/destinations.py b/src/cloudflare/resources/workers/observability/destinations.py new file mode 100644 index 00000000000..26a156b902d --- /dev/null +++ b/src/cloudflare/resources/workers/observability/destinations.py @@ -0,0 +1,525 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +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 maybe_transform, async_maybe_transform +from ...._compat import cached_property +from ...._resource import SyncAPIResource, AsyncAPIResource +from ...._response import ( + to_raw_response_wrapper, + to_streamed_response_wrapper, + 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.workers.observability import ( + destination_list_params, + destination_create_params, + destination_update_params, +) +from ....types.workers.observability.destination_list_response import DestinationListResponse +from ....types.workers.observability.destination_create_response import DestinationCreateResponse +from ....types.workers.observability.destination_delete_response import DestinationDeleteResponse +from ....types.workers.observability.destination_update_response import DestinationUpdateResponse + +__all__ = ["DestinationsResource", "AsyncDestinationsResource"] + + +class DestinationsResource(SyncAPIResource): + @cached_property + def with_raw_response(self) -> DestinationsResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers + """ + return DestinationsResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> DestinationsResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/cloudflare/cloudflare-python#with_streaming_response + """ + return DestinationsResourceWithStreamingResponse(self) + + def create( + self, + *, + account_id: str, + configuration: destination_create_params.Configuration, + enabled: bool, + name: str, + skip_preflight_check: 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, + ) -> DestinationCreateResponse: + """ + Create a new Workers Observability Telemetry Destination. + + Args: + 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._post( + f"/accounts/{account_id}/workers/observability/destinations", + body=maybe_transform( + { + "configuration": configuration, + "enabled": enabled, + "name": name, + "skip_preflight_check": skip_preflight_check, + }, + destination_create_params.DestinationCreateParams, + ), + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + post_parser=ResultWrapper[DestinationCreateResponse]._unwrapper, + ), + cast_to=cast(Type[DestinationCreateResponse], ResultWrapper[DestinationCreateResponse]), + ) + + def update( + self, + slug: str, + *, + account_id: str, + configuration: destination_update_params.Configuration, + enabled: bool, + # 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, + ) -> DestinationUpdateResponse: + """ + Update an existing Workers Observability Telemetry Destination. + + Args: + 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 slug: + raise ValueError(f"Expected a non-empty value for `slug` but received {slug!r}") + return self._patch( + f"/accounts/{account_id}/workers/observability/destinations/{slug}", + body=maybe_transform( + { + "configuration": configuration, + "enabled": enabled, + }, + destination_update_params.DestinationUpdateParams, + ), + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + post_parser=ResultWrapper[DestinationUpdateResponse]._unwrapper, + ), + cast_to=cast(Type[DestinationUpdateResponse], ResultWrapper[DestinationUpdateResponse]), + ) + + def list( + self, + *, + account_id: str, + order: Literal["asc", "desc"] | Omit = omit, + order_by: Literal["created", "updated"] | Omit = omit, + page: float | Omit = omit, + per_page: float | 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, + ) -> SyncSinglePage[DestinationListResponse]: + """ + List your Workers Observability Telemetry Destinations. + + Args: + 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( + f"/accounts/{account_id}/workers/observability/destinations", + page=SyncSinglePage[DestinationListResponse], + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=maybe_transform( + { + "order": order, + "order_by": order_by, + "page": page, + "per_page": per_page, + }, + destination_list_params.DestinationListParams, + ), + ), + model=DestinationListResponse, + ) + + def delete( + self, + slug: 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[DestinationDeleteResponse]: + """ + Delete a Workers Observability Telemetry Destination. + + Args: + 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 slug: + raise ValueError(f"Expected a non-empty value for `slug` but received {slug!r}") + return self._delete( + f"/accounts/{account_id}/workers/observability/destinations/{slug}", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + post_parser=ResultWrapper[Optional[DestinationDeleteResponse]]._unwrapper, + ), + cast_to=cast(Type[Optional[DestinationDeleteResponse]], ResultWrapper[DestinationDeleteResponse]), + ) + + +class AsyncDestinationsResource(AsyncAPIResource): + @cached_property + def with_raw_response(self) -> AsyncDestinationsResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers + """ + return AsyncDestinationsResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> AsyncDestinationsResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/cloudflare/cloudflare-python#with_streaming_response + """ + return AsyncDestinationsResourceWithStreamingResponse(self) + + async def create( + self, + *, + account_id: str, + configuration: destination_create_params.Configuration, + enabled: bool, + name: str, + skip_preflight_check: 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, + ) -> DestinationCreateResponse: + """ + Create a new Workers Observability Telemetry Destination. + + Args: + 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 await self._post( + f"/accounts/{account_id}/workers/observability/destinations", + body=await async_maybe_transform( + { + "configuration": configuration, + "enabled": enabled, + "name": name, + "skip_preflight_check": skip_preflight_check, + }, + destination_create_params.DestinationCreateParams, + ), + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + post_parser=ResultWrapper[DestinationCreateResponse]._unwrapper, + ), + cast_to=cast(Type[DestinationCreateResponse], ResultWrapper[DestinationCreateResponse]), + ) + + async def update( + self, + slug: str, + *, + account_id: str, + configuration: destination_update_params.Configuration, + enabled: bool, + # 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, + ) -> DestinationUpdateResponse: + """ + Update an existing Workers Observability Telemetry Destination. + + Args: + 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 slug: + raise ValueError(f"Expected a non-empty value for `slug` but received {slug!r}") + return await self._patch( + f"/accounts/{account_id}/workers/observability/destinations/{slug}", + body=await async_maybe_transform( + { + "configuration": configuration, + "enabled": enabled, + }, + destination_update_params.DestinationUpdateParams, + ), + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + post_parser=ResultWrapper[DestinationUpdateResponse]._unwrapper, + ), + cast_to=cast(Type[DestinationUpdateResponse], ResultWrapper[DestinationUpdateResponse]), + ) + + def list( + self, + *, + account_id: str, + order: Literal["asc", "desc"] | Omit = omit, + order_by: Literal["created", "updated"] | Omit = omit, + page: float | Omit = omit, + per_page: float | 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, + ) -> AsyncPaginator[DestinationListResponse, AsyncSinglePage[DestinationListResponse]]: + """ + List your Workers Observability Telemetry Destinations. + + Args: + 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( + f"/accounts/{account_id}/workers/observability/destinations", + page=AsyncSinglePage[DestinationListResponse], + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=maybe_transform( + { + "order": order, + "order_by": order_by, + "page": page, + "per_page": per_page, + }, + destination_list_params.DestinationListParams, + ), + ), + model=DestinationListResponse, + ) + + async def delete( + self, + slug: 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[DestinationDeleteResponse]: + """ + Delete a Workers Observability Telemetry Destination. + + Args: + 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 slug: + raise ValueError(f"Expected a non-empty value for `slug` but received {slug!r}") + return await self._delete( + f"/accounts/{account_id}/workers/observability/destinations/{slug}", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + post_parser=ResultWrapper[Optional[DestinationDeleteResponse]]._unwrapper, + ), + cast_to=cast(Type[Optional[DestinationDeleteResponse]], ResultWrapper[DestinationDeleteResponse]), + ) + + +class DestinationsResourceWithRawResponse: + def __init__(self, destinations: DestinationsResource) -> None: + self._destinations = destinations + + self.create = to_raw_response_wrapper( + destinations.create, + ) + self.update = to_raw_response_wrapper( + destinations.update, + ) + self.list = to_raw_response_wrapper( + destinations.list, + ) + self.delete = to_raw_response_wrapper( + destinations.delete, + ) + + +class AsyncDestinationsResourceWithRawResponse: + def __init__(self, destinations: AsyncDestinationsResource) -> None: + self._destinations = destinations + + self.create = async_to_raw_response_wrapper( + destinations.create, + ) + self.update = async_to_raw_response_wrapper( + destinations.update, + ) + self.list = async_to_raw_response_wrapper( + destinations.list, + ) + self.delete = async_to_raw_response_wrapper( + destinations.delete, + ) + + +class DestinationsResourceWithStreamingResponse: + def __init__(self, destinations: DestinationsResource) -> None: + self._destinations = destinations + + self.create = to_streamed_response_wrapper( + destinations.create, + ) + self.update = to_streamed_response_wrapper( + destinations.update, + ) + self.list = to_streamed_response_wrapper( + destinations.list, + ) + self.delete = to_streamed_response_wrapper( + destinations.delete, + ) + + +class AsyncDestinationsResourceWithStreamingResponse: + def __init__(self, destinations: AsyncDestinationsResource) -> None: + self._destinations = destinations + + self.create = async_to_streamed_response_wrapper( + destinations.create, + ) + self.update = async_to_streamed_response_wrapper( + destinations.update, + ) + self.list = async_to_streamed_response_wrapper( + destinations.list, + ) + self.delete = async_to_streamed_response_wrapper( + destinations.delete, + ) diff --git a/src/cloudflare/resources/workers/observability/observability.py b/src/cloudflare/resources/workers/observability/observability.py index 7e09842a71a..e1caadbdd68 100644 --- a/src/cloudflare/resources/workers/observability/observability.py +++ b/src/cloudflare/resources/workers/observability/observability.py @@ -12,6 +12,14 @@ ) from ...._compat import cached_property from ...._resource import SyncAPIResource, AsyncAPIResource +from .destinations import ( + DestinationsResource, + AsyncDestinationsResource, + DestinationsResourceWithRawResponse, + AsyncDestinationsResourceWithRawResponse, + DestinationsResourceWithStreamingResponse, + AsyncDestinationsResourceWithStreamingResponse, +) __all__ = ["ObservabilityResource", "AsyncObservabilityResource"] @@ -21,6 +29,10 @@ class ObservabilityResource(SyncAPIResource): def telemetry(self) -> TelemetryResource: return TelemetryResource(self._client) + @cached_property + def destinations(self) -> DestinationsResource: + return DestinationsResource(self._client) + @cached_property def with_raw_response(self) -> ObservabilityResourceWithRawResponse: """ @@ -46,6 +58,10 @@ class AsyncObservabilityResource(AsyncAPIResource): def telemetry(self) -> AsyncTelemetryResource: return AsyncTelemetryResource(self._client) + @cached_property + def destinations(self) -> AsyncDestinationsResource: + return AsyncDestinationsResource(self._client) + @cached_property def with_raw_response(self) -> AsyncObservabilityResourceWithRawResponse: """ @@ -74,6 +90,10 @@ def __init__(self, observability: ObservabilityResource) -> None: def telemetry(self) -> TelemetryResourceWithRawResponse: return TelemetryResourceWithRawResponse(self._observability.telemetry) + @cached_property + def destinations(self) -> DestinationsResourceWithRawResponse: + return DestinationsResourceWithRawResponse(self._observability.destinations) + class AsyncObservabilityResourceWithRawResponse: def __init__(self, observability: AsyncObservabilityResource) -> None: @@ -83,6 +103,10 @@ def __init__(self, observability: AsyncObservabilityResource) -> None: def telemetry(self) -> AsyncTelemetryResourceWithRawResponse: return AsyncTelemetryResourceWithRawResponse(self._observability.telemetry) + @cached_property + def destinations(self) -> AsyncDestinationsResourceWithRawResponse: + return AsyncDestinationsResourceWithRawResponse(self._observability.destinations) + class ObservabilityResourceWithStreamingResponse: def __init__(self, observability: ObservabilityResource) -> None: @@ -92,6 +116,10 @@ def __init__(self, observability: ObservabilityResource) -> None: def telemetry(self) -> TelemetryResourceWithStreamingResponse: return TelemetryResourceWithStreamingResponse(self._observability.telemetry) + @cached_property + def destinations(self) -> DestinationsResourceWithStreamingResponse: + return DestinationsResourceWithStreamingResponse(self._observability.destinations) + class AsyncObservabilityResourceWithStreamingResponse: def __init__(self, observability: AsyncObservabilityResource) -> None: @@ -100,3 +128,7 @@ def __init__(self, observability: AsyncObservabilityResource) -> None: @cached_property def telemetry(self) -> AsyncTelemetryResourceWithStreamingResponse: return AsyncTelemetryResourceWithStreamingResponse(self._observability.telemetry) + + @cached_property + def destinations(self) -> AsyncDestinationsResourceWithStreamingResponse: + return AsyncDestinationsResourceWithStreamingResponse(self._observability.destinations) diff --git a/src/cloudflare/types/workers/observability/__init__.py b/src/cloudflare/types/workers/observability/__init__.py index 0aaa1d0adea..aa4075caf4b 100644 --- a/src/cloudflare/types/workers/observability/__init__.py +++ b/src/cloudflare/types/workers/observability/__init__.py @@ -4,7 +4,14 @@ from .telemetry_keys_params import TelemetryKeysParams as TelemetryKeysParams from .telemetry_query_params import TelemetryQueryParams as TelemetryQueryParams +from .destination_list_params import DestinationListParams as DestinationListParams from .telemetry_keys_response import TelemetryKeysResponse as TelemetryKeysResponse from .telemetry_values_params import TelemetryValuesParams as TelemetryValuesParams from .telemetry_query_response import TelemetryQueryResponse as TelemetryQueryResponse +from .destination_create_params import DestinationCreateParams as DestinationCreateParams +from .destination_list_response import DestinationListResponse as DestinationListResponse +from .destination_update_params import DestinationUpdateParams as DestinationUpdateParams from .telemetry_values_response import TelemetryValuesResponse as TelemetryValuesResponse +from .destination_create_response import DestinationCreateResponse as DestinationCreateResponse +from .destination_delete_response import DestinationDeleteResponse as DestinationDeleteResponse +from .destination_update_response import DestinationUpdateResponse as DestinationUpdateResponse diff --git a/src/cloudflare/types/workers/observability/destination_create_params.py b/src/cloudflare/types/workers/observability/destination_create_params.py new file mode 100644 index 00000000000..9af45a3f4fc --- /dev/null +++ b/src/cloudflare/types/workers/observability/destination_create_params.py @@ -0,0 +1,34 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Dict +from typing_extensions import Literal, Required, Annotated, TypedDict + +from ...._utils import PropertyInfo + +__all__ = ["DestinationCreateParams", "Configuration"] + + +class DestinationCreateParams(TypedDict, total=False): + account_id: Required[str] + + configuration: Required[Configuration] + + enabled: Required[bool] + + name: Required[str] + + skip_preflight_check: Annotated[bool, PropertyInfo(alias="skipPreflightCheck")] + + +class Configuration(TypedDict, total=False): + headers: Required[Dict[str, str]] + + logpush_dataset: Required[ + Annotated[Literal["opentelemetry-traces", "opentelemetry-logs"], PropertyInfo(alias="logpushDataset")] + ] + + type: Required[Literal["logpush"]] + + url: Required[str] diff --git a/src/cloudflare/types/workers/observability/destination_create_response.py b/src/cloudflare/types/workers/observability/destination_create_response.py new file mode 100644 index 00000000000..d84b9645bb1 --- /dev/null +++ b/src/cloudflare/types/workers/observability/destination_create_response.py @@ -0,0 +1,34 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List +from typing_extensions import Literal + +from pydantic import Field as FieldInfo + +from ...._models import BaseModel + +__all__ = ["DestinationCreateResponse", "Configuration"] + + +class Configuration(BaseModel): + destination_conf: str + + logpush_dataset: Literal["opentelemetry-traces", "opentelemetry-logs"] = FieldInfo(alias="logpushDataset") + + logpush_job: float = FieldInfo(alias="logpushJob") + + type: Literal["logpush"] + + url: str + + +class DestinationCreateResponse(BaseModel): + configuration: Configuration + + enabled: bool + + name: str + + scripts: List[str] + + slug: str diff --git a/src/cloudflare/types/workers/observability/destination_delete_response.py b/src/cloudflare/types/workers/observability/destination_delete_response.py new file mode 100644 index 00000000000..953d92ce9ef --- /dev/null +++ b/src/cloudflare/types/workers/observability/destination_delete_response.py @@ -0,0 +1,34 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List +from typing_extensions import Literal + +from pydantic import Field as FieldInfo + +from ...._models import BaseModel + +__all__ = ["DestinationDeleteResponse", "Configuration"] + + +class Configuration(BaseModel): + destination_conf: str + + logpush_dataset: Literal["opentelemetry-traces", "opentelemetry-logs"] = FieldInfo(alias="logpushDataset") + + logpush_job: float = FieldInfo(alias="logpushJob") + + type: Literal["logpush"] + + url: str + + +class DestinationDeleteResponse(BaseModel): + configuration: Configuration + + enabled: bool + + name: str + + scripts: List[str] + + slug: str diff --git a/src/cloudflare/types/workers/observability/destination_list_params.py b/src/cloudflare/types/workers/observability/destination_list_params.py new file mode 100644 index 00000000000..85d6519f33d --- /dev/null +++ b/src/cloudflare/types/workers/observability/destination_list_params.py @@ -0,0 +1,21 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Literal, Required, Annotated, TypedDict + +from ...._utils import PropertyInfo + +__all__ = ["DestinationListParams"] + + +class DestinationListParams(TypedDict, total=False): + account_id: Required[str] + + order: Literal["asc", "desc"] + + order_by: Annotated[Literal["created", "updated"], PropertyInfo(alias="orderBy")] + + page: float + + per_page: Annotated[float, PropertyInfo(alias="perPage")] diff --git a/src/cloudflare/types/workers/observability/destination_list_response.py b/src/cloudflare/types/workers/observability/destination_list_response.py new file mode 100644 index 00000000000..75ac1e0847e --- /dev/null +++ b/src/cloudflare/types/workers/observability/destination_list_response.py @@ -0,0 +1,44 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Dict, List +from typing_extensions import Literal + +from pydantic import Field as FieldInfo + +from ...._models import BaseModel + +__all__ = ["DestinationListResponse", "Configuration", "ConfigurationJobStatus"] + + +class ConfigurationJobStatus(BaseModel): + error_message: str + + last_complete: str + + last_error: str + + +class Configuration(BaseModel): + destination_conf: str + + headers: Dict[str, str] + + job_status: ConfigurationJobStatus = FieldInfo(alias="jobStatus") + + logpush_dataset: Literal["opentelemetry-traces", "opentelemetry-logs"] = FieldInfo(alias="logpushDataset") + + type: Literal["logpush"] + + url: str + + +class DestinationListResponse(BaseModel): + configuration: Configuration + + enabled: bool + + name: str + + scripts: List[str] + + slug: str diff --git a/src/cloudflare/types/workers/observability/destination_update_params.py b/src/cloudflare/types/workers/observability/destination_update_params.py new file mode 100644 index 00000000000..a6c2d729053 --- /dev/null +++ b/src/cloudflare/types/workers/observability/destination_update_params.py @@ -0,0 +1,24 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Dict +from typing_extensions import Literal, Required, TypedDict + +__all__ = ["DestinationUpdateParams", "Configuration"] + + +class DestinationUpdateParams(TypedDict, total=False): + account_id: Required[str] + + configuration: Required[Configuration] + + enabled: Required[bool] + + +class Configuration(TypedDict, total=False): + headers: Required[Dict[str, str]] + + type: Required[Literal["logpush"]] + + url: Required[str] diff --git a/src/cloudflare/types/workers/observability/destination_update_response.py b/src/cloudflare/types/workers/observability/destination_update_response.py new file mode 100644 index 00000000000..f4b392027db --- /dev/null +++ b/src/cloudflare/types/workers/observability/destination_update_response.py @@ -0,0 +1,34 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List +from typing_extensions import Literal + +from pydantic import Field as FieldInfo + +from ...._models import BaseModel + +__all__ = ["DestinationUpdateResponse", "Configuration"] + + +class Configuration(BaseModel): + destination_conf: str + + logpush_dataset: Literal["opentelemetry-traces", "opentelemetry-logs"] = FieldInfo(alias="logpushDataset") + + logpush_job: float = FieldInfo(alias="logpushJob") + + type: Literal["logpush"] + + url: str + + +class DestinationUpdateResponse(BaseModel): + configuration: Configuration + + enabled: bool + + name: str + + scripts: List[str] + + slug: str diff --git a/tests/api_resources/workers/observability/test_destinations.py b/tests/api_resources/workers/observability/test_destinations.py new file mode 100644 index 00000000000..82f2c056fef --- /dev/null +++ b/tests/api_resources/workers/observability/test_destinations.py @@ -0,0 +1,552 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +import os +from typing import Any, Optional, cast + +import pytest + +from cloudflare import Cloudflare, AsyncCloudflare +from tests.utils import assert_matches_type +from cloudflare.pagination import SyncSinglePage, AsyncSinglePage +from cloudflare.types.workers.observability import ( + DestinationListResponse, + DestinationCreateResponse, + DestinationDeleteResponse, + DestinationUpdateResponse, +) + +base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") + + +class TestDestinations: + parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) + + @parametrize + def test_method_create(self, client: Cloudflare) -> None: + destination = client.workers.observability.destinations.create( + account_id="account_id", + configuration={ + "headers": {"foo": "string"}, + "logpush_dataset": "opentelemetry-traces", + "type": "logpush", + "url": "url", + }, + enabled=True, + name="name", + ) + assert_matches_type(DestinationCreateResponse, destination, path=["response"]) + + @parametrize + def test_method_create_with_all_params(self, client: Cloudflare) -> None: + destination = client.workers.observability.destinations.create( + account_id="account_id", + configuration={ + "headers": {"foo": "string"}, + "logpush_dataset": "opentelemetry-traces", + "type": "logpush", + "url": "url", + }, + enabled=True, + name="name", + skip_preflight_check=True, + ) + assert_matches_type(DestinationCreateResponse, destination, path=["response"]) + + @parametrize + def test_raw_response_create(self, client: Cloudflare) -> None: + response = client.workers.observability.destinations.with_raw_response.create( + account_id="account_id", + configuration={ + "headers": {"foo": "string"}, + "logpush_dataset": "opentelemetry-traces", + "type": "logpush", + "url": "url", + }, + enabled=True, + name="name", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + destination = response.parse() + assert_matches_type(DestinationCreateResponse, destination, path=["response"]) + + @parametrize + def test_streaming_response_create(self, client: Cloudflare) -> None: + with client.workers.observability.destinations.with_streaming_response.create( + account_id="account_id", + configuration={ + "headers": {"foo": "string"}, + "logpush_dataset": "opentelemetry-traces", + "type": "logpush", + "url": "url", + }, + enabled=True, + name="name", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + destination = response.parse() + assert_matches_type(DestinationCreateResponse, destination, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_create(self, client: Cloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + client.workers.observability.destinations.with_raw_response.create( + account_id="", + configuration={ + "headers": {"foo": "string"}, + "logpush_dataset": "opentelemetry-traces", + "type": "logpush", + "url": "url", + }, + enabled=True, + name="name", + ) + + @parametrize + def test_method_update(self, client: Cloudflare) -> None: + destination = client.workers.observability.destinations.update( + slug="slug", + account_id="account_id", + configuration={ + "headers": {"foo": "string"}, + "type": "logpush", + "url": "url", + }, + enabled=True, + ) + assert_matches_type(DestinationUpdateResponse, destination, path=["response"]) + + @parametrize + def test_raw_response_update(self, client: Cloudflare) -> None: + response = client.workers.observability.destinations.with_raw_response.update( + slug="slug", + account_id="account_id", + configuration={ + "headers": {"foo": "string"}, + "type": "logpush", + "url": "url", + }, + enabled=True, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + destination = response.parse() + assert_matches_type(DestinationUpdateResponse, destination, path=["response"]) + + @parametrize + def test_streaming_response_update(self, client: Cloudflare) -> None: + with client.workers.observability.destinations.with_streaming_response.update( + slug="slug", + account_id="account_id", + configuration={ + "headers": {"foo": "string"}, + "type": "logpush", + "url": "url", + }, + enabled=True, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + destination = response.parse() + assert_matches_type(DestinationUpdateResponse, destination, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_update(self, client: Cloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + client.workers.observability.destinations.with_raw_response.update( + slug="slug", + account_id="", + configuration={ + "headers": {"foo": "string"}, + "type": "logpush", + "url": "url", + }, + enabled=True, + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `slug` but received ''"): + client.workers.observability.destinations.with_raw_response.update( + slug="", + account_id="account_id", + configuration={ + "headers": {"foo": "string"}, + "type": "logpush", + "url": "url", + }, + enabled=True, + ) + + @parametrize + def test_method_list(self, client: Cloudflare) -> None: + destination = client.workers.observability.destinations.list( + account_id="account_id", + ) + assert_matches_type(SyncSinglePage[DestinationListResponse], destination, path=["response"]) + + @parametrize + def test_method_list_with_all_params(self, client: Cloudflare) -> None: + destination = client.workers.observability.destinations.list( + account_id="account_id", + order="asc", + order_by="created", + page=1, + per_page=5, + ) + assert_matches_type(SyncSinglePage[DestinationListResponse], destination, path=["response"]) + + @parametrize + def test_raw_response_list(self, client: Cloudflare) -> None: + response = client.workers.observability.destinations.with_raw_response.list( + account_id="account_id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + destination = response.parse() + assert_matches_type(SyncSinglePage[DestinationListResponse], destination, path=["response"]) + + @parametrize + def test_streaming_response_list(self, client: Cloudflare) -> None: + with client.workers.observability.destinations.with_streaming_response.list( + account_id="account_id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + destination = response.parse() + assert_matches_type(SyncSinglePage[DestinationListResponse], destination, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_list(self, client: Cloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + client.workers.observability.destinations.with_raw_response.list( + account_id="", + ) + + @parametrize + def test_method_delete(self, client: Cloudflare) -> None: + destination = client.workers.observability.destinations.delete( + slug="slug", + account_id="account_id", + ) + assert_matches_type(Optional[DestinationDeleteResponse], destination, path=["response"]) + + @parametrize + def test_raw_response_delete(self, client: Cloudflare) -> None: + response = client.workers.observability.destinations.with_raw_response.delete( + slug="slug", + account_id="account_id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + destination = response.parse() + assert_matches_type(Optional[DestinationDeleteResponse], destination, path=["response"]) + + @parametrize + def test_streaming_response_delete(self, client: Cloudflare) -> None: + with client.workers.observability.destinations.with_streaming_response.delete( + slug="slug", + account_id="account_id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + destination = response.parse() + assert_matches_type(Optional[DestinationDeleteResponse], destination, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_delete(self, client: Cloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + client.workers.observability.destinations.with_raw_response.delete( + slug="slug", + account_id="", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `slug` but received ''"): + client.workers.observability.destinations.with_raw_response.delete( + slug="", + account_id="account_id", + ) + + +class TestAsyncDestinations: + parametrize = pytest.mark.parametrize( + "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"] + ) + + @parametrize + async def test_method_create(self, async_client: AsyncCloudflare) -> None: + destination = await async_client.workers.observability.destinations.create( + account_id="account_id", + configuration={ + "headers": {"foo": "string"}, + "logpush_dataset": "opentelemetry-traces", + "type": "logpush", + "url": "url", + }, + enabled=True, + name="name", + ) + assert_matches_type(DestinationCreateResponse, destination, path=["response"]) + + @parametrize + async def test_method_create_with_all_params(self, async_client: AsyncCloudflare) -> None: + destination = await async_client.workers.observability.destinations.create( + account_id="account_id", + configuration={ + "headers": {"foo": "string"}, + "logpush_dataset": "opentelemetry-traces", + "type": "logpush", + "url": "url", + }, + enabled=True, + name="name", + skip_preflight_check=True, + ) + assert_matches_type(DestinationCreateResponse, destination, path=["response"]) + + @parametrize + async def test_raw_response_create(self, async_client: AsyncCloudflare) -> None: + response = await async_client.workers.observability.destinations.with_raw_response.create( + account_id="account_id", + configuration={ + "headers": {"foo": "string"}, + "logpush_dataset": "opentelemetry-traces", + "type": "logpush", + "url": "url", + }, + enabled=True, + name="name", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + destination = await response.parse() + assert_matches_type(DestinationCreateResponse, destination, path=["response"]) + + @parametrize + async def test_streaming_response_create(self, async_client: AsyncCloudflare) -> None: + async with async_client.workers.observability.destinations.with_streaming_response.create( + account_id="account_id", + configuration={ + "headers": {"foo": "string"}, + "logpush_dataset": "opentelemetry-traces", + "type": "logpush", + "url": "url", + }, + enabled=True, + name="name", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + destination = await response.parse() + assert_matches_type(DestinationCreateResponse, destination, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_create(self, async_client: AsyncCloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + await async_client.workers.observability.destinations.with_raw_response.create( + account_id="", + configuration={ + "headers": {"foo": "string"}, + "logpush_dataset": "opentelemetry-traces", + "type": "logpush", + "url": "url", + }, + enabled=True, + name="name", + ) + + @parametrize + async def test_method_update(self, async_client: AsyncCloudflare) -> None: + destination = await async_client.workers.observability.destinations.update( + slug="slug", + account_id="account_id", + configuration={ + "headers": {"foo": "string"}, + "type": "logpush", + "url": "url", + }, + enabled=True, + ) + assert_matches_type(DestinationUpdateResponse, destination, path=["response"]) + + @parametrize + async def test_raw_response_update(self, async_client: AsyncCloudflare) -> None: + response = await async_client.workers.observability.destinations.with_raw_response.update( + slug="slug", + account_id="account_id", + configuration={ + "headers": {"foo": "string"}, + "type": "logpush", + "url": "url", + }, + enabled=True, + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + destination = await response.parse() + assert_matches_type(DestinationUpdateResponse, destination, path=["response"]) + + @parametrize + async def test_streaming_response_update(self, async_client: AsyncCloudflare) -> None: + async with async_client.workers.observability.destinations.with_streaming_response.update( + slug="slug", + account_id="account_id", + configuration={ + "headers": {"foo": "string"}, + "type": "logpush", + "url": "url", + }, + enabled=True, + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + destination = await response.parse() + assert_matches_type(DestinationUpdateResponse, destination, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_update(self, async_client: AsyncCloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + await async_client.workers.observability.destinations.with_raw_response.update( + slug="slug", + account_id="", + configuration={ + "headers": {"foo": "string"}, + "type": "logpush", + "url": "url", + }, + enabled=True, + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `slug` but received ''"): + await async_client.workers.observability.destinations.with_raw_response.update( + slug="", + account_id="account_id", + configuration={ + "headers": {"foo": "string"}, + "type": "logpush", + "url": "url", + }, + enabled=True, + ) + + @parametrize + async def test_method_list(self, async_client: AsyncCloudflare) -> None: + destination = await async_client.workers.observability.destinations.list( + account_id="account_id", + ) + assert_matches_type(AsyncSinglePage[DestinationListResponse], destination, path=["response"]) + + @parametrize + async def test_method_list_with_all_params(self, async_client: AsyncCloudflare) -> None: + destination = await async_client.workers.observability.destinations.list( + account_id="account_id", + order="asc", + order_by="created", + page=1, + per_page=5, + ) + assert_matches_type(AsyncSinglePage[DestinationListResponse], destination, path=["response"]) + + @parametrize + async def test_raw_response_list(self, async_client: AsyncCloudflare) -> None: + response = await async_client.workers.observability.destinations.with_raw_response.list( + account_id="account_id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + destination = await response.parse() + assert_matches_type(AsyncSinglePage[DestinationListResponse], destination, path=["response"]) + + @parametrize + async def test_streaming_response_list(self, async_client: AsyncCloudflare) -> None: + async with async_client.workers.observability.destinations.with_streaming_response.list( + account_id="account_id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + destination = await response.parse() + assert_matches_type(AsyncSinglePage[DestinationListResponse], destination, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_list(self, async_client: AsyncCloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + await async_client.workers.observability.destinations.with_raw_response.list( + account_id="", + ) + + @parametrize + async def test_method_delete(self, async_client: AsyncCloudflare) -> None: + destination = await async_client.workers.observability.destinations.delete( + slug="slug", + account_id="account_id", + ) + assert_matches_type(Optional[DestinationDeleteResponse], destination, path=["response"]) + + @parametrize + async def test_raw_response_delete(self, async_client: AsyncCloudflare) -> None: + response = await async_client.workers.observability.destinations.with_raw_response.delete( + slug="slug", + account_id="account_id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + destination = await response.parse() + assert_matches_type(Optional[DestinationDeleteResponse], destination, path=["response"]) + + @parametrize + async def test_streaming_response_delete(self, async_client: AsyncCloudflare) -> None: + async with async_client.workers.observability.destinations.with_streaming_response.delete( + slug="slug", + account_id="account_id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + destination = await response.parse() + assert_matches_type(Optional[DestinationDeleteResponse], destination, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_delete(self, async_client: AsyncCloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + await async_client.workers.observability.destinations.with_raw_response.delete( + slug="slug", + account_id="", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `slug` but received ''"): + await async_client.workers.observability.destinations.with_raw_response.delete( + slug="", + account_id="account_id", + ) From bcafc86a702e490d04adbf58fd34cd6b3396d897 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 4 Mar 2026 22:56:41 +0000 Subject: [PATCH 051/279] feat: feat(zero_trust_device_subnet): onboard new terraform resource cloudflare_zero_trust_device_subnet * feat(zero_trust_device_subnet): onboard new terraform resource cloudflare_zero_trust_device_subnet --- .stats.yml | 2 +- api.md | 29 +++-------- .../networks/subnets/cloudflare_source.py | 14 +++--- .../zero_trust/networks/subnets/subnets.py | 14 +++--- .../zero_trust/networks/subnets/warp.py | 40 ++++++++-------- .../types/zero_trust/networks/__init__.py | 1 - .../networks/subnet_list_response.py | 41 ---------------- .../zero_trust/networks/subnets/__init__.py | 5 +- .../cloudflare_source_update_response.py | 41 ---------------- .../{warp_get_response.py => subnet.py} | 4 +- .../networks/subnets/warp_create_response.py | 41 ---------------- .../networks/subnets/warp_edit_response.py | 41 ---------------- .../subnets/test_cloudflare_source.py | 18 +++---- .../zero_trust/networks/subnets/test_warp.py | 48 +++++++++---------- .../zero_trust/networks/test_subnets.py | 18 +++---- 15 files changed, 84 insertions(+), 273 deletions(-) delete mode 100644 src/cloudflare/types/zero_trust/networks/subnet_list_response.py delete mode 100644 src/cloudflare/types/zero_trust/networks/subnets/cloudflare_source_update_response.py rename src/cloudflare/types/zero_trust/networks/subnets/{warp_get_response.py => subnet.py} (94%) delete mode 100644 src/cloudflare/types/zero_trust/networks/subnets/warp_create_response.py delete mode 100644 src/cloudflare/types/zero_trust/networks/subnets/warp_edit_response.py diff --git a/.stats.yml b/.stats.yml index ba380523a09..e454ea14a72 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 2045 openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-9ba099b7936091cc984d2a24fc4d32c3ffcb1d71d86412c8c9084d201e16b3ac.yml openapi_spec_hash: 45edc9a107cf5a5e3b204b230b0d336d -config_hash: c8f6f451ad44a8349b1876f50735189a +config_hash: 7d51f0daff6082e6eef983fe5a1bcfef diff --git a/api.md b/api.md index 75d39498134..dd8b3a32371 100644 --- a/api.md +++ b/api.md @@ -7340,47 +7340,30 @@ Methods: ### Subnets -Types: - -```python -from cloudflare.types.zero_trust.networks import SubnetListResponse -``` - Methods: -- client.zero_trust.networks.subnets.list(\*, account_id, \*\*params) -> SyncV4PagePaginationArray[SubnetListResponse] +- client.zero_trust.networks.subnets.list(\*, account_id, \*\*params) -> SyncV4PagePaginationArray[Subnet] #### WARP Types: ```python -from cloudflare.types.zero_trust.networks.subnets import ( - WARPCreateResponse, - WARPDeleteResponse, - WARPEditResponse, - WARPGetResponse, -) +from cloudflare.types.zero_trust.networks.subnets import Subnet, WARPDeleteResponse ``` Methods: -- client.zero_trust.networks.subnets.warp.create(\*, account_id, \*\*params) -> WARPCreateResponse +- client.zero_trust.networks.subnets.warp.create(\*, account_id, \*\*params) -> Subnet - client.zero_trust.networks.subnets.warp.delete(subnet_id, \*, account_id) -> Optional[WARPDeleteResponse] -- client.zero_trust.networks.subnets.warp.edit(subnet_id, \*, account_id, \*\*params) -> WARPEditResponse -- client.zero_trust.networks.subnets.warp.get(subnet_id, \*, account_id) -> WARPGetResponse +- client.zero_trust.networks.subnets.warp.edit(subnet_id, \*, account_id, \*\*params) -> Subnet +- client.zero_trust.networks.subnets.warp.get(subnet_id, \*, account_id) -> Subnet #### CloudflareSource -Types: - -```python -from cloudflare.types.zero_trust.networks.subnets import CloudflareSourceUpdateResponse -``` - Methods: -- client.zero_trust.networks.subnets.cloudflare_source.update(address_family, \*, account_id, \*\*params) -> CloudflareSourceUpdateResponse +- client.zero_trust.networks.subnets.cloudflare_source.update(address_family, \*, account_id, \*\*params) -> Subnet ### HostnameRoutes diff --git a/src/cloudflare/resources/zero_trust/networks/subnets/cloudflare_source.py b/src/cloudflare/resources/zero_trust/networks/subnets/cloudflare_source.py index 9245c6df3f9..568a1ac9db7 100644 --- a/src/cloudflare/resources/zero_trust/networks/subnets/cloudflare_source.py +++ b/src/cloudflare/resources/zero_trust/networks/subnets/cloudflare_source.py @@ -20,7 +20,7 @@ from ....._wrappers import ResultWrapper from ....._base_client import make_request_options from .....types.zero_trust.networks.subnets import cloudflare_source_update_params -from .....types.zero_trust.networks.subnets.cloudflare_source_update_response import CloudflareSourceUpdateResponse +from .....types.zero_trust.networks.subnets.subnet import Subnet __all__ = ["CloudflareSourceResource", "AsyncCloudflareSourceResource"] @@ -59,7 +59,7 @@ def update( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, - ) -> CloudflareSourceUpdateResponse: + ) -> Subnet: """ Updates the Cloudflare Source subnet of the given address family @@ -101,9 +101,9 @@ def update( extra_query=extra_query, extra_body=extra_body, timeout=timeout, - post_parser=ResultWrapper[CloudflareSourceUpdateResponse]._unwrapper, + post_parser=ResultWrapper[Subnet]._unwrapper, ), - cast_to=cast(Type[CloudflareSourceUpdateResponse], ResultWrapper[CloudflareSourceUpdateResponse]), + cast_to=cast(Type[Subnet], ResultWrapper[Subnet]), ) @@ -141,7 +141,7 @@ async def update( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, - ) -> CloudflareSourceUpdateResponse: + ) -> Subnet: """ Updates the Cloudflare Source subnet of the given address family @@ -183,9 +183,9 @@ async def update( extra_query=extra_query, extra_body=extra_body, timeout=timeout, - post_parser=ResultWrapper[CloudflareSourceUpdateResponse]._unwrapper, + post_parser=ResultWrapper[Subnet]._unwrapper, ), - cast_to=cast(Type[CloudflareSourceUpdateResponse], ResultWrapper[CloudflareSourceUpdateResponse]), + cast_to=cast(Type[Subnet], ResultWrapper[Subnet]), ) diff --git a/src/cloudflare/resources/zero_trust/networks/subnets/subnets.py b/src/cloudflare/resources/zero_trust/networks/subnets/subnets.py index d723f449966..799ea74893e 100644 --- a/src/cloudflare/resources/zero_trust/networks/subnets/subnets.py +++ b/src/cloudflare/resources/zero_trust/networks/subnets/subnets.py @@ -35,7 +35,7 @@ AsyncCloudflareSourceResourceWithStreamingResponse, ) from .....types.zero_trust.networks import subnet_list_params -from .....types.zero_trust.networks.subnet_list_response import SubnetListResponse +from .....types.zero_trust.networks.subnets.subnet import Subnet __all__ = ["SubnetsResource", "AsyncSubnetsResource"] @@ -89,7 +89,7 @@ def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, - ) -> SyncV4PagePaginationArray[SubnetListResponse]: + ) -> SyncV4PagePaginationArray[Subnet]: """ Lists and filters subnets in an account. @@ -134,7 +134,7 @@ def list( raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get_api_list( f"/accounts/{account_id}/zerotrust/subnets", - page=SyncV4PagePaginationArray[SubnetListResponse], + page=SyncV4PagePaginationArray[Subnet], options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, @@ -157,7 +157,7 @@ def list( subnet_list_params.SubnetListParams, ), ), - model=SubnetListResponse, + model=Subnet, ) @@ -210,7 +210,7 @@ def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, - ) -> AsyncPaginator[SubnetListResponse, AsyncV4PagePaginationArray[SubnetListResponse]]: + ) -> AsyncPaginator[Subnet, AsyncV4PagePaginationArray[Subnet]]: """ Lists and filters subnets in an account. @@ -255,7 +255,7 @@ def list( raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get_api_list( f"/accounts/{account_id}/zerotrust/subnets", - page=AsyncV4PagePaginationArray[SubnetListResponse], + page=AsyncV4PagePaginationArray[Subnet], options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, @@ -278,7 +278,7 @@ def list( subnet_list_params.SubnetListParams, ), ), - model=SubnetListResponse, + model=Subnet, ) diff --git a/src/cloudflare/resources/zero_trust/networks/subnets/warp.py b/src/cloudflare/resources/zero_trust/networks/subnets/warp.py index 79caba44736..fd964d37ac4 100644 --- a/src/cloudflare/resources/zero_trust/networks/subnets/warp.py +++ b/src/cloudflare/resources/zero_trust/networks/subnets/warp.py @@ -19,9 +19,7 @@ from ....._wrappers import ResultWrapper from ....._base_client import make_request_options from .....types.zero_trust.networks.subnets import warp_edit_params, warp_create_params -from .....types.zero_trust.networks.subnets.warp_get_response import WARPGetResponse -from .....types.zero_trust.networks.subnets.warp_edit_response import WARPEditResponse -from .....types.zero_trust.networks.subnets.warp_create_response import WARPCreateResponse +from .....types.zero_trust.networks.subnets.subnet import Subnet from .....types.zero_trust.networks.subnets.warp_delete_response import WARPDeleteResponse __all__ = ["WARPResource", "AsyncWARPResource"] @@ -61,7 +59,7 @@ def create( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, - ) -> WARPCreateResponse: + ) -> Subnet: """Create a WARP IP assignment subnet. Currently, only IPv4 subnets can be created. @@ -114,9 +112,9 @@ def create( extra_query=extra_query, extra_body=extra_body, timeout=timeout, - post_parser=ResultWrapper[WARPCreateResponse]._unwrapper, + post_parser=ResultWrapper[Subnet]._unwrapper, ), - cast_to=cast(Type[WARPCreateResponse], ResultWrapper[WARPCreateResponse]), + cast_to=cast(Type[Subnet], ResultWrapper[Subnet]), ) def delete( @@ -180,7 +178,7 @@ def edit( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, - ) -> WARPEditResponse: + ) -> Subnet: """ Updates a WARP IP assignment subnet. @@ -232,9 +230,9 @@ def edit( extra_query=extra_query, extra_body=extra_body, timeout=timeout, - post_parser=ResultWrapper[WARPEditResponse]._unwrapper, + post_parser=ResultWrapper[Subnet]._unwrapper, ), - cast_to=cast(Type[WARPEditResponse], ResultWrapper[WARPEditResponse]), + cast_to=cast(Type[Subnet], ResultWrapper[Subnet]), ) def get( @@ -248,7 +246,7 @@ def get( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, - ) -> WARPGetResponse: + ) -> Subnet: """ Get a WARP IP assignment subnet. @@ -276,9 +274,9 @@ def get( extra_query=extra_query, extra_body=extra_body, timeout=timeout, - post_parser=ResultWrapper[WARPGetResponse]._unwrapper, + post_parser=ResultWrapper[Subnet]._unwrapper, ), - cast_to=cast(Type[WARPGetResponse], ResultWrapper[WARPGetResponse]), + cast_to=cast(Type[Subnet], ResultWrapper[Subnet]), ) @@ -316,7 +314,7 @@ async def create( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, - ) -> WARPCreateResponse: + ) -> Subnet: """Create a WARP IP assignment subnet. Currently, only IPv4 subnets can be created. @@ -369,9 +367,9 @@ async def create( extra_query=extra_query, extra_body=extra_body, timeout=timeout, - post_parser=ResultWrapper[WARPCreateResponse]._unwrapper, + post_parser=ResultWrapper[Subnet]._unwrapper, ), - cast_to=cast(Type[WARPCreateResponse], ResultWrapper[WARPCreateResponse]), + cast_to=cast(Type[Subnet], ResultWrapper[Subnet]), ) async def delete( @@ -435,7 +433,7 @@ async def edit( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, - ) -> WARPEditResponse: + ) -> Subnet: """ Updates a WARP IP assignment subnet. @@ -487,9 +485,9 @@ async def edit( extra_query=extra_query, extra_body=extra_body, timeout=timeout, - post_parser=ResultWrapper[WARPEditResponse]._unwrapper, + post_parser=ResultWrapper[Subnet]._unwrapper, ), - cast_to=cast(Type[WARPEditResponse], ResultWrapper[WARPEditResponse]), + cast_to=cast(Type[Subnet], ResultWrapper[Subnet]), ) async def get( @@ -503,7 +501,7 @@ async def get( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, - ) -> WARPGetResponse: + ) -> Subnet: """ Get a WARP IP assignment subnet. @@ -531,9 +529,9 @@ async def get( extra_query=extra_query, extra_body=extra_body, timeout=timeout, - post_parser=ResultWrapper[WARPGetResponse]._unwrapper, + post_parser=ResultWrapper[Subnet]._unwrapper, ), - cast_to=cast(Type[WARPGetResponse], ResultWrapper[WARPGetResponse]), + cast_to=cast(Type[Subnet], ResultWrapper[Subnet]), ) diff --git a/src/cloudflare/types/zero_trust/networks/__init__.py b/src/cloudflare/types/zero_trust/networks/__init__.py index 401271d6d2f..0e578a5d991 100644 --- a/src/cloudflare/types/zero_trust/networks/__init__.py +++ b/src/cloudflare/types/zero_trust/networks/__init__.py @@ -10,7 +10,6 @@ from .route_list_params import RouteListParams as RouteListParams from .subnet_list_params import SubnetListParams as SubnetListParams from .route_create_params import RouteCreateParams as RouteCreateParams -from .subnet_list_response import SubnetListResponse as SubnetListResponse from .hostname_route_edit_params import HostnameRouteEditParams as HostnameRouteEditParams from .hostname_route_list_params import HostnameRouteListParams as HostnameRouteListParams from .virtual_network_edit_params import VirtualNetworkEditParams as VirtualNetworkEditParams diff --git a/src/cloudflare/types/zero_trust/networks/subnet_list_response.py b/src/cloudflare/types/zero_trust/networks/subnet_list_response.py deleted file mode 100644 index 4ecca401e28..00000000000 --- a/src/cloudflare/types/zero_trust/networks/subnet_list_response.py +++ /dev/null @@ -1,41 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Optional -from datetime import datetime -from typing_extensions import Literal - -from ...._models import BaseModel - -__all__ = ["SubnetListResponse"] - - -class SubnetListResponse(BaseModel): - id: Optional[str] = None - """The UUID of the subnet.""" - - comment: Optional[str] = None - """An optional description of the subnet.""" - - created_at: Optional[datetime] = None - """Timestamp of when the resource was created.""" - - deleted_at: Optional[datetime] = None - """Timestamp of when the resource was deleted. - - If `null`, the resource has not been deleted. - """ - - is_default_network: Optional[bool] = None - """If `true`, this is the default subnet for the account. - - There can only be one default subnet per account. - """ - - name: Optional[str] = None - """A user-friendly name for the subnet.""" - - network: Optional[str] = None - """The private IPv4 or IPv6 range defining the subnet, in CIDR notation.""" - - subnet_type: Optional[Literal["cloudflare_source", "warp"]] = None - """The type of subnet.""" diff --git a/src/cloudflare/types/zero_trust/networks/subnets/__init__.py b/src/cloudflare/types/zero_trust/networks/subnets/__init__.py index 5c47375b355..aca9235366d 100644 --- a/src/cloudflare/types/zero_trust/networks/subnets/__init__.py +++ b/src/cloudflare/types/zero_trust/networks/subnets/__init__.py @@ -2,11 +2,8 @@ from __future__ import annotations +from .subnet import Subnet as Subnet from .warp_edit_params import WARPEditParams as WARPEditParams -from .warp_get_response import WARPGetResponse as WARPGetResponse from .warp_create_params import WARPCreateParams as WARPCreateParams -from .warp_edit_response import WARPEditResponse as WARPEditResponse -from .warp_create_response import WARPCreateResponse as WARPCreateResponse from .warp_delete_response import WARPDeleteResponse as WARPDeleteResponse from .cloudflare_source_update_params import CloudflareSourceUpdateParams as CloudflareSourceUpdateParams -from .cloudflare_source_update_response import CloudflareSourceUpdateResponse as CloudflareSourceUpdateResponse diff --git a/src/cloudflare/types/zero_trust/networks/subnets/cloudflare_source_update_response.py b/src/cloudflare/types/zero_trust/networks/subnets/cloudflare_source_update_response.py deleted file mode 100644 index 37f881d9a97..00000000000 --- a/src/cloudflare/types/zero_trust/networks/subnets/cloudflare_source_update_response.py +++ /dev/null @@ -1,41 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Optional -from datetime import datetime -from typing_extensions import Literal - -from ....._models import BaseModel - -__all__ = ["CloudflareSourceUpdateResponse"] - - -class CloudflareSourceUpdateResponse(BaseModel): - id: Optional[str] = None - """The UUID of the subnet.""" - - comment: Optional[str] = None - """An optional description of the subnet.""" - - created_at: Optional[datetime] = None - """Timestamp of when the resource was created.""" - - deleted_at: Optional[datetime] = None - """Timestamp of when the resource was deleted. - - If `null`, the resource has not been deleted. - """ - - is_default_network: Optional[bool] = None - """If `true`, this is the default subnet for the account. - - There can only be one default subnet per account. - """ - - name: Optional[str] = None - """A user-friendly name for the subnet.""" - - network: Optional[str] = None - """The private IPv4 or IPv6 range defining the subnet, in CIDR notation.""" - - subnet_type: Optional[Literal["cloudflare_source", "warp"]] = None - """The type of subnet.""" diff --git a/src/cloudflare/types/zero_trust/networks/subnets/warp_get_response.py b/src/cloudflare/types/zero_trust/networks/subnets/subnet.py similarity index 94% rename from src/cloudflare/types/zero_trust/networks/subnets/warp_get_response.py rename to src/cloudflare/types/zero_trust/networks/subnets/subnet.py index efaafd465a5..b2be84028dd 100644 --- a/src/cloudflare/types/zero_trust/networks/subnets/warp_get_response.py +++ b/src/cloudflare/types/zero_trust/networks/subnets/subnet.py @@ -6,10 +6,10 @@ from ....._models import BaseModel -__all__ = ["WARPGetResponse"] +__all__ = ["Subnet"] -class WARPGetResponse(BaseModel): +class Subnet(BaseModel): id: Optional[str] = None """The UUID of the subnet.""" diff --git a/src/cloudflare/types/zero_trust/networks/subnets/warp_create_response.py b/src/cloudflare/types/zero_trust/networks/subnets/warp_create_response.py deleted file mode 100644 index c4ae8abfb42..00000000000 --- a/src/cloudflare/types/zero_trust/networks/subnets/warp_create_response.py +++ /dev/null @@ -1,41 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Optional -from datetime import datetime -from typing_extensions import Literal - -from ....._models import BaseModel - -__all__ = ["WARPCreateResponse"] - - -class WARPCreateResponse(BaseModel): - id: Optional[str] = None - """The UUID of the subnet.""" - - comment: Optional[str] = None - """An optional description of the subnet.""" - - created_at: Optional[datetime] = None - """Timestamp of when the resource was created.""" - - deleted_at: Optional[datetime] = None - """Timestamp of when the resource was deleted. - - If `null`, the resource has not been deleted. - """ - - is_default_network: Optional[bool] = None - """If `true`, this is the default subnet for the account. - - There can only be one default subnet per account. - """ - - name: Optional[str] = None - """A user-friendly name for the subnet.""" - - network: Optional[str] = None - """The private IPv4 or IPv6 range defining the subnet, in CIDR notation.""" - - subnet_type: Optional[Literal["cloudflare_source", "warp"]] = None - """The type of subnet.""" diff --git a/src/cloudflare/types/zero_trust/networks/subnets/warp_edit_response.py b/src/cloudflare/types/zero_trust/networks/subnets/warp_edit_response.py deleted file mode 100644 index b976b41f832..00000000000 --- a/src/cloudflare/types/zero_trust/networks/subnets/warp_edit_response.py +++ /dev/null @@ -1,41 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Optional -from datetime import datetime -from typing_extensions import Literal - -from ....._models import BaseModel - -__all__ = ["WARPEditResponse"] - - -class WARPEditResponse(BaseModel): - id: Optional[str] = None - """The UUID of the subnet.""" - - comment: Optional[str] = None - """An optional description of the subnet.""" - - created_at: Optional[datetime] = None - """Timestamp of when the resource was created.""" - - deleted_at: Optional[datetime] = None - """Timestamp of when the resource was deleted. - - If `null`, the resource has not been deleted. - """ - - is_default_network: Optional[bool] = None - """If `true`, this is the default subnet for the account. - - There can only be one default subnet per account. - """ - - name: Optional[str] = None - """A user-friendly name for the subnet.""" - - network: Optional[str] = None - """The private IPv4 or IPv6 range defining the subnet, in CIDR notation.""" - - subnet_type: Optional[Literal["cloudflare_source", "warp"]] = None - """The type of subnet.""" diff --git a/tests/api_resources/zero_trust/networks/subnets/test_cloudflare_source.py b/tests/api_resources/zero_trust/networks/subnets/test_cloudflare_source.py index 27a5af44aad..405bb8a55b0 100644 --- a/tests/api_resources/zero_trust/networks/subnets/test_cloudflare_source.py +++ b/tests/api_resources/zero_trust/networks/subnets/test_cloudflare_source.py @@ -9,7 +9,7 @@ from cloudflare import Cloudflare, AsyncCloudflare from tests.utils import assert_matches_type -from cloudflare.types.zero_trust.networks.subnets import CloudflareSourceUpdateResponse +from cloudflare.types.zero_trust.networks.subnets import Subnet base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") @@ -23,7 +23,7 @@ def test_method_update(self, client: Cloudflare) -> None: address_family="v4", account_id="699d98642c564d2e855e9661899b7252", ) - assert_matches_type(CloudflareSourceUpdateResponse, cloudflare_source, path=["response"]) + assert_matches_type(Subnet, cloudflare_source, path=["response"]) @parametrize def test_method_update_with_all_params(self, client: Cloudflare) -> None: @@ -34,7 +34,7 @@ def test_method_update_with_all_params(self, client: Cloudflare) -> None: name="IPv4 Cloudflare Source IPs", network="100.64.0.0/12", ) - assert_matches_type(CloudflareSourceUpdateResponse, cloudflare_source, path=["response"]) + assert_matches_type(Subnet, cloudflare_source, path=["response"]) @parametrize def test_raw_response_update(self, client: Cloudflare) -> None: @@ -46,7 +46,7 @@ def test_raw_response_update(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" cloudflare_source = response.parse() - assert_matches_type(CloudflareSourceUpdateResponse, cloudflare_source, path=["response"]) + assert_matches_type(Subnet, cloudflare_source, path=["response"]) @parametrize def test_streaming_response_update(self, client: Cloudflare) -> None: @@ -58,7 +58,7 @@ def test_streaming_response_update(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" cloudflare_source = response.parse() - assert_matches_type(CloudflareSourceUpdateResponse, cloudflare_source, path=["response"]) + assert_matches_type(Subnet, cloudflare_source, path=["response"]) assert cast(Any, response.is_closed) is True @@ -82,7 +82,7 @@ async def test_method_update(self, async_client: AsyncCloudflare) -> None: address_family="v4", account_id="699d98642c564d2e855e9661899b7252", ) - assert_matches_type(CloudflareSourceUpdateResponse, cloudflare_source, path=["response"]) + assert_matches_type(Subnet, cloudflare_source, path=["response"]) @parametrize async def test_method_update_with_all_params(self, async_client: AsyncCloudflare) -> None: @@ -93,7 +93,7 @@ async def test_method_update_with_all_params(self, async_client: AsyncCloudflare name="IPv4 Cloudflare Source IPs", network="100.64.0.0/12", ) - assert_matches_type(CloudflareSourceUpdateResponse, cloudflare_source, path=["response"]) + assert_matches_type(Subnet, cloudflare_source, path=["response"]) @parametrize async def test_raw_response_update(self, async_client: AsyncCloudflare) -> None: @@ -105,7 +105,7 @@ async def test_raw_response_update(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" cloudflare_source = await response.parse() - assert_matches_type(CloudflareSourceUpdateResponse, cloudflare_source, path=["response"]) + assert_matches_type(Subnet, cloudflare_source, path=["response"]) @parametrize async def test_streaming_response_update(self, async_client: AsyncCloudflare) -> None: @@ -117,7 +117,7 @@ async def test_streaming_response_update(self, async_client: AsyncCloudflare) -> assert response.http_request.headers.get("X-Stainless-Lang") == "python" cloudflare_source = await response.parse() - assert_matches_type(CloudflareSourceUpdateResponse, cloudflare_source, path=["response"]) + assert_matches_type(Subnet, cloudflare_source, path=["response"]) assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/zero_trust/networks/subnets/test_warp.py b/tests/api_resources/zero_trust/networks/subnets/test_warp.py index b016142f108..29f3796c73f 100644 --- a/tests/api_resources/zero_trust/networks/subnets/test_warp.py +++ b/tests/api_resources/zero_trust/networks/subnets/test_warp.py @@ -10,9 +10,7 @@ from cloudflare import Cloudflare, AsyncCloudflare from tests.utils import assert_matches_type from cloudflare.types.zero_trust.networks.subnets import ( - WARPGetResponse, - WARPEditResponse, - WARPCreateResponse, + Subnet, WARPDeleteResponse, ) @@ -29,7 +27,7 @@ def test_method_create(self, client: Cloudflare) -> None: name="IPv4 Cloudflare Source IPs", network="100.64.0.0/12", ) - assert_matches_type(WARPCreateResponse, warp, path=["response"]) + assert_matches_type(Subnet, warp, path=["response"]) @parametrize def test_method_create_with_all_params(self, client: Cloudflare) -> None: @@ -40,7 +38,7 @@ def test_method_create_with_all_params(self, client: Cloudflare) -> None: comment="example comment", is_default_network=True, ) - assert_matches_type(WARPCreateResponse, warp, path=["response"]) + assert_matches_type(Subnet, warp, path=["response"]) @parametrize def test_raw_response_create(self, client: Cloudflare) -> None: @@ -53,7 +51,7 @@ def test_raw_response_create(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" warp = response.parse() - assert_matches_type(WARPCreateResponse, warp, path=["response"]) + assert_matches_type(Subnet, warp, path=["response"]) @parametrize def test_streaming_response_create(self, client: Cloudflare) -> None: @@ -66,7 +64,7 @@ def test_streaming_response_create(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" warp = response.parse() - assert_matches_type(WARPCreateResponse, warp, path=["response"]) + assert_matches_type(Subnet, warp, path=["response"]) assert cast(Any, response.is_closed) is True @@ -133,7 +131,7 @@ def test_method_edit(self, client: Cloudflare) -> None: subnet_id="f70ff985-a4ef-4643-bbbc-4a0ed4fc8415", account_id="699d98642c564d2e855e9661899b7252", ) - assert_matches_type(WARPEditResponse, warp, path=["response"]) + assert_matches_type(Subnet, warp, path=["response"]) @parametrize def test_method_edit_with_all_params(self, client: Cloudflare) -> None: @@ -145,7 +143,7 @@ def test_method_edit_with_all_params(self, client: Cloudflare) -> None: name="IPv4 Cloudflare Source IPs", network="100.64.0.0/12", ) - assert_matches_type(WARPEditResponse, warp, path=["response"]) + assert_matches_type(Subnet, warp, path=["response"]) @parametrize def test_raw_response_edit(self, client: Cloudflare) -> None: @@ -157,7 +155,7 @@ def test_raw_response_edit(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" warp = response.parse() - assert_matches_type(WARPEditResponse, warp, path=["response"]) + assert_matches_type(Subnet, warp, path=["response"]) @parametrize def test_streaming_response_edit(self, client: Cloudflare) -> None: @@ -169,7 +167,7 @@ def test_streaming_response_edit(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" warp = response.parse() - assert_matches_type(WARPEditResponse, warp, path=["response"]) + assert_matches_type(Subnet, warp, path=["response"]) assert cast(Any, response.is_closed) is True @@ -193,7 +191,7 @@ def test_method_get(self, client: Cloudflare) -> None: subnet_id="f70ff985-a4ef-4643-bbbc-4a0ed4fc8415", account_id="699d98642c564d2e855e9661899b7252", ) - assert_matches_type(WARPGetResponse, warp, path=["response"]) + assert_matches_type(Subnet, warp, path=["response"]) @parametrize def test_raw_response_get(self, client: Cloudflare) -> None: @@ -205,7 +203,7 @@ def test_raw_response_get(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" warp = response.parse() - assert_matches_type(WARPGetResponse, warp, path=["response"]) + assert_matches_type(Subnet, warp, path=["response"]) @parametrize def test_streaming_response_get(self, client: Cloudflare) -> None: @@ -217,7 +215,7 @@ def test_streaming_response_get(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" warp = response.parse() - assert_matches_type(WARPGetResponse, warp, path=["response"]) + assert_matches_type(Subnet, warp, path=["response"]) assert cast(Any, response.is_closed) is True @@ -248,7 +246,7 @@ async def test_method_create(self, async_client: AsyncCloudflare) -> None: name="IPv4 Cloudflare Source IPs", network="100.64.0.0/12", ) - assert_matches_type(WARPCreateResponse, warp, path=["response"]) + assert_matches_type(Subnet, warp, path=["response"]) @parametrize async def test_method_create_with_all_params(self, async_client: AsyncCloudflare) -> None: @@ -259,7 +257,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncCloudflare comment="example comment", is_default_network=True, ) - assert_matches_type(WARPCreateResponse, warp, path=["response"]) + assert_matches_type(Subnet, warp, path=["response"]) @parametrize async def test_raw_response_create(self, async_client: AsyncCloudflare) -> None: @@ -272,7 +270,7 @@ async def test_raw_response_create(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" warp = await response.parse() - assert_matches_type(WARPCreateResponse, warp, path=["response"]) + assert_matches_type(Subnet, warp, path=["response"]) @parametrize async def test_streaming_response_create(self, async_client: AsyncCloudflare) -> None: @@ -285,7 +283,7 @@ async def test_streaming_response_create(self, async_client: AsyncCloudflare) -> assert response.http_request.headers.get("X-Stainless-Lang") == "python" warp = await response.parse() - assert_matches_type(WARPCreateResponse, warp, path=["response"]) + assert_matches_type(Subnet, warp, path=["response"]) assert cast(Any, response.is_closed) is True @@ -352,7 +350,7 @@ async def test_method_edit(self, async_client: AsyncCloudflare) -> None: subnet_id="f70ff985-a4ef-4643-bbbc-4a0ed4fc8415", account_id="699d98642c564d2e855e9661899b7252", ) - assert_matches_type(WARPEditResponse, warp, path=["response"]) + assert_matches_type(Subnet, warp, path=["response"]) @parametrize async def test_method_edit_with_all_params(self, async_client: AsyncCloudflare) -> None: @@ -364,7 +362,7 @@ async def test_method_edit_with_all_params(self, async_client: AsyncCloudflare) name="IPv4 Cloudflare Source IPs", network="100.64.0.0/12", ) - assert_matches_type(WARPEditResponse, warp, path=["response"]) + assert_matches_type(Subnet, warp, path=["response"]) @parametrize async def test_raw_response_edit(self, async_client: AsyncCloudflare) -> None: @@ -376,7 +374,7 @@ async def test_raw_response_edit(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" warp = await response.parse() - assert_matches_type(WARPEditResponse, warp, path=["response"]) + assert_matches_type(Subnet, warp, path=["response"]) @parametrize async def test_streaming_response_edit(self, async_client: AsyncCloudflare) -> None: @@ -388,7 +386,7 @@ async def test_streaming_response_edit(self, async_client: AsyncCloudflare) -> N assert response.http_request.headers.get("X-Stainless-Lang") == "python" warp = await response.parse() - assert_matches_type(WARPEditResponse, warp, path=["response"]) + assert_matches_type(Subnet, warp, path=["response"]) assert cast(Any, response.is_closed) is True @@ -412,7 +410,7 @@ async def test_method_get(self, async_client: AsyncCloudflare) -> None: subnet_id="f70ff985-a4ef-4643-bbbc-4a0ed4fc8415", account_id="699d98642c564d2e855e9661899b7252", ) - assert_matches_type(WARPGetResponse, warp, path=["response"]) + assert_matches_type(Subnet, warp, path=["response"]) @parametrize async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: @@ -424,7 +422,7 @@ async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" warp = await response.parse() - assert_matches_type(WARPGetResponse, warp, path=["response"]) + assert_matches_type(Subnet, warp, path=["response"]) @parametrize async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> None: @@ -436,7 +434,7 @@ async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> No assert response.http_request.headers.get("X-Stainless-Lang") == "python" warp = await response.parse() - assert_matches_type(WARPGetResponse, warp, path=["response"]) + assert_matches_type(Subnet, warp, path=["response"]) assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/zero_trust/networks/test_subnets.py b/tests/api_resources/zero_trust/networks/test_subnets.py index e8d64025ff2..32c510f6f0b 100644 --- a/tests/api_resources/zero_trust/networks/test_subnets.py +++ b/tests/api_resources/zero_trust/networks/test_subnets.py @@ -10,7 +10,7 @@ from cloudflare import Cloudflare, AsyncCloudflare from tests.utils import assert_matches_type from cloudflare.pagination import SyncV4PagePaginationArray, AsyncV4PagePaginationArray -from cloudflare.types.zero_trust.networks import SubnetListResponse +from cloudflare.types.zero_trust.networks.subnets import Subnet base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") @@ -23,7 +23,7 @@ def test_method_list(self, client: Cloudflare) -> None: subnet = client.zero_trust.networks.subnets.list( account_id="699d98642c564d2e855e9661899b7252", ) - assert_matches_type(SyncV4PagePaginationArray[SubnetListResponse], subnet, path=["response"]) + assert_matches_type(SyncV4PagePaginationArray[Subnet], subnet, path=["response"]) @parametrize def test_method_list_with_all_params(self, client: Cloudflare) -> None: @@ -41,7 +41,7 @@ def test_method_list_with_all_params(self, client: Cloudflare) -> None: sort_order="asc", subnet_types="cloudflare_source", ) - assert_matches_type(SyncV4PagePaginationArray[SubnetListResponse], subnet, path=["response"]) + assert_matches_type(SyncV4PagePaginationArray[Subnet], subnet, path=["response"]) @parametrize def test_raw_response_list(self, client: Cloudflare) -> None: @@ -52,7 +52,7 @@ def test_raw_response_list(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" subnet = response.parse() - assert_matches_type(SyncV4PagePaginationArray[SubnetListResponse], subnet, path=["response"]) + assert_matches_type(SyncV4PagePaginationArray[Subnet], subnet, path=["response"]) @parametrize def test_streaming_response_list(self, client: Cloudflare) -> None: @@ -63,7 +63,7 @@ def test_streaming_response_list(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" subnet = response.parse() - assert_matches_type(SyncV4PagePaginationArray[SubnetListResponse], subnet, path=["response"]) + assert_matches_type(SyncV4PagePaginationArray[Subnet], subnet, path=["response"]) assert cast(Any, response.is_closed) is True @@ -85,7 +85,7 @@ async def test_method_list(self, async_client: AsyncCloudflare) -> None: subnet = await async_client.zero_trust.networks.subnets.list( account_id="699d98642c564d2e855e9661899b7252", ) - assert_matches_type(AsyncV4PagePaginationArray[SubnetListResponse], subnet, path=["response"]) + assert_matches_type(AsyncV4PagePaginationArray[Subnet], subnet, path=["response"]) @parametrize async def test_method_list_with_all_params(self, async_client: AsyncCloudflare) -> None: @@ -103,7 +103,7 @@ async def test_method_list_with_all_params(self, async_client: AsyncCloudflare) sort_order="asc", subnet_types="cloudflare_source", ) - assert_matches_type(AsyncV4PagePaginationArray[SubnetListResponse], subnet, path=["response"]) + assert_matches_type(AsyncV4PagePaginationArray[Subnet], subnet, path=["response"]) @parametrize async def test_raw_response_list(self, async_client: AsyncCloudflare) -> None: @@ -114,7 +114,7 @@ async def test_raw_response_list(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" subnet = await response.parse() - assert_matches_type(AsyncV4PagePaginationArray[SubnetListResponse], subnet, path=["response"]) + assert_matches_type(AsyncV4PagePaginationArray[Subnet], subnet, path=["response"]) @parametrize async def test_streaming_response_list(self, async_client: AsyncCloudflare) -> None: @@ -125,7 +125,7 @@ async def test_streaming_response_list(self, async_client: AsyncCloudflare) -> N assert response.http_request.headers.get("X-Stainless-Lang") == "python" subnet = await response.parse() - assert_matches_type(AsyncV4PagePaginationArray[SubnetListResponse], subnet, path=["response"]) + assert_matches_type(AsyncV4PagePaginationArray[Subnet], subnet, path=["response"]) assert cast(Any, response.is_closed) is True From fe2b21d02c0cd4ecbf5216714907cfb95f374083 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 5 Mar 2026 00:35:42 +0000 Subject: [PATCH 052/279] feat: feat(ip_profile): onboard new terraform resource cloudflare_zero_trust_device_ip_profile * feat(ip_profile): onboard new terraform resource cloudflare_zero_trust_device_ip_profile * feat(ip_profile): onboard new terraform resource cloudflare_zero_trust_device_ip_profile --- .stats.yml | 4 +- api.md | 16 + .../resources/zero_trust/devices/__init__.py | 14 + .../resources/zero_trust/devices/devices.py | 32 + .../zero_trust/devices/ip_profiles.py | 692 ++++++++++++++++++ .../types/zero_trust/devices/__init__.py | 5 + .../types/zero_trust/devices/ip_profile.py | 44 ++ .../devices/ip_profile_create_params.py | 38 + .../devices/ip_profile_delete_response.py | 12 + .../devices/ip_profile_list_params.py | 14 + .../devices/ip_profile_update_params.py | 37 + .../zero_trust/devices/test_ip_profiles.py | 570 +++++++++++++++ 12 files changed, 1476 insertions(+), 2 deletions(-) create mode 100644 src/cloudflare/resources/zero_trust/devices/ip_profiles.py create mode 100644 src/cloudflare/types/zero_trust/devices/ip_profile.py create mode 100644 src/cloudflare/types/zero_trust/devices/ip_profile_create_params.py create mode 100644 src/cloudflare/types/zero_trust/devices/ip_profile_delete_response.py create mode 100644 src/cloudflare/types/zero_trust/devices/ip_profile_list_params.py create mode 100644 src/cloudflare/types/zero_trust/devices/ip_profile_update_params.py create mode 100644 tests/api_resources/zero_trust/devices/test_ip_profiles.py diff --git a/.stats.yml b/.stats.yml index e454ea14a72..abfd2fbdca7 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ -configured_endpoints: 2045 +configured_endpoints: 2050 openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-9ba099b7936091cc984d2a24fc4d32c3ffcb1d71d86412c8c9084d201e16b3ac.yml openapi_spec_hash: 45edc9a107cf5a5e3b204b230b0d336d -config_hash: 7d51f0daff6082e6eef983fe5a1bcfef +config_hash: 082014e766adf9596cfb12f88a73329a diff --git a/api.md b/api.md index dd8b3a32371..3ddbf724f9b 100644 --- a/api.md +++ b/api.md @@ -5637,6 +5637,22 @@ Methods: - client.zero_trust.devices.dex_tests.delete(dex_test_id, \*, account_id) -> Optional[DEXTestDeleteResponse] - client.zero_trust.devices.dex_tests.get(dex_test_id, \*, account_id) -> Optional[DEXTestGetResponse] +### IPProfiles + +Types: + +```python +from cloudflare.types.zero_trust.devices import IPProfile, IPProfileDeleteResponse +``` + +Methods: + +- client.zero_trust.devices.ip_profiles.create(\*, account_id, \*\*params) -> IPProfile +- client.zero_trust.devices.ip_profiles.update(profile_id, \*, account_id, \*\*params) -> IPProfile +- client.zero_trust.devices.ip_profiles.list(\*, account_id, \*\*params) -> SyncSinglePage[IPProfile] +- client.zero_trust.devices.ip_profiles.delete(profile_id, \*, account_id) -> IPProfileDeleteResponse +- client.zero_trust.devices.ip_profiles.get(profile_id, \*, account_id) -> IPProfile + ### Networks Types: diff --git a/src/cloudflare/resources/zero_trust/devices/__init__.py b/src/cloudflare/resources/zero_trust/devices/__init__.py index b3bd5980ce4..a3579f08c06 100644 --- a/src/cloudflare/resources/zero_trust/devices/__init__.py +++ b/src/cloudflare/resources/zero_trust/devices/__init__.py @@ -72,6 +72,14 @@ ResilienceResourceWithStreamingResponse, AsyncResilienceResourceWithStreamingResponse, ) +from .ip_profiles import ( + IPProfilesResource, + AsyncIPProfilesResource, + IPProfilesResourceWithRawResponse, + AsyncIPProfilesResourceWithRawResponse, + IPProfilesResourceWithStreamingResponse, + AsyncIPProfilesResourceWithStreamingResponse, +) from .fleet_status import ( FleetStatusResource, AsyncFleetStatusResource, @@ -116,6 +124,12 @@ "AsyncDEXTestsResourceWithRawResponse", "DEXTestsResourceWithStreamingResponse", "AsyncDEXTestsResourceWithStreamingResponse", + "IPProfilesResource", + "AsyncIPProfilesResource", + "IPProfilesResourceWithRawResponse", + "AsyncIPProfilesResourceWithRawResponse", + "IPProfilesResourceWithStreamingResponse", + "AsyncIPProfilesResourceWithStreamingResponse", "NetworksResource", "AsyncNetworksResource", "NetworksResourceWithRawResponse", diff --git a/src/cloudflare/resources/zero_trust/devices/devices.py b/src/cloudflare/resources/zero_trust/devices/devices.py index ce53ece99fb..0127c723960 100644 --- a/src/cloudflare/resources/zero_trust/devices/devices.py +++ b/src/cloudflare/resources/zero_trust/devices/devices.py @@ -50,6 +50,14 @@ AsyncDEXTestsResourceWithStreamingResponse, ) from ...._compat import cached_property +from .ip_profiles import ( + IPProfilesResource, + AsyncIPProfilesResource, + IPProfilesResourceWithRawResponse, + AsyncIPProfilesResourceWithRawResponse, + IPProfilesResourceWithStreamingResponse, + AsyncIPProfilesResourceWithStreamingResponse, +) from ...._resource import SyncAPIResource, AsyncAPIResource from ...._response import ( to_raw_response_wrapper, @@ -131,6 +139,10 @@ def registrations(self) -> RegistrationsResource: def dex_tests(self) -> DEXTestsResource: return DEXTestsResource(self._client) + @cached_property + def ip_profiles(self) -> IPProfilesResource: + return IPProfilesResource(self._client) + @cached_property def networks(self) -> NetworksResource: return NetworksResource(self._client) @@ -295,6 +307,10 @@ def registrations(self) -> AsyncRegistrationsResource: def dex_tests(self) -> AsyncDEXTestsResource: return AsyncDEXTestsResource(self._client) + @cached_property + def ip_profiles(self) -> AsyncIPProfilesResource: + return AsyncIPProfilesResource(self._client) + @cached_property def networks(self) -> AsyncNetworksResource: return AsyncNetworksResource(self._client) @@ -473,6 +489,10 @@ def registrations(self) -> RegistrationsResourceWithRawResponse: def dex_tests(self) -> DEXTestsResourceWithRawResponse: return DEXTestsResourceWithRawResponse(self._devices.dex_tests) + @cached_property + def ip_profiles(self) -> IPProfilesResourceWithRawResponse: + return IPProfilesResourceWithRawResponse(self._devices.ip_profiles) + @cached_property def networks(self) -> NetworksResourceWithRawResponse: return NetworksResourceWithRawResponse(self._devices.networks) @@ -537,6 +557,10 @@ def registrations(self) -> AsyncRegistrationsResourceWithRawResponse: def dex_tests(self) -> AsyncDEXTestsResourceWithRawResponse: return AsyncDEXTestsResourceWithRawResponse(self._devices.dex_tests) + @cached_property + def ip_profiles(self) -> AsyncIPProfilesResourceWithRawResponse: + return AsyncIPProfilesResourceWithRawResponse(self._devices.ip_profiles) + @cached_property def networks(self) -> AsyncNetworksResourceWithRawResponse: return AsyncNetworksResourceWithRawResponse(self._devices.networks) @@ -601,6 +625,10 @@ def registrations(self) -> RegistrationsResourceWithStreamingResponse: def dex_tests(self) -> DEXTestsResourceWithStreamingResponse: return DEXTestsResourceWithStreamingResponse(self._devices.dex_tests) + @cached_property + def ip_profiles(self) -> IPProfilesResourceWithStreamingResponse: + return IPProfilesResourceWithStreamingResponse(self._devices.ip_profiles) + @cached_property def networks(self) -> NetworksResourceWithStreamingResponse: return NetworksResourceWithStreamingResponse(self._devices.networks) @@ -665,6 +693,10 @@ def registrations(self) -> AsyncRegistrationsResourceWithStreamingResponse: def dex_tests(self) -> AsyncDEXTestsResourceWithStreamingResponse: return AsyncDEXTestsResourceWithStreamingResponse(self._devices.dex_tests) + @cached_property + def ip_profiles(self) -> AsyncIPProfilesResourceWithStreamingResponse: + return AsyncIPProfilesResourceWithStreamingResponse(self._devices.ip_profiles) + @cached_property def networks(self) -> AsyncNetworksResourceWithStreamingResponse: return AsyncNetworksResourceWithStreamingResponse(self._devices.networks) diff --git a/src/cloudflare/resources/zero_trust/devices/ip_profiles.py b/src/cloudflare/resources/zero_trust/devices/ip_profiles.py new file mode 100644 index 00000000000..413013cd2f0 --- /dev/null +++ b/src/cloudflare/resources/zero_trust/devices/ip_profiles.py @@ -0,0 +1,692 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Type, Optional, cast + +import httpx + +from ...._types import Body, Omit, Query, Headers, NotGiven, omit, not_given +from ...._utils import maybe_transform, async_maybe_transform +from ...._compat import cached_property +from ...._resource import SyncAPIResource, AsyncAPIResource +from ...._response import ( + to_raw_response_wrapper, + to_streamed_response_wrapper, + 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.zero_trust.devices import ip_profile_list_params, ip_profile_create_params, ip_profile_update_params +from ....types.zero_trust.devices.ip_profile import IPProfile +from ....types.zero_trust.devices.ip_profile_delete_response import IPProfileDeleteResponse + +__all__ = ["IPProfilesResource", "AsyncIPProfilesResource"] + + +class IPProfilesResource(SyncAPIResource): + @cached_property + def with_raw_response(self) -> IPProfilesResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers + """ + return IPProfilesResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> IPProfilesResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/cloudflare/cloudflare-python#with_streaming_response + """ + return IPProfilesResourceWithStreamingResponse(self) + + def create( + self, + *, + account_id: str, + match: str, + name: str, + precedence: int, + subnet_id: str, + description: Optional[str] | Omit = omit, + enabled: 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, + ) -> IPProfile: + """Creates a WARP Device IP profile. + + Currently, only IPv4 Device subnets can be + associated. + + Args: + match: + The wirefilter expression to match registrations. Available values: + "identity.name", "identity.email", "identity.groups.id", "identity.groups.name", + "identity.groups.email", "identity.saml_attributes". + + name: A user-friendly name for the Device IP profile. + + precedence: The precedence of the Device IP profile. Lower values indicate higher + precedence. Device IP profile will be evaluated in ascending order of this + field. + + subnet_id: The ID of the Subnet. + + description: An optional description of the Device IP profile. + + enabled: Whether the Device IP profile will be applied to matching devices. + + 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._post( + f"/accounts/{account_id}/devices/ip-profiles", + body=maybe_transform( + { + "match": match, + "name": name, + "precedence": precedence, + "subnet_id": subnet_id, + "description": description, + "enabled": enabled, + }, + ip_profile_create_params.IPProfileCreateParams, + ), + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + post_parser=ResultWrapper[IPProfile]._unwrapper, + ), + cast_to=cast(Type[IPProfile], ResultWrapper[IPProfile]), + ) + + def update( + self, + profile_id: str, + *, + account_id: str, + description: str | Omit = omit, + enabled: bool | Omit = omit, + match: str | Omit = omit, + name: str | Omit = omit, + precedence: int | Omit = omit, + subnet_id: str | 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, + ) -> IPProfile: + """Updates a WARP Device IP profile. + + Currently, only IPv4 Device subnets can be + associated. + + Args: + description: An optional description of the Device IP profile. + + enabled: Whether the Device IP profile is enabled. + + match: + The wirefilter expression to match registrations. Available values: + "identity.name", "identity.email", "identity.groups.id", "identity.groups.name", + "identity.groups.email", "identity.saml_attributes". + + name: A user-friendly name for the Device IP profile. + + precedence: The precedence of the Device IP profile. Lower values indicate higher + precedence. Device IP profile will be evaluated in ascending order of this + field. + + subnet_id: The ID of the Subnet. + + 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 profile_id: + raise ValueError(f"Expected a non-empty value for `profile_id` but received {profile_id!r}") + return self._patch( + f"/accounts/{account_id}/devices/ip-profiles/{profile_id}", + body=maybe_transform( + { + "description": description, + "enabled": enabled, + "match": match, + "name": name, + "precedence": precedence, + "subnet_id": subnet_id, + }, + ip_profile_update_params.IPProfileUpdateParams, + ), + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + post_parser=ResultWrapper[IPProfile]._unwrapper, + ), + cast_to=cast(Type[IPProfile], ResultWrapper[IPProfile]), + ) + + def list( + self, + *, + account_id: str, + per_page: int | 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, + ) -> SyncSinglePage[IPProfile]: + """ + Lists WARP Device IP profiles. + + Args: + per_page: The number of IP profiles to return per page. + + 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( + f"/accounts/{account_id}/devices/ip-profiles", + page=SyncSinglePage[IPProfile], + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=maybe_transform({"per_page": per_page}, ip_profile_list_params.IPProfileListParams), + ), + model=IPProfile, + ) + + def delete( + self, + profile_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, + ) -> IPProfileDeleteResponse: + """ + Delete a WARP Device IP profile. + + Args: + 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 profile_id: + raise ValueError(f"Expected a non-empty value for `profile_id` but received {profile_id!r}") + return self._delete( + f"/accounts/{account_id}/devices/ip-profiles/{profile_id}", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + post_parser=ResultWrapper[IPProfileDeleteResponse]._unwrapper, + ), + cast_to=cast(Type[IPProfileDeleteResponse], ResultWrapper[IPProfileDeleteResponse]), + ) + + def get( + self, + profile_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, + ) -> IPProfile: + """ + Fetches a single WARP Device IP profile. + + Args: + 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 profile_id: + raise ValueError(f"Expected a non-empty value for `profile_id` but received {profile_id!r}") + return self._get( + f"/accounts/{account_id}/devices/ip-profiles/{profile_id}", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + post_parser=ResultWrapper[IPProfile]._unwrapper, + ), + cast_to=cast(Type[IPProfile], ResultWrapper[IPProfile]), + ) + + +class AsyncIPProfilesResource(AsyncAPIResource): + @cached_property + def with_raw_response(self) -> AsyncIPProfilesResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers + """ + return AsyncIPProfilesResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> AsyncIPProfilesResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/cloudflare/cloudflare-python#with_streaming_response + """ + return AsyncIPProfilesResourceWithStreamingResponse(self) + + async def create( + self, + *, + account_id: str, + match: str, + name: str, + precedence: int, + subnet_id: str, + description: Optional[str] | Omit = omit, + enabled: 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, + ) -> IPProfile: + """Creates a WARP Device IP profile. + + Currently, only IPv4 Device subnets can be + associated. + + Args: + match: + The wirefilter expression to match registrations. Available values: + "identity.name", "identity.email", "identity.groups.id", "identity.groups.name", + "identity.groups.email", "identity.saml_attributes". + + name: A user-friendly name for the Device IP profile. + + precedence: The precedence of the Device IP profile. Lower values indicate higher + precedence. Device IP profile will be evaluated in ascending order of this + field. + + subnet_id: The ID of the Subnet. + + description: An optional description of the Device IP profile. + + enabled: Whether the Device IP profile will be applied to matching devices. + + 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 await self._post( + f"/accounts/{account_id}/devices/ip-profiles", + body=await async_maybe_transform( + { + "match": match, + "name": name, + "precedence": precedence, + "subnet_id": subnet_id, + "description": description, + "enabled": enabled, + }, + ip_profile_create_params.IPProfileCreateParams, + ), + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + post_parser=ResultWrapper[IPProfile]._unwrapper, + ), + cast_to=cast(Type[IPProfile], ResultWrapper[IPProfile]), + ) + + async def update( + self, + profile_id: str, + *, + account_id: str, + description: str | Omit = omit, + enabled: bool | Omit = omit, + match: str | Omit = omit, + name: str | Omit = omit, + precedence: int | Omit = omit, + subnet_id: str | 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, + ) -> IPProfile: + """Updates a WARP Device IP profile. + + Currently, only IPv4 Device subnets can be + associated. + + Args: + description: An optional description of the Device IP profile. + + enabled: Whether the Device IP profile is enabled. + + match: + The wirefilter expression to match registrations. Available values: + "identity.name", "identity.email", "identity.groups.id", "identity.groups.name", + "identity.groups.email", "identity.saml_attributes". + + name: A user-friendly name for the Device IP profile. + + precedence: The precedence of the Device IP profile. Lower values indicate higher + precedence. Device IP profile will be evaluated in ascending order of this + field. + + subnet_id: The ID of the Subnet. + + 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 profile_id: + raise ValueError(f"Expected a non-empty value for `profile_id` but received {profile_id!r}") + return await self._patch( + f"/accounts/{account_id}/devices/ip-profiles/{profile_id}", + body=await async_maybe_transform( + { + "description": description, + "enabled": enabled, + "match": match, + "name": name, + "precedence": precedence, + "subnet_id": subnet_id, + }, + ip_profile_update_params.IPProfileUpdateParams, + ), + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + post_parser=ResultWrapper[IPProfile]._unwrapper, + ), + cast_to=cast(Type[IPProfile], ResultWrapper[IPProfile]), + ) + + def list( + self, + *, + account_id: str, + per_page: int | 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, + ) -> AsyncPaginator[IPProfile, AsyncSinglePage[IPProfile]]: + """ + Lists WARP Device IP profiles. + + Args: + per_page: The number of IP profiles to return per page. + + 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( + f"/accounts/{account_id}/devices/ip-profiles", + page=AsyncSinglePage[IPProfile], + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=maybe_transform({"per_page": per_page}, ip_profile_list_params.IPProfileListParams), + ), + model=IPProfile, + ) + + async def delete( + self, + profile_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, + ) -> IPProfileDeleteResponse: + """ + Delete a WARP Device IP profile. + + Args: + 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 profile_id: + raise ValueError(f"Expected a non-empty value for `profile_id` but received {profile_id!r}") + return await self._delete( + f"/accounts/{account_id}/devices/ip-profiles/{profile_id}", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + post_parser=ResultWrapper[IPProfileDeleteResponse]._unwrapper, + ), + cast_to=cast(Type[IPProfileDeleteResponse], ResultWrapper[IPProfileDeleteResponse]), + ) + + async def get( + self, + profile_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, + ) -> IPProfile: + """ + Fetches a single WARP Device IP profile. + + Args: + 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 profile_id: + raise ValueError(f"Expected a non-empty value for `profile_id` but received {profile_id!r}") + return await self._get( + f"/accounts/{account_id}/devices/ip-profiles/{profile_id}", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + post_parser=ResultWrapper[IPProfile]._unwrapper, + ), + cast_to=cast(Type[IPProfile], ResultWrapper[IPProfile]), + ) + + +class IPProfilesResourceWithRawResponse: + def __init__(self, ip_profiles: IPProfilesResource) -> None: + self._ip_profiles = ip_profiles + + self.create = to_raw_response_wrapper( + ip_profiles.create, + ) + self.update = to_raw_response_wrapper( + ip_profiles.update, + ) + self.list = to_raw_response_wrapper( + ip_profiles.list, + ) + self.delete = to_raw_response_wrapper( + ip_profiles.delete, + ) + self.get = to_raw_response_wrapper( + ip_profiles.get, + ) + + +class AsyncIPProfilesResourceWithRawResponse: + def __init__(self, ip_profiles: AsyncIPProfilesResource) -> None: + self._ip_profiles = ip_profiles + + self.create = async_to_raw_response_wrapper( + ip_profiles.create, + ) + self.update = async_to_raw_response_wrapper( + ip_profiles.update, + ) + self.list = async_to_raw_response_wrapper( + ip_profiles.list, + ) + self.delete = async_to_raw_response_wrapper( + ip_profiles.delete, + ) + self.get = async_to_raw_response_wrapper( + ip_profiles.get, + ) + + +class IPProfilesResourceWithStreamingResponse: + def __init__(self, ip_profiles: IPProfilesResource) -> None: + self._ip_profiles = ip_profiles + + self.create = to_streamed_response_wrapper( + ip_profiles.create, + ) + self.update = to_streamed_response_wrapper( + ip_profiles.update, + ) + self.list = to_streamed_response_wrapper( + ip_profiles.list, + ) + self.delete = to_streamed_response_wrapper( + ip_profiles.delete, + ) + self.get = to_streamed_response_wrapper( + ip_profiles.get, + ) + + +class AsyncIPProfilesResourceWithStreamingResponse: + def __init__(self, ip_profiles: AsyncIPProfilesResource) -> None: + self._ip_profiles = ip_profiles + + self.create = async_to_streamed_response_wrapper( + ip_profiles.create, + ) + self.update = async_to_streamed_response_wrapper( + ip_profiles.update, + ) + self.list = async_to_streamed_response_wrapper( + ip_profiles.list, + ) + self.delete = async_to_streamed_response_wrapper( + ip_profiles.delete, + ) + self.get = async_to_streamed_response_wrapper( + ip_profiles.get, + ) diff --git a/src/cloudflare/types/zero_trust/devices/__init__.py b/src/cloudflare/types/zero_trust/devices/__init__.py index c6997f543e5..b8a661717f2 100644 --- a/src/cloudflare/types/zero_trust/devices/__init__.py +++ b/src/cloudflare/types/zero_trust/devices/__init__.py @@ -3,6 +3,7 @@ from __future__ import annotations from .file_input import FileInput as FileInput +from .ip_profile import IPProfile as IPProfile from .device_input import DeviceInput as DeviceInput from .device_match import DeviceMatch as DeviceMatch from .intune_input import IntuneInput as IntuneInput @@ -48,6 +49,7 @@ from .dex_test_create_params import DEXTestCreateParams as DEXTestCreateParams from .dex_test_list_response import DEXTestListResponse as DEXTestListResponse from .dex_test_update_params import DEXTestUpdateParams as DEXTestUpdateParams +from .ip_profile_list_params import IPProfileListParams as IPProfileListParams from .os_version_input_param import OSVersionInputParam as OSVersionInputParam from .revoke_create_response import RevokeCreateResponse as RevokeCreateResponse from .unique_client_id_input import UniqueClientIDInput as UniqueClientIDInput @@ -61,6 +63,8 @@ from .dex_test_create_response import DEXTestCreateResponse as DEXTestCreateResponse from .dex_test_delete_response import DEXTestDeleteResponse as DEXTestDeleteResponse from .dex_test_update_response import DEXTestUpdateResponse as DEXTestUpdateResponse +from .ip_profile_create_params import IPProfileCreateParams as IPProfileCreateParams +from .ip_profile_update_params import IPProfileUpdateParams as IPProfileUpdateParams from .registration_list_params import RegistrationListParams as RegistrationListParams from .unrevoke_create_response import UnrevokeCreateResponse as UnrevokeCreateResponse from .domain_joined_input_param import DomainJoinedInputParam as DomainJoinedInputParam @@ -68,6 +72,7 @@ from .registration_get_response import RegistrationGetResponse as RegistrationGetResponse from .workspace_one_input_param import WorkspaceOneInputParam as WorkspaceOneInputParam from .device_policy_certificates import DevicePolicyCertificates as DevicePolicyCertificates +from .ip_profile_delete_response import IPProfileDeleteResponse as IPProfileDeleteResponse from .override_code_get_response import OverrideCodeGetResponse as OverrideCodeGetResponse from .registration_list_response import RegistrationListResponse as RegistrationListResponse from .registration_revoke_params import RegistrationRevokeParams as RegistrationRevokeParams diff --git a/src/cloudflare/types/zero_trust/devices/ip_profile.py b/src/cloudflare/types/zero_trust/devices/ip_profile.py new file mode 100644 index 00000000000..93f0a5eda46 --- /dev/null +++ b/src/cloudflare/types/zero_trust/devices/ip_profile.py @@ -0,0 +1,44 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional + +from ...._models import BaseModel + +__all__ = ["IPProfile"] + + +class IPProfile(BaseModel): + id: str + """The ID of the Device IP profile.""" + + created_at: str + """The RFC3339Nano timestamp when the Device IP profile was created.""" + + description: Optional[str] = None + """An optional description of the Device IP profile.""" + + enabled: bool + """Whether the Device IP profile is enabled.""" + + match: str + """The wirefilter expression to match registrations. + + Available values: "identity.name", "identity.email", "identity.groups.id", + "identity.groups.name", "identity.groups.email", "identity.saml_attributes". + """ + + name: str + """A user-friendly name for the Device IP profile.""" + + precedence: int + """The precedence of the Device IP profile. + + Lower values indicate higher precedence. Device IP profile will be evaluated in + ascending order of this field. + """ + + subnet_id: str + """The ID of the Subnet.""" + + updated_at: str + """The RFC3339Nano timestamp when the Device IP profile was last updated.""" diff --git a/src/cloudflare/types/zero_trust/devices/ip_profile_create_params.py b/src/cloudflare/types/zero_trust/devices/ip_profile_create_params.py new file mode 100644 index 00000000000..60ab6588144 --- /dev/null +++ b/src/cloudflare/types/zero_trust/devices/ip_profile_create_params.py @@ -0,0 +1,38 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Optional +from typing_extensions import Required, TypedDict + +__all__ = ["IPProfileCreateParams"] + + +class IPProfileCreateParams(TypedDict, total=False): + account_id: Required[str] + + match: Required[str] + """The wirefilter expression to match registrations. + + Available values: "identity.name", "identity.email", "identity.groups.id", + "identity.groups.name", "identity.groups.email", "identity.saml_attributes". + """ + + name: Required[str] + """A user-friendly name for the Device IP profile.""" + + precedence: Required[int] + """The precedence of the Device IP profile. + + Lower values indicate higher precedence. Device IP profile will be evaluated in + ascending order of this field. + """ + + subnet_id: Required[str] + """The ID of the Subnet.""" + + description: Optional[str] + """An optional description of the Device IP profile.""" + + enabled: bool + """Whether the Device IP profile will be applied to matching devices.""" diff --git a/src/cloudflare/types/zero_trust/devices/ip_profile_delete_response.py b/src/cloudflare/types/zero_trust/devices/ip_profile_delete_response.py new file mode 100644 index 00000000000..de2178bc21e --- /dev/null +++ b/src/cloudflare/types/zero_trust/devices/ip_profile_delete_response.py @@ -0,0 +1,12 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional + +from ...._models import BaseModel + +__all__ = ["IPProfileDeleteResponse"] + + +class IPProfileDeleteResponse(BaseModel): + id: Optional[str] = None + """ID of the deleted Device IP profile.""" diff --git a/src/cloudflare/types/zero_trust/devices/ip_profile_list_params.py b/src/cloudflare/types/zero_trust/devices/ip_profile_list_params.py new file mode 100644 index 00000000000..184eba34c9b --- /dev/null +++ b/src/cloudflare/types/zero_trust/devices/ip_profile_list_params.py @@ -0,0 +1,14 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +__all__ = ["IPProfileListParams"] + + +class IPProfileListParams(TypedDict, total=False): + account_id: Required[str] + + per_page: int + """The number of IP profiles to return per page.""" diff --git a/src/cloudflare/types/zero_trust/devices/ip_profile_update_params.py b/src/cloudflare/types/zero_trust/devices/ip_profile_update_params.py new file mode 100644 index 00000000000..793212497f8 --- /dev/null +++ b/src/cloudflare/types/zero_trust/devices/ip_profile_update_params.py @@ -0,0 +1,37 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +__all__ = ["IPProfileUpdateParams"] + + +class IPProfileUpdateParams(TypedDict, total=False): + account_id: Required[str] + + description: str + """An optional description of the Device IP profile.""" + + enabled: bool + """Whether the Device IP profile is enabled.""" + + match: str + """The wirefilter expression to match registrations. + + Available values: "identity.name", "identity.email", "identity.groups.id", + "identity.groups.name", "identity.groups.email", "identity.saml_attributes". + """ + + name: str + """A user-friendly name for the Device IP profile.""" + + precedence: int + """The precedence of the Device IP profile. + + Lower values indicate higher precedence. Device IP profile will be evaluated in + ascending order of this field. + """ + + subnet_id: str + """The ID of the Subnet.""" diff --git a/tests/api_resources/zero_trust/devices/test_ip_profiles.py b/tests/api_resources/zero_trust/devices/test_ip_profiles.py new file mode 100644 index 00000000000..14fbc171dd0 --- /dev/null +++ b/tests/api_resources/zero_trust/devices/test_ip_profiles.py @@ -0,0 +1,570 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +import os +from typing import Any, cast + +import pytest + +from cloudflare import Cloudflare, AsyncCloudflare +from tests.utils import assert_matches_type +from cloudflare.pagination import SyncSinglePage, AsyncSinglePage +from cloudflare.types.zero_trust.devices import ( + IPProfile, + IPProfileDeleteResponse, +) + +base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") + + +class TestIPProfiles: + parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) + + @parametrize + def test_method_create(self, client: Cloudflare) -> None: + ip_profile = client.zero_trust.devices.ip_profiles.create( + account_id="account_id", + match='identity.email == "test@cloudflare.com"', + name="IPv4 Cloudflare Source IPs", + precedence=100, + subnet_id="b70ff985-a4ef-4643-bbbc-4a0ed4fc8415", + ) + assert_matches_type(IPProfile, ip_profile, path=["response"]) + + @parametrize + def test_method_create_with_all_params(self, client: Cloudflare) -> None: + ip_profile = client.zero_trust.devices.ip_profiles.create( + account_id="account_id", + match='identity.email == "test@cloudflare.com"', + name="IPv4 Cloudflare Source IPs", + precedence=100, + subnet_id="b70ff985-a4ef-4643-bbbc-4a0ed4fc8415", + description="example comment", + enabled=True, + ) + assert_matches_type(IPProfile, ip_profile, path=["response"]) + + @parametrize + def test_raw_response_create(self, client: Cloudflare) -> None: + response = client.zero_trust.devices.ip_profiles.with_raw_response.create( + account_id="account_id", + match='identity.email == "test@cloudflare.com"', + name="IPv4 Cloudflare Source IPs", + precedence=100, + subnet_id="b70ff985-a4ef-4643-bbbc-4a0ed4fc8415", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + ip_profile = response.parse() + assert_matches_type(IPProfile, ip_profile, path=["response"]) + + @parametrize + def test_streaming_response_create(self, client: Cloudflare) -> None: + with client.zero_trust.devices.ip_profiles.with_streaming_response.create( + account_id="account_id", + match='identity.email == "test@cloudflare.com"', + name="IPv4 Cloudflare Source IPs", + precedence=100, + subnet_id="b70ff985-a4ef-4643-bbbc-4a0ed4fc8415", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + ip_profile = response.parse() + assert_matches_type(IPProfile, ip_profile, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_create(self, client: Cloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + client.zero_trust.devices.ip_profiles.with_raw_response.create( + account_id="", + match='identity.email == "test@cloudflare.com"', + name="IPv4 Cloudflare Source IPs", + precedence=100, + subnet_id="b70ff985-a4ef-4643-bbbc-4a0ed4fc8415", + ) + + @parametrize + def test_method_update(self, client: Cloudflare) -> None: + ip_profile = client.zero_trust.devices.ip_profiles.update( + profile_id="profile_id", + account_id="account_id", + ) + assert_matches_type(IPProfile, ip_profile, path=["response"]) + + @parametrize + def test_method_update_with_all_params(self, client: Cloudflare) -> None: + ip_profile = client.zero_trust.devices.ip_profiles.update( + profile_id="profile_id", + account_id="account_id", + description="example comment", + enabled=True, + match='identity.email == "test@cloudflare.com"', + name="IPv4 Cloudflare Source IPs", + precedence=100, + subnet_id="b70ff985-a4ef-4643-bbbc-4a0ed4fc8415", + ) + assert_matches_type(IPProfile, ip_profile, path=["response"]) + + @parametrize + def test_raw_response_update(self, client: Cloudflare) -> None: + response = client.zero_trust.devices.ip_profiles.with_raw_response.update( + profile_id="profile_id", + account_id="account_id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + ip_profile = response.parse() + assert_matches_type(IPProfile, ip_profile, path=["response"]) + + @parametrize + def test_streaming_response_update(self, client: Cloudflare) -> None: + with client.zero_trust.devices.ip_profiles.with_streaming_response.update( + profile_id="profile_id", + account_id="account_id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + ip_profile = response.parse() + assert_matches_type(IPProfile, ip_profile, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_update(self, client: Cloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + client.zero_trust.devices.ip_profiles.with_raw_response.update( + profile_id="profile_id", + account_id="", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `profile_id` but received ''"): + client.zero_trust.devices.ip_profiles.with_raw_response.update( + profile_id="", + account_id="account_id", + ) + + @parametrize + def test_method_list(self, client: Cloudflare) -> None: + ip_profile = client.zero_trust.devices.ip_profiles.list( + account_id="account_id", + ) + assert_matches_type(SyncSinglePage[IPProfile], ip_profile, path=["response"]) + + @parametrize + def test_method_list_with_all_params(self, client: Cloudflare) -> None: + ip_profile = client.zero_trust.devices.ip_profiles.list( + account_id="account_id", + per_page=1, + ) + assert_matches_type(SyncSinglePage[IPProfile], ip_profile, path=["response"]) + + @parametrize + def test_raw_response_list(self, client: Cloudflare) -> None: + response = client.zero_trust.devices.ip_profiles.with_raw_response.list( + account_id="account_id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + ip_profile = response.parse() + assert_matches_type(SyncSinglePage[IPProfile], ip_profile, path=["response"]) + + @parametrize + def test_streaming_response_list(self, client: Cloudflare) -> None: + with client.zero_trust.devices.ip_profiles.with_streaming_response.list( + account_id="account_id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + ip_profile = response.parse() + assert_matches_type(SyncSinglePage[IPProfile], ip_profile, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_list(self, client: Cloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + client.zero_trust.devices.ip_profiles.with_raw_response.list( + account_id="", + ) + + @parametrize + def test_method_delete(self, client: Cloudflare) -> None: + ip_profile = client.zero_trust.devices.ip_profiles.delete( + profile_id="profile_id", + account_id="account_id", + ) + assert_matches_type(IPProfileDeleteResponse, ip_profile, path=["response"]) + + @parametrize + def test_raw_response_delete(self, client: Cloudflare) -> None: + response = client.zero_trust.devices.ip_profiles.with_raw_response.delete( + profile_id="profile_id", + account_id="account_id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + ip_profile = response.parse() + assert_matches_type(IPProfileDeleteResponse, ip_profile, path=["response"]) + + @parametrize + def test_streaming_response_delete(self, client: Cloudflare) -> None: + with client.zero_trust.devices.ip_profiles.with_streaming_response.delete( + profile_id="profile_id", + account_id="account_id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + ip_profile = response.parse() + assert_matches_type(IPProfileDeleteResponse, ip_profile, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_delete(self, client: Cloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + client.zero_trust.devices.ip_profiles.with_raw_response.delete( + profile_id="profile_id", + account_id="", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `profile_id` but received ''"): + client.zero_trust.devices.ip_profiles.with_raw_response.delete( + profile_id="", + account_id="account_id", + ) + + @parametrize + def test_method_get(self, client: Cloudflare) -> None: + ip_profile = client.zero_trust.devices.ip_profiles.get( + profile_id="profile_id", + account_id="account_id", + ) + assert_matches_type(IPProfile, ip_profile, path=["response"]) + + @parametrize + def test_raw_response_get(self, client: Cloudflare) -> None: + response = client.zero_trust.devices.ip_profiles.with_raw_response.get( + profile_id="profile_id", + account_id="account_id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + ip_profile = response.parse() + assert_matches_type(IPProfile, ip_profile, path=["response"]) + + @parametrize + def test_streaming_response_get(self, client: Cloudflare) -> None: + with client.zero_trust.devices.ip_profiles.with_streaming_response.get( + profile_id="profile_id", + account_id="account_id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + ip_profile = response.parse() + assert_matches_type(IPProfile, ip_profile, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_get(self, client: Cloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + client.zero_trust.devices.ip_profiles.with_raw_response.get( + profile_id="profile_id", + account_id="", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `profile_id` but received ''"): + client.zero_trust.devices.ip_profiles.with_raw_response.get( + profile_id="", + account_id="account_id", + ) + + +class TestAsyncIPProfiles: + parametrize = pytest.mark.parametrize( + "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"] + ) + + @parametrize + async def test_method_create(self, async_client: AsyncCloudflare) -> None: + ip_profile = await async_client.zero_trust.devices.ip_profiles.create( + account_id="account_id", + match='identity.email == "test@cloudflare.com"', + name="IPv4 Cloudflare Source IPs", + precedence=100, + subnet_id="b70ff985-a4ef-4643-bbbc-4a0ed4fc8415", + ) + assert_matches_type(IPProfile, ip_profile, path=["response"]) + + @parametrize + async def test_method_create_with_all_params(self, async_client: AsyncCloudflare) -> None: + ip_profile = await async_client.zero_trust.devices.ip_profiles.create( + account_id="account_id", + match='identity.email == "test@cloudflare.com"', + name="IPv4 Cloudflare Source IPs", + precedence=100, + subnet_id="b70ff985-a4ef-4643-bbbc-4a0ed4fc8415", + description="example comment", + enabled=True, + ) + assert_matches_type(IPProfile, ip_profile, path=["response"]) + + @parametrize + async def test_raw_response_create(self, async_client: AsyncCloudflare) -> None: + response = await async_client.zero_trust.devices.ip_profiles.with_raw_response.create( + account_id="account_id", + match='identity.email == "test@cloudflare.com"', + name="IPv4 Cloudflare Source IPs", + precedence=100, + subnet_id="b70ff985-a4ef-4643-bbbc-4a0ed4fc8415", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + ip_profile = await response.parse() + assert_matches_type(IPProfile, ip_profile, path=["response"]) + + @parametrize + async def test_streaming_response_create(self, async_client: AsyncCloudflare) -> None: + async with async_client.zero_trust.devices.ip_profiles.with_streaming_response.create( + account_id="account_id", + match='identity.email == "test@cloudflare.com"', + name="IPv4 Cloudflare Source IPs", + precedence=100, + subnet_id="b70ff985-a4ef-4643-bbbc-4a0ed4fc8415", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + ip_profile = await response.parse() + assert_matches_type(IPProfile, ip_profile, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_create(self, async_client: AsyncCloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + await async_client.zero_trust.devices.ip_profiles.with_raw_response.create( + account_id="", + match='identity.email == "test@cloudflare.com"', + name="IPv4 Cloudflare Source IPs", + precedence=100, + subnet_id="b70ff985-a4ef-4643-bbbc-4a0ed4fc8415", + ) + + @parametrize + async def test_method_update(self, async_client: AsyncCloudflare) -> None: + ip_profile = await async_client.zero_trust.devices.ip_profiles.update( + profile_id="profile_id", + account_id="account_id", + ) + assert_matches_type(IPProfile, ip_profile, path=["response"]) + + @parametrize + async def test_method_update_with_all_params(self, async_client: AsyncCloudflare) -> None: + ip_profile = await async_client.zero_trust.devices.ip_profiles.update( + profile_id="profile_id", + account_id="account_id", + description="example comment", + enabled=True, + match='identity.email == "test@cloudflare.com"', + name="IPv4 Cloudflare Source IPs", + precedence=100, + subnet_id="b70ff985-a4ef-4643-bbbc-4a0ed4fc8415", + ) + assert_matches_type(IPProfile, ip_profile, path=["response"]) + + @parametrize + async def test_raw_response_update(self, async_client: AsyncCloudflare) -> None: + response = await async_client.zero_trust.devices.ip_profiles.with_raw_response.update( + profile_id="profile_id", + account_id="account_id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + ip_profile = await response.parse() + assert_matches_type(IPProfile, ip_profile, path=["response"]) + + @parametrize + async def test_streaming_response_update(self, async_client: AsyncCloudflare) -> None: + async with async_client.zero_trust.devices.ip_profiles.with_streaming_response.update( + profile_id="profile_id", + account_id="account_id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + ip_profile = await response.parse() + assert_matches_type(IPProfile, ip_profile, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_update(self, async_client: AsyncCloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + await async_client.zero_trust.devices.ip_profiles.with_raw_response.update( + profile_id="profile_id", + account_id="", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `profile_id` but received ''"): + await async_client.zero_trust.devices.ip_profiles.with_raw_response.update( + profile_id="", + account_id="account_id", + ) + + @parametrize + async def test_method_list(self, async_client: AsyncCloudflare) -> None: + ip_profile = await async_client.zero_trust.devices.ip_profiles.list( + account_id="account_id", + ) + assert_matches_type(AsyncSinglePage[IPProfile], ip_profile, path=["response"]) + + @parametrize + async def test_method_list_with_all_params(self, async_client: AsyncCloudflare) -> None: + ip_profile = await async_client.zero_trust.devices.ip_profiles.list( + account_id="account_id", + per_page=1, + ) + assert_matches_type(AsyncSinglePage[IPProfile], ip_profile, path=["response"]) + + @parametrize + async def test_raw_response_list(self, async_client: AsyncCloudflare) -> None: + response = await async_client.zero_trust.devices.ip_profiles.with_raw_response.list( + account_id="account_id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + ip_profile = await response.parse() + assert_matches_type(AsyncSinglePage[IPProfile], ip_profile, path=["response"]) + + @parametrize + async def test_streaming_response_list(self, async_client: AsyncCloudflare) -> None: + async with async_client.zero_trust.devices.ip_profiles.with_streaming_response.list( + account_id="account_id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + ip_profile = await response.parse() + assert_matches_type(AsyncSinglePage[IPProfile], ip_profile, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_list(self, async_client: AsyncCloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + await async_client.zero_trust.devices.ip_profiles.with_raw_response.list( + account_id="", + ) + + @parametrize + async def test_method_delete(self, async_client: AsyncCloudflare) -> None: + ip_profile = await async_client.zero_trust.devices.ip_profiles.delete( + profile_id="profile_id", + account_id="account_id", + ) + assert_matches_type(IPProfileDeleteResponse, ip_profile, path=["response"]) + + @parametrize + async def test_raw_response_delete(self, async_client: AsyncCloudflare) -> None: + response = await async_client.zero_trust.devices.ip_profiles.with_raw_response.delete( + profile_id="profile_id", + account_id="account_id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + ip_profile = await response.parse() + assert_matches_type(IPProfileDeleteResponse, ip_profile, path=["response"]) + + @parametrize + async def test_streaming_response_delete(self, async_client: AsyncCloudflare) -> None: + async with async_client.zero_trust.devices.ip_profiles.with_streaming_response.delete( + profile_id="profile_id", + account_id="account_id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + ip_profile = await response.parse() + assert_matches_type(IPProfileDeleteResponse, ip_profile, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_delete(self, async_client: AsyncCloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + await async_client.zero_trust.devices.ip_profiles.with_raw_response.delete( + profile_id="profile_id", + account_id="", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `profile_id` but received ''"): + await async_client.zero_trust.devices.ip_profiles.with_raw_response.delete( + profile_id="", + account_id="account_id", + ) + + @parametrize + async def test_method_get(self, async_client: AsyncCloudflare) -> None: + ip_profile = await async_client.zero_trust.devices.ip_profiles.get( + profile_id="profile_id", + account_id="account_id", + ) + assert_matches_type(IPProfile, ip_profile, path=["response"]) + + @parametrize + async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: + response = await async_client.zero_trust.devices.ip_profiles.with_raw_response.get( + profile_id="profile_id", + account_id="account_id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + ip_profile = await response.parse() + assert_matches_type(IPProfile, ip_profile, path=["response"]) + + @parametrize + async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> None: + async with async_client.zero_trust.devices.ip_profiles.with_streaming_response.get( + profile_id="profile_id", + account_id="account_id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + ip_profile = await response.parse() + assert_matches_type(IPProfile, ip_profile, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_get(self, async_client: AsyncCloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + await async_client.zero_trust.devices.ip_profiles.with_raw_response.get( + profile_id="profile_id", + account_id="", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `profile_id` but received ''"): + await async_client.zero_trust.devices.ip_profiles.with_raw_response.get( + profile_id="", + account_id="account_id", + ) From 2358e0af7d1023765832e67d1bf727b68eee4eb3 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 5 Mar 2026 16:41:05 +0000 Subject: [PATCH 053/279] feat: chore(zero_trust_device_ip_profile): skip go prism tests --- .stats.yml | 2 +- .../zero_trust/devices/test_ip_profiles.py | 46 +++++++++++++++++++ 2 files changed, 47 insertions(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index abfd2fbdca7..5798a769b7d 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 2050 openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-9ba099b7936091cc984d2a24fc4d32c3ffcb1d71d86412c8c9084d201e16b3ac.yml openapi_spec_hash: 45edc9a107cf5a5e3b204b230b0d336d -config_hash: 082014e766adf9596cfb12f88a73329a +config_hash: e0714aca87c83c7d709440ec515aef8a diff --git a/tests/api_resources/zero_trust/devices/test_ip_profiles.py b/tests/api_resources/zero_trust/devices/test_ip_profiles.py index 14fbc171dd0..3bafccc9b0d 100644 --- a/tests/api_resources/zero_trust/devices/test_ip_profiles.py +++ b/tests/api_resources/zero_trust/devices/test_ip_profiles.py @@ -21,6 +21,7 @@ class TestIPProfiles: parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) + @pytest.mark.skip(reason="401 Unauthorized: Prism doesnt handle api tokens") @parametrize def test_method_create(self, client: Cloudflare) -> None: ip_profile = client.zero_trust.devices.ip_profiles.create( @@ -32,6 +33,7 @@ def test_method_create(self, client: Cloudflare) -> None: ) assert_matches_type(IPProfile, ip_profile, path=["response"]) + @pytest.mark.skip(reason="401 Unauthorized: Prism doesnt handle api tokens") @parametrize def test_method_create_with_all_params(self, client: Cloudflare) -> None: ip_profile = client.zero_trust.devices.ip_profiles.create( @@ -45,6 +47,7 @@ def test_method_create_with_all_params(self, client: Cloudflare) -> None: ) assert_matches_type(IPProfile, ip_profile, path=["response"]) + @pytest.mark.skip(reason="401 Unauthorized: Prism doesnt handle api tokens") @parametrize def test_raw_response_create(self, client: Cloudflare) -> None: response = client.zero_trust.devices.ip_profiles.with_raw_response.create( @@ -60,6 +63,7 @@ def test_raw_response_create(self, client: Cloudflare) -> None: ip_profile = response.parse() assert_matches_type(IPProfile, ip_profile, path=["response"]) + @pytest.mark.skip(reason="401 Unauthorized: Prism doesnt handle api tokens") @parametrize def test_streaming_response_create(self, client: Cloudflare) -> None: with client.zero_trust.devices.ip_profiles.with_streaming_response.create( @@ -77,6 +81,7 @@ def test_streaming_response_create(self, client: Cloudflare) -> None: assert cast(Any, response.is_closed) is True + @pytest.mark.skip(reason="401 Unauthorized: Prism doesnt handle api tokens") @parametrize def test_path_params_create(self, client: Cloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): @@ -88,6 +93,7 @@ def test_path_params_create(self, client: Cloudflare) -> None: subnet_id="b70ff985-a4ef-4643-bbbc-4a0ed4fc8415", ) + @pytest.mark.skip(reason="401 Unauthorized: Prism doesnt handle api tokens") @parametrize def test_method_update(self, client: Cloudflare) -> None: ip_profile = client.zero_trust.devices.ip_profiles.update( @@ -96,6 +102,7 @@ def test_method_update(self, client: Cloudflare) -> None: ) assert_matches_type(IPProfile, ip_profile, path=["response"]) + @pytest.mark.skip(reason="401 Unauthorized: Prism doesnt handle api tokens") @parametrize def test_method_update_with_all_params(self, client: Cloudflare) -> None: ip_profile = client.zero_trust.devices.ip_profiles.update( @@ -110,6 +117,7 @@ def test_method_update_with_all_params(self, client: Cloudflare) -> None: ) assert_matches_type(IPProfile, ip_profile, path=["response"]) + @pytest.mark.skip(reason="401 Unauthorized: Prism doesnt handle api tokens") @parametrize def test_raw_response_update(self, client: Cloudflare) -> None: response = client.zero_trust.devices.ip_profiles.with_raw_response.update( @@ -122,6 +130,7 @@ def test_raw_response_update(self, client: Cloudflare) -> None: ip_profile = response.parse() assert_matches_type(IPProfile, ip_profile, path=["response"]) + @pytest.mark.skip(reason="401 Unauthorized: Prism doesnt handle api tokens") @parametrize def test_streaming_response_update(self, client: Cloudflare) -> None: with client.zero_trust.devices.ip_profiles.with_streaming_response.update( @@ -136,6 +145,7 @@ def test_streaming_response_update(self, client: Cloudflare) -> None: assert cast(Any, response.is_closed) is True + @pytest.mark.skip(reason="401 Unauthorized: Prism doesnt handle api tokens") @parametrize def test_path_params_update(self, client: Cloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): @@ -150,6 +160,7 @@ def test_path_params_update(self, client: Cloudflare) -> None: account_id="account_id", ) + @pytest.mark.skip(reason="401 Unauthorized: Prism doesnt handle api tokens") @parametrize def test_method_list(self, client: Cloudflare) -> None: ip_profile = client.zero_trust.devices.ip_profiles.list( @@ -157,6 +168,7 @@ def test_method_list(self, client: Cloudflare) -> None: ) assert_matches_type(SyncSinglePage[IPProfile], ip_profile, path=["response"]) + @pytest.mark.skip(reason="401 Unauthorized: Prism doesnt handle api tokens") @parametrize def test_method_list_with_all_params(self, client: Cloudflare) -> None: ip_profile = client.zero_trust.devices.ip_profiles.list( @@ -165,6 +177,7 @@ def test_method_list_with_all_params(self, client: Cloudflare) -> None: ) assert_matches_type(SyncSinglePage[IPProfile], ip_profile, path=["response"]) + @pytest.mark.skip(reason="401 Unauthorized: Prism doesnt handle api tokens") @parametrize def test_raw_response_list(self, client: Cloudflare) -> None: response = client.zero_trust.devices.ip_profiles.with_raw_response.list( @@ -176,6 +189,7 @@ def test_raw_response_list(self, client: Cloudflare) -> None: ip_profile = response.parse() assert_matches_type(SyncSinglePage[IPProfile], ip_profile, path=["response"]) + @pytest.mark.skip(reason="401 Unauthorized: Prism doesnt handle api tokens") @parametrize def test_streaming_response_list(self, client: Cloudflare) -> None: with client.zero_trust.devices.ip_profiles.with_streaming_response.list( @@ -189,6 +203,7 @@ def test_streaming_response_list(self, client: Cloudflare) -> None: assert cast(Any, response.is_closed) is True + @pytest.mark.skip(reason="401 Unauthorized: Prism doesnt handle api tokens") @parametrize def test_path_params_list(self, client: Cloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): @@ -196,6 +211,7 @@ def test_path_params_list(self, client: Cloudflare) -> None: account_id="", ) + @pytest.mark.skip(reason="401 Unauthorized: Prism doesnt handle api tokens") @parametrize def test_method_delete(self, client: Cloudflare) -> None: ip_profile = client.zero_trust.devices.ip_profiles.delete( @@ -204,6 +220,7 @@ def test_method_delete(self, client: Cloudflare) -> None: ) assert_matches_type(IPProfileDeleteResponse, ip_profile, path=["response"]) + @pytest.mark.skip(reason="401 Unauthorized: Prism doesnt handle api tokens") @parametrize def test_raw_response_delete(self, client: Cloudflare) -> None: response = client.zero_trust.devices.ip_profiles.with_raw_response.delete( @@ -216,6 +233,7 @@ def test_raw_response_delete(self, client: Cloudflare) -> None: ip_profile = response.parse() assert_matches_type(IPProfileDeleteResponse, ip_profile, path=["response"]) + @pytest.mark.skip(reason="401 Unauthorized: Prism doesnt handle api tokens") @parametrize def test_streaming_response_delete(self, client: Cloudflare) -> None: with client.zero_trust.devices.ip_profiles.with_streaming_response.delete( @@ -230,6 +248,7 @@ def test_streaming_response_delete(self, client: Cloudflare) -> None: assert cast(Any, response.is_closed) is True + @pytest.mark.skip(reason="401 Unauthorized: Prism doesnt handle api tokens") @parametrize def test_path_params_delete(self, client: Cloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): @@ -244,6 +263,7 @@ def test_path_params_delete(self, client: Cloudflare) -> None: account_id="account_id", ) + @pytest.mark.skip(reason="401 Unauthorized: Prism doesnt handle api tokens") @parametrize def test_method_get(self, client: Cloudflare) -> None: ip_profile = client.zero_trust.devices.ip_profiles.get( @@ -252,6 +272,7 @@ def test_method_get(self, client: Cloudflare) -> None: ) assert_matches_type(IPProfile, ip_profile, path=["response"]) + @pytest.mark.skip(reason="401 Unauthorized: Prism doesnt handle api tokens") @parametrize def test_raw_response_get(self, client: Cloudflare) -> None: response = client.zero_trust.devices.ip_profiles.with_raw_response.get( @@ -264,6 +285,7 @@ def test_raw_response_get(self, client: Cloudflare) -> None: ip_profile = response.parse() assert_matches_type(IPProfile, ip_profile, path=["response"]) + @pytest.mark.skip(reason="401 Unauthorized: Prism doesnt handle api tokens") @parametrize def test_streaming_response_get(self, client: Cloudflare) -> None: with client.zero_trust.devices.ip_profiles.with_streaming_response.get( @@ -278,6 +300,7 @@ def test_streaming_response_get(self, client: Cloudflare) -> None: assert cast(Any, response.is_closed) is True + @pytest.mark.skip(reason="401 Unauthorized: Prism doesnt handle api tokens") @parametrize def test_path_params_get(self, client: Cloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): @@ -298,6 +321,7 @@ class TestAsyncIPProfiles: "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"] ) + @pytest.mark.skip(reason="401 Unauthorized: Prism doesnt handle api tokens") @parametrize async def test_method_create(self, async_client: AsyncCloudflare) -> None: ip_profile = await async_client.zero_trust.devices.ip_profiles.create( @@ -309,6 +333,7 @@ async def test_method_create(self, async_client: AsyncCloudflare) -> None: ) assert_matches_type(IPProfile, ip_profile, path=["response"]) + @pytest.mark.skip(reason="401 Unauthorized: Prism doesnt handle api tokens") @parametrize async def test_method_create_with_all_params(self, async_client: AsyncCloudflare) -> None: ip_profile = await async_client.zero_trust.devices.ip_profiles.create( @@ -322,6 +347,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncCloudflare ) assert_matches_type(IPProfile, ip_profile, path=["response"]) + @pytest.mark.skip(reason="401 Unauthorized: Prism doesnt handle api tokens") @parametrize async def test_raw_response_create(self, async_client: AsyncCloudflare) -> None: response = await async_client.zero_trust.devices.ip_profiles.with_raw_response.create( @@ -337,6 +363,7 @@ async def test_raw_response_create(self, async_client: AsyncCloudflare) -> None: ip_profile = await response.parse() assert_matches_type(IPProfile, ip_profile, path=["response"]) + @pytest.mark.skip(reason="401 Unauthorized: Prism doesnt handle api tokens") @parametrize async def test_streaming_response_create(self, async_client: AsyncCloudflare) -> None: async with async_client.zero_trust.devices.ip_profiles.with_streaming_response.create( @@ -354,6 +381,7 @@ async def test_streaming_response_create(self, async_client: AsyncCloudflare) -> assert cast(Any, response.is_closed) is True + @pytest.mark.skip(reason="401 Unauthorized: Prism doesnt handle api tokens") @parametrize async def test_path_params_create(self, async_client: AsyncCloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): @@ -365,6 +393,7 @@ async def test_path_params_create(self, async_client: AsyncCloudflare) -> None: subnet_id="b70ff985-a4ef-4643-bbbc-4a0ed4fc8415", ) + @pytest.mark.skip(reason="401 Unauthorized: Prism doesnt handle api tokens") @parametrize async def test_method_update(self, async_client: AsyncCloudflare) -> None: ip_profile = await async_client.zero_trust.devices.ip_profiles.update( @@ -373,6 +402,7 @@ async def test_method_update(self, async_client: AsyncCloudflare) -> None: ) assert_matches_type(IPProfile, ip_profile, path=["response"]) + @pytest.mark.skip(reason="401 Unauthorized: Prism doesnt handle api tokens") @parametrize async def test_method_update_with_all_params(self, async_client: AsyncCloudflare) -> None: ip_profile = await async_client.zero_trust.devices.ip_profiles.update( @@ -387,6 +417,7 @@ async def test_method_update_with_all_params(self, async_client: AsyncCloudflare ) assert_matches_type(IPProfile, ip_profile, path=["response"]) + @pytest.mark.skip(reason="401 Unauthorized: Prism doesnt handle api tokens") @parametrize async def test_raw_response_update(self, async_client: AsyncCloudflare) -> None: response = await async_client.zero_trust.devices.ip_profiles.with_raw_response.update( @@ -399,6 +430,7 @@ async def test_raw_response_update(self, async_client: AsyncCloudflare) -> None: ip_profile = await response.parse() assert_matches_type(IPProfile, ip_profile, path=["response"]) + @pytest.mark.skip(reason="401 Unauthorized: Prism doesnt handle api tokens") @parametrize async def test_streaming_response_update(self, async_client: AsyncCloudflare) -> None: async with async_client.zero_trust.devices.ip_profiles.with_streaming_response.update( @@ -413,6 +445,7 @@ async def test_streaming_response_update(self, async_client: AsyncCloudflare) -> assert cast(Any, response.is_closed) is True + @pytest.mark.skip(reason="401 Unauthorized: Prism doesnt handle api tokens") @parametrize async def test_path_params_update(self, async_client: AsyncCloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): @@ -427,6 +460,7 @@ async def test_path_params_update(self, async_client: AsyncCloudflare) -> None: account_id="account_id", ) + @pytest.mark.skip(reason="401 Unauthorized: Prism doesnt handle api tokens") @parametrize async def test_method_list(self, async_client: AsyncCloudflare) -> None: ip_profile = await async_client.zero_trust.devices.ip_profiles.list( @@ -434,6 +468,7 @@ async def test_method_list(self, async_client: AsyncCloudflare) -> None: ) assert_matches_type(AsyncSinglePage[IPProfile], ip_profile, path=["response"]) + @pytest.mark.skip(reason="401 Unauthorized: Prism doesnt handle api tokens") @parametrize async def test_method_list_with_all_params(self, async_client: AsyncCloudflare) -> None: ip_profile = await async_client.zero_trust.devices.ip_profiles.list( @@ -442,6 +477,7 @@ async def test_method_list_with_all_params(self, async_client: AsyncCloudflare) ) assert_matches_type(AsyncSinglePage[IPProfile], ip_profile, path=["response"]) + @pytest.mark.skip(reason="401 Unauthorized: Prism doesnt handle api tokens") @parametrize async def test_raw_response_list(self, async_client: AsyncCloudflare) -> None: response = await async_client.zero_trust.devices.ip_profiles.with_raw_response.list( @@ -453,6 +489,7 @@ async def test_raw_response_list(self, async_client: AsyncCloudflare) -> None: ip_profile = await response.parse() assert_matches_type(AsyncSinglePage[IPProfile], ip_profile, path=["response"]) + @pytest.mark.skip(reason="401 Unauthorized: Prism doesnt handle api tokens") @parametrize async def test_streaming_response_list(self, async_client: AsyncCloudflare) -> None: async with async_client.zero_trust.devices.ip_profiles.with_streaming_response.list( @@ -466,6 +503,7 @@ async def test_streaming_response_list(self, async_client: AsyncCloudflare) -> N assert cast(Any, response.is_closed) is True + @pytest.mark.skip(reason="401 Unauthorized: Prism doesnt handle api tokens") @parametrize async def test_path_params_list(self, async_client: AsyncCloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): @@ -473,6 +511,7 @@ async def test_path_params_list(self, async_client: AsyncCloudflare) -> None: account_id="", ) + @pytest.mark.skip(reason="401 Unauthorized: Prism doesnt handle api tokens") @parametrize async def test_method_delete(self, async_client: AsyncCloudflare) -> None: ip_profile = await async_client.zero_trust.devices.ip_profiles.delete( @@ -481,6 +520,7 @@ async def test_method_delete(self, async_client: AsyncCloudflare) -> None: ) assert_matches_type(IPProfileDeleteResponse, ip_profile, path=["response"]) + @pytest.mark.skip(reason="401 Unauthorized: Prism doesnt handle api tokens") @parametrize async def test_raw_response_delete(self, async_client: AsyncCloudflare) -> None: response = await async_client.zero_trust.devices.ip_profiles.with_raw_response.delete( @@ -493,6 +533,7 @@ async def test_raw_response_delete(self, async_client: AsyncCloudflare) -> None: ip_profile = await response.parse() assert_matches_type(IPProfileDeleteResponse, ip_profile, path=["response"]) + @pytest.mark.skip(reason="401 Unauthorized: Prism doesnt handle api tokens") @parametrize async def test_streaming_response_delete(self, async_client: AsyncCloudflare) -> None: async with async_client.zero_trust.devices.ip_profiles.with_streaming_response.delete( @@ -507,6 +548,7 @@ async def test_streaming_response_delete(self, async_client: AsyncCloudflare) -> assert cast(Any, response.is_closed) is True + @pytest.mark.skip(reason="401 Unauthorized: Prism doesnt handle api tokens") @parametrize async def test_path_params_delete(self, async_client: AsyncCloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): @@ -521,6 +563,7 @@ async def test_path_params_delete(self, async_client: AsyncCloudflare) -> None: account_id="account_id", ) + @pytest.mark.skip(reason="401 Unauthorized: Prism doesnt handle api tokens") @parametrize async def test_method_get(self, async_client: AsyncCloudflare) -> None: ip_profile = await async_client.zero_trust.devices.ip_profiles.get( @@ -529,6 +572,7 @@ async def test_method_get(self, async_client: AsyncCloudflare) -> None: ) assert_matches_type(IPProfile, ip_profile, path=["response"]) + @pytest.mark.skip(reason="401 Unauthorized: Prism doesnt handle api tokens") @parametrize async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: response = await async_client.zero_trust.devices.ip_profiles.with_raw_response.get( @@ -541,6 +585,7 @@ async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: ip_profile = await response.parse() assert_matches_type(IPProfile, ip_profile, path=["response"]) + @pytest.mark.skip(reason="401 Unauthorized: Prism doesnt handle api tokens") @parametrize async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> None: async with async_client.zero_trust.devices.ip_profiles.with_streaming_response.get( @@ -555,6 +600,7 @@ async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> No assert cast(Any, response.is_closed) is True + @pytest.mark.skip(reason="401 Unauthorized: Prism doesnt handle api tokens") @parametrize async def test_path_params_get(self, async_client: AsyncCloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): From 76eacbbe8f01e7c2f72e209d189595c63317de57 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 5 Mar 2026 18:06:29 +0000 Subject: [PATCH 054/279] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index 5798a769b7d..5006ac24b6c 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 2050 openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-9ba099b7936091cc984d2a24fc4d32c3ffcb1d71d86412c8c9084d201e16b3ac.yml openapi_spec_hash: 45edc9a107cf5a5e3b204b230b0d336d -config_hash: e0714aca87c83c7d709440ec515aef8a +config_hash: ebde54bdd7ec58f9abf7de1c45a2c076 From 31cc1676eeeef320495c7527252e92e0a8d4f972 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 5 Mar 2026 20:55:33 +0000 Subject: [PATCH 055/279] chore(api): update composite API spec --- .stats.yml | 6 +- api.md | 7 +- .../resources/abuse_reports/abuse_reports.py | 8 +- src/cloudflare/resources/ai/models/schema.py | 4 +- src/cloudflare/resources/ai/to_markdown.py | 8 +- .../resources/ai_gateway/ai_gateway.py | 44 +- .../resources/ai_gateway/datasets.py | 20 +- .../resources/ai_gateway/evaluations.py | 16 +- src/cloudflare/resources/ai_gateway/logs.py | 16 +- .../resources/ai_gateway/provider_configs.py | 8 +- src/cloudflare/resources/ai_gateway/urls.py | 4 +- .../resources/aisearch/instances/instances.py | 42 +- .../resources/aisearch/instances/items.py | 105 -- .../resources/aisearch/instances/jobs.py | 6 +- src/cloudflare/resources/aisearch/tokens.py | 17 + .../resources/api_gateway/configurations.py | 18 +- .../expression_template/fallthrough.py | 12 +- .../api_gateway/operations/operations.py | 30 +- .../api_gateway/user_schemas/hosts.py | 12 +- .../api_gateway/user_schemas/user_schemas.py | 36 +- .../threat_events/datasets/datasets.py | 12 +- .../email_security/investigate/investigate.py | 34 +- .../email_security/investigate/move.py | 6 +- .../email_security/investigate/preview.py | 6 +- .../email_security/investigate/reclassify.py | 6 +- .../email_security/investigate/release.py | 6 +- .../email_security/investigate/trace.py | 6 +- .../email_security/phishguard/reports.py | 6 +- .../email_security/settings/allow_policies.py | 30 +- .../email_security/settings/block_senders.py | 26 +- .../email_security/settings/domains.py | 14 +- .../settings/impersonation_registry.py | 16 +- .../settings/trusted_domains.py | 26 +- .../resources/email_security/submissions.py | 4 + .../resources/magic_transit/apps.py | 30 + .../magic_transit/connectors/connectors.py | 71 +- .../resources/magic_transit/sites/lans.py | 48 + .../resources/radar/ai/inference/inference.py | 4 +- .../resources/radar/ai/to_markdown.py | 4 +- src/cloudflare/resources/radar/dns/dns.py | 16 +- src/cloudflare/resources/radar/http/http.py | 8 + .../resources/radar/netflows/netflows.py | 8 +- src/cloudflare/resources/rulesets/rules.py | 730 +++++++++- .../resources/schema_validation/schemas.py | 40 +- .../schema_validation/settings/operations.py | 26 +- .../schema_validation/settings/settings.py | 16 +- src/cloudflare/resources/speed/schedule.py | 24 +- .../resources/workers/scripts/versions.py | 4 +- .../resources/workflows/instances/events.py | 4 +- .../workflows/instances/instances.py | 44 +- .../resources/workflows/instances/status.py | 6 +- .../resources/workflows/versions.py | 8 +- .../resources/workflows/workflows.py | 16 +- .../zero_trust/dlp/profiles/custom.py | 56 +- .../abuse_report_create_params.py | 2 +- .../ai_gateway/ai_gateway_create_params.py | 5 +- .../ai_gateway/ai_gateway_create_response.py | 11 +- .../ai_gateway/ai_gateway_delete_response.py | 11 +- .../ai_gateway/ai_gateway_get_response.py | 11 +- .../ai_gateway/ai_gateway_list_response.py | 11 +- .../ai_gateway/ai_gateway_update_params.py | 7 +- .../ai_gateway/ai_gateway_update_response.py | 11 +- .../ai_gateway/dataset_create_response.py | 4 - .../ai_gateway/dataset_delete_response.py | 4 - .../types/ai_gateway/dataset_get_response.py | 4 - .../types/ai_gateway/dataset_list_response.py | 4 - .../ai_gateway/dataset_update_response.py | 4 - ...amic_routing_create_deployment_response.py | 2 - .../dynamic_routing_create_response.py | 2 - ...dynamic_routing_create_version_response.py | 2 - .../dynamic_routing_delete_response.py | 2 - .../dynamic_routing_get_response.py | 2 - .../dynamic_routing_get_version_response.py | 2 - .../ai_gateway/evaluation_create_response.py | 4 - .../ai_gateway/evaluation_delete_response.py | 4 - .../ai_gateway/evaluation_get_response.py | 4 - .../ai_gateway/evaluation_list_response.py | 4 - .../provider_config_create_response.py | 4 - .../provider_config_list_response.py | 4 - .../instance_chat_completions_params.py | 28 + .../types/aisearch/instance_create_params.py | 64 +- .../aisearch/instance_create_response.py | 60 +- .../aisearch/instance_delete_response.py | 60 +- .../types/aisearch/instance_list_params.py | 8 +- .../types/aisearch/instance_list_response.py | 60 +- .../types/aisearch/instance_read_response.py | 60 +- .../types/aisearch/instance_search_params.py | 28 + .../types/aisearch/instance_update_params.py | 52 + .../aisearch/instance_update_response.py | 60 +- .../types/aisearch/instances/__init__.py | 2 +- .../aisearch/instances/item_get_response.py | 35 - .../aisearch/instances/job_create_params.py | 13 + .../aisearch/instances/job_create_response.py | 2 + .../aisearch/instances/job_get_response.py | 2 + .../aisearch/instances/job_list_response.py | 2 + .../types/aisearch/token_list_params.py | 8 +- .../threat_events/dataset_raw_response.py | 4 +- src/cloudflare/types/d1/d1.py | 6 + .../types/d1/database_list_response.py | 7 + .../investigate_get_response.py | 2 + .../email_security/investigate_list_params.py | 14 +- .../investigate_list_response.py | 2 + .../email_security/submission_list_params.py | 2 + .../submission_list_response.py | 2 + .../types/magic_transit/app_create_params.py | 6 + .../magic_transit/app_create_response.py | 6 + .../magic_transit/app_delete_response.py | 6 + .../types/magic_transit/app_edit_params.py | 6 + .../types/magic_transit/app_edit_response.py | 6 + .../types/magic_transit/app_list_response.py | 12 + .../types/magic_transit/app_update_params.py | 6 + .../magic_transit/app_update_response.py | 6 + .../magic_transit/connector_create_params.py | 13 +- .../connector_create_response.py | 11 +- .../connector_delete_response.py | 11 +- .../magic_transit/connector_edit_params.py | 13 +- .../magic_transit/connector_edit_response.py | 11 +- .../magic_transit/connector_get_response.py | 11 +- .../magic_transit/connector_list_response.py | 11 +- .../magic_transit/connector_update_params.py | 13 +- .../connector_update_response.py | 11 +- .../types/magic_transit/sites/lan.py | 6 + .../magic_transit/sites/lan_create_params.py | 6 + .../magic_transit/sites/lan_edit_params.py | 6 + .../magic_transit/sites/lan_update_params.py | 6 + .../types/pipelines/sink_get_response.py | 52 +- .../types/pipelines/sink_list_response.py | 52 +- .../inference_timeseries_groups_v2_params.py | 2 +- .../types/radar/geolocation_get_response.py | 7 + .../types/radar/geolocation_list_response.py | 8 +- src/cloudflare/types/rulesets/phase.py | 1 + .../types/rulesets/phase_get_response.py | 762 ++++++++++ .../types/rulesets/phase_update_params.py | 740 +++++++++- .../types/rulesets/phase_update_response.py | 762 ++++++++++ .../rulesets/phases/version_get_response.py | 762 ++++++++++ .../types/rulesets/rule_create_params.py | 826 ++++++++++- .../types/rulesets/rule_create_response.py | 762 ++++++++++ .../types/rulesets/rule_delete_response.py | 762 ++++++++++ .../types/rulesets/rule_edit_params.py | 832 ++++++++++- .../types/rulesets/rule_edit_response.py | 762 ++++++++++ .../types/rulesets/ruleset_create_params.py | 740 +++++++++- .../types/rulesets/ruleset_create_response.py | 762 ++++++++++ .../types/rulesets/ruleset_get_response.py | 762 ++++++++++ .../types/rulesets/ruleset_update_params.py | 740 +++++++++- .../types/rulesets/ruleset_update_response.py | 762 ++++++++++ .../types/rulesets/set_cache_settings_rule.py | 9 + .../rulesets/set_cache_settings_rule_param.py | 9 + .../types/rulesets/version_get_response.py | 762 ++++++++++ .../security_txt/security_txt_get_response.py | 4 +- .../security_txt_update_params.py | 2 +- .../types/speed/schedule_create_params.py | 6 + .../configuration_edit_response.py | 3 + .../types/workers/beta/workers/version.py | 7 + src/cloudflare/types/workflows/__init__.py | 1 + .../types/workflows/instance_get_params.py | 19 + .../types/workflows/instance_get_response.py | 2 + .../types/workflows/version_get_response.py | 9 +- .../types/workflows/version_list_response.py | 9 +- .../types/workflows/workflow_update_params.py | 8 +- .../dlp/payload_log_get_response.py | 6 +- .../dlp/payload_log_update_response.py | 6 +- .../types/zero_trust/dlp/profile.py | 9 + .../dlp/profiles/custom_create_params.py | 11 + .../dlp/profiles/custom_update_params.py | 19 + .../types/zones/setting_edit_response.py | 24 + .../types/zones/setting_get_response.py | 24 + .../aisearch/instances/test_items.py | 122 +- .../aisearch/instances/test_jobs.py | 18 + .../api_resources/aisearch/test_instances.py | 120 +- tests/api_resources/aisearch/test_tokens.py | 4 + .../email_security/test_investigate.py | 2 + .../email_security/test_submissions.py | 2 + .../magic_transit/sites/test_lans.py | 12 + .../api_resources/magic_transit/test_apps.py | 6 + .../magic_transit/test_connectors.py | 24 +- .../api_resources/radar/ai/test_inference.py | 4 +- tests/api_resources/radar/test_dns.py | 32 +- tests/api_resources/rulesets/test_rules.py | 1240 +++++++++++++++-- tests/api_resources/speed/test_schedule.py | 2 + tests/api_resources/test_ai_gateway.py | 10 +- tests/api_resources/test_workflows.py | 22 + .../api_resources/workflows/test_instances.py | 22 + .../zero_trust/dlp/profiles/test_custom.py | 12 + 183 files changed, 15188 insertions(+), 944 deletions(-) delete mode 100644 src/cloudflare/types/aisearch/instances/item_get_response.py create mode 100644 src/cloudflare/types/aisearch/instances/job_create_params.py create mode 100644 src/cloudflare/types/workflows/instance_get_params.py diff --git a/.stats.yml b/.stats.yml index 5006ac24b6c..10011598aba 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ -configured_endpoints: 2050 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-9ba099b7936091cc984d2a24fc4d32c3ffcb1d71d86412c8c9084d201e16b3ac.yml -openapi_spec_hash: 45edc9a107cf5a5e3b204b230b0d336d +configured_endpoints: 2049 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-ee23c4fe5cfe74e6576003db5f37b8b85cd8aaae1ff7576ccd2e16fa47008934.yml +openapi_spec_hash: 20046482414d30b12cdc7ab777b15e94 config_hash: ebde54bdd7ec58f9abf7de1c45a2c076 diff --git a/api.md b/api.md index 3ddbf724f9b..fdf2a04d227 100644 --- a/api.md +++ b/api.md @@ -10443,7 +10443,7 @@ Methods: - client.workflows.instances.create(workflow_name, \*, account_id, \*\*params) -> InstanceCreateResponse - client.workflows.instances.list(workflow_name, \*, account_id, \*\*params) -> SyncV4PagePaginationArray[InstanceListResponse] - client.workflows.instances.bulk(workflow_name, \*, account_id, \*\*params) -> SyncSinglePage[InstanceBulkResponse] -- client.workflows.instances.get(instance_id, \*, account_id, workflow_name) -> InstanceGetResponse +- client.workflows.instances.get(instance_id, \*, account_id, workflow_name, \*\*params) -> InstanceGetResponse ### Status @@ -10785,13 +10785,12 @@ Methods: Types: ```python -from cloudflare.types.aisearch.instances import ItemListResponse, ItemGetResponse +from cloudflare.types.aisearch.instances import ItemListResponse ``` Methods: - client.aisearch.instances.items.list(id, \*, account_id, \*\*params) -> SyncV4PagePaginationArray[ItemListResponse] -- client.aisearch.instances.items.get(item_id, \*, account_id, id) -> ItemGetResponse ### Jobs @@ -10808,7 +10807,7 @@ from cloudflare.types.aisearch.instances import ( Methods: -- client.aisearch.instances.jobs.create(id, \*, account_id) -> JobCreateResponse +- client.aisearch.instances.jobs.create(id, \*, account_id, \*\*params) -> JobCreateResponse - client.aisearch.instances.jobs.list(id, \*, account_id, \*\*params) -> SyncV4PagePaginationArray[JobListResponse] - client.aisearch.instances.jobs.get(job_id, \*, account_id, id) -> JobGetResponse - client.aisearch.instances.jobs.logs(job_id, \*, account_id, id, \*\*params) -> JobLogsResponse diff --git a/src/cloudflare/resources/abuse_reports/abuse_reports.py b/src/cloudflare/resources/abuse_reports/abuse_reports.py index 9cf0a64aa03..0766fbdbf26 100644 --- a/src/cloudflare/resources/abuse_reports/abuse_reports.py +++ b/src/cloudflare/resources/abuse_reports/abuse_reports.py @@ -273,7 +273,7 @@ def create( host_notification: Literal["send", "send-anon"], justification: str, name: str, - owner_notification: Literal["send", "send-anon", "none"], + owner_notification: Literal["send", "send-anon"], urls: str, comments: str | Omit = omit, company: str | Omit = omit, @@ -866,7 +866,7 @@ def create( host_notification: Literal["send"] | Literal["send", "send-anon"] | Omit = omit, name: str, original_work: str | Omit = omit, - owner_notification: Literal["send"] | Literal["send", "send-anon", "none"] | Literal["send", "send-anon"], + owner_notification: Literal["send"] | Literal["send", "send-anon"] | Literal["send", "send-anon", "none"], signature: str | Omit = omit, state: str | Omit = omit, urls: str, @@ -1299,7 +1299,7 @@ async def create( host_notification: Literal["send", "send-anon"], justification: str, name: str, - owner_notification: Literal["send", "send-anon", "none"], + owner_notification: Literal["send", "send-anon"], urls: str, comments: str | Omit = omit, company: str | Omit = omit, @@ -1892,7 +1892,7 @@ async def create( host_notification: Literal["send"] | Literal["send", "send-anon"] | Omit = omit, name: str, original_work: str | Omit = omit, - owner_notification: Literal["send"] | Literal["send", "send-anon", "none"] | Literal["send", "send-anon"], + owner_notification: Literal["send"] | Literal["send", "send-anon"] | Literal["send", "send-anon", "none"], signature: str | Omit = omit, state: str | Omit = omit, urls: str, diff --git a/src/cloudflare/resources/ai/models/schema.py b/src/cloudflare/resources/ai/models/schema.py index d555ab98627..a041d762955 100644 --- a/src/cloudflare/resources/ai/models/schema.py +++ b/src/cloudflare/resources/ai/models/schema.py @@ -57,7 +57,7 @@ def get( timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SchemaGetResponse: """ - Get Model Schema + Retrieves the input and output JSON schema definition for a Workers AI model. Args: model: Model Name @@ -119,7 +119,7 @@ async def get( timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SchemaGetResponse: """ - Get Model Schema + Retrieves the input and output JSON schema definition for a Workers AI model. Args: model: Model Name diff --git a/src/cloudflare/resources/ai/to_markdown.py b/src/cloudflare/resources/ai/to_markdown.py index 15cab8aa9e4..a4792606100 100644 --- a/src/cloudflare/resources/ai/to_markdown.py +++ b/src/cloudflare/resources/ai/to_markdown.py @@ -57,7 +57,7 @@ def supported( timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SyncSinglePage[ToMarkdownSupportedResponse]: """ - Get all converted formats supported + Lists all file formats supported for conversion to Markdown. Args: extra_headers: Send extra headers @@ -92,7 +92,7 @@ def transform( timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SyncSinglePage[ToMarkdownTransformResponse]: """ - Convert Files into Markdown + Converts uploaded files into Markdown format using Workers AI. Args: extra_headers: Send extra headers @@ -156,7 +156,7 @@ def supported( timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AsyncPaginator[ToMarkdownSupportedResponse, AsyncSinglePage[ToMarkdownSupportedResponse]]: """ - Get all converted formats supported + Lists all file formats supported for conversion to Markdown. Args: extra_headers: Send extra headers @@ -191,7 +191,7 @@ def transform( timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AsyncPaginator[ToMarkdownTransformResponse, AsyncSinglePage[ToMarkdownTransformResponse]]: """ - Convert Files into Markdown + Converts uploaded files into Markdown format using Workers AI. Args: extra_headers: Send extra headers diff --git a/src/cloudflare/resources/ai_gateway/ai_gateway.py b/src/cloudflare/resources/ai_gateway/ai_gateway.py index 545ad9b28e6..43c3b00b118 100644 --- a/src/cloudflare/resources/ai_gateway/ai_gateway.py +++ b/src/cloudflare/resources/ai_gateway/ai_gateway.py @@ -146,11 +146,11 @@ def create( rate_limiting_limit: Optional[int], rate_limiting_technique: Literal["fixed", "sliding"], authentication: bool | Omit = omit, - is_default: bool | Omit = omit, log_management: Optional[int] | Omit = omit, log_management_strategy: Optional[Literal["STOP_INSERTING", "DELETE_OLDEST"]] | Omit = omit, logpush: bool | Omit = omit, logpush_public_key: Optional[str] | Omit = omit, + workers_ai_billing_mode: Literal["postpaid", "unified"] | Omit = omit, zdr: 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. @@ -160,11 +160,13 @@ def create( timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AIGatewayCreateResponse: """ - Create a new Gateway + Creates a new AI Gateway. Args: id: gateway id + workers_ai_billing_mode: Controls how Workers AI inference calls routed through this gateway are billed + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -187,11 +189,11 @@ def create( "rate_limiting_limit": rate_limiting_limit, "rate_limiting_technique": rate_limiting_technique, "authentication": authentication, - "is_default": is_default, "log_management": log_management, "log_management_strategy": log_management_strategy, "logpush": logpush, "logpush_public_key": logpush_public_key, + "workers_ai_billing_mode": workers_ai_billing_mode, "zdr": zdr, }, ai_gateway_create_params.AIGatewayCreateParams, @@ -219,7 +221,6 @@ def update( rate_limiting_technique: Literal["fixed", "sliding"], authentication: bool | Omit = omit, dlp: ai_gateway_update_params.DLP | Omit = omit, - is_default: bool | Omit = omit, log_management: Optional[int] | Omit = omit, log_management_strategy: Optional[Literal["STOP_INSERTING", "DELETE_OLDEST"]] | Omit = omit, logpush: bool | Omit = omit, @@ -227,6 +228,7 @@ def update( otel: Optional[Iterable[ai_gateway_update_params.Otel]] | Omit = omit, store_id: Optional[str] | Omit = omit, stripe: Optional[ai_gateway_update_params.Stripe] | Omit = omit, + workers_ai_billing_mode: Literal["postpaid", "unified"] | Omit = omit, zdr: 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. @@ -236,11 +238,13 @@ def update( timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AIGatewayUpdateResponse: """ - Update a Gateway + Updates an existing AI Gateway dataset. Args: id: gateway id + workers_ai_billing_mode: Controls how Workers AI inference calls routed through this gateway are billed + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -265,7 +269,6 @@ def update( "rate_limiting_technique": rate_limiting_technique, "authentication": authentication, "dlp": dlp, - "is_default": is_default, "log_management": log_management, "log_management_strategy": log_management_strategy, "logpush": logpush, @@ -273,6 +276,7 @@ def update( "otel": otel, "store_id": store_id, "stripe": stripe, + "workers_ai_billing_mode": workers_ai_billing_mode, "zdr": zdr, }, ai_gateway_update_params.AIGatewayUpdateParams, @@ -302,7 +306,7 @@ def list( timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SyncV4PagePaginationArray[AIGatewayListResponse]: """ - List Gateways + Lists all AI Gateway evaluator types configured for the account. Args: search: Search by id @@ -350,7 +354,7 @@ def delete( timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AIGatewayDeleteResponse: """ - Delete a Gateway + Deletes an AI Gateway dataset. Args: id: gateway id @@ -392,7 +396,7 @@ def get( timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AIGatewayGetResponse: """ - Fetch a Gateway + Retrieves details for a specific AI Gateway dataset. Args: id: gateway id @@ -482,11 +486,11 @@ async def create( rate_limiting_limit: Optional[int], rate_limiting_technique: Literal["fixed", "sliding"], authentication: bool | Omit = omit, - is_default: bool | Omit = omit, log_management: Optional[int] | Omit = omit, log_management_strategy: Optional[Literal["STOP_INSERTING", "DELETE_OLDEST"]] | Omit = omit, logpush: bool | Omit = omit, logpush_public_key: Optional[str] | Omit = omit, + workers_ai_billing_mode: Literal["postpaid", "unified"] | Omit = omit, zdr: 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. @@ -496,11 +500,13 @@ async def create( timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AIGatewayCreateResponse: """ - Create a new Gateway + Creates a new AI Gateway. Args: id: gateway id + workers_ai_billing_mode: Controls how Workers AI inference calls routed through this gateway are billed + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -523,11 +529,11 @@ async def create( "rate_limiting_limit": rate_limiting_limit, "rate_limiting_technique": rate_limiting_technique, "authentication": authentication, - "is_default": is_default, "log_management": log_management, "log_management_strategy": log_management_strategy, "logpush": logpush, "logpush_public_key": logpush_public_key, + "workers_ai_billing_mode": workers_ai_billing_mode, "zdr": zdr, }, ai_gateway_create_params.AIGatewayCreateParams, @@ -555,7 +561,6 @@ async def update( rate_limiting_technique: Literal["fixed", "sliding"], authentication: bool | Omit = omit, dlp: ai_gateway_update_params.DLP | Omit = omit, - is_default: bool | Omit = omit, log_management: Optional[int] | Omit = omit, log_management_strategy: Optional[Literal["STOP_INSERTING", "DELETE_OLDEST"]] | Omit = omit, logpush: bool | Omit = omit, @@ -563,6 +568,7 @@ async def update( otel: Optional[Iterable[ai_gateway_update_params.Otel]] | Omit = omit, store_id: Optional[str] | Omit = omit, stripe: Optional[ai_gateway_update_params.Stripe] | Omit = omit, + workers_ai_billing_mode: Literal["postpaid", "unified"] | Omit = omit, zdr: 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. @@ -572,11 +578,13 @@ async def update( timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AIGatewayUpdateResponse: """ - Update a Gateway + Updates an existing AI Gateway dataset. Args: id: gateway id + workers_ai_billing_mode: Controls how Workers AI inference calls routed through this gateway are billed + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -601,7 +609,6 @@ async def update( "rate_limiting_technique": rate_limiting_technique, "authentication": authentication, "dlp": dlp, - "is_default": is_default, "log_management": log_management, "log_management_strategy": log_management_strategy, "logpush": logpush, @@ -609,6 +616,7 @@ async def update( "otel": otel, "store_id": store_id, "stripe": stripe, + "workers_ai_billing_mode": workers_ai_billing_mode, "zdr": zdr, }, ai_gateway_update_params.AIGatewayUpdateParams, @@ -638,7 +646,7 @@ def list( timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AsyncPaginator[AIGatewayListResponse, AsyncV4PagePaginationArray[AIGatewayListResponse]]: """ - List Gateways + Lists all AI Gateway evaluator types configured for the account. Args: search: Search by id @@ -686,7 +694,7 @@ async def delete( timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AIGatewayDeleteResponse: """ - Delete a Gateway + Deletes an AI Gateway dataset. Args: id: gateway id @@ -728,7 +736,7 @@ async def get( timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AIGatewayGetResponse: """ - Fetch a Gateway + Retrieves details for a specific AI Gateway dataset. Args: id: gateway id diff --git a/src/cloudflare/resources/ai_gateway/datasets.py b/src/cloudflare/resources/ai_gateway/datasets.py index bb256a33205..91601b7a385 100644 --- a/src/cloudflare/resources/ai_gateway/datasets.py +++ b/src/cloudflare/resources/ai_gateway/datasets.py @@ -65,7 +65,7 @@ def create( timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> DatasetCreateResponse: """ - Create a new Dataset + Creates a new AI Gateway. Args: gateway_id: gateway id @@ -119,7 +119,7 @@ def update( timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> DatasetUpdateResponse: """ - Update a Dataset + Updates an existing AI Gateway dataset. Args: gateway_id: gateway id @@ -176,7 +176,7 @@ def list( timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SyncV4PagePaginationArray[DatasetListResponse]: """ - List Datasets + Lists all AI Gateway evaluator types configured for the account. Args: gateway_id: gateway id @@ -231,7 +231,7 @@ def delete( timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> DatasetDeleteResponse: """ - Delete a Dataset + Deletes an AI Gateway dataset. Args: gateway_id: gateway id @@ -276,7 +276,7 @@ def get( timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> DatasetGetResponse: """ - Fetch a Dataset + Retrieves details for a specific AI Gateway dataset. Args: gateway_id: gateway id @@ -344,7 +344,7 @@ async def create( timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> DatasetCreateResponse: """ - Create a new Dataset + Creates a new AI Gateway. Args: gateway_id: gateway id @@ -398,7 +398,7 @@ async def update( timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> DatasetUpdateResponse: """ - Update a Dataset + Updates an existing AI Gateway dataset. Args: gateway_id: gateway id @@ -455,7 +455,7 @@ def list( timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AsyncPaginator[DatasetListResponse, AsyncV4PagePaginationArray[DatasetListResponse]]: """ - List Datasets + Lists all AI Gateway evaluator types configured for the account. Args: gateway_id: gateway id @@ -510,7 +510,7 @@ async def delete( timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> DatasetDeleteResponse: """ - Delete a Dataset + Deletes an AI Gateway dataset. Args: gateway_id: gateway id @@ -555,7 +555,7 @@ async def get( timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> DatasetGetResponse: """ - Fetch a Dataset + Retrieves details for a specific AI Gateway dataset. Args: gateway_id: gateway id diff --git a/src/cloudflare/resources/ai_gateway/evaluations.py b/src/cloudflare/resources/ai_gateway/evaluations.py index e3d9fd87309..b466e084495 100644 --- a/src/cloudflare/resources/ai_gateway/evaluations.py +++ b/src/cloudflare/resources/ai_gateway/evaluations.py @@ -64,7 +64,7 @@ def create( timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> EvaluationCreateResponse: """ - Create a new Evaluation + Creates a new AI Gateway. Args: gateway_id: gateway id @@ -119,7 +119,7 @@ def list( timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SyncV4PagePaginationArray[EvaluationListResponse]: """ - List Evaluations + Lists all AI Gateway evaluator types configured for the account. Args: gateway_id: gateway id @@ -174,7 +174,7 @@ def delete( timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> EvaluationDeleteResponse: """ - Delete a Evaluation + Deletes an AI Gateway dataset. Args: gateway_id: gateway id @@ -219,7 +219,7 @@ def get( timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> EvaluationGetResponse: """ - Fetch a Evaluation + Retrieves details for a specific AI Gateway dataset. Args: gateway_id: gateway id @@ -287,7 +287,7 @@ async def create( timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> EvaluationCreateResponse: """ - Create a new Evaluation + Creates a new AI Gateway. Args: gateway_id: gateway id @@ -342,7 +342,7 @@ def list( timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AsyncPaginator[EvaluationListResponse, AsyncV4PagePaginationArray[EvaluationListResponse]]: """ - List Evaluations + Lists all AI Gateway evaluator types configured for the account. Args: gateway_id: gateway id @@ -397,7 +397,7 @@ async def delete( timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> EvaluationDeleteResponse: """ - Delete a Evaluation + Deletes an AI Gateway dataset. Args: gateway_id: gateway id @@ -442,7 +442,7 @@ async def get( timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> EvaluationGetResponse: """ - Fetch a Evaluation + Retrieves details for a specific AI Gateway dataset. Args: gateway_id: gateway id diff --git a/src/cloudflare/resources/ai_gateway/logs.py b/src/cloudflare/resources/ai_gateway/logs.py index 8518d36781c..0ea6559c96b 100644 --- a/src/cloudflare/resources/ai_gateway/logs.py +++ b/src/cloudflare/resources/ai_gateway/logs.py @@ -236,7 +236,7 @@ def edit( timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> object: """ - Patch Gateway Log + Updates metadata for an AI Gateway log entry. Args: gateway_id: gateway id @@ -289,7 +289,7 @@ def get( timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> LogGetResponse: """ - Get Gateway Log Detail + Retrieves detailed information for a specific AI Gateway log entry. Args: gateway_id: gateway id @@ -334,7 +334,7 @@ def request( timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> object: """ - Get Gateway Log Request + Retrieves the original request payload for an AI Gateway log entry. Args: gateway_id: gateway id @@ -375,7 +375,7 @@ def response( timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> object: """ - Get Gateway Log Response + Retrieves the response payload for an AI Gateway log entry. Args: gateway_id: gateway id @@ -610,7 +610,7 @@ async def edit( timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> object: """ - Patch Gateway Log + Updates metadata for an AI Gateway log entry. Args: gateway_id: gateway id @@ -663,7 +663,7 @@ async def get( timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> LogGetResponse: """ - Get Gateway Log Detail + Retrieves detailed information for a specific AI Gateway log entry. Args: gateway_id: gateway id @@ -708,7 +708,7 @@ async def request( timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> object: """ - Get Gateway Log Request + Retrieves the original request payload for an AI Gateway log entry. Args: gateway_id: gateway id @@ -749,7 +749,7 @@ async def response( timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> object: """ - Get Gateway Log Response + Retrieves the response payload for an AI Gateway log entry. Args: gateway_id: gateway id diff --git a/src/cloudflare/resources/ai_gateway/provider_configs.py b/src/cloudflare/resources/ai_gateway/provider_configs.py index 60c7fc5f891..2e75c14bdc3 100644 --- a/src/cloudflare/resources/ai_gateway/provider_configs.py +++ b/src/cloudflare/resources/ai_gateway/provider_configs.py @@ -66,7 +66,7 @@ def create( timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> ProviderConfigCreateResponse: """ - Create a new Provider Configs + Creates a new AI Gateway. Args: gateway_id: gateway id @@ -122,7 +122,7 @@ def list( timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SyncV4PagePaginationArray[ProviderConfigListResponse]: """ - List Provider Configs + Lists all AI Gateway evaluator types configured for the account. Args: gateway_id: gateway id @@ -199,7 +199,7 @@ async def create( timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> ProviderConfigCreateResponse: """ - Create a new Provider Configs + Creates a new AI Gateway. Args: gateway_id: gateway id @@ -255,7 +255,7 @@ def list( timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AsyncPaginator[ProviderConfigListResponse, AsyncV4PagePaginationArray[ProviderConfigListResponse]]: """ - List Provider Configs + Lists all AI Gateway evaluator types configured for the account. Args: gateway_id: gateway id diff --git a/src/cloudflare/resources/ai_gateway/urls.py b/src/cloudflare/resources/ai_gateway/urls.py index 8f660faa164..988e21ecc24 100644 --- a/src/cloudflare/resources/ai_gateway/urls.py +++ b/src/cloudflare/resources/ai_gateway/urls.py @@ -56,7 +56,7 @@ def get( timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> str: """ - Get Gateway URL + Retrieves the endpoint URL for an AI Gateway. Args: gateway_id: gateway id @@ -122,7 +122,7 @@ async def get( timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> str: """ - Get Gateway URL + Retrieves the endpoint URL for an AI Gateway. Args: gateway_id: gateway id diff --git a/src/cloudflare/resources/aisearch/instances/instances.py b/src/cloudflare/resources/aisearch/instances/instances.py index 256d55b0ba3..a6eb75d2b48 100644 --- a/src/cloudflare/resources/aisearch/instances/instances.py +++ b/src/cloudflare/resources/aisearch/instances/instances.py @@ -88,8 +88,6 @@ def create( *, account_id: str, id: str, - source: str, - type: Literal["r2", "web-crawler"], ai_gateway_id: Optional[str] | Omit = omit, aisearch_model: Literal[ "@cf/meta/llama-3.3-70b-instruct-fp8-fast", @@ -122,6 +120,9 @@ def create( "", ] | Omit = omit, + cache: bool | Omit = omit, + cache_threshold: Literal["super_strict_match", "close_enough", "flexible_friend", "anything_goes"] + | Omit = omit, chunk: bool | Omit = omit, chunk_overlap: int | Omit = omit, chunk_size: int | Omit = omit, @@ -178,8 +179,10 @@ def create( | Omit = omit, rewrite_query: bool | Omit = omit, score_threshold: float | Omit = omit, + source: str | Omit = omit, source_params: Optional[instance_create_params.SourceParams] | Omit = omit, token_id: str | Omit = omit, + type: Literal["r2", "web-crawler"] | 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, @@ -208,10 +211,10 @@ def create( body=maybe_transform( { "id": id, - "source": source, - "type": type, "ai_gateway_id": ai_gateway_id, "aisearch_model": aisearch_model, + "cache": cache, + "cache_threshold": cache_threshold, "chunk": chunk, "chunk_overlap": chunk_overlap, "chunk_size": chunk_size, @@ -228,8 +231,10 @@ def create( "rewrite_model": rewrite_model, "rewrite_query": rewrite_query, "score_threshold": score_threshold, + "source": source, "source_params": source_params, "token_id": token_id, + "type": type, }, instance_create_params.InstanceCreateParams, ), @@ -451,6 +456,8 @@ def list( self, *, account_id: str, + order_by: Literal["created_at"] | Omit = omit, + order_by_direction: Literal["asc", "desc"] | Omit = omit, page: int | Omit = omit, per_page: int | Omit = omit, search: str | Omit = omit, @@ -465,6 +472,10 @@ def list( List instances. Args: + order_by: Order By Column Name + + order_by_direction: Order By Direction + search: Search by id extra_headers: Send extra headers @@ -487,6 +498,8 @@ def list( timeout=timeout, query=maybe_transform( { + "order_by": order_by, + "order_by_direction": order_by_direction, "page": page, "per_page": per_page, "search": search, @@ -791,8 +804,6 @@ async def create( *, account_id: str, id: str, - source: str, - type: Literal["r2", "web-crawler"], ai_gateway_id: Optional[str] | Omit = omit, aisearch_model: Literal[ "@cf/meta/llama-3.3-70b-instruct-fp8-fast", @@ -825,6 +836,9 @@ async def create( "", ] | Omit = omit, + cache: bool | Omit = omit, + cache_threshold: Literal["super_strict_match", "close_enough", "flexible_friend", "anything_goes"] + | Omit = omit, chunk: bool | Omit = omit, chunk_overlap: int | Omit = omit, chunk_size: int | Omit = omit, @@ -881,8 +895,10 @@ async def create( | Omit = omit, rewrite_query: bool | Omit = omit, score_threshold: float | Omit = omit, + source: str | Omit = omit, source_params: Optional[instance_create_params.SourceParams] | Omit = omit, token_id: str | Omit = omit, + type: Literal["r2", "web-crawler"] | 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, @@ -911,10 +927,10 @@ async def create( body=await async_maybe_transform( { "id": id, - "source": source, - "type": type, "ai_gateway_id": ai_gateway_id, "aisearch_model": aisearch_model, + "cache": cache, + "cache_threshold": cache_threshold, "chunk": chunk, "chunk_overlap": chunk_overlap, "chunk_size": chunk_size, @@ -931,8 +947,10 @@ async def create( "rewrite_model": rewrite_model, "rewrite_query": rewrite_query, "score_threshold": score_threshold, + "source": source, "source_params": source_params, "token_id": token_id, + "type": type, }, instance_create_params.InstanceCreateParams, ), @@ -1154,6 +1172,8 @@ def list( self, *, account_id: str, + order_by: Literal["created_at"] | Omit = omit, + order_by_direction: Literal["asc", "desc"] | Omit = omit, page: int | Omit = omit, per_page: int | Omit = omit, search: str | Omit = omit, @@ -1168,6 +1188,10 @@ def list( List instances. Args: + order_by: Order By Column Name + + order_by_direction: Order By Direction + search: Search by id extra_headers: Send extra headers @@ -1190,6 +1214,8 @@ def list( timeout=timeout, query=maybe_transform( { + "order_by": order_by, + "order_by_direction": order_by_direction, "page": page, "per_page": per_page, "search": search, diff --git a/src/cloudflare/resources/aisearch/instances/items.py b/src/cloudflare/resources/aisearch/instances/items.py index eaa492c2593..52f24c2ecec 100644 --- a/src/cloudflare/resources/aisearch/instances/items.py +++ b/src/cloudflare/resources/aisearch/instances/items.py @@ -2,7 +2,6 @@ from __future__ import annotations -from typing import Type, cast from typing_extensions import Literal import httpx @@ -17,11 +16,9 @@ async_to_raw_response_wrapper, async_to_streamed_response_wrapper, ) -from ...._wrappers import ResultWrapper from ....pagination import SyncV4PagePaginationArray, AsyncV4PagePaginationArray from ...._base_client import AsyncPaginator, make_request_options from ....types.aisearch.instances import item_list_params -from ....types.aisearch.instances.item_get_response import ItemGetResponse from ....types.aisearch.instances.item_list_response import ItemListResponse __all__ = ["ItemsResource", "AsyncItemsResource"] @@ -102,51 +99,6 @@ def list( model=ItemListResponse, ) - def get( - self, - item_id: str, - *, - account_id: str, - 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, - ) -> ItemGetResponse: - """ - Retrieves a specific indexed item from an AI Search instance. - - Args: - id: Use your AI Search ID. - - 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 id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - if not item_id: - raise ValueError(f"Expected a non-empty value for `item_id` but received {item_id!r}") - return self._get( - f"/accounts/{account_id}/ai-search/instances/{id}/items/{item_id}", - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper[ItemGetResponse]._unwrapper, - ), - cast_to=cast(Type[ItemGetResponse], ResultWrapper[ItemGetResponse]), - ) - class AsyncItemsResource(AsyncAPIResource): @cached_property @@ -223,51 +175,6 @@ def list( model=ItemListResponse, ) - async def get( - self, - item_id: str, - *, - account_id: str, - 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, - ) -> ItemGetResponse: - """ - Retrieves a specific indexed item from an AI Search instance. - - Args: - id: Use your AI Search ID. - - 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 id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - if not item_id: - raise ValueError(f"Expected a non-empty value for `item_id` but received {item_id!r}") - return await self._get( - f"/accounts/{account_id}/ai-search/instances/{id}/items/{item_id}", - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - post_parser=ResultWrapper[ItemGetResponse]._unwrapper, - ), - cast_to=cast(Type[ItemGetResponse], ResultWrapper[ItemGetResponse]), - ) - class ItemsResourceWithRawResponse: def __init__(self, items: ItemsResource) -> None: @@ -276,9 +183,6 @@ def __init__(self, items: ItemsResource) -> None: self.list = to_raw_response_wrapper( items.list, ) - self.get = to_raw_response_wrapper( - items.get, - ) class AsyncItemsResourceWithRawResponse: @@ -288,9 +192,6 @@ def __init__(self, items: AsyncItemsResource) -> None: self.list = async_to_raw_response_wrapper( items.list, ) - self.get = async_to_raw_response_wrapper( - items.get, - ) class ItemsResourceWithStreamingResponse: @@ -300,9 +201,6 @@ def __init__(self, items: ItemsResource) -> None: self.list = to_streamed_response_wrapper( items.list, ) - self.get = to_streamed_response_wrapper( - items.get, - ) class AsyncItemsResourceWithStreamingResponse: @@ -312,6 +210,3 @@ def __init__(self, items: AsyncItemsResource) -> None: self.list = async_to_streamed_response_wrapper( items.list, ) - self.get = async_to_streamed_response_wrapper( - items.get, - ) diff --git a/src/cloudflare/resources/aisearch/instances/jobs.py b/src/cloudflare/resources/aisearch/instances/jobs.py index d5c03bf6e7a..24ef439a64c 100644 --- a/src/cloudflare/resources/aisearch/instances/jobs.py +++ b/src/cloudflare/resources/aisearch/instances/jobs.py @@ -19,7 +19,7 @@ from ...._wrappers import ResultWrapper from ....pagination import SyncV4PagePaginationArray, AsyncV4PagePaginationArray from ...._base_client import AsyncPaginator, make_request_options -from ....types.aisearch.instances import job_list_params, job_logs_params +from ....types.aisearch.instances import job_list_params, job_logs_params, job_create_params from ....types.aisearch.instances.job_get_response import JobGetResponse from ....types.aisearch.instances.job_list_response import JobListResponse from ....types.aisearch.instances.job_logs_response import JobLogsResponse @@ -53,6 +53,7 @@ def create( id: str, *, account_id: str, + description: str | 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, @@ -80,6 +81,7 @@ def create( raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") return self._post( f"/accounts/{account_id}/ai-search/instances/{id}/jobs", + body=maybe_transform({"description": description}, job_create_params.JobCreateParams), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, @@ -266,6 +268,7 @@ async def create( id: str, *, account_id: str, + description: str | 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, @@ -293,6 +296,7 @@ async def create( raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") return await self._post( f"/accounts/{account_id}/ai-search/instances/{id}/jobs", + body=await async_maybe_transform({"description": description}, job_create_params.JobCreateParams), options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, diff --git a/src/cloudflare/resources/aisearch/tokens.py b/src/cloudflare/resources/aisearch/tokens.py index 8916dfecec0..94654a58c85 100644 --- a/src/cloudflare/resources/aisearch/tokens.py +++ b/src/cloudflare/resources/aisearch/tokens.py @@ -3,6 +3,7 @@ from __future__ import annotations from typing import Type, cast +from typing_extensions import Literal import httpx @@ -152,6 +153,8 @@ def list( self, *, account_id: str, + order_by: Literal["created_at"] | Omit = omit, + order_by_direction: Literal["asc", "desc"] | Omit = omit, page: int | Omit = omit, per_page: int | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -165,6 +168,10 @@ def list( List tokens. Args: + order_by: Order By Column Name + + order_by_direction: Order By Direction + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -185,6 +192,8 @@ def list( timeout=timeout, query=maybe_transform( { + "order_by": order_by, + "order_by_direction": order_by_direction, "page": page, "per_page": per_page, }, @@ -398,6 +407,8 @@ def list( self, *, account_id: str, + order_by: Literal["created_at"] | Omit = omit, + order_by_direction: Literal["asc", "desc"] | Omit = omit, page: int | Omit = omit, per_page: int | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -411,6 +422,10 @@ def list( List tokens. Args: + order_by: Order By Column Name + + order_by_direction: Order By Direction + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -431,6 +446,8 @@ def list( timeout=timeout, query=maybe_transform( { + "order_by": order_by, + "order_by_direction": order_by_direction, "page": page, "per_page": per_page, }, diff --git a/src/cloudflare/resources/api_gateway/configurations.py b/src/cloudflare/resources/api_gateway/configurations.py index 96cebe13223..bd62e5e568b 100644 --- a/src/cloudflare/resources/api_gateway/configurations.py +++ b/src/cloudflare/resources/api_gateway/configurations.py @@ -57,8 +57,10 @@ def update( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Configuration: - """ - Update configuration properties + """Updates API Shield configuration settings for a zone. + + Can modify validation + strictness, enforcement mode, and other global settings. Args: zone_id: Identifier. @@ -105,7 +107,8 @@ def get( timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Configuration: """ - Retrieve information about specific configuration properties + Gets the current API Shield configuration settings for a zone, including + validation behavior and enforcement mode. Args: zone_id: Identifier. @@ -169,8 +172,10 @@ async def update( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Configuration: - """ - Update configuration properties + """Updates API Shield configuration settings for a zone. + + Can modify validation + strictness, enforcement mode, and other global settings. Args: zone_id: Identifier. @@ -219,7 +224,8 @@ async def get( timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> Configuration: """ - Retrieve information about specific configuration properties + Gets the current API Shield configuration settings for a zone, including + validation behavior and enforcement mode. Args: zone_id: Identifier. diff --git a/src/cloudflare/resources/api_gateway/expression_template/fallthrough.py b/src/cloudflare/resources/api_gateway/expression_template/fallthrough.py index 1434470cfad..8f4d2735cd0 100644 --- a/src/cloudflare/resources/api_gateway/expression_template/fallthrough.py +++ b/src/cloudflare/resources/api_gateway/expression_template/fallthrough.py @@ -56,8 +56,10 @@ def create( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> FallthroughCreateResponse: - """ - Generate fallthrough WAF expression template from a set of API hosts + """Creates an expression template fallthrough rule for API Shield. + + Used for + configuring default behavior when no other expression templates match. Args: zone_id: Identifier. @@ -120,8 +122,10 @@ async def create( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> FallthroughCreateResponse: - """ - Generate fallthrough WAF expression template from a set of API hosts + """Creates an expression template fallthrough rule for API Shield. + + Used for + configuring default behavior when no other expression templates match. Args: zone_id: Identifier. diff --git a/src/cloudflare/resources/api_gateway/operations/operations.py b/src/cloudflare/resources/api_gateway/operations/operations.py index 1a6038c3688..f69385e3dd9 100644 --- a/src/cloudflare/resources/api_gateway/operations/operations.py +++ b/src/cloudflare/resources/api_gateway/operations/operations.py @@ -152,7 +152,8 @@ def list( timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SyncV4PagePaginationArray[OperationListResponse]: """ - Retrieve information about all operations on a zone + Lists all API operations tracked by API Shield for a zone with pagination. + Returns operation details including method, path, and feature configurations. Args: zone_id: Identifier. @@ -223,8 +224,10 @@ def delete( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> OperationDeleteResponse: - """ - Delete an operation + """Removes a single API operation from API Shield endpoint management. + + The + operation will no longer be tracked or protected by API Shield rules. Args: zone_id: Identifier. @@ -307,7 +310,8 @@ def bulk_delete( timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> OperationBulkDeleteResponse: """ - Delete multiple operations + Bulk removes multiple API operations from API Shield endpoint management in a + single request. Efficient for cleaning up unused endpoints. Args: zone_id: Identifier. @@ -344,7 +348,8 @@ def get( timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> OperationGetResponse: """ - Retrieve information about an operation + Gets detailed information about a specific API operation in API Shield, + including its schema validation settings and traffic statistics. Args: zone_id: Identifier. @@ -489,7 +494,8 @@ def list( timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AsyncPaginator[OperationListResponse, AsyncV4PagePaginationArray[OperationListResponse]]: """ - Retrieve information about all operations on a zone + Lists all API operations tracked by API Shield for a zone with pagination. + Returns operation details including method, path, and feature configurations. Args: zone_id: Identifier. @@ -560,8 +566,10 @@ async def delete( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> OperationDeleteResponse: - """ - Delete an operation + """Removes a single API operation from API Shield endpoint management. + + The + operation will no longer be tracked or protected by API Shield rules. Args: zone_id: Identifier. @@ -644,7 +652,8 @@ async def bulk_delete( timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> OperationBulkDeleteResponse: """ - Delete multiple operations + Bulk removes multiple API operations from API Shield endpoint management in a + single request. Efficient for cleaning up unused endpoints. Args: zone_id: Identifier. @@ -681,7 +690,8 @@ async def get( timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> OperationGetResponse: """ - Retrieve information about an operation + Gets detailed information about a specific API operation in API Shield, + including its schema validation settings and traffic statistics. Args: zone_id: Identifier. diff --git a/src/cloudflare/resources/api_gateway/user_schemas/hosts.py b/src/cloudflare/resources/api_gateway/user_schemas/hosts.py index 01861b64473..d193678ec7d 100644 --- a/src/cloudflare/resources/api_gateway/user_schemas/hosts.py +++ b/src/cloudflare/resources/api_gateway/user_schemas/hosts.py @@ -60,8 +60,10 @@ def list( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SyncV4PagePaginationArray[HostListResponse]: - """ - Retrieve schema hosts in a zone + """Lists all unique hosts found in uploaded OpenAPI schemas for the zone. + + Useful + for understanding which domains have schema coverage. Args: zone_id: Identifier. @@ -136,8 +138,10 @@ def list( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AsyncPaginator[HostListResponse, AsyncV4PagePaginationArray[HostListResponse]]: - """ - Retrieve schema hosts in a zone + """Lists all unique hosts found in uploaded OpenAPI schemas for the zone. + + Useful + for understanding which domains have schema coverage. Args: zone_id: Identifier. diff --git a/src/cloudflare/resources/api_gateway/user_schemas/user_schemas.py b/src/cloudflare/resources/api_gateway/user_schemas/user_schemas.py index e7d9626a705..346db5396d5 100644 --- a/src/cloudflare/resources/api_gateway/user_schemas/user_schemas.py +++ b/src/cloudflare/resources/api_gateway/user_schemas/user_schemas.py @@ -166,7 +166,8 @@ def list( timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SyncV4PagePaginationArray[OldPublicSchema]: """ - Retrieve information about all schemas on a zone + Lists all OpenAPI schemas uploaded to API Shield for the zone, including their + validation status and associated operations. Args: zone_id: Identifier. @@ -225,8 +226,10 @@ def delete( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> UserSchemaDeleteResponse: - """ - Delete a schema + """Permanently removes an uploaded OpenAPI schema from API Shield schema + validation. + + Operations using this schema will lose their validation rules. Args: zone_id: Identifier. @@ -267,8 +270,10 @@ def edit( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> OldPublicSchema: - """ - Enable validation for a schema + """Activates schema validation for an uploaded OpenAPI schema. + + Requests to matching + endpoints will be validated against the schema definitions. Args: zone_id: Identifier. @@ -319,7 +324,8 @@ def get( timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> OldPublicSchema: """ - Retrieve information about a specific schema on a zone + Gets detailed information about a specific uploaded OpenAPI schema, including + its contents and validation configuration. Args: zone_id: Identifier. @@ -468,7 +474,8 @@ def list( timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AsyncPaginator[OldPublicSchema, AsyncV4PagePaginationArray[OldPublicSchema]]: """ - Retrieve information about all schemas on a zone + Lists all OpenAPI schemas uploaded to API Shield for the zone, including their + validation status and associated operations. Args: zone_id: Identifier. @@ -527,8 +534,10 @@ async def delete( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> UserSchemaDeleteResponse: - """ - Delete a schema + """Permanently removes an uploaded OpenAPI schema from API Shield schema + validation. + + Operations using this schema will lose their validation rules. Args: zone_id: Identifier. @@ -569,8 +578,10 @@ async def edit( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> OldPublicSchema: - """ - Enable validation for a schema + """Activates schema validation for an uploaded OpenAPI schema. + + Requests to matching + endpoints will be validated against the schema definitions. Args: zone_id: Identifier. @@ -621,7 +632,8 @@ async def get( timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> OldPublicSchema: """ - Retrieve information about a specific schema on a zone + Gets detailed information about a specific uploaded OpenAPI schema, including + its contents and validation configuration. Args: zone_id: Identifier. diff --git a/src/cloudflare/resources/cloudforce_one/threat_events/datasets/datasets.py b/src/cloudflare/resources/cloudforce_one/threat_events/datasets/datasets.py index 6a430786bc9..6fb96b5cba8 100644 --- a/src/cloudflare/resources/cloudforce_one/threat_events/datasets/datasets.py +++ b/src/cloudflare/resources/cloudforce_one/threat_events/datasets/datasets.py @@ -236,8 +236,10 @@ def raw( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> DatasetRawResponse: - """ - Reads data for a raw event + """Retrieves the raw data associated with an event. + + Searches across all shards in + the dataset. Args: account_id: Account ID. @@ -480,8 +482,10 @@ async def raw( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> DatasetRawResponse: - """ - Reads data for a raw event + """Retrieves the raw data associated with an event. + + Searches across all shards in + the dataset. Args: account_id: Account ID. diff --git a/src/cloudflare/resources/email_security/investigate/investigate.py b/src/cloudflare/resources/email_security/investigate/investigate.py index 819279a8b67..d8057b8d8f3 100644 --- a/src/cloudflare/resources/email_security/investigate/investigate.py +++ b/src/cloudflare/resources/email_security/investigate/investigate.py @@ -142,6 +142,7 @@ 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"] | Omit = omit, message_id: str | Omit = omit, @@ -173,10 +174,13 @@ def list( detections_only: Determines if the search results will include detections or not. - domain: The sender domains the search filters by. + domain: Filter by a domain found in the email: sender domain, recipient domain, or a + domain in a link. end: The end of the search date range. Defaults to `now` if not provided. + exact_subject: Search for messages with an exact subject match. + final_disposition: The dispositions the search filters by. message_action: The message actions the search filters by. @@ -210,9 +214,16 @@ def list( - 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. + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -239,6 +250,7 @@ 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, @@ -270,7 +282,8 @@ def get( timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> InvestigateGetResponse: """ - Get message details + Retrieves detailed information about a specific email message, including + headers, metadata, and security scan results. Args: account_id: Account Identifier @@ -360,6 +373,7 @@ 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"] | Omit = omit, message_id: str | Omit = omit, @@ -391,10 +405,13 @@ def list( detections_only: Determines if the search results will include detections or not. - domain: The sender domains the search filters by. + domain: Filter by a domain found in the email: sender domain, recipient domain, or a + domain in a link. end: The end of the search date range. Defaults to `now` if not provided. + exact_subject: Search for messages with an exact subject match. + final_disposition: The dispositions the search filters by. message_action: The message actions the search filters by. @@ -428,9 +445,16 @@ def list( - 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. + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -457,6 +481,7 @@ 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, @@ -488,7 +513,8 @@ async def get( timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> InvestigateGetResponse: """ - Get message details + Retrieves detailed information about a specific email message, including + headers, metadata, and security scan results. Args: account_id: Account Identifier diff --git a/src/cloudflare/resources/email_security/investigate/move.py b/src/cloudflare/resources/email_security/investigate/move.py index f4a2267332a..1ca1bfc4536 100644 --- a/src/cloudflare/resources/email_security/investigate/move.py +++ b/src/cloudflare/resources/email_security/investigate/move.py @@ -61,7 +61,8 @@ def create( timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SyncSinglePage[MoveCreateResponse]: """ - Move a message + Moves a single email message to a different folder or changes its quarantine + status. Args: account_id: Account Identifier @@ -182,7 +183,8 @@ def create( timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AsyncPaginator[MoveCreateResponse, AsyncSinglePage[MoveCreateResponse]]: """ - Move a message + Moves a single email message to a different folder or changes its quarantine + status. Args: account_id: Account Identifier diff --git a/src/cloudflare/resources/email_security/investigate/preview.py b/src/cloudflare/resources/email_security/investigate/preview.py index eb256fad862..9c11c012ad6 100644 --- a/src/cloudflare/resources/email_security/investigate/preview.py +++ b/src/cloudflare/resources/email_security/investigate/preview.py @@ -58,7 +58,8 @@ def create( timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> PreviewCreateResponse: """ - Preview for non-detection messages + Generates a preview of an email message for safe viewing without executing any + embedded content. Args: account_id: Account Identifier @@ -167,7 +168,8 @@ async def create( timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> PreviewCreateResponse: """ - Preview for non-detection messages + Generates a preview of an email message for safe viewing without executing any + embedded content. Args: account_id: Account Identifier diff --git a/src/cloudflare/resources/email_security/investigate/reclassify.py b/src/cloudflare/resources/email_security/investigate/reclassify.py index 61efd16b622..479bece1b7f 100644 --- a/src/cloudflare/resources/email_security/investigate/reclassify.py +++ b/src/cloudflare/resources/email_security/investigate/reclassify.py @@ -60,7 +60,8 @@ def create( timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> object: """ - Change email classfication + Submits an email message for reclassification, updating its threat assessment + based on new analysis. Args: account_id: Account Identifier @@ -138,7 +139,8 @@ async def create( timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> object: """ - Change email classfication + Submits an email message for reclassification, updating its threat assessment + based on new analysis. Args: account_id: Account Identifier diff --git a/src/cloudflare/resources/email_security/investigate/release.py b/src/cloudflare/resources/email_security/investigate/release.py index 12789ed5119..1fe506c920d 100644 --- a/src/cloudflare/resources/email_security/investigate/release.py +++ b/src/cloudflare/resources/email_security/investigate/release.py @@ -54,7 +54,8 @@ def bulk( timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SyncSinglePage[ReleaseBulkResponse]: """ - Release messages from quarantine + Releases a quarantined email message, allowing it to be delivered to the + recipient. Args: account_id: Account Identifier @@ -116,7 +117,8 @@ def bulk( timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AsyncPaginator[ReleaseBulkResponse, AsyncSinglePage[ReleaseBulkResponse]]: """ - Release messages from quarantine + Releases a quarantined email message, allowing it to be delivered to the + recipient. Args: account_id: Account Identifier diff --git a/src/cloudflare/resources/email_security/investigate/trace.py b/src/cloudflare/resources/email_security/investigate/trace.py index 6ca1601d587..8bfb16d9696 100644 --- a/src/cloudflare/resources/email_security/investigate/trace.py +++ b/src/cloudflare/resources/email_security/investigate/trace.py @@ -55,7 +55,8 @@ def get( timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> TraceGetResponse: """ - Get email trace + Gets the delivery trace for an email message, showing its path through email + security processing. Args: account_id: Account Identifier @@ -120,7 +121,8 @@ async def get( timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> TraceGetResponse: """ - Get email trace + Gets the delivery trace for an email message, showing its path through email + security processing. Args: account_id: Account Identifier diff --git a/src/cloudflare/resources/email_security/phishguard/reports.py b/src/cloudflare/resources/email_security/phishguard/reports.py index 880fe8397f2..14e10e977f3 100644 --- a/src/cloudflare/resources/email_security/phishguard/reports.py +++ b/src/cloudflare/resources/email_security/phishguard/reports.py @@ -61,7 +61,8 @@ def list( timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SyncSinglePage[ReportListResponse]: """ - Get `PhishGuard` reports + Retrieves `PhishGuard` reports showing phishing attempts and suspicious email + patterns detected. Args: account_id: Account Identifier @@ -138,7 +139,8 @@ def list( timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AsyncPaginator[ReportListResponse, AsyncSinglePage[ReportListResponse]]: """ - Get `PhishGuard` reports + Retrieves `PhishGuard` reports showing phishing attempts and suspicious email + patterns detected. Args: account_id: Account Identifier diff --git a/src/cloudflare/resources/email_security/settings/allow_policies.py b/src/cloudflare/resources/email_security/settings/allow_policies.py index a2b0da56230..05d886a4b0f 100644 --- a/src/cloudflare/resources/email_security/settings/allow_policies.py +++ b/src/cloudflare/resources/email_security/settings/allow_policies.py @@ -77,7 +77,8 @@ def create( timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AllowPolicyCreateResponse: """ - Create an email allow policy + Creates a new email allow policy that permits specific senders, domains, or + patterns to bypass security scanning. Args: account_id: Account Identifier @@ -227,8 +228,10 @@ def delete( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AllowPolicyDeleteResponse: - """ - Delete an email allow policy + """Removes an email allow policy. + + Previously allowed senders will be subject to + normal security scanning. Args: account_id: Account Identifier @@ -278,7 +281,8 @@ def edit( timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AllowPolicyEditResponse: """ - Update an email allow policy + Updates an existing email allow policy, modifying its matching criteria or + scope. Args: account_id: Account Identifier @@ -344,7 +348,8 @@ def get( timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AllowPolicyGetResponse: """ - Get an email allow policy + Retrieves details for a specific email allow policy, including its matching + criteria and scope. Args: account_id: Account Identifier @@ -417,7 +422,8 @@ async def create( timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AllowPolicyCreateResponse: """ - Create an email allow policy + Creates a new email allow policy that permits specific senders, domains, or + patterns to bypass security scanning. Args: account_id: Account Identifier @@ -567,8 +573,10 @@ async def delete( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AllowPolicyDeleteResponse: - """ - Delete an email allow policy + """Removes an email allow policy. + + Previously allowed senders will be subject to + normal security scanning. Args: account_id: Account Identifier @@ -618,7 +626,8 @@ async def edit( timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AllowPolicyEditResponse: """ - Update an email allow policy + Updates an existing email allow policy, modifying its matching criteria or + scope. Args: account_id: Account Identifier @@ -684,7 +693,8 @@ async def get( timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AllowPolicyGetResponse: """ - Get an email allow policy + Retrieves details for a specific email allow policy, including its matching + criteria and scope. Args: account_id: Account Identifier diff --git a/src/cloudflare/resources/email_security/settings/block_senders.py b/src/cloudflare/resources/email_security/settings/block_senders.py index 350053cb5b4..c4f72b56dc6 100644 --- a/src/cloudflare/resources/email_security/settings/block_senders.py +++ b/src/cloudflare/resources/email_security/settings/block_senders.py @@ -70,7 +70,8 @@ def create( timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> BlockSenderCreateResponse: """ - Create a blocked email sender + Adds a sender pattern to the email block list, preventing messages from matching + senders from being delivered. Args: account_id: Account Identifier @@ -125,7 +126,7 @@ def list( timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SyncV4PagePaginationArray[BlockSenderListResponse]: """ - List blocked email senders + Lists all blocked sender entries with their patterns and block reasons. Args: account_id: Account Identifier @@ -189,7 +190,8 @@ def delete( timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> BlockSenderDeleteResponse: """ - Delete a blocked email sender + Removes a sender from the email block list, allowing their messages to be + delivered normally. Args: account_id: Account Identifier @@ -235,7 +237,7 @@ def edit( timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> BlockSenderEditResponse: """ - Update a blocked email sender + Modifies a blocked sender entry, updating its pattern or block reason. Args: account_id: Account Identifier @@ -286,7 +288,8 @@ def get( timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> BlockSenderGetResponse: """ - Get a blocked email sender + Gets information about a specific blocked sender entry, including the pattern + and block reason. Args: account_id: Account Identifier @@ -352,7 +355,8 @@ async def create( timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> BlockSenderCreateResponse: """ - Create a blocked email sender + Adds a sender pattern to the email block list, preventing messages from matching + senders from being delivered. Args: account_id: Account Identifier @@ -407,7 +411,7 @@ def list( timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AsyncPaginator[BlockSenderListResponse, AsyncV4PagePaginationArray[BlockSenderListResponse]]: """ - List blocked email senders + Lists all blocked sender entries with their patterns and block reasons. Args: account_id: Account Identifier @@ -471,7 +475,8 @@ async def delete( timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> BlockSenderDeleteResponse: """ - Delete a blocked email sender + Removes a sender from the email block list, allowing their messages to be + delivered normally. Args: account_id: Account Identifier @@ -517,7 +522,7 @@ async def edit( timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> BlockSenderEditResponse: """ - Update a blocked email sender + Modifies a blocked sender entry, updating its pattern or block reason. Args: account_id: Account Identifier @@ -568,7 +573,8 @@ async def get( timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> BlockSenderGetResponse: """ - Get a blocked email sender + Gets information about a specific blocked sender entry, including the pattern + and block reason. Args: account_id: Account Identifier diff --git a/src/cloudflare/resources/email_security/settings/domains.py b/src/cloudflare/resources/email_security/settings/domains.py index 9f8f717056a..cfe78def266 100644 --- a/src/cloudflare/resources/email_security/settings/domains.py +++ b/src/cloudflare/resources/email_security/settings/domains.py @@ -186,7 +186,8 @@ def bulk_delete( timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SyncSinglePage[DomainBulkDeleteResponse]: """ - Unprotect multiple email domains + Bulk removes multiple domains from email security configuration in a single + request. Args: account_id: Account Identifier @@ -249,7 +250,7 @@ def edit( timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> DomainEditResponse: """ - Update an email domain + Updates configuration for a domain in email security. Args: account_id: Account Identifier @@ -307,7 +308,7 @@ def get( timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> DomainGetResponse: """ - Get an email domain + Gets configuration details for a specific domain in email security. Args: account_id: Account Identifier @@ -493,7 +494,8 @@ def bulk_delete( timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AsyncPaginator[DomainBulkDeleteResponse, AsyncSinglePage[DomainBulkDeleteResponse]]: """ - Unprotect multiple email domains + Bulk removes multiple domains from email security configuration in a single + request. Args: account_id: Account Identifier @@ -556,7 +558,7 @@ async def edit( timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> DomainEditResponse: """ - Update an email domain + Updates configuration for a domain in email security. Args: account_id: Account Identifier @@ -614,7 +616,7 @@ async def get( timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> DomainGetResponse: """ - Get an email domain + Gets configuration details for a specific domain in email security. Args: account_id: Account Identifier diff --git a/src/cloudflare/resources/email_security/settings/impersonation_registry.py b/src/cloudflare/resources/email_security/settings/impersonation_registry.py index e5dcaae2429..988929ff74d 100644 --- a/src/cloudflare/resources/email_security/settings/impersonation_registry.py +++ b/src/cloudflare/resources/email_security/settings/impersonation_registry.py @@ -69,7 +69,7 @@ def create( timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> ImpersonationRegistryCreateResponse: """ - Create an entry in impersonation registry + Creates a display name entry for email security impersonation protection. Args: account_id: Account Identifier @@ -186,7 +186,7 @@ def delete( timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> ImpersonationRegistryDeleteResponse: """ - Delete an entry from impersonation registry + Removes a display name from impersonation protection monitoring. Args: account_id: Account Identifier @@ -229,7 +229,7 @@ def edit( timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> ImpersonationRegistryEditResponse: """ - Update an entry in impersonation registry + Updates a display name entry used for impersonation protection. Args: account_id: Account Identifier @@ -277,7 +277,7 @@ def get( timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> ImpersonationRegistryGetResponse: """ - Get an entry in impersonation registry + Retrieves a display name entry used for impersonation protection. Args: account_id: Account Identifier @@ -340,7 +340,7 @@ async def create( timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> ImpersonationRegistryCreateResponse: """ - Create an entry in impersonation registry + Creates a display name entry for email security impersonation protection. Args: account_id: Account Identifier @@ -459,7 +459,7 @@ async def delete( timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> ImpersonationRegistryDeleteResponse: """ - Delete an entry from impersonation registry + Removes a display name from impersonation protection monitoring. Args: account_id: Account Identifier @@ -502,7 +502,7 @@ async def edit( timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> ImpersonationRegistryEditResponse: """ - Update an entry in impersonation registry + Updates a display name entry used for impersonation protection. Args: account_id: Account Identifier @@ -550,7 +550,7 @@ async def get( timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> ImpersonationRegistryGetResponse: """ - Get an entry in impersonation registry + Retrieves a display name entry used for impersonation protection. Args: account_id: Account Identifier diff --git a/src/cloudflare/resources/email_security/settings/trusted_domains.py b/src/cloudflare/resources/email_security/settings/trusted_domains.py index 184b212d2ee..e79b273cc4e 100644 --- a/src/cloudflare/resources/email_security/settings/trusted_domains.py +++ b/src/cloudflare/resources/email_security/settings/trusted_domains.py @@ -72,7 +72,8 @@ def create( timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> TrustedDomainCreateResponse: """ - Create a trusted email domain + Adds a domain to the trusted domains list for email security, reducing false + positive detections. Args: account_id: Account Identifier @@ -107,7 +108,8 @@ def create( timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> TrustedDomainCreateResponse: """ - Create a trusted email domain + Adds a domain to the trusted domains list for email security, reducing false + positive detections. Args: account_id: Account Identifier @@ -255,7 +257,8 @@ def delete( timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> TrustedDomainDeleteResponse: """ - Delete a trusted email domain + Removes a domain from the trusted domains list, subjecting it to normal security + scanning. Args: account_id: Account Identifier @@ -302,7 +305,7 @@ def edit( timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> TrustedDomainEditResponse: """ - Update a trusted email domain + Modifies a trusted domain entry's configuration. Args: account_id: Account Identifier @@ -360,7 +363,7 @@ def get( timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> TrustedDomainGetResponse: """ - Get a trusted email domain + Gets information about a specific trusted domain entry. Args: account_id: Account Identifier @@ -428,7 +431,8 @@ async def create( timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> TrustedDomainCreateResponse: """ - Create a trusted email domain + Adds a domain to the trusted domains list for email security, reducing false + positive detections. Args: account_id: Account Identifier @@ -463,7 +467,8 @@ async def create( timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> TrustedDomainCreateResponse: """ - Create a trusted email domain + Adds a domain to the trusted domains list for email security, reducing false + positive detections. Args: account_id: Account Identifier @@ -611,7 +616,8 @@ async def delete( timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> TrustedDomainDeleteResponse: """ - Delete a trusted email domain + Removes a domain from the trusted domains list, subjecting it to normal security + scanning. Args: account_id: Account Identifier @@ -658,7 +664,7 @@ async def edit( timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> TrustedDomainEditResponse: """ - Update a trusted email domain + Modifies a trusted domain entry's configuration. Args: account_id: Account Identifier @@ -716,7 +722,7 @@ async def get( timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> TrustedDomainGetResponse: """ - Get a trusted email domain + Gets information about a specific trusted domain entry. Args: account_id: Account Identifier diff --git a/src/cloudflare/resources/email_security/submissions.py b/src/cloudflare/resources/email_security/submissions.py index 5eff9c1c234..685b8ee74de 100644 --- a/src/cloudflare/resources/email_security/submissions.py +++ b/src/cloudflare/resources/email_security/submissions.py @@ -50,6 +50,7 @@ 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, @@ -103,6 +104,7 @@ def list( timeout=timeout, query=maybe_transform( { + "customer_status": customer_status, "end": end, "original_disposition": original_disposition, "outcome_disposition": outcome_disposition, @@ -146,6 +148,7 @@ 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, @@ -199,6 +202,7 @@ 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/apps.py b/src/cloudflare/resources/magic_transit/apps.py index 11604493a1f..9a394b05499 100644 --- a/src/cloudflare/resources/magic_transit/apps.py +++ b/src/cloudflare/resources/magic_transit/apps.py @@ -57,6 +57,7 @@ def create( type: str, hostnames: SequenceNotStr[str] | Omit = omit, ip_subnets: SequenceNotStr[str] | Omit = omit, + source_subnets: SequenceNotStr[str] | 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, @@ -79,6 +80,9 @@ def create( ip_subnets: IPv4 CIDRs to associate with traffic decisions. (IPv6 CIDRs are currently unsupported) + source_subnets: IPv4 CIDRs to associate with traffic decisions. (IPv6 CIDRs are currently + unsupported) + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -97,6 +101,7 @@ def create( "type": type, "hostnames": hostnames, "ip_subnets": ip_subnets, + "source_subnets": source_subnets, }, app_create_params.AppCreateParams, ), @@ -118,6 +123,7 @@ def update( hostnames: SequenceNotStr[str] | Omit = omit, ip_subnets: SequenceNotStr[str] | Omit = omit, name: str | Omit = omit, + source_subnets: SequenceNotStr[str] | Omit = omit, type: str | 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. @@ -141,6 +147,9 @@ def update( name: Display name for the app. + source_subnets: IPv4 CIDRs to associate with traffic decisions. (IPv6 CIDRs are currently + unsupported) + type: Category of the app. extra_headers: Send extra headers @@ -162,6 +171,7 @@ def update( "hostnames": hostnames, "ip_subnets": ip_subnets, "name": name, + "source_subnets": source_subnets, "type": type, }, app_update_params.AppUpdateParams, @@ -264,6 +274,7 @@ def edit( hostnames: SequenceNotStr[str] | Omit = omit, ip_subnets: SequenceNotStr[str] | Omit = omit, name: str | Omit = omit, + source_subnets: SequenceNotStr[str] | Omit = omit, type: str | 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. @@ -287,6 +298,9 @@ def edit( name: Display name for the app. + source_subnets: IPv4 CIDRs to associate with traffic decisions. (IPv6 CIDRs are currently + unsupported) + type: Category of the app. extra_headers: Send extra headers @@ -308,6 +322,7 @@ def edit( "hostnames": hostnames, "ip_subnets": ip_subnets, "name": name, + "source_subnets": source_subnets, "type": type, }, app_edit_params.AppEditParams, @@ -351,6 +366,7 @@ async def create( type: str, hostnames: SequenceNotStr[str] | Omit = omit, ip_subnets: SequenceNotStr[str] | Omit = omit, + source_subnets: SequenceNotStr[str] | 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, @@ -373,6 +389,9 @@ async def create( ip_subnets: IPv4 CIDRs to associate with traffic decisions. (IPv6 CIDRs are currently unsupported) + source_subnets: IPv4 CIDRs to associate with traffic decisions. (IPv6 CIDRs are currently + unsupported) + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -391,6 +410,7 @@ async def create( "type": type, "hostnames": hostnames, "ip_subnets": ip_subnets, + "source_subnets": source_subnets, }, app_create_params.AppCreateParams, ), @@ -412,6 +432,7 @@ async def update( hostnames: SequenceNotStr[str] | Omit = omit, ip_subnets: SequenceNotStr[str] | Omit = omit, name: str | Omit = omit, + source_subnets: SequenceNotStr[str] | Omit = omit, type: str | 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. @@ -435,6 +456,9 @@ async def update( name: Display name for the app. + source_subnets: IPv4 CIDRs to associate with traffic decisions. (IPv6 CIDRs are currently + unsupported) + type: Category of the app. extra_headers: Send extra headers @@ -456,6 +480,7 @@ async def update( "hostnames": hostnames, "ip_subnets": ip_subnets, "name": name, + "source_subnets": source_subnets, "type": type, }, app_update_params.AppUpdateParams, @@ -558,6 +583,7 @@ async def edit( hostnames: SequenceNotStr[str] | Omit = omit, ip_subnets: SequenceNotStr[str] | Omit = omit, name: str | Omit = omit, + source_subnets: SequenceNotStr[str] | Omit = omit, type: str | 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. @@ -581,6 +607,9 @@ async def edit( name: Display name for the app. + source_subnets: IPv4 CIDRs to associate with traffic decisions. (IPv6 CIDRs are currently + unsupported) + type: Category of the app. extra_headers: Send extra headers @@ -602,6 +631,7 @@ async def edit( "hostnames": hostnames, "ip_subnets": ip_subnets, "name": name, + "source_subnets": source_subnets, "type": type, }, app_edit_params.AppEditParams, diff --git a/src/cloudflare/resources/magic_transit/connectors/connectors.py b/src/cloudflare/resources/magic_transit/connectors/connectors.py index 961707d44dc..f757d6a4b8d 100644 --- a/src/cloudflare/resources/magic_transit/connectors/connectors.py +++ b/src/cloudflare/resources/magic_transit/connectors/connectors.py @@ -2,11 +2,12 @@ from __future__ import annotations -from typing import Type, cast +from typing import List, Type, cast +from typing_extensions import Literal import httpx -from ...._types import Body, Omit, Query, Headers, NotGiven, omit, not_given +from ...._types import Body, Omit, Query, Headers, NotGiven, SequenceNotStr, omit, not_given from ...._utils import maybe_transform, async_maybe_transform from ...._compat import cached_property from ...._resource import SyncAPIResource, AsyncAPIResource @@ -80,7 +81,12 @@ def create( account_id: str, device: connector_create_params.Device, activated: bool | Omit = omit, + interrupt_window_days_of_week: List[ + Literal["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"] + ] + | Omit = omit, interrupt_window_duration_hours: float | Omit = omit, + interrupt_window_embargo_dates: SequenceNotStr[str] | Omit = omit, interrupt_window_hour_of_day: float | Omit = omit, notes: str | Omit = omit, timezone: str | Omit = omit, @@ -99,6 +105,10 @@ def create( device: Exactly one of id, serial_number, or provision_license must be provided. + interrupt_window_days_of_week: Allowed days of the week for upgrades. Default is all days. + + interrupt_window_embargo_dates: List of dates (YYYY-MM-DD) when upgrades are blocked. + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -115,7 +125,9 @@ def create( { "device": device, "activated": activated, + "interrupt_window_days_of_week": interrupt_window_days_of_week, "interrupt_window_duration_hours": interrupt_window_duration_hours, + "interrupt_window_embargo_dates": interrupt_window_embargo_dates, "interrupt_window_hour_of_day": interrupt_window_hour_of_day, "notes": notes, "timezone": timezone, @@ -138,7 +150,12 @@ def update( *, account_id: str, activated: bool | Omit = omit, + interrupt_window_days_of_week: List[ + Literal["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"] + ] + | Omit = omit, interrupt_window_duration_hours: float | Omit = omit, + interrupt_window_embargo_dates: SequenceNotStr[str] | Omit = omit, interrupt_window_hour_of_day: float | Omit = omit, notes: str | Omit = omit, provision_license: bool | Omit = omit, @@ -156,6 +173,10 @@ def update( Args: account_id: Account identifier + interrupt_window_days_of_week: Allowed days of the week for upgrades. Default is all days. + + interrupt_window_embargo_dates: List of dates (YYYY-MM-DD) when upgrades are blocked. + provision_license: When true, regenerate license key for the connector. extra_headers: Send extra headers @@ -175,7 +196,9 @@ def update( body=maybe_transform( { "activated": activated, + "interrupt_window_days_of_week": interrupt_window_days_of_week, "interrupt_window_duration_hours": interrupt_window_duration_hours, + "interrupt_window_embargo_dates": interrupt_window_embargo_dates, "interrupt_window_hour_of_day": interrupt_window_hour_of_day, "notes": notes, "provision_license": provision_license, @@ -277,7 +300,12 @@ def edit( *, account_id: str, activated: bool | Omit = omit, + interrupt_window_days_of_week: List[ + Literal["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"] + ] + | Omit = omit, interrupt_window_duration_hours: float | Omit = omit, + interrupt_window_embargo_dates: SequenceNotStr[str] | Omit = omit, interrupt_window_hour_of_day: float | Omit = omit, notes: str | Omit = omit, provision_license: bool | Omit = omit, @@ -295,6 +323,10 @@ def edit( Args: account_id: Account identifier + interrupt_window_days_of_week: Allowed days of the week for upgrades. Default is all days. + + interrupt_window_embargo_dates: List of dates (YYYY-MM-DD) when upgrades are blocked. + provision_license: When true, regenerate license key for the connector. extra_headers: Send extra headers @@ -314,7 +346,9 @@ def edit( body=maybe_transform( { "activated": activated, + "interrupt_window_days_of_week": interrupt_window_days_of_week, "interrupt_window_duration_hours": interrupt_window_duration_hours, + "interrupt_window_embargo_dates": interrupt_window_embargo_dates, "interrupt_window_hour_of_day": interrupt_window_hour_of_day, "notes": notes, "provision_license": provision_license, @@ -409,7 +443,12 @@ async def create( account_id: str, device: connector_create_params.Device, activated: bool | Omit = omit, + interrupt_window_days_of_week: List[ + Literal["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"] + ] + | Omit = omit, interrupt_window_duration_hours: float | Omit = omit, + interrupt_window_embargo_dates: SequenceNotStr[str] | Omit = omit, interrupt_window_hour_of_day: float | Omit = omit, notes: str | Omit = omit, timezone: str | Omit = omit, @@ -428,6 +467,10 @@ async def create( device: Exactly one of id, serial_number, or provision_license must be provided. + interrupt_window_days_of_week: Allowed days of the week for upgrades. Default is all days. + + interrupt_window_embargo_dates: List of dates (YYYY-MM-DD) when upgrades are blocked. + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -444,7 +487,9 @@ async def create( { "device": device, "activated": activated, + "interrupt_window_days_of_week": interrupt_window_days_of_week, "interrupt_window_duration_hours": interrupt_window_duration_hours, + "interrupt_window_embargo_dates": interrupt_window_embargo_dates, "interrupt_window_hour_of_day": interrupt_window_hour_of_day, "notes": notes, "timezone": timezone, @@ -467,7 +512,12 @@ async def update( *, account_id: str, activated: bool | Omit = omit, + interrupt_window_days_of_week: List[ + Literal["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"] + ] + | Omit = omit, interrupt_window_duration_hours: float | Omit = omit, + interrupt_window_embargo_dates: SequenceNotStr[str] | Omit = omit, interrupt_window_hour_of_day: float | Omit = omit, notes: str | Omit = omit, provision_license: bool | Omit = omit, @@ -485,6 +535,10 @@ async def update( Args: account_id: Account identifier + interrupt_window_days_of_week: Allowed days of the week for upgrades. Default is all days. + + interrupt_window_embargo_dates: List of dates (YYYY-MM-DD) when upgrades are blocked. + provision_license: When true, regenerate license key for the connector. extra_headers: Send extra headers @@ -504,7 +558,9 @@ async def update( body=await async_maybe_transform( { "activated": activated, + "interrupt_window_days_of_week": interrupt_window_days_of_week, "interrupt_window_duration_hours": interrupt_window_duration_hours, + "interrupt_window_embargo_dates": interrupt_window_embargo_dates, "interrupt_window_hour_of_day": interrupt_window_hour_of_day, "notes": notes, "provision_license": provision_license, @@ -606,7 +662,12 @@ async def edit( *, account_id: str, activated: bool | Omit = omit, + interrupt_window_days_of_week: List[ + Literal["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"] + ] + | Omit = omit, interrupt_window_duration_hours: float | Omit = omit, + interrupt_window_embargo_dates: SequenceNotStr[str] | Omit = omit, interrupt_window_hour_of_day: float | Omit = omit, notes: str | Omit = omit, provision_license: bool | Omit = omit, @@ -624,6 +685,10 @@ async def edit( Args: account_id: Account identifier + interrupt_window_days_of_week: Allowed days of the week for upgrades. Default is all days. + + interrupt_window_embargo_dates: List of dates (YYYY-MM-DD) when upgrades are blocked. + provision_license: When true, regenerate license key for the connector. extra_headers: Send extra headers @@ -643,7 +708,9 @@ async def edit( body=await async_maybe_transform( { "activated": activated, + "interrupt_window_days_of_week": interrupt_window_days_of_week, "interrupt_window_duration_hours": interrupt_window_duration_hours, + "interrupt_window_embargo_dates": interrupt_window_embargo_dates, "interrupt_window_hour_of_day": interrupt_window_hour_of_day, "notes": notes, "provision_license": provision_license, diff --git a/src/cloudflare/resources/magic_transit/sites/lans.py b/src/cloudflare/resources/magic_transit/sites/lans.py index a38a961f721..baab5990753 100644 --- a/src/cloudflare/resources/magic_transit/sites/lans.py +++ b/src/cloudflare/resources/magic_transit/sites/lans.py @@ -59,6 +59,8 @@ def create( account_id: str, bond_id: int | Omit = omit, ha_link: bool | Omit = omit, + is_breakout: bool | Omit = omit, + is_prioritized: bool | Omit = omit, name: str | Omit = omit, nat: NatParam | Omit = omit, physport: int | Omit = omit, @@ -85,6 +87,10 @@ def create( ha_link: mark true to use this LAN for HA probing. only works for site with HA turned on. only one LAN can be set as the ha_link. + is_breakout: mark true to use this LAN for source-based breakout traffic + + is_prioritized: mark true to use this LAN for source-based prioritized traffic + static_addressing: If the site is not configured in high availability mode, this configuration is optional (if omitted, use DHCP). However, if in high availability mode, static_address is required along with secondary and virtual address. @@ -110,6 +116,8 @@ def create( { "bond_id": bond_id, "ha_link": ha_link, + "is_breakout": is_breakout, + "is_prioritized": is_prioritized, "name": name, "nat": nat, "physport": physport, @@ -133,6 +141,8 @@ def update( account_id: str, site_id: str, bond_id: int | Omit = omit, + is_breakout: bool | Omit = omit, + is_prioritized: bool | Omit = omit, name: str | Omit = omit, nat: NatParam | Omit = omit, physport: int | Omit = omit, @@ -156,6 +166,10 @@ def update( lan_id: Identifier + is_breakout: mark true to use this LAN for source-based breakout traffic + + is_prioritized: mark true to use this LAN for source-based prioritized traffic + static_addressing: If the site is not configured in high availability mode, this configuration is optional (if omitted, use DHCP). However, if in high availability mode, static_address is required along with secondary and virtual address. @@ -181,6 +195,8 @@ def update( body=maybe_transform( { "bond_id": bond_id, + "is_breakout": is_breakout, + "is_prioritized": is_prioritized, "name": name, "nat": nat, "physport": physport, @@ -297,6 +313,8 @@ def edit( account_id: str, site_id: str, bond_id: int | Omit = omit, + is_breakout: bool | Omit = omit, + is_prioritized: bool | Omit = omit, name: str | Omit = omit, nat: NatParam | Omit = omit, physport: int | Omit = omit, @@ -320,6 +338,10 @@ def edit( lan_id: Identifier + is_breakout: mark true to use this LAN for source-based breakout traffic + + is_prioritized: mark true to use this LAN for source-based prioritized traffic + static_addressing: If the site is not configured in high availability mode, this configuration is optional (if omitted, use DHCP). However, if in high availability mode, static_address is required along with secondary and virtual address. @@ -345,6 +367,8 @@ def edit( body=maybe_transform( { "bond_id": bond_id, + "is_breakout": is_breakout, + "is_prioritized": is_prioritized, "name": name, "nat": nat, "physport": physport, @@ -441,6 +465,8 @@ def create( account_id: str, bond_id: int | Omit = omit, ha_link: bool | Omit = omit, + is_breakout: bool | Omit = omit, + is_prioritized: bool | Omit = omit, name: str | Omit = omit, nat: NatParam | Omit = omit, physport: int | Omit = omit, @@ -467,6 +493,10 @@ def create( ha_link: mark true to use this LAN for HA probing. only works for site with HA turned on. only one LAN can be set as the ha_link. + is_breakout: mark true to use this LAN for source-based breakout traffic + + is_prioritized: mark true to use this LAN for source-based prioritized traffic + static_addressing: If the site is not configured in high availability mode, this configuration is optional (if omitted, use DHCP). However, if in high availability mode, static_address is required along with secondary and virtual address. @@ -492,6 +522,8 @@ def create( { "bond_id": bond_id, "ha_link": ha_link, + "is_breakout": is_breakout, + "is_prioritized": is_prioritized, "name": name, "nat": nat, "physport": physport, @@ -515,6 +547,8 @@ async def update( account_id: str, site_id: str, bond_id: int | Omit = omit, + is_breakout: bool | Omit = omit, + is_prioritized: bool | Omit = omit, name: str | Omit = omit, nat: NatParam | Omit = omit, physport: int | Omit = omit, @@ -538,6 +572,10 @@ async def update( lan_id: Identifier + is_breakout: mark true to use this LAN for source-based breakout traffic + + is_prioritized: mark true to use this LAN for source-based prioritized traffic + static_addressing: If the site is not configured in high availability mode, this configuration is optional (if omitted, use DHCP). However, if in high availability mode, static_address is required along with secondary and virtual address. @@ -563,6 +601,8 @@ async def update( body=await async_maybe_transform( { "bond_id": bond_id, + "is_breakout": is_breakout, + "is_prioritized": is_prioritized, "name": name, "nat": nat, "physport": physport, @@ -679,6 +719,8 @@ async def edit( account_id: str, site_id: str, bond_id: int | Omit = omit, + is_breakout: bool | Omit = omit, + is_prioritized: bool | Omit = omit, name: str | Omit = omit, nat: NatParam | Omit = omit, physport: int | Omit = omit, @@ -702,6 +744,10 @@ async def edit( lan_id: Identifier + is_breakout: mark true to use this LAN for source-based breakout traffic + + is_prioritized: mark true to use this LAN for source-based prioritized traffic + static_addressing: If the site is not configured in high availability mode, this configuration is optional (if omitted, use DHCP). However, if in high availability mode, static_address is required along with secondary and virtual address. @@ -727,6 +773,8 @@ async def edit( body=await async_maybe_transform( { "bond_id": bond_id, + "is_breakout": is_breakout, + "is_prioritized": is_prioritized, "name": name, "nat": nat, "physport": physport, diff --git a/src/cloudflare/resources/radar/ai/inference/inference.py b/src/cloudflare/resources/radar/ai/inference/inference.py index 8a3e3da863e..08ae1e5b9ce 100644 --- a/src/cloudflare/resources/radar/ai/inference/inference.py +++ b/src/cloudflare/resources/radar/ai/inference/inference.py @@ -177,7 +177,7 @@ def timeseries_groups_v2( limit_per_group: int | Omit = omit, location: SequenceNotStr[str] | Omit = omit, name: SequenceNotStr[str] | Omit = omit, - normalization: Literal["PERCENTAGE_CHANGE", "MIN0_MAX"] | Omit = omit, + normalization: Literal["PERCENTAGE", "MIN0_MAX"] | 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, @@ -401,7 +401,7 @@ async def timeseries_groups_v2( limit_per_group: int | Omit = omit, location: SequenceNotStr[str] | Omit = omit, name: SequenceNotStr[str] | Omit = omit, - normalization: Literal["PERCENTAGE_CHANGE", "MIN0_MAX"] | Omit = omit, + normalization: Literal["PERCENTAGE", "MIN0_MAX"] | 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, diff --git a/src/cloudflare/resources/radar/ai/to_markdown.py b/src/cloudflare/resources/radar/ai/to_markdown.py index 8c4db60fd81..1e675de3355 100644 --- a/src/cloudflare/resources/radar/ai/to_markdown.py +++ b/src/cloudflare/resources/radar/ai/to_markdown.py @@ -69,7 +69,7 @@ def create( timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SyncSinglePage[ToMarkdownCreateResponse]: """ - Convert Files into Markdown + Converts uploaded files into Markdown format using Workers AI. Args: extra_headers: Send extra headers @@ -137,7 +137,7 @@ def create( timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AsyncPaginator[ToMarkdownCreateResponse, AsyncSinglePage[ToMarkdownCreateResponse]]: """ - Convert Files into Markdown + Converts uploaded files into Markdown format using Workers AI. Args: extra_headers: Send extra headers diff --git a/src/cloudflare/resources/radar/dns/dns.py b/src/cloudflare/resources/radar/dns/dns.py index fd383b017c0..539c48177f4 100644 --- a/src/cloudflare/resources/radar/dns/dns.py +++ b/src/cloudflare/resources/radar/dns/dns.py @@ -87,11 +87,13 @@ def with_streaming_response(self) -> DNSResourceWithStreamingResponse: def summary_v2( self, dimension: Literal[ - "IP_VERSION", + "AS", "CACHE_HIT", "DNSSEC", "DNSSEC_AWARE", "DNSSEC_E2E", + "IP_VERSION", + "LOCATION", "MATCHING_ANSWER", "PROTOCOL", "QUERY_TYPE", @@ -613,11 +615,13 @@ def timeseries( def timeseries_groups_v2( self, dimension: Literal[ - "IP_VERSION", + "AS", "CACHE_HIT", "DNSSEC", "DNSSEC_AWARE", "DNSSEC_E2E", + "IP_VERSION", + "LOCATION", "MATCHING_ANSWER", "PROTOCOL", "QUERY_TYPE", @@ -928,11 +932,13 @@ def with_streaming_response(self) -> AsyncDNSResourceWithStreamingResponse: async def summary_v2( self, dimension: Literal[ - "IP_VERSION", + "AS", "CACHE_HIT", "DNSSEC", "DNSSEC_AWARE", "DNSSEC_E2E", + "IP_VERSION", + "LOCATION", "MATCHING_ANSWER", "PROTOCOL", "QUERY_TYPE", @@ -1454,11 +1460,13 @@ async def timeseries( async def timeseries_groups_v2( self, dimension: Literal[ - "IP_VERSION", + "AS", "CACHE_HIT", "DNSSEC", "DNSSEC_AWARE", "DNSSEC_E2E", + "IP_VERSION", + "LOCATION", "MATCHING_ANSWER", "PROTOCOL", "QUERY_TYPE", diff --git a/src/cloudflare/resources/radar/http/http.py b/src/cloudflare/resources/radar/http/http.py index 9754cb0f2e0..90dc011257e 100644 --- a/src/cloudflare/resources/radar/http/http.py +++ b/src/cloudflare/resources/radar/http/http.py @@ -112,6 +112,7 @@ def summary_v2( self, dimension: Literal[ "ADM1", + "AS", "BOT_CLASS", "BROWSER", "BROWSER_FAMILY", @@ -119,6 +120,7 @@ def summary_v2( "HTTP_PROTOCOL", "HTTP_VERSION", "IP_VERSION", + "LOCATION", "OS", "POST_QUANTUM", "TLS_VERSION", @@ -382,6 +384,7 @@ def timeseries_groups_v2( self, dimension: Literal[ "ADM1", + "AS", "BOT_CLASS", "BROWSER", "BROWSER_FAMILY", @@ -389,6 +392,7 @@ def timeseries_groups_v2( "HTTP_PROTOCOL", "HTTP_VERSION", "IP_VERSION", + "LOCATION", "OS", "POST_QUANTUM", "TLS_VERSION", @@ -573,6 +577,7 @@ async def summary_v2( self, dimension: Literal[ "ADM1", + "AS", "BOT_CLASS", "BROWSER", "BROWSER_FAMILY", @@ -580,6 +585,7 @@ async def summary_v2( "HTTP_PROTOCOL", "HTTP_VERSION", "IP_VERSION", + "LOCATION", "OS", "POST_QUANTUM", "TLS_VERSION", @@ -843,6 +849,7 @@ async def timeseries_groups_v2( self, dimension: Literal[ "ADM1", + "AS", "BOT_CLASS", "BROWSER", "BROWSER_FAMILY", @@ -850,6 +857,7 @@ async def timeseries_groups_v2( "HTTP_PROTOCOL", "HTTP_VERSION", "IP_VERSION", + "LOCATION", "OS", "POST_QUANTUM", "TLS_VERSION", diff --git a/src/cloudflare/resources/radar/netflows/netflows.py b/src/cloudflare/resources/radar/netflows/netflows.py index 829305489be..04cfe8a3157 100644 --- a/src/cloudflare/resources/radar/netflows/netflows.py +++ b/src/cloudflare/resources/radar/netflows/netflows.py @@ -160,7 +160,7 @@ def summary( def summary_v2( self, - dimension: Literal["ADM1", "PRODUCT"], + dimension: Literal["ADM1", "AS", "LOCATION", "PRODUCT"], *, asn: SequenceNotStr[str] | Omit = omit, continent: SequenceNotStr[str] | Omit = omit, @@ -365,7 +365,7 @@ def timeseries( def timeseries_groups( self, - dimension: Literal["ADM1", "PRODUCT"], + dimension: Literal["ADM1", "AS", "LOCATION", "PRODUCT"], *, agg_interval: Literal["15m", "1h", "1d", "1w"] | Omit = omit, asn: SequenceNotStr[str] | Omit = omit, @@ -595,7 +595,7 @@ async def summary( async def summary_v2( self, - dimension: Literal["ADM1", "PRODUCT"], + dimension: Literal["ADM1", "AS", "LOCATION", "PRODUCT"], *, asn: SequenceNotStr[str] | Omit = omit, continent: SequenceNotStr[str] | Omit = omit, @@ -800,7 +800,7 @@ async def timeseries( async def timeseries_groups( self, - dimension: Literal["ADM1", "PRODUCT"], + dimension: Literal["ADM1", "AS", "LOCATION", "PRODUCT"], *, agg_interval: Literal["15m", "1h", "1d", "1w"] | Omit = omit, asn: SequenceNotStr[str] | Omit = omit, diff --git a/src/cloudflare/resources/rulesets/rules.py b/src/cloudflare/resources/rulesets/rules.py index e1f991a9e29..85c818be54b 100644 --- a/src/cloudflare/resources/rulesets/rules.py +++ b/src/cloudflare/resources/rulesets/rules.py @@ -1083,6 +1083,75 @@ def create( """ ... + @overload + def create( + self, + ruleset_id: str, + *, + account_id: str | Omit = omit, + zone_id: str | Omit = omit, + id: str | Omit = omit, + action: Literal["set_cache_control"] | Omit = omit, + action_parameters: rule_create_params.SetCacheControlRuleActionParameters | Omit = omit, + description: str | Omit = omit, + enabled: bool | Omit = omit, + exposed_credential_check: rule_create_params.SetCacheControlRuleExposedCredentialCheck | Omit = omit, + expression: str | Omit = omit, + logging: LoggingParam | Omit = omit, + position: rule_create_params.SetCacheControlRulePosition | Omit = omit, + ratelimit: rule_create_params.SetCacheControlRuleRatelimit | Omit = omit, + ref: str | 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, + ) -> RuleCreateResponse: + """Adds a new rule to an account or zone ruleset. + + The rule will be added to the end + of the existing list of rules in the ruleset by default. + + Args: + ruleset_id: The unique ID of the ruleset. + + account_id: The Account ID to use for this endpoint. Mutually exclusive with the Zone ID. + + zone_id: The Zone ID to use for this endpoint. Mutually exclusive with the Account ID. + + id: The unique ID of the rule. + + action: The action to perform when the rule matches. + + action_parameters: The parameters configuring the rule's action. + + description: An informative description of the rule. + + enabled: Whether the rule should be executed. + + exposed_credential_check: Configuration for exposed credential checking. + + expression: The expression defining which traffic will match the rule. + + logging: An object configuring the rule's logging behavior. + + position: An object configuring where the rule will be placed. + + ratelimit: An object configuring the rule's rate limit behavior. + + ref: The reference of the rule (the rule's ID by default). + + 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 + """ + ... + @overload def create( self, @@ -1152,6 +1221,75 @@ def create( """ ... + @overload + def create( + self, + ruleset_id: str, + *, + account_id: str | Omit = omit, + zone_id: str | Omit = omit, + id: str | Omit = omit, + action: Literal["set_cache_tags"] | Omit = omit, + action_parameters: rule_create_params.SetCacheTagsRuleActionParameters | Omit = omit, + description: str | Omit = omit, + enabled: bool | Omit = omit, + exposed_credential_check: rule_create_params.SetCacheTagsRuleExposedCredentialCheck | Omit = omit, + expression: str | Omit = omit, + logging: LoggingParam | Omit = omit, + position: rule_create_params.SetCacheTagsRulePosition | Omit = omit, + ratelimit: rule_create_params.SetCacheTagsRuleRatelimit | Omit = omit, + ref: str | 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, + ) -> RuleCreateResponse: + """Adds a new rule to an account or zone ruleset. + + The rule will be added to the end + of the existing list of rules in the ruleset by default. + + Args: + ruleset_id: The unique ID of the ruleset. + + account_id: The Account ID to use for this endpoint. Mutually exclusive with the Zone ID. + + zone_id: The Zone ID to use for this endpoint. Mutually exclusive with the Account ID. + + id: The unique ID of the rule. + + action: The action to perform when the rule matches. + + action_parameters: The parameters configuring the rule's action. + + description: An informative description of the rule. + + enabled: Whether the rule should be executed. + + exposed_credential_check: Configuration for exposed credential checking. + + expression: The expression defining which traffic will match the rule. + + logging: An object configuring the rule's logging behavior. + + position: An object configuring where the rule will be placed. + + ratelimit: An object configuring the rule's rate limit behavior. + + ref: The reference of the rule (the rule's ID by default). + + 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 + """ + ... + @overload def create( self, @@ -1312,7 +1450,9 @@ def create( | Literal["route"] | Literal["score"] | Literal["serve_error"] + | Literal["set_cache_control"] | Literal["set_cache_settings"] + | Literal["set_cache_tags"] | Literal["set_config"] | Literal["skip"] | Omit = omit, @@ -1326,7 +1466,9 @@ def create( | rule_create_params.RouteRuleActionParameters | rule_create_params.ScoreRuleActionParameters | rule_create_params.ServeErrorRuleActionParameters + | rule_create_params.SetCacheControlRuleActionParameters | rule_create_params.SetCacheSettingsRuleActionParameters + | rule_create_params.SetCacheTagsRuleActionParameters | rule_create_params.SetConfigurationRuleActionParameters | rule_create_params.SkipRuleActionParameters | Omit = omit, @@ -1347,7 +1489,9 @@ def create( | rule_create_params.RouteRuleExposedCredentialCheck | rule_create_params.ScoreRuleExposedCredentialCheck | rule_create_params.ServeErrorRuleExposedCredentialCheck + | rule_create_params.SetCacheControlRuleExposedCredentialCheck | rule_create_params.SetCacheSettingsRuleExposedCredentialCheck + | rule_create_params.SetCacheTagsRuleExposedCredentialCheck | rule_create_params.SetConfigurationRuleExposedCredentialCheck | rule_create_params.SkipRuleExposedCredentialCheck | Omit = omit, @@ -1368,7 +1512,9 @@ def create( | rule_create_params.RouteRulePosition | rule_create_params.ScoreRulePosition | rule_create_params.ServeErrorRulePosition + | rule_create_params.SetCacheControlRulePosition | rule_create_params.SetCacheSettingsRulePosition + | rule_create_params.SetCacheTagsRulePosition | rule_create_params.SetConfigurationRulePosition | rule_create_params.SkipRulePosition | Omit = omit, @@ -1387,7 +1533,9 @@ def create( | rule_create_params.RouteRuleRatelimit | rule_create_params.ScoreRuleRatelimit | rule_create_params.ServeErrorRuleRatelimit + | rule_create_params.SetCacheControlRuleRatelimit | rule_create_params.SetCacheSettingsRuleRatelimit + | rule_create_params.SetCacheTagsRuleRatelimit | rule_create_params.SetConfigurationRuleRatelimit | rule_create_params.SkipRuleRatelimit | Omit = omit, @@ -2553,6 +2701,76 @@ def edit( """ ... + @overload + def edit( + self, + rule_id: str, + *, + ruleset_id: str, + account_id: str | Omit = omit, + zone_id: str | Omit = omit, + id: str | Omit = omit, + action: Literal["set_cache_control"] | Omit = omit, + action_parameters: rule_edit_params.SetCacheControlRuleActionParameters | Omit = omit, + description: str | Omit = omit, + enabled: bool | Omit = omit, + exposed_credential_check: rule_edit_params.SetCacheControlRuleExposedCredentialCheck | Omit = omit, + expression: str | Omit = omit, + logging: LoggingParam | Omit = omit, + position: rule_edit_params.SetCacheControlRulePosition | Omit = omit, + ratelimit: rule_edit_params.SetCacheControlRuleRatelimit | Omit = omit, + ref: str | 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, + ) -> RuleEditResponse: + """ + Updates an existing rule in an account or zone ruleset. + + Args: + ruleset_id: The unique ID of the ruleset. + + rule_id: The unique ID of the rule. + + account_id: The Account ID to use for this endpoint. Mutually exclusive with the Zone ID. + + zone_id: The Zone ID to use for this endpoint. Mutually exclusive with the Account ID. + + id: The unique ID of the rule. + + action: The action to perform when the rule matches. + + action_parameters: The parameters configuring the rule's action. + + description: An informative description of the rule. + + enabled: Whether the rule should be executed. + + exposed_credential_check: Configuration for exposed credential checking. + + expression: The expression defining which traffic will match the rule. + + logging: An object configuring the rule's logging behavior. + + position: An object configuring where the rule will be placed. + + ratelimit: An object configuring the rule's rate limit behavior. + + ref: The reference of the rule (the rule's ID by default). + + 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 + """ + ... + @overload def edit( self, @@ -2623,6 +2841,76 @@ def edit( """ ... + @overload + def edit( + self, + rule_id: str, + *, + ruleset_id: str, + account_id: str | Omit = omit, + zone_id: str | Omit = omit, + id: str | Omit = omit, + action: Literal["set_cache_tags"] | Omit = omit, + action_parameters: rule_edit_params.SetCacheTagsRuleActionParameters | Omit = omit, + description: str | Omit = omit, + enabled: bool | Omit = omit, + exposed_credential_check: rule_edit_params.SetCacheTagsRuleExposedCredentialCheck | Omit = omit, + expression: str | Omit = omit, + logging: LoggingParam | Omit = omit, + position: rule_edit_params.SetCacheTagsRulePosition | Omit = omit, + ratelimit: rule_edit_params.SetCacheTagsRuleRatelimit | Omit = omit, + ref: str | 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, + ) -> RuleEditResponse: + """ + Updates an existing rule in an account or zone ruleset. + + Args: + ruleset_id: The unique ID of the ruleset. + + rule_id: The unique ID of the rule. + + account_id: The Account ID to use for this endpoint. Mutually exclusive with the Zone ID. + + zone_id: The Zone ID to use for this endpoint. Mutually exclusive with the Account ID. + + id: The unique ID of the rule. + + action: The action to perform when the rule matches. + + action_parameters: The parameters configuring the rule's action. + + description: An informative description of the rule. + + enabled: Whether the rule should be executed. + + exposed_credential_check: Configuration for exposed credential checking. + + expression: The expression defining which traffic will match the rule. + + logging: An object configuring the rule's logging behavior. + + position: An object configuring where the rule will be placed. + + ratelimit: An object configuring the rule's rate limit behavior. + + ref: The reference of the rule (the rule's ID by default). + + 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 + """ + ... + @overload def edit( self, @@ -2787,7 +3075,9 @@ def edit( | Literal["route"] | Literal["score"] | Literal["serve_error"] + | Literal["set_cache_control"] | Literal["set_cache_settings"] + | Literal["set_cache_tags"] | Literal["set_config"] | Literal["skip"] | Omit = omit, @@ -2801,7 +3091,9 @@ def edit( | rule_edit_params.RouteRuleActionParameters | rule_edit_params.ScoreRuleActionParameters | rule_edit_params.ServeErrorRuleActionParameters + | rule_edit_params.SetCacheControlRuleActionParameters | rule_edit_params.SetCacheSettingsRuleActionParameters + | rule_edit_params.SetCacheTagsRuleActionParameters | rule_edit_params.SetConfigurationRuleActionParameters | rule_edit_params.SkipRuleActionParameters | Omit = omit, @@ -2822,7 +3114,9 @@ def edit( | rule_edit_params.RouteRuleExposedCredentialCheck | rule_edit_params.ScoreRuleExposedCredentialCheck | rule_edit_params.ServeErrorRuleExposedCredentialCheck + | rule_edit_params.SetCacheControlRuleExposedCredentialCheck | rule_edit_params.SetCacheSettingsRuleExposedCredentialCheck + | rule_edit_params.SetCacheTagsRuleExposedCredentialCheck | rule_edit_params.SetConfigurationRuleExposedCredentialCheck | rule_edit_params.SkipRuleExposedCredentialCheck | Omit = omit, @@ -2843,7 +3137,9 @@ def edit( | rule_edit_params.RouteRulePosition | rule_edit_params.ScoreRulePosition | rule_edit_params.ServeErrorRulePosition + | rule_edit_params.SetCacheControlRulePosition | rule_edit_params.SetCacheSettingsRulePosition + | rule_edit_params.SetCacheTagsRulePosition | rule_edit_params.SetConfigurationRulePosition | rule_edit_params.SkipRulePosition | Omit = omit, @@ -2862,7 +3158,9 @@ def edit( | rule_edit_params.RouteRuleRatelimit | rule_edit_params.ScoreRuleRatelimit | rule_edit_params.ServeErrorRuleRatelimit + | rule_edit_params.SetCacheControlRuleRatelimit | rule_edit_params.SetCacheSettingsRuleRatelimit + | rule_edit_params.SetCacheTagsRuleRatelimit | rule_edit_params.SetConfigurationRuleRatelimit | rule_edit_params.SkipRuleRatelimit | Omit = omit, @@ -3085,15 +3383,153 @@ async def create( account_id: str | Omit = omit, zone_id: str | Omit = omit, id: str | Omit = omit, - action: Literal["compress_response"] | Omit = omit, - action_parameters: rule_create_params.ResponseCompressionRuleActionParameters | Omit = omit, + action: Literal["compress_response"] | Omit = omit, + action_parameters: rule_create_params.ResponseCompressionRuleActionParameters | Omit = omit, + description: str | Omit = omit, + enabled: bool | Omit = omit, + exposed_credential_check: rule_create_params.ResponseCompressionRuleExposedCredentialCheck | Omit = omit, + expression: str | Omit = omit, + logging: LoggingParam | Omit = omit, + position: rule_create_params.ResponseCompressionRulePosition | Omit = omit, + ratelimit: rule_create_params.ResponseCompressionRuleRatelimit | Omit = omit, + ref: str | 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, + ) -> RuleCreateResponse: + """Adds a new rule to an account or zone ruleset. + + The rule will be added to the end + of the existing list of rules in the ruleset by default. + + Args: + ruleset_id: The unique ID of the ruleset. + + account_id: The Account ID to use for this endpoint. Mutually exclusive with the Zone ID. + + zone_id: The Zone ID to use for this endpoint. Mutually exclusive with the Account ID. + + id: The unique ID of the rule. + + action: The action to perform when the rule matches. + + action_parameters: The parameters configuring the rule's action. + + description: An informative description of the rule. + + enabled: Whether the rule should be executed. + + exposed_credential_check: Configuration for exposed credential checking. + + expression: The expression defining which traffic will match the rule. + + logging: An object configuring the rule's logging behavior. + + position: An object configuring where the rule will be placed. + + ratelimit: An object configuring the rule's rate limit behavior. + + ref: The reference of the rule (the rule's ID by default). + + 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 + """ + ... + + @overload + async def create( + self, + ruleset_id: str, + *, + account_id: str | Omit = omit, + zone_id: str | Omit = omit, + id: str | Omit = omit, + action: Literal["ddos_dynamic"] | Omit = omit, + action_parameters: object | Omit = omit, + description: str | Omit = omit, + enabled: bool | Omit = omit, + exposed_credential_check: rule_create_params.DDoSDynamicRuleExposedCredentialCheck | Omit = omit, + expression: str | Omit = omit, + logging: LoggingParam | Omit = omit, + position: rule_create_params.DDoSDynamicRulePosition | Omit = omit, + ratelimit: rule_create_params.DDoSDynamicRuleRatelimit | Omit = omit, + ref: str | 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, + ) -> RuleCreateResponse: + """Adds a new rule to an account or zone ruleset. + + The rule will be added to the end + of the existing list of rules in the ruleset by default. + + Args: + ruleset_id: The unique ID of the ruleset. + + account_id: The Account ID to use for this endpoint. Mutually exclusive with the Zone ID. + + zone_id: The Zone ID to use for this endpoint. Mutually exclusive with the Account ID. + + id: The unique ID of the rule. + + action: The action to perform when the rule matches. + + action_parameters: The parameters configuring the rule's action. + + description: An informative description of the rule. + + enabled: Whether the rule should be executed. + + exposed_credential_check: Configuration for exposed credential checking. + + expression: The expression defining which traffic will match the rule. + + logging: An object configuring the rule's logging behavior. + + position: An object configuring where the rule will be placed. + + ratelimit: An object configuring the rule's rate limit behavior. + + ref: The reference of the rule (the rule's ID by default). + + 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 + """ + ... + + @overload + async def create( + self, + ruleset_id: str, + *, + account_id: str | Omit = omit, + zone_id: str | Omit = omit, + id: str | Omit = omit, + action: Literal["execute"] | Omit = omit, + action_parameters: rule_create_params.ExecuteRuleActionParameters | Omit = omit, description: str | Omit = omit, enabled: bool | Omit = omit, - exposed_credential_check: rule_create_params.ResponseCompressionRuleExposedCredentialCheck | Omit = omit, + exposed_credential_check: rule_create_params.ExecuteRuleExposedCredentialCheck | Omit = omit, expression: str | Omit = omit, logging: LoggingParam | Omit = omit, - position: rule_create_params.ResponseCompressionRulePosition | Omit = omit, - ratelimit: rule_create_params.ResponseCompressionRuleRatelimit | Omit = omit, + position: rule_create_params.ExecuteRulePosition | Omit = omit, + ratelimit: rule_create_params.ExecuteRuleRatelimit | Omit = omit, ref: str | 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. @@ -3154,15 +3590,15 @@ async def create( account_id: str | Omit = omit, zone_id: str | Omit = omit, id: str | Omit = omit, - action: Literal["ddos_dynamic"] | Omit = omit, + action: Literal["force_connection_close"] | Omit = omit, action_parameters: object | Omit = omit, description: str | Omit = omit, enabled: bool | Omit = omit, - exposed_credential_check: rule_create_params.DDoSDynamicRuleExposedCredentialCheck | Omit = omit, + exposed_credential_check: rule_create_params.ForceConnectionCloseRuleExposedCredentialCheck | Omit = omit, expression: str | Omit = omit, logging: LoggingParam | Omit = omit, - position: rule_create_params.DDoSDynamicRulePosition | Omit = omit, - ratelimit: rule_create_params.DDoSDynamicRuleRatelimit | Omit = omit, + position: rule_create_params.ForceConnectionCloseRulePosition | Omit = omit, + ratelimit: rule_create_params.ForceConnectionCloseRuleRatelimit | Omit = omit, ref: str | 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. @@ -3223,15 +3659,15 @@ async def create( account_id: str | Omit = omit, zone_id: str | Omit = omit, id: str | Omit = omit, - action: Literal["execute"] | Omit = omit, - action_parameters: rule_create_params.ExecuteRuleActionParameters | Omit = omit, + action: Literal["js_challenge"] | Omit = omit, + action_parameters: object | Omit = omit, description: str | Omit = omit, enabled: bool | Omit = omit, - exposed_credential_check: rule_create_params.ExecuteRuleExposedCredentialCheck | Omit = omit, + exposed_credential_check: rule_create_params.JavaScriptChallengeRuleExposedCredentialCheck | Omit = omit, expression: str | Omit = omit, logging: LoggingParam | Omit = omit, - position: rule_create_params.ExecuteRulePosition | Omit = omit, - ratelimit: rule_create_params.ExecuteRuleRatelimit | Omit = omit, + position: rule_create_params.JavaScriptChallengeRulePosition | Omit = omit, + ratelimit: rule_create_params.JavaScriptChallengeRuleRatelimit | Omit = omit, ref: str | 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. @@ -3292,15 +3728,15 @@ async def create( account_id: str | Omit = omit, zone_id: str | Omit = omit, id: str | Omit = omit, - action: Literal["force_connection_close"] | Omit = omit, + action: Literal["log"] | Omit = omit, action_parameters: object | Omit = omit, description: str | Omit = omit, enabled: bool | Omit = omit, - exposed_credential_check: rule_create_params.ForceConnectionCloseRuleExposedCredentialCheck | Omit = omit, + exposed_credential_check: rule_create_params.LogRuleExposedCredentialCheck | Omit = omit, expression: str | Omit = omit, logging: LoggingParam | Omit = omit, - position: rule_create_params.ForceConnectionCloseRulePosition | Omit = omit, - ratelimit: rule_create_params.ForceConnectionCloseRuleRatelimit | Omit = omit, + position: rule_create_params.LogRulePosition | Omit = omit, + ratelimit: rule_create_params.LogRuleRatelimit | Omit = omit, ref: str | 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. @@ -3361,15 +3797,15 @@ async def create( account_id: str | Omit = omit, zone_id: str | Omit = omit, id: str | Omit = omit, - action: Literal["js_challenge"] | Omit = omit, - action_parameters: object | Omit = omit, + action: Literal["log_custom_field"] | Omit = omit, + action_parameters: rule_create_params.LogCustomFieldRuleActionParameters | Omit = omit, description: str | Omit = omit, enabled: bool | Omit = omit, - exposed_credential_check: rule_create_params.JavaScriptChallengeRuleExposedCredentialCheck | Omit = omit, + exposed_credential_check: rule_create_params.LogCustomFieldRuleExposedCredentialCheck | Omit = omit, expression: str | Omit = omit, logging: LoggingParam | Omit = omit, - position: rule_create_params.JavaScriptChallengeRulePosition | Omit = omit, - ratelimit: rule_create_params.JavaScriptChallengeRuleRatelimit | Omit = omit, + position: rule_create_params.LogCustomFieldRulePosition | Omit = omit, + ratelimit: rule_create_params.LogCustomFieldRuleRatelimit | Omit = omit, ref: str | 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. @@ -3430,15 +3866,15 @@ async def create( account_id: str | Omit = omit, zone_id: str | Omit = omit, id: str | Omit = omit, - action: Literal["log"] | Omit = omit, + action: Literal["managed_challenge"] | Omit = omit, action_parameters: object | Omit = omit, description: str | Omit = omit, enabled: bool | Omit = omit, - exposed_credential_check: rule_create_params.LogRuleExposedCredentialCheck | Omit = omit, + exposed_credential_check: rule_create_params.ManagedChallengeRuleExposedCredentialCheck | Omit = omit, expression: str | Omit = omit, logging: LoggingParam | Omit = omit, - position: rule_create_params.LogRulePosition | Omit = omit, - ratelimit: rule_create_params.LogRuleRatelimit | Omit = omit, + position: rule_create_params.ManagedChallengeRulePosition | Omit = omit, + ratelimit: rule_create_params.ManagedChallengeRuleRatelimit | Omit = omit, ref: str | 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. @@ -3499,15 +3935,15 @@ async def create( account_id: str | Omit = omit, zone_id: str | Omit = omit, id: str | Omit = omit, - action: Literal["log_custom_field"] | Omit = omit, - action_parameters: rule_create_params.LogCustomFieldRuleActionParameters | Omit = omit, + action: Literal["redirect"] | Omit = omit, + action_parameters: rule_create_params.RedirectRuleActionParameters | Omit = omit, description: str | Omit = omit, enabled: bool | Omit = omit, - exposed_credential_check: rule_create_params.LogCustomFieldRuleExposedCredentialCheck | Omit = omit, + exposed_credential_check: rule_create_params.RedirectRuleExposedCredentialCheck | Omit = omit, expression: str | Omit = omit, logging: LoggingParam | Omit = omit, - position: rule_create_params.LogCustomFieldRulePosition | Omit = omit, - ratelimit: rule_create_params.LogCustomFieldRuleRatelimit | Omit = omit, + position: rule_create_params.RedirectRulePosition | Omit = omit, + ratelimit: rule_create_params.RedirectRuleRatelimit | Omit = omit, ref: str | 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. @@ -3568,15 +4004,15 @@ async def create( account_id: str | Omit = omit, zone_id: str | Omit = omit, id: str | Omit = omit, - action: Literal["managed_challenge"] | Omit = omit, - action_parameters: object | Omit = omit, + action: Literal["rewrite"] | Omit = omit, + action_parameters: rule_create_params.RewriteRuleActionParameters | Omit = omit, description: str | Omit = omit, enabled: bool | Omit = omit, - exposed_credential_check: rule_create_params.ManagedChallengeRuleExposedCredentialCheck | Omit = omit, + exposed_credential_check: rule_create_params.RewriteRuleExposedCredentialCheck | Omit = omit, expression: str | Omit = omit, logging: LoggingParam | Omit = omit, - position: rule_create_params.ManagedChallengeRulePosition | Omit = omit, - ratelimit: rule_create_params.ManagedChallengeRuleRatelimit | Omit = omit, + position: rule_create_params.RewriteRulePosition | Omit = omit, + ratelimit: rule_create_params.RewriteRuleRatelimit | Omit = omit, ref: str | 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. @@ -3637,15 +4073,15 @@ async def create( account_id: str | Omit = omit, zone_id: str | Omit = omit, id: str | Omit = omit, - action: Literal["redirect"] | Omit = omit, - action_parameters: rule_create_params.RedirectRuleActionParameters | Omit = omit, + action: Literal["route"] | Omit = omit, + action_parameters: rule_create_params.RouteRuleActionParameters | Omit = omit, description: str | Omit = omit, enabled: bool | Omit = omit, - exposed_credential_check: rule_create_params.RedirectRuleExposedCredentialCheck | Omit = omit, + exposed_credential_check: rule_create_params.RouteRuleExposedCredentialCheck | Omit = omit, expression: str | Omit = omit, logging: LoggingParam | Omit = omit, - position: rule_create_params.RedirectRulePosition | Omit = omit, - ratelimit: rule_create_params.RedirectRuleRatelimit | Omit = omit, + position: rule_create_params.RouteRulePosition | Omit = omit, + ratelimit: rule_create_params.RouteRuleRatelimit | Omit = omit, ref: str | 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. @@ -3706,15 +4142,15 @@ async def create( account_id: str | Omit = omit, zone_id: str | Omit = omit, id: str | Omit = omit, - action: Literal["rewrite"] | Omit = omit, - action_parameters: rule_create_params.RewriteRuleActionParameters | Omit = omit, + action: Literal["score"] | Omit = omit, + action_parameters: rule_create_params.ScoreRuleActionParameters | Omit = omit, description: str | Omit = omit, enabled: bool | Omit = omit, - exposed_credential_check: rule_create_params.RewriteRuleExposedCredentialCheck | Omit = omit, + exposed_credential_check: rule_create_params.ScoreRuleExposedCredentialCheck | Omit = omit, expression: str | Omit = omit, logging: LoggingParam | Omit = omit, - position: rule_create_params.RewriteRulePosition | Omit = omit, - ratelimit: rule_create_params.RewriteRuleRatelimit | Omit = omit, + position: rule_create_params.ScoreRulePosition | Omit = omit, + ratelimit: rule_create_params.ScoreRuleRatelimit | Omit = omit, ref: str | 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. @@ -3775,15 +4211,15 @@ async def create( account_id: str | Omit = omit, zone_id: str | Omit = omit, id: str | Omit = omit, - action: Literal["route"] | Omit = omit, - action_parameters: rule_create_params.RouteRuleActionParameters | Omit = omit, + action: Literal["serve_error"] | Omit = omit, + action_parameters: rule_create_params.ServeErrorRuleActionParameters | Omit = omit, description: str | Omit = omit, enabled: bool | Omit = omit, - exposed_credential_check: rule_create_params.RouteRuleExposedCredentialCheck | Omit = omit, + exposed_credential_check: rule_create_params.ServeErrorRuleExposedCredentialCheck | Omit = omit, expression: str | Omit = omit, logging: LoggingParam | Omit = omit, - position: rule_create_params.RouteRulePosition | Omit = omit, - ratelimit: rule_create_params.RouteRuleRatelimit | Omit = omit, + position: rule_create_params.ServeErrorRulePosition | Omit = omit, + ratelimit: rule_create_params.ServeErrorRuleRatelimit | Omit = omit, ref: str | 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. @@ -3844,15 +4280,15 @@ async def create( account_id: str | Omit = omit, zone_id: str | Omit = omit, id: str | Omit = omit, - action: Literal["score"] | Omit = omit, - action_parameters: rule_create_params.ScoreRuleActionParameters | Omit = omit, + action: Literal["set_cache_control"] | Omit = omit, + action_parameters: rule_create_params.SetCacheControlRuleActionParameters | Omit = omit, description: str | Omit = omit, enabled: bool | Omit = omit, - exposed_credential_check: rule_create_params.ScoreRuleExposedCredentialCheck | Omit = omit, + exposed_credential_check: rule_create_params.SetCacheControlRuleExposedCredentialCheck | Omit = omit, expression: str | Omit = omit, logging: LoggingParam | Omit = omit, - position: rule_create_params.ScoreRulePosition | Omit = omit, - ratelimit: rule_create_params.ScoreRuleRatelimit | Omit = omit, + position: rule_create_params.SetCacheControlRulePosition | Omit = omit, + ratelimit: rule_create_params.SetCacheControlRuleRatelimit | Omit = omit, ref: str | 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. @@ -3913,15 +4349,15 @@ async def create( account_id: str | Omit = omit, zone_id: str | Omit = omit, id: str | Omit = omit, - action: Literal["serve_error"] | Omit = omit, - action_parameters: rule_create_params.ServeErrorRuleActionParameters | Omit = omit, + action: Literal["set_cache_settings"] | Omit = omit, + action_parameters: rule_create_params.SetCacheSettingsRuleActionParameters | Omit = omit, description: str | Omit = omit, enabled: bool | Omit = omit, - exposed_credential_check: rule_create_params.ServeErrorRuleExposedCredentialCheck | Omit = omit, + exposed_credential_check: rule_create_params.SetCacheSettingsRuleExposedCredentialCheck | Omit = omit, expression: str | Omit = omit, logging: LoggingParam | Omit = omit, - position: rule_create_params.ServeErrorRulePosition | Omit = omit, - ratelimit: rule_create_params.ServeErrorRuleRatelimit | Omit = omit, + position: rule_create_params.SetCacheSettingsRulePosition | Omit = omit, + ratelimit: rule_create_params.SetCacheSettingsRuleRatelimit | Omit = omit, ref: str | 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. @@ -3982,15 +4418,15 @@ async def create( account_id: str | Omit = omit, zone_id: str | Omit = omit, id: str | Omit = omit, - action: Literal["set_cache_settings"] | Omit = omit, - action_parameters: rule_create_params.SetCacheSettingsRuleActionParameters | Omit = omit, + action: Literal["set_cache_tags"] | Omit = omit, + action_parameters: rule_create_params.SetCacheTagsRuleActionParameters | Omit = omit, description: str | Omit = omit, enabled: bool | Omit = omit, - exposed_credential_check: rule_create_params.SetCacheSettingsRuleExposedCredentialCheck | Omit = omit, + exposed_credential_check: rule_create_params.SetCacheTagsRuleExposedCredentialCheck | Omit = omit, expression: str | Omit = omit, logging: LoggingParam | Omit = omit, - position: rule_create_params.SetCacheSettingsRulePosition | Omit = omit, - ratelimit: rule_create_params.SetCacheSettingsRuleRatelimit | Omit = omit, + position: rule_create_params.SetCacheTagsRulePosition | Omit = omit, + ratelimit: rule_create_params.SetCacheTagsRuleRatelimit | Omit = omit, ref: str | 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. @@ -4203,7 +4639,9 @@ async def create( | Literal["route"] | Literal["score"] | Literal["serve_error"] + | Literal["set_cache_control"] | Literal["set_cache_settings"] + | Literal["set_cache_tags"] | Literal["set_config"] | Literal["skip"] | Omit = omit, @@ -4217,7 +4655,9 @@ async def create( | rule_create_params.RouteRuleActionParameters | rule_create_params.ScoreRuleActionParameters | rule_create_params.ServeErrorRuleActionParameters + | rule_create_params.SetCacheControlRuleActionParameters | rule_create_params.SetCacheSettingsRuleActionParameters + | rule_create_params.SetCacheTagsRuleActionParameters | rule_create_params.SetConfigurationRuleActionParameters | rule_create_params.SkipRuleActionParameters | Omit = omit, @@ -4238,7 +4678,9 @@ async def create( | rule_create_params.RouteRuleExposedCredentialCheck | rule_create_params.ScoreRuleExposedCredentialCheck | rule_create_params.ServeErrorRuleExposedCredentialCheck + | rule_create_params.SetCacheControlRuleExposedCredentialCheck | rule_create_params.SetCacheSettingsRuleExposedCredentialCheck + | rule_create_params.SetCacheTagsRuleExposedCredentialCheck | rule_create_params.SetConfigurationRuleExposedCredentialCheck | rule_create_params.SkipRuleExposedCredentialCheck | Omit = omit, @@ -4259,7 +4701,9 @@ async def create( | rule_create_params.RouteRulePosition | rule_create_params.ScoreRulePosition | rule_create_params.ServeErrorRulePosition + | rule_create_params.SetCacheControlRulePosition | rule_create_params.SetCacheSettingsRulePosition + | rule_create_params.SetCacheTagsRulePosition | rule_create_params.SetConfigurationRulePosition | rule_create_params.SkipRulePosition | Omit = omit, @@ -4278,7 +4722,9 @@ async def create( | rule_create_params.RouteRuleRatelimit | rule_create_params.ScoreRuleRatelimit | rule_create_params.ServeErrorRuleRatelimit + | rule_create_params.SetCacheControlRuleRatelimit | rule_create_params.SetCacheSettingsRuleRatelimit + | rule_create_params.SetCacheTagsRuleRatelimit | rule_create_params.SetConfigurationRuleRatelimit | rule_create_params.SkipRuleRatelimit | Omit = omit, @@ -5444,6 +5890,76 @@ async def edit( """ ... + @overload + async def edit( + self, + rule_id: str, + *, + ruleset_id: str, + account_id: str | Omit = omit, + zone_id: str | Omit = omit, + id: str | Omit = omit, + action: Literal["set_cache_control"] | Omit = omit, + action_parameters: rule_edit_params.SetCacheControlRuleActionParameters | Omit = omit, + description: str | Omit = omit, + enabled: bool | Omit = omit, + exposed_credential_check: rule_edit_params.SetCacheControlRuleExposedCredentialCheck | Omit = omit, + expression: str | Omit = omit, + logging: LoggingParam | Omit = omit, + position: rule_edit_params.SetCacheControlRulePosition | Omit = omit, + ratelimit: rule_edit_params.SetCacheControlRuleRatelimit | Omit = omit, + ref: str | 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, + ) -> RuleEditResponse: + """ + Updates an existing rule in an account or zone ruleset. + + Args: + ruleset_id: The unique ID of the ruleset. + + rule_id: The unique ID of the rule. + + account_id: The Account ID to use for this endpoint. Mutually exclusive with the Zone ID. + + zone_id: The Zone ID to use for this endpoint. Mutually exclusive with the Account ID. + + id: The unique ID of the rule. + + action: The action to perform when the rule matches. + + action_parameters: The parameters configuring the rule's action. + + description: An informative description of the rule. + + enabled: Whether the rule should be executed. + + exposed_credential_check: Configuration for exposed credential checking. + + expression: The expression defining which traffic will match the rule. + + logging: An object configuring the rule's logging behavior. + + position: An object configuring where the rule will be placed. + + ratelimit: An object configuring the rule's rate limit behavior. + + ref: The reference of the rule (the rule's ID by default). + + 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 + """ + ... + @overload async def edit( self, @@ -5514,6 +6030,76 @@ async def edit( """ ... + @overload + async def edit( + self, + rule_id: str, + *, + ruleset_id: str, + account_id: str | Omit = omit, + zone_id: str | Omit = omit, + id: str | Omit = omit, + action: Literal["set_cache_tags"] | Omit = omit, + action_parameters: rule_edit_params.SetCacheTagsRuleActionParameters | Omit = omit, + description: str | Omit = omit, + enabled: bool | Omit = omit, + exposed_credential_check: rule_edit_params.SetCacheTagsRuleExposedCredentialCheck | Omit = omit, + expression: str | Omit = omit, + logging: LoggingParam | Omit = omit, + position: rule_edit_params.SetCacheTagsRulePosition | Omit = omit, + ratelimit: rule_edit_params.SetCacheTagsRuleRatelimit | Omit = omit, + ref: str | 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, + ) -> RuleEditResponse: + """ + Updates an existing rule in an account or zone ruleset. + + Args: + ruleset_id: The unique ID of the ruleset. + + rule_id: The unique ID of the rule. + + account_id: The Account ID to use for this endpoint. Mutually exclusive with the Zone ID. + + zone_id: The Zone ID to use for this endpoint. Mutually exclusive with the Account ID. + + id: The unique ID of the rule. + + action: The action to perform when the rule matches. + + action_parameters: The parameters configuring the rule's action. + + description: An informative description of the rule. + + enabled: Whether the rule should be executed. + + exposed_credential_check: Configuration for exposed credential checking. + + expression: The expression defining which traffic will match the rule. + + logging: An object configuring the rule's logging behavior. + + position: An object configuring where the rule will be placed. + + ratelimit: An object configuring the rule's rate limit behavior. + + ref: The reference of the rule (the rule's ID by default). + + 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 + """ + ... + @overload async def edit( self, @@ -5678,7 +6264,9 @@ async def edit( | Literal["route"] | Literal["score"] | Literal["serve_error"] + | Literal["set_cache_control"] | Literal["set_cache_settings"] + | Literal["set_cache_tags"] | Literal["set_config"] | Literal["skip"] | Omit = omit, @@ -5692,7 +6280,9 @@ async def edit( | rule_edit_params.RouteRuleActionParameters | rule_edit_params.ScoreRuleActionParameters | rule_edit_params.ServeErrorRuleActionParameters + | rule_edit_params.SetCacheControlRuleActionParameters | rule_edit_params.SetCacheSettingsRuleActionParameters + | rule_edit_params.SetCacheTagsRuleActionParameters | rule_edit_params.SetConfigurationRuleActionParameters | rule_edit_params.SkipRuleActionParameters | Omit = omit, @@ -5713,7 +6303,9 @@ async def edit( | rule_edit_params.RouteRuleExposedCredentialCheck | rule_edit_params.ScoreRuleExposedCredentialCheck | rule_edit_params.ServeErrorRuleExposedCredentialCheck + | rule_edit_params.SetCacheControlRuleExposedCredentialCheck | rule_edit_params.SetCacheSettingsRuleExposedCredentialCheck + | rule_edit_params.SetCacheTagsRuleExposedCredentialCheck | rule_edit_params.SetConfigurationRuleExposedCredentialCheck | rule_edit_params.SkipRuleExposedCredentialCheck | Omit = omit, @@ -5734,7 +6326,9 @@ async def edit( | rule_edit_params.RouteRulePosition | rule_edit_params.ScoreRulePosition | rule_edit_params.ServeErrorRulePosition + | rule_edit_params.SetCacheControlRulePosition | rule_edit_params.SetCacheSettingsRulePosition + | rule_edit_params.SetCacheTagsRulePosition | rule_edit_params.SetConfigurationRulePosition | rule_edit_params.SkipRulePosition | Omit = omit, @@ -5753,7 +6347,9 @@ async def edit( | rule_edit_params.RouteRuleRatelimit | rule_edit_params.ScoreRuleRatelimit | rule_edit_params.ServeErrorRuleRatelimit + | rule_edit_params.SetCacheControlRuleRatelimit | rule_edit_params.SetCacheSettingsRuleRatelimit + | rule_edit_params.SetCacheTagsRuleRatelimit | rule_edit_params.SetConfigurationRuleRatelimit | rule_edit_params.SkipRuleRatelimit | Omit = omit, diff --git a/src/cloudflare/resources/schema_validation/schemas.py b/src/cloudflare/resources/schema_validation/schemas.py index cd6e4a9fb30..22ed24d85c9 100644 --- a/src/cloudflare/resources/schema_validation/schemas.py +++ b/src/cloudflare/resources/schema_validation/schemas.py @@ -62,8 +62,10 @@ def create( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> PublicSchema: - """ - Upload a schema + """Uploads a new OpenAPI schema for API Shield schema validation. + + The schema + defines expected request/response formats for API endpoints. Args: zone_id: Identifier. @@ -123,7 +125,7 @@ def list( timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SyncV4PagePaginationArray[PublicSchema]: """ - List all uploaded schemas + Lists all OpenAPI schemas uploaded to API Shield with pagination support. Args: zone_id: Identifier. @@ -179,8 +181,10 @@ def delete( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SchemaDeleteResponse: - """ - Delete a schema + """Permanently removes an uploaded OpenAPI schema from API Shield. + + Operations using + this schema will lose their validation rules. Args: zone_id: Identifier. @@ -225,7 +229,8 @@ def edit( timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> PublicSchema: """ - Edit details of a schema to enable validation + Modifies an existing OpenAPI schema in API Shield, updating the validation rules + for associated API operations. Args: zone_id: Identifier. @@ -273,7 +278,8 @@ def get( timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> PublicSchema: """ - Get details of a schema + Gets the contents and metadata of a specific OpenAPI schema uploaded to API + Shield. Args: zone_id: Identifier. @@ -343,8 +349,10 @@ async def create( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> PublicSchema: - """ - Upload a schema + """Uploads a new OpenAPI schema for API Shield schema validation. + + The schema + defines expected request/response formats for API endpoints. Args: zone_id: Identifier. @@ -404,7 +412,7 @@ def list( timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AsyncPaginator[PublicSchema, AsyncV4PagePaginationArray[PublicSchema]]: """ - List all uploaded schemas + Lists all OpenAPI schemas uploaded to API Shield with pagination support. Args: zone_id: Identifier. @@ -460,8 +468,10 @@ async def delete( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SchemaDeleteResponse: - """ - Delete a schema + """Permanently removes an uploaded OpenAPI schema from API Shield. + + Operations using + this schema will lose their validation rules. Args: zone_id: Identifier. @@ -506,7 +516,8 @@ async def edit( timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> PublicSchema: """ - Edit details of a schema to enable validation + Modifies an existing OpenAPI schema in API Shield, updating the validation rules + for associated API operations. Args: zone_id: Identifier. @@ -556,7 +567,8 @@ async def get( timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> PublicSchema: """ - Get details of a schema + Gets the contents and metadata of a specific OpenAPI schema uploaded to API + Shield. Args: zone_id: Identifier. diff --git a/src/cloudflare/resources/schema_validation/settings/operations.py b/src/cloudflare/resources/schema_validation/settings/operations.py index 1212c275f42..7d0f9568591 100644 --- a/src/cloudflare/resources/schema_validation/settings/operations.py +++ b/src/cloudflare/resources/schema_validation/settings/operations.py @@ -68,7 +68,7 @@ def update( timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> OperationUpdateResponse: """ - Update per-operation schema validation setting + Fully updates schema validation settings for a specific API operation. Args: zone_id: Identifier. @@ -125,7 +125,7 @@ def list( timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SyncV4PagePaginationArray[OperationListResponse]: """ - List per-operation schema validation settings + Lists all per-operation schema validation settings configured for the zone. Args: zone_id: Identifier. @@ -176,7 +176,8 @@ def delete( timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> OperationDeleteResponse: """ - Delete per-operation schema validation setting + Removes custom schema validation settings for a specific API operation, + reverting to zone-level defaults. Args: zone_id: Identifier. @@ -220,7 +221,8 @@ def bulk_edit( timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> OperationBulkEditResponse: """ - Bulk edit per-operation schema validation settings + Updates schema validation settings for multiple API operations in a single + request. Efficient for applying consistent validation rules across endpoints. Args: zone_id: Identifier. @@ -261,7 +263,8 @@ def get( timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> OperationGetResponse: """ - Get per-operation schema validation setting + Retrieves the schema validation settings configured for a specific API + operation. Args: zone_id: Identifier. @@ -327,7 +330,7 @@ async def update( timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> OperationUpdateResponse: """ - Update per-operation schema validation setting + Fully updates schema validation settings for a specific API operation. Args: zone_id: Identifier. @@ -384,7 +387,7 @@ def list( timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AsyncPaginator[OperationListResponse, AsyncV4PagePaginationArray[OperationListResponse]]: """ - List per-operation schema validation settings + Lists all per-operation schema validation settings configured for the zone. Args: zone_id: Identifier. @@ -435,7 +438,8 @@ async def delete( timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> OperationDeleteResponse: """ - Delete per-operation schema validation setting + Removes custom schema validation settings for a specific API operation, + reverting to zone-level defaults. Args: zone_id: Identifier. @@ -479,7 +483,8 @@ async def bulk_edit( timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> OperationBulkEditResponse: """ - Bulk edit per-operation schema validation settings + Updates schema validation settings for multiple API operations in a single + request. Efficient for applying consistent validation rules across endpoints. Args: zone_id: Identifier. @@ -520,7 +525,8 @@ async def get( timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> OperationGetResponse: """ - Get per-operation schema validation setting + Retrieves the schema validation settings configured for a specific API + operation. Args: zone_id: Identifier. diff --git a/src/cloudflare/resources/schema_validation/settings/settings.py b/src/cloudflare/resources/schema_validation/settings/settings.py index 82b061c1624..fad14610c3a 100644 --- a/src/cloudflare/resources/schema_validation/settings/settings.py +++ b/src/cloudflare/resources/schema_validation/settings/settings.py @@ -73,7 +73,8 @@ def update( timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SettingUpdateResponse: """ - Update global schema validation settings + Fully updates global schema validation settings for a zone, replacing existing + configuration. Args: zone_id: Identifier. @@ -133,7 +134,8 @@ def edit( timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SettingEditResponse: """ - Edit global schema validation settings + Partially updates global schema validation settings for a zone using PATCH + semantics. Args: zone_id: Identifier. @@ -191,7 +193,7 @@ def get( timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SettingGetResponse: """ - Get global schema validation settings + Retrieves the current global schema validation settings for a zone. Args: zone_id: Identifier. @@ -257,7 +259,8 @@ async def update( timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SettingUpdateResponse: """ - Update global schema validation settings + Fully updates global schema validation settings for a zone, replacing existing + configuration. Args: zone_id: Identifier. @@ -317,7 +320,8 @@ async def edit( timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SettingEditResponse: """ - Edit global schema validation settings + Partially updates global schema validation settings for a zone using PATCH + semantics. Args: zone_id: Identifier. @@ -375,7 +379,7 @@ async def get( timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SettingGetResponse: """ - Get global schema validation settings + Retrieves the current global schema validation settings for a zone. Args: zone_id: Identifier. diff --git a/src/cloudflare/resources/speed/schedule.py b/src/cloudflare/resources/speed/schedule.py index 6c822983901..eb8e477807e 100644 --- a/src/cloudflare/resources/speed/schedule.py +++ b/src/cloudflare/resources/speed/schedule.py @@ -52,6 +52,7 @@ def create( url: str, *, zone_id: str, + frequency: Literal["DAILY", "WEEKLY"] | Omit = omit, region: Literal[ "asia-east1", "asia-northeast1", @@ -91,6 +92,9 @@ def create( url: A URL. + frequency: The frequency of the scheduled test. Defaults to WEEKLY for free plans, DAILY + for paid plans. + region: A test region. extra_headers: Send extra headers @@ -112,7 +116,13 @@ def create( extra_query=extra_query, extra_body=extra_body, timeout=timeout, - query=maybe_transform({"region": region}, schedule_create_params.ScheduleCreateParams), + query=maybe_transform( + { + "frequency": frequency, + "region": region, + }, + schedule_create_params.ScheduleCreateParams, + ), post_parser=ResultWrapper[Optional[ScheduleCreateResponse]]._unwrapper, ), cast_to=cast(Type[Optional[ScheduleCreateResponse]], ResultWrapper[ScheduleCreateResponse]), @@ -286,6 +296,7 @@ async def create( url: str, *, zone_id: str, + frequency: Literal["DAILY", "WEEKLY"] | Omit = omit, region: Literal[ "asia-east1", "asia-northeast1", @@ -325,6 +336,9 @@ async def create( url: A URL. + frequency: The frequency of the scheduled test. Defaults to WEEKLY for free plans, DAILY + for paid plans. + region: A test region. extra_headers: Send extra headers @@ -346,7 +360,13 @@ async def create( extra_query=extra_query, extra_body=extra_body, timeout=timeout, - query=await async_maybe_transform({"region": region}, schedule_create_params.ScheduleCreateParams), + query=await async_maybe_transform( + { + "frequency": frequency, + "region": region, + }, + schedule_create_params.ScheduleCreateParams, + ), post_parser=ResultWrapper[Optional[ScheduleCreateResponse]]._unwrapper, ), cast_to=cast(Type[Optional[ScheduleCreateResponse]], ResultWrapper[ScheduleCreateResponse]), diff --git a/src/cloudflare/resources/workers/scripts/versions.py b/src/cloudflare/resources/workers/scripts/versions.py index bb39678aaa4..3c8f95ecbc1 100644 --- a/src/cloudflare/resources/workers/scripts/versions.py +++ b/src/cloudflare/resources/workers/scripts/versions.py @@ -215,7 +215,7 @@ def get( timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> VersionGetResponse: """ - Get Version Detail + Retrieves detailed information about a specific version of a Workers script. Args: account_id: Identifier. @@ -425,7 +425,7 @@ async def get( timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> VersionGetResponse: """ - Get Version Detail + Retrieves detailed information about a specific version of a Workers script. Args: account_id: Identifier. diff --git a/src/cloudflare/resources/workflows/instances/events.py b/src/cloudflare/resources/workflows/instances/events.py index 6c8885c538a..1509e234b2b 100644 --- a/src/cloudflare/resources/workflows/instances/events.py +++ b/src/cloudflare/resources/workflows/instances/events.py @@ -59,7 +59,7 @@ def create( timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> object: """ - Send event to instance + Sends an event to a running workflow instance to trigger state transitions. Args: extra_headers: Send extra headers @@ -128,7 +128,7 @@ async def create( timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> object: """ - Send event to instance + Sends an event to a running workflow instance to trigger state transitions. Args: extra_headers: Send extra headers diff --git a/src/cloudflare/resources/workflows/instances/instances.py b/src/cloudflare/resources/workflows/instances/instances.py index 7ce3dfdeb52..46a72edc33c 100644 --- a/src/cloudflare/resources/workflows/instances/instances.py +++ b/src/cloudflare/resources/workflows/instances/instances.py @@ -37,7 +37,7 @@ from ...._wrappers import ResultWrapper from ....pagination import SyncSinglePage, AsyncSinglePage, SyncV4PagePaginationArray, AsyncV4PagePaginationArray from ...._base_client import AsyncPaginator, make_request_options -from ....types.workflows import instance_bulk_params, instance_list_params, instance_create_params +from ....types.workflows import instance_get_params, instance_bulk_params, instance_list_params, instance_create_params from ....types.workflows.instance_get_response import InstanceGetResponse from ....types.workflows.instance_bulk_response import InstanceBulkResponse from ....types.workflows.instance_list_response import InstanceListResponse @@ -90,7 +90,7 @@ def create( timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> InstanceCreateResponse: """ - Create a new workflow instance + Creates a new instance of a workflow, starting its execution. Args: extra_headers: Send extra headers @@ -148,7 +148,7 @@ def list( timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SyncV4PagePaginationArray[InstanceListResponse]: """ - List of workflow instances + Lists all instances of a workflow with their execution status. Args: cursor: `page` and `cursor` are mutually exclusive, use one or the other. @@ -212,7 +212,7 @@ def bulk( timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SyncSinglePage[InstanceBulkResponse]: """ - Batch create new Workflow instances + Creates multiple workflow instances in a single batch operation. Args: extra_headers: Send extra headers @@ -244,6 +244,8 @@ def get( *, account_id: str, workflow_name: str, + order: Literal["asc", "desc"] | Omit = omit, + simple: Literal["true", "false"] | 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, @@ -252,9 +254,13 @@ def get( timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> InstanceGetResponse: """ - Get logs and status from instance + Retrieves logs and execution status for a specific workflow instance. Args: + order: Step ordering: "asc" (default, oldest first) or "desc" (newest first). + + simple: When true, omits step details and returns only metadata with step_count. + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -276,6 +282,13 @@ def get( extra_query=extra_query, extra_body=extra_body, timeout=timeout, + query=maybe_transform( + { + "order": order, + "simple": simple, + }, + instance_get_params.InstanceGetParams, + ), post_parser=ResultWrapper[InstanceGetResponse]._unwrapper, ), cast_to=cast(Type[InstanceGetResponse], ResultWrapper[InstanceGetResponse]), @@ -326,7 +339,7 @@ async def create( timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> InstanceCreateResponse: """ - Create a new workflow instance + Creates a new instance of a workflow, starting its execution. Args: extra_headers: Send extra headers @@ -384,7 +397,7 @@ def list( timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AsyncPaginator[InstanceListResponse, AsyncV4PagePaginationArray[InstanceListResponse]]: """ - List of workflow instances + Lists all instances of a workflow with their execution status. Args: cursor: `page` and `cursor` are mutually exclusive, use one or the other. @@ -448,7 +461,7 @@ def bulk( timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AsyncPaginator[InstanceBulkResponse, AsyncSinglePage[InstanceBulkResponse]]: """ - Batch create new Workflow instances + Creates multiple workflow instances in a single batch operation. Args: extra_headers: Send extra headers @@ -480,6 +493,8 @@ async def get( *, account_id: str, workflow_name: str, + order: Literal["asc", "desc"] | Omit = omit, + simple: Literal["true", "false"] | 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, @@ -488,9 +503,13 @@ async def get( timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> InstanceGetResponse: """ - Get logs and status from instance + Retrieves logs and execution status for a specific workflow instance. Args: + order: Step ordering: "asc" (default, oldest first) or "desc" (newest first). + + simple: When true, omits step details and returns only metadata with step_count. + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -512,6 +531,13 @@ async def get( extra_query=extra_query, extra_body=extra_body, timeout=timeout, + query=await async_maybe_transform( + { + "order": order, + "simple": simple, + }, + instance_get_params.InstanceGetParams, + ), post_parser=ResultWrapper[InstanceGetResponse]._unwrapper, ), cast_to=cast(Type[InstanceGetResponse], ResultWrapper[InstanceGetResponse]), diff --git a/src/cloudflare/resources/workflows/instances/status.py b/src/cloudflare/resources/workflows/instances/status.py index 462b4c4be21..3b23b17a5bc 100644 --- a/src/cloudflare/resources/workflows/instances/status.py +++ b/src/cloudflare/resources/workflows/instances/status.py @@ -60,7 +60,8 @@ def edit( timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> StatusEditResponse: """ - Change status of instance + Changes the execution status of a workflow instance (e.g., pause, resume, + terminate). Args: status: Apply action to instance. @@ -128,7 +129,8 @@ async def edit( timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> StatusEditResponse: """ - Change status of instance + Changes the execution status of a workflow instance (e.g., pause, resume, + terminate). Args: status: Apply action to instance. diff --git a/src/cloudflare/resources/workflows/versions.py b/src/cloudflare/resources/workflows/versions.py index 6a965a68a7e..2a683b3a473 100644 --- a/src/cloudflare/resources/workflows/versions.py +++ b/src/cloudflare/resources/workflows/versions.py @@ -61,7 +61,7 @@ def list( timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SyncV4PagePaginationArray[VersionListResponse]: """ - List deployed Workflow versions + Lists all deployed versions of a workflow. Args: extra_headers: Send extra headers @@ -109,7 +109,7 @@ def get( timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> VersionGetResponse: """ - Get Workflow version details + Retrieves details for a specific deployed workflow version. Args: extra_headers: Send extra headers @@ -174,7 +174,7 @@ def list( timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AsyncPaginator[VersionListResponse, AsyncV4PagePaginationArray[VersionListResponse]]: """ - List deployed Workflow versions + Lists all deployed versions of a workflow. Args: extra_headers: Send extra headers @@ -222,7 +222,7 @@ async def get( timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> VersionGetResponse: """ - Get Workflow version details + Retrieves details for a specific deployed workflow version. Args: extra_headers: Send extra headers diff --git a/src/cloudflare/resources/workflows/workflows.py b/src/cloudflare/resources/workflows/workflows.py index 8d7d5fba510..049fdee3dd5 100644 --- a/src/cloudflare/resources/workflows/workflows.py +++ b/src/cloudflare/resources/workflows/workflows.py @@ -79,6 +79,7 @@ def update( account_id: str, class_name: str, script_name: str, + limits: workflow_update_params.Limits | 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, @@ -87,7 +88,7 @@ def update( timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> WorkflowUpdateResponse: """ - Create/modify Workflow + Creates a new workflow or updates an existing workflow definition. Args: extra_headers: Send extra headers @@ -108,6 +109,7 @@ def update( { "class_name": class_name, "script_name": script_name, + "limits": limits, }, workflow_update_params.WorkflowUpdateParams, ), @@ -136,7 +138,7 @@ def list( timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> SyncV4PagePaginationArray[WorkflowListResponse]: """ - List all Workflows + Lists all workflows configured for the account. Args: search: Allows filtering workflows` name. @@ -226,7 +228,7 @@ def get( timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> WorkflowGetResponse: """ - Get Workflow details + Retrieves configuration and metadata for a specific workflow. Args: extra_headers: Send extra headers @@ -289,6 +291,7 @@ async def update( account_id: str, class_name: str, script_name: str, + limits: workflow_update_params.Limits | 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, @@ -297,7 +300,7 @@ async def update( timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> WorkflowUpdateResponse: """ - Create/modify Workflow + Creates a new workflow or updates an existing workflow definition. Args: extra_headers: Send extra headers @@ -318,6 +321,7 @@ async def update( { "class_name": class_name, "script_name": script_name, + "limits": limits, }, workflow_update_params.WorkflowUpdateParams, ), @@ -346,7 +350,7 @@ def list( timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> AsyncPaginator[WorkflowListResponse, AsyncV4PagePaginationArray[WorkflowListResponse]]: """ - List all Workflows + Lists all workflows configured for the account. Args: search: Allows filtering workflows` name. @@ -436,7 +440,7 @@ async def get( timeout: float | httpx.Timeout | None | NotGiven = not_given, ) -> WorkflowGetResponse: """ - Get Workflow details + Retrieves configuration and metadata for a specific workflow. Args: extra_headers: Send extra headers diff --git a/src/cloudflare/resources/zero_trust/dlp/profiles/custom.py b/src/cloudflare/resources/zero_trust/dlp/profiles/custom.py index 586ccceee16..e7c0036747e 100644 --- a/src/cloudflare/resources/zero_trust/dlp/profiles/custom.py +++ b/src/cloudflare/resources/zero_trust/dlp/profiles/custom.py @@ -6,7 +6,7 @@ import httpx -from ....._types import Body, Omit, Query, Headers, NotGiven, omit, not_given +from ....._types import Body, Omit, Query, Headers, NotGiven, SequenceNotStr, omit, not_given from ....._utils import maybe_transform, async_maybe_transform from ....._compat import cached_property from ....._resource import SyncAPIResource, AsyncAPIResource @@ -54,9 +54,12 @@ def create( allowed_match_count: int | Omit = omit, confidence_threshold: Optional[str] | Omit = omit, context_awareness: ContextAwarenessParam | Omit = omit, + data_classes: SequenceNotStr[str] | Omit = omit, + data_tags: SequenceNotStr[str] | Omit = omit, description: Optional[str] | Omit = omit, entries: Iterable[custom_create_params.Entry] | Omit = omit, ocr_enabled: bool | Omit = omit, + sensitivity_levels: Iterable[SequenceNotStr[str]] | Omit = omit, shared_entries: Iterable[custom_create_params.SharedEntry] | 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. @@ -74,8 +77,14 @@ def create( context_awareness: Scan the context of predefined entries to only return matches surrounded by keywords. + data_classes: Data class IDs to associate with the profile. + + data_tags: Data tag IDs to associate with the profile. + description: The description of the profile. + sensitivity_levels: Sensitivity levels to associate with the profile as (group_id, level_id) tuples. + shared_entries: Entries from other profiles (e.g. pre-defined Cloudflare profiles, or your Microsoft Information Protection profiles). @@ -100,9 +109,12 @@ def create( "allowed_match_count": allowed_match_count, "confidence_threshold": confidence_threshold, "context_awareness": context_awareness, + "data_classes": data_classes, + "data_tags": data_tags, "description": description, "entries": entries, "ocr_enabled": ocr_enabled, + "sensitivity_levels": sensitivity_levels, "shared_entries": shared_entries, }, custom_create_params.CustomCreateParams, @@ -130,9 +142,12 @@ def update( allowed_match_count: Optional[int] | Omit = omit, confidence_threshold: Optional[str] | Omit = omit, context_awareness: ContextAwarenessParam | Omit = omit, + data_classes: Optional[SequenceNotStr[str]] | Omit = omit, + data_tags: Optional[SequenceNotStr[str]] | Omit = omit, description: Optional[str] | Omit = omit, entries: Optional[Iterable[custom_update_params.Entry]] | Omit = omit, ocr_enabled: bool | Omit = omit, + sensitivity_levels: Optional[Iterable[SequenceNotStr[str]]] | Omit = omit, shared_entries: Iterable[custom_update_params.SharedEntry] | 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. @@ -148,11 +163,20 @@ def update( context_awareness: Scan the context of predefined entries to only return matches surrounded by keywords. + data_classes: Data class IDs to associate with the profile. If omitted, existing associations + are unchanged. + + data_tags: Data tag IDs to associate with the profile. If omitted, existing associations + are unchanged. + description: The description of the profile. entries: Custom entries from this profile. If this field is omitted, entries owned by this profile will not be changed. + sensitivity_levels: Sensitivity levels to associate with the profile. If omitted, existing + associations are unchanged. + shared_entries: Other entries, e.g. predefined or integration. extra_headers: Send extra headers @@ -178,9 +202,12 @@ def update( "allowed_match_count": allowed_match_count, "confidence_threshold": confidence_threshold, "context_awareness": context_awareness, + "data_classes": data_classes, + "data_tags": data_tags, "description": description, "entries": entries, "ocr_enabled": ocr_enabled, + "sensitivity_levels": sensitivity_levels, "shared_entries": shared_entries, }, custom_update_params.CustomUpdateParams, @@ -313,9 +340,12 @@ async def create( allowed_match_count: int | Omit = omit, confidence_threshold: Optional[str] | Omit = omit, context_awareness: ContextAwarenessParam | Omit = omit, + data_classes: SequenceNotStr[str] | Omit = omit, + data_tags: SequenceNotStr[str] | Omit = omit, description: Optional[str] | Omit = omit, entries: Iterable[custom_create_params.Entry] | Omit = omit, ocr_enabled: bool | Omit = omit, + sensitivity_levels: Iterable[SequenceNotStr[str]] | Omit = omit, shared_entries: Iterable[custom_create_params.SharedEntry] | 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. @@ -333,8 +363,14 @@ async def create( context_awareness: Scan the context of predefined entries to only return matches surrounded by keywords. + data_classes: Data class IDs to associate with the profile. + + data_tags: Data tag IDs to associate with the profile. + description: The description of the profile. + sensitivity_levels: Sensitivity levels to associate with the profile as (group_id, level_id) tuples. + shared_entries: Entries from other profiles (e.g. pre-defined Cloudflare profiles, or your Microsoft Information Protection profiles). @@ -359,9 +395,12 @@ async def create( "allowed_match_count": allowed_match_count, "confidence_threshold": confidence_threshold, "context_awareness": context_awareness, + "data_classes": data_classes, + "data_tags": data_tags, "description": description, "entries": entries, "ocr_enabled": ocr_enabled, + "sensitivity_levels": sensitivity_levels, "shared_entries": shared_entries, }, custom_create_params.CustomCreateParams, @@ -389,9 +428,12 @@ async def update( allowed_match_count: Optional[int] | Omit = omit, confidence_threshold: Optional[str] | Omit = omit, context_awareness: ContextAwarenessParam | Omit = omit, + data_classes: Optional[SequenceNotStr[str]] | Omit = omit, + data_tags: Optional[SequenceNotStr[str]] | Omit = omit, description: Optional[str] | Omit = omit, entries: Optional[Iterable[custom_update_params.Entry]] | Omit = omit, ocr_enabled: bool | Omit = omit, + sensitivity_levels: Optional[Iterable[SequenceNotStr[str]]] | Omit = omit, shared_entries: Iterable[custom_update_params.SharedEntry] | 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. @@ -407,11 +449,20 @@ async def update( context_awareness: Scan the context of predefined entries to only return matches surrounded by keywords. + data_classes: Data class IDs to associate with the profile. If omitted, existing associations + are unchanged. + + data_tags: Data tag IDs to associate with the profile. If omitted, existing associations + are unchanged. + description: The description of the profile. entries: Custom entries from this profile. If this field is omitted, entries owned by this profile will not be changed. + sensitivity_levels: Sensitivity levels to associate with the profile. If omitted, existing + associations are unchanged. + shared_entries: Other entries, e.g. predefined or integration. extra_headers: Send extra headers @@ -437,9 +488,12 @@ async def update( "allowed_match_count": allowed_match_count, "confidence_threshold": confidence_threshold, "context_awareness": context_awareness, + "data_classes": data_classes, + "data_tags": data_tags, "description": description, "entries": entries, "ocr_enabled": ocr_enabled, + "sensitivity_levels": sensitivity_levels, "shared_entries": shared_entries, }, custom_update_params.CustomUpdateParams, diff --git a/src/cloudflare/types/abuse_reports/abuse_report_create_params.py b/src/cloudflare/types/abuse_reports/abuse_report_create_params.py index 9d6ae29ffc0..b004cdd1a1c 100644 --- a/src/cloudflare/types/abuse_reports/abuse_report_create_params.py +++ b/src/cloudflare/types/abuse_reports/abuse_report_create_params.py @@ -262,7 +262,7 @@ class AbuseReportsGeneralReport(TypedDict, total=False): Database (https://lumendatabase.org/). """ - owner_notification: Required[Literal["send", "send-anon", "none"]] + owner_notification: Required[Literal["send", "send-anon"]] """Notification type based on the abuse type. NOTE: Copyright (DMCA) and Trademark reports cannot be anonymous. diff --git a/src/cloudflare/types/ai_gateway/ai_gateway_create_params.py b/src/cloudflare/types/ai_gateway/ai_gateway_create_params.py index be112a797dc..213071208f8 100644 --- a/src/cloudflare/types/ai_gateway/ai_gateway_create_params.py +++ b/src/cloudflare/types/ai_gateway/ai_gateway_create_params.py @@ -28,8 +28,6 @@ class AIGatewayCreateParams(TypedDict, total=False): authentication: bool - is_default: bool - log_management: Optional[int] log_management_strategy: Optional[Literal["STOP_INSERTING", "DELETE_OLDEST"]] @@ -38,4 +36,7 @@ class AIGatewayCreateParams(TypedDict, total=False): logpush_public_key: Optional[str] + workers_ai_billing_mode: Literal["postpaid", "unified"] + """Controls how Workers AI inference calls routed through this gateway are billed""" + zdr: bool diff --git a/src/cloudflare/types/ai_gateway/ai_gateway_create_response.py b/src/cloudflare/types/ai_gateway/ai_gateway_create_response.py index 690cf4b30d1..d4c88925c6f 100644 --- a/src/cloudflare/types/ai_gateway/ai_gateway_create_response.py +++ b/src/cloudflare/types/ai_gateway/ai_gateway_create_response.py @@ -54,6 +54,8 @@ class Otel(BaseModel): url: str + content_type: Optional[Literal["json", "protobuf"]] = None + class StripeUsageEvent(BaseModel): payload: str @@ -69,10 +71,6 @@ class AIGatewayCreateResponse(BaseModel): id: str """gateway id""" - account_id: str - - account_tag: str - cache_invalidate_on_update: bool cache_ttl: Optional[int] = None @@ -81,8 +79,6 @@ class AIGatewayCreateResponse(BaseModel): created_at: datetime - internal_id: str - modified_at: datetime rate_limiting_interval: Optional[int] = None @@ -111,4 +107,7 @@ class AIGatewayCreateResponse(BaseModel): stripe: Optional[Stripe] = None + workers_ai_billing_mode: Optional[Literal["postpaid", "unified"]] = None + """Controls how Workers AI inference calls routed through this gateway are billed""" + zdr: Optional[bool] = None diff --git a/src/cloudflare/types/ai_gateway/ai_gateway_delete_response.py b/src/cloudflare/types/ai_gateway/ai_gateway_delete_response.py index 3575a8d62ad..9a38af08300 100644 --- a/src/cloudflare/types/ai_gateway/ai_gateway_delete_response.py +++ b/src/cloudflare/types/ai_gateway/ai_gateway_delete_response.py @@ -54,6 +54,8 @@ class Otel(BaseModel): url: str + content_type: Optional[Literal["json", "protobuf"]] = None + class StripeUsageEvent(BaseModel): payload: str @@ -69,10 +71,6 @@ class AIGatewayDeleteResponse(BaseModel): id: str """gateway id""" - account_id: str - - account_tag: str - cache_invalidate_on_update: bool cache_ttl: Optional[int] = None @@ -81,8 +79,6 @@ class AIGatewayDeleteResponse(BaseModel): created_at: datetime - internal_id: str - modified_at: datetime rate_limiting_interval: Optional[int] = None @@ -111,4 +107,7 @@ class AIGatewayDeleteResponse(BaseModel): stripe: Optional[Stripe] = None + workers_ai_billing_mode: Optional[Literal["postpaid", "unified"]] = None + """Controls how Workers AI inference calls routed through this gateway are billed""" + zdr: Optional[bool] = None diff --git a/src/cloudflare/types/ai_gateway/ai_gateway_get_response.py b/src/cloudflare/types/ai_gateway/ai_gateway_get_response.py index ad13af400f9..866ec00a7cd 100644 --- a/src/cloudflare/types/ai_gateway/ai_gateway_get_response.py +++ b/src/cloudflare/types/ai_gateway/ai_gateway_get_response.py @@ -54,6 +54,8 @@ class Otel(BaseModel): url: str + content_type: Optional[Literal["json", "protobuf"]] = None + class StripeUsageEvent(BaseModel): payload: str @@ -69,10 +71,6 @@ class AIGatewayGetResponse(BaseModel): id: str """gateway id""" - account_id: str - - account_tag: str - cache_invalidate_on_update: bool cache_ttl: Optional[int] = None @@ -81,8 +79,6 @@ class AIGatewayGetResponse(BaseModel): created_at: datetime - internal_id: str - modified_at: datetime rate_limiting_interval: Optional[int] = None @@ -111,4 +107,7 @@ class AIGatewayGetResponse(BaseModel): stripe: Optional[Stripe] = None + workers_ai_billing_mode: Optional[Literal["postpaid", "unified"]] = None + """Controls how Workers AI inference calls routed through this gateway are billed""" + zdr: Optional[bool] = None diff --git a/src/cloudflare/types/ai_gateway/ai_gateway_list_response.py b/src/cloudflare/types/ai_gateway/ai_gateway_list_response.py index 99681cb27c7..17e5fa98cbc 100644 --- a/src/cloudflare/types/ai_gateway/ai_gateway_list_response.py +++ b/src/cloudflare/types/ai_gateway/ai_gateway_list_response.py @@ -54,6 +54,8 @@ class Otel(BaseModel): url: str + content_type: Optional[Literal["json", "protobuf"]] = None + class StripeUsageEvent(BaseModel): payload: str @@ -69,10 +71,6 @@ class AIGatewayListResponse(BaseModel): id: str """gateway id""" - account_id: str - - account_tag: str - cache_invalidate_on_update: bool cache_ttl: Optional[int] = None @@ -81,8 +79,6 @@ class AIGatewayListResponse(BaseModel): created_at: datetime - internal_id: str - modified_at: datetime rate_limiting_interval: Optional[int] = None @@ -111,4 +107,7 @@ class AIGatewayListResponse(BaseModel): stripe: Optional[Stripe] = None + workers_ai_billing_mode: Optional[Literal["postpaid", "unified"]] = None + """Controls how Workers AI inference calls routed through this gateway are billed""" + zdr: Optional[bool] = None diff --git a/src/cloudflare/types/ai_gateway/ai_gateway_update_params.py b/src/cloudflare/types/ai_gateway/ai_gateway_update_params.py index b59349236ae..9ab63b83479 100644 --- a/src/cloudflare/types/ai_gateway/ai_gateway_update_params.py +++ b/src/cloudflare/types/ai_gateway/ai_gateway_update_params.py @@ -38,8 +38,6 @@ class AIGatewayUpdateParams(TypedDict, total=False): dlp: DLP - is_default: bool - log_management: Optional[int] log_management_strategy: Optional[Literal["STOP_INSERTING", "DELETE_OLDEST"]] @@ -54,6 +52,9 @@ class AIGatewayUpdateParams(TypedDict, total=False): stripe: Optional[Stripe] + workers_ai_billing_mode: Literal["postpaid", "unified"] + """Controls how Workers AI inference calls routed through this gateway are billed""" + zdr: bool @@ -93,6 +94,8 @@ class Otel(TypedDict, total=False): url: Required[str] + content_type: Literal["json", "protobuf"] + class StripeUsageEvent(TypedDict, total=False): payload: Required[str] diff --git a/src/cloudflare/types/ai_gateway/ai_gateway_update_response.py b/src/cloudflare/types/ai_gateway/ai_gateway_update_response.py index 6250e1cc8ba..69cf2d1702e 100644 --- a/src/cloudflare/types/ai_gateway/ai_gateway_update_response.py +++ b/src/cloudflare/types/ai_gateway/ai_gateway_update_response.py @@ -54,6 +54,8 @@ class Otel(BaseModel): url: str + content_type: Optional[Literal["json", "protobuf"]] = None + class StripeUsageEvent(BaseModel): payload: str @@ -69,10 +71,6 @@ class AIGatewayUpdateResponse(BaseModel): id: str """gateway id""" - account_id: str - - account_tag: str - cache_invalidate_on_update: bool cache_ttl: Optional[int] = None @@ -81,8 +79,6 @@ class AIGatewayUpdateResponse(BaseModel): created_at: datetime - internal_id: str - modified_at: datetime rate_limiting_interval: Optional[int] = None @@ -111,4 +107,7 @@ class AIGatewayUpdateResponse(BaseModel): stripe: Optional[Stripe] = None + workers_ai_billing_mode: Optional[Literal["postpaid", "unified"]] = None + """Controls how Workers AI inference calls routed through this gateway are billed""" + zdr: Optional[bool] = None diff --git a/src/cloudflare/types/ai_gateway/dataset_create_response.py b/src/cloudflare/types/ai_gateway/dataset_create_response.py index 5be90be4a14..806584ab12e 100644 --- a/src/cloudflare/types/ai_gateway/dataset_create_response.py +++ b/src/cloudflare/types/ai_gateway/dataset_create_response.py @@ -34,10 +34,6 @@ class Filter(BaseModel): class DatasetCreateResponse(BaseModel): id: str - account_id: str - - account_tag: str - created_at: datetime enable: bool diff --git a/src/cloudflare/types/ai_gateway/dataset_delete_response.py b/src/cloudflare/types/ai_gateway/dataset_delete_response.py index 9b9ede756f2..b097128ba3c 100644 --- a/src/cloudflare/types/ai_gateway/dataset_delete_response.py +++ b/src/cloudflare/types/ai_gateway/dataset_delete_response.py @@ -34,10 +34,6 @@ class Filter(BaseModel): class DatasetDeleteResponse(BaseModel): id: str - account_id: str - - account_tag: str - created_at: datetime enable: bool diff --git a/src/cloudflare/types/ai_gateway/dataset_get_response.py b/src/cloudflare/types/ai_gateway/dataset_get_response.py index 102c0cd1b49..1641c723f9e 100644 --- a/src/cloudflare/types/ai_gateway/dataset_get_response.py +++ b/src/cloudflare/types/ai_gateway/dataset_get_response.py @@ -34,10 +34,6 @@ class Filter(BaseModel): class DatasetGetResponse(BaseModel): id: str - account_id: str - - account_tag: str - created_at: datetime enable: bool diff --git a/src/cloudflare/types/ai_gateway/dataset_list_response.py b/src/cloudflare/types/ai_gateway/dataset_list_response.py index cf9d6e28bd3..710a48b322d 100644 --- a/src/cloudflare/types/ai_gateway/dataset_list_response.py +++ b/src/cloudflare/types/ai_gateway/dataset_list_response.py @@ -34,10 +34,6 @@ class Filter(BaseModel): class DatasetListResponse(BaseModel): id: str - account_id: str - - account_tag: str - created_at: datetime enable: bool diff --git a/src/cloudflare/types/ai_gateway/dataset_update_response.py b/src/cloudflare/types/ai_gateway/dataset_update_response.py index 2cfeca9e20c..a68021d1647 100644 --- a/src/cloudflare/types/ai_gateway/dataset_update_response.py +++ b/src/cloudflare/types/ai_gateway/dataset_update_response.py @@ -34,10 +34,6 @@ class Filter(BaseModel): class DatasetUpdateResponse(BaseModel): id: str - account_id: str - - account_tag: str - created_at: datetime enable: bool diff --git a/src/cloudflare/types/ai_gateway/dynamic_routing_create_deployment_response.py b/src/cloudflare/types/ai_gateway/dynamic_routing_create_deployment_response.py index 52f0bcbcfae..9952e6e63f5 100644 --- a/src/cloudflare/types/ai_gateway/dynamic_routing_create_deployment_response.py +++ b/src/cloudflare/types/ai_gateway/dynamic_routing_create_deployment_response.py @@ -185,8 +185,6 @@ class ElementUnionMember5(BaseModel): class DynamicRoutingCreateDeploymentResponse(BaseModel): id: str - account_tag: str - created_at: datetime elements: List[Element] diff --git a/src/cloudflare/types/ai_gateway/dynamic_routing_create_response.py b/src/cloudflare/types/ai_gateway/dynamic_routing_create_response.py index c474ddb8514..bd50d5adc66 100644 --- a/src/cloudflare/types/ai_gateway/dynamic_routing_create_response.py +++ b/src/cloudflare/types/ai_gateway/dynamic_routing_create_response.py @@ -209,8 +209,6 @@ class Version(BaseModel): class DynamicRoutingCreateResponse(BaseModel): id: str - account_tag: str - created_at: datetime deployment: Deployment diff --git a/src/cloudflare/types/ai_gateway/dynamic_routing_create_version_response.py b/src/cloudflare/types/ai_gateway/dynamic_routing_create_version_response.py index 7ceef2f3a58..737c0292956 100644 --- a/src/cloudflare/types/ai_gateway/dynamic_routing_create_version_response.py +++ b/src/cloudflare/types/ai_gateway/dynamic_routing_create_version_response.py @@ -185,8 +185,6 @@ class ElementUnionMember5(BaseModel): class DynamicRoutingCreateVersionResponse(BaseModel): id: str - account_tag: str - created_at: datetime elements: List[Element] diff --git a/src/cloudflare/types/ai_gateway/dynamic_routing_delete_response.py b/src/cloudflare/types/ai_gateway/dynamic_routing_delete_response.py index 32a4772e569..d57a51826a7 100644 --- a/src/cloudflare/types/ai_gateway/dynamic_routing_delete_response.py +++ b/src/cloudflare/types/ai_gateway/dynamic_routing_delete_response.py @@ -185,8 +185,6 @@ class ElementUnionMember5(BaseModel): class DynamicRoutingDeleteResponse(BaseModel): id: str - account_tag: str - created_at: datetime elements: List[Element] diff --git a/src/cloudflare/types/ai_gateway/dynamic_routing_get_response.py b/src/cloudflare/types/ai_gateway/dynamic_routing_get_response.py index d2641a522fb..ec592a02639 100644 --- a/src/cloudflare/types/ai_gateway/dynamic_routing_get_response.py +++ b/src/cloudflare/types/ai_gateway/dynamic_routing_get_response.py @@ -209,8 +209,6 @@ class Version(BaseModel): class DynamicRoutingGetResponse(BaseModel): id: str - account_tag: str - created_at: datetime deployment: Deployment diff --git a/src/cloudflare/types/ai_gateway/dynamic_routing_get_version_response.py b/src/cloudflare/types/ai_gateway/dynamic_routing_get_version_response.py index 649d4cf78e2..7770fb981cb 100644 --- a/src/cloudflare/types/ai_gateway/dynamic_routing_get_version_response.py +++ b/src/cloudflare/types/ai_gateway/dynamic_routing_get_version_response.py @@ -185,8 +185,6 @@ class ElementUnionMember5(BaseModel): class DynamicRoutingGetVersionResponse(BaseModel): id: str - account_tag: str - active: Literal["true", "false"] created_at: str diff --git a/src/cloudflare/types/ai_gateway/evaluation_create_response.py b/src/cloudflare/types/ai_gateway/evaluation_create_response.py index 40b1b09254b..cf8a74f977d 100644 --- a/src/cloudflare/types/ai_gateway/evaluation_create_response.py +++ b/src/cloudflare/types/ai_gateway/evaluation_create_response.py @@ -75,10 +75,6 @@ class Result(BaseModel): class EvaluationCreateResponse(BaseModel): id: str - account_id: str - - account_tag: str - created_at: datetime datasets: List[Dataset] diff --git a/src/cloudflare/types/ai_gateway/evaluation_delete_response.py b/src/cloudflare/types/ai_gateway/evaluation_delete_response.py index 163d4406dd6..b5a129bfe57 100644 --- a/src/cloudflare/types/ai_gateway/evaluation_delete_response.py +++ b/src/cloudflare/types/ai_gateway/evaluation_delete_response.py @@ -75,10 +75,6 @@ class Result(BaseModel): class EvaluationDeleteResponse(BaseModel): id: str - account_id: str - - account_tag: str - created_at: datetime datasets: List[Dataset] diff --git a/src/cloudflare/types/ai_gateway/evaluation_get_response.py b/src/cloudflare/types/ai_gateway/evaluation_get_response.py index 2ac71bd4a18..b5742ab63cf 100644 --- a/src/cloudflare/types/ai_gateway/evaluation_get_response.py +++ b/src/cloudflare/types/ai_gateway/evaluation_get_response.py @@ -75,10 +75,6 @@ class Result(BaseModel): class EvaluationGetResponse(BaseModel): id: str - account_id: str - - account_tag: str - created_at: datetime datasets: List[Dataset] diff --git a/src/cloudflare/types/ai_gateway/evaluation_list_response.py b/src/cloudflare/types/ai_gateway/evaluation_list_response.py index e40b09a38aa..055f50727c4 100644 --- a/src/cloudflare/types/ai_gateway/evaluation_list_response.py +++ b/src/cloudflare/types/ai_gateway/evaluation_list_response.py @@ -75,10 +75,6 @@ class Result(BaseModel): class EvaluationListResponse(BaseModel): id: str - account_id: str - - account_tag: str - created_at: datetime datasets: List[Dataset] diff --git a/src/cloudflare/types/ai_gateway/provider_config_create_response.py b/src/cloudflare/types/ai_gateway/provider_config_create_response.py index 7beec1a3a36..1b0a0bcf2c6 100644 --- a/src/cloudflare/types/ai_gateway/provider_config_create_response.py +++ b/src/cloudflare/types/ai_gateway/provider_config_create_response.py @@ -11,10 +11,6 @@ class ProviderConfigCreateResponse(BaseModel): id: str - account_id: str - - account_tag: str - alias: str default_config: bool diff --git a/src/cloudflare/types/ai_gateway/provider_config_list_response.py b/src/cloudflare/types/ai_gateway/provider_config_list_response.py index 6c2fa3aef29..2998e9f70fa 100644 --- a/src/cloudflare/types/ai_gateway/provider_config_list_response.py +++ b/src/cloudflare/types/ai_gateway/provider_config_list_response.py @@ -11,10 +11,6 @@ class ProviderConfigListResponse(BaseModel): id: str - account_id: str - - account_tag: str - alias: str default_config: bool diff --git a/src/cloudflare/types/aisearch/instance_chat_completions_params.py b/src/cloudflare/types/aisearch/instance_chat_completions_params.py index a60d3a9a458..47445b63283 100644 --- a/src/cloudflare/types/aisearch/instance_chat_completions_params.py +++ b/src/cloudflare/types/aisearch/instance_chat_completions_params.py @@ -14,6 +14,7 @@ "AISearchOptionsQueryRewrite", "AISearchOptionsReranking", "AISearchOptionsRetrieval", + "AISearchOptionsRetrievalBoostBy", ] @@ -112,7 +113,34 @@ class AISearchOptionsReranking(TypedDict, total=False): model: Literal["@cf/baai/bge-reranker-base", ""] +class AISearchOptionsRetrievalBoostBy(TypedDict, total=False): + field: Required[str] + """Metadata field name to boost by. + + Use 'timestamp' for document freshness, or any custom_metadata field. Numeric + fields support asc/desc directions; text/boolean fields support + exists/not_exists. + """ + + direction: Literal["asc", "desc", "exists", "not_exists"] + """Boost direction. + + 'desc' = higher values rank higher (e.g. newer timestamps). 'asc' = lower values + rank higher. 'exists' = boost chunks that have the field. 'not_exists' = boost + chunks that lack the field. Optional ��� defaults to 'asc' for numeric fields, + 'exists' for text/boolean fields. + """ + + class AISearchOptionsRetrieval(TypedDict, total=False): + boost_by: Iterable[AISearchOptionsRetrievalBoostBy] + """Metadata fields to boost search results by. + + Overrides the instance-level boost_by config. Direction defaults to 'asc' for + numeric fields, 'exists' for text/boolean fields. Fields must match 'timestamp' + or a defined custom_metadata field. + """ + context_expansion: int filters: Dict[str, object] diff --git a/src/cloudflare/types/aisearch/instance_create_params.py b/src/cloudflare/types/aisearch/instance_create_params.py index 19f94e53997..ed3f9e19263 100644 --- a/src/cloudflare/types/aisearch/instance_create_params.py +++ b/src/cloudflare/types/aisearch/instance_create_params.py @@ -19,9 +19,11 @@ "PublicEndpointParamsRateLimit", "PublicEndpointParamsSearchEndpoint", "RetrievalOptions", + "RetrievalOptionsBoostBy", "SourceParams", "SourceParamsWebCrawler", "SourceParamsWebCrawlerParseOptions", + "SourceParamsWebCrawlerParseOptionsContentSelector", "SourceParamsWebCrawlerStoreOptions", ] @@ -32,10 +34,6 @@ class InstanceCreateParams(TypedDict, total=False): id: Required[str] """Use your AI Search ID.""" - source: Required[str] - - type: Required[Literal["r2", "web-crawler"]] - ai_gateway_id: Optional[str] aisearch_model: Annotated[ @@ -72,6 +70,10 @@ class InstanceCreateParams(TypedDict, total=False): PropertyInfo(alias="ai_search_model"), ] + cache: bool + + cache_threshold: Literal["super_strict_match", "close_enough", "flexible_friend", "anything_goes"] + chunk: bool chunk_overlap: int @@ -142,10 +144,14 @@ class InstanceCreateParams(TypedDict, total=False): score_threshold: float + source: str + source_params: Optional[SourceParams] token_id: str + type: Literal["r2", "web-crawler"] + class CustomMetadata(TypedDict, total=False): data_type: Required[Literal["text", "number", "boolean"]] @@ -198,7 +204,34 @@ class PublicEndpointParams(TypedDict, total=False): search_endpoint: PublicEndpointParamsSearchEndpoint +class RetrievalOptionsBoostBy(TypedDict, total=False): + field: Required[str] + """Metadata field name to boost by. + + Use 'timestamp' for document freshness, or any custom_metadata field. Numeric + fields support asc/desc directions; text/boolean fields support + exists/not_exists. + """ + + direction: Literal["asc", "desc", "exists", "not_exists"] + """Boost direction. + + 'desc' = higher values rank higher (e.g. newer timestamps). 'asc' = lower values + rank higher. 'exists' = boost chunks that have the field. 'not_exists' = boost + chunks that lack the field. Optional ��� defaults to 'asc' for numeric fields, + 'exists' for text/boolean fields. + """ + + class RetrievalOptions(TypedDict, total=False): + boost_by: Iterable[RetrievalOptionsBoostBy] + """Metadata fields to boost search results by. + + Each entry specifies a metadata field and an optional direction. Direction + defaults to 'asc' for numeric fields and 'exists' for text/boolean fields. + Fields must match 'timestamp' or a defined custom_metadata field. + """ + keyword_match_mode: Literal["exact_match", "fuzzy_match"] """Controls how keyword search terms are matched. @@ -207,7 +240,30 @@ class RetrievalOptions(TypedDict, total=False): """ +class SourceParamsWebCrawlerParseOptionsContentSelector(TypedDict, total=False): + path: Required[str] + """Glob pattern to match against the page URL path. + + Uses standard glob syntax: \\** matches within a segment, \\**\\** crosses + directories. + """ + + selector: Required[str] + """CSS selector to extract content from pages matching the path pattern. + + Supports standard CSS selectors including class, ID, element, and attribute + selectors. + """ + + class SourceParamsWebCrawlerParseOptions(TypedDict, total=False): + content_selector: Iterable[SourceParamsWebCrawlerParseOptionsContentSelector] + """ + List of path-to-selector mappings for extracting specific content from crawled + pages. Each entry pairs a URL glob pattern with a CSS selector. The first + matching path wins. Only the matched HTML fragment is stored and indexed. + """ + include_headers: Dict[str, str] include_images: bool diff --git a/src/cloudflare/types/aisearch/instance_create_response.py b/src/cloudflare/types/aisearch/instance_create_response.py index 4a81cf1c492..8509a055875 100644 --- a/src/cloudflare/types/aisearch/instance_create_response.py +++ b/src/cloudflare/types/aisearch/instance_create_response.py @@ -19,9 +19,11 @@ "PublicEndpointParamsRateLimit", "PublicEndpointParamsSearchEndpoint", "RetrievalOptions", + "RetrievalOptionsBoostBy", "SourceParams", "SourceParamsWebCrawler", "SourceParamsWebCrawlerParseOptions", + "SourceParamsWebCrawlerParseOptionsContentSelector", "SourceParamsWebCrawlerStoreOptions", ] @@ -77,7 +79,34 @@ class PublicEndpointParams(BaseModel): search_endpoint: Optional[PublicEndpointParamsSearchEndpoint] = None +class RetrievalOptionsBoostBy(BaseModel): + field: str + """Metadata field name to boost by. + + Use 'timestamp' for document freshness, or any custom_metadata field. Numeric + fields support asc/desc directions; text/boolean fields support + exists/not_exists. + """ + + direction: Optional[Literal["asc", "desc", "exists", "not_exists"]] = None + """Boost direction. + + 'desc' = higher values rank higher (e.g. newer timestamps). 'asc' = lower values + rank higher. 'exists' = boost chunks that have the field. 'not_exists' = boost + chunks that lack the field. Optional ��� defaults to 'asc' for numeric fields, + 'exists' for text/boolean fields. + """ + + class RetrievalOptions(BaseModel): + boost_by: Optional[List[RetrievalOptionsBoostBy]] = None + """Metadata fields to boost search results by. + + Each entry specifies a metadata field and an optional direction. Direction + defaults to 'asc' for numeric fields and 'exists' for text/boolean fields. + Fields must match 'timestamp' or a defined custom_metadata field. + """ + keyword_match_mode: Optional[Literal["exact_match", "fuzzy_match"]] = None """Controls how keyword search terms are matched. @@ -86,7 +115,30 @@ class RetrievalOptions(BaseModel): """ +class SourceParamsWebCrawlerParseOptionsContentSelector(BaseModel): + path: str + """Glob pattern to match against the page URL path. + + Uses standard glob syntax: \\** matches within a segment, \\**\\** crosses + directories. + """ + + selector: str + """CSS selector to extract content from pages matching the path pattern. + + Supports standard CSS selectors including class, ID, element, and attribute + selectors. + """ + + class SourceParamsWebCrawlerParseOptions(BaseModel): + content_selector: Optional[List[SourceParamsWebCrawlerParseOptionsContentSelector]] = None + """ + List of path-to-selector mappings for extracting specific content from crawled + pages. Each entry pairs a URL glob pattern with a CSS selector. The first + matching path wins. Only the matched HTML fragment is stored and indexed. + """ + include_headers: Optional[Dict[str, str]] = None include_images: Optional[bool] = None @@ -147,10 +199,6 @@ class InstanceCreateResponse(BaseModel): modified_at: datetime - source: str - - type: Literal["r2", "web-crawler"] - vectorize_name: str ai_gateway_id: Optional[str] = None @@ -276,8 +324,12 @@ class InstanceCreateResponse(BaseModel): score_threshold: Optional[float] = None + source: Optional[str] = None + source_params: Optional[SourceParams] = None status: Optional[str] = None token_id: Optional[str] = None + + type: Optional[Literal["r2", "web-crawler"]] = None diff --git a/src/cloudflare/types/aisearch/instance_delete_response.py b/src/cloudflare/types/aisearch/instance_delete_response.py index 8c19423fa88..b12dd8839ec 100644 --- a/src/cloudflare/types/aisearch/instance_delete_response.py +++ b/src/cloudflare/types/aisearch/instance_delete_response.py @@ -19,9 +19,11 @@ "PublicEndpointParamsRateLimit", "PublicEndpointParamsSearchEndpoint", "RetrievalOptions", + "RetrievalOptionsBoostBy", "SourceParams", "SourceParamsWebCrawler", "SourceParamsWebCrawlerParseOptions", + "SourceParamsWebCrawlerParseOptionsContentSelector", "SourceParamsWebCrawlerStoreOptions", ] @@ -77,7 +79,34 @@ class PublicEndpointParams(BaseModel): search_endpoint: Optional[PublicEndpointParamsSearchEndpoint] = None +class RetrievalOptionsBoostBy(BaseModel): + field: str + """Metadata field name to boost by. + + Use 'timestamp' for document freshness, or any custom_metadata field. Numeric + fields support asc/desc directions; text/boolean fields support + exists/not_exists. + """ + + direction: Optional[Literal["asc", "desc", "exists", "not_exists"]] = None + """Boost direction. + + 'desc' = higher values rank higher (e.g. newer timestamps). 'asc' = lower values + rank higher. 'exists' = boost chunks that have the field. 'not_exists' = boost + chunks that lack the field. Optional ��� defaults to 'asc' for numeric fields, + 'exists' for text/boolean fields. + """ + + class RetrievalOptions(BaseModel): + boost_by: Optional[List[RetrievalOptionsBoostBy]] = None + """Metadata fields to boost search results by. + + Each entry specifies a metadata field and an optional direction. Direction + defaults to 'asc' for numeric fields and 'exists' for text/boolean fields. + Fields must match 'timestamp' or a defined custom_metadata field. + """ + keyword_match_mode: Optional[Literal["exact_match", "fuzzy_match"]] = None """Controls how keyword search terms are matched. @@ -86,7 +115,30 @@ class RetrievalOptions(BaseModel): """ +class SourceParamsWebCrawlerParseOptionsContentSelector(BaseModel): + path: str + """Glob pattern to match against the page URL path. + + Uses standard glob syntax: \\** matches within a segment, \\**\\** crosses + directories. + """ + + selector: str + """CSS selector to extract content from pages matching the path pattern. + + Supports standard CSS selectors including class, ID, element, and attribute + selectors. + """ + + class SourceParamsWebCrawlerParseOptions(BaseModel): + content_selector: Optional[List[SourceParamsWebCrawlerParseOptionsContentSelector]] = None + """ + List of path-to-selector mappings for extracting specific content from crawled + pages. Each entry pairs a URL glob pattern with a CSS selector. The first + matching path wins. Only the matched HTML fragment is stored and indexed. + """ + include_headers: Optional[Dict[str, str]] = None include_images: Optional[bool] = None @@ -147,10 +199,6 @@ class InstanceDeleteResponse(BaseModel): modified_at: datetime - source: str - - type: Literal["r2", "web-crawler"] - vectorize_name: str ai_gateway_id: Optional[str] = None @@ -276,8 +324,12 @@ class InstanceDeleteResponse(BaseModel): score_threshold: Optional[float] = None + source: Optional[str] = None + source_params: Optional[SourceParams] = None status: Optional[str] = None token_id: Optional[str] = None + + type: Optional[Literal["r2", "web-crawler"]] = None diff --git a/src/cloudflare/types/aisearch/instance_list_params.py b/src/cloudflare/types/aisearch/instance_list_params.py index 543926bdaee..6433ba8e007 100644 --- a/src/cloudflare/types/aisearch/instance_list_params.py +++ b/src/cloudflare/types/aisearch/instance_list_params.py @@ -2,7 +2,7 @@ from __future__ import annotations -from typing_extensions import Required, TypedDict +from typing_extensions import Literal, Required, TypedDict __all__ = ["InstanceListParams"] @@ -10,6 +10,12 @@ class InstanceListParams(TypedDict, total=False): account_id: Required[str] + order_by: Literal["created_at"] + """Order By Column Name""" + + order_by_direction: Literal["asc", "desc"] + """Order By Direction""" + page: int per_page: int diff --git a/src/cloudflare/types/aisearch/instance_list_response.py b/src/cloudflare/types/aisearch/instance_list_response.py index 5a72892e3aa..0030fc823f4 100644 --- a/src/cloudflare/types/aisearch/instance_list_response.py +++ b/src/cloudflare/types/aisearch/instance_list_response.py @@ -19,9 +19,11 @@ "PublicEndpointParamsRateLimit", "PublicEndpointParamsSearchEndpoint", "RetrievalOptions", + "RetrievalOptionsBoostBy", "SourceParams", "SourceParamsWebCrawler", "SourceParamsWebCrawlerParseOptions", + "SourceParamsWebCrawlerParseOptionsContentSelector", "SourceParamsWebCrawlerStoreOptions", ] @@ -77,7 +79,34 @@ class PublicEndpointParams(BaseModel): search_endpoint: Optional[PublicEndpointParamsSearchEndpoint] = None +class RetrievalOptionsBoostBy(BaseModel): + field: str + """Metadata field name to boost by. + + Use 'timestamp' for document freshness, or any custom_metadata field. Numeric + fields support asc/desc directions; text/boolean fields support + exists/not_exists. + """ + + direction: Optional[Literal["asc", "desc", "exists", "not_exists"]] = None + """Boost direction. + + 'desc' = higher values rank higher (e.g. newer timestamps). 'asc' = lower values + rank higher. 'exists' = boost chunks that have the field. 'not_exists' = boost + chunks that lack the field. Optional ��� defaults to 'asc' for numeric fields, + 'exists' for text/boolean fields. + """ + + class RetrievalOptions(BaseModel): + boost_by: Optional[List[RetrievalOptionsBoostBy]] = None + """Metadata fields to boost search results by. + + Each entry specifies a metadata field and an optional direction. Direction + defaults to 'asc' for numeric fields and 'exists' for text/boolean fields. + Fields must match 'timestamp' or a defined custom_metadata field. + """ + keyword_match_mode: Optional[Literal["exact_match", "fuzzy_match"]] = None """Controls how keyword search terms are matched. @@ -86,7 +115,30 @@ class RetrievalOptions(BaseModel): """ +class SourceParamsWebCrawlerParseOptionsContentSelector(BaseModel): + path: str + """Glob pattern to match against the page URL path. + + Uses standard glob syntax: \\** matches within a segment, \\**\\** crosses + directories. + """ + + selector: str + """CSS selector to extract content from pages matching the path pattern. + + Supports standard CSS selectors including class, ID, element, and attribute + selectors. + """ + + class SourceParamsWebCrawlerParseOptions(BaseModel): + content_selector: Optional[List[SourceParamsWebCrawlerParseOptionsContentSelector]] = None + """ + List of path-to-selector mappings for extracting specific content from crawled + pages. Each entry pairs a URL glob pattern with a CSS selector. The first + matching path wins. Only the matched HTML fragment is stored and indexed. + """ + include_headers: Optional[Dict[str, str]] = None include_images: Optional[bool] = None @@ -147,10 +199,6 @@ class InstanceListResponse(BaseModel): modified_at: datetime - source: str - - type: Literal["r2", "web-crawler"] - vectorize_name: str ai_gateway_id: Optional[str] = None @@ -276,8 +324,12 @@ class InstanceListResponse(BaseModel): score_threshold: Optional[float] = None + source: Optional[str] = None + source_params: Optional[SourceParams] = None status: Optional[str] = None token_id: Optional[str] = None + + type: Optional[Literal["r2", "web-crawler"]] = None diff --git a/src/cloudflare/types/aisearch/instance_read_response.py b/src/cloudflare/types/aisearch/instance_read_response.py index b0d3f5996d9..5168fe0a540 100644 --- a/src/cloudflare/types/aisearch/instance_read_response.py +++ b/src/cloudflare/types/aisearch/instance_read_response.py @@ -19,9 +19,11 @@ "PublicEndpointParamsRateLimit", "PublicEndpointParamsSearchEndpoint", "RetrievalOptions", + "RetrievalOptionsBoostBy", "SourceParams", "SourceParamsWebCrawler", "SourceParamsWebCrawlerParseOptions", + "SourceParamsWebCrawlerParseOptionsContentSelector", "SourceParamsWebCrawlerStoreOptions", ] @@ -77,7 +79,34 @@ class PublicEndpointParams(BaseModel): search_endpoint: Optional[PublicEndpointParamsSearchEndpoint] = None +class RetrievalOptionsBoostBy(BaseModel): + field: str + """Metadata field name to boost by. + + Use 'timestamp' for document freshness, or any custom_metadata field. Numeric + fields support asc/desc directions; text/boolean fields support + exists/not_exists. + """ + + direction: Optional[Literal["asc", "desc", "exists", "not_exists"]] = None + """Boost direction. + + 'desc' = higher values rank higher (e.g. newer timestamps). 'asc' = lower values + rank higher. 'exists' = boost chunks that have the field. 'not_exists' = boost + chunks that lack the field. Optional ��� defaults to 'asc' for numeric fields, + 'exists' for text/boolean fields. + """ + + class RetrievalOptions(BaseModel): + boost_by: Optional[List[RetrievalOptionsBoostBy]] = None + """Metadata fields to boost search results by. + + Each entry specifies a metadata field and an optional direction. Direction + defaults to 'asc' for numeric fields and 'exists' for text/boolean fields. + Fields must match 'timestamp' or a defined custom_metadata field. + """ + keyword_match_mode: Optional[Literal["exact_match", "fuzzy_match"]] = None """Controls how keyword search terms are matched. @@ -86,7 +115,30 @@ class RetrievalOptions(BaseModel): """ +class SourceParamsWebCrawlerParseOptionsContentSelector(BaseModel): + path: str + """Glob pattern to match against the page URL path. + + Uses standard glob syntax: \\** matches within a segment, \\**\\** crosses + directories. + """ + + selector: str + """CSS selector to extract content from pages matching the path pattern. + + Supports standard CSS selectors including class, ID, element, and attribute + selectors. + """ + + class SourceParamsWebCrawlerParseOptions(BaseModel): + content_selector: Optional[List[SourceParamsWebCrawlerParseOptionsContentSelector]] = None + """ + List of path-to-selector mappings for extracting specific content from crawled + pages. Each entry pairs a URL glob pattern with a CSS selector. The first + matching path wins. Only the matched HTML fragment is stored and indexed. + """ + include_headers: Optional[Dict[str, str]] = None include_images: Optional[bool] = None @@ -147,10 +199,6 @@ class InstanceReadResponse(BaseModel): modified_at: datetime - source: str - - type: Literal["r2", "web-crawler"] - vectorize_name: str ai_gateway_id: Optional[str] = None @@ -276,8 +324,12 @@ class InstanceReadResponse(BaseModel): score_threshold: Optional[float] = None + source: Optional[str] = None + source_params: Optional[SourceParams] = None status: Optional[str] = None token_id: Optional[str] = None + + type: Optional[Literal["r2", "web-crawler"]] = None diff --git a/src/cloudflare/types/aisearch/instance_search_params.py b/src/cloudflare/types/aisearch/instance_search_params.py index fba9dbe2f6a..a8c23c9992c 100644 --- a/src/cloudflare/types/aisearch/instance_search_params.py +++ b/src/cloudflare/types/aisearch/instance_search_params.py @@ -14,6 +14,7 @@ "AISearchOptionsQueryRewrite", "AISearchOptionsReranking", "AISearchOptionsRetrieval", + "AISearchOptionsRetrievalBoostBy", ] @@ -79,7 +80,34 @@ class AISearchOptionsReranking(TypedDict, total=False): model: Literal["@cf/baai/bge-reranker-base", ""] +class AISearchOptionsRetrievalBoostBy(TypedDict, total=False): + field: Required[str] + """Metadata field name to boost by. + + Use 'timestamp' for document freshness, or any custom_metadata field. Numeric + fields support asc/desc directions; text/boolean fields support + exists/not_exists. + """ + + direction: Literal["asc", "desc", "exists", "not_exists"] + """Boost direction. + + 'desc' = higher values rank higher (e.g. newer timestamps). 'asc' = lower values + rank higher. 'exists' = boost chunks that have the field. 'not_exists' = boost + chunks that lack the field. Optional ��� defaults to 'asc' for numeric fields, + 'exists' for text/boolean fields. + """ + + class AISearchOptionsRetrieval(TypedDict, total=False): + boost_by: Iterable[AISearchOptionsRetrievalBoostBy] + """Metadata fields to boost search results by. + + Overrides the instance-level boost_by config. Direction defaults to 'asc' for + numeric fields, 'exists' for text/boolean fields. Fields must match 'timestamp' + or a defined custom_metadata field. + """ + context_expansion: int filters: Dict[str, object] diff --git a/src/cloudflare/types/aisearch/instance_update_params.py b/src/cloudflare/types/aisearch/instance_update_params.py index e1d481fb7ac..db2a4100f54 100644 --- a/src/cloudflare/types/aisearch/instance_update_params.py +++ b/src/cloudflare/types/aisearch/instance_update_params.py @@ -19,9 +19,11 @@ "PublicEndpointParamsRateLimit", "PublicEndpointParamsSearchEndpoint", "RetrievalOptions", + "RetrievalOptionsBoostBy", "SourceParams", "SourceParamsWebCrawler", "SourceParamsWebCrawlerParseOptions", + "SourceParamsWebCrawlerParseOptionsContentSelector", "SourceParamsWebCrawlerStoreOptions", ] @@ -236,7 +238,34 @@ class PublicEndpointParams(TypedDict, total=False): search_endpoint: PublicEndpointParamsSearchEndpoint +class RetrievalOptionsBoostBy(TypedDict, total=False): + field: Required[str] + """Metadata field name to boost by. + + Use 'timestamp' for document freshness, or any custom_metadata field. Numeric + fields support asc/desc directions; text/boolean fields support + exists/not_exists. + """ + + direction: Literal["asc", "desc", "exists", "not_exists"] + """Boost direction. + + 'desc' = higher values rank higher (e.g. newer timestamps). 'asc' = lower values + rank higher. 'exists' = boost chunks that have the field. 'not_exists' = boost + chunks that lack the field. Optional ��� defaults to 'asc' for numeric fields, + 'exists' for text/boolean fields. + """ + + class RetrievalOptions(TypedDict, total=False): + boost_by: Iterable[RetrievalOptionsBoostBy] + """Metadata fields to boost search results by. + + Each entry specifies a metadata field and an optional direction. Direction + defaults to 'asc' for numeric fields and 'exists' for text/boolean fields. + Fields must match 'timestamp' or a defined custom_metadata field. + """ + keyword_match_mode: Literal["exact_match", "fuzzy_match"] """Controls how keyword search terms are matched. @@ -245,7 +274,30 @@ class RetrievalOptions(TypedDict, total=False): """ +class SourceParamsWebCrawlerParseOptionsContentSelector(TypedDict, total=False): + path: Required[str] + """Glob pattern to match against the page URL path. + + Uses standard glob syntax: \\** matches within a segment, \\**\\** crosses + directories. + """ + + selector: Required[str] + """CSS selector to extract content from pages matching the path pattern. + + Supports standard CSS selectors including class, ID, element, and attribute + selectors. + """ + + class SourceParamsWebCrawlerParseOptions(TypedDict, total=False): + content_selector: Iterable[SourceParamsWebCrawlerParseOptionsContentSelector] + """ + List of path-to-selector mappings for extracting specific content from crawled + pages. Each entry pairs a URL glob pattern with a CSS selector. The first + matching path wins. Only the matched HTML fragment is stored and indexed. + """ + include_headers: Dict[str, str] include_images: bool diff --git a/src/cloudflare/types/aisearch/instance_update_response.py b/src/cloudflare/types/aisearch/instance_update_response.py index 712c2a7bc1e..4ac93b2b86a 100644 --- a/src/cloudflare/types/aisearch/instance_update_response.py +++ b/src/cloudflare/types/aisearch/instance_update_response.py @@ -19,9 +19,11 @@ "PublicEndpointParamsRateLimit", "PublicEndpointParamsSearchEndpoint", "RetrievalOptions", + "RetrievalOptionsBoostBy", "SourceParams", "SourceParamsWebCrawler", "SourceParamsWebCrawlerParseOptions", + "SourceParamsWebCrawlerParseOptionsContentSelector", "SourceParamsWebCrawlerStoreOptions", ] @@ -77,7 +79,34 @@ class PublicEndpointParams(BaseModel): search_endpoint: Optional[PublicEndpointParamsSearchEndpoint] = None +class RetrievalOptionsBoostBy(BaseModel): + field: str + """Metadata field name to boost by. + + Use 'timestamp' for document freshness, or any custom_metadata field. Numeric + fields support asc/desc directions; text/boolean fields support + exists/not_exists. + """ + + direction: Optional[Literal["asc", "desc", "exists", "not_exists"]] = None + """Boost direction. + + 'desc' = higher values rank higher (e.g. newer timestamps). 'asc' = lower values + rank higher. 'exists' = boost chunks that have the field. 'not_exists' = boost + chunks that lack the field. Optional ��� defaults to 'asc' for numeric fields, + 'exists' for text/boolean fields. + """ + + class RetrievalOptions(BaseModel): + boost_by: Optional[List[RetrievalOptionsBoostBy]] = None + """Metadata fields to boost search results by. + + Each entry specifies a metadata field and an optional direction. Direction + defaults to 'asc' for numeric fields and 'exists' for text/boolean fields. + Fields must match 'timestamp' or a defined custom_metadata field. + """ + keyword_match_mode: Optional[Literal["exact_match", "fuzzy_match"]] = None """Controls how keyword search terms are matched. @@ -86,7 +115,30 @@ class RetrievalOptions(BaseModel): """ +class SourceParamsWebCrawlerParseOptionsContentSelector(BaseModel): + path: str + """Glob pattern to match against the page URL path. + + Uses standard glob syntax: \\** matches within a segment, \\**\\** crosses + directories. + """ + + selector: str + """CSS selector to extract content from pages matching the path pattern. + + Supports standard CSS selectors including class, ID, element, and attribute + selectors. + """ + + class SourceParamsWebCrawlerParseOptions(BaseModel): + content_selector: Optional[List[SourceParamsWebCrawlerParseOptionsContentSelector]] = None + """ + List of path-to-selector mappings for extracting specific content from crawled + pages. Each entry pairs a URL glob pattern with a CSS selector. The first + matching path wins. Only the matched HTML fragment is stored and indexed. + """ + include_headers: Optional[Dict[str, str]] = None include_images: Optional[bool] = None @@ -147,10 +199,6 @@ class InstanceUpdateResponse(BaseModel): modified_at: datetime - source: str - - type: Literal["r2", "web-crawler"] - vectorize_name: str ai_gateway_id: Optional[str] = None @@ -276,8 +324,12 @@ class InstanceUpdateResponse(BaseModel): score_threshold: Optional[float] = None + source: Optional[str] = None + source_params: Optional[SourceParams] = None status: Optional[str] = None token_id: Optional[str] = None + + type: Optional[Literal["r2", "web-crawler"]] = None diff --git a/src/cloudflare/types/aisearch/instances/__init__.py b/src/cloudflare/types/aisearch/instances/__init__.py index a9a19580c09..68c80804a2a 100644 --- a/src/cloudflare/types/aisearch/instances/__init__.py +++ b/src/cloudflare/types/aisearch/instances/__init__.py @@ -6,7 +6,7 @@ from .job_logs_params import JobLogsParams as JobLogsParams from .item_list_params import ItemListParams as ItemListParams from .job_get_response import JobGetResponse as JobGetResponse -from .item_get_response import ItemGetResponse as ItemGetResponse +from .job_create_params import JobCreateParams as JobCreateParams from .job_list_response import JobListResponse as JobListResponse from .job_logs_response import JobLogsResponse as JobLogsResponse from .item_list_response import ItemListResponse as ItemListResponse diff --git a/src/cloudflare/types/aisearch/instances/item_get_response.py b/src/cloudflare/types/aisearch/instances/item_get_response.py deleted file mode 100644 index 50eaf709682..00000000000 --- a/src/cloudflare/types/aisearch/instances/item_get_response.py +++ /dev/null @@ -1,35 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Optional -from datetime import datetime -from typing_extensions import Literal - -from ...._models import BaseModel - -__all__ = ["ItemGetResponse"] - - -class ItemGetResponse(BaseModel): - id: float - - checksum: str - - chunks_count: Optional[int] = None - - created_at: datetime - - file_size: Optional[float] = None - - key: str - - last_seen_at: datetime - - namespace: str - - next_action: Optional[Literal["INDEX", "DELETE"]] = None - - status: Literal["queued", "running", "completed", "error", "skipped"] - - error: Optional[str] = None - - public_id: Optional[str] = None diff --git a/src/cloudflare/types/aisearch/instances/job_create_params.py b/src/cloudflare/types/aisearch/instances/job_create_params.py new file mode 100644 index 00000000000..243c20584fb --- /dev/null +++ b/src/cloudflare/types/aisearch/instances/job_create_params.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +__all__ = ["JobCreateParams"] + + +class JobCreateParams(TypedDict, total=False): + account_id: Required[str] + + description: str diff --git a/src/cloudflare/types/aisearch/instances/job_create_response.py b/src/cloudflare/types/aisearch/instances/job_create_response.py index 25ad1d27903..e50db7271da 100644 --- a/src/cloudflare/types/aisearch/instances/job_create_response.py +++ b/src/cloudflare/types/aisearch/instances/job_create_response.py @@ -13,6 +13,8 @@ class JobCreateResponse(BaseModel): source: Literal["user", "schedule"] + description: Optional[str] = None + end_reason: Optional[str] = None ended_at: Optional[str] = None diff --git a/src/cloudflare/types/aisearch/instances/job_get_response.py b/src/cloudflare/types/aisearch/instances/job_get_response.py index 6fbbda8a3ab..cbd4075812b 100644 --- a/src/cloudflare/types/aisearch/instances/job_get_response.py +++ b/src/cloudflare/types/aisearch/instances/job_get_response.py @@ -13,6 +13,8 @@ class JobGetResponse(BaseModel): source: Literal["user", "schedule"] + description: Optional[str] = None + end_reason: Optional[str] = None ended_at: Optional[str] = None diff --git a/src/cloudflare/types/aisearch/instances/job_list_response.py b/src/cloudflare/types/aisearch/instances/job_list_response.py index 1b550a45c10..f2cb59f4e17 100644 --- a/src/cloudflare/types/aisearch/instances/job_list_response.py +++ b/src/cloudflare/types/aisearch/instances/job_list_response.py @@ -13,6 +13,8 @@ class JobListResponse(BaseModel): source: Literal["user", "schedule"] + description: Optional[str] = None + end_reason: Optional[str] = None ended_at: Optional[str] = None diff --git a/src/cloudflare/types/aisearch/token_list_params.py b/src/cloudflare/types/aisearch/token_list_params.py index 2133c57baba..01a1a0f2add 100644 --- a/src/cloudflare/types/aisearch/token_list_params.py +++ b/src/cloudflare/types/aisearch/token_list_params.py @@ -2,7 +2,7 @@ from __future__ import annotations -from typing_extensions import Required, TypedDict +from typing_extensions import Literal, Required, TypedDict __all__ = ["TokenListParams"] @@ -10,6 +10,12 @@ class TokenListParams(TypedDict, total=False): account_id: Required[str] + order_by: Literal["created_at"] + """Order By Column Name""" + + order_by_direction: Literal["asc", "desc"] + """Order By Direction""" + page: int per_page: int diff --git a/src/cloudflare/types/cloudforce_one/threat_events/dataset_raw_response.py b/src/cloudflare/types/cloudforce_one/threat_events/dataset_raw_response.py index 6baf8e4b567..aaec6178749 100644 --- a/src/cloudflare/types/cloudforce_one/threat_events/dataset_raw_response.py +++ b/src/cloudflare/types/cloudforce_one/threat_events/dataset_raw_response.py @@ -8,13 +8,13 @@ class DatasetRawResponse(BaseModel): - id: str + id: float account_id: float = FieldInfo(alias="accountId") created: str - data: object + data: str source: str diff --git a/src/cloudflare/types/d1/d1.py b/src/cloudflare/types/d1/d1.py index 41fe1cb45a3..d1e8af72b22 100644 --- a/src/cloudflare/types/d1/d1.py +++ b/src/cloudflare/types/d1/d1.py @@ -30,6 +30,12 @@ class D1(BaseModel): file_size: Optional[float] = None """The D1 database's size, in bytes.""" + jurisdiction: Optional[Literal["eu", "fedramp"]] = None + """Specify the location to restrict the D1 database to run and store data. + + If this option is present, the location hint is ignored. + """ + name: Optional[str] = None """D1 database name.""" diff --git a/src/cloudflare/types/d1/database_list_response.py b/src/cloudflare/types/d1/database_list_response.py index bdcb159357d..1332df02199 100644 --- a/src/cloudflare/types/d1/database_list_response.py +++ b/src/cloudflare/types/d1/database_list_response.py @@ -2,6 +2,7 @@ from typing import Optional from datetime import datetime +from typing_extensions import Literal from ..._models import BaseModel @@ -12,6 +13,12 @@ class DatabaseListResponse(BaseModel): created_at: Optional[datetime] = None """Specifies the timestamp the resource was created as an ISO8601 string.""" + jurisdiction: Optional[Literal["eu", "fedramp"]] = None + """Specify the location to restrict the D1 database to run and store data. + + If this option is present, the location hint is ignored. + """ + name: Optional[str] = None """D1 database name.""" diff --git a/src/cloudflare/types/email_security/investigate_get_response.py b/src/cloudflare/types/email_security/investigate_get_response.py index c3bb7927ab0..7cdee54bd4d 100644 --- a/src/cloudflare/types/email_security/investigate_get_response.py +++ b/src/cloudflare/types/email_security/investigate_get_response.py @@ -156,6 +156,8 @@ class InvestigateGetResponse(BaseModel): message_id: Optional[str] = None + post_delivery_operations: Optional[List[Literal["PREVIEW", "QUARANTINE_RELEASE", "SUBMISSION", "MOVE"]]] = None + postfix_id_outbound: Optional[str] = None replyto: 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 9c5fa4e2ab5..e3fcf105d4d 100644 --- a/src/cloudflare/types/email_security/investigate_list_params.py +++ b/src/cloudflare/types/email_security/investigate_list_params.py @@ -26,11 +26,17 @@ class InvestigateListParams(TypedDict, total=False): """Determines if the search results will include detections or not.""" domain: str - """The sender domains the search filters by.""" + """ + Filter by a domain found in the email: sender domain, recipient domain, or a + domain in a link. + """ 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.""" + final_disposition: Literal["MALICIOUS", "SUSPICIOUS", "SPOOF", "SPAM", "BULK", "NONE"] """The dispositions the search filters by.""" @@ -75,8 +81,10 @@ class InvestigateListParams(TypedDict, total=False): """ 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")] """ @@ -85,3 +93,7 @@ class InvestigateListParams(TypedDict, total=False): """ subject: str + """ + Search for messages containing individual keywords in any order within the + subject. + """ diff --git a/src/cloudflare/types/email_security/investigate_list_response.py b/src/cloudflare/types/email_security/investigate_list_response.py index dbf5f9c25e6..b0fdb523b72 100644 --- a/src/cloudflare/types/email_security/investigate_list_response.py +++ b/src/cloudflare/types/email_security/investigate_list_response.py @@ -156,6 +156,8 @@ class InvestigateListResponse(BaseModel): message_id: Optional[str] = None + post_delivery_operations: Optional[List[Literal["PREVIEW", "QUARANTINE_RELEASE", "SUBMISSION", "MOVE"]]] = None + postfix_id_outbound: Optional[str] = None replyto: 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 de2f513a2fc..225fb097290 100644 --- a/src/cloudflare/types/email_security/submission_list_params.py +++ b/src/cloudflare/types/email_security/submission_list_params.py @@ -15,6 +15,8 @@ class SubmissionListParams(TypedDict, total=False): account_id: Required[str] """Account Identifier""" + customer_status: Literal["escalated", "reviewed", "unreviewed"] + end: Annotated[Union[str, datetime], PropertyInfo(format="iso8601")] """The end of the search date range. Defaults to `now` if not provided.""" diff --git a/src/cloudflare/types/email_security/submission_list_response.py b/src/cloudflare/types/email_security/submission_list_response.py index 841284d9801..9395ccdabd5 100644 --- a/src/cloudflare/types/email_security/submission_list_response.py +++ b/src/cloudflare/types/email_security/submission_list_response.py @@ -14,6 +14,8 @@ class SubmissionListResponse(BaseModel): submission_id: str + customer_status: Optional[Literal["escalated", "reviewed", "unreviewed"]] = None + original_disposition: Optional[ Literal[ "MALICIOUS", diff --git a/src/cloudflare/types/magic_transit/app_create_params.py b/src/cloudflare/types/magic_transit/app_create_params.py index 06e6ea07417..33512d9db4e 100644 --- a/src/cloudflare/types/magic_transit/app_create_params.py +++ b/src/cloudflare/types/magic_transit/app_create_params.py @@ -27,3 +27,9 @@ class AppCreateParams(TypedDict, total=False): (IPv6 CIDRs are currently unsupported) """ + + source_subnets: SequenceNotStr[str] + """IPv4 CIDRs to associate with traffic decisions. + + (IPv6 CIDRs are currently unsupported) + """ diff --git a/src/cloudflare/types/magic_transit/app_create_response.py b/src/cloudflare/types/magic_transit/app_create_response.py index 9dc78cc85e0..393051343b3 100644 --- a/src/cloudflare/types/magic_transit/app_create_response.py +++ b/src/cloudflare/types/magic_transit/app_create_response.py @@ -25,5 +25,11 @@ class AppCreateResponse(BaseModel): name: Optional[str] = None """Display name for the app.""" + source_subnets: Optional[List[str]] = None + """IPv4 CIDRs to associate with traffic decisions. + + (IPv6 CIDRs are currently unsupported) + """ + type: Optional[str] = None """Category of the app.""" diff --git a/src/cloudflare/types/magic_transit/app_delete_response.py b/src/cloudflare/types/magic_transit/app_delete_response.py index 034a9d740ed..5ef23a76449 100644 --- a/src/cloudflare/types/magic_transit/app_delete_response.py +++ b/src/cloudflare/types/magic_transit/app_delete_response.py @@ -25,5 +25,11 @@ class AppDeleteResponse(BaseModel): name: Optional[str] = None """Display name for the app.""" + source_subnets: Optional[List[str]] = None + """IPv4 CIDRs to associate with traffic decisions. + + (IPv6 CIDRs are currently unsupported) + """ + type: Optional[str] = None """Category of the app.""" diff --git a/src/cloudflare/types/magic_transit/app_edit_params.py b/src/cloudflare/types/magic_transit/app_edit_params.py index 8d0052ab142..c9702e77697 100644 --- a/src/cloudflare/types/magic_transit/app_edit_params.py +++ b/src/cloudflare/types/magic_transit/app_edit_params.py @@ -25,5 +25,11 @@ class AppEditParams(TypedDict, total=False): name: str """Display name for the app.""" + source_subnets: SequenceNotStr[str] + """IPv4 CIDRs to associate with traffic decisions. + + (IPv6 CIDRs are currently unsupported) + """ + type: str """Category of the app.""" diff --git a/src/cloudflare/types/magic_transit/app_edit_response.py b/src/cloudflare/types/magic_transit/app_edit_response.py index da5bda564f6..02e2c1c2563 100644 --- a/src/cloudflare/types/magic_transit/app_edit_response.py +++ b/src/cloudflare/types/magic_transit/app_edit_response.py @@ -25,5 +25,11 @@ class AppEditResponse(BaseModel): name: Optional[str] = None """Display name for the app.""" + source_subnets: Optional[List[str]] = None + """IPv4 CIDRs to associate with traffic decisions. + + (IPv6 CIDRs are currently unsupported) + """ + type: Optional[str] = None """Category of the app.""" diff --git a/src/cloudflare/types/magic_transit/app_list_response.py b/src/cloudflare/types/magic_transit/app_list_response.py index 4698cdc6883..888bec795c6 100644 --- a/src/cloudflare/types/magic_transit/app_list_response.py +++ b/src/cloudflare/types/magic_transit/app_list_response.py @@ -26,6 +26,12 @@ class MagicAccountApp(BaseModel): name: Optional[str] = None """Display name for the app.""" + source_subnets: Optional[List[str]] = None + """IPv4 CIDRs to associate with traffic decisions. + + (IPv6 CIDRs are currently unsupported) + """ + type: Optional[str] = None """Category of the app.""" @@ -48,6 +54,12 @@ class MagicManagedApp(BaseModel): name: Optional[str] = None """Display name for the app.""" + source_subnets: Optional[List[str]] = None + """IPv4 CIDRs to associate with traffic decisions. + + (IPv6 CIDRs are currently unsupported) + """ + type: Optional[str] = None """Category of the app.""" diff --git a/src/cloudflare/types/magic_transit/app_update_params.py b/src/cloudflare/types/magic_transit/app_update_params.py index 4ae6f412734..4af8c5f1a63 100644 --- a/src/cloudflare/types/magic_transit/app_update_params.py +++ b/src/cloudflare/types/magic_transit/app_update_params.py @@ -25,5 +25,11 @@ class AppUpdateParams(TypedDict, total=False): name: str """Display name for the app.""" + source_subnets: SequenceNotStr[str] + """IPv4 CIDRs to associate with traffic decisions. + + (IPv6 CIDRs are currently unsupported) + """ + type: str """Category of the app.""" diff --git a/src/cloudflare/types/magic_transit/app_update_response.py b/src/cloudflare/types/magic_transit/app_update_response.py index b32d7944666..7ec55a596d2 100644 --- a/src/cloudflare/types/magic_transit/app_update_response.py +++ b/src/cloudflare/types/magic_transit/app_update_response.py @@ -25,5 +25,11 @@ class AppUpdateResponse(BaseModel): name: Optional[str] = None """Display name for the app.""" + source_subnets: Optional[List[str]] = None + """IPv4 CIDRs to associate with traffic decisions. + + (IPv6 CIDRs are currently unsupported) + """ + type: Optional[str] = None """Category of the app.""" diff --git a/src/cloudflare/types/magic_transit/connector_create_params.py b/src/cloudflare/types/magic_transit/connector_create_params.py index f39191505a0..8ada6bdf956 100644 --- a/src/cloudflare/types/magic_transit/connector_create_params.py +++ b/src/cloudflare/types/magic_transit/connector_create_params.py @@ -2,7 +2,10 @@ from __future__ import annotations -from typing_extensions import Required, TypedDict +from typing import List +from typing_extensions import Literal, Required, TypedDict + +from ..._types import SequenceNotStr __all__ = ["ConnectorCreateParams", "Device"] @@ -16,8 +19,16 @@ class ConnectorCreateParams(TypedDict, total=False): activated: bool + interrupt_window_days_of_week: List[ + Literal["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"] + ] + """Allowed days of the week for upgrades. Default is all days.""" + interrupt_window_duration_hours: float + interrupt_window_embargo_dates: SequenceNotStr[str] + """List of dates (YYYY-MM-DD) when upgrades are blocked.""" + interrupt_window_hour_of_day: float notes: str diff --git a/src/cloudflare/types/magic_transit/connector_create_response.py b/src/cloudflare/types/magic_transit/connector_create_response.py index 9c0e39f9f1a..74053c83628 100644 --- a/src/cloudflare/types/magic_transit/connector_create_response.py +++ b/src/cloudflare/types/magic_transit/connector_create_response.py @@ -1,6 +1,7 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import Optional +from typing import List, Optional +from typing_extensions import Literal from ..._models import BaseModel @@ -18,8 +19,16 @@ class ConnectorCreateResponse(BaseModel): activated: bool + interrupt_window_days_of_week: List[ + Literal["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"] + ] + """Allowed days of the week for upgrades. Default is all days.""" + interrupt_window_duration_hours: float + interrupt_window_embargo_dates: List[str] + """List of dates (YYYY-MM-DD) when upgrades are blocked.""" + interrupt_window_hour_of_day: float last_updated: str diff --git a/src/cloudflare/types/magic_transit/connector_delete_response.py b/src/cloudflare/types/magic_transit/connector_delete_response.py index 3337342f6aa..7dc21b7c70c 100644 --- a/src/cloudflare/types/magic_transit/connector_delete_response.py +++ b/src/cloudflare/types/magic_transit/connector_delete_response.py @@ -1,6 +1,7 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import Optional +from typing import List, Optional +from typing_extensions import Literal from ..._models import BaseModel @@ -18,8 +19,16 @@ class ConnectorDeleteResponse(BaseModel): activated: bool + interrupt_window_days_of_week: List[ + Literal["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"] + ] + """Allowed days of the week for upgrades. Default is all days.""" + interrupt_window_duration_hours: float + interrupt_window_embargo_dates: List[str] + """List of dates (YYYY-MM-DD) when upgrades are blocked.""" + interrupt_window_hour_of_day: float last_updated: str diff --git a/src/cloudflare/types/magic_transit/connector_edit_params.py b/src/cloudflare/types/magic_transit/connector_edit_params.py index 0f2e12db6c8..56b44c01e3d 100644 --- a/src/cloudflare/types/magic_transit/connector_edit_params.py +++ b/src/cloudflare/types/magic_transit/connector_edit_params.py @@ -2,7 +2,10 @@ from __future__ import annotations -from typing_extensions import Required, TypedDict +from typing import List +from typing_extensions import Literal, Required, TypedDict + +from ..._types import SequenceNotStr __all__ = ["ConnectorEditParams"] @@ -13,8 +16,16 @@ class ConnectorEditParams(TypedDict, total=False): activated: bool + interrupt_window_days_of_week: List[ + Literal["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"] + ] + """Allowed days of the week for upgrades. Default is all days.""" + interrupt_window_duration_hours: float + interrupt_window_embargo_dates: SequenceNotStr[str] + """List of dates (YYYY-MM-DD) when upgrades are blocked.""" + interrupt_window_hour_of_day: float notes: str diff --git a/src/cloudflare/types/magic_transit/connector_edit_response.py b/src/cloudflare/types/magic_transit/connector_edit_response.py index d7e96504124..e65a54a4c14 100644 --- a/src/cloudflare/types/magic_transit/connector_edit_response.py +++ b/src/cloudflare/types/magic_transit/connector_edit_response.py @@ -1,6 +1,7 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import Optional +from typing import List, Optional +from typing_extensions import Literal from ..._models import BaseModel @@ -18,8 +19,16 @@ class ConnectorEditResponse(BaseModel): activated: bool + interrupt_window_days_of_week: List[ + Literal["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"] + ] + """Allowed days of the week for upgrades. Default is all days.""" + interrupt_window_duration_hours: float + interrupt_window_embargo_dates: List[str] + """List of dates (YYYY-MM-DD) when upgrades are blocked.""" + interrupt_window_hour_of_day: float last_updated: str diff --git a/src/cloudflare/types/magic_transit/connector_get_response.py b/src/cloudflare/types/magic_transit/connector_get_response.py index bb1b53e6d78..00426f9c13b 100644 --- a/src/cloudflare/types/magic_transit/connector_get_response.py +++ b/src/cloudflare/types/magic_transit/connector_get_response.py @@ -1,6 +1,7 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import Optional +from typing import List, Optional +from typing_extensions import Literal from ..._models import BaseModel @@ -18,8 +19,16 @@ class ConnectorGetResponse(BaseModel): activated: bool + interrupt_window_days_of_week: List[ + Literal["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"] + ] + """Allowed days of the week for upgrades. Default is all days.""" + interrupt_window_duration_hours: float + interrupt_window_embargo_dates: List[str] + """List of dates (YYYY-MM-DD) when upgrades are blocked.""" + interrupt_window_hour_of_day: float last_updated: str diff --git a/src/cloudflare/types/magic_transit/connector_list_response.py b/src/cloudflare/types/magic_transit/connector_list_response.py index 2de6b683db6..bb73ab1bbf3 100644 --- a/src/cloudflare/types/magic_transit/connector_list_response.py +++ b/src/cloudflare/types/magic_transit/connector_list_response.py @@ -1,6 +1,7 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import Optional +from typing import List, Optional +from typing_extensions import Literal from ..._models import BaseModel @@ -18,8 +19,16 @@ class ConnectorListResponse(BaseModel): activated: bool + interrupt_window_days_of_week: List[ + Literal["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"] + ] + """Allowed days of the week for upgrades. Default is all days.""" + interrupt_window_duration_hours: float + interrupt_window_embargo_dates: List[str] + """List of dates (YYYY-MM-DD) when upgrades are blocked.""" + interrupt_window_hour_of_day: float last_updated: str diff --git a/src/cloudflare/types/magic_transit/connector_update_params.py b/src/cloudflare/types/magic_transit/connector_update_params.py index 44529b716a5..9b046f584cc 100644 --- a/src/cloudflare/types/magic_transit/connector_update_params.py +++ b/src/cloudflare/types/magic_transit/connector_update_params.py @@ -2,7 +2,10 @@ from __future__ import annotations -from typing_extensions import Required, TypedDict +from typing import List +from typing_extensions import Literal, Required, TypedDict + +from ..._types import SequenceNotStr __all__ = ["ConnectorUpdateParams"] @@ -13,8 +16,16 @@ class ConnectorUpdateParams(TypedDict, total=False): activated: bool + interrupt_window_days_of_week: List[ + Literal["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"] + ] + """Allowed days of the week for upgrades. Default is all days.""" + interrupt_window_duration_hours: float + interrupt_window_embargo_dates: SequenceNotStr[str] + """List of dates (YYYY-MM-DD) when upgrades are blocked.""" + interrupt_window_hour_of_day: float notes: str diff --git a/src/cloudflare/types/magic_transit/connector_update_response.py b/src/cloudflare/types/magic_transit/connector_update_response.py index 6e6430b7df3..35d0ee9f20d 100644 --- a/src/cloudflare/types/magic_transit/connector_update_response.py +++ b/src/cloudflare/types/magic_transit/connector_update_response.py @@ -1,6 +1,7 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import Optional +from typing import List, Optional +from typing_extensions import Literal from ..._models import BaseModel @@ -18,8 +19,16 @@ class ConnectorUpdateResponse(BaseModel): activated: bool + interrupt_window_days_of_week: List[ + Literal["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"] + ] + """Allowed days of the week for upgrades. Default is all days.""" + interrupt_window_duration_hours: float + interrupt_window_embargo_dates: List[str] + """List of dates (YYYY-MM-DD) when upgrades are blocked.""" + interrupt_window_hour_of_day: float last_updated: str diff --git a/src/cloudflare/types/magic_transit/sites/lan.py b/src/cloudflare/types/magic_transit/sites/lan.py index fa029373d9f..f9e0e821a2c 100644 --- a/src/cloudflare/types/magic_transit/sites/lan.py +++ b/src/cloudflare/types/magic_transit/sites/lan.py @@ -22,6 +22,12 @@ class LAN(BaseModel): only works for site with HA turned on. only one LAN can be set as the ha_link. """ + is_breakout: Optional[bool] = None + """mark true to use this LAN for source-based breakout traffic""" + + is_prioritized: Optional[bool] = None + """mark true to use this LAN for source-based prioritized traffic""" + name: Optional[str] = None nat: Optional[Nat] = None diff --git a/src/cloudflare/types/magic_transit/sites/lan_create_params.py b/src/cloudflare/types/magic_transit/sites/lan_create_params.py index e0cefcdc9e4..ba7ea87f1a4 100644 --- a/src/cloudflare/types/magic_transit/sites/lan_create_params.py +++ b/src/cloudflare/types/magic_transit/sites/lan_create_params.py @@ -24,6 +24,12 @@ class LANCreateParams(TypedDict, total=False): only works for site with HA turned on. only one LAN can be set as the ha_link. """ + is_breakout: bool + """mark true to use this LAN for source-based breakout traffic""" + + is_prioritized: bool + """mark true to use this LAN for source-based prioritized traffic""" + name: str nat: NatParam diff --git a/src/cloudflare/types/magic_transit/sites/lan_edit_params.py b/src/cloudflare/types/magic_transit/sites/lan_edit_params.py index 8ae626d9846..36fd58040bf 100644 --- a/src/cloudflare/types/magic_transit/sites/lan_edit_params.py +++ b/src/cloudflare/types/magic_transit/sites/lan_edit_params.py @@ -21,6 +21,12 @@ class LANEditParams(TypedDict, total=False): bond_id: int + is_breakout: bool + """mark true to use this LAN for source-based breakout traffic""" + + is_prioritized: bool + """mark true to use this LAN for source-based prioritized traffic""" + name: str nat: NatParam diff --git a/src/cloudflare/types/magic_transit/sites/lan_update_params.py b/src/cloudflare/types/magic_transit/sites/lan_update_params.py index 58c4bd03f1e..db47e847eee 100644 --- a/src/cloudflare/types/magic_transit/sites/lan_update_params.py +++ b/src/cloudflare/types/magic_transit/sites/lan_update_params.py @@ -21,6 +21,12 @@ class LANUpdateParams(TypedDict, total=False): bond_id: int + is_breakout: bool + """mark true to use this LAN for source-based breakout traffic""" + + is_prioritized: bool + """mark true to use this LAN for source-based prioritized traffic""" + name: str nat: NatParam diff --git a/src/cloudflare/types/pipelines/sink_get_response.py b/src/cloudflare/types/pipelines/sink_get_response.py index ba6144023c6..f5078211ff3 100644 --- a/src/cloudflare/types/pipelines/sink_get_response.py +++ b/src/cloudflare/types/pipelines/sink_get_response.py @@ -12,13 +12,12 @@ __all__ = [ "SinkGetResponse", "Config", - "ConfigCloudflarePipelinesR2Table", - "ConfigCloudflarePipelinesR2TableCredentials", - "ConfigCloudflarePipelinesR2TableFileNaming", - "ConfigCloudflarePipelinesR2TablePartitioning", - "ConfigCloudflarePipelinesR2TableRollingPolicy", - "ConfigCloudflarePipelinesR2DataCatalogTable", - "ConfigCloudflarePipelinesR2DataCatalogTableRollingPolicy", + "ConfigCloudflarePipelinesR2TablePublic", + "ConfigCloudflarePipelinesR2TablePublicFileNaming", + "ConfigCloudflarePipelinesR2TablePublicPartitioning", + "ConfigCloudflarePipelinesR2TablePublicRollingPolicy", + "ConfigCloudflarePipelinesR2DataCatalogTablePublic", + "ConfigCloudflarePipelinesR2DataCatalogTablePublicRollingPolicy", "Format", "FormatJson", "FormatParquet", @@ -41,15 +40,7 @@ ] -class ConfigCloudflarePipelinesR2TableCredentials(BaseModel): - access_key_id: str - """Cloudflare Account ID for the bucket""" - - secret_access_key: str - """Cloudflare Account ID for the bucket""" - - -class ConfigCloudflarePipelinesR2TableFileNaming(BaseModel): +class ConfigCloudflarePipelinesR2TablePublicFileNaming(BaseModel): """Controls filename prefix/suffix and strategy.""" prefix: Optional[str] = None @@ -62,14 +53,14 @@ class ConfigCloudflarePipelinesR2TableFileNaming(BaseModel): """This will overwrite the default file suffix. i.e .parquet, use with caution""" -class ConfigCloudflarePipelinesR2TablePartitioning(BaseModel): +class ConfigCloudflarePipelinesR2TablePublicPartitioning(BaseModel): """Data-layout partitioning for sinks.""" time_pattern: Optional[str] = None """The pattern of the date string""" -class ConfigCloudflarePipelinesR2TableRollingPolicy(BaseModel): +class ConfigCloudflarePipelinesR2TablePublicRollingPolicy(BaseModel): """Rolling policy for file sinks (when & why to close a file and open a new one).""" file_size_bytes: Optional[int] = None @@ -82,32 +73,32 @@ class ConfigCloudflarePipelinesR2TableRollingPolicy(BaseModel): """Number of seconds to wait before rolling over to a new file""" -class ConfigCloudflarePipelinesR2Table(BaseModel): +class ConfigCloudflarePipelinesR2TablePublic(BaseModel): + """R2 Sink public configuration.""" + account_id: str """Cloudflare Account ID for the bucket""" bucket: str """R2 Bucket to write to""" - credentials: ConfigCloudflarePipelinesR2TableCredentials - - file_naming: Optional[ConfigCloudflarePipelinesR2TableFileNaming] = None + file_naming: Optional[ConfigCloudflarePipelinesR2TablePublicFileNaming] = None """Controls filename prefix/suffix and strategy.""" jurisdiction: Optional[str] = None """Jurisdiction this bucket is hosted in""" - partitioning: Optional[ConfigCloudflarePipelinesR2TablePartitioning] = None + partitioning: Optional[ConfigCloudflarePipelinesR2TablePublicPartitioning] = None """Data-layout partitioning for sinks.""" path: Optional[str] = None """Subpath within the bucket to write to""" - rolling_policy: Optional[ConfigCloudflarePipelinesR2TableRollingPolicy] = None + rolling_policy: Optional[ConfigCloudflarePipelinesR2TablePublicRollingPolicy] = None """Rolling policy for file sinks (when & why to close a file and open a new one).""" -class ConfigCloudflarePipelinesR2DataCatalogTableRollingPolicy(BaseModel): +class ConfigCloudflarePipelinesR2DataCatalogTablePublicRollingPolicy(BaseModel): """Rolling policy for file sinks (when & why to close a file and open a new one).""" file_size_bytes: Optional[int] = None @@ -120,11 +111,8 @@ class ConfigCloudflarePipelinesR2DataCatalogTableRollingPolicy(BaseModel): """Number of seconds to wait before rolling over to a new file""" -class ConfigCloudflarePipelinesR2DataCatalogTable(BaseModel): - """R2 Data Catalog Sink""" - - token: str - """Authentication token""" +class ConfigCloudflarePipelinesR2DataCatalogTablePublic(BaseModel): + """R2 Data Catalog Sink public configuration.""" account_id: str """Cloudflare Account ID""" @@ -138,11 +126,11 @@ class ConfigCloudflarePipelinesR2DataCatalogTable(BaseModel): namespace: Optional[str] = None """Table namespace""" - rolling_policy: Optional[ConfigCloudflarePipelinesR2DataCatalogTableRollingPolicy] = None + rolling_policy: Optional[ConfigCloudflarePipelinesR2DataCatalogTablePublicRollingPolicy] = None """Rolling policy for file sinks (when & why to close a file and open a new one).""" -Config: TypeAlias = Union[ConfigCloudflarePipelinesR2Table, ConfigCloudflarePipelinesR2DataCatalogTable] +Config: TypeAlias = Union[ConfigCloudflarePipelinesR2TablePublic, ConfigCloudflarePipelinesR2DataCatalogTablePublic] class FormatJson(BaseModel): diff --git a/src/cloudflare/types/pipelines/sink_list_response.py b/src/cloudflare/types/pipelines/sink_list_response.py index 5509131b2e1..46a3d74822e 100644 --- a/src/cloudflare/types/pipelines/sink_list_response.py +++ b/src/cloudflare/types/pipelines/sink_list_response.py @@ -12,13 +12,12 @@ __all__ = [ "SinkListResponse", "Config", - "ConfigCloudflarePipelinesR2Table", - "ConfigCloudflarePipelinesR2TableCredentials", - "ConfigCloudflarePipelinesR2TableFileNaming", - "ConfigCloudflarePipelinesR2TablePartitioning", - "ConfigCloudflarePipelinesR2TableRollingPolicy", - "ConfigCloudflarePipelinesR2DataCatalogTable", - "ConfigCloudflarePipelinesR2DataCatalogTableRollingPolicy", + "ConfigCloudflarePipelinesR2TablePublic", + "ConfigCloudflarePipelinesR2TablePublicFileNaming", + "ConfigCloudflarePipelinesR2TablePublicPartitioning", + "ConfigCloudflarePipelinesR2TablePublicRollingPolicy", + "ConfigCloudflarePipelinesR2DataCatalogTablePublic", + "ConfigCloudflarePipelinesR2DataCatalogTablePublicRollingPolicy", "Format", "FormatJson", "FormatParquet", @@ -41,15 +40,7 @@ ] -class ConfigCloudflarePipelinesR2TableCredentials(BaseModel): - access_key_id: str - """Cloudflare Account ID for the bucket""" - - secret_access_key: str - """Cloudflare Account ID for the bucket""" - - -class ConfigCloudflarePipelinesR2TableFileNaming(BaseModel): +class ConfigCloudflarePipelinesR2TablePublicFileNaming(BaseModel): """Controls filename prefix/suffix and strategy.""" prefix: Optional[str] = None @@ -62,14 +53,14 @@ class ConfigCloudflarePipelinesR2TableFileNaming(BaseModel): """This will overwrite the default file suffix. i.e .parquet, use with caution""" -class ConfigCloudflarePipelinesR2TablePartitioning(BaseModel): +class ConfigCloudflarePipelinesR2TablePublicPartitioning(BaseModel): """Data-layout partitioning for sinks.""" time_pattern: Optional[str] = None """The pattern of the date string""" -class ConfigCloudflarePipelinesR2TableRollingPolicy(BaseModel): +class ConfigCloudflarePipelinesR2TablePublicRollingPolicy(BaseModel): """Rolling policy for file sinks (when & why to close a file and open a new one).""" file_size_bytes: Optional[int] = None @@ -82,32 +73,32 @@ class ConfigCloudflarePipelinesR2TableRollingPolicy(BaseModel): """Number of seconds to wait before rolling over to a new file""" -class ConfigCloudflarePipelinesR2Table(BaseModel): +class ConfigCloudflarePipelinesR2TablePublic(BaseModel): + """R2 Sink public configuration.""" + account_id: str """Cloudflare Account ID for the bucket""" bucket: str """R2 Bucket to write to""" - credentials: ConfigCloudflarePipelinesR2TableCredentials - - file_naming: Optional[ConfigCloudflarePipelinesR2TableFileNaming] = None + file_naming: Optional[ConfigCloudflarePipelinesR2TablePublicFileNaming] = None """Controls filename prefix/suffix and strategy.""" jurisdiction: Optional[str] = None """Jurisdiction this bucket is hosted in""" - partitioning: Optional[ConfigCloudflarePipelinesR2TablePartitioning] = None + partitioning: Optional[ConfigCloudflarePipelinesR2TablePublicPartitioning] = None """Data-layout partitioning for sinks.""" path: Optional[str] = None """Subpath within the bucket to write to""" - rolling_policy: Optional[ConfigCloudflarePipelinesR2TableRollingPolicy] = None + rolling_policy: Optional[ConfigCloudflarePipelinesR2TablePublicRollingPolicy] = None """Rolling policy for file sinks (when & why to close a file and open a new one).""" -class ConfigCloudflarePipelinesR2DataCatalogTableRollingPolicy(BaseModel): +class ConfigCloudflarePipelinesR2DataCatalogTablePublicRollingPolicy(BaseModel): """Rolling policy for file sinks (when & why to close a file and open a new one).""" file_size_bytes: Optional[int] = None @@ -120,11 +111,8 @@ class ConfigCloudflarePipelinesR2DataCatalogTableRollingPolicy(BaseModel): """Number of seconds to wait before rolling over to a new file""" -class ConfigCloudflarePipelinesR2DataCatalogTable(BaseModel): - """R2 Data Catalog Sink""" - - token: str - """Authentication token""" +class ConfigCloudflarePipelinesR2DataCatalogTablePublic(BaseModel): + """R2 Data Catalog Sink public configuration.""" account_id: str """Cloudflare Account ID""" @@ -138,11 +126,11 @@ class ConfigCloudflarePipelinesR2DataCatalogTable(BaseModel): namespace: Optional[str] = None """Table namespace""" - rolling_policy: Optional[ConfigCloudflarePipelinesR2DataCatalogTableRollingPolicy] = None + rolling_policy: Optional[ConfigCloudflarePipelinesR2DataCatalogTablePublicRollingPolicy] = None """Rolling policy for file sinks (when & why to close a file and open a new one).""" -Config: TypeAlias = Union[ConfigCloudflarePipelinesR2Table, ConfigCloudflarePipelinesR2DataCatalogTable] +Config: TypeAlias = Union[ConfigCloudflarePipelinesR2TablePublic, ConfigCloudflarePipelinesR2DataCatalogTablePublic] class FormatJson(BaseModel): diff --git a/src/cloudflare/types/radar/ai/inference_timeseries_groups_v2_params.py b/src/cloudflare/types/radar/ai/inference_timeseries_groups_v2_params.py index db5f948dee9..dd3309d32de 100644 --- a/src/cloudflare/types/radar/ai/inference_timeseries_groups_v2_params.py +++ b/src/cloudflare/types/radar/ai/inference_timeseries_groups_v2_params.py @@ -71,7 +71,7 @@ class InferenceTimeseriesGroupsV2Params(TypedDict, total=False): name: SequenceNotStr[str] """Array of names used to label the series in the response.""" - normalization: Literal["PERCENTAGE_CHANGE", "MIN0_MAX"] + normalization: Literal["PERCENTAGE", "MIN0_MAX"] """Normalization method applied to the results. Refer to diff --git a/src/cloudflare/types/radar/geolocation_get_response.py b/src/cloudflare/types/radar/geolocation_get_response.py index bc5aaecc88d..d172f8872e1 100644 --- a/src/cloudflare/types/radar/geolocation_get_response.py +++ b/src/cloudflare/types/radar/geolocation_get_response.py @@ -1,5 +1,6 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. +from typing import Optional from typing_extensions import Literal from pydantic import Field as FieldInfo @@ -23,6 +24,8 @@ class GeolocationParentParent(BaseModel): type: Literal["CONTINENT", "COUNTRY", "ADM1"] """The type of the geolocation.""" + code: Optional[str] = None + class GeolocationParent(BaseModel): geo_id: str = FieldInfo(alias="geoId") @@ -40,6 +43,8 @@ class GeolocationParent(BaseModel): type: Literal["CONTINENT", "COUNTRY", "ADM1"] """The type of the geolocation.""" + code: Optional[str] = None + class Geolocation(BaseModel): geo_id: str = FieldInfo(alias="geoId") @@ -57,6 +62,8 @@ class Geolocation(BaseModel): type: Literal["CONTINENT", "COUNTRY", "ADM1"] """The type of the geolocation.""" + code: Optional[str] = None + class GeolocationGetResponse(BaseModel): geolocation: Geolocation diff --git a/src/cloudflare/types/radar/geolocation_list_response.py b/src/cloudflare/types/radar/geolocation_list_response.py index 5dbd2bc4ebc..cb79a57d530 100644 --- a/src/cloudflare/types/radar/geolocation_list_response.py +++ b/src/cloudflare/types/radar/geolocation_list_response.py @@ -1,6 +1,6 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import List +from typing import List, Optional from typing_extensions import Literal from pydantic import Field as FieldInfo @@ -24,6 +24,8 @@ class GeolocationParentParent(BaseModel): type: Literal["CONTINENT", "COUNTRY", "ADM1"] """The type of the geolocation.""" + code: Optional[str] = None + class GeolocationParent(BaseModel): geo_id: str = FieldInfo(alias="geoId") @@ -41,6 +43,8 @@ class GeolocationParent(BaseModel): type: Literal["CONTINENT", "COUNTRY", "ADM1"] """The type of the geolocation.""" + code: Optional[str] = None + class Geolocation(BaseModel): geo_id: str = FieldInfo(alias="geoId") @@ -58,6 +62,8 @@ class Geolocation(BaseModel): type: Literal["CONTINENT", "COUNTRY", "ADM1"] """The type of the geolocation.""" + code: Optional[str] = None + class GeolocationListResponse(BaseModel): geolocations: List[Geolocation] diff --git a/src/cloudflare/types/rulesets/phase.py b/src/cloudflare/types/rulesets/phase.py index f7918ae46f6..7993a770ba1 100644 --- a/src/cloudflare/types/rulesets/phase.py +++ b/src/cloudflare/types/rulesets/phase.py @@ -21,6 +21,7 @@ "http_request_sanitize", "http_request_sbfm", "http_request_transform", + "http_response_cache_settings", "http_response_compression", "http_response_firewall_managed", "http_response_headers_transform", diff --git a/src/cloudflare/types/rulesets/phase_get_response.py b/src/cloudflare/types/rulesets/phase_get_response.py index 3b3e517d373..b9552130335 100644 --- a/src/cloudflare/types/rulesets/phase_get_response.py +++ b/src/cloudflare/types/rulesets/phase_get_response.py @@ -4,6 +4,8 @@ from datetime import datetime from typing_extensions import Literal, Annotated, TypeAlias +from pydantic import Field as FieldInfo + from .kind import Kind from .phase import Phase from .logging import Logging @@ -35,6 +37,59 @@ "RuleRulesetsJSChallengeRule", "RuleRulesetsJSChallengeRuleExposedCredentialCheck", "RuleRulesetsJSChallengeRuleRatelimit", + "RuleRulesetsSetCacheControlRule", + "RuleRulesetsSetCacheControlRuleActionParameters", + "RuleRulesetsSetCacheControlRuleActionParametersImmutable", + "RuleRulesetsSetCacheControlRuleActionParametersImmutableSetDirective", + "RuleRulesetsSetCacheControlRuleActionParametersImmutableRemoveDirective", + "RuleRulesetsSetCacheControlRuleActionParametersMaxAge", + "RuleRulesetsSetCacheControlRuleActionParametersMaxAgeSetDirective", + "RuleRulesetsSetCacheControlRuleActionParametersMaxAgeRemoveDirective", + "RuleRulesetsSetCacheControlRuleActionParametersMustRevalidate", + "RuleRulesetsSetCacheControlRuleActionParametersMustRevalidateSetDirective", + "RuleRulesetsSetCacheControlRuleActionParametersMustRevalidateRemoveDirective", + "RuleRulesetsSetCacheControlRuleActionParametersMustUnderstand", + "RuleRulesetsSetCacheControlRuleActionParametersMustUnderstandSetDirective", + "RuleRulesetsSetCacheControlRuleActionParametersMustUnderstandRemoveDirective", + "RuleRulesetsSetCacheControlRuleActionParametersNoCache", + "RuleRulesetsSetCacheControlRuleActionParametersNoCacheSetDirective", + "RuleRulesetsSetCacheControlRuleActionParametersNoCacheRemoveDirective", + "RuleRulesetsSetCacheControlRuleActionParametersNoStore", + "RuleRulesetsSetCacheControlRuleActionParametersNoStoreSetDirective", + "RuleRulesetsSetCacheControlRuleActionParametersNoStoreRemoveDirective", + "RuleRulesetsSetCacheControlRuleActionParametersNoTransform", + "RuleRulesetsSetCacheControlRuleActionParametersNoTransformSetDirective", + "RuleRulesetsSetCacheControlRuleActionParametersNoTransformRemoveDirective", + "RuleRulesetsSetCacheControlRuleActionParametersPrivate", + "RuleRulesetsSetCacheControlRuleActionParametersPrivateSetDirective", + "RuleRulesetsSetCacheControlRuleActionParametersPrivateRemoveDirective", + "RuleRulesetsSetCacheControlRuleActionParametersProxyRevalidate", + "RuleRulesetsSetCacheControlRuleActionParametersProxyRevalidateSetDirective", + "RuleRulesetsSetCacheControlRuleActionParametersProxyRevalidateRemoveDirective", + "RuleRulesetsSetCacheControlRuleActionParametersPublic", + "RuleRulesetsSetCacheControlRuleActionParametersPublicSetDirective", + "RuleRulesetsSetCacheControlRuleActionParametersPublicRemoveDirective", + "RuleRulesetsSetCacheControlRuleActionParametersSMaxage", + "RuleRulesetsSetCacheControlRuleActionParametersSMaxageSetDirective", + "RuleRulesetsSetCacheControlRuleActionParametersSMaxageRemoveDirective", + "RuleRulesetsSetCacheControlRuleActionParametersStaleIfError", + "RuleRulesetsSetCacheControlRuleActionParametersStaleIfErrorSetDirective", + "RuleRulesetsSetCacheControlRuleActionParametersStaleIfErrorRemoveDirective", + "RuleRulesetsSetCacheControlRuleActionParametersStaleWhileRevalidate", + "RuleRulesetsSetCacheControlRuleActionParametersStaleWhileRevalidateSetDirective", + "RuleRulesetsSetCacheControlRuleActionParametersStaleWhileRevalidateRemoveDirective", + "RuleRulesetsSetCacheControlRuleExposedCredentialCheck", + "RuleRulesetsSetCacheControlRuleRatelimit", + "RuleRulesetsSetCacheTagsRule", + "RuleRulesetsSetCacheTagsRuleActionParameters", + "RuleRulesetsSetCacheTagsRuleActionParametersAddCacheTagsValues", + "RuleRulesetsSetCacheTagsRuleActionParametersAddCacheTagsExpression", + "RuleRulesetsSetCacheTagsRuleActionParametersRemoveCacheTagsValues", + "RuleRulesetsSetCacheTagsRuleActionParametersRemoveCacheTagsExpression", + "RuleRulesetsSetCacheTagsRuleActionParametersSetCacheTagsValues", + "RuleRulesetsSetCacheTagsRuleActionParametersSetCacheTagsExpression", + "RuleRulesetsSetCacheTagsRuleExposedCredentialCheck", + "RuleRulesetsSetCacheTagsRuleRatelimit", ] @@ -232,6 +287,711 @@ class RuleRulesetsJSChallengeRule(BaseModel): """The reference of the rule (the rule's ID by default).""" +class RuleRulesetsSetCacheControlRuleActionParametersImmutableSetDirective(BaseModel): + """Set the directive.""" + + operation: Literal["set", "remove"] + """The operation to perform on the cache-control directive.""" + + cloudflare_only: Optional[bool] = None + """Whether the directive should only be applied to the Cloudflare CDN cache.""" + + +class RuleRulesetsSetCacheControlRuleActionParametersImmutableRemoveDirective(BaseModel): + """Remove the directive.""" + + operation: Literal["set", "remove"] + """The operation to perform on the cache-control directive.""" + + cloudflare_only: Optional[bool] = None + """Whether the directive should only be applied to the Cloudflare CDN cache.""" + + +RuleRulesetsSetCacheControlRuleActionParametersImmutable: TypeAlias = Union[ + RuleRulesetsSetCacheControlRuleActionParametersImmutableSetDirective, + RuleRulesetsSetCacheControlRuleActionParametersImmutableRemoveDirective, +] + + +class RuleRulesetsSetCacheControlRuleActionParametersMaxAgeSetDirective(BaseModel): + """Set the directive with a duration value in seconds.""" + + operation: Literal["set", "remove"] + """The operation to perform on the cache-control directive.""" + + value: int + """The duration value in seconds for the directive.""" + + cloudflare_only: Optional[bool] = None + """Whether the directive should only be applied to the Cloudflare CDN cache.""" + + +class RuleRulesetsSetCacheControlRuleActionParametersMaxAgeRemoveDirective(BaseModel): + """Remove the directive.""" + + operation: Literal["set", "remove"] + """The operation to perform on the cache-control directive.""" + + cloudflare_only: Optional[bool] = None + """Whether the directive should only be applied to the Cloudflare CDN cache.""" + + +RuleRulesetsSetCacheControlRuleActionParametersMaxAge: TypeAlias = Union[ + RuleRulesetsSetCacheControlRuleActionParametersMaxAgeSetDirective, + RuleRulesetsSetCacheControlRuleActionParametersMaxAgeRemoveDirective, +] + + +class RuleRulesetsSetCacheControlRuleActionParametersMustRevalidateSetDirective(BaseModel): + """Set the directive.""" + + operation: Literal["set", "remove"] + """The operation to perform on the cache-control directive.""" + + cloudflare_only: Optional[bool] = None + """Whether the directive should only be applied to the Cloudflare CDN cache.""" + + +class RuleRulesetsSetCacheControlRuleActionParametersMustRevalidateRemoveDirective(BaseModel): + """Remove the directive.""" + + operation: Literal["set", "remove"] + """The operation to perform on the cache-control directive.""" + + cloudflare_only: Optional[bool] = None + """Whether the directive should only be applied to the Cloudflare CDN cache.""" + + +RuleRulesetsSetCacheControlRuleActionParametersMustRevalidate: TypeAlias = Union[ + RuleRulesetsSetCacheControlRuleActionParametersMustRevalidateSetDirective, + RuleRulesetsSetCacheControlRuleActionParametersMustRevalidateRemoveDirective, +] + + +class RuleRulesetsSetCacheControlRuleActionParametersMustUnderstandSetDirective(BaseModel): + """Set the directive.""" + + operation: Literal["set", "remove"] + """The operation to perform on the cache-control directive.""" + + cloudflare_only: Optional[bool] = None + """Whether the directive should only be applied to the Cloudflare CDN cache.""" + + +class RuleRulesetsSetCacheControlRuleActionParametersMustUnderstandRemoveDirective(BaseModel): + """Remove the directive.""" + + operation: Literal["set", "remove"] + """The operation to perform on the cache-control directive.""" + + cloudflare_only: Optional[bool] = None + """Whether the directive should only be applied to the Cloudflare CDN cache.""" + + +RuleRulesetsSetCacheControlRuleActionParametersMustUnderstand: TypeAlias = Union[ + RuleRulesetsSetCacheControlRuleActionParametersMustUnderstandSetDirective, + RuleRulesetsSetCacheControlRuleActionParametersMustUnderstandRemoveDirective, +] + + +class RuleRulesetsSetCacheControlRuleActionParametersNoCacheSetDirective(BaseModel): + """Set the directive with optional qualifiers.""" + + operation: Literal["set", "remove"] + """The operation to perform on the cache-control directive.""" + + cloudflare_only: Optional[bool] = None + """Whether the directive should only be applied to the Cloudflare CDN cache.""" + + qualifiers: Optional[List[str]] = None + """ + Optional list of header names to qualify the directive (e.g., for "private" or + "no-cache" directives). + """ + + +class RuleRulesetsSetCacheControlRuleActionParametersNoCacheRemoveDirective(BaseModel): + """Remove the directive.""" + + operation: Literal["set", "remove"] + """The operation to perform on the cache-control directive.""" + + cloudflare_only: Optional[bool] = None + """Whether the directive should only be applied to the Cloudflare CDN cache.""" + + +RuleRulesetsSetCacheControlRuleActionParametersNoCache: TypeAlias = Union[ + RuleRulesetsSetCacheControlRuleActionParametersNoCacheSetDirective, + RuleRulesetsSetCacheControlRuleActionParametersNoCacheRemoveDirective, +] + + +class RuleRulesetsSetCacheControlRuleActionParametersNoStoreSetDirective(BaseModel): + """Set the directive.""" + + operation: Literal["set", "remove"] + """The operation to perform on the cache-control directive.""" + + cloudflare_only: Optional[bool] = None + """Whether the directive should only be applied to the Cloudflare CDN cache.""" + + +class RuleRulesetsSetCacheControlRuleActionParametersNoStoreRemoveDirective(BaseModel): + """Remove the directive.""" + + operation: Literal["set", "remove"] + """The operation to perform on the cache-control directive.""" + + cloudflare_only: Optional[bool] = None + """Whether the directive should only be applied to the Cloudflare CDN cache.""" + + +RuleRulesetsSetCacheControlRuleActionParametersNoStore: TypeAlias = Union[ + RuleRulesetsSetCacheControlRuleActionParametersNoStoreSetDirective, + RuleRulesetsSetCacheControlRuleActionParametersNoStoreRemoveDirective, +] + + +class RuleRulesetsSetCacheControlRuleActionParametersNoTransformSetDirective(BaseModel): + """Set the directive.""" + + operation: Literal["set", "remove"] + """The operation to perform on the cache-control directive.""" + + cloudflare_only: Optional[bool] = None + """Whether the directive should only be applied to the Cloudflare CDN cache.""" + + +class RuleRulesetsSetCacheControlRuleActionParametersNoTransformRemoveDirective(BaseModel): + """Remove the directive.""" + + operation: Literal["set", "remove"] + """The operation to perform on the cache-control directive.""" + + cloudflare_only: Optional[bool] = None + """Whether the directive should only be applied to the Cloudflare CDN cache.""" + + +RuleRulesetsSetCacheControlRuleActionParametersNoTransform: TypeAlias = Union[ + RuleRulesetsSetCacheControlRuleActionParametersNoTransformSetDirective, + RuleRulesetsSetCacheControlRuleActionParametersNoTransformRemoveDirective, +] + + +class RuleRulesetsSetCacheControlRuleActionParametersPrivateSetDirective(BaseModel): + """Set the directive with optional qualifiers.""" + + operation: Literal["set", "remove"] + """The operation to perform on the cache-control directive.""" + + cloudflare_only: Optional[bool] = None + """Whether the directive should only be applied to the Cloudflare CDN cache.""" + + qualifiers: Optional[List[str]] = None + """ + Optional list of header names to qualify the directive (e.g., for "private" or + "no-cache" directives). + """ + + +class RuleRulesetsSetCacheControlRuleActionParametersPrivateRemoveDirective(BaseModel): + """Remove the directive.""" + + operation: Literal["set", "remove"] + """The operation to perform on the cache-control directive.""" + + cloudflare_only: Optional[bool] = None + """Whether the directive should only be applied to the Cloudflare CDN cache.""" + + +RuleRulesetsSetCacheControlRuleActionParametersPrivate: TypeAlias = Union[ + RuleRulesetsSetCacheControlRuleActionParametersPrivateSetDirective, + RuleRulesetsSetCacheControlRuleActionParametersPrivateRemoveDirective, +] + + +class RuleRulesetsSetCacheControlRuleActionParametersProxyRevalidateSetDirective(BaseModel): + """Set the directive.""" + + operation: Literal["set", "remove"] + """The operation to perform on the cache-control directive.""" + + cloudflare_only: Optional[bool] = None + """Whether the directive should only be applied to the Cloudflare CDN cache.""" + + +class RuleRulesetsSetCacheControlRuleActionParametersProxyRevalidateRemoveDirective(BaseModel): + """Remove the directive.""" + + operation: Literal["set", "remove"] + """The operation to perform on the cache-control directive.""" + + cloudflare_only: Optional[bool] = None + """Whether the directive should only be applied to the Cloudflare CDN cache.""" + + +RuleRulesetsSetCacheControlRuleActionParametersProxyRevalidate: TypeAlias = Union[ + RuleRulesetsSetCacheControlRuleActionParametersProxyRevalidateSetDirective, + RuleRulesetsSetCacheControlRuleActionParametersProxyRevalidateRemoveDirective, +] + + +class RuleRulesetsSetCacheControlRuleActionParametersPublicSetDirective(BaseModel): + """Set the directive.""" + + operation: Literal["set", "remove"] + """The operation to perform on the cache-control directive.""" + + cloudflare_only: Optional[bool] = None + """Whether the directive should only be applied to the Cloudflare CDN cache.""" + + +class RuleRulesetsSetCacheControlRuleActionParametersPublicRemoveDirective(BaseModel): + """Remove the directive.""" + + operation: Literal["set", "remove"] + """The operation to perform on the cache-control directive.""" + + cloudflare_only: Optional[bool] = None + """Whether the directive should only be applied to the Cloudflare CDN cache.""" + + +RuleRulesetsSetCacheControlRuleActionParametersPublic: TypeAlias = Union[ + RuleRulesetsSetCacheControlRuleActionParametersPublicSetDirective, + RuleRulesetsSetCacheControlRuleActionParametersPublicRemoveDirective, +] + + +class RuleRulesetsSetCacheControlRuleActionParametersSMaxageSetDirective(BaseModel): + """Set the directive with a duration value in seconds.""" + + operation: Literal["set", "remove"] + """The operation to perform on the cache-control directive.""" + + value: int + """The duration value in seconds for the directive.""" + + cloudflare_only: Optional[bool] = None + """Whether the directive should only be applied to the Cloudflare CDN cache.""" + + +class RuleRulesetsSetCacheControlRuleActionParametersSMaxageRemoveDirective(BaseModel): + """Remove the directive.""" + + operation: Literal["set", "remove"] + """The operation to perform on the cache-control directive.""" + + cloudflare_only: Optional[bool] = None + """Whether the directive should only be applied to the Cloudflare CDN cache.""" + + +RuleRulesetsSetCacheControlRuleActionParametersSMaxage: TypeAlias = Union[ + RuleRulesetsSetCacheControlRuleActionParametersSMaxageSetDirective, + RuleRulesetsSetCacheControlRuleActionParametersSMaxageRemoveDirective, +] + + +class RuleRulesetsSetCacheControlRuleActionParametersStaleIfErrorSetDirective(BaseModel): + """Set the directive with a duration value in seconds.""" + + operation: Literal["set", "remove"] + """The operation to perform on the cache-control directive.""" + + value: int + """The duration value in seconds for the directive.""" + + cloudflare_only: Optional[bool] = None + """Whether the directive should only be applied to the Cloudflare CDN cache.""" + + +class RuleRulesetsSetCacheControlRuleActionParametersStaleIfErrorRemoveDirective(BaseModel): + """Remove the directive.""" + + operation: Literal["set", "remove"] + """The operation to perform on the cache-control directive.""" + + cloudflare_only: Optional[bool] = None + """Whether the directive should only be applied to the Cloudflare CDN cache.""" + + +RuleRulesetsSetCacheControlRuleActionParametersStaleIfError: TypeAlias = Union[ + RuleRulesetsSetCacheControlRuleActionParametersStaleIfErrorSetDirective, + RuleRulesetsSetCacheControlRuleActionParametersStaleIfErrorRemoveDirective, +] + + +class RuleRulesetsSetCacheControlRuleActionParametersStaleWhileRevalidateSetDirective(BaseModel): + """Set the directive with a duration value in seconds.""" + + operation: Literal["set", "remove"] + """The operation to perform on the cache-control directive.""" + + value: int + """The duration value in seconds for the directive.""" + + cloudflare_only: Optional[bool] = None + """Whether the directive should only be applied to the Cloudflare CDN cache.""" + + +class RuleRulesetsSetCacheControlRuleActionParametersStaleWhileRevalidateRemoveDirective(BaseModel): + """Remove the directive.""" + + operation: Literal["set", "remove"] + """The operation to perform on the cache-control directive.""" + + cloudflare_only: Optional[bool] = None + """Whether the directive should only be applied to the Cloudflare CDN cache.""" + + +RuleRulesetsSetCacheControlRuleActionParametersStaleWhileRevalidate: TypeAlias = Union[ + RuleRulesetsSetCacheControlRuleActionParametersStaleWhileRevalidateSetDirective, + RuleRulesetsSetCacheControlRuleActionParametersStaleWhileRevalidateRemoveDirective, +] + + +class RuleRulesetsSetCacheControlRuleActionParameters(BaseModel): + """The parameters configuring the rule's action.""" + + immutable: Optional[RuleRulesetsSetCacheControlRuleActionParametersImmutable] = None + """A cache-control directive configuration.""" + + max_age: Optional[RuleRulesetsSetCacheControlRuleActionParametersMaxAge] = FieldInfo(alias="max-age", default=None) + """ + A cache-control directive configuration that accepts a duration value in + seconds. + """ + + must_revalidate: Optional[RuleRulesetsSetCacheControlRuleActionParametersMustRevalidate] = FieldInfo( + alias="must-revalidate", default=None + ) + """A cache-control directive configuration.""" + + must_understand: Optional[RuleRulesetsSetCacheControlRuleActionParametersMustUnderstand] = FieldInfo( + alias="must-understand", default=None + ) + """A cache-control directive configuration.""" + + no_cache: Optional[RuleRulesetsSetCacheControlRuleActionParametersNoCache] = FieldInfo( + alias="no-cache", default=None + ) + """ + A cache-control directive configuration that accepts optional qualifiers (header + names). + """ + + no_store: Optional[RuleRulesetsSetCacheControlRuleActionParametersNoStore] = FieldInfo( + alias="no-store", default=None + ) + """A cache-control directive configuration.""" + + no_transform: Optional[RuleRulesetsSetCacheControlRuleActionParametersNoTransform] = FieldInfo( + alias="no-transform", default=None + ) + """A cache-control directive configuration.""" + + private: Optional[RuleRulesetsSetCacheControlRuleActionParametersPrivate] = None + """ + A cache-control directive configuration that accepts optional qualifiers (header + names). + """ + + proxy_revalidate: Optional[RuleRulesetsSetCacheControlRuleActionParametersProxyRevalidate] = FieldInfo( + alias="proxy-revalidate", default=None + ) + """A cache-control directive configuration.""" + + public: Optional[RuleRulesetsSetCacheControlRuleActionParametersPublic] = None + """A cache-control directive configuration.""" + + s_maxage: Optional[RuleRulesetsSetCacheControlRuleActionParametersSMaxage] = FieldInfo( + alias="s-maxage", default=None + ) + """ + A cache-control directive configuration that accepts a duration value in + seconds. + """ + + stale_if_error: Optional[RuleRulesetsSetCacheControlRuleActionParametersStaleIfError] = FieldInfo( + alias="stale-if-error", default=None + ) + """ + A cache-control directive configuration that accepts a duration value in + seconds. + """ + + stale_while_revalidate: Optional[RuleRulesetsSetCacheControlRuleActionParametersStaleWhileRevalidate] = FieldInfo( + alias="stale-while-revalidate", default=None + ) + """ + A cache-control directive configuration that accepts a duration value in + seconds. + """ + + +class RuleRulesetsSetCacheControlRuleExposedCredentialCheck(BaseModel): + """Configuration for exposed credential checking.""" + + password_expression: str + """An expression that selects the password used in the credentials check.""" + + username_expression: str + """An expression that selects the user ID used in the credentials check.""" + + +class RuleRulesetsSetCacheControlRuleRatelimit(BaseModel): + """An object configuring the rule's rate limit behavior.""" + + characteristics: List[str] + """ + Characteristics of the request on which the rate limit counter will be + incremented. + """ + + period: int + """Period in seconds over which the counter is being incremented.""" + + counting_expression: Optional[str] = None + """An expression that defines when the rate limit counter should be incremented. + + It defaults to the same as the rule's expression. + """ + + mitigation_timeout: Optional[int] = None + """ + Period of time in seconds after which the action will be disabled following its + first execution. + """ + + requests_per_period: Optional[int] = None + """ + The threshold of requests per period after which the action will be executed for + the first time. + """ + + requests_to_origin: Optional[bool] = None + """Whether counting is only performed when an origin is reached.""" + + score_per_period: Optional[int] = None + """ + The score threshold per period for which the action will be executed the first + time. + """ + + score_response_header_name: Optional[str] = None + """ + A response header name provided by the origin, which contains the score to + increment rate limit counter with. + """ + + +class RuleRulesetsSetCacheControlRule(BaseModel): + last_updated: datetime + """The timestamp of when the rule was last modified.""" + + version: str + """The version of the rule.""" + + id: Optional[str] = None + """The unique ID of the rule.""" + + action: Optional[Literal["set_cache_control"]] = None + """The action to perform when the rule matches.""" + + action_parameters: Optional[RuleRulesetsSetCacheControlRuleActionParameters] = None + """The parameters configuring the rule's action.""" + + categories: Optional[List[str]] = None + """The categories of the rule.""" + + description: Optional[str] = None + """An informative description of the rule.""" + + enabled: Optional[bool] = None + """Whether the rule should be executed.""" + + exposed_credential_check: Optional[RuleRulesetsSetCacheControlRuleExposedCredentialCheck] = None + """Configuration for exposed credential checking.""" + + expression: Optional[str] = None + """The expression defining which traffic will match the rule.""" + + logging: Optional[Logging] = None + """An object configuring the rule's logging behavior.""" + + ratelimit: Optional[RuleRulesetsSetCacheControlRuleRatelimit] = None + """An object configuring the rule's rate limit behavior.""" + + ref: Optional[str] = None + """The reference of the rule (the rule's ID by default).""" + + +class RuleRulesetsSetCacheTagsRuleActionParametersAddCacheTagsValues(BaseModel): + """Add cache tags using a list of values.""" + + operation: Literal["add", "remove", "set"] + """The operation to perform on the cache tags.""" + + values: List[str] + """A list of cache tag values.""" + + +class RuleRulesetsSetCacheTagsRuleActionParametersAddCacheTagsExpression(BaseModel): + """Add cache tags using an expression.""" + + expression: str + """An expression that evaluates to an array of cache tag values.""" + + operation: Literal["add", "remove", "set"] + """The operation to perform on the cache tags.""" + + +class RuleRulesetsSetCacheTagsRuleActionParametersRemoveCacheTagsValues(BaseModel): + """Remove cache tags using a list of values.""" + + operation: Literal["add", "remove", "set"] + """The operation to perform on the cache tags.""" + + values: List[str] + """A list of cache tag values.""" + + +class RuleRulesetsSetCacheTagsRuleActionParametersRemoveCacheTagsExpression(BaseModel): + """Remove cache tags using an expression.""" + + expression: str + """An expression that evaluates to an array of cache tag values.""" + + operation: Literal["add", "remove", "set"] + """The operation to perform on the cache tags.""" + + +class RuleRulesetsSetCacheTagsRuleActionParametersSetCacheTagsValues(BaseModel): + """Set cache tags using a list of values.""" + + operation: Literal["add", "remove", "set"] + """The operation to perform on the cache tags.""" + + values: List[str] + """A list of cache tag values.""" + + +class RuleRulesetsSetCacheTagsRuleActionParametersSetCacheTagsExpression(BaseModel): + """Set cache tags using an expression.""" + + expression: str + """An expression that evaluates to an array of cache tag values.""" + + operation: Literal["add", "remove", "set"] + """The operation to perform on the cache tags.""" + + +RuleRulesetsSetCacheTagsRuleActionParameters: TypeAlias = Union[ + RuleRulesetsSetCacheTagsRuleActionParametersAddCacheTagsValues, + RuleRulesetsSetCacheTagsRuleActionParametersAddCacheTagsExpression, + RuleRulesetsSetCacheTagsRuleActionParametersRemoveCacheTagsValues, + RuleRulesetsSetCacheTagsRuleActionParametersRemoveCacheTagsExpression, + RuleRulesetsSetCacheTagsRuleActionParametersSetCacheTagsValues, + RuleRulesetsSetCacheTagsRuleActionParametersSetCacheTagsExpression, +] + + +class RuleRulesetsSetCacheTagsRuleExposedCredentialCheck(BaseModel): + """Configuration for exposed credential checking.""" + + password_expression: str + """An expression that selects the password used in the credentials check.""" + + username_expression: str + """An expression that selects the user ID used in the credentials check.""" + + +class RuleRulesetsSetCacheTagsRuleRatelimit(BaseModel): + """An object configuring the rule's rate limit behavior.""" + + characteristics: List[str] + """ + Characteristics of the request on which the rate limit counter will be + incremented. + """ + + period: int + """Period in seconds over which the counter is being incremented.""" + + counting_expression: Optional[str] = None + """An expression that defines when the rate limit counter should be incremented. + + It defaults to the same as the rule's expression. + """ + + mitigation_timeout: Optional[int] = None + """ + Period of time in seconds after which the action will be disabled following its + first execution. + """ + + requests_per_period: Optional[int] = None + """ + The threshold of requests per period after which the action will be executed for + the first time. + """ + + requests_to_origin: Optional[bool] = None + """Whether counting is only performed when an origin is reached.""" + + score_per_period: Optional[int] = None + """ + The score threshold per period for which the action will be executed the first + time. + """ + + score_response_header_name: Optional[str] = None + """ + A response header name provided by the origin, which contains the score to + increment rate limit counter with. + """ + + +class RuleRulesetsSetCacheTagsRule(BaseModel): + last_updated: datetime + """The timestamp of when the rule was last modified.""" + + version: str + """The version of the rule.""" + + id: Optional[str] = None + """The unique ID of the rule.""" + + action: Optional[Literal["set_cache_tags"]] = None + """The action to perform when the rule matches.""" + + action_parameters: Optional[RuleRulesetsSetCacheTagsRuleActionParameters] = None + """The parameters configuring the rule's action.""" + + categories: Optional[List[str]] = None + """The categories of the rule.""" + + description: Optional[str] = None + """An informative description of the rule.""" + + enabled: Optional[bool] = None + """Whether the rule should be executed.""" + + exposed_credential_check: Optional[RuleRulesetsSetCacheTagsRuleExposedCredentialCheck] = None + """Configuration for exposed credential checking.""" + + expression: Optional[str] = None + """The expression defining which traffic will match the rule.""" + + logging: Optional[Logging] = None + """An object configuring the rule's logging behavior.""" + + ratelimit: Optional[RuleRulesetsSetCacheTagsRuleRatelimit] = None + """An object configuring the rule's rate limit behavior.""" + + ref: Optional[str] = None + """The reference of the rule (the rule's ID by default).""" + + Rule: TypeAlias = Annotated[ Union[ BlockRule, @@ -249,7 +1009,9 @@ class RuleRulesetsJSChallengeRule(BaseModel): RouteRule, ScoreRule, ServeErrorRule, + RuleRulesetsSetCacheControlRule, SetCacheSettingsRule, + RuleRulesetsSetCacheTagsRule, SetConfigRule, SkipRule, ], diff --git a/src/cloudflare/types/rulesets/phase_update_params.py b/src/cloudflare/types/rulesets/phase_update_params.py index 84e20caaf86..1a17a4c6063 100644 --- a/src/cloudflare/types/rulesets/phase_update_params.py +++ b/src/cloudflare/types/rulesets/phase_update_params.py @@ -3,9 +3,10 @@ from __future__ import annotations from typing import Union, Iterable -from typing_extensions import Literal, Required, TypeAlias, TypedDict +from typing_extensions import Literal, Required, Annotated, TypeAlias, TypedDict from ..._types import SequenceNotStr +from ..._utils import PropertyInfo from .logging_param import LoggingParam from .log_rule_param import LogRuleParam from .skip_rule_param import SkipRuleParam @@ -33,6 +34,59 @@ "RuleRulesetsJSChallengeRule", "RuleRulesetsJSChallengeRuleExposedCredentialCheck", "RuleRulesetsJSChallengeRuleRatelimit", + "RuleRulesetsSetCacheControlRule", + "RuleRulesetsSetCacheControlRuleActionParameters", + "RuleRulesetsSetCacheControlRuleActionParametersImmutable", + "RuleRulesetsSetCacheControlRuleActionParametersImmutableSetDirective", + "RuleRulesetsSetCacheControlRuleActionParametersImmutableRemoveDirective", + "RuleRulesetsSetCacheControlRuleActionParametersMaxAge", + "RuleRulesetsSetCacheControlRuleActionParametersMaxAgeSetDirective", + "RuleRulesetsSetCacheControlRuleActionParametersMaxAgeRemoveDirective", + "RuleRulesetsSetCacheControlRuleActionParametersMustRevalidate", + "RuleRulesetsSetCacheControlRuleActionParametersMustRevalidateSetDirective", + "RuleRulesetsSetCacheControlRuleActionParametersMustRevalidateRemoveDirective", + "RuleRulesetsSetCacheControlRuleActionParametersMustUnderstand", + "RuleRulesetsSetCacheControlRuleActionParametersMustUnderstandSetDirective", + "RuleRulesetsSetCacheControlRuleActionParametersMustUnderstandRemoveDirective", + "RuleRulesetsSetCacheControlRuleActionParametersNoCache", + "RuleRulesetsSetCacheControlRuleActionParametersNoCacheSetDirective", + "RuleRulesetsSetCacheControlRuleActionParametersNoCacheRemoveDirective", + "RuleRulesetsSetCacheControlRuleActionParametersNoStore", + "RuleRulesetsSetCacheControlRuleActionParametersNoStoreSetDirective", + "RuleRulesetsSetCacheControlRuleActionParametersNoStoreRemoveDirective", + "RuleRulesetsSetCacheControlRuleActionParametersNoTransform", + "RuleRulesetsSetCacheControlRuleActionParametersNoTransformSetDirective", + "RuleRulesetsSetCacheControlRuleActionParametersNoTransformRemoveDirective", + "RuleRulesetsSetCacheControlRuleActionParametersPrivate", + "RuleRulesetsSetCacheControlRuleActionParametersPrivateSetDirective", + "RuleRulesetsSetCacheControlRuleActionParametersPrivateRemoveDirective", + "RuleRulesetsSetCacheControlRuleActionParametersProxyRevalidate", + "RuleRulesetsSetCacheControlRuleActionParametersProxyRevalidateSetDirective", + "RuleRulesetsSetCacheControlRuleActionParametersProxyRevalidateRemoveDirective", + "RuleRulesetsSetCacheControlRuleActionParametersPublic", + "RuleRulesetsSetCacheControlRuleActionParametersPublicSetDirective", + "RuleRulesetsSetCacheControlRuleActionParametersPublicRemoveDirective", + "RuleRulesetsSetCacheControlRuleActionParametersSMaxage", + "RuleRulesetsSetCacheControlRuleActionParametersSMaxageSetDirective", + "RuleRulesetsSetCacheControlRuleActionParametersSMaxageRemoveDirective", + "RuleRulesetsSetCacheControlRuleActionParametersStaleIfError", + "RuleRulesetsSetCacheControlRuleActionParametersStaleIfErrorSetDirective", + "RuleRulesetsSetCacheControlRuleActionParametersStaleIfErrorRemoveDirective", + "RuleRulesetsSetCacheControlRuleActionParametersStaleWhileRevalidate", + "RuleRulesetsSetCacheControlRuleActionParametersStaleWhileRevalidateSetDirective", + "RuleRulesetsSetCacheControlRuleActionParametersStaleWhileRevalidateRemoveDirective", + "RuleRulesetsSetCacheControlRuleExposedCredentialCheck", + "RuleRulesetsSetCacheControlRuleRatelimit", + "RuleRulesetsSetCacheTagsRule", + "RuleRulesetsSetCacheTagsRuleActionParameters", + "RuleRulesetsSetCacheTagsRuleActionParametersAddCacheTagsValues", + "RuleRulesetsSetCacheTagsRuleActionParametersAddCacheTagsExpression", + "RuleRulesetsSetCacheTagsRuleActionParametersRemoveCacheTagsValues", + "RuleRulesetsSetCacheTagsRuleActionParametersRemoveCacheTagsExpression", + "RuleRulesetsSetCacheTagsRuleActionParametersSetCacheTagsValues", + "RuleRulesetsSetCacheTagsRuleActionParametersSetCacheTagsExpression", + "RuleRulesetsSetCacheTagsRuleExposedCredentialCheck", + "RuleRulesetsSetCacheTagsRuleRatelimit", ] @@ -229,6 +283,688 @@ class RuleRulesetsJSChallengeRule(TypedDict, total=False): """The reference of the rule (the rule's ID by default).""" +class RuleRulesetsSetCacheControlRuleActionParametersImmutableSetDirective(TypedDict, total=False): + """Set the directive.""" + + operation: Required[Literal["set", "remove"]] + """The operation to perform on the cache-control directive.""" + + cloudflare_only: bool + """Whether the directive should only be applied to the Cloudflare CDN cache.""" + + +class RuleRulesetsSetCacheControlRuleActionParametersImmutableRemoveDirective(TypedDict, total=False): + """Remove the directive.""" + + operation: Required[Literal["set", "remove"]] + """The operation to perform on the cache-control directive.""" + + cloudflare_only: bool + """Whether the directive should only be applied to the Cloudflare CDN cache.""" + + +RuleRulesetsSetCacheControlRuleActionParametersImmutable: TypeAlias = Union[ + RuleRulesetsSetCacheControlRuleActionParametersImmutableSetDirective, + RuleRulesetsSetCacheControlRuleActionParametersImmutableRemoveDirective, +] + + +class RuleRulesetsSetCacheControlRuleActionParametersMaxAgeSetDirective(TypedDict, total=False): + """Set the directive with a duration value in seconds.""" + + operation: Required[Literal["set", "remove"]] + """The operation to perform on the cache-control directive.""" + + value: Required[int] + """The duration value in seconds for the directive.""" + + cloudflare_only: bool + """Whether the directive should only be applied to the Cloudflare CDN cache.""" + + +class RuleRulesetsSetCacheControlRuleActionParametersMaxAgeRemoveDirective(TypedDict, total=False): + """Remove the directive.""" + + operation: Required[Literal["set", "remove"]] + """The operation to perform on the cache-control directive.""" + + cloudflare_only: bool + """Whether the directive should only be applied to the Cloudflare CDN cache.""" + + +RuleRulesetsSetCacheControlRuleActionParametersMaxAge: TypeAlias = Union[ + RuleRulesetsSetCacheControlRuleActionParametersMaxAgeSetDirective, + RuleRulesetsSetCacheControlRuleActionParametersMaxAgeRemoveDirective, +] + + +class RuleRulesetsSetCacheControlRuleActionParametersMustRevalidateSetDirective(TypedDict, total=False): + """Set the directive.""" + + operation: Required[Literal["set", "remove"]] + """The operation to perform on the cache-control directive.""" + + cloudflare_only: bool + """Whether the directive should only be applied to the Cloudflare CDN cache.""" + + +class RuleRulesetsSetCacheControlRuleActionParametersMustRevalidateRemoveDirective(TypedDict, total=False): + """Remove the directive.""" + + operation: Required[Literal["set", "remove"]] + """The operation to perform on the cache-control directive.""" + + cloudflare_only: bool + """Whether the directive should only be applied to the Cloudflare CDN cache.""" + + +RuleRulesetsSetCacheControlRuleActionParametersMustRevalidate: TypeAlias = Union[ + RuleRulesetsSetCacheControlRuleActionParametersMustRevalidateSetDirective, + RuleRulesetsSetCacheControlRuleActionParametersMustRevalidateRemoveDirective, +] + + +class RuleRulesetsSetCacheControlRuleActionParametersMustUnderstandSetDirective(TypedDict, total=False): + """Set the directive.""" + + operation: Required[Literal["set", "remove"]] + """The operation to perform on the cache-control directive.""" + + cloudflare_only: bool + """Whether the directive should only be applied to the Cloudflare CDN cache.""" + + +class RuleRulesetsSetCacheControlRuleActionParametersMustUnderstandRemoveDirective(TypedDict, total=False): + """Remove the directive.""" + + operation: Required[Literal["set", "remove"]] + """The operation to perform on the cache-control directive.""" + + cloudflare_only: bool + """Whether the directive should only be applied to the Cloudflare CDN cache.""" + + +RuleRulesetsSetCacheControlRuleActionParametersMustUnderstand: TypeAlias = Union[ + RuleRulesetsSetCacheControlRuleActionParametersMustUnderstandSetDirective, + RuleRulesetsSetCacheControlRuleActionParametersMustUnderstandRemoveDirective, +] + + +class RuleRulesetsSetCacheControlRuleActionParametersNoCacheSetDirective(TypedDict, total=False): + """Set the directive with optional qualifiers.""" + + operation: Required[Literal["set", "remove"]] + """The operation to perform on the cache-control directive.""" + + cloudflare_only: bool + """Whether the directive should only be applied to the Cloudflare CDN cache.""" + + qualifiers: SequenceNotStr[str] + """ + Optional list of header names to qualify the directive (e.g., for "private" or + "no-cache" directives). + """ + + +class RuleRulesetsSetCacheControlRuleActionParametersNoCacheRemoveDirective(TypedDict, total=False): + """Remove the directive.""" + + operation: Required[Literal["set", "remove"]] + """The operation to perform on the cache-control directive.""" + + cloudflare_only: bool + """Whether the directive should only be applied to the Cloudflare CDN cache.""" + + +RuleRulesetsSetCacheControlRuleActionParametersNoCache: TypeAlias = Union[ + RuleRulesetsSetCacheControlRuleActionParametersNoCacheSetDirective, + RuleRulesetsSetCacheControlRuleActionParametersNoCacheRemoveDirective, +] + + +class RuleRulesetsSetCacheControlRuleActionParametersNoStoreSetDirective(TypedDict, total=False): + """Set the directive.""" + + operation: Required[Literal["set", "remove"]] + """The operation to perform on the cache-control directive.""" + + cloudflare_only: bool + """Whether the directive should only be applied to the Cloudflare CDN cache.""" + + +class RuleRulesetsSetCacheControlRuleActionParametersNoStoreRemoveDirective(TypedDict, total=False): + """Remove the directive.""" + + operation: Required[Literal["set", "remove"]] + """The operation to perform on the cache-control directive.""" + + cloudflare_only: bool + """Whether the directive should only be applied to the Cloudflare CDN cache.""" + + +RuleRulesetsSetCacheControlRuleActionParametersNoStore: TypeAlias = Union[ + RuleRulesetsSetCacheControlRuleActionParametersNoStoreSetDirective, + RuleRulesetsSetCacheControlRuleActionParametersNoStoreRemoveDirective, +] + + +class RuleRulesetsSetCacheControlRuleActionParametersNoTransformSetDirective(TypedDict, total=False): + """Set the directive.""" + + operation: Required[Literal["set", "remove"]] + """The operation to perform on the cache-control directive.""" + + cloudflare_only: bool + """Whether the directive should only be applied to the Cloudflare CDN cache.""" + + +class RuleRulesetsSetCacheControlRuleActionParametersNoTransformRemoveDirective(TypedDict, total=False): + """Remove the directive.""" + + operation: Required[Literal["set", "remove"]] + """The operation to perform on the cache-control directive.""" + + cloudflare_only: bool + """Whether the directive should only be applied to the Cloudflare CDN cache.""" + + +RuleRulesetsSetCacheControlRuleActionParametersNoTransform: TypeAlias = Union[ + RuleRulesetsSetCacheControlRuleActionParametersNoTransformSetDirective, + RuleRulesetsSetCacheControlRuleActionParametersNoTransformRemoveDirective, +] + + +class RuleRulesetsSetCacheControlRuleActionParametersPrivateSetDirective(TypedDict, total=False): + """Set the directive with optional qualifiers.""" + + operation: Required[Literal["set", "remove"]] + """The operation to perform on the cache-control directive.""" + + cloudflare_only: bool + """Whether the directive should only be applied to the Cloudflare CDN cache.""" + + qualifiers: SequenceNotStr[str] + """ + Optional list of header names to qualify the directive (e.g., for "private" or + "no-cache" directives). + """ + + +class RuleRulesetsSetCacheControlRuleActionParametersPrivateRemoveDirective(TypedDict, total=False): + """Remove the directive.""" + + operation: Required[Literal["set", "remove"]] + """The operation to perform on the cache-control directive.""" + + cloudflare_only: bool + """Whether the directive should only be applied to the Cloudflare CDN cache.""" + + +RuleRulesetsSetCacheControlRuleActionParametersPrivate: TypeAlias = Union[ + RuleRulesetsSetCacheControlRuleActionParametersPrivateSetDirective, + RuleRulesetsSetCacheControlRuleActionParametersPrivateRemoveDirective, +] + + +class RuleRulesetsSetCacheControlRuleActionParametersProxyRevalidateSetDirective(TypedDict, total=False): + """Set the directive.""" + + operation: Required[Literal["set", "remove"]] + """The operation to perform on the cache-control directive.""" + + cloudflare_only: bool + """Whether the directive should only be applied to the Cloudflare CDN cache.""" + + +class RuleRulesetsSetCacheControlRuleActionParametersProxyRevalidateRemoveDirective(TypedDict, total=False): + """Remove the directive.""" + + operation: Required[Literal["set", "remove"]] + """The operation to perform on the cache-control directive.""" + + cloudflare_only: bool + """Whether the directive should only be applied to the Cloudflare CDN cache.""" + + +RuleRulesetsSetCacheControlRuleActionParametersProxyRevalidate: TypeAlias = Union[ + RuleRulesetsSetCacheControlRuleActionParametersProxyRevalidateSetDirective, + RuleRulesetsSetCacheControlRuleActionParametersProxyRevalidateRemoveDirective, +] + + +class RuleRulesetsSetCacheControlRuleActionParametersPublicSetDirective(TypedDict, total=False): + """Set the directive.""" + + operation: Required[Literal["set", "remove"]] + """The operation to perform on the cache-control directive.""" + + cloudflare_only: bool + """Whether the directive should only be applied to the Cloudflare CDN cache.""" + + +class RuleRulesetsSetCacheControlRuleActionParametersPublicRemoveDirective(TypedDict, total=False): + """Remove the directive.""" + + operation: Required[Literal["set", "remove"]] + """The operation to perform on the cache-control directive.""" + + cloudflare_only: bool + """Whether the directive should only be applied to the Cloudflare CDN cache.""" + + +RuleRulesetsSetCacheControlRuleActionParametersPublic: TypeAlias = Union[ + RuleRulesetsSetCacheControlRuleActionParametersPublicSetDirective, + RuleRulesetsSetCacheControlRuleActionParametersPublicRemoveDirective, +] + + +class RuleRulesetsSetCacheControlRuleActionParametersSMaxageSetDirective(TypedDict, total=False): + """Set the directive with a duration value in seconds.""" + + operation: Required[Literal["set", "remove"]] + """The operation to perform on the cache-control directive.""" + + value: Required[int] + """The duration value in seconds for the directive.""" + + cloudflare_only: bool + """Whether the directive should only be applied to the Cloudflare CDN cache.""" + + +class RuleRulesetsSetCacheControlRuleActionParametersSMaxageRemoveDirective(TypedDict, total=False): + """Remove the directive.""" + + operation: Required[Literal["set", "remove"]] + """The operation to perform on the cache-control directive.""" + + cloudflare_only: bool + """Whether the directive should only be applied to the Cloudflare CDN cache.""" + + +RuleRulesetsSetCacheControlRuleActionParametersSMaxage: TypeAlias = Union[ + RuleRulesetsSetCacheControlRuleActionParametersSMaxageSetDirective, + RuleRulesetsSetCacheControlRuleActionParametersSMaxageRemoveDirective, +] + + +class RuleRulesetsSetCacheControlRuleActionParametersStaleIfErrorSetDirective(TypedDict, total=False): + """Set the directive with a duration value in seconds.""" + + operation: Required[Literal["set", "remove"]] + """The operation to perform on the cache-control directive.""" + + value: Required[int] + """The duration value in seconds for the directive.""" + + cloudflare_only: bool + """Whether the directive should only be applied to the Cloudflare CDN cache.""" + + +class RuleRulesetsSetCacheControlRuleActionParametersStaleIfErrorRemoveDirective(TypedDict, total=False): + """Remove the directive.""" + + operation: Required[Literal["set", "remove"]] + """The operation to perform on the cache-control directive.""" + + cloudflare_only: bool + """Whether the directive should only be applied to the Cloudflare CDN cache.""" + + +RuleRulesetsSetCacheControlRuleActionParametersStaleIfError: TypeAlias = Union[ + RuleRulesetsSetCacheControlRuleActionParametersStaleIfErrorSetDirective, + RuleRulesetsSetCacheControlRuleActionParametersStaleIfErrorRemoveDirective, +] + + +class RuleRulesetsSetCacheControlRuleActionParametersStaleWhileRevalidateSetDirective(TypedDict, total=False): + """Set the directive with a duration value in seconds.""" + + operation: Required[Literal["set", "remove"]] + """The operation to perform on the cache-control directive.""" + + value: Required[int] + """The duration value in seconds for the directive.""" + + cloudflare_only: bool + """Whether the directive should only be applied to the Cloudflare CDN cache.""" + + +class RuleRulesetsSetCacheControlRuleActionParametersStaleWhileRevalidateRemoveDirective(TypedDict, total=False): + """Remove the directive.""" + + operation: Required[Literal["set", "remove"]] + """The operation to perform on the cache-control directive.""" + + cloudflare_only: bool + """Whether the directive should only be applied to the Cloudflare CDN cache.""" + + +RuleRulesetsSetCacheControlRuleActionParametersStaleWhileRevalidate: TypeAlias = Union[ + RuleRulesetsSetCacheControlRuleActionParametersStaleWhileRevalidateSetDirective, + RuleRulesetsSetCacheControlRuleActionParametersStaleWhileRevalidateRemoveDirective, +] + + +class RuleRulesetsSetCacheControlRuleActionParameters(TypedDict, total=False): + """The parameters configuring the rule's action.""" + + immutable: RuleRulesetsSetCacheControlRuleActionParametersImmutable + """A cache-control directive configuration.""" + + max_age: Annotated[RuleRulesetsSetCacheControlRuleActionParametersMaxAge, PropertyInfo(alias="max-age")] + """ + A cache-control directive configuration that accepts a duration value in + seconds. + """ + + must_revalidate: Annotated[ + RuleRulesetsSetCacheControlRuleActionParametersMustRevalidate, PropertyInfo(alias="must-revalidate") + ] + """A cache-control directive configuration.""" + + must_understand: Annotated[ + RuleRulesetsSetCacheControlRuleActionParametersMustUnderstand, PropertyInfo(alias="must-understand") + ] + """A cache-control directive configuration.""" + + no_cache: Annotated[RuleRulesetsSetCacheControlRuleActionParametersNoCache, PropertyInfo(alias="no-cache")] + """ + A cache-control directive configuration that accepts optional qualifiers (header + names). + """ + + no_store: Annotated[RuleRulesetsSetCacheControlRuleActionParametersNoStore, PropertyInfo(alias="no-store")] + """A cache-control directive configuration.""" + + no_transform: Annotated[ + RuleRulesetsSetCacheControlRuleActionParametersNoTransform, PropertyInfo(alias="no-transform") + ] + """A cache-control directive configuration.""" + + private: RuleRulesetsSetCacheControlRuleActionParametersPrivate + """ + A cache-control directive configuration that accepts optional qualifiers (header + names). + """ + + proxy_revalidate: Annotated[ + RuleRulesetsSetCacheControlRuleActionParametersProxyRevalidate, PropertyInfo(alias="proxy-revalidate") + ] + """A cache-control directive configuration.""" + + public: RuleRulesetsSetCacheControlRuleActionParametersPublic + """A cache-control directive configuration.""" + + s_maxage: Annotated[RuleRulesetsSetCacheControlRuleActionParametersSMaxage, PropertyInfo(alias="s-maxage")] + """ + A cache-control directive configuration that accepts a duration value in + seconds. + """ + + stale_if_error: Annotated[ + RuleRulesetsSetCacheControlRuleActionParametersStaleIfError, PropertyInfo(alias="stale-if-error") + ] + """ + A cache-control directive configuration that accepts a duration value in + seconds. + """ + + stale_while_revalidate: Annotated[ + RuleRulesetsSetCacheControlRuleActionParametersStaleWhileRevalidate, + PropertyInfo(alias="stale-while-revalidate"), + ] + """ + A cache-control directive configuration that accepts a duration value in + seconds. + """ + + +class RuleRulesetsSetCacheControlRuleExposedCredentialCheck(TypedDict, total=False): + """Configuration for exposed credential checking.""" + + password_expression: Required[str] + """An expression that selects the password used in the credentials check.""" + + username_expression: Required[str] + """An expression that selects the user ID used in the credentials check.""" + + +class RuleRulesetsSetCacheControlRuleRatelimit(TypedDict, total=False): + """An object configuring the rule's rate limit behavior.""" + + characteristics: Required[SequenceNotStr[str]] + """ + Characteristics of the request on which the rate limit counter will be + incremented. + """ + + period: Required[int] + """Period in seconds over which the counter is being incremented.""" + + counting_expression: str + """An expression that defines when the rate limit counter should be incremented. + + It defaults to the same as the rule's expression. + """ + + mitigation_timeout: int + """ + Period of time in seconds after which the action will be disabled following its + first execution. + """ + + requests_per_period: int + """ + The threshold of requests per period after which the action will be executed for + the first time. + """ + + requests_to_origin: bool + """Whether counting is only performed when an origin is reached.""" + + score_per_period: int + """ + The score threshold per period for which the action will be executed the first + time. + """ + + score_response_header_name: str + """ + A response header name provided by the origin, which contains the score to + increment rate limit counter with. + """ + + +class RuleRulesetsSetCacheControlRule(TypedDict, total=False): + id: str + """The unique ID of the rule.""" + + action: Literal["set_cache_control"] + """The action to perform when the rule matches.""" + + action_parameters: RuleRulesetsSetCacheControlRuleActionParameters + """The parameters configuring the rule's action.""" + + description: str + """An informative description of the rule.""" + + enabled: bool + """Whether the rule should be executed.""" + + exposed_credential_check: RuleRulesetsSetCacheControlRuleExposedCredentialCheck + """Configuration for exposed credential checking.""" + + expression: str + """The expression defining which traffic will match the rule.""" + + logging: LoggingParam + """An object configuring the rule's logging behavior.""" + + ratelimit: RuleRulesetsSetCacheControlRuleRatelimit + """An object configuring the rule's rate limit behavior.""" + + ref: str + """The reference of the rule (the rule's ID by default).""" + + +class RuleRulesetsSetCacheTagsRuleActionParametersAddCacheTagsValues(TypedDict, total=False): + """Add cache tags using a list of values.""" + + operation: Required[Literal["add", "remove", "set"]] + """The operation to perform on the cache tags.""" + + values: Required[SequenceNotStr[str]] + """A list of cache tag values.""" + + +class RuleRulesetsSetCacheTagsRuleActionParametersAddCacheTagsExpression(TypedDict, total=False): + """Add cache tags using an expression.""" + + expression: Required[str] + """An expression that evaluates to an array of cache tag values.""" + + operation: Required[Literal["add", "remove", "set"]] + """The operation to perform on the cache tags.""" + + +class RuleRulesetsSetCacheTagsRuleActionParametersRemoveCacheTagsValues(TypedDict, total=False): + """Remove cache tags using a list of values.""" + + operation: Required[Literal["add", "remove", "set"]] + """The operation to perform on the cache tags.""" + + values: Required[SequenceNotStr[str]] + """A list of cache tag values.""" + + +class RuleRulesetsSetCacheTagsRuleActionParametersRemoveCacheTagsExpression(TypedDict, total=False): + """Remove cache tags using an expression.""" + + expression: Required[str] + """An expression that evaluates to an array of cache tag values.""" + + operation: Required[Literal["add", "remove", "set"]] + """The operation to perform on the cache tags.""" + + +class RuleRulesetsSetCacheTagsRuleActionParametersSetCacheTagsValues(TypedDict, total=False): + """Set cache tags using a list of values.""" + + operation: Required[Literal["add", "remove", "set"]] + """The operation to perform on the cache tags.""" + + values: Required[SequenceNotStr[str]] + """A list of cache tag values.""" + + +class RuleRulesetsSetCacheTagsRuleActionParametersSetCacheTagsExpression(TypedDict, total=False): + """Set cache tags using an expression.""" + + expression: Required[str] + """An expression that evaluates to an array of cache tag values.""" + + operation: Required[Literal["add", "remove", "set"]] + """The operation to perform on the cache tags.""" + + +RuleRulesetsSetCacheTagsRuleActionParameters: TypeAlias = Union[ + RuleRulesetsSetCacheTagsRuleActionParametersAddCacheTagsValues, + RuleRulesetsSetCacheTagsRuleActionParametersAddCacheTagsExpression, + RuleRulesetsSetCacheTagsRuleActionParametersRemoveCacheTagsValues, + RuleRulesetsSetCacheTagsRuleActionParametersRemoveCacheTagsExpression, + RuleRulesetsSetCacheTagsRuleActionParametersSetCacheTagsValues, + RuleRulesetsSetCacheTagsRuleActionParametersSetCacheTagsExpression, +] + + +class RuleRulesetsSetCacheTagsRuleExposedCredentialCheck(TypedDict, total=False): + """Configuration for exposed credential checking.""" + + password_expression: Required[str] + """An expression that selects the password used in the credentials check.""" + + username_expression: Required[str] + """An expression that selects the user ID used in the credentials check.""" + + +class RuleRulesetsSetCacheTagsRuleRatelimit(TypedDict, total=False): + """An object configuring the rule's rate limit behavior.""" + + characteristics: Required[SequenceNotStr[str]] + """ + Characteristics of the request on which the rate limit counter will be + incremented. + """ + + period: Required[int] + """Period in seconds over which the counter is being incremented.""" + + counting_expression: str + """An expression that defines when the rate limit counter should be incremented. + + It defaults to the same as the rule's expression. + """ + + mitigation_timeout: int + """ + Period of time in seconds after which the action will be disabled following its + first execution. + """ + + requests_per_period: int + """ + The threshold of requests per period after which the action will be executed for + the first time. + """ + + requests_to_origin: bool + """Whether counting is only performed when an origin is reached.""" + + score_per_period: int + """ + The score threshold per period for which the action will be executed the first + time. + """ + + score_response_header_name: str + """ + A response header name provided by the origin, which contains the score to + increment rate limit counter with. + """ + + +class RuleRulesetsSetCacheTagsRule(TypedDict, total=False): + id: str + """The unique ID of the rule.""" + + action: Literal["set_cache_tags"] + """The action to perform when the rule matches.""" + + action_parameters: RuleRulesetsSetCacheTagsRuleActionParameters + """The parameters configuring the rule's action.""" + + description: str + """An informative description of the rule.""" + + enabled: bool + """Whether the rule should be executed.""" + + exposed_credential_check: RuleRulesetsSetCacheTagsRuleExposedCredentialCheck + """Configuration for exposed credential checking.""" + + expression: str + """The expression defining which traffic will match the rule.""" + + logging: LoggingParam + """An object configuring the rule's logging behavior.""" + + ratelimit: RuleRulesetsSetCacheTagsRuleRatelimit + """An object configuring the rule's rate limit behavior.""" + + ref: str + """The reference of the rule (the rule's ID by default).""" + + Rule: TypeAlias = Union[ BlockRuleParam, RuleRulesetsChallengeRule, @@ -245,7 +981,9 @@ class RuleRulesetsJSChallengeRule(TypedDict, total=False): RouteRuleParam, ScoreRuleParam, ServeErrorRuleParam, + RuleRulesetsSetCacheControlRule, SetCacheSettingsRuleParam, + RuleRulesetsSetCacheTagsRule, SetConfigRuleParam, SkipRuleParam, ] diff --git a/src/cloudflare/types/rulesets/phase_update_response.py b/src/cloudflare/types/rulesets/phase_update_response.py index bae558d023c..9b06f4b181e 100644 --- a/src/cloudflare/types/rulesets/phase_update_response.py +++ b/src/cloudflare/types/rulesets/phase_update_response.py @@ -4,6 +4,8 @@ from datetime import datetime from typing_extensions import Literal, Annotated, TypeAlias +from pydantic import Field as FieldInfo + from .kind import Kind from .phase import Phase from .logging import Logging @@ -35,6 +37,59 @@ "RuleRulesetsJSChallengeRule", "RuleRulesetsJSChallengeRuleExposedCredentialCheck", "RuleRulesetsJSChallengeRuleRatelimit", + "RuleRulesetsSetCacheControlRule", + "RuleRulesetsSetCacheControlRuleActionParameters", + "RuleRulesetsSetCacheControlRuleActionParametersImmutable", + "RuleRulesetsSetCacheControlRuleActionParametersImmutableSetDirective", + "RuleRulesetsSetCacheControlRuleActionParametersImmutableRemoveDirective", + "RuleRulesetsSetCacheControlRuleActionParametersMaxAge", + "RuleRulesetsSetCacheControlRuleActionParametersMaxAgeSetDirective", + "RuleRulesetsSetCacheControlRuleActionParametersMaxAgeRemoveDirective", + "RuleRulesetsSetCacheControlRuleActionParametersMustRevalidate", + "RuleRulesetsSetCacheControlRuleActionParametersMustRevalidateSetDirective", + "RuleRulesetsSetCacheControlRuleActionParametersMustRevalidateRemoveDirective", + "RuleRulesetsSetCacheControlRuleActionParametersMustUnderstand", + "RuleRulesetsSetCacheControlRuleActionParametersMustUnderstandSetDirective", + "RuleRulesetsSetCacheControlRuleActionParametersMustUnderstandRemoveDirective", + "RuleRulesetsSetCacheControlRuleActionParametersNoCache", + "RuleRulesetsSetCacheControlRuleActionParametersNoCacheSetDirective", + "RuleRulesetsSetCacheControlRuleActionParametersNoCacheRemoveDirective", + "RuleRulesetsSetCacheControlRuleActionParametersNoStore", + "RuleRulesetsSetCacheControlRuleActionParametersNoStoreSetDirective", + "RuleRulesetsSetCacheControlRuleActionParametersNoStoreRemoveDirective", + "RuleRulesetsSetCacheControlRuleActionParametersNoTransform", + "RuleRulesetsSetCacheControlRuleActionParametersNoTransformSetDirective", + "RuleRulesetsSetCacheControlRuleActionParametersNoTransformRemoveDirective", + "RuleRulesetsSetCacheControlRuleActionParametersPrivate", + "RuleRulesetsSetCacheControlRuleActionParametersPrivateSetDirective", + "RuleRulesetsSetCacheControlRuleActionParametersPrivateRemoveDirective", + "RuleRulesetsSetCacheControlRuleActionParametersProxyRevalidate", + "RuleRulesetsSetCacheControlRuleActionParametersProxyRevalidateSetDirective", + "RuleRulesetsSetCacheControlRuleActionParametersProxyRevalidateRemoveDirective", + "RuleRulesetsSetCacheControlRuleActionParametersPublic", + "RuleRulesetsSetCacheControlRuleActionParametersPublicSetDirective", + "RuleRulesetsSetCacheControlRuleActionParametersPublicRemoveDirective", + "RuleRulesetsSetCacheControlRuleActionParametersSMaxage", + "RuleRulesetsSetCacheControlRuleActionParametersSMaxageSetDirective", + "RuleRulesetsSetCacheControlRuleActionParametersSMaxageRemoveDirective", + "RuleRulesetsSetCacheControlRuleActionParametersStaleIfError", + "RuleRulesetsSetCacheControlRuleActionParametersStaleIfErrorSetDirective", + "RuleRulesetsSetCacheControlRuleActionParametersStaleIfErrorRemoveDirective", + "RuleRulesetsSetCacheControlRuleActionParametersStaleWhileRevalidate", + "RuleRulesetsSetCacheControlRuleActionParametersStaleWhileRevalidateSetDirective", + "RuleRulesetsSetCacheControlRuleActionParametersStaleWhileRevalidateRemoveDirective", + "RuleRulesetsSetCacheControlRuleExposedCredentialCheck", + "RuleRulesetsSetCacheControlRuleRatelimit", + "RuleRulesetsSetCacheTagsRule", + "RuleRulesetsSetCacheTagsRuleActionParameters", + "RuleRulesetsSetCacheTagsRuleActionParametersAddCacheTagsValues", + "RuleRulesetsSetCacheTagsRuleActionParametersAddCacheTagsExpression", + "RuleRulesetsSetCacheTagsRuleActionParametersRemoveCacheTagsValues", + "RuleRulesetsSetCacheTagsRuleActionParametersRemoveCacheTagsExpression", + "RuleRulesetsSetCacheTagsRuleActionParametersSetCacheTagsValues", + "RuleRulesetsSetCacheTagsRuleActionParametersSetCacheTagsExpression", + "RuleRulesetsSetCacheTagsRuleExposedCredentialCheck", + "RuleRulesetsSetCacheTagsRuleRatelimit", ] @@ -232,6 +287,711 @@ class RuleRulesetsJSChallengeRule(BaseModel): """The reference of the rule (the rule's ID by default).""" +class RuleRulesetsSetCacheControlRuleActionParametersImmutableSetDirective(BaseModel): + """Set the directive.""" + + operation: Literal["set", "remove"] + """The operation to perform on the cache-control directive.""" + + cloudflare_only: Optional[bool] = None + """Whether the directive should only be applied to the Cloudflare CDN cache.""" + + +class RuleRulesetsSetCacheControlRuleActionParametersImmutableRemoveDirective(BaseModel): + """Remove the directive.""" + + operation: Literal["set", "remove"] + """The operation to perform on the cache-control directive.""" + + cloudflare_only: Optional[bool] = None + """Whether the directive should only be applied to the Cloudflare CDN cache.""" + + +RuleRulesetsSetCacheControlRuleActionParametersImmutable: TypeAlias = Union[ + RuleRulesetsSetCacheControlRuleActionParametersImmutableSetDirective, + RuleRulesetsSetCacheControlRuleActionParametersImmutableRemoveDirective, +] + + +class RuleRulesetsSetCacheControlRuleActionParametersMaxAgeSetDirective(BaseModel): + """Set the directive with a duration value in seconds.""" + + operation: Literal["set", "remove"] + """The operation to perform on the cache-control directive.""" + + value: int + """The duration value in seconds for the directive.""" + + cloudflare_only: Optional[bool] = None + """Whether the directive should only be applied to the Cloudflare CDN cache.""" + + +class RuleRulesetsSetCacheControlRuleActionParametersMaxAgeRemoveDirective(BaseModel): + """Remove the directive.""" + + operation: Literal["set", "remove"] + """The operation to perform on the cache-control directive.""" + + cloudflare_only: Optional[bool] = None + """Whether the directive should only be applied to the Cloudflare CDN cache.""" + + +RuleRulesetsSetCacheControlRuleActionParametersMaxAge: TypeAlias = Union[ + RuleRulesetsSetCacheControlRuleActionParametersMaxAgeSetDirective, + RuleRulesetsSetCacheControlRuleActionParametersMaxAgeRemoveDirective, +] + + +class RuleRulesetsSetCacheControlRuleActionParametersMustRevalidateSetDirective(BaseModel): + """Set the directive.""" + + operation: Literal["set", "remove"] + """The operation to perform on the cache-control directive.""" + + cloudflare_only: Optional[bool] = None + """Whether the directive should only be applied to the Cloudflare CDN cache.""" + + +class RuleRulesetsSetCacheControlRuleActionParametersMustRevalidateRemoveDirective(BaseModel): + """Remove the directive.""" + + operation: Literal["set", "remove"] + """The operation to perform on the cache-control directive.""" + + cloudflare_only: Optional[bool] = None + """Whether the directive should only be applied to the Cloudflare CDN cache.""" + + +RuleRulesetsSetCacheControlRuleActionParametersMustRevalidate: TypeAlias = Union[ + RuleRulesetsSetCacheControlRuleActionParametersMustRevalidateSetDirective, + RuleRulesetsSetCacheControlRuleActionParametersMustRevalidateRemoveDirective, +] + + +class RuleRulesetsSetCacheControlRuleActionParametersMustUnderstandSetDirective(BaseModel): + """Set the directive.""" + + operation: Literal["set", "remove"] + """The operation to perform on the cache-control directive.""" + + cloudflare_only: Optional[bool] = None + """Whether the directive should only be applied to the Cloudflare CDN cache.""" + + +class RuleRulesetsSetCacheControlRuleActionParametersMustUnderstandRemoveDirective(BaseModel): + """Remove the directive.""" + + operation: Literal["set", "remove"] + """The operation to perform on the cache-control directive.""" + + cloudflare_only: Optional[bool] = None + """Whether the directive should only be applied to the Cloudflare CDN cache.""" + + +RuleRulesetsSetCacheControlRuleActionParametersMustUnderstand: TypeAlias = Union[ + RuleRulesetsSetCacheControlRuleActionParametersMustUnderstandSetDirective, + RuleRulesetsSetCacheControlRuleActionParametersMustUnderstandRemoveDirective, +] + + +class RuleRulesetsSetCacheControlRuleActionParametersNoCacheSetDirective(BaseModel): + """Set the directive with optional qualifiers.""" + + operation: Literal["set", "remove"] + """The operation to perform on the cache-control directive.""" + + cloudflare_only: Optional[bool] = None + """Whether the directive should only be applied to the Cloudflare CDN cache.""" + + qualifiers: Optional[List[str]] = None + """ + Optional list of header names to qualify the directive (e.g., for "private" or + "no-cache" directives). + """ + + +class RuleRulesetsSetCacheControlRuleActionParametersNoCacheRemoveDirective(BaseModel): + """Remove the directive.""" + + operation: Literal["set", "remove"] + """The operation to perform on the cache-control directive.""" + + cloudflare_only: Optional[bool] = None + """Whether the directive should only be applied to the Cloudflare CDN cache.""" + + +RuleRulesetsSetCacheControlRuleActionParametersNoCache: TypeAlias = Union[ + RuleRulesetsSetCacheControlRuleActionParametersNoCacheSetDirective, + RuleRulesetsSetCacheControlRuleActionParametersNoCacheRemoveDirective, +] + + +class RuleRulesetsSetCacheControlRuleActionParametersNoStoreSetDirective(BaseModel): + """Set the directive.""" + + operation: Literal["set", "remove"] + """The operation to perform on the cache-control directive.""" + + cloudflare_only: Optional[bool] = None + """Whether the directive should only be applied to the Cloudflare CDN cache.""" + + +class RuleRulesetsSetCacheControlRuleActionParametersNoStoreRemoveDirective(BaseModel): + """Remove the directive.""" + + operation: Literal["set", "remove"] + """The operation to perform on the cache-control directive.""" + + cloudflare_only: Optional[bool] = None + """Whether the directive should only be applied to the Cloudflare CDN cache.""" + + +RuleRulesetsSetCacheControlRuleActionParametersNoStore: TypeAlias = Union[ + RuleRulesetsSetCacheControlRuleActionParametersNoStoreSetDirective, + RuleRulesetsSetCacheControlRuleActionParametersNoStoreRemoveDirective, +] + + +class RuleRulesetsSetCacheControlRuleActionParametersNoTransformSetDirective(BaseModel): + """Set the directive.""" + + operation: Literal["set", "remove"] + """The operation to perform on the cache-control directive.""" + + cloudflare_only: Optional[bool] = None + """Whether the directive should only be applied to the Cloudflare CDN cache.""" + + +class RuleRulesetsSetCacheControlRuleActionParametersNoTransformRemoveDirective(BaseModel): + """Remove the directive.""" + + operation: Literal["set", "remove"] + """The operation to perform on the cache-control directive.""" + + cloudflare_only: Optional[bool] = None + """Whether the directive should only be applied to the Cloudflare CDN cache.""" + + +RuleRulesetsSetCacheControlRuleActionParametersNoTransform: TypeAlias = Union[ + RuleRulesetsSetCacheControlRuleActionParametersNoTransformSetDirective, + RuleRulesetsSetCacheControlRuleActionParametersNoTransformRemoveDirective, +] + + +class RuleRulesetsSetCacheControlRuleActionParametersPrivateSetDirective(BaseModel): + """Set the directive with optional qualifiers.""" + + operation: Literal["set", "remove"] + """The operation to perform on the cache-control directive.""" + + cloudflare_only: Optional[bool] = None + """Whether the directive should only be applied to the Cloudflare CDN cache.""" + + qualifiers: Optional[List[str]] = None + """ + Optional list of header names to qualify the directive (e.g., for "private" or + "no-cache" directives). + """ + + +class RuleRulesetsSetCacheControlRuleActionParametersPrivateRemoveDirective(BaseModel): + """Remove the directive.""" + + operation: Literal["set", "remove"] + """The operation to perform on the cache-control directive.""" + + cloudflare_only: Optional[bool] = None + """Whether the directive should only be applied to the Cloudflare CDN cache.""" + + +RuleRulesetsSetCacheControlRuleActionParametersPrivate: TypeAlias = Union[ + RuleRulesetsSetCacheControlRuleActionParametersPrivateSetDirective, + RuleRulesetsSetCacheControlRuleActionParametersPrivateRemoveDirective, +] + + +class RuleRulesetsSetCacheControlRuleActionParametersProxyRevalidateSetDirective(BaseModel): + """Set the directive.""" + + operation: Literal["set", "remove"] + """The operation to perform on the cache-control directive.""" + + cloudflare_only: Optional[bool] = None + """Whether the directive should only be applied to the Cloudflare CDN cache.""" + + +class RuleRulesetsSetCacheControlRuleActionParametersProxyRevalidateRemoveDirective(BaseModel): + """Remove the directive.""" + + operation: Literal["set", "remove"] + """The operation to perform on the cache-control directive.""" + + cloudflare_only: Optional[bool] = None + """Whether the directive should only be applied to the Cloudflare CDN cache.""" + + +RuleRulesetsSetCacheControlRuleActionParametersProxyRevalidate: TypeAlias = Union[ + RuleRulesetsSetCacheControlRuleActionParametersProxyRevalidateSetDirective, + RuleRulesetsSetCacheControlRuleActionParametersProxyRevalidateRemoveDirective, +] + + +class RuleRulesetsSetCacheControlRuleActionParametersPublicSetDirective(BaseModel): + """Set the directive.""" + + operation: Literal["set", "remove"] + """The operation to perform on the cache-control directive.""" + + cloudflare_only: Optional[bool] = None + """Whether the directive should only be applied to the Cloudflare CDN cache.""" + + +class RuleRulesetsSetCacheControlRuleActionParametersPublicRemoveDirective(BaseModel): + """Remove the directive.""" + + operation: Literal["set", "remove"] + """The operation to perform on the cache-control directive.""" + + cloudflare_only: Optional[bool] = None + """Whether the directive should only be applied to the Cloudflare CDN cache.""" + + +RuleRulesetsSetCacheControlRuleActionParametersPublic: TypeAlias = Union[ + RuleRulesetsSetCacheControlRuleActionParametersPublicSetDirective, + RuleRulesetsSetCacheControlRuleActionParametersPublicRemoveDirective, +] + + +class RuleRulesetsSetCacheControlRuleActionParametersSMaxageSetDirective(BaseModel): + """Set the directive with a duration value in seconds.""" + + operation: Literal["set", "remove"] + """The operation to perform on the cache-control directive.""" + + value: int + """The duration value in seconds for the directive.""" + + cloudflare_only: Optional[bool] = None + """Whether the directive should only be applied to the Cloudflare CDN cache.""" + + +class RuleRulesetsSetCacheControlRuleActionParametersSMaxageRemoveDirective(BaseModel): + """Remove the directive.""" + + operation: Literal["set", "remove"] + """The operation to perform on the cache-control directive.""" + + cloudflare_only: Optional[bool] = None + """Whether the directive should only be applied to the Cloudflare CDN cache.""" + + +RuleRulesetsSetCacheControlRuleActionParametersSMaxage: TypeAlias = Union[ + RuleRulesetsSetCacheControlRuleActionParametersSMaxageSetDirective, + RuleRulesetsSetCacheControlRuleActionParametersSMaxageRemoveDirective, +] + + +class RuleRulesetsSetCacheControlRuleActionParametersStaleIfErrorSetDirective(BaseModel): + """Set the directive with a duration value in seconds.""" + + operation: Literal["set", "remove"] + """The operation to perform on the cache-control directive.""" + + value: int + """The duration value in seconds for the directive.""" + + cloudflare_only: Optional[bool] = None + """Whether the directive should only be applied to the Cloudflare CDN cache.""" + + +class RuleRulesetsSetCacheControlRuleActionParametersStaleIfErrorRemoveDirective(BaseModel): + """Remove the directive.""" + + operation: Literal["set", "remove"] + """The operation to perform on the cache-control directive.""" + + cloudflare_only: Optional[bool] = None + """Whether the directive should only be applied to the Cloudflare CDN cache.""" + + +RuleRulesetsSetCacheControlRuleActionParametersStaleIfError: TypeAlias = Union[ + RuleRulesetsSetCacheControlRuleActionParametersStaleIfErrorSetDirective, + RuleRulesetsSetCacheControlRuleActionParametersStaleIfErrorRemoveDirective, +] + + +class RuleRulesetsSetCacheControlRuleActionParametersStaleWhileRevalidateSetDirective(BaseModel): + """Set the directive with a duration value in seconds.""" + + operation: Literal["set", "remove"] + """The operation to perform on the cache-control directive.""" + + value: int + """The duration value in seconds for the directive.""" + + cloudflare_only: Optional[bool] = None + """Whether the directive should only be applied to the Cloudflare CDN cache.""" + + +class RuleRulesetsSetCacheControlRuleActionParametersStaleWhileRevalidateRemoveDirective(BaseModel): + """Remove the directive.""" + + operation: Literal["set", "remove"] + """The operation to perform on the cache-control directive.""" + + cloudflare_only: Optional[bool] = None + """Whether the directive should only be applied to the Cloudflare CDN cache.""" + + +RuleRulesetsSetCacheControlRuleActionParametersStaleWhileRevalidate: TypeAlias = Union[ + RuleRulesetsSetCacheControlRuleActionParametersStaleWhileRevalidateSetDirective, + RuleRulesetsSetCacheControlRuleActionParametersStaleWhileRevalidateRemoveDirective, +] + + +class RuleRulesetsSetCacheControlRuleActionParameters(BaseModel): + """The parameters configuring the rule's action.""" + + immutable: Optional[RuleRulesetsSetCacheControlRuleActionParametersImmutable] = None + """A cache-control directive configuration.""" + + max_age: Optional[RuleRulesetsSetCacheControlRuleActionParametersMaxAge] = FieldInfo(alias="max-age", default=None) + """ + A cache-control directive configuration that accepts a duration value in + seconds. + """ + + must_revalidate: Optional[RuleRulesetsSetCacheControlRuleActionParametersMustRevalidate] = FieldInfo( + alias="must-revalidate", default=None + ) + """A cache-control directive configuration.""" + + must_understand: Optional[RuleRulesetsSetCacheControlRuleActionParametersMustUnderstand] = FieldInfo( + alias="must-understand", default=None + ) + """A cache-control directive configuration.""" + + no_cache: Optional[RuleRulesetsSetCacheControlRuleActionParametersNoCache] = FieldInfo( + alias="no-cache", default=None + ) + """ + A cache-control directive configuration that accepts optional qualifiers (header + names). + """ + + no_store: Optional[RuleRulesetsSetCacheControlRuleActionParametersNoStore] = FieldInfo( + alias="no-store", default=None + ) + """A cache-control directive configuration.""" + + no_transform: Optional[RuleRulesetsSetCacheControlRuleActionParametersNoTransform] = FieldInfo( + alias="no-transform", default=None + ) + """A cache-control directive configuration.""" + + private: Optional[RuleRulesetsSetCacheControlRuleActionParametersPrivate] = None + """ + A cache-control directive configuration that accepts optional qualifiers (header + names). + """ + + proxy_revalidate: Optional[RuleRulesetsSetCacheControlRuleActionParametersProxyRevalidate] = FieldInfo( + alias="proxy-revalidate", default=None + ) + """A cache-control directive configuration.""" + + public: Optional[RuleRulesetsSetCacheControlRuleActionParametersPublic] = None + """A cache-control directive configuration.""" + + s_maxage: Optional[RuleRulesetsSetCacheControlRuleActionParametersSMaxage] = FieldInfo( + alias="s-maxage", default=None + ) + """ + A cache-control directive configuration that accepts a duration value in + seconds. + """ + + stale_if_error: Optional[RuleRulesetsSetCacheControlRuleActionParametersStaleIfError] = FieldInfo( + alias="stale-if-error", default=None + ) + """ + A cache-control directive configuration that accepts a duration value in + seconds. + """ + + stale_while_revalidate: Optional[RuleRulesetsSetCacheControlRuleActionParametersStaleWhileRevalidate] = FieldInfo( + alias="stale-while-revalidate", default=None + ) + """ + A cache-control directive configuration that accepts a duration value in + seconds. + """ + + +class RuleRulesetsSetCacheControlRuleExposedCredentialCheck(BaseModel): + """Configuration for exposed credential checking.""" + + password_expression: str + """An expression that selects the password used in the credentials check.""" + + username_expression: str + """An expression that selects the user ID used in the credentials check.""" + + +class RuleRulesetsSetCacheControlRuleRatelimit(BaseModel): + """An object configuring the rule's rate limit behavior.""" + + characteristics: List[str] + """ + Characteristics of the request on which the rate limit counter will be + incremented. + """ + + period: int + """Period in seconds over which the counter is being incremented.""" + + counting_expression: Optional[str] = None + """An expression that defines when the rate limit counter should be incremented. + + It defaults to the same as the rule's expression. + """ + + mitigation_timeout: Optional[int] = None + """ + Period of time in seconds after which the action will be disabled following its + first execution. + """ + + requests_per_period: Optional[int] = None + """ + The threshold of requests per period after which the action will be executed for + the first time. + """ + + requests_to_origin: Optional[bool] = None + """Whether counting is only performed when an origin is reached.""" + + score_per_period: Optional[int] = None + """ + The score threshold per period for which the action will be executed the first + time. + """ + + score_response_header_name: Optional[str] = None + """ + A response header name provided by the origin, which contains the score to + increment rate limit counter with. + """ + + +class RuleRulesetsSetCacheControlRule(BaseModel): + last_updated: datetime + """The timestamp of when the rule was last modified.""" + + version: str + """The version of the rule.""" + + id: Optional[str] = None + """The unique ID of the rule.""" + + action: Optional[Literal["set_cache_control"]] = None + """The action to perform when the rule matches.""" + + action_parameters: Optional[RuleRulesetsSetCacheControlRuleActionParameters] = None + """The parameters configuring the rule's action.""" + + categories: Optional[List[str]] = None + """The categories of the rule.""" + + description: Optional[str] = None + """An informative description of the rule.""" + + enabled: Optional[bool] = None + """Whether the rule should be executed.""" + + exposed_credential_check: Optional[RuleRulesetsSetCacheControlRuleExposedCredentialCheck] = None + """Configuration for exposed credential checking.""" + + expression: Optional[str] = None + """The expression defining which traffic will match the rule.""" + + logging: Optional[Logging] = None + """An object configuring the rule's logging behavior.""" + + ratelimit: Optional[RuleRulesetsSetCacheControlRuleRatelimit] = None + """An object configuring the rule's rate limit behavior.""" + + ref: Optional[str] = None + """The reference of the rule (the rule's ID by default).""" + + +class RuleRulesetsSetCacheTagsRuleActionParametersAddCacheTagsValues(BaseModel): + """Add cache tags using a list of values.""" + + operation: Literal["add", "remove", "set"] + """The operation to perform on the cache tags.""" + + values: List[str] + """A list of cache tag values.""" + + +class RuleRulesetsSetCacheTagsRuleActionParametersAddCacheTagsExpression(BaseModel): + """Add cache tags using an expression.""" + + expression: str + """An expression that evaluates to an array of cache tag values.""" + + operation: Literal["add", "remove", "set"] + """The operation to perform on the cache tags.""" + + +class RuleRulesetsSetCacheTagsRuleActionParametersRemoveCacheTagsValues(BaseModel): + """Remove cache tags using a list of values.""" + + operation: Literal["add", "remove", "set"] + """The operation to perform on the cache tags.""" + + values: List[str] + """A list of cache tag values.""" + + +class RuleRulesetsSetCacheTagsRuleActionParametersRemoveCacheTagsExpression(BaseModel): + """Remove cache tags using an expression.""" + + expression: str + """An expression that evaluates to an array of cache tag values.""" + + operation: Literal["add", "remove", "set"] + """The operation to perform on the cache tags.""" + + +class RuleRulesetsSetCacheTagsRuleActionParametersSetCacheTagsValues(BaseModel): + """Set cache tags using a list of values.""" + + operation: Literal["add", "remove", "set"] + """The operation to perform on the cache tags.""" + + values: List[str] + """A list of cache tag values.""" + + +class RuleRulesetsSetCacheTagsRuleActionParametersSetCacheTagsExpression(BaseModel): + """Set cache tags using an expression.""" + + expression: str + """An expression that evaluates to an array of cache tag values.""" + + operation: Literal["add", "remove", "set"] + """The operation to perform on the cache tags.""" + + +RuleRulesetsSetCacheTagsRuleActionParameters: TypeAlias = Union[ + RuleRulesetsSetCacheTagsRuleActionParametersAddCacheTagsValues, + RuleRulesetsSetCacheTagsRuleActionParametersAddCacheTagsExpression, + RuleRulesetsSetCacheTagsRuleActionParametersRemoveCacheTagsValues, + RuleRulesetsSetCacheTagsRuleActionParametersRemoveCacheTagsExpression, + RuleRulesetsSetCacheTagsRuleActionParametersSetCacheTagsValues, + RuleRulesetsSetCacheTagsRuleActionParametersSetCacheTagsExpression, +] + + +class RuleRulesetsSetCacheTagsRuleExposedCredentialCheck(BaseModel): + """Configuration for exposed credential checking.""" + + password_expression: str + """An expression that selects the password used in the credentials check.""" + + username_expression: str + """An expression that selects the user ID used in the credentials check.""" + + +class RuleRulesetsSetCacheTagsRuleRatelimit(BaseModel): + """An object configuring the rule's rate limit behavior.""" + + characteristics: List[str] + """ + Characteristics of the request on which the rate limit counter will be + incremented. + """ + + period: int + """Period in seconds over which the counter is being incremented.""" + + counting_expression: Optional[str] = None + """An expression that defines when the rate limit counter should be incremented. + + It defaults to the same as the rule's expression. + """ + + mitigation_timeout: Optional[int] = None + """ + Period of time in seconds after which the action will be disabled following its + first execution. + """ + + requests_per_period: Optional[int] = None + """ + The threshold of requests per period after which the action will be executed for + the first time. + """ + + requests_to_origin: Optional[bool] = None + """Whether counting is only performed when an origin is reached.""" + + score_per_period: Optional[int] = None + """ + The score threshold per period for which the action will be executed the first + time. + """ + + score_response_header_name: Optional[str] = None + """ + A response header name provided by the origin, which contains the score to + increment rate limit counter with. + """ + + +class RuleRulesetsSetCacheTagsRule(BaseModel): + last_updated: datetime + """The timestamp of when the rule was last modified.""" + + version: str + """The version of the rule.""" + + id: Optional[str] = None + """The unique ID of the rule.""" + + action: Optional[Literal["set_cache_tags"]] = None + """The action to perform when the rule matches.""" + + action_parameters: Optional[RuleRulesetsSetCacheTagsRuleActionParameters] = None + """The parameters configuring the rule's action.""" + + categories: Optional[List[str]] = None + """The categories of the rule.""" + + description: Optional[str] = None + """An informative description of the rule.""" + + enabled: Optional[bool] = None + """Whether the rule should be executed.""" + + exposed_credential_check: Optional[RuleRulesetsSetCacheTagsRuleExposedCredentialCheck] = None + """Configuration for exposed credential checking.""" + + expression: Optional[str] = None + """The expression defining which traffic will match the rule.""" + + logging: Optional[Logging] = None + """An object configuring the rule's logging behavior.""" + + ratelimit: Optional[RuleRulesetsSetCacheTagsRuleRatelimit] = None + """An object configuring the rule's rate limit behavior.""" + + ref: Optional[str] = None + """The reference of the rule (the rule's ID by default).""" + + Rule: TypeAlias = Annotated[ Union[ BlockRule, @@ -249,7 +1009,9 @@ class RuleRulesetsJSChallengeRule(BaseModel): RouteRule, ScoreRule, ServeErrorRule, + RuleRulesetsSetCacheControlRule, SetCacheSettingsRule, + RuleRulesetsSetCacheTagsRule, SetConfigRule, SkipRule, ], diff --git a/src/cloudflare/types/rulesets/phases/version_get_response.py b/src/cloudflare/types/rulesets/phases/version_get_response.py index 1f7a8e398c8..d6f80e98ed8 100644 --- a/src/cloudflare/types/rulesets/phases/version_get_response.py +++ b/src/cloudflare/types/rulesets/phases/version_get_response.py @@ -4,6 +4,8 @@ from datetime import datetime from typing_extensions import Literal, Annotated, TypeAlias +from pydantic import Field as FieldInfo + from ..kind import Kind from ..phase import Phase from ..logging import Logging @@ -35,6 +37,59 @@ "RuleRulesetsJSChallengeRule", "RuleRulesetsJSChallengeRuleExposedCredentialCheck", "RuleRulesetsJSChallengeRuleRatelimit", + "RuleRulesetsSetCacheControlRule", + "RuleRulesetsSetCacheControlRuleActionParameters", + "RuleRulesetsSetCacheControlRuleActionParametersImmutable", + "RuleRulesetsSetCacheControlRuleActionParametersImmutableSetDirective", + "RuleRulesetsSetCacheControlRuleActionParametersImmutableRemoveDirective", + "RuleRulesetsSetCacheControlRuleActionParametersMaxAge", + "RuleRulesetsSetCacheControlRuleActionParametersMaxAgeSetDirective", + "RuleRulesetsSetCacheControlRuleActionParametersMaxAgeRemoveDirective", + "RuleRulesetsSetCacheControlRuleActionParametersMustRevalidate", + "RuleRulesetsSetCacheControlRuleActionParametersMustRevalidateSetDirective", + "RuleRulesetsSetCacheControlRuleActionParametersMustRevalidateRemoveDirective", + "RuleRulesetsSetCacheControlRuleActionParametersMustUnderstand", + "RuleRulesetsSetCacheControlRuleActionParametersMustUnderstandSetDirective", + "RuleRulesetsSetCacheControlRuleActionParametersMustUnderstandRemoveDirective", + "RuleRulesetsSetCacheControlRuleActionParametersNoCache", + "RuleRulesetsSetCacheControlRuleActionParametersNoCacheSetDirective", + "RuleRulesetsSetCacheControlRuleActionParametersNoCacheRemoveDirective", + "RuleRulesetsSetCacheControlRuleActionParametersNoStore", + "RuleRulesetsSetCacheControlRuleActionParametersNoStoreSetDirective", + "RuleRulesetsSetCacheControlRuleActionParametersNoStoreRemoveDirective", + "RuleRulesetsSetCacheControlRuleActionParametersNoTransform", + "RuleRulesetsSetCacheControlRuleActionParametersNoTransformSetDirective", + "RuleRulesetsSetCacheControlRuleActionParametersNoTransformRemoveDirective", + "RuleRulesetsSetCacheControlRuleActionParametersPrivate", + "RuleRulesetsSetCacheControlRuleActionParametersPrivateSetDirective", + "RuleRulesetsSetCacheControlRuleActionParametersPrivateRemoveDirective", + "RuleRulesetsSetCacheControlRuleActionParametersProxyRevalidate", + "RuleRulesetsSetCacheControlRuleActionParametersProxyRevalidateSetDirective", + "RuleRulesetsSetCacheControlRuleActionParametersProxyRevalidateRemoveDirective", + "RuleRulesetsSetCacheControlRuleActionParametersPublic", + "RuleRulesetsSetCacheControlRuleActionParametersPublicSetDirective", + "RuleRulesetsSetCacheControlRuleActionParametersPublicRemoveDirective", + "RuleRulesetsSetCacheControlRuleActionParametersSMaxage", + "RuleRulesetsSetCacheControlRuleActionParametersSMaxageSetDirective", + "RuleRulesetsSetCacheControlRuleActionParametersSMaxageRemoveDirective", + "RuleRulesetsSetCacheControlRuleActionParametersStaleIfError", + "RuleRulesetsSetCacheControlRuleActionParametersStaleIfErrorSetDirective", + "RuleRulesetsSetCacheControlRuleActionParametersStaleIfErrorRemoveDirective", + "RuleRulesetsSetCacheControlRuleActionParametersStaleWhileRevalidate", + "RuleRulesetsSetCacheControlRuleActionParametersStaleWhileRevalidateSetDirective", + "RuleRulesetsSetCacheControlRuleActionParametersStaleWhileRevalidateRemoveDirective", + "RuleRulesetsSetCacheControlRuleExposedCredentialCheck", + "RuleRulesetsSetCacheControlRuleRatelimit", + "RuleRulesetsSetCacheTagsRule", + "RuleRulesetsSetCacheTagsRuleActionParameters", + "RuleRulesetsSetCacheTagsRuleActionParametersAddCacheTagsValues", + "RuleRulesetsSetCacheTagsRuleActionParametersAddCacheTagsExpression", + "RuleRulesetsSetCacheTagsRuleActionParametersRemoveCacheTagsValues", + "RuleRulesetsSetCacheTagsRuleActionParametersRemoveCacheTagsExpression", + "RuleRulesetsSetCacheTagsRuleActionParametersSetCacheTagsValues", + "RuleRulesetsSetCacheTagsRuleActionParametersSetCacheTagsExpression", + "RuleRulesetsSetCacheTagsRuleExposedCredentialCheck", + "RuleRulesetsSetCacheTagsRuleRatelimit", ] @@ -232,6 +287,711 @@ class RuleRulesetsJSChallengeRule(BaseModel): """The reference of the rule (the rule's ID by default).""" +class RuleRulesetsSetCacheControlRuleActionParametersImmutableSetDirective(BaseModel): + """Set the directive.""" + + operation: Literal["set", "remove"] + """The operation to perform on the cache-control directive.""" + + cloudflare_only: Optional[bool] = None + """Whether the directive should only be applied to the Cloudflare CDN cache.""" + + +class RuleRulesetsSetCacheControlRuleActionParametersImmutableRemoveDirective(BaseModel): + """Remove the directive.""" + + operation: Literal["set", "remove"] + """The operation to perform on the cache-control directive.""" + + cloudflare_only: Optional[bool] = None + """Whether the directive should only be applied to the Cloudflare CDN cache.""" + + +RuleRulesetsSetCacheControlRuleActionParametersImmutable: TypeAlias = Union[ + RuleRulesetsSetCacheControlRuleActionParametersImmutableSetDirective, + RuleRulesetsSetCacheControlRuleActionParametersImmutableRemoveDirective, +] + + +class RuleRulesetsSetCacheControlRuleActionParametersMaxAgeSetDirective(BaseModel): + """Set the directive with a duration value in seconds.""" + + operation: Literal["set", "remove"] + """The operation to perform on the cache-control directive.""" + + value: int + """The duration value in seconds for the directive.""" + + cloudflare_only: Optional[bool] = None + """Whether the directive should only be applied to the Cloudflare CDN cache.""" + + +class RuleRulesetsSetCacheControlRuleActionParametersMaxAgeRemoveDirective(BaseModel): + """Remove the directive.""" + + operation: Literal["set", "remove"] + """The operation to perform on the cache-control directive.""" + + cloudflare_only: Optional[bool] = None + """Whether the directive should only be applied to the Cloudflare CDN cache.""" + + +RuleRulesetsSetCacheControlRuleActionParametersMaxAge: TypeAlias = Union[ + RuleRulesetsSetCacheControlRuleActionParametersMaxAgeSetDirective, + RuleRulesetsSetCacheControlRuleActionParametersMaxAgeRemoveDirective, +] + + +class RuleRulesetsSetCacheControlRuleActionParametersMustRevalidateSetDirective(BaseModel): + """Set the directive.""" + + operation: Literal["set", "remove"] + """The operation to perform on the cache-control directive.""" + + cloudflare_only: Optional[bool] = None + """Whether the directive should only be applied to the Cloudflare CDN cache.""" + + +class RuleRulesetsSetCacheControlRuleActionParametersMustRevalidateRemoveDirective(BaseModel): + """Remove the directive.""" + + operation: Literal["set", "remove"] + """The operation to perform on the cache-control directive.""" + + cloudflare_only: Optional[bool] = None + """Whether the directive should only be applied to the Cloudflare CDN cache.""" + + +RuleRulesetsSetCacheControlRuleActionParametersMustRevalidate: TypeAlias = Union[ + RuleRulesetsSetCacheControlRuleActionParametersMustRevalidateSetDirective, + RuleRulesetsSetCacheControlRuleActionParametersMustRevalidateRemoveDirective, +] + + +class RuleRulesetsSetCacheControlRuleActionParametersMustUnderstandSetDirective(BaseModel): + """Set the directive.""" + + operation: Literal["set", "remove"] + """The operation to perform on the cache-control directive.""" + + cloudflare_only: Optional[bool] = None + """Whether the directive should only be applied to the Cloudflare CDN cache.""" + + +class RuleRulesetsSetCacheControlRuleActionParametersMustUnderstandRemoveDirective(BaseModel): + """Remove the directive.""" + + operation: Literal["set", "remove"] + """The operation to perform on the cache-control directive.""" + + cloudflare_only: Optional[bool] = None + """Whether the directive should only be applied to the Cloudflare CDN cache.""" + + +RuleRulesetsSetCacheControlRuleActionParametersMustUnderstand: TypeAlias = Union[ + RuleRulesetsSetCacheControlRuleActionParametersMustUnderstandSetDirective, + RuleRulesetsSetCacheControlRuleActionParametersMustUnderstandRemoveDirective, +] + + +class RuleRulesetsSetCacheControlRuleActionParametersNoCacheSetDirective(BaseModel): + """Set the directive with optional qualifiers.""" + + operation: Literal["set", "remove"] + """The operation to perform on the cache-control directive.""" + + cloudflare_only: Optional[bool] = None + """Whether the directive should only be applied to the Cloudflare CDN cache.""" + + qualifiers: Optional[List[str]] = None + """ + Optional list of header names to qualify the directive (e.g., for "private" or + "no-cache" directives). + """ + + +class RuleRulesetsSetCacheControlRuleActionParametersNoCacheRemoveDirective(BaseModel): + """Remove the directive.""" + + operation: Literal["set", "remove"] + """The operation to perform on the cache-control directive.""" + + cloudflare_only: Optional[bool] = None + """Whether the directive should only be applied to the Cloudflare CDN cache.""" + + +RuleRulesetsSetCacheControlRuleActionParametersNoCache: TypeAlias = Union[ + RuleRulesetsSetCacheControlRuleActionParametersNoCacheSetDirective, + RuleRulesetsSetCacheControlRuleActionParametersNoCacheRemoveDirective, +] + + +class RuleRulesetsSetCacheControlRuleActionParametersNoStoreSetDirective(BaseModel): + """Set the directive.""" + + operation: Literal["set", "remove"] + """The operation to perform on the cache-control directive.""" + + cloudflare_only: Optional[bool] = None + """Whether the directive should only be applied to the Cloudflare CDN cache.""" + + +class RuleRulesetsSetCacheControlRuleActionParametersNoStoreRemoveDirective(BaseModel): + """Remove the directive.""" + + operation: Literal["set", "remove"] + """The operation to perform on the cache-control directive.""" + + cloudflare_only: Optional[bool] = None + """Whether the directive should only be applied to the Cloudflare CDN cache.""" + + +RuleRulesetsSetCacheControlRuleActionParametersNoStore: TypeAlias = Union[ + RuleRulesetsSetCacheControlRuleActionParametersNoStoreSetDirective, + RuleRulesetsSetCacheControlRuleActionParametersNoStoreRemoveDirective, +] + + +class RuleRulesetsSetCacheControlRuleActionParametersNoTransformSetDirective(BaseModel): + """Set the directive.""" + + operation: Literal["set", "remove"] + """The operation to perform on the cache-control directive.""" + + cloudflare_only: Optional[bool] = None + """Whether the directive should only be applied to the Cloudflare CDN cache.""" + + +class RuleRulesetsSetCacheControlRuleActionParametersNoTransformRemoveDirective(BaseModel): + """Remove the directive.""" + + operation: Literal["set", "remove"] + """The operation to perform on the cache-control directive.""" + + cloudflare_only: Optional[bool] = None + """Whether the directive should only be applied to the Cloudflare CDN cache.""" + + +RuleRulesetsSetCacheControlRuleActionParametersNoTransform: TypeAlias = Union[ + RuleRulesetsSetCacheControlRuleActionParametersNoTransformSetDirective, + RuleRulesetsSetCacheControlRuleActionParametersNoTransformRemoveDirective, +] + + +class RuleRulesetsSetCacheControlRuleActionParametersPrivateSetDirective(BaseModel): + """Set the directive with optional qualifiers.""" + + operation: Literal["set", "remove"] + """The operation to perform on the cache-control directive.""" + + cloudflare_only: Optional[bool] = None + """Whether the directive should only be applied to the Cloudflare CDN cache.""" + + qualifiers: Optional[List[str]] = None + """ + Optional list of header names to qualify the directive (e.g., for "private" or + "no-cache" directives). + """ + + +class RuleRulesetsSetCacheControlRuleActionParametersPrivateRemoveDirective(BaseModel): + """Remove the directive.""" + + operation: Literal["set", "remove"] + """The operation to perform on the cache-control directive.""" + + cloudflare_only: Optional[bool] = None + """Whether the directive should only be applied to the Cloudflare CDN cache.""" + + +RuleRulesetsSetCacheControlRuleActionParametersPrivate: TypeAlias = Union[ + RuleRulesetsSetCacheControlRuleActionParametersPrivateSetDirective, + RuleRulesetsSetCacheControlRuleActionParametersPrivateRemoveDirective, +] + + +class RuleRulesetsSetCacheControlRuleActionParametersProxyRevalidateSetDirective(BaseModel): + """Set the directive.""" + + operation: Literal["set", "remove"] + """The operation to perform on the cache-control directive.""" + + cloudflare_only: Optional[bool] = None + """Whether the directive should only be applied to the Cloudflare CDN cache.""" + + +class RuleRulesetsSetCacheControlRuleActionParametersProxyRevalidateRemoveDirective(BaseModel): + """Remove the directive.""" + + operation: Literal["set", "remove"] + """The operation to perform on the cache-control directive.""" + + cloudflare_only: Optional[bool] = None + """Whether the directive should only be applied to the Cloudflare CDN cache.""" + + +RuleRulesetsSetCacheControlRuleActionParametersProxyRevalidate: TypeAlias = Union[ + RuleRulesetsSetCacheControlRuleActionParametersProxyRevalidateSetDirective, + RuleRulesetsSetCacheControlRuleActionParametersProxyRevalidateRemoveDirective, +] + + +class RuleRulesetsSetCacheControlRuleActionParametersPublicSetDirective(BaseModel): + """Set the directive.""" + + operation: Literal["set", "remove"] + """The operation to perform on the cache-control directive.""" + + cloudflare_only: Optional[bool] = None + """Whether the directive should only be applied to the Cloudflare CDN cache.""" + + +class RuleRulesetsSetCacheControlRuleActionParametersPublicRemoveDirective(BaseModel): + """Remove the directive.""" + + operation: Literal["set", "remove"] + """The operation to perform on the cache-control directive.""" + + cloudflare_only: Optional[bool] = None + """Whether the directive should only be applied to the Cloudflare CDN cache.""" + + +RuleRulesetsSetCacheControlRuleActionParametersPublic: TypeAlias = Union[ + RuleRulesetsSetCacheControlRuleActionParametersPublicSetDirective, + RuleRulesetsSetCacheControlRuleActionParametersPublicRemoveDirective, +] + + +class RuleRulesetsSetCacheControlRuleActionParametersSMaxageSetDirective(BaseModel): + """Set the directive with a duration value in seconds.""" + + operation: Literal["set", "remove"] + """The operation to perform on the cache-control directive.""" + + value: int + """The duration value in seconds for the directive.""" + + cloudflare_only: Optional[bool] = None + """Whether the directive should only be applied to the Cloudflare CDN cache.""" + + +class RuleRulesetsSetCacheControlRuleActionParametersSMaxageRemoveDirective(BaseModel): + """Remove the directive.""" + + operation: Literal["set", "remove"] + """The operation to perform on the cache-control directive.""" + + cloudflare_only: Optional[bool] = None + """Whether the directive should only be applied to the Cloudflare CDN cache.""" + + +RuleRulesetsSetCacheControlRuleActionParametersSMaxage: TypeAlias = Union[ + RuleRulesetsSetCacheControlRuleActionParametersSMaxageSetDirective, + RuleRulesetsSetCacheControlRuleActionParametersSMaxageRemoveDirective, +] + + +class RuleRulesetsSetCacheControlRuleActionParametersStaleIfErrorSetDirective(BaseModel): + """Set the directive with a duration value in seconds.""" + + operation: Literal["set", "remove"] + """The operation to perform on the cache-control directive.""" + + value: int + """The duration value in seconds for the directive.""" + + cloudflare_only: Optional[bool] = None + """Whether the directive should only be applied to the Cloudflare CDN cache.""" + + +class RuleRulesetsSetCacheControlRuleActionParametersStaleIfErrorRemoveDirective(BaseModel): + """Remove the directive.""" + + operation: Literal["set", "remove"] + """The operation to perform on the cache-control directive.""" + + cloudflare_only: Optional[bool] = None + """Whether the directive should only be applied to the Cloudflare CDN cache.""" + + +RuleRulesetsSetCacheControlRuleActionParametersStaleIfError: TypeAlias = Union[ + RuleRulesetsSetCacheControlRuleActionParametersStaleIfErrorSetDirective, + RuleRulesetsSetCacheControlRuleActionParametersStaleIfErrorRemoveDirective, +] + + +class RuleRulesetsSetCacheControlRuleActionParametersStaleWhileRevalidateSetDirective(BaseModel): + """Set the directive with a duration value in seconds.""" + + operation: Literal["set", "remove"] + """The operation to perform on the cache-control directive.""" + + value: int + """The duration value in seconds for the directive.""" + + cloudflare_only: Optional[bool] = None + """Whether the directive should only be applied to the Cloudflare CDN cache.""" + + +class RuleRulesetsSetCacheControlRuleActionParametersStaleWhileRevalidateRemoveDirective(BaseModel): + """Remove the directive.""" + + operation: Literal["set", "remove"] + """The operation to perform on the cache-control directive.""" + + cloudflare_only: Optional[bool] = None + """Whether the directive should only be applied to the Cloudflare CDN cache.""" + + +RuleRulesetsSetCacheControlRuleActionParametersStaleWhileRevalidate: TypeAlias = Union[ + RuleRulesetsSetCacheControlRuleActionParametersStaleWhileRevalidateSetDirective, + RuleRulesetsSetCacheControlRuleActionParametersStaleWhileRevalidateRemoveDirective, +] + + +class RuleRulesetsSetCacheControlRuleActionParameters(BaseModel): + """The parameters configuring the rule's action.""" + + immutable: Optional[RuleRulesetsSetCacheControlRuleActionParametersImmutable] = None + """A cache-control directive configuration.""" + + max_age: Optional[RuleRulesetsSetCacheControlRuleActionParametersMaxAge] = FieldInfo(alias="max-age", default=None) + """ + A cache-control directive configuration that accepts a duration value in + seconds. + """ + + must_revalidate: Optional[RuleRulesetsSetCacheControlRuleActionParametersMustRevalidate] = FieldInfo( + alias="must-revalidate", default=None + ) + """A cache-control directive configuration.""" + + must_understand: Optional[RuleRulesetsSetCacheControlRuleActionParametersMustUnderstand] = FieldInfo( + alias="must-understand", default=None + ) + """A cache-control directive configuration.""" + + no_cache: Optional[RuleRulesetsSetCacheControlRuleActionParametersNoCache] = FieldInfo( + alias="no-cache", default=None + ) + """ + A cache-control directive configuration that accepts optional qualifiers (header + names). + """ + + no_store: Optional[RuleRulesetsSetCacheControlRuleActionParametersNoStore] = FieldInfo( + alias="no-store", default=None + ) + """A cache-control directive configuration.""" + + no_transform: Optional[RuleRulesetsSetCacheControlRuleActionParametersNoTransform] = FieldInfo( + alias="no-transform", default=None + ) + """A cache-control directive configuration.""" + + private: Optional[RuleRulesetsSetCacheControlRuleActionParametersPrivate] = None + """ + A cache-control directive configuration that accepts optional qualifiers (header + names). + """ + + proxy_revalidate: Optional[RuleRulesetsSetCacheControlRuleActionParametersProxyRevalidate] = FieldInfo( + alias="proxy-revalidate", default=None + ) + """A cache-control directive configuration.""" + + public: Optional[RuleRulesetsSetCacheControlRuleActionParametersPublic] = None + """A cache-control directive configuration.""" + + s_maxage: Optional[RuleRulesetsSetCacheControlRuleActionParametersSMaxage] = FieldInfo( + alias="s-maxage", default=None + ) + """ + A cache-control directive configuration that accepts a duration value in + seconds. + """ + + stale_if_error: Optional[RuleRulesetsSetCacheControlRuleActionParametersStaleIfError] = FieldInfo( + alias="stale-if-error", default=None + ) + """ + A cache-control directive configuration that accepts a duration value in + seconds. + """ + + stale_while_revalidate: Optional[RuleRulesetsSetCacheControlRuleActionParametersStaleWhileRevalidate] = FieldInfo( + alias="stale-while-revalidate", default=None + ) + """ + A cache-control directive configuration that accepts a duration value in + seconds. + """ + + +class RuleRulesetsSetCacheControlRuleExposedCredentialCheck(BaseModel): + """Configuration for exposed credential checking.""" + + password_expression: str + """An expression that selects the password used in the credentials check.""" + + username_expression: str + """An expression that selects the user ID used in the credentials check.""" + + +class RuleRulesetsSetCacheControlRuleRatelimit(BaseModel): + """An object configuring the rule's rate limit behavior.""" + + characteristics: List[str] + """ + Characteristics of the request on which the rate limit counter will be + incremented. + """ + + period: int + """Period in seconds over which the counter is being incremented.""" + + counting_expression: Optional[str] = None + """An expression that defines when the rate limit counter should be incremented. + + It defaults to the same as the rule's expression. + """ + + mitigation_timeout: Optional[int] = None + """ + Period of time in seconds after which the action will be disabled following its + first execution. + """ + + requests_per_period: Optional[int] = None + """ + The threshold of requests per period after which the action will be executed for + the first time. + """ + + requests_to_origin: Optional[bool] = None + """Whether counting is only performed when an origin is reached.""" + + score_per_period: Optional[int] = None + """ + The score threshold per period for which the action will be executed the first + time. + """ + + score_response_header_name: Optional[str] = None + """ + A response header name provided by the origin, which contains the score to + increment rate limit counter with. + """ + + +class RuleRulesetsSetCacheControlRule(BaseModel): + last_updated: datetime + """The timestamp of when the rule was last modified.""" + + version: str + """The version of the rule.""" + + id: Optional[str] = None + """The unique ID of the rule.""" + + action: Optional[Literal["set_cache_control"]] = None + """The action to perform when the rule matches.""" + + action_parameters: Optional[RuleRulesetsSetCacheControlRuleActionParameters] = None + """The parameters configuring the rule's action.""" + + categories: Optional[List[str]] = None + """The categories of the rule.""" + + description: Optional[str] = None + """An informative description of the rule.""" + + enabled: Optional[bool] = None + """Whether the rule should be executed.""" + + exposed_credential_check: Optional[RuleRulesetsSetCacheControlRuleExposedCredentialCheck] = None + """Configuration for exposed credential checking.""" + + expression: Optional[str] = None + """The expression defining which traffic will match the rule.""" + + logging: Optional[Logging] = None + """An object configuring the rule's logging behavior.""" + + ratelimit: Optional[RuleRulesetsSetCacheControlRuleRatelimit] = None + """An object configuring the rule's rate limit behavior.""" + + ref: Optional[str] = None + """The reference of the rule (the rule's ID by default).""" + + +class RuleRulesetsSetCacheTagsRuleActionParametersAddCacheTagsValues(BaseModel): + """Add cache tags using a list of values.""" + + operation: Literal["add", "remove", "set"] + """The operation to perform on the cache tags.""" + + values: List[str] + """A list of cache tag values.""" + + +class RuleRulesetsSetCacheTagsRuleActionParametersAddCacheTagsExpression(BaseModel): + """Add cache tags using an expression.""" + + expression: str + """An expression that evaluates to an array of cache tag values.""" + + operation: Literal["add", "remove", "set"] + """The operation to perform on the cache tags.""" + + +class RuleRulesetsSetCacheTagsRuleActionParametersRemoveCacheTagsValues(BaseModel): + """Remove cache tags using a list of values.""" + + operation: Literal["add", "remove", "set"] + """The operation to perform on the cache tags.""" + + values: List[str] + """A list of cache tag values.""" + + +class RuleRulesetsSetCacheTagsRuleActionParametersRemoveCacheTagsExpression(BaseModel): + """Remove cache tags using an expression.""" + + expression: str + """An expression that evaluates to an array of cache tag values.""" + + operation: Literal["add", "remove", "set"] + """The operation to perform on the cache tags.""" + + +class RuleRulesetsSetCacheTagsRuleActionParametersSetCacheTagsValues(BaseModel): + """Set cache tags using a list of values.""" + + operation: Literal["add", "remove", "set"] + """The operation to perform on the cache tags.""" + + values: List[str] + """A list of cache tag values.""" + + +class RuleRulesetsSetCacheTagsRuleActionParametersSetCacheTagsExpression(BaseModel): + """Set cache tags using an expression.""" + + expression: str + """An expression that evaluates to an array of cache tag values.""" + + operation: Literal["add", "remove", "set"] + """The operation to perform on the cache tags.""" + + +RuleRulesetsSetCacheTagsRuleActionParameters: TypeAlias = Union[ + RuleRulesetsSetCacheTagsRuleActionParametersAddCacheTagsValues, + RuleRulesetsSetCacheTagsRuleActionParametersAddCacheTagsExpression, + RuleRulesetsSetCacheTagsRuleActionParametersRemoveCacheTagsValues, + RuleRulesetsSetCacheTagsRuleActionParametersRemoveCacheTagsExpression, + RuleRulesetsSetCacheTagsRuleActionParametersSetCacheTagsValues, + RuleRulesetsSetCacheTagsRuleActionParametersSetCacheTagsExpression, +] + + +class RuleRulesetsSetCacheTagsRuleExposedCredentialCheck(BaseModel): + """Configuration for exposed credential checking.""" + + password_expression: str + """An expression that selects the password used in the credentials check.""" + + username_expression: str + """An expression that selects the user ID used in the credentials check.""" + + +class RuleRulesetsSetCacheTagsRuleRatelimit(BaseModel): + """An object configuring the rule's rate limit behavior.""" + + characteristics: List[str] + """ + Characteristics of the request on which the rate limit counter will be + incremented. + """ + + period: int + """Period in seconds over which the counter is being incremented.""" + + counting_expression: Optional[str] = None + """An expression that defines when the rate limit counter should be incremented. + + It defaults to the same as the rule's expression. + """ + + mitigation_timeout: Optional[int] = None + """ + Period of time in seconds after which the action will be disabled following its + first execution. + """ + + requests_per_period: Optional[int] = None + """ + The threshold of requests per period after which the action will be executed for + the first time. + """ + + requests_to_origin: Optional[bool] = None + """Whether counting is only performed when an origin is reached.""" + + score_per_period: Optional[int] = None + """ + The score threshold per period for which the action will be executed the first + time. + """ + + score_response_header_name: Optional[str] = None + """ + A response header name provided by the origin, which contains the score to + increment rate limit counter with. + """ + + +class RuleRulesetsSetCacheTagsRule(BaseModel): + last_updated: datetime + """The timestamp of when the rule was last modified.""" + + version: str + """The version of the rule.""" + + id: Optional[str] = None + """The unique ID of the rule.""" + + action: Optional[Literal["set_cache_tags"]] = None + """The action to perform when the rule matches.""" + + action_parameters: Optional[RuleRulesetsSetCacheTagsRuleActionParameters] = None + """The parameters configuring the rule's action.""" + + categories: Optional[List[str]] = None + """The categories of the rule.""" + + description: Optional[str] = None + """An informative description of the rule.""" + + enabled: Optional[bool] = None + """Whether the rule should be executed.""" + + exposed_credential_check: Optional[RuleRulesetsSetCacheTagsRuleExposedCredentialCheck] = None + """Configuration for exposed credential checking.""" + + expression: Optional[str] = None + """The expression defining which traffic will match the rule.""" + + logging: Optional[Logging] = None + """An object configuring the rule's logging behavior.""" + + ratelimit: Optional[RuleRulesetsSetCacheTagsRuleRatelimit] = None + """An object configuring the rule's rate limit behavior.""" + + ref: Optional[str] = None + """The reference of the rule (the rule's ID by default).""" + + Rule: TypeAlias = Annotated[ Union[ BlockRule, @@ -249,7 +1009,9 @@ class RuleRulesetsJSChallengeRule(BaseModel): RouteRule, ScoreRule, ServeErrorRule, + RuleRulesetsSetCacheControlRule, SetCacheSettingsRule, + RuleRulesetsSetCacheTagsRule, SetConfigRule, SkipRule, ], diff --git a/src/cloudflare/types/rulesets/rule_create_params.py b/src/cloudflare/types/rulesets/rule_create_params.py index a8435dbd1c2..af5468057cd 100644 --- a/src/cloudflare/types/rulesets/rule_create_params.py +++ b/src/cloudflare/types/rulesets/rule_create_params.py @@ -3,10 +3,11 @@ from __future__ import annotations from typing import Dict, List, Union, Iterable -from typing_extensions import Literal, Required, TypeAlias, TypedDict +from typing_extensions import Literal, Required, Annotated, TypeAlias, TypedDict from .phase import Phase from ..._types import SequenceNotStr +from ..._utils import PropertyInfo from .logging_param import LoggingParam __all__ = [ @@ -154,6 +155,53 @@ "ServeErrorRulePositionAfterPosition", "ServeErrorRulePositionIndexPosition", "ServeErrorRuleRatelimit", + "SetCacheControlRule", + "SetCacheControlRuleActionParameters", + "SetCacheControlRuleActionParametersImmutable", + "SetCacheControlRuleActionParametersImmutableSetDirective", + "SetCacheControlRuleActionParametersImmutableRemoveDirective", + "SetCacheControlRuleActionParametersMaxAge", + "SetCacheControlRuleActionParametersMaxAgeSetDirective", + "SetCacheControlRuleActionParametersMaxAgeRemoveDirective", + "SetCacheControlRuleActionParametersMustRevalidate", + "SetCacheControlRuleActionParametersMustRevalidateSetDirective", + "SetCacheControlRuleActionParametersMustRevalidateRemoveDirective", + "SetCacheControlRuleActionParametersMustUnderstand", + "SetCacheControlRuleActionParametersMustUnderstandSetDirective", + "SetCacheControlRuleActionParametersMustUnderstandRemoveDirective", + "SetCacheControlRuleActionParametersNoCache", + "SetCacheControlRuleActionParametersNoCacheSetDirective", + "SetCacheControlRuleActionParametersNoCacheRemoveDirective", + "SetCacheControlRuleActionParametersNoStore", + "SetCacheControlRuleActionParametersNoStoreSetDirective", + "SetCacheControlRuleActionParametersNoStoreRemoveDirective", + "SetCacheControlRuleActionParametersNoTransform", + "SetCacheControlRuleActionParametersNoTransformSetDirective", + "SetCacheControlRuleActionParametersNoTransformRemoveDirective", + "SetCacheControlRuleActionParametersPrivate", + "SetCacheControlRuleActionParametersPrivateSetDirective", + "SetCacheControlRuleActionParametersPrivateRemoveDirective", + "SetCacheControlRuleActionParametersProxyRevalidate", + "SetCacheControlRuleActionParametersProxyRevalidateSetDirective", + "SetCacheControlRuleActionParametersProxyRevalidateRemoveDirective", + "SetCacheControlRuleActionParametersPublic", + "SetCacheControlRuleActionParametersPublicSetDirective", + "SetCacheControlRuleActionParametersPublicRemoveDirective", + "SetCacheControlRuleActionParametersSMaxage", + "SetCacheControlRuleActionParametersSMaxageSetDirective", + "SetCacheControlRuleActionParametersSMaxageRemoveDirective", + "SetCacheControlRuleActionParametersStaleIfError", + "SetCacheControlRuleActionParametersStaleIfErrorSetDirective", + "SetCacheControlRuleActionParametersStaleIfErrorRemoveDirective", + "SetCacheControlRuleActionParametersStaleWhileRevalidate", + "SetCacheControlRuleActionParametersStaleWhileRevalidateSetDirective", + "SetCacheControlRuleActionParametersStaleWhileRevalidateRemoveDirective", + "SetCacheControlRuleExposedCredentialCheck", + "SetCacheControlRulePosition", + "SetCacheControlRulePositionBeforePosition", + "SetCacheControlRulePositionAfterPosition", + "SetCacheControlRulePositionIndexPosition", + "SetCacheControlRuleRatelimit", "SetCacheSettingsRule", "SetCacheSettingsRuleActionParameters", "SetCacheSettingsRuleActionParametersBrowserTTL", @@ -177,6 +225,20 @@ "SetCacheSettingsRulePositionAfterPosition", "SetCacheSettingsRulePositionIndexPosition", "SetCacheSettingsRuleRatelimit", + "SetCacheTagsRule", + "SetCacheTagsRuleActionParameters", + "SetCacheTagsRuleActionParametersAddCacheTagsValues", + "SetCacheTagsRuleActionParametersAddCacheTagsExpression", + "SetCacheTagsRuleActionParametersRemoveCacheTagsValues", + "SetCacheTagsRuleActionParametersRemoveCacheTagsExpression", + "SetCacheTagsRuleActionParametersSetCacheTagsValues", + "SetCacheTagsRuleActionParametersSetCacheTagsExpression", + "SetCacheTagsRuleExposedCredentialCheck", + "SetCacheTagsRulePosition", + "SetCacheTagsRulePositionBeforePosition", + "SetCacheTagsRulePositionAfterPosition", + "SetCacheTagsRulePositionIndexPosition", + "SetCacheTagsRuleRatelimit", "SetConfigurationRule", "SetConfigurationRuleActionParameters", "SetConfigurationRuleActionParametersAutominify", @@ -2541,6 +2603,558 @@ class ServeErrorRuleRatelimit(TypedDict, total=False): """ +class SetCacheControlRule(TypedDict, total=False): + account_id: str + """The Account ID to use for this endpoint. Mutually exclusive with the Zone ID.""" + + zone_id: str + """The Zone ID to use for this endpoint. Mutually exclusive with the Account ID.""" + + id: str + """The unique ID of the rule.""" + + action: Literal["set_cache_control"] + """The action to perform when the rule matches.""" + + action_parameters: SetCacheControlRuleActionParameters + """The parameters configuring the rule's action.""" + + description: str + """An informative description of the rule.""" + + enabled: bool + """Whether the rule should be executed.""" + + exposed_credential_check: SetCacheControlRuleExposedCredentialCheck + """Configuration for exposed credential checking.""" + + expression: str + """The expression defining which traffic will match the rule.""" + + logging: LoggingParam + """An object configuring the rule's logging behavior.""" + + position: SetCacheControlRulePosition + """An object configuring where the rule will be placed.""" + + ratelimit: SetCacheControlRuleRatelimit + """An object configuring the rule's rate limit behavior.""" + + ref: str + """The reference of the rule (the rule's ID by default).""" + + +class SetCacheControlRuleActionParametersImmutableSetDirective(TypedDict, total=False): + """Set the directive.""" + + operation: Required[Literal["set", "remove"]] + """The operation to perform on the cache-control directive.""" + + cloudflare_only: bool + """Whether the directive should only be applied to the Cloudflare CDN cache.""" + + +class SetCacheControlRuleActionParametersImmutableRemoveDirective(TypedDict, total=False): + """Remove the directive.""" + + operation: Required[Literal["set", "remove"]] + """The operation to perform on the cache-control directive.""" + + cloudflare_only: bool + """Whether the directive should only be applied to the Cloudflare CDN cache.""" + + +SetCacheControlRuleActionParametersImmutable: TypeAlias = Union[ + SetCacheControlRuleActionParametersImmutableSetDirective, + SetCacheControlRuleActionParametersImmutableRemoveDirective, +] + + +class SetCacheControlRuleActionParametersMaxAgeSetDirective(TypedDict, total=False): + """Set the directive with a duration value in seconds.""" + + operation: Required[Literal["set", "remove"]] + """The operation to perform on the cache-control directive.""" + + value: Required[int] + """The duration value in seconds for the directive.""" + + cloudflare_only: bool + """Whether the directive should only be applied to the Cloudflare CDN cache.""" + + +class SetCacheControlRuleActionParametersMaxAgeRemoveDirective(TypedDict, total=False): + """Remove the directive.""" + + operation: Required[Literal["set", "remove"]] + """The operation to perform on the cache-control directive.""" + + cloudflare_only: bool + """Whether the directive should only be applied to the Cloudflare CDN cache.""" + + +SetCacheControlRuleActionParametersMaxAge: TypeAlias = Union[ + SetCacheControlRuleActionParametersMaxAgeSetDirective, SetCacheControlRuleActionParametersMaxAgeRemoveDirective +] + + +class SetCacheControlRuleActionParametersMustRevalidateSetDirective(TypedDict, total=False): + """Set the directive.""" + + operation: Required[Literal["set", "remove"]] + """The operation to perform on the cache-control directive.""" + + cloudflare_only: bool + """Whether the directive should only be applied to the Cloudflare CDN cache.""" + + +class SetCacheControlRuleActionParametersMustRevalidateRemoveDirective(TypedDict, total=False): + """Remove the directive.""" + + operation: Required[Literal["set", "remove"]] + """The operation to perform on the cache-control directive.""" + + cloudflare_only: bool + """Whether the directive should only be applied to the Cloudflare CDN cache.""" + + +SetCacheControlRuleActionParametersMustRevalidate: TypeAlias = Union[ + SetCacheControlRuleActionParametersMustRevalidateSetDirective, + SetCacheControlRuleActionParametersMustRevalidateRemoveDirective, +] + + +class SetCacheControlRuleActionParametersMustUnderstandSetDirective(TypedDict, total=False): + """Set the directive.""" + + operation: Required[Literal["set", "remove"]] + """The operation to perform on the cache-control directive.""" + + cloudflare_only: bool + """Whether the directive should only be applied to the Cloudflare CDN cache.""" + + +class SetCacheControlRuleActionParametersMustUnderstandRemoveDirective(TypedDict, total=False): + """Remove the directive.""" + + operation: Required[Literal["set", "remove"]] + """The operation to perform on the cache-control directive.""" + + cloudflare_only: bool + """Whether the directive should only be applied to the Cloudflare CDN cache.""" + + +SetCacheControlRuleActionParametersMustUnderstand: TypeAlias = Union[ + SetCacheControlRuleActionParametersMustUnderstandSetDirective, + SetCacheControlRuleActionParametersMustUnderstandRemoveDirective, +] + + +class SetCacheControlRuleActionParametersNoCacheSetDirective(TypedDict, total=False): + """Set the directive with optional qualifiers.""" + + operation: Required[Literal["set", "remove"]] + """The operation to perform on the cache-control directive.""" + + cloudflare_only: bool + """Whether the directive should only be applied to the Cloudflare CDN cache.""" + + qualifiers: SequenceNotStr[str] + """ + Optional list of header names to qualify the directive (e.g., for "private" or + "no-cache" directives). + """ + + +class SetCacheControlRuleActionParametersNoCacheRemoveDirective(TypedDict, total=False): + """Remove the directive.""" + + operation: Required[Literal["set", "remove"]] + """The operation to perform on the cache-control directive.""" + + cloudflare_only: bool + """Whether the directive should only be applied to the Cloudflare CDN cache.""" + + +SetCacheControlRuleActionParametersNoCache: TypeAlias = Union[ + SetCacheControlRuleActionParametersNoCacheSetDirective, SetCacheControlRuleActionParametersNoCacheRemoveDirective +] + + +class SetCacheControlRuleActionParametersNoStoreSetDirective(TypedDict, total=False): + """Set the directive.""" + + operation: Required[Literal["set", "remove"]] + """The operation to perform on the cache-control directive.""" + + cloudflare_only: bool + """Whether the directive should only be applied to the Cloudflare CDN cache.""" + + +class SetCacheControlRuleActionParametersNoStoreRemoveDirective(TypedDict, total=False): + """Remove the directive.""" + + operation: Required[Literal["set", "remove"]] + """The operation to perform on the cache-control directive.""" + + cloudflare_only: bool + """Whether the directive should only be applied to the Cloudflare CDN cache.""" + + +SetCacheControlRuleActionParametersNoStore: TypeAlias = Union[ + SetCacheControlRuleActionParametersNoStoreSetDirective, SetCacheControlRuleActionParametersNoStoreRemoveDirective +] + + +class SetCacheControlRuleActionParametersNoTransformSetDirective(TypedDict, total=False): + """Set the directive.""" + + operation: Required[Literal["set", "remove"]] + """The operation to perform on the cache-control directive.""" + + cloudflare_only: bool + """Whether the directive should only be applied to the Cloudflare CDN cache.""" + + +class SetCacheControlRuleActionParametersNoTransformRemoveDirective(TypedDict, total=False): + """Remove the directive.""" + + operation: Required[Literal["set", "remove"]] + """The operation to perform on the cache-control directive.""" + + cloudflare_only: bool + """Whether the directive should only be applied to the Cloudflare CDN cache.""" + + +SetCacheControlRuleActionParametersNoTransform: TypeAlias = Union[ + SetCacheControlRuleActionParametersNoTransformSetDirective, + SetCacheControlRuleActionParametersNoTransformRemoveDirective, +] + + +class SetCacheControlRuleActionParametersPrivateSetDirective(TypedDict, total=False): + """Set the directive with optional qualifiers.""" + + operation: Required[Literal["set", "remove"]] + """The operation to perform on the cache-control directive.""" + + cloudflare_only: bool + """Whether the directive should only be applied to the Cloudflare CDN cache.""" + + qualifiers: SequenceNotStr[str] + """ + Optional list of header names to qualify the directive (e.g., for "private" or + "no-cache" directives). + """ + + +class SetCacheControlRuleActionParametersPrivateRemoveDirective(TypedDict, total=False): + """Remove the directive.""" + + operation: Required[Literal["set", "remove"]] + """The operation to perform on the cache-control directive.""" + + cloudflare_only: bool + """Whether the directive should only be applied to the Cloudflare CDN cache.""" + + +SetCacheControlRuleActionParametersPrivate: TypeAlias = Union[ + SetCacheControlRuleActionParametersPrivateSetDirective, SetCacheControlRuleActionParametersPrivateRemoveDirective +] + + +class SetCacheControlRuleActionParametersProxyRevalidateSetDirective(TypedDict, total=False): + """Set the directive.""" + + operation: Required[Literal["set", "remove"]] + """The operation to perform on the cache-control directive.""" + + cloudflare_only: bool + """Whether the directive should only be applied to the Cloudflare CDN cache.""" + + +class SetCacheControlRuleActionParametersProxyRevalidateRemoveDirective(TypedDict, total=False): + """Remove the directive.""" + + operation: Required[Literal["set", "remove"]] + """The operation to perform on the cache-control directive.""" + + cloudflare_only: bool + """Whether the directive should only be applied to the Cloudflare CDN cache.""" + + +SetCacheControlRuleActionParametersProxyRevalidate: TypeAlias = Union[ + SetCacheControlRuleActionParametersProxyRevalidateSetDirective, + SetCacheControlRuleActionParametersProxyRevalidateRemoveDirective, +] + + +class SetCacheControlRuleActionParametersPublicSetDirective(TypedDict, total=False): + """Set the directive.""" + + operation: Required[Literal["set", "remove"]] + """The operation to perform on the cache-control directive.""" + + cloudflare_only: bool + """Whether the directive should only be applied to the Cloudflare CDN cache.""" + + +class SetCacheControlRuleActionParametersPublicRemoveDirective(TypedDict, total=False): + """Remove the directive.""" + + operation: Required[Literal["set", "remove"]] + """The operation to perform on the cache-control directive.""" + + cloudflare_only: bool + """Whether the directive should only be applied to the Cloudflare CDN cache.""" + + +SetCacheControlRuleActionParametersPublic: TypeAlias = Union[ + SetCacheControlRuleActionParametersPublicSetDirective, SetCacheControlRuleActionParametersPublicRemoveDirective +] + + +class SetCacheControlRuleActionParametersSMaxageSetDirective(TypedDict, total=False): + """Set the directive with a duration value in seconds.""" + + operation: Required[Literal["set", "remove"]] + """The operation to perform on the cache-control directive.""" + + value: Required[int] + """The duration value in seconds for the directive.""" + + cloudflare_only: bool + """Whether the directive should only be applied to the Cloudflare CDN cache.""" + + +class SetCacheControlRuleActionParametersSMaxageRemoveDirective(TypedDict, total=False): + """Remove the directive.""" + + operation: Required[Literal["set", "remove"]] + """The operation to perform on the cache-control directive.""" + + cloudflare_only: bool + """Whether the directive should only be applied to the Cloudflare CDN cache.""" + + +SetCacheControlRuleActionParametersSMaxage: TypeAlias = Union[ + SetCacheControlRuleActionParametersSMaxageSetDirective, SetCacheControlRuleActionParametersSMaxageRemoveDirective +] + + +class SetCacheControlRuleActionParametersStaleIfErrorSetDirective(TypedDict, total=False): + """Set the directive with a duration value in seconds.""" + + operation: Required[Literal["set", "remove"]] + """The operation to perform on the cache-control directive.""" + + value: Required[int] + """The duration value in seconds for the directive.""" + + cloudflare_only: bool + """Whether the directive should only be applied to the Cloudflare CDN cache.""" + + +class SetCacheControlRuleActionParametersStaleIfErrorRemoveDirective(TypedDict, total=False): + """Remove the directive.""" + + operation: Required[Literal["set", "remove"]] + """The operation to perform on the cache-control directive.""" + + cloudflare_only: bool + """Whether the directive should only be applied to the Cloudflare CDN cache.""" + + +SetCacheControlRuleActionParametersStaleIfError: TypeAlias = Union[ + SetCacheControlRuleActionParametersStaleIfErrorSetDirective, + SetCacheControlRuleActionParametersStaleIfErrorRemoveDirective, +] + + +class SetCacheControlRuleActionParametersStaleWhileRevalidateSetDirective(TypedDict, total=False): + """Set the directive with a duration value in seconds.""" + + operation: Required[Literal["set", "remove"]] + """The operation to perform on the cache-control directive.""" + + value: Required[int] + """The duration value in seconds for the directive.""" + + cloudflare_only: bool + """Whether the directive should only be applied to the Cloudflare CDN cache.""" + + +class SetCacheControlRuleActionParametersStaleWhileRevalidateRemoveDirective(TypedDict, total=False): + """Remove the directive.""" + + operation: Required[Literal["set", "remove"]] + """The operation to perform on the cache-control directive.""" + + cloudflare_only: bool + """Whether the directive should only be applied to the Cloudflare CDN cache.""" + + +SetCacheControlRuleActionParametersStaleWhileRevalidate: TypeAlias = Union[ + SetCacheControlRuleActionParametersStaleWhileRevalidateSetDirective, + SetCacheControlRuleActionParametersStaleWhileRevalidateRemoveDirective, +] + + +class SetCacheControlRuleActionParameters(TypedDict, total=False): + """The parameters configuring the rule's action.""" + + immutable: SetCacheControlRuleActionParametersImmutable + """A cache-control directive configuration.""" + + max_age: Annotated[SetCacheControlRuleActionParametersMaxAge, PropertyInfo(alias="max-age")] + """ + A cache-control directive configuration that accepts a duration value in + seconds. + """ + + must_revalidate: Annotated[SetCacheControlRuleActionParametersMustRevalidate, PropertyInfo(alias="must-revalidate")] + """A cache-control directive configuration.""" + + must_understand: Annotated[SetCacheControlRuleActionParametersMustUnderstand, PropertyInfo(alias="must-understand")] + """A cache-control directive configuration.""" + + no_cache: Annotated[SetCacheControlRuleActionParametersNoCache, PropertyInfo(alias="no-cache")] + """ + A cache-control directive configuration that accepts optional qualifiers (header + names). + """ + + no_store: Annotated[SetCacheControlRuleActionParametersNoStore, PropertyInfo(alias="no-store")] + """A cache-control directive configuration.""" + + no_transform: Annotated[SetCacheControlRuleActionParametersNoTransform, PropertyInfo(alias="no-transform")] + """A cache-control directive configuration.""" + + private: SetCacheControlRuleActionParametersPrivate + """ + A cache-control directive configuration that accepts optional qualifiers (header + names). + """ + + proxy_revalidate: Annotated[ + SetCacheControlRuleActionParametersProxyRevalidate, PropertyInfo(alias="proxy-revalidate") + ] + """A cache-control directive configuration.""" + + public: SetCacheControlRuleActionParametersPublic + """A cache-control directive configuration.""" + + s_maxage: Annotated[SetCacheControlRuleActionParametersSMaxage, PropertyInfo(alias="s-maxage")] + """ + A cache-control directive configuration that accepts a duration value in + seconds. + """ + + stale_if_error: Annotated[SetCacheControlRuleActionParametersStaleIfError, PropertyInfo(alias="stale-if-error")] + """ + A cache-control directive configuration that accepts a duration value in + seconds. + """ + + stale_while_revalidate: Annotated[ + SetCacheControlRuleActionParametersStaleWhileRevalidate, PropertyInfo(alias="stale-while-revalidate") + ] + """ + A cache-control directive configuration that accepts a duration value in + seconds. + """ + + +class SetCacheControlRuleExposedCredentialCheck(TypedDict, total=False): + """Configuration for exposed credential checking.""" + + password_expression: Required[str] + """An expression that selects the password used in the credentials check.""" + + username_expression: Required[str] + """An expression that selects the user ID used in the credentials check.""" + + +class SetCacheControlRulePositionBeforePosition(TypedDict, total=False): + """An object configuring where the rule will be placed.""" + + before: str + """The ID of another rule to place the rule before. + + An empty value causes the rule to be placed at the top. + """ + + +class SetCacheControlRulePositionAfterPosition(TypedDict, total=False): + """An object configuring where the rule will be placed.""" + + after: str + """The ID of another rule to place the rule after. + + An empty value causes the rule to be placed at the bottom. + """ + + +class SetCacheControlRulePositionIndexPosition(TypedDict, total=False): + """An object configuring where the rule will be placed.""" + + index: int + """An index at which to place the rule, where index 1 is the first rule.""" + + +SetCacheControlRulePosition: TypeAlias = Union[ + SetCacheControlRulePositionBeforePosition, + SetCacheControlRulePositionAfterPosition, + SetCacheControlRulePositionIndexPosition, +] + + +class SetCacheControlRuleRatelimit(TypedDict, total=False): + """An object configuring the rule's rate limit behavior.""" + + characteristics: Required[SequenceNotStr[str]] + """ + Characteristics of the request on which the rate limit counter will be + incremented. + """ + + period: Required[int] + """Period in seconds over which the counter is being incremented.""" + + counting_expression: str + """An expression that defines when the rate limit counter should be incremented. + + It defaults to the same as the rule's expression. + """ + + mitigation_timeout: int + """ + Period of time in seconds after which the action will be disabled following its + first execution. + """ + + requests_per_period: int + """ + The threshold of requests per period after which the action will be executed for + the first time. + """ + + requests_to_origin: bool + """Whether counting is only performed when an origin is reached.""" + + score_per_period: int + """ + The score threshold per period for which the action will be executed the first + time. + """ + + score_response_header_name: str + """ + A response header name provided by the origin, which contains the score to + increment rate limit counter with. + """ + + class SetCacheSettingsRule(TypedDict, total=False): account_id: str """The Account ID to use for this endpoint. Mutually exclusive with the Zone ID.""" @@ -2856,6 +3470,15 @@ class SetCacheSettingsRuleActionParameters(TypedDict, total=False): serve_stale: SetCacheSettingsRuleActionParametersServeStale """When to serve stale content from cache.""" + strip_etags: bool + """Whether to strip ETag headers from the origin response before caching.""" + + strip_last_modified: bool + """Whether to strip Last-Modified headers from the origin response before caching.""" + + strip_set_cookie: bool + """Whether to strip Set-Cookie headers from the origin response before caching.""" + class SetCacheSettingsRuleExposedCredentialCheck(TypedDict, total=False): """Configuration for exposed credential checking.""" @@ -2947,6 +3570,205 @@ class SetCacheSettingsRuleRatelimit(TypedDict, total=False): """ +class SetCacheTagsRule(TypedDict, total=False): + account_id: str + """The Account ID to use for this endpoint. Mutually exclusive with the Zone ID.""" + + zone_id: str + """The Zone ID to use for this endpoint. Mutually exclusive with the Account ID.""" + + id: str + """The unique ID of the rule.""" + + action: Literal["set_cache_tags"] + """The action to perform when the rule matches.""" + + action_parameters: SetCacheTagsRuleActionParameters + """The parameters configuring the rule's action.""" + + description: str + """An informative description of the rule.""" + + enabled: bool + """Whether the rule should be executed.""" + + exposed_credential_check: SetCacheTagsRuleExposedCredentialCheck + """Configuration for exposed credential checking.""" + + expression: str + """The expression defining which traffic will match the rule.""" + + logging: LoggingParam + """An object configuring the rule's logging behavior.""" + + position: SetCacheTagsRulePosition + """An object configuring where the rule will be placed.""" + + ratelimit: SetCacheTagsRuleRatelimit + """An object configuring the rule's rate limit behavior.""" + + ref: str + """The reference of the rule (the rule's ID by default).""" + + +class SetCacheTagsRuleActionParametersAddCacheTagsValues(TypedDict, total=False): + """Add cache tags using a list of values.""" + + operation: Required[Literal["add", "remove", "set"]] + """The operation to perform on the cache tags.""" + + values: Required[SequenceNotStr[str]] + """A list of cache tag values.""" + + +class SetCacheTagsRuleActionParametersAddCacheTagsExpression(TypedDict, total=False): + """Add cache tags using an expression.""" + + expression: Required[str] + """An expression that evaluates to an array of cache tag values.""" + + operation: Required[Literal["add", "remove", "set"]] + """The operation to perform on the cache tags.""" + + +class SetCacheTagsRuleActionParametersRemoveCacheTagsValues(TypedDict, total=False): + """Remove cache tags using a list of values.""" + + operation: Required[Literal["add", "remove", "set"]] + """The operation to perform on the cache tags.""" + + values: Required[SequenceNotStr[str]] + """A list of cache tag values.""" + + +class SetCacheTagsRuleActionParametersRemoveCacheTagsExpression(TypedDict, total=False): + """Remove cache tags using an expression.""" + + expression: Required[str] + """An expression that evaluates to an array of cache tag values.""" + + operation: Required[Literal["add", "remove", "set"]] + """The operation to perform on the cache tags.""" + + +class SetCacheTagsRuleActionParametersSetCacheTagsValues(TypedDict, total=False): + """Set cache tags using a list of values.""" + + operation: Required[Literal["add", "remove", "set"]] + """The operation to perform on the cache tags.""" + + values: Required[SequenceNotStr[str]] + """A list of cache tag values.""" + + +class SetCacheTagsRuleActionParametersSetCacheTagsExpression(TypedDict, total=False): + """Set cache tags using an expression.""" + + expression: Required[str] + """An expression that evaluates to an array of cache tag values.""" + + operation: Required[Literal["add", "remove", "set"]] + """The operation to perform on the cache tags.""" + + +SetCacheTagsRuleActionParameters: TypeAlias = Union[ + SetCacheTagsRuleActionParametersAddCacheTagsValues, + SetCacheTagsRuleActionParametersAddCacheTagsExpression, + SetCacheTagsRuleActionParametersRemoveCacheTagsValues, + SetCacheTagsRuleActionParametersRemoveCacheTagsExpression, + SetCacheTagsRuleActionParametersSetCacheTagsValues, + SetCacheTagsRuleActionParametersSetCacheTagsExpression, +] + + +class SetCacheTagsRuleExposedCredentialCheck(TypedDict, total=False): + """Configuration for exposed credential checking.""" + + password_expression: Required[str] + """An expression that selects the password used in the credentials check.""" + + username_expression: Required[str] + """An expression that selects the user ID used in the credentials check.""" + + +class SetCacheTagsRulePositionBeforePosition(TypedDict, total=False): + """An object configuring where the rule will be placed.""" + + before: str + """The ID of another rule to place the rule before. + + An empty value causes the rule to be placed at the top. + """ + + +class SetCacheTagsRulePositionAfterPosition(TypedDict, total=False): + """An object configuring where the rule will be placed.""" + + after: str + """The ID of another rule to place the rule after. + + An empty value causes the rule to be placed at the bottom. + """ + + +class SetCacheTagsRulePositionIndexPosition(TypedDict, total=False): + """An object configuring where the rule will be placed.""" + + index: int + """An index at which to place the rule, where index 1 is the first rule.""" + + +SetCacheTagsRulePosition: TypeAlias = Union[ + SetCacheTagsRulePositionBeforePosition, SetCacheTagsRulePositionAfterPosition, SetCacheTagsRulePositionIndexPosition +] + + +class SetCacheTagsRuleRatelimit(TypedDict, total=False): + """An object configuring the rule's rate limit behavior.""" + + characteristics: Required[SequenceNotStr[str]] + """ + Characteristics of the request on which the rate limit counter will be + incremented. + """ + + period: Required[int] + """Period in seconds over which the counter is being incremented.""" + + counting_expression: str + """An expression that defines when the rate limit counter should be incremented. + + It defaults to the same as the rule's expression. + """ + + mitigation_timeout: int + """ + Period of time in seconds after which the action will be disabled following its + first execution. + """ + + requests_per_period: int + """ + The threshold of requests per period after which the action will be executed for + the first time. + """ + + requests_to_origin: bool + """Whether counting is only performed when an origin is reached.""" + + score_per_period: int + """ + The score threshold per period for which the action will be executed the first + time. + """ + + score_response_header_name: str + """ + A response header name provided by the origin, which contains the score to + increment rate limit counter with. + """ + + class SetConfigurationRule(TypedDict, total=False): account_id: str """The Account ID to use for this endpoint. Mutually exclusive with the Zone ID.""" @@ -3340,7 +4162,9 @@ class SkipRuleRatelimit(TypedDict, total=False): RouteRule, ScoreRule, ServeErrorRule, + SetCacheControlRule, SetCacheSettingsRule, + SetCacheTagsRule, SetConfigurationRule, SkipRule, ] diff --git a/src/cloudflare/types/rulesets/rule_create_response.py b/src/cloudflare/types/rulesets/rule_create_response.py index 0490e4d9ed9..46f7ecd38f8 100644 --- a/src/cloudflare/types/rulesets/rule_create_response.py +++ b/src/cloudflare/types/rulesets/rule_create_response.py @@ -4,6 +4,8 @@ from datetime import datetime from typing_extensions import Literal, Annotated, TypeAlias +from pydantic import Field as FieldInfo + from .kind import Kind from .phase import Phase from .logging import Logging @@ -35,6 +37,59 @@ "RuleRulesetsJSChallengeRule", "RuleRulesetsJSChallengeRuleExposedCredentialCheck", "RuleRulesetsJSChallengeRuleRatelimit", + "RuleRulesetsSetCacheControlRule", + "RuleRulesetsSetCacheControlRuleActionParameters", + "RuleRulesetsSetCacheControlRuleActionParametersImmutable", + "RuleRulesetsSetCacheControlRuleActionParametersImmutableSetDirective", + "RuleRulesetsSetCacheControlRuleActionParametersImmutableRemoveDirective", + "RuleRulesetsSetCacheControlRuleActionParametersMaxAge", + "RuleRulesetsSetCacheControlRuleActionParametersMaxAgeSetDirective", + "RuleRulesetsSetCacheControlRuleActionParametersMaxAgeRemoveDirective", + "RuleRulesetsSetCacheControlRuleActionParametersMustRevalidate", + "RuleRulesetsSetCacheControlRuleActionParametersMustRevalidateSetDirective", + "RuleRulesetsSetCacheControlRuleActionParametersMustRevalidateRemoveDirective", + "RuleRulesetsSetCacheControlRuleActionParametersMustUnderstand", + "RuleRulesetsSetCacheControlRuleActionParametersMustUnderstandSetDirective", + "RuleRulesetsSetCacheControlRuleActionParametersMustUnderstandRemoveDirective", + "RuleRulesetsSetCacheControlRuleActionParametersNoCache", + "RuleRulesetsSetCacheControlRuleActionParametersNoCacheSetDirective", + "RuleRulesetsSetCacheControlRuleActionParametersNoCacheRemoveDirective", + "RuleRulesetsSetCacheControlRuleActionParametersNoStore", + "RuleRulesetsSetCacheControlRuleActionParametersNoStoreSetDirective", + "RuleRulesetsSetCacheControlRuleActionParametersNoStoreRemoveDirective", + "RuleRulesetsSetCacheControlRuleActionParametersNoTransform", + "RuleRulesetsSetCacheControlRuleActionParametersNoTransformSetDirective", + "RuleRulesetsSetCacheControlRuleActionParametersNoTransformRemoveDirective", + "RuleRulesetsSetCacheControlRuleActionParametersPrivate", + "RuleRulesetsSetCacheControlRuleActionParametersPrivateSetDirective", + "RuleRulesetsSetCacheControlRuleActionParametersPrivateRemoveDirective", + "RuleRulesetsSetCacheControlRuleActionParametersProxyRevalidate", + "RuleRulesetsSetCacheControlRuleActionParametersProxyRevalidateSetDirective", + "RuleRulesetsSetCacheControlRuleActionParametersProxyRevalidateRemoveDirective", + "RuleRulesetsSetCacheControlRuleActionParametersPublic", + "RuleRulesetsSetCacheControlRuleActionParametersPublicSetDirective", + "RuleRulesetsSetCacheControlRuleActionParametersPublicRemoveDirective", + "RuleRulesetsSetCacheControlRuleActionParametersSMaxage", + "RuleRulesetsSetCacheControlRuleActionParametersSMaxageSetDirective", + "RuleRulesetsSetCacheControlRuleActionParametersSMaxageRemoveDirective", + "RuleRulesetsSetCacheControlRuleActionParametersStaleIfError", + "RuleRulesetsSetCacheControlRuleActionParametersStaleIfErrorSetDirective", + "RuleRulesetsSetCacheControlRuleActionParametersStaleIfErrorRemoveDirective", + "RuleRulesetsSetCacheControlRuleActionParametersStaleWhileRevalidate", + "RuleRulesetsSetCacheControlRuleActionParametersStaleWhileRevalidateSetDirective", + "RuleRulesetsSetCacheControlRuleActionParametersStaleWhileRevalidateRemoveDirective", + "RuleRulesetsSetCacheControlRuleExposedCredentialCheck", + "RuleRulesetsSetCacheControlRuleRatelimit", + "RuleRulesetsSetCacheTagsRule", + "RuleRulesetsSetCacheTagsRuleActionParameters", + "RuleRulesetsSetCacheTagsRuleActionParametersAddCacheTagsValues", + "RuleRulesetsSetCacheTagsRuleActionParametersAddCacheTagsExpression", + "RuleRulesetsSetCacheTagsRuleActionParametersRemoveCacheTagsValues", + "RuleRulesetsSetCacheTagsRuleActionParametersRemoveCacheTagsExpression", + "RuleRulesetsSetCacheTagsRuleActionParametersSetCacheTagsValues", + "RuleRulesetsSetCacheTagsRuleActionParametersSetCacheTagsExpression", + "RuleRulesetsSetCacheTagsRuleExposedCredentialCheck", + "RuleRulesetsSetCacheTagsRuleRatelimit", ] @@ -232,6 +287,711 @@ class RuleRulesetsJSChallengeRule(BaseModel): """The reference of the rule (the rule's ID by default).""" +class RuleRulesetsSetCacheControlRuleActionParametersImmutableSetDirective(BaseModel): + """Set the directive.""" + + operation: Literal["set", "remove"] + """The operation to perform on the cache-control directive.""" + + cloudflare_only: Optional[bool] = None + """Whether the directive should only be applied to the Cloudflare CDN cache.""" + + +class RuleRulesetsSetCacheControlRuleActionParametersImmutableRemoveDirective(BaseModel): + """Remove the directive.""" + + operation: Literal["set", "remove"] + """The operation to perform on the cache-control directive.""" + + cloudflare_only: Optional[bool] = None + """Whether the directive should only be applied to the Cloudflare CDN cache.""" + + +RuleRulesetsSetCacheControlRuleActionParametersImmutable: TypeAlias = Union[ + RuleRulesetsSetCacheControlRuleActionParametersImmutableSetDirective, + RuleRulesetsSetCacheControlRuleActionParametersImmutableRemoveDirective, +] + + +class RuleRulesetsSetCacheControlRuleActionParametersMaxAgeSetDirective(BaseModel): + """Set the directive with a duration value in seconds.""" + + operation: Literal["set", "remove"] + """The operation to perform on the cache-control directive.""" + + value: int + """The duration value in seconds for the directive.""" + + cloudflare_only: Optional[bool] = None + """Whether the directive should only be applied to the Cloudflare CDN cache.""" + + +class RuleRulesetsSetCacheControlRuleActionParametersMaxAgeRemoveDirective(BaseModel): + """Remove the directive.""" + + operation: Literal["set", "remove"] + """The operation to perform on the cache-control directive.""" + + cloudflare_only: Optional[bool] = None + """Whether the directive should only be applied to the Cloudflare CDN cache.""" + + +RuleRulesetsSetCacheControlRuleActionParametersMaxAge: TypeAlias = Union[ + RuleRulesetsSetCacheControlRuleActionParametersMaxAgeSetDirective, + RuleRulesetsSetCacheControlRuleActionParametersMaxAgeRemoveDirective, +] + + +class RuleRulesetsSetCacheControlRuleActionParametersMustRevalidateSetDirective(BaseModel): + """Set the directive.""" + + operation: Literal["set", "remove"] + """The operation to perform on the cache-control directive.""" + + cloudflare_only: Optional[bool] = None + """Whether the directive should only be applied to the Cloudflare CDN cache.""" + + +class RuleRulesetsSetCacheControlRuleActionParametersMustRevalidateRemoveDirective(BaseModel): + """Remove the directive.""" + + operation: Literal["set", "remove"] + """The operation to perform on the cache-control directive.""" + + cloudflare_only: Optional[bool] = None + """Whether the directive should only be applied to the Cloudflare CDN cache.""" + + +RuleRulesetsSetCacheControlRuleActionParametersMustRevalidate: TypeAlias = Union[ + RuleRulesetsSetCacheControlRuleActionParametersMustRevalidateSetDirective, + RuleRulesetsSetCacheControlRuleActionParametersMustRevalidateRemoveDirective, +] + + +class RuleRulesetsSetCacheControlRuleActionParametersMustUnderstandSetDirective(BaseModel): + """Set the directive.""" + + operation: Literal["set", "remove"] + """The operation to perform on the cache-control directive.""" + + cloudflare_only: Optional[bool] = None + """Whether the directive should only be applied to the Cloudflare CDN cache.""" + + +class RuleRulesetsSetCacheControlRuleActionParametersMustUnderstandRemoveDirective(BaseModel): + """Remove the directive.""" + + operation: Literal["set", "remove"] + """The operation to perform on the cache-control directive.""" + + cloudflare_only: Optional[bool] = None + """Whether the directive should only be applied to the Cloudflare CDN cache.""" + + +RuleRulesetsSetCacheControlRuleActionParametersMustUnderstand: TypeAlias = Union[ + RuleRulesetsSetCacheControlRuleActionParametersMustUnderstandSetDirective, + RuleRulesetsSetCacheControlRuleActionParametersMustUnderstandRemoveDirective, +] + + +class RuleRulesetsSetCacheControlRuleActionParametersNoCacheSetDirective(BaseModel): + """Set the directive with optional qualifiers.""" + + operation: Literal["set", "remove"] + """The operation to perform on the cache-control directive.""" + + cloudflare_only: Optional[bool] = None + """Whether the directive should only be applied to the Cloudflare CDN cache.""" + + qualifiers: Optional[List[str]] = None + """ + Optional list of header names to qualify the directive (e.g., for "private" or + "no-cache" directives). + """ + + +class RuleRulesetsSetCacheControlRuleActionParametersNoCacheRemoveDirective(BaseModel): + """Remove the directive.""" + + operation: Literal["set", "remove"] + """The operation to perform on the cache-control directive.""" + + cloudflare_only: Optional[bool] = None + """Whether the directive should only be applied to the Cloudflare CDN cache.""" + + +RuleRulesetsSetCacheControlRuleActionParametersNoCache: TypeAlias = Union[ + RuleRulesetsSetCacheControlRuleActionParametersNoCacheSetDirective, + RuleRulesetsSetCacheControlRuleActionParametersNoCacheRemoveDirective, +] + + +class RuleRulesetsSetCacheControlRuleActionParametersNoStoreSetDirective(BaseModel): + """Set the directive.""" + + operation: Literal["set", "remove"] + """The operation to perform on the cache-control directive.""" + + cloudflare_only: Optional[bool] = None + """Whether the directive should only be applied to the Cloudflare CDN cache.""" + + +class RuleRulesetsSetCacheControlRuleActionParametersNoStoreRemoveDirective(BaseModel): + """Remove the directive.""" + + operation: Literal["set", "remove"] + """The operation to perform on the cache-control directive.""" + + cloudflare_only: Optional[bool] = None + """Whether the directive should only be applied to the Cloudflare CDN cache.""" + + +RuleRulesetsSetCacheControlRuleActionParametersNoStore: TypeAlias = Union[ + RuleRulesetsSetCacheControlRuleActionParametersNoStoreSetDirective, + RuleRulesetsSetCacheControlRuleActionParametersNoStoreRemoveDirective, +] + + +class RuleRulesetsSetCacheControlRuleActionParametersNoTransformSetDirective(BaseModel): + """Set the directive.""" + + operation: Literal["set", "remove"] + """The operation to perform on the cache-control directive.""" + + cloudflare_only: Optional[bool] = None + """Whether the directive should only be applied to the Cloudflare CDN cache.""" + + +class RuleRulesetsSetCacheControlRuleActionParametersNoTransformRemoveDirective(BaseModel): + """Remove the directive.""" + + operation: Literal["set", "remove"] + """The operation to perform on the cache-control directive.""" + + cloudflare_only: Optional[bool] = None + """Whether the directive should only be applied to the Cloudflare CDN cache.""" + + +RuleRulesetsSetCacheControlRuleActionParametersNoTransform: TypeAlias = Union[ + RuleRulesetsSetCacheControlRuleActionParametersNoTransformSetDirective, + RuleRulesetsSetCacheControlRuleActionParametersNoTransformRemoveDirective, +] + + +class RuleRulesetsSetCacheControlRuleActionParametersPrivateSetDirective(BaseModel): + """Set the directive with optional qualifiers.""" + + operation: Literal["set", "remove"] + """The operation to perform on the cache-control directive.""" + + cloudflare_only: Optional[bool] = None + """Whether the directive should only be applied to the Cloudflare CDN cache.""" + + qualifiers: Optional[List[str]] = None + """ + Optional list of header names to qualify the directive (e.g., for "private" or + "no-cache" directives). + """ + + +class RuleRulesetsSetCacheControlRuleActionParametersPrivateRemoveDirective(BaseModel): + """Remove the directive.""" + + operation: Literal["set", "remove"] + """The operation to perform on the cache-control directive.""" + + cloudflare_only: Optional[bool] = None + """Whether the directive should only be applied to the Cloudflare CDN cache.""" + + +RuleRulesetsSetCacheControlRuleActionParametersPrivate: TypeAlias = Union[ + RuleRulesetsSetCacheControlRuleActionParametersPrivateSetDirective, + RuleRulesetsSetCacheControlRuleActionParametersPrivateRemoveDirective, +] + + +class RuleRulesetsSetCacheControlRuleActionParametersProxyRevalidateSetDirective(BaseModel): + """Set the directive.""" + + operation: Literal["set", "remove"] + """The operation to perform on the cache-control directive.""" + + cloudflare_only: Optional[bool] = None + """Whether the directive should only be applied to the Cloudflare CDN cache.""" + + +class RuleRulesetsSetCacheControlRuleActionParametersProxyRevalidateRemoveDirective(BaseModel): + """Remove the directive.""" + + operation: Literal["set", "remove"] + """The operation to perform on the cache-control directive.""" + + cloudflare_only: Optional[bool] = None + """Whether the directive should only be applied to the Cloudflare CDN cache.""" + + +RuleRulesetsSetCacheControlRuleActionParametersProxyRevalidate: TypeAlias = Union[ + RuleRulesetsSetCacheControlRuleActionParametersProxyRevalidateSetDirective, + RuleRulesetsSetCacheControlRuleActionParametersProxyRevalidateRemoveDirective, +] + + +class RuleRulesetsSetCacheControlRuleActionParametersPublicSetDirective(BaseModel): + """Set the directive.""" + + operation: Literal["set", "remove"] + """The operation to perform on the cache-control directive.""" + + cloudflare_only: Optional[bool] = None + """Whether the directive should only be applied to the Cloudflare CDN cache.""" + + +class RuleRulesetsSetCacheControlRuleActionParametersPublicRemoveDirective(BaseModel): + """Remove the directive.""" + + operation: Literal["set", "remove"] + """The operation to perform on the cache-control directive.""" + + cloudflare_only: Optional[bool] = None + """Whether the directive should only be applied to the Cloudflare CDN cache.""" + + +RuleRulesetsSetCacheControlRuleActionParametersPublic: TypeAlias = Union[ + RuleRulesetsSetCacheControlRuleActionParametersPublicSetDirective, + RuleRulesetsSetCacheControlRuleActionParametersPublicRemoveDirective, +] + + +class RuleRulesetsSetCacheControlRuleActionParametersSMaxageSetDirective(BaseModel): + """Set the directive with a duration value in seconds.""" + + operation: Literal["set", "remove"] + """The operation to perform on the cache-control directive.""" + + value: int + """The duration value in seconds for the directive.""" + + cloudflare_only: Optional[bool] = None + """Whether the directive should only be applied to the Cloudflare CDN cache.""" + + +class RuleRulesetsSetCacheControlRuleActionParametersSMaxageRemoveDirective(BaseModel): + """Remove the directive.""" + + operation: Literal["set", "remove"] + """The operation to perform on the cache-control directive.""" + + cloudflare_only: Optional[bool] = None + """Whether the directive should only be applied to the Cloudflare CDN cache.""" + + +RuleRulesetsSetCacheControlRuleActionParametersSMaxage: TypeAlias = Union[ + RuleRulesetsSetCacheControlRuleActionParametersSMaxageSetDirective, + RuleRulesetsSetCacheControlRuleActionParametersSMaxageRemoveDirective, +] + + +class RuleRulesetsSetCacheControlRuleActionParametersStaleIfErrorSetDirective(BaseModel): + """Set the directive with a duration value in seconds.""" + + operation: Literal["set", "remove"] + """The operation to perform on the cache-control directive.""" + + value: int + """The duration value in seconds for the directive.""" + + cloudflare_only: Optional[bool] = None + """Whether the directive should only be applied to the Cloudflare CDN cache.""" + + +class RuleRulesetsSetCacheControlRuleActionParametersStaleIfErrorRemoveDirective(BaseModel): + """Remove the directive.""" + + operation: Literal["set", "remove"] + """The operation to perform on the cache-control directive.""" + + cloudflare_only: Optional[bool] = None + """Whether the directive should only be applied to the Cloudflare CDN cache.""" + + +RuleRulesetsSetCacheControlRuleActionParametersStaleIfError: TypeAlias = Union[ + RuleRulesetsSetCacheControlRuleActionParametersStaleIfErrorSetDirective, + RuleRulesetsSetCacheControlRuleActionParametersStaleIfErrorRemoveDirective, +] + + +class RuleRulesetsSetCacheControlRuleActionParametersStaleWhileRevalidateSetDirective(BaseModel): + """Set the directive with a duration value in seconds.""" + + operation: Literal["set", "remove"] + """The operation to perform on the cache-control directive.""" + + value: int + """The duration value in seconds for the directive.""" + + cloudflare_only: Optional[bool] = None + """Whether the directive should only be applied to the Cloudflare CDN cache.""" + + +class RuleRulesetsSetCacheControlRuleActionParametersStaleWhileRevalidateRemoveDirective(BaseModel): + """Remove the directive.""" + + operation: Literal["set", "remove"] + """The operation to perform on the cache-control directive.""" + + cloudflare_only: Optional[bool] = None + """Whether the directive should only be applied to the Cloudflare CDN cache.""" + + +RuleRulesetsSetCacheControlRuleActionParametersStaleWhileRevalidate: TypeAlias = Union[ + RuleRulesetsSetCacheControlRuleActionParametersStaleWhileRevalidateSetDirective, + RuleRulesetsSetCacheControlRuleActionParametersStaleWhileRevalidateRemoveDirective, +] + + +class RuleRulesetsSetCacheControlRuleActionParameters(BaseModel): + """The parameters configuring the rule's action.""" + + immutable: Optional[RuleRulesetsSetCacheControlRuleActionParametersImmutable] = None + """A cache-control directive configuration.""" + + max_age: Optional[RuleRulesetsSetCacheControlRuleActionParametersMaxAge] = FieldInfo(alias="max-age", default=None) + """ + A cache-control directive configuration that accepts a duration value in + seconds. + """ + + must_revalidate: Optional[RuleRulesetsSetCacheControlRuleActionParametersMustRevalidate] = FieldInfo( + alias="must-revalidate", default=None + ) + """A cache-control directive configuration.""" + + must_understand: Optional[RuleRulesetsSetCacheControlRuleActionParametersMustUnderstand] = FieldInfo( + alias="must-understand", default=None + ) + """A cache-control directive configuration.""" + + no_cache: Optional[RuleRulesetsSetCacheControlRuleActionParametersNoCache] = FieldInfo( + alias="no-cache", default=None + ) + """ + A cache-control directive configuration that accepts optional qualifiers (header + names). + """ + + no_store: Optional[RuleRulesetsSetCacheControlRuleActionParametersNoStore] = FieldInfo( + alias="no-store", default=None + ) + """A cache-control directive configuration.""" + + no_transform: Optional[RuleRulesetsSetCacheControlRuleActionParametersNoTransform] = FieldInfo( + alias="no-transform", default=None + ) + """A cache-control directive configuration.""" + + private: Optional[RuleRulesetsSetCacheControlRuleActionParametersPrivate] = None + """ + A cache-control directive configuration that accepts optional qualifiers (header + names). + """ + + proxy_revalidate: Optional[RuleRulesetsSetCacheControlRuleActionParametersProxyRevalidate] = FieldInfo( + alias="proxy-revalidate", default=None + ) + """A cache-control directive configuration.""" + + public: Optional[RuleRulesetsSetCacheControlRuleActionParametersPublic] = None + """A cache-control directive configuration.""" + + s_maxage: Optional[RuleRulesetsSetCacheControlRuleActionParametersSMaxage] = FieldInfo( + alias="s-maxage", default=None + ) + """ + A cache-control directive configuration that accepts a duration value in + seconds. + """ + + stale_if_error: Optional[RuleRulesetsSetCacheControlRuleActionParametersStaleIfError] = FieldInfo( + alias="stale-if-error", default=None + ) + """ + A cache-control directive configuration that accepts a duration value in + seconds. + """ + + stale_while_revalidate: Optional[RuleRulesetsSetCacheControlRuleActionParametersStaleWhileRevalidate] = FieldInfo( + alias="stale-while-revalidate", default=None + ) + """ + A cache-control directive configuration that accepts a duration value in + seconds. + """ + + +class RuleRulesetsSetCacheControlRuleExposedCredentialCheck(BaseModel): + """Configuration for exposed credential checking.""" + + password_expression: str + """An expression that selects the password used in the credentials check.""" + + username_expression: str + """An expression that selects the user ID used in the credentials check.""" + + +class RuleRulesetsSetCacheControlRuleRatelimit(BaseModel): + """An object configuring the rule's rate limit behavior.""" + + characteristics: List[str] + """ + Characteristics of the request on which the rate limit counter will be + incremented. + """ + + period: int + """Period in seconds over which the counter is being incremented.""" + + counting_expression: Optional[str] = None + """An expression that defines when the rate limit counter should be incremented. + + It defaults to the same as the rule's expression. + """ + + mitigation_timeout: Optional[int] = None + """ + Period of time in seconds after which the action will be disabled following its + first execution. + """ + + requests_per_period: Optional[int] = None + """ + The threshold of requests per period after which the action will be executed for + the first time. + """ + + requests_to_origin: Optional[bool] = None + """Whether counting is only performed when an origin is reached.""" + + score_per_period: Optional[int] = None + """ + The score threshold per period for which the action will be executed the first + time. + """ + + score_response_header_name: Optional[str] = None + """ + A response header name provided by the origin, which contains the score to + increment rate limit counter with. + """ + + +class RuleRulesetsSetCacheControlRule(BaseModel): + last_updated: datetime + """The timestamp of when the rule was last modified.""" + + version: str + """The version of the rule.""" + + id: Optional[str] = None + """The unique ID of the rule.""" + + action: Optional[Literal["set_cache_control"]] = None + """The action to perform when the rule matches.""" + + action_parameters: Optional[RuleRulesetsSetCacheControlRuleActionParameters] = None + """The parameters configuring the rule's action.""" + + categories: Optional[List[str]] = None + """The categories of the rule.""" + + description: Optional[str] = None + """An informative description of the rule.""" + + enabled: Optional[bool] = None + """Whether the rule should be executed.""" + + exposed_credential_check: Optional[RuleRulesetsSetCacheControlRuleExposedCredentialCheck] = None + """Configuration for exposed credential checking.""" + + expression: Optional[str] = None + """The expression defining which traffic will match the rule.""" + + logging: Optional[Logging] = None + """An object configuring the rule's logging behavior.""" + + ratelimit: Optional[RuleRulesetsSetCacheControlRuleRatelimit] = None + """An object configuring the rule's rate limit behavior.""" + + ref: Optional[str] = None + """The reference of the rule (the rule's ID by default).""" + + +class RuleRulesetsSetCacheTagsRuleActionParametersAddCacheTagsValues(BaseModel): + """Add cache tags using a list of values.""" + + operation: Literal["add", "remove", "set"] + """The operation to perform on the cache tags.""" + + values: List[str] + """A list of cache tag values.""" + + +class RuleRulesetsSetCacheTagsRuleActionParametersAddCacheTagsExpression(BaseModel): + """Add cache tags using an expression.""" + + expression: str + """An expression that evaluates to an array of cache tag values.""" + + operation: Literal["add", "remove", "set"] + """The operation to perform on the cache tags.""" + + +class RuleRulesetsSetCacheTagsRuleActionParametersRemoveCacheTagsValues(BaseModel): + """Remove cache tags using a list of values.""" + + operation: Literal["add", "remove", "set"] + """The operation to perform on the cache tags.""" + + values: List[str] + """A list of cache tag values.""" + + +class RuleRulesetsSetCacheTagsRuleActionParametersRemoveCacheTagsExpression(BaseModel): + """Remove cache tags using an expression.""" + + expression: str + """An expression that evaluates to an array of cache tag values.""" + + operation: Literal["add", "remove", "set"] + """The operation to perform on the cache tags.""" + + +class RuleRulesetsSetCacheTagsRuleActionParametersSetCacheTagsValues(BaseModel): + """Set cache tags using a list of values.""" + + operation: Literal["add", "remove", "set"] + """The operation to perform on the cache tags.""" + + values: List[str] + """A list of cache tag values.""" + + +class RuleRulesetsSetCacheTagsRuleActionParametersSetCacheTagsExpression(BaseModel): + """Set cache tags using an expression.""" + + expression: str + """An expression that evaluates to an array of cache tag values.""" + + operation: Literal["add", "remove", "set"] + """The operation to perform on the cache tags.""" + + +RuleRulesetsSetCacheTagsRuleActionParameters: TypeAlias = Union[ + RuleRulesetsSetCacheTagsRuleActionParametersAddCacheTagsValues, + RuleRulesetsSetCacheTagsRuleActionParametersAddCacheTagsExpression, + RuleRulesetsSetCacheTagsRuleActionParametersRemoveCacheTagsValues, + RuleRulesetsSetCacheTagsRuleActionParametersRemoveCacheTagsExpression, + RuleRulesetsSetCacheTagsRuleActionParametersSetCacheTagsValues, + RuleRulesetsSetCacheTagsRuleActionParametersSetCacheTagsExpression, +] + + +class RuleRulesetsSetCacheTagsRuleExposedCredentialCheck(BaseModel): + """Configuration for exposed credential checking.""" + + password_expression: str + """An expression that selects the password used in the credentials check.""" + + username_expression: str + """An expression that selects the user ID used in the credentials check.""" + + +class RuleRulesetsSetCacheTagsRuleRatelimit(BaseModel): + """An object configuring the rule's rate limit behavior.""" + + characteristics: List[str] + """ + Characteristics of the request on which the rate limit counter will be + incremented. + """ + + period: int + """Period in seconds over which the counter is being incremented.""" + + counting_expression: Optional[str] = None + """An expression that defines when the rate limit counter should be incremented. + + It defaults to the same as the rule's expression. + """ + + mitigation_timeout: Optional[int] = None + """ + Period of time in seconds after which the action will be disabled following its + first execution. + """ + + requests_per_period: Optional[int] = None + """ + The threshold of requests per period after which the action will be executed for + the first time. + """ + + requests_to_origin: Optional[bool] = None + """Whether counting is only performed when an origin is reached.""" + + score_per_period: Optional[int] = None + """ + The score threshold per period for which the action will be executed the first + time. + """ + + score_response_header_name: Optional[str] = None + """ + A response header name provided by the origin, which contains the score to + increment rate limit counter with. + """ + + +class RuleRulesetsSetCacheTagsRule(BaseModel): + last_updated: datetime + """The timestamp of when the rule was last modified.""" + + version: str + """The version of the rule.""" + + id: Optional[str] = None + """The unique ID of the rule.""" + + action: Optional[Literal["set_cache_tags"]] = None + """The action to perform when the rule matches.""" + + action_parameters: Optional[RuleRulesetsSetCacheTagsRuleActionParameters] = None + """The parameters configuring the rule's action.""" + + categories: Optional[List[str]] = None + """The categories of the rule.""" + + description: Optional[str] = None + """An informative description of the rule.""" + + enabled: Optional[bool] = None + """Whether the rule should be executed.""" + + exposed_credential_check: Optional[RuleRulesetsSetCacheTagsRuleExposedCredentialCheck] = None + """Configuration for exposed credential checking.""" + + expression: Optional[str] = None + """The expression defining which traffic will match the rule.""" + + logging: Optional[Logging] = None + """An object configuring the rule's logging behavior.""" + + ratelimit: Optional[RuleRulesetsSetCacheTagsRuleRatelimit] = None + """An object configuring the rule's rate limit behavior.""" + + ref: Optional[str] = None + """The reference of the rule (the rule's ID by default).""" + + Rule: TypeAlias = Annotated[ Union[ BlockRule, @@ -249,7 +1009,9 @@ class RuleRulesetsJSChallengeRule(BaseModel): RouteRule, ScoreRule, ServeErrorRule, + RuleRulesetsSetCacheControlRule, SetCacheSettingsRule, + RuleRulesetsSetCacheTagsRule, SetConfigRule, SkipRule, ], diff --git a/src/cloudflare/types/rulesets/rule_delete_response.py b/src/cloudflare/types/rulesets/rule_delete_response.py index a4524c6c260..0477fa7dd06 100644 --- a/src/cloudflare/types/rulesets/rule_delete_response.py +++ b/src/cloudflare/types/rulesets/rule_delete_response.py @@ -4,6 +4,8 @@ from datetime import datetime from typing_extensions import Literal, Annotated, TypeAlias +from pydantic import Field as FieldInfo + from .kind import Kind from .phase import Phase from .logging import Logging @@ -35,6 +37,59 @@ "RuleRulesetsJSChallengeRule", "RuleRulesetsJSChallengeRuleExposedCredentialCheck", "RuleRulesetsJSChallengeRuleRatelimit", + "RuleRulesetsSetCacheControlRule", + "RuleRulesetsSetCacheControlRuleActionParameters", + "RuleRulesetsSetCacheControlRuleActionParametersImmutable", + "RuleRulesetsSetCacheControlRuleActionParametersImmutableSetDirective", + "RuleRulesetsSetCacheControlRuleActionParametersImmutableRemoveDirective", + "RuleRulesetsSetCacheControlRuleActionParametersMaxAge", + "RuleRulesetsSetCacheControlRuleActionParametersMaxAgeSetDirective", + "RuleRulesetsSetCacheControlRuleActionParametersMaxAgeRemoveDirective", + "RuleRulesetsSetCacheControlRuleActionParametersMustRevalidate", + "RuleRulesetsSetCacheControlRuleActionParametersMustRevalidateSetDirective", + "RuleRulesetsSetCacheControlRuleActionParametersMustRevalidateRemoveDirective", + "RuleRulesetsSetCacheControlRuleActionParametersMustUnderstand", + "RuleRulesetsSetCacheControlRuleActionParametersMustUnderstandSetDirective", + "RuleRulesetsSetCacheControlRuleActionParametersMustUnderstandRemoveDirective", + "RuleRulesetsSetCacheControlRuleActionParametersNoCache", + "RuleRulesetsSetCacheControlRuleActionParametersNoCacheSetDirective", + "RuleRulesetsSetCacheControlRuleActionParametersNoCacheRemoveDirective", + "RuleRulesetsSetCacheControlRuleActionParametersNoStore", + "RuleRulesetsSetCacheControlRuleActionParametersNoStoreSetDirective", + "RuleRulesetsSetCacheControlRuleActionParametersNoStoreRemoveDirective", + "RuleRulesetsSetCacheControlRuleActionParametersNoTransform", + "RuleRulesetsSetCacheControlRuleActionParametersNoTransformSetDirective", + "RuleRulesetsSetCacheControlRuleActionParametersNoTransformRemoveDirective", + "RuleRulesetsSetCacheControlRuleActionParametersPrivate", + "RuleRulesetsSetCacheControlRuleActionParametersPrivateSetDirective", + "RuleRulesetsSetCacheControlRuleActionParametersPrivateRemoveDirective", + "RuleRulesetsSetCacheControlRuleActionParametersProxyRevalidate", + "RuleRulesetsSetCacheControlRuleActionParametersProxyRevalidateSetDirective", + "RuleRulesetsSetCacheControlRuleActionParametersProxyRevalidateRemoveDirective", + "RuleRulesetsSetCacheControlRuleActionParametersPublic", + "RuleRulesetsSetCacheControlRuleActionParametersPublicSetDirective", + "RuleRulesetsSetCacheControlRuleActionParametersPublicRemoveDirective", + "RuleRulesetsSetCacheControlRuleActionParametersSMaxage", + "RuleRulesetsSetCacheControlRuleActionParametersSMaxageSetDirective", + "RuleRulesetsSetCacheControlRuleActionParametersSMaxageRemoveDirective", + "RuleRulesetsSetCacheControlRuleActionParametersStaleIfError", + "RuleRulesetsSetCacheControlRuleActionParametersStaleIfErrorSetDirective", + "RuleRulesetsSetCacheControlRuleActionParametersStaleIfErrorRemoveDirective", + "RuleRulesetsSetCacheControlRuleActionParametersStaleWhileRevalidate", + "RuleRulesetsSetCacheControlRuleActionParametersStaleWhileRevalidateSetDirective", + "RuleRulesetsSetCacheControlRuleActionParametersStaleWhileRevalidateRemoveDirective", + "RuleRulesetsSetCacheControlRuleExposedCredentialCheck", + "RuleRulesetsSetCacheControlRuleRatelimit", + "RuleRulesetsSetCacheTagsRule", + "RuleRulesetsSetCacheTagsRuleActionParameters", + "RuleRulesetsSetCacheTagsRuleActionParametersAddCacheTagsValues", + "RuleRulesetsSetCacheTagsRuleActionParametersAddCacheTagsExpression", + "RuleRulesetsSetCacheTagsRuleActionParametersRemoveCacheTagsValues", + "RuleRulesetsSetCacheTagsRuleActionParametersRemoveCacheTagsExpression", + "RuleRulesetsSetCacheTagsRuleActionParametersSetCacheTagsValues", + "RuleRulesetsSetCacheTagsRuleActionParametersSetCacheTagsExpression", + "RuleRulesetsSetCacheTagsRuleExposedCredentialCheck", + "RuleRulesetsSetCacheTagsRuleRatelimit", ] @@ -232,6 +287,711 @@ class RuleRulesetsJSChallengeRule(BaseModel): """The reference of the rule (the rule's ID by default).""" +class RuleRulesetsSetCacheControlRuleActionParametersImmutableSetDirective(BaseModel): + """Set the directive.""" + + operation: Literal["set", "remove"] + """The operation to perform on the cache-control directive.""" + + cloudflare_only: Optional[bool] = None + """Whether the directive should only be applied to the Cloudflare CDN cache.""" + + +class RuleRulesetsSetCacheControlRuleActionParametersImmutableRemoveDirective(BaseModel): + """Remove the directive.""" + + operation: Literal["set", "remove"] + """The operation to perform on the cache-control directive.""" + + cloudflare_only: Optional[bool] = None + """Whether the directive should only be applied to the Cloudflare CDN cache.""" + + +RuleRulesetsSetCacheControlRuleActionParametersImmutable: TypeAlias = Union[ + RuleRulesetsSetCacheControlRuleActionParametersImmutableSetDirective, + RuleRulesetsSetCacheControlRuleActionParametersImmutableRemoveDirective, +] + + +class RuleRulesetsSetCacheControlRuleActionParametersMaxAgeSetDirective(BaseModel): + """Set the directive with a duration value in seconds.""" + + operation: Literal["set", "remove"] + """The operation to perform on the cache-control directive.""" + + value: int + """The duration value in seconds for the directive.""" + + cloudflare_only: Optional[bool] = None + """Whether the directive should only be applied to the Cloudflare CDN cache.""" + + +class RuleRulesetsSetCacheControlRuleActionParametersMaxAgeRemoveDirective(BaseModel): + """Remove the directive.""" + + operation: Literal["set", "remove"] + """The operation to perform on the cache-control directive.""" + + cloudflare_only: Optional[bool] = None + """Whether the directive should only be applied to the Cloudflare CDN cache.""" + + +RuleRulesetsSetCacheControlRuleActionParametersMaxAge: TypeAlias = Union[ + RuleRulesetsSetCacheControlRuleActionParametersMaxAgeSetDirective, + RuleRulesetsSetCacheControlRuleActionParametersMaxAgeRemoveDirective, +] + + +class RuleRulesetsSetCacheControlRuleActionParametersMustRevalidateSetDirective(BaseModel): + """Set the directive.""" + + operation: Literal["set", "remove"] + """The operation to perform on the cache-control directive.""" + + cloudflare_only: Optional[bool] = None + """Whether the directive should only be applied to the Cloudflare CDN cache.""" + + +class RuleRulesetsSetCacheControlRuleActionParametersMustRevalidateRemoveDirective(BaseModel): + """Remove the directive.""" + + operation: Literal["set", "remove"] + """The operation to perform on the cache-control directive.""" + + cloudflare_only: Optional[bool] = None + """Whether the directive should only be applied to the Cloudflare CDN cache.""" + + +RuleRulesetsSetCacheControlRuleActionParametersMustRevalidate: TypeAlias = Union[ + RuleRulesetsSetCacheControlRuleActionParametersMustRevalidateSetDirective, + RuleRulesetsSetCacheControlRuleActionParametersMustRevalidateRemoveDirective, +] + + +class RuleRulesetsSetCacheControlRuleActionParametersMustUnderstandSetDirective(BaseModel): + """Set the directive.""" + + operation: Literal["set", "remove"] + """The operation to perform on the cache-control directive.""" + + cloudflare_only: Optional[bool] = None + """Whether the directive should only be applied to the Cloudflare CDN cache.""" + + +class RuleRulesetsSetCacheControlRuleActionParametersMustUnderstandRemoveDirective(BaseModel): + """Remove the directive.""" + + operation: Literal["set", "remove"] + """The operation to perform on the cache-control directive.""" + + cloudflare_only: Optional[bool] = None + """Whether the directive should only be applied to the Cloudflare CDN cache.""" + + +RuleRulesetsSetCacheControlRuleActionParametersMustUnderstand: TypeAlias = Union[ + RuleRulesetsSetCacheControlRuleActionParametersMustUnderstandSetDirective, + RuleRulesetsSetCacheControlRuleActionParametersMustUnderstandRemoveDirective, +] + + +class RuleRulesetsSetCacheControlRuleActionParametersNoCacheSetDirective(BaseModel): + """Set the directive with optional qualifiers.""" + + operation: Literal["set", "remove"] + """The operation to perform on the cache-control directive.""" + + cloudflare_only: Optional[bool] = None + """Whether the directive should only be applied to the Cloudflare CDN cache.""" + + qualifiers: Optional[List[str]] = None + """ + Optional list of header names to qualify the directive (e.g., for "private" or + "no-cache" directives). + """ + + +class RuleRulesetsSetCacheControlRuleActionParametersNoCacheRemoveDirective(BaseModel): + """Remove the directive.""" + + operation: Literal["set", "remove"] + """The operation to perform on the cache-control directive.""" + + cloudflare_only: Optional[bool] = None + """Whether the directive should only be applied to the Cloudflare CDN cache.""" + + +RuleRulesetsSetCacheControlRuleActionParametersNoCache: TypeAlias = Union[ + RuleRulesetsSetCacheControlRuleActionParametersNoCacheSetDirective, + RuleRulesetsSetCacheControlRuleActionParametersNoCacheRemoveDirective, +] + + +class RuleRulesetsSetCacheControlRuleActionParametersNoStoreSetDirective(BaseModel): + """Set the directive.""" + + operation: Literal["set", "remove"] + """The operation to perform on the cache-control directive.""" + + cloudflare_only: Optional[bool] = None + """Whether the directive should only be applied to the Cloudflare CDN cache.""" + + +class RuleRulesetsSetCacheControlRuleActionParametersNoStoreRemoveDirective(BaseModel): + """Remove the directive.""" + + operation: Literal["set", "remove"] + """The operation to perform on the cache-control directive.""" + + cloudflare_only: Optional[bool] = None + """Whether the directive should only be applied to the Cloudflare CDN cache.""" + + +RuleRulesetsSetCacheControlRuleActionParametersNoStore: TypeAlias = Union[ + RuleRulesetsSetCacheControlRuleActionParametersNoStoreSetDirective, + RuleRulesetsSetCacheControlRuleActionParametersNoStoreRemoveDirective, +] + + +class RuleRulesetsSetCacheControlRuleActionParametersNoTransformSetDirective(BaseModel): + """Set the directive.""" + + operation: Literal["set", "remove"] + """The operation to perform on the cache-control directive.""" + + cloudflare_only: Optional[bool] = None + """Whether the directive should only be applied to the Cloudflare CDN cache.""" + + +class RuleRulesetsSetCacheControlRuleActionParametersNoTransformRemoveDirective(BaseModel): + """Remove the directive.""" + + operation: Literal["set", "remove"] + """The operation to perform on the cache-control directive.""" + + cloudflare_only: Optional[bool] = None + """Whether the directive should only be applied to the Cloudflare CDN cache.""" + + +RuleRulesetsSetCacheControlRuleActionParametersNoTransform: TypeAlias = Union[ + RuleRulesetsSetCacheControlRuleActionParametersNoTransformSetDirective, + RuleRulesetsSetCacheControlRuleActionParametersNoTransformRemoveDirective, +] + + +class RuleRulesetsSetCacheControlRuleActionParametersPrivateSetDirective(BaseModel): + """Set the directive with optional qualifiers.""" + + operation: Literal["set", "remove"] + """The operation to perform on the cache-control directive.""" + + cloudflare_only: Optional[bool] = None + """Whether the directive should only be applied to the Cloudflare CDN cache.""" + + qualifiers: Optional[List[str]] = None + """ + Optional list of header names to qualify the directive (e.g., for "private" or + "no-cache" directives). + """ + + +class RuleRulesetsSetCacheControlRuleActionParametersPrivateRemoveDirective(BaseModel): + """Remove the directive.""" + + operation: Literal["set", "remove"] + """The operation to perform on the cache-control directive.""" + + cloudflare_only: Optional[bool] = None + """Whether the directive should only be applied to the Cloudflare CDN cache.""" + + +RuleRulesetsSetCacheControlRuleActionParametersPrivate: TypeAlias = Union[ + RuleRulesetsSetCacheControlRuleActionParametersPrivateSetDirective, + RuleRulesetsSetCacheControlRuleActionParametersPrivateRemoveDirective, +] + + +class RuleRulesetsSetCacheControlRuleActionParametersProxyRevalidateSetDirective(BaseModel): + """Set the directive.""" + + operation: Literal["set", "remove"] + """The operation to perform on the cache-control directive.""" + + cloudflare_only: Optional[bool] = None + """Whether the directive should only be applied to the Cloudflare CDN cache.""" + + +class RuleRulesetsSetCacheControlRuleActionParametersProxyRevalidateRemoveDirective(BaseModel): + """Remove the directive.""" + + operation: Literal["set", "remove"] + """The operation to perform on the cache-control directive.""" + + cloudflare_only: Optional[bool] = None + """Whether the directive should only be applied to the Cloudflare CDN cache.""" + + +RuleRulesetsSetCacheControlRuleActionParametersProxyRevalidate: TypeAlias = Union[ + RuleRulesetsSetCacheControlRuleActionParametersProxyRevalidateSetDirective, + RuleRulesetsSetCacheControlRuleActionParametersProxyRevalidateRemoveDirective, +] + + +class RuleRulesetsSetCacheControlRuleActionParametersPublicSetDirective(BaseModel): + """Set the directive.""" + + operation: Literal["set", "remove"] + """The operation to perform on the cache-control directive.""" + + cloudflare_only: Optional[bool] = None + """Whether the directive should only be applied to the Cloudflare CDN cache.""" + + +class RuleRulesetsSetCacheControlRuleActionParametersPublicRemoveDirective(BaseModel): + """Remove the directive.""" + + operation: Literal["set", "remove"] + """The operation to perform on the cache-control directive.""" + + cloudflare_only: Optional[bool] = None + """Whether the directive should only be applied to the Cloudflare CDN cache.""" + + +RuleRulesetsSetCacheControlRuleActionParametersPublic: TypeAlias = Union[ + RuleRulesetsSetCacheControlRuleActionParametersPublicSetDirective, + RuleRulesetsSetCacheControlRuleActionParametersPublicRemoveDirective, +] + + +class RuleRulesetsSetCacheControlRuleActionParametersSMaxageSetDirective(BaseModel): + """Set the directive with a duration value in seconds.""" + + operation: Literal["set", "remove"] + """The operation to perform on the cache-control directive.""" + + value: int + """The duration value in seconds for the directive.""" + + cloudflare_only: Optional[bool] = None + """Whether the directive should only be applied to the Cloudflare CDN cache.""" + + +class RuleRulesetsSetCacheControlRuleActionParametersSMaxageRemoveDirective(BaseModel): + """Remove the directive.""" + + operation: Literal["set", "remove"] + """The operation to perform on the cache-control directive.""" + + cloudflare_only: Optional[bool] = None + """Whether the directive should only be applied to the Cloudflare CDN cache.""" + + +RuleRulesetsSetCacheControlRuleActionParametersSMaxage: TypeAlias = Union[ + RuleRulesetsSetCacheControlRuleActionParametersSMaxageSetDirective, + RuleRulesetsSetCacheControlRuleActionParametersSMaxageRemoveDirective, +] + + +class RuleRulesetsSetCacheControlRuleActionParametersStaleIfErrorSetDirective(BaseModel): + """Set the directive with a duration value in seconds.""" + + operation: Literal["set", "remove"] + """The operation to perform on the cache-control directive.""" + + value: int + """The duration value in seconds for the directive.""" + + cloudflare_only: Optional[bool] = None + """Whether the directive should only be applied to the Cloudflare CDN cache.""" + + +class RuleRulesetsSetCacheControlRuleActionParametersStaleIfErrorRemoveDirective(BaseModel): + """Remove the directive.""" + + operation: Literal["set", "remove"] + """The operation to perform on the cache-control directive.""" + + cloudflare_only: Optional[bool] = None + """Whether the directive should only be applied to the Cloudflare CDN cache.""" + + +RuleRulesetsSetCacheControlRuleActionParametersStaleIfError: TypeAlias = Union[ + RuleRulesetsSetCacheControlRuleActionParametersStaleIfErrorSetDirective, + RuleRulesetsSetCacheControlRuleActionParametersStaleIfErrorRemoveDirective, +] + + +class RuleRulesetsSetCacheControlRuleActionParametersStaleWhileRevalidateSetDirective(BaseModel): + """Set the directive with a duration value in seconds.""" + + operation: Literal["set", "remove"] + """The operation to perform on the cache-control directive.""" + + value: int + """The duration value in seconds for the directive.""" + + cloudflare_only: Optional[bool] = None + """Whether the directive should only be applied to the Cloudflare CDN cache.""" + + +class RuleRulesetsSetCacheControlRuleActionParametersStaleWhileRevalidateRemoveDirective(BaseModel): + """Remove the directive.""" + + operation: Literal["set", "remove"] + """The operation to perform on the cache-control directive.""" + + cloudflare_only: Optional[bool] = None + """Whether the directive should only be applied to the Cloudflare CDN cache.""" + + +RuleRulesetsSetCacheControlRuleActionParametersStaleWhileRevalidate: TypeAlias = Union[ + RuleRulesetsSetCacheControlRuleActionParametersStaleWhileRevalidateSetDirective, + RuleRulesetsSetCacheControlRuleActionParametersStaleWhileRevalidateRemoveDirective, +] + + +class RuleRulesetsSetCacheControlRuleActionParameters(BaseModel): + """The parameters configuring the rule's action.""" + + immutable: Optional[RuleRulesetsSetCacheControlRuleActionParametersImmutable] = None + """A cache-control directive configuration.""" + + max_age: Optional[RuleRulesetsSetCacheControlRuleActionParametersMaxAge] = FieldInfo(alias="max-age", default=None) + """ + A cache-control directive configuration that accepts a duration value in + seconds. + """ + + must_revalidate: Optional[RuleRulesetsSetCacheControlRuleActionParametersMustRevalidate] = FieldInfo( + alias="must-revalidate", default=None + ) + """A cache-control directive configuration.""" + + must_understand: Optional[RuleRulesetsSetCacheControlRuleActionParametersMustUnderstand] = FieldInfo( + alias="must-understand", default=None + ) + """A cache-control directive configuration.""" + + no_cache: Optional[RuleRulesetsSetCacheControlRuleActionParametersNoCache] = FieldInfo( + alias="no-cache", default=None + ) + """ + A cache-control directive configuration that accepts optional qualifiers (header + names). + """ + + no_store: Optional[RuleRulesetsSetCacheControlRuleActionParametersNoStore] = FieldInfo( + alias="no-store", default=None + ) + """A cache-control directive configuration.""" + + no_transform: Optional[RuleRulesetsSetCacheControlRuleActionParametersNoTransform] = FieldInfo( + alias="no-transform", default=None + ) + """A cache-control directive configuration.""" + + private: Optional[RuleRulesetsSetCacheControlRuleActionParametersPrivate] = None + """ + A cache-control directive configuration that accepts optional qualifiers (header + names). + """ + + proxy_revalidate: Optional[RuleRulesetsSetCacheControlRuleActionParametersProxyRevalidate] = FieldInfo( + alias="proxy-revalidate", default=None + ) + """A cache-control directive configuration.""" + + public: Optional[RuleRulesetsSetCacheControlRuleActionParametersPublic] = None + """A cache-control directive configuration.""" + + s_maxage: Optional[RuleRulesetsSetCacheControlRuleActionParametersSMaxage] = FieldInfo( + alias="s-maxage", default=None + ) + """ + A cache-control directive configuration that accepts a duration value in + seconds. + """ + + stale_if_error: Optional[RuleRulesetsSetCacheControlRuleActionParametersStaleIfError] = FieldInfo( + alias="stale-if-error", default=None + ) + """ + A cache-control directive configuration that accepts a duration value in + seconds. + """ + + stale_while_revalidate: Optional[RuleRulesetsSetCacheControlRuleActionParametersStaleWhileRevalidate] = FieldInfo( + alias="stale-while-revalidate", default=None + ) + """ + A cache-control directive configuration that accepts a duration value in + seconds. + """ + + +class RuleRulesetsSetCacheControlRuleExposedCredentialCheck(BaseModel): + """Configuration for exposed credential checking.""" + + password_expression: str + """An expression that selects the password used in the credentials check.""" + + username_expression: str + """An expression that selects the user ID used in the credentials check.""" + + +class RuleRulesetsSetCacheControlRuleRatelimit(BaseModel): + """An object configuring the rule's rate limit behavior.""" + + characteristics: List[str] + """ + Characteristics of the request on which the rate limit counter will be + incremented. + """ + + period: int + """Period in seconds over which the counter is being incremented.""" + + counting_expression: Optional[str] = None + """An expression that defines when the rate limit counter should be incremented. + + It defaults to the same as the rule's expression. + """ + + mitigation_timeout: Optional[int] = None + """ + Period of time in seconds after which the action will be disabled following its + first execution. + """ + + requests_per_period: Optional[int] = None + """ + The threshold of requests per period after which the action will be executed for + the first time. + """ + + requests_to_origin: Optional[bool] = None + """Whether counting is only performed when an origin is reached.""" + + score_per_period: Optional[int] = None + """ + The score threshold per period for which the action will be executed the first + time. + """ + + score_response_header_name: Optional[str] = None + """ + A response header name provided by the origin, which contains the score to + increment rate limit counter with. + """ + + +class RuleRulesetsSetCacheControlRule(BaseModel): + last_updated: datetime + """The timestamp of when the rule was last modified.""" + + version: str + """The version of the rule.""" + + id: Optional[str] = None + """The unique ID of the rule.""" + + action: Optional[Literal["set_cache_control"]] = None + """The action to perform when the rule matches.""" + + action_parameters: Optional[RuleRulesetsSetCacheControlRuleActionParameters] = None + """The parameters configuring the rule's action.""" + + categories: Optional[List[str]] = None + """The categories of the rule.""" + + description: Optional[str] = None + """An informative description of the rule.""" + + enabled: Optional[bool] = None + """Whether the rule should be executed.""" + + exposed_credential_check: Optional[RuleRulesetsSetCacheControlRuleExposedCredentialCheck] = None + """Configuration for exposed credential checking.""" + + expression: Optional[str] = None + """The expression defining which traffic will match the rule.""" + + logging: Optional[Logging] = None + """An object configuring the rule's logging behavior.""" + + ratelimit: Optional[RuleRulesetsSetCacheControlRuleRatelimit] = None + """An object configuring the rule's rate limit behavior.""" + + ref: Optional[str] = None + """The reference of the rule (the rule's ID by default).""" + + +class RuleRulesetsSetCacheTagsRuleActionParametersAddCacheTagsValues(BaseModel): + """Add cache tags using a list of values.""" + + operation: Literal["add", "remove", "set"] + """The operation to perform on the cache tags.""" + + values: List[str] + """A list of cache tag values.""" + + +class RuleRulesetsSetCacheTagsRuleActionParametersAddCacheTagsExpression(BaseModel): + """Add cache tags using an expression.""" + + expression: str + """An expression that evaluates to an array of cache tag values.""" + + operation: Literal["add", "remove", "set"] + """The operation to perform on the cache tags.""" + + +class RuleRulesetsSetCacheTagsRuleActionParametersRemoveCacheTagsValues(BaseModel): + """Remove cache tags using a list of values.""" + + operation: Literal["add", "remove", "set"] + """The operation to perform on the cache tags.""" + + values: List[str] + """A list of cache tag values.""" + + +class RuleRulesetsSetCacheTagsRuleActionParametersRemoveCacheTagsExpression(BaseModel): + """Remove cache tags using an expression.""" + + expression: str + """An expression that evaluates to an array of cache tag values.""" + + operation: Literal["add", "remove", "set"] + """The operation to perform on the cache tags.""" + + +class RuleRulesetsSetCacheTagsRuleActionParametersSetCacheTagsValues(BaseModel): + """Set cache tags using a list of values.""" + + operation: Literal["add", "remove", "set"] + """The operation to perform on the cache tags.""" + + values: List[str] + """A list of cache tag values.""" + + +class RuleRulesetsSetCacheTagsRuleActionParametersSetCacheTagsExpression(BaseModel): + """Set cache tags using an expression.""" + + expression: str + """An expression that evaluates to an array of cache tag values.""" + + operation: Literal["add", "remove", "set"] + """The operation to perform on the cache tags.""" + + +RuleRulesetsSetCacheTagsRuleActionParameters: TypeAlias = Union[ + RuleRulesetsSetCacheTagsRuleActionParametersAddCacheTagsValues, + RuleRulesetsSetCacheTagsRuleActionParametersAddCacheTagsExpression, + RuleRulesetsSetCacheTagsRuleActionParametersRemoveCacheTagsValues, + RuleRulesetsSetCacheTagsRuleActionParametersRemoveCacheTagsExpression, + RuleRulesetsSetCacheTagsRuleActionParametersSetCacheTagsValues, + RuleRulesetsSetCacheTagsRuleActionParametersSetCacheTagsExpression, +] + + +class RuleRulesetsSetCacheTagsRuleExposedCredentialCheck(BaseModel): + """Configuration for exposed credential checking.""" + + password_expression: str + """An expression that selects the password used in the credentials check.""" + + username_expression: str + """An expression that selects the user ID used in the credentials check.""" + + +class RuleRulesetsSetCacheTagsRuleRatelimit(BaseModel): + """An object configuring the rule's rate limit behavior.""" + + characteristics: List[str] + """ + Characteristics of the request on which the rate limit counter will be + incremented. + """ + + period: int + """Period in seconds over which the counter is being incremented.""" + + counting_expression: Optional[str] = None + """An expression that defines when the rate limit counter should be incremented. + + It defaults to the same as the rule's expression. + """ + + mitigation_timeout: Optional[int] = None + """ + Period of time in seconds after which the action will be disabled following its + first execution. + """ + + requests_per_period: Optional[int] = None + """ + The threshold of requests per period after which the action will be executed for + the first time. + """ + + requests_to_origin: Optional[bool] = None + """Whether counting is only performed when an origin is reached.""" + + score_per_period: Optional[int] = None + """ + The score threshold per period for which the action will be executed the first + time. + """ + + score_response_header_name: Optional[str] = None + """ + A response header name provided by the origin, which contains the score to + increment rate limit counter with. + """ + + +class RuleRulesetsSetCacheTagsRule(BaseModel): + last_updated: datetime + """The timestamp of when the rule was last modified.""" + + version: str + """The version of the rule.""" + + id: Optional[str] = None + """The unique ID of the rule.""" + + action: Optional[Literal["set_cache_tags"]] = None + """The action to perform when the rule matches.""" + + action_parameters: Optional[RuleRulesetsSetCacheTagsRuleActionParameters] = None + """The parameters configuring the rule's action.""" + + categories: Optional[List[str]] = None + """The categories of the rule.""" + + description: Optional[str] = None + """An informative description of the rule.""" + + enabled: Optional[bool] = None + """Whether the rule should be executed.""" + + exposed_credential_check: Optional[RuleRulesetsSetCacheTagsRuleExposedCredentialCheck] = None + """Configuration for exposed credential checking.""" + + expression: Optional[str] = None + """The expression defining which traffic will match the rule.""" + + logging: Optional[Logging] = None + """An object configuring the rule's logging behavior.""" + + ratelimit: Optional[RuleRulesetsSetCacheTagsRuleRatelimit] = None + """An object configuring the rule's rate limit behavior.""" + + ref: Optional[str] = None + """The reference of the rule (the rule's ID by default).""" + + Rule: TypeAlias = Annotated[ Union[ BlockRule, @@ -249,7 +1009,9 @@ class RuleRulesetsJSChallengeRule(BaseModel): RouteRule, ScoreRule, ServeErrorRule, + RuleRulesetsSetCacheControlRule, SetCacheSettingsRule, + RuleRulesetsSetCacheTagsRule, SetConfigRule, SkipRule, ], diff --git a/src/cloudflare/types/rulesets/rule_edit_params.py b/src/cloudflare/types/rulesets/rule_edit_params.py index c3c46474390..bb83fb8de24 100644 --- a/src/cloudflare/types/rulesets/rule_edit_params.py +++ b/src/cloudflare/types/rulesets/rule_edit_params.py @@ -3,10 +3,11 @@ from __future__ import annotations from typing import Dict, List, Union, Iterable -from typing_extensions import Literal, Required, TypeAlias, TypedDict +from typing_extensions import Literal, Required, Annotated, TypeAlias, TypedDict from .phase import Phase from ..._types import SequenceNotStr +from ..._utils import PropertyInfo from .logging_param import LoggingParam __all__ = [ @@ -154,6 +155,53 @@ "ServeErrorRulePositionAfterPosition", "ServeErrorRulePositionIndexPosition", "ServeErrorRuleRatelimit", + "SetCacheControlRule", + "SetCacheControlRuleActionParameters", + "SetCacheControlRuleActionParametersImmutable", + "SetCacheControlRuleActionParametersImmutableSetDirective", + "SetCacheControlRuleActionParametersImmutableRemoveDirective", + "SetCacheControlRuleActionParametersMaxAge", + "SetCacheControlRuleActionParametersMaxAgeSetDirective", + "SetCacheControlRuleActionParametersMaxAgeRemoveDirective", + "SetCacheControlRuleActionParametersMustRevalidate", + "SetCacheControlRuleActionParametersMustRevalidateSetDirective", + "SetCacheControlRuleActionParametersMustRevalidateRemoveDirective", + "SetCacheControlRuleActionParametersMustUnderstand", + "SetCacheControlRuleActionParametersMustUnderstandSetDirective", + "SetCacheControlRuleActionParametersMustUnderstandRemoveDirective", + "SetCacheControlRuleActionParametersNoCache", + "SetCacheControlRuleActionParametersNoCacheSetDirective", + "SetCacheControlRuleActionParametersNoCacheRemoveDirective", + "SetCacheControlRuleActionParametersNoStore", + "SetCacheControlRuleActionParametersNoStoreSetDirective", + "SetCacheControlRuleActionParametersNoStoreRemoveDirective", + "SetCacheControlRuleActionParametersNoTransform", + "SetCacheControlRuleActionParametersNoTransformSetDirective", + "SetCacheControlRuleActionParametersNoTransformRemoveDirective", + "SetCacheControlRuleActionParametersPrivate", + "SetCacheControlRuleActionParametersPrivateSetDirective", + "SetCacheControlRuleActionParametersPrivateRemoveDirective", + "SetCacheControlRuleActionParametersProxyRevalidate", + "SetCacheControlRuleActionParametersProxyRevalidateSetDirective", + "SetCacheControlRuleActionParametersProxyRevalidateRemoveDirective", + "SetCacheControlRuleActionParametersPublic", + "SetCacheControlRuleActionParametersPublicSetDirective", + "SetCacheControlRuleActionParametersPublicRemoveDirective", + "SetCacheControlRuleActionParametersSMaxage", + "SetCacheControlRuleActionParametersSMaxageSetDirective", + "SetCacheControlRuleActionParametersSMaxageRemoveDirective", + "SetCacheControlRuleActionParametersStaleIfError", + "SetCacheControlRuleActionParametersStaleIfErrorSetDirective", + "SetCacheControlRuleActionParametersStaleIfErrorRemoveDirective", + "SetCacheControlRuleActionParametersStaleWhileRevalidate", + "SetCacheControlRuleActionParametersStaleWhileRevalidateSetDirective", + "SetCacheControlRuleActionParametersStaleWhileRevalidateRemoveDirective", + "SetCacheControlRuleExposedCredentialCheck", + "SetCacheControlRulePosition", + "SetCacheControlRulePositionBeforePosition", + "SetCacheControlRulePositionAfterPosition", + "SetCacheControlRulePositionIndexPosition", + "SetCacheControlRuleRatelimit", "SetCacheSettingsRule", "SetCacheSettingsRuleActionParameters", "SetCacheSettingsRuleActionParametersBrowserTTL", @@ -177,6 +225,20 @@ "SetCacheSettingsRulePositionAfterPosition", "SetCacheSettingsRulePositionIndexPosition", "SetCacheSettingsRuleRatelimit", + "SetCacheTagsRule", + "SetCacheTagsRuleActionParameters", + "SetCacheTagsRuleActionParametersAddCacheTagsValues", + "SetCacheTagsRuleActionParametersAddCacheTagsExpression", + "SetCacheTagsRuleActionParametersRemoveCacheTagsValues", + "SetCacheTagsRuleActionParametersRemoveCacheTagsExpression", + "SetCacheTagsRuleActionParametersSetCacheTagsValues", + "SetCacheTagsRuleActionParametersSetCacheTagsExpression", + "SetCacheTagsRuleExposedCredentialCheck", + "SetCacheTagsRulePosition", + "SetCacheTagsRulePositionBeforePosition", + "SetCacheTagsRulePositionAfterPosition", + "SetCacheTagsRulePositionIndexPosition", + "SetCacheTagsRuleRatelimit", "SetConfigurationRule", "SetConfigurationRuleActionParameters", "SetConfigurationRuleActionParametersAutominify", @@ -2586,6 +2648,561 @@ class ServeErrorRuleRatelimit(TypedDict, total=False): """ +class SetCacheControlRule(TypedDict, total=False): + ruleset_id: Required[str] + """The unique ID of the ruleset.""" + + account_id: str + """The Account ID to use for this endpoint. Mutually exclusive with the Zone ID.""" + + zone_id: str + """The Zone ID to use for this endpoint. Mutually exclusive with the Account ID.""" + + id: str + """The unique ID of the rule.""" + + action: Literal["set_cache_control"] + """The action to perform when the rule matches.""" + + action_parameters: SetCacheControlRuleActionParameters + """The parameters configuring the rule's action.""" + + description: str + """An informative description of the rule.""" + + enabled: bool + """Whether the rule should be executed.""" + + exposed_credential_check: SetCacheControlRuleExposedCredentialCheck + """Configuration for exposed credential checking.""" + + expression: str + """The expression defining which traffic will match the rule.""" + + logging: LoggingParam + """An object configuring the rule's logging behavior.""" + + position: SetCacheControlRulePosition + """An object configuring where the rule will be placed.""" + + ratelimit: SetCacheControlRuleRatelimit + """An object configuring the rule's rate limit behavior.""" + + ref: str + """The reference of the rule (the rule's ID by default).""" + + +class SetCacheControlRuleActionParametersImmutableSetDirective(TypedDict, total=False): + """Set the directive.""" + + operation: Required[Literal["set", "remove"]] + """The operation to perform on the cache-control directive.""" + + cloudflare_only: bool + """Whether the directive should only be applied to the Cloudflare CDN cache.""" + + +class SetCacheControlRuleActionParametersImmutableRemoveDirective(TypedDict, total=False): + """Remove the directive.""" + + operation: Required[Literal["set", "remove"]] + """The operation to perform on the cache-control directive.""" + + cloudflare_only: bool + """Whether the directive should only be applied to the Cloudflare CDN cache.""" + + +SetCacheControlRuleActionParametersImmutable: TypeAlias = Union[ + SetCacheControlRuleActionParametersImmutableSetDirective, + SetCacheControlRuleActionParametersImmutableRemoveDirective, +] + + +class SetCacheControlRuleActionParametersMaxAgeSetDirective(TypedDict, total=False): + """Set the directive with a duration value in seconds.""" + + operation: Required[Literal["set", "remove"]] + """The operation to perform on the cache-control directive.""" + + value: Required[int] + """The duration value in seconds for the directive.""" + + cloudflare_only: bool + """Whether the directive should only be applied to the Cloudflare CDN cache.""" + + +class SetCacheControlRuleActionParametersMaxAgeRemoveDirective(TypedDict, total=False): + """Remove the directive.""" + + operation: Required[Literal["set", "remove"]] + """The operation to perform on the cache-control directive.""" + + cloudflare_only: bool + """Whether the directive should only be applied to the Cloudflare CDN cache.""" + + +SetCacheControlRuleActionParametersMaxAge: TypeAlias = Union[ + SetCacheControlRuleActionParametersMaxAgeSetDirective, SetCacheControlRuleActionParametersMaxAgeRemoveDirective +] + + +class SetCacheControlRuleActionParametersMustRevalidateSetDirective(TypedDict, total=False): + """Set the directive.""" + + operation: Required[Literal["set", "remove"]] + """The operation to perform on the cache-control directive.""" + + cloudflare_only: bool + """Whether the directive should only be applied to the Cloudflare CDN cache.""" + + +class SetCacheControlRuleActionParametersMustRevalidateRemoveDirective(TypedDict, total=False): + """Remove the directive.""" + + operation: Required[Literal["set", "remove"]] + """The operation to perform on the cache-control directive.""" + + cloudflare_only: bool + """Whether the directive should only be applied to the Cloudflare CDN cache.""" + + +SetCacheControlRuleActionParametersMustRevalidate: TypeAlias = Union[ + SetCacheControlRuleActionParametersMustRevalidateSetDirective, + SetCacheControlRuleActionParametersMustRevalidateRemoveDirective, +] + + +class SetCacheControlRuleActionParametersMustUnderstandSetDirective(TypedDict, total=False): + """Set the directive.""" + + operation: Required[Literal["set", "remove"]] + """The operation to perform on the cache-control directive.""" + + cloudflare_only: bool + """Whether the directive should only be applied to the Cloudflare CDN cache.""" + + +class SetCacheControlRuleActionParametersMustUnderstandRemoveDirective(TypedDict, total=False): + """Remove the directive.""" + + operation: Required[Literal["set", "remove"]] + """The operation to perform on the cache-control directive.""" + + cloudflare_only: bool + """Whether the directive should only be applied to the Cloudflare CDN cache.""" + + +SetCacheControlRuleActionParametersMustUnderstand: TypeAlias = Union[ + SetCacheControlRuleActionParametersMustUnderstandSetDirective, + SetCacheControlRuleActionParametersMustUnderstandRemoveDirective, +] + + +class SetCacheControlRuleActionParametersNoCacheSetDirective(TypedDict, total=False): + """Set the directive with optional qualifiers.""" + + operation: Required[Literal["set", "remove"]] + """The operation to perform on the cache-control directive.""" + + cloudflare_only: bool + """Whether the directive should only be applied to the Cloudflare CDN cache.""" + + qualifiers: SequenceNotStr[str] + """ + Optional list of header names to qualify the directive (e.g., for "private" or + "no-cache" directives). + """ + + +class SetCacheControlRuleActionParametersNoCacheRemoveDirective(TypedDict, total=False): + """Remove the directive.""" + + operation: Required[Literal["set", "remove"]] + """The operation to perform on the cache-control directive.""" + + cloudflare_only: bool + """Whether the directive should only be applied to the Cloudflare CDN cache.""" + + +SetCacheControlRuleActionParametersNoCache: TypeAlias = Union[ + SetCacheControlRuleActionParametersNoCacheSetDirective, SetCacheControlRuleActionParametersNoCacheRemoveDirective +] + + +class SetCacheControlRuleActionParametersNoStoreSetDirective(TypedDict, total=False): + """Set the directive.""" + + operation: Required[Literal["set", "remove"]] + """The operation to perform on the cache-control directive.""" + + cloudflare_only: bool + """Whether the directive should only be applied to the Cloudflare CDN cache.""" + + +class SetCacheControlRuleActionParametersNoStoreRemoveDirective(TypedDict, total=False): + """Remove the directive.""" + + operation: Required[Literal["set", "remove"]] + """The operation to perform on the cache-control directive.""" + + cloudflare_only: bool + """Whether the directive should only be applied to the Cloudflare CDN cache.""" + + +SetCacheControlRuleActionParametersNoStore: TypeAlias = Union[ + SetCacheControlRuleActionParametersNoStoreSetDirective, SetCacheControlRuleActionParametersNoStoreRemoveDirective +] + + +class SetCacheControlRuleActionParametersNoTransformSetDirective(TypedDict, total=False): + """Set the directive.""" + + operation: Required[Literal["set", "remove"]] + """The operation to perform on the cache-control directive.""" + + cloudflare_only: bool + """Whether the directive should only be applied to the Cloudflare CDN cache.""" + + +class SetCacheControlRuleActionParametersNoTransformRemoveDirective(TypedDict, total=False): + """Remove the directive.""" + + operation: Required[Literal["set", "remove"]] + """The operation to perform on the cache-control directive.""" + + cloudflare_only: bool + """Whether the directive should only be applied to the Cloudflare CDN cache.""" + + +SetCacheControlRuleActionParametersNoTransform: TypeAlias = Union[ + SetCacheControlRuleActionParametersNoTransformSetDirective, + SetCacheControlRuleActionParametersNoTransformRemoveDirective, +] + + +class SetCacheControlRuleActionParametersPrivateSetDirective(TypedDict, total=False): + """Set the directive with optional qualifiers.""" + + operation: Required[Literal["set", "remove"]] + """The operation to perform on the cache-control directive.""" + + cloudflare_only: bool + """Whether the directive should only be applied to the Cloudflare CDN cache.""" + + qualifiers: SequenceNotStr[str] + """ + Optional list of header names to qualify the directive (e.g., for "private" or + "no-cache" directives). + """ + + +class SetCacheControlRuleActionParametersPrivateRemoveDirective(TypedDict, total=False): + """Remove the directive.""" + + operation: Required[Literal["set", "remove"]] + """The operation to perform on the cache-control directive.""" + + cloudflare_only: bool + """Whether the directive should only be applied to the Cloudflare CDN cache.""" + + +SetCacheControlRuleActionParametersPrivate: TypeAlias = Union[ + SetCacheControlRuleActionParametersPrivateSetDirective, SetCacheControlRuleActionParametersPrivateRemoveDirective +] + + +class SetCacheControlRuleActionParametersProxyRevalidateSetDirective(TypedDict, total=False): + """Set the directive.""" + + operation: Required[Literal["set", "remove"]] + """The operation to perform on the cache-control directive.""" + + cloudflare_only: bool + """Whether the directive should only be applied to the Cloudflare CDN cache.""" + + +class SetCacheControlRuleActionParametersProxyRevalidateRemoveDirective(TypedDict, total=False): + """Remove the directive.""" + + operation: Required[Literal["set", "remove"]] + """The operation to perform on the cache-control directive.""" + + cloudflare_only: bool + """Whether the directive should only be applied to the Cloudflare CDN cache.""" + + +SetCacheControlRuleActionParametersProxyRevalidate: TypeAlias = Union[ + SetCacheControlRuleActionParametersProxyRevalidateSetDirective, + SetCacheControlRuleActionParametersProxyRevalidateRemoveDirective, +] + + +class SetCacheControlRuleActionParametersPublicSetDirective(TypedDict, total=False): + """Set the directive.""" + + operation: Required[Literal["set", "remove"]] + """The operation to perform on the cache-control directive.""" + + cloudflare_only: bool + """Whether the directive should only be applied to the Cloudflare CDN cache.""" + + +class SetCacheControlRuleActionParametersPublicRemoveDirective(TypedDict, total=False): + """Remove the directive.""" + + operation: Required[Literal["set", "remove"]] + """The operation to perform on the cache-control directive.""" + + cloudflare_only: bool + """Whether the directive should only be applied to the Cloudflare CDN cache.""" + + +SetCacheControlRuleActionParametersPublic: TypeAlias = Union[ + SetCacheControlRuleActionParametersPublicSetDirective, SetCacheControlRuleActionParametersPublicRemoveDirective +] + + +class SetCacheControlRuleActionParametersSMaxageSetDirective(TypedDict, total=False): + """Set the directive with a duration value in seconds.""" + + operation: Required[Literal["set", "remove"]] + """The operation to perform on the cache-control directive.""" + + value: Required[int] + """The duration value in seconds for the directive.""" + + cloudflare_only: bool + """Whether the directive should only be applied to the Cloudflare CDN cache.""" + + +class SetCacheControlRuleActionParametersSMaxageRemoveDirective(TypedDict, total=False): + """Remove the directive.""" + + operation: Required[Literal["set", "remove"]] + """The operation to perform on the cache-control directive.""" + + cloudflare_only: bool + """Whether the directive should only be applied to the Cloudflare CDN cache.""" + + +SetCacheControlRuleActionParametersSMaxage: TypeAlias = Union[ + SetCacheControlRuleActionParametersSMaxageSetDirective, SetCacheControlRuleActionParametersSMaxageRemoveDirective +] + + +class SetCacheControlRuleActionParametersStaleIfErrorSetDirective(TypedDict, total=False): + """Set the directive with a duration value in seconds.""" + + operation: Required[Literal["set", "remove"]] + """The operation to perform on the cache-control directive.""" + + value: Required[int] + """The duration value in seconds for the directive.""" + + cloudflare_only: bool + """Whether the directive should only be applied to the Cloudflare CDN cache.""" + + +class SetCacheControlRuleActionParametersStaleIfErrorRemoveDirective(TypedDict, total=False): + """Remove the directive.""" + + operation: Required[Literal["set", "remove"]] + """The operation to perform on the cache-control directive.""" + + cloudflare_only: bool + """Whether the directive should only be applied to the Cloudflare CDN cache.""" + + +SetCacheControlRuleActionParametersStaleIfError: TypeAlias = Union[ + SetCacheControlRuleActionParametersStaleIfErrorSetDirective, + SetCacheControlRuleActionParametersStaleIfErrorRemoveDirective, +] + + +class SetCacheControlRuleActionParametersStaleWhileRevalidateSetDirective(TypedDict, total=False): + """Set the directive with a duration value in seconds.""" + + operation: Required[Literal["set", "remove"]] + """The operation to perform on the cache-control directive.""" + + value: Required[int] + """The duration value in seconds for the directive.""" + + cloudflare_only: bool + """Whether the directive should only be applied to the Cloudflare CDN cache.""" + + +class SetCacheControlRuleActionParametersStaleWhileRevalidateRemoveDirective(TypedDict, total=False): + """Remove the directive.""" + + operation: Required[Literal["set", "remove"]] + """The operation to perform on the cache-control directive.""" + + cloudflare_only: bool + """Whether the directive should only be applied to the Cloudflare CDN cache.""" + + +SetCacheControlRuleActionParametersStaleWhileRevalidate: TypeAlias = Union[ + SetCacheControlRuleActionParametersStaleWhileRevalidateSetDirective, + SetCacheControlRuleActionParametersStaleWhileRevalidateRemoveDirective, +] + + +class SetCacheControlRuleActionParameters(TypedDict, total=False): + """The parameters configuring the rule's action.""" + + immutable: SetCacheControlRuleActionParametersImmutable + """A cache-control directive configuration.""" + + max_age: Annotated[SetCacheControlRuleActionParametersMaxAge, PropertyInfo(alias="max-age")] + """ + A cache-control directive configuration that accepts a duration value in + seconds. + """ + + must_revalidate: Annotated[SetCacheControlRuleActionParametersMustRevalidate, PropertyInfo(alias="must-revalidate")] + """A cache-control directive configuration.""" + + must_understand: Annotated[SetCacheControlRuleActionParametersMustUnderstand, PropertyInfo(alias="must-understand")] + """A cache-control directive configuration.""" + + no_cache: Annotated[SetCacheControlRuleActionParametersNoCache, PropertyInfo(alias="no-cache")] + """ + A cache-control directive configuration that accepts optional qualifiers (header + names). + """ + + no_store: Annotated[SetCacheControlRuleActionParametersNoStore, PropertyInfo(alias="no-store")] + """A cache-control directive configuration.""" + + no_transform: Annotated[SetCacheControlRuleActionParametersNoTransform, PropertyInfo(alias="no-transform")] + """A cache-control directive configuration.""" + + private: SetCacheControlRuleActionParametersPrivate + """ + A cache-control directive configuration that accepts optional qualifiers (header + names). + """ + + proxy_revalidate: Annotated[ + SetCacheControlRuleActionParametersProxyRevalidate, PropertyInfo(alias="proxy-revalidate") + ] + """A cache-control directive configuration.""" + + public: SetCacheControlRuleActionParametersPublic + """A cache-control directive configuration.""" + + s_maxage: Annotated[SetCacheControlRuleActionParametersSMaxage, PropertyInfo(alias="s-maxage")] + """ + A cache-control directive configuration that accepts a duration value in + seconds. + """ + + stale_if_error: Annotated[SetCacheControlRuleActionParametersStaleIfError, PropertyInfo(alias="stale-if-error")] + """ + A cache-control directive configuration that accepts a duration value in + seconds. + """ + + stale_while_revalidate: Annotated[ + SetCacheControlRuleActionParametersStaleWhileRevalidate, PropertyInfo(alias="stale-while-revalidate") + ] + """ + A cache-control directive configuration that accepts a duration value in + seconds. + """ + + +class SetCacheControlRuleExposedCredentialCheck(TypedDict, total=False): + """Configuration for exposed credential checking.""" + + password_expression: Required[str] + """An expression that selects the password used in the credentials check.""" + + username_expression: Required[str] + """An expression that selects the user ID used in the credentials check.""" + + +class SetCacheControlRulePositionBeforePosition(TypedDict, total=False): + """An object configuring where the rule will be placed.""" + + before: str + """The ID of another rule to place the rule before. + + An empty value causes the rule to be placed at the top. + """ + + +class SetCacheControlRulePositionAfterPosition(TypedDict, total=False): + """An object configuring where the rule will be placed.""" + + after: str + """The ID of another rule to place the rule after. + + An empty value causes the rule to be placed at the bottom. + """ + + +class SetCacheControlRulePositionIndexPosition(TypedDict, total=False): + """An object configuring where the rule will be placed.""" + + index: int + """An index at which to place the rule, where index 1 is the first rule.""" + + +SetCacheControlRulePosition: TypeAlias = Union[ + SetCacheControlRulePositionBeforePosition, + SetCacheControlRulePositionAfterPosition, + SetCacheControlRulePositionIndexPosition, +] + + +class SetCacheControlRuleRatelimit(TypedDict, total=False): + """An object configuring the rule's rate limit behavior.""" + + characteristics: Required[SequenceNotStr[str]] + """ + Characteristics of the request on which the rate limit counter will be + incremented. + """ + + period: Required[int] + """Period in seconds over which the counter is being incremented.""" + + counting_expression: str + """An expression that defines when the rate limit counter should be incremented. + + It defaults to the same as the rule's expression. + """ + + mitigation_timeout: int + """ + Period of time in seconds after which the action will be disabled following its + first execution. + """ + + requests_per_period: int + """ + The threshold of requests per period after which the action will be executed for + the first time. + """ + + requests_to_origin: bool + """Whether counting is only performed when an origin is reached.""" + + score_per_period: int + """ + The score threshold per period for which the action will be executed the first + time. + """ + + score_response_header_name: str + """ + A response header name provided by the origin, which contains the score to + increment rate limit counter with. + """ + + class SetCacheSettingsRule(TypedDict, total=False): ruleset_id: Required[str] """The unique ID of the ruleset.""" @@ -2904,6 +3521,15 @@ class SetCacheSettingsRuleActionParameters(TypedDict, total=False): serve_stale: SetCacheSettingsRuleActionParametersServeStale """When to serve stale content from cache.""" + strip_etags: bool + """Whether to strip ETag headers from the origin response before caching.""" + + strip_last_modified: bool + """Whether to strip Last-Modified headers from the origin response before caching.""" + + strip_set_cookie: bool + """Whether to strip Set-Cookie headers from the origin response before caching.""" + class SetCacheSettingsRuleExposedCredentialCheck(TypedDict, total=False): """Configuration for exposed credential checking.""" @@ -2995,6 +3621,208 @@ class SetCacheSettingsRuleRatelimit(TypedDict, total=False): """ +class SetCacheTagsRule(TypedDict, total=False): + ruleset_id: Required[str] + """The unique ID of the ruleset.""" + + account_id: str + """The Account ID to use for this endpoint. Mutually exclusive with the Zone ID.""" + + zone_id: str + """The Zone ID to use for this endpoint. Mutually exclusive with the Account ID.""" + + id: str + """The unique ID of the rule.""" + + action: Literal["set_cache_tags"] + """The action to perform when the rule matches.""" + + action_parameters: SetCacheTagsRuleActionParameters + """The parameters configuring the rule's action.""" + + description: str + """An informative description of the rule.""" + + enabled: bool + """Whether the rule should be executed.""" + + exposed_credential_check: SetCacheTagsRuleExposedCredentialCheck + """Configuration for exposed credential checking.""" + + expression: str + """The expression defining which traffic will match the rule.""" + + logging: LoggingParam + """An object configuring the rule's logging behavior.""" + + position: SetCacheTagsRulePosition + """An object configuring where the rule will be placed.""" + + ratelimit: SetCacheTagsRuleRatelimit + """An object configuring the rule's rate limit behavior.""" + + ref: str + """The reference of the rule (the rule's ID by default).""" + + +class SetCacheTagsRuleActionParametersAddCacheTagsValues(TypedDict, total=False): + """Add cache tags using a list of values.""" + + operation: Required[Literal["add", "remove", "set"]] + """The operation to perform on the cache tags.""" + + values: Required[SequenceNotStr[str]] + """A list of cache tag values.""" + + +class SetCacheTagsRuleActionParametersAddCacheTagsExpression(TypedDict, total=False): + """Add cache tags using an expression.""" + + expression: Required[str] + """An expression that evaluates to an array of cache tag values.""" + + operation: Required[Literal["add", "remove", "set"]] + """The operation to perform on the cache tags.""" + + +class SetCacheTagsRuleActionParametersRemoveCacheTagsValues(TypedDict, total=False): + """Remove cache tags using a list of values.""" + + operation: Required[Literal["add", "remove", "set"]] + """The operation to perform on the cache tags.""" + + values: Required[SequenceNotStr[str]] + """A list of cache tag values.""" + + +class SetCacheTagsRuleActionParametersRemoveCacheTagsExpression(TypedDict, total=False): + """Remove cache tags using an expression.""" + + expression: Required[str] + """An expression that evaluates to an array of cache tag values.""" + + operation: Required[Literal["add", "remove", "set"]] + """The operation to perform on the cache tags.""" + + +class SetCacheTagsRuleActionParametersSetCacheTagsValues(TypedDict, total=False): + """Set cache tags using a list of values.""" + + operation: Required[Literal["add", "remove", "set"]] + """The operation to perform on the cache tags.""" + + values: Required[SequenceNotStr[str]] + """A list of cache tag values.""" + + +class SetCacheTagsRuleActionParametersSetCacheTagsExpression(TypedDict, total=False): + """Set cache tags using an expression.""" + + expression: Required[str] + """An expression that evaluates to an array of cache tag values.""" + + operation: Required[Literal["add", "remove", "set"]] + """The operation to perform on the cache tags.""" + + +SetCacheTagsRuleActionParameters: TypeAlias = Union[ + SetCacheTagsRuleActionParametersAddCacheTagsValues, + SetCacheTagsRuleActionParametersAddCacheTagsExpression, + SetCacheTagsRuleActionParametersRemoveCacheTagsValues, + SetCacheTagsRuleActionParametersRemoveCacheTagsExpression, + SetCacheTagsRuleActionParametersSetCacheTagsValues, + SetCacheTagsRuleActionParametersSetCacheTagsExpression, +] + + +class SetCacheTagsRuleExposedCredentialCheck(TypedDict, total=False): + """Configuration for exposed credential checking.""" + + password_expression: Required[str] + """An expression that selects the password used in the credentials check.""" + + username_expression: Required[str] + """An expression that selects the user ID used in the credentials check.""" + + +class SetCacheTagsRulePositionBeforePosition(TypedDict, total=False): + """An object configuring where the rule will be placed.""" + + before: str + """The ID of another rule to place the rule before. + + An empty value causes the rule to be placed at the top. + """ + + +class SetCacheTagsRulePositionAfterPosition(TypedDict, total=False): + """An object configuring where the rule will be placed.""" + + after: str + """The ID of another rule to place the rule after. + + An empty value causes the rule to be placed at the bottom. + """ + + +class SetCacheTagsRulePositionIndexPosition(TypedDict, total=False): + """An object configuring where the rule will be placed.""" + + index: int + """An index at which to place the rule, where index 1 is the first rule.""" + + +SetCacheTagsRulePosition: TypeAlias = Union[ + SetCacheTagsRulePositionBeforePosition, SetCacheTagsRulePositionAfterPosition, SetCacheTagsRulePositionIndexPosition +] + + +class SetCacheTagsRuleRatelimit(TypedDict, total=False): + """An object configuring the rule's rate limit behavior.""" + + characteristics: Required[SequenceNotStr[str]] + """ + Characteristics of the request on which the rate limit counter will be + incremented. + """ + + period: Required[int] + """Period in seconds over which the counter is being incremented.""" + + counting_expression: str + """An expression that defines when the rate limit counter should be incremented. + + It defaults to the same as the rule's expression. + """ + + mitigation_timeout: int + """ + Period of time in seconds after which the action will be disabled following its + first execution. + """ + + requests_per_period: int + """ + The threshold of requests per period after which the action will be executed for + the first time. + """ + + requests_to_origin: bool + """Whether counting is only performed when an origin is reached.""" + + score_per_period: int + """ + The score threshold per period for which the action will be executed the first + time. + """ + + score_response_header_name: str + """ + A response header name provided by the origin, which contains the score to + increment rate limit counter with. + """ + + class SetConfigurationRule(TypedDict, total=False): ruleset_id: Required[str] """The unique ID of the ruleset.""" @@ -3394,7 +4222,9 @@ class SkipRuleRatelimit(TypedDict, total=False): RouteRule, ScoreRule, ServeErrorRule, + SetCacheControlRule, SetCacheSettingsRule, + SetCacheTagsRule, SetConfigurationRule, SkipRule, ] diff --git a/src/cloudflare/types/rulesets/rule_edit_response.py b/src/cloudflare/types/rulesets/rule_edit_response.py index 7de4cd9523e..73f8f8cc4aa 100644 --- a/src/cloudflare/types/rulesets/rule_edit_response.py +++ b/src/cloudflare/types/rulesets/rule_edit_response.py @@ -4,6 +4,8 @@ from datetime import datetime from typing_extensions import Literal, Annotated, TypeAlias +from pydantic import Field as FieldInfo + from .kind import Kind from .phase import Phase from .logging import Logging @@ -35,6 +37,59 @@ "RuleRulesetsJSChallengeRule", "RuleRulesetsJSChallengeRuleExposedCredentialCheck", "RuleRulesetsJSChallengeRuleRatelimit", + "RuleRulesetsSetCacheControlRule", + "RuleRulesetsSetCacheControlRuleActionParameters", + "RuleRulesetsSetCacheControlRuleActionParametersImmutable", + "RuleRulesetsSetCacheControlRuleActionParametersImmutableSetDirective", + "RuleRulesetsSetCacheControlRuleActionParametersImmutableRemoveDirective", + "RuleRulesetsSetCacheControlRuleActionParametersMaxAge", + "RuleRulesetsSetCacheControlRuleActionParametersMaxAgeSetDirective", + "RuleRulesetsSetCacheControlRuleActionParametersMaxAgeRemoveDirective", + "RuleRulesetsSetCacheControlRuleActionParametersMustRevalidate", + "RuleRulesetsSetCacheControlRuleActionParametersMustRevalidateSetDirective", + "RuleRulesetsSetCacheControlRuleActionParametersMustRevalidateRemoveDirective", + "RuleRulesetsSetCacheControlRuleActionParametersMustUnderstand", + "RuleRulesetsSetCacheControlRuleActionParametersMustUnderstandSetDirective", + "RuleRulesetsSetCacheControlRuleActionParametersMustUnderstandRemoveDirective", + "RuleRulesetsSetCacheControlRuleActionParametersNoCache", + "RuleRulesetsSetCacheControlRuleActionParametersNoCacheSetDirective", + "RuleRulesetsSetCacheControlRuleActionParametersNoCacheRemoveDirective", + "RuleRulesetsSetCacheControlRuleActionParametersNoStore", + "RuleRulesetsSetCacheControlRuleActionParametersNoStoreSetDirective", + "RuleRulesetsSetCacheControlRuleActionParametersNoStoreRemoveDirective", + "RuleRulesetsSetCacheControlRuleActionParametersNoTransform", + "RuleRulesetsSetCacheControlRuleActionParametersNoTransformSetDirective", + "RuleRulesetsSetCacheControlRuleActionParametersNoTransformRemoveDirective", + "RuleRulesetsSetCacheControlRuleActionParametersPrivate", + "RuleRulesetsSetCacheControlRuleActionParametersPrivateSetDirective", + "RuleRulesetsSetCacheControlRuleActionParametersPrivateRemoveDirective", + "RuleRulesetsSetCacheControlRuleActionParametersProxyRevalidate", + "RuleRulesetsSetCacheControlRuleActionParametersProxyRevalidateSetDirective", + "RuleRulesetsSetCacheControlRuleActionParametersProxyRevalidateRemoveDirective", + "RuleRulesetsSetCacheControlRuleActionParametersPublic", + "RuleRulesetsSetCacheControlRuleActionParametersPublicSetDirective", + "RuleRulesetsSetCacheControlRuleActionParametersPublicRemoveDirective", + "RuleRulesetsSetCacheControlRuleActionParametersSMaxage", + "RuleRulesetsSetCacheControlRuleActionParametersSMaxageSetDirective", + "RuleRulesetsSetCacheControlRuleActionParametersSMaxageRemoveDirective", + "RuleRulesetsSetCacheControlRuleActionParametersStaleIfError", + "RuleRulesetsSetCacheControlRuleActionParametersStaleIfErrorSetDirective", + "RuleRulesetsSetCacheControlRuleActionParametersStaleIfErrorRemoveDirective", + "RuleRulesetsSetCacheControlRuleActionParametersStaleWhileRevalidate", + "RuleRulesetsSetCacheControlRuleActionParametersStaleWhileRevalidateSetDirective", + "RuleRulesetsSetCacheControlRuleActionParametersStaleWhileRevalidateRemoveDirective", + "RuleRulesetsSetCacheControlRuleExposedCredentialCheck", + "RuleRulesetsSetCacheControlRuleRatelimit", + "RuleRulesetsSetCacheTagsRule", + "RuleRulesetsSetCacheTagsRuleActionParameters", + "RuleRulesetsSetCacheTagsRuleActionParametersAddCacheTagsValues", + "RuleRulesetsSetCacheTagsRuleActionParametersAddCacheTagsExpression", + "RuleRulesetsSetCacheTagsRuleActionParametersRemoveCacheTagsValues", + "RuleRulesetsSetCacheTagsRuleActionParametersRemoveCacheTagsExpression", + "RuleRulesetsSetCacheTagsRuleActionParametersSetCacheTagsValues", + "RuleRulesetsSetCacheTagsRuleActionParametersSetCacheTagsExpression", + "RuleRulesetsSetCacheTagsRuleExposedCredentialCheck", + "RuleRulesetsSetCacheTagsRuleRatelimit", ] @@ -232,6 +287,711 @@ class RuleRulesetsJSChallengeRule(BaseModel): """The reference of the rule (the rule's ID by default).""" +class RuleRulesetsSetCacheControlRuleActionParametersImmutableSetDirective(BaseModel): + """Set the directive.""" + + operation: Literal["set", "remove"] + """The operation to perform on the cache-control directive.""" + + cloudflare_only: Optional[bool] = None + """Whether the directive should only be applied to the Cloudflare CDN cache.""" + + +class RuleRulesetsSetCacheControlRuleActionParametersImmutableRemoveDirective(BaseModel): + """Remove the directive.""" + + operation: Literal["set", "remove"] + """The operation to perform on the cache-control directive.""" + + cloudflare_only: Optional[bool] = None + """Whether the directive should only be applied to the Cloudflare CDN cache.""" + + +RuleRulesetsSetCacheControlRuleActionParametersImmutable: TypeAlias = Union[ + RuleRulesetsSetCacheControlRuleActionParametersImmutableSetDirective, + RuleRulesetsSetCacheControlRuleActionParametersImmutableRemoveDirective, +] + + +class RuleRulesetsSetCacheControlRuleActionParametersMaxAgeSetDirective(BaseModel): + """Set the directive with a duration value in seconds.""" + + operation: Literal["set", "remove"] + """The operation to perform on the cache-control directive.""" + + value: int + """The duration value in seconds for the directive.""" + + cloudflare_only: Optional[bool] = None + """Whether the directive should only be applied to the Cloudflare CDN cache.""" + + +class RuleRulesetsSetCacheControlRuleActionParametersMaxAgeRemoveDirective(BaseModel): + """Remove the directive.""" + + operation: Literal["set", "remove"] + """The operation to perform on the cache-control directive.""" + + cloudflare_only: Optional[bool] = None + """Whether the directive should only be applied to the Cloudflare CDN cache.""" + + +RuleRulesetsSetCacheControlRuleActionParametersMaxAge: TypeAlias = Union[ + RuleRulesetsSetCacheControlRuleActionParametersMaxAgeSetDirective, + RuleRulesetsSetCacheControlRuleActionParametersMaxAgeRemoveDirective, +] + + +class RuleRulesetsSetCacheControlRuleActionParametersMustRevalidateSetDirective(BaseModel): + """Set the directive.""" + + operation: Literal["set", "remove"] + """The operation to perform on the cache-control directive.""" + + cloudflare_only: Optional[bool] = None + """Whether the directive should only be applied to the Cloudflare CDN cache.""" + + +class RuleRulesetsSetCacheControlRuleActionParametersMustRevalidateRemoveDirective(BaseModel): + """Remove the directive.""" + + operation: Literal["set", "remove"] + """The operation to perform on the cache-control directive.""" + + cloudflare_only: Optional[bool] = None + """Whether the directive should only be applied to the Cloudflare CDN cache.""" + + +RuleRulesetsSetCacheControlRuleActionParametersMustRevalidate: TypeAlias = Union[ + RuleRulesetsSetCacheControlRuleActionParametersMustRevalidateSetDirective, + RuleRulesetsSetCacheControlRuleActionParametersMustRevalidateRemoveDirective, +] + + +class RuleRulesetsSetCacheControlRuleActionParametersMustUnderstandSetDirective(BaseModel): + """Set the directive.""" + + operation: Literal["set", "remove"] + """The operation to perform on the cache-control directive.""" + + cloudflare_only: Optional[bool] = None + """Whether the directive should only be applied to the Cloudflare CDN cache.""" + + +class RuleRulesetsSetCacheControlRuleActionParametersMustUnderstandRemoveDirective(BaseModel): + """Remove the directive.""" + + operation: Literal["set", "remove"] + """The operation to perform on the cache-control directive.""" + + cloudflare_only: Optional[bool] = None + """Whether the directive should only be applied to the Cloudflare CDN cache.""" + + +RuleRulesetsSetCacheControlRuleActionParametersMustUnderstand: TypeAlias = Union[ + RuleRulesetsSetCacheControlRuleActionParametersMustUnderstandSetDirective, + RuleRulesetsSetCacheControlRuleActionParametersMustUnderstandRemoveDirective, +] + + +class RuleRulesetsSetCacheControlRuleActionParametersNoCacheSetDirective(BaseModel): + """Set the directive with optional qualifiers.""" + + operation: Literal["set", "remove"] + """The operation to perform on the cache-control directive.""" + + cloudflare_only: Optional[bool] = None + """Whether the directive should only be applied to the Cloudflare CDN cache.""" + + qualifiers: Optional[List[str]] = None + """ + Optional list of header names to qualify the directive (e.g., for "private" or + "no-cache" directives). + """ + + +class RuleRulesetsSetCacheControlRuleActionParametersNoCacheRemoveDirective(BaseModel): + """Remove the directive.""" + + operation: Literal["set", "remove"] + """The operation to perform on the cache-control directive.""" + + cloudflare_only: Optional[bool] = None + """Whether the directive should only be applied to the Cloudflare CDN cache.""" + + +RuleRulesetsSetCacheControlRuleActionParametersNoCache: TypeAlias = Union[ + RuleRulesetsSetCacheControlRuleActionParametersNoCacheSetDirective, + RuleRulesetsSetCacheControlRuleActionParametersNoCacheRemoveDirective, +] + + +class RuleRulesetsSetCacheControlRuleActionParametersNoStoreSetDirective(BaseModel): + """Set the directive.""" + + operation: Literal["set", "remove"] + """The operation to perform on the cache-control directive.""" + + cloudflare_only: Optional[bool] = None + """Whether the directive should only be applied to the Cloudflare CDN cache.""" + + +class RuleRulesetsSetCacheControlRuleActionParametersNoStoreRemoveDirective(BaseModel): + """Remove the directive.""" + + operation: Literal["set", "remove"] + """The operation to perform on the cache-control directive.""" + + cloudflare_only: Optional[bool] = None + """Whether the directive should only be applied to the Cloudflare CDN cache.""" + + +RuleRulesetsSetCacheControlRuleActionParametersNoStore: TypeAlias = Union[ + RuleRulesetsSetCacheControlRuleActionParametersNoStoreSetDirective, + RuleRulesetsSetCacheControlRuleActionParametersNoStoreRemoveDirective, +] + + +class RuleRulesetsSetCacheControlRuleActionParametersNoTransformSetDirective(BaseModel): + """Set the directive.""" + + operation: Literal["set", "remove"] + """The operation to perform on the cache-control directive.""" + + cloudflare_only: Optional[bool] = None + """Whether the directive should only be applied to the Cloudflare CDN cache.""" + + +class RuleRulesetsSetCacheControlRuleActionParametersNoTransformRemoveDirective(BaseModel): + """Remove the directive.""" + + operation: Literal["set", "remove"] + """The operation to perform on the cache-control directive.""" + + cloudflare_only: Optional[bool] = None + """Whether the directive should only be applied to the Cloudflare CDN cache.""" + + +RuleRulesetsSetCacheControlRuleActionParametersNoTransform: TypeAlias = Union[ + RuleRulesetsSetCacheControlRuleActionParametersNoTransformSetDirective, + RuleRulesetsSetCacheControlRuleActionParametersNoTransformRemoveDirective, +] + + +class RuleRulesetsSetCacheControlRuleActionParametersPrivateSetDirective(BaseModel): + """Set the directive with optional qualifiers.""" + + operation: Literal["set", "remove"] + """The operation to perform on the cache-control directive.""" + + cloudflare_only: Optional[bool] = None + """Whether the directive should only be applied to the Cloudflare CDN cache.""" + + qualifiers: Optional[List[str]] = None + """ + Optional list of header names to qualify the directive (e.g., for "private" or + "no-cache" directives). + """ + + +class RuleRulesetsSetCacheControlRuleActionParametersPrivateRemoveDirective(BaseModel): + """Remove the directive.""" + + operation: Literal["set", "remove"] + """The operation to perform on the cache-control directive.""" + + cloudflare_only: Optional[bool] = None + """Whether the directive should only be applied to the Cloudflare CDN cache.""" + + +RuleRulesetsSetCacheControlRuleActionParametersPrivate: TypeAlias = Union[ + RuleRulesetsSetCacheControlRuleActionParametersPrivateSetDirective, + RuleRulesetsSetCacheControlRuleActionParametersPrivateRemoveDirective, +] + + +class RuleRulesetsSetCacheControlRuleActionParametersProxyRevalidateSetDirective(BaseModel): + """Set the directive.""" + + operation: Literal["set", "remove"] + """The operation to perform on the cache-control directive.""" + + cloudflare_only: Optional[bool] = None + """Whether the directive should only be applied to the Cloudflare CDN cache.""" + + +class RuleRulesetsSetCacheControlRuleActionParametersProxyRevalidateRemoveDirective(BaseModel): + """Remove the directive.""" + + operation: Literal["set", "remove"] + """The operation to perform on the cache-control directive.""" + + cloudflare_only: Optional[bool] = None + """Whether the directive should only be applied to the Cloudflare CDN cache.""" + + +RuleRulesetsSetCacheControlRuleActionParametersProxyRevalidate: TypeAlias = Union[ + RuleRulesetsSetCacheControlRuleActionParametersProxyRevalidateSetDirective, + RuleRulesetsSetCacheControlRuleActionParametersProxyRevalidateRemoveDirective, +] + + +class RuleRulesetsSetCacheControlRuleActionParametersPublicSetDirective(BaseModel): + """Set the directive.""" + + operation: Literal["set", "remove"] + """The operation to perform on the cache-control directive.""" + + cloudflare_only: Optional[bool] = None + """Whether the directive should only be applied to the Cloudflare CDN cache.""" + + +class RuleRulesetsSetCacheControlRuleActionParametersPublicRemoveDirective(BaseModel): + """Remove the directive.""" + + operation: Literal["set", "remove"] + """The operation to perform on the cache-control directive.""" + + cloudflare_only: Optional[bool] = None + """Whether the directive should only be applied to the Cloudflare CDN cache.""" + + +RuleRulesetsSetCacheControlRuleActionParametersPublic: TypeAlias = Union[ + RuleRulesetsSetCacheControlRuleActionParametersPublicSetDirective, + RuleRulesetsSetCacheControlRuleActionParametersPublicRemoveDirective, +] + + +class RuleRulesetsSetCacheControlRuleActionParametersSMaxageSetDirective(BaseModel): + """Set the directive with a duration value in seconds.""" + + operation: Literal["set", "remove"] + """The operation to perform on the cache-control directive.""" + + value: int + """The duration value in seconds for the directive.""" + + cloudflare_only: Optional[bool] = None + """Whether the directive should only be applied to the Cloudflare CDN cache.""" + + +class RuleRulesetsSetCacheControlRuleActionParametersSMaxageRemoveDirective(BaseModel): + """Remove the directive.""" + + operation: Literal["set", "remove"] + """The operation to perform on the cache-control directive.""" + + cloudflare_only: Optional[bool] = None + """Whether the directive should only be applied to the Cloudflare CDN cache.""" + + +RuleRulesetsSetCacheControlRuleActionParametersSMaxage: TypeAlias = Union[ + RuleRulesetsSetCacheControlRuleActionParametersSMaxageSetDirective, + RuleRulesetsSetCacheControlRuleActionParametersSMaxageRemoveDirective, +] + + +class RuleRulesetsSetCacheControlRuleActionParametersStaleIfErrorSetDirective(BaseModel): + """Set the directive with a duration value in seconds.""" + + operation: Literal["set", "remove"] + """The operation to perform on the cache-control directive.""" + + value: int + """The duration value in seconds for the directive.""" + + cloudflare_only: Optional[bool] = None + """Whether the directive should only be applied to the Cloudflare CDN cache.""" + + +class RuleRulesetsSetCacheControlRuleActionParametersStaleIfErrorRemoveDirective(BaseModel): + """Remove the directive.""" + + operation: Literal["set", "remove"] + """The operation to perform on the cache-control directive.""" + + cloudflare_only: Optional[bool] = None + """Whether the directive should only be applied to the Cloudflare CDN cache.""" + + +RuleRulesetsSetCacheControlRuleActionParametersStaleIfError: TypeAlias = Union[ + RuleRulesetsSetCacheControlRuleActionParametersStaleIfErrorSetDirective, + RuleRulesetsSetCacheControlRuleActionParametersStaleIfErrorRemoveDirective, +] + + +class RuleRulesetsSetCacheControlRuleActionParametersStaleWhileRevalidateSetDirective(BaseModel): + """Set the directive with a duration value in seconds.""" + + operation: Literal["set", "remove"] + """The operation to perform on the cache-control directive.""" + + value: int + """The duration value in seconds for the directive.""" + + cloudflare_only: Optional[bool] = None + """Whether the directive should only be applied to the Cloudflare CDN cache.""" + + +class RuleRulesetsSetCacheControlRuleActionParametersStaleWhileRevalidateRemoveDirective(BaseModel): + """Remove the directive.""" + + operation: Literal["set", "remove"] + """The operation to perform on the cache-control directive.""" + + cloudflare_only: Optional[bool] = None + """Whether the directive should only be applied to the Cloudflare CDN cache.""" + + +RuleRulesetsSetCacheControlRuleActionParametersStaleWhileRevalidate: TypeAlias = Union[ + RuleRulesetsSetCacheControlRuleActionParametersStaleWhileRevalidateSetDirective, + RuleRulesetsSetCacheControlRuleActionParametersStaleWhileRevalidateRemoveDirective, +] + + +class RuleRulesetsSetCacheControlRuleActionParameters(BaseModel): + """The parameters configuring the rule's action.""" + + immutable: Optional[RuleRulesetsSetCacheControlRuleActionParametersImmutable] = None + """A cache-control directive configuration.""" + + max_age: Optional[RuleRulesetsSetCacheControlRuleActionParametersMaxAge] = FieldInfo(alias="max-age", default=None) + """ + A cache-control directive configuration that accepts a duration value in + seconds. + """ + + must_revalidate: Optional[RuleRulesetsSetCacheControlRuleActionParametersMustRevalidate] = FieldInfo( + alias="must-revalidate", default=None + ) + """A cache-control directive configuration.""" + + must_understand: Optional[RuleRulesetsSetCacheControlRuleActionParametersMustUnderstand] = FieldInfo( + alias="must-understand", default=None + ) + """A cache-control directive configuration.""" + + no_cache: Optional[RuleRulesetsSetCacheControlRuleActionParametersNoCache] = FieldInfo( + alias="no-cache", default=None + ) + """ + A cache-control directive configuration that accepts optional qualifiers (header + names). + """ + + no_store: Optional[RuleRulesetsSetCacheControlRuleActionParametersNoStore] = FieldInfo( + alias="no-store", default=None + ) + """A cache-control directive configuration.""" + + no_transform: Optional[RuleRulesetsSetCacheControlRuleActionParametersNoTransform] = FieldInfo( + alias="no-transform", default=None + ) + """A cache-control directive configuration.""" + + private: Optional[RuleRulesetsSetCacheControlRuleActionParametersPrivate] = None + """ + A cache-control directive configuration that accepts optional qualifiers (header + names). + """ + + proxy_revalidate: Optional[RuleRulesetsSetCacheControlRuleActionParametersProxyRevalidate] = FieldInfo( + alias="proxy-revalidate", default=None + ) + """A cache-control directive configuration.""" + + public: Optional[RuleRulesetsSetCacheControlRuleActionParametersPublic] = None + """A cache-control directive configuration.""" + + s_maxage: Optional[RuleRulesetsSetCacheControlRuleActionParametersSMaxage] = FieldInfo( + alias="s-maxage", default=None + ) + """ + A cache-control directive configuration that accepts a duration value in + seconds. + """ + + stale_if_error: Optional[RuleRulesetsSetCacheControlRuleActionParametersStaleIfError] = FieldInfo( + alias="stale-if-error", default=None + ) + """ + A cache-control directive configuration that accepts a duration value in + seconds. + """ + + stale_while_revalidate: Optional[RuleRulesetsSetCacheControlRuleActionParametersStaleWhileRevalidate] = FieldInfo( + alias="stale-while-revalidate", default=None + ) + """ + A cache-control directive configuration that accepts a duration value in + seconds. + """ + + +class RuleRulesetsSetCacheControlRuleExposedCredentialCheck(BaseModel): + """Configuration for exposed credential checking.""" + + password_expression: str + """An expression that selects the password used in the credentials check.""" + + username_expression: str + """An expression that selects the user ID used in the credentials check.""" + + +class RuleRulesetsSetCacheControlRuleRatelimit(BaseModel): + """An object configuring the rule's rate limit behavior.""" + + characteristics: List[str] + """ + Characteristics of the request on which the rate limit counter will be + incremented. + """ + + period: int + """Period in seconds over which the counter is being incremented.""" + + counting_expression: Optional[str] = None + """An expression that defines when the rate limit counter should be incremented. + + It defaults to the same as the rule's expression. + """ + + mitigation_timeout: Optional[int] = None + """ + Period of time in seconds after which the action will be disabled following its + first execution. + """ + + requests_per_period: Optional[int] = None + """ + The threshold of requests per period after which the action will be executed for + the first time. + """ + + requests_to_origin: Optional[bool] = None + """Whether counting is only performed when an origin is reached.""" + + score_per_period: Optional[int] = None + """ + The score threshold per period for which the action will be executed the first + time. + """ + + score_response_header_name: Optional[str] = None + """ + A response header name provided by the origin, which contains the score to + increment rate limit counter with. + """ + + +class RuleRulesetsSetCacheControlRule(BaseModel): + last_updated: datetime + """The timestamp of when the rule was last modified.""" + + version: str + """The version of the rule.""" + + id: Optional[str] = None + """The unique ID of the rule.""" + + action: Optional[Literal["set_cache_control"]] = None + """The action to perform when the rule matches.""" + + action_parameters: Optional[RuleRulesetsSetCacheControlRuleActionParameters] = None + """The parameters configuring the rule's action.""" + + categories: Optional[List[str]] = None + """The categories of the rule.""" + + description: Optional[str] = None + """An informative description of the rule.""" + + enabled: Optional[bool] = None + """Whether the rule should be executed.""" + + exposed_credential_check: Optional[RuleRulesetsSetCacheControlRuleExposedCredentialCheck] = None + """Configuration for exposed credential checking.""" + + expression: Optional[str] = None + """The expression defining which traffic will match the rule.""" + + logging: Optional[Logging] = None + """An object configuring the rule's logging behavior.""" + + ratelimit: Optional[RuleRulesetsSetCacheControlRuleRatelimit] = None + """An object configuring the rule's rate limit behavior.""" + + ref: Optional[str] = None + """The reference of the rule (the rule's ID by default).""" + + +class RuleRulesetsSetCacheTagsRuleActionParametersAddCacheTagsValues(BaseModel): + """Add cache tags using a list of values.""" + + operation: Literal["add", "remove", "set"] + """The operation to perform on the cache tags.""" + + values: List[str] + """A list of cache tag values.""" + + +class RuleRulesetsSetCacheTagsRuleActionParametersAddCacheTagsExpression(BaseModel): + """Add cache tags using an expression.""" + + expression: str + """An expression that evaluates to an array of cache tag values.""" + + operation: Literal["add", "remove", "set"] + """The operation to perform on the cache tags.""" + + +class RuleRulesetsSetCacheTagsRuleActionParametersRemoveCacheTagsValues(BaseModel): + """Remove cache tags using a list of values.""" + + operation: Literal["add", "remove", "set"] + """The operation to perform on the cache tags.""" + + values: List[str] + """A list of cache tag values.""" + + +class RuleRulesetsSetCacheTagsRuleActionParametersRemoveCacheTagsExpression(BaseModel): + """Remove cache tags using an expression.""" + + expression: str + """An expression that evaluates to an array of cache tag values.""" + + operation: Literal["add", "remove", "set"] + """The operation to perform on the cache tags.""" + + +class RuleRulesetsSetCacheTagsRuleActionParametersSetCacheTagsValues(BaseModel): + """Set cache tags using a list of values.""" + + operation: Literal["add", "remove", "set"] + """The operation to perform on the cache tags.""" + + values: List[str] + """A list of cache tag values.""" + + +class RuleRulesetsSetCacheTagsRuleActionParametersSetCacheTagsExpression(BaseModel): + """Set cache tags using an expression.""" + + expression: str + """An expression that evaluates to an array of cache tag values.""" + + operation: Literal["add", "remove", "set"] + """The operation to perform on the cache tags.""" + + +RuleRulesetsSetCacheTagsRuleActionParameters: TypeAlias = Union[ + RuleRulesetsSetCacheTagsRuleActionParametersAddCacheTagsValues, + RuleRulesetsSetCacheTagsRuleActionParametersAddCacheTagsExpression, + RuleRulesetsSetCacheTagsRuleActionParametersRemoveCacheTagsValues, + RuleRulesetsSetCacheTagsRuleActionParametersRemoveCacheTagsExpression, + RuleRulesetsSetCacheTagsRuleActionParametersSetCacheTagsValues, + RuleRulesetsSetCacheTagsRuleActionParametersSetCacheTagsExpression, +] + + +class RuleRulesetsSetCacheTagsRuleExposedCredentialCheck(BaseModel): + """Configuration for exposed credential checking.""" + + password_expression: str + """An expression that selects the password used in the credentials check.""" + + username_expression: str + """An expression that selects the user ID used in the credentials check.""" + + +class RuleRulesetsSetCacheTagsRuleRatelimit(BaseModel): + """An object configuring the rule's rate limit behavior.""" + + characteristics: List[str] + """ + Characteristics of the request on which the rate limit counter will be + incremented. + """ + + period: int + """Period in seconds over which the counter is being incremented.""" + + counting_expression: Optional[str] = None + """An expression that defines when the rate limit counter should be incremented. + + It defaults to the same as the rule's expression. + """ + + mitigation_timeout: Optional[int] = None + """ + Period of time in seconds after which the action will be disabled following its + first execution. + """ + + requests_per_period: Optional[int] = None + """ + The threshold of requests per period after which the action will be executed for + the first time. + """ + + requests_to_origin: Optional[bool] = None + """Whether counting is only performed when an origin is reached.""" + + score_per_period: Optional[int] = None + """ + The score threshold per period for which the action will be executed the first + time. + """ + + score_response_header_name: Optional[str] = None + """ + A response header name provided by the origin, which contains the score to + increment rate limit counter with. + """ + + +class RuleRulesetsSetCacheTagsRule(BaseModel): + last_updated: datetime + """The timestamp of when the rule was last modified.""" + + version: str + """The version of the rule.""" + + id: Optional[str] = None + """The unique ID of the rule.""" + + action: Optional[Literal["set_cache_tags"]] = None + """The action to perform when the rule matches.""" + + action_parameters: Optional[RuleRulesetsSetCacheTagsRuleActionParameters] = None + """The parameters configuring the rule's action.""" + + categories: Optional[List[str]] = None + """The categories of the rule.""" + + description: Optional[str] = None + """An informative description of the rule.""" + + enabled: Optional[bool] = None + """Whether the rule should be executed.""" + + exposed_credential_check: Optional[RuleRulesetsSetCacheTagsRuleExposedCredentialCheck] = None + """Configuration for exposed credential checking.""" + + expression: Optional[str] = None + """The expression defining which traffic will match the rule.""" + + logging: Optional[Logging] = None + """An object configuring the rule's logging behavior.""" + + ratelimit: Optional[RuleRulesetsSetCacheTagsRuleRatelimit] = None + """An object configuring the rule's rate limit behavior.""" + + ref: Optional[str] = None + """The reference of the rule (the rule's ID by default).""" + + Rule: TypeAlias = Annotated[ Union[ BlockRule, @@ -249,7 +1009,9 @@ class RuleRulesetsJSChallengeRule(BaseModel): RouteRule, ScoreRule, ServeErrorRule, + RuleRulesetsSetCacheControlRule, SetCacheSettingsRule, + RuleRulesetsSetCacheTagsRule, SetConfigRule, SkipRule, ], diff --git a/src/cloudflare/types/rulesets/ruleset_create_params.py b/src/cloudflare/types/rulesets/ruleset_create_params.py index d70cfb8f604..e1130c331fa 100644 --- a/src/cloudflare/types/rulesets/ruleset_create_params.py +++ b/src/cloudflare/types/rulesets/ruleset_create_params.py @@ -3,11 +3,12 @@ from __future__ import annotations from typing import Union, Iterable -from typing_extensions import Literal, Required, TypeAlias, TypedDict +from typing_extensions import Literal, Required, Annotated, TypeAlias, TypedDict from .kind import Kind from .phase import Phase from ..._types import SequenceNotStr +from ..._utils import PropertyInfo from .logging_param import LoggingParam from .log_rule_param import LogRuleParam from .skip_rule_param import SkipRuleParam @@ -35,6 +36,59 @@ "RuleRulesetsJSChallengeRule", "RuleRulesetsJSChallengeRuleExposedCredentialCheck", "RuleRulesetsJSChallengeRuleRatelimit", + "RuleRulesetsSetCacheControlRule", + "RuleRulesetsSetCacheControlRuleActionParameters", + "RuleRulesetsSetCacheControlRuleActionParametersImmutable", + "RuleRulesetsSetCacheControlRuleActionParametersImmutableSetDirective", + "RuleRulesetsSetCacheControlRuleActionParametersImmutableRemoveDirective", + "RuleRulesetsSetCacheControlRuleActionParametersMaxAge", + "RuleRulesetsSetCacheControlRuleActionParametersMaxAgeSetDirective", + "RuleRulesetsSetCacheControlRuleActionParametersMaxAgeRemoveDirective", + "RuleRulesetsSetCacheControlRuleActionParametersMustRevalidate", + "RuleRulesetsSetCacheControlRuleActionParametersMustRevalidateSetDirective", + "RuleRulesetsSetCacheControlRuleActionParametersMustRevalidateRemoveDirective", + "RuleRulesetsSetCacheControlRuleActionParametersMustUnderstand", + "RuleRulesetsSetCacheControlRuleActionParametersMustUnderstandSetDirective", + "RuleRulesetsSetCacheControlRuleActionParametersMustUnderstandRemoveDirective", + "RuleRulesetsSetCacheControlRuleActionParametersNoCache", + "RuleRulesetsSetCacheControlRuleActionParametersNoCacheSetDirective", + "RuleRulesetsSetCacheControlRuleActionParametersNoCacheRemoveDirective", + "RuleRulesetsSetCacheControlRuleActionParametersNoStore", + "RuleRulesetsSetCacheControlRuleActionParametersNoStoreSetDirective", + "RuleRulesetsSetCacheControlRuleActionParametersNoStoreRemoveDirective", + "RuleRulesetsSetCacheControlRuleActionParametersNoTransform", + "RuleRulesetsSetCacheControlRuleActionParametersNoTransformSetDirective", + "RuleRulesetsSetCacheControlRuleActionParametersNoTransformRemoveDirective", + "RuleRulesetsSetCacheControlRuleActionParametersPrivate", + "RuleRulesetsSetCacheControlRuleActionParametersPrivateSetDirective", + "RuleRulesetsSetCacheControlRuleActionParametersPrivateRemoveDirective", + "RuleRulesetsSetCacheControlRuleActionParametersProxyRevalidate", + "RuleRulesetsSetCacheControlRuleActionParametersProxyRevalidateSetDirective", + "RuleRulesetsSetCacheControlRuleActionParametersProxyRevalidateRemoveDirective", + "RuleRulesetsSetCacheControlRuleActionParametersPublic", + "RuleRulesetsSetCacheControlRuleActionParametersPublicSetDirective", + "RuleRulesetsSetCacheControlRuleActionParametersPublicRemoveDirective", + "RuleRulesetsSetCacheControlRuleActionParametersSMaxage", + "RuleRulesetsSetCacheControlRuleActionParametersSMaxageSetDirective", + "RuleRulesetsSetCacheControlRuleActionParametersSMaxageRemoveDirective", + "RuleRulesetsSetCacheControlRuleActionParametersStaleIfError", + "RuleRulesetsSetCacheControlRuleActionParametersStaleIfErrorSetDirective", + "RuleRulesetsSetCacheControlRuleActionParametersStaleIfErrorRemoveDirective", + "RuleRulesetsSetCacheControlRuleActionParametersStaleWhileRevalidate", + "RuleRulesetsSetCacheControlRuleActionParametersStaleWhileRevalidateSetDirective", + "RuleRulesetsSetCacheControlRuleActionParametersStaleWhileRevalidateRemoveDirective", + "RuleRulesetsSetCacheControlRuleExposedCredentialCheck", + "RuleRulesetsSetCacheControlRuleRatelimit", + "RuleRulesetsSetCacheTagsRule", + "RuleRulesetsSetCacheTagsRuleActionParameters", + "RuleRulesetsSetCacheTagsRuleActionParametersAddCacheTagsValues", + "RuleRulesetsSetCacheTagsRuleActionParametersAddCacheTagsExpression", + "RuleRulesetsSetCacheTagsRuleActionParametersRemoveCacheTagsValues", + "RuleRulesetsSetCacheTagsRuleActionParametersRemoveCacheTagsExpression", + "RuleRulesetsSetCacheTagsRuleActionParametersSetCacheTagsValues", + "RuleRulesetsSetCacheTagsRuleActionParametersSetCacheTagsExpression", + "RuleRulesetsSetCacheTagsRuleExposedCredentialCheck", + "RuleRulesetsSetCacheTagsRuleRatelimit", ] @@ -237,6 +291,688 @@ class RuleRulesetsJSChallengeRule(TypedDict, total=False): """The reference of the rule (the rule's ID by default).""" +class RuleRulesetsSetCacheControlRuleActionParametersImmutableSetDirective(TypedDict, total=False): + """Set the directive.""" + + operation: Required[Literal["set", "remove"]] + """The operation to perform on the cache-control directive.""" + + cloudflare_only: bool + """Whether the directive should only be applied to the Cloudflare CDN cache.""" + + +class RuleRulesetsSetCacheControlRuleActionParametersImmutableRemoveDirective(TypedDict, total=False): + """Remove the directive.""" + + operation: Required[Literal["set", "remove"]] + """The operation to perform on the cache-control directive.""" + + cloudflare_only: bool + """Whether the directive should only be applied to the Cloudflare CDN cache.""" + + +RuleRulesetsSetCacheControlRuleActionParametersImmutable: TypeAlias = Union[ + RuleRulesetsSetCacheControlRuleActionParametersImmutableSetDirective, + RuleRulesetsSetCacheControlRuleActionParametersImmutableRemoveDirective, +] + + +class RuleRulesetsSetCacheControlRuleActionParametersMaxAgeSetDirective(TypedDict, total=False): + """Set the directive with a duration value in seconds.""" + + operation: Required[Literal["set", "remove"]] + """The operation to perform on the cache-control directive.""" + + value: Required[int] + """The duration value in seconds for the directive.""" + + cloudflare_only: bool + """Whether the directive should only be applied to the Cloudflare CDN cache.""" + + +class RuleRulesetsSetCacheControlRuleActionParametersMaxAgeRemoveDirective(TypedDict, total=False): + """Remove the directive.""" + + operation: Required[Literal["set", "remove"]] + """The operation to perform on the cache-control directive.""" + + cloudflare_only: bool + """Whether the directive should only be applied to the Cloudflare CDN cache.""" + + +RuleRulesetsSetCacheControlRuleActionParametersMaxAge: TypeAlias = Union[ + RuleRulesetsSetCacheControlRuleActionParametersMaxAgeSetDirective, + RuleRulesetsSetCacheControlRuleActionParametersMaxAgeRemoveDirective, +] + + +class RuleRulesetsSetCacheControlRuleActionParametersMustRevalidateSetDirective(TypedDict, total=False): + """Set the directive.""" + + operation: Required[Literal["set", "remove"]] + """The operation to perform on the cache-control directive.""" + + cloudflare_only: bool + """Whether the directive should only be applied to the Cloudflare CDN cache.""" + + +class RuleRulesetsSetCacheControlRuleActionParametersMustRevalidateRemoveDirective(TypedDict, total=False): + """Remove the directive.""" + + operation: Required[Literal["set", "remove"]] + """The operation to perform on the cache-control directive.""" + + cloudflare_only: bool + """Whether the directive should only be applied to the Cloudflare CDN cache.""" + + +RuleRulesetsSetCacheControlRuleActionParametersMustRevalidate: TypeAlias = Union[ + RuleRulesetsSetCacheControlRuleActionParametersMustRevalidateSetDirective, + RuleRulesetsSetCacheControlRuleActionParametersMustRevalidateRemoveDirective, +] + + +class RuleRulesetsSetCacheControlRuleActionParametersMustUnderstandSetDirective(TypedDict, total=False): + """Set the directive.""" + + operation: Required[Literal["set", "remove"]] + """The operation to perform on the cache-control directive.""" + + cloudflare_only: bool + """Whether the directive should only be applied to the Cloudflare CDN cache.""" + + +class RuleRulesetsSetCacheControlRuleActionParametersMustUnderstandRemoveDirective(TypedDict, total=False): + """Remove the directive.""" + + operation: Required[Literal["set", "remove"]] + """The operation to perform on the cache-control directive.""" + + cloudflare_only: bool + """Whether the directive should only be applied to the Cloudflare CDN cache.""" + + +RuleRulesetsSetCacheControlRuleActionParametersMustUnderstand: TypeAlias = Union[ + RuleRulesetsSetCacheControlRuleActionParametersMustUnderstandSetDirective, + RuleRulesetsSetCacheControlRuleActionParametersMustUnderstandRemoveDirective, +] + + +class RuleRulesetsSetCacheControlRuleActionParametersNoCacheSetDirective(TypedDict, total=False): + """Set the directive with optional qualifiers.""" + + operation: Required[Literal["set", "remove"]] + """The operation to perform on the cache-control directive.""" + + cloudflare_only: bool + """Whether the directive should only be applied to the Cloudflare CDN cache.""" + + qualifiers: SequenceNotStr[str] + """ + Optional list of header names to qualify the directive (e.g., for "private" or + "no-cache" directives). + """ + + +class RuleRulesetsSetCacheControlRuleActionParametersNoCacheRemoveDirective(TypedDict, total=False): + """Remove the directive.""" + + operation: Required[Literal["set", "remove"]] + """The operation to perform on the cache-control directive.""" + + cloudflare_only: bool + """Whether the directive should only be applied to the Cloudflare CDN cache.""" + + +RuleRulesetsSetCacheControlRuleActionParametersNoCache: TypeAlias = Union[ + RuleRulesetsSetCacheControlRuleActionParametersNoCacheSetDirective, + RuleRulesetsSetCacheControlRuleActionParametersNoCacheRemoveDirective, +] + + +class RuleRulesetsSetCacheControlRuleActionParametersNoStoreSetDirective(TypedDict, total=False): + """Set the directive.""" + + operation: Required[Literal["set", "remove"]] + """The operation to perform on the cache-control directive.""" + + cloudflare_only: bool + """Whether the directive should only be applied to the Cloudflare CDN cache.""" + + +class RuleRulesetsSetCacheControlRuleActionParametersNoStoreRemoveDirective(TypedDict, total=False): + """Remove the directive.""" + + operation: Required[Literal["set", "remove"]] + """The operation to perform on the cache-control directive.""" + + cloudflare_only: bool + """Whether the directive should only be applied to the Cloudflare CDN cache.""" + + +RuleRulesetsSetCacheControlRuleActionParametersNoStore: TypeAlias = Union[ + RuleRulesetsSetCacheControlRuleActionParametersNoStoreSetDirective, + RuleRulesetsSetCacheControlRuleActionParametersNoStoreRemoveDirective, +] + + +class RuleRulesetsSetCacheControlRuleActionParametersNoTransformSetDirective(TypedDict, total=False): + """Set the directive.""" + + operation: Required[Literal["set", "remove"]] + """The operation to perform on the cache-control directive.""" + + cloudflare_only: bool + """Whether the directive should only be applied to the Cloudflare CDN cache.""" + + +class RuleRulesetsSetCacheControlRuleActionParametersNoTransformRemoveDirective(TypedDict, total=False): + """Remove the directive.""" + + operation: Required[Literal["set", "remove"]] + """The operation to perform on the cache-control directive.""" + + cloudflare_only: bool + """Whether the directive should only be applied to the Cloudflare CDN cache.""" + + +RuleRulesetsSetCacheControlRuleActionParametersNoTransform: TypeAlias = Union[ + RuleRulesetsSetCacheControlRuleActionParametersNoTransformSetDirective, + RuleRulesetsSetCacheControlRuleActionParametersNoTransformRemoveDirective, +] + + +class RuleRulesetsSetCacheControlRuleActionParametersPrivateSetDirective(TypedDict, total=False): + """Set the directive with optional qualifiers.""" + + operation: Required[Literal["set", "remove"]] + """The operation to perform on the cache-control directive.""" + + cloudflare_only: bool + """Whether the directive should only be applied to the Cloudflare CDN cache.""" + + qualifiers: SequenceNotStr[str] + """ + Optional list of header names to qualify the directive (e.g., for "private" or + "no-cache" directives). + """ + + +class RuleRulesetsSetCacheControlRuleActionParametersPrivateRemoveDirective(TypedDict, total=False): + """Remove the directive.""" + + operation: Required[Literal["set", "remove"]] + """The operation to perform on the cache-control directive.""" + + cloudflare_only: bool + """Whether the directive should only be applied to the Cloudflare CDN cache.""" + + +RuleRulesetsSetCacheControlRuleActionParametersPrivate: TypeAlias = Union[ + RuleRulesetsSetCacheControlRuleActionParametersPrivateSetDirective, + RuleRulesetsSetCacheControlRuleActionParametersPrivateRemoveDirective, +] + + +class RuleRulesetsSetCacheControlRuleActionParametersProxyRevalidateSetDirective(TypedDict, total=False): + """Set the directive.""" + + operation: Required[Literal["set", "remove"]] + """The operation to perform on the cache-control directive.""" + + cloudflare_only: bool + """Whether the directive should only be applied to the Cloudflare CDN cache.""" + + +class RuleRulesetsSetCacheControlRuleActionParametersProxyRevalidateRemoveDirective(TypedDict, total=False): + """Remove the directive.""" + + operation: Required[Literal["set", "remove"]] + """The operation to perform on the cache-control directive.""" + + cloudflare_only: bool + """Whether the directive should only be applied to the Cloudflare CDN cache.""" + + +RuleRulesetsSetCacheControlRuleActionParametersProxyRevalidate: TypeAlias = Union[ + RuleRulesetsSetCacheControlRuleActionParametersProxyRevalidateSetDirective, + RuleRulesetsSetCacheControlRuleActionParametersProxyRevalidateRemoveDirective, +] + + +class RuleRulesetsSetCacheControlRuleActionParametersPublicSetDirective(TypedDict, total=False): + """Set the directive.""" + + operation: Required[Literal["set", "remove"]] + """The operation to perform on the cache-control directive.""" + + cloudflare_only: bool + """Whether the directive should only be applied to the Cloudflare CDN cache.""" + + +class RuleRulesetsSetCacheControlRuleActionParametersPublicRemoveDirective(TypedDict, total=False): + """Remove the directive.""" + + operation: Required[Literal["set", "remove"]] + """The operation to perform on the cache-control directive.""" + + cloudflare_only: bool + """Whether the directive should only be applied to the Cloudflare CDN cache.""" + + +RuleRulesetsSetCacheControlRuleActionParametersPublic: TypeAlias = Union[ + RuleRulesetsSetCacheControlRuleActionParametersPublicSetDirective, + RuleRulesetsSetCacheControlRuleActionParametersPublicRemoveDirective, +] + + +class RuleRulesetsSetCacheControlRuleActionParametersSMaxageSetDirective(TypedDict, total=False): + """Set the directive with a duration value in seconds.""" + + operation: Required[Literal["set", "remove"]] + """The operation to perform on the cache-control directive.""" + + value: Required[int] + """The duration value in seconds for the directive.""" + + cloudflare_only: bool + """Whether the directive should only be applied to the Cloudflare CDN cache.""" + + +class RuleRulesetsSetCacheControlRuleActionParametersSMaxageRemoveDirective(TypedDict, total=False): + """Remove the directive.""" + + operation: Required[Literal["set", "remove"]] + """The operation to perform on the cache-control directive.""" + + cloudflare_only: bool + """Whether the directive should only be applied to the Cloudflare CDN cache.""" + + +RuleRulesetsSetCacheControlRuleActionParametersSMaxage: TypeAlias = Union[ + RuleRulesetsSetCacheControlRuleActionParametersSMaxageSetDirective, + RuleRulesetsSetCacheControlRuleActionParametersSMaxageRemoveDirective, +] + + +class RuleRulesetsSetCacheControlRuleActionParametersStaleIfErrorSetDirective(TypedDict, total=False): + """Set the directive with a duration value in seconds.""" + + operation: Required[Literal["set", "remove"]] + """The operation to perform on the cache-control directive.""" + + value: Required[int] + """The duration value in seconds for the directive.""" + + cloudflare_only: bool + """Whether the directive should only be applied to the Cloudflare CDN cache.""" + + +class RuleRulesetsSetCacheControlRuleActionParametersStaleIfErrorRemoveDirective(TypedDict, total=False): + """Remove the directive.""" + + operation: Required[Literal["set", "remove"]] + """The operation to perform on the cache-control directive.""" + + cloudflare_only: bool + """Whether the directive should only be applied to the Cloudflare CDN cache.""" + + +RuleRulesetsSetCacheControlRuleActionParametersStaleIfError: TypeAlias = Union[ + RuleRulesetsSetCacheControlRuleActionParametersStaleIfErrorSetDirective, + RuleRulesetsSetCacheControlRuleActionParametersStaleIfErrorRemoveDirective, +] + + +class RuleRulesetsSetCacheControlRuleActionParametersStaleWhileRevalidateSetDirective(TypedDict, total=False): + """Set the directive with a duration value in seconds.""" + + operation: Required[Literal["set", "remove"]] + """The operation to perform on the cache-control directive.""" + + value: Required[int] + """The duration value in seconds for the directive.""" + + cloudflare_only: bool + """Whether the directive should only be applied to the Cloudflare CDN cache.""" + + +class RuleRulesetsSetCacheControlRuleActionParametersStaleWhileRevalidateRemoveDirective(TypedDict, total=False): + """Remove the directive.""" + + operation: Required[Literal["set", "remove"]] + """The operation to perform on the cache-control directive.""" + + cloudflare_only: bool + """Whether the directive should only be applied to the Cloudflare CDN cache.""" + + +RuleRulesetsSetCacheControlRuleActionParametersStaleWhileRevalidate: TypeAlias = Union[ + RuleRulesetsSetCacheControlRuleActionParametersStaleWhileRevalidateSetDirective, + RuleRulesetsSetCacheControlRuleActionParametersStaleWhileRevalidateRemoveDirective, +] + + +class RuleRulesetsSetCacheControlRuleActionParameters(TypedDict, total=False): + """The parameters configuring the rule's action.""" + + immutable: RuleRulesetsSetCacheControlRuleActionParametersImmutable + """A cache-control directive configuration.""" + + max_age: Annotated[RuleRulesetsSetCacheControlRuleActionParametersMaxAge, PropertyInfo(alias="max-age")] + """ + A cache-control directive configuration that accepts a duration value in + seconds. + """ + + must_revalidate: Annotated[ + RuleRulesetsSetCacheControlRuleActionParametersMustRevalidate, PropertyInfo(alias="must-revalidate") + ] + """A cache-control directive configuration.""" + + must_understand: Annotated[ + RuleRulesetsSetCacheControlRuleActionParametersMustUnderstand, PropertyInfo(alias="must-understand") + ] + """A cache-control directive configuration.""" + + no_cache: Annotated[RuleRulesetsSetCacheControlRuleActionParametersNoCache, PropertyInfo(alias="no-cache")] + """ + A cache-control directive configuration that accepts optional qualifiers (header + names). + """ + + no_store: Annotated[RuleRulesetsSetCacheControlRuleActionParametersNoStore, PropertyInfo(alias="no-store")] + """A cache-control directive configuration.""" + + no_transform: Annotated[ + RuleRulesetsSetCacheControlRuleActionParametersNoTransform, PropertyInfo(alias="no-transform") + ] + """A cache-control directive configuration.""" + + private: RuleRulesetsSetCacheControlRuleActionParametersPrivate + """ + A cache-control directive configuration that accepts optional qualifiers (header + names). + """ + + proxy_revalidate: Annotated[ + RuleRulesetsSetCacheControlRuleActionParametersProxyRevalidate, PropertyInfo(alias="proxy-revalidate") + ] + """A cache-control directive configuration.""" + + public: RuleRulesetsSetCacheControlRuleActionParametersPublic + """A cache-control directive configuration.""" + + s_maxage: Annotated[RuleRulesetsSetCacheControlRuleActionParametersSMaxage, PropertyInfo(alias="s-maxage")] + """ + A cache-control directive configuration that accepts a duration value in + seconds. + """ + + stale_if_error: Annotated[ + RuleRulesetsSetCacheControlRuleActionParametersStaleIfError, PropertyInfo(alias="stale-if-error") + ] + """ + A cache-control directive configuration that accepts a duration value in + seconds. + """ + + stale_while_revalidate: Annotated[ + RuleRulesetsSetCacheControlRuleActionParametersStaleWhileRevalidate, + PropertyInfo(alias="stale-while-revalidate"), + ] + """ + A cache-control directive configuration that accepts a duration value in + seconds. + """ + + +class RuleRulesetsSetCacheControlRuleExposedCredentialCheck(TypedDict, total=False): + """Configuration for exposed credential checking.""" + + password_expression: Required[str] + """An expression that selects the password used in the credentials check.""" + + username_expression: Required[str] + """An expression that selects the user ID used in the credentials check.""" + + +class RuleRulesetsSetCacheControlRuleRatelimit(TypedDict, total=False): + """An object configuring the rule's rate limit behavior.""" + + characteristics: Required[SequenceNotStr[str]] + """ + Characteristics of the request on which the rate limit counter will be + incremented. + """ + + period: Required[int] + """Period in seconds over which the counter is being incremented.""" + + counting_expression: str + """An expression that defines when the rate limit counter should be incremented. + + It defaults to the same as the rule's expression. + """ + + mitigation_timeout: int + """ + Period of time in seconds after which the action will be disabled following its + first execution. + """ + + requests_per_period: int + """ + The threshold of requests per period after which the action will be executed for + the first time. + """ + + requests_to_origin: bool + """Whether counting is only performed when an origin is reached.""" + + score_per_period: int + """ + The score threshold per period for which the action will be executed the first + time. + """ + + score_response_header_name: str + """ + A response header name provided by the origin, which contains the score to + increment rate limit counter with. + """ + + +class RuleRulesetsSetCacheControlRule(TypedDict, total=False): + id: str + """The unique ID of the rule.""" + + action: Literal["set_cache_control"] + """The action to perform when the rule matches.""" + + action_parameters: RuleRulesetsSetCacheControlRuleActionParameters + """The parameters configuring the rule's action.""" + + description: str + """An informative description of the rule.""" + + enabled: bool + """Whether the rule should be executed.""" + + exposed_credential_check: RuleRulesetsSetCacheControlRuleExposedCredentialCheck + """Configuration for exposed credential checking.""" + + expression: str + """The expression defining which traffic will match the rule.""" + + logging: LoggingParam + """An object configuring the rule's logging behavior.""" + + ratelimit: RuleRulesetsSetCacheControlRuleRatelimit + """An object configuring the rule's rate limit behavior.""" + + ref: str + """The reference of the rule (the rule's ID by default).""" + + +class RuleRulesetsSetCacheTagsRuleActionParametersAddCacheTagsValues(TypedDict, total=False): + """Add cache tags using a list of values.""" + + operation: Required[Literal["add", "remove", "set"]] + """The operation to perform on the cache tags.""" + + values: Required[SequenceNotStr[str]] + """A list of cache tag values.""" + + +class RuleRulesetsSetCacheTagsRuleActionParametersAddCacheTagsExpression(TypedDict, total=False): + """Add cache tags using an expression.""" + + expression: Required[str] + """An expression that evaluates to an array of cache tag values.""" + + operation: Required[Literal["add", "remove", "set"]] + """The operation to perform on the cache tags.""" + + +class RuleRulesetsSetCacheTagsRuleActionParametersRemoveCacheTagsValues(TypedDict, total=False): + """Remove cache tags using a list of values.""" + + operation: Required[Literal["add", "remove", "set"]] + """The operation to perform on the cache tags.""" + + values: Required[SequenceNotStr[str]] + """A list of cache tag values.""" + + +class RuleRulesetsSetCacheTagsRuleActionParametersRemoveCacheTagsExpression(TypedDict, total=False): + """Remove cache tags using an expression.""" + + expression: Required[str] + """An expression that evaluates to an array of cache tag values.""" + + operation: Required[Literal["add", "remove", "set"]] + """The operation to perform on the cache tags.""" + + +class RuleRulesetsSetCacheTagsRuleActionParametersSetCacheTagsValues(TypedDict, total=False): + """Set cache tags using a list of values.""" + + operation: Required[Literal["add", "remove", "set"]] + """The operation to perform on the cache tags.""" + + values: Required[SequenceNotStr[str]] + """A list of cache tag values.""" + + +class RuleRulesetsSetCacheTagsRuleActionParametersSetCacheTagsExpression(TypedDict, total=False): + """Set cache tags using an expression.""" + + expression: Required[str] + """An expression that evaluates to an array of cache tag values.""" + + operation: Required[Literal["add", "remove", "set"]] + """The operation to perform on the cache tags.""" + + +RuleRulesetsSetCacheTagsRuleActionParameters: TypeAlias = Union[ + RuleRulesetsSetCacheTagsRuleActionParametersAddCacheTagsValues, + RuleRulesetsSetCacheTagsRuleActionParametersAddCacheTagsExpression, + RuleRulesetsSetCacheTagsRuleActionParametersRemoveCacheTagsValues, + RuleRulesetsSetCacheTagsRuleActionParametersRemoveCacheTagsExpression, + RuleRulesetsSetCacheTagsRuleActionParametersSetCacheTagsValues, + RuleRulesetsSetCacheTagsRuleActionParametersSetCacheTagsExpression, +] + + +class RuleRulesetsSetCacheTagsRuleExposedCredentialCheck(TypedDict, total=False): + """Configuration for exposed credential checking.""" + + password_expression: Required[str] + """An expression that selects the password used in the credentials check.""" + + username_expression: Required[str] + """An expression that selects the user ID used in the credentials check.""" + + +class RuleRulesetsSetCacheTagsRuleRatelimit(TypedDict, total=False): + """An object configuring the rule's rate limit behavior.""" + + characteristics: Required[SequenceNotStr[str]] + """ + Characteristics of the request on which the rate limit counter will be + incremented. + """ + + period: Required[int] + """Period in seconds over which the counter is being incremented.""" + + counting_expression: str + """An expression that defines when the rate limit counter should be incremented. + + It defaults to the same as the rule's expression. + """ + + mitigation_timeout: int + """ + Period of time in seconds after which the action will be disabled following its + first execution. + """ + + requests_per_period: int + """ + The threshold of requests per period after which the action will be executed for + the first time. + """ + + requests_to_origin: bool + """Whether counting is only performed when an origin is reached.""" + + score_per_period: int + """ + The score threshold per period for which the action will be executed the first + time. + """ + + score_response_header_name: str + """ + A response header name provided by the origin, which contains the score to + increment rate limit counter with. + """ + + +class RuleRulesetsSetCacheTagsRule(TypedDict, total=False): + id: str + """The unique ID of the rule.""" + + action: Literal["set_cache_tags"] + """The action to perform when the rule matches.""" + + action_parameters: RuleRulesetsSetCacheTagsRuleActionParameters + """The parameters configuring the rule's action.""" + + description: str + """An informative description of the rule.""" + + enabled: bool + """Whether the rule should be executed.""" + + exposed_credential_check: RuleRulesetsSetCacheTagsRuleExposedCredentialCheck + """Configuration for exposed credential checking.""" + + expression: str + """The expression defining which traffic will match the rule.""" + + logging: LoggingParam + """An object configuring the rule's logging behavior.""" + + ratelimit: RuleRulesetsSetCacheTagsRuleRatelimit + """An object configuring the rule's rate limit behavior.""" + + ref: str + """The reference of the rule (the rule's ID by default).""" + + Rule: TypeAlias = Union[ BlockRuleParam, RuleRulesetsChallengeRule, @@ -253,7 +989,9 @@ class RuleRulesetsJSChallengeRule(TypedDict, total=False): RouteRuleParam, ScoreRuleParam, ServeErrorRuleParam, + RuleRulesetsSetCacheControlRule, SetCacheSettingsRuleParam, + RuleRulesetsSetCacheTagsRule, SetConfigRuleParam, SkipRuleParam, ] diff --git a/src/cloudflare/types/rulesets/ruleset_create_response.py b/src/cloudflare/types/rulesets/ruleset_create_response.py index 4b157ce0840..996e8edac9d 100644 --- a/src/cloudflare/types/rulesets/ruleset_create_response.py +++ b/src/cloudflare/types/rulesets/ruleset_create_response.py @@ -4,6 +4,8 @@ from datetime import datetime from typing_extensions import Literal, Annotated, TypeAlias +from pydantic import Field as FieldInfo + from .kind import Kind from .phase import Phase from .logging import Logging @@ -35,6 +37,59 @@ "RuleRulesetsJSChallengeRule", "RuleRulesetsJSChallengeRuleExposedCredentialCheck", "RuleRulesetsJSChallengeRuleRatelimit", + "RuleRulesetsSetCacheControlRule", + "RuleRulesetsSetCacheControlRuleActionParameters", + "RuleRulesetsSetCacheControlRuleActionParametersImmutable", + "RuleRulesetsSetCacheControlRuleActionParametersImmutableSetDirective", + "RuleRulesetsSetCacheControlRuleActionParametersImmutableRemoveDirective", + "RuleRulesetsSetCacheControlRuleActionParametersMaxAge", + "RuleRulesetsSetCacheControlRuleActionParametersMaxAgeSetDirective", + "RuleRulesetsSetCacheControlRuleActionParametersMaxAgeRemoveDirective", + "RuleRulesetsSetCacheControlRuleActionParametersMustRevalidate", + "RuleRulesetsSetCacheControlRuleActionParametersMustRevalidateSetDirective", + "RuleRulesetsSetCacheControlRuleActionParametersMustRevalidateRemoveDirective", + "RuleRulesetsSetCacheControlRuleActionParametersMustUnderstand", + "RuleRulesetsSetCacheControlRuleActionParametersMustUnderstandSetDirective", + "RuleRulesetsSetCacheControlRuleActionParametersMustUnderstandRemoveDirective", + "RuleRulesetsSetCacheControlRuleActionParametersNoCache", + "RuleRulesetsSetCacheControlRuleActionParametersNoCacheSetDirective", + "RuleRulesetsSetCacheControlRuleActionParametersNoCacheRemoveDirective", + "RuleRulesetsSetCacheControlRuleActionParametersNoStore", + "RuleRulesetsSetCacheControlRuleActionParametersNoStoreSetDirective", + "RuleRulesetsSetCacheControlRuleActionParametersNoStoreRemoveDirective", + "RuleRulesetsSetCacheControlRuleActionParametersNoTransform", + "RuleRulesetsSetCacheControlRuleActionParametersNoTransformSetDirective", + "RuleRulesetsSetCacheControlRuleActionParametersNoTransformRemoveDirective", + "RuleRulesetsSetCacheControlRuleActionParametersPrivate", + "RuleRulesetsSetCacheControlRuleActionParametersPrivateSetDirective", + "RuleRulesetsSetCacheControlRuleActionParametersPrivateRemoveDirective", + "RuleRulesetsSetCacheControlRuleActionParametersProxyRevalidate", + "RuleRulesetsSetCacheControlRuleActionParametersProxyRevalidateSetDirective", + "RuleRulesetsSetCacheControlRuleActionParametersProxyRevalidateRemoveDirective", + "RuleRulesetsSetCacheControlRuleActionParametersPublic", + "RuleRulesetsSetCacheControlRuleActionParametersPublicSetDirective", + "RuleRulesetsSetCacheControlRuleActionParametersPublicRemoveDirective", + "RuleRulesetsSetCacheControlRuleActionParametersSMaxage", + "RuleRulesetsSetCacheControlRuleActionParametersSMaxageSetDirective", + "RuleRulesetsSetCacheControlRuleActionParametersSMaxageRemoveDirective", + "RuleRulesetsSetCacheControlRuleActionParametersStaleIfError", + "RuleRulesetsSetCacheControlRuleActionParametersStaleIfErrorSetDirective", + "RuleRulesetsSetCacheControlRuleActionParametersStaleIfErrorRemoveDirective", + "RuleRulesetsSetCacheControlRuleActionParametersStaleWhileRevalidate", + "RuleRulesetsSetCacheControlRuleActionParametersStaleWhileRevalidateSetDirective", + "RuleRulesetsSetCacheControlRuleActionParametersStaleWhileRevalidateRemoveDirective", + "RuleRulesetsSetCacheControlRuleExposedCredentialCheck", + "RuleRulesetsSetCacheControlRuleRatelimit", + "RuleRulesetsSetCacheTagsRule", + "RuleRulesetsSetCacheTagsRuleActionParameters", + "RuleRulesetsSetCacheTagsRuleActionParametersAddCacheTagsValues", + "RuleRulesetsSetCacheTagsRuleActionParametersAddCacheTagsExpression", + "RuleRulesetsSetCacheTagsRuleActionParametersRemoveCacheTagsValues", + "RuleRulesetsSetCacheTagsRuleActionParametersRemoveCacheTagsExpression", + "RuleRulesetsSetCacheTagsRuleActionParametersSetCacheTagsValues", + "RuleRulesetsSetCacheTagsRuleActionParametersSetCacheTagsExpression", + "RuleRulesetsSetCacheTagsRuleExposedCredentialCheck", + "RuleRulesetsSetCacheTagsRuleRatelimit", ] @@ -232,6 +287,711 @@ class RuleRulesetsJSChallengeRule(BaseModel): """The reference of the rule (the rule's ID by default).""" +class RuleRulesetsSetCacheControlRuleActionParametersImmutableSetDirective(BaseModel): + """Set the directive.""" + + operation: Literal["set", "remove"] + """The operation to perform on the cache-control directive.""" + + cloudflare_only: Optional[bool] = None + """Whether the directive should only be applied to the Cloudflare CDN cache.""" + + +class RuleRulesetsSetCacheControlRuleActionParametersImmutableRemoveDirective(BaseModel): + """Remove the directive.""" + + operation: Literal["set", "remove"] + """The operation to perform on the cache-control directive.""" + + cloudflare_only: Optional[bool] = None + """Whether the directive should only be applied to the Cloudflare CDN cache.""" + + +RuleRulesetsSetCacheControlRuleActionParametersImmutable: TypeAlias = Union[ + RuleRulesetsSetCacheControlRuleActionParametersImmutableSetDirective, + RuleRulesetsSetCacheControlRuleActionParametersImmutableRemoveDirective, +] + + +class RuleRulesetsSetCacheControlRuleActionParametersMaxAgeSetDirective(BaseModel): + """Set the directive with a duration value in seconds.""" + + operation: Literal["set", "remove"] + """The operation to perform on the cache-control directive.""" + + value: int + """The duration value in seconds for the directive.""" + + cloudflare_only: Optional[bool] = None + """Whether the directive should only be applied to the Cloudflare CDN cache.""" + + +class RuleRulesetsSetCacheControlRuleActionParametersMaxAgeRemoveDirective(BaseModel): + """Remove the directive.""" + + operation: Literal["set", "remove"] + """The operation to perform on the cache-control directive.""" + + cloudflare_only: Optional[bool] = None + """Whether the directive should only be applied to the Cloudflare CDN cache.""" + + +RuleRulesetsSetCacheControlRuleActionParametersMaxAge: TypeAlias = Union[ + RuleRulesetsSetCacheControlRuleActionParametersMaxAgeSetDirective, + RuleRulesetsSetCacheControlRuleActionParametersMaxAgeRemoveDirective, +] + + +class RuleRulesetsSetCacheControlRuleActionParametersMustRevalidateSetDirective(BaseModel): + """Set the directive.""" + + operation: Literal["set", "remove"] + """The operation to perform on the cache-control directive.""" + + cloudflare_only: Optional[bool] = None + """Whether the directive should only be applied to the Cloudflare CDN cache.""" + + +class RuleRulesetsSetCacheControlRuleActionParametersMustRevalidateRemoveDirective(BaseModel): + """Remove the directive.""" + + operation: Literal["set", "remove"] + """The operation to perform on the cache-control directive.""" + + cloudflare_only: Optional[bool] = None + """Whether the directive should only be applied to the Cloudflare CDN cache.""" + + +RuleRulesetsSetCacheControlRuleActionParametersMustRevalidate: TypeAlias = Union[ + RuleRulesetsSetCacheControlRuleActionParametersMustRevalidateSetDirective, + RuleRulesetsSetCacheControlRuleActionParametersMustRevalidateRemoveDirective, +] + + +class RuleRulesetsSetCacheControlRuleActionParametersMustUnderstandSetDirective(BaseModel): + """Set the directive.""" + + operation: Literal["set", "remove"] + """The operation to perform on the cache-control directive.""" + + cloudflare_only: Optional[bool] = None + """Whether the directive should only be applied to the Cloudflare CDN cache.""" + + +class RuleRulesetsSetCacheControlRuleActionParametersMustUnderstandRemoveDirective(BaseModel): + """Remove the directive.""" + + operation: Literal["set", "remove"] + """The operation to perform on the cache-control directive.""" + + cloudflare_only: Optional[bool] = None + """Whether the directive should only be applied to the Cloudflare CDN cache.""" + + +RuleRulesetsSetCacheControlRuleActionParametersMustUnderstand: TypeAlias = Union[ + RuleRulesetsSetCacheControlRuleActionParametersMustUnderstandSetDirective, + RuleRulesetsSetCacheControlRuleActionParametersMustUnderstandRemoveDirective, +] + + +class RuleRulesetsSetCacheControlRuleActionParametersNoCacheSetDirective(BaseModel): + """Set the directive with optional qualifiers.""" + + operation: Literal["set", "remove"] + """The operation to perform on the cache-control directive.""" + + cloudflare_only: Optional[bool] = None + """Whether the directive should only be applied to the Cloudflare CDN cache.""" + + qualifiers: Optional[List[str]] = None + """ + Optional list of header names to qualify the directive (e.g., for "private" or + "no-cache" directives). + """ + + +class RuleRulesetsSetCacheControlRuleActionParametersNoCacheRemoveDirective(BaseModel): + """Remove the directive.""" + + operation: Literal["set", "remove"] + """The operation to perform on the cache-control directive.""" + + cloudflare_only: Optional[bool] = None + """Whether the directive should only be applied to the Cloudflare CDN cache.""" + + +RuleRulesetsSetCacheControlRuleActionParametersNoCache: TypeAlias = Union[ + RuleRulesetsSetCacheControlRuleActionParametersNoCacheSetDirective, + RuleRulesetsSetCacheControlRuleActionParametersNoCacheRemoveDirective, +] + + +class RuleRulesetsSetCacheControlRuleActionParametersNoStoreSetDirective(BaseModel): + """Set the directive.""" + + operation: Literal["set", "remove"] + """The operation to perform on the cache-control directive.""" + + cloudflare_only: Optional[bool] = None + """Whether the directive should only be applied to the Cloudflare CDN cache.""" + + +class RuleRulesetsSetCacheControlRuleActionParametersNoStoreRemoveDirective(BaseModel): + """Remove the directive.""" + + operation: Literal["set", "remove"] + """The operation to perform on the cache-control directive.""" + + cloudflare_only: Optional[bool] = None + """Whether the directive should only be applied to the Cloudflare CDN cache.""" + + +RuleRulesetsSetCacheControlRuleActionParametersNoStore: TypeAlias = Union[ + RuleRulesetsSetCacheControlRuleActionParametersNoStoreSetDirective, + RuleRulesetsSetCacheControlRuleActionParametersNoStoreRemoveDirective, +] + + +class RuleRulesetsSetCacheControlRuleActionParametersNoTransformSetDirective(BaseModel): + """Set the directive.""" + + operation: Literal["set", "remove"] + """The operation to perform on the cache-control directive.""" + + cloudflare_only: Optional[bool] = None + """Whether the directive should only be applied to the Cloudflare CDN cache.""" + + +class RuleRulesetsSetCacheControlRuleActionParametersNoTransformRemoveDirective(BaseModel): + """Remove the directive.""" + + operation: Literal["set", "remove"] + """The operation to perform on the cache-control directive.""" + + cloudflare_only: Optional[bool] = None + """Whether the directive should only be applied to the Cloudflare CDN cache.""" + + +RuleRulesetsSetCacheControlRuleActionParametersNoTransform: TypeAlias = Union[ + RuleRulesetsSetCacheControlRuleActionParametersNoTransformSetDirective, + RuleRulesetsSetCacheControlRuleActionParametersNoTransformRemoveDirective, +] + + +class RuleRulesetsSetCacheControlRuleActionParametersPrivateSetDirective(BaseModel): + """Set the directive with optional qualifiers.""" + + operation: Literal["set", "remove"] + """The operation to perform on the cache-control directive.""" + + cloudflare_only: Optional[bool] = None + """Whether the directive should only be applied to the Cloudflare CDN cache.""" + + qualifiers: Optional[List[str]] = None + """ + Optional list of header names to qualify the directive (e.g., for "private" or + "no-cache" directives). + """ + + +class RuleRulesetsSetCacheControlRuleActionParametersPrivateRemoveDirective(BaseModel): + """Remove the directive.""" + + operation: Literal["set", "remove"] + """The operation to perform on the cache-control directive.""" + + cloudflare_only: Optional[bool] = None + """Whether the directive should only be applied to the Cloudflare CDN cache.""" + + +RuleRulesetsSetCacheControlRuleActionParametersPrivate: TypeAlias = Union[ + RuleRulesetsSetCacheControlRuleActionParametersPrivateSetDirective, + RuleRulesetsSetCacheControlRuleActionParametersPrivateRemoveDirective, +] + + +class RuleRulesetsSetCacheControlRuleActionParametersProxyRevalidateSetDirective(BaseModel): + """Set the directive.""" + + operation: Literal["set", "remove"] + """The operation to perform on the cache-control directive.""" + + cloudflare_only: Optional[bool] = None + """Whether the directive should only be applied to the Cloudflare CDN cache.""" + + +class RuleRulesetsSetCacheControlRuleActionParametersProxyRevalidateRemoveDirective(BaseModel): + """Remove the directive.""" + + operation: Literal["set", "remove"] + """The operation to perform on the cache-control directive.""" + + cloudflare_only: Optional[bool] = None + """Whether the directive should only be applied to the Cloudflare CDN cache.""" + + +RuleRulesetsSetCacheControlRuleActionParametersProxyRevalidate: TypeAlias = Union[ + RuleRulesetsSetCacheControlRuleActionParametersProxyRevalidateSetDirective, + RuleRulesetsSetCacheControlRuleActionParametersProxyRevalidateRemoveDirective, +] + + +class RuleRulesetsSetCacheControlRuleActionParametersPublicSetDirective(BaseModel): + """Set the directive.""" + + operation: Literal["set", "remove"] + """The operation to perform on the cache-control directive.""" + + cloudflare_only: Optional[bool] = None + """Whether the directive should only be applied to the Cloudflare CDN cache.""" + + +class RuleRulesetsSetCacheControlRuleActionParametersPublicRemoveDirective(BaseModel): + """Remove the directive.""" + + operation: Literal["set", "remove"] + """The operation to perform on the cache-control directive.""" + + cloudflare_only: Optional[bool] = None + """Whether the directive should only be applied to the Cloudflare CDN cache.""" + + +RuleRulesetsSetCacheControlRuleActionParametersPublic: TypeAlias = Union[ + RuleRulesetsSetCacheControlRuleActionParametersPublicSetDirective, + RuleRulesetsSetCacheControlRuleActionParametersPublicRemoveDirective, +] + + +class RuleRulesetsSetCacheControlRuleActionParametersSMaxageSetDirective(BaseModel): + """Set the directive with a duration value in seconds.""" + + operation: Literal["set", "remove"] + """The operation to perform on the cache-control directive.""" + + value: int + """The duration value in seconds for the directive.""" + + cloudflare_only: Optional[bool] = None + """Whether the directive should only be applied to the Cloudflare CDN cache.""" + + +class RuleRulesetsSetCacheControlRuleActionParametersSMaxageRemoveDirective(BaseModel): + """Remove the directive.""" + + operation: Literal["set", "remove"] + """The operation to perform on the cache-control directive.""" + + cloudflare_only: Optional[bool] = None + """Whether the directive should only be applied to the Cloudflare CDN cache.""" + + +RuleRulesetsSetCacheControlRuleActionParametersSMaxage: TypeAlias = Union[ + RuleRulesetsSetCacheControlRuleActionParametersSMaxageSetDirective, + RuleRulesetsSetCacheControlRuleActionParametersSMaxageRemoveDirective, +] + + +class RuleRulesetsSetCacheControlRuleActionParametersStaleIfErrorSetDirective(BaseModel): + """Set the directive with a duration value in seconds.""" + + operation: Literal["set", "remove"] + """The operation to perform on the cache-control directive.""" + + value: int + """The duration value in seconds for the directive.""" + + cloudflare_only: Optional[bool] = None + """Whether the directive should only be applied to the Cloudflare CDN cache.""" + + +class RuleRulesetsSetCacheControlRuleActionParametersStaleIfErrorRemoveDirective(BaseModel): + """Remove the directive.""" + + operation: Literal["set", "remove"] + """The operation to perform on the cache-control directive.""" + + cloudflare_only: Optional[bool] = None + """Whether the directive should only be applied to the Cloudflare CDN cache.""" + + +RuleRulesetsSetCacheControlRuleActionParametersStaleIfError: TypeAlias = Union[ + RuleRulesetsSetCacheControlRuleActionParametersStaleIfErrorSetDirective, + RuleRulesetsSetCacheControlRuleActionParametersStaleIfErrorRemoveDirective, +] + + +class RuleRulesetsSetCacheControlRuleActionParametersStaleWhileRevalidateSetDirective(BaseModel): + """Set the directive with a duration value in seconds.""" + + operation: Literal["set", "remove"] + """The operation to perform on the cache-control directive.""" + + value: int + """The duration value in seconds for the directive.""" + + cloudflare_only: Optional[bool] = None + """Whether the directive should only be applied to the Cloudflare CDN cache.""" + + +class RuleRulesetsSetCacheControlRuleActionParametersStaleWhileRevalidateRemoveDirective(BaseModel): + """Remove the directive.""" + + operation: Literal["set", "remove"] + """The operation to perform on the cache-control directive.""" + + cloudflare_only: Optional[bool] = None + """Whether the directive should only be applied to the Cloudflare CDN cache.""" + + +RuleRulesetsSetCacheControlRuleActionParametersStaleWhileRevalidate: TypeAlias = Union[ + RuleRulesetsSetCacheControlRuleActionParametersStaleWhileRevalidateSetDirective, + RuleRulesetsSetCacheControlRuleActionParametersStaleWhileRevalidateRemoveDirective, +] + + +class RuleRulesetsSetCacheControlRuleActionParameters(BaseModel): + """The parameters configuring the rule's action.""" + + immutable: Optional[RuleRulesetsSetCacheControlRuleActionParametersImmutable] = None + """A cache-control directive configuration.""" + + max_age: Optional[RuleRulesetsSetCacheControlRuleActionParametersMaxAge] = FieldInfo(alias="max-age", default=None) + """ + A cache-control directive configuration that accepts a duration value in + seconds. + """ + + must_revalidate: Optional[RuleRulesetsSetCacheControlRuleActionParametersMustRevalidate] = FieldInfo( + alias="must-revalidate", default=None + ) + """A cache-control directive configuration.""" + + must_understand: Optional[RuleRulesetsSetCacheControlRuleActionParametersMustUnderstand] = FieldInfo( + alias="must-understand", default=None + ) + """A cache-control directive configuration.""" + + no_cache: Optional[RuleRulesetsSetCacheControlRuleActionParametersNoCache] = FieldInfo( + alias="no-cache", default=None + ) + """ + A cache-control directive configuration that accepts optional qualifiers (header + names). + """ + + no_store: Optional[RuleRulesetsSetCacheControlRuleActionParametersNoStore] = FieldInfo( + alias="no-store", default=None + ) + """A cache-control directive configuration.""" + + no_transform: Optional[RuleRulesetsSetCacheControlRuleActionParametersNoTransform] = FieldInfo( + alias="no-transform", default=None + ) + """A cache-control directive configuration.""" + + private: Optional[RuleRulesetsSetCacheControlRuleActionParametersPrivate] = None + """ + A cache-control directive configuration that accepts optional qualifiers (header + names). + """ + + proxy_revalidate: Optional[RuleRulesetsSetCacheControlRuleActionParametersProxyRevalidate] = FieldInfo( + alias="proxy-revalidate", default=None + ) + """A cache-control directive configuration.""" + + public: Optional[RuleRulesetsSetCacheControlRuleActionParametersPublic] = None + """A cache-control directive configuration.""" + + s_maxage: Optional[RuleRulesetsSetCacheControlRuleActionParametersSMaxage] = FieldInfo( + alias="s-maxage", default=None + ) + """ + A cache-control directive configuration that accepts a duration value in + seconds. + """ + + stale_if_error: Optional[RuleRulesetsSetCacheControlRuleActionParametersStaleIfError] = FieldInfo( + alias="stale-if-error", default=None + ) + """ + A cache-control directive configuration that accepts a duration value in + seconds. + """ + + stale_while_revalidate: Optional[RuleRulesetsSetCacheControlRuleActionParametersStaleWhileRevalidate] = FieldInfo( + alias="stale-while-revalidate", default=None + ) + """ + A cache-control directive configuration that accepts a duration value in + seconds. + """ + + +class RuleRulesetsSetCacheControlRuleExposedCredentialCheck(BaseModel): + """Configuration for exposed credential checking.""" + + password_expression: str + """An expression that selects the password used in the credentials check.""" + + username_expression: str + """An expression that selects the user ID used in the credentials check.""" + + +class RuleRulesetsSetCacheControlRuleRatelimit(BaseModel): + """An object configuring the rule's rate limit behavior.""" + + characteristics: List[str] + """ + Characteristics of the request on which the rate limit counter will be + incremented. + """ + + period: int + """Period in seconds over which the counter is being incremented.""" + + counting_expression: Optional[str] = None + """An expression that defines when the rate limit counter should be incremented. + + It defaults to the same as the rule's expression. + """ + + mitigation_timeout: Optional[int] = None + """ + Period of time in seconds after which the action will be disabled following its + first execution. + """ + + requests_per_period: Optional[int] = None + """ + The threshold of requests per period after which the action will be executed for + the first time. + """ + + requests_to_origin: Optional[bool] = None + """Whether counting is only performed when an origin is reached.""" + + score_per_period: Optional[int] = None + """ + The score threshold per period for which the action will be executed the first + time. + """ + + score_response_header_name: Optional[str] = None + """ + A response header name provided by the origin, which contains the score to + increment rate limit counter with. + """ + + +class RuleRulesetsSetCacheControlRule(BaseModel): + last_updated: datetime + """The timestamp of when the rule was last modified.""" + + version: str + """The version of the rule.""" + + id: Optional[str] = None + """The unique ID of the rule.""" + + action: Optional[Literal["set_cache_control"]] = None + """The action to perform when the rule matches.""" + + action_parameters: Optional[RuleRulesetsSetCacheControlRuleActionParameters] = None + """The parameters configuring the rule's action.""" + + categories: Optional[List[str]] = None + """The categories of the rule.""" + + description: Optional[str] = None + """An informative description of the rule.""" + + enabled: Optional[bool] = None + """Whether the rule should be executed.""" + + exposed_credential_check: Optional[RuleRulesetsSetCacheControlRuleExposedCredentialCheck] = None + """Configuration for exposed credential checking.""" + + expression: Optional[str] = None + """The expression defining which traffic will match the rule.""" + + logging: Optional[Logging] = None + """An object configuring the rule's logging behavior.""" + + ratelimit: Optional[RuleRulesetsSetCacheControlRuleRatelimit] = None + """An object configuring the rule's rate limit behavior.""" + + ref: Optional[str] = None + """The reference of the rule (the rule's ID by default).""" + + +class RuleRulesetsSetCacheTagsRuleActionParametersAddCacheTagsValues(BaseModel): + """Add cache tags using a list of values.""" + + operation: Literal["add", "remove", "set"] + """The operation to perform on the cache tags.""" + + values: List[str] + """A list of cache tag values.""" + + +class RuleRulesetsSetCacheTagsRuleActionParametersAddCacheTagsExpression(BaseModel): + """Add cache tags using an expression.""" + + expression: str + """An expression that evaluates to an array of cache tag values.""" + + operation: Literal["add", "remove", "set"] + """The operation to perform on the cache tags.""" + + +class RuleRulesetsSetCacheTagsRuleActionParametersRemoveCacheTagsValues(BaseModel): + """Remove cache tags using a list of values.""" + + operation: Literal["add", "remove", "set"] + """The operation to perform on the cache tags.""" + + values: List[str] + """A list of cache tag values.""" + + +class RuleRulesetsSetCacheTagsRuleActionParametersRemoveCacheTagsExpression(BaseModel): + """Remove cache tags using an expression.""" + + expression: str + """An expression that evaluates to an array of cache tag values.""" + + operation: Literal["add", "remove", "set"] + """The operation to perform on the cache tags.""" + + +class RuleRulesetsSetCacheTagsRuleActionParametersSetCacheTagsValues(BaseModel): + """Set cache tags using a list of values.""" + + operation: Literal["add", "remove", "set"] + """The operation to perform on the cache tags.""" + + values: List[str] + """A list of cache tag values.""" + + +class RuleRulesetsSetCacheTagsRuleActionParametersSetCacheTagsExpression(BaseModel): + """Set cache tags using an expression.""" + + expression: str + """An expression that evaluates to an array of cache tag values.""" + + operation: Literal["add", "remove", "set"] + """The operation to perform on the cache tags.""" + + +RuleRulesetsSetCacheTagsRuleActionParameters: TypeAlias = Union[ + RuleRulesetsSetCacheTagsRuleActionParametersAddCacheTagsValues, + RuleRulesetsSetCacheTagsRuleActionParametersAddCacheTagsExpression, + RuleRulesetsSetCacheTagsRuleActionParametersRemoveCacheTagsValues, + RuleRulesetsSetCacheTagsRuleActionParametersRemoveCacheTagsExpression, + RuleRulesetsSetCacheTagsRuleActionParametersSetCacheTagsValues, + RuleRulesetsSetCacheTagsRuleActionParametersSetCacheTagsExpression, +] + + +class RuleRulesetsSetCacheTagsRuleExposedCredentialCheck(BaseModel): + """Configuration for exposed credential checking.""" + + password_expression: str + """An expression that selects the password used in the credentials check.""" + + username_expression: str + """An expression that selects the user ID used in the credentials check.""" + + +class RuleRulesetsSetCacheTagsRuleRatelimit(BaseModel): + """An object configuring the rule's rate limit behavior.""" + + characteristics: List[str] + """ + Characteristics of the request on which the rate limit counter will be + incremented. + """ + + period: int + """Period in seconds over which the counter is being incremented.""" + + counting_expression: Optional[str] = None + """An expression that defines when the rate limit counter should be incremented. + + It defaults to the same as the rule's expression. + """ + + mitigation_timeout: Optional[int] = None + """ + Period of time in seconds after which the action will be disabled following its + first execution. + """ + + requests_per_period: Optional[int] = None + """ + The threshold of requests per period after which the action will be executed for + the first time. + """ + + requests_to_origin: Optional[bool] = None + """Whether counting is only performed when an origin is reached.""" + + score_per_period: Optional[int] = None + """ + The score threshold per period for which the action will be executed the first + time. + """ + + score_response_header_name: Optional[str] = None + """ + A response header name provided by the origin, which contains the score to + increment rate limit counter with. + """ + + +class RuleRulesetsSetCacheTagsRule(BaseModel): + last_updated: datetime + """The timestamp of when the rule was last modified.""" + + version: str + """The version of the rule.""" + + id: Optional[str] = None + """The unique ID of the rule.""" + + action: Optional[Literal["set_cache_tags"]] = None + """The action to perform when the rule matches.""" + + action_parameters: Optional[RuleRulesetsSetCacheTagsRuleActionParameters] = None + """The parameters configuring the rule's action.""" + + categories: Optional[List[str]] = None + """The categories of the rule.""" + + description: Optional[str] = None + """An informative description of the rule.""" + + enabled: Optional[bool] = None + """Whether the rule should be executed.""" + + exposed_credential_check: Optional[RuleRulesetsSetCacheTagsRuleExposedCredentialCheck] = None + """Configuration for exposed credential checking.""" + + expression: Optional[str] = None + """The expression defining which traffic will match the rule.""" + + logging: Optional[Logging] = None + """An object configuring the rule's logging behavior.""" + + ratelimit: Optional[RuleRulesetsSetCacheTagsRuleRatelimit] = None + """An object configuring the rule's rate limit behavior.""" + + ref: Optional[str] = None + """The reference of the rule (the rule's ID by default).""" + + Rule: TypeAlias = Annotated[ Union[ BlockRule, @@ -249,7 +1009,9 @@ class RuleRulesetsJSChallengeRule(BaseModel): RouteRule, ScoreRule, ServeErrorRule, + RuleRulesetsSetCacheControlRule, SetCacheSettingsRule, + RuleRulesetsSetCacheTagsRule, SetConfigRule, SkipRule, ], diff --git a/src/cloudflare/types/rulesets/ruleset_get_response.py b/src/cloudflare/types/rulesets/ruleset_get_response.py index fda4e4bf141..642243625e4 100644 --- a/src/cloudflare/types/rulesets/ruleset_get_response.py +++ b/src/cloudflare/types/rulesets/ruleset_get_response.py @@ -4,6 +4,8 @@ from datetime import datetime from typing_extensions import Literal, Annotated, TypeAlias +from pydantic import Field as FieldInfo + from .kind import Kind from .phase import Phase from .logging import Logging @@ -35,6 +37,59 @@ "RuleRulesetsJSChallengeRule", "RuleRulesetsJSChallengeRuleExposedCredentialCheck", "RuleRulesetsJSChallengeRuleRatelimit", + "RuleRulesetsSetCacheControlRule", + "RuleRulesetsSetCacheControlRuleActionParameters", + "RuleRulesetsSetCacheControlRuleActionParametersImmutable", + "RuleRulesetsSetCacheControlRuleActionParametersImmutableSetDirective", + "RuleRulesetsSetCacheControlRuleActionParametersImmutableRemoveDirective", + "RuleRulesetsSetCacheControlRuleActionParametersMaxAge", + "RuleRulesetsSetCacheControlRuleActionParametersMaxAgeSetDirective", + "RuleRulesetsSetCacheControlRuleActionParametersMaxAgeRemoveDirective", + "RuleRulesetsSetCacheControlRuleActionParametersMustRevalidate", + "RuleRulesetsSetCacheControlRuleActionParametersMustRevalidateSetDirective", + "RuleRulesetsSetCacheControlRuleActionParametersMustRevalidateRemoveDirective", + "RuleRulesetsSetCacheControlRuleActionParametersMustUnderstand", + "RuleRulesetsSetCacheControlRuleActionParametersMustUnderstandSetDirective", + "RuleRulesetsSetCacheControlRuleActionParametersMustUnderstandRemoveDirective", + "RuleRulesetsSetCacheControlRuleActionParametersNoCache", + "RuleRulesetsSetCacheControlRuleActionParametersNoCacheSetDirective", + "RuleRulesetsSetCacheControlRuleActionParametersNoCacheRemoveDirective", + "RuleRulesetsSetCacheControlRuleActionParametersNoStore", + "RuleRulesetsSetCacheControlRuleActionParametersNoStoreSetDirective", + "RuleRulesetsSetCacheControlRuleActionParametersNoStoreRemoveDirective", + "RuleRulesetsSetCacheControlRuleActionParametersNoTransform", + "RuleRulesetsSetCacheControlRuleActionParametersNoTransformSetDirective", + "RuleRulesetsSetCacheControlRuleActionParametersNoTransformRemoveDirective", + "RuleRulesetsSetCacheControlRuleActionParametersPrivate", + "RuleRulesetsSetCacheControlRuleActionParametersPrivateSetDirective", + "RuleRulesetsSetCacheControlRuleActionParametersPrivateRemoveDirective", + "RuleRulesetsSetCacheControlRuleActionParametersProxyRevalidate", + "RuleRulesetsSetCacheControlRuleActionParametersProxyRevalidateSetDirective", + "RuleRulesetsSetCacheControlRuleActionParametersProxyRevalidateRemoveDirective", + "RuleRulesetsSetCacheControlRuleActionParametersPublic", + "RuleRulesetsSetCacheControlRuleActionParametersPublicSetDirective", + "RuleRulesetsSetCacheControlRuleActionParametersPublicRemoveDirective", + "RuleRulesetsSetCacheControlRuleActionParametersSMaxage", + "RuleRulesetsSetCacheControlRuleActionParametersSMaxageSetDirective", + "RuleRulesetsSetCacheControlRuleActionParametersSMaxageRemoveDirective", + "RuleRulesetsSetCacheControlRuleActionParametersStaleIfError", + "RuleRulesetsSetCacheControlRuleActionParametersStaleIfErrorSetDirective", + "RuleRulesetsSetCacheControlRuleActionParametersStaleIfErrorRemoveDirective", + "RuleRulesetsSetCacheControlRuleActionParametersStaleWhileRevalidate", + "RuleRulesetsSetCacheControlRuleActionParametersStaleWhileRevalidateSetDirective", + "RuleRulesetsSetCacheControlRuleActionParametersStaleWhileRevalidateRemoveDirective", + "RuleRulesetsSetCacheControlRuleExposedCredentialCheck", + "RuleRulesetsSetCacheControlRuleRatelimit", + "RuleRulesetsSetCacheTagsRule", + "RuleRulesetsSetCacheTagsRuleActionParameters", + "RuleRulesetsSetCacheTagsRuleActionParametersAddCacheTagsValues", + "RuleRulesetsSetCacheTagsRuleActionParametersAddCacheTagsExpression", + "RuleRulesetsSetCacheTagsRuleActionParametersRemoveCacheTagsValues", + "RuleRulesetsSetCacheTagsRuleActionParametersRemoveCacheTagsExpression", + "RuleRulesetsSetCacheTagsRuleActionParametersSetCacheTagsValues", + "RuleRulesetsSetCacheTagsRuleActionParametersSetCacheTagsExpression", + "RuleRulesetsSetCacheTagsRuleExposedCredentialCheck", + "RuleRulesetsSetCacheTagsRuleRatelimit", ] @@ -232,6 +287,711 @@ class RuleRulesetsJSChallengeRule(BaseModel): """The reference of the rule (the rule's ID by default).""" +class RuleRulesetsSetCacheControlRuleActionParametersImmutableSetDirective(BaseModel): + """Set the directive.""" + + operation: Literal["set", "remove"] + """The operation to perform on the cache-control directive.""" + + cloudflare_only: Optional[bool] = None + """Whether the directive should only be applied to the Cloudflare CDN cache.""" + + +class RuleRulesetsSetCacheControlRuleActionParametersImmutableRemoveDirective(BaseModel): + """Remove the directive.""" + + operation: Literal["set", "remove"] + """The operation to perform on the cache-control directive.""" + + cloudflare_only: Optional[bool] = None + """Whether the directive should only be applied to the Cloudflare CDN cache.""" + + +RuleRulesetsSetCacheControlRuleActionParametersImmutable: TypeAlias = Union[ + RuleRulesetsSetCacheControlRuleActionParametersImmutableSetDirective, + RuleRulesetsSetCacheControlRuleActionParametersImmutableRemoveDirective, +] + + +class RuleRulesetsSetCacheControlRuleActionParametersMaxAgeSetDirective(BaseModel): + """Set the directive with a duration value in seconds.""" + + operation: Literal["set", "remove"] + """The operation to perform on the cache-control directive.""" + + value: int + """The duration value in seconds for the directive.""" + + cloudflare_only: Optional[bool] = None + """Whether the directive should only be applied to the Cloudflare CDN cache.""" + + +class RuleRulesetsSetCacheControlRuleActionParametersMaxAgeRemoveDirective(BaseModel): + """Remove the directive.""" + + operation: Literal["set", "remove"] + """The operation to perform on the cache-control directive.""" + + cloudflare_only: Optional[bool] = None + """Whether the directive should only be applied to the Cloudflare CDN cache.""" + + +RuleRulesetsSetCacheControlRuleActionParametersMaxAge: TypeAlias = Union[ + RuleRulesetsSetCacheControlRuleActionParametersMaxAgeSetDirective, + RuleRulesetsSetCacheControlRuleActionParametersMaxAgeRemoveDirective, +] + + +class RuleRulesetsSetCacheControlRuleActionParametersMustRevalidateSetDirective(BaseModel): + """Set the directive.""" + + operation: Literal["set", "remove"] + """The operation to perform on the cache-control directive.""" + + cloudflare_only: Optional[bool] = None + """Whether the directive should only be applied to the Cloudflare CDN cache.""" + + +class RuleRulesetsSetCacheControlRuleActionParametersMustRevalidateRemoveDirective(BaseModel): + """Remove the directive.""" + + operation: Literal["set", "remove"] + """The operation to perform on the cache-control directive.""" + + cloudflare_only: Optional[bool] = None + """Whether the directive should only be applied to the Cloudflare CDN cache.""" + + +RuleRulesetsSetCacheControlRuleActionParametersMustRevalidate: TypeAlias = Union[ + RuleRulesetsSetCacheControlRuleActionParametersMustRevalidateSetDirective, + RuleRulesetsSetCacheControlRuleActionParametersMustRevalidateRemoveDirective, +] + + +class RuleRulesetsSetCacheControlRuleActionParametersMustUnderstandSetDirective(BaseModel): + """Set the directive.""" + + operation: Literal["set", "remove"] + """The operation to perform on the cache-control directive.""" + + cloudflare_only: Optional[bool] = None + """Whether the directive should only be applied to the Cloudflare CDN cache.""" + + +class RuleRulesetsSetCacheControlRuleActionParametersMustUnderstandRemoveDirective(BaseModel): + """Remove the directive.""" + + operation: Literal["set", "remove"] + """The operation to perform on the cache-control directive.""" + + cloudflare_only: Optional[bool] = None + """Whether the directive should only be applied to the Cloudflare CDN cache.""" + + +RuleRulesetsSetCacheControlRuleActionParametersMustUnderstand: TypeAlias = Union[ + RuleRulesetsSetCacheControlRuleActionParametersMustUnderstandSetDirective, + RuleRulesetsSetCacheControlRuleActionParametersMustUnderstandRemoveDirective, +] + + +class RuleRulesetsSetCacheControlRuleActionParametersNoCacheSetDirective(BaseModel): + """Set the directive with optional qualifiers.""" + + operation: Literal["set", "remove"] + """The operation to perform on the cache-control directive.""" + + cloudflare_only: Optional[bool] = None + """Whether the directive should only be applied to the Cloudflare CDN cache.""" + + qualifiers: Optional[List[str]] = None + """ + Optional list of header names to qualify the directive (e.g., for "private" or + "no-cache" directives). + """ + + +class RuleRulesetsSetCacheControlRuleActionParametersNoCacheRemoveDirective(BaseModel): + """Remove the directive.""" + + operation: Literal["set", "remove"] + """The operation to perform on the cache-control directive.""" + + cloudflare_only: Optional[bool] = None + """Whether the directive should only be applied to the Cloudflare CDN cache.""" + + +RuleRulesetsSetCacheControlRuleActionParametersNoCache: TypeAlias = Union[ + RuleRulesetsSetCacheControlRuleActionParametersNoCacheSetDirective, + RuleRulesetsSetCacheControlRuleActionParametersNoCacheRemoveDirective, +] + + +class RuleRulesetsSetCacheControlRuleActionParametersNoStoreSetDirective(BaseModel): + """Set the directive.""" + + operation: Literal["set", "remove"] + """The operation to perform on the cache-control directive.""" + + cloudflare_only: Optional[bool] = None + """Whether the directive should only be applied to the Cloudflare CDN cache.""" + + +class RuleRulesetsSetCacheControlRuleActionParametersNoStoreRemoveDirective(BaseModel): + """Remove the directive.""" + + operation: Literal["set", "remove"] + """The operation to perform on the cache-control directive.""" + + cloudflare_only: Optional[bool] = None + """Whether the directive should only be applied to the Cloudflare CDN cache.""" + + +RuleRulesetsSetCacheControlRuleActionParametersNoStore: TypeAlias = Union[ + RuleRulesetsSetCacheControlRuleActionParametersNoStoreSetDirective, + RuleRulesetsSetCacheControlRuleActionParametersNoStoreRemoveDirective, +] + + +class RuleRulesetsSetCacheControlRuleActionParametersNoTransformSetDirective(BaseModel): + """Set the directive.""" + + operation: Literal["set", "remove"] + """The operation to perform on the cache-control directive.""" + + cloudflare_only: Optional[bool] = None + """Whether the directive should only be applied to the Cloudflare CDN cache.""" + + +class RuleRulesetsSetCacheControlRuleActionParametersNoTransformRemoveDirective(BaseModel): + """Remove the directive.""" + + operation: Literal["set", "remove"] + """The operation to perform on the cache-control directive.""" + + cloudflare_only: Optional[bool] = None + """Whether the directive should only be applied to the Cloudflare CDN cache.""" + + +RuleRulesetsSetCacheControlRuleActionParametersNoTransform: TypeAlias = Union[ + RuleRulesetsSetCacheControlRuleActionParametersNoTransformSetDirective, + RuleRulesetsSetCacheControlRuleActionParametersNoTransformRemoveDirective, +] + + +class RuleRulesetsSetCacheControlRuleActionParametersPrivateSetDirective(BaseModel): + """Set the directive with optional qualifiers.""" + + operation: Literal["set", "remove"] + """The operation to perform on the cache-control directive.""" + + cloudflare_only: Optional[bool] = None + """Whether the directive should only be applied to the Cloudflare CDN cache.""" + + qualifiers: Optional[List[str]] = None + """ + Optional list of header names to qualify the directive (e.g., for "private" or + "no-cache" directives). + """ + + +class RuleRulesetsSetCacheControlRuleActionParametersPrivateRemoveDirective(BaseModel): + """Remove the directive.""" + + operation: Literal["set", "remove"] + """The operation to perform on the cache-control directive.""" + + cloudflare_only: Optional[bool] = None + """Whether the directive should only be applied to the Cloudflare CDN cache.""" + + +RuleRulesetsSetCacheControlRuleActionParametersPrivate: TypeAlias = Union[ + RuleRulesetsSetCacheControlRuleActionParametersPrivateSetDirective, + RuleRulesetsSetCacheControlRuleActionParametersPrivateRemoveDirective, +] + + +class RuleRulesetsSetCacheControlRuleActionParametersProxyRevalidateSetDirective(BaseModel): + """Set the directive.""" + + operation: Literal["set", "remove"] + """The operation to perform on the cache-control directive.""" + + cloudflare_only: Optional[bool] = None + """Whether the directive should only be applied to the Cloudflare CDN cache.""" + + +class RuleRulesetsSetCacheControlRuleActionParametersProxyRevalidateRemoveDirective(BaseModel): + """Remove the directive.""" + + operation: Literal["set", "remove"] + """The operation to perform on the cache-control directive.""" + + cloudflare_only: Optional[bool] = None + """Whether the directive should only be applied to the Cloudflare CDN cache.""" + + +RuleRulesetsSetCacheControlRuleActionParametersProxyRevalidate: TypeAlias = Union[ + RuleRulesetsSetCacheControlRuleActionParametersProxyRevalidateSetDirective, + RuleRulesetsSetCacheControlRuleActionParametersProxyRevalidateRemoveDirective, +] + + +class RuleRulesetsSetCacheControlRuleActionParametersPublicSetDirective(BaseModel): + """Set the directive.""" + + operation: Literal["set", "remove"] + """The operation to perform on the cache-control directive.""" + + cloudflare_only: Optional[bool] = None + """Whether the directive should only be applied to the Cloudflare CDN cache.""" + + +class RuleRulesetsSetCacheControlRuleActionParametersPublicRemoveDirective(BaseModel): + """Remove the directive.""" + + operation: Literal["set", "remove"] + """The operation to perform on the cache-control directive.""" + + cloudflare_only: Optional[bool] = None + """Whether the directive should only be applied to the Cloudflare CDN cache.""" + + +RuleRulesetsSetCacheControlRuleActionParametersPublic: TypeAlias = Union[ + RuleRulesetsSetCacheControlRuleActionParametersPublicSetDirective, + RuleRulesetsSetCacheControlRuleActionParametersPublicRemoveDirective, +] + + +class RuleRulesetsSetCacheControlRuleActionParametersSMaxageSetDirective(BaseModel): + """Set the directive with a duration value in seconds.""" + + operation: Literal["set", "remove"] + """The operation to perform on the cache-control directive.""" + + value: int + """The duration value in seconds for the directive.""" + + cloudflare_only: Optional[bool] = None + """Whether the directive should only be applied to the Cloudflare CDN cache.""" + + +class RuleRulesetsSetCacheControlRuleActionParametersSMaxageRemoveDirective(BaseModel): + """Remove the directive.""" + + operation: Literal["set", "remove"] + """The operation to perform on the cache-control directive.""" + + cloudflare_only: Optional[bool] = None + """Whether the directive should only be applied to the Cloudflare CDN cache.""" + + +RuleRulesetsSetCacheControlRuleActionParametersSMaxage: TypeAlias = Union[ + RuleRulesetsSetCacheControlRuleActionParametersSMaxageSetDirective, + RuleRulesetsSetCacheControlRuleActionParametersSMaxageRemoveDirective, +] + + +class RuleRulesetsSetCacheControlRuleActionParametersStaleIfErrorSetDirective(BaseModel): + """Set the directive with a duration value in seconds.""" + + operation: Literal["set", "remove"] + """The operation to perform on the cache-control directive.""" + + value: int + """The duration value in seconds for the directive.""" + + cloudflare_only: Optional[bool] = None + """Whether the directive should only be applied to the Cloudflare CDN cache.""" + + +class RuleRulesetsSetCacheControlRuleActionParametersStaleIfErrorRemoveDirective(BaseModel): + """Remove the directive.""" + + operation: Literal["set", "remove"] + """The operation to perform on the cache-control directive.""" + + cloudflare_only: Optional[bool] = None + """Whether the directive should only be applied to the Cloudflare CDN cache.""" + + +RuleRulesetsSetCacheControlRuleActionParametersStaleIfError: TypeAlias = Union[ + RuleRulesetsSetCacheControlRuleActionParametersStaleIfErrorSetDirective, + RuleRulesetsSetCacheControlRuleActionParametersStaleIfErrorRemoveDirective, +] + + +class RuleRulesetsSetCacheControlRuleActionParametersStaleWhileRevalidateSetDirective(BaseModel): + """Set the directive with a duration value in seconds.""" + + operation: Literal["set", "remove"] + """The operation to perform on the cache-control directive.""" + + value: int + """The duration value in seconds for the directive.""" + + cloudflare_only: Optional[bool] = None + """Whether the directive should only be applied to the Cloudflare CDN cache.""" + + +class RuleRulesetsSetCacheControlRuleActionParametersStaleWhileRevalidateRemoveDirective(BaseModel): + """Remove the directive.""" + + operation: Literal["set", "remove"] + """The operation to perform on the cache-control directive.""" + + cloudflare_only: Optional[bool] = None + """Whether the directive should only be applied to the Cloudflare CDN cache.""" + + +RuleRulesetsSetCacheControlRuleActionParametersStaleWhileRevalidate: TypeAlias = Union[ + RuleRulesetsSetCacheControlRuleActionParametersStaleWhileRevalidateSetDirective, + RuleRulesetsSetCacheControlRuleActionParametersStaleWhileRevalidateRemoveDirective, +] + + +class RuleRulesetsSetCacheControlRuleActionParameters(BaseModel): + """The parameters configuring the rule's action.""" + + immutable: Optional[RuleRulesetsSetCacheControlRuleActionParametersImmutable] = None + """A cache-control directive configuration.""" + + max_age: Optional[RuleRulesetsSetCacheControlRuleActionParametersMaxAge] = FieldInfo(alias="max-age", default=None) + """ + A cache-control directive configuration that accepts a duration value in + seconds. + """ + + must_revalidate: Optional[RuleRulesetsSetCacheControlRuleActionParametersMustRevalidate] = FieldInfo( + alias="must-revalidate", default=None + ) + """A cache-control directive configuration.""" + + must_understand: Optional[RuleRulesetsSetCacheControlRuleActionParametersMustUnderstand] = FieldInfo( + alias="must-understand", default=None + ) + """A cache-control directive configuration.""" + + no_cache: Optional[RuleRulesetsSetCacheControlRuleActionParametersNoCache] = FieldInfo( + alias="no-cache", default=None + ) + """ + A cache-control directive configuration that accepts optional qualifiers (header + names). + """ + + no_store: Optional[RuleRulesetsSetCacheControlRuleActionParametersNoStore] = FieldInfo( + alias="no-store", default=None + ) + """A cache-control directive configuration.""" + + no_transform: Optional[RuleRulesetsSetCacheControlRuleActionParametersNoTransform] = FieldInfo( + alias="no-transform", default=None + ) + """A cache-control directive configuration.""" + + private: Optional[RuleRulesetsSetCacheControlRuleActionParametersPrivate] = None + """ + A cache-control directive configuration that accepts optional qualifiers (header + names). + """ + + proxy_revalidate: Optional[RuleRulesetsSetCacheControlRuleActionParametersProxyRevalidate] = FieldInfo( + alias="proxy-revalidate", default=None + ) + """A cache-control directive configuration.""" + + public: Optional[RuleRulesetsSetCacheControlRuleActionParametersPublic] = None + """A cache-control directive configuration.""" + + s_maxage: Optional[RuleRulesetsSetCacheControlRuleActionParametersSMaxage] = FieldInfo( + alias="s-maxage", default=None + ) + """ + A cache-control directive configuration that accepts a duration value in + seconds. + """ + + stale_if_error: Optional[RuleRulesetsSetCacheControlRuleActionParametersStaleIfError] = FieldInfo( + alias="stale-if-error", default=None + ) + """ + A cache-control directive configuration that accepts a duration value in + seconds. + """ + + stale_while_revalidate: Optional[RuleRulesetsSetCacheControlRuleActionParametersStaleWhileRevalidate] = FieldInfo( + alias="stale-while-revalidate", default=None + ) + """ + A cache-control directive configuration that accepts a duration value in + seconds. + """ + + +class RuleRulesetsSetCacheControlRuleExposedCredentialCheck(BaseModel): + """Configuration for exposed credential checking.""" + + password_expression: str + """An expression that selects the password used in the credentials check.""" + + username_expression: str + """An expression that selects the user ID used in the credentials check.""" + + +class RuleRulesetsSetCacheControlRuleRatelimit(BaseModel): + """An object configuring the rule's rate limit behavior.""" + + characteristics: List[str] + """ + Characteristics of the request on which the rate limit counter will be + incremented. + """ + + period: int + """Period in seconds over which the counter is being incremented.""" + + counting_expression: Optional[str] = None + """An expression that defines when the rate limit counter should be incremented. + + It defaults to the same as the rule's expression. + """ + + mitigation_timeout: Optional[int] = None + """ + Period of time in seconds after which the action will be disabled following its + first execution. + """ + + requests_per_period: Optional[int] = None + """ + The threshold of requests per period after which the action will be executed for + the first time. + """ + + requests_to_origin: Optional[bool] = None + """Whether counting is only performed when an origin is reached.""" + + score_per_period: Optional[int] = None + """ + The score threshold per period for which the action will be executed the first + time. + """ + + score_response_header_name: Optional[str] = None + """ + A response header name provided by the origin, which contains the score to + increment rate limit counter with. + """ + + +class RuleRulesetsSetCacheControlRule(BaseModel): + last_updated: datetime + """The timestamp of when the rule was last modified.""" + + version: str + """The version of the rule.""" + + id: Optional[str] = None + """The unique ID of the rule.""" + + action: Optional[Literal["set_cache_control"]] = None + """The action to perform when the rule matches.""" + + action_parameters: Optional[RuleRulesetsSetCacheControlRuleActionParameters] = None + """The parameters configuring the rule's action.""" + + categories: Optional[List[str]] = None + """The categories of the rule.""" + + description: Optional[str] = None + """An informative description of the rule.""" + + enabled: Optional[bool] = None + """Whether the rule should be executed.""" + + exposed_credential_check: Optional[RuleRulesetsSetCacheControlRuleExposedCredentialCheck] = None + """Configuration for exposed credential checking.""" + + expression: Optional[str] = None + """The expression defining which traffic will match the rule.""" + + logging: Optional[Logging] = None + """An object configuring the rule's logging behavior.""" + + ratelimit: Optional[RuleRulesetsSetCacheControlRuleRatelimit] = None + """An object configuring the rule's rate limit behavior.""" + + ref: Optional[str] = None + """The reference of the rule (the rule's ID by default).""" + + +class RuleRulesetsSetCacheTagsRuleActionParametersAddCacheTagsValues(BaseModel): + """Add cache tags using a list of values.""" + + operation: Literal["add", "remove", "set"] + """The operation to perform on the cache tags.""" + + values: List[str] + """A list of cache tag values.""" + + +class RuleRulesetsSetCacheTagsRuleActionParametersAddCacheTagsExpression(BaseModel): + """Add cache tags using an expression.""" + + expression: str + """An expression that evaluates to an array of cache tag values.""" + + operation: Literal["add", "remove", "set"] + """The operation to perform on the cache tags.""" + + +class RuleRulesetsSetCacheTagsRuleActionParametersRemoveCacheTagsValues(BaseModel): + """Remove cache tags using a list of values.""" + + operation: Literal["add", "remove", "set"] + """The operation to perform on the cache tags.""" + + values: List[str] + """A list of cache tag values.""" + + +class RuleRulesetsSetCacheTagsRuleActionParametersRemoveCacheTagsExpression(BaseModel): + """Remove cache tags using an expression.""" + + expression: str + """An expression that evaluates to an array of cache tag values.""" + + operation: Literal["add", "remove", "set"] + """The operation to perform on the cache tags.""" + + +class RuleRulesetsSetCacheTagsRuleActionParametersSetCacheTagsValues(BaseModel): + """Set cache tags using a list of values.""" + + operation: Literal["add", "remove", "set"] + """The operation to perform on the cache tags.""" + + values: List[str] + """A list of cache tag values.""" + + +class RuleRulesetsSetCacheTagsRuleActionParametersSetCacheTagsExpression(BaseModel): + """Set cache tags using an expression.""" + + expression: str + """An expression that evaluates to an array of cache tag values.""" + + operation: Literal["add", "remove", "set"] + """The operation to perform on the cache tags.""" + + +RuleRulesetsSetCacheTagsRuleActionParameters: TypeAlias = Union[ + RuleRulesetsSetCacheTagsRuleActionParametersAddCacheTagsValues, + RuleRulesetsSetCacheTagsRuleActionParametersAddCacheTagsExpression, + RuleRulesetsSetCacheTagsRuleActionParametersRemoveCacheTagsValues, + RuleRulesetsSetCacheTagsRuleActionParametersRemoveCacheTagsExpression, + RuleRulesetsSetCacheTagsRuleActionParametersSetCacheTagsValues, + RuleRulesetsSetCacheTagsRuleActionParametersSetCacheTagsExpression, +] + + +class RuleRulesetsSetCacheTagsRuleExposedCredentialCheck(BaseModel): + """Configuration for exposed credential checking.""" + + password_expression: str + """An expression that selects the password used in the credentials check.""" + + username_expression: str + """An expression that selects the user ID used in the credentials check.""" + + +class RuleRulesetsSetCacheTagsRuleRatelimit(BaseModel): + """An object configuring the rule's rate limit behavior.""" + + characteristics: List[str] + """ + Characteristics of the request on which the rate limit counter will be + incremented. + """ + + period: int + """Period in seconds over which the counter is being incremented.""" + + counting_expression: Optional[str] = None + """An expression that defines when the rate limit counter should be incremented. + + It defaults to the same as the rule's expression. + """ + + mitigation_timeout: Optional[int] = None + """ + Period of time in seconds after which the action will be disabled following its + first execution. + """ + + requests_per_period: Optional[int] = None + """ + The threshold of requests per period after which the action will be executed for + the first time. + """ + + requests_to_origin: Optional[bool] = None + """Whether counting is only performed when an origin is reached.""" + + score_per_period: Optional[int] = None + """ + The score threshold per period for which the action will be executed the first + time. + """ + + score_response_header_name: Optional[str] = None + """ + A response header name provided by the origin, which contains the score to + increment rate limit counter with. + """ + + +class RuleRulesetsSetCacheTagsRule(BaseModel): + last_updated: datetime + """The timestamp of when the rule was last modified.""" + + version: str + """The version of the rule.""" + + id: Optional[str] = None + """The unique ID of the rule.""" + + action: Optional[Literal["set_cache_tags"]] = None + """The action to perform when the rule matches.""" + + action_parameters: Optional[RuleRulesetsSetCacheTagsRuleActionParameters] = None + """The parameters configuring the rule's action.""" + + categories: Optional[List[str]] = None + """The categories of the rule.""" + + description: Optional[str] = None + """An informative description of the rule.""" + + enabled: Optional[bool] = None + """Whether the rule should be executed.""" + + exposed_credential_check: Optional[RuleRulesetsSetCacheTagsRuleExposedCredentialCheck] = None + """Configuration for exposed credential checking.""" + + expression: Optional[str] = None + """The expression defining which traffic will match the rule.""" + + logging: Optional[Logging] = None + """An object configuring the rule's logging behavior.""" + + ratelimit: Optional[RuleRulesetsSetCacheTagsRuleRatelimit] = None + """An object configuring the rule's rate limit behavior.""" + + ref: Optional[str] = None + """The reference of the rule (the rule's ID by default).""" + + Rule: TypeAlias = Annotated[ Union[ BlockRule, @@ -249,7 +1009,9 @@ class RuleRulesetsJSChallengeRule(BaseModel): RouteRule, ScoreRule, ServeErrorRule, + RuleRulesetsSetCacheControlRule, SetCacheSettingsRule, + RuleRulesetsSetCacheTagsRule, SetConfigRule, SkipRule, ], diff --git a/src/cloudflare/types/rulesets/ruleset_update_params.py b/src/cloudflare/types/rulesets/ruleset_update_params.py index 38af103d218..75ac54d4e87 100644 --- a/src/cloudflare/types/rulesets/ruleset_update_params.py +++ b/src/cloudflare/types/rulesets/ruleset_update_params.py @@ -3,11 +3,12 @@ from __future__ import annotations from typing import Union, Iterable -from typing_extensions import Literal, Required, TypeAlias, TypedDict +from typing_extensions import Literal, Required, Annotated, TypeAlias, TypedDict from .kind import Kind from .phase import Phase from ..._types import SequenceNotStr +from ..._utils import PropertyInfo from .logging_param import LoggingParam from .log_rule_param import LogRuleParam from .skip_rule_param import SkipRuleParam @@ -35,6 +36,59 @@ "RuleRulesetsJSChallengeRule", "RuleRulesetsJSChallengeRuleExposedCredentialCheck", "RuleRulesetsJSChallengeRuleRatelimit", + "RuleRulesetsSetCacheControlRule", + "RuleRulesetsSetCacheControlRuleActionParameters", + "RuleRulesetsSetCacheControlRuleActionParametersImmutable", + "RuleRulesetsSetCacheControlRuleActionParametersImmutableSetDirective", + "RuleRulesetsSetCacheControlRuleActionParametersImmutableRemoveDirective", + "RuleRulesetsSetCacheControlRuleActionParametersMaxAge", + "RuleRulesetsSetCacheControlRuleActionParametersMaxAgeSetDirective", + "RuleRulesetsSetCacheControlRuleActionParametersMaxAgeRemoveDirective", + "RuleRulesetsSetCacheControlRuleActionParametersMustRevalidate", + "RuleRulesetsSetCacheControlRuleActionParametersMustRevalidateSetDirective", + "RuleRulesetsSetCacheControlRuleActionParametersMustRevalidateRemoveDirective", + "RuleRulesetsSetCacheControlRuleActionParametersMustUnderstand", + "RuleRulesetsSetCacheControlRuleActionParametersMustUnderstandSetDirective", + "RuleRulesetsSetCacheControlRuleActionParametersMustUnderstandRemoveDirective", + "RuleRulesetsSetCacheControlRuleActionParametersNoCache", + "RuleRulesetsSetCacheControlRuleActionParametersNoCacheSetDirective", + "RuleRulesetsSetCacheControlRuleActionParametersNoCacheRemoveDirective", + "RuleRulesetsSetCacheControlRuleActionParametersNoStore", + "RuleRulesetsSetCacheControlRuleActionParametersNoStoreSetDirective", + "RuleRulesetsSetCacheControlRuleActionParametersNoStoreRemoveDirective", + "RuleRulesetsSetCacheControlRuleActionParametersNoTransform", + "RuleRulesetsSetCacheControlRuleActionParametersNoTransformSetDirective", + "RuleRulesetsSetCacheControlRuleActionParametersNoTransformRemoveDirective", + "RuleRulesetsSetCacheControlRuleActionParametersPrivate", + "RuleRulesetsSetCacheControlRuleActionParametersPrivateSetDirective", + "RuleRulesetsSetCacheControlRuleActionParametersPrivateRemoveDirective", + "RuleRulesetsSetCacheControlRuleActionParametersProxyRevalidate", + "RuleRulesetsSetCacheControlRuleActionParametersProxyRevalidateSetDirective", + "RuleRulesetsSetCacheControlRuleActionParametersProxyRevalidateRemoveDirective", + "RuleRulesetsSetCacheControlRuleActionParametersPublic", + "RuleRulesetsSetCacheControlRuleActionParametersPublicSetDirective", + "RuleRulesetsSetCacheControlRuleActionParametersPublicRemoveDirective", + "RuleRulesetsSetCacheControlRuleActionParametersSMaxage", + "RuleRulesetsSetCacheControlRuleActionParametersSMaxageSetDirective", + "RuleRulesetsSetCacheControlRuleActionParametersSMaxageRemoveDirective", + "RuleRulesetsSetCacheControlRuleActionParametersStaleIfError", + "RuleRulesetsSetCacheControlRuleActionParametersStaleIfErrorSetDirective", + "RuleRulesetsSetCacheControlRuleActionParametersStaleIfErrorRemoveDirective", + "RuleRulesetsSetCacheControlRuleActionParametersStaleWhileRevalidate", + "RuleRulesetsSetCacheControlRuleActionParametersStaleWhileRevalidateSetDirective", + "RuleRulesetsSetCacheControlRuleActionParametersStaleWhileRevalidateRemoveDirective", + "RuleRulesetsSetCacheControlRuleExposedCredentialCheck", + "RuleRulesetsSetCacheControlRuleRatelimit", + "RuleRulesetsSetCacheTagsRule", + "RuleRulesetsSetCacheTagsRuleActionParameters", + "RuleRulesetsSetCacheTagsRuleActionParametersAddCacheTagsValues", + "RuleRulesetsSetCacheTagsRuleActionParametersAddCacheTagsExpression", + "RuleRulesetsSetCacheTagsRuleActionParametersRemoveCacheTagsValues", + "RuleRulesetsSetCacheTagsRuleActionParametersRemoveCacheTagsExpression", + "RuleRulesetsSetCacheTagsRuleActionParametersSetCacheTagsValues", + "RuleRulesetsSetCacheTagsRuleActionParametersSetCacheTagsExpression", + "RuleRulesetsSetCacheTagsRuleExposedCredentialCheck", + "RuleRulesetsSetCacheTagsRuleRatelimit", ] @@ -237,6 +291,688 @@ class RuleRulesetsJSChallengeRule(TypedDict, total=False): """The reference of the rule (the rule's ID by default).""" +class RuleRulesetsSetCacheControlRuleActionParametersImmutableSetDirective(TypedDict, total=False): + """Set the directive.""" + + operation: Required[Literal["set", "remove"]] + """The operation to perform on the cache-control directive.""" + + cloudflare_only: bool + """Whether the directive should only be applied to the Cloudflare CDN cache.""" + + +class RuleRulesetsSetCacheControlRuleActionParametersImmutableRemoveDirective(TypedDict, total=False): + """Remove the directive.""" + + operation: Required[Literal["set", "remove"]] + """The operation to perform on the cache-control directive.""" + + cloudflare_only: bool + """Whether the directive should only be applied to the Cloudflare CDN cache.""" + + +RuleRulesetsSetCacheControlRuleActionParametersImmutable: TypeAlias = Union[ + RuleRulesetsSetCacheControlRuleActionParametersImmutableSetDirective, + RuleRulesetsSetCacheControlRuleActionParametersImmutableRemoveDirective, +] + + +class RuleRulesetsSetCacheControlRuleActionParametersMaxAgeSetDirective(TypedDict, total=False): + """Set the directive with a duration value in seconds.""" + + operation: Required[Literal["set", "remove"]] + """The operation to perform on the cache-control directive.""" + + value: Required[int] + """The duration value in seconds for the directive.""" + + cloudflare_only: bool + """Whether the directive should only be applied to the Cloudflare CDN cache.""" + + +class RuleRulesetsSetCacheControlRuleActionParametersMaxAgeRemoveDirective(TypedDict, total=False): + """Remove the directive.""" + + operation: Required[Literal["set", "remove"]] + """The operation to perform on the cache-control directive.""" + + cloudflare_only: bool + """Whether the directive should only be applied to the Cloudflare CDN cache.""" + + +RuleRulesetsSetCacheControlRuleActionParametersMaxAge: TypeAlias = Union[ + RuleRulesetsSetCacheControlRuleActionParametersMaxAgeSetDirective, + RuleRulesetsSetCacheControlRuleActionParametersMaxAgeRemoveDirective, +] + + +class RuleRulesetsSetCacheControlRuleActionParametersMustRevalidateSetDirective(TypedDict, total=False): + """Set the directive.""" + + operation: Required[Literal["set", "remove"]] + """The operation to perform on the cache-control directive.""" + + cloudflare_only: bool + """Whether the directive should only be applied to the Cloudflare CDN cache.""" + + +class RuleRulesetsSetCacheControlRuleActionParametersMustRevalidateRemoveDirective(TypedDict, total=False): + """Remove the directive.""" + + operation: Required[Literal["set", "remove"]] + """The operation to perform on the cache-control directive.""" + + cloudflare_only: bool + """Whether the directive should only be applied to the Cloudflare CDN cache.""" + + +RuleRulesetsSetCacheControlRuleActionParametersMustRevalidate: TypeAlias = Union[ + RuleRulesetsSetCacheControlRuleActionParametersMustRevalidateSetDirective, + RuleRulesetsSetCacheControlRuleActionParametersMustRevalidateRemoveDirective, +] + + +class RuleRulesetsSetCacheControlRuleActionParametersMustUnderstandSetDirective(TypedDict, total=False): + """Set the directive.""" + + operation: Required[Literal["set", "remove"]] + """The operation to perform on the cache-control directive.""" + + cloudflare_only: bool + """Whether the directive should only be applied to the Cloudflare CDN cache.""" + + +class RuleRulesetsSetCacheControlRuleActionParametersMustUnderstandRemoveDirective(TypedDict, total=False): + """Remove the directive.""" + + operation: Required[Literal["set", "remove"]] + """The operation to perform on the cache-control directive.""" + + cloudflare_only: bool + """Whether the directive should only be applied to the Cloudflare CDN cache.""" + + +RuleRulesetsSetCacheControlRuleActionParametersMustUnderstand: TypeAlias = Union[ + RuleRulesetsSetCacheControlRuleActionParametersMustUnderstandSetDirective, + RuleRulesetsSetCacheControlRuleActionParametersMustUnderstandRemoveDirective, +] + + +class RuleRulesetsSetCacheControlRuleActionParametersNoCacheSetDirective(TypedDict, total=False): + """Set the directive with optional qualifiers.""" + + operation: Required[Literal["set", "remove"]] + """The operation to perform on the cache-control directive.""" + + cloudflare_only: bool + """Whether the directive should only be applied to the Cloudflare CDN cache.""" + + qualifiers: SequenceNotStr[str] + """ + Optional list of header names to qualify the directive (e.g., for "private" or + "no-cache" directives). + """ + + +class RuleRulesetsSetCacheControlRuleActionParametersNoCacheRemoveDirective(TypedDict, total=False): + """Remove the directive.""" + + operation: Required[Literal["set", "remove"]] + """The operation to perform on the cache-control directive.""" + + cloudflare_only: bool + """Whether the directive should only be applied to the Cloudflare CDN cache.""" + + +RuleRulesetsSetCacheControlRuleActionParametersNoCache: TypeAlias = Union[ + RuleRulesetsSetCacheControlRuleActionParametersNoCacheSetDirective, + RuleRulesetsSetCacheControlRuleActionParametersNoCacheRemoveDirective, +] + + +class RuleRulesetsSetCacheControlRuleActionParametersNoStoreSetDirective(TypedDict, total=False): + """Set the directive.""" + + operation: Required[Literal["set", "remove"]] + """The operation to perform on the cache-control directive.""" + + cloudflare_only: bool + """Whether the directive should only be applied to the Cloudflare CDN cache.""" + + +class RuleRulesetsSetCacheControlRuleActionParametersNoStoreRemoveDirective(TypedDict, total=False): + """Remove the directive.""" + + operation: Required[Literal["set", "remove"]] + """The operation to perform on the cache-control directive.""" + + cloudflare_only: bool + """Whether the directive should only be applied to the Cloudflare CDN cache.""" + + +RuleRulesetsSetCacheControlRuleActionParametersNoStore: TypeAlias = Union[ + RuleRulesetsSetCacheControlRuleActionParametersNoStoreSetDirective, + RuleRulesetsSetCacheControlRuleActionParametersNoStoreRemoveDirective, +] + + +class RuleRulesetsSetCacheControlRuleActionParametersNoTransformSetDirective(TypedDict, total=False): + """Set the directive.""" + + operation: Required[Literal["set", "remove"]] + """The operation to perform on the cache-control directive.""" + + cloudflare_only: bool + """Whether the directive should only be applied to the Cloudflare CDN cache.""" + + +class RuleRulesetsSetCacheControlRuleActionParametersNoTransformRemoveDirective(TypedDict, total=False): + """Remove the directive.""" + + operation: Required[Literal["set", "remove"]] + """The operation to perform on the cache-control directive.""" + + cloudflare_only: bool + """Whether the directive should only be applied to the Cloudflare CDN cache.""" + + +RuleRulesetsSetCacheControlRuleActionParametersNoTransform: TypeAlias = Union[ + RuleRulesetsSetCacheControlRuleActionParametersNoTransformSetDirective, + RuleRulesetsSetCacheControlRuleActionParametersNoTransformRemoveDirective, +] + + +class RuleRulesetsSetCacheControlRuleActionParametersPrivateSetDirective(TypedDict, total=False): + """Set the directive with optional qualifiers.""" + + operation: Required[Literal["set", "remove"]] + """The operation to perform on the cache-control directive.""" + + cloudflare_only: bool + """Whether the directive should only be applied to the Cloudflare CDN cache.""" + + qualifiers: SequenceNotStr[str] + """ + Optional list of header names to qualify the directive (e.g., for "private" or + "no-cache" directives). + """ + + +class RuleRulesetsSetCacheControlRuleActionParametersPrivateRemoveDirective(TypedDict, total=False): + """Remove the directive.""" + + operation: Required[Literal["set", "remove"]] + """The operation to perform on the cache-control directive.""" + + cloudflare_only: bool + """Whether the directive should only be applied to the Cloudflare CDN cache.""" + + +RuleRulesetsSetCacheControlRuleActionParametersPrivate: TypeAlias = Union[ + RuleRulesetsSetCacheControlRuleActionParametersPrivateSetDirective, + RuleRulesetsSetCacheControlRuleActionParametersPrivateRemoveDirective, +] + + +class RuleRulesetsSetCacheControlRuleActionParametersProxyRevalidateSetDirective(TypedDict, total=False): + """Set the directive.""" + + operation: Required[Literal["set", "remove"]] + """The operation to perform on the cache-control directive.""" + + cloudflare_only: bool + """Whether the directive should only be applied to the Cloudflare CDN cache.""" + + +class RuleRulesetsSetCacheControlRuleActionParametersProxyRevalidateRemoveDirective(TypedDict, total=False): + """Remove the directive.""" + + operation: Required[Literal["set", "remove"]] + """The operation to perform on the cache-control directive.""" + + cloudflare_only: bool + """Whether the directive should only be applied to the Cloudflare CDN cache.""" + + +RuleRulesetsSetCacheControlRuleActionParametersProxyRevalidate: TypeAlias = Union[ + RuleRulesetsSetCacheControlRuleActionParametersProxyRevalidateSetDirective, + RuleRulesetsSetCacheControlRuleActionParametersProxyRevalidateRemoveDirective, +] + + +class RuleRulesetsSetCacheControlRuleActionParametersPublicSetDirective(TypedDict, total=False): + """Set the directive.""" + + operation: Required[Literal["set", "remove"]] + """The operation to perform on the cache-control directive.""" + + cloudflare_only: bool + """Whether the directive should only be applied to the Cloudflare CDN cache.""" + + +class RuleRulesetsSetCacheControlRuleActionParametersPublicRemoveDirective(TypedDict, total=False): + """Remove the directive.""" + + operation: Required[Literal["set", "remove"]] + """The operation to perform on the cache-control directive.""" + + cloudflare_only: bool + """Whether the directive should only be applied to the Cloudflare CDN cache.""" + + +RuleRulesetsSetCacheControlRuleActionParametersPublic: TypeAlias = Union[ + RuleRulesetsSetCacheControlRuleActionParametersPublicSetDirective, + RuleRulesetsSetCacheControlRuleActionParametersPublicRemoveDirective, +] + + +class RuleRulesetsSetCacheControlRuleActionParametersSMaxageSetDirective(TypedDict, total=False): + """Set the directive with a duration value in seconds.""" + + operation: Required[Literal["set", "remove"]] + """The operation to perform on the cache-control directive.""" + + value: Required[int] + """The duration value in seconds for the directive.""" + + cloudflare_only: bool + """Whether the directive should only be applied to the Cloudflare CDN cache.""" + + +class RuleRulesetsSetCacheControlRuleActionParametersSMaxageRemoveDirective(TypedDict, total=False): + """Remove the directive.""" + + operation: Required[Literal["set", "remove"]] + """The operation to perform on the cache-control directive.""" + + cloudflare_only: bool + """Whether the directive should only be applied to the Cloudflare CDN cache.""" + + +RuleRulesetsSetCacheControlRuleActionParametersSMaxage: TypeAlias = Union[ + RuleRulesetsSetCacheControlRuleActionParametersSMaxageSetDirective, + RuleRulesetsSetCacheControlRuleActionParametersSMaxageRemoveDirective, +] + + +class RuleRulesetsSetCacheControlRuleActionParametersStaleIfErrorSetDirective(TypedDict, total=False): + """Set the directive with a duration value in seconds.""" + + operation: Required[Literal["set", "remove"]] + """The operation to perform on the cache-control directive.""" + + value: Required[int] + """The duration value in seconds for the directive.""" + + cloudflare_only: bool + """Whether the directive should only be applied to the Cloudflare CDN cache.""" + + +class RuleRulesetsSetCacheControlRuleActionParametersStaleIfErrorRemoveDirective(TypedDict, total=False): + """Remove the directive.""" + + operation: Required[Literal["set", "remove"]] + """The operation to perform on the cache-control directive.""" + + cloudflare_only: bool + """Whether the directive should only be applied to the Cloudflare CDN cache.""" + + +RuleRulesetsSetCacheControlRuleActionParametersStaleIfError: TypeAlias = Union[ + RuleRulesetsSetCacheControlRuleActionParametersStaleIfErrorSetDirective, + RuleRulesetsSetCacheControlRuleActionParametersStaleIfErrorRemoveDirective, +] + + +class RuleRulesetsSetCacheControlRuleActionParametersStaleWhileRevalidateSetDirective(TypedDict, total=False): + """Set the directive with a duration value in seconds.""" + + operation: Required[Literal["set", "remove"]] + """The operation to perform on the cache-control directive.""" + + value: Required[int] + """The duration value in seconds for the directive.""" + + cloudflare_only: bool + """Whether the directive should only be applied to the Cloudflare CDN cache.""" + + +class RuleRulesetsSetCacheControlRuleActionParametersStaleWhileRevalidateRemoveDirective(TypedDict, total=False): + """Remove the directive.""" + + operation: Required[Literal["set", "remove"]] + """The operation to perform on the cache-control directive.""" + + cloudflare_only: bool + """Whether the directive should only be applied to the Cloudflare CDN cache.""" + + +RuleRulesetsSetCacheControlRuleActionParametersStaleWhileRevalidate: TypeAlias = Union[ + RuleRulesetsSetCacheControlRuleActionParametersStaleWhileRevalidateSetDirective, + RuleRulesetsSetCacheControlRuleActionParametersStaleWhileRevalidateRemoveDirective, +] + + +class RuleRulesetsSetCacheControlRuleActionParameters(TypedDict, total=False): + """The parameters configuring the rule's action.""" + + immutable: RuleRulesetsSetCacheControlRuleActionParametersImmutable + """A cache-control directive configuration.""" + + max_age: Annotated[RuleRulesetsSetCacheControlRuleActionParametersMaxAge, PropertyInfo(alias="max-age")] + """ + A cache-control directive configuration that accepts a duration value in + seconds. + """ + + must_revalidate: Annotated[ + RuleRulesetsSetCacheControlRuleActionParametersMustRevalidate, PropertyInfo(alias="must-revalidate") + ] + """A cache-control directive configuration.""" + + must_understand: Annotated[ + RuleRulesetsSetCacheControlRuleActionParametersMustUnderstand, PropertyInfo(alias="must-understand") + ] + """A cache-control directive configuration.""" + + no_cache: Annotated[RuleRulesetsSetCacheControlRuleActionParametersNoCache, PropertyInfo(alias="no-cache")] + """ + A cache-control directive configuration that accepts optional qualifiers (header + names). + """ + + no_store: Annotated[RuleRulesetsSetCacheControlRuleActionParametersNoStore, PropertyInfo(alias="no-store")] + """A cache-control directive configuration.""" + + no_transform: Annotated[ + RuleRulesetsSetCacheControlRuleActionParametersNoTransform, PropertyInfo(alias="no-transform") + ] + """A cache-control directive configuration.""" + + private: RuleRulesetsSetCacheControlRuleActionParametersPrivate + """ + A cache-control directive configuration that accepts optional qualifiers (header + names). + """ + + proxy_revalidate: Annotated[ + RuleRulesetsSetCacheControlRuleActionParametersProxyRevalidate, PropertyInfo(alias="proxy-revalidate") + ] + """A cache-control directive configuration.""" + + public: RuleRulesetsSetCacheControlRuleActionParametersPublic + """A cache-control directive configuration.""" + + s_maxage: Annotated[RuleRulesetsSetCacheControlRuleActionParametersSMaxage, PropertyInfo(alias="s-maxage")] + """ + A cache-control directive configuration that accepts a duration value in + seconds. + """ + + stale_if_error: Annotated[ + RuleRulesetsSetCacheControlRuleActionParametersStaleIfError, PropertyInfo(alias="stale-if-error") + ] + """ + A cache-control directive configuration that accepts a duration value in + seconds. + """ + + stale_while_revalidate: Annotated[ + RuleRulesetsSetCacheControlRuleActionParametersStaleWhileRevalidate, + PropertyInfo(alias="stale-while-revalidate"), + ] + """ + A cache-control directive configuration that accepts a duration value in + seconds. + """ + + +class RuleRulesetsSetCacheControlRuleExposedCredentialCheck(TypedDict, total=False): + """Configuration for exposed credential checking.""" + + password_expression: Required[str] + """An expression that selects the password used in the credentials check.""" + + username_expression: Required[str] + """An expression that selects the user ID used in the credentials check.""" + + +class RuleRulesetsSetCacheControlRuleRatelimit(TypedDict, total=False): + """An object configuring the rule's rate limit behavior.""" + + characteristics: Required[SequenceNotStr[str]] + """ + Characteristics of the request on which the rate limit counter will be + incremented. + """ + + period: Required[int] + """Period in seconds over which the counter is being incremented.""" + + counting_expression: str + """An expression that defines when the rate limit counter should be incremented. + + It defaults to the same as the rule's expression. + """ + + mitigation_timeout: int + """ + Period of time in seconds after which the action will be disabled following its + first execution. + """ + + requests_per_period: int + """ + The threshold of requests per period after which the action will be executed for + the first time. + """ + + requests_to_origin: bool + """Whether counting is only performed when an origin is reached.""" + + score_per_period: int + """ + The score threshold per period for which the action will be executed the first + time. + """ + + score_response_header_name: str + """ + A response header name provided by the origin, which contains the score to + increment rate limit counter with. + """ + + +class RuleRulesetsSetCacheControlRule(TypedDict, total=False): + id: str + """The unique ID of the rule.""" + + action: Literal["set_cache_control"] + """The action to perform when the rule matches.""" + + action_parameters: RuleRulesetsSetCacheControlRuleActionParameters + """The parameters configuring the rule's action.""" + + description: str + """An informative description of the rule.""" + + enabled: bool + """Whether the rule should be executed.""" + + exposed_credential_check: RuleRulesetsSetCacheControlRuleExposedCredentialCheck + """Configuration for exposed credential checking.""" + + expression: str + """The expression defining which traffic will match the rule.""" + + logging: LoggingParam + """An object configuring the rule's logging behavior.""" + + ratelimit: RuleRulesetsSetCacheControlRuleRatelimit + """An object configuring the rule's rate limit behavior.""" + + ref: str + """The reference of the rule (the rule's ID by default).""" + + +class RuleRulesetsSetCacheTagsRuleActionParametersAddCacheTagsValues(TypedDict, total=False): + """Add cache tags using a list of values.""" + + operation: Required[Literal["add", "remove", "set"]] + """The operation to perform on the cache tags.""" + + values: Required[SequenceNotStr[str]] + """A list of cache tag values.""" + + +class RuleRulesetsSetCacheTagsRuleActionParametersAddCacheTagsExpression(TypedDict, total=False): + """Add cache tags using an expression.""" + + expression: Required[str] + """An expression that evaluates to an array of cache tag values.""" + + operation: Required[Literal["add", "remove", "set"]] + """The operation to perform on the cache tags.""" + + +class RuleRulesetsSetCacheTagsRuleActionParametersRemoveCacheTagsValues(TypedDict, total=False): + """Remove cache tags using a list of values.""" + + operation: Required[Literal["add", "remove", "set"]] + """The operation to perform on the cache tags.""" + + values: Required[SequenceNotStr[str]] + """A list of cache tag values.""" + + +class RuleRulesetsSetCacheTagsRuleActionParametersRemoveCacheTagsExpression(TypedDict, total=False): + """Remove cache tags using an expression.""" + + expression: Required[str] + """An expression that evaluates to an array of cache tag values.""" + + operation: Required[Literal["add", "remove", "set"]] + """The operation to perform on the cache tags.""" + + +class RuleRulesetsSetCacheTagsRuleActionParametersSetCacheTagsValues(TypedDict, total=False): + """Set cache tags using a list of values.""" + + operation: Required[Literal["add", "remove", "set"]] + """The operation to perform on the cache tags.""" + + values: Required[SequenceNotStr[str]] + """A list of cache tag values.""" + + +class RuleRulesetsSetCacheTagsRuleActionParametersSetCacheTagsExpression(TypedDict, total=False): + """Set cache tags using an expression.""" + + expression: Required[str] + """An expression that evaluates to an array of cache tag values.""" + + operation: Required[Literal["add", "remove", "set"]] + """The operation to perform on the cache tags.""" + + +RuleRulesetsSetCacheTagsRuleActionParameters: TypeAlias = Union[ + RuleRulesetsSetCacheTagsRuleActionParametersAddCacheTagsValues, + RuleRulesetsSetCacheTagsRuleActionParametersAddCacheTagsExpression, + RuleRulesetsSetCacheTagsRuleActionParametersRemoveCacheTagsValues, + RuleRulesetsSetCacheTagsRuleActionParametersRemoveCacheTagsExpression, + RuleRulesetsSetCacheTagsRuleActionParametersSetCacheTagsValues, + RuleRulesetsSetCacheTagsRuleActionParametersSetCacheTagsExpression, +] + + +class RuleRulesetsSetCacheTagsRuleExposedCredentialCheck(TypedDict, total=False): + """Configuration for exposed credential checking.""" + + password_expression: Required[str] + """An expression that selects the password used in the credentials check.""" + + username_expression: Required[str] + """An expression that selects the user ID used in the credentials check.""" + + +class RuleRulesetsSetCacheTagsRuleRatelimit(TypedDict, total=False): + """An object configuring the rule's rate limit behavior.""" + + characteristics: Required[SequenceNotStr[str]] + """ + Characteristics of the request on which the rate limit counter will be + incremented. + """ + + period: Required[int] + """Period in seconds over which the counter is being incremented.""" + + counting_expression: str + """An expression that defines when the rate limit counter should be incremented. + + It defaults to the same as the rule's expression. + """ + + mitigation_timeout: int + """ + Period of time in seconds after which the action will be disabled following its + first execution. + """ + + requests_per_period: int + """ + The threshold of requests per period after which the action will be executed for + the first time. + """ + + requests_to_origin: bool + """Whether counting is only performed when an origin is reached.""" + + score_per_period: int + """ + The score threshold per period for which the action will be executed the first + time. + """ + + score_response_header_name: str + """ + A response header name provided by the origin, which contains the score to + increment rate limit counter with. + """ + + +class RuleRulesetsSetCacheTagsRule(TypedDict, total=False): + id: str + """The unique ID of the rule.""" + + action: Literal["set_cache_tags"] + """The action to perform when the rule matches.""" + + action_parameters: RuleRulesetsSetCacheTagsRuleActionParameters + """The parameters configuring the rule's action.""" + + description: str + """An informative description of the rule.""" + + enabled: bool + """Whether the rule should be executed.""" + + exposed_credential_check: RuleRulesetsSetCacheTagsRuleExposedCredentialCheck + """Configuration for exposed credential checking.""" + + expression: str + """The expression defining which traffic will match the rule.""" + + logging: LoggingParam + """An object configuring the rule's logging behavior.""" + + ratelimit: RuleRulesetsSetCacheTagsRuleRatelimit + """An object configuring the rule's rate limit behavior.""" + + ref: str + """The reference of the rule (the rule's ID by default).""" + + Rule: TypeAlias = Union[ BlockRuleParam, RuleRulesetsChallengeRule, @@ -253,7 +989,9 @@ class RuleRulesetsJSChallengeRule(TypedDict, total=False): RouteRuleParam, ScoreRuleParam, ServeErrorRuleParam, + RuleRulesetsSetCacheControlRule, SetCacheSettingsRuleParam, + RuleRulesetsSetCacheTagsRule, SetConfigRuleParam, SkipRuleParam, ] diff --git a/src/cloudflare/types/rulesets/ruleset_update_response.py b/src/cloudflare/types/rulesets/ruleset_update_response.py index 19a203aa4de..a323e0af695 100644 --- a/src/cloudflare/types/rulesets/ruleset_update_response.py +++ b/src/cloudflare/types/rulesets/ruleset_update_response.py @@ -4,6 +4,8 @@ from datetime import datetime from typing_extensions import Literal, Annotated, TypeAlias +from pydantic import Field as FieldInfo + from .kind import Kind from .phase import Phase from .logging import Logging @@ -35,6 +37,59 @@ "RuleRulesetsJSChallengeRule", "RuleRulesetsJSChallengeRuleExposedCredentialCheck", "RuleRulesetsJSChallengeRuleRatelimit", + "RuleRulesetsSetCacheControlRule", + "RuleRulesetsSetCacheControlRuleActionParameters", + "RuleRulesetsSetCacheControlRuleActionParametersImmutable", + "RuleRulesetsSetCacheControlRuleActionParametersImmutableSetDirective", + "RuleRulesetsSetCacheControlRuleActionParametersImmutableRemoveDirective", + "RuleRulesetsSetCacheControlRuleActionParametersMaxAge", + "RuleRulesetsSetCacheControlRuleActionParametersMaxAgeSetDirective", + "RuleRulesetsSetCacheControlRuleActionParametersMaxAgeRemoveDirective", + "RuleRulesetsSetCacheControlRuleActionParametersMustRevalidate", + "RuleRulesetsSetCacheControlRuleActionParametersMustRevalidateSetDirective", + "RuleRulesetsSetCacheControlRuleActionParametersMustRevalidateRemoveDirective", + "RuleRulesetsSetCacheControlRuleActionParametersMustUnderstand", + "RuleRulesetsSetCacheControlRuleActionParametersMustUnderstandSetDirective", + "RuleRulesetsSetCacheControlRuleActionParametersMustUnderstandRemoveDirective", + "RuleRulesetsSetCacheControlRuleActionParametersNoCache", + "RuleRulesetsSetCacheControlRuleActionParametersNoCacheSetDirective", + "RuleRulesetsSetCacheControlRuleActionParametersNoCacheRemoveDirective", + "RuleRulesetsSetCacheControlRuleActionParametersNoStore", + "RuleRulesetsSetCacheControlRuleActionParametersNoStoreSetDirective", + "RuleRulesetsSetCacheControlRuleActionParametersNoStoreRemoveDirective", + "RuleRulesetsSetCacheControlRuleActionParametersNoTransform", + "RuleRulesetsSetCacheControlRuleActionParametersNoTransformSetDirective", + "RuleRulesetsSetCacheControlRuleActionParametersNoTransformRemoveDirective", + "RuleRulesetsSetCacheControlRuleActionParametersPrivate", + "RuleRulesetsSetCacheControlRuleActionParametersPrivateSetDirective", + "RuleRulesetsSetCacheControlRuleActionParametersPrivateRemoveDirective", + "RuleRulesetsSetCacheControlRuleActionParametersProxyRevalidate", + "RuleRulesetsSetCacheControlRuleActionParametersProxyRevalidateSetDirective", + "RuleRulesetsSetCacheControlRuleActionParametersProxyRevalidateRemoveDirective", + "RuleRulesetsSetCacheControlRuleActionParametersPublic", + "RuleRulesetsSetCacheControlRuleActionParametersPublicSetDirective", + "RuleRulesetsSetCacheControlRuleActionParametersPublicRemoveDirective", + "RuleRulesetsSetCacheControlRuleActionParametersSMaxage", + "RuleRulesetsSetCacheControlRuleActionParametersSMaxageSetDirective", + "RuleRulesetsSetCacheControlRuleActionParametersSMaxageRemoveDirective", + "RuleRulesetsSetCacheControlRuleActionParametersStaleIfError", + "RuleRulesetsSetCacheControlRuleActionParametersStaleIfErrorSetDirective", + "RuleRulesetsSetCacheControlRuleActionParametersStaleIfErrorRemoveDirective", + "RuleRulesetsSetCacheControlRuleActionParametersStaleWhileRevalidate", + "RuleRulesetsSetCacheControlRuleActionParametersStaleWhileRevalidateSetDirective", + "RuleRulesetsSetCacheControlRuleActionParametersStaleWhileRevalidateRemoveDirective", + "RuleRulesetsSetCacheControlRuleExposedCredentialCheck", + "RuleRulesetsSetCacheControlRuleRatelimit", + "RuleRulesetsSetCacheTagsRule", + "RuleRulesetsSetCacheTagsRuleActionParameters", + "RuleRulesetsSetCacheTagsRuleActionParametersAddCacheTagsValues", + "RuleRulesetsSetCacheTagsRuleActionParametersAddCacheTagsExpression", + "RuleRulesetsSetCacheTagsRuleActionParametersRemoveCacheTagsValues", + "RuleRulesetsSetCacheTagsRuleActionParametersRemoveCacheTagsExpression", + "RuleRulesetsSetCacheTagsRuleActionParametersSetCacheTagsValues", + "RuleRulesetsSetCacheTagsRuleActionParametersSetCacheTagsExpression", + "RuleRulesetsSetCacheTagsRuleExposedCredentialCheck", + "RuleRulesetsSetCacheTagsRuleRatelimit", ] @@ -232,6 +287,711 @@ class RuleRulesetsJSChallengeRule(BaseModel): """The reference of the rule (the rule's ID by default).""" +class RuleRulesetsSetCacheControlRuleActionParametersImmutableSetDirective(BaseModel): + """Set the directive.""" + + operation: Literal["set", "remove"] + """The operation to perform on the cache-control directive.""" + + cloudflare_only: Optional[bool] = None + """Whether the directive should only be applied to the Cloudflare CDN cache.""" + + +class RuleRulesetsSetCacheControlRuleActionParametersImmutableRemoveDirective(BaseModel): + """Remove the directive.""" + + operation: Literal["set", "remove"] + """The operation to perform on the cache-control directive.""" + + cloudflare_only: Optional[bool] = None + """Whether the directive should only be applied to the Cloudflare CDN cache.""" + + +RuleRulesetsSetCacheControlRuleActionParametersImmutable: TypeAlias = Union[ + RuleRulesetsSetCacheControlRuleActionParametersImmutableSetDirective, + RuleRulesetsSetCacheControlRuleActionParametersImmutableRemoveDirective, +] + + +class RuleRulesetsSetCacheControlRuleActionParametersMaxAgeSetDirective(BaseModel): + """Set the directive with a duration value in seconds.""" + + operation: Literal["set", "remove"] + """The operation to perform on the cache-control directive.""" + + value: int + """The duration value in seconds for the directive.""" + + cloudflare_only: Optional[bool] = None + """Whether the directive should only be applied to the Cloudflare CDN cache.""" + + +class RuleRulesetsSetCacheControlRuleActionParametersMaxAgeRemoveDirective(BaseModel): + """Remove the directive.""" + + operation: Literal["set", "remove"] + """The operation to perform on the cache-control directive.""" + + cloudflare_only: Optional[bool] = None + """Whether the directive should only be applied to the Cloudflare CDN cache.""" + + +RuleRulesetsSetCacheControlRuleActionParametersMaxAge: TypeAlias = Union[ + RuleRulesetsSetCacheControlRuleActionParametersMaxAgeSetDirective, + RuleRulesetsSetCacheControlRuleActionParametersMaxAgeRemoveDirective, +] + + +class RuleRulesetsSetCacheControlRuleActionParametersMustRevalidateSetDirective(BaseModel): + """Set the directive.""" + + operation: Literal["set", "remove"] + """The operation to perform on the cache-control directive.""" + + cloudflare_only: Optional[bool] = None + """Whether the directive should only be applied to the Cloudflare CDN cache.""" + + +class RuleRulesetsSetCacheControlRuleActionParametersMustRevalidateRemoveDirective(BaseModel): + """Remove the directive.""" + + operation: Literal["set", "remove"] + """The operation to perform on the cache-control directive.""" + + cloudflare_only: Optional[bool] = None + """Whether the directive should only be applied to the Cloudflare CDN cache.""" + + +RuleRulesetsSetCacheControlRuleActionParametersMustRevalidate: TypeAlias = Union[ + RuleRulesetsSetCacheControlRuleActionParametersMustRevalidateSetDirective, + RuleRulesetsSetCacheControlRuleActionParametersMustRevalidateRemoveDirective, +] + + +class RuleRulesetsSetCacheControlRuleActionParametersMustUnderstandSetDirective(BaseModel): + """Set the directive.""" + + operation: Literal["set", "remove"] + """The operation to perform on the cache-control directive.""" + + cloudflare_only: Optional[bool] = None + """Whether the directive should only be applied to the Cloudflare CDN cache.""" + + +class RuleRulesetsSetCacheControlRuleActionParametersMustUnderstandRemoveDirective(BaseModel): + """Remove the directive.""" + + operation: Literal["set", "remove"] + """The operation to perform on the cache-control directive.""" + + cloudflare_only: Optional[bool] = None + """Whether the directive should only be applied to the Cloudflare CDN cache.""" + + +RuleRulesetsSetCacheControlRuleActionParametersMustUnderstand: TypeAlias = Union[ + RuleRulesetsSetCacheControlRuleActionParametersMustUnderstandSetDirective, + RuleRulesetsSetCacheControlRuleActionParametersMustUnderstandRemoveDirective, +] + + +class RuleRulesetsSetCacheControlRuleActionParametersNoCacheSetDirective(BaseModel): + """Set the directive with optional qualifiers.""" + + operation: Literal["set", "remove"] + """The operation to perform on the cache-control directive.""" + + cloudflare_only: Optional[bool] = None + """Whether the directive should only be applied to the Cloudflare CDN cache.""" + + qualifiers: Optional[List[str]] = None + """ + Optional list of header names to qualify the directive (e.g., for "private" or + "no-cache" directives). + """ + + +class RuleRulesetsSetCacheControlRuleActionParametersNoCacheRemoveDirective(BaseModel): + """Remove the directive.""" + + operation: Literal["set", "remove"] + """The operation to perform on the cache-control directive.""" + + cloudflare_only: Optional[bool] = None + """Whether the directive should only be applied to the Cloudflare CDN cache.""" + + +RuleRulesetsSetCacheControlRuleActionParametersNoCache: TypeAlias = Union[ + RuleRulesetsSetCacheControlRuleActionParametersNoCacheSetDirective, + RuleRulesetsSetCacheControlRuleActionParametersNoCacheRemoveDirective, +] + + +class RuleRulesetsSetCacheControlRuleActionParametersNoStoreSetDirective(BaseModel): + """Set the directive.""" + + operation: Literal["set", "remove"] + """The operation to perform on the cache-control directive.""" + + cloudflare_only: Optional[bool] = None + """Whether the directive should only be applied to the Cloudflare CDN cache.""" + + +class RuleRulesetsSetCacheControlRuleActionParametersNoStoreRemoveDirective(BaseModel): + """Remove the directive.""" + + operation: Literal["set", "remove"] + """The operation to perform on the cache-control directive.""" + + cloudflare_only: Optional[bool] = None + """Whether the directive should only be applied to the Cloudflare CDN cache.""" + + +RuleRulesetsSetCacheControlRuleActionParametersNoStore: TypeAlias = Union[ + RuleRulesetsSetCacheControlRuleActionParametersNoStoreSetDirective, + RuleRulesetsSetCacheControlRuleActionParametersNoStoreRemoveDirective, +] + + +class RuleRulesetsSetCacheControlRuleActionParametersNoTransformSetDirective(BaseModel): + """Set the directive.""" + + operation: Literal["set", "remove"] + """The operation to perform on the cache-control directive.""" + + cloudflare_only: Optional[bool] = None + """Whether the directive should only be applied to the Cloudflare CDN cache.""" + + +class RuleRulesetsSetCacheControlRuleActionParametersNoTransformRemoveDirective(BaseModel): + """Remove the directive.""" + + operation: Literal["set", "remove"] + """The operation to perform on the cache-control directive.""" + + cloudflare_only: Optional[bool] = None + """Whether the directive should only be applied to the Cloudflare CDN cache.""" + + +RuleRulesetsSetCacheControlRuleActionParametersNoTransform: TypeAlias = Union[ + RuleRulesetsSetCacheControlRuleActionParametersNoTransformSetDirective, + RuleRulesetsSetCacheControlRuleActionParametersNoTransformRemoveDirective, +] + + +class RuleRulesetsSetCacheControlRuleActionParametersPrivateSetDirective(BaseModel): + """Set the directive with optional qualifiers.""" + + operation: Literal["set", "remove"] + """The operation to perform on the cache-control directive.""" + + cloudflare_only: Optional[bool] = None + """Whether the directive should only be applied to the Cloudflare CDN cache.""" + + qualifiers: Optional[List[str]] = None + """ + Optional list of header names to qualify the directive (e.g., for "private" or + "no-cache" directives). + """ + + +class RuleRulesetsSetCacheControlRuleActionParametersPrivateRemoveDirective(BaseModel): + """Remove the directive.""" + + operation: Literal["set", "remove"] + """The operation to perform on the cache-control directive.""" + + cloudflare_only: Optional[bool] = None + """Whether the directive should only be applied to the Cloudflare CDN cache.""" + + +RuleRulesetsSetCacheControlRuleActionParametersPrivate: TypeAlias = Union[ + RuleRulesetsSetCacheControlRuleActionParametersPrivateSetDirective, + RuleRulesetsSetCacheControlRuleActionParametersPrivateRemoveDirective, +] + + +class RuleRulesetsSetCacheControlRuleActionParametersProxyRevalidateSetDirective(BaseModel): + """Set the directive.""" + + operation: Literal["set", "remove"] + """The operation to perform on the cache-control directive.""" + + cloudflare_only: Optional[bool] = None + """Whether the directive should only be applied to the Cloudflare CDN cache.""" + + +class RuleRulesetsSetCacheControlRuleActionParametersProxyRevalidateRemoveDirective(BaseModel): + """Remove the directive.""" + + operation: Literal["set", "remove"] + """The operation to perform on the cache-control directive.""" + + cloudflare_only: Optional[bool] = None + """Whether the directive should only be applied to the Cloudflare CDN cache.""" + + +RuleRulesetsSetCacheControlRuleActionParametersProxyRevalidate: TypeAlias = Union[ + RuleRulesetsSetCacheControlRuleActionParametersProxyRevalidateSetDirective, + RuleRulesetsSetCacheControlRuleActionParametersProxyRevalidateRemoveDirective, +] + + +class RuleRulesetsSetCacheControlRuleActionParametersPublicSetDirective(BaseModel): + """Set the directive.""" + + operation: Literal["set", "remove"] + """The operation to perform on the cache-control directive.""" + + cloudflare_only: Optional[bool] = None + """Whether the directive should only be applied to the Cloudflare CDN cache.""" + + +class RuleRulesetsSetCacheControlRuleActionParametersPublicRemoveDirective(BaseModel): + """Remove the directive.""" + + operation: Literal["set", "remove"] + """The operation to perform on the cache-control directive.""" + + cloudflare_only: Optional[bool] = None + """Whether the directive should only be applied to the Cloudflare CDN cache.""" + + +RuleRulesetsSetCacheControlRuleActionParametersPublic: TypeAlias = Union[ + RuleRulesetsSetCacheControlRuleActionParametersPublicSetDirective, + RuleRulesetsSetCacheControlRuleActionParametersPublicRemoveDirective, +] + + +class RuleRulesetsSetCacheControlRuleActionParametersSMaxageSetDirective(BaseModel): + """Set the directive with a duration value in seconds.""" + + operation: Literal["set", "remove"] + """The operation to perform on the cache-control directive.""" + + value: int + """The duration value in seconds for the directive.""" + + cloudflare_only: Optional[bool] = None + """Whether the directive should only be applied to the Cloudflare CDN cache.""" + + +class RuleRulesetsSetCacheControlRuleActionParametersSMaxageRemoveDirective(BaseModel): + """Remove the directive.""" + + operation: Literal["set", "remove"] + """The operation to perform on the cache-control directive.""" + + cloudflare_only: Optional[bool] = None + """Whether the directive should only be applied to the Cloudflare CDN cache.""" + + +RuleRulesetsSetCacheControlRuleActionParametersSMaxage: TypeAlias = Union[ + RuleRulesetsSetCacheControlRuleActionParametersSMaxageSetDirective, + RuleRulesetsSetCacheControlRuleActionParametersSMaxageRemoveDirective, +] + + +class RuleRulesetsSetCacheControlRuleActionParametersStaleIfErrorSetDirective(BaseModel): + """Set the directive with a duration value in seconds.""" + + operation: Literal["set", "remove"] + """The operation to perform on the cache-control directive.""" + + value: int + """The duration value in seconds for the directive.""" + + cloudflare_only: Optional[bool] = None + """Whether the directive should only be applied to the Cloudflare CDN cache.""" + + +class RuleRulesetsSetCacheControlRuleActionParametersStaleIfErrorRemoveDirective(BaseModel): + """Remove the directive.""" + + operation: Literal["set", "remove"] + """The operation to perform on the cache-control directive.""" + + cloudflare_only: Optional[bool] = None + """Whether the directive should only be applied to the Cloudflare CDN cache.""" + + +RuleRulesetsSetCacheControlRuleActionParametersStaleIfError: TypeAlias = Union[ + RuleRulesetsSetCacheControlRuleActionParametersStaleIfErrorSetDirective, + RuleRulesetsSetCacheControlRuleActionParametersStaleIfErrorRemoveDirective, +] + + +class RuleRulesetsSetCacheControlRuleActionParametersStaleWhileRevalidateSetDirective(BaseModel): + """Set the directive with a duration value in seconds.""" + + operation: Literal["set", "remove"] + """The operation to perform on the cache-control directive.""" + + value: int + """The duration value in seconds for the directive.""" + + cloudflare_only: Optional[bool] = None + """Whether the directive should only be applied to the Cloudflare CDN cache.""" + + +class RuleRulesetsSetCacheControlRuleActionParametersStaleWhileRevalidateRemoveDirective(BaseModel): + """Remove the directive.""" + + operation: Literal["set", "remove"] + """The operation to perform on the cache-control directive.""" + + cloudflare_only: Optional[bool] = None + """Whether the directive should only be applied to the Cloudflare CDN cache.""" + + +RuleRulesetsSetCacheControlRuleActionParametersStaleWhileRevalidate: TypeAlias = Union[ + RuleRulesetsSetCacheControlRuleActionParametersStaleWhileRevalidateSetDirective, + RuleRulesetsSetCacheControlRuleActionParametersStaleWhileRevalidateRemoveDirective, +] + + +class RuleRulesetsSetCacheControlRuleActionParameters(BaseModel): + """The parameters configuring the rule's action.""" + + immutable: Optional[RuleRulesetsSetCacheControlRuleActionParametersImmutable] = None + """A cache-control directive configuration.""" + + max_age: Optional[RuleRulesetsSetCacheControlRuleActionParametersMaxAge] = FieldInfo(alias="max-age", default=None) + """ + A cache-control directive configuration that accepts a duration value in + seconds. + """ + + must_revalidate: Optional[RuleRulesetsSetCacheControlRuleActionParametersMustRevalidate] = FieldInfo( + alias="must-revalidate", default=None + ) + """A cache-control directive configuration.""" + + must_understand: Optional[RuleRulesetsSetCacheControlRuleActionParametersMustUnderstand] = FieldInfo( + alias="must-understand", default=None + ) + """A cache-control directive configuration.""" + + no_cache: Optional[RuleRulesetsSetCacheControlRuleActionParametersNoCache] = FieldInfo( + alias="no-cache", default=None + ) + """ + A cache-control directive configuration that accepts optional qualifiers (header + names). + """ + + no_store: Optional[RuleRulesetsSetCacheControlRuleActionParametersNoStore] = FieldInfo( + alias="no-store", default=None + ) + """A cache-control directive configuration.""" + + no_transform: Optional[RuleRulesetsSetCacheControlRuleActionParametersNoTransform] = FieldInfo( + alias="no-transform", default=None + ) + """A cache-control directive configuration.""" + + private: Optional[RuleRulesetsSetCacheControlRuleActionParametersPrivate] = None + """ + A cache-control directive configuration that accepts optional qualifiers (header + names). + """ + + proxy_revalidate: Optional[RuleRulesetsSetCacheControlRuleActionParametersProxyRevalidate] = FieldInfo( + alias="proxy-revalidate", default=None + ) + """A cache-control directive configuration.""" + + public: Optional[RuleRulesetsSetCacheControlRuleActionParametersPublic] = None + """A cache-control directive configuration.""" + + s_maxage: Optional[RuleRulesetsSetCacheControlRuleActionParametersSMaxage] = FieldInfo( + alias="s-maxage", default=None + ) + """ + A cache-control directive configuration that accepts a duration value in + seconds. + """ + + stale_if_error: Optional[RuleRulesetsSetCacheControlRuleActionParametersStaleIfError] = FieldInfo( + alias="stale-if-error", default=None + ) + """ + A cache-control directive configuration that accepts a duration value in + seconds. + """ + + stale_while_revalidate: Optional[RuleRulesetsSetCacheControlRuleActionParametersStaleWhileRevalidate] = FieldInfo( + alias="stale-while-revalidate", default=None + ) + """ + A cache-control directive configuration that accepts a duration value in + seconds. + """ + + +class RuleRulesetsSetCacheControlRuleExposedCredentialCheck(BaseModel): + """Configuration for exposed credential checking.""" + + password_expression: str + """An expression that selects the password used in the credentials check.""" + + username_expression: str + """An expression that selects the user ID used in the credentials check.""" + + +class RuleRulesetsSetCacheControlRuleRatelimit(BaseModel): + """An object configuring the rule's rate limit behavior.""" + + characteristics: List[str] + """ + Characteristics of the request on which the rate limit counter will be + incremented. + """ + + period: int + """Period in seconds over which the counter is being incremented.""" + + counting_expression: Optional[str] = None + """An expression that defines when the rate limit counter should be incremented. + + It defaults to the same as the rule's expression. + """ + + mitigation_timeout: Optional[int] = None + """ + Period of time in seconds after which the action will be disabled following its + first execution. + """ + + requests_per_period: Optional[int] = None + """ + The threshold of requests per period after which the action will be executed for + the first time. + """ + + requests_to_origin: Optional[bool] = None + """Whether counting is only performed when an origin is reached.""" + + score_per_period: Optional[int] = None + """ + The score threshold per period for which the action will be executed the first + time. + """ + + score_response_header_name: Optional[str] = None + """ + A response header name provided by the origin, which contains the score to + increment rate limit counter with. + """ + + +class RuleRulesetsSetCacheControlRule(BaseModel): + last_updated: datetime + """The timestamp of when the rule was last modified.""" + + version: str + """The version of the rule.""" + + id: Optional[str] = None + """The unique ID of the rule.""" + + action: Optional[Literal["set_cache_control"]] = None + """The action to perform when the rule matches.""" + + action_parameters: Optional[RuleRulesetsSetCacheControlRuleActionParameters] = None + """The parameters configuring the rule's action.""" + + categories: Optional[List[str]] = None + """The categories of the rule.""" + + description: Optional[str] = None + """An informative description of the rule.""" + + enabled: Optional[bool] = None + """Whether the rule should be executed.""" + + exposed_credential_check: Optional[RuleRulesetsSetCacheControlRuleExposedCredentialCheck] = None + """Configuration for exposed credential checking.""" + + expression: Optional[str] = None + """The expression defining which traffic will match the rule.""" + + logging: Optional[Logging] = None + """An object configuring the rule's logging behavior.""" + + ratelimit: Optional[RuleRulesetsSetCacheControlRuleRatelimit] = None + """An object configuring the rule's rate limit behavior.""" + + ref: Optional[str] = None + """The reference of the rule (the rule's ID by default).""" + + +class RuleRulesetsSetCacheTagsRuleActionParametersAddCacheTagsValues(BaseModel): + """Add cache tags using a list of values.""" + + operation: Literal["add", "remove", "set"] + """The operation to perform on the cache tags.""" + + values: List[str] + """A list of cache tag values.""" + + +class RuleRulesetsSetCacheTagsRuleActionParametersAddCacheTagsExpression(BaseModel): + """Add cache tags using an expression.""" + + expression: str + """An expression that evaluates to an array of cache tag values.""" + + operation: Literal["add", "remove", "set"] + """The operation to perform on the cache tags.""" + + +class RuleRulesetsSetCacheTagsRuleActionParametersRemoveCacheTagsValues(BaseModel): + """Remove cache tags using a list of values.""" + + operation: Literal["add", "remove", "set"] + """The operation to perform on the cache tags.""" + + values: List[str] + """A list of cache tag values.""" + + +class RuleRulesetsSetCacheTagsRuleActionParametersRemoveCacheTagsExpression(BaseModel): + """Remove cache tags using an expression.""" + + expression: str + """An expression that evaluates to an array of cache tag values.""" + + operation: Literal["add", "remove", "set"] + """The operation to perform on the cache tags.""" + + +class RuleRulesetsSetCacheTagsRuleActionParametersSetCacheTagsValues(BaseModel): + """Set cache tags using a list of values.""" + + operation: Literal["add", "remove", "set"] + """The operation to perform on the cache tags.""" + + values: List[str] + """A list of cache tag values.""" + + +class RuleRulesetsSetCacheTagsRuleActionParametersSetCacheTagsExpression(BaseModel): + """Set cache tags using an expression.""" + + expression: str + """An expression that evaluates to an array of cache tag values.""" + + operation: Literal["add", "remove", "set"] + """The operation to perform on the cache tags.""" + + +RuleRulesetsSetCacheTagsRuleActionParameters: TypeAlias = Union[ + RuleRulesetsSetCacheTagsRuleActionParametersAddCacheTagsValues, + RuleRulesetsSetCacheTagsRuleActionParametersAddCacheTagsExpression, + RuleRulesetsSetCacheTagsRuleActionParametersRemoveCacheTagsValues, + RuleRulesetsSetCacheTagsRuleActionParametersRemoveCacheTagsExpression, + RuleRulesetsSetCacheTagsRuleActionParametersSetCacheTagsValues, + RuleRulesetsSetCacheTagsRuleActionParametersSetCacheTagsExpression, +] + + +class RuleRulesetsSetCacheTagsRuleExposedCredentialCheck(BaseModel): + """Configuration for exposed credential checking.""" + + password_expression: str + """An expression that selects the password used in the credentials check.""" + + username_expression: str + """An expression that selects the user ID used in the credentials check.""" + + +class RuleRulesetsSetCacheTagsRuleRatelimit(BaseModel): + """An object configuring the rule's rate limit behavior.""" + + characteristics: List[str] + """ + Characteristics of the request on which the rate limit counter will be + incremented. + """ + + period: int + """Period in seconds over which the counter is being incremented.""" + + counting_expression: Optional[str] = None + """An expression that defines when the rate limit counter should be incremented. + + It defaults to the same as the rule's expression. + """ + + mitigation_timeout: Optional[int] = None + """ + Period of time in seconds after which the action will be disabled following its + first execution. + """ + + requests_per_period: Optional[int] = None + """ + The threshold of requests per period after which the action will be executed for + the first time. + """ + + requests_to_origin: Optional[bool] = None + """Whether counting is only performed when an origin is reached.""" + + score_per_period: Optional[int] = None + """ + The score threshold per period for which the action will be executed the first + time. + """ + + score_response_header_name: Optional[str] = None + """ + A response header name provided by the origin, which contains the score to + increment rate limit counter with. + """ + + +class RuleRulesetsSetCacheTagsRule(BaseModel): + last_updated: datetime + """The timestamp of when the rule was last modified.""" + + version: str + """The version of the rule.""" + + id: Optional[str] = None + """The unique ID of the rule.""" + + action: Optional[Literal["set_cache_tags"]] = None + """The action to perform when the rule matches.""" + + action_parameters: Optional[RuleRulesetsSetCacheTagsRuleActionParameters] = None + """The parameters configuring the rule's action.""" + + categories: Optional[List[str]] = None + """The categories of the rule.""" + + description: Optional[str] = None + """An informative description of the rule.""" + + enabled: Optional[bool] = None + """Whether the rule should be executed.""" + + exposed_credential_check: Optional[RuleRulesetsSetCacheTagsRuleExposedCredentialCheck] = None + """Configuration for exposed credential checking.""" + + expression: Optional[str] = None + """The expression defining which traffic will match the rule.""" + + logging: Optional[Logging] = None + """An object configuring the rule's logging behavior.""" + + ratelimit: Optional[RuleRulesetsSetCacheTagsRuleRatelimit] = None + """An object configuring the rule's rate limit behavior.""" + + ref: Optional[str] = None + """The reference of the rule (the rule's ID by default).""" + + Rule: TypeAlias = Annotated[ Union[ BlockRule, @@ -249,7 +1009,9 @@ class RuleRulesetsJSChallengeRule(BaseModel): RouteRule, ScoreRule, ServeErrorRule, + RuleRulesetsSetCacheControlRule, SetCacheSettingsRule, + RuleRulesetsSetCacheTagsRule, SetConfigRule, SkipRule, ], diff --git a/src/cloudflare/types/rulesets/set_cache_settings_rule.py b/src/cloudflare/types/rulesets/set_cache_settings_rule.py index afbc0d4af20..6d90bf7d997 100644 --- a/src/cloudflare/types/rulesets/set_cache_settings_rule.py +++ b/src/cloudflare/types/rulesets/set_cache_settings_rule.py @@ -298,6 +298,15 @@ class ActionParameters(BaseModel): serve_stale: Optional[ActionParametersServeStale] = None """When to serve stale content from cache.""" + strip_etags: Optional[bool] = None + """Whether to strip ETag headers from the origin response before caching.""" + + strip_last_modified: Optional[bool] = None + """Whether to strip Last-Modified headers from the origin response before caching.""" + + strip_set_cookie: Optional[bool] = None + """Whether to strip Set-Cookie headers from the origin response before caching.""" + class ExposedCredentialCheck(BaseModel): """Configuration for exposed credential checking.""" diff --git a/src/cloudflare/types/rulesets/set_cache_settings_rule_param.py b/src/cloudflare/types/rulesets/set_cache_settings_rule_param.py index 302bf4ff9f9..9fd1071a07d 100644 --- a/src/cloudflare/types/rulesets/set_cache_settings_rule_param.py +++ b/src/cloudflare/types/rulesets/set_cache_settings_rule_param.py @@ -305,6 +305,15 @@ class ActionParameters(TypedDict, total=False): serve_stale: ActionParametersServeStale """When to serve stale content from cache.""" + strip_etags: bool + """Whether to strip ETag headers from the origin response before caching.""" + + strip_last_modified: bool + """Whether to strip Last-Modified headers from the origin response before caching.""" + + strip_set_cookie: bool + """Whether to strip Set-Cookie headers from the origin response before caching.""" + class ExposedCredentialCheck(TypedDict, total=False): """Configuration for exposed credential checking.""" diff --git a/src/cloudflare/types/rulesets/version_get_response.py b/src/cloudflare/types/rulesets/version_get_response.py index 6e0536e009c..ffa5b313a0b 100644 --- a/src/cloudflare/types/rulesets/version_get_response.py +++ b/src/cloudflare/types/rulesets/version_get_response.py @@ -4,6 +4,8 @@ from datetime import datetime from typing_extensions import Literal, Annotated, TypeAlias +from pydantic import Field as FieldInfo + from .kind import Kind from .phase import Phase from .logging import Logging @@ -35,6 +37,59 @@ "RuleRulesetsJSChallengeRule", "RuleRulesetsJSChallengeRuleExposedCredentialCheck", "RuleRulesetsJSChallengeRuleRatelimit", + "RuleRulesetsSetCacheControlRule", + "RuleRulesetsSetCacheControlRuleActionParameters", + "RuleRulesetsSetCacheControlRuleActionParametersImmutable", + "RuleRulesetsSetCacheControlRuleActionParametersImmutableSetDirective", + "RuleRulesetsSetCacheControlRuleActionParametersImmutableRemoveDirective", + "RuleRulesetsSetCacheControlRuleActionParametersMaxAge", + "RuleRulesetsSetCacheControlRuleActionParametersMaxAgeSetDirective", + "RuleRulesetsSetCacheControlRuleActionParametersMaxAgeRemoveDirective", + "RuleRulesetsSetCacheControlRuleActionParametersMustRevalidate", + "RuleRulesetsSetCacheControlRuleActionParametersMustRevalidateSetDirective", + "RuleRulesetsSetCacheControlRuleActionParametersMustRevalidateRemoveDirective", + "RuleRulesetsSetCacheControlRuleActionParametersMustUnderstand", + "RuleRulesetsSetCacheControlRuleActionParametersMustUnderstandSetDirective", + "RuleRulesetsSetCacheControlRuleActionParametersMustUnderstandRemoveDirective", + "RuleRulesetsSetCacheControlRuleActionParametersNoCache", + "RuleRulesetsSetCacheControlRuleActionParametersNoCacheSetDirective", + "RuleRulesetsSetCacheControlRuleActionParametersNoCacheRemoveDirective", + "RuleRulesetsSetCacheControlRuleActionParametersNoStore", + "RuleRulesetsSetCacheControlRuleActionParametersNoStoreSetDirective", + "RuleRulesetsSetCacheControlRuleActionParametersNoStoreRemoveDirective", + "RuleRulesetsSetCacheControlRuleActionParametersNoTransform", + "RuleRulesetsSetCacheControlRuleActionParametersNoTransformSetDirective", + "RuleRulesetsSetCacheControlRuleActionParametersNoTransformRemoveDirective", + "RuleRulesetsSetCacheControlRuleActionParametersPrivate", + "RuleRulesetsSetCacheControlRuleActionParametersPrivateSetDirective", + "RuleRulesetsSetCacheControlRuleActionParametersPrivateRemoveDirective", + "RuleRulesetsSetCacheControlRuleActionParametersProxyRevalidate", + "RuleRulesetsSetCacheControlRuleActionParametersProxyRevalidateSetDirective", + "RuleRulesetsSetCacheControlRuleActionParametersProxyRevalidateRemoveDirective", + "RuleRulesetsSetCacheControlRuleActionParametersPublic", + "RuleRulesetsSetCacheControlRuleActionParametersPublicSetDirective", + "RuleRulesetsSetCacheControlRuleActionParametersPublicRemoveDirective", + "RuleRulesetsSetCacheControlRuleActionParametersSMaxage", + "RuleRulesetsSetCacheControlRuleActionParametersSMaxageSetDirective", + "RuleRulesetsSetCacheControlRuleActionParametersSMaxageRemoveDirective", + "RuleRulesetsSetCacheControlRuleActionParametersStaleIfError", + "RuleRulesetsSetCacheControlRuleActionParametersStaleIfErrorSetDirective", + "RuleRulesetsSetCacheControlRuleActionParametersStaleIfErrorRemoveDirective", + "RuleRulesetsSetCacheControlRuleActionParametersStaleWhileRevalidate", + "RuleRulesetsSetCacheControlRuleActionParametersStaleWhileRevalidateSetDirective", + "RuleRulesetsSetCacheControlRuleActionParametersStaleWhileRevalidateRemoveDirective", + "RuleRulesetsSetCacheControlRuleExposedCredentialCheck", + "RuleRulesetsSetCacheControlRuleRatelimit", + "RuleRulesetsSetCacheTagsRule", + "RuleRulesetsSetCacheTagsRuleActionParameters", + "RuleRulesetsSetCacheTagsRuleActionParametersAddCacheTagsValues", + "RuleRulesetsSetCacheTagsRuleActionParametersAddCacheTagsExpression", + "RuleRulesetsSetCacheTagsRuleActionParametersRemoveCacheTagsValues", + "RuleRulesetsSetCacheTagsRuleActionParametersRemoveCacheTagsExpression", + "RuleRulesetsSetCacheTagsRuleActionParametersSetCacheTagsValues", + "RuleRulesetsSetCacheTagsRuleActionParametersSetCacheTagsExpression", + "RuleRulesetsSetCacheTagsRuleExposedCredentialCheck", + "RuleRulesetsSetCacheTagsRuleRatelimit", ] @@ -232,6 +287,711 @@ class RuleRulesetsJSChallengeRule(BaseModel): """The reference of the rule (the rule's ID by default).""" +class RuleRulesetsSetCacheControlRuleActionParametersImmutableSetDirective(BaseModel): + """Set the directive.""" + + operation: Literal["set", "remove"] + """The operation to perform on the cache-control directive.""" + + cloudflare_only: Optional[bool] = None + """Whether the directive should only be applied to the Cloudflare CDN cache.""" + + +class RuleRulesetsSetCacheControlRuleActionParametersImmutableRemoveDirective(BaseModel): + """Remove the directive.""" + + operation: Literal["set", "remove"] + """The operation to perform on the cache-control directive.""" + + cloudflare_only: Optional[bool] = None + """Whether the directive should only be applied to the Cloudflare CDN cache.""" + + +RuleRulesetsSetCacheControlRuleActionParametersImmutable: TypeAlias = Union[ + RuleRulesetsSetCacheControlRuleActionParametersImmutableSetDirective, + RuleRulesetsSetCacheControlRuleActionParametersImmutableRemoveDirective, +] + + +class RuleRulesetsSetCacheControlRuleActionParametersMaxAgeSetDirective(BaseModel): + """Set the directive with a duration value in seconds.""" + + operation: Literal["set", "remove"] + """The operation to perform on the cache-control directive.""" + + value: int + """The duration value in seconds for the directive.""" + + cloudflare_only: Optional[bool] = None + """Whether the directive should only be applied to the Cloudflare CDN cache.""" + + +class RuleRulesetsSetCacheControlRuleActionParametersMaxAgeRemoveDirective(BaseModel): + """Remove the directive.""" + + operation: Literal["set", "remove"] + """The operation to perform on the cache-control directive.""" + + cloudflare_only: Optional[bool] = None + """Whether the directive should only be applied to the Cloudflare CDN cache.""" + + +RuleRulesetsSetCacheControlRuleActionParametersMaxAge: TypeAlias = Union[ + RuleRulesetsSetCacheControlRuleActionParametersMaxAgeSetDirective, + RuleRulesetsSetCacheControlRuleActionParametersMaxAgeRemoveDirective, +] + + +class RuleRulesetsSetCacheControlRuleActionParametersMustRevalidateSetDirective(BaseModel): + """Set the directive.""" + + operation: Literal["set", "remove"] + """The operation to perform on the cache-control directive.""" + + cloudflare_only: Optional[bool] = None + """Whether the directive should only be applied to the Cloudflare CDN cache.""" + + +class RuleRulesetsSetCacheControlRuleActionParametersMustRevalidateRemoveDirective(BaseModel): + """Remove the directive.""" + + operation: Literal["set", "remove"] + """The operation to perform on the cache-control directive.""" + + cloudflare_only: Optional[bool] = None + """Whether the directive should only be applied to the Cloudflare CDN cache.""" + + +RuleRulesetsSetCacheControlRuleActionParametersMustRevalidate: TypeAlias = Union[ + RuleRulesetsSetCacheControlRuleActionParametersMustRevalidateSetDirective, + RuleRulesetsSetCacheControlRuleActionParametersMustRevalidateRemoveDirective, +] + + +class RuleRulesetsSetCacheControlRuleActionParametersMustUnderstandSetDirective(BaseModel): + """Set the directive.""" + + operation: Literal["set", "remove"] + """The operation to perform on the cache-control directive.""" + + cloudflare_only: Optional[bool] = None + """Whether the directive should only be applied to the Cloudflare CDN cache.""" + + +class RuleRulesetsSetCacheControlRuleActionParametersMustUnderstandRemoveDirective(BaseModel): + """Remove the directive.""" + + operation: Literal["set", "remove"] + """The operation to perform on the cache-control directive.""" + + cloudflare_only: Optional[bool] = None + """Whether the directive should only be applied to the Cloudflare CDN cache.""" + + +RuleRulesetsSetCacheControlRuleActionParametersMustUnderstand: TypeAlias = Union[ + RuleRulesetsSetCacheControlRuleActionParametersMustUnderstandSetDirective, + RuleRulesetsSetCacheControlRuleActionParametersMustUnderstandRemoveDirective, +] + + +class RuleRulesetsSetCacheControlRuleActionParametersNoCacheSetDirective(BaseModel): + """Set the directive with optional qualifiers.""" + + operation: Literal["set", "remove"] + """The operation to perform on the cache-control directive.""" + + cloudflare_only: Optional[bool] = None + """Whether the directive should only be applied to the Cloudflare CDN cache.""" + + qualifiers: Optional[List[str]] = None + """ + Optional list of header names to qualify the directive (e.g., for "private" or + "no-cache" directives). + """ + + +class RuleRulesetsSetCacheControlRuleActionParametersNoCacheRemoveDirective(BaseModel): + """Remove the directive.""" + + operation: Literal["set", "remove"] + """The operation to perform on the cache-control directive.""" + + cloudflare_only: Optional[bool] = None + """Whether the directive should only be applied to the Cloudflare CDN cache.""" + + +RuleRulesetsSetCacheControlRuleActionParametersNoCache: TypeAlias = Union[ + RuleRulesetsSetCacheControlRuleActionParametersNoCacheSetDirective, + RuleRulesetsSetCacheControlRuleActionParametersNoCacheRemoveDirective, +] + + +class RuleRulesetsSetCacheControlRuleActionParametersNoStoreSetDirective(BaseModel): + """Set the directive.""" + + operation: Literal["set", "remove"] + """The operation to perform on the cache-control directive.""" + + cloudflare_only: Optional[bool] = None + """Whether the directive should only be applied to the Cloudflare CDN cache.""" + + +class RuleRulesetsSetCacheControlRuleActionParametersNoStoreRemoveDirective(BaseModel): + """Remove the directive.""" + + operation: Literal["set", "remove"] + """The operation to perform on the cache-control directive.""" + + cloudflare_only: Optional[bool] = None + """Whether the directive should only be applied to the Cloudflare CDN cache.""" + + +RuleRulesetsSetCacheControlRuleActionParametersNoStore: TypeAlias = Union[ + RuleRulesetsSetCacheControlRuleActionParametersNoStoreSetDirective, + RuleRulesetsSetCacheControlRuleActionParametersNoStoreRemoveDirective, +] + + +class RuleRulesetsSetCacheControlRuleActionParametersNoTransformSetDirective(BaseModel): + """Set the directive.""" + + operation: Literal["set", "remove"] + """The operation to perform on the cache-control directive.""" + + cloudflare_only: Optional[bool] = None + """Whether the directive should only be applied to the Cloudflare CDN cache.""" + + +class RuleRulesetsSetCacheControlRuleActionParametersNoTransformRemoveDirective(BaseModel): + """Remove the directive.""" + + operation: Literal["set", "remove"] + """The operation to perform on the cache-control directive.""" + + cloudflare_only: Optional[bool] = None + """Whether the directive should only be applied to the Cloudflare CDN cache.""" + + +RuleRulesetsSetCacheControlRuleActionParametersNoTransform: TypeAlias = Union[ + RuleRulesetsSetCacheControlRuleActionParametersNoTransformSetDirective, + RuleRulesetsSetCacheControlRuleActionParametersNoTransformRemoveDirective, +] + + +class RuleRulesetsSetCacheControlRuleActionParametersPrivateSetDirective(BaseModel): + """Set the directive with optional qualifiers.""" + + operation: Literal["set", "remove"] + """The operation to perform on the cache-control directive.""" + + cloudflare_only: Optional[bool] = None + """Whether the directive should only be applied to the Cloudflare CDN cache.""" + + qualifiers: Optional[List[str]] = None + """ + Optional list of header names to qualify the directive (e.g., for "private" or + "no-cache" directives). + """ + + +class RuleRulesetsSetCacheControlRuleActionParametersPrivateRemoveDirective(BaseModel): + """Remove the directive.""" + + operation: Literal["set", "remove"] + """The operation to perform on the cache-control directive.""" + + cloudflare_only: Optional[bool] = None + """Whether the directive should only be applied to the Cloudflare CDN cache.""" + + +RuleRulesetsSetCacheControlRuleActionParametersPrivate: TypeAlias = Union[ + RuleRulesetsSetCacheControlRuleActionParametersPrivateSetDirective, + RuleRulesetsSetCacheControlRuleActionParametersPrivateRemoveDirective, +] + + +class RuleRulesetsSetCacheControlRuleActionParametersProxyRevalidateSetDirective(BaseModel): + """Set the directive.""" + + operation: Literal["set", "remove"] + """The operation to perform on the cache-control directive.""" + + cloudflare_only: Optional[bool] = None + """Whether the directive should only be applied to the Cloudflare CDN cache.""" + + +class RuleRulesetsSetCacheControlRuleActionParametersProxyRevalidateRemoveDirective(BaseModel): + """Remove the directive.""" + + operation: Literal["set", "remove"] + """The operation to perform on the cache-control directive.""" + + cloudflare_only: Optional[bool] = None + """Whether the directive should only be applied to the Cloudflare CDN cache.""" + + +RuleRulesetsSetCacheControlRuleActionParametersProxyRevalidate: TypeAlias = Union[ + RuleRulesetsSetCacheControlRuleActionParametersProxyRevalidateSetDirective, + RuleRulesetsSetCacheControlRuleActionParametersProxyRevalidateRemoveDirective, +] + + +class RuleRulesetsSetCacheControlRuleActionParametersPublicSetDirective(BaseModel): + """Set the directive.""" + + operation: Literal["set", "remove"] + """The operation to perform on the cache-control directive.""" + + cloudflare_only: Optional[bool] = None + """Whether the directive should only be applied to the Cloudflare CDN cache.""" + + +class RuleRulesetsSetCacheControlRuleActionParametersPublicRemoveDirective(BaseModel): + """Remove the directive.""" + + operation: Literal["set", "remove"] + """The operation to perform on the cache-control directive.""" + + cloudflare_only: Optional[bool] = None + """Whether the directive should only be applied to the Cloudflare CDN cache.""" + + +RuleRulesetsSetCacheControlRuleActionParametersPublic: TypeAlias = Union[ + RuleRulesetsSetCacheControlRuleActionParametersPublicSetDirective, + RuleRulesetsSetCacheControlRuleActionParametersPublicRemoveDirective, +] + + +class RuleRulesetsSetCacheControlRuleActionParametersSMaxageSetDirective(BaseModel): + """Set the directive with a duration value in seconds.""" + + operation: Literal["set", "remove"] + """The operation to perform on the cache-control directive.""" + + value: int + """The duration value in seconds for the directive.""" + + cloudflare_only: Optional[bool] = None + """Whether the directive should only be applied to the Cloudflare CDN cache.""" + + +class RuleRulesetsSetCacheControlRuleActionParametersSMaxageRemoveDirective(BaseModel): + """Remove the directive.""" + + operation: Literal["set", "remove"] + """The operation to perform on the cache-control directive.""" + + cloudflare_only: Optional[bool] = None + """Whether the directive should only be applied to the Cloudflare CDN cache.""" + + +RuleRulesetsSetCacheControlRuleActionParametersSMaxage: TypeAlias = Union[ + RuleRulesetsSetCacheControlRuleActionParametersSMaxageSetDirective, + RuleRulesetsSetCacheControlRuleActionParametersSMaxageRemoveDirective, +] + + +class RuleRulesetsSetCacheControlRuleActionParametersStaleIfErrorSetDirective(BaseModel): + """Set the directive with a duration value in seconds.""" + + operation: Literal["set", "remove"] + """The operation to perform on the cache-control directive.""" + + value: int + """The duration value in seconds for the directive.""" + + cloudflare_only: Optional[bool] = None + """Whether the directive should only be applied to the Cloudflare CDN cache.""" + + +class RuleRulesetsSetCacheControlRuleActionParametersStaleIfErrorRemoveDirective(BaseModel): + """Remove the directive.""" + + operation: Literal["set", "remove"] + """The operation to perform on the cache-control directive.""" + + cloudflare_only: Optional[bool] = None + """Whether the directive should only be applied to the Cloudflare CDN cache.""" + + +RuleRulesetsSetCacheControlRuleActionParametersStaleIfError: TypeAlias = Union[ + RuleRulesetsSetCacheControlRuleActionParametersStaleIfErrorSetDirective, + RuleRulesetsSetCacheControlRuleActionParametersStaleIfErrorRemoveDirective, +] + + +class RuleRulesetsSetCacheControlRuleActionParametersStaleWhileRevalidateSetDirective(BaseModel): + """Set the directive with a duration value in seconds.""" + + operation: Literal["set", "remove"] + """The operation to perform on the cache-control directive.""" + + value: int + """The duration value in seconds for the directive.""" + + cloudflare_only: Optional[bool] = None + """Whether the directive should only be applied to the Cloudflare CDN cache.""" + + +class RuleRulesetsSetCacheControlRuleActionParametersStaleWhileRevalidateRemoveDirective(BaseModel): + """Remove the directive.""" + + operation: Literal["set", "remove"] + """The operation to perform on the cache-control directive.""" + + cloudflare_only: Optional[bool] = None + """Whether the directive should only be applied to the Cloudflare CDN cache.""" + + +RuleRulesetsSetCacheControlRuleActionParametersStaleWhileRevalidate: TypeAlias = Union[ + RuleRulesetsSetCacheControlRuleActionParametersStaleWhileRevalidateSetDirective, + RuleRulesetsSetCacheControlRuleActionParametersStaleWhileRevalidateRemoveDirective, +] + + +class RuleRulesetsSetCacheControlRuleActionParameters(BaseModel): + """The parameters configuring the rule's action.""" + + immutable: Optional[RuleRulesetsSetCacheControlRuleActionParametersImmutable] = None + """A cache-control directive configuration.""" + + max_age: Optional[RuleRulesetsSetCacheControlRuleActionParametersMaxAge] = FieldInfo(alias="max-age", default=None) + """ + A cache-control directive configuration that accepts a duration value in + seconds. + """ + + must_revalidate: Optional[RuleRulesetsSetCacheControlRuleActionParametersMustRevalidate] = FieldInfo( + alias="must-revalidate", default=None + ) + """A cache-control directive configuration.""" + + must_understand: Optional[RuleRulesetsSetCacheControlRuleActionParametersMustUnderstand] = FieldInfo( + alias="must-understand", default=None + ) + """A cache-control directive configuration.""" + + no_cache: Optional[RuleRulesetsSetCacheControlRuleActionParametersNoCache] = FieldInfo( + alias="no-cache", default=None + ) + """ + A cache-control directive configuration that accepts optional qualifiers (header + names). + """ + + no_store: Optional[RuleRulesetsSetCacheControlRuleActionParametersNoStore] = FieldInfo( + alias="no-store", default=None + ) + """A cache-control directive configuration.""" + + no_transform: Optional[RuleRulesetsSetCacheControlRuleActionParametersNoTransform] = FieldInfo( + alias="no-transform", default=None + ) + """A cache-control directive configuration.""" + + private: Optional[RuleRulesetsSetCacheControlRuleActionParametersPrivate] = None + """ + A cache-control directive configuration that accepts optional qualifiers (header + names). + """ + + proxy_revalidate: Optional[RuleRulesetsSetCacheControlRuleActionParametersProxyRevalidate] = FieldInfo( + alias="proxy-revalidate", default=None + ) + """A cache-control directive configuration.""" + + public: Optional[RuleRulesetsSetCacheControlRuleActionParametersPublic] = None + """A cache-control directive configuration.""" + + s_maxage: Optional[RuleRulesetsSetCacheControlRuleActionParametersSMaxage] = FieldInfo( + alias="s-maxage", default=None + ) + """ + A cache-control directive configuration that accepts a duration value in + seconds. + """ + + stale_if_error: Optional[RuleRulesetsSetCacheControlRuleActionParametersStaleIfError] = FieldInfo( + alias="stale-if-error", default=None + ) + """ + A cache-control directive configuration that accepts a duration value in + seconds. + """ + + stale_while_revalidate: Optional[RuleRulesetsSetCacheControlRuleActionParametersStaleWhileRevalidate] = FieldInfo( + alias="stale-while-revalidate", default=None + ) + """ + A cache-control directive configuration that accepts a duration value in + seconds. + """ + + +class RuleRulesetsSetCacheControlRuleExposedCredentialCheck(BaseModel): + """Configuration for exposed credential checking.""" + + password_expression: str + """An expression that selects the password used in the credentials check.""" + + username_expression: str + """An expression that selects the user ID used in the credentials check.""" + + +class RuleRulesetsSetCacheControlRuleRatelimit(BaseModel): + """An object configuring the rule's rate limit behavior.""" + + characteristics: List[str] + """ + Characteristics of the request on which the rate limit counter will be + incremented. + """ + + period: int + """Period in seconds over which the counter is being incremented.""" + + counting_expression: Optional[str] = None + """An expression that defines when the rate limit counter should be incremented. + + It defaults to the same as the rule's expression. + """ + + mitigation_timeout: Optional[int] = None + """ + Period of time in seconds after which the action will be disabled following its + first execution. + """ + + requests_per_period: Optional[int] = None + """ + The threshold of requests per period after which the action will be executed for + the first time. + """ + + requests_to_origin: Optional[bool] = None + """Whether counting is only performed when an origin is reached.""" + + score_per_period: Optional[int] = None + """ + The score threshold per period for which the action will be executed the first + time. + """ + + score_response_header_name: Optional[str] = None + """ + A response header name provided by the origin, which contains the score to + increment rate limit counter with. + """ + + +class RuleRulesetsSetCacheControlRule(BaseModel): + last_updated: datetime + """The timestamp of when the rule was last modified.""" + + version: str + """The version of the rule.""" + + id: Optional[str] = None + """The unique ID of the rule.""" + + action: Optional[Literal["set_cache_control"]] = None + """The action to perform when the rule matches.""" + + action_parameters: Optional[RuleRulesetsSetCacheControlRuleActionParameters] = None + """The parameters configuring the rule's action.""" + + categories: Optional[List[str]] = None + """The categories of the rule.""" + + description: Optional[str] = None + """An informative description of the rule.""" + + enabled: Optional[bool] = None + """Whether the rule should be executed.""" + + exposed_credential_check: Optional[RuleRulesetsSetCacheControlRuleExposedCredentialCheck] = None + """Configuration for exposed credential checking.""" + + expression: Optional[str] = None + """The expression defining which traffic will match the rule.""" + + logging: Optional[Logging] = None + """An object configuring the rule's logging behavior.""" + + ratelimit: Optional[RuleRulesetsSetCacheControlRuleRatelimit] = None + """An object configuring the rule's rate limit behavior.""" + + ref: Optional[str] = None + """The reference of the rule (the rule's ID by default).""" + + +class RuleRulesetsSetCacheTagsRuleActionParametersAddCacheTagsValues(BaseModel): + """Add cache tags using a list of values.""" + + operation: Literal["add", "remove", "set"] + """The operation to perform on the cache tags.""" + + values: List[str] + """A list of cache tag values.""" + + +class RuleRulesetsSetCacheTagsRuleActionParametersAddCacheTagsExpression(BaseModel): + """Add cache tags using an expression.""" + + expression: str + """An expression that evaluates to an array of cache tag values.""" + + operation: Literal["add", "remove", "set"] + """The operation to perform on the cache tags.""" + + +class RuleRulesetsSetCacheTagsRuleActionParametersRemoveCacheTagsValues(BaseModel): + """Remove cache tags using a list of values.""" + + operation: Literal["add", "remove", "set"] + """The operation to perform on the cache tags.""" + + values: List[str] + """A list of cache tag values.""" + + +class RuleRulesetsSetCacheTagsRuleActionParametersRemoveCacheTagsExpression(BaseModel): + """Remove cache tags using an expression.""" + + expression: str + """An expression that evaluates to an array of cache tag values.""" + + operation: Literal["add", "remove", "set"] + """The operation to perform on the cache tags.""" + + +class RuleRulesetsSetCacheTagsRuleActionParametersSetCacheTagsValues(BaseModel): + """Set cache tags using a list of values.""" + + operation: Literal["add", "remove", "set"] + """The operation to perform on the cache tags.""" + + values: List[str] + """A list of cache tag values.""" + + +class RuleRulesetsSetCacheTagsRuleActionParametersSetCacheTagsExpression(BaseModel): + """Set cache tags using an expression.""" + + expression: str + """An expression that evaluates to an array of cache tag values.""" + + operation: Literal["add", "remove", "set"] + """The operation to perform on the cache tags.""" + + +RuleRulesetsSetCacheTagsRuleActionParameters: TypeAlias = Union[ + RuleRulesetsSetCacheTagsRuleActionParametersAddCacheTagsValues, + RuleRulesetsSetCacheTagsRuleActionParametersAddCacheTagsExpression, + RuleRulesetsSetCacheTagsRuleActionParametersRemoveCacheTagsValues, + RuleRulesetsSetCacheTagsRuleActionParametersRemoveCacheTagsExpression, + RuleRulesetsSetCacheTagsRuleActionParametersSetCacheTagsValues, + RuleRulesetsSetCacheTagsRuleActionParametersSetCacheTagsExpression, +] + + +class RuleRulesetsSetCacheTagsRuleExposedCredentialCheck(BaseModel): + """Configuration for exposed credential checking.""" + + password_expression: str + """An expression that selects the password used in the credentials check.""" + + username_expression: str + """An expression that selects the user ID used in the credentials check.""" + + +class RuleRulesetsSetCacheTagsRuleRatelimit(BaseModel): + """An object configuring the rule's rate limit behavior.""" + + characteristics: List[str] + """ + Characteristics of the request on which the rate limit counter will be + incremented. + """ + + period: int + """Period in seconds over which the counter is being incremented.""" + + counting_expression: Optional[str] = None + """An expression that defines when the rate limit counter should be incremented. + + It defaults to the same as the rule's expression. + """ + + mitigation_timeout: Optional[int] = None + """ + Period of time in seconds after which the action will be disabled following its + first execution. + """ + + requests_per_period: Optional[int] = None + """ + The threshold of requests per period after which the action will be executed for + the first time. + """ + + requests_to_origin: Optional[bool] = None + """Whether counting is only performed when an origin is reached.""" + + score_per_period: Optional[int] = None + """ + The score threshold per period for which the action will be executed the first + time. + """ + + score_response_header_name: Optional[str] = None + """ + A response header name provided by the origin, which contains the score to + increment rate limit counter with. + """ + + +class RuleRulesetsSetCacheTagsRule(BaseModel): + last_updated: datetime + """The timestamp of when the rule was last modified.""" + + version: str + """The version of the rule.""" + + id: Optional[str] = None + """The unique ID of the rule.""" + + action: Optional[Literal["set_cache_tags"]] = None + """The action to perform when the rule matches.""" + + action_parameters: Optional[RuleRulesetsSetCacheTagsRuleActionParameters] = None + """The parameters configuring the rule's action.""" + + categories: Optional[List[str]] = None + """The categories of the rule.""" + + description: Optional[str] = None + """An informative description of the rule.""" + + enabled: Optional[bool] = None + """Whether the rule should be executed.""" + + exposed_credential_check: Optional[RuleRulesetsSetCacheTagsRuleExposedCredentialCheck] = None + """Configuration for exposed credential checking.""" + + expression: Optional[str] = None + """The expression defining which traffic will match the rule.""" + + logging: Optional[Logging] = None + """An object configuring the rule's logging behavior.""" + + ratelimit: Optional[RuleRulesetsSetCacheTagsRuleRatelimit] = None + """An object configuring the rule's rate limit behavior.""" + + ref: Optional[str] = None + """The reference of the rule (the rule's ID by default).""" + + Rule: TypeAlias = Annotated[ Union[ BlockRule, @@ -249,7 +1009,9 @@ class RuleRulesetsJSChallengeRule(BaseModel): RouteRule, ScoreRule, ServeErrorRule, + RuleRulesetsSetCacheControlRule, SetCacheSettingsRule, + RuleRulesetsSetCacheTagsRule, SetConfigRule, SkipRule, ], diff --git a/src/cloudflare/types/security_txt/security_txt_get_response.py b/src/cloudflare/types/security_txt/security_txt_get_response.py index 21e896fb24a..9a2263d1101 100644 --- a/src/cloudflare/types/security_txt/security_txt_get_response.py +++ b/src/cloudflare/types/security_txt/security_txt_get_response.py @@ -3,8 +3,6 @@ from typing import List, Optional from datetime import datetime -from pydantic import Field as FieldInfo - from ..._models import BaseModel __all__ = ["SecurityTXTGetResponse"] @@ -27,4 +25,4 @@ class SecurityTXTGetResponse(BaseModel): policy: Optional[List[str]] = None - preferred_languages: Optional[str] = FieldInfo(alias="preferredLanguages", default=None) + preferred_languages: Optional[str] = None diff --git a/src/cloudflare/types/security_txt/security_txt_update_params.py b/src/cloudflare/types/security_txt/security_txt_update_params.py index cfd96dc16ac..ccd935f7bed 100644 --- a/src/cloudflare/types/security_txt/security_txt_update_params.py +++ b/src/cloudflare/types/security_txt/security_txt_update_params.py @@ -32,4 +32,4 @@ class SecurityTXTUpdateParams(TypedDict, total=False): policy: SequenceNotStr[str] - preferred_languages: Annotated[str, PropertyInfo(alias="preferredLanguages")] + preferred_languages: str diff --git a/src/cloudflare/types/speed/schedule_create_params.py b/src/cloudflare/types/speed/schedule_create_params.py index e776e4255d6..c36a7880435 100644 --- a/src/cloudflare/types/speed/schedule_create_params.py +++ b/src/cloudflare/types/speed/schedule_create_params.py @@ -11,6 +11,12 @@ class ScheduleCreateParams(TypedDict, total=False): zone_id: Required[str] """Identifier.""" + frequency: Literal["DAILY", "WEEKLY"] + """The frequency of the scheduled test. + + Defaults to WEEKLY for free plans, DAILY for paid plans. + """ + region: Literal[ "asia-east1", "asia-northeast1", diff --git a/src/cloudflare/types/token_validation/configuration_edit_response.py b/src/cloudflare/types/token_validation/configuration_edit_response.py index 662c55edd12..22545c20e04 100644 --- a/src/cloudflare/types/token_validation/configuration_edit_response.py +++ b/src/cloudflare/types/token_validation/configuration_edit_response.py @@ -8,6 +8,9 @@ class ConfigurationEditResponse(BaseModel): + id: Optional[str] = None + """UUID.""" + description: Optional[str] = None title: Optional[str] = None diff --git a/src/cloudflare/types/workers/beta/workers/version.py b/src/cloudflare/types/workers/beta/workers/version.py index 26a16505ff2..640ea8501c8 100644 --- a/src/cloudflare/types/workers/beta/workers/version.py +++ b/src/cloudflare/types/workers/beta/workers/version.py @@ -704,6 +704,13 @@ class Version(BaseModel): number: int """The integer version number, starting from one.""" + urls: List[str] + """All routable URLs that always point to this version. + + Does not include alias URLs, since aliases can be updated to point to a + different version. + """ + annotations: Optional[Annotations] = None """Metadata about the version.""" diff --git a/src/cloudflare/types/workflows/__init__.py b/src/cloudflare/types/workflows/__init__.py index 7ddd6aefea8..385d8fff853 100644 --- a/src/cloudflare/types/workflows/__init__.py +++ b/src/cloudflare/types/workflows/__init__.py @@ -2,6 +2,7 @@ from __future__ import annotations +from .instance_get_params import InstanceGetParams as InstanceGetParams from .version_list_params import VersionListParams as VersionListParams from .instance_bulk_params import InstanceBulkParams as InstanceBulkParams from .instance_list_params import InstanceListParams as InstanceListParams diff --git a/src/cloudflare/types/workflows/instance_get_params.py b/src/cloudflare/types/workflows/instance_get_params.py new file mode 100644 index 00000000000..eb22c5965ce --- /dev/null +++ b/src/cloudflare/types/workflows/instance_get_params.py @@ -0,0 +1,19 @@ +# 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__ = ["InstanceGetParams"] + + +class InstanceGetParams(TypedDict, total=False): + account_id: Required[str] + + workflow_name: Required[str] + + order: Literal["asc", "desc"] + """Step ordering: "asc" (default, oldest first) or "desc" (newest first).""" + + simple: Literal["true", "false"] + """When true, omits step details and returns only metadata with step_count.""" diff --git a/src/cloudflare/types/workflows/instance_get_response.py b/src/cloudflare/types/workflows/instance_get_response.py index e75ee1e2c6f..f25bfa25ead 100644 --- a/src/cloudflare/types/workflows/instance_get_response.py +++ b/src/cloudflare/types/workflows/instance_get_response.py @@ -157,6 +157,8 @@ class InstanceGetResponse(BaseModel): status: Literal["queued", "running", "paused", "errored", "terminated", "complete", "waitingForPause", "waiting"] + step_count: int + steps: List[Step] success: Optional[bool] = None diff --git a/src/cloudflare/types/workflows/version_get_response.py b/src/cloudflare/types/workflows/version_get_response.py index 51c1879072f..efcc075ab45 100644 --- a/src/cloudflare/types/workflows/version_get_response.py +++ b/src/cloudflare/types/workflows/version_get_response.py @@ -1,10 +1,15 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. +from typing import Optional from datetime import datetime from ..._models import BaseModel -__all__ = ["VersionGetResponse"] +__all__ = ["VersionGetResponse", "Limits"] + + +class Limits(BaseModel): + steps: Optional[int] = None class VersionGetResponse(BaseModel): @@ -19,3 +24,5 @@ class VersionGetResponse(BaseModel): modified_on: datetime workflow_id: str + + limits: Optional[Limits] = None diff --git a/src/cloudflare/types/workflows/version_list_response.py b/src/cloudflare/types/workflows/version_list_response.py index 03a9a24feef..4125333a1b4 100644 --- a/src/cloudflare/types/workflows/version_list_response.py +++ b/src/cloudflare/types/workflows/version_list_response.py @@ -1,10 +1,15 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. +from typing import Optional from datetime import datetime from ..._models import BaseModel -__all__ = ["VersionListResponse"] +__all__ = ["VersionListResponse", "Limits"] + + +class Limits(BaseModel): + steps: Optional[int] = None class VersionListResponse(BaseModel): @@ -19,3 +24,5 @@ class VersionListResponse(BaseModel): modified_on: datetime workflow_id: str + + limits: Optional[Limits] = None diff --git a/src/cloudflare/types/workflows/workflow_update_params.py b/src/cloudflare/types/workflows/workflow_update_params.py index 3cc22a14961..2ff781a484d 100644 --- a/src/cloudflare/types/workflows/workflow_update_params.py +++ b/src/cloudflare/types/workflows/workflow_update_params.py @@ -4,7 +4,7 @@ from typing_extensions import Required, TypedDict -__all__ = ["WorkflowUpdateParams"] +__all__ = ["WorkflowUpdateParams", "Limits"] class WorkflowUpdateParams(TypedDict, total=False): @@ -13,3 +13,9 @@ class WorkflowUpdateParams(TypedDict, total=False): class_name: Required[str] script_name: Required[str] + + limits: Limits + + +class Limits(TypedDict, total=False): + steps: int diff --git a/src/cloudflare/types/zero_trust/dlp/payload_log_get_response.py b/src/cloudflare/types/zero_trust/dlp/payload_log_get_response.py index 14a5fe92d59..0ee9d9e6406 100644 --- a/src/cloudflare/types/zero_trust/dlp/payload_log_get_response.py +++ b/src/cloudflare/types/zero_trust/dlp/payload_log_get_response.py @@ -10,7 +10,9 @@ class PayloadLogGetResponse(BaseModel): - masking_level: Literal["full", "partial", "clear", "default"] + updated_at: datetime + + masking_level: Optional[Literal["full", "partial", "clear", "default"]] = None """Masking level for payload logs. - `full`: The entire payload is masked. @@ -19,8 +21,6 @@ class PayloadLogGetResponse(BaseModel): - `default`: DLP uses its default masking behavior. """ - updated_at: datetime - public_key: Optional[str] = None """Base64-encoded public key for encrypting payload logs. diff --git a/src/cloudflare/types/zero_trust/dlp/payload_log_update_response.py b/src/cloudflare/types/zero_trust/dlp/payload_log_update_response.py index 20e305721e7..d5cb5fea76e 100644 --- a/src/cloudflare/types/zero_trust/dlp/payload_log_update_response.py +++ b/src/cloudflare/types/zero_trust/dlp/payload_log_update_response.py @@ -10,7 +10,9 @@ class PayloadLogUpdateResponse(BaseModel): - masking_level: Literal["full", "partial", "clear", "default"] + updated_at: datetime + + masking_level: Optional[Literal["full", "partial", "clear", "default"]] = None """Masking level for payload logs. - `full`: The entire payload is masked. @@ -19,8 +21,6 @@ class PayloadLogUpdateResponse(BaseModel): - `default`: DLP uses its default masking behavior. """ - updated_at: datetime - public_key: Optional[str] = None """Base64-encoded public key for encrypting payload logs. diff --git a/src/cloudflare/types/zero_trust/dlp/profile.py b/src/cloudflare/types/zero_trust/dlp/profile.py index 3e204f1c0fa..e5904c1c648 100644 --- a/src/cloudflare/types/zero_trust/dlp/profile.py +++ b/src/cloudflare/types/zero_trust/dlp/profile.py @@ -364,11 +364,20 @@ class CustomProfile(BaseModel): keywords. """ + data_classes: Optional[List[str]] = None + """Data classes associated with this profile.""" + + data_tags: Optional[List[str]] = None + """Data tags associated with this profile.""" + description: Optional[str] = None """The description of the profile.""" entries: Optional[List[CustomProfileEntry]] = None + sensitivity_levels: Optional[List[List[str]]] = None + """Sensitivity levels associated with this profile as (group_id, level_id) tuples.""" + shared_entries: Optional[List[CustomProfileSharedEntry]] = None diff --git a/src/cloudflare/types/zero_trust/dlp/profiles/custom_create_params.py b/src/cloudflare/types/zero_trust/dlp/profiles/custom_create_params.py index fa44d5c365f..61b88ede52d 100644 --- a/src/cloudflare/types/zero_trust/dlp/profiles/custom_create_params.py +++ b/src/cloudflare/types/zero_trust/dlp/profiles/custom_create_params.py @@ -30,6 +30,12 @@ class CustomCreateParams(TypedDict, total=False): keywords. """ + data_classes: SequenceNotStr[str] + """Data class IDs to associate with the profile.""" + + data_tags: SequenceNotStr[str] + """Data tag IDs to associate with the profile.""" + description: Optional[str] """The description of the profile.""" @@ -37,6 +43,11 @@ class CustomCreateParams(TypedDict, total=False): ocr_enabled: bool + sensitivity_levels: Iterable[SequenceNotStr[str]] + """ + Sensitivity levels to associate with the profile as (group_id, level_id) tuples. + """ + shared_entries: Iterable[SharedEntry] """Entries from other profiles (e.g. diff --git a/src/cloudflare/types/zero_trust/dlp/profiles/custom_update_params.py b/src/cloudflare/types/zero_trust/dlp/profiles/custom_update_params.py index b6b46d1059d..928b959cf0a 100644 --- a/src/cloudflare/types/zero_trust/dlp/profiles/custom_update_params.py +++ b/src/cloudflare/types/zero_trust/dlp/profiles/custom_update_params.py @@ -5,6 +5,7 @@ from typing import Union, Iterable, Optional from typing_extensions import Required, TypeAlias, TypedDict +from ....._types import SequenceNotStr from .pattern_param import PatternParam from ..context_awareness_param import ContextAwarenessParam @@ -28,6 +29,18 @@ class CustomUpdateParams(TypedDict, total=False): keywords. """ + data_classes: Optional[SequenceNotStr[str]] + """Data class IDs to associate with the profile. + + If omitted, existing associations are unchanged. + """ + + data_tags: Optional[SequenceNotStr[str]] + """Data tag IDs to associate with the profile. + + If omitted, existing associations are unchanged. + """ + description: Optional[str] """The description of the profile.""" @@ -39,6 +52,12 @@ class CustomUpdateParams(TypedDict, total=False): ocr_enabled: bool + sensitivity_levels: Optional[Iterable[SequenceNotStr[str]]] + """Sensitivity levels to associate with the profile. + + If omitted, existing associations are unchanged. + """ + shared_entries: Iterable[SharedEntry] """Other entries, e.g. predefined or integration.""" diff --git a/src/cloudflare/types/zones/setting_edit_response.py b/src/cloudflare/types/zones/setting_edit_response.py index 9a65fcb24a0..9fd2e3ef777 100644 --- a/src/cloudflare/types/zones/setting_edit_response.py +++ b/src/cloudflare/types/zones/setting_edit_response.py @@ -58,6 +58,7 @@ "ZonesCacheRulesOriginMaxHTTPVersion", "ZonesSchemasPolish", "ZonesPrivacyPass", + "ZonesRedirectsForAITraining", "ZonesReplaceInsecureJS", "ZonesSchemasResponseBuffering", "ZonesSchemasRocketLoader", @@ -508,6 +509,28 @@ class ZonesPrivacyPass(BaseModel): """last time this setting was modified.""" +class ZonesRedirectsForAITraining(BaseModel): + """ + When enabled, Cloudflare will redirect verified AI training crawlers to canonical URLs + found in the HTML response, ensuring AI models train on authoritative content. + """ + + id: Literal["redirects_for_ai_training"] + """ID of the zone setting.""" + + value: Literal["off", "on"] + """Current value of the zone setting.""" + + editable: Optional[Literal[True, False]] = None + """ + Whether or not this setting can be modified for this zone (based on your + Cloudflare plan level). + """ + + modified_on: Optional[datetime] = None + """last time this setting was modified.""" + + class ZonesReplaceInsecureJS(BaseModel): """ Automatically replace insecure JavaScript libraries with safer and faster alternatives provided under cdnjs and powered by Cloudflare. Currently supports the following libraries: Polyfill under polyfill.io. @@ -827,6 +850,7 @@ class ZonesSchemasWAF(BaseModel): ZonesPrivacyPass, ProxyReadTimeout, PseudoIPV4, + ZonesRedirectsForAITraining, ZonesReplaceInsecureJS, ZonesSchemasResponseBuffering, ZonesSchemasRocketLoader, diff --git a/src/cloudflare/types/zones/setting_get_response.py b/src/cloudflare/types/zones/setting_get_response.py index 5976efc6f37..ac20c206eb1 100644 --- a/src/cloudflare/types/zones/setting_get_response.py +++ b/src/cloudflare/types/zones/setting_get_response.py @@ -58,6 +58,7 @@ "ZonesCacheRulesOriginMaxHTTPVersion", "ZonesSchemasPolish", "ZonesPrivacyPass", + "ZonesRedirectsForAITraining", "ZonesReplaceInsecureJS", "ZonesSchemasResponseBuffering", "ZonesSchemasRocketLoader", @@ -508,6 +509,28 @@ class ZonesPrivacyPass(BaseModel): """last time this setting was modified.""" +class ZonesRedirectsForAITraining(BaseModel): + """ + When enabled, Cloudflare will redirect verified AI training crawlers to canonical URLs + found in the HTML response, ensuring AI models train on authoritative content. + """ + + id: Literal["redirects_for_ai_training"] + """ID of the zone setting.""" + + value: Literal["off", "on"] + """Current value of the zone setting.""" + + editable: Optional[Literal[True, False]] = None + """ + Whether or not this setting can be modified for this zone (based on your + Cloudflare plan level). + """ + + modified_on: Optional[datetime] = None + """last time this setting was modified.""" + + class ZonesReplaceInsecureJS(BaseModel): """ Automatically replace insecure JavaScript libraries with safer and faster alternatives provided under cdnjs and powered by Cloudflare. Currently supports the following libraries: Polyfill under polyfill.io. @@ -827,6 +850,7 @@ class ZonesSchemasWAF(BaseModel): ZonesPrivacyPass, ProxyReadTimeout, PseudoIPV4, + ZonesRedirectsForAITraining, ZonesReplaceInsecureJS, ZonesSchemasResponseBuffering, ZonesSchemasRocketLoader, diff --git a/tests/api_resources/aisearch/instances/test_items.py b/tests/api_resources/aisearch/instances/test_items.py index 1d2e15d03b9..b95f7b5d460 100644 --- a/tests/api_resources/aisearch/instances/test_items.py +++ b/tests/api_resources/aisearch/instances/test_items.py @@ -10,7 +10,7 @@ from cloudflare import Cloudflare, AsyncCloudflare from tests.utils import assert_matches_type from cloudflare.pagination import SyncV4PagePaginationArray, AsyncV4PagePaginationArray -from cloudflare.types.aisearch.instances import ItemGetResponse, ItemListResponse +from cloudflare.types.aisearch.instances import ItemListResponse base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") @@ -78,66 +78,6 @@ def test_path_params_list(self, client: Cloudflare) -> None: account_id="c3dc5f0b34a14ff8e1b3ec04895e1b22", ) - @parametrize - def test_method_get(self, client: Cloudflare) -> None: - item = client.aisearch.instances.items.get( - item_id="item_id", - account_id="c3dc5f0b34a14ff8e1b3ec04895e1b22", - id="my-ai-search", - ) - assert_matches_type(ItemGetResponse, item, path=["response"]) - - @parametrize - def test_raw_response_get(self, client: Cloudflare) -> None: - response = client.aisearch.instances.items.with_raw_response.get( - item_id="item_id", - account_id="c3dc5f0b34a14ff8e1b3ec04895e1b22", - id="my-ai-search", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - item = response.parse() - assert_matches_type(ItemGetResponse, item, path=["response"]) - - @parametrize - def test_streaming_response_get(self, client: Cloudflare) -> None: - with client.aisearch.instances.items.with_streaming_response.get( - item_id="item_id", - account_id="c3dc5f0b34a14ff8e1b3ec04895e1b22", - id="my-ai-search", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - item = response.parse() - assert_matches_type(ItemGetResponse, item, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_get(self, client: Cloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): - client.aisearch.instances.items.with_raw_response.get( - item_id="item_id", - account_id="", - id="my-ai-search", - ) - - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.aisearch.instances.items.with_raw_response.get( - item_id="item_id", - account_id="c3dc5f0b34a14ff8e1b3ec04895e1b22", - id="", - ) - - with pytest.raises(ValueError, match=r"Expected a non-empty value for `item_id` but received ''"): - client.aisearch.instances.items.with_raw_response.get( - item_id="", - account_id="c3dc5f0b34a14ff8e1b3ec04895e1b22", - id="my-ai-search", - ) - class TestAsyncItems: parametrize = pytest.mark.parametrize( @@ -203,63 +143,3 @@ async def test_path_params_list(self, async_client: AsyncCloudflare) -> None: id="", account_id="c3dc5f0b34a14ff8e1b3ec04895e1b22", ) - - @parametrize - async def test_method_get(self, async_client: AsyncCloudflare) -> None: - item = await async_client.aisearch.instances.items.get( - item_id="item_id", - account_id="c3dc5f0b34a14ff8e1b3ec04895e1b22", - id="my-ai-search", - ) - assert_matches_type(ItemGetResponse, item, path=["response"]) - - @parametrize - async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: - response = await async_client.aisearch.instances.items.with_raw_response.get( - item_id="item_id", - account_id="c3dc5f0b34a14ff8e1b3ec04895e1b22", - id="my-ai-search", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - item = await response.parse() - assert_matches_type(ItemGetResponse, item, path=["response"]) - - @parametrize - async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> None: - async with async_client.aisearch.instances.items.with_streaming_response.get( - item_id="item_id", - account_id="c3dc5f0b34a14ff8e1b3ec04895e1b22", - id="my-ai-search", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - item = await response.parse() - assert_matches_type(ItemGetResponse, item, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_get(self, async_client: AsyncCloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): - await async_client.aisearch.instances.items.with_raw_response.get( - item_id="item_id", - account_id="", - id="my-ai-search", - ) - - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.aisearch.instances.items.with_raw_response.get( - item_id="item_id", - account_id="c3dc5f0b34a14ff8e1b3ec04895e1b22", - id="", - ) - - with pytest.raises(ValueError, match=r"Expected a non-empty value for `item_id` but received ''"): - await async_client.aisearch.instances.items.with_raw_response.get( - item_id="", - account_id="c3dc5f0b34a14ff8e1b3ec04895e1b22", - id="my-ai-search", - ) diff --git a/tests/api_resources/aisearch/instances/test_jobs.py b/tests/api_resources/aisearch/instances/test_jobs.py index 9fa2d6a28d4..d66674d7e80 100644 --- a/tests/api_resources/aisearch/instances/test_jobs.py +++ b/tests/api_resources/aisearch/instances/test_jobs.py @@ -31,6 +31,15 @@ def test_method_create(self, client: Cloudflare) -> None: ) assert_matches_type(JobCreateResponse, job, path=["response"]) + @parametrize + def test_method_create_with_all_params(self, client: Cloudflare) -> None: + job = client.aisearch.instances.jobs.create( + id="my-ai-search", + account_id="c3dc5f0b34a14ff8e1b3ec04895e1b22", + description="description", + ) + assert_matches_type(JobCreateResponse, job, path=["response"]) + @parametrize def test_raw_response_create(self, client: Cloudflare) -> None: response = client.aisearch.instances.jobs.with_raw_response.create( @@ -274,6 +283,15 @@ async def test_method_create(self, async_client: AsyncCloudflare) -> None: ) assert_matches_type(JobCreateResponse, job, path=["response"]) + @parametrize + async def test_method_create_with_all_params(self, async_client: AsyncCloudflare) -> None: + job = await async_client.aisearch.instances.jobs.create( + id="my-ai-search", + account_id="c3dc5f0b34a14ff8e1b3ec04895e1b22", + description="description", + ) + assert_matches_type(JobCreateResponse, job, path=["response"]) + @parametrize async def test_raw_response_create(self, async_client: AsyncCloudflare) -> None: response = await async_client.aisearch.instances.jobs.with_raw_response.create( diff --git a/tests/api_resources/aisearch/test_instances.py b/tests/api_resources/aisearch/test_instances.py index e65fdf05082..ddfc0435184 100644 --- a/tests/api_resources/aisearch/test_instances.py +++ b/tests/api_resources/aisearch/test_instances.py @@ -32,8 +32,6 @@ def test_method_create(self, client: Cloudflare) -> None: instance = client.aisearch.instances.create( account_id="c3dc5f0b34a14ff8e1b3ec04895e1b22", id="my-ai-search", - source="source", - type="r2", ) assert_matches_type(InstanceCreateResponse, instance, path=["response"]) @@ -42,10 +40,10 @@ def test_method_create_with_all_params(self, client: Cloudflare) -> None: instance = client.aisearch.instances.create( account_id="c3dc5f0b34a14ff8e1b3ec04895e1b22", id="my-ai-search", - source="source", - type="r2", ai_gateway_id="ai_gateway_id", aisearch_model="@cf/meta/llama-3.3-70b-instruct-fp8-fast", + cache=True, + cache_threshold="super_strict_match", chunk=True, chunk_overlap=0, chunk_size=64, @@ -80,10 +78,19 @@ def test_method_create_with_all_params(self, client: Cloudflare) -> None: }, reranking=True, reranking_model="@cf/baai/bge-reranker-base", - retrieval_options={"keyword_match_mode": "exact_match"}, + retrieval_options={ + "boost_by": [ + { + "field": "timestamp", + "direction": "desc", + } + ], + "keyword_match_mode": "exact_match", + }, rewrite_model="@cf/meta/llama-3.3-70b-instruct-fp8-fast", rewrite_query=True, score_threshold=0, + source="source", source_params={ "exclude_items": ["/admin/**", "/private/**", "**\\temp\\**"], "include_items": ["/blog/**", "/docs/**/*.html", "**\\blog\\**.html"], @@ -91,6 +98,12 @@ def test_method_create_with_all_params(self, client: Cloudflare) -> None: "r2_jurisdiction": "r2_jurisdiction", "web_crawler": { "parse_options": { + "content_selector": [ + { + "path": "**/blog/**", + "selector": "article .post-body", + } + ], "include_headers": {"foo": "string"}, "include_images": True, "specific_sitemaps": [ @@ -108,6 +121,7 @@ def test_method_create_with_all_params(self, client: Cloudflare) -> None: }, }, token_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + type="r2", ) assert_matches_type(InstanceCreateResponse, instance, path=["response"]) @@ -116,8 +130,6 @@ def test_raw_response_create(self, client: Cloudflare) -> None: response = client.aisearch.instances.with_raw_response.create( account_id="c3dc5f0b34a14ff8e1b3ec04895e1b22", id="my-ai-search", - source="source", - type="r2", ) assert response.is_closed is True @@ -130,8 +142,6 @@ def test_streaming_response_create(self, client: Cloudflare) -> None: with client.aisearch.instances.with_streaming_response.create( account_id="c3dc5f0b34a14ff8e1b3ec04895e1b22", id="my-ai-search", - source="source", - type="r2", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -147,8 +157,6 @@ def test_path_params_create(self, client: Cloudflare) -> None: client.aisearch.instances.with_raw_response.create( account_id="", id="my-ai-search", - source="source", - type="r2", ) @parametrize @@ -203,7 +211,15 @@ def test_method_update_with_all_params(self, client: Cloudflare) -> None: }, reranking=True, reranking_model="@cf/baai/bge-reranker-base", - retrieval_options={"keyword_match_mode": "exact_match"}, + retrieval_options={ + "boost_by": [ + { + "field": "timestamp", + "direction": "desc", + } + ], + "keyword_match_mode": "exact_match", + }, rewrite_model="@cf/meta/llama-3.3-70b-instruct-fp8-fast", rewrite_query=True, score_threshold=0, @@ -214,6 +230,12 @@ def test_method_update_with_all_params(self, client: Cloudflare) -> None: "r2_jurisdiction": "r2_jurisdiction", "web_crawler": { "parse_options": { + "content_selector": [ + { + "path": "**/blog/**", + "selector": "article .post-body", + } + ], "include_headers": {"foo": "string"}, "include_images": True, "specific_sitemaps": [ @@ -290,6 +312,8 @@ def test_method_list(self, client: Cloudflare) -> None: def test_method_list_with_all_params(self, client: Cloudflare) -> None: instance = client.aisearch.instances.list( account_id="c3dc5f0b34a14ff8e1b3ec04895e1b22", + order_by="created_at", + order_by_direction="asc", page=1, per_page=1, search="search", @@ -412,6 +436,12 @@ def test_method_chat_completions_with_all_params(self, client: Cloudflare) -> No "model": "@cf/baai/bge-reranker-base", }, "retrieval": { + "boost_by": [ + { + "field": "timestamp", + "direction": "desc", + } + ], "context_expansion": 0, "filters": {"foo": "bar"}, "fusion_method": "max", @@ -576,6 +606,12 @@ def test_method_search_with_all_params(self, client: Cloudflare) -> None: "model": "@cf/baai/bge-reranker-base", }, "retrieval": { + "boost_by": [ + { + "field": "timestamp", + "direction": "desc", + } + ], "context_expansion": 0, "filters": {"foo": "bar"}, "fusion_method": "max", @@ -712,8 +748,6 @@ async def test_method_create(self, async_client: AsyncCloudflare) -> None: instance = await async_client.aisearch.instances.create( account_id="c3dc5f0b34a14ff8e1b3ec04895e1b22", id="my-ai-search", - source="source", - type="r2", ) assert_matches_type(InstanceCreateResponse, instance, path=["response"]) @@ -722,10 +756,10 @@ async def test_method_create_with_all_params(self, async_client: AsyncCloudflare instance = await async_client.aisearch.instances.create( account_id="c3dc5f0b34a14ff8e1b3ec04895e1b22", id="my-ai-search", - source="source", - type="r2", ai_gateway_id="ai_gateway_id", aisearch_model="@cf/meta/llama-3.3-70b-instruct-fp8-fast", + cache=True, + cache_threshold="super_strict_match", chunk=True, chunk_overlap=0, chunk_size=64, @@ -760,10 +794,19 @@ async def test_method_create_with_all_params(self, async_client: AsyncCloudflare }, reranking=True, reranking_model="@cf/baai/bge-reranker-base", - retrieval_options={"keyword_match_mode": "exact_match"}, + retrieval_options={ + "boost_by": [ + { + "field": "timestamp", + "direction": "desc", + } + ], + "keyword_match_mode": "exact_match", + }, rewrite_model="@cf/meta/llama-3.3-70b-instruct-fp8-fast", rewrite_query=True, score_threshold=0, + source="source", source_params={ "exclude_items": ["/admin/**", "/private/**", "**\\temp\\**"], "include_items": ["/blog/**", "/docs/**/*.html", "**\\blog\\**.html"], @@ -771,6 +814,12 @@ async def test_method_create_with_all_params(self, async_client: AsyncCloudflare "r2_jurisdiction": "r2_jurisdiction", "web_crawler": { "parse_options": { + "content_selector": [ + { + "path": "**/blog/**", + "selector": "article .post-body", + } + ], "include_headers": {"foo": "string"}, "include_images": True, "specific_sitemaps": [ @@ -788,6 +837,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncCloudflare }, }, token_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", + type="r2", ) assert_matches_type(InstanceCreateResponse, instance, path=["response"]) @@ -796,8 +846,6 @@ async def test_raw_response_create(self, async_client: AsyncCloudflare) -> None: response = await async_client.aisearch.instances.with_raw_response.create( account_id="c3dc5f0b34a14ff8e1b3ec04895e1b22", id="my-ai-search", - source="source", - type="r2", ) assert response.is_closed is True @@ -810,8 +858,6 @@ async def test_streaming_response_create(self, async_client: AsyncCloudflare) -> async with async_client.aisearch.instances.with_streaming_response.create( account_id="c3dc5f0b34a14ff8e1b3ec04895e1b22", id="my-ai-search", - source="source", - type="r2", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -827,8 +873,6 @@ async def test_path_params_create(self, async_client: AsyncCloudflare) -> None: await async_client.aisearch.instances.with_raw_response.create( account_id="", id="my-ai-search", - source="source", - type="r2", ) @parametrize @@ -883,7 +927,15 @@ async def test_method_update_with_all_params(self, async_client: AsyncCloudflare }, reranking=True, reranking_model="@cf/baai/bge-reranker-base", - retrieval_options={"keyword_match_mode": "exact_match"}, + retrieval_options={ + "boost_by": [ + { + "field": "timestamp", + "direction": "desc", + } + ], + "keyword_match_mode": "exact_match", + }, rewrite_model="@cf/meta/llama-3.3-70b-instruct-fp8-fast", rewrite_query=True, score_threshold=0, @@ -894,6 +946,12 @@ async def test_method_update_with_all_params(self, async_client: AsyncCloudflare "r2_jurisdiction": "r2_jurisdiction", "web_crawler": { "parse_options": { + "content_selector": [ + { + "path": "**/blog/**", + "selector": "article .post-body", + } + ], "include_headers": {"foo": "string"}, "include_images": True, "specific_sitemaps": [ @@ -970,6 +1028,8 @@ async def test_method_list(self, async_client: AsyncCloudflare) -> None: async def test_method_list_with_all_params(self, async_client: AsyncCloudflare) -> None: instance = await async_client.aisearch.instances.list( account_id="c3dc5f0b34a14ff8e1b3ec04895e1b22", + order_by="created_at", + order_by_direction="asc", page=1, per_page=1, search="search", @@ -1092,6 +1152,12 @@ async def test_method_chat_completions_with_all_params(self, async_client: Async "model": "@cf/baai/bge-reranker-base", }, "retrieval": { + "boost_by": [ + { + "field": "timestamp", + "direction": "desc", + } + ], "context_expansion": 0, "filters": {"foo": "bar"}, "fusion_method": "max", @@ -1256,6 +1322,12 @@ async def test_method_search_with_all_params(self, async_client: AsyncCloudflare "model": "@cf/baai/bge-reranker-base", }, "retrieval": { + "boost_by": [ + { + "field": "timestamp", + "direction": "desc", + } + ], "context_expansion": 0, "filters": {"foo": "bar"}, "fusion_method": "max", diff --git a/tests/api_resources/aisearch/test_tokens.py b/tests/api_resources/aisearch/test_tokens.py index 92ab27fd1db..1090f0fb388 100644 --- a/tests/api_resources/aisearch/test_tokens.py +++ b/tests/api_resources/aisearch/test_tokens.py @@ -148,6 +148,8 @@ def test_method_list(self, client: Cloudflare) -> None: def test_method_list_with_all_params(self, client: Cloudflare) -> None: token = client.aisearch.tokens.list( account_id="c3dc5f0b34a14ff8e1b3ec04895e1b22", + order_by="created_at", + order_by_direction="asc", page=1, per_page=1, ) @@ -410,6 +412,8 @@ async def test_method_list(self, async_client: AsyncCloudflare) -> None: async def test_method_list_with_all_params(self, async_client: AsyncCloudflare) -> None: token = await async_client.aisearch.tokens.list( account_id="c3dc5f0b34a14ff8e1b3ec04895e1b22", + order_by="created_at", + order_by_direction="asc", page=1, per_page=1, ) diff --git a/tests/api_resources/email_security/test_investigate.py b/tests/api_resources/email_security/test_investigate.py index 641cd669ad2..2368a3500c3 100644 --- a/tests/api_resources/email_security/test_investigate.py +++ b/tests/api_resources/email_security/test_investigate.py @@ -36,6 +36,7 @@ def test_method_list_with_all_params(self, client: Cloudflare) -> None: detections_only=True, domain="domain", end=parse_datetime("2019-12-27T18:11:19.117Z"), + exact_subject="exact_subject", final_disposition="MALICIOUS", message_action="PREVIEW", message_id="message_id", @@ -152,6 +153,7 @@ async def test_method_list_with_all_params(self, async_client: AsyncCloudflare) detections_only=True, domain="domain", end=parse_datetime("2019-12-27T18:11:19.117Z"), + exact_subject="exact_subject", final_disposition="MALICIOUS", message_action="PREVIEW", message_id="message_id", diff --git a/tests/api_resources/email_security/test_submissions.py b/tests/api_resources/email_security/test_submissions.py index 0645b94fd7a..5c6e59faee4 100644 --- a/tests/api_resources/email_security/test_submissions.py +++ b/tests/api_resources/email_security/test_submissions.py @@ -30,6 +30,7 @@ def test_method_list(self, client: Cloudflare) -> None: def test_method_list_with_all_params(self, client: Cloudflare) -> None: submission = client.email_security.submissions.list( account_id="023e105f4ecef8ad9ca31a8372d0c353", + customer_status="escalated", end=parse_datetime("2019-12-27T18:11:19.117Z"), original_disposition="MALICIOUS", outcome_disposition="MALICIOUS", @@ -92,6 +93,7 @@ async def test_method_list(self, async_client: AsyncCloudflare) -> None: async def test_method_list_with_all_params(self, async_client: AsyncCloudflare) -> None: submission = await async_client.email_security.submissions.list( account_id="023e105f4ecef8ad9ca31a8372d0c353", + customer_status="escalated", end=parse_datetime("2019-12-27T18:11:19.117Z"), original_disposition="MALICIOUS", outcome_disposition="MALICIOUS", diff --git a/tests/api_resources/magic_transit/sites/test_lans.py b/tests/api_resources/magic_transit/sites/test_lans.py index 967a5ba1c41..b5b9d2a9bc3 100644 --- a/tests/api_resources/magic_transit/sites/test_lans.py +++ b/tests/api_resources/magic_transit/sites/test_lans.py @@ -35,6 +35,8 @@ def test_method_create_with_all_params(self, client: Cloudflare) -> None: account_id="023e105f4ecef8ad9ca31a8372d0c353", bond_id=2, ha_link=True, + is_breakout=True, + is_prioritized=True, name="name", nat={"static_prefix": "192.0.2.0/24"}, physport=1, @@ -121,6 +123,8 @@ def test_method_update_with_all_params(self, client: Cloudflare) -> None: account_id="023e105f4ecef8ad9ca31a8372d0c353", site_id="023e105f4ecef8ad9ca31a8372d0c353", bond_id=2, + is_breakout=True, + is_prioritized=True, name="name", nat={"static_prefix": "192.0.2.0/24"}, physport=1, @@ -326,6 +330,8 @@ def test_method_edit_with_all_params(self, client: Cloudflare) -> None: account_id="023e105f4ecef8ad9ca31a8372d0c353", site_id="023e105f4ecef8ad9ca31a8372d0c353", bond_id=2, + is_breakout=True, + is_prioritized=True, name="name", nat={"static_prefix": "192.0.2.0/24"}, physport=1, @@ -488,6 +494,8 @@ async def test_method_create_with_all_params(self, async_client: AsyncCloudflare account_id="023e105f4ecef8ad9ca31a8372d0c353", bond_id=2, ha_link=True, + is_breakout=True, + is_prioritized=True, name="name", nat={"static_prefix": "192.0.2.0/24"}, physport=1, @@ -574,6 +582,8 @@ async def test_method_update_with_all_params(self, async_client: AsyncCloudflare account_id="023e105f4ecef8ad9ca31a8372d0c353", site_id="023e105f4ecef8ad9ca31a8372d0c353", bond_id=2, + is_breakout=True, + is_prioritized=True, name="name", nat={"static_prefix": "192.0.2.0/24"}, physport=1, @@ -779,6 +789,8 @@ async def test_method_edit_with_all_params(self, async_client: AsyncCloudflare) account_id="023e105f4ecef8ad9ca31a8372d0c353", site_id="023e105f4ecef8ad9ca31a8372d0c353", bond_id=2, + is_breakout=True, + is_prioritized=True, name="name", nat={"static_prefix": "192.0.2.0/24"}, physport=1, diff --git a/tests/api_resources/magic_transit/test_apps.py b/tests/api_resources/magic_transit/test_apps.py index bfa9adeceb6..688d2516556 100644 --- a/tests/api_resources/magic_transit/test_apps.py +++ b/tests/api_resources/magic_transit/test_apps.py @@ -47,6 +47,7 @@ def test_method_create_with_all_params(self, client: Cloudflare) -> None: type="Development", hostnames=["auth.cloudflare.com"], ip_subnets=["192.0.2.0/24"], + source_subnets=["192.0.2.0/24"], ) assert_matches_type(Optional[AppCreateResponse], app, path=["response"]) @@ -118,6 +119,7 @@ def test_method_update_with_all_params(self, client: Cloudflare) -> None: hostnames=["auth.cloudflare.com"], ip_subnets=["1.1.1.1/32"], name="Cloudflare Dashboard", + source_subnets=["1.1.1.1/32"], type="Development", ) assert_matches_type(Optional[AppUpdateResponse], app, path=["response"]) @@ -291,6 +293,7 @@ def test_method_edit_with_all_params(self, client: Cloudflare) -> None: hostnames=["auth.cloudflare.com"], ip_subnets=["1.1.1.1/32"], name="Cloudflare Dashboard", + source_subnets=["1.1.1.1/32"], type="Development", ) assert_matches_type(Optional[AppEditResponse], app, path=["response"]) @@ -373,6 +376,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncCloudflare type="Development", hostnames=["auth.cloudflare.com"], ip_subnets=["192.0.2.0/24"], + source_subnets=["192.0.2.0/24"], ) assert_matches_type(Optional[AppCreateResponse], app, path=["response"]) @@ -444,6 +448,7 @@ async def test_method_update_with_all_params(self, async_client: AsyncCloudflare hostnames=["auth.cloudflare.com"], ip_subnets=["1.1.1.1/32"], name="Cloudflare Dashboard", + source_subnets=["1.1.1.1/32"], type="Development", ) assert_matches_type(Optional[AppUpdateResponse], app, path=["response"]) @@ -617,6 +622,7 @@ async def test_method_edit_with_all_params(self, async_client: AsyncCloudflare) hostnames=["auth.cloudflare.com"], ip_subnets=["1.1.1.1/32"], name="Cloudflare Dashboard", + source_subnets=["1.1.1.1/32"], type="Development", ) assert_matches_type(Optional[AppEditResponse], app, path=["response"]) diff --git a/tests/api_resources/magic_transit/test_connectors.py b/tests/api_resources/magic_transit/test_connectors.py index 77bb1d77052..17cf666175a 100644 --- a/tests/api_resources/magic_transit/test_connectors.py +++ b/tests/api_resources/magic_transit/test_connectors.py @@ -49,7 +49,9 @@ def test_method_create_with_all_params(self, client: Cloudflare) -> None: "serial_number": "serial_number", }, activated=True, - interrupt_window_duration_hours=0, + interrupt_window_days_of_week=["Sunday"], + interrupt_window_duration_hours=1, + interrupt_window_embargo_dates=["string"], interrupt_window_hour_of_day=0, notes="notes", timezone="timezone", @@ -113,7 +115,9 @@ def test_method_update_with_all_params(self, client: Cloudflare) -> None: connector_id="connector_id", account_id="023e105f4ecef8ad9ca31a8372d0c353", activated=True, - interrupt_window_duration_hours=0, + interrupt_window_days_of_week=["Sunday"], + interrupt_window_duration_hours=1, + interrupt_window_embargo_dates=["string"], interrupt_window_hour_of_day=0, notes="notes", provision_license=True, @@ -261,7 +265,9 @@ def test_method_edit_with_all_params(self, client: Cloudflare) -> None: connector_id="connector_id", account_id="023e105f4ecef8ad9ca31a8372d0c353", activated=True, - interrupt_window_duration_hours=0, + interrupt_window_days_of_week=["Sunday"], + interrupt_window_duration_hours=1, + interrupt_window_embargo_dates=["string"], interrupt_window_hour_of_day=0, notes="notes", provision_license=True, @@ -387,7 +393,9 @@ async def test_method_create_with_all_params(self, async_client: AsyncCloudflare "serial_number": "serial_number", }, activated=True, - interrupt_window_duration_hours=0, + interrupt_window_days_of_week=["Sunday"], + interrupt_window_duration_hours=1, + interrupt_window_embargo_dates=["string"], interrupt_window_hour_of_day=0, notes="notes", timezone="timezone", @@ -451,7 +459,9 @@ async def test_method_update_with_all_params(self, async_client: AsyncCloudflare connector_id="connector_id", account_id="023e105f4ecef8ad9ca31a8372d0c353", activated=True, - interrupt_window_duration_hours=0, + interrupt_window_days_of_week=["Sunday"], + interrupt_window_duration_hours=1, + interrupt_window_embargo_dates=["string"], interrupt_window_hour_of_day=0, notes="notes", provision_license=True, @@ -599,7 +609,9 @@ async def test_method_edit_with_all_params(self, async_client: AsyncCloudflare) connector_id="connector_id", account_id="023e105f4ecef8ad9ca31a8372d0c353", activated=True, - interrupt_window_duration_hours=0, + interrupt_window_days_of_week=["Sunday"], + interrupt_window_duration_hours=1, + interrupt_window_embargo_dates=["string"], interrupt_window_hour_of_day=0, notes="notes", provision_license=True, diff --git a/tests/api_resources/radar/ai/test_inference.py b/tests/api_resources/radar/ai/test_inference.py index f9da17395a9..331b1934fd8 100644 --- a/tests/api_resources/radar/ai/test_inference.py +++ b/tests/api_resources/radar/ai/test_inference.py @@ -89,7 +89,7 @@ def test_method_timeseries_groups_v2_with_all_params(self, client: Cloudflare) - limit_per_group=10, location=["string"], name=["main_series"], - normalization="MIN0_MAX", + normalization="PERCENTAGE", ) assert_matches_type(InferenceTimeseriesGroupsV2Response, inference, path=["response"]) @@ -191,7 +191,7 @@ async def test_method_timeseries_groups_v2_with_all_params(self, async_client: A limit_per_group=10, location=["string"], name=["main_series"], - normalization="MIN0_MAX", + normalization="PERCENTAGE", ) assert_matches_type(InferenceTimeseriesGroupsV2Response, inference, path=["response"]) diff --git a/tests/api_resources/radar/test_dns.py b/tests/api_resources/radar/test_dns.py index 9d11fe15abb..f863244f5b0 100644 --- a/tests/api_resources/radar/test_dns.py +++ b/tests/api_resources/radar/test_dns.py @@ -25,14 +25,14 @@ class TestDNS: @parametrize def test_method_summary_v2(self, client: Cloudflare) -> None: dns = client.radar.dns.summary_v2( - dimension="IP_VERSION", + dimension="AS", ) assert_matches_type(DNSSummaryV2Response, dns, path=["response"]) @parametrize def test_method_summary_v2_with_all_params(self, client: Cloudflare) -> None: dns = client.radar.dns.summary_v2( - dimension="IP_VERSION", + dimension="AS", asn=["string"], cache_hit=[True], continent=["string"], @@ -60,7 +60,7 @@ def test_method_summary_v2_with_all_params(self, client: Cloudflare) -> None: @parametrize def test_raw_response_summary_v2(self, client: Cloudflare) -> None: response = client.radar.dns.with_raw_response.summary_v2( - dimension="IP_VERSION", + dimension="AS", ) assert response.is_closed is True @@ -71,7 +71,7 @@ def test_raw_response_summary_v2(self, client: Cloudflare) -> None: @parametrize def test_streaming_response_summary_v2(self, client: Cloudflare) -> None: with client.radar.dns.with_streaming_response.summary_v2( - dimension="IP_VERSION", + dimension="AS", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -136,14 +136,14 @@ def test_streaming_response_timeseries(self, client: Cloudflare) -> None: @parametrize def test_method_timeseries_groups_v2(self, client: Cloudflare) -> None: dns = client.radar.dns.timeseries_groups_v2( - dimension="IP_VERSION", + dimension="AS", ) assert_matches_type(DNSTimeseriesGroupsV2Response, dns, path=["response"]) @parametrize def test_method_timeseries_groups_v2_with_all_params(self, client: Cloudflare) -> None: dns = client.radar.dns.timeseries_groups_v2( - dimension="IP_VERSION", + dimension="AS", agg_interval="1h", asn=["string"], cache_hit=[True], @@ -173,7 +173,7 @@ def test_method_timeseries_groups_v2_with_all_params(self, client: Cloudflare) - @parametrize def test_raw_response_timeseries_groups_v2(self, client: Cloudflare) -> None: response = client.radar.dns.with_raw_response.timeseries_groups_v2( - dimension="IP_VERSION", + dimension="AS", ) assert response.is_closed is True @@ -184,7 +184,7 @@ def test_raw_response_timeseries_groups_v2(self, client: Cloudflare) -> None: @parametrize def test_streaming_response_timeseries_groups_v2(self, client: Cloudflare) -> None: with client.radar.dns.with_streaming_response.timeseries_groups_v2( - dimension="IP_VERSION", + dimension="AS", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -203,14 +203,14 @@ class TestAsyncDNS: @parametrize async def test_method_summary_v2(self, async_client: AsyncCloudflare) -> None: dns = await async_client.radar.dns.summary_v2( - dimension="IP_VERSION", + dimension="AS", ) assert_matches_type(DNSSummaryV2Response, dns, path=["response"]) @parametrize async def test_method_summary_v2_with_all_params(self, async_client: AsyncCloudflare) -> None: dns = await async_client.radar.dns.summary_v2( - dimension="IP_VERSION", + dimension="AS", asn=["string"], cache_hit=[True], continent=["string"], @@ -238,7 +238,7 @@ async def test_method_summary_v2_with_all_params(self, async_client: AsyncCloudf @parametrize async def test_raw_response_summary_v2(self, async_client: AsyncCloudflare) -> None: response = await async_client.radar.dns.with_raw_response.summary_v2( - dimension="IP_VERSION", + dimension="AS", ) assert response.is_closed is True @@ -249,7 +249,7 @@ async def test_raw_response_summary_v2(self, async_client: AsyncCloudflare) -> N @parametrize async def test_streaming_response_summary_v2(self, async_client: AsyncCloudflare) -> None: async with async_client.radar.dns.with_streaming_response.summary_v2( - dimension="IP_VERSION", + dimension="AS", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -314,14 +314,14 @@ async def test_streaming_response_timeseries(self, async_client: AsyncCloudflare @parametrize async def test_method_timeseries_groups_v2(self, async_client: AsyncCloudflare) -> None: dns = await async_client.radar.dns.timeseries_groups_v2( - dimension="IP_VERSION", + dimension="AS", ) assert_matches_type(DNSTimeseriesGroupsV2Response, dns, path=["response"]) @parametrize async def test_method_timeseries_groups_v2_with_all_params(self, async_client: AsyncCloudflare) -> None: dns = await async_client.radar.dns.timeseries_groups_v2( - dimension="IP_VERSION", + dimension="AS", agg_interval="1h", asn=["string"], cache_hit=[True], @@ -351,7 +351,7 @@ async def test_method_timeseries_groups_v2_with_all_params(self, async_client: A @parametrize async def test_raw_response_timeseries_groups_v2(self, async_client: AsyncCloudflare) -> None: response = await async_client.radar.dns.with_raw_response.timeseries_groups_v2( - dimension="IP_VERSION", + dimension="AS", ) assert response.is_closed is True @@ -362,7 +362,7 @@ async def test_raw_response_timeseries_groups_v2(self, async_client: AsyncCloudf @parametrize async def test_streaming_response_timeseries_groups_v2(self, async_client: AsyncCloudflare) -> None: async with async_client.radar.dns.with_streaming_response.timeseries_groups_v2( - dimension="IP_VERSION", + dimension="AS", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" diff --git a/tests/api_resources/rulesets/test_rules.py b/tests/api_resources/rulesets/test_rules.py index a15cd560be1..5d0a23444f9 100644 --- a/tests/api_resources/rulesets/test_rules.py +++ b/tests/api_resources/rulesets/test_rules.py @@ -1467,6 +1467,155 @@ def test_method_create_overload_16(self, client: Cloudflare) -> None: @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize def test_method_create_with_all_params_overload_16(self, client: Cloudflare) -> None: + rule = client.rulesets.rules.create( + ruleset_id="2f2feab2026849078ba485f918791bdc", + account_id="account_id", + id="3a03d665bac047339bb530ecb439a90d", + action="set_cache_control", + action_parameters={ + "immutable": { + "operation": "set", + "cloudflare_only": False, + }, + "max_age": { + "operation": "set", + "value": 3600, + "cloudflare_only": False, + }, + "must_revalidate": { + "operation": "set", + "cloudflare_only": False, + }, + "must_understand": { + "operation": "set", + "cloudflare_only": False, + }, + "no_cache": { + "operation": "set", + "cloudflare_only": False, + "qualifiers": ["X-Custom-Header"], + }, + "no_store": { + "operation": "set", + "cloudflare_only": False, + }, + "no_transform": { + "operation": "set", + "cloudflare_only": False, + }, + "private": { + "operation": "set", + "cloudflare_only": False, + "qualifiers": ["X-Custom-Header"], + }, + "proxy_revalidate": { + "operation": "set", + "cloudflare_only": False, + }, + "public": { + "operation": "set", + "cloudflare_only": False, + }, + "s_maxage": { + "operation": "set", + "value": 3600, + "cloudflare_only": False, + }, + "stale_if_error": { + "operation": "set", + "value": 3600, + "cloudflare_only": False, + }, + "stale_while_revalidate": { + "operation": "set", + "value": 3600, + "cloudflare_only": False, + }, + }, + description="Modify the cache-control header directives in an Origin response.", + enabled=True, + exposed_credential_check={ + "password_expression": 'url_decode(http.request.body.form[\\"password\\"][0])', + "username_expression": 'url_decode(http.request.body.form[\\"username\\"][0])', + }, + expression="ip.src eq 1.1.1.1", + logging={"enabled": True}, + position={"before": "da5e8e506c8e7877fe06cdf4c41add54"}, + ratelimit={ + "characteristics": ["cf.colo.id"], + "period": 60, + "counting_expression": 'http.request.body.raw eq "abcd"', + "mitigation_timeout": 600, + "requests_per_period": 1000, + "requests_to_origin": True, + "score_per_period": 400, + "score_response_header_name": "my-score", + }, + ref="my_ref", + ) + assert_matches_type(RuleCreateResponse, rule, path=["response"]) + + @pytest.mark.skip(reason="TODO: investigate broken test") + @parametrize + def test_raw_response_create_overload_16(self, client: Cloudflare) -> None: + response = client.rulesets.rules.with_raw_response.create( + ruleset_id="2f2feab2026849078ba485f918791bdc", + account_id="account_id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + rule = response.parse() + assert_matches_type(RuleCreateResponse, rule, path=["response"]) + + @pytest.mark.skip(reason="TODO: investigate broken test") + @parametrize + def test_streaming_response_create_overload_16(self, client: Cloudflare) -> None: + with client.rulesets.rules.with_streaming_response.create( + ruleset_id="2f2feab2026849078ba485f918791bdc", + account_id="account_id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + rule = response.parse() + assert_matches_type(RuleCreateResponse, rule, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip(reason="TODO: investigate broken test") + @parametrize + def test_path_params_create_overload_16(self, client: Cloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `ruleset_id` but received ''"): + client.rulesets.rules.with_raw_response.create( + ruleset_id="", + account_id="account_id", + ) + + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): + client.rulesets.rules.with_raw_response.create( + ruleset_id="2f2feab2026849078ba485f918791bdc", + account_id="", + ) + + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): + client.rulesets.rules.with_raw_response.create( + ruleset_id="2f2feab2026849078ba485f918791bdc", + account_id="account_id", + ) + + @pytest.mark.skip(reason="TODO: investigate broken test") + @parametrize + def test_method_create_overload_17(self, client: Cloudflare) -> None: + rule = client.rulesets.rules.create( + ruleset_id="2f2feab2026849078ba485f918791bdc", + account_id="account_id", + ) + assert_matches_type(RuleCreateResponse, rule, path=["response"]) + + @pytest.mark.skip(reason="TODO: investigate broken test") + @parametrize + def test_method_create_with_all_params_overload_17(self, client: Cloudflare) -> None: rule = client.rulesets.rules.create( ruleset_id="2f2feab2026849078ba485f918791bdc", account_id="account_id", @@ -1535,6 +1684,9 @@ def test_method_create_with_all_params_overload_16(self, client: Cloudflare) -> "read_timeout": 900, "respect_strong_etags": True, "serve_stale": {"disable_stale_while_updating": True}, + "strip_etags": True, + "strip_last_modified": True, + "strip_set_cookie": True, }, description="Configure settings for how the response is cached.", enabled=True, @@ -1561,7 +1713,7 @@ def test_method_create_with_all_params_overload_16(self, client: Cloudflare) -> @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize - def test_raw_response_create_overload_16(self, client: Cloudflare) -> None: + def test_raw_response_create_overload_17(self, client: Cloudflare) -> None: response = client.rulesets.rules.with_raw_response.create( ruleset_id="2f2feab2026849078ba485f918791bdc", account_id="account_id", @@ -1574,7 +1726,7 @@ def test_raw_response_create_overload_16(self, client: Cloudflare) -> None: @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize - def test_streaming_response_create_overload_16(self, client: Cloudflare) -> None: + def test_streaming_response_create_overload_17(self, client: Cloudflare) -> None: with client.rulesets.rules.with_streaming_response.create( ruleset_id="2f2feab2026849078ba485f918791bdc", account_id="account_id", @@ -1589,7 +1741,7 @@ def test_streaming_response_create_overload_16(self, client: Cloudflare) -> None @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize - def test_path_params_create_overload_16(self, client: Cloudflare) -> None: + def test_path_params_create_overload_17(self, client: Cloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `ruleset_id` but received ''"): client.rulesets.rules.with_raw_response.create( ruleset_id="", @@ -1610,7 +1762,7 @@ def test_path_params_create_overload_16(self, client: Cloudflare) -> None: @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize - def test_method_create_overload_17(self, client: Cloudflare) -> None: + def test_method_create_overload_18(self, client: Cloudflare) -> None: rule = client.rulesets.rules.create( ruleset_id="2f2feab2026849078ba485f918791bdc", account_id="account_id", @@ -1619,7 +1771,100 @@ def test_method_create_overload_17(self, client: Cloudflare) -> None: @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize - def test_method_create_with_all_params_overload_17(self, client: Cloudflare) -> None: + def test_method_create_with_all_params_overload_18(self, client: Cloudflare) -> None: + rule = client.rulesets.rules.create( + ruleset_id="2f2feab2026849078ba485f918791bdc", + account_id="account_id", + id="3a03d665bac047339bb530ecb439a90d", + action="set_cache_tags", + action_parameters={ + "operation": "add", + "values": ["my-cache-tag"], + }, + description="Modify the cache tags associated with the response.", + enabled=True, + exposed_credential_check={ + "password_expression": 'url_decode(http.request.body.form[\\"password\\"][0])', + "username_expression": 'url_decode(http.request.body.form[\\"username\\"][0])', + }, + expression="ip.src eq 1.1.1.1", + logging={"enabled": True}, + position={"before": "da5e8e506c8e7877fe06cdf4c41add54"}, + ratelimit={ + "characteristics": ["cf.colo.id"], + "period": 60, + "counting_expression": 'http.request.body.raw eq "abcd"', + "mitigation_timeout": 600, + "requests_per_period": 1000, + "requests_to_origin": True, + "score_per_period": 400, + "score_response_header_name": "my-score", + }, + ref="my_ref", + ) + assert_matches_type(RuleCreateResponse, rule, path=["response"]) + + @pytest.mark.skip(reason="TODO: investigate broken test") + @parametrize + def test_raw_response_create_overload_18(self, client: Cloudflare) -> None: + response = client.rulesets.rules.with_raw_response.create( + ruleset_id="2f2feab2026849078ba485f918791bdc", + account_id="account_id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + rule = response.parse() + assert_matches_type(RuleCreateResponse, rule, path=["response"]) + + @pytest.mark.skip(reason="TODO: investigate broken test") + @parametrize + def test_streaming_response_create_overload_18(self, client: Cloudflare) -> None: + with client.rulesets.rules.with_streaming_response.create( + ruleset_id="2f2feab2026849078ba485f918791bdc", + account_id="account_id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + rule = response.parse() + assert_matches_type(RuleCreateResponse, rule, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip(reason="TODO: investigate broken test") + @parametrize + def test_path_params_create_overload_18(self, client: Cloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `ruleset_id` but received ''"): + client.rulesets.rules.with_raw_response.create( + ruleset_id="", + account_id="account_id", + ) + + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): + client.rulesets.rules.with_raw_response.create( + ruleset_id="2f2feab2026849078ba485f918791bdc", + account_id="", + ) + + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): + client.rulesets.rules.with_raw_response.create( + ruleset_id="2f2feab2026849078ba485f918791bdc", + account_id="account_id", + ) + + @pytest.mark.skip(reason="TODO: investigate broken test") + @parametrize + def test_method_create_overload_19(self, client: Cloudflare) -> None: + rule = client.rulesets.rules.create( + ruleset_id="2f2feab2026849078ba485f918791bdc", + account_id="account_id", + ) + assert_matches_type(RuleCreateResponse, rule, path=["response"]) + + @pytest.mark.skip(reason="TODO: investigate broken test") + @parametrize + def test_method_create_with_all_params_overload_19(self, client: Cloudflare) -> None: rule = client.rulesets.rules.create( ruleset_id="2f2feab2026849078ba485f918791bdc", account_id="account_id", @@ -1677,7 +1922,7 @@ def test_method_create_with_all_params_overload_17(self, client: Cloudflare) -> @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize - def test_raw_response_create_overload_17(self, client: Cloudflare) -> None: + def test_raw_response_create_overload_19(self, client: Cloudflare) -> None: response = client.rulesets.rules.with_raw_response.create( ruleset_id="2f2feab2026849078ba485f918791bdc", account_id="account_id", @@ -1690,7 +1935,7 @@ def test_raw_response_create_overload_17(self, client: Cloudflare) -> None: @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize - def test_streaming_response_create_overload_17(self, client: Cloudflare) -> None: + def test_streaming_response_create_overload_19(self, client: Cloudflare) -> None: with client.rulesets.rules.with_streaming_response.create( ruleset_id="2f2feab2026849078ba485f918791bdc", account_id="account_id", @@ -1705,7 +1950,7 @@ def test_streaming_response_create_overload_17(self, client: Cloudflare) -> None @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize - def test_path_params_create_overload_17(self, client: Cloudflare) -> None: + def test_path_params_create_overload_19(self, client: Cloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `ruleset_id` but received ''"): client.rulesets.rules.with_raw_response.create( ruleset_id="", @@ -1726,7 +1971,7 @@ def test_path_params_create_overload_17(self, client: Cloudflare) -> None: @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize - def test_method_create_overload_18(self, client: Cloudflare) -> None: + def test_method_create_overload_20(self, client: Cloudflare) -> None: rule = client.rulesets.rules.create( ruleset_id="2f2feab2026849078ba485f918791bdc", account_id="account_id", @@ -1735,7 +1980,7 @@ def test_method_create_overload_18(self, client: Cloudflare) -> None: @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize - def test_method_create_with_all_params_overload_18(self, client: Cloudflare) -> None: + def test_method_create_with_all_params_overload_20(self, client: Cloudflare) -> None: rule = client.rulesets.rules.create( ruleset_id="2f2feab2026849078ba485f918791bdc", account_id="account_id", @@ -1774,7 +2019,7 @@ def test_method_create_with_all_params_overload_18(self, client: Cloudflare) -> @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize - def test_raw_response_create_overload_18(self, client: Cloudflare) -> None: + def test_raw_response_create_overload_20(self, client: Cloudflare) -> None: response = client.rulesets.rules.with_raw_response.create( ruleset_id="2f2feab2026849078ba485f918791bdc", account_id="account_id", @@ -1787,7 +2032,7 @@ def test_raw_response_create_overload_18(self, client: Cloudflare) -> None: @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize - def test_streaming_response_create_overload_18(self, client: Cloudflare) -> None: + def test_streaming_response_create_overload_20(self, client: Cloudflare) -> None: with client.rulesets.rules.with_streaming_response.create( ruleset_id="2f2feab2026849078ba485f918791bdc", account_id="account_id", @@ -1802,7 +2047,7 @@ def test_streaming_response_create_overload_18(self, client: Cloudflare) -> None @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize - def test_path_params_create_overload_18(self, client: Cloudflare) -> None: + def test_path_params_create_overload_20(self, client: Cloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `ruleset_id` but received ''"): client.rulesets.rules.with_raw_response.create( ruleset_id="", @@ -3564,59 +3809,222 @@ def test_method_edit_with_all_params_overload_16(self, client: Cloudflare) -> No ruleset_id="2f2feab2026849078ba485f918791bdc", account_id="account_id", id="3a03d665bac047339bb530ecb439a90d", - action="set_cache_settings", + action="set_cache_control", action_parameters={ - "additional_cacheable_ports": [8080], - "browser_ttl": { - "mode": "override_origin", - "default": 60, + "immutable": { + "operation": "set", + "cloudflare_only": False, }, - "cache": True, - "cache_key": { - "cache_by_device_type": True, - "cache_deception_armor": True, - "custom_key": { - "cookie": { - "check_presence": ["myCookie"], - "include": ["myCookie"], - }, - "header": { - "check_presence": ["my-header"], - "contains": {"my-header": ["my-header-value-1", "my-header-value-2"]}, - "exclude_origin": True, - "include": ["my-header"], - }, - "host": {"resolved": True}, - "query_string": { - "exclude": { - "all": True, - "list": ["foo"], - }, - "include": { - "all": True, - "list": ["foo"], - }, - }, - "user": { - "device_type": True, - "geo": True, - "lang": True, - }, - }, - "ignore_query_strings_order": True, + "max_age": { + "operation": "set", + "value": 3600, + "cloudflare_only": False, }, - "cache_reserve": { - "eligible": True, - "minimum_file_size": 1024, + "must_revalidate": { + "operation": "set", + "cloudflare_only": False, }, - "edge_ttl": { - "mode": "override_origin", - "default": 60, - "status_code_ttl": [ - { - "value": 0, - "status_code": 200, - "status_code_range": { + "must_understand": { + "operation": "set", + "cloudflare_only": False, + }, + "no_cache": { + "operation": "set", + "cloudflare_only": False, + "qualifiers": ["X-Custom-Header"], + }, + "no_store": { + "operation": "set", + "cloudflare_only": False, + }, + "no_transform": { + "operation": "set", + "cloudflare_only": False, + }, + "private": { + "operation": "set", + "cloudflare_only": False, + "qualifiers": ["X-Custom-Header"], + }, + "proxy_revalidate": { + "operation": "set", + "cloudflare_only": False, + }, + "public": { + "operation": "set", + "cloudflare_only": False, + }, + "s_maxage": { + "operation": "set", + "value": 3600, + "cloudflare_only": False, + }, + "stale_if_error": { + "operation": "set", + "value": 3600, + "cloudflare_only": False, + }, + "stale_while_revalidate": { + "operation": "set", + "value": 3600, + "cloudflare_only": False, + }, + }, + description="Modify the cache-control header directives in an Origin response.", + enabled=True, + exposed_credential_check={ + "password_expression": 'url_decode(http.request.body.form[\\"password\\"][0])', + "username_expression": 'url_decode(http.request.body.form[\\"username\\"][0])', + }, + expression="ip.src eq 1.1.1.1", + logging={"enabled": True}, + position={"before": "da5e8e506c8e7877fe06cdf4c41add54"}, + ratelimit={ + "characteristics": ["cf.colo.id"], + "period": 60, + "counting_expression": 'http.request.body.raw eq "abcd"', + "mitigation_timeout": 600, + "requests_per_period": 1000, + "requests_to_origin": True, + "score_per_period": 400, + "score_response_header_name": "my-score", + }, + ref="my_ref", + ) + assert_matches_type(RuleEditResponse, rule, path=["response"]) + + @pytest.mark.skip(reason="TODO: investigate broken test") + @parametrize + def test_raw_response_edit_overload_16(self, client: Cloudflare) -> None: + response = client.rulesets.rules.with_raw_response.edit( + rule_id="3a03d665bac047339bb530ecb439a90d", + ruleset_id="2f2feab2026849078ba485f918791bdc", + account_id="account_id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + rule = response.parse() + assert_matches_type(RuleEditResponse, rule, path=["response"]) + + @pytest.mark.skip(reason="TODO: investigate broken test") + @parametrize + def test_streaming_response_edit_overload_16(self, client: Cloudflare) -> None: + with client.rulesets.rules.with_streaming_response.edit( + rule_id="3a03d665bac047339bb530ecb439a90d", + ruleset_id="2f2feab2026849078ba485f918791bdc", + account_id="account_id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + rule = response.parse() + assert_matches_type(RuleEditResponse, rule, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip(reason="TODO: investigate broken test") + @parametrize + def test_path_params_edit_overload_16(self, client: Cloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `ruleset_id` but received ''"): + client.rulesets.rules.with_raw_response.edit( + rule_id="3a03d665bac047339bb530ecb439a90d", + ruleset_id="", + account_id="account_id", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `rule_id` but received ''"): + client.rulesets.rules.with_raw_response.edit( + rule_id="", + ruleset_id="2f2feab2026849078ba485f918791bdc", + account_id="account_id", + ) + + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): + client.rulesets.rules.with_raw_response.edit( + rule_id="3a03d665bac047339bb530ecb439a90d", + ruleset_id="2f2feab2026849078ba485f918791bdc", + account_id="", + ) + + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): + client.rulesets.rules.with_raw_response.edit( + rule_id="3a03d665bac047339bb530ecb439a90d", + ruleset_id="2f2feab2026849078ba485f918791bdc", + account_id="account_id", + ) + + @pytest.mark.skip(reason="TODO: investigate broken test") + @parametrize + def test_method_edit_overload_17(self, client: Cloudflare) -> None: + rule = client.rulesets.rules.edit( + rule_id="3a03d665bac047339bb530ecb439a90d", + ruleset_id="2f2feab2026849078ba485f918791bdc", + account_id="account_id", + ) + assert_matches_type(RuleEditResponse, rule, path=["response"]) + + @pytest.mark.skip(reason="TODO: investigate broken test") + @parametrize + def test_method_edit_with_all_params_overload_17(self, client: Cloudflare) -> None: + rule = client.rulesets.rules.edit( + rule_id="3a03d665bac047339bb530ecb439a90d", + ruleset_id="2f2feab2026849078ba485f918791bdc", + account_id="account_id", + id="3a03d665bac047339bb530ecb439a90d", + action="set_cache_settings", + action_parameters={ + "additional_cacheable_ports": [8080], + "browser_ttl": { + "mode": "override_origin", + "default": 60, + }, + "cache": True, + "cache_key": { + "cache_by_device_type": True, + "cache_deception_armor": True, + "custom_key": { + "cookie": { + "check_presence": ["myCookie"], + "include": ["myCookie"], + }, + "header": { + "check_presence": ["my-header"], + "contains": {"my-header": ["my-header-value-1", "my-header-value-2"]}, + "exclude_origin": True, + "include": ["my-header"], + }, + "host": {"resolved": True}, + "query_string": { + "exclude": { + "all": True, + "list": ["foo"], + }, + "include": { + "all": True, + "list": ["foo"], + }, + }, + "user": { + "device_type": True, + "geo": True, + "lang": True, + }, + }, + "ignore_query_strings_order": True, + }, + "cache_reserve": { + "eligible": True, + "minimum_file_size": 1024, + }, + "edge_ttl": { + "mode": "override_origin", + "default": 60, + "status_code_ttl": [ + { + "value": 0, + "status_code": 200, + "status_code_range": { "from": 200, "to": 299, }, @@ -3628,6 +4036,9 @@ def test_method_edit_with_all_params_overload_16(self, client: Cloudflare) -> No "read_timeout": 900, "respect_strong_etags": True, "serve_stale": {"disable_stale_while_updating": True}, + "strip_etags": True, + "strip_last_modified": True, + "strip_set_cookie": True, }, description="Configure settings for how the response is cached.", enabled=True, @@ -3654,7 +4065,7 @@ def test_method_edit_with_all_params_overload_16(self, client: Cloudflare) -> No @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize - def test_raw_response_edit_overload_16(self, client: Cloudflare) -> None: + def test_raw_response_edit_overload_17(self, client: Cloudflare) -> None: response = client.rulesets.rules.with_raw_response.edit( rule_id="3a03d665bac047339bb530ecb439a90d", ruleset_id="2f2feab2026849078ba485f918791bdc", @@ -3668,7 +4079,7 @@ def test_raw_response_edit_overload_16(self, client: Cloudflare) -> None: @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize - def test_streaming_response_edit_overload_16(self, client: Cloudflare) -> None: + def test_streaming_response_edit_overload_17(self, client: Cloudflare) -> None: with client.rulesets.rules.with_streaming_response.edit( rule_id="3a03d665bac047339bb530ecb439a90d", ruleset_id="2f2feab2026849078ba485f918791bdc", @@ -3684,7 +4095,7 @@ def test_streaming_response_edit_overload_16(self, client: Cloudflare) -> None: @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize - def test_path_params_edit_overload_16(self, client: Cloudflare) -> None: + def test_path_params_edit_overload_17(self, client: Cloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `ruleset_id` but received ''"): client.rulesets.rules.with_raw_response.edit( rule_id="3a03d665bac047339bb530ecb439a90d", @@ -3715,7 +4126,7 @@ def test_path_params_edit_overload_16(self, client: Cloudflare) -> None: @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize - def test_method_edit_overload_17(self, client: Cloudflare) -> None: + def test_method_edit_overload_18(self, client: Cloudflare) -> None: rule = client.rulesets.rules.edit( rule_id="3a03d665bac047339bb530ecb439a90d", ruleset_id="2f2feab2026849078ba485f918791bdc", @@ -3725,7 +4136,114 @@ def test_method_edit_overload_17(self, client: Cloudflare) -> None: @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize - def test_method_edit_with_all_params_overload_17(self, client: Cloudflare) -> None: + def test_method_edit_with_all_params_overload_18(self, client: Cloudflare) -> None: + rule = client.rulesets.rules.edit( + rule_id="3a03d665bac047339bb530ecb439a90d", + ruleset_id="2f2feab2026849078ba485f918791bdc", + account_id="account_id", + id="3a03d665bac047339bb530ecb439a90d", + action="set_cache_tags", + action_parameters={ + "operation": "add", + "values": ["my-cache-tag"], + }, + description="Modify the cache tags associated with the response.", + enabled=True, + exposed_credential_check={ + "password_expression": 'url_decode(http.request.body.form[\\"password\\"][0])', + "username_expression": 'url_decode(http.request.body.form[\\"username\\"][0])', + }, + expression="ip.src eq 1.1.1.1", + logging={"enabled": True}, + position={"before": "da5e8e506c8e7877fe06cdf4c41add54"}, + ratelimit={ + "characteristics": ["cf.colo.id"], + "period": 60, + "counting_expression": 'http.request.body.raw eq "abcd"', + "mitigation_timeout": 600, + "requests_per_period": 1000, + "requests_to_origin": True, + "score_per_period": 400, + "score_response_header_name": "my-score", + }, + ref="my_ref", + ) + assert_matches_type(RuleEditResponse, rule, path=["response"]) + + @pytest.mark.skip(reason="TODO: investigate broken test") + @parametrize + def test_raw_response_edit_overload_18(self, client: Cloudflare) -> None: + response = client.rulesets.rules.with_raw_response.edit( + rule_id="3a03d665bac047339bb530ecb439a90d", + ruleset_id="2f2feab2026849078ba485f918791bdc", + account_id="account_id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + rule = response.parse() + assert_matches_type(RuleEditResponse, rule, path=["response"]) + + @pytest.mark.skip(reason="TODO: investigate broken test") + @parametrize + def test_streaming_response_edit_overload_18(self, client: Cloudflare) -> None: + with client.rulesets.rules.with_streaming_response.edit( + rule_id="3a03d665bac047339bb530ecb439a90d", + ruleset_id="2f2feab2026849078ba485f918791bdc", + account_id="account_id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + rule = response.parse() + assert_matches_type(RuleEditResponse, rule, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip(reason="TODO: investigate broken test") + @parametrize + def test_path_params_edit_overload_18(self, client: Cloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `ruleset_id` but received ''"): + client.rulesets.rules.with_raw_response.edit( + rule_id="3a03d665bac047339bb530ecb439a90d", + ruleset_id="", + account_id="account_id", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `rule_id` but received ''"): + client.rulesets.rules.with_raw_response.edit( + rule_id="", + ruleset_id="2f2feab2026849078ba485f918791bdc", + account_id="account_id", + ) + + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): + client.rulesets.rules.with_raw_response.edit( + rule_id="3a03d665bac047339bb530ecb439a90d", + ruleset_id="2f2feab2026849078ba485f918791bdc", + account_id="", + ) + + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): + client.rulesets.rules.with_raw_response.edit( + rule_id="3a03d665bac047339bb530ecb439a90d", + ruleset_id="2f2feab2026849078ba485f918791bdc", + account_id="account_id", + ) + + @pytest.mark.skip(reason="TODO: investigate broken test") + @parametrize + def test_method_edit_overload_19(self, client: Cloudflare) -> None: + rule = client.rulesets.rules.edit( + rule_id="3a03d665bac047339bb530ecb439a90d", + ruleset_id="2f2feab2026849078ba485f918791bdc", + account_id="account_id", + ) + assert_matches_type(RuleEditResponse, rule, path=["response"]) + + @pytest.mark.skip(reason="TODO: investigate broken test") + @parametrize + def test_method_edit_with_all_params_overload_19(self, client: Cloudflare) -> None: rule = client.rulesets.rules.edit( rule_id="3a03d665bac047339bb530ecb439a90d", ruleset_id="2f2feab2026849078ba485f918791bdc", @@ -3784,7 +4302,7 @@ def test_method_edit_with_all_params_overload_17(self, client: Cloudflare) -> No @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize - def test_raw_response_edit_overload_17(self, client: Cloudflare) -> None: + def test_raw_response_edit_overload_19(self, client: Cloudflare) -> None: response = client.rulesets.rules.with_raw_response.edit( rule_id="3a03d665bac047339bb530ecb439a90d", ruleset_id="2f2feab2026849078ba485f918791bdc", @@ -3798,7 +4316,7 @@ def test_raw_response_edit_overload_17(self, client: Cloudflare) -> None: @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize - def test_streaming_response_edit_overload_17(self, client: Cloudflare) -> None: + def test_streaming_response_edit_overload_19(self, client: Cloudflare) -> None: with client.rulesets.rules.with_streaming_response.edit( rule_id="3a03d665bac047339bb530ecb439a90d", ruleset_id="2f2feab2026849078ba485f918791bdc", @@ -3814,7 +4332,7 @@ def test_streaming_response_edit_overload_17(self, client: Cloudflare) -> None: @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize - def test_path_params_edit_overload_17(self, client: Cloudflare) -> None: + def test_path_params_edit_overload_19(self, client: Cloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `ruleset_id` but received ''"): client.rulesets.rules.with_raw_response.edit( rule_id="3a03d665bac047339bb530ecb439a90d", @@ -3845,7 +4363,7 @@ def test_path_params_edit_overload_17(self, client: Cloudflare) -> None: @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize - def test_method_edit_overload_18(self, client: Cloudflare) -> None: + def test_method_edit_overload_20(self, client: Cloudflare) -> None: rule = client.rulesets.rules.edit( rule_id="3a03d665bac047339bb530ecb439a90d", ruleset_id="2f2feab2026849078ba485f918791bdc", @@ -3855,7 +4373,7 @@ def test_method_edit_overload_18(self, client: Cloudflare) -> None: @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize - def test_method_edit_with_all_params_overload_18(self, client: Cloudflare) -> None: + def test_method_edit_with_all_params_overload_20(self, client: Cloudflare) -> None: rule = client.rulesets.rules.edit( rule_id="3a03d665bac047339bb530ecb439a90d", ruleset_id="2f2feab2026849078ba485f918791bdc", @@ -3895,7 +4413,7 @@ def test_method_edit_with_all_params_overload_18(self, client: Cloudflare) -> No @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize - def test_raw_response_edit_overload_18(self, client: Cloudflare) -> None: + def test_raw_response_edit_overload_20(self, client: Cloudflare) -> None: response = client.rulesets.rules.with_raw_response.edit( rule_id="3a03d665bac047339bb530ecb439a90d", ruleset_id="2f2feab2026849078ba485f918791bdc", @@ -3909,7 +4427,7 @@ def test_raw_response_edit_overload_18(self, client: Cloudflare) -> None: @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize - def test_streaming_response_edit_overload_18(self, client: Cloudflare) -> None: + def test_streaming_response_edit_overload_20(self, client: Cloudflare) -> None: with client.rulesets.rules.with_streaming_response.edit( rule_id="3a03d665bac047339bb530ecb439a90d", ruleset_id="2f2feab2026849078ba485f918791bdc", @@ -3925,7 +4443,7 @@ def test_streaming_response_edit_overload_18(self, client: Cloudflare) -> None: @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize - def test_path_params_edit_overload_18(self, client: Cloudflare) -> None: + def test_path_params_edit_overload_20(self, client: Cloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `ruleset_id` but received ''"): client.rulesets.rules.with_raw_response.edit( rule_id="3a03d665bac047339bb530ecb439a90d", @@ -5406,6 +5924,155 @@ async def test_method_create_overload_16(self, async_client: AsyncCloudflare) -> @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize async def test_method_create_with_all_params_overload_16(self, async_client: AsyncCloudflare) -> None: + rule = await async_client.rulesets.rules.create( + ruleset_id="2f2feab2026849078ba485f918791bdc", + account_id="account_id", + id="3a03d665bac047339bb530ecb439a90d", + action="set_cache_control", + action_parameters={ + "immutable": { + "operation": "set", + "cloudflare_only": False, + }, + "max_age": { + "operation": "set", + "value": 3600, + "cloudflare_only": False, + }, + "must_revalidate": { + "operation": "set", + "cloudflare_only": False, + }, + "must_understand": { + "operation": "set", + "cloudflare_only": False, + }, + "no_cache": { + "operation": "set", + "cloudflare_only": False, + "qualifiers": ["X-Custom-Header"], + }, + "no_store": { + "operation": "set", + "cloudflare_only": False, + }, + "no_transform": { + "operation": "set", + "cloudflare_only": False, + }, + "private": { + "operation": "set", + "cloudflare_only": False, + "qualifiers": ["X-Custom-Header"], + }, + "proxy_revalidate": { + "operation": "set", + "cloudflare_only": False, + }, + "public": { + "operation": "set", + "cloudflare_only": False, + }, + "s_maxage": { + "operation": "set", + "value": 3600, + "cloudflare_only": False, + }, + "stale_if_error": { + "operation": "set", + "value": 3600, + "cloudflare_only": False, + }, + "stale_while_revalidate": { + "operation": "set", + "value": 3600, + "cloudflare_only": False, + }, + }, + description="Modify the cache-control header directives in an Origin response.", + enabled=True, + exposed_credential_check={ + "password_expression": 'url_decode(http.request.body.form[\\"password\\"][0])', + "username_expression": 'url_decode(http.request.body.form[\\"username\\"][0])', + }, + expression="ip.src eq 1.1.1.1", + logging={"enabled": True}, + position={"before": "da5e8e506c8e7877fe06cdf4c41add54"}, + ratelimit={ + "characteristics": ["cf.colo.id"], + "period": 60, + "counting_expression": 'http.request.body.raw eq "abcd"', + "mitigation_timeout": 600, + "requests_per_period": 1000, + "requests_to_origin": True, + "score_per_period": 400, + "score_response_header_name": "my-score", + }, + ref="my_ref", + ) + assert_matches_type(RuleCreateResponse, rule, path=["response"]) + + @pytest.mark.skip(reason="TODO: investigate broken test") + @parametrize + async def test_raw_response_create_overload_16(self, async_client: AsyncCloudflare) -> None: + response = await async_client.rulesets.rules.with_raw_response.create( + ruleset_id="2f2feab2026849078ba485f918791bdc", + account_id="account_id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + rule = await response.parse() + assert_matches_type(RuleCreateResponse, rule, path=["response"]) + + @pytest.mark.skip(reason="TODO: investigate broken test") + @parametrize + async def test_streaming_response_create_overload_16(self, async_client: AsyncCloudflare) -> None: + async with async_client.rulesets.rules.with_streaming_response.create( + ruleset_id="2f2feab2026849078ba485f918791bdc", + account_id="account_id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + rule = await response.parse() + assert_matches_type(RuleCreateResponse, rule, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip(reason="TODO: investigate broken test") + @parametrize + async def test_path_params_create_overload_16(self, async_client: AsyncCloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `ruleset_id` but received ''"): + await async_client.rulesets.rules.with_raw_response.create( + ruleset_id="", + account_id="account_id", + ) + + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): + await async_client.rulesets.rules.with_raw_response.create( + ruleset_id="2f2feab2026849078ba485f918791bdc", + account_id="", + ) + + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): + await async_client.rulesets.rules.with_raw_response.create( + ruleset_id="2f2feab2026849078ba485f918791bdc", + account_id="account_id", + ) + + @pytest.mark.skip(reason="TODO: investigate broken test") + @parametrize + async def test_method_create_overload_17(self, async_client: AsyncCloudflare) -> None: + rule = await async_client.rulesets.rules.create( + ruleset_id="2f2feab2026849078ba485f918791bdc", + account_id="account_id", + ) + assert_matches_type(RuleCreateResponse, rule, path=["response"]) + + @pytest.mark.skip(reason="TODO: investigate broken test") + @parametrize + async def test_method_create_with_all_params_overload_17(self, async_client: AsyncCloudflare) -> None: rule = await async_client.rulesets.rules.create( ruleset_id="2f2feab2026849078ba485f918791bdc", account_id="account_id", @@ -5474,8 +6141,104 @@ async def test_method_create_with_all_params_overload_16(self, async_client: Asy "read_timeout": 900, "respect_strong_etags": True, "serve_stale": {"disable_stale_while_updating": True}, + "strip_etags": True, + "strip_last_modified": True, + "strip_set_cookie": True, + }, + description="Configure settings for how the response is cached.", + enabled=True, + exposed_credential_check={ + "password_expression": 'url_decode(http.request.body.form[\\"password\\"][0])', + "username_expression": 'url_decode(http.request.body.form[\\"username\\"][0])', + }, + expression="ip.src eq 1.1.1.1", + logging={"enabled": True}, + position={"before": "da5e8e506c8e7877fe06cdf4c41add54"}, + ratelimit={ + "characteristics": ["cf.colo.id"], + "period": 60, + "counting_expression": 'http.request.body.raw eq "abcd"', + "mitigation_timeout": 600, + "requests_per_period": 1000, + "requests_to_origin": True, + "score_per_period": 400, + "score_response_header_name": "my-score", + }, + ref="my_ref", + ) + assert_matches_type(RuleCreateResponse, rule, path=["response"]) + + @pytest.mark.skip(reason="TODO: investigate broken test") + @parametrize + async def test_raw_response_create_overload_17(self, async_client: AsyncCloudflare) -> None: + response = await async_client.rulesets.rules.with_raw_response.create( + ruleset_id="2f2feab2026849078ba485f918791bdc", + account_id="account_id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + rule = await response.parse() + assert_matches_type(RuleCreateResponse, rule, path=["response"]) + + @pytest.mark.skip(reason="TODO: investigate broken test") + @parametrize + async def test_streaming_response_create_overload_17(self, async_client: AsyncCloudflare) -> None: + async with async_client.rulesets.rules.with_streaming_response.create( + ruleset_id="2f2feab2026849078ba485f918791bdc", + account_id="account_id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + rule = await response.parse() + assert_matches_type(RuleCreateResponse, rule, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip(reason="TODO: investigate broken test") + @parametrize + async def test_path_params_create_overload_17(self, async_client: AsyncCloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `ruleset_id` but received ''"): + await async_client.rulesets.rules.with_raw_response.create( + ruleset_id="", + account_id="account_id", + ) + + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): + await async_client.rulesets.rules.with_raw_response.create( + ruleset_id="2f2feab2026849078ba485f918791bdc", + account_id="", + ) + + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): + await async_client.rulesets.rules.with_raw_response.create( + ruleset_id="2f2feab2026849078ba485f918791bdc", + account_id="account_id", + ) + + @pytest.mark.skip(reason="TODO: investigate broken test") + @parametrize + async def test_method_create_overload_18(self, async_client: AsyncCloudflare) -> None: + rule = await async_client.rulesets.rules.create( + ruleset_id="2f2feab2026849078ba485f918791bdc", + account_id="account_id", + ) + assert_matches_type(RuleCreateResponse, rule, path=["response"]) + + @pytest.mark.skip(reason="TODO: investigate broken test") + @parametrize + async def test_method_create_with_all_params_overload_18(self, async_client: AsyncCloudflare) -> None: + rule = await async_client.rulesets.rules.create( + ruleset_id="2f2feab2026849078ba485f918791bdc", + account_id="account_id", + id="3a03d665bac047339bb530ecb439a90d", + action="set_cache_tags", + action_parameters={ + "operation": "add", + "values": ["my-cache-tag"], }, - description="Configure settings for how the response is cached.", + description="Modify the cache tags associated with the response.", enabled=True, exposed_credential_check={ "password_expression": 'url_decode(http.request.body.form[\\"password\\"][0])', @@ -5500,7 +6263,7 @@ async def test_method_create_with_all_params_overload_16(self, async_client: Asy @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize - async def test_raw_response_create_overload_16(self, async_client: AsyncCloudflare) -> None: + async def test_raw_response_create_overload_18(self, async_client: AsyncCloudflare) -> None: response = await async_client.rulesets.rules.with_raw_response.create( ruleset_id="2f2feab2026849078ba485f918791bdc", account_id="account_id", @@ -5513,7 +6276,7 @@ async def test_raw_response_create_overload_16(self, async_client: AsyncCloudfla @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize - async def test_streaming_response_create_overload_16(self, async_client: AsyncCloudflare) -> None: + async def test_streaming_response_create_overload_18(self, async_client: AsyncCloudflare) -> None: async with async_client.rulesets.rules.with_streaming_response.create( ruleset_id="2f2feab2026849078ba485f918791bdc", account_id="account_id", @@ -5528,7 +6291,7 @@ async def test_streaming_response_create_overload_16(self, async_client: AsyncCl @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize - async def test_path_params_create_overload_16(self, async_client: AsyncCloudflare) -> None: + async def test_path_params_create_overload_18(self, async_client: AsyncCloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `ruleset_id` but received ''"): await async_client.rulesets.rules.with_raw_response.create( ruleset_id="", @@ -5549,7 +6312,7 @@ async def test_path_params_create_overload_16(self, async_client: AsyncCloudflar @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize - async def test_method_create_overload_17(self, async_client: AsyncCloudflare) -> None: + async def test_method_create_overload_19(self, async_client: AsyncCloudflare) -> None: rule = await async_client.rulesets.rules.create( ruleset_id="2f2feab2026849078ba485f918791bdc", account_id="account_id", @@ -5558,7 +6321,7 @@ async def test_method_create_overload_17(self, async_client: AsyncCloudflare) -> @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize - async def test_method_create_with_all_params_overload_17(self, async_client: AsyncCloudflare) -> None: + async def test_method_create_with_all_params_overload_19(self, async_client: AsyncCloudflare) -> None: rule = await async_client.rulesets.rules.create( ruleset_id="2f2feab2026849078ba485f918791bdc", account_id="account_id", @@ -5616,7 +6379,7 @@ async def test_method_create_with_all_params_overload_17(self, async_client: Asy @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize - async def test_raw_response_create_overload_17(self, async_client: AsyncCloudflare) -> None: + async def test_raw_response_create_overload_19(self, async_client: AsyncCloudflare) -> None: response = await async_client.rulesets.rules.with_raw_response.create( ruleset_id="2f2feab2026849078ba485f918791bdc", account_id="account_id", @@ -5629,7 +6392,7 @@ async def test_raw_response_create_overload_17(self, async_client: AsyncCloudfla @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize - async def test_streaming_response_create_overload_17(self, async_client: AsyncCloudflare) -> None: + async def test_streaming_response_create_overload_19(self, async_client: AsyncCloudflare) -> None: async with async_client.rulesets.rules.with_streaming_response.create( ruleset_id="2f2feab2026849078ba485f918791bdc", account_id="account_id", @@ -5644,7 +6407,7 @@ async def test_streaming_response_create_overload_17(self, async_client: AsyncCl @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize - async def test_path_params_create_overload_17(self, async_client: AsyncCloudflare) -> None: + async def test_path_params_create_overload_19(self, async_client: AsyncCloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `ruleset_id` but received ''"): await async_client.rulesets.rules.with_raw_response.create( ruleset_id="", @@ -5665,7 +6428,7 @@ async def test_path_params_create_overload_17(self, async_client: AsyncCloudflar @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize - async def test_method_create_overload_18(self, async_client: AsyncCloudflare) -> None: + async def test_method_create_overload_20(self, async_client: AsyncCloudflare) -> None: rule = await async_client.rulesets.rules.create( ruleset_id="2f2feab2026849078ba485f918791bdc", account_id="account_id", @@ -5674,7 +6437,7 @@ async def test_method_create_overload_18(self, async_client: AsyncCloudflare) -> @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize - async def test_method_create_with_all_params_overload_18(self, async_client: AsyncCloudflare) -> None: + async def test_method_create_with_all_params_overload_20(self, async_client: AsyncCloudflare) -> None: rule = await async_client.rulesets.rules.create( ruleset_id="2f2feab2026849078ba485f918791bdc", account_id="account_id", @@ -5713,7 +6476,7 @@ async def test_method_create_with_all_params_overload_18(self, async_client: Asy @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize - async def test_raw_response_create_overload_18(self, async_client: AsyncCloudflare) -> None: + async def test_raw_response_create_overload_20(self, async_client: AsyncCloudflare) -> None: response = await async_client.rulesets.rules.with_raw_response.create( ruleset_id="2f2feab2026849078ba485f918791bdc", account_id="account_id", @@ -5726,7 +6489,7 @@ async def test_raw_response_create_overload_18(self, async_client: AsyncCloudfla @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize - async def test_streaming_response_create_overload_18(self, async_client: AsyncCloudflare) -> None: + async def test_streaming_response_create_overload_20(self, async_client: AsyncCloudflare) -> None: async with async_client.rulesets.rules.with_streaming_response.create( ruleset_id="2f2feab2026849078ba485f918791bdc", account_id="account_id", @@ -5741,7 +6504,7 @@ async def test_streaming_response_create_overload_18(self, async_client: AsyncCl @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize - async def test_path_params_create_overload_18(self, async_client: AsyncCloudflare) -> None: + async def test_path_params_create_overload_20(self, async_client: AsyncCloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `ruleset_id` but received ''"): await async_client.rulesets.rules.with_raw_response.create( ruleset_id="", @@ -7498,6 +8261,169 @@ async def test_method_edit_overload_16(self, async_client: AsyncCloudflare) -> N @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize async def test_method_edit_with_all_params_overload_16(self, async_client: AsyncCloudflare) -> None: + rule = await async_client.rulesets.rules.edit( + rule_id="3a03d665bac047339bb530ecb439a90d", + ruleset_id="2f2feab2026849078ba485f918791bdc", + account_id="account_id", + id="3a03d665bac047339bb530ecb439a90d", + action="set_cache_control", + action_parameters={ + "immutable": { + "operation": "set", + "cloudflare_only": False, + }, + "max_age": { + "operation": "set", + "value": 3600, + "cloudflare_only": False, + }, + "must_revalidate": { + "operation": "set", + "cloudflare_only": False, + }, + "must_understand": { + "operation": "set", + "cloudflare_only": False, + }, + "no_cache": { + "operation": "set", + "cloudflare_only": False, + "qualifiers": ["X-Custom-Header"], + }, + "no_store": { + "operation": "set", + "cloudflare_only": False, + }, + "no_transform": { + "operation": "set", + "cloudflare_only": False, + }, + "private": { + "operation": "set", + "cloudflare_only": False, + "qualifiers": ["X-Custom-Header"], + }, + "proxy_revalidate": { + "operation": "set", + "cloudflare_only": False, + }, + "public": { + "operation": "set", + "cloudflare_only": False, + }, + "s_maxage": { + "operation": "set", + "value": 3600, + "cloudflare_only": False, + }, + "stale_if_error": { + "operation": "set", + "value": 3600, + "cloudflare_only": False, + }, + "stale_while_revalidate": { + "operation": "set", + "value": 3600, + "cloudflare_only": False, + }, + }, + description="Modify the cache-control header directives in an Origin response.", + enabled=True, + exposed_credential_check={ + "password_expression": 'url_decode(http.request.body.form[\\"password\\"][0])', + "username_expression": 'url_decode(http.request.body.form[\\"username\\"][0])', + }, + expression="ip.src eq 1.1.1.1", + logging={"enabled": True}, + position={"before": "da5e8e506c8e7877fe06cdf4c41add54"}, + ratelimit={ + "characteristics": ["cf.colo.id"], + "period": 60, + "counting_expression": 'http.request.body.raw eq "abcd"', + "mitigation_timeout": 600, + "requests_per_period": 1000, + "requests_to_origin": True, + "score_per_period": 400, + "score_response_header_name": "my-score", + }, + ref="my_ref", + ) + assert_matches_type(RuleEditResponse, rule, path=["response"]) + + @pytest.mark.skip(reason="TODO: investigate broken test") + @parametrize + async def test_raw_response_edit_overload_16(self, async_client: AsyncCloudflare) -> None: + response = await async_client.rulesets.rules.with_raw_response.edit( + rule_id="3a03d665bac047339bb530ecb439a90d", + ruleset_id="2f2feab2026849078ba485f918791bdc", + account_id="account_id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + rule = await response.parse() + assert_matches_type(RuleEditResponse, rule, path=["response"]) + + @pytest.mark.skip(reason="TODO: investigate broken test") + @parametrize + async def test_streaming_response_edit_overload_16(self, async_client: AsyncCloudflare) -> None: + async with async_client.rulesets.rules.with_streaming_response.edit( + rule_id="3a03d665bac047339bb530ecb439a90d", + ruleset_id="2f2feab2026849078ba485f918791bdc", + account_id="account_id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + rule = await response.parse() + assert_matches_type(RuleEditResponse, rule, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip(reason="TODO: investigate broken test") + @parametrize + async def test_path_params_edit_overload_16(self, async_client: AsyncCloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `ruleset_id` but received ''"): + await async_client.rulesets.rules.with_raw_response.edit( + rule_id="3a03d665bac047339bb530ecb439a90d", + ruleset_id="", + account_id="account_id", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `rule_id` but received ''"): + await async_client.rulesets.rules.with_raw_response.edit( + rule_id="", + ruleset_id="2f2feab2026849078ba485f918791bdc", + account_id="account_id", + ) + + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): + await async_client.rulesets.rules.with_raw_response.edit( + rule_id="3a03d665bac047339bb530ecb439a90d", + ruleset_id="2f2feab2026849078ba485f918791bdc", + account_id="", + ) + + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): + await async_client.rulesets.rules.with_raw_response.edit( + rule_id="3a03d665bac047339bb530ecb439a90d", + ruleset_id="2f2feab2026849078ba485f918791bdc", + account_id="account_id", + ) + + @pytest.mark.skip(reason="TODO: investigate broken test") + @parametrize + async def test_method_edit_overload_17(self, async_client: AsyncCloudflare) -> None: + rule = await async_client.rulesets.rules.edit( + rule_id="3a03d665bac047339bb530ecb439a90d", + ruleset_id="2f2feab2026849078ba485f918791bdc", + account_id="account_id", + ) + assert_matches_type(RuleEditResponse, rule, path=["response"]) + + @pytest.mark.skip(reason="TODO: investigate broken test") + @parametrize + async def test_method_edit_with_all_params_overload_17(self, async_client: AsyncCloudflare) -> None: rule = await async_client.rulesets.rules.edit( rule_id="3a03d665bac047339bb530ecb439a90d", ruleset_id="2f2feab2026849078ba485f918791bdc", @@ -7567,6 +8493,9 @@ async def test_method_edit_with_all_params_overload_16(self, async_client: Async "read_timeout": 900, "respect_strong_etags": True, "serve_stale": {"disable_stale_while_updating": True}, + "strip_etags": True, + "strip_last_modified": True, + "strip_set_cookie": True, }, description="Configure settings for how the response is cached.", enabled=True, @@ -7593,7 +8522,7 @@ async def test_method_edit_with_all_params_overload_16(self, async_client: Async @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize - async def test_raw_response_edit_overload_16(self, async_client: AsyncCloudflare) -> None: + async def test_raw_response_edit_overload_17(self, async_client: AsyncCloudflare) -> None: response = await async_client.rulesets.rules.with_raw_response.edit( rule_id="3a03d665bac047339bb530ecb439a90d", ruleset_id="2f2feab2026849078ba485f918791bdc", @@ -7607,7 +8536,7 @@ async def test_raw_response_edit_overload_16(self, async_client: AsyncCloudflare @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize - async def test_streaming_response_edit_overload_16(self, async_client: AsyncCloudflare) -> None: + async def test_streaming_response_edit_overload_17(self, async_client: AsyncCloudflare) -> None: async with async_client.rulesets.rules.with_streaming_response.edit( rule_id="3a03d665bac047339bb530ecb439a90d", ruleset_id="2f2feab2026849078ba485f918791bdc", @@ -7623,7 +8552,7 @@ async def test_streaming_response_edit_overload_16(self, async_client: AsyncClou @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize - async def test_path_params_edit_overload_16(self, async_client: AsyncCloudflare) -> None: + async def test_path_params_edit_overload_17(self, async_client: AsyncCloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `ruleset_id` but received ''"): await async_client.rulesets.rules.with_raw_response.edit( rule_id="3a03d665bac047339bb530ecb439a90d", @@ -7654,7 +8583,7 @@ async def test_path_params_edit_overload_16(self, async_client: AsyncCloudflare) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize - async def test_method_edit_overload_17(self, async_client: AsyncCloudflare) -> None: + async def test_method_edit_overload_18(self, async_client: AsyncCloudflare) -> None: rule = await async_client.rulesets.rules.edit( rule_id="3a03d665bac047339bb530ecb439a90d", ruleset_id="2f2feab2026849078ba485f918791bdc", @@ -7664,7 +8593,114 @@ async def test_method_edit_overload_17(self, async_client: AsyncCloudflare) -> N @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize - async def test_method_edit_with_all_params_overload_17(self, async_client: AsyncCloudflare) -> None: + async def test_method_edit_with_all_params_overload_18(self, async_client: AsyncCloudflare) -> None: + rule = await async_client.rulesets.rules.edit( + rule_id="3a03d665bac047339bb530ecb439a90d", + ruleset_id="2f2feab2026849078ba485f918791bdc", + account_id="account_id", + id="3a03d665bac047339bb530ecb439a90d", + action="set_cache_tags", + action_parameters={ + "operation": "add", + "values": ["my-cache-tag"], + }, + description="Modify the cache tags associated with the response.", + enabled=True, + exposed_credential_check={ + "password_expression": 'url_decode(http.request.body.form[\\"password\\"][0])', + "username_expression": 'url_decode(http.request.body.form[\\"username\\"][0])', + }, + expression="ip.src eq 1.1.1.1", + logging={"enabled": True}, + position={"before": "da5e8e506c8e7877fe06cdf4c41add54"}, + ratelimit={ + "characteristics": ["cf.colo.id"], + "period": 60, + "counting_expression": 'http.request.body.raw eq "abcd"', + "mitigation_timeout": 600, + "requests_per_period": 1000, + "requests_to_origin": True, + "score_per_period": 400, + "score_response_header_name": "my-score", + }, + ref="my_ref", + ) + assert_matches_type(RuleEditResponse, rule, path=["response"]) + + @pytest.mark.skip(reason="TODO: investigate broken test") + @parametrize + async def test_raw_response_edit_overload_18(self, async_client: AsyncCloudflare) -> None: + response = await async_client.rulesets.rules.with_raw_response.edit( + rule_id="3a03d665bac047339bb530ecb439a90d", + ruleset_id="2f2feab2026849078ba485f918791bdc", + account_id="account_id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + rule = await response.parse() + assert_matches_type(RuleEditResponse, rule, path=["response"]) + + @pytest.mark.skip(reason="TODO: investigate broken test") + @parametrize + async def test_streaming_response_edit_overload_18(self, async_client: AsyncCloudflare) -> None: + async with async_client.rulesets.rules.with_streaming_response.edit( + rule_id="3a03d665bac047339bb530ecb439a90d", + ruleset_id="2f2feab2026849078ba485f918791bdc", + account_id="account_id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + rule = await response.parse() + assert_matches_type(RuleEditResponse, rule, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip(reason="TODO: investigate broken test") + @parametrize + async def test_path_params_edit_overload_18(self, async_client: AsyncCloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `ruleset_id` but received ''"): + await async_client.rulesets.rules.with_raw_response.edit( + rule_id="3a03d665bac047339bb530ecb439a90d", + ruleset_id="", + account_id="account_id", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `rule_id` but received ''"): + await async_client.rulesets.rules.with_raw_response.edit( + rule_id="", + ruleset_id="2f2feab2026849078ba485f918791bdc", + account_id="account_id", + ) + + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): + await async_client.rulesets.rules.with_raw_response.edit( + rule_id="3a03d665bac047339bb530ecb439a90d", + ruleset_id="2f2feab2026849078ba485f918791bdc", + account_id="", + ) + + with pytest.raises(ValueError, match=r"You must provide either account_id or zone_id"): + await async_client.rulesets.rules.with_raw_response.edit( + rule_id="3a03d665bac047339bb530ecb439a90d", + ruleset_id="2f2feab2026849078ba485f918791bdc", + account_id="account_id", + ) + + @pytest.mark.skip(reason="TODO: investigate broken test") + @parametrize + async def test_method_edit_overload_19(self, async_client: AsyncCloudflare) -> None: + rule = await async_client.rulesets.rules.edit( + rule_id="3a03d665bac047339bb530ecb439a90d", + ruleset_id="2f2feab2026849078ba485f918791bdc", + account_id="account_id", + ) + assert_matches_type(RuleEditResponse, rule, path=["response"]) + + @pytest.mark.skip(reason="TODO: investigate broken test") + @parametrize + async def test_method_edit_with_all_params_overload_19(self, async_client: AsyncCloudflare) -> None: rule = await async_client.rulesets.rules.edit( rule_id="3a03d665bac047339bb530ecb439a90d", ruleset_id="2f2feab2026849078ba485f918791bdc", @@ -7723,7 +8759,7 @@ async def test_method_edit_with_all_params_overload_17(self, async_client: Async @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize - async def test_raw_response_edit_overload_17(self, async_client: AsyncCloudflare) -> None: + async def test_raw_response_edit_overload_19(self, async_client: AsyncCloudflare) -> None: response = await async_client.rulesets.rules.with_raw_response.edit( rule_id="3a03d665bac047339bb530ecb439a90d", ruleset_id="2f2feab2026849078ba485f918791bdc", @@ -7737,7 +8773,7 @@ async def test_raw_response_edit_overload_17(self, async_client: AsyncCloudflare @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize - async def test_streaming_response_edit_overload_17(self, async_client: AsyncCloudflare) -> None: + async def test_streaming_response_edit_overload_19(self, async_client: AsyncCloudflare) -> None: async with async_client.rulesets.rules.with_streaming_response.edit( rule_id="3a03d665bac047339bb530ecb439a90d", ruleset_id="2f2feab2026849078ba485f918791bdc", @@ -7753,7 +8789,7 @@ async def test_streaming_response_edit_overload_17(self, async_client: AsyncClou @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize - async def test_path_params_edit_overload_17(self, async_client: AsyncCloudflare) -> None: + async def test_path_params_edit_overload_19(self, async_client: AsyncCloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `ruleset_id` but received ''"): await async_client.rulesets.rules.with_raw_response.edit( rule_id="3a03d665bac047339bb530ecb439a90d", @@ -7784,7 +8820,7 @@ async def test_path_params_edit_overload_17(self, async_client: AsyncCloudflare) @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize - async def test_method_edit_overload_18(self, async_client: AsyncCloudflare) -> None: + async def test_method_edit_overload_20(self, async_client: AsyncCloudflare) -> None: rule = await async_client.rulesets.rules.edit( rule_id="3a03d665bac047339bb530ecb439a90d", ruleset_id="2f2feab2026849078ba485f918791bdc", @@ -7794,7 +8830,7 @@ async def test_method_edit_overload_18(self, async_client: AsyncCloudflare) -> N @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize - async def test_method_edit_with_all_params_overload_18(self, async_client: AsyncCloudflare) -> None: + async def test_method_edit_with_all_params_overload_20(self, async_client: AsyncCloudflare) -> None: rule = await async_client.rulesets.rules.edit( rule_id="3a03d665bac047339bb530ecb439a90d", ruleset_id="2f2feab2026849078ba485f918791bdc", @@ -7834,7 +8870,7 @@ async def test_method_edit_with_all_params_overload_18(self, async_client: Async @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize - async def test_raw_response_edit_overload_18(self, async_client: AsyncCloudflare) -> None: + async def test_raw_response_edit_overload_20(self, async_client: AsyncCloudflare) -> None: response = await async_client.rulesets.rules.with_raw_response.edit( rule_id="3a03d665bac047339bb530ecb439a90d", ruleset_id="2f2feab2026849078ba485f918791bdc", @@ -7848,7 +8884,7 @@ async def test_raw_response_edit_overload_18(self, async_client: AsyncCloudflare @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize - async def test_streaming_response_edit_overload_18(self, async_client: AsyncCloudflare) -> None: + async def test_streaming_response_edit_overload_20(self, async_client: AsyncCloudflare) -> None: async with async_client.rulesets.rules.with_streaming_response.edit( rule_id="3a03d665bac047339bb530ecb439a90d", ruleset_id="2f2feab2026849078ba485f918791bdc", @@ -7864,7 +8900,7 @@ async def test_streaming_response_edit_overload_18(self, async_client: AsyncClou @pytest.mark.skip(reason="TODO: investigate broken test") @parametrize - async def test_path_params_edit_overload_18(self, async_client: AsyncCloudflare) -> None: + async def test_path_params_edit_overload_20(self, async_client: AsyncCloudflare) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `ruleset_id` but received ''"): await async_client.rulesets.rules.with_raw_response.edit( rule_id="3a03d665bac047339bb530ecb439a90d", diff --git a/tests/api_resources/speed/test_schedule.py b/tests/api_resources/speed/test_schedule.py index 96eab910c45..b229ad71ff1 100644 --- a/tests/api_resources/speed/test_schedule.py +++ b/tests/api_resources/speed/test_schedule.py @@ -34,6 +34,7 @@ def test_method_create_with_all_params(self, client: Cloudflare) -> None: schedule = client.speed.schedule.create( url="example.com", zone_id="023e105f4ecef8ad9ca31a8372d0c353", + frequency="DAILY", region="us-central1", ) assert_matches_type(Optional[ScheduleCreateResponse], schedule, path=["response"]) @@ -211,6 +212,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncCloudflare schedule = await async_client.speed.schedule.create( url="example.com", zone_id="023e105f4ecef8ad9ca31a8372d0c353", + frequency="DAILY", region="us-central1", ) assert_matches_type(Optional[ScheduleCreateResponse], schedule, path=["response"]) diff --git a/tests/api_resources/test_ai_gateway.py b/tests/api_resources/test_ai_gateway.py index d0b981f22c6..56982a727da 100644 --- a/tests/api_resources/test_ai_gateway.py +++ b/tests/api_resources/test_ai_gateway.py @@ -50,11 +50,11 @@ def test_method_create_with_all_params(self, client: Cloudflare) -> None: rate_limiting_limit=0, rate_limiting_technique="fixed", authentication=True, - is_default=True, log_management=10000, log_management_strategy="STOP_INSERTING", logpush=True, logpush_public_key="xxxxxxxxxxxxxxxx", + workers_ai_billing_mode="postpaid", zdr=True, ) assert_matches_type(AIGatewayCreateResponse, ai_gateway, path=["response"]) @@ -142,7 +142,6 @@ def test_method_update_with_all_params(self, client: Cloudflare) -> None: "enabled": True, "profiles": ["string"], }, - is_default=True, log_management=10000, log_management_strategy="STOP_INSERTING", logpush=True, @@ -152,6 +151,7 @@ def test_method_update_with_all_params(self, client: Cloudflare) -> None: "authorization": "authorization", "headers": {"foo": "string"}, "url": "url", + "content_type": "json", } ], store_id="store_id", @@ -159,6 +159,7 @@ def test_method_update_with_all_params(self, client: Cloudflare) -> None: "authorization": "authorization", "usage_events": [{"payload": "payload"}], }, + workers_ai_billing_mode="postpaid", zdr=True, ) assert_matches_type(AIGatewayUpdateResponse, ai_gateway, path=["response"]) @@ -403,11 +404,11 @@ async def test_method_create_with_all_params(self, async_client: AsyncCloudflare rate_limiting_limit=0, rate_limiting_technique="fixed", authentication=True, - is_default=True, log_management=10000, log_management_strategy="STOP_INSERTING", logpush=True, logpush_public_key="xxxxxxxxxxxxxxxx", + workers_ai_billing_mode="postpaid", zdr=True, ) assert_matches_type(AIGatewayCreateResponse, ai_gateway, path=["response"]) @@ -495,7 +496,6 @@ async def test_method_update_with_all_params(self, async_client: AsyncCloudflare "enabled": True, "profiles": ["string"], }, - is_default=True, log_management=10000, log_management_strategy="STOP_INSERTING", logpush=True, @@ -505,6 +505,7 @@ async def test_method_update_with_all_params(self, async_client: AsyncCloudflare "authorization": "authorization", "headers": {"foo": "string"}, "url": "url", + "content_type": "json", } ], store_id="store_id", @@ -512,6 +513,7 @@ async def test_method_update_with_all_params(self, async_client: AsyncCloudflare "authorization": "authorization", "usage_events": [{"payload": "payload"}], }, + workers_ai_billing_mode="postpaid", zdr=True, ) assert_matches_type(AIGatewayUpdateResponse, ai_gateway, path=["response"]) diff --git a/tests/api_resources/test_workflows.py b/tests/api_resources/test_workflows.py index bcc84aa9081..50b603500c7 100644 --- a/tests/api_resources/test_workflows.py +++ b/tests/api_resources/test_workflows.py @@ -33,6 +33,17 @@ def test_method_update(self, client: Cloudflare) -> None: ) assert_matches_type(WorkflowUpdateResponse, workflow, path=["response"]) + @parametrize + def test_method_update_with_all_params(self, client: Cloudflare) -> None: + workflow = client.workflows.update( + workflow_name="x", + account_id="account_id", + class_name="x", + script_name="x", + limits={"steps": 1}, + ) + assert_matches_type(WorkflowUpdateResponse, workflow, path=["response"]) + @parametrize def test_raw_response_update(self, client: Cloudflare) -> None: response = client.workflows.with_raw_response.update( @@ -241,6 +252,17 @@ async def test_method_update(self, async_client: AsyncCloudflare) -> None: ) assert_matches_type(WorkflowUpdateResponse, workflow, path=["response"]) + @parametrize + async def test_method_update_with_all_params(self, async_client: AsyncCloudflare) -> None: + workflow = await async_client.workflows.update( + workflow_name="x", + account_id="account_id", + class_name="x", + script_name="x", + limits={"steps": 1}, + ) + assert_matches_type(WorkflowUpdateResponse, workflow, path=["response"]) + @parametrize async def test_raw_response_update(self, async_client: AsyncCloudflare) -> None: response = await async_client.workflows.with_raw_response.update( diff --git a/tests/api_resources/workflows/test_instances.py b/tests/api_resources/workflows/test_instances.py index f5af61e88cb..9d29e7aa3e7 100644 --- a/tests/api_resources/workflows/test_instances.py +++ b/tests/api_resources/workflows/test_instances.py @@ -224,6 +224,17 @@ def test_method_get(self, client: Cloudflare) -> None: ) assert_matches_type(InstanceGetResponse, instance, path=["response"]) + @parametrize + def test_method_get_with_all_params(self, client: Cloudflare) -> None: + instance = client.workflows.instances.get( + instance_id="x", + account_id="account_id", + workflow_name="x", + order="asc", + simple="true", + ) + assert_matches_type(InstanceGetResponse, instance, path=["response"]) + @parametrize def test_raw_response_get(self, client: Cloudflare) -> None: response = client.workflows.instances.with_raw_response.get( @@ -481,6 +492,17 @@ async def test_method_get(self, async_client: AsyncCloudflare) -> None: ) assert_matches_type(InstanceGetResponse, instance, path=["response"]) + @parametrize + async def test_method_get_with_all_params(self, async_client: AsyncCloudflare) -> None: + instance = await async_client.workflows.instances.get( + instance_id="x", + account_id="account_id", + workflow_name="x", + order="asc", + simple="true", + ) + assert_matches_type(InstanceGetResponse, instance, path=["response"]) + @parametrize async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: response = await async_client.workflows.instances.with_raw_response.get( diff --git a/tests/api_resources/zero_trust/dlp/profiles/test_custom.py b/tests/api_resources/zero_trust/dlp/profiles/test_custom.py index f26540bad38..14f32d2505d 100644 --- a/tests/api_resources/zero_trust/dlp/profiles/test_custom.py +++ b/tests/api_resources/zero_trust/dlp/profiles/test_custom.py @@ -37,6 +37,8 @@ def test_method_create_with_all_params(self, client: Cloudflare) -> None: "enabled": True, "skip": {"files": True}, }, + data_classes=["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"], + data_tags=["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"], description="description", entries=[ { @@ -50,6 +52,7 @@ def test_method_create_with_all_params(self, client: Cloudflare) -> None: } ], ocr_enabled=True, + sensitivity_levels=[["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"]], shared_entries=[ { "enabled": True, @@ -115,6 +118,8 @@ def test_method_update_with_all_params(self, client: Cloudflare) -> None: "enabled": True, "skip": {"files": True}, }, + data_classes=["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"], + data_tags=["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"], description="description", entries=[ { @@ -129,6 +134,7 @@ def test_method_update_with_all_params(self, client: Cloudflare) -> None: } ], ocr_enabled=True, + sensitivity_levels=[["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"]], shared_entries=[ { "enabled": True, @@ -304,6 +310,8 @@ async def test_method_create_with_all_params(self, async_client: AsyncCloudflare "enabled": True, "skip": {"files": True}, }, + data_classes=["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"], + data_tags=["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"], description="description", entries=[ { @@ -317,6 +325,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncCloudflare } ], ocr_enabled=True, + sensitivity_levels=[["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"]], shared_entries=[ { "enabled": True, @@ -382,6 +391,8 @@ async def test_method_update_with_all_params(self, async_client: AsyncCloudflare "enabled": True, "skip": {"files": True}, }, + data_classes=["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"], + data_tags=["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"], description="description", entries=[ { @@ -396,6 +407,7 @@ async def test_method_update_with_all_params(self, async_client: AsyncCloudflare } ], ocr_enabled=True, + sensitivity_levels=[["182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"]], shared_entries=[ { "enabled": True, From d0805c4e4aafcd05da0ca2e91393a49544be2cfc Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 5 Mar 2026 21:31:57 +0000 Subject: [PATCH 056/279] chore(api): update composite API spec --- .stats.yml | 4 +- .../zero_trust/organizations/organizations.py | 20 ------ .../access/application_create_params.py | 64 +++++++++---------- .../access/application_create_response.py | 64 +++++++++---------- .../access/application_get_response.py | 64 +++++++++---------- .../access/application_list_response.py | 64 +++++++++---------- .../access/application_update_params.py | 64 +++++++++---------- .../access/application_update_response.py | 64 +++++++++---------- .../access/applications/access_rule.py | 21 +++++- .../access/applications/access_rule_param.py | 21 +++++- .../applications/policy_create_params.py | 4 +- .../applications/policy_create_response.py | 4 +- .../applications/policy_get_response.py | 4 +- .../applications/policy_list_response.py | 4 +- .../applications/policy_test_create_params.py | 4 +- .../applications/policy_update_params.py | 4 +- .../applications/policy_update_response.py | 4 +- .../zero_trust/access/policy_create_params.py | 4 +- .../access/policy_create_response.py | 4 +- .../zero_trust/access/policy_get_response.py | 4 +- .../zero_trust/access/policy_list_response.py | 4 +- .../zero_trust/access/policy_update_params.py | 4 +- .../access/policy_update_response.py | 4 +- .../types/zero_trust/organization.py | 6 -- .../zero_trust/organization_create_params.py | 6 -- .../zero_trust/organization_update_params.py | 6 -- .../access/applications/test_policies.py | 8 +-- .../access/applications/test_policy_tests.py | 4 +- .../zero_trust/access/test_applications.py | 32 +++++----- .../zero_trust/access/test_policies.py | 8 +-- .../zero_trust/test_organizations.py | 4 -- 31 files changed, 284 insertions(+), 292 deletions(-) diff --git a/.stats.yml b/.stats.yml index 10011598aba..33026388f2e 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 2049 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-ee23c4fe5cfe74e6576003db5f37b8b85cd8aaae1ff7576ccd2e16fa47008934.yml -openapi_spec_hash: 20046482414d30b12cdc7ab777b15e94 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-2290f772d9da747604b876da6e05a038187c26179245af12a64d198f25ef3fd0.yml +openapi_spec_hash: f46a7fc30fe001095a2b484fb6ada3e9 config_hash: ebde54bdd7ec58f9abf7de1c45a2c076 diff --git a/src/cloudflare/resources/zero_trust/organizations/organizations.py b/src/cloudflare/resources/zero_trust/organizations/organizations.py index 9a5730fae56..baeb18dbcb7 100644 --- a/src/cloudflare/resources/zero_trust/organizations/organizations.py +++ b/src/cloudflare/resources/zero_trust/organizations/organizations.py @@ -76,7 +76,6 @@ def create( is_ui_read_only: bool | Omit = omit, login_design: LoginDesignParam | Omit = omit, mfa_config: organization_create_params.MfaConfig | Omit = omit, - mfa_configuration_allowed: bool | Omit = omit, mfa_required_for_all_apps: bool | Omit = omit, session_duration: str | Omit = omit, ui_read_only_toggle_reason: str | Omit = omit, @@ -123,9 +122,6 @@ def create( mfa_config: Configures multi-factor authentication (MFA) settings for an organization. - mfa_configuration_allowed: Indicates if this organization can enforce multi-factor authentication (MFA) - requirements at the application and policy level. - mfa_required_for_all_apps: Determines whether global MFA settings apply to applications by default. The organization must have MFA enabled with at least one authentication method and a session duration configured. @@ -178,7 +174,6 @@ def create( "is_ui_read_only": is_ui_read_only, "login_design": login_design, "mfa_config": mfa_config, - "mfa_configuration_allowed": mfa_configuration_allowed, "mfa_required_for_all_apps": mfa_required_for_all_apps, "session_duration": session_duration, "ui_read_only_toggle_reason": ui_read_only_toggle_reason, @@ -211,7 +206,6 @@ def update( is_ui_read_only: bool | Omit = omit, login_design: LoginDesignParam | Omit = omit, mfa_config: organization_update_params.MfaConfig | Omit = omit, - mfa_configuration_allowed: bool | Omit = omit, mfa_required_for_all_apps: bool | Omit = omit, name: str | Omit = omit, session_duration: str | Omit = omit, @@ -257,9 +251,6 @@ def update( mfa_config: Configures multi-factor authentication (MFA) settings for an organization. - mfa_configuration_allowed: Indicates if this organization can enforce multi-factor authentication (MFA) - requirements at the application and policy level. - mfa_required_for_all_apps: Determines whether global MFA settings apply to applications by default. The organization must have MFA enabled with at least one authentication method and a session duration configured. @@ -314,7 +305,6 @@ def update( "is_ui_read_only": is_ui_read_only, "login_design": login_design, "mfa_config": mfa_config, - "mfa_configuration_allowed": mfa_configuration_allowed, "mfa_required_for_all_apps": mfa_required_for_all_apps, "name": name, "session_duration": session_duration, @@ -508,7 +498,6 @@ async def create( is_ui_read_only: bool | Omit = omit, login_design: LoginDesignParam | Omit = omit, mfa_config: organization_create_params.MfaConfig | Omit = omit, - mfa_configuration_allowed: bool | Omit = omit, mfa_required_for_all_apps: bool | Omit = omit, session_duration: str | Omit = omit, ui_read_only_toggle_reason: str | Omit = omit, @@ -555,9 +544,6 @@ async def create( mfa_config: Configures multi-factor authentication (MFA) settings for an organization. - mfa_configuration_allowed: Indicates if this organization can enforce multi-factor authentication (MFA) - requirements at the application and policy level. - mfa_required_for_all_apps: Determines whether global MFA settings apply to applications by default. The organization must have MFA enabled with at least one authentication method and a session duration configured. @@ -610,7 +596,6 @@ async def create( "is_ui_read_only": is_ui_read_only, "login_design": login_design, "mfa_config": mfa_config, - "mfa_configuration_allowed": mfa_configuration_allowed, "mfa_required_for_all_apps": mfa_required_for_all_apps, "session_duration": session_duration, "ui_read_only_toggle_reason": ui_read_only_toggle_reason, @@ -643,7 +628,6 @@ async def update( is_ui_read_only: bool | Omit = omit, login_design: LoginDesignParam | Omit = omit, mfa_config: organization_update_params.MfaConfig | Omit = omit, - mfa_configuration_allowed: bool | Omit = omit, mfa_required_for_all_apps: bool | Omit = omit, name: str | Omit = omit, session_duration: str | Omit = omit, @@ -689,9 +673,6 @@ async def update( mfa_config: Configures multi-factor authentication (MFA) settings for an organization. - mfa_configuration_allowed: Indicates if this organization can enforce multi-factor authentication (MFA) - requirements at the application and policy level. - mfa_required_for_all_apps: Determines whether global MFA settings apply to applications by default. The organization must have MFA enabled with at least one authentication method and a session duration configured. @@ -746,7 +727,6 @@ async def update( "is_ui_read_only": is_ui_read_only, "login_design": login_design, "mfa_config": mfa_config, - "mfa_configuration_allowed": mfa_configuration_allowed, "mfa_required_for_all_apps": mfa_required_for_all_apps, "name": name, "session_duration": session_duration, diff --git a/src/cloudflare/types/zero_trust/access/application_create_params.py b/src/cloudflare/types/zero_trust/access/application_create_params.py index c1c5b442226..a8bca59a618 100644 --- a/src/cloudflare/types/zero_trust/access/application_create_params.py +++ b/src/cloudflare/types/zero_trust/access/application_create_params.py @@ -448,8 +448,8 @@ class SelfHostedApplicationMfaConfig(TypedDict, total=False): allowed_authenticators: List[Literal["totp", "biometrics", "security_key"]] """Lists the MFA methods that users can authenticate with.""" - mfa_bypass: bool - """Indicates whether to bypass MFA for this resource. + mfa_disabled: bool + """Indicates whether to disable MFA for this resource. This option is available at the application and policy level. """ @@ -560,8 +560,8 @@ class SelfHostedApplicationPolicyUnionMember2MfaConfig(TypedDict, total=False): allowed_authenticators: List[Literal["totp", "biometrics", "security_key"]] """Lists the MFA methods that users can authenticate with.""" - mfa_bypass: bool - """Indicates whether to bypass MFA for this resource. + mfa_disabled: bool + """Indicates whether to disable MFA for this resource. This option is available at the application and policy level. """ @@ -828,8 +828,8 @@ class SaaSApplicationPolicyUnionMember2MfaConfig(TypedDict, total=False): allowed_authenticators: List[Literal["totp", "biometrics", "security_key"]] """Lists the MFA methods that users can authenticate with.""" - mfa_bypass: bool - """Indicates whether to bypass MFA for this resource. + mfa_disabled: bool + """Indicates whether to disable MFA for this resource. This option is available at the application and policy level. """ @@ -1262,8 +1262,8 @@ class BrowserSSHApplicationMfaConfig(TypedDict, total=False): allowed_authenticators: List[Literal["totp", "biometrics", "security_key"]] """Lists the MFA methods that users can authenticate with.""" - mfa_bypass: bool - """Indicates whether to bypass MFA for this resource. + mfa_disabled: bool + """Indicates whether to disable MFA for this resource. This option is available at the application and policy level. """ @@ -1374,8 +1374,8 @@ class BrowserSSHApplicationPolicyUnionMember2MfaConfig(TypedDict, total=False): allowed_authenticators: List[Literal["totp", "biometrics", "security_key"]] """Lists the MFA methods that users can authenticate with.""" - mfa_bypass: bool - """Indicates whether to bypass MFA for this resource. + mfa_disabled: bool + """Indicates whether to disable MFA for this resource. This option is available at the application and policy level. """ @@ -1808,8 +1808,8 @@ class BrowserVNCApplicationMfaConfig(TypedDict, total=False): allowed_authenticators: List[Literal["totp", "biometrics", "security_key"]] """Lists the MFA methods that users can authenticate with.""" - mfa_bypass: bool - """Indicates whether to bypass MFA for this resource. + mfa_disabled: bool + """Indicates whether to disable MFA for this resource. This option is available at the application and policy level. """ @@ -1920,8 +1920,8 @@ class BrowserVNCApplicationPolicyUnionMember2MfaConfig(TypedDict, total=False): allowed_authenticators: List[Literal["totp", "biometrics", "security_key"]] """Lists the MFA methods that users can authenticate with.""" - mfa_bypass: bool - """Indicates whether to bypass MFA for this resource. + mfa_disabled: bool + """Indicates whether to disable MFA for this resource. This option is available at the application and policy level. """ @@ -2246,8 +2246,8 @@ class AppLauncherApplicationPolicyUnionMember2MfaConfig(TypedDict, total=False): allowed_authenticators: List[Literal["totp", "biometrics", "security_key"]] """Lists the MFA methods that users can authenticate with.""" - mfa_bypass: bool - """Indicates whether to bypass MFA for this resource. + mfa_disabled: bool + """Indicates whether to disable MFA for this resource. This option is available at the application and policy level. """ @@ -2410,8 +2410,8 @@ class DeviceEnrollmentPermissionsApplicationPolicyUnionMember2MfaConfig(TypedDic allowed_authenticators: List[Literal["totp", "biometrics", "security_key"]] """Lists the MFA methods that users can authenticate with.""" - mfa_bypass: bool - """Indicates whether to bypass MFA for this resource. + mfa_disabled: bool + """Indicates whether to disable MFA for this resource. This option is available at the application and policy level. """ @@ -2576,8 +2576,8 @@ class BrowserIsolationPermissionsApplicationPolicyUnionMember2MfaConfig(TypedDic allowed_authenticators: List[Literal["totp", "biometrics", "security_key"]] """Lists the MFA methods that users can authenticate with.""" - mfa_bypass: bool - """Indicates whether to bypass MFA for this resource. + mfa_disabled: bool + """Indicates whether to disable MFA for this resource. This option is available at the application and policy level. """ @@ -2751,8 +2751,8 @@ class GatewayIdentityProxyEndpointApplicationPolicyUnionMember2MfaConfig(TypedDi allowed_authenticators: List[Literal["totp", "biometrics", "security_key"]] """Lists the MFA methods that users can authenticate with.""" - mfa_bypass: bool - """Indicates whether to bypass MFA for this resource. + mfa_disabled: bool + """Indicates whether to disable MFA for this resource. This option is available at the application and policy level. """ @@ -2899,8 +2899,8 @@ class BookmarkApplicationPolicyUnionMember2MfaConfig(TypedDict, total=False): allowed_authenticators: List[Literal["totp", "biometrics", "security_key"]] """Lists the MFA methods that users can authenticate with.""" - mfa_bypass: bool - """Indicates whether to bypass MFA for this resource. + mfa_disabled: bool + """Indicates whether to disable MFA for this resource. This option is available at the application and policy level. """ @@ -3324,8 +3324,8 @@ class BrowserRDPApplicationMfaConfig(TypedDict, total=False): allowed_authenticators: List[Literal["totp", "biometrics", "security_key"]] """Lists the MFA methods that users can authenticate with.""" - mfa_bypass: bool - """Indicates whether to bypass MFA for this resource. + mfa_disabled: bool + """Indicates whether to disable MFA for this resource. This option is available at the application and policy level. """ @@ -3436,8 +3436,8 @@ class BrowserRDPApplicationPolicyUnionMember2MfaConfig(TypedDict, total=False): allowed_authenticators: List[Literal["totp", "biometrics", "security_key"]] """Lists the MFA methods that users can authenticate with.""" - mfa_bypass: bool - """Indicates whether to bypass MFA for this resource. + mfa_disabled: bool + """Indicates whether to disable MFA for this resource. This option is available at the application and policy level. """ @@ -3883,8 +3883,8 @@ class McpServerApplicationPolicyUnionMember2MfaConfig(TypedDict, total=False): allowed_authenticators: List[Literal["totp", "biometrics", "security_key"]] """Lists the MFA methods that users can authenticate with.""" - mfa_bypass: bool - """Indicates whether to bypass MFA for this resource. + mfa_disabled: bool + """Indicates whether to disable MFA for this resource. This option is available at the application and policy level. """ @@ -4336,8 +4336,8 @@ class McpServerPortalApplicationPolicyUnionMember2MfaConfig(TypedDict, total=Fal allowed_authenticators: List[Literal["totp", "biometrics", "security_key"]] """Lists the MFA methods that users can authenticate with.""" - mfa_bypass: bool - """Indicates whether to bypass MFA for this resource. + mfa_disabled: bool + """Indicates whether to disable MFA for this resource. This option is available at the application and policy level. """ diff --git a/src/cloudflare/types/zero_trust/access/application_create_response.py b/src/cloudflare/types/zero_trust/access/application_create_response.py index 55500554b08..4b7f7e0395c 100644 --- a/src/cloudflare/types/zero_trust/access/application_create_response.py +++ b/src/cloudflare/types/zero_trust/access/application_create_response.py @@ -240,8 +240,8 @@ class SelfHostedApplicationMfaConfig(BaseModel): allowed_authenticators: Optional[List[Literal["totp", "biometrics", "security_key"]]] = None """Lists the MFA methods that users can authenticate with.""" - mfa_bypass: Optional[bool] = None - """Indicates whether to bypass MFA for this resource. + mfa_disabled: Optional[bool] = None + """Indicates whether to disable MFA for this resource. This option is available at the application and policy level. """ @@ -339,8 +339,8 @@ class SelfHostedApplicationPolicyMfaConfig(BaseModel): allowed_authenticators: Optional[List[Literal["totp", "biometrics", "security_key"]]] = None """Lists the MFA methods that users can authenticate with.""" - mfa_bypass: Optional[bool] = None - """Indicates whether to bypass MFA for this resource. + mfa_disabled: Optional[bool] = None + """Indicates whether to disable MFA for this resource. This option is available at the application and policy level. """ @@ -738,8 +738,8 @@ class SaaSApplicationPolicyMfaConfig(BaseModel): allowed_authenticators: Optional[List[Literal["totp", "biometrics", "security_key"]]] = None """Lists the MFA methods that users can authenticate with.""" - mfa_bypass: Optional[bool] = None - """Indicates whether to bypass MFA for this resource. + mfa_disabled: Optional[bool] = None + """Indicates whether to disable MFA for this resource. This option is available at the application and policy level. """ @@ -1052,8 +1052,8 @@ class BrowserSSHApplicationMfaConfig(BaseModel): allowed_authenticators: Optional[List[Literal["totp", "biometrics", "security_key"]]] = None """Lists the MFA methods that users can authenticate with.""" - mfa_bypass: Optional[bool] = None - """Indicates whether to bypass MFA for this resource. + mfa_disabled: Optional[bool] = None + """Indicates whether to disable MFA for this resource. This option is available at the application and policy level. """ @@ -1151,8 +1151,8 @@ class BrowserSSHApplicationPolicyMfaConfig(BaseModel): allowed_authenticators: Optional[List[Literal["totp", "biometrics", "security_key"]]] = None """Lists the MFA methods that users can authenticate with.""" - mfa_bypass: Optional[bool] = None - """Indicates whether to bypass MFA for this resource. + mfa_disabled: Optional[bool] = None + """Indicates whether to disable MFA for this resource. This option is available at the application and policy level. """ @@ -1602,8 +1602,8 @@ class BrowserVNCApplicationMfaConfig(BaseModel): allowed_authenticators: Optional[List[Literal["totp", "biometrics", "security_key"]]] = None """Lists the MFA methods that users can authenticate with.""" - mfa_bypass: Optional[bool] = None - """Indicates whether to bypass MFA for this resource. + mfa_disabled: Optional[bool] = None + """Indicates whether to disable MFA for this resource. This option is available at the application and policy level. """ @@ -1701,8 +1701,8 @@ class BrowserVNCApplicationPolicyMfaConfig(BaseModel): allowed_authenticators: Optional[List[Literal["totp", "biometrics", "security_key"]]] = None """Lists the MFA methods that users can authenticate with.""" - mfa_bypass: Optional[bool] = None - """Indicates whether to bypass MFA for this resource. + mfa_disabled: Optional[bool] = None + """Indicates whether to disable MFA for this resource. This option is available at the application and policy level. """ @@ -2142,8 +2142,8 @@ class AppLauncherApplicationPolicyMfaConfig(BaseModel): allowed_authenticators: Optional[List[Literal["totp", "biometrics", "security_key"]]] = None """Lists the MFA methods that users can authenticate with.""" - mfa_bypass: Optional[bool] = None - """Indicates whether to bypass MFA for this resource. + mfa_disabled: Optional[bool] = None + """Indicates whether to disable MFA for this resource. This option is available at the application and policy level. """ @@ -2356,8 +2356,8 @@ class DeviceEnrollmentPermissionsApplicationPolicyMfaConfig(BaseModel): allowed_authenticators: Optional[List[Literal["totp", "biometrics", "security_key"]]] = None """Lists the MFA methods that users can authenticate with.""" - mfa_bypass: Optional[bool] = None - """Indicates whether to bypass MFA for this resource. + mfa_disabled: Optional[bool] = None + """Indicates whether to disable MFA for this resource. This option is available at the application and policy level. """ @@ -2537,8 +2537,8 @@ class BrowserIsolationPermissionsApplicationPolicyMfaConfig(BaseModel): allowed_authenticators: Optional[List[Literal["totp", "biometrics", "security_key"]]] = None """Lists the MFA methods that users can authenticate with.""" - mfa_bypass: Optional[bool] = None - """Indicates whether to bypass MFA for this resource. + mfa_disabled: Optional[bool] = None + """Indicates whether to disable MFA for this resource. This option is available at the application and policy level. """ @@ -2718,8 +2718,8 @@ class GatewayIdentityProxyEndpointApplicationPolicyMfaConfig(BaseModel): allowed_authenticators: Optional[List[Literal["totp", "biometrics", "security_key"]]] = None """Lists the MFA methods that users can authenticate with.""" - mfa_bypass: Optional[bool] = None - """Indicates whether to bypass MFA for this resource. + mfa_disabled: Optional[bool] = None + """Indicates whether to disable MFA for this resource. This option is available at the application and policy level. """ @@ -2899,8 +2899,8 @@ class BookmarkApplicationPolicyMfaConfig(BaseModel): allowed_authenticators: Optional[List[Literal["totp", "biometrics", "security_key"]]] = None """Lists the MFA methods that users can authenticate with.""" - mfa_bypass: Optional[bool] = None - """Indicates whether to bypass MFA for this resource. + mfa_disabled: Optional[bool] = None + """Indicates whether to disable MFA for this resource. This option is available at the application and policy level. """ @@ -3202,8 +3202,8 @@ class BrowserRDPApplicationMfaConfig(BaseModel): allowed_authenticators: Optional[List[Literal["totp", "biometrics", "security_key"]]] = None """Lists the MFA methods that users can authenticate with.""" - mfa_bypass: Optional[bool] = None - """Indicates whether to bypass MFA for this resource. + mfa_disabled: Optional[bool] = None + """Indicates whether to disable MFA for this resource. This option is available at the application and policy level. """ @@ -3301,8 +3301,8 @@ class BrowserRDPApplicationPolicyMfaConfig(BaseModel): allowed_authenticators: Optional[List[Literal["totp", "biometrics", "security_key"]]] = None """Lists the MFA methods that users can authenticate with.""" - mfa_bypass: Optional[bool] = None - """Indicates whether to bypass MFA for this resource. + mfa_disabled: Optional[bool] = None + """Indicates whether to disable MFA for this resource. This option is available at the application and policy level. """ @@ -3818,8 +3818,8 @@ class McpServerApplicationPolicyMfaConfig(BaseModel): allowed_authenticators: Optional[List[Literal["totp", "biometrics", "security_key"]]] = None """Lists the MFA methods that users can authenticate with.""" - mfa_bypass: Optional[bool] = None - """Indicates whether to bypass MFA for this resource. + mfa_disabled: Optional[bool] = None + """Indicates whether to disable MFA for this resource. This option is available at the application and policy level. """ @@ -4271,8 +4271,8 @@ class McpServerPortalApplicationPolicyMfaConfig(BaseModel): allowed_authenticators: Optional[List[Literal["totp", "biometrics", "security_key"]]] = None """Lists the MFA methods that users can authenticate with.""" - mfa_bypass: Optional[bool] = None - """Indicates whether to bypass MFA for this resource. + mfa_disabled: Optional[bool] = None + """Indicates whether to disable MFA for this resource. This option is available at the application and policy level. """ diff --git a/src/cloudflare/types/zero_trust/access/application_get_response.py b/src/cloudflare/types/zero_trust/access/application_get_response.py index 18fe3f2a3d6..c9d356a54de 100644 --- a/src/cloudflare/types/zero_trust/access/application_get_response.py +++ b/src/cloudflare/types/zero_trust/access/application_get_response.py @@ -240,8 +240,8 @@ class SelfHostedApplicationMfaConfig(BaseModel): allowed_authenticators: Optional[List[Literal["totp", "biometrics", "security_key"]]] = None """Lists the MFA methods that users can authenticate with.""" - mfa_bypass: Optional[bool] = None - """Indicates whether to bypass MFA for this resource. + mfa_disabled: Optional[bool] = None + """Indicates whether to disable MFA for this resource. This option is available at the application and policy level. """ @@ -339,8 +339,8 @@ class SelfHostedApplicationPolicyMfaConfig(BaseModel): allowed_authenticators: Optional[List[Literal["totp", "biometrics", "security_key"]]] = None """Lists the MFA methods that users can authenticate with.""" - mfa_bypass: Optional[bool] = None - """Indicates whether to bypass MFA for this resource. + mfa_disabled: Optional[bool] = None + """Indicates whether to disable MFA for this resource. This option is available at the application and policy level. """ @@ -738,8 +738,8 @@ class SaaSApplicationPolicyMfaConfig(BaseModel): allowed_authenticators: Optional[List[Literal["totp", "biometrics", "security_key"]]] = None """Lists the MFA methods that users can authenticate with.""" - mfa_bypass: Optional[bool] = None - """Indicates whether to bypass MFA for this resource. + mfa_disabled: Optional[bool] = None + """Indicates whether to disable MFA for this resource. This option is available at the application and policy level. """ @@ -1052,8 +1052,8 @@ class BrowserSSHApplicationMfaConfig(BaseModel): allowed_authenticators: Optional[List[Literal["totp", "biometrics", "security_key"]]] = None """Lists the MFA methods that users can authenticate with.""" - mfa_bypass: Optional[bool] = None - """Indicates whether to bypass MFA for this resource. + mfa_disabled: Optional[bool] = None + """Indicates whether to disable MFA for this resource. This option is available at the application and policy level. """ @@ -1151,8 +1151,8 @@ class BrowserSSHApplicationPolicyMfaConfig(BaseModel): allowed_authenticators: Optional[List[Literal["totp", "biometrics", "security_key"]]] = None """Lists the MFA methods that users can authenticate with.""" - mfa_bypass: Optional[bool] = None - """Indicates whether to bypass MFA for this resource. + mfa_disabled: Optional[bool] = None + """Indicates whether to disable MFA for this resource. This option is available at the application and policy level. """ @@ -1602,8 +1602,8 @@ class BrowserVNCApplicationMfaConfig(BaseModel): allowed_authenticators: Optional[List[Literal["totp", "biometrics", "security_key"]]] = None """Lists the MFA methods that users can authenticate with.""" - mfa_bypass: Optional[bool] = None - """Indicates whether to bypass MFA for this resource. + mfa_disabled: Optional[bool] = None + """Indicates whether to disable MFA for this resource. This option is available at the application and policy level. """ @@ -1701,8 +1701,8 @@ class BrowserVNCApplicationPolicyMfaConfig(BaseModel): allowed_authenticators: Optional[List[Literal["totp", "biometrics", "security_key"]]] = None """Lists the MFA methods that users can authenticate with.""" - mfa_bypass: Optional[bool] = None - """Indicates whether to bypass MFA for this resource. + mfa_disabled: Optional[bool] = None + """Indicates whether to disable MFA for this resource. This option is available at the application and policy level. """ @@ -2142,8 +2142,8 @@ class AppLauncherApplicationPolicyMfaConfig(BaseModel): allowed_authenticators: Optional[List[Literal["totp", "biometrics", "security_key"]]] = None """Lists the MFA methods that users can authenticate with.""" - mfa_bypass: Optional[bool] = None - """Indicates whether to bypass MFA for this resource. + mfa_disabled: Optional[bool] = None + """Indicates whether to disable MFA for this resource. This option is available at the application and policy level. """ @@ -2356,8 +2356,8 @@ class DeviceEnrollmentPermissionsApplicationPolicyMfaConfig(BaseModel): allowed_authenticators: Optional[List[Literal["totp", "biometrics", "security_key"]]] = None """Lists the MFA methods that users can authenticate with.""" - mfa_bypass: Optional[bool] = None - """Indicates whether to bypass MFA for this resource. + mfa_disabled: Optional[bool] = None + """Indicates whether to disable MFA for this resource. This option is available at the application and policy level. """ @@ -2537,8 +2537,8 @@ class BrowserIsolationPermissionsApplicationPolicyMfaConfig(BaseModel): allowed_authenticators: Optional[List[Literal["totp", "biometrics", "security_key"]]] = None """Lists the MFA methods that users can authenticate with.""" - mfa_bypass: Optional[bool] = None - """Indicates whether to bypass MFA for this resource. + mfa_disabled: Optional[bool] = None + """Indicates whether to disable MFA for this resource. This option is available at the application and policy level. """ @@ -2718,8 +2718,8 @@ class GatewayIdentityProxyEndpointApplicationPolicyMfaConfig(BaseModel): allowed_authenticators: Optional[List[Literal["totp", "biometrics", "security_key"]]] = None """Lists the MFA methods that users can authenticate with.""" - mfa_bypass: Optional[bool] = None - """Indicates whether to bypass MFA for this resource. + mfa_disabled: Optional[bool] = None + """Indicates whether to disable MFA for this resource. This option is available at the application and policy level. """ @@ -2899,8 +2899,8 @@ class BookmarkApplicationPolicyMfaConfig(BaseModel): allowed_authenticators: Optional[List[Literal["totp", "biometrics", "security_key"]]] = None """Lists the MFA methods that users can authenticate with.""" - mfa_bypass: Optional[bool] = None - """Indicates whether to bypass MFA for this resource. + mfa_disabled: Optional[bool] = None + """Indicates whether to disable MFA for this resource. This option is available at the application and policy level. """ @@ -3202,8 +3202,8 @@ class BrowserRDPApplicationMfaConfig(BaseModel): allowed_authenticators: Optional[List[Literal["totp", "biometrics", "security_key"]]] = None """Lists the MFA methods that users can authenticate with.""" - mfa_bypass: Optional[bool] = None - """Indicates whether to bypass MFA for this resource. + mfa_disabled: Optional[bool] = None + """Indicates whether to disable MFA for this resource. This option is available at the application and policy level. """ @@ -3301,8 +3301,8 @@ class BrowserRDPApplicationPolicyMfaConfig(BaseModel): allowed_authenticators: Optional[List[Literal["totp", "biometrics", "security_key"]]] = None """Lists the MFA methods that users can authenticate with.""" - mfa_bypass: Optional[bool] = None - """Indicates whether to bypass MFA for this resource. + mfa_disabled: Optional[bool] = None + """Indicates whether to disable MFA for this resource. This option is available at the application and policy level. """ @@ -3818,8 +3818,8 @@ class McpServerApplicationPolicyMfaConfig(BaseModel): allowed_authenticators: Optional[List[Literal["totp", "biometrics", "security_key"]]] = None """Lists the MFA methods that users can authenticate with.""" - mfa_bypass: Optional[bool] = None - """Indicates whether to bypass MFA for this resource. + mfa_disabled: Optional[bool] = None + """Indicates whether to disable MFA for this resource. This option is available at the application and policy level. """ @@ -4271,8 +4271,8 @@ class McpServerPortalApplicationPolicyMfaConfig(BaseModel): allowed_authenticators: Optional[List[Literal["totp", "biometrics", "security_key"]]] = None """Lists the MFA methods that users can authenticate with.""" - mfa_bypass: Optional[bool] = None - """Indicates whether to bypass MFA for this resource. + mfa_disabled: Optional[bool] = None + """Indicates whether to disable MFA for this resource. This option is available at the application and policy level. """ diff --git a/src/cloudflare/types/zero_trust/access/application_list_response.py b/src/cloudflare/types/zero_trust/access/application_list_response.py index 4b779844b2b..1ff25475ba2 100644 --- a/src/cloudflare/types/zero_trust/access/application_list_response.py +++ b/src/cloudflare/types/zero_trust/access/application_list_response.py @@ -240,8 +240,8 @@ class SelfHostedApplicationMfaConfig(BaseModel): allowed_authenticators: Optional[List[Literal["totp", "biometrics", "security_key"]]] = None """Lists the MFA methods that users can authenticate with.""" - mfa_bypass: Optional[bool] = None - """Indicates whether to bypass MFA for this resource. + mfa_disabled: Optional[bool] = None + """Indicates whether to disable MFA for this resource. This option is available at the application and policy level. """ @@ -339,8 +339,8 @@ class SelfHostedApplicationPolicyMfaConfig(BaseModel): allowed_authenticators: Optional[List[Literal["totp", "biometrics", "security_key"]]] = None """Lists the MFA methods that users can authenticate with.""" - mfa_bypass: Optional[bool] = None - """Indicates whether to bypass MFA for this resource. + mfa_disabled: Optional[bool] = None + """Indicates whether to disable MFA for this resource. This option is available at the application and policy level. """ @@ -738,8 +738,8 @@ class SaaSApplicationPolicyMfaConfig(BaseModel): allowed_authenticators: Optional[List[Literal["totp", "biometrics", "security_key"]]] = None """Lists the MFA methods that users can authenticate with.""" - mfa_bypass: Optional[bool] = None - """Indicates whether to bypass MFA for this resource. + mfa_disabled: Optional[bool] = None + """Indicates whether to disable MFA for this resource. This option is available at the application and policy level. """ @@ -1052,8 +1052,8 @@ class BrowserSSHApplicationMfaConfig(BaseModel): allowed_authenticators: Optional[List[Literal["totp", "biometrics", "security_key"]]] = None """Lists the MFA methods that users can authenticate with.""" - mfa_bypass: Optional[bool] = None - """Indicates whether to bypass MFA for this resource. + mfa_disabled: Optional[bool] = None + """Indicates whether to disable MFA for this resource. This option is available at the application and policy level. """ @@ -1151,8 +1151,8 @@ class BrowserSSHApplicationPolicyMfaConfig(BaseModel): allowed_authenticators: Optional[List[Literal["totp", "biometrics", "security_key"]]] = None """Lists the MFA methods that users can authenticate with.""" - mfa_bypass: Optional[bool] = None - """Indicates whether to bypass MFA for this resource. + mfa_disabled: Optional[bool] = None + """Indicates whether to disable MFA for this resource. This option is available at the application and policy level. """ @@ -1602,8 +1602,8 @@ class BrowserVNCApplicationMfaConfig(BaseModel): allowed_authenticators: Optional[List[Literal["totp", "biometrics", "security_key"]]] = None """Lists the MFA methods that users can authenticate with.""" - mfa_bypass: Optional[bool] = None - """Indicates whether to bypass MFA for this resource. + mfa_disabled: Optional[bool] = None + """Indicates whether to disable MFA for this resource. This option is available at the application and policy level. """ @@ -1701,8 +1701,8 @@ class BrowserVNCApplicationPolicyMfaConfig(BaseModel): allowed_authenticators: Optional[List[Literal["totp", "biometrics", "security_key"]]] = None """Lists the MFA methods that users can authenticate with.""" - mfa_bypass: Optional[bool] = None - """Indicates whether to bypass MFA for this resource. + mfa_disabled: Optional[bool] = None + """Indicates whether to disable MFA for this resource. This option is available at the application and policy level. """ @@ -2142,8 +2142,8 @@ class AppLauncherApplicationPolicyMfaConfig(BaseModel): allowed_authenticators: Optional[List[Literal["totp", "biometrics", "security_key"]]] = None """Lists the MFA methods that users can authenticate with.""" - mfa_bypass: Optional[bool] = None - """Indicates whether to bypass MFA for this resource. + mfa_disabled: Optional[bool] = None + """Indicates whether to disable MFA for this resource. This option is available at the application and policy level. """ @@ -2356,8 +2356,8 @@ class DeviceEnrollmentPermissionsApplicationPolicyMfaConfig(BaseModel): allowed_authenticators: Optional[List[Literal["totp", "biometrics", "security_key"]]] = None """Lists the MFA methods that users can authenticate with.""" - mfa_bypass: Optional[bool] = None - """Indicates whether to bypass MFA for this resource. + mfa_disabled: Optional[bool] = None + """Indicates whether to disable MFA for this resource. This option is available at the application and policy level. """ @@ -2537,8 +2537,8 @@ class BrowserIsolationPermissionsApplicationPolicyMfaConfig(BaseModel): allowed_authenticators: Optional[List[Literal["totp", "biometrics", "security_key"]]] = None """Lists the MFA methods that users can authenticate with.""" - mfa_bypass: Optional[bool] = None - """Indicates whether to bypass MFA for this resource. + mfa_disabled: Optional[bool] = None + """Indicates whether to disable MFA for this resource. This option is available at the application and policy level. """ @@ -2718,8 +2718,8 @@ class GatewayIdentityProxyEndpointApplicationPolicyMfaConfig(BaseModel): allowed_authenticators: Optional[List[Literal["totp", "biometrics", "security_key"]]] = None """Lists the MFA methods that users can authenticate with.""" - mfa_bypass: Optional[bool] = None - """Indicates whether to bypass MFA for this resource. + mfa_disabled: Optional[bool] = None + """Indicates whether to disable MFA for this resource. This option is available at the application and policy level. """ @@ -2899,8 +2899,8 @@ class BookmarkApplicationPolicyMfaConfig(BaseModel): allowed_authenticators: Optional[List[Literal["totp", "biometrics", "security_key"]]] = None """Lists the MFA methods that users can authenticate with.""" - mfa_bypass: Optional[bool] = None - """Indicates whether to bypass MFA for this resource. + mfa_disabled: Optional[bool] = None + """Indicates whether to disable MFA for this resource. This option is available at the application and policy level. """ @@ -3202,8 +3202,8 @@ class BrowserRDPApplicationMfaConfig(BaseModel): allowed_authenticators: Optional[List[Literal["totp", "biometrics", "security_key"]]] = None """Lists the MFA methods that users can authenticate with.""" - mfa_bypass: Optional[bool] = None - """Indicates whether to bypass MFA for this resource. + mfa_disabled: Optional[bool] = None + """Indicates whether to disable MFA for this resource. This option is available at the application and policy level. """ @@ -3301,8 +3301,8 @@ class BrowserRDPApplicationPolicyMfaConfig(BaseModel): allowed_authenticators: Optional[List[Literal["totp", "biometrics", "security_key"]]] = None """Lists the MFA methods that users can authenticate with.""" - mfa_bypass: Optional[bool] = None - """Indicates whether to bypass MFA for this resource. + mfa_disabled: Optional[bool] = None + """Indicates whether to disable MFA for this resource. This option is available at the application and policy level. """ @@ -3818,8 +3818,8 @@ class McpServerApplicationPolicyMfaConfig(BaseModel): allowed_authenticators: Optional[List[Literal["totp", "biometrics", "security_key"]]] = None """Lists the MFA methods that users can authenticate with.""" - mfa_bypass: Optional[bool] = None - """Indicates whether to bypass MFA for this resource. + mfa_disabled: Optional[bool] = None + """Indicates whether to disable MFA for this resource. This option is available at the application and policy level. """ @@ -4271,8 +4271,8 @@ class McpServerPortalApplicationPolicyMfaConfig(BaseModel): allowed_authenticators: Optional[List[Literal["totp", "biometrics", "security_key"]]] = None """Lists the MFA methods that users can authenticate with.""" - mfa_bypass: Optional[bool] = None - """Indicates whether to bypass MFA for this resource. + mfa_disabled: Optional[bool] = None + """Indicates whether to disable MFA for this resource. This option is available at the application and policy level. """ diff --git a/src/cloudflare/types/zero_trust/access/application_update_params.py b/src/cloudflare/types/zero_trust/access/application_update_params.py index 03c6de94cb4..c812ed225d1 100644 --- a/src/cloudflare/types/zero_trust/access/application_update_params.py +++ b/src/cloudflare/types/zero_trust/access/application_update_params.py @@ -448,8 +448,8 @@ class SelfHostedApplicationMfaConfig(TypedDict, total=False): allowed_authenticators: List[Literal["totp", "biometrics", "security_key"]] """Lists the MFA methods that users can authenticate with.""" - mfa_bypass: bool - """Indicates whether to bypass MFA for this resource. + mfa_disabled: bool + """Indicates whether to disable MFA for this resource. This option is available at the application and policy level. """ @@ -560,8 +560,8 @@ class SelfHostedApplicationPolicyUnionMember2MfaConfig(TypedDict, total=False): allowed_authenticators: List[Literal["totp", "biometrics", "security_key"]] """Lists the MFA methods that users can authenticate with.""" - mfa_bypass: bool - """Indicates whether to bypass MFA for this resource. + mfa_disabled: bool + """Indicates whether to disable MFA for this resource. This option is available at the application and policy level. """ @@ -828,8 +828,8 @@ class SaaSApplicationPolicyUnionMember2MfaConfig(TypedDict, total=False): allowed_authenticators: List[Literal["totp", "biometrics", "security_key"]] """Lists the MFA methods that users can authenticate with.""" - mfa_bypass: bool - """Indicates whether to bypass MFA for this resource. + mfa_disabled: bool + """Indicates whether to disable MFA for this resource. This option is available at the application and policy level. """ @@ -1262,8 +1262,8 @@ class BrowserSSHApplicationMfaConfig(TypedDict, total=False): allowed_authenticators: List[Literal["totp", "biometrics", "security_key"]] """Lists the MFA methods that users can authenticate with.""" - mfa_bypass: bool - """Indicates whether to bypass MFA for this resource. + mfa_disabled: bool + """Indicates whether to disable MFA for this resource. This option is available at the application and policy level. """ @@ -1374,8 +1374,8 @@ class BrowserSSHApplicationPolicyUnionMember2MfaConfig(TypedDict, total=False): allowed_authenticators: List[Literal["totp", "biometrics", "security_key"]] """Lists the MFA methods that users can authenticate with.""" - mfa_bypass: bool - """Indicates whether to bypass MFA for this resource. + mfa_disabled: bool + """Indicates whether to disable MFA for this resource. This option is available at the application and policy level. """ @@ -1808,8 +1808,8 @@ class BrowserVNCApplicationMfaConfig(TypedDict, total=False): allowed_authenticators: List[Literal["totp", "biometrics", "security_key"]] """Lists the MFA methods that users can authenticate with.""" - mfa_bypass: bool - """Indicates whether to bypass MFA for this resource. + mfa_disabled: bool + """Indicates whether to disable MFA for this resource. This option is available at the application and policy level. """ @@ -1920,8 +1920,8 @@ class BrowserVNCApplicationPolicyUnionMember2MfaConfig(TypedDict, total=False): allowed_authenticators: List[Literal["totp", "biometrics", "security_key"]] """Lists the MFA methods that users can authenticate with.""" - mfa_bypass: bool - """Indicates whether to bypass MFA for this resource. + mfa_disabled: bool + """Indicates whether to disable MFA for this resource. This option is available at the application and policy level. """ @@ -2246,8 +2246,8 @@ class AppLauncherApplicationPolicyUnionMember2MfaConfig(TypedDict, total=False): allowed_authenticators: List[Literal["totp", "biometrics", "security_key"]] """Lists the MFA methods that users can authenticate with.""" - mfa_bypass: bool - """Indicates whether to bypass MFA for this resource. + mfa_disabled: bool + """Indicates whether to disable MFA for this resource. This option is available at the application and policy level. """ @@ -2410,8 +2410,8 @@ class DeviceEnrollmentPermissionsApplicationPolicyUnionMember2MfaConfig(TypedDic allowed_authenticators: List[Literal["totp", "biometrics", "security_key"]] """Lists the MFA methods that users can authenticate with.""" - mfa_bypass: bool - """Indicates whether to bypass MFA for this resource. + mfa_disabled: bool + """Indicates whether to disable MFA for this resource. This option is available at the application and policy level. """ @@ -2576,8 +2576,8 @@ class BrowserIsolationPermissionsApplicationPolicyUnionMember2MfaConfig(TypedDic allowed_authenticators: List[Literal["totp", "biometrics", "security_key"]] """Lists the MFA methods that users can authenticate with.""" - mfa_bypass: bool - """Indicates whether to bypass MFA for this resource. + mfa_disabled: bool + """Indicates whether to disable MFA for this resource. This option is available at the application and policy level. """ @@ -2751,8 +2751,8 @@ class GatewayIdentityProxyEndpointApplicationPolicyUnionMember2MfaConfig(TypedDi allowed_authenticators: List[Literal["totp", "biometrics", "security_key"]] """Lists the MFA methods that users can authenticate with.""" - mfa_bypass: bool - """Indicates whether to bypass MFA for this resource. + mfa_disabled: bool + """Indicates whether to disable MFA for this resource. This option is available at the application and policy level. """ @@ -2899,8 +2899,8 @@ class BookmarkApplicationPolicyUnionMember2MfaConfig(TypedDict, total=False): allowed_authenticators: List[Literal["totp", "biometrics", "security_key"]] """Lists the MFA methods that users can authenticate with.""" - mfa_bypass: bool - """Indicates whether to bypass MFA for this resource. + mfa_disabled: bool + """Indicates whether to disable MFA for this resource. This option is available at the application and policy level. """ @@ -3324,8 +3324,8 @@ class BrowserRDPApplicationMfaConfig(TypedDict, total=False): allowed_authenticators: List[Literal["totp", "biometrics", "security_key"]] """Lists the MFA methods that users can authenticate with.""" - mfa_bypass: bool - """Indicates whether to bypass MFA for this resource. + mfa_disabled: bool + """Indicates whether to disable MFA for this resource. This option is available at the application and policy level. """ @@ -3436,8 +3436,8 @@ class BrowserRDPApplicationPolicyUnionMember2MfaConfig(TypedDict, total=False): allowed_authenticators: List[Literal["totp", "biometrics", "security_key"]] """Lists the MFA methods that users can authenticate with.""" - mfa_bypass: bool - """Indicates whether to bypass MFA for this resource. + mfa_disabled: bool + """Indicates whether to disable MFA for this resource. This option is available at the application and policy level. """ @@ -3883,8 +3883,8 @@ class McpServerApplicationPolicyUnionMember2MfaConfig(TypedDict, total=False): allowed_authenticators: List[Literal["totp", "biometrics", "security_key"]] """Lists the MFA methods that users can authenticate with.""" - mfa_bypass: bool - """Indicates whether to bypass MFA for this resource. + mfa_disabled: bool + """Indicates whether to disable MFA for this resource. This option is available at the application and policy level. """ @@ -4336,8 +4336,8 @@ class McpServerPortalApplicationPolicyUnionMember2MfaConfig(TypedDict, total=Fal allowed_authenticators: List[Literal["totp", "biometrics", "security_key"]] """Lists the MFA methods that users can authenticate with.""" - mfa_bypass: bool - """Indicates whether to bypass MFA for this resource. + mfa_disabled: bool + """Indicates whether to disable MFA for this resource. This option is available at the application and policy level. """ diff --git a/src/cloudflare/types/zero_trust/access/application_update_response.py b/src/cloudflare/types/zero_trust/access/application_update_response.py index fb3ebf8f7bf..d29527de7be 100644 --- a/src/cloudflare/types/zero_trust/access/application_update_response.py +++ b/src/cloudflare/types/zero_trust/access/application_update_response.py @@ -240,8 +240,8 @@ class SelfHostedApplicationMfaConfig(BaseModel): allowed_authenticators: Optional[List[Literal["totp", "biometrics", "security_key"]]] = None """Lists the MFA methods that users can authenticate with.""" - mfa_bypass: Optional[bool] = None - """Indicates whether to bypass MFA for this resource. + mfa_disabled: Optional[bool] = None + """Indicates whether to disable MFA for this resource. This option is available at the application and policy level. """ @@ -339,8 +339,8 @@ class SelfHostedApplicationPolicyMfaConfig(BaseModel): allowed_authenticators: Optional[List[Literal["totp", "biometrics", "security_key"]]] = None """Lists the MFA methods that users can authenticate with.""" - mfa_bypass: Optional[bool] = None - """Indicates whether to bypass MFA for this resource. + mfa_disabled: Optional[bool] = None + """Indicates whether to disable MFA for this resource. This option is available at the application and policy level. """ @@ -738,8 +738,8 @@ class SaaSApplicationPolicyMfaConfig(BaseModel): allowed_authenticators: Optional[List[Literal["totp", "biometrics", "security_key"]]] = None """Lists the MFA methods that users can authenticate with.""" - mfa_bypass: Optional[bool] = None - """Indicates whether to bypass MFA for this resource. + mfa_disabled: Optional[bool] = None + """Indicates whether to disable MFA for this resource. This option is available at the application and policy level. """ @@ -1052,8 +1052,8 @@ class BrowserSSHApplicationMfaConfig(BaseModel): allowed_authenticators: Optional[List[Literal["totp", "biometrics", "security_key"]]] = None """Lists the MFA methods that users can authenticate with.""" - mfa_bypass: Optional[bool] = None - """Indicates whether to bypass MFA for this resource. + mfa_disabled: Optional[bool] = None + """Indicates whether to disable MFA for this resource. This option is available at the application and policy level. """ @@ -1151,8 +1151,8 @@ class BrowserSSHApplicationPolicyMfaConfig(BaseModel): allowed_authenticators: Optional[List[Literal["totp", "biometrics", "security_key"]]] = None """Lists the MFA methods that users can authenticate with.""" - mfa_bypass: Optional[bool] = None - """Indicates whether to bypass MFA for this resource. + mfa_disabled: Optional[bool] = None + """Indicates whether to disable MFA for this resource. This option is available at the application and policy level. """ @@ -1602,8 +1602,8 @@ class BrowserVNCApplicationMfaConfig(BaseModel): allowed_authenticators: Optional[List[Literal["totp", "biometrics", "security_key"]]] = None """Lists the MFA methods that users can authenticate with.""" - mfa_bypass: Optional[bool] = None - """Indicates whether to bypass MFA for this resource. + mfa_disabled: Optional[bool] = None + """Indicates whether to disable MFA for this resource. This option is available at the application and policy level. """ @@ -1701,8 +1701,8 @@ class BrowserVNCApplicationPolicyMfaConfig(BaseModel): allowed_authenticators: Optional[List[Literal["totp", "biometrics", "security_key"]]] = None """Lists the MFA methods that users can authenticate with.""" - mfa_bypass: Optional[bool] = None - """Indicates whether to bypass MFA for this resource. + mfa_disabled: Optional[bool] = None + """Indicates whether to disable MFA for this resource. This option is available at the application and policy level. """ @@ -2142,8 +2142,8 @@ class AppLauncherApplicationPolicyMfaConfig(BaseModel): allowed_authenticators: Optional[List[Literal["totp", "biometrics", "security_key"]]] = None """Lists the MFA methods that users can authenticate with.""" - mfa_bypass: Optional[bool] = None - """Indicates whether to bypass MFA for this resource. + mfa_disabled: Optional[bool] = None + """Indicates whether to disable MFA for this resource. This option is available at the application and policy level. """ @@ -2356,8 +2356,8 @@ class DeviceEnrollmentPermissionsApplicationPolicyMfaConfig(BaseModel): allowed_authenticators: Optional[List[Literal["totp", "biometrics", "security_key"]]] = None """Lists the MFA methods that users can authenticate with.""" - mfa_bypass: Optional[bool] = None - """Indicates whether to bypass MFA for this resource. + mfa_disabled: Optional[bool] = None + """Indicates whether to disable MFA for this resource. This option is available at the application and policy level. """ @@ -2537,8 +2537,8 @@ class BrowserIsolationPermissionsApplicationPolicyMfaConfig(BaseModel): allowed_authenticators: Optional[List[Literal["totp", "biometrics", "security_key"]]] = None """Lists the MFA methods that users can authenticate with.""" - mfa_bypass: Optional[bool] = None - """Indicates whether to bypass MFA for this resource. + mfa_disabled: Optional[bool] = None + """Indicates whether to disable MFA for this resource. This option is available at the application and policy level. """ @@ -2718,8 +2718,8 @@ class GatewayIdentityProxyEndpointApplicationPolicyMfaConfig(BaseModel): allowed_authenticators: Optional[List[Literal["totp", "biometrics", "security_key"]]] = None """Lists the MFA methods that users can authenticate with.""" - mfa_bypass: Optional[bool] = None - """Indicates whether to bypass MFA for this resource. + mfa_disabled: Optional[bool] = None + """Indicates whether to disable MFA for this resource. This option is available at the application and policy level. """ @@ -2899,8 +2899,8 @@ class BookmarkApplicationPolicyMfaConfig(BaseModel): allowed_authenticators: Optional[List[Literal["totp", "biometrics", "security_key"]]] = None """Lists the MFA methods that users can authenticate with.""" - mfa_bypass: Optional[bool] = None - """Indicates whether to bypass MFA for this resource. + mfa_disabled: Optional[bool] = None + """Indicates whether to disable MFA for this resource. This option is available at the application and policy level. """ @@ -3202,8 +3202,8 @@ class BrowserRDPApplicationMfaConfig(BaseModel): allowed_authenticators: Optional[List[Literal["totp", "biometrics", "security_key"]]] = None """Lists the MFA methods that users can authenticate with.""" - mfa_bypass: Optional[bool] = None - """Indicates whether to bypass MFA for this resource. + mfa_disabled: Optional[bool] = None + """Indicates whether to disable MFA for this resource. This option is available at the application and policy level. """ @@ -3301,8 +3301,8 @@ class BrowserRDPApplicationPolicyMfaConfig(BaseModel): allowed_authenticators: Optional[List[Literal["totp", "biometrics", "security_key"]]] = None """Lists the MFA methods that users can authenticate with.""" - mfa_bypass: Optional[bool] = None - """Indicates whether to bypass MFA for this resource. + mfa_disabled: Optional[bool] = None + """Indicates whether to disable MFA for this resource. This option is available at the application and policy level. """ @@ -3818,8 +3818,8 @@ class McpServerApplicationPolicyMfaConfig(BaseModel): allowed_authenticators: Optional[List[Literal["totp", "biometrics", "security_key"]]] = None """Lists the MFA methods that users can authenticate with.""" - mfa_bypass: Optional[bool] = None - """Indicates whether to bypass MFA for this resource. + mfa_disabled: Optional[bool] = None + """Indicates whether to disable MFA for this resource. This option is available at the application and policy level. """ @@ -4271,8 +4271,8 @@ class McpServerPortalApplicationPolicyMfaConfig(BaseModel): allowed_authenticators: Optional[List[Literal["totp", "biometrics", "security_key"]]] = None """Lists the MFA methods that users can authenticate with.""" - mfa_bypass: Optional[bool] = None - """Indicates whether to bypass MFA for this resource. + mfa_disabled: Optional[bool] = None + """Indicates whether to disable MFA for this resource. This option is available at the application and policy level. """ diff --git a/src/cloudflare/types/zero_trust/access/applications/access_rule.py b/src/cloudflare/types/zero_trust/access/applications/access_rule.py index 67f2997529e..c9ea53edc3f 100644 --- a/src/cloudflare/types/zero_trust/access/applications/access_rule.py +++ b/src/cloudflare/types/zero_trust/access/applications/access_rule.py @@ -1,7 +1,7 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import Union -from typing_extensions import TypeAlias +from typing import List, Union +from typing_extensions import Literal, TypeAlias from .ip_rule import IPRule from .email_rule import EmailRule @@ -36,6 +36,8 @@ "AccessOIDCClaimRuleOIDC", "AccessLinkedAppTokenRule", "AccessLinkedAppTokenRuleLinkedAppToken", + "AccessUserRiskScoreRule", + "AccessUserRiskScoreRuleUserRiskScore", ] @@ -114,6 +116,20 @@ class AccessLinkedAppTokenRule(BaseModel): linked_app_token: AccessLinkedAppTokenRuleLinkedAppToken +class AccessUserRiskScoreRuleUserRiskScore(BaseModel): + user_risk_score: List[Literal["low", "medium", "high", "unscored"]] + """A list of risk score levels to match. + + Values can be low, medium, high, or unscored. + """ + + +class AccessUserRiskScoreRule(BaseModel): + """Matches a user's risk score.""" + + user_risk_score: AccessUserRiskScoreRuleUserRiskScore + + AccessRule: TypeAlias = Union[ GroupRule, AnyValidServiceTokenRule, @@ -139,4 +155,5 @@ class AccessLinkedAppTokenRule(BaseModel): AccessOIDCClaimRule, ServiceTokenRule, AccessLinkedAppTokenRule, + AccessUserRiskScoreRule, ] diff --git a/src/cloudflare/types/zero_trust/access/applications/access_rule_param.py b/src/cloudflare/types/zero_trust/access/applications/access_rule_param.py index ce3a266fe9f..65d2137c1aa 100644 --- a/src/cloudflare/types/zero_trust/access/applications/access_rule_param.py +++ b/src/cloudflare/types/zero_trust/access/applications/access_rule_param.py @@ -2,8 +2,8 @@ from __future__ import annotations -from typing import Union -from typing_extensions import Required, TypeAlias, TypedDict +from typing import List, Union +from typing_extensions import Literal, Required, TypeAlias, TypedDict from .ip_rule_param import IPRuleParam from .email_rule_param import EmailRuleParam @@ -37,6 +37,8 @@ "AccessOIDCClaimRuleOIDC", "AccessLinkedAppTokenRule", "AccessLinkedAppTokenRuleLinkedAppToken", + "AccessUserRiskScoreRule", + "AccessUserRiskScoreRuleUserRiskScore", ] @@ -115,6 +117,20 @@ class AccessLinkedAppTokenRule(TypedDict, total=False): linked_app_token: Required[AccessLinkedAppTokenRuleLinkedAppToken] +class AccessUserRiskScoreRuleUserRiskScore(TypedDict, total=False): + user_risk_score: Required[List[Literal["low", "medium", "high", "unscored"]]] + """A list of risk score levels to match. + + Values can be low, medium, high, or unscored. + """ + + +class AccessUserRiskScoreRule(TypedDict, total=False): + """Matches a user's risk score.""" + + user_risk_score: Required[AccessUserRiskScoreRuleUserRiskScore] + + AccessRuleParam: TypeAlias = Union[ GroupRuleParam, AnyValidServiceTokenRuleParam, @@ -140,4 +156,5 @@ class AccessLinkedAppTokenRule(TypedDict, total=False): AccessOIDCClaimRule, ServiceTokenRuleParam, AccessLinkedAppTokenRule, + AccessUserRiskScoreRule, ] diff --git a/src/cloudflare/types/zero_trust/access/applications/policy_create_params.py b/src/cloudflare/types/zero_trust/access/applications/policy_create_params.py index 9dd797afa07..6477b49cf17 100644 --- a/src/cloudflare/types/zero_trust/access/applications/policy_create_params.py +++ b/src/cloudflare/types/zero_trust/access/applications/policy_create_params.py @@ -91,8 +91,8 @@ class MfaConfig(TypedDict, total=False): allowed_authenticators: List[Literal["totp", "biometrics", "security_key"]] """Lists the MFA methods that users can authenticate with.""" - mfa_bypass: bool - """Indicates whether to bypass MFA for this resource. + mfa_disabled: bool + """Indicates whether to disable MFA for this resource. This option is available at the application and policy level. """ diff --git a/src/cloudflare/types/zero_trust/access/applications/policy_create_response.py b/src/cloudflare/types/zero_trust/access/applications/policy_create_response.py index 05d87c5ee24..cdf59ce5d0d 100644 --- a/src/cloudflare/types/zero_trust/access/applications/policy_create_response.py +++ b/src/cloudflare/types/zero_trust/access/applications/policy_create_response.py @@ -41,8 +41,8 @@ class MfaConfig(BaseModel): allowed_authenticators: Optional[List[Literal["totp", "biometrics", "security_key"]]] = None """Lists the MFA methods that users can authenticate with.""" - mfa_bypass: Optional[bool] = None - """Indicates whether to bypass MFA for this resource. + mfa_disabled: Optional[bool] = None + """Indicates whether to disable MFA for this resource. This option is available at the application and policy level. """ diff --git a/src/cloudflare/types/zero_trust/access/applications/policy_get_response.py b/src/cloudflare/types/zero_trust/access/applications/policy_get_response.py index 4bc53c6fe31..d7538baf291 100644 --- a/src/cloudflare/types/zero_trust/access/applications/policy_get_response.py +++ b/src/cloudflare/types/zero_trust/access/applications/policy_get_response.py @@ -41,8 +41,8 @@ class MfaConfig(BaseModel): allowed_authenticators: Optional[List[Literal["totp", "biometrics", "security_key"]]] = None """Lists the MFA methods that users can authenticate with.""" - mfa_bypass: Optional[bool] = None - """Indicates whether to bypass MFA for this resource. + mfa_disabled: Optional[bool] = None + """Indicates whether to disable MFA for this resource. This option is available at the application and policy level. """ diff --git a/src/cloudflare/types/zero_trust/access/applications/policy_list_response.py b/src/cloudflare/types/zero_trust/access/applications/policy_list_response.py index 2ab9487d994..57b971525ba 100644 --- a/src/cloudflare/types/zero_trust/access/applications/policy_list_response.py +++ b/src/cloudflare/types/zero_trust/access/applications/policy_list_response.py @@ -41,8 +41,8 @@ class MfaConfig(BaseModel): allowed_authenticators: Optional[List[Literal["totp", "biometrics", "security_key"]]] = None """Lists the MFA methods that users can authenticate with.""" - mfa_bypass: Optional[bool] = None - """Indicates whether to bypass MFA for this resource. + mfa_disabled: Optional[bool] = None + """Indicates whether to disable MFA for this resource. This option is available at the application and policy level. """ 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 index 26bb9d12cda..6be89506f1f 100755 --- 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 @@ -56,8 +56,8 @@ class PolicyUnionMember0MfaConfig(TypedDict, total=False): allowed_authenticators: List[Literal["totp", "biometrics", "security_key"]] """Lists the MFA methods that users can authenticate with.""" - mfa_bypass: bool - """Indicates whether to bypass MFA for this resource. + mfa_disabled: bool + """Indicates whether to disable MFA for this resource. This option is available at the application and policy level. """ diff --git a/src/cloudflare/types/zero_trust/access/applications/policy_update_params.py b/src/cloudflare/types/zero_trust/access/applications/policy_update_params.py index c659d26c501..329852be992 100644 --- a/src/cloudflare/types/zero_trust/access/applications/policy_update_params.py +++ b/src/cloudflare/types/zero_trust/access/applications/policy_update_params.py @@ -94,8 +94,8 @@ class MfaConfig(TypedDict, total=False): allowed_authenticators: List[Literal["totp", "biometrics", "security_key"]] """Lists the MFA methods that users can authenticate with.""" - mfa_bypass: bool - """Indicates whether to bypass MFA for this resource. + mfa_disabled: bool + """Indicates whether to disable MFA for this resource. This option is available at the application and policy level. """ diff --git a/src/cloudflare/types/zero_trust/access/applications/policy_update_response.py b/src/cloudflare/types/zero_trust/access/applications/policy_update_response.py index 00c9ac9a19a..05cddf19586 100644 --- a/src/cloudflare/types/zero_trust/access/applications/policy_update_response.py +++ b/src/cloudflare/types/zero_trust/access/applications/policy_update_response.py @@ -41,8 +41,8 @@ class MfaConfig(BaseModel): allowed_authenticators: Optional[List[Literal["totp", "biometrics", "security_key"]]] = None """Lists the MFA methods that users can authenticate with.""" - mfa_bypass: Optional[bool] = None - """Indicates whether to bypass MFA for this resource. + mfa_disabled: Optional[bool] = None + """Indicates whether to disable MFA for this resource. This option is available at the application and policy level. """ diff --git a/src/cloudflare/types/zero_trust/access/policy_create_params.py b/src/cloudflare/types/zero_trust/access/policy_create_params.py index a9c3015f40a..880b61d6c48 100644 --- a/src/cloudflare/types/zero_trust/access/policy_create_params.py +++ b/src/cloudflare/types/zero_trust/access/policy_create_params.py @@ -111,8 +111,8 @@ class MfaConfig(TypedDict, total=False): allowed_authenticators: List[Literal["totp", "biometrics", "security_key"]] """Lists the MFA methods that users can authenticate with.""" - mfa_bypass: bool - """Indicates whether to bypass MFA for this resource. + mfa_disabled: bool + """Indicates whether to disable MFA for this resource. This option is available at the application and policy level. """ diff --git a/src/cloudflare/types/zero_trust/access/policy_create_response.py b/src/cloudflare/types/zero_trust/access/policy_create_response.py index aec26906ba5..49c180e3f85 100644 --- a/src/cloudflare/types/zero_trust/access/policy_create_response.py +++ b/src/cloudflare/types/zero_trust/access/policy_create_response.py @@ -41,8 +41,8 @@ class MfaConfig(BaseModel): allowed_authenticators: Optional[List[Literal["totp", "biometrics", "security_key"]]] = None """Lists the MFA methods that users can authenticate with.""" - mfa_bypass: Optional[bool] = None - """Indicates whether to bypass MFA for this resource. + mfa_disabled: Optional[bool] = None + """Indicates whether to disable MFA for this resource. This option is available at the application and policy level. """ diff --git a/src/cloudflare/types/zero_trust/access/policy_get_response.py b/src/cloudflare/types/zero_trust/access/policy_get_response.py index 966a199fbe6..5cad1569744 100644 --- a/src/cloudflare/types/zero_trust/access/policy_get_response.py +++ b/src/cloudflare/types/zero_trust/access/policy_get_response.py @@ -41,8 +41,8 @@ class MfaConfig(BaseModel): allowed_authenticators: Optional[List[Literal["totp", "biometrics", "security_key"]]] = None """Lists the MFA methods that users can authenticate with.""" - mfa_bypass: Optional[bool] = None - """Indicates whether to bypass MFA for this resource. + mfa_disabled: Optional[bool] = None + """Indicates whether to disable MFA for this resource. This option is available at the application and policy level. """ diff --git a/src/cloudflare/types/zero_trust/access/policy_list_response.py b/src/cloudflare/types/zero_trust/access/policy_list_response.py index 39477e671db..d765cdd4eba 100644 --- a/src/cloudflare/types/zero_trust/access/policy_list_response.py +++ b/src/cloudflare/types/zero_trust/access/policy_list_response.py @@ -41,8 +41,8 @@ class MfaConfig(BaseModel): allowed_authenticators: Optional[List[Literal["totp", "biometrics", "security_key"]]] = None """Lists the MFA methods that users can authenticate with.""" - mfa_bypass: Optional[bool] = None - """Indicates whether to bypass MFA for this resource. + mfa_disabled: Optional[bool] = None + """Indicates whether to disable MFA for this resource. This option is available at the application and policy level. """ diff --git a/src/cloudflare/types/zero_trust/access/policy_update_params.py b/src/cloudflare/types/zero_trust/access/policy_update_params.py index 6ac7aea58d4..57c3cd9cd3a 100644 --- a/src/cloudflare/types/zero_trust/access/policy_update_params.py +++ b/src/cloudflare/types/zero_trust/access/policy_update_params.py @@ -111,8 +111,8 @@ class MfaConfig(TypedDict, total=False): allowed_authenticators: List[Literal["totp", "biometrics", "security_key"]] """Lists the MFA methods that users can authenticate with.""" - mfa_bypass: bool - """Indicates whether to bypass MFA for this resource. + mfa_disabled: bool + """Indicates whether to disable MFA for this resource. This option is available at the application and policy level. """ diff --git a/src/cloudflare/types/zero_trust/access/policy_update_response.py b/src/cloudflare/types/zero_trust/access/policy_update_response.py index 9da2c852379..ca249923729 100644 --- a/src/cloudflare/types/zero_trust/access/policy_update_response.py +++ b/src/cloudflare/types/zero_trust/access/policy_update_response.py @@ -41,8 +41,8 @@ class MfaConfig(BaseModel): allowed_authenticators: Optional[List[Literal["totp", "biometrics", "security_key"]]] = None """Lists the MFA methods that users can authenticate with.""" - mfa_bypass: Optional[bool] = None - """Indicates whether to bypass MFA for this resource. + mfa_disabled: Optional[bool] = None + """Indicates whether to disable MFA for this resource. This option is available at the application and policy level. """ diff --git a/src/cloudflare/types/zero_trust/organization.py b/src/cloudflare/types/zero_trust/organization.py index 7eb81796fec..e7ecc57d573 100644 --- a/src/cloudflare/types/zero_trust/organization.py +++ b/src/cloudflare/types/zero_trust/organization.py @@ -80,12 +80,6 @@ class Organization(BaseModel): mfa_config: Optional[MfaConfig] = None """Configures multi-factor authentication (MFA) settings for an organization.""" - mfa_configuration_allowed: Optional[bool] = None - """ - Indicates if this organization can enforce multi-factor authentication (MFA) - requirements at the application and policy level. - """ - mfa_required_for_all_apps: Optional[bool] = None """Determines whether global MFA settings apply to applications by default. diff --git a/src/cloudflare/types/zero_trust/organization_create_params.py b/src/cloudflare/types/zero_trust/organization_create_params.py index e01bbfb4c42..e64aacb705f 100644 --- a/src/cloudflare/types/zero_trust/organization_create_params.py +++ b/src/cloudflare/types/zero_trust/organization_create_params.py @@ -64,12 +64,6 @@ class OrganizationCreateParams(TypedDict, total=False): mfa_config: MfaConfig """Configures multi-factor authentication (MFA) settings for an organization.""" - mfa_configuration_allowed: bool - """ - Indicates if this organization can enforce multi-factor authentication (MFA) - requirements at the application and policy level. - """ - mfa_required_for_all_apps: bool """Determines whether global MFA settings apply to applications by default. diff --git a/src/cloudflare/types/zero_trust/organization_update_params.py b/src/cloudflare/types/zero_trust/organization_update_params.py index 6654c9d2882..e568ad6832a 100644 --- a/src/cloudflare/types/zero_trust/organization_update_params.py +++ b/src/cloudflare/types/zero_trust/organization_update_params.py @@ -63,12 +63,6 @@ class OrganizationUpdateParams(TypedDict, total=False): mfa_config: MfaConfig """Configures multi-factor authentication (MFA) settings for an organization.""" - mfa_configuration_allowed: bool - """ - Indicates if this organization can enforce multi-factor authentication (MFA) - requirements at the application and policy level. - """ - mfa_required_for_all_apps: bool """Determines whether global MFA settings apply to applications by default. diff --git a/tests/api_resources/zero_trust/access/applications/test_policies.py b/tests/api_resources/zero_trust/access/applications/test_policies.py index 52266e52dda..79329c5028a 100644 --- a/tests/api_resources/zero_trust/access/applications/test_policies.py +++ b/tests/api_resources/zero_trust/access/applications/test_policies.py @@ -61,7 +61,7 @@ def test_method_create_with_all_params(self, client: Cloudflare) -> None: isolation_required=False, mfa_config={ "allowed_authenticators": ["totp", "biometrics", "security_key"], - "mfa_bypass": False, + "mfa_disabled": False, "session_duration": "24h", }, precedence=0, @@ -159,7 +159,7 @@ def test_method_update_with_all_params(self, client: Cloudflare) -> None: isolation_required=False, mfa_config={ "allowed_authenticators": ["totp", "biometrics", "security_key"], - "mfa_bypass": False, + "mfa_disabled": False, "session_duration": "24h", }, precedence=0, @@ -504,7 +504,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncCloudflare isolation_required=False, mfa_config={ "allowed_authenticators": ["totp", "biometrics", "security_key"], - "mfa_bypass": False, + "mfa_disabled": False, "session_duration": "24h", }, precedence=0, @@ -602,7 +602,7 @@ async def test_method_update_with_all_params(self, async_client: AsyncCloudflare isolation_required=False, mfa_config={ "allowed_authenticators": ["totp", "biometrics", "security_key"], - "mfa_bypass": False, + "mfa_disabled": False, "session_duration": "24h", }, precedence=0, diff --git a/tests/api_resources/zero_trust/access/applications/test_policy_tests.py b/tests/api_resources/zero_trust/access/applications/test_policy_tests.py index 5cd0138cda0..e987c50a3c1 100755 --- a/tests/api_resources/zero_trust/access/applications/test_policy_tests.py +++ b/tests/api_resources/zero_trust/access/applications/test_policy_tests.py @@ -59,7 +59,7 @@ def test_method_create_with_all_params(self, client: Cloudflare) -> None: "isolation_required": False, "mfa_config": { "allowed_authenticators": ["totp", "biometrics", "security_key"], - "mfa_bypass": False, + "mfa_disabled": False, "session_duration": "24h", }, "purpose_justification_prompt": "Please enter a justification for entering this protected domain.", @@ -195,7 +195,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncCloudflare "isolation_required": False, "mfa_config": { "allowed_authenticators": ["totp", "biometrics", "security_key"], - "mfa_bypass": False, + "mfa_disabled": False, "session_duration": "24h", }, "purpose_justification_prompt": "Please enter a justification for entering this protected domain.", diff --git a/tests/api_resources/zero_trust/access/test_applications.py b/tests/api_resources/zero_trust/access/test_applications.py index 89e7f8a31ce..ba7c58edd8a 100644 --- a/tests/api_resources/zero_trust/access/test_applications.py +++ b/tests/api_resources/zero_trust/access/test_applications.py @@ -103,7 +103,7 @@ def test_method_create_with_all_params_overload_1(self, client: Cloudflare) -> N logo_url="https://www.cloudflare.com/img/logo-web-badges/cf-logo-on-white-bg.svg", mfa_config={ "allowed_authenticators": ["totp", "biometrics", "security_key"], - "mfa_bypass": False, + "mfa_disabled": False, "session_duration": "24h", }, name="Admin Site", @@ -413,7 +413,7 @@ def test_method_create_with_all_params_overload_3(self, client: Cloudflare) -> N logo_url="https://www.cloudflare.com/img/logo-web-badges/cf-logo-on-white-bg.svg", mfa_config={ "allowed_authenticators": ["totp", "biometrics", "security_key"], - "mfa_bypass": False, + "mfa_disabled": False, "session_duration": "24h", }, name="Admin Site", @@ -600,7 +600,7 @@ def test_method_create_with_all_params_overload_4(self, client: Cloudflare) -> N logo_url="https://www.cloudflare.com/img/logo-web-badges/cf-logo-on-white-bg.svg", mfa_config={ "allowed_authenticators": ["totp", "biometrics", "security_key"], - "mfa_bypass": False, + "mfa_disabled": False, "session_duration": "24h", }, name="Admin Site", @@ -1298,7 +1298,7 @@ def test_method_create_with_all_params_overload_11(self, client: Cloudflare) -> logo_url="https://www.cloudflare.com/img/logo-web-badges/cf-logo-on-white-bg.svg", mfa_config={ "allowed_authenticators": ["totp", "biometrics", "security_key"], - "mfa_bypass": False, + "mfa_disabled": False, "session_duration": "24h", }, name="Admin Site", @@ -1830,7 +1830,7 @@ def test_method_update_with_all_params_overload_1(self, client: Cloudflare) -> N logo_url="https://www.cloudflare.com/img/logo-web-badges/cf-logo-on-white-bg.svg", mfa_config={ "allowed_authenticators": ["totp", "biometrics", "security_key"], - "mfa_bypass": False, + "mfa_disabled": False, "session_duration": "24h", }, name="Admin Site", @@ -2166,7 +2166,7 @@ def test_method_update_with_all_params_overload_3(self, client: Cloudflare) -> N logo_url="https://www.cloudflare.com/img/logo-web-badges/cf-logo-on-white-bg.svg", mfa_config={ "allowed_authenticators": ["totp", "biometrics", "security_key"], - "mfa_bypass": False, + "mfa_disabled": False, "session_duration": "24h", }, name="Admin Site", @@ -2367,7 +2367,7 @@ def test_method_update_with_all_params_overload_4(self, client: Cloudflare) -> N logo_url="https://www.cloudflare.com/img/logo-web-badges/cf-logo-on-white-bg.svg", mfa_config={ "allowed_authenticators": ["totp", "biometrics", "security_key"], - "mfa_bypass": False, + "mfa_disabled": False, "session_duration": "24h", }, name="Admin Site", @@ -3163,7 +3163,7 @@ def test_method_update_with_all_params_overload_11(self, client: Cloudflare) -> logo_url="https://www.cloudflare.com/img/logo-web-badges/cf-logo-on-white-bg.svg", mfa_config={ "allowed_authenticators": ["totp", "biometrics", "security_key"], - "mfa_bypass": False, + "mfa_disabled": False, "session_duration": "24h", }, name="Admin Site", @@ -4008,7 +4008,7 @@ async def test_method_create_with_all_params_overload_1(self, async_client: Asyn logo_url="https://www.cloudflare.com/img/logo-web-badges/cf-logo-on-white-bg.svg", mfa_config={ "allowed_authenticators": ["totp", "biometrics", "security_key"], - "mfa_bypass": False, + "mfa_disabled": False, "session_duration": "24h", }, name="Admin Site", @@ -4318,7 +4318,7 @@ async def test_method_create_with_all_params_overload_3(self, async_client: Asyn logo_url="https://www.cloudflare.com/img/logo-web-badges/cf-logo-on-white-bg.svg", mfa_config={ "allowed_authenticators": ["totp", "biometrics", "security_key"], - "mfa_bypass": False, + "mfa_disabled": False, "session_duration": "24h", }, name="Admin Site", @@ -4505,7 +4505,7 @@ async def test_method_create_with_all_params_overload_4(self, async_client: Asyn logo_url="https://www.cloudflare.com/img/logo-web-badges/cf-logo-on-white-bg.svg", mfa_config={ "allowed_authenticators": ["totp", "biometrics", "security_key"], - "mfa_bypass": False, + "mfa_disabled": False, "session_duration": "24h", }, name="Admin Site", @@ -5203,7 +5203,7 @@ async def test_method_create_with_all_params_overload_11(self, async_client: Asy logo_url="https://www.cloudflare.com/img/logo-web-badges/cf-logo-on-white-bg.svg", mfa_config={ "allowed_authenticators": ["totp", "biometrics", "security_key"], - "mfa_bypass": False, + "mfa_disabled": False, "session_duration": "24h", }, name="Admin Site", @@ -5735,7 +5735,7 @@ async def test_method_update_with_all_params_overload_1(self, async_client: Asyn logo_url="https://www.cloudflare.com/img/logo-web-badges/cf-logo-on-white-bg.svg", mfa_config={ "allowed_authenticators": ["totp", "biometrics", "security_key"], - "mfa_bypass": False, + "mfa_disabled": False, "session_duration": "24h", }, name="Admin Site", @@ -6071,7 +6071,7 @@ async def test_method_update_with_all_params_overload_3(self, async_client: Asyn logo_url="https://www.cloudflare.com/img/logo-web-badges/cf-logo-on-white-bg.svg", mfa_config={ "allowed_authenticators": ["totp", "biometrics", "security_key"], - "mfa_bypass": False, + "mfa_disabled": False, "session_duration": "24h", }, name="Admin Site", @@ -6272,7 +6272,7 @@ async def test_method_update_with_all_params_overload_4(self, async_client: Asyn logo_url="https://www.cloudflare.com/img/logo-web-badges/cf-logo-on-white-bg.svg", mfa_config={ "allowed_authenticators": ["totp", "biometrics", "security_key"], - "mfa_bypass": False, + "mfa_disabled": False, "session_duration": "24h", }, name="Admin Site", @@ -7068,7 +7068,7 @@ async def test_method_update_with_all_params_overload_11(self, async_client: Asy logo_url="https://www.cloudflare.com/img/logo-web-badges/cf-logo-on-white-bg.svg", mfa_config={ "allowed_authenticators": ["totp", "biometrics", "security_key"], - "mfa_bypass": False, + "mfa_disabled": False, "session_duration": "24h", }, name="Admin Site", diff --git a/tests/api_resources/zero_trust/access/test_policies.py b/tests/api_resources/zero_trust/access/test_policies.py index 5f4a60a6752..7986e7f7922 100644 --- a/tests/api_resources/zero_trust/access/test_policies.py +++ b/tests/api_resources/zero_trust/access/test_policies.py @@ -64,7 +64,7 @@ def test_method_create_with_all_params(self, client: Cloudflare) -> None: isolation_required=False, mfa_config={ "allowed_authenticators": ["totp", "biometrics", "security_key"], - "mfa_bypass": False, + "mfa_disabled": False, "session_duration": "24h", }, purpose_justification_prompt="Please enter a justification for entering this protected domain.", @@ -156,7 +156,7 @@ def test_method_update_with_all_params(self, client: Cloudflare) -> None: isolation_required=False, mfa_config={ "allowed_authenticators": ["totp", "biometrics", "security_key"], - "mfa_bypass": False, + "mfa_disabled": False, "session_duration": "24h", }, purpose_justification_prompt="Please enter a justification for entering this protected domain.", @@ -407,7 +407,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncCloudflare isolation_required=False, mfa_config={ "allowed_authenticators": ["totp", "biometrics", "security_key"], - "mfa_bypass": False, + "mfa_disabled": False, "session_duration": "24h", }, purpose_justification_prompt="Please enter a justification for entering this protected domain.", @@ -499,7 +499,7 @@ async def test_method_update_with_all_params(self, async_client: AsyncCloudflare isolation_required=False, mfa_config={ "allowed_authenticators": ["totp", "biometrics", "security_key"], - "mfa_bypass": False, + "mfa_disabled": False, "session_duration": "24h", }, purpose_justification_prompt="Please enter a justification for entering this protected domain.", diff --git a/tests/api_resources/zero_trust/test_organizations.py b/tests/api_resources/zero_trust/test_organizations.py index b8030ef3754..ddeaada72d5 100644 --- a/tests/api_resources/zero_trust/test_organizations.py +++ b/tests/api_resources/zero_trust/test_organizations.py @@ -53,7 +53,6 @@ def test_method_create_with_all_params(self, client: Cloudflare) -> None: "allowed_authenticators": ["totp", "biometrics", "security_key"], "session_duration": "24h", }, - mfa_configuration_allowed=True, mfa_required_for_all_apps=False, session_duration="24h", ui_read_only_toggle_reason="Temporarily turn off the UI read only lock to make a change via the UI", @@ -143,7 +142,6 @@ def test_method_update_with_all_params(self, client: Cloudflare) -> None: "allowed_authenticators": ["totp", "biometrics", "security_key"], "session_duration": "24h", }, - mfa_configuration_allowed=True, mfa_required_for_all_apps=False, name="Widget Corps Internal Applications", session_duration="24h", @@ -351,7 +349,6 @@ async def test_method_create_with_all_params(self, async_client: AsyncCloudflare "allowed_authenticators": ["totp", "biometrics", "security_key"], "session_duration": "24h", }, - mfa_configuration_allowed=True, mfa_required_for_all_apps=False, session_duration="24h", ui_read_only_toggle_reason="Temporarily turn off the UI read only lock to make a change via the UI", @@ -441,7 +438,6 @@ async def test_method_update_with_all_params(self, async_client: AsyncCloudflare "allowed_authenticators": ["totp", "biometrics", "security_key"], "session_duration": "24h", }, - mfa_configuration_allowed=True, mfa_required_for_all_apps=False, name="Widget Corps Internal Applications", session_duration="24h", From e6917d2724f84bfac4693c6625d11ee0f5361f03 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 5 Mar 2026 22:30:35 +0000 Subject: [PATCH 057/279] feat: feat(tags): GRM-385 add resource_tagging routes * build: bump CI image * feat(tags): GRM-385 add resource_tagging routes --- .stats.yml | 6 +- api.md | 64 ++ src/cloudflare/_client.py | 38 + .../resources/resource_tagging/__init__.py | 75 ++ .../resource_tagging/account_tags.py | 792 ++++++++++++++++++ .../resources/resource_tagging/keys.py | 186 ++++ .../resource_tagging/resource_tagging.py | 443 ++++++++++ .../resources/resource_tagging/values.py | 272 ++++++ .../resources/resource_tagging/zone_tags.py | 670 +++++++++++++++ .../types/resource_tagging/__init__.py | 18 + .../account_tag_get_params.py | 44 + .../account_tag_get_response.py | 747 +++++++++++++++++ .../account_tag_update_params.py | 105 +++ .../account_tag_update_response.py | 747 +++++++++++++++++ .../types/resource_tagging/key_list_params.py | 15 + .../resource_tagging/key_list_response.py | 7 + .../resource_tagging_list_params.py | 77 ++ .../resource_tagging_list_response.py | 747 +++++++++++++++++ .../resource_tagging/value_list_params.py | 46 + .../resource_tagging/value_list_response.py | 7 + .../resource_tagging/zone_tag_get_params.py | 34 + .../resource_tagging/zone_tag_get_response.py | 747 +++++++++++++++++ .../zone_tag_update_params.py | 73 ++ .../zone_tag_update_response.py | 747 +++++++++++++++++ .../resource_tagging/__init__.py | 1 + .../resource_tagging/test_account_tags.py | 481 +++++++++++ .../resource_tagging/test_keys.py | 117 +++ .../resource_tagging/test_values.py | 141 ++++ .../resource_tagging/test_zone_tags.py | 481 +++++++++++ tests/api_resources/test_resource_tagging.py | 131 +++ 30 files changed, 8056 insertions(+), 3 deletions(-) create mode 100644 src/cloudflare/resources/resource_tagging/__init__.py create mode 100644 src/cloudflare/resources/resource_tagging/account_tags.py create mode 100644 src/cloudflare/resources/resource_tagging/keys.py create mode 100644 src/cloudflare/resources/resource_tagging/resource_tagging.py create mode 100644 src/cloudflare/resources/resource_tagging/values.py create mode 100644 src/cloudflare/resources/resource_tagging/zone_tags.py create mode 100644 src/cloudflare/types/resource_tagging/__init__.py create mode 100644 src/cloudflare/types/resource_tagging/account_tag_get_params.py create mode 100644 src/cloudflare/types/resource_tagging/account_tag_get_response.py create mode 100644 src/cloudflare/types/resource_tagging/account_tag_update_params.py create mode 100644 src/cloudflare/types/resource_tagging/account_tag_update_response.py create mode 100644 src/cloudflare/types/resource_tagging/key_list_params.py create mode 100644 src/cloudflare/types/resource_tagging/key_list_response.py create mode 100644 src/cloudflare/types/resource_tagging/resource_tagging_list_params.py create mode 100644 src/cloudflare/types/resource_tagging/resource_tagging_list_response.py create mode 100644 src/cloudflare/types/resource_tagging/value_list_params.py create mode 100644 src/cloudflare/types/resource_tagging/value_list_response.py create mode 100644 src/cloudflare/types/resource_tagging/zone_tag_get_params.py create mode 100644 src/cloudflare/types/resource_tagging/zone_tag_get_response.py create mode 100644 src/cloudflare/types/resource_tagging/zone_tag_update_params.py create mode 100644 src/cloudflare/types/resource_tagging/zone_tag_update_response.py create mode 100644 tests/api_resources/resource_tagging/__init__.py create mode 100644 tests/api_resources/resource_tagging/test_account_tags.py create mode 100644 tests/api_resources/resource_tagging/test_keys.py create mode 100644 tests/api_resources/resource_tagging/test_values.py create mode 100644 tests/api_resources/resource_tagging/test_zone_tags.py create mode 100644 tests/api_resources/test_resource_tagging.py diff --git a/.stats.yml b/.stats.yml index 33026388f2e..f8d714a9ebd 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ -configured_endpoints: 2049 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-2290f772d9da747604b876da6e05a038187c26179245af12a64d198f25ef3fd0.yml +configured_endpoints: 2058 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-27d7c57107c9203d814f63f6686c63b76aadb365ce0ee0549dfb214f40db12ef.yml openapi_spec_hash: f46a7fc30fe001095a2b484fb6ada3e9 -config_hash: ebde54bdd7ec58f9abf7de1c45a2c076 +config_hash: b78af95529f71a3da2339b6fd717ed86 diff --git a/api.md b/api.md index fdf2a04d227..ec569c47ec4 100644 --- a/api.md +++ b/api.md @@ -10540,6 +10540,70 @@ Methods: - client.resource_sharing.resources.delete(resource_id, \*, account_id, share_id) -> Optional[ResourceDeleteResponse] - client.resource_sharing.resources.get(resource_id, \*, account_id, share_id) -> Optional[ResourceGetResponse] +# ResourceTagging + +Types: + +```python +from cloudflare.types.resource_tagging import ResourceTaggingListResponse +``` + +Methods: + +- client.resource_tagging.list(\*, account_id, \*\*params) -> SyncCursorPaginationAfter[ResourceTaggingListResponse] + +## AccountTags + +Types: + +```python +from cloudflare.types.resource_tagging import AccountTagUpdateResponse, AccountTagGetResponse +``` + +Methods: + +- client.resource_tagging.account_tags.update(\*, account_id, \*\*params) -> Optional[AccountTagUpdateResponse] +- client.resource_tagging.account_tags.delete(\*, account_id) -> None +- client.resource_tagging.account_tags.get(\*, account_id, \*\*params) -> Optional[AccountTagGetResponse] + +## ZoneTags + +Types: + +```python +from cloudflare.types.resource_tagging import ZoneTagUpdateResponse, ZoneTagGetResponse +``` + +Methods: + +- client.resource_tagging.zone_tags.update(\*, zone_id, \*\*params) -> Optional[ZoneTagUpdateResponse] +- client.resource_tagging.zone_tags.delete(\*, zone_id) -> None +- client.resource_tagging.zone_tags.get(\*, zone_id, \*\*params) -> Optional[ZoneTagGetResponse] + +## Keys + +Types: + +```python +from cloudflare.types.resource_tagging import KeyListResponse +``` + +Methods: + +- client.resource_tagging.keys.list(\*, account_id, \*\*params) -> SyncCursorPaginationAfter[KeyListResponse] + +## Values + +Types: + +```python +from cloudflare.types.resource_tagging import ValueListResponse +``` + +Methods: + +- client.resource_tagging.values.list(tag_key, \*, account_id, \*\*params) -> SyncCursorPaginationAfter[ValueListResponse] + # LeakedCredentialChecks Types: diff --git a/src/cloudflare/_client.py b/src/cloudflare/_client.py index edc473185de..06911dbf10b 100644 --- a/src/cloudflare/_client.py +++ b/src/cloudflare/_client.py @@ -117,6 +117,7 @@ content_scanning, custom_hostnames, resource_sharing, + resource_tagging, token_validation, browser_rendering, mtls_certificates, @@ -230,6 +231,7 @@ from .resources.content_scanning.content_scanning import ContentScanningResource, AsyncContentScanningResource from .resources.custom_hostnames.custom_hostnames import CustomHostnamesResource, AsyncCustomHostnamesResource from .resources.resource_sharing.resource_sharing import ResourceSharingResource, AsyncResourceSharingResource + from .resources.resource_tagging.resource_tagging import ResourceTaggingResource, AsyncResourceTaggingResource from .resources.token_validation.token_validation import TokenValidationResource, AsyncTokenValidationResource from .resources.browser_rendering.browser_rendering import BrowserRenderingResource, AsyncBrowserRenderingResource from .resources.mtls_certificates.mtls_certificates import MTLSCertificatesResource, AsyncMTLSCertificatesResource @@ -897,6 +899,12 @@ def resource_sharing(self) -> ResourceSharingResource: return ResourceSharingResource(self) + @cached_property + def resource_tagging(self) -> ResourceTaggingResource: + from .resources.resource_tagging import ResourceTaggingResource + + return ResourceTaggingResource(self) + @cached_property def leaked_credential_checks(self) -> LeakedCredentialChecksResource: from .resources.leaked_credential_checks import LeakedCredentialChecksResource @@ -1763,6 +1771,12 @@ def resource_sharing(self) -> AsyncResourceSharingResource: return AsyncResourceSharingResource(self) + @cached_property + def resource_tagging(self) -> AsyncResourceTaggingResource: + from .resources.resource_tagging import AsyncResourceTaggingResource + + return AsyncResourceTaggingResource(self) + @cached_property def leaked_credential_checks(self) -> AsyncLeakedCredentialChecksResource: from .resources.leaked_credential_checks import AsyncLeakedCredentialChecksResource @@ -2559,6 +2573,12 @@ def resource_sharing(self) -> resource_sharing.ResourceSharingResourceWithRawRes return ResourceSharingResourceWithRawResponse(self._client.resource_sharing) + @cached_property + def resource_tagging(self) -> resource_tagging.ResourceTaggingResourceWithRawResponse: + from .resources.resource_tagging import ResourceTaggingResourceWithRawResponse + + return ResourceTaggingResourceWithRawResponse(self._client.resource_tagging) + @cached_property def leaked_credential_checks(self) -> leaked_credential_checks.LeakedCredentialChecksResourceWithRawResponse: from .resources.leaked_credential_checks import LeakedCredentialChecksResourceWithRawResponse @@ -3180,6 +3200,12 @@ def resource_sharing(self) -> resource_sharing.AsyncResourceSharingResourceWithR return AsyncResourceSharingResourceWithRawResponse(self._client.resource_sharing) + @cached_property + def resource_tagging(self) -> resource_tagging.AsyncResourceTaggingResourceWithRawResponse: + from .resources.resource_tagging import AsyncResourceTaggingResourceWithRawResponse + + return AsyncResourceTaggingResourceWithRawResponse(self._client.resource_tagging) + @cached_property def leaked_credential_checks(self) -> leaked_credential_checks.AsyncLeakedCredentialChecksResourceWithRawResponse: from .resources.leaked_credential_checks import AsyncLeakedCredentialChecksResourceWithRawResponse @@ -3801,6 +3827,12 @@ def resource_sharing(self) -> resource_sharing.ResourceSharingResourceWithStream return ResourceSharingResourceWithStreamingResponse(self._client.resource_sharing) + @cached_property + def resource_tagging(self) -> resource_tagging.ResourceTaggingResourceWithStreamingResponse: + from .resources.resource_tagging import ResourceTaggingResourceWithStreamingResponse + + return ResourceTaggingResourceWithStreamingResponse(self._client.resource_tagging) + @cached_property def leaked_credential_checks(self) -> leaked_credential_checks.LeakedCredentialChecksResourceWithStreamingResponse: from .resources.leaked_credential_checks import LeakedCredentialChecksResourceWithStreamingResponse @@ -4430,6 +4462,12 @@ def resource_sharing(self) -> resource_sharing.AsyncResourceSharingResourceWithS return AsyncResourceSharingResourceWithStreamingResponse(self._client.resource_sharing) + @cached_property + def resource_tagging(self) -> resource_tagging.AsyncResourceTaggingResourceWithStreamingResponse: + from .resources.resource_tagging import AsyncResourceTaggingResourceWithStreamingResponse + + return AsyncResourceTaggingResourceWithStreamingResponse(self._client.resource_tagging) + @cached_property def leaked_credential_checks( self, diff --git a/src/cloudflare/resources/resource_tagging/__init__.py b/src/cloudflare/resources/resource_tagging/__init__.py new file mode 100644 index 00000000000..bf3595821b2 --- /dev/null +++ b/src/cloudflare/resources/resource_tagging/__init__.py @@ -0,0 +1,75 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from .keys import ( + KeysResource, + AsyncKeysResource, + KeysResourceWithRawResponse, + AsyncKeysResourceWithRawResponse, + KeysResourceWithStreamingResponse, + AsyncKeysResourceWithStreamingResponse, +) +from .values import ( + ValuesResource, + AsyncValuesResource, + ValuesResourceWithRawResponse, + AsyncValuesResourceWithRawResponse, + ValuesResourceWithStreamingResponse, + AsyncValuesResourceWithStreamingResponse, +) +from .zone_tags import ( + ZoneTagsResource, + AsyncZoneTagsResource, + ZoneTagsResourceWithRawResponse, + AsyncZoneTagsResourceWithRawResponse, + ZoneTagsResourceWithStreamingResponse, + AsyncZoneTagsResourceWithStreamingResponse, +) +from .account_tags import ( + AccountTagsResource, + AsyncAccountTagsResource, + AccountTagsResourceWithRawResponse, + AsyncAccountTagsResourceWithRawResponse, + AccountTagsResourceWithStreamingResponse, + AsyncAccountTagsResourceWithStreamingResponse, +) +from .resource_tagging import ( + ResourceTaggingResource, + AsyncResourceTaggingResource, + ResourceTaggingResourceWithRawResponse, + AsyncResourceTaggingResourceWithRawResponse, + ResourceTaggingResourceWithStreamingResponse, + AsyncResourceTaggingResourceWithStreamingResponse, +) + +__all__ = [ + "AccountTagsResource", + "AsyncAccountTagsResource", + "AccountTagsResourceWithRawResponse", + "AsyncAccountTagsResourceWithRawResponse", + "AccountTagsResourceWithStreamingResponse", + "AsyncAccountTagsResourceWithStreamingResponse", + "ZoneTagsResource", + "AsyncZoneTagsResource", + "ZoneTagsResourceWithRawResponse", + "AsyncZoneTagsResourceWithRawResponse", + "ZoneTagsResourceWithStreamingResponse", + "AsyncZoneTagsResourceWithStreamingResponse", + "KeysResource", + "AsyncKeysResource", + "KeysResourceWithRawResponse", + "AsyncKeysResourceWithRawResponse", + "KeysResourceWithStreamingResponse", + "AsyncKeysResourceWithStreamingResponse", + "ValuesResource", + "AsyncValuesResource", + "ValuesResourceWithRawResponse", + "AsyncValuesResourceWithRawResponse", + "ValuesResourceWithStreamingResponse", + "AsyncValuesResourceWithStreamingResponse", + "ResourceTaggingResource", + "AsyncResourceTaggingResource", + "ResourceTaggingResourceWithRawResponse", + "AsyncResourceTaggingResourceWithRawResponse", + "ResourceTaggingResourceWithStreamingResponse", + "AsyncResourceTaggingResourceWithStreamingResponse", +] diff --git a/src/cloudflare/resources/resource_tagging/account_tags.py b/src/cloudflare/resources/resource_tagging/account_tags.py new file mode 100644 index 00000000000..64017813a3b --- /dev/null +++ b/src/cloudflare/resources/resource_tagging/account_tags.py @@ -0,0 +1,792 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Any, Dict, Optional, cast +from typing_extensions import Literal, overload + +import httpx + +from ..._types import Body, Omit, Query, Headers, NoneType, NotGiven, omit, not_given +from ..._utils import required_args, maybe_transform, strip_not_given, async_maybe_transform +from ..._compat import cached_property +from ..._resource import SyncAPIResource, AsyncAPIResource +from ..._response import ( + to_raw_response_wrapper, + to_streamed_response_wrapper, + async_to_raw_response_wrapper, + async_to_streamed_response_wrapper, +) +from ..._wrappers import ResultWrapper +from ..._base_client import make_request_options +from ...types.resource_tagging import account_tag_get_params, account_tag_update_params +from ...types.resource_tagging.account_tag_get_response import AccountTagGetResponse +from ...types.resource_tagging.account_tag_update_response import AccountTagUpdateResponse + +__all__ = ["AccountTagsResource", "AsyncAccountTagsResource"] + + +class AccountTagsResource(SyncAPIResource): + @cached_property + def with_raw_response(self) -> AccountTagsResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers + """ + return AccountTagsResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> AccountTagsResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/cloudflare/cloudflare-python#with_streaming_response + """ + return AccountTagsResourceWithStreamingResponse(self) + + @overload + def update( + self, + *, + account_id: str, + resource_id: str, + resource_type: Literal[ + "access_application", + "access_group", + "account", + "ai_gateway", + "alerting_policy", + "alerting_webhook", + "cloudflared_tunnel", + "d1_database", + "durable_object_namespace", + "gateway_list", + "gateway_rule", + "image", + "kv_namespace", + "queue", + "r2_bucket", + "resource_share", + "stream_live_input", + "stream_video", + "worker", + "worker_version", + ], + worker_id: str, + tags: Dict[str, str] | Omit = omit, + if_match: str | 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, + ) -> Optional[AccountTagUpdateResponse]: + """ + Creates or updates tags for a specific account-level resource. + + Args: + account_id: Identifier. + + resource_id: Identifies the unique resource. + + resource_type: Enum for base account-level resource types (those with no extra required + fields). + + worker_id: Worker ID is required only for worker_version resources + + tags: Contains key-value pairs of tags. + + 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 + """ + ... + + @overload + def update( + self, + *, + account_id: str, + resource_id: str, + resource_type: Literal[ + "access_application", + "access_group", + "account", + "ai_gateway", + "alerting_policy", + "alerting_webhook", + "cloudflared_tunnel", + "d1_database", + "durable_object_namespace", + "gateway_list", + "gateway_rule", + "image", + "kv_namespace", + "queue", + "r2_bucket", + "resource_share", + "stream_live_input", + "stream_video", + "worker", + ], + tags: Dict[str, str] | Omit = omit, + if_match: str | 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, + ) -> Optional[AccountTagUpdateResponse]: + """ + Creates or updates tags for a specific account-level resource. + + Args: + account_id: Identifier. + + resource_id: Identifies the unique resource. + + resource_type: Enum for base account-level resource types (those with no extra required + fields). + + tags: Contains key-value pairs of tags. + + 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", "resource_id", "resource_type", "worker_id"], ["account_id", "resource_id", "resource_type"] + ) + def update( + self, + *, + account_id: str, + resource_id: str, + resource_type: Literal[ + "access_application", + "access_group", + "account", + "ai_gateway", + "alerting_policy", + "alerting_webhook", + "cloudflared_tunnel", + "d1_database", + "durable_object_namespace", + "gateway_list", + "gateway_rule", + "image", + "kv_namespace", + "queue", + "r2_bucket", + "resource_share", + "stream_live_input", + "stream_video", + "worker", + "worker_version", + ] + | Literal[ + "access_application", + "access_group", + "account", + "ai_gateway", + "alerting_policy", + "alerting_webhook", + "cloudflared_tunnel", + "d1_database", + "durable_object_namespace", + "gateway_list", + "gateway_rule", + "image", + "kv_namespace", + "queue", + "r2_bucket", + "resource_share", + "stream_live_input", + "stream_video", + "worker", + ], + worker_id: str | Omit = omit, + tags: Dict[str, str] | Omit = omit, + if_match: str | 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, + ) -> Optional[AccountTagUpdateResponse]: + if not account_id: + raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") + extra_headers = {**strip_not_given({"If-Match": if_match}), **(extra_headers or {})} + return cast( + Optional[AccountTagUpdateResponse], + self._put( + f"/accounts/{account_id}/tags", + body=maybe_transform( + { + "resource_id": resource_id, + "resource_type": resource_type, + "worker_id": worker_id, + "tags": tags, + }, + account_tag_update_params.AccountTagUpdateParams, + ), + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + post_parser=ResultWrapper[Optional[AccountTagUpdateResponse]]._unwrapper, + ), + cast_to=cast( + Any, ResultWrapper[AccountTagUpdateResponse] + ), # Union types cannot be passed in as arguments in the type system + ), + ) + + def delete( + self, + *, + account_id: str, + if_match: str | 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, + ) -> None: + """ + Removes all tags from a specific account-level resource. + + Args: + account_id: 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}") + extra_headers = {"Accept": "*/*", **(extra_headers or {})} + extra_headers = {**strip_not_given({"If-Match": if_match}), **(extra_headers or {})} + return self._delete( + f"/accounts/{account_id}/tags", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=NoneType, + ) + + def get( + self, + *, + account_id: str, + resource_id: str, + resource_type: Literal[ + "access_application", + "access_group", + "account", + "ai_gateway", + "alerting_policy", + "alerting_webhook", + "cloudflared_tunnel", + "d1_database", + "durable_object_namespace", + "gateway_list", + "gateway_rule", + "image", + "kv_namespace", + "queue", + "r2_bucket", + "resource_share", + "stream_live_input", + "stream_video", + "worker", + "worker_version", + ], + worker_id: str | 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, + ) -> Optional[AccountTagGetResponse]: + """ + Retrieves tags for a specific account-level resource. + + Args: + account_id: Identifier. + + resource_id: The ID of the resource to retrieve tags for. + + resource_type: The type of the resource. + + worker_id: Worker identifier. Required for worker_version resources. + + 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 cast( + Optional[AccountTagGetResponse], + self._get( + f"/accounts/{account_id}/tags", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=maybe_transform( + { + "resource_id": resource_id, + "resource_type": resource_type, + "worker_id": worker_id, + }, + account_tag_get_params.AccountTagGetParams, + ), + post_parser=ResultWrapper[Optional[AccountTagGetResponse]]._unwrapper, + ), + cast_to=cast( + Any, ResultWrapper[AccountTagGetResponse] + ), # Union types cannot be passed in as arguments in the type system + ), + ) + + +class AsyncAccountTagsResource(AsyncAPIResource): + @cached_property + def with_raw_response(self) -> AsyncAccountTagsResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers + """ + return AsyncAccountTagsResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> AsyncAccountTagsResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/cloudflare/cloudflare-python#with_streaming_response + """ + return AsyncAccountTagsResourceWithStreamingResponse(self) + + @overload + async def update( + self, + *, + account_id: str, + resource_id: str, + resource_type: Literal[ + "access_application", + "access_group", + "account", + "ai_gateway", + "alerting_policy", + "alerting_webhook", + "cloudflared_tunnel", + "d1_database", + "durable_object_namespace", + "gateway_list", + "gateway_rule", + "image", + "kv_namespace", + "queue", + "r2_bucket", + "resource_share", + "stream_live_input", + "stream_video", + "worker", + "worker_version", + ], + worker_id: str, + tags: Dict[str, str] | Omit = omit, + if_match: str | 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, + ) -> Optional[AccountTagUpdateResponse]: + """ + Creates or updates tags for a specific account-level resource. + + Args: + account_id: Identifier. + + resource_id: Identifies the unique resource. + + resource_type: Enum for base account-level resource types (those with no extra required + fields). + + worker_id: Worker ID is required only for worker_version resources + + tags: Contains key-value pairs of tags. + + 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 + """ + ... + + @overload + async def update( + self, + *, + account_id: str, + resource_id: str, + resource_type: Literal[ + "access_application", + "access_group", + "account", + "ai_gateway", + "alerting_policy", + "alerting_webhook", + "cloudflared_tunnel", + "d1_database", + "durable_object_namespace", + "gateway_list", + "gateway_rule", + "image", + "kv_namespace", + "queue", + "r2_bucket", + "resource_share", + "stream_live_input", + "stream_video", + "worker", + ], + tags: Dict[str, str] | Omit = omit, + if_match: str | 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, + ) -> Optional[AccountTagUpdateResponse]: + """ + Creates or updates tags for a specific account-level resource. + + Args: + account_id: Identifier. + + resource_id: Identifies the unique resource. + + resource_type: Enum for base account-level resource types (those with no extra required + fields). + + tags: Contains key-value pairs of tags. + + 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", "resource_id", "resource_type", "worker_id"], ["account_id", "resource_id", "resource_type"] + ) + async def update( + self, + *, + account_id: str, + resource_id: str, + resource_type: Literal[ + "access_application", + "access_group", + "account", + "ai_gateway", + "alerting_policy", + "alerting_webhook", + "cloudflared_tunnel", + "d1_database", + "durable_object_namespace", + "gateway_list", + "gateway_rule", + "image", + "kv_namespace", + "queue", + "r2_bucket", + "resource_share", + "stream_live_input", + "stream_video", + "worker", + "worker_version", + ] + | Literal[ + "access_application", + "access_group", + "account", + "ai_gateway", + "alerting_policy", + "alerting_webhook", + "cloudflared_tunnel", + "d1_database", + "durable_object_namespace", + "gateway_list", + "gateway_rule", + "image", + "kv_namespace", + "queue", + "r2_bucket", + "resource_share", + "stream_live_input", + "stream_video", + "worker", + ], + worker_id: str | Omit = omit, + tags: Dict[str, str] | Omit = omit, + if_match: str | 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, + ) -> Optional[AccountTagUpdateResponse]: + if not account_id: + raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") + extra_headers = {**strip_not_given({"If-Match": if_match}), **(extra_headers or {})} + return cast( + Optional[AccountTagUpdateResponse], + await self._put( + f"/accounts/{account_id}/tags", + body=await async_maybe_transform( + { + "resource_id": resource_id, + "resource_type": resource_type, + "worker_id": worker_id, + "tags": tags, + }, + account_tag_update_params.AccountTagUpdateParams, + ), + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + post_parser=ResultWrapper[Optional[AccountTagUpdateResponse]]._unwrapper, + ), + cast_to=cast( + Any, ResultWrapper[AccountTagUpdateResponse] + ), # Union types cannot be passed in as arguments in the type system + ), + ) + + async def delete( + self, + *, + account_id: str, + if_match: str | 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, + ) -> None: + """ + Removes all tags from a specific account-level resource. + + Args: + account_id: 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}") + extra_headers = {"Accept": "*/*", **(extra_headers or {})} + extra_headers = {**strip_not_given({"If-Match": if_match}), **(extra_headers or {})} + return await self._delete( + f"/accounts/{account_id}/tags", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=NoneType, + ) + + async def get( + self, + *, + account_id: str, + resource_id: str, + resource_type: Literal[ + "access_application", + "access_group", + "account", + "ai_gateway", + "alerting_policy", + "alerting_webhook", + "cloudflared_tunnel", + "d1_database", + "durable_object_namespace", + "gateway_list", + "gateway_rule", + "image", + "kv_namespace", + "queue", + "r2_bucket", + "resource_share", + "stream_live_input", + "stream_video", + "worker", + "worker_version", + ], + worker_id: str | 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, + ) -> Optional[AccountTagGetResponse]: + """ + Retrieves tags for a specific account-level resource. + + Args: + account_id: Identifier. + + resource_id: The ID of the resource to retrieve tags for. + + resource_type: The type of the resource. + + worker_id: Worker identifier. Required for worker_version resources. + + 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 cast( + Optional[AccountTagGetResponse], + await self._get( + f"/accounts/{account_id}/tags", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=await async_maybe_transform( + { + "resource_id": resource_id, + "resource_type": resource_type, + "worker_id": worker_id, + }, + account_tag_get_params.AccountTagGetParams, + ), + post_parser=ResultWrapper[Optional[AccountTagGetResponse]]._unwrapper, + ), + cast_to=cast( + Any, ResultWrapper[AccountTagGetResponse] + ), # Union types cannot be passed in as arguments in the type system + ), + ) + + +class AccountTagsResourceWithRawResponse: + def __init__(self, account_tags: AccountTagsResource) -> None: + self._account_tags = account_tags + + self.update = to_raw_response_wrapper( + account_tags.update, + ) + self.delete = to_raw_response_wrapper( + account_tags.delete, + ) + self.get = to_raw_response_wrapper( + account_tags.get, + ) + + +class AsyncAccountTagsResourceWithRawResponse: + def __init__(self, account_tags: AsyncAccountTagsResource) -> None: + self._account_tags = account_tags + + self.update = async_to_raw_response_wrapper( + account_tags.update, + ) + self.delete = async_to_raw_response_wrapper( + account_tags.delete, + ) + self.get = async_to_raw_response_wrapper( + account_tags.get, + ) + + +class AccountTagsResourceWithStreamingResponse: + def __init__(self, account_tags: AccountTagsResource) -> None: + self._account_tags = account_tags + + self.update = to_streamed_response_wrapper( + account_tags.update, + ) + self.delete = to_streamed_response_wrapper( + account_tags.delete, + ) + self.get = to_streamed_response_wrapper( + account_tags.get, + ) + + +class AsyncAccountTagsResourceWithStreamingResponse: + def __init__(self, account_tags: AsyncAccountTagsResource) -> None: + self._account_tags = account_tags + + self.update = async_to_streamed_response_wrapper( + account_tags.update, + ) + self.delete = async_to_streamed_response_wrapper( + account_tags.delete, + ) + self.get = async_to_streamed_response_wrapper( + account_tags.get, + ) diff --git a/src/cloudflare/resources/resource_tagging/keys.py b/src/cloudflare/resources/resource_tagging/keys.py new file mode 100644 index 00000000000..4a106e55917 --- /dev/null +++ b/src/cloudflare/resources/resource_tagging/keys.py @@ -0,0 +1,186 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +import httpx + +from ..._types import Body, Omit, Query, Headers, NotGiven, omit, not_given +from ..._utils import maybe_transform +from ..._compat import cached_property +from ..._resource import SyncAPIResource, AsyncAPIResource +from ..._response import ( + to_raw_response_wrapper, + to_streamed_response_wrapper, + async_to_raw_response_wrapper, + async_to_streamed_response_wrapper, +) +from ...pagination import SyncCursorPaginationAfter, AsyncCursorPaginationAfter +from ..._base_client import AsyncPaginator, make_request_options +from ...types.resource_tagging import key_list_params +from ...types.resource_tagging.key_list_response import KeyListResponse + +__all__ = ["KeysResource", "AsyncKeysResource"] + + +class KeysResource(SyncAPIResource): + @cached_property + def with_raw_response(self) -> KeysResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers + """ + return KeysResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> KeysResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/cloudflare/cloudflare-python#with_streaming_response + """ + return KeysResourceWithStreamingResponse(self) + + def list( + self, + *, + account_id: str, + cursor: str | 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, + ) -> SyncCursorPaginationAfter[KeyListResponse]: + """ + Lists all distinct tag keys used across resources in an account. + + Args: + account_id: Identifier. + + cursor: Cursor for pagination. + + 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( + f"/accounts/{account_id}/tags/keys", + page=SyncCursorPaginationAfter[KeyListResponse], + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=maybe_transform({"cursor": cursor}, key_list_params.KeyListParams), + ), + model=str, + ) + + +class AsyncKeysResource(AsyncAPIResource): + @cached_property + def with_raw_response(self) -> AsyncKeysResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers + """ + return AsyncKeysResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> AsyncKeysResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/cloudflare/cloudflare-python#with_streaming_response + """ + return AsyncKeysResourceWithStreamingResponse(self) + + def list( + self, + *, + account_id: str, + cursor: str | 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, + ) -> AsyncPaginator[KeyListResponse, AsyncCursorPaginationAfter[KeyListResponse]]: + """ + Lists all distinct tag keys used across resources in an account. + + Args: + account_id: Identifier. + + cursor: Cursor for pagination. + + 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( + f"/accounts/{account_id}/tags/keys", + page=AsyncCursorPaginationAfter[KeyListResponse], + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=maybe_transform({"cursor": cursor}, key_list_params.KeyListParams), + ), + model=str, + ) + + +class KeysResourceWithRawResponse: + def __init__(self, keys: KeysResource) -> None: + self._keys = keys + + self.list = to_raw_response_wrapper( + keys.list, + ) + + +class AsyncKeysResourceWithRawResponse: + def __init__(self, keys: AsyncKeysResource) -> None: + self._keys = keys + + self.list = async_to_raw_response_wrapper( + keys.list, + ) + + +class KeysResourceWithStreamingResponse: + def __init__(self, keys: KeysResource) -> None: + self._keys = keys + + self.list = to_streamed_response_wrapper( + keys.list, + ) + + +class AsyncKeysResourceWithStreamingResponse: + def __init__(self, keys: AsyncKeysResource) -> None: + self._keys = keys + + self.list = async_to_streamed_response_wrapper( + keys.list, + ) diff --git a/src/cloudflare/resources/resource_tagging/resource_tagging.py b/src/cloudflare/resources/resource_tagging/resource_tagging.py new file mode 100644 index 00000000000..56a27620fc6 --- /dev/null +++ b/src/cloudflare/resources/resource_tagging/resource_tagging.py @@ -0,0 +1,443 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Any, List, cast +from typing_extensions import Literal + +import httpx + +from .keys import ( + KeysResource, + AsyncKeysResource, + KeysResourceWithRawResponse, + AsyncKeysResourceWithRawResponse, + KeysResourceWithStreamingResponse, + AsyncKeysResourceWithStreamingResponse, +) +from .values import ( + ValuesResource, + AsyncValuesResource, + ValuesResourceWithRawResponse, + AsyncValuesResourceWithRawResponse, + ValuesResourceWithStreamingResponse, + AsyncValuesResourceWithStreamingResponse, +) +from ..._types import Body, Omit, Query, Headers, NotGiven, SequenceNotStr, omit, not_given +from ..._utils import maybe_transform +from ..._compat import cached_property +from .zone_tags import ( + ZoneTagsResource, + AsyncZoneTagsResource, + ZoneTagsResourceWithRawResponse, + AsyncZoneTagsResourceWithRawResponse, + ZoneTagsResourceWithStreamingResponse, + AsyncZoneTagsResourceWithStreamingResponse, +) +from ..._resource import SyncAPIResource, AsyncAPIResource +from ..._response import ( + to_raw_response_wrapper, + to_streamed_response_wrapper, + async_to_raw_response_wrapper, + async_to_streamed_response_wrapper, +) +from ...pagination import SyncCursorPaginationAfter, AsyncCursorPaginationAfter +from .account_tags import ( + AccountTagsResource, + AsyncAccountTagsResource, + AccountTagsResourceWithRawResponse, + AsyncAccountTagsResourceWithRawResponse, + AccountTagsResourceWithStreamingResponse, + AsyncAccountTagsResourceWithStreamingResponse, +) +from ..._base_client import AsyncPaginator, make_request_options +from ...types.resource_tagging import resource_tagging_list_params +from ...types.resource_tagging.resource_tagging_list_response import ResourceTaggingListResponse + +__all__ = ["ResourceTaggingResource", "AsyncResourceTaggingResource"] + + +class ResourceTaggingResource(SyncAPIResource): + @cached_property + def account_tags(self) -> AccountTagsResource: + return AccountTagsResource(self._client) + + @cached_property + def zone_tags(self) -> ZoneTagsResource: + return ZoneTagsResource(self._client) + + @cached_property + def keys(self) -> KeysResource: + return KeysResource(self._client) + + @cached_property + def values(self) -> ValuesResource: + return ValuesResource(self._client) + + @cached_property + def with_raw_response(self) -> ResourceTaggingResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers + """ + return ResourceTaggingResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> ResourceTaggingResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/cloudflare/cloudflare-python#with_streaming_response + """ + return ResourceTaggingResourceWithStreamingResponse(self) + + def list( + self, + *, + account_id: str, + cursor: str | Omit = omit, + tag: SequenceNotStr[str] | Omit = omit, + type: List[ + Literal[ + "access_application", + "access_application_policy", + "access_group", + "account", + "ai_gateway", + "alerting_policy", + "alerting_webhook", + "api_gateway_operation", + "cloudflared_tunnel", + "custom_certificate", + "custom_hostname", + "d1_database", + "dns_record", + "durable_object_namespace", + "gateway_list", + "gateway_rule", + "image", + "kv_namespace", + "managed_client_certificate", + "queue", + "r2_bucket", + "resource_share", + "stream_live_input", + "stream_video", + "worker", + "worker_version", + "zone", + ] + ] + | 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, + ) -> SyncCursorPaginationAfter[ResourceTaggingListResponse]: + """ + Lists all tagged resources for an account. + + Args: + account_id: Identifier. + + cursor: Cursor for pagination. + + tag: Filter resources by tag criteria. This parameter can be repeated multiple times, + with AND logic between parameters. + + Supported syntax: + + - **Key-only**: `tag=` - Resource must have the tag key (e.g., + `tag=production`) + - **Key-value**: `tag==` - Resource must have the tag with specific + value (e.g., `tag=env=prod`) + - **Multiple values (OR)**: `tag==,` - Resource must have tag with + any of the values (e.g., `tag=env=prod,staging`) + - **Negate key-only**: `tag=!` - Resource must not have the tag key (e.g., + `tag=!archived`) + - **Negate key-value**: `tag=!=` - Resource must not have the tag + with specific value (e.g., `tag=region!=us-west-1`) + + Multiple tag parameters are combined with AND logic. + + type: Filter by resource type. Can be repeated to filter by multiple types (OR logic). + Example: ?type=zone&type=worker + + 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( + f"/accounts/{account_id}/tags/resources", + page=SyncCursorPaginationAfter[ResourceTaggingListResponse], + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=maybe_transform( + { + "cursor": cursor, + "tag": tag, + "type": type, + }, + resource_tagging_list_params.ResourceTaggingListParams, + ), + ), + model=cast( + Any, ResourceTaggingListResponse + ), # Union types cannot be passed in as arguments in the type system + ) + + +class AsyncResourceTaggingResource(AsyncAPIResource): + @cached_property + def account_tags(self) -> AsyncAccountTagsResource: + return AsyncAccountTagsResource(self._client) + + @cached_property + def zone_tags(self) -> AsyncZoneTagsResource: + return AsyncZoneTagsResource(self._client) + + @cached_property + def keys(self) -> AsyncKeysResource: + return AsyncKeysResource(self._client) + + @cached_property + def values(self) -> AsyncValuesResource: + return AsyncValuesResource(self._client) + + @cached_property + def with_raw_response(self) -> AsyncResourceTaggingResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers + """ + return AsyncResourceTaggingResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> AsyncResourceTaggingResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/cloudflare/cloudflare-python#with_streaming_response + """ + return AsyncResourceTaggingResourceWithStreamingResponse(self) + + def list( + self, + *, + account_id: str, + cursor: str | Omit = omit, + tag: SequenceNotStr[str] | Omit = omit, + type: List[ + Literal[ + "access_application", + "access_application_policy", + "access_group", + "account", + "ai_gateway", + "alerting_policy", + "alerting_webhook", + "api_gateway_operation", + "cloudflared_tunnel", + "custom_certificate", + "custom_hostname", + "d1_database", + "dns_record", + "durable_object_namespace", + "gateway_list", + "gateway_rule", + "image", + "kv_namespace", + "managed_client_certificate", + "queue", + "r2_bucket", + "resource_share", + "stream_live_input", + "stream_video", + "worker", + "worker_version", + "zone", + ] + ] + | 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, + ) -> AsyncPaginator[ResourceTaggingListResponse, AsyncCursorPaginationAfter[ResourceTaggingListResponse]]: + """ + Lists all tagged resources for an account. + + Args: + account_id: Identifier. + + cursor: Cursor for pagination. + + tag: Filter resources by tag criteria. This parameter can be repeated multiple times, + with AND logic between parameters. + + Supported syntax: + + - **Key-only**: `tag=` - Resource must have the tag key (e.g., + `tag=production`) + - **Key-value**: `tag==` - Resource must have the tag with specific + value (e.g., `tag=env=prod`) + - **Multiple values (OR)**: `tag==,` - Resource must have tag with + any of the values (e.g., `tag=env=prod,staging`) + - **Negate key-only**: `tag=!` - Resource must not have the tag key (e.g., + `tag=!archived`) + - **Negate key-value**: `tag=!=` - Resource must not have the tag + with specific value (e.g., `tag=region!=us-west-1`) + + Multiple tag parameters are combined with AND logic. + + type: Filter by resource type. Can be repeated to filter by multiple types (OR logic). + Example: ?type=zone&type=worker + + 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( + f"/accounts/{account_id}/tags/resources", + page=AsyncCursorPaginationAfter[ResourceTaggingListResponse], + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=maybe_transform( + { + "cursor": cursor, + "tag": tag, + "type": type, + }, + resource_tagging_list_params.ResourceTaggingListParams, + ), + ), + model=cast( + Any, ResourceTaggingListResponse + ), # Union types cannot be passed in as arguments in the type system + ) + + +class ResourceTaggingResourceWithRawResponse: + def __init__(self, resource_tagging: ResourceTaggingResource) -> None: + self._resource_tagging = resource_tagging + + self.list = to_raw_response_wrapper( + resource_tagging.list, + ) + + @cached_property + def account_tags(self) -> AccountTagsResourceWithRawResponse: + return AccountTagsResourceWithRawResponse(self._resource_tagging.account_tags) + + @cached_property + def zone_tags(self) -> ZoneTagsResourceWithRawResponse: + return ZoneTagsResourceWithRawResponse(self._resource_tagging.zone_tags) + + @cached_property + def keys(self) -> KeysResourceWithRawResponse: + return KeysResourceWithRawResponse(self._resource_tagging.keys) + + @cached_property + def values(self) -> ValuesResourceWithRawResponse: + return ValuesResourceWithRawResponse(self._resource_tagging.values) + + +class AsyncResourceTaggingResourceWithRawResponse: + def __init__(self, resource_tagging: AsyncResourceTaggingResource) -> None: + self._resource_tagging = resource_tagging + + self.list = async_to_raw_response_wrapper( + resource_tagging.list, + ) + + @cached_property + def account_tags(self) -> AsyncAccountTagsResourceWithRawResponse: + return AsyncAccountTagsResourceWithRawResponse(self._resource_tagging.account_tags) + + @cached_property + def zone_tags(self) -> AsyncZoneTagsResourceWithRawResponse: + return AsyncZoneTagsResourceWithRawResponse(self._resource_tagging.zone_tags) + + @cached_property + def keys(self) -> AsyncKeysResourceWithRawResponse: + return AsyncKeysResourceWithRawResponse(self._resource_tagging.keys) + + @cached_property + def values(self) -> AsyncValuesResourceWithRawResponse: + return AsyncValuesResourceWithRawResponse(self._resource_tagging.values) + + +class ResourceTaggingResourceWithStreamingResponse: + def __init__(self, resource_tagging: ResourceTaggingResource) -> None: + self._resource_tagging = resource_tagging + + self.list = to_streamed_response_wrapper( + resource_tagging.list, + ) + + @cached_property + def account_tags(self) -> AccountTagsResourceWithStreamingResponse: + return AccountTagsResourceWithStreamingResponse(self._resource_tagging.account_tags) + + @cached_property + def zone_tags(self) -> ZoneTagsResourceWithStreamingResponse: + return ZoneTagsResourceWithStreamingResponse(self._resource_tagging.zone_tags) + + @cached_property + def keys(self) -> KeysResourceWithStreamingResponse: + return KeysResourceWithStreamingResponse(self._resource_tagging.keys) + + @cached_property + def values(self) -> ValuesResourceWithStreamingResponse: + return ValuesResourceWithStreamingResponse(self._resource_tagging.values) + + +class AsyncResourceTaggingResourceWithStreamingResponse: + def __init__(self, resource_tagging: AsyncResourceTaggingResource) -> None: + self._resource_tagging = resource_tagging + + self.list = async_to_streamed_response_wrapper( + resource_tagging.list, + ) + + @cached_property + def account_tags(self) -> AsyncAccountTagsResourceWithStreamingResponse: + return AsyncAccountTagsResourceWithStreamingResponse(self._resource_tagging.account_tags) + + @cached_property + def zone_tags(self) -> AsyncZoneTagsResourceWithStreamingResponse: + return AsyncZoneTagsResourceWithStreamingResponse(self._resource_tagging.zone_tags) + + @cached_property + def keys(self) -> AsyncKeysResourceWithStreamingResponse: + return AsyncKeysResourceWithStreamingResponse(self._resource_tagging.keys) + + @cached_property + def values(self) -> AsyncValuesResourceWithStreamingResponse: + return AsyncValuesResourceWithStreamingResponse(self._resource_tagging.values) diff --git a/src/cloudflare/resources/resource_tagging/values.py b/src/cloudflare/resources/resource_tagging/values.py new file mode 100644 index 00000000000..b2b278b99f4 --- /dev/null +++ b/src/cloudflare/resources/resource_tagging/values.py @@ -0,0 +1,272 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Literal + +import httpx + +from ..._types import Body, Omit, Query, Headers, NotGiven, omit, not_given +from ..._utils import maybe_transform +from ..._compat import cached_property +from ..._resource import SyncAPIResource, AsyncAPIResource +from ..._response import ( + to_raw_response_wrapper, + to_streamed_response_wrapper, + async_to_raw_response_wrapper, + async_to_streamed_response_wrapper, +) +from ...pagination import SyncCursorPaginationAfter, AsyncCursorPaginationAfter +from ..._base_client import AsyncPaginator, make_request_options +from ...types.resource_tagging import value_list_params +from ...types.resource_tagging.value_list_response import ValueListResponse + +__all__ = ["ValuesResource", "AsyncValuesResource"] + + +class ValuesResource(SyncAPIResource): + @cached_property + def with_raw_response(self) -> ValuesResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers + """ + return ValuesResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> ValuesResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/cloudflare/cloudflare-python#with_streaming_response + """ + return ValuesResourceWithStreamingResponse(self) + + def list( + self, + tag_key: str, + *, + account_id: str, + cursor: str | Omit = omit, + type: Literal[ + "access_application", + "access_application_policy", + "access_group", + "account", + "ai_gateway", + "alerting_policy", + "alerting_webhook", + "api_gateway_operation", + "cloudflared_tunnel", + "custom_certificate", + "custom_hostname", + "d1_database", + "dns_record", + "durable_object_namespace", + "gateway_list", + "gateway_rule", + "image", + "kv_namespace", + "managed_client_certificate", + "queue", + "r2_bucket", + "resource_share", + "stream_live_input", + "stream_video", + "worker", + "worker_version", + "zone", + ] + | 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, + ) -> SyncCursorPaginationAfter[ValueListResponse]: + """ + Lists all distinct values for a given tag key, optionally filtered by resource + type. + + Args: + account_id: Identifier. + + cursor: Cursor for pagination. + + type: Filter by resource type. + + 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 tag_key: + raise ValueError(f"Expected a non-empty value for `tag_key` but received {tag_key!r}") + return self._get_api_list( + f"/accounts/{account_id}/tags/values/{tag_key}", + page=SyncCursorPaginationAfter[ValueListResponse], + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=maybe_transform( + { + "cursor": cursor, + "type": type, + }, + value_list_params.ValueListParams, + ), + ), + model=str, + ) + + +class AsyncValuesResource(AsyncAPIResource): + @cached_property + def with_raw_response(self) -> AsyncValuesResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers + """ + return AsyncValuesResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> AsyncValuesResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/cloudflare/cloudflare-python#with_streaming_response + """ + return AsyncValuesResourceWithStreamingResponse(self) + + def list( + self, + tag_key: str, + *, + account_id: str, + cursor: str | Omit = omit, + type: Literal[ + "access_application", + "access_application_policy", + "access_group", + "account", + "ai_gateway", + "alerting_policy", + "alerting_webhook", + "api_gateway_operation", + "cloudflared_tunnel", + "custom_certificate", + "custom_hostname", + "d1_database", + "dns_record", + "durable_object_namespace", + "gateway_list", + "gateway_rule", + "image", + "kv_namespace", + "managed_client_certificate", + "queue", + "r2_bucket", + "resource_share", + "stream_live_input", + "stream_video", + "worker", + "worker_version", + "zone", + ] + | 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, + ) -> AsyncPaginator[ValueListResponse, AsyncCursorPaginationAfter[ValueListResponse]]: + """ + Lists all distinct values for a given tag key, optionally filtered by resource + type. + + Args: + account_id: Identifier. + + cursor: Cursor for pagination. + + type: Filter by resource type. + + 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 tag_key: + raise ValueError(f"Expected a non-empty value for `tag_key` but received {tag_key!r}") + return self._get_api_list( + f"/accounts/{account_id}/tags/values/{tag_key}", + page=AsyncCursorPaginationAfter[ValueListResponse], + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=maybe_transform( + { + "cursor": cursor, + "type": type, + }, + value_list_params.ValueListParams, + ), + ), + model=str, + ) + + +class ValuesResourceWithRawResponse: + def __init__(self, values: ValuesResource) -> None: + self._values = values + + self.list = to_raw_response_wrapper( + values.list, + ) + + +class AsyncValuesResourceWithRawResponse: + def __init__(self, values: AsyncValuesResource) -> None: + self._values = values + + self.list = async_to_raw_response_wrapper( + values.list, + ) + + +class ValuesResourceWithStreamingResponse: + def __init__(self, values: ValuesResource) -> None: + self._values = values + + self.list = to_streamed_response_wrapper( + values.list, + ) + + +class AsyncValuesResourceWithStreamingResponse: + def __init__(self, values: AsyncValuesResource) -> None: + self._values = values + + self.list = async_to_streamed_response_wrapper( + values.list, + ) diff --git a/src/cloudflare/resources/resource_tagging/zone_tags.py b/src/cloudflare/resources/resource_tagging/zone_tags.py new file mode 100644 index 00000000000..8b5224337f1 --- /dev/null +++ b/src/cloudflare/resources/resource_tagging/zone_tags.py @@ -0,0 +1,670 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Any, Dict, Optional, cast +from typing_extensions import Literal, overload + +import httpx + +from ..._types import Body, Omit, Query, Headers, NoneType, NotGiven, omit, not_given +from ..._utils import required_args, maybe_transform, strip_not_given, async_maybe_transform +from ..._compat import cached_property +from ..._resource import SyncAPIResource, AsyncAPIResource +from ..._response import ( + to_raw_response_wrapper, + to_streamed_response_wrapper, + async_to_raw_response_wrapper, + async_to_streamed_response_wrapper, +) +from ..._wrappers import ResultWrapper +from ..._base_client import make_request_options +from ...types.resource_tagging import zone_tag_get_params, zone_tag_update_params +from ...types.resource_tagging.zone_tag_get_response import ZoneTagGetResponse +from ...types.resource_tagging.zone_tag_update_response import ZoneTagUpdateResponse + +__all__ = ["ZoneTagsResource", "AsyncZoneTagsResource"] + + +class ZoneTagsResource(SyncAPIResource): + @cached_property + def with_raw_response(self) -> ZoneTagsResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers + """ + return ZoneTagsResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> ZoneTagsResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/cloudflare/cloudflare-python#with_streaming_response + """ + return ZoneTagsResourceWithStreamingResponse(self) + + @overload + def update( + self, + *, + zone_id: str, + resource_id: str, + resource_type: Literal[ + "api_gateway_operation", + "custom_certificate", + "custom_hostname", + "dns_record", + "managed_client_certificate", + "zone", + ], + tags: Dict[str, str] | Omit = omit, + if_match: str | 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, + ) -> Optional[ZoneTagUpdateResponse]: + """Creates or updates tags for a specific zone-level resource. + + Replaces all + existing tags for the resource. + + Args: + zone_id: Zone ID is required only for zone-level resources + + resource_id: Identifies the unique resource. + + resource_type: Enum for base zone-level resource types (those with no extra required fields). + + tags: Contains key-value pairs of tags. + + 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 + """ + ... + + @overload + def update( + self, + *, + zone_id: str, + access_application_id: str, + resource_id: str, + resource_type: Literal[ + "api_gateway_operation", + "custom_certificate", + "custom_hostname", + "dns_record", + "managed_client_certificate", + "zone", + "access_application_policy", + ], + tags: Dict[str, str] | Omit = omit, + if_match: str | 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, + ) -> Optional[ZoneTagUpdateResponse]: + """Creates or updates tags for a specific zone-level resource. + + Replaces all + existing tags for the resource. + + Args: + zone_id: Zone ID is required only for zone-level resources + + access_application_id: Access application ID is required only for access_application_policy resources + + resource_id: Identifies the unique resource. + + resource_type: Enum for base zone-level resource types (those with no extra required fields). + + tags: Contains key-value pairs of tags. + + 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( + ["zone_id", "resource_id", "resource_type"], + ["zone_id", "access_application_id", "resource_id", "resource_type"], + ) + def update( + self, + *, + zone_id: str, + resource_id: str, + resource_type: Literal[ + "api_gateway_operation", + "custom_certificate", + "custom_hostname", + "dns_record", + "managed_client_certificate", + "zone", + ] + | Literal[ + "api_gateway_operation", + "custom_certificate", + "custom_hostname", + "dns_record", + "managed_client_certificate", + "zone", + "access_application_policy", + ], + tags: Dict[str, str] | Omit = omit, + if_match: str | Omit = omit, + access_application_id: str | 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, + ) -> Optional[ZoneTagUpdateResponse]: + if not zone_id: + raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") + extra_headers = {**strip_not_given({"If-Match": if_match}), **(extra_headers or {})} + return cast( + Optional[ZoneTagUpdateResponse], + self._put( + f"/zones/{zone_id}/tags", + body=maybe_transform( + { + "resource_id": resource_id, + "resource_type": resource_type, + "tags": tags, + "access_application_id": access_application_id, + }, + zone_tag_update_params.ZoneTagUpdateParams, + ), + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + post_parser=ResultWrapper[Optional[ZoneTagUpdateResponse]]._unwrapper, + ), + cast_to=cast( + Any, ResultWrapper[ZoneTagUpdateResponse] + ), # Union types cannot be passed in as arguments in the type system + ), + ) + + def delete( + self, + *, + zone_id: str, + if_match: str | 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, + ) -> None: + """ + Removes all tags from a specific zone-level resource. + + Args: + zone_id: Zone ID is required only for zone-level resources + + 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 zone_id: + raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") + extra_headers = {"Accept": "*/*", **(extra_headers or {})} + extra_headers = {**strip_not_given({"If-Match": if_match}), **(extra_headers or {})} + return self._delete( + f"/zones/{zone_id}/tags", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=NoneType, + ) + + def get( + self, + *, + zone_id: str, + resource_id: str, + resource_type: Literal[ + "access_application_policy", + "api_gateway_operation", + "custom_certificate", + "custom_hostname", + "dns_record", + "managed_client_certificate", + "zone", + ], + access_application_id: str | 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, + ) -> Optional[ZoneTagGetResponse]: + """ + Retrieves tags for a specific zone-level resource. + + Args: + zone_id: Zone ID is required only for zone-level resources + + resource_id: The ID of the resource to retrieve tags for. + + resource_type: The type of the resource. + + access_application_id: Access application ID identifier. Required for access_application_policy + resources. + + 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 zone_id: + raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") + return cast( + Optional[ZoneTagGetResponse], + self._get( + f"/zones/{zone_id}/tags", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=maybe_transform( + { + "resource_id": resource_id, + "resource_type": resource_type, + "access_application_id": access_application_id, + }, + zone_tag_get_params.ZoneTagGetParams, + ), + post_parser=ResultWrapper[Optional[ZoneTagGetResponse]]._unwrapper, + ), + cast_to=cast( + Any, ResultWrapper[ZoneTagGetResponse] + ), # Union types cannot be passed in as arguments in the type system + ), + ) + + +class AsyncZoneTagsResource(AsyncAPIResource): + @cached_property + def with_raw_response(self) -> AsyncZoneTagsResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers + """ + return AsyncZoneTagsResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> AsyncZoneTagsResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/cloudflare/cloudflare-python#with_streaming_response + """ + return AsyncZoneTagsResourceWithStreamingResponse(self) + + @overload + async def update( + self, + *, + zone_id: str, + resource_id: str, + resource_type: Literal[ + "api_gateway_operation", + "custom_certificate", + "custom_hostname", + "dns_record", + "managed_client_certificate", + "zone", + ], + tags: Dict[str, str] | Omit = omit, + if_match: str | 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, + ) -> Optional[ZoneTagUpdateResponse]: + """Creates or updates tags for a specific zone-level resource. + + Replaces all + existing tags for the resource. + + Args: + zone_id: Zone ID is required only for zone-level resources + + resource_id: Identifies the unique resource. + + resource_type: Enum for base zone-level resource types (those with no extra required fields). + + tags: Contains key-value pairs of tags. + + 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 + """ + ... + + @overload + async def update( + self, + *, + zone_id: str, + access_application_id: str, + resource_id: str, + resource_type: Literal[ + "api_gateway_operation", + "custom_certificate", + "custom_hostname", + "dns_record", + "managed_client_certificate", + "zone", + "access_application_policy", + ], + tags: Dict[str, str] | Omit = omit, + if_match: str | 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, + ) -> Optional[ZoneTagUpdateResponse]: + """Creates or updates tags for a specific zone-level resource. + + Replaces all + existing tags for the resource. + + Args: + zone_id: Zone ID is required only for zone-level resources + + access_application_id: Access application ID is required only for access_application_policy resources + + resource_id: Identifies the unique resource. + + resource_type: Enum for base zone-level resource types (those with no extra required fields). + + tags: Contains key-value pairs of tags. + + 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( + ["zone_id", "resource_id", "resource_type"], + ["zone_id", "access_application_id", "resource_id", "resource_type"], + ) + async def update( + self, + *, + zone_id: str, + resource_id: str, + resource_type: Literal[ + "api_gateway_operation", + "custom_certificate", + "custom_hostname", + "dns_record", + "managed_client_certificate", + "zone", + ] + | Literal[ + "api_gateway_operation", + "custom_certificate", + "custom_hostname", + "dns_record", + "managed_client_certificate", + "zone", + "access_application_policy", + ], + tags: Dict[str, str] | Omit = omit, + if_match: str | Omit = omit, + access_application_id: str | 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, + ) -> Optional[ZoneTagUpdateResponse]: + if not zone_id: + raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") + extra_headers = {**strip_not_given({"If-Match": if_match}), **(extra_headers or {})} + return cast( + Optional[ZoneTagUpdateResponse], + await self._put( + f"/zones/{zone_id}/tags", + body=await async_maybe_transform( + { + "resource_id": resource_id, + "resource_type": resource_type, + "tags": tags, + "access_application_id": access_application_id, + }, + zone_tag_update_params.ZoneTagUpdateParams, + ), + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + post_parser=ResultWrapper[Optional[ZoneTagUpdateResponse]]._unwrapper, + ), + cast_to=cast( + Any, ResultWrapper[ZoneTagUpdateResponse] + ), # Union types cannot be passed in as arguments in the type system + ), + ) + + async def delete( + self, + *, + zone_id: str, + if_match: str | 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, + ) -> None: + """ + Removes all tags from a specific zone-level resource. + + Args: + zone_id: Zone ID is required only for zone-level resources + + 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 zone_id: + raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") + extra_headers = {"Accept": "*/*", **(extra_headers or {})} + extra_headers = {**strip_not_given({"If-Match": if_match}), **(extra_headers or {})} + return await self._delete( + f"/zones/{zone_id}/tags", + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=NoneType, + ) + + async def get( + self, + *, + zone_id: str, + resource_id: str, + resource_type: Literal[ + "access_application_policy", + "api_gateway_operation", + "custom_certificate", + "custom_hostname", + "dns_record", + "managed_client_certificate", + "zone", + ], + access_application_id: str | 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, + ) -> Optional[ZoneTagGetResponse]: + """ + Retrieves tags for a specific zone-level resource. + + Args: + zone_id: Zone ID is required only for zone-level resources + + resource_id: The ID of the resource to retrieve tags for. + + resource_type: The type of the resource. + + access_application_id: Access application ID identifier. Required for access_application_policy + resources. + + 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 zone_id: + raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") + return cast( + Optional[ZoneTagGetResponse], + await self._get( + f"/zones/{zone_id}/tags", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=await async_maybe_transform( + { + "resource_id": resource_id, + "resource_type": resource_type, + "access_application_id": access_application_id, + }, + zone_tag_get_params.ZoneTagGetParams, + ), + post_parser=ResultWrapper[Optional[ZoneTagGetResponse]]._unwrapper, + ), + cast_to=cast( + Any, ResultWrapper[ZoneTagGetResponse] + ), # Union types cannot be passed in as arguments in the type system + ), + ) + + +class ZoneTagsResourceWithRawResponse: + def __init__(self, zone_tags: ZoneTagsResource) -> None: + self._zone_tags = zone_tags + + self.update = to_raw_response_wrapper( + zone_tags.update, + ) + self.delete = to_raw_response_wrapper( + zone_tags.delete, + ) + self.get = to_raw_response_wrapper( + zone_tags.get, + ) + + +class AsyncZoneTagsResourceWithRawResponse: + def __init__(self, zone_tags: AsyncZoneTagsResource) -> None: + self._zone_tags = zone_tags + + self.update = async_to_raw_response_wrapper( + zone_tags.update, + ) + self.delete = async_to_raw_response_wrapper( + zone_tags.delete, + ) + self.get = async_to_raw_response_wrapper( + zone_tags.get, + ) + + +class ZoneTagsResourceWithStreamingResponse: + def __init__(self, zone_tags: ZoneTagsResource) -> None: + self._zone_tags = zone_tags + + self.update = to_streamed_response_wrapper( + zone_tags.update, + ) + self.delete = to_streamed_response_wrapper( + zone_tags.delete, + ) + self.get = to_streamed_response_wrapper( + zone_tags.get, + ) + + +class AsyncZoneTagsResourceWithStreamingResponse: + def __init__(self, zone_tags: AsyncZoneTagsResource) -> None: + self._zone_tags = zone_tags + + self.update = async_to_streamed_response_wrapper( + zone_tags.update, + ) + self.delete = async_to_streamed_response_wrapper( + zone_tags.delete, + ) + self.get = async_to_streamed_response_wrapper( + zone_tags.get, + ) diff --git a/src/cloudflare/types/resource_tagging/__init__.py b/src/cloudflare/types/resource_tagging/__init__.py new file mode 100644 index 00000000000..35b85d44a3b --- /dev/null +++ b/src/cloudflare/types/resource_tagging/__init__.py @@ -0,0 +1,18 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from .key_list_params import KeyListParams as KeyListParams +from .key_list_response import KeyListResponse as KeyListResponse +from .value_list_params import ValueListParams as ValueListParams +from .value_list_response import ValueListResponse as ValueListResponse +from .zone_tag_get_params import ZoneTagGetParams as ZoneTagGetParams +from .zone_tag_get_response import ZoneTagGetResponse as ZoneTagGetResponse +from .account_tag_get_params import AccountTagGetParams as AccountTagGetParams +from .zone_tag_update_params import ZoneTagUpdateParams as ZoneTagUpdateParams +from .account_tag_get_response import AccountTagGetResponse as AccountTagGetResponse +from .zone_tag_update_response import ZoneTagUpdateResponse as ZoneTagUpdateResponse +from .account_tag_update_params import AccountTagUpdateParams as AccountTagUpdateParams +from .account_tag_update_response import AccountTagUpdateResponse as AccountTagUpdateResponse +from .resource_tagging_list_params import ResourceTaggingListParams as ResourceTaggingListParams +from .resource_tagging_list_response import ResourceTaggingListResponse as ResourceTaggingListResponse diff --git a/src/cloudflare/types/resource_tagging/account_tag_get_params.py b/src/cloudflare/types/resource_tagging/account_tag_get_params.py new file mode 100644 index 00000000000..7a0340f55ab --- /dev/null +++ b/src/cloudflare/types/resource_tagging/account_tag_get_params.py @@ -0,0 +1,44 @@ +# 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__ = ["AccountTagGetParams"] + + +class AccountTagGetParams(TypedDict, total=False): + account_id: Required[str] + """Identifier.""" + + resource_id: Required[str] + """The ID of the resource to retrieve tags for.""" + + resource_type: Required[ + Literal[ + "access_application", + "access_group", + "account", + "ai_gateway", + "alerting_policy", + "alerting_webhook", + "cloudflared_tunnel", + "d1_database", + "durable_object_namespace", + "gateway_list", + "gateway_rule", + "image", + "kv_namespace", + "queue", + "r2_bucket", + "resource_share", + "stream_live_input", + "stream_video", + "worker", + "worker_version", + ] + ] + """The type of the resource.""" + + worker_id: str + """Worker identifier. Required for worker_version resources.""" diff --git a/src/cloudflare/types/resource_tagging/account_tag_get_response.py b/src/cloudflare/types/resource_tagging/account_tag_get_response.py new file mode 100644 index 00000000000..ea42615d755 --- /dev/null +++ b/src/cloudflare/types/resource_tagging/account_tag_get_response.py @@ -0,0 +1,747 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Dict, Union +from typing_extensions import Literal, Annotated, TypeAlias + +from ..._utils import PropertyInfo +from ..._models import BaseModel + +__all__ = [ + "AccountTagGetResponse", + "ResourceTaggingTaggedResourceObjectAccessApplication", + "ResourceTaggingTaggedResourceObjectAccessApplicationPolicy", + "ResourceTaggingTaggedResourceObjectAccessGroup", + "ResourceTaggingTaggedResourceObjectAccount", + "ResourceTaggingTaggedResourceObjectAIGateway", + "ResourceTaggingTaggedResourceObjectAlertingPolicy", + "ResourceTaggingTaggedResourceObjectAlertingWebhook", + "ResourceTaggingTaggedResourceObjectAPIGatewayOperation", + "ResourceTaggingTaggedResourceObjectCloudflaredTunnel", + "ResourceTaggingTaggedResourceObjectCustomCertificate", + "ResourceTaggingTaggedResourceObjectCustomHostname", + "ResourceTaggingTaggedResourceObjectD1Database", + "ResourceTaggingTaggedResourceObjectDNSRecord", + "ResourceTaggingTaggedResourceObjectDurableObjectNamespace", + "ResourceTaggingTaggedResourceObjectGatewayList", + "ResourceTaggingTaggedResourceObjectGatewayRule", + "ResourceTaggingTaggedResourceObjectImage", + "ResourceTaggingTaggedResourceObjectKVNamespace", + "ResourceTaggingTaggedResourceObjectManagedClientCertificate", + "ResourceTaggingTaggedResourceObjectQueue", + "ResourceTaggingTaggedResourceObjectR2Bucket", + "ResourceTaggingTaggedResourceObjectResourceShare", + "ResourceTaggingTaggedResourceObjectStreamLiveInput", + "ResourceTaggingTaggedResourceObjectStreamVideo", + "ResourceTaggingTaggedResourceObjectWorker", + "ResourceTaggingTaggedResourceObjectWorkerVersion", + "ResourceTaggingTaggedResourceObjectZone", +] + + +class ResourceTaggingTaggedResourceObjectAccessApplication(BaseModel): + """Response for access_application resources""" + + id: str + """Identifies the unique resource.""" + + etag: str + """ETag identifier for optimistic concurrency control. + + Formatted as "v1:" where the hash is the base64url-encoded SHA-256 + (truncated to 128 bits) of the tags map canonicalized using RFC 8785 (JSON + Canonicalization Scheme). Clients should treat ETags as opaque strings and pass + them back via the If-Match header on write operations. + """ + + name: str + """Human-readable name of the resource.""" + + tags: Dict[str, str] + """Contains key-value pairs of tags.""" + + type: Literal["access_application"] + + +class ResourceTaggingTaggedResourceObjectAccessApplicationPolicy(BaseModel): + """Response for access_application_policy resources""" + + id: str + """Identifies the unique resource.""" + + access_application_id: str + """Access application ID is required only for access_application_policy resources""" + + etag: str + """ETag identifier for optimistic concurrency control. + + Formatted as "v1:" where the hash is the base64url-encoded SHA-256 + (truncated to 128 bits) of the tags map canonicalized using RFC 8785 (JSON + Canonicalization Scheme). Clients should treat ETags as opaque strings and pass + them back via the If-Match header on write operations. + """ + + name: str + """Human-readable name of the resource.""" + + tags: Dict[str, str] + """Contains key-value pairs of tags.""" + + type: Literal["access_application_policy"] + + zone_id: str + """Zone ID is required only for zone-level resources""" + + +class ResourceTaggingTaggedResourceObjectAccessGroup(BaseModel): + """Response for access_group resources""" + + id: str + """Identifies the unique resource.""" + + etag: str + """ETag identifier for optimistic concurrency control. + + Formatted as "v1:" where the hash is the base64url-encoded SHA-256 + (truncated to 128 bits) of the tags map canonicalized using RFC 8785 (JSON + Canonicalization Scheme). Clients should treat ETags as opaque strings and pass + them back via the If-Match header on write operations. + """ + + name: str + """Human-readable name of the resource.""" + + tags: Dict[str, str] + """Contains key-value pairs of tags.""" + + type: Literal["access_group"] + + +class ResourceTaggingTaggedResourceObjectAccount(BaseModel): + """Response for account resources""" + + id: str + """Identifies the unique resource.""" + + etag: str + """ETag identifier for optimistic concurrency control. + + Formatted as "v1:" where the hash is the base64url-encoded SHA-256 + (truncated to 128 bits) of the tags map canonicalized using RFC 8785 (JSON + Canonicalization Scheme). Clients should treat ETags as opaque strings and pass + them back via the If-Match header on write operations. + """ + + name: str + """Human-readable name of the resource.""" + + tags: Dict[str, str] + """Contains key-value pairs of tags.""" + + type: Literal["account"] + + +class ResourceTaggingTaggedResourceObjectAIGateway(BaseModel): + """Response for ai_gateway resources""" + + id: str + """Identifies the unique resource.""" + + etag: str + """ETag identifier for optimistic concurrency control. + + Formatted as "v1:" where the hash is the base64url-encoded SHA-256 + (truncated to 128 bits) of the tags map canonicalized using RFC 8785 (JSON + Canonicalization Scheme). Clients should treat ETags as opaque strings and pass + them back via the If-Match header on write operations. + """ + + name: str + """Human-readable name of the resource.""" + + tags: Dict[str, str] + """Contains key-value pairs of tags.""" + + type: Literal["ai_gateway"] + + +class ResourceTaggingTaggedResourceObjectAlertingPolicy(BaseModel): + """Response for alerting_policy resources""" + + id: str + """Identifies the unique resource.""" + + etag: str + """ETag identifier for optimistic concurrency control. + + Formatted as "v1:" where the hash is the base64url-encoded SHA-256 + (truncated to 128 bits) of the tags map canonicalized using RFC 8785 (JSON + Canonicalization Scheme). Clients should treat ETags as opaque strings and pass + them back via the If-Match header on write operations. + """ + + name: str + """Human-readable name of the resource.""" + + tags: Dict[str, str] + """Contains key-value pairs of tags.""" + + type: Literal["alerting_policy"] + + +class ResourceTaggingTaggedResourceObjectAlertingWebhook(BaseModel): + """Response for alerting_webhook resources""" + + id: str + """Identifies the unique resource.""" + + etag: str + """ETag identifier for optimistic concurrency control. + + Formatted as "v1:" where the hash is the base64url-encoded SHA-256 + (truncated to 128 bits) of the tags map canonicalized using RFC 8785 (JSON + Canonicalization Scheme). Clients should treat ETags as opaque strings and pass + them back via the If-Match header on write operations. + """ + + name: str + """Human-readable name of the resource.""" + + tags: Dict[str, str] + """Contains key-value pairs of tags.""" + + type: Literal["alerting_webhook"] + + +class ResourceTaggingTaggedResourceObjectAPIGatewayOperation(BaseModel): + """Response for api_gateway_operation resources""" + + id: str + """Identifies the unique resource.""" + + etag: str + """ETag identifier for optimistic concurrency control. + + Formatted as "v1:" where the hash is the base64url-encoded SHA-256 + (truncated to 128 bits) of the tags map canonicalized using RFC 8785 (JSON + Canonicalization Scheme). Clients should treat ETags as opaque strings and pass + them back via the If-Match header on write operations. + """ + + name: str + """Human-readable name of the resource.""" + + tags: Dict[str, str] + """Contains key-value pairs of tags.""" + + type: Literal["api_gateway_operation"] + + zone_id: str + """Zone ID is required only for zone-level resources""" + + +class ResourceTaggingTaggedResourceObjectCloudflaredTunnel(BaseModel): + """Response for cloudflared_tunnel resources""" + + id: str + """Identifies the unique resource.""" + + etag: str + """ETag identifier for optimistic concurrency control. + + Formatted as "v1:" where the hash is the base64url-encoded SHA-256 + (truncated to 128 bits) of the tags map canonicalized using RFC 8785 (JSON + Canonicalization Scheme). Clients should treat ETags as opaque strings and pass + them back via the If-Match header on write operations. + """ + + name: str + """Human-readable name of the resource.""" + + tags: Dict[str, str] + """Contains key-value pairs of tags.""" + + type: Literal["cloudflared_tunnel"] + + +class ResourceTaggingTaggedResourceObjectCustomCertificate(BaseModel): + """Response for custom_certificate resources""" + + id: str + """Identifies the unique resource.""" + + etag: str + """ETag identifier for optimistic concurrency control. + + Formatted as "v1:" where the hash is the base64url-encoded SHA-256 + (truncated to 128 bits) of the tags map canonicalized using RFC 8785 (JSON + Canonicalization Scheme). Clients should treat ETags as opaque strings and pass + them back via the If-Match header on write operations. + """ + + name: str + """Human-readable name of the resource.""" + + tags: Dict[str, str] + """Contains key-value pairs of tags.""" + + type: Literal["custom_certificate"] + + zone_id: str + """Zone ID is required only for zone-level resources""" + + +class ResourceTaggingTaggedResourceObjectCustomHostname(BaseModel): + """Response for custom_hostname resources""" + + id: str + """Identifies the unique resource.""" + + etag: str + """ETag identifier for optimistic concurrency control. + + Formatted as "v1:" where the hash is the base64url-encoded SHA-256 + (truncated to 128 bits) of the tags map canonicalized using RFC 8785 (JSON + Canonicalization Scheme). Clients should treat ETags as opaque strings and pass + them back via the If-Match header on write operations. + """ + + name: str + """Human-readable name of the resource.""" + + tags: Dict[str, str] + """Contains key-value pairs of tags.""" + + type: Literal["custom_hostname"] + + zone_id: str + """Zone ID is required only for zone-level resources""" + + +class ResourceTaggingTaggedResourceObjectD1Database(BaseModel): + """Response for d1_database resources""" + + id: str + """Identifies the unique resource.""" + + etag: str + """ETag identifier for optimistic concurrency control. + + Formatted as "v1:" where the hash is the base64url-encoded SHA-256 + (truncated to 128 bits) of the tags map canonicalized using RFC 8785 (JSON + Canonicalization Scheme). Clients should treat ETags as opaque strings and pass + them back via the If-Match header on write operations. + """ + + name: str + """Human-readable name of the resource.""" + + tags: Dict[str, str] + """Contains key-value pairs of tags.""" + + type: Literal["d1_database"] + + +class ResourceTaggingTaggedResourceObjectDNSRecord(BaseModel): + """Response for dns_record resources""" + + id: str + """Identifies the unique resource.""" + + etag: str + """ETag identifier for optimistic concurrency control. + + Formatted as "v1:" where the hash is the base64url-encoded SHA-256 + (truncated to 128 bits) of the tags map canonicalized using RFC 8785 (JSON + Canonicalization Scheme). Clients should treat ETags as opaque strings and pass + them back via the If-Match header on write operations. + """ + + name: str + """Human-readable name of the resource.""" + + tags: Dict[str, str] + """Contains key-value pairs of tags.""" + + type: Literal["dns_record"] + + zone_id: str + """Zone ID is required only for zone-level resources""" + + +class ResourceTaggingTaggedResourceObjectDurableObjectNamespace(BaseModel): + """Response for durable_object_namespace resources""" + + id: str + """Identifies the unique resource.""" + + etag: str + """ETag identifier for optimistic concurrency control. + + Formatted as "v1:" where the hash is the base64url-encoded SHA-256 + (truncated to 128 bits) of the tags map canonicalized using RFC 8785 (JSON + Canonicalization Scheme). Clients should treat ETags as opaque strings and pass + them back via the If-Match header on write operations. + """ + + name: str + """Human-readable name of the resource.""" + + tags: Dict[str, str] + """Contains key-value pairs of tags.""" + + type: Literal["durable_object_namespace"] + + +class ResourceTaggingTaggedResourceObjectGatewayList(BaseModel): + """Response for gateway_list resources""" + + id: str + """Identifies the unique resource.""" + + etag: str + """ETag identifier for optimistic concurrency control. + + Formatted as "v1:" where the hash is the base64url-encoded SHA-256 + (truncated to 128 bits) of the tags map canonicalized using RFC 8785 (JSON + Canonicalization Scheme). Clients should treat ETags as opaque strings and pass + them back via the If-Match header on write operations. + """ + + name: str + """Human-readable name of the resource.""" + + tags: Dict[str, str] + """Contains key-value pairs of tags.""" + + type: Literal["gateway_list"] + + +class ResourceTaggingTaggedResourceObjectGatewayRule(BaseModel): + """Response for gateway_rule resources""" + + id: str + """Identifies the unique resource.""" + + etag: str + """ETag identifier for optimistic concurrency control. + + Formatted as "v1:" where the hash is the base64url-encoded SHA-256 + (truncated to 128 bits) of the tags map canonicalized using RFC 8785 (JSON + Canonicalization Scheme). Clients should treat ETags as opaque strings and pass + them back via the If-Match header on write operations. + """ + + name: str + """Human-readable name of the resource.""" + + tags: Dict[str, str] + """Contains key-value pairs of tags.""" + + type: Literal["gateway_rule"] + + +class ResourceTaggingTaggedResourceObjectImage(BaseModel): + """Response for image resources""" + + id: str + """Identifies the unique resource.""" + + etag: str + """ETag identifier for optimistic concurrency control. + + Formatted as "v1:" where the hash is the base64url-encoded SHA-256 + (truncated to 128 bits) of the tags map canonicalized using RFC 8785 (JSON + Canonicalization Scheme). Clients should treat ETags as opaque strings and pass + them back via the If-Match header on write operations. + """ + + name: str + """Human-readable name of the resource.""" + + tags: Dict[str, str] + """Contains key-value pairs of tags.""" + + type: Literal["image"] + + +class ResourceTaggingTaggedResourceObjectKVNamespace(BaseModel): + """Response for kv_namespace resources""" + + id: str + """Identifies the unique resource.""" + + etag: str + """ETag identifier for optimistic concurrency control. + + Formatted as "v1:" where the hash is the base64url-encoded SHA-256 + (truncated to 128 bits) of the tags map canonicalized using RFC 8785 (JSON + Canonicalization Scheme). Clients should treat ETags as opaque strings and pass + them back via the If-Match header on write operations. + """ + + name: str + """Human-readable name of the resource.""" + + tags: Dict[str, str] + """Contains key-value pairs of tags.""" + + type: Literal["kv_namespace"] + + +class ResourceTaggingTaggedResourceObjectManagedClientCertificate(BaseModel): + """Response for managed_client_certificate resources""" + + id: str + """Identifies the unique resource.""" + + etag: str + """ETag identifier for optimistic concurrency control. + + Formatted as "v1:" where the hash is the base64url-encoded SHA-256 + (truncated to 128 bits) of the tags map canonicalized using RFC 8785 (JSON + Canonicalization Scheme). Clients should treat ETags as opaque strings and pass + them back via the If-Match header on write operations. + """ + + name: str + """Human-readable name of the resource.""" + + tags: Dict[str, str] + """Contains key-value pairs of tags.""" + + type: Literal["managed_client_certificate"] + + zone_id: str + """Zone ID is required only for zone-level resources""" + + +class ResourceTaggingTaggedResourceObjectQueue(BaseModel): + """Response for queue resources""" + + id: str + """Identifies the unique resource.""" + + etag: str + """ETag identifier for optimistic concurrency control. + + Formatted as "v1:" where the hash is the base64url-encoded SHA-256 + (truncated to 128 bits) of the tags map canonicalized using RFC 8785 (JSON + Canonicalization Scheme). Clients should treat ETags as opaque strings and pass + them back via the If-Match header on write operations. + """ + + name: str + """Human-readable name of the resource.""" + + tags: Dict[str, str] + """Contains key-value pairs of tags.""" + + type: Literal["queue"] + + +class ResourceTaggingTaggedResourceObjectR2Bucket(BaseModel): + """Response for r2_bucket resources""" + + id: str + """Identifies the unique resource.""" + + etag: str + """ETag identifier for optimistic concurrency control. + + Formatted as "v1:" where the hash is the base64url-encoded SHA-256 + (truncated to 128 bits) of the tags map canonicalized using RFC 8785 (JSON + Canonicalization Scheme). Clients should treat ETags as opaque strings and pass + them back via the If-Match header on write operations. + """ + + name: str + """Human-readable name of the resource.""" + + tags: Dict[str, str] + """Contains key-value pairs of tags.""" + + type: Literal["r2_bucket"] + + +class ResourceTaggingTaggedResourceObjectResourceShare(BaseModel): + """Response for resource_share resources""" + + id: str + """Identifies the unique resource.""" + + etag: str + """ETag identifier for optimistic concurrency control. + + Formatted as "v1:" where the hash is the base64url-encoded SHA-256 + (truncated to 128 bits) of the tags map canonicalized using RFC 8785 (JSON + Canonicalization Scheme). Clients should treat ETags as opaque strings and pass + them back via the If-Match header on write operations. + """ + + name: str + """Human-readable name of the resource.""" + + tags: Dict[str, str] + """Contains key-value pairs of tags.""" + + type: Literal["resource_share"] + + +class ResourceTaggingTaggedResourceObjectStreamLiveInput(BaseModel): + """Response for stream_live_input resources""" + + id: str + """Identifies the unique resource.""" + + etag: str + """ETag identifier for optimistic concurrency control. + + Formatted as "v1:" where the hash is the base64url-encoded SHA-256 + (truncated to 128 bits) of the tags map canonicalized using RFC 8785 (JSON + Canonicalization Scheme). Clients should treat ETags as opaque strings and pass + them back via the If-Match header on write operations. + """ + + name: str + """Human-readable name of the resource.""" + + tags: Dict[str, str] + """Contains key-value pairs of tags.""" + + type: Literal["stream_live_input"] + + +class ResourceTaggingTaggedResourceObjectStreamVideo(BaseModel): + """Response for stream_video resources""" + + id: str + """Identifies the unique resource.""" + + etag: str + """ETag identifier for optimistic concurrency control. + + Formatted as "v1:" where the hash is the base64url-encoded SHA-256 + (truncated to 128 bits) of the tags map canonicalized using RFC 8785 (JSON + Canonicalization Scheme). Clients should treat ETags as opaque strings and pass + them back via the If-Match header on write operations. + """ + + name: str + """Human-readable name of the resource.""" + + tags: Dict[str, str] + """Contains key-value pairs of tags.""" + + type: Literal["stream_video"] + + +class ResourceTaggingTaggedResourceObjectWorker(BaseModel): + """Response for worker resources""" + + id: str + """Identifies the unique resource.""" + + etag: str + """ETag identifier for optimistic concurrency control. + + Formatted as "v1:" where the hash is the base64url-encoded SHA-256 + (truncated to 128 bits) of the tags map canonicalized using RFC 8785 (JSON + Canonicalization Scheme). Clients should treat ETags as opaque strings and pass + them back via the If-Match header on write operations. + """ + + name: str + """Human-readable name of the resource.""" + + tags: Dict[str, str] + """Contains key-value pairs of tags.""" + + type: Literal["worker"] + + +class ResourceTaggingTaggedResourceObjectWorkerVersion(BaseModel): + """Response for worker_version resources""" + + id: str + """Identifies the unique resource.""" + + etag: str + """ETag identifier for optimistic concurrency control. + + Formatted as "v1:" where the hash is the base64url-encoded SHA-256 + (truncated to 128 bits) of the tags map canonicalized using RFC 8785 (JSON + Canonicalization Scheme). Clients should treat ETags as opaque strings and pass + them back via the If-Match header on write operations. + """ + + name: str + """Human-readable name of the resource.""" + + tags: Dict[str, str] + """Contains key-value pairs of tags.""" + + type: Literal["worker_version"] + + worker_id: str + """Worker ID is required only for worker_version resources""" + + +class ResourceTaggingTaggedResourceObjectZone(BaseModel): + """Response for zone resources""" + + id: str + """Identifies the unique resource.""" + + etag: str + """ETag identifier for optimistic concurrency control. + + Formatted as "v1:" where the hash is the base64url-encoded SHA-256 + (truncated to 128 bits) of the tags map canonicalized using RFC 8785 (JSON + Canonicalization Scheme). Clients should treat ETags as opaque strings and pass + them back via the If-Match header on write operations. + """ + + name: str + """Human-readable name of the resource.""" + + tags: Dict[str, str] + """Contains key-value pairs of tags.""" + + type: Literal["zone"] + + zone_id: str + """Zone ID is required only for zone-level resources""" + + +AccountTagGetResponse: TypeAlias = Annotated[ + Union[ + ResourceTaggingTaggedResourceObjectAccessApplication, + ResourceTaggingTaggedResourceObjectAccessApplicationPolicy, + ResourceTaggingTaggedResourceObjectAccessGroup, + ResourceTaggingTaggedResourceObjectAccount, + ResourceTaggingTaggedResourceObjectAIGateway, + ResourceTaggingTaggedResourceObjectAlertingPolicy, + ResourceTaggingTaggedResourceObjectAlertingWebhook, + ResourceTaggingTaggedResourceObjectAPIGatewayOperation, + ResourceTaggingTaggedResourceObjectCloudflaredTunnel, + ResourceTaggingTaggedResourceObjectCustomCertificate, + ResourceTaggingTaggedResourceObjectCustomHostname, + ResourceTaggingTaggedResourceObjectD1Database, + ResourceTaggingTaggedResourceObjectDNSRecord, + ResourceTaggingTaggedResourceObjectDurableObjectNamespace, + ResourceTaggingTaggedResourceObjectGatewayList, + ResourceTaggingTaggedResourceObjectGatewayRule, + ResourceTaggingTaggedResourceObjectImage, + ResourceTaggingTaggedResourceObjectKVNamespace, + ResourceTaggingTaggedResourceObjectManagedClientCertificate, + ResourceTaggingTaggedResourceObjectQueue, + ResourceTaggingTaggedResourceObjectR2Bucket, + ResourceTaggingTaggedResourceObjectResourceShare, + ResourceTaggingTaggedResourceObjectStreamLiveInput, + ResourceTaggingTaggedResourceObjectStreamVideo, + ResourceTaggingTaggedResourceObjectWorker, + ResourceTaggingTaggedResourceObjectWorkerVersion, + ResourceTaggingTaggedResourceObjectZone, + ], + PropertyInfo(discriminator="type"), +] diff --git a/src/cloudflare/types/resource_tagging/account_tag_update_params.py b/src/cloudflare/types/resource_tagging/account_tag_update_params.py new file mode 100644 index 00000000000..1fb41f29a2a --- /dev/null +++ b/src/cloudflare/types/resource_tagging/account_tag_update_params.py @@ -0,0 +1,105 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Dict, Union +from typing_extensions import Literal, Required, Annotated, TypeAlias, TypedDict + +from ..._utils import PropertyInfo + +__all__ = [ + "AccountTagUpdateParams", + "ResourceTaggingSetTagsRequestAccountLevelWorkerVersion", + "ResourceTaggingSetTagsRequestAccountLevelBase", +] + + +class ResourceTaggingSetTagsRequestAccountLevelWorkerVersion(TypedDict, total=False): + account_id: Required[str] + """Identifier.""" + + resource_id: Required[str] + """Identifies the unique resource.""" + + resource_type: Required[ + Literal[ + "access_application", + "access_group", + "account", + "ai_gateway", + "alerting_policy", + "alerting_webhook", + "cloudflared_tunnel", + "d1_database", + "durable_object_namespace", + "gateway_list", + "gateway_rule", + "image", + "kv_namespace", + "queue", + "r2_bucket", + "resource_share", + "stream_live_input", + "stream_video", + "worker", + "worker_version", + ] + ] + """ + Enum for base account-level resource types (those with no extra required + fields). + """ + + worker_id: Required[str] + """Worker ID is required only for worker_version resources""" + + tags: Dict[str, str] + """Contains key-value pairs of tags.""" + + if_match: Annotated[str, PropertyInfo(alias="If-Match")] + + +class ResourceTaggingSetTagsRequestAccountLevelBase(TypedDict, total=False): + account_id: Required[str] + """Identifier.""" + + resource_id: Required[str] + """Identifies the unique resource.""" + + resource_type: Required[ + Literal[ + "access_application", + "access_group", + "account", + "ai_gateway", + "alerting_policy", + "alerting_webhook", + "cloudflared_tunnel", + "d1_database", + "durable_object_namespace", + "gateway_list", + "gateway_rule", + "image", + "kv_namespace", + "queue", + "r2_bucket", + "resource_share", + "stream_live_input", + "stream_video", + "worker", + ] + ] + """ + Enum for base account-level resource types (those with no extra required + fields). + """ + + tags: Dict[str, str] + """Contains key-value pairs of tags.""" + + if_match: Annotated[str, PropertyInfo(alias="If-Match")] + + +AccountTagUpdateParams: TypeAlias = Union[ + ResourceTaggingSetTagsRequestAccountLevelWorkerVersion, ResourceTaggingSetTagsRequestAccountLevelBase +] diff --git a/src/cloudflare/types/resource_tagging/account_tag_update_response.py b/src/cloudflare/types/resource_tagging/account_tag_update_response.py new file mode 100644 index 00000000000..77d06d6ed2b --- /dev/null +++ b/src/cloudflare/types/resource_tagging/account_tag_update_response.py @@ -0,0 +1,747 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Dict, Union +from typing_extensions import Literal, Annotated, TypeAlias + +from ..._utils import PropertyInfo +from ..._models import BaseModel + +__all__ = [ + "AccountTagUpdateResponse", + "ResourceTaggingTaggedResourceObjectAccessApplication", + "ResourceTaggingTaggedResourceObjectAccessApplicationPolicy", + "ResourceTaggingTaggedResourceObjectAccessGroup", + "ResourceTaggingTaggedResourceObjectAccount", + "ResourceTaggingTaggedResourceObjectAIGateway", + "ResourceTaggingTaggedResourceObjectAlertingPolicy", + "ResourceTaggingTaggedResourceObjectAlertingWebhook", + "ResourceTaggingTaggedResourceObjectAPIGatewayOperation", + "ResourceTaggingTaggedResourceObjectCloudflaredTunnel", + "ResourceTaggingTaggedResourceObjectCustomCertificate", + "ResourceTaggingTaggedResourceObjectCustomHostname", + "ResourceTaggingTaggedResourceObjectD1Database", + "ResourceTaggingTaggedResourceObjectDNSRecord", + "ResourceTaggingTaggedResourceObjectDurableObjectNamespace", + "ResourceTaggingTaggedResourceObjectGatewayList", + "ResourceTaggingTaggedResourceObjectGatewayRule", + "ResourceTaggingTaggedResourceObjectImage", + "ResourceTaggingTaggedResourceObjectKVNamespace", + "ResourceTaggingTaggedResourceObjectManagedClientCertificate", + "ResourceTaggingTaggedResourceObjectQueue", + "ResourceTaggingTaggedResourceObjectR2Bucket", + "ResourceTaggingTaggedResourceObjectResourceShare", + "ResourceTaggingTaggedResourceObjectStreamLiveInput", + "ResourceTaggingTaggedResourceObjectStreamVideo", + "ResourceTaggingTaggedResourceObjectWorker", + "ResourceTaggingTaggedResourceObjectWorkerVersion", + "ResourceTaggingTaggedResourceObjectZone", +] + + +class ResourceTaggingTaggedResourceObjectAccessApplication(BaseModel): + """Response for access_application resources""" + + id: str + """Identifies the unique resource.""" + + etag: str + """ETag identifier for optimistic concurrency control. + + Formatted as "v1:" where the hash is the base64url-encoded SHA-256 + (truncated to 128 bits) of the tags map canonicalized using RFC 8785 (JSON + Canonicalization Scheme). Clients should treat ETags as opaque strings and pass + them back via the If-Match header on write operations. + """ + + name: str + """Human-readable name of the resource.""" + + tags: Dict[str, str] + """Contains key-value pairs of tags.""" + + type: Literal["access_application"] + + +class ResourceTaggingTaggedResourceObjectAccessApplicationPolicy(BaseModel): + """Response for access_application_policy resources""" + + id: str + """Identifies the unique resource.""" + + access_application_id: str + """Access application ID is required only for access_application_policy resources""" + + etag: str + """ETag identifier for optimistic concurrency control. + + Formatted as "v1:" where the hash is the base64url-encoded SHA-256 + (truncated to 128 bits) of the tags map canonicalized using RFC 8785 (JSON + Canonicalization Scheme). Clients should treat ETags as opaque strings and pass + them back via the If-Match header on write operations. + """ + + name: str + """Human-readable name of the resource.""" + + tags: Dict[str, str] + """Contains key-value pairs of tags.""" + + type: Literal["access_application_policy"] + + zone_id: str + """Zone ID is required only for zone-level resources""" + + +class ResourceTaggingTaggedResourceObjectAccessGroup(BaseModel): + """Response for access_group resources""" + + id: str + """Identifies the unique resource.""" + + etag: str + """ETag identifier for optimistic concurrency control. + + Formatted as "v1:" where the hash is the base64url-encoded SHA-256 + (truncated to 128 bits) of the tags map canonicalized using RFC 8785 (JSON + Canonicalization Scheme). Clients should treat ETags as opaque strings and pass + them back via the If-Match header on write operations. + """ + + name: str + """Human-readable name of the resource.""" + + tags: Dict[str, str] + """Contains key-value pairs of tags.""" + + type: Literal["access_group"] + + +class ResourceTaggingTaggedResourceObjectAccount(BaseModel): + """Response for account resources""" + + id: str + """Identifies the unique resource.""" + + etag: str + """ETag identifier for optimistic concurrency control. + + Formatted as "v1:" where the hash is the base64url-encoded SHA-256 + (truncated to 128 bits) of the tags map canonicalized using RFC 8785 (JSON + Canonicalization Scheme). Clients should treat ETags as opaque strings and pass + them back via the If-Match header on write operations. + """ + + name: str + """Human-readable name of the resource.""" + + tags: Dict[str, str] + """Contains key-value pairs of tags.""" + + type: Literal["account"] + + +class ResourceTaggingTaggedResourceObjectAIGateway(BaseModel): + """Response for ai_gateway resources""" + + id: str + """Identifies the unique resource.""" + + etag: str + """ETag identifier for optimistic concurrency control. + + Formatted as "v1:" where the hash is the base64url-encoded SHA-256 + (truncated to 128 bits) of the tags map canonicalized using RFC 8785 (JSON + Canonicalization Scheme). Clients should treat ETags as opaque strings and pass + them back via the If-Match header on write operations. + """ + + name: str + """Human-readable name of the resource.""" + + tags: Dict[str, str] + """Contains key-value pairs of tags.""" + + type: Literal["ai_gateway"] + + +class ResourceTaggingTaggedResourceObjectAlertingPolicy(BaseModel): + """Response for alerting_policy resources""" + + id: str + """Identifies the unique resource.""" + + etag: str + """ETag identifier for optimistic concurrency control. + + Formatted as "v1:" where the hash is the base64url-encoded SHA-256 + (truncated to 128 bits) of the tags map canonicalized using RFC 8785 (JSON + Canonicalization Scheme). Clients should treat ETags as opaque strings and pass + them back via the If-Match header on write operations. + """ + + name: str + """Human-readable name of the resource.""" + + tags: Dict[str, str] + """Contains key-value pairs of tags.""" + + type: Literal["alerting_policy"] + + +class ResourceTaggingTaggedResourceObjectAlertingWebhook(BaseModel): + """Response for alerting_webhook resources""" + + id: str + """Identifies the unique resource.""" + + etag: str + """ETag identifier for optimistic concurrency control. + + Formatted as "v1:" where the hash is the base64url-encoded SHA-256 + (truncated to 128 bits) of the tags map canonicalized using RFC 8785 (JSON + Canonicalization Scheme). Clients should treat ETags as opaque strings and pass + them back via the If-Match header on write operations. + """ + + name: str + """Human-readable name of the resource.""" + + tags: Dict[str, str] + """Contains key-value pairs of tags.""" + + type: Literal["alerting_webhook"] + + +class ResourceTaggingTaggedResourceObjectAPIGatewayOperation(BaseModel): + """Response for api_gateway_operation resources""" + + id: str + """Identifies the unique resource.""" + + etag: str + """ETag identifier for optimistic concurrency control. + + Formatted as "v1:" where the hash is the base64url-encoded SHA-256 + (truncated to 128 bits) of the tags map canonicalized using RFC 8785 (JSON + Canonicalization Scheme). Clients should treat ETags as opaque strings and pass + them back via the If-Match header on write operations. + """ + + name: str + """Human-readable name of the resource.""" + + tags: Dict[str, str] + """Contains key-value pairs of tags.""" + + type: Literal["api_gateway_operation"] + + zone_id: str + """Zone ID is required only for zone-level resources""" + + +class ResourceTaggingTaggedResourceObjectCloudflaredTunnel(BaseModel): + """Response for cloudflared_tunnel resources""" + + id: str + """Identifies the unique resource.""" + + etag: str + """ETag identifier for optimistic concurrency control. + + Formatted as "v1:" where the hash is the base64url-encoded SHA-256 + (truncated to 128 bits) of the tags map canonicalized using RFC 8785 (JSON + Canonicalization Scheme). Clients should treat ETags as opaque strings and pass + them back via the If-Match header on write operations. + """ + + name: str + """Human-readable name of the resource.""" + + tags: Dict[str, str] + """Contains key-value pairs of tags.""" + + type: Literal["cloudflared_tunnel"] + + +class ResourceTaggingTaggedResourceObjectCustomCertificate(BaseModel): + """Response for custom_certificate resources""" + + id: str + """Identifies the unique resource.""" + + etag: str + """ETag identifier for optimistic concurrency control. + + Formatted as "v1:" where the hash is the base64url-encoded SHA-256 + (truncated to 128 bits) of the tags map canonicalized using RFC 8785 (JSON + Canonicalization Scheme). Clients should treat ETags as opaque strings and pass + them back via the If-Match header on write operations. + """ + + name: str + """Human-readable name of the resource.""" + + tags: Dict[str, str] + """Contains key-value pairs of tags.""" + + type: Literal["custom_certificate"] + + zone_id: str + """Zone ID is required only for zone-level resources""" + + +class ResourceTaggingTaggedResourceObjectCustomHostname(BaseModel): + """Response for custom_hostname resources""" + + id: str + """Identifies the unique resource.""" + + etag: str + """ETag identifier for optimistic concurrency control. + + Formatted as "v1:" where the hash is the base64url-encoded SHA-256 + (truncated to 128 bits) of the tags map canonicalized using RFC 8785 (JSON + Canonicalization Scheme). Clients should treat ETags as opaque strings and pass + them back via the If-Match header on write operations. + """ + + name: str + """Human-readable name of the resource.""" + + tags: Dict[str, str] + """Contains key-value pairs of tags.""" + + type: Literal["custom_hostname"] + + zone_id: str + """Zone ID is required only for zone-level resources""" + + +class ResourceTaggingTaggedResourceObjectD1Database(BaseModel): + """Response for d1_database resources""" + + id: str + """Identifies the unique resource.""" + + etag: str + """ETag identifier for optimistic concurrency control. + + Formatted as "v1:" where the hash is the base64url-encoded SHA-256 + (truncated to 128 bits) of the tags map canonicalized using RFC 8785 (JSON + Canonicalization Scheme). Clients should treat ETags as opaque strings and pass + them back via the If-Match header on write operations. + """ + + name: str + """Human-readable name of the resource.""" + + tags: Dict[str, str] + """Contains key-value pairs of tags.""" + + type: Literal["d1_database"] + + +class ResourceTaggingTaggedResourceObjectDNSRecord(BaseModel): + """Response for dns_record resources""" + + id: str + """Identifies the unique resource.""" + + etag: str + """ETag identifier for optimistic concurrency control. + + Formatted as "v1:" where the hash is the base64url-encoded SHA-256 + (truncated to 128 bits) of the tags map canonicalized using RFC 8785 (JSON + Canonicalization Scheme). Clients should treat ETags as opaque strings and pass + them back via the If-Match header on write operations. + """ + + name: str + """Human-readable name of the resource.""" + + tags: Dict[str, str] + """Contains key-value pairs of tags.""" + + type: Literal["dns_record"] + + zone_id: str + """Zone ID is required only for zone-level resources""" + + +class ResourceTaggingTaggedResourceObjectDurableObjectNamespace(BaseModel): + """Response for durable_object_namespace resources""" + + id: str + """Identifies the unique resource.""" + + etag: str + """ETag identifier for optimistic concurrency control. + + Formatted as "v1:" where the hash is the base64url-encoded SHA-256 + (truncated to 128 bits) of the tags map canonicalized using RFC 8785 (JSON + Canonicalization Scheme). Clients should treat ETags as opaque strings and pass + them back via the If-Match header on write operations. + """ + + name: str + """Human-readable name of the resource.""" + + tags: Dict[str, str] + """Contains key-value pairs of tags.""" + + type: Literal["durable_object_namespace"] + + +class ResourceTaggingTaggedResourceObjectGatewayList(BaseModel): + """Response for gateway_list resources""" + + id: str + """Identifies the unique resource.""" + + etag: str + """ETag identifier for optimistic concurrency control. + + Formatted as "v1:" where the hash is the base64url-encoded SHA-256 + (truncated to 128 bits) of the tags map canonicalized using RFC 8785 (JSON + Canonicalization Scheme). Clients should treat ETags as opaque strings and pass + them back via the If-Match header on write operations. + """ + + name: str + """Human-readable name of the resource.""" + + tags: Dict[str, str] + """Contains key-value pairs of tags.""" + + type: Literal["gateway_list"] + + +class ResourceTaggingTaggedResourceObjectGatewayRule(BaseModel): + """Response for gateway_rule resources""" + + id: str + """Identifies the unique resource.""" + + etag: str + """ETag identifier for optimistic concurrency control. + + Formatted as "v1:" where the hash is the base64url-encoded SHA-256 + (truncated to 128 bits) of the tags map canonicalized using RFC 8785 (JSON + Canonicalization Scheme). Clients should treat ETags as opaque strings and pass + them back via the If-Match header on write operations. + """ + + name: str + """Human-readable name of the resource.""" + + tags: Dict[str, str] + """Contains key-value pairs of tags.""" + + type: Literal["gateway_rule"] + + +class ResourceTaggingTaggedResourceObjectImage(BaseModel): + """Response for image resources""" + + id: str + """Identifies the unique resource.""" + + etag: str + """ETag identifier for optimistic concurrency control. + + Formatted as "v1:" where the hash is the base64url-encoded SHA-256 + (truncated to 128 bits) of the tags map canonicalized using RFC 8785 (JSON + Canonicalization Scheme). Clients should treat ETags as opaque strings and pass + them back via the If-Match header on write operations. + """ + + name: str + """Human-readable name of the resource.""" + + tags: Dict[str, str] + """Contains key-value pairs of tags.""" + + type: Literal["image"] + + +class ResourceTaggingTaggedResourceObjectKVNamespace(BaseModel): + """Response for kv_namespace resources""" + + id: str + """Identifies the unique resource.""" + + etag: str + """ETag identifier for optimistic concurrency control. + + Formatted as "v1:" where the hash is the base64url-encoded SHA-256 + (truncated to 128 bits) of the tags map canonicalized using RFC 8785 (JSON + Canonicalization Scheme). Clients should treat ETags as opaque strings and pass + them back via the If-Match header on write operations. + """ + + name: str + """Human-readable name of the resource.""" + + tags: Dict[str, str] + """Contains key-value pairs of tags.""" + + type: Literal["kv_namespace"] + + +class ResourceTaggingTaggedResourceObjectManagedClientCertificate(BaseModel): + """Response for managed_client_certificate resources""" + + id: str + """Identifies the unique resource.""" + + etag: str + """ETag identifier for optimistic concurrency control. + + Formatted as "v1:" where the hash is the base64url-encoded SHA-256 + (truncated to 128 bits) of the tags map canonicalized using RFC 8785 (JSON + Canonicalization Scheme). Clients should treat ETags as opaque strings and pass + them back via the If-Match header on write operations. + """ + + name: str + """Human-readable name of the resource.""" + + tags: Dict[str, str] + """Contains key-value pairs of tags.""" + + type: Literal["managed_client_certificate"] + + zone_id: str + """Zone ID is required only for zone-level resources""" + + +class ResourceTaggingTaggedResourceObjectQueue(BaseModel): + """Response for queue resources""" + + id: str + """Identifies the unique resource.""" + + etag: str + """ETag identifier for optimistic concurrency control. + + Formatted as "v1:" where the hash is the base64url-encoded SHA-256 + (truncated to 128 bits) of the tags map canonicalized using RFC 8785 (JSON + Canonicalization Scheme). Clients should treat ETags as opaque strings and pass + them back via the If-Match header on write operations. + """ + + name: str + """Human-readable name of the resource.""" + + tags: Dict[str, str] + """Contains key-value pairs of tags.""" + + type: Literal["queue"] + + +class ResourceTaggingTaggedResourceObjectR2Bucket(BaseModel): + """Response for r2_bucket resources""" + + id: str + """Identifies the unique resource.""" + + etag: str + """ETag identifier for optimistic concurrency control. + + Formatted as "v1:" where the hash is the base64url-encoded SHA-256 + (truncated to 128 bits) of the tags map canonicalized using RFC 8785 (JSON + Canonicalization Scheme). Clients should treat ETags as opaque strings and pass + them back via the If-Match header on write operations. + """ + + name: str + """Human-readable name of the resource.""" + + tags: Dict[str, str] + """Contains key-value pairs of tags.""" + + type: Literal["r2_bucket"] + + +class ResourceTaggingTaggedResourceObjectResourceShare(BaseModel): + """Response for resource_share resources""" + + id: str + """Identifies the unique resource.""" + + etag: str + """ETag identifier for optimistic concurrency control. + + Formatted as "v1:" where the hash is the base64url-encoded SHA-256 + (truncated to 128 bits) of the tags map canonicalized using RFC 8785 (JSON + Canonicalization Scheme). Clients should treat ETags as opaque strings and pass + them back via the If-Match header on write operations. + """ + + name: str + """Human-readable name of the resource.""" + + tags: Dict[str, str] + """Contains key-value pairs of tags.""" + + type: Literal["resource_share"] + + +class ResourceTaggingTaggedResourceObjectStreamLiveInput(BaseModel): + """Response for stream_live_input resources""" + + id: str + """Identifies the unique resource.""" + + etag: str + """ETag identifier for optimistic concurrency control. + + Formatted as "v1:" where the hash is the base64url-encoded SHA-256 + (truncated to 128 bits) of the tags map canonicalized using RFC 8785 (JSON + Canonicalization Scheme). Clients should treat ETags as opaque strings and pass + them back via the If-Match header on write operations. + """ + + name: str + """Human-readable name of the resource.""" + + tags: Dict[str, str] + """Contains key-value pairs of tags.""" + + type: Literal["stream_live_input"] + + +class ResourceTaggingTaggedResourceObjectStreamVideo(BaseModel): + """Response for stream_video resources""" + + id: str + """Identifies the unique resource.""" + + etag: str + """ETag identifier for optimistic concurrency control. + + Formatted as "v1:" where the hash is the base64url-encoded SHA-256 + (truncated to 128 bits) of the tags map canonicalized using RFC 8785 (JSON + Canonicalization Scheme). Clients should treat ETags as opaque strings and pass + them back via the If-Match header on write operations. + """ + + name: str + """Human-readable name of the resource.""" + + tags: Dict[str, str] + """Contains key-value pairs of tags.""" + + type: Literal["stream_video"] + + +class ResourceTaggingTaggedResourceObjectWorker(BaseModel): + """Response for worker resources""" + + id: str + """Identifies the unique resource.""" + + etag: str + """ETag identifier for optimistic concurrency control. + + Formatted as "v1:" where the hash is the base64url-encoded SHA-256 + (truncated to 128 bits) of the tags map canonicalized using RFC 8785 (JSON + Canonicalization Scheme). Clients should treat ETags as opaque strings and pass + them back via the If-Match header on write operations. + """ + + name: str + """Human-readable name of the resource.""" + + tags: Dict[str, str] + """Contains key-value pairs of tags.""" + + type: Literal["worker"] + + +class ResourceTaggingTaggedResourceObjectWorkerVersion(BaseModel): + """Response for worker_version resources""" + + id: str + """Identifies the unique resource.""" + + etag: str + """ETag identifier for optimistic concurrency control. + + Formatted as "v1:" where the hash is the base64url-encoded SHA-256 + (truncated to 128 bits) of the tags map canonicalized using RFC 8785 (JSON + Canonicalization Scheme). Clients should treat ETags as opaque strings and pass + them back via the If-Match header on write operations. + """ + + name: str + """Human-readable name of the resource.""" + + tags: Dict[str, str] + """Contains key-value pairs of tags.""" + + type: Literal["worker_version"] + + worker_id: str + """Worker ID is required only for worker_version resources""" + + +class ResourceTaggingTaggedResourceObjectZone(BaseModel): + """Response for zone resources""" + + id: str + """Identifies the unique resource.""" + + etag: str + """ETag identifier for optimistic concurrency control. + + Formatted as "v1:" where the hash is the base64url-encoded SHA-256 + (truncated to 128 bits) of the tags map canonicalized using RFC 8785 (JSON + Canonicalization Scheme). Clients should treat ETags as opaque strings and pass + them back via the If-Match header on write operations. + """ + + name: str + """Human-readable name of the resource.""" + + tags: Dict[str, str] + """Contains key-value pairs of tags.""" + + type: Literal["zone"] + + zone_id: str + """Zone ID is required only for zone-level resources""" + + +AccountTagUpdateResponse: TypeAlias = Annotated[ + Union[ + ResourceTaggingTaggedResourceObjectAccessApplication, + ResourceTaggingTaggedResourceObjectAccessApplicationPolicy, + ResourceTaggingTaggedResourceObjectAccessGroup, + ResourceTaggingTaggedResourceObjectAccount, + ResourceTaggingTaggedResourceObjectAIGateway, + ResourceTaggingTaggedResourceObjectAlertingPolicy, + ResourceTaggingTaggedResourceObjectAlertingWebhook, + ResourceTaggingTaggedResourceObjectAPIGatewayOperation, + ResourceTaggingTaggedResourceObjectCloudflaredTunnel, + ResourceTaggingTaggedResourceObjectCustomCertificate, + ResourceTaggingTaggedResourceObjectCustomHostname, + ResourceTaggingTaggedResourceObjectD1Database, + ResourceTaggingTaggedResourceObjectDNSRecord, + ResourceTaggingTaggedResourceObjectDurableObjectNamespace, + ResourceTaggingTaggedResourceObjectGatewayList, + ResourceTaggingTaggedResourceObjectGatewayRule, + ResourceTaggingTaggedResourceObjectImage, + ResourceTaggingTaggedResourceObjectKVNamespace, + ResourceTaggingTaggedResourceObjectManagedClientCertificate, + ResourceTaggingTaggedResourceObjectQueue, + ResourceTaggingTaggedResourceObjectR2Bucket, + ResourceTaggingTaggedResourceObjectResourceShare, + ResourceTaggingTaggedResourceObjectStreamLiveInput, + ResourceTaggingTaggedResourceObjectStreamVideo, + ResourceTaggingTaggedResourceObjectWorker, + ResourceTaggingTaggedResourceObjectWorkerVersion, + ResourceTaggingTaggedResourceObjectZone, + ], + PropertyInfo(discriminator="type"), +] diff --git a/src/cloudflare/types/resource_tagging/key_list_params.py b/src/cloudflare/types/resource_tagging/key_list_params.py new file mode 100644 index 00000000000..3511a00e252 --- /dev/null +++ b/src/cloudflare/types/resource_tagging/key_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 Required, TypedDict + +__all__ = ["KeyListParams"] + + +class KeyListParams(TypedDict, total=False): + account_id: Required[str] + """Identifier.""" + + cursor: str + """Cursor for pagination.""" diff --git a/src/cloudflare/types/resource_tagging/key_list_response.py b/src/cloudflare/types/resource_tagging/key_list_response.py new file mode 100644 index 00000000000..2c54f926ce4 --- /dev/null +++ b/src/cloudflare/types/resource_tagging/key_list_response.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["KeyListResponse"] + +KeyListResponse: TypeAlias = str diff --git a/src/cloudflare/types/resource_tagging/resource_tagging_list_params.py b/src/cloudflare/types/resource_tagging/resource_tagging_list_params.py new file mode 100644 index 00000000000..ed7e4758489 --- /dev/null +++ b/src/cloudflare/types/resource_tagging/resource_tagging_list_params.py @@ -0,0 +1,77 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import List +from typing_extensions import Literal, Required, TypedDict + +from ..._types import SequenceNotStr + +__all__ = ["ResourceTaggingListParams"] + + +class ResourceTaggingListParams(TypedDict, total=False): + account_id: Required[str] + """Identifier.""" + + cursor: str + """Cursor for pagination.""" + + tag: SequenceNotStr[str] + """Filter resources by tag criteria. + + This parameter can be repeated multiple times, with AND logic between + parameters. + + Supported syntax: + + - **Key-only**: `tag=` - Resource must have the tag key (e.g., + `tag=production`) + - **Key-value**: `tag==` - Resource must have the tag with specific + value (e.g., `tag=env=prod`) + - **Multiple values (OR)**: `tag==,` - Resource must have tag with + any of the values (e.g., `tag=env=prod,staging`) + - **Negate key-only**: `tag=!` - Resource must not have the tag key (e.g., + `tag=!archived`) + - **Negate key-value**: `tag=!=` - Resource must not have the tag + with specific value (e.g., `tag=region!=us-west-1`) + + Multiple tag parameters are combined with AND logic. + """ + + type: List[ + Literal[ + "access_application", + "access_application_policy", + "access_group", + "account", + "ai_gateway", + "alerting_policy", + "alerting_webhook", + "api_gateway_operation", + "cloudflared_tunnel", + "custom_certificate", + "custom_hostname", + "d1_database", + "dns_record", + "durable_object_namespace", + "gateway_list", + "gateway_rule", + "image", + "kv_namespace", + "managed_client_certificate", + "queue", + "r2_bucket", + "resource_share", + "stream_live_input", + "stream_video", + "worker", + "worker_version", + "zone", + ] + ] + """Filter by resource type. + + Can be repeated to filter by multiple types (OR logic). Example: + ?type=zone&type=worker + """ diff --git a/src/cloudflare/types/resource_tagging/resource_tagging_list_response.py b/src/cloudflare/types/resource_tagging/resource_tagging_list_response.py new file mode 100644 index 00000000000..c6015538be0 --- /dev/null +++ b/src/cloudflare/types/resource_tagging/resource_tagging_list_response.py @@ -0,0 +1,747 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Dict, Union +from typing_extensions import Literal, Annotated, TypeAlias + +from ..._utils import PropertyInfo +from ..._models import BaseModel + +__all__ = [ + "ResourceTaggingListResponse", + "ResourceTaggingTaggedResourceObjectAccessApplication", + "ResourceTaggingTaggedResourceObjectAccessApplicationPolicy", + "ResourceTaggingTaggedResourceObjectAccessGroup", + "ResourceTaggingTaggedResourceObjectAccount", + "ResourceTaggingTaggedResourceObjectAIGateway", + "ResourceTaggingTaggedResourceObjectAlertingPolicy", + "ResourceTaggingTaggedResourceObjectAlertingWebhook", + "ResourceTaggingTaggedResourceObjectAPIGatewayOperation", + "ResourceTaggingTaggedResourceObjectCloudflaredTunnel", + "ResourceTaggingTaggedResourceObjectCustomCertificate", + "ResourceTaggingTaggedResourceObjectCustomHostname", + "ResourceTaggingTaggedResourceObjectD1Database", + "ResourceTaggingTaggedResourceObjectDNSRecord", + "ResourceTaggingTaggedResourceObjectDurableObjectNamespace", + "ResourceTaggingTaggedResourceObjectGatewayList", + "ResourceTaggingTaggedResourceObjectGatewayRule", + "ResourceTaggingTaggedResourceObjectImage", + "ResourceTaggingTaggedResourceObjectKVNamespace", + "ResourceTaggingTaggedResourceObjectManagedClientCertificate", + "ResourceTaggingTaggedResourceObjectQueue", + "ResourceTaggingTaggedResourceObjectR2Bucket", + "ResourceTaggingTaggedResourceObjectResourceShare", + "ResourceTaggingTaggedResourceObjectStreamLiveInput", + "ResourceTaggingTaggedResourceObjectStreamVideo", + "ResourceTaggingTaggedResourceObjectWorker", + "ResourceTaggingTaggedResourceObjectWorkerVersion", + "ResourceTaggingTaggedResourceObjectZone", +] + + +class ResourceTaggingTaggedResourceObjectAccessApplication(BaseModel): + """Response for access_application resources""" + + id: str + """Identifies the unique resource.""" + + etag: str + """ETag identifier for optimistic concurrency control. + + Formatted as "v1:" where the hash is the base64url-encoded SHA-256 + (truncated to 128 bits) of the tags map canonicalized using RFC 8785 (JSON + Canonicalization Scheme). Clients should treat ETags as opaque strings and pass + them back via the If-Match header on write operations. + """ + + name: str + """Human-readable name of the resource.""" + + tags: Dict[str, str] + """Contains key-value pairs of tags.""" + + type: Literal["access_application"] + + +class ResourceTaggingTaggedResourceObjectAccessApplicationPolicy(BaseModel): + """Response for access_application_policy resources""" + + id: str + """Identifies the unique resource.""" + + access_application_id: str + """Access application ID is required only for access_application_policy resources""" + + etag: str + """ETag identifier for optimistic concurrency control. + + Formatted as "v1:" where the hash is the base64url-encoded SHA-256 + (truncated to 128 bits) of the tags map canonicalized using RFC 8785 (JSON + Canonicalization Scheme). Clients should treat ETags as opaque strings and pass + them back via the If-Match header on write operations. + """ + + name: str + """Human-readable name of the resource.""" + + tags: Dict[str, str] + """Contains key-value pairs of tags.""" + + type: Literal["access_application_policy"] + + zone_id: str + """Zone ID is required only for zone-level resources""" + + +class ResourceTaggingTaggedResourceObjectAccessGroup(BaseModel): + """Response for access_group resources""" + + id: str + """Identifies the unique resource.""" + + etag: str + """ETag identifier for optimistic concurrency control. + + Formatted as "v1:" where the hash is the base64url-encoded SHA-256 + (truncated to 128 bits) of the tags map canonicalized using RFC 8785 (JSON + Canonicalization Scheme). Clients should treat ETags as opaque strings and pass + them back via the If-Match header on write operations. + """ + + name: str + """Human-readable name of the resource.""" + + tags: Dict[str, str] + """Contains key-value pairs of tags.""" + + type: Literal["access_group"] + + +class ResourceTaggingTaggedResourceObjectAccount(BaseModel): + """Response for account resources""" + + id: str + """Identifies the unique resource.""" + + etag: str + """ETag identifier for optimistic concurrency control. + + Formatted as "v1:" where the hash is the base64url-encoded SHA-256 + (truncated to 128 bits) of the tags map canonicalized using RFC 8785 (JSON + Canonicalization Scheme). Clients should treat ETags as opaque strings and pass + them back via the If-Match header on write operations. + """ + + name: str + """Human-readable name of the resource.""" + + tags: Dict[str, str] + """Contains key-value pairs of tags.""" + + type: Literal["account"] + + +class ResourceTaggingTaggedResourceObjectAIGateway(BaseModel): + """Response for ai_gateway resources""" + + id: str + """Identifies the unique resource.""" + + etag: str + """ETag identifier for optimistic concurrency control. + + Formatted as "v1:" where the hash is the base64url-encoded SHA-256 + (truncated to 128 bits) of the tags map canonicalized using RFC 8785 (JSON + Canonicalization Scheme). Clients should treat ETags as opaque strings and pass + them back via the If-Match header on write operations. + """ + + name: str + """Human-readable name of the resource.""" + + tags: Dict[str, str] + """Contains key-value pairs of tags.""" + + type: Literal["ai_gateway"] + + +class ResourceTaggingTaggedResourceObjectAlertingPolicy(BaseModel): + """Response for alerting_policy resources""" + + id: str + """Identifies the unique resource.""" + + etag: str + """ETag identifier for optimistic concurrency control. + + Formatted as "v1:" where the hash is the base64url-encoded SHA-256 + (truncated to 128 bits) of the tags map canonicalized using RFC 8785 (JSON + Canonicalization Scheme). Clients should treat ETags as opaque strings and pass + them back via the If-Match header on write operations. + """ + + name: str + """Human-readable name of the resource.""" + + tags: Dict[str, str] + """Contains key-value pairs of tags.""" + + type: Literal["alerting_policy"] + + +class ResourceTaggingTaggedResourceObjectAlertingWebhook(BaseModel): + """Response for alerting_webhook resources""" + + id: str + """Identifies the unique resource.""" + + etag: str + """ETag identifier for optimistic concurrency control. + + Formatted as "v1:" where the hash is the base64url-encoded SHA-256 + (truncated to 128 bits) of the tags map canonicalized using RFC 8785 (JSON + Canonicalization Scheme). Clients should treat ETags as opaque strings and pass + them back via the If-Match header on write operations. + """ + + name: str + """Human-readable name of the resource.""" + + tags: Dict[str, str] + """Contains key-value pairs of tags.""" + + type: Literal["alerting_webhook"] + + +class ResourceTaggingTaggedResourceObjectAPIGatewayOperation(BaseModel): + """Response for api_gateway_operation resources""" + + id: str + """Identifies the unique resource.""" + + etag: str + """ETag identifier for optimistic concurrency control. + + Formatted as "v1:" where the hash is the base64url-encoded SHA-256 + (truncated to 128 bits) of the tags map canonicalized using RFC 8785 (JSON + Canonicalization Scheme). Clients should treat ETags as opaque strings and pass + them back via the If-Match header on write operations. + """ + + name: str + """Human-readable name of the resource.""" + + tags: Dict[str, str] + """Contains key-value pairs of tags.""" + + type: Literal["api_gateway_operation"] + + zone_id: str + """Zone ID is required only for zone-level resources""" + + +class ResourceTaggingTaggedResourceObjectCloudflaredTunnel(BaseModel): + """Response for cloudflared_tunnel resources""" + + id: str + """Identifies the unique resource.""" + + etag: str + """ETag identifier for optimistic concurrency control. + + Formatted as "v1:" where the hash is the base64url-encoded SHA-256 + (truncated to 128 bits) of the tags map canonicalized using RFC 8785 (JSON + Canonicalization Scheme). Clients should treat ETags as opaque strings and pass + them back via the If-Match header on write operations. + """ + + name: str + """Human-readable name of the resource.""" + + tags: Dict[str, str] + """Contains key-value pairs of tags.""" + + type: Literal["cloudflared_tunnel"] + + +class ResourceTaggingTaggedResourceObjectCustomCertificate(BaseModel): + """Response for custom_certificate resources""" + + id: str + """Identifies the unique resource.""" + + etag: str + """ETag identifier for optimistic concurrency control. + + Formatted as "v1:" where the hash is the base64url-encoded SHA-256 + (truncated to 128 bits) of the tags map canonicalized using RFC 8785 (JSON + Canonicalization Scheme). Clients should treat ETags as opaque strings and pass + them back via the If-Match header on write operations. + """ + + name: str + """Human-readable name of the resource.""" + + tags: Dict[str, str] + """Contains key-value pairs of tags.""" + + type: Literal["custom_certificate"] + + zone_id: str + """Zone ID is required only for zone-level resources""" + + +class ResourceTaggingTaggedResourceObjectCustomHostname(BaseModel): + """Response for custom_hostname resources""" + + id: str + """Identifies the unique resource.""" + + etag: str + """ETag identifier for optimistic concurrency control. + + Formatted as "v1:" where the hash is the base64url-encoded SHA-256 + (truncated to 128 bits) of the tags map canonicalized using RFC 8785 (JSON + Canonicalization Scheme). Clients should treat ETags as opaque strings and pass + them back via the If-Match header on write operations. + """ + + name: str + """Human-readable name of the resource.""" + + tags: Dict[str, str] + """Contains key-value pairs of tags.""" + + type: Literal["custom_hostname"] + + zone_id: str + """Zone ID is required only for zone-level resources""" + + +class ResourceTaggingTaggedResourceObjectD1Database(BaseModel): + """Response for d1_database resources""" + + id: str + """Identifies the unique resource.""" + + etag: str + """ETag identifier for optimistic concurrency control. + + Formatted as "v1:" where the hash is the base64url-encoded SHA-256 + (truncated to 128 bits) of the tags map canonicalized using RFC 8785 (JSON + Canonicalization Scheme). Clients should treat ETags as opaque strings and pass + them back via the If-Match header on write operations. + """ + + name: str + """Human-readable name of the resource.""" + + tags: Dict[str, str] + """Contains key-value pairs of tags.""" + + type: Literal["d1_database"] + + +class ResourceTaggingTaggedResourceObjectDNSRecord(BaseModel): + """Response for dns_record resources""" + + id: str + """Identifies the unique resource.""" + + etag: str + """ETag identifier for optimistic concurrency control. + + Formatted as "v1:" where the hash is the base64url-encoded SHA-256 + (truncated to 128 bits) of the tags map canonicalized using RFC 8785 (JSON + Canonicalization Scheme). Clients should treat ETags as opaque strings and pass + them back via the If-Match header on write operations. + """ + + name: str + """Human-readable name of the resource.""" + + tags: Dict[str, str] + """Contains key-value pairs of tags.""" + + type: Literal["dns_record"] + + zone_id: str + """Zone ID is required only for zone-level resources""" + + +class ResourceTaggingTaggedResourceObjectDurableObjectNamespace(BaseModel): + """Response for durable_object_namespace resources""" + + id: str + """Identifies the unique resource.""" + + etag: str + """ETag identifier for optimistic concurrency control. + + Formatted as "v1:" where the hash is the base64url-encoded SHA-256 + (truncated to 128 bits) of the tags map canonicalized using RFC 8785 (JSON + Canonicalization Scheme). Clients should treat ETags as opaque strings and pass + them back via the If-Match header on write operations. + """ + + name: str + """Human-readable name of the resource.""" + + tags: Dict[str, str] + """Contains key-value pairs of tags.""" + + type: Literal["durable_object_namespace"] + + +class ResourceTaggingTaggedResourceObjectGatewayList(BaseModel): + """Response for gateway_list resources""" + + id: str + """Identifies the unique resource.""" + + etag: str + """ETag identifier for optimistic concurrency control. + + Formatted as "v1:" where the hash is the base64url-encoded SHA-256 + (truncated to 128 bits) of the tags map canonicalized using RFC 8785 (JSON + Canonicalization Scheme). Clients should treat ETags as opaque strings and pass + them back via the If-Match header on write operations. + """ + + name: str + """Human-readable name of the resource.""" + + tags: Dict[str, str] + """Contains key-value pairs of tags.""" + + type: Literal["gateway_list"] + + +class ResourceTaggingTaggedResourceObjectGatewayRule(BaseModel): + """Response for gateway_rule resources""" + + id: str + """Identifies the unique resource.""" + + etag: str + """ETag identifier for optimistic concurrency control. + + Formatted as "v1:" where the hash is the base64url-encoded SHA-256 + (truncated to 128 bits) of the tags map canonicalized using RFC 8785 (JSON + Canonicalization Scheme). Clients should treat ETags as opaque strings and pass + them back via the If-Match header on write operations. + """ + + name: str + """Human-readable name of the resource.""" + + tags: Dict[str, str] + """Contains key-value pairs of tags.""" + + type: Literal["gateway_rule"] + + +class ResourceTaggingTaggedResourceObjectImage(BaseModel): + """Response for image resources""" + + id: str + """Identifies the unique resource.""" + + etag: str + """ETag identifier for optimistic concurrency control. + + Formatted as "v1:" where the hash is the base64url-encoded SHA-256 + (truncated to 128 bits) of the tags map canonicalized using RFC 8785 (JSON + Canonicalization Scheme). Clients should treat ETags as opaque strings and pass + them back via the If-Match header on write operations. + """ + + name: str + """Human-readable name of the resource.""" + + tags: Dict[str, str] + """Contains key-value pairs of tags.""" + + type: Literal["image"] + + +class ResourceTaggingTaggedResourceObjectKVNamespace(BaseModel): + """Response for kv_namespace resources""" + + id: str + """Identifies the unique resource.""" + + etag: str + """ETag identifier for optimistic concurrency control. + + Formatted as "v1:" where the hash is the base64url-encoded SHA-256 + (truncated to 128 bits) of the tags map canonicalized using RFC 8785 (JSON + Canonicalization Scheme). Clients should treat ETags as opaque strings and pass + them back via the If-Match header on write operations. + """ + + name: str + """Human-readable name of the resource.""" + + tags: Dict[str, str] + """Contains key-value pairs of tags.""" + + type: Literal["kv_namespace"] + + +class ResourceTaggingTaggedResourceObjectManagedClientCertificate(BaseModel): + """Response for managed_client_certificate resources""" + + id: str + """Identifies the unique resource.""" + + etag: str + """ETag identifier for optimistic concurrency control. + + Formatted as "v1:" where the hash is the base64url-encoded SHA-256 + (truncated to 128 bits) of the tags map canonicalized using RFC 8785 (JSON + Canonicalization Scheme). Clients should treat ETags as opaque strings and pass + them back via the If-Match header on write operations. + """ + + name: str + """Human-readable name of the resource.""" + + tags: Dict[str, str] + """Contains key-value pairs of tags.""" + + type: Literal["managed_client_certificate"] + + zone_id: str + """Zone ID is required only for zone-level resources""" + + +class ResourceTaggingTaggedResourceObjectQueue(BaseModel): + """Response for queue resources""" + + id: str + """Identifies the unique resource.""" + + etag: str + """ETag identifier for optimistic concurrency control. + + Formatted as "v1:" where the hash is the base64url-encoded SHA-256 + (truncated to 128 bits) of the tags map canonicalized using RFC 8785 (JSON + Canonicalization Scheme). Clients should treat ETags as opaque strings and pass + them back via the If-Match header on write operations. + """ + + name: str + """Human-readable name of the resource.""" + + tags: Dict[str, str] + """Contains key-value pairs of tags.""" + + type: Literal["queue"] + + +class ResourceTaggingTaggedResourceObjectR2Bucket(BaseModel): + """Response for r2_bucket resources""" + + id: str + """Identifies the unique resource.""" + + etag: str + """ETag identifier for optimistic concurrency control. + + Formatted as "v1:" where the hash is the base64url-encoded SHA-256 + (truncated to 128 bits) of the tags map canonicalized using RFC 8785 (JSON + Canonicalization Scheme). Clients should treat ETags as opaque strings and pass + them back via the If-Match header on write operations. + """ + + name: str + """Human-readable name of the resource.""" + + tags: Dict[str, str] + """Contains key-value pairs of tags.""" + + type: Literal["r2_bucket"] + + +class ResourceTaggingTaggedResourceObjectResourceShare(BaseModel): + """Response for resource_share resources""" + + id: str + """Identifies the unique resource.""" + + etag: str + """ETag identifier for optimistic concurrency control. + + Formatted as "v1:" where the hash is the base64url-encoded SHA-256 + (truncated to 128 bits) of the tags map canonicalized using RFC 8785 (JSON + Canonicalization Scheme). Clients should treat ETags as opaque strings and pass + them back via the If-Match header on write operations. + """ + + name: str + """Human-readable name of the resource.""" + + tags: Dict[str, str] + """Contains key-value pairs of tags.""" + + type: Literal["resource_share"] + + +class ResourceTaggingTaggedResourceObjectStreamLiveInput(BaseModel): + """Response for stream_live_input resources""" + + id: str + """Identifies the unique resource.""" + + etag: str + """ETag identifier for optimistic concurrency control. + + Formatted as "v1:" where the hash is the base64url-encoded SHA-256 + (truncated to 128 bits) of the tags map canonicalized using RFC 8785 (JSON + Canonicalization Scheme). Clients should treat ETags as opaque strings and pass + them back via the If-Match header on write operations. + """ + + name: str + """Human-readable name of the resource.""" + + tags: Dict[str, str] + """Contains key-value pairs of tags.""" + + type: Literal["stream_live_input"] + + +class ResourceTaggingTaggedResourceObjectStreamVideo(BaseModel): + """Response for stream_video resources""" + + id: str + """Identifies the unique resource.""" + + etag: str + """ETag identifier for optimistic concurrency control. + + Formatted as "v1:" where the hash is the base64url-encoded SHA-256 + (truncated to 128 bits) of the tags map canonicalized using RFC 8785 (JSON + Canonicalization Scheme). Clients should treat ETags as opaque strings and pass + them back via the If-Match header on write operations. + """ + + name: str + """Human-readable name of the resource.""" + + tags: Dict[str, str] + """Contains key-value pairs of tags.""" + + type: Literal["stream_video"] + + +class ResourceTaggingTaggedResourceObjectWorker(BaseModel): + """Response for worker resources""" + + id: str + """Identifies the unique resource.""" + + etag: str + """ETag identifier for optimistic concurrency control. + + Formatted as "v1:" where the hash is the base64url-encoded SHA-256 + (truncated to 128 bits) of the tags map canonicalized using RFC 8785 (JSON + Canonicalization Scheme). Clients should treat ETags as opaque strings and pass + them back via the If-Match header on write operations. + """ + + name: str + """Human-readable name of the resource.""" + + tags: Dict[str, str] + """Contains key-value pairs of tags.""" + + type: Literal["worker"] + + +class ResourceTaggingTaggedResourceObjectWorkerVersion(BaseModel): + """Response for worker_version resources""" + + id: str + """Identifies the unique resource.""" + + etag: str + """ETag identifier for optimistic concurrency control. + + Formatted as "v1:" where the hash is the base64url-encoded SHA-256 + (truncated to 128 bits) of the tags map canonicalized using RFC 8785 (JSON + Canonicalization Scheme). Clients should treat ETags as opaque strings and pass + them back via the If-Match header on write operations. + """ + + name: str + """Human-readable name of the resource.""" + + tags: Dict[str, str] + """Contains key-value pairs of tags.""" + + type: Literal["worker_version"] + + worker_id: str + """Worker ID is required only for worker_version resources""" + + +class ResourceTaggingTaggedResourceObjectZone(BaseModel): + """Response for zone resources""" + + id: str + """Identifies the unique resource.""" + + etag: str + """ETag identifier for optimistic concurrency control. + + Formatted as "v1:" where the hash is the base64url-encoded SHA-256 + (truncated to 128 bits) of the tags map canonicalized using RFC 8785 (JSON + Canonicalization Scheme). Clients should treat ETags as opaque strings and pass + them back via the If-Match header on write operations. + """ + + name: str + """Human-readable name of the resource.""" + + tags: Dict[str, str] + """Contains key-value pairs of tags.""" + + type: Literal["zone"] + + zone_id: str + """Zone ID is required only for zone-level resources""" + + +ResourceTaggingListResponse: TypeAlias = Annotated[ + Union[ + ResourceTaggingTaggedResourceObjectAccessApplication, + ResourceTaggingTaggedResourceObjectAccessApplicationPolicy, + ResourceTaggingTaggedResourceObjectAccessGroup, + ResourceTaggingTaggedResourceObjectAccount, + ResourceTaggingTaggedResourceObjectAIGateway, + ResourceTaggingTaggedResourceObjectAlertingPolicy, + ResourceTaggingTaggedResourceObjectAlertingWebhook, + ResourceTaggingTaggedResourceObjectAPIGatewayOperation, + ResourceTaggingTaggedResourceObjectCloudflaredTunnel, + ResourceTaggingTaggedResourceObjectCustomCertificate, + ResourceTaggingTaggedResourceObjectCustomHostname, + ResourceTaggingTaggedResourceObjectD1Database, + ResourceTaggingTaggedResourceObjectDNSRecord, + ResourceTaggingTaggedResourceObjectDurableObjectNamespace, + ResourceTaggingTaggedResourceObjectGatewayList, + ResourceTaggingTaggedResourceObjectGatewayRule, + ResourceTaggingTaggedResourceObjectImage, + ResourceTaggingTaggedResourceObjectKVNamespace, + ResourceTaggingTaggedResourceObjectManagedClientCertificate, + ResourceTaggingTaggedResourceObjectQueue, + ResourceTaggingTaggedResourceObjectR2Bucket, + ResourceTaggingTaggedResourceObjectResourceShare, + ResourceTaggingTaggedResourceObjectStreamLiveInput, + ResourceTaggingTaggedResourceObjectStreamVideo, + ResourceTaggingTaggedResourceObjectWorker, + ResourceTaggingTaggedResourceObjectWorkerVersion, + ResourceTaggingTaggedResourceObjectZone, + ], + PropertyInfo(discriminator="type"), +] diff --git a/src/cloudflare/types/resource_tagging/value_list_params.py b/src/cloudflare/types/resource_tagging/value_list_params.py new file mode 100644 index 00000000000..f154de3a39c --- /dev/null +++ b/src/cloudflare/types/resource_tagging/value_list_params.py @@ -0,0 +1,46 @@ +# 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__ = ["ValueListParams"] + + +class ValueListParams(TypedDict, total=False): + account_id: Required[str] + """Identifier.""" + + cursor: str + """Cursor for pagination.""" + + type: Literal[ + "access_application", + "access_application_policy", + "access_group", + "account", + "ai_gateway", + "alerting_policy", + "alerting_webhook", + "api_gateway_operation", + "cloudflared_tunnel", + "custom_certificate", + "custom_hostname", + "d1_database", + "dns_record", + "durable_object_namespace", + "gateway_list", + "gateway_rule", + "image", + "kv_namespace", + "managed_client_certificate", + "queue", + "r2_bucket", + "resource_share", + "stream_live_input", + "stream_video", + "worker", + "worker_version", + "zone", + ] + """Filter by resource type.""" diff --git a/src/cloudflare/types/resource_tagging/value_list_response.py b/src/cloudflare/types/resource_tagging/value_list_response.py new file mode 100644 index 00000000000..bd92eaf11e9 --- /dev/null +++ b/src/cloudflare/types/resource_tagging/value_list_response.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import TypeAlias + +__all__ = ["ValueListResponse"] + +ValueListResponse: TypeAlias = str diff --git a/src/cloudflare/types/resource_tagging/zone_tag_get_params.py b/src/cloudflare/types/resource_tagging/zone_tag_get_params.py new file mode 100644 index 00000000000..41e8fbbbe22 --- /dev/null +++ b/src/cloudflare/types/resource_tagging/zone_tag_get_params.py @@ -0,0 +1,34 @@ +# 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__ = ["ZoneTagGetParams"] + + +class ZoneTagGetParams(TypedDict, total=False): + zone_id: Required[str] + """Zone ID is required only for zone-level resources""" + + resource_id: Required[str] + """The ID of the resource to retrieve tags for.""" + + resource_type: Required[ + Literal[ + "access_application_policy", + "api_gateway_operation", + "custom_certificate", + "custom_hostname", + "dns_record", + "managed_client_certificate", + "zone", + ] + ] + """The type of the resource.""" + + access_application_id: str + """Access application ID identifier. + + Required for access_application_policy resources. + """ diff --git a/src/cloudflare/types/resource_tagging/zone_tag_get_response.py b/src/cloudflare/types/resource_tagging/zone_tag_get_response.py new file mode 100644 index 00000000000..d43d1cd4589 --- /dev/null +++ b/src/cloudflare/types/resource_tagging/zone_tag_get_response.py @@ -0,0 +1,747 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Dict, Union +from typing_extensions import Literal, Annotated, TypeAlias + +from ..._utils import PropertyInfo +from ..._models import BaseModel + +__all__ = [ + "ZoneTagGetResponse", + "ResourceTaggingTaggedResourceObjectAccessApplication", + "ResourceTaggingTaggedResourceObjectAccessApplicationPolicy", + "ResourceTaggingTaggedResourceObjectAccessGroup", + "ResourceTaggingTaggedResourceObjectAccount", + "ResourceTaggingTaggedResourceObjectAIGateway", + "ResourceTaggingTaggedResourceObjectAlertingPolicy", + "ResourceTaggingTaggedResourceObjectAlertingWebhook", + "ResourceTaggingTaggedResourceObjectAPIGatewayOperation", + "ResourceTaggingTaggedResourceObjectCloudflaredTunnel", + "ResourceTaggingTaggedResourceObjectCustomCertificate", + "ResourceTaggingTaggedResourceObjectCustomHostname", + "ResourceTaggingTaggedResourceObjectD1Database", + "ResourceTaggingTaggedResourceObjectDNSRecord", + "ResourceTaggingTaggedResourceObjectDurableObjectNamespace", + "ResourceTaggingTaggedResourceObjectGatewayList", + "ResourceTaggingTaggedResourceObjectGatewayRule", + "ResourceTaggingTaggedResourceObjectImage", + "ResourceTaggingTaggedResourceObjectKVNamespace", + "ResourceTaggingTaggedResourceObjectManagedClientCertificate", + "ResourceTaggingTaggedResourceObjectQueue", + "ResourceTaggingTaggedResourceObjectR2Bucket", + "ResourceTaggingTaggedResourceObjectResourceShare", + "ResourceTaggingTaggedResourceObjectStreamLiveInput", + "ResourceTaggingTaggedResourceObjectStreamVideo", + "ResourceTaggingTaggedResourceObjectWorker", + "ResourceTaggingTaggedResourceObjectWorkerVersion", + "ResourceTaggingTaggedResourceObjectZone", +] + + +class ResourceTaggingTaggedResourceObjectAccessApplication(BaseModel): + """Response for access_application resources""" + + id: str + """Identifies the unique resource.""" + + etag: str + """ETag identifier for optimistic concurrency control. + + Formatted as "v1:" where the hash is the base64url-encoded SHA-256 + (truncated to 128 bits) of the tags map canonicalized using RFC 8785 (JSON + Canonicalization Scheme). Clients should treat ETags as opaque strings and pass + them back via the If-Match header on write operations. + """ + + name: str + """Human-readable name of the resource.""" + + tags: Dict[str, str] + """Contains key-value pairs of tags.""" + + type: Literal["access_application"] + + +class ResourceTaggingTaggedResourceObjectAccessApplicationPolicy(BaseModel): + """Response for access_application_policy resources""" + + id: str + """Identifies the unique resource.""" + + access_application_id: str + """Access application ID is required only for access_application_policy resources""" + + etag: str + """ETag identifier for optimistic concurrency control. + + Formatted as "v1:" where the hash is the base64url-encoded SHA-256 + (truncated to 128 bits) of the tags map canonicalized using RFC 8785 (JSON + Canonicalization Scheme). Clients should treat ETags as opaque strings and pass + them back via the If-Match header on write operations. + """ + + name: str + """Human-readable name of the resource.""" + + tags: Dict[str, str] + """Contains key-value pairs of tags.""" + + type: Literal["access_application_policy"] + + zone_id: str + """Zone ID is required only for zone-level resources""" + + +class ResourceTaggingTaggedResourceObjectAccessGroup(BaseModel): + """Response for access_group resources""" + + id: str + """Identifies the unique resource.""" + + etag: str + """ETag identifier for optimistic concurrency control. + + Formatted as "v1:" where the hash is the base64url-encoded SHA-256 + (truncated to 128 bits) of the tags map canonicalized using RFC 8785 (JSON + Canonicalization Scheme). Clients should treat ETags as opaque strings and pass + them back via the If-Match header on write operations. + """ + + name: str + """Human-readable name of the resource.""" + + tags: Dict[str, str] + """Contains key-value pairs of tags.""" + + type: Literal["access_group"] + + +class ResourceTaggingTaggedResourceObjectAccount(BaseModel): + """Response for account resources""" + + id: str + """Identifies the unique resource.""" + + etag: str + """ETag identifier for optimistic concurrency control. + + Formatted as "v1:" where the hash is the base64url-encoded SHA-256 + (truncated to 128 bits) of the tags map canonicalized using RFC 8785 (JSON + Canonicalization Scheme). Clients should treat ETags as opaque strings and pass + them back via the If-Match header on write operations. + """ + + name: str + """Human-readable name of the resource.""" + + tags: Dict[str, str] + """Contains key-value pairs of tags.""" + + type: Literal["account"] + + +class ResourceTaggingTaggedResourceObjectAIGateway(BaseModel): + """Response for ai_gateway resources""" + + id: str + """Identifies the unique resource.""" + + etag: str + """ETag identifier for optimistic concurrency control. + + Formatted as "v1:" where the hash is the base64url-encoded SHA-256 + (truncated to 128 bits) of the tags map canonicalized using RFC 8785 (JSON + Canonicalization Scheme). Clients should treat ETags as opaque strings and pass + them back via the If-Match header on write operations. + """ + + name: str + """Human-readable name of the resource.""" + + tags: Dict[str, str] + """Contains key-value pairs of tags.""" + + type: Literal["ai_gateway"] + + +class ResourceTaggingTaggedResourceObjectAlertingPolicy(BaseModel): + """Response for alerting_policy resources""" + + id: str + """Identifies the unique resource.""" + + etag: str + """ETag identifier for optimistic concurrency control. + + Formatted as "v1:" where the hash is the base64url-encoded SHA-256 + (truncated to 128 bits) of the tags map canonicalized using RFC 8785 (JSON + Canonicalization Scheme). Clients should treat ETags as opaque strings and pass + them back via the If-Match header on write operations. + """ + + name: str + """Human-readable name of the resource.""" + + tags: Dict[str, str] + """Contains key-value pairs of tags.""" + + type: Literal["alerting_policy"] + + +class ResourceTaggingTaggedResourceObjectAlertingWebhook(BaseModel): + """Response for alerting_webhook resources""" + + id: str + """Identifies the unique resource.""" + + etag: str + """ETag identifier for optimistic concurrency control. + + Formatted as "v1:" where the hash is the base64url-encoded SHA-256 + (truncated to 128 bits) of the tags map canonicalized using RFC 8785 (JSON + Canonicalization Scheme). Clients should treat ETags as opaque strings and pass + them back via the If-Match header on write operations. + """ + + name: str + """Human-readable name of the resource.""" + + tags: Dict[str, str] + """Contains key-value pairs of tags.""" + + type: Literal["alerting_webhook"] + + +class ResourceTaggingTaggedResourceObjectAPIGatewayOperation(BaseModel): + """Response for api_gateway_operation resources""" + + id: str + """Identifies the unique resource.""" + + etag: str + """ETag identifier for optimistic concurrency control. + + Formatted as "v1:" where the hash is the base64url-encoded SHA-256 + (truncated to 128 bits) of the tags map canonicalized using RFC 8785 (JSON + Canonicalization Scheme). Clients should treat ETags as opaque strings and pass + them back via the If-Match header on write operations. + """ + + name: str + """Human-readable name of the resource.""" + + tags: Dict[str, str] + """Contains key-value pairs of tags.""" + + type: Literal["api_gateway_operation"] + + zone_id: str + """Zone ID is required only for zone-level resources""" + + +class ResourceTaggingTaggedResourceObjectCloudflaredTunnel(BaseModel): + """Response for cloudflared_tunnel resources""" + + id: str + """Identifies the unique resource.""" + + etag: str + """ETag identifier for optimistic concurrency control. + + Formatted as "v1:" where the hash is the base64url-encoded SHA-256 + (truncated to 128 bits) of the tags map canonicalized using RFC 8785 (JSON + Canonicalization Scheme). Clients should treat ETags as opaque strings and pass + them back via the If-Match header on write operations. + """ + + name: str + """Human-readable name of the resource.""" + + tags: Dict[str, str] + """Contains key-value pairs of tags.""" + + type: Literal["cloudflared_tunnel"] + + +class ResourceTaggingTaggedResourceObjectCustomCertificate(BaseModel): + """Response for custom_certificate resources""" + + id: str + """Identifies the unique resource.""" + + etag: str + """ETag identifier for optimistic concurrency control. + + Formatted as "v1:" where the hash is the base64url-encoded SHA-256 + (truncated to 128 bits) of the tags map canonicalized using RFC 8785 (JSON + Canonicalization Scheme). Clients should treat ETags as opaque strings and pass + them back via the If-Match header on write operations. + """ + + name: str + """Human-readable name of the resource.""" + + tags: Dict[str, str] + """Contains key-value pairs of tags.""" + + type: Literal["custom_certificate"] + + zone_id: str + """Zone ID is required only for zone-level resources""" + + +class ResourceTaggingTaggedResourceObjectCustomHostname(BaseModel): + """Response for custom_hostname resources""" + + id: str + """Identifies the unique resource.""" + + etag: str + """ETag identifier for optimistic concurrency control. + + Formatted as "v1:" where the hash is the base64url-encoded SHA-256 + (truncated to 128 bits) of the tags map canonicalized using RFC 8785 (JSON + Canonicalization Scheme). Clients should treat ETags as opaque strings and pass + them back via the If-Match header on write operations. + """ + + name: str + """Human-readable name of the resource.""" + + tags: Dict[str, str] + """Contains key-value pairs of tags.""" + + type: Literal["custom_hostname"] + + zone_id: str + """Zone ID is required only for zone-level resources""" + + +class ResourceTaggingTaggedResourceObjectD1Database(BaseModel): + """Response for d1_database resources""" + + id: str + """Identifies the unique resource.""" + + etag: str + """ETag identifier for optimistic concurrency control. + + Formatted as "v1:" where the hash is the base64url-encoded SHA-256 + (truncated to 128 bits) of the tags map canonicalized using RFC 8785 (JSON + Canonicalization Scheme). Clients should treat ETags as opaque strings and pass + them back via the If-Match header on write operations. + """ + + name: str + """Human-readable name of the resource.""" + + tags: Dict[str, str] + """Contains key-value pairs of tags.""" + + type: Literal["d1_database"] + + +class ResourceTaggingTaggedResourceObjectDNSRecord(BaseModel): + """Response for dns_record resources""" + + id: str + """Identifies the unique resource.""" + + etag: str + """ETag identifier for optimistic concurrency control. + + Formatted as "v1:" where the hash is the base64url-encoded SHA-256 + (truncated to 128 bits) of the tags map canonicalized using RFC 8785 (JSON + Canonicalization Scheme). Clients should treat ETags as opaque strings and pass + them back via the If-Match header on write operations. + """ + + name: str + """Human-readable name of the resource.""" + + tags: Dict[str, str] + """Contains key-value pairs of tags.""" + + type: Literal["dns_record"] + + zone_id: str + """Zone ID is required only for zone-level resources""" + + +class ResourceTaggingTaggedResourceObjectDurableObjectNamespace(BaseModel): + """Response for durable_object_namespace resources""" + + id: str + """Identifies the unique resource.""" + + etag: str + """ETag identifier for optimistic concurrency control. + + Formatted as "v1:" where the hash is the base64url-encoded SHA-256 + (truncated to 128 bits) of the tags map canonicalized using RFC 8785 (JSON + Canonicalization Scheme). Clients should treat ETags as opaque strings and pass + them back via the If-Match header on write operations. + """ + + name: str + """Human-readable name of the resource.""" + + tags: Dict[str, str] + """Contains key-value pairs of tags.""" + + type: Literal["durable_object_namespace"] + + +class ResourceTaggingTaggedResourceObjectGatewayList(BaseModel): + """Response for gateway_list resources""" + + id: str + """Identifies the unique resource.""" + + etag: str + """ETag identifier for optimistic concurrency control. + + Formatted as "v1:" where the hash is the base64url-encoded SHA-256 + (truncated to 128 bits) of the tags map canonicalized using RFC 8785 (JSON + Canonicalization Scheme). Clients should treat ETags as opaque strings and pass + them back via the If-Match header on write operations. + """ + + name: str + """Human-readable name of the resource.""" + + tags: Dict[str, str] + """Contains key-value pairs of tags.""" + + type: Literal["gateway_list"] + + +class ResourceTaggingTaggedResourceObjectGatewayRule(BaseModel): + """Response for gateway_rule resources""" + + id: str + """Identifies the unique resource.""" + + etag: str + """ETag identifier for optimistic concurrency control. + + Formatted as "v1:" where the hash is the base64url-encoded SHA-256 + (truncated to 128 bits) of the tags map canonicalized using RFC 8785 (JSON + Canonicalization Scheme). Clients should treat ETags as opaque strings and pass + them back via the If-Match header on write operations. + """ + + name: str + """Human-readable name of the resource.""" + + tags: Dict[str, str] + """Contains key-value pairs of tags.""" + + type: Literal["gateway_rule"] + + +class ResourceTaggingTaggedResourceObjectImage(BaseModel): + """Response for image resources""" + + id: str + """Identifies the unique resource.""" + + etag: str + """ETag identifier for optimistic concurrency control. + + Formatted as "v1:" where the hash is the base64url-encoded SHA-256 + (truncated to 128 bits) of the tags map canonicalized using RFC 8785 (JSON + Canonicalization Scheme). Clients should treat ETags as opaque strings and pass + them back via the If-Match header on write operations. + """ + + name: str + """Human-readable name of the resource.""" + + tags: Dict[str, str] + """Contains key-value pairs of tags.""" + + type: Literal["image"] + + +class ResourceTaggingTaggedResourceObjectKVNamespace(BaseModel): + """Response for kv_namespace resources""" + + id: str + """Identifies the unique resource.""" + + etag: str + """ETag identifier for optimistic concurrency control. + + Formatted as "v1:" where the hash is the base64url-encoded SHA-256 + (truncated to 128 bits) of the tags map canonicalized using RFC 8785 (JSON + Canonicalization Scheme). Clients should treat ETags as opaque strings and pass + them back via the If-Match header on write operations. + """ + + name: str + """Human-readable name of the resource.""" + + tags: Dict[str, str] + """Contains key-value pairs of tags.""" + + type: Literal["kv_namespace"] + + +class ResourceTaggingTaggedResourceObjectManagedClientCertificate(BaseModel): + """Response for managed_client_certificate resources""" + + id: str + """Identifies the unique resource.""" + + etag: str + """ETag identifier for optimistic concurrency control. + + Formatted as "v1:" where the hash is the base64url-encoded SHA-256 + (truncated to 128 bits) of the tags map canonicalized using RFC 8785 (JSON + Canonicalization Scheme). Clients should treat ETags as opaque strings and pass + them back via the If-Match header on write operations. + """ + + name: str + """Human-readable name of the resource.""" + + tags: Dict[str, str] + """Contains key-value pairs of tags.""" + + type: Literal["managed_client_certificate"] + + zone_id: str + """Zone ID is required only for zone-level resources""" + + +class ResourceTaggingTaggedResourceObjectQueue(BaseModel): + """Response for queue resources""" + + id: str + """Identifies the unique resource.""" + + etag: str + """ETag identifier for optimistic concurrency control. + + Formatted as "v1:" where the hash is the base64url-encoded SHA-256 + (truncated to 128 bits) of the tags map canonicalized using RFC 8785 (JSON + Canonicalization Scheme). Clients should treat ETags as opaque strings and pass + them back via the If-Match header on write operations. + """ + + name: str + """Human-readable name of the resource.""" + + tags: Dict[str, str] + """Contains key-value pairs of tags.""" + + type: Literal["queue"] + + +class ResourceTaggingTaggedResourceObjectR2Bucket(BaseModel): + """Response for r2_bucket resources""" + + id: str + """Identifies the unique resource.""" + + etag: str + """ETag identifier for optimistic concurrency control. + + Formatted as "v1:" where the hash is the base64url-encoded SHA-256 + (truncated to 128 bits) of the tags map canonicalized using RFC 8785 (JSON + Canonicalization Scheme). Clients should treat ETags as opaque strings and pass + them back via the If-Match header on write operations. + """ + + name: str + """Human-readable name of the resource.""" + + tags: Dict[str, str] + """Contains key-value pairs of tags.""" + + type: Literal["r2_bucket"] + + +class ResourceTaggingTaggedResourceObjectResourceShare(BaseModel): + """Response for resource_share resources""" + + id: str + """Identifies the unique resource.""" + + etag: str + """ETag identifier for optimistic concurrency control. + + Formatted as "v1:" where the hash is the base64url-encoded SHA-256 + (truncated to 128 bits) of the tags map canonicalized using RFC 8785 (JSON + Canonicalization Scheme). Clients should treat ETags as opaque strings and pass + them back via the If-Match header on write operations. + """ + + name: str + """Human-readable name of the resource.""" + + tags: Dict[str, str] + """Contains key-value pairs of tags.""" + + type: Literal["resource_share"] + + +class ResourceTaggingTaggedResourceObjectStreamLiveInput(BaseModel): + """Response for stream_live_input resources""" + + id: str + """Identifies the unique resource.""" + + etag: str + """ETag identifier for optimistic concurrency control. + + Formatted as "v1:" where the hash is the base64url-encoded SHA-256 + (truncated to 128 bits) of the tags map canonicalized using RFC 8785 (JSON + Canonicalization Scheme). Clients should treat ETags as opaque strings and pass + them back via the If-Match header on write operations. + """ + + name: str + """Human-readable name of the resource.""" + + tags: Dict[str, str] + """Contains key-value pairs of tags.""" + + type: Literal["stream_live_input"] + + +class ResourceTaggingTaggedResourceObjectStreamVideo(BaseModel): + """Response for stream_video resources""" + + id: str + """Identifies the unique resource.""" + + etag: str + """ETag identifier for optimistic concurrency control. + + Formatted as "v1:" where the hash is the base64url-encoded SHA-256 + (truncated to 128 bits) of the tags map canonicalized using RFC 8785 (JSON + Canonicalization Scheme). Clients should treat ETags as opaque strings and pass + them back via the If-Match header on write operations. + """ + + name: str + """Human-readable name of the resource.""" + + tags: Dict[str, str] + """Contains key-value pairs of tags.""" + + type: Literal["stream_video"] + + +class ResourceTaggingTaggedResourceObjectWorker(BaseModel): + """Response for worker resources""" + + id: str + """Identifies the unique resource.""" + + etag: str + """ETag identifier for optimistic concurrency control. + + Formatted as "v1:" where the hash is the base64url-encoded SHA-256 + (truncated to 128 bits) of the tags map canonicalized using RFC 8785 (JSON + Canonicalization Scheme). Clients should treat ETags as opaque strings and pass + them back via the If-Match header on write operations. + """ + + name: str + """Human-readable name of the resource.""" + + tags: Dict[str, str] + """Contains key-value pairs of tags.""" + + type: Literal["worker"] + + +class ResourceTaggingTaggedResourceObjectWorkerVersion(BaseModel): + """Response for worker_version resources""" + + id: str + """Identifies the unique resource.""" + + etag: str + """ETag identifier for optimistic concurrency control. + + Formatted as "v1:" where the hash is the base64url-encoded SHA-256 + (truncated to 128 bits) of the tags map canonicalized using RFC 8785 (JSON + Canonicalization Scheme). Clients should treat ETags as opaque strings and pass + them back via the If-Match header on write operations. + """ + + name: str + """Human-readable name of the resource.""" + + tags: Dict[str, str] + """Contains key-value pairs of tags.""" + + type: Literal["worker_version"] + + worker_id: str + """Worker ID is required only for worker_version resources""" + + +class ResourceTaggingTaggedResourceObjectZone(BaseModel): + """Response for zone resources""" + + id: str + """Identifies the unique resource.""" + + etag: str + """ETag identifier for optimistic concurrency control. + + Formatted as "v1:" where the hash is the base64url-encoded SHA-256 + (truncated to 128 bits) of the tags map canonicalized using RFC 8785 (JSON + Canonicalization Scheme). Clients should treat ETags as opaque strings and pass + them back via the If-Match header on write operations. + """ + + name: str + """Human-readable name of the resource.""" + + tags: Dict[str, str] + """Contains key-value pairs of tags.""" + + type: Literal["zone"] + + zone_id: str + """Zone ID is required only for zone-level resources""" + + +ZoneTagGetResponse: TypeAlias = Annotated[ + Union[ + ResourceTaggingTaggedResourceObjectAccessApplication, + ResourceTaggingTaggedResourceObjectAccessApplicationPolicy, + ResourceTaggingTaggedResourceObjectAccessGroup, + ResourceTaggingTaggedResourceObjectAccount, + ResourceTaggingTaggedResourceObjectAIGateway, + ResourceTaggingTaggedResourceObjectAlertingPolicy, + ResourceTaggingTaggedResourceObjectAlertingWebhook, + ResourceTaggingTaggedResourceObjectAPIGatewayOperation, + ResourceTaggingTaggedResourceObjectCloudflaredTunnel, + ResourceTaggingTaggedResourceObjectCustomCertificate, + ResourceTaggingTaggedResourceObjectCustomHostname, + ResourceTaggingTaggedResourceObjectD1Database, + ResourceTaggingTaggedResourceObjectDNSRecord, + ResourceTaggingTaggedResourceObjectDurableObjectNamespace, + ResourceTaggingTaggedResourceObjectGatewayList, + ResourceTaggingTaggedResourceObjectGatewayRule, + ResourceTaggingTaggedResourceObjectImage, + ResourceTaggingTaggedResourceObjectKVNamespace, + ResourceTaggingTaggedResourceObjectManagedClientCertificate, + ResourceTaggingTaggedResourceObjectQueue, + ResourceTaggingTaggedResourceObjectR2Bucket, + ResourceTaggingTaggedResourceObjectResourceShare, + ResourceTaggingTaggedResourceObjectStreamLiveInput, + ResourceTaggingTaggedResourceObjectStreamVideo, + ResourceTaggingTaggedResourceObjectWorker, + ResourceTaggingTaggedResourceObjectWorkerVersion, + ResourceTaggingTaggedResourceObjectZone, + ], + PropertyInfo(discriminator="type"), +] diff --git a/src/cloudflare/types/resource_tagging/zone_tag_update_params.py b/src/cloudflare/types/resource_tagging/zone_tag_update_params.py new file mode 100644 index 00000000000..9b9fa8a54fa --- /dev/null +++ b/src/cloudflare/types/resource_tagging/zone_tag_update_params.py @@ -0,0 +1,73 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Dict, Union +from typing_extensions import Literal, Required, Annotated, TypeAlias, TypedDict + +from ..._utils import PropertyInfo + +__all__ = [ + "ZoneTagUpdateParams", + "ResourceTaggingSetTagsRequestZoneLevelBase", + "ResourceTaggingSetTagsRequestZoneLevelAccessApplicationPolicy", +] + + +class ResourceTaggingSetTagsRequestZoneLevelBase(TypedDict, total=False): + zone_id: Required[str] + """Zone ID is required only for zone-level resources""" + + resource_id: Required[str] + """Identifies the unique resource.""" + + resource_type: Required[ + Literal[ + "api_gateway_operation", + "custom_certificate", + "custom_hostname", + "dns_record", + "managed_client_certificate", + "zone", + ] + ] + """Enum for base zone-level resource types (those with no extra required fields).""" + + tags: Dict[str, str] + """Contains key-value pairs of tags.""" + + if_match: Annotated[str, PropertyInfo(alias="If-Match")] + + +class ResourceTaggingSetTagsRequestZoneLevelAccessApplicationPolicy(TypedDict, total=False): + zone_id: Required[str] + """Zone ID is required only for zone-level resources""" + + access_application_id: Required[str] + """Access application ID is required only for access_application_policy resources""" + + resource_id: Required[str] + """Identifies the unique resource.""" + + resource_type: Required[ + Literal[ + "api_gateway_operation", + "custom_certificate", + "custom_hostname", + "dns_record", + "managed_client_certificate", + "zone", + "access_application_policy", + ] + ] + """Enum for base zone-level resource types (those with no extra required fields).""" + + tags: Dict[str, str] + """Contains key-value pairs of tags.""" + + if_match: Annotated[str, PropertyInfo(alias="If-Match")] + + +ZoneTagUpdateParams: TypeAlias = Union[ + ResourceTaggingSetTagsRequestZoneLevelBase, ResourceTaggingSetTagsRequestZoneLevelAccessApplicationPolicy +] diff --git a/src/cloudflare/types/resource_tagging/zone_tag_update_response.py b/src/cloudflare/types/resource_tagging/zone_tag_update_response.py new file mode 100644 index 00000000000..7981847d2f2 --- /dev/null +++ b/src/cloudflare/types/resource_tagging/zone_tag_update_response.py @@ -0,0 +1,747 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Dict, Union +from typing_extensions import Literal, Annotated, TypeAlias + +from ..._utils import PropertyInfo +from ..._models import BaseModel + +__all__ = [ + "ZoneTagUpdateResponse", + "ResourceTaggingTaggedResourceObjectAccessApplication", + "ResourceTaggingTaggedResourceObjectAccessApplicationPolicy", + "ResourceTaggingTaggedResourceObjectAccessGroup", + "ResourceTaggingTaggedResourceObjectAccount", + "ResourceTaggingTaggedResourceObjectAIGateway", + "ResourceTaggingTaggedResourceObjectAlertingPolicy", + "ResourceTaggingTaggedResourceObjectAlertingWebhook", + "ResourceTaggingTaggedResourceObjectAPIGatewayOperation", + "ResourceTaggingTaggedResourceObjectCloudflaredTunnel", + "ResourceTaggingTaggedResourceObjectCustomCertificate", + "ResourceTaggingTaggedResourceObjectCustomHostname", + "ResourceTaggingTaggedResourceObjectD1Database", + "ResourceTaggingTaggedResourceObjectDNSRecord", + "ResourceTaggingTaggedResourceObjectDurableObjectNamespace", + "ResourceTaggingTaggedResourceObjectGatewayList", + "ResourceTaggingTaggedResourceObjectGatewayRule", + "ResourceTaggingTaggedResourceObjectImage", + "ResourceTaggingTaggedResourceObjectKVNamespace", + "ResourceTaggingTaggedResourceObjectManagedClientCertificate", + "ResourceTaggingTaggedResourceObjectQueue", + "ResourceTaggingTaggedResourceObjectR2Bucket", + "ResourceTaggingTaggedResourceObjectResourceShare", + "ResourceTaggingTaggedResourceObjectStreamLiveInput", + "ResourceTaggingTaggedResourceObjectStreamVideo", + "ResourceTaggingTaggedResourceObjectWorker", + "ResourceTaggingTaggedResourceObjectWorkerVersion", + "ResourceTaggingTaggedResourceObjectZone", +] + + +class ResourceTaggingTaggedResourceObjectAccessApplication(BaseModel): + """Response for access_application resources""" + + id: str + """Identifies the unique resource.""" + + etag: str + """ETag identifier for optimistic concurrency control. + + Formatted as "v1:" where the hash is the base64url-encoded SHA-256 + (truncated to 128 bits) of the tags map canonicalized using RFC 8785 (JSON + Canonicalization Scheme). Clients should treat ETags as opaque strings and pass + them back via the If-Match header on write operations. + """ + + name: str + """Human-readable name of the resource.""" + + tags: Dict[str, str] + """Contains key-value pairs of tags.""" + + type: Literal["access_application"] + + +class ResourceTaggingTaggedResourceObjectAccessApplicationPolicy(BaseModel): + """Response for access_application_policy resources""" + + id: str + """Identifies the unique resource.""" + + access_application_id: str + """Access application ID is required only for access_application_policy resources""" + + etag: str + """ETag identifier for optimistic concurrency control. + + Formatted as "v1:" where the hash is the base64url-encoded SHA-256 + (truncated to 128 bits) of the tags map canonicalized using RFC 8785 (JSON + Canonicalization Scheme). Clients should treat ETags as opaque strings and pass + them back via the If-Match header on write operations. + """ + + name: str + """Human-readable name of the resource.""" + + tags: Dict[str, str] + """Contains key-value pairs of tags.""" + + type: Literal["access_application_policy"] + + zone_id: str + """Zone ID is required only for zone-level resources""" + + +class ResourceTaggingTaggedResourceObjectAccessGroup(BaseModel): + """Response for access_group resources""" + + id: str + """Identifies the unique resource.""" + + etag: str + """ETag identifier for optimistic concurrency control. + + Formatted as "v1:" where the hash is the base64url-encoded SHA-256 + (truncated to 128 bits) of the tags map canonicalized using RFC 8785 (JSON + Canonicalization Scheme). Clients should treat ETags as opaque strings and pass + them back via the If-Match header on write operations. + """ + + name: str + """Human-readable name of the resource.""" + + tags: Dict[str, str] + """Contains key-value pairs of tags.""" + + type: Literal["access_group"] + + +class ResourceTaggingTaggedResourceObjectAccount(BaseModel): + """Response for account resources""" + + id: str + """Identifies the unique resource.""" + + etag: str + """ETag identifier for optimistic concurrency control. + + Formatted as "v1:" where the hash is the base64url-encoded SHA-256 + (truncated to 128 bits) of the tags map canonicalized using RFC 8785 (JSON + Canonicalization Scheme). Clients should treat ETags as opaque strings and pass + them back via the If-Match header on write operations. + """ + + name: str + """Human-readable name of the resource.""" + + tags: Dict[str, str] + """Contains key-value pairs of tags.""" + + type: Literal["account"] + + +class ResourceTaggingTaggedResourceObjectAIGateway(BaseModel): + """Response for ai_gateway resources""" + + id: str + """Identifies the unique resource.""" + + etag: str + """ETag identifier for optimistic concurrency control. + + Formatted as "v1:" where the hash is the base64url-encoded SHA-256 + (truncated to 128 bits) of the tags map canonicalized using RFC 8785 (JSON + Canonicalization Scheme). Clients should treat ETags as opaque strings and pass + them back via the If-Match header on write operations. + """ + + name: str + """Human-readable name of the resource.""" + + tags: Dict[str, str] + """Contains key-value pairs of tags.""" + + type: Literal["ai_gateway"] + + +class ResourceTaggingTaggedResourceObjectAlertingPolicy(BaseModel): + """Response for alerting_policy resources""" + + id: str + """Identifies the unique resource.""" + + etag: str + """ETag identifier for optimistic concurrency control. + + Formatted as "v1:" where the hash is the base64url-encoded SHA-256 + (truncated to 128 bits) of the tags map canonicalized using RFC 8785 (JSON + Canonicalization Scheme). Clients should treat ETags as opaque strings and pass + them back via the If-Match header on write operations. + """ + + name: str + """Human-readable name of the resource.""" + + tags: Dict[str, str] + """Contains key-value pairs of tags.""" + + type: Literal["alerting_policy"] + + +class ResourceTaggingTaggedResourceObjectAlertingWebhook(BaseModel): + """Response for alerting_webhook resources""" + + id: str + """Identifies the unique resource.""" + + etag: str + """ETag identifier for optimistic concurrency control. + + Formatted as "v1:" where the hash is the base64url-encoded SHA-256 + (truncated to 128 bits) of the tags map canonicalized using RFC 8785 (JSON + Canonicalization Scheme). Clients should treat ETags as opaque strings and pass + them back via the If-Match header on write operations. + """ + + name: str + """Human-readable name of the resource.""" + + tags: Dict[str, str] + """Contains key-value pairs of tags.""" + + type: Literal["alerting_webhook"] + + +class ResourceTaggingTaggedResourceObjectAPIGatewayOperation(BaseModel): + """Response for api_gateway_operation resources""" + + id: str + """Identifies the unique resource.""" + + etag: str + """ETag identifier for optimistic concurrency control. + + Formatted as "v1:" where the hash is the base64url-encoded SHA-256 + (truncated to 128 bits) of the tags map canonicalized using RFC 8785 (JSON + Canonicalization Scheme). Clients should treat ETags as opaque strings and pass + them back via the If-Match header on write operations. + """ + + name: str + """Human-readable name of the resource.""" + + tags: Dict[str, str] + """Contains key-value pairs of tags.""" + + type: Literal["api_gateway_operation"] + + zone_id: str + """Zone ID is required only for zone-level resources""" + + +class ResourceTaggingTaggedResourceObjectCloudflaredTunnel(BaseModel): + """Response for cloudflared_tunnel resources""" + + id: str + """Identifies the unique resource.""" + + etag: str + """ETag identifier for optimistic concurrency control. + + Formatted as "v1:" where the hash is the base64url-encoded SHA-256 + (truncated to 128 bits) of the tags map canonicalized using RFC 8785 (JSON + Canonicalization Scheme). Clients should treat ETags as opaque strings and pass + them back via the If-Match header on write operations. + """ + + name: str + """Human-readable name of the resource.""" + + tags: Dict[str, str] + """Contains key-value pairs of tags.""" + + type: Literal["cloudflared_tunnel"] + + +class ResourceTaggingTaggedResourceObjectCustomCertificate(BaseModel): + """Response for custom_certificate resources""" + + id: str + """Identifies the unique resource.""" + + etag: str + """ETag identifier for optimistic concurrency control. + + Formatted as "v1:" where the hash is the base64url-encoded SHA-256 + (truncated to 128 bits) of the tags map canonicalized using RFC 8785 (JSON + Canonicalization Scheme). Clients should treat ETags as opaque strings and pass + them back via the If-Match header on write operations. + """ + + name: str + """Human-readable name of the resource.""" + + tags: Dict[str, str] + """Contains key-value pairs of tags.""" + + type: Literal["custom_certificate"] + + zone_id: str + """Zone ID is required only for zone-level resources""" + + +class ResourceTaggingTaggedResourceObjectCustomHostname(BaseModel): + """Response for custom_hostname resources""" + + id: str + """Identifies the unique resource.""" + + etag: str + """ETag identifier for optimistic concurrency control. + + Formatted as "v1:" where the hash is the base64url-encoded SHA-256 + (truncated to 128 bits) of the tags map canonicalized using RFC 8785 (JSON + Canonicalization Scheme). Clients should treat ETags as opaque strings and pass + them back via the If-Match header on write operations. + """ + + name: str + """Human-readable name of the resource.""" + + tags: Dict[str, str] + """Contains key-value pairs of tags.""" + + type: Literal["custom_hostname"] + + zone_id: str + """Zone ID is required only for zone-level resources""" + + +class ResourceTaggingTaggedResourceObjectD1Database(BaseModel): + """Response for d1_database resources""" + + id: str + """Identifies the unique resource.""" + + etag: str + """ETag identifier for optimistic concurrency control. + + Formatted as "v1:" where the hash is the base64url-encoded SHA-256 + (truncated to 128 bits) of the tags map canonicalized using RFC 8785 (JSON + Canonicalization Scheme). Clients should treat ETags as opaque strings and pass + them back via the If-Match header on write operations. + """ + + name: str + """Human-readable name of the resource.""" + + tags: Dict[str, str] + """Contains key-value pairs of tags.""" + + type: Literal["d1_database"] + + +class ResourceTaggingTaggedResourceObjectDNSRecord(BaseModel): + """Response for dns_record resources""" + + id: str + """Identifies the unique resource.""" + + etag: str + """ETag identifier for optimistic concurrency control. + + Formatted as "v1:" where the hash is the base64url-encoded SHA-256 + (truncated to 128 bits) of the tags map canonicalized using RFC 8785 (JSON + Canonicalization Scheme). Clients should treat ETags as opaque strings and pass + them back via the If-Match header on write operations. + """ + + name: str + """Human-readable name of the resource.""" + + tags: Dict[str, str] + """Contains key-value pairs of tags.""" + + type: Literal["dns_record"] + + zone_id: str + """Zone ID is required only for zone-level resources""" + + +class ResourceTaggingTaggedResourceObjectDurableObjectNamespace(BaseModel): + """Response for durable_object_namespace resources""" + + id: str + """Identifies the unique resource.""" + + etag: str + """ETag identifier for optimistic concurrency control. + + Formatted as "v1:" where the hash is the base64url-encoded SHA-256 + (truncated to 128 bits) of the tags map canonicalized using RFC 8785 (JSON + Canonicalization Scheme). Clients should treat ETags as opaque strings and pass + them back via the If-Match header on write operations. + """ + + name: str + """Human-readable name of the resource.""" + + tags: Dict[str, str] + """Contains key-value pairs of tags.""" + + type: Literal["durable_object_namespace"] + + +class ResourceTaggingTaggedResourceObjectGatewayList(BaseModel): + """Response for gateway_list resources""" + + id: str + """Identifies the unique resource.""" + + etag: str + """ETag identifier for optimistic concurrency control. + + Formatted as "v1:" where the hash is the base64url-encoded SHA-256 + (truncated to 128 bits) of the tags map canonicalized using RFC 8785 (JSON + Canonicalization Scheme). Clients should treat ETags as opaque strings and pass + them back via the If-Match header on write operations. + """ + + name: str + """Human-readable name of the resource.""" + + tags: Dict[str, str] + """Contains key-value pairs of tags.""" + + type: Literal["gateway_list"] + + +class ResourceTaggingTaggedResourceObjectGatewayRule(BaseModel): + """Response for gateway_rule resources""" + + id: str + """Identifies the unique resource.""" + + etag: str + """ETag identifier for optimistic concurrency control. + + Formatted as "v1:" where the hash is the base64url-encoded SHA-256 + (truncated to 128 bits) of the tags map canonicalized using RFC 8785 (JSON + Canonicalization Scheme). Clients should treat ETags as opaque strings and pass + them back via the If-Match header on write operations. + """ + + name: str + """Human-readable name of the resource.""" + + tags: Dict[str, str] + """Contains key-value pairs of tags.""" + + type: Literal["gateway_rule"] + + +class ResourceTaggingTaggedResourceObjectImage(BaseModel): + """Response for image resources""" + + id: str + """Identifies the unique resource.""" + + etag: str + """ETag identifier for optimistic concurrency control. + + Formatted as "v1:" where the hash is the base64url-encoded SHA-256 + (truncated to 128 bits) of the tags map canonicalized using RFC 8785 (JSON + Canonicalization Scheme). Clients should treat ETags as opaque strings and pass + them back via the If-Match header on write operations. + """ + + name: str + """Human-readable name of the resource.""" + + tags: Dict[str, str] + """Contains key-value pairs of tags.""" + + type: Literal["image"] + + +class ResourceTaggingTaggedResourceObjectKVNamespace(BaseModel): + """Response for kv_namespace resources""" + + id: str + """Identifies the unique resource.""" + + etag: str + """ETag identifier for optimistic concurrency control. + + Formatted as "v1:" where the hash is the base64url-encoded SHA-256 + (truncated to 128 bits) of the tags map canonicalized using RFC 8785 (JSON + Canonicalization Scheme). Clients should treat ETags as opaque strings and pass + them back via the If-Match header on write operations. + """ + + name: str + """Human-readable name of the resource.""" + + tags: Dict[str, str] + """Contains key-value pairs of tags.""" + + type: Literal["kv_namespace"] + + +class ResourceTaggingTaggedResourceObjectManagedClientCertificate(BaseModel): + """Response for managed_client_certificate resources""" + + id: str + """Identifies the unique resource.""" + + etag: str + """ETag identifier for optimistic concurrency control. + + Formatted as "v1:" where the hash is the base64url-encoded SHA-256 + (truncated to 128 bits) of the tags map canonicalized using RFC 8785 (JSON + Canonicalization Scheme). Clients should treat ETags as opaque strings and pass + them back via the If-Match header on write operations. + """ + + name: str + """Human-readable name of the resource.""" + + tags: Dict[str, str] + """Contains key-value pairs of tags.""" + + type: Literal["managed_client_certificate"] + + zone_id: str + """Zone ID is required only for zone-level resources""" + + +class ResourceTaggingTaggedResourceObjectQueue(BaseModel): + """Response for queue resources""" + + id: str + """Identifies the unique resource.""" + + etag: str + """ETag identifier for optimistic concurrency control. + + Formatted as "v1:" where the hash is the base64url-encoded SHA-256 + (truncated to 128 bits) of the tags map canonicalized using RFC 8785 (JSON + Canonicalization Scheme). Clients should treat ETags as opaque strings and pass + them back via the If-Match header on write operations. + """ + + name: str + """Human-readable name of the resource.""" + + tags: Dict[str, str] + """Contains key-value pairs of tags.""" + + type: Literal["queue"] + + +class ResourceTaggingTaggedResourceObjectR2Bucket(BaseModel): + """Response for r2_bucket resources""" + + id: str + """Identifies the unique resource.""" + + etag: str + """ETag identifier for optimistic concurrency control. + + Formatted as "v1:" where the hash is the base64url-encoded SHA-256 + (truncated to 128 bits) of the tags map canonicalized using RFC 8785 (JSON + Canonicalization Scheme). Clients should treat ETags as opaque strings and pass + them back via the If-Match header on write operations. + """ + + name: str + """Human-readable name of the resource.""" + + tags: Dict[str, str] + """Contains key-value pairs of tags.""" + + type: Literal["r2_bucket"] + + +class ResourceTaggingTaggedResourceObjectResourceShare(BaseModel): + """Response for resource_share resources""" + + id: str + """Identifies the unique resource.""" + + etag: str + """ETag identifier for optimistic concurrency control. + + Formatted as "v1:" where the hash is the base64url-encoded SHA-256 + (truncated to 128 bits) of the tags map canonicalized using RFC 8785 (JSON + Canonicalization Scheme). Clients should treat ETags as opaque strings and pass + them back via the If-Match header on write operations. + """ + + name: str + """Human-readable name of the resource.""" + + tags: Dict[str, str] + """Contains key-value pairs of tags.""" + + type: Literal["resource_share"] + + +class ResourceTaggingTaggedResourceObjectStreamLiveInput(BaseModel): + """Response for stream_live_input resources""" + + id: str + """Identifies the unique resource.""" + + etag: str + """ETag identifier for optimistic concurrency control. + + Formatted as "v1:" where the hash is the base64url-encoded SHA-256 + (truncated to 128 bits) of the tags map canonicalized using RFC 8785 (JSON + Canonicalization Scheme). Clients should treat ETags as opaque strings and pass + them back via the If-Match header on write operations. + """ + + name: str + """Human-readable name of the resource.""" + + tags: Dict[str, str] + """Contains key-value pairs of tags.""" + + type: Literal["stream_live_input"] + + +class ResourceTaggingTaggedResourceObjectStreamVideo(BaseModel): + """Response for stream_video resources""" + + id: str + """Identifies the unique resource.""" + + etag: str + """ETag identifier for optimistic concurrency control. + + Formatted as "v1:" where the hash is the base64url-encoded SHA-256 + (truncated to 128 bits) of the tags map canonicalized using RFC 8785 (JSON + Canonicalization Scheme). Clients should treat ETags as opaque strings and pass + them back via the If-Match header on write operations. + """ + + name: str + """Human-readable name of the resource.""" + + tags: Dict[str, str] + """Contains key-value pairs of tags.""" + + type: Literal["stream_video"] + + +class ResourceTaggingTaggedResourceObjectWorker(BaseModel): + """Response for worker resources""" + + id: str + """Identifies the unique resource.""" + + etag: str + """ETag identifier for optimistic concurrency control. + + Formatted as "v1:" where the hash is the base64url-encoded SHA-256 + (truncated to 128 bits) of the tags map canonicalized using RFC 8785 (JSON + Canonicalization Scheme). Clients should treat ETags as opaque strings and pass + them back via the If-Match header on write operations. + """ + + name: str + """Human-readable name of the resource.""" + + tags: Dict[str, str] + """Contains key-value pairs of tags.""" + + type: Literal["worker"] + + +class ResourceTaggingTaggedResourceObjectWorkerVersion(BaseModel): + """Response for worker_version resources""" + + id: str + """Identifies the unique resource.""" + + etag: str + """ETag identifier for optimistic concurrency control. + + Formatted as "v1:" where the hash is the base64url-encoded SHA-256 + (truncated to 128 bits) of the tags map canonicalized using RFC 8785 (JSON + Canonicalization Scheme). Clients should treat ETags as opaque strings and pass + them back via the If-Match header on write operations. + """ + + name: str + """Human-readable name of the resource.""" + + tags: Dict[str, str] + """Contains key-value pairs of tags.""" + + type: Literal["worker_version"] + + worker_id: str + """Worker ID is required only for worker_version resources""" + + +class ResourceTaggingTaggedResourceObjectZone(BaseModel): + """Response for zone resources""" + + id: str + """Identifies the unique resource.""" + + etag: str + """ETag identifier for optimistic concurrency control. + + Formatted as "v1:" where the hash is the base64url-encoded SHA-256 + (truncated to 128 bits) of the tags map canonicalized using RFC 8785 (JSON + Canonicalization Scheme). Clients should treat ETags as opaque strings and pass + them back via the If-Match header on write operations. + """ + + name: str + """Human-readable name of the resource.""" + + tags: Dict[str, str] + """Contains key-value pairs of tags.""" + + type: Literal["zone"] + + zone_id: str + """Zone ID is required only for zone-level resources""" + + +ZoneTagUpdateResponse: TypeAlias = Annotated[ + Union[ + ResourceTaggingTaggedResourceObjectAccessApplication, + ResourceTaggingTaggedResourceObjectAccessApplicationPolicy, + ResourceTaggingTaggedResourceObjectAccessGroup, + ResourceTaggingTaggedResourceObjectAccount, + ResourceTaggingTaggedResourceObjectAIGateway, + ResourceTaggingTaggedResourceObjectAlertingPolicy, + ResourceTaggingTaggedResourceObjectAlertingWebhook, + ResourceTaggingTaggedResourceObjectAPIGatewayOperation, + ResourceTaggingTaggedResourceObjectCloudflaredTunnel, + ResourceTaggingTaggedResourceObjectCustomCertificate, + ResourceTaggingTaggedResourceObjectCustomHostname, + ResourceTaggingTaggedResourceObjectD1Database, + ResourceTaggingTaggedResourceObjectDNSRecord, + ResourceTaggingTaggedResourceObjectDurableObjectNamespace, + ResourceTaggingTaggedResourceObjectGatewayList, + ResourceTaggingTaggedResourceObjectGatewayRule, + ResourceTaggingTaggedResourceObjectImage, + ResourceTaggingTaggedResourceObjectKVNamespace, + ResourceTaggingTaggedResourceObjectManagedClientCertificate, + ResourceTaggingTaggedResourceObjectQueue, + ResourceTaggingTaggedResourceObjectR2Bucket, + ResourceTaggingTaggedResourceObjectResourceShare, + ResourceTaggingTaggedResourceObjectStreamLiveInput, + ResourceTaggingTaggedResourceObjectStreamVideo, + ResourceTaggingTaggedResourceObjectWorker, + ResourceTaggingTaggedResourceObjectWorkerVersion, + ResourceTaggingTaggedResourceObjectZone, + ], + PropertyInfo(discriminator="type"), +] diff --git a/tests/api_resources/resource_tagging/__init__.py b/tests/api_resources/resource_tagging/__init__.py new file mode 100644 index 00000000000..fd8019a9a1a --- /dev/null +++ b/tests/api_resources/resource_tagging/__init__.py @@ -0,0 +1 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. diff --git a/tests/api_resources/resource_tagging/test_account_tags.py b/tests/api_resources/resource_tagging/test_account_tags.py new file mode 100644 index 00000000000..9c91463df46 --- /dev/null +++ b/tests/api_resources/resource_tagging/test_account_tags.py @@ -0,0 +1,481 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +import os +from typing import Any, Optional, cast + +import pytest + +from cloudflare import Cloudflare, AsyncCloudflare +from tests.utils import assert_matches_type +from cloudflare.types.resource_tagging import ( + AccountTagGetResponse, + AccountTagUpdateResponse, +) + +base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") + + +class TestAccountTags: + parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) + + @parametrize + def test_method_update_overload_1(self, client: Cloudflare) -> None: + account_tag = client.resource_tagging.account_tags.update( + account_id="023e105f4ecef8ad9ca31a8372d0c353", + resource_id="023e105f4ecef8ad9ca31a8372d0c353", + resource_type="worker", + worker_id="3f72a691-44b3-4c11-8642-c18a88ddaa5e", + ) + assert_matches_type(Optional[AccountTagUpdateResponse], account_tag, path=["response"]) + + @parametrize + def test_method_update_with_all_params_overload_1(self, client: Cloudflare) -> None: + account_tag = client.resource_tagging.account_tags.update( + account_id="023e105f4ecef8ad9ca31a8372d0c353", + resource_id="023e105f4ecef8ad9ca31a8372d0c353", + resource_type="worker", + worker_id="3f72a691-44b3-4c11-8642-c18a88ddaa5e", + tags={ + "environment": "production", + "team": "engineering", + }, + if_match='"v1:RBNvo1WzZ4oRRq0W9-hkng"', + ) + assert_matches_type(Optional[AccountTagUpdateResponse], account_tag, path=["response"]) + + @parametrize + def test_raw_response_update_overload_1(self, client: Cloudflare) -> None: + response = client.resource_tagging.account_tags.with_raw_response.update( + account_id="023e105f4ecef8ad9ca31a8372d0c353", + resource_id="023e105f4ecef8ad9ca31a8372d0c353", + resource_type="worker", + worker_id="3f72a691-44b3-4c11-8642-c18a88ddaa5e", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + account_tag = response.parse() + assert_matches_type(Optional[AccountTagUpdateResponse], account_tag, path=["response"]) + + @parametrize + def test_streaming_response_update_overload_1(self, client: Cloudflare) -> None: + with client.resource_tagging.account_tags.with_streaming_response.update( + account_id="023e105f4ecef8ad9ca31a8372d0c353", + resource_id="023e105f4ecef8ad9ca31a8372d0c353", + resource_type="worker", + worker_id="3f72a691-44b3-4c11-8642-c18a88ddaa5e", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + account_tag = response.parse() + assert_matches_type(Optional[AccountTagUpdateResponse], account_tag, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_update_overload_1(self, client: Cloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + client.resource_tagging.account_tags.with_raw_response.update( + account_id="", + resource_id="023e105f4ecef8ad9ca31a8372d0c353", + resource_type="worker", + worker_id="3f72a691-44b3-4c11-8642-c18a88ddaa5e", + ) + + @parametrize + def test_method_update_overload_2(self, client: Cloudflare) -> None: + account_tag = client.resource_tagging.account_tags.update( + account_id="023e105f4ecef8ad9ca31a8372d0c353", + resource_id="023e105f4ecef8ad9ca31a8372d0c353", + resource_type="worker", + ) + assert_matches_type(Optional[AccountTagUpdateResponse], account_tag, path=["response"]) + + @parametrize + def test_method_update_with_all_params_overload_2(self, client: Cloudflare) -> None: + account_tag = client.resource_tagging.account_tags.update( + account_id="023e105f4ecef8ad9ca31a8372d0c353", + resource_id="023e105f4ecef8ad9ca31a8372d0c353", + resource_type="worker", + tags={ + "environment": "production", + "team": "engineering", + }, + if_match='"v1:RBNvo1WzZ4oRRq0W9-hkng"', + ) + assert_matches_type(Optional[AccountTagUpdateResponse], account_tag, path=["response"]) + + @parametrize + def test_raw_response_update_overload_2(self, client: Cloudflare) -> None: + response = client.resource_tagging.account_tags.with_raw_response.update( + account_id="023e105f4ecef8ad9ca31a8372d0c353", + resource_id="023e105f4ecef8ad9ca31a8372d0c353", + resource_type="worker", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + account_tag = response.parse() + assert_matches_type(Optional[AccountTagUpdateResponse], account_tag, path=["response"]) + + @parametrize + def test_streaming_response_update_overload_2(self, client: Cloudflare) -> None: + with client.resource_tagging.account_tags.with_streaming_response.update( + account_id="023e105f4ecef8ad9ca31a8372d0c353", + resource_id="023e105f4ecef8ad9ca31a8372d0c353", + resource_type="worker", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + account_tag = response.parse() + assert_matches_type(Optional[AccountTagUpdateResponse], account_tag, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_update_overload_2(self, client: Cloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + client.resource_tagging.account_tags.with_raw_response.update( + account_id="", + resource_id="023e105f4ecef8ad9ca31a8372d0c353", + resource_type="worker", + ) + + @parametrize + def test_method_delete(self, client: Cloudflare) -> None: + account_tag = client.resource_tagging.account_tags.delete( + account_id="023e105f4ecef8ad9ca31a8372d0c353", + ) + assert account_tag is None + + @parametrize + def test_method_delete_with_all_params(self, client: Cloudflare) -> None: + account_tag = client.resource_tagging.account_tags.delete( + account_id="023e105f4ecef8ad9ca31a8372d0c353", + if_match='"v1:RBNvo1WzZ4oRRq0W9-hkng"', + ) + assert account_tag is None + + @parametrize + def test_raw_response_delete(self, client: Cloudflare) -> None: + response = client.resource_tagging.account_tags.with_raw_response.delete( + account_id="023e105f4ecef8ad9ca31a8372d0c353", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + account_tag = response.parse() + assert account_tag is None + + @parametrize + def test_streaming_response_delete(self, client: Cloudflare) -> None: + with client.resource_tagging.account_tags.with_streaming_response.delete( + account_id="023e105f4ecef8ad9ca31a8372d0c353", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + account_tag = response.parse() + assert account_tag is None + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_delete(self, client: Cloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + client.resource_tagging.account_tags.with_raw_response.delete( + account_id="", + ) + + @parametrize + def test_method_get(self, client: Cloudflare) -> None: + account_tag = client.resource_tagging.account_tags.get( + account_id="023e105f4ecef8ad9ca31a8372d0c353", + resource_id="023e105f4ecef8ad9ca31a8372d0c353", + resource_type="worker", + ) + assert_matches_type(Optional[AccountTagGetResponse], account_tag, path=["response"]) + + @parametrize + def test_method_get_with_all_params(self, client: Cloudflare) -> None: + account_tag = client.resource_tagging.account_tags.get( + account_id="023e105f4ecef8ad9ca31a8372d0c353", + resource_id="023e105f4ecef8ad9ca31a8372d0c353", + resource_type="worker", + worker_id="3f72a691-44b3-4c11-8642-c18a88ddaa5e", + ) + assert_matches_type(Optional[AccountTagGetResponse], account_tag, path=["response"]) + + @parametrize + def test_raw_response_get(self, client: Cloudflare) -> None: + response = client.resource_tagging.account_tags.with_raw_response.get( + account_id="023e105f4ecef8ad9ca31a8372d0c353", + resource_id="023e105f4ecef8ad9ca31a8372d0c353", + resource_type="worker", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + account_tag = response.parse() + assert_matches_type(Optional[AccountTagGetResponse], account_tag, path=["response"]) + + @parametrize + def test_streaming_response_get(self, client: Cloudflare) -> None: + with client.resource_tagging.account_tags.with_streaming_response.get( + account_id="023e105f4ecef8ad9ca31a8372d0c353", + resource_id="023e105f4ecef8ad9ca31a8372d0c353", + resource_type="worker", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + account_tag = response.parse() + assert_matches_type(Optional[AccountTagGetResponse], account_tag, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_get(self, client: Cloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + client.resource_tagging.account_tags.with_raw_response.get( + account_id="", + resource_id="023e105f4ecef8ad9ca31a8372d0c353", + resource_type="worker", + ) + + +class TestAsyncAccountTags: + parametrize = pytest.mark.parametrize( + "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"] + ) + + @parametrize + async def test_method_update_overload_1(self, async_client: AsyncCloudflare) -> None: + account_tag = await async_client.resource_tagging.account_tags.update( + account_id="023e105f4ecef8ad9ca31a8372d0c353", + resource_id="023e105f4ecef8ad9ca31a8372d0c353", + resource_type="worker", + worker_id="3f72a691-44b3-4c11-8642-c18a88ddaa5e", + ) + assert_matches_type(Optional[AccountTagUpdateResponse], account_tag, path=["response"]) + + @parametrize + async def test_method_update_with_all_params_overload_1(self, async_client: AsyncCloudflare) -> None: + account_tag = await async_client.resource_tagging.account_tags.update( + account_id="023e105f4ecef8ad9ca31a8372d0c353", + resource_id="023e105f4ecef8ad9ca31a8372d0c353", + resource_type="worker", + worker_id="3f72a691-44b3-4c11-8642-c18a88ddaa5e", + tags={ + "environment": "production", + "team": "engineering", + }, + if_match='"v1:RBNvo1WzZ4oRRq0W9-hkng"', + ) + assert_matches_type(Optional[AccountTagUpdateResponse], account_tag, path=["response"]) + + @parametrize + async def test_raw_response_update_overload_1(self, async_client: AsyncCloudflare) -> None: + response = await async_client.resource_tagging.account_tags.with_raw_response.update( + account_id="023e105f4ecef8ad9ca31a8372d0c353", + resource_id="023e105f4ecef8ad9ca31a8372d0c353", + resource_type="worker", + worker_id="3f72a691-44b3-4c11-8642-c18a88ddaa5e", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + account_tag = await response.parse() + assert_matches_type(Optional[AccountTagUpdateResponse], account_tag, path=["response"]) + + @parametrize + async def test_streaming_response_update_overload_1(self, async_client: AsyncCloudflare) -> None: + async with async_client.resource_tagging.account_tags.with_streaming_response.update( + account_id="023e105f4ecef8ad9ca31a8372d0c353", + resource_id="023e105f4ecef8ad9ca31a8372d0c353", + resource_type="worker", + worker_id="3f72a691-44b3-4c11-8642-c18a88ddaa5e", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + account_tag = await response.parse() + assert_matches_type(Optional[AccountTagUpdateResponse], account_tag, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_update_overload_1(self, async_client: AsyncCloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + await async_client.resource_tagging.account_tags.with_raw_response.update( + account_id="", + resource_id="023e105f4ecef8ad9ca31a8372d0c353", + resource_type="worker", + worker_id="3f72a691-44b3-4c11-8642-c18a88ddaa5e", + ) + + @parametrize + async def test_method_update_overload_2(self, async_client: AsyncCloudflare) -> None: + account_tag = await async_client.resource_tagging.account_tags.update( + account_id="023e105f4ecef8ad9ca31a8372d0c353", + resource_id="023e105f4ecef8ad9ca31a8372d0c353", + resource_type="worker", + ) + assert_matches_type(Optional[AccountTagUpdateResponse], account_tag, path=["response"]) + + @parametrize + async def test_method_update_with_all_params_overload_2(self, async_client: AsyncCloudflare) -> None: + account_tag = await async_client.resource_tagging.account_tags.update( + account_id="023e105f4ecef8ad9ca31a8372d0c353", + resource_id="023e105f4ecef8ad9ca31a8372d0c353", + resource_type="worker", + tags={ + "environment": "production", + "team": "engineering", + }, + if_match='"v1:RBNvo1WzZ4oRRq0W9-hkng"', + ) + assert_matches_type(Optional[AccountTagUpdateResponse], account_tag, path=["response"]) + + @parametrize + async def test_raw_response_update_overload_2(self, async_client: AsyncCloudflare) -> None: + response = await async_client.resource_tagging.account_tags.with_raw_response.update( + account_id="023e105f4ecef8ad9ca31a8372d0c353", + resource_id="023e105f4ecef8ad9ca31a8372d0c353", + resource_type="worker", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + account_tag = await response.parse() + assert_matches_type(Optional[AccountTagUpdateResponse], account_tag, path=["response"]) + + @parametrize + async def test_streaming_response_update_overload_2(self, async_client: AsyncCloudflare) -> None: + async with async_client.resource_tagging.account_tags.with_streaming_response.update( + account_id="023e105f4ecef8ad9ca31a8372d0c353", + resource_id="023e105f4ecef8ad9ca31a8372d0c353", + resource_type="worker", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + account_tag = await response.parse() + assert_matches_type(Optional[AccountTagUpdateResponse], account_tag, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_update_overload_2(self, async_client: AsyncCloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + await async_client.resource_tagging.account_tags.with_raw_response.update( + account_id="", + resource_id="023e105f4ecef8ad9ca31a8372d0c353", + resource_type="worker", + ) + + @parametrize + async def test_method_delete(self, async_client: AsyncCloudflare) -> None: + account_tag = await async_client.resource_tagging.account_tags.delete( + account_id="023e105f4ecef8ad9ca31a8372d0c353", + ) + assert account_tag is None + + @parametrize + async def test_method_delete_with_all_params(self, async_client: AsyncCloudflare) -> None: + account_tag = await async_client.resource_tagging.account_tags.delete( + account_id="023e105f4ecef8ad9ca31a8372d0c353", + if_match='"v1:RBNvo1WzZ4oRRq0W9-hkng"', + ) + assert account_tag is None + + @parametrize + async def test_raw_response_delete(self, async_client: AsyncCloudflare) -> None: + response = await async_client.resource_tagging.account_tags.with_raw_response.delete( + account_id="023e105f4ecef8ad9ca31a8372d0c353", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + account_tag = await response.parse() + assert account_tag is None + + @parametrize + async def test_streaming_response_delete(self, async_client: AsyncCloudflare) -> None: + async with async_client.resource_tagging.account_tags.with_streaming_response.delete( + account_id="023e105f4ecef8ad9ca31a8372d0c353", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + account_tag = await response.parse() + assert account_tag is None + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_delete(self, async_client: AsyncCloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + await async_client.resource_tagging.account_tags.with_raw_response.delete( + account_id="", + ) + + @parametrize + async def test_method_get(self, async_client: AsyncCloudflare) -> None: + account_tag = await async_client.resource_tagging.account_tags.get( + account_id="023e105f4ecef8ad9ca31a8372d0c353", + resource_id="023e105f4ecef8ad9ca31a8372d0c353", + resource_type="worker", + ) + assert_matches_type(Optional[AccountTagGetResponse], account_tag, path=["response"]) + + @parametrize + async def test_method_get_with_all_params(self, async_client: AsyncCloudflare) -> None: + account_tag = await async_client.resource_tagging.account_tags.get( + account_id="023e105f4ecef8ad9ca31a8372d0c353", + resource_id="023e105f4ecef8ad9ca31a8372d0c353", + resource_type="worker", + worker_id="3f72a691-44b3-4c11-8642-c18a88ddaa5e", + ) + assert_matches_type(Optional[AccountTagGetResponse], account_tag, path=["response"]) + + @parametrize + async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: + response = await async_client.resource_tagging.account_tags.with_raw_response.get( + account_id="023e105f4ecef8ad9ca31a8372d0c353", + resource_id="023e105f4ecef8ad9ca31a8372d0c353", + resource_type="worker", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + account_tag = await response.parse() + assert_matches_type(Optional[AccountTagGetResponse], account_tag, path=["response"]) + + @parametrize + async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> None: + async with async_client.resource_tagging.account_tags.with_streaming_response.get( + account_id="023e105f4ecef8ad9ca31a8372d0c353", + resource_id="023e105f4ecef8ad9ca31a8372d0c353", + resource_type="worker", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + account_tag = await response.parse() + assert_matches_type(Optional[AccountTagGetResponse], account_tag, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_get(self, async_client: AsyncCloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + await async_client.resource_tagging.account_tags.with_raw_response.get( + account_id="", + resource_id="023e105f4ecef8ad9ca31a8372d0c353", + resource_type="worker", + ) diff --git a/tests/api_resources/resource_tagging/test_keys.py b/tests/api_resources/resource_tagging/test_keys.py new file mode 100644 index 00000000000..7a819478d39 --- /dev/null +++ b/tests/api_resources/resource_tagging/test_keys.py @@ -0,0 +1,117 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +import os +from typing import Any, cast + +import pytest + +from cloudflare import Cloudflare, AsyncCloudflare +from tests.utils import assert_matches_type +from cloudflare.pagination import SyncCursorPaginationAfter, AsyncCursorPaginationAfter +from cloudflare.types.resource_tagging import KeyListResponse + +base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") + + +class TestKeys: + parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) + + @parametrize + def test_method_list(self, client: Cloudflare) -> None: + key = client.resource_tagging.keys.list( + account_id="023e105f4ecef8ad9ca31a8372d0c353", + ) + assert_matches_type(SyncCursorPaginationAfter[KeyListResponse], key, path=["response"]) + + @parametrize + def test_method_list_with_all_params(self, client: Cloudflare) -> None: + key = client.resource_tagging.keys.list( + account_id="023e105f4ecef8ad9ca31a8372d0c353", + cursor="eyJhY2NvdW50X2lkIjoxMjM0NTY3ODkwfQ", + ) + assert_matches_type(SyncCursorPaginationAfter[KeyListResponse], key, path=["response"]) + + @parametrize + def test_raw_response_list(self, client: Cloudflare) -> None: + response = client.resource_tagging.keys.with_raw_response.list( + account_id="023e105f4ecef8ad9ca31a8372d0c353", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + key = response.parse() + assert_matches_type(SyncCursorPaginationAfter[KeyListResponse], key, path=["response"]) + + @parametrize + def test_streaming_response_list(self, client: Cloudflare) -> None: + with client.resource_tagging.keys.with_streaming_response.list( + account_id="023e105f4ecef8ad9ca31a8372d0c353", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + key = response.parse() + assert_matches_type(SyncCursorPaginationAfter[KeyListResponse], key, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_list(self, client: Cloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + client.resource_tagging.keys.with_raw_response.list( + account_id="", + ) + + +class TestAsyncKeys: + parametrize = pytest.mark.parametrize( + "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"] + ) + + @parametrize + async def test_method_list(self, async_client: AsyncCloudflare) -> None: + key = await async_client.resource_tagging.keys.list( + account_id="023e105f4ecef8ad9ca31a8372d0c353", + ) + assert_matches_type(AsyncCursorPaginationAfter[KeyListResponse], key, path=["response"]) + + @parametrize + async def test_method_list_with_all_params(self, async_client: AsyncCloudflare) -> None: + key = await async_client.resource_tagging.keys.list( + account_id="023e105f4ecef8ad9ca31a8372d0c353", + cursor="eyJhY2NvdW50X2lkIjoxMjM0NTY3ODkwfQ", + ) + assert_matches_type(AsyncCursorPaginationAfter[KeyListResponse], key, path=["response"]) + + @parametrize + async def test_raw_response_list(self, async_client: AsyncCloudflare) -> None: + response = await async_client.resource_tagging.keys.with_raw_response.list( + account_id="023e105f4ecef8ad9ca31a8372d0c353", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + key = await response.parse() + assert_matches_type(AsyncCursorPaginationAfter[KeyListResponse], key, path=["response"]) + + @parametrize + async def test_streaming_response_list(self, async_client: AsyncCloudflare) -> None: + async with async_client.resource_tagging.keys.with_streaming_response.list( + account_id="023e105f4ecef8ad9ca31a8372d0c353", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + key = await response.parse() + assert_matches_type(AsyncCursorPaginationAfter[KeyListResponse], key, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_list(self, async_client: AsyncCloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + await async_client.resource_tagging.keys.with_raw_response.list( + account_id="", + ) diff --git a/tests/api_resources/resource_tagging/test_values.py b/tests/api_resources/resource_tagging/test_values.py new file mode 100644 index 00000000000..0c4669121ec --- /dev/null +++ b/tests/api_resources/resource_tagging/test_values.py @@ -0,0 +1,141 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +import os +from typing import Any, cast + +import pytest + +from cloudflare import Cloudflare, AsyncCloudflare +from tests.utils import assert_matches_type +from cloudflare.pagination import SyncCursorPaginationAfter, AsyncCursorPaginationAfter +from cloudflare.types.resource_tagging import ValueListResponse + +base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") + + +class TestValues: + parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) + + @parametrize + def test_method_list(self, client: Cloudflare) -> None: + value = client.resource_tagging.values.list( + tag_key="environment", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + ) + assert_matches_type(SyncCursorPaginationAfter[ValueListResponse], value, path=["response"]) + + @parametrize + def test_method_list_with_all_params(self, client: Cloudflare) -> None: + value = client.resource_tagging.values.list( + tag_key="environment", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + cursor="eyJhY2NvdW50X2lkIjoxMjM0NTY3ODkwfQ", + type="zone", + ) + assert_matches_type(SyncCursorPaginationAfter[ValueListResponse], value, path=["response"]) + + @parametrize + def test_raw_response_list(self, client: Cloudflare) -> None: + response = client.resource_tagging.values.with_raw_response.list( + tag_key="environment", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + value = response.parse() + assert_matches_type(SyncCursorPaginationAfter[ValueListResponse], value, path=["response"]) + + @parametrize + def test_streaming_response_list(self, client: Cloudflare) -> None: + with client.resource_tagging.values.with_streaming_response.list( + tag_key="environment", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + value = response.parse() + assert_matches_type(SyncCursorPaginationAfter[ValueListResponse], value, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_list(self, client: Cloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + client.resource_tagging.values.with_raw_response.list( + tag_key="environment", + account_id="", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `tag_key` but received ''"): + client.resource_tagging.values.with_raw_response.list( + tag_key="", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + ) + + +class TestAsyncValues: + parametrize = pytest.mark.parametrize( + "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"] + ) + + @parametrize + async def test_method_list(self, async_client: AsyncCloudflare) -> None: + value = await async_client.resource_tagging.values.list( + tag_key="environment", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + ) + assert_matches_type(AsyncCursorPaginationAfter[ValueListResponse], value, path=["response"]) + + @parametrize + async def test_method_list_with_all_params(self, async_client: AsyncCloudflare) -> None: + value = await async_client.resource_tagging.values.list( + tag_key="environment", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + cursor="eyJhY2NvdW50X2lkIjoxMjM0NTY3ODkwfQ", + type="zone", + ) + assert_matches_type(AsyncCursorPaginationAfter[ValueListResponse], value, path=["response"]) + + @parametrize + async def test_raw_response_list(self, async_client: AsyncCloudflare) -> None: + response = await async_client.resource_tagging.values.with_raw_response.list( + tag_key="environment", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + value = await response.parse() + assert_matches_type(AsyncCursorPaginationAfter[ValueListResponse], value, path=["response"]) + + @parametrize + async def test_streaming_response_list(self, async_client: AsyncCloudflare) -> None: + async with async_client.resource_tagging.values.with_streaming_response.list( + tag_key="environment", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + value = await response.parse() + assert_matches_type(AsyncCursorPaginationAfter[ValueListResponse], value, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_list(self, async_client: AsyncCloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + await async_client.resource_tagging.values.with_raw_response.list( + tag_key="environment", + account_id="", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `tag_key` but received ''"): + await async_client.resource_tagging.values.with_raw_response.list( + tag_key="", + account_id="023e105f4ecef8ad9ca31a8372d0c353", + ) diff --git a/tests/api_resources/resource_tagging/test_zone_tags.py b/tests/api_resources/resource_tagging/test_zone_tags.py new file mode 100644 index 00000000000..d180a0f7005 --- /dev/null +++ b/tests/api_resources/resource_tagging/test_zone_tags.py @@ -0,0 +1,481 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +import os +from typing import Any, Optional, cast + +import pytest + +from cloudflare import Cloudflare, AsyncCloudflare +from tests.utils import assert_matches_type +from cloudflare.types.resource_tagging import ( + ZoneTagGetResponse, + ZoneTagUpdateResponse, +) + +base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") + + +class TestZoneTags: + parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) + + @parametrize + def test_method_update_overload_1(self, client: Cloudflare) -> None: + zone_tag = client.resource_tagging.zone_tags.update( + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + resource_id="023e105f4ecef8ad9ca31a8372d0c353", + resource_type="zone", + ) + assert_matches_type(Optional[ZoneTagUpdateResponse], zone_tag, path=["response"]) + + @parametrize + def test_method_update_with_all_params_overload_1(self, client: Cloudflare) -> None: + zone_tag = client.resource_tagging.zone_tags.update( + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + resource_id="023e105f4ecef8ad9ca31a8372d0c353", + resource_type="zone", + tags={ + "environment": "production", + "team": "engineering", + }, + if_match='"v1:RBNvo1WzZ4oRRq0W9-hkng"', + ) + assert_matches_type(Optional[ZoneTagUpdateResponse], zone_tag, path=["response"]) + + @parametrize + def test_raw_response_update_overload_1(self, client: Cloudflare) -> None: + response = client.resource_tagging.zone_tags.with_raw_response.update( + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + resource_id="023e105f4ecef8ad9ca31a8372d0c353", + resource_type="zone", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + zone_tag = response.parse() + assert_matches_type(Optional[ZoneTagUpdateResponse], zone_tag, path=["response"]) + + @parametrize + def test_streaming_response_update_overload_1(self, client: Cloudflare) -> None: + with client.resource_tagging.zone_tags.with_streaming_response.update( + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + resource_id="023e105f4ecef8ad9ca31a8372d0c353", + resource_type="zone", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + zone_tag = response.parse() + assert_matches_type(Optional[ZoneTagUpdateResponse], zone_tag, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_update_overload_1(self, client: Cloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + client.resource_tagging.zone_tags.with_raw_response.update( + zone_id="", + resource_id="023e105f4ecef8ad9ca31a8372d0c353", + resource_type="zone", + ) + + @parametrize + def test_method_update_overload_2(self, client: Cloudflare) -> None: + zone_tag = client.resource_tagging.zone_tags.update( + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + access_application_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", + resource_id="023e105f4ecef8ad9ca31a8372d0c353", + resource_type="zone", + ) + assert_matches_type(Optional[ZoneTagUpdateResponse], zone_tag, path=["response"]) + + @parametrize + def test_method_update_with_all_params_overload_2(self, client: Cloudflare) -> None: + zone_tag = client.resource_tagging.zone_tags.update( + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + access_application_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", + resource_id="023e105f4ecef8ad9ca31a8372d0c353", + resource_type="zone", + tags={ + "environment": "production", + "team": "engineering", + }, + if_match='"v1:RBNvo1WzZ4oRRq0W9-hkng"', + ) + assert_matches_type(Optional[ZoneTagUpdateResponse], zone_tag, path=["response"]) + + @parametrize + def test_raw_response_update_overload_2(self, client: Cloudflare) -> None: + response = client.resource_tagging.zone_tags.with_raw_response.update( + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + access_application_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", + resource_id="023e105f4ecef8ad9ca31a8372d0c353", + resource_type="zone", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + zone_tag = response.parse() + assert_matches_type(Optional[ZoneTagUpdateResponse], zone_tag, path=["response"]) + + @parametrize + def test_streaming_response_update_overload_2(self, client: Cloudflare) -> None: + with client.resource_tagging.zone_tags.with_streaming_response.update( + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + access_application_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", + resource_id="023e105f4ecef8ad9ca31a8372d0c353", + resource_type="zone", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + zone_tag = response.parse() + assert_matches_type(Optional[ZoneTagUpdateResponse], zone_tag, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_update_overload_2(self, client: Cloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + client.resource_tagging.zone_tags.with_raw_response.update( + zone_id="", + access_application_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", + resource_id="023e105f4ecef8ad9ca31a8372d0c353", + resource_type="zone", + ) + + @parametrize + def test_method_delete(self, client: Cloudflare) -> None: + zone_tag = client.resource_tagging.zone_tags.delete( + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + ) + assert zone_tag is None + + @parametrize + def test_method_delete_with_all_params(self, client: Cloudflare) -> None: + zone_tag = client.resource_tagging.zone_tags.delete( + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + if_match='"v1:RBNvo1WzZ4oRRq0W9-hkng"', + ) + assert zone_tag is None + + @parametrize + def test_raw_response_delete(self, client: Cloudflare) -> None: + response = client.resource_tagging.zone_tags.with_raw_response.delete( + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + zone_tag = response.parse() + assert zone_tag is None + + @parametrize + def test_streaming_response_delete(self, client: Cloudflare) -> None: + with client.resource_tagging.zone_tags.with_streaming_response.delete( + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + zone_tag = response.parse() + assert zone_tag is None + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_delete(self, client: Cloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + client.resource_tagging.zone_tags.with_raw_response.delete( + zone_id="", + ) + + @parametrize + def test_method_get(self, client: Cloudflare) -> None: + zone_tag = client.resource_tagging.zone_tags.get( + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + resource_id="023e105f4ecef8ad9ca31a8372d0c353", + resource_type="zone", + ) + assert_matches_type(Optional[ZoneTagGetResponse], zone_tag, path=["response"]) + + @parametrize + def test_method_get_with_all_params(self, client: Cloudflare) -> None: + zone_tag = client.resource_tagging.zone_tags.get( + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + resource_id="023e105f4ecef8ad9ca31a8372d0c353", + resource_type="zone", + access_application_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", + ) + assert_matches_type(Optional[ZoneTagGetResponse], zone_tag, path=["response"]) + + @parametrize + def test_raw_response_get(self, client: Cloudflare) -> None: + response = client.resource_tagging.zone_tags.with_raw_response.get( + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + resource_id="023e105f4ecef8ad9ca31a8372d0c353", + resource_type="zone", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + zone_tag = response.parse() + assert_matches_type(Optional[ZoneTagGetResponse], zone_tag, path=["response"]) + + @parametrize + def test_streaming_response_get(self, client: Cloudflare) -> None: + with client.resource_tagging.zone_tags.with_streaming_response.get( + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + resource_id="023e105f4ecef8ad9ca31a8372d0c353", + resource_type="zone", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + zone_tag = response.parse() + assert_matches_type(Optional[ZoneTagGetResponse], zone_tag, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_get(self, client: Cloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + client.resource_tagging.zone_tags.with_raw_response.get( + zone_id="", + resource_id="023e105f4ecef8ad9ca31a8372d0c353", + resource_type="zone", + ) + + +class TestAsyncZoneTags: + parametrize = pytest.mark.parametrize( + "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"] + ) + + @parametrize + async def test_method_update_overload_1(self, async_client: AsyncCloudflare) -> None: + zone_tag = await async_client.resource_tagging.zone_tags.update( + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + resource_id="023e105f4ecef8ad9ca31a8372d0c353", + resource_type="zone", + ) + assert_matches_type(Optional[ZoneTagUpdateResponse], zone_tag, path=["response"]) + + @parametrize + async def test_method_update_with_all_params_overload_1(self, async_client: AsyncCloudflare) -> None: + zone_tag = await async_client.resource_tagging.zone_tags.update( + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + resource_id="023e105f4ecef8ad9ca31a8372d0c353", + resource_type="zone", + tags={ + "environment": "production", + "team": "engineering", + }, + if_match='"v1:RBNvo1WzZ4oRRq0W9-hkng"', + ) + assert_matches_type(Optional[ZoneTagUpdateResponse], zone_tag, path=["response"]) + + @parametrize + async def test_raw_response_update_overload_1(self, async_client: AsyncCloudflare) -> None: + response = await async_client.resource_tagging.zone_tags.with_raw_response.update( + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + resource_id="023e105f4ecef8ad9ca31a8372d0c353", + resource_type="zone", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + zone_tag = await response.parse() + assert_matches_type(Optional[ZoneTagUpdateResponse], zone_tag, path=["response"]) + + @parametrize + async def test_streaming_response_update_overload_1(self, async_client: AsyncCloudflare) -> None: + async with async_client.resource_tagging.zone_tags.with_streaming_response.update( + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + resource_id="023e105f4ecef8ad9ca31a8372d0c353", + resource_type="zone", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + zone_tag = await response.parse() + assert_matches_type(Optional[ZoneTagUpdateResponse], zone_tag, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_update_overload_1(self, async_client: AsyncCloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + await async_client.resource_tagging.zone_tags.with_raw_response.update( + zone_id="", + resource_id="023e105f4ecef8ad9ca31a8372d0c353", + resource_type="zone", + ) + + @parametrize + async def test_method_update_overload_2(self, async_client: AsyncCloudflare) -> None: + zone_tag = await async_client.resource_tagging.zone_tags.update( + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + access_application_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", + resource_id="023e105f4ecef8ad9ca31a8372d0c353", + resource_type="zone", + ) + assert_matches_type(Optional[ZoneTagUpdateResponse], zone_tag, path=["response"]) + + @parametrize + async def test_method_update_with_all_params_overload_2(self, async_client: AsyncCloudflare) -> None: + zone_tag = await async_client.resource_tagging.zone_tags.update( + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + access_application_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", + resource_id="023e105f4ecef8ad9ca31a8372d0c353", + resource_type="zone", + tags={ + "environment": "production", + "team": "engineering", + }, + if_match='"v1:RBNvo1WzZ4oRRq0W9-hkng"', + ) + assert_matches_type(Optional[ZoneTagUpdateResponse], zone_tag, path=["response"]) + + @parametrize + async def test_raw_response_update_overload_2(self, async_client: AsyncCloudflare) -> None: + response = await async_client.resource_tagging.zone_tags.with_raw_response.update( + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + access_application_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", + resource_id="023e105f4ecef8ad9ca31a8372d0c353", + resource_type="zone", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + zone_tag = await response.parse() + assert_matches_type(Optional[ZoneTagUpdateResponse], zone_tag, path=["response"]) + + @parametrize + async def test_streaming_response_update_overload_2(self, async_client: AsyncCloudflare) -> None: + async with async_client.resource_tagging.zone_tags.with_streaming_response.update( + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + access_application_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", + resource_id="023e105f4ecef8ad9ca31a8372d0c353", + resource_type="zone", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + zone_tag = await response.parse() + assert_matches_type(Optional[ZoneTagUpdateResponse], zone_tag, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_update_overload_2(self, async_client: AsyncCloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + await async_client.resource_tagging.zone_tags.with_raw_response.update( + zone_id="", + access_application_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", + resource_id="023e105f4ecef8ad9ca31a8372d0c353", + resource_type="zone", + ) + + @parametrize + async def test_method_delete(self, async_client: AsyncCloudflare) -> None: + zone_tag = await async_client.resource_tagging.zone_tags.delete( + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + ) + assert zone_tag is None + + @parametrize + async def test_method_delete_with_all_params(self, async_client: AsyncCloudflare) -> None: + zone_tag = await async_client.resource_tagging.zone_tags.delete( + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + if_match='"v1:RBNvo1WzZ4oRRq0W9-hkng"', + ) + assert zone_tag is None + + @parametrize + async def test_raw_response_delete(self, async_client: AsyncCloudflare) -> None: + response = await async_client.resource_tagging.zone_tags.with_raw_response.delete( + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + zone_tag = await response.parse() + assert zone_tag is None + + @parametrize + async def test_streaming_response_delete(self, async_client: AsyncCloudflare) -> None: + async with async_client.resource_tagging.zone_tags.with_streaming_response.delete( + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + zone_tag = await response.parse() + assert zone_tag is None + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_delete(self, async_client: AsyncCloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + await async_client.resource_tagging.zone_tags.with_raw_response.delete( + zone_id="", + ) + + @parametrize + async def test_method_get(self, async_client: AsyncCloudflare) -> None: + zone_tag = await async_client.resource_tagging.zone_tags.get( + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + resource_id="023e105f4ecef8ad9ca31a8372d0c353", + resource_type="zone", + ) + assert_matches_type(Optional[ZoneTagGetResponse], zone_tag, path=["response"]) + + @parametrize + async def test_method_get_with_all_params(self, async_client: AsyncCloudflare) -> None: + zone_tag = await async_client.resource_tagging.zone_tags.get( + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + resource_id="023e105f4ecef8ad9ca31a8372d0c353", + resource_type="zone", + access_application_id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", + ) + assert_matches_type(Optional[ZoneTagGetResponse], zone_tag, path=["response"]) + + @parametrize + async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: + response = await async_client.resource_tagging.zone_tags.with_raw_response.get( + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + resource_id="023e105f4ecef8ad9ca31a8372d0c353", + resource_type="zone", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + zone_tag = await response.parse() + assert_matches_type(Optional[ZoneTagGetResponse], zone_tag, path=["response"]) + + @parametrize + async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> None: + async with async_client.resource_tagging.zone_tags.with_streaming_response.get( + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + resource_id="023e105f4ecef8ad9ca31a8372d0c353", + resource_type="zone", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + zone_tag = await response.parse() + assert_matches_type(Optional[ZoneTagGetResponse], zone_tag, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_get(self, async_client: AsyncCloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + await async_client.resource_tagging.zone_tags.with_raw_response.get( + zone_id="", + resource_id="023e105f4ecef8ad9ca31a8372d0c353", + resource_type="zone", + ) diff --git a/tests/api_resources/test_resource_tagging.py b/tests/api_resources/test_resource_tagging.py new file mode 100644 index 00000000000..99205e2eed2 --- /dev/null +++ b/tests/api_resources/test_resource_tagging.py @@ -0,0 +1,131 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +import os +from typing import Any, cast + +import pytest + +from cloudflare import Cloudflare, AsyncCloudflare +from tests.utils import assert_matches_type +from cloudflare.pagination import SyncCursorPaginationAfter, AsyncCursorPaginationAfter +from cloudflare.types.resource_tagging import ResourceTaggingListResponse + +base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") + + +class TestResourceTagging: + parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) + + @parametrize + def test_method_list(self, client: Cloudflare) -> None: + resource_tagging = client.resource_tagging.list( + account_id="023e105f4ecef8ad9ca31a8372d0c353", + ) + assert_matches_type(SyncCursorPaginationAfter[ResourceTaggingListResponse], resource_tagging, path=["response"]) + + @parametrize + def test_method_list_with_all_params(self, client: Cloudflare) -> None: + resource_tagging = client.resource_tagging.list( + account_id="023e105f4ecef8ad9ca31a8372d0c353", + cursor="eyJhY2NvdW50X2lkIjoxMjM0NTY3ODkwfQ", + tag=["production", "env=prod", "env=prod,staging", "!archived", "region!=us-west-1"], + type=["zone"], + ) + assert_matches_type(SyncCursorPaginationAfter[ResourceTaggingListResponse], resource_tagging, path=["response"]) + + @parametrize + def test_raw_response_list(self, client: Cloudflare) -> None: + response = client.resource_tagging.with_raw_response.list( + account_id="023e105f4ecef8ad9ca31a8372d0c353", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + resource_tagging = response.parse() + assert_matches_type(SyncCursorPaginationAfter[ResourceTaggingListResponse], resource_tagging, path=["response"]) + + @parametrize + def test_streaming_response_list(self, client: Cloudflare) -> None: + with client.resource_tagging.with_streaming_response.list( + account_id="023e105f4ecef8ad9ca31a8372d0c353", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + resource_tagging = response.parse() + assert_matches_type( + SyncCursorPaginationAfter[ResourceTaggingListResponse], resource_tagging, path=["response"] + ) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_list(self, client: Cloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + client.resource_tagging.with_raw_response.list( + account_id="", + ) + + +class TestAsyncResourceTagging: + parametrize = pytest.mark.parametrize( + "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"] + ) + + @parametrize + async def test_method_list(self, async_client: AsyncCloudflare) -> None: + resource_tagging = await async_client.resource_tagging.list( + account_id="023e105f4ecef8ad9ca31a8372d0c353", + ) + assert_matches_type( + AsyncCursorPaginationAfter[ResourceTaggingListResponse], resource_tagging, path=["response"] + ) + + @parametrize + async def test_method_list_with_all_params(self, async_client: AsyncCloudflare) -> None: + resource_tagging = await async_client.resource_tagging.list( + account_id="023e105f4ecef8ad9ca31a8372d0c353", + cursor="eyJhY2NvdW50X2lkIjoxMjM0NTY3ODkwfQ", + tag=["production", "env=prod", "env=prod,staging", "!archived", "region!=us-west-1"], + type=["zone"], + ) + assert_matches_type( + AsyncCursorPaginationAfter[ResourceTaggingListResponse], resource_tagging, path=["response"] + ) + + @parametrize + async def test_raw_response_list(self, async_client: AsyncCloudflare) -> None: + response = await async_client.resource_tagging.with_raw_response.list( + account_id="023e105f4ecef8ad9ca31a8372d0c353", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + resource_tagging = await response.parse() + assert_matches_type( + AsyncCursorPaginationAfter[ResourceTaggingListResponse], resource_tagging, path=["response"] + ) + + @parametrize + async def test_streaming_response_list(self, async_client: AsyncCloudflare) -> None: + async with async_client.resource_tagging.with_streaming_response.list( + account_id="023e105f4ecef8ad9ca31a8372d0c353", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + resource_tagging = await response.parse() + assert_matches_type( + AsyncCursorPaginationAfter[ResourceTaggingListResponse], resource_tagging, path=["response"] + ) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_list(self, async_client: AsyncCloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + await async_client.resource_tagging.with_raw_response.list( + account_id="", + ) From 160c7be3b3123ce5e18d4a6526c013ea960e277d Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 6 Mar 2026 06:08:30 +0000 Subject: [PATCH 058/279] chore(api): update composite API spec --- .stats.yml | 4 ++-- .../types/zero_trust/dex/command_create_params.py | 8 +++++++- .../types/zero_trust/dex/command_create_response.py | 3 +++ .../types/zero_trust/dex/command_list_response.py | 3 +++ .../types/zero_trust/dex/commands/device_list_response.py | 7 +++++++ 5 files changed, 22 insertions(+), 3 deletions(-) diff --git a/.stats.yml b/.stats.yml index f8d714a9ebd..548d6b88a5e 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 2058 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-27d7c57107c9203d814f63f6686c63b76aadb365ce0ee0549dfb214f40db12ef.yml -openapi_spec_hash: f46a7fc30fe001095a2b484fb6ada3e9 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-68ec7ac2968ba982c1ab2f396af7047a904c7f628b5dd0affd9fff1f99396342.yml +openapi_spec_hash: 1c7fb37a4269d8e21c9b66d01e5a01ad config_hash: b78af95529f71a3da2339b6fd717ed86 diff --git a/src/cloudflare/types/zero_trust/dex/command_create_params.py b/src/cloudflare/types/zero_trust/dex/command_create_params.py index cbab76ab1c1..a118d017e6d 100644 --- a/src/cloudflare/types/zero_trust/dex/command_create_params.py +++ b/src/cloudflare/types/zero_trust/dex/command_create_params.py @@ -49,9 +49,15 @@ class Command(TypedDict, total=False): """Type of command to execute on the device""" device_id: Required[str] - """Unique identifier for the device""" + """Unique identifier for the physical device""" user_email: Required[str] """Email tied to the device""" command_args: CommandCommandArgs + + registration_id: str + """Unique identifier for the device registration. + + Required for multi-user devices to target the correct user session. + """ diff --git a/src/cloudflare/types/zero_trust/dex/command_create_response.py b/src/cloudflare/types/zero_trust/dex/command_create_response.py index e3a1e432678..c6f8c7b516b 100644 --- a/src/cloudflare/types/zero_trust/dex/command_create_response.py +++ b/src/cloudflare/types/zero_trust/dex/command_create_response.py @@ -18,6 +18,9 @@ class Command(BaseModel): device_id: Optional[str] = None """Identifier for the device associated with the command""" + registration_id: Optional[str] = None + """Unique identifier for the device registration""" + status: Optional[Literal["PENDING_EXEC", "PENDING_UPLOAD", "SUCCESS", "FAILED"]] = None """Current status of the command""" diff --git a/src/cloudflare/types/zero_trust/dex/command_list_response.py b/src/cloudflare/types/zero_trust/dex/command_list_response.py index 601cef906ce..e74ff3665ed 100644 --- a/src/cloudflare/types/zero_trust/dex/command_list_response.py +++ b/src/cloudflare/types/zero_trust/dex/command_list_response.py @@ -19,6 +19,9 @@ class Command(BaseModel): filename: Optional[str] = None + registration_id: Optional[str] = None + """Unique identifier for the device registration""" + status: Optional[str] = None type: Optional[str] = None diff --git a/src/cloudflare/types/zero_trust/dex/commands/device_list_response.py b/src/cloudflare/types/zero_trust/dex/commands/device_list_response.py index 0e85164ecb0..26000944013 100644 --- a/src/cloudflare/types/zero_trust/dex/commands/device_list_response.py +++ b/src/cloudflare/types/zero_trust/dex/commands/device_list_response.py @@ -28,6 +28,13 @@ class Device(BaseModel): platform: Optional[str] = None """Operating system""" + registration_id: Optional[str] = FieldInfo(alias="registrationId", default=None) + """Device registration identifier (UUID v4). + + On multi-user devices, this uniquely identifies a user's registration on the + device. + """ + status: Optional[str] = None """Network status""" From 1c6ee6329d8c2e772f7e1d9199a9f386cfcd7590 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 6 Mar 2026 14:52:27 +0000 Subject: [PATCH 059/279] chore(api): update composite API spec --- .stats.yml | 6 +- api.md | 12 - .../resources/aisearch/instances/__init__.py | 14 -- .../resources/aisearch/instances/instances.py | 32 --- .../resources/aisearch/instances/items.py | 212 ------------------ .../types/aisearch/instance_create_params.py | 17 +- .../aisearch/instance_create_response.py | 17 +- .../aisearch/instance_delete_response.py | 17 +- .../types/aisearch/instance_list_response.py | 17 +- .../types/aisearch/instance_read_response.py | 17 +- .../types/aisearch/instance_update_params.py | 17 +- .../aisearch/instance_update_response.py | 17 +- .../types/aisearch/instances/__init__.py | 2 - .../aisearch/instances/item_list_params.py | 19 -- .../aisearch/instances/item_list_response.py | 35 --- .../types/logpush/output_options.py | 6 +- .../types/logpush/output_options_param.py | 6 +- .../aisearch/instances/test_items.py | 145 ------------ .../api_resources/aisearch/test_instances.py | 28 +++ 19 files changed, 149 insertions(+), 487 deletions(-) delete mode 100644 src/cloudflare/resources/aisearch/instances/items.py delete mode 100644 src/cloudflare/types/aisearch/instances/item_list_params.py delete mode 100644 src/cloudflare/types/aisearch/instances/item_list_response.py delete mode 100644 tests/api_resources/aisearch/instances/test_items.py diff --git a/.stats.yml b/.stats.yml index 548d6b88a5e..746a64c2f80 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ -configured_endpoints: 2058 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-68ec7ac2968ba982c1ab2f396af7047a904c7f628b5dd0affd9fff1f99396342.yml -openapi_spec_hash: 1c7fb37a4269d8e21c9b66d01e5a01ad +configured_endpoints: 2057 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-a531b799897a2903f62ece8f506cbbf9dd157373469af4e3d868544783eb92a0.yml +openapi_spec_hash: 10c604337dfdbf74ed0a68d07cc9625e config_hash: b78af95529f71a3da2339b6fd717ed86 diff --git a/api.md b/api.md index ec569c47ec4..dc970af1a71 100644 --- a/api.md +++ b/api.md @@ -10844,18 +10844,6 @@ Methods: - client.aisearch.instances.search(id, \*, account_id, \*\*params) -> InstanceSearchResponse - client.aisearch.instances.stats(id, \*, account_id) -> InstanceStatsResponse -### Items - -Types: - -```python -from cloudflare.types.aisearch.instances import ItemListResponse -``` - -Methods: - -- client.aisearch.instances.items.list(id, \*, account_id, \*\*params) -> SyncV4PagePaginationArray[ItemListResponse] - ### Jobs Types: diff --git a/src/cloudflare/resources/aisearch/instances/__init__.py b/src/cloudflare/resources/aisearch/instances/__init__.py index bcd3fe82f43..f07262e470e 100644 --- a/src/cloudflare/resources/aisearch/instances/__init__.py +++ b/src/cloudflare/resources/aisearch/instances/__init__.py @@ -8,14 +8,6 @@ JobsResourceWithStreamingResponse, AsyncJobsResourceWithStreamingResponse, ) -from .items import ( - ItemsResource, - AsyncItemsResource, - ItemsResourceWithRawResponse, - AsyncItemsResourceWithRawResponse, - ItemsResourceWithStreamingResponse, - AsyncItemsResourceWithStreamingResponse, -) from .instances import ( InstancesResource, AsyncInstancesResource, @@ -26,12 +18,6 @@ ) __all__ = [ - "ItemsResource", - "AsyncItemsResource", - "ItemsResourceWithRawResponse", - "AsyncItemsResourceWithRawResponse", - "ItemsResourceWithStreamingResponse", - "AsyncItemsResourceWithStreamingResponse", "JobsResource", "AsyncJobsResource", "JobsResourceWithRawResponse", diff --git a/src/cloudflare/resources/aisearch/instances/instances.py b/src/cloudflare/resources/aisearch/instances/instances.py index a6eb75d2b48..4c7637ead72 100644 --- a/src/cloudflare/resources/aisearch/instances/instances.py +++ b/src/cloudflare/resources/aisearch/instances/instances.py @@ -15,14 +15,6 @@ JobsResourceWithStreamingResponse, AsyncJobsResourceWithStreamingResponse, ) -from .items import ( - ItemsResource, - AsyncItemsResource, - ItemsResourceWithRawResponse, - AsyncItemsResourceWithRawResponse, - ItemsResourceWithStreamingResponse, - AsyncItemsResourceWithStreamingResponse, -) from ...._types import Body, Omit, Query, Headers, NotGiven, omit, not_given from ...._utils import maybe_transform, async_maybe_transform from ...._compat import cached_property @@ -56,10 +48,6 @@ class InstancesResource(SyncAPIResource): - @cached_property - def items(self) -> ItemsResource: - return ItemsResource(self._client) - @cached_property def jobs(self) -> JobsResource: return JobsResource(self._client) @@ -772,10 +760,6 @@ def stats( class AsyncInstancesResource(AsyncAPIResource): - @cached_property - def items(self) -> AsyncItemsResource: - return AsyncItemsResource(self._client) - @cached_property def jobs(self) -> AsyncJobsResource: return AsyncJobsResource(self._client) @@ -1516,10 +1500,6 @@ def __init__(self, instances: InstancesResource) -> None: instances.stats, ) - @cached_property - def items(self) -> ItemsResourceWithRawResponse: - return ItemsResourceWithRawResponse(self._instances.items) - @cached_property def jobs(self) -> JobsResourceWithRawResponse: return JobsResourceWithRawResponse(self._instances.jobs) @@ -1554,10 +1534,6 @@ def __init__(self, instances: AsyncInstancesResource) -> None: instances.stats, ) - @cached_property - def items(self) -> AsyncItemsResourceWithRawResponse: - return AsyncItemsResourceWithRawResponse(self._instances.items) - @cached_property def jobs(self) -> AsyncJobsResourceWithRawResponse: return AsyncJobsResourceWithRawResponse(self._instances.jobs) @@ -1592,10 +1568,6 @@ def __init__(self, instances: InstancesResource) -> None: instances.stats, ) - @cached_property - def items(self) -> ItemsResourceWithStreamingResponse: - return ItemsResourceWithStreamingResponse(self._instances.items) - @cached_property def jobs(self) -> JobsResourceWithStreamingResponse: return JobsResourceWithStreamingResponse(self._instances.jobs) @@ -1630,10 +1602,6 @@ def __init__(self, instances: AsyncInstancesResource) -> None: instances.stats, ) - @cached_property - def items(self) -> AsyncItemsResourceWithStreamingResponse: - return AsyncItemsResourceWithStreamingResponse(self._instances.items) - @cached_property def jobs(self) -> AsyncJobsResourceWithStreamingResponse: return AsyncJobsResourceWithStreamingResponse(self._instances.jobs) diff --git a/src/cloudflare/resources/aisearch/instances/items.py b/src/cloudflare/resources/aisearch/instances/items.py deleted file mode 100644 index 52f24c2ecec..00000000000 --- a/src/cloudflare/resources/aisearch/instances/items.py +++ /dev/null @@ -1,212 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing_extensions import Literal - -import httpx - -from ...._types import Body, Omit, Query, Headers, NotGiven, omit, not_given -from ...._utils import maybe_transform -from ...._compat import cached_property -from ...._resource import SyncAPIResource, AsyncAPIResource -from ...._response import ( - to_raw_response_wrapper, - to_streamed_response_wrapper, - async_to_raw_response_wrapper, - async_to_streamed_response_wrapper, -) -from ....pagination import SyncV4PagePaginationArray, AsyncV4PagePaginationArray -from ...._base_client import AsyncPaginator, make_request_options -from ....types.aisearch.instances import item_list_params -from ....types.aisearch.instances.item_list_response import ItemListResponse - -__all__ = ["ItemsResource", "AsyncItemsResource"] - - -class ItemsResource(SyncAPIResource): - @cached_property - def with_raw_response(self) -> ItemsResourceWithRawResponse: - """ - This property can be used as a prefix for any HTTP method call to return - the raw response object instead of the parsed content. - - For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers - """ - return ItemsResourceWithRawResponse(self) - - @cached_property - def with_streaming_response(self) -> ItemsResourceWithStreamingResponse: - """ - An alternative to `.with_raw_response` that doesn't eagerly read the response body. - - For more information, see https://www.github.com/cloudflare/cloudflare-python#with_streaming_response - """ - return ItemsResourceWithStreamingResponse(self) - - def list( - self, - id: str, - *, - account_id: str, - page: int | Omit = omit, - per_page: int | Omit = omit, - search: str | Omit = omit, - status: Literal["queued", "running", "completed", "error", "skipped"] | 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, - ) -> SyncV4PagePaginationArray[ItemListResponse]: - """ - Lists indexed items in an AI Search instance. - - Args: - id: Use your AI Search ID. - - 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 id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._get_api_list( - f"/accounts/{account_id}/ai-search/instances/{id}/items", - page=SyncV4PagePaginationArray[ItemListResponse], - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - query=maybe_transform( - { - "page": page, - "per_page": per_page, - "search": search, - "status": status, - }, - item_list_params.ItemListParams, - ), - ), - model=ItemListResponse, - ) - - -class AsyncItemsResource(AsyncAPIResource): - @cached_property - def with_raw_response(self) -> AsyncItemsResourceWithRawResponse: - """ - This property can be used as a prefix for any HTTP method call to return - the raw response object instead of the parsed content. - - For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers - """ - return AsyncItemsResourceWithRawResponse(self) - - @cached_property - def with_streaming_response(self) -> AsyncItemsResourceWithStreamingResponse: - """ - An alternative to `.with_raw_response` that doesn't eagerly read the response body. - - For more information, see https://www.github.com/cloudflare/cloudflare-python#with_streaming_response - """ - return AsyncItemsResourceWithStreamingResponse(self) - - def list( - self, - id: str, - *, - account_id: str, - page: int | Omit = omit, - per_page: int | Omit = omit, - search: str | Omit = omit, - status: Literal["queued", "running", "completed", "error", "skipped"] | 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, - ) -> AsyncPaginator[ItemListResponse, AsyncV4PagePaginationArray[ItemListResponse]]: - """ - Lists indexed items in an AI Search instance. - - Args: - id: Use your AI Search ID. - - 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 id: - raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") - return self._get_api_list( - f"/accounts/{account_id}/ai-search/instances/{id}/items", - page=AsyncV4PagePaginationArray[ItemListResponse], - options=make_request_options( - extra_headers=extra_headers, - extra_query=extra_query, - extra_body=extra_body, - timeout=timeout, - query=maybe_transform( - { - "page": page, - "per_page": per_page, - "search": search, - "status": status, - }, - item_list_params.ItemListParams, - ), - ), - model=ItemListResponse, - ) - - -class ItemsResourceWithRawResponse: - def __init__(self, items: ItemsResource) -> None: - self._items = items - - self.list = to_raw_response_wrapper( - items.list, - ) - - -class AsyncItemsResourceWithRawResponse: - def __init__(self, items: AsyncItemsResource) -> None: - self._items = items - - self.list = async_to_raw_response_wrapper( - items.list, - ) - - -class ItemsResourceWithStreamingResponse: - def __init__(self, items: ItemsResource) -> None: - self._items = items - - self.list = to_streamed_response_wrapper( - items.list, - ) - - -class AsyncItemsResourceWithStreamingResponse: - def __init__(self, items: AsyncItemsResource) -> None: - self._items = items - - self.list = async_to_streamed_response_wrapper( - items.list, - ) diff --git a/src/cloudflare/types/aisearch/instance_create_params.py b/src/cloudflare/types/aisearch/instance_create_params.py index ed3f9e19263..b03f9c22edb 100644 --- a/src/cloudflare/types/aisearch/instance_create_params.py +++ b/src/cloudflare/types/aisearch/instance_create_params.py @@ -22,6 +22,7 @@ "RetrievalOptionsBoostBy", "SourceParams", "SourceParamsWebCrawler", + "SourceParamsWebCrawlerCrawlOptions", "SourceParamsWebCrawlerParseOptions", "SourceParamsWebCrawlerParseOptionsContentSelector", "SourceParamsWebCrawlerStoreOptions", @@ -240,6 +241,18 @@ class RetrievalOptions(TypedDict, total=False): """ +class SourceParamsWebCrawlerCrawlOptions(TypedDict, total=False): + depth: float + + include_external_links: bool + + include_subdomains: bool + + max_age: float + + source: Literal["all", "sitemaps", "links"] + + class SourceParamsWebCrawlerParseOptionsContentSelector(TypedDict, total=False): path: Required[str] """Glob pattern to match against the page URL path. @@ -286,9 +299,11 @@ class SourceParamsWebCrawlerStoreOptions(TypedDict, total=False): class SourceParamsWebCrawler(TypedDict, total=False): + crawl_options: SourceParamsWebCrawlerCrawlOptions + parse_options: SourceParamsWebCrawlerParseOptions - parse_type: Literal["sitemap", "feed-rss"] + parse_type: Literal["sitemap", "feed-rss", "crawl"] store_options: SourceParamsWebCrawlerStoreOptions diff --git a/src/cloudflare/types/aisearch/instance_create_response.py b/src/cloudflare/types/aisearch/instance_create_response.py index 8509a055875..9b87e82e89e 100644 --- a/src/cloudflare/types/aisearch/instance_create_response.py +++ b/src/cloudflare/types/aisearch/instance_create_response.py @@ -22,6 +22,7 @@ "RetrievalOptionsBoostBy", "SourceParams", "SourceParamsWebCrawler", + "SourceParamsWebCrawlerCrawlOptions", "SourceParamsWebCrawlerParseOptions", "SourceParamsWebCrawlerParseOptionsContentSelector", "SourceParamsWebCrawlerStoreOptions", @@ -115,6 +116,18 @@ class RetrievalOptions(BaseModel): """ +class SourceParamsWebCrawlerCrawlOptions(BaseModel): + depth: Optional[float] = None + + include_external_links: Optional[bool] = None + + include_subdomains: Optional[bool] = None + + max_age: Optional[float] = None + + source: Optional[Literal["all", "sitemaps", "links"]] = None + + class SourceParamsWebCrawlerParseOptionsContentSelector(BaseModel): path: str """Glob pattern to match against the page URL path. @@ -161,9 +174,11 @@ class SourceParamsWebCrawlerStoreOptions(BaseModel): class SourceParamsWebCrawler(BaseModel): + crawl_options: Optional[SourceParamsWebCrawlerCrawlOptions] = None + parse_options: Optional[SourceParamsWebCrawlerParseOptions] = None - parse_type: Optional[Literal["sitemap", "feed-rss"]] = None + parse_type: Optional[Literal["sitemap", "feed-rss", "crawl"]] = None store_options: Optional[SourceParamsWebCrawlerStoreOptions] = None diff --git a/src/cloudflare/types/aisearch/instance_delete_response.py b/src/cloudflare/types/aisearch/instance_delete_response.py index b12dd8839ec..652e4062de8 100644 --- a/src/cloudflare/types/aisearch/instance_delete_response.py +++ b/src/cloudflare/types/aisearch/instance_delete_response.py @@ -22,6 +22,7 @@ "RetrievalOptionsBoostBy", "SourceParams", "SourceParamsWebCrawler", + "SourceParamsWebCrawlerCrawlOptions", "SourceParamsWebCrawlerParseOptions", "SourceParamsWebCrawlerParseOptionsContentSelector", "SourceParamsWebCrawlerStoreOptions", @@ -115,6 +116,18 @@ class RetrievalOptions(BaseModel): """ +class SourceParamsWebCrawlerCrawlOptions(BaseModel): + depth: Optional[float] = None + + include_external_links: Optional[bool] = None + + include_subdomains: Optional[bool] = None + + max_age: Optional[float] = None + + source: Optional[Literal["all", "sitemaps", "links"]] = None + + class SourceParamsWebCrawlerParseOptionsContentSelector(BaseModel): path: str """Glob pattern to match against the page URL path. @@ -161,9 +174,11 @@ class SourceParamsWebCrawlerStoreOptions(BaseModel): class SourceParamsWebCrawler(BaseModel): + crawl_options: Optional[SourceParamsWebCrawlerCrawlOptions] = None + parse_options: Optional[SourceParamsWebCrawlerParseOptions] = None - parse_type: Optional[Literal["sitemap", "feed-rss"]] = None + parse_type: Optional[Literal["sitemap", "feed-rss", "crawl"]] = None store_options: Optional[SourceParamsWebCrawlerStoreOptions] = None diff --git a/src/cloudflare/types/aisearch/instance_list_response.py b/src/cloudflare/types/aisearch/instance_list_response.py index 0030fc823f4..cabcc0e33c8 100644 --- a/src/cloudflare/types/aisearch/instance_list_response.py +++ b/src/cloudflare/types/aisearch/instance_list_response.py @@ -22,6 +22,7 @@ "RetrievalOptionsBoostBy", "SourceParams", "SourceParamsWebCrawler", + "SourceParamsWebCrawlerCrawlOptions", "SourceParamsWebCrawlerParseOptions", "SourceParamsWebCrawlerParseOptionsContentSelector", "SourceParamsWebCrawlerStoreOptions", @@ -115,6 +116,18 @@ class RetrievalOptions(BaseModel): """ +class SourceParamsWebCrawlerCrawlOptions(BaseModel): + depth: Optional[float] = None + + include_external_links: Optional[bool] = None + + include_subdomains: Optional[bool] = None + + max_age: Optional[float] = None + + source: Optional[Literal["all", "sitemaps", "links"]] = None + + class SourceParamsWebCrawlerParseOptionsContentSelector(BaseModel): path: str """Glob pattern to match against the page URL path. @@ -161,9 +174,11 @@ class SourceParamsWebCrawlerStoreOptions(BaseModel): class SourceParamsWebCrawler(BaseModel): + crawl_options: Optional[SourceParamsWebCrawlerCrawlOptions] = None + parse_options: Optional[SourceParamsWebCrawlerParseOptions] = None - parse_type: Optional[Literal["sitemap", "feed-rss"]] = None + parse_type: Optional[Literal["sitemap", "feed-rss", "crawl"]] = None store_options: Optional[SourceParamsWebCrawlerStoreOptions] = None diff --git a/src/cloudflare/types/aisearch/instance_read_response.py b/src/cloudflare/types/aisearch/instance_read_response.py index 5168fe0a540..84f5635100c 100644 --- a/src/cloudflare/types/aisearch/instance_read_response.py +++ b/src/cloudflare/types/aisearch/instance_read_response.py @@ -22,6 +22,7 @@ "RetrievalOptionsBoostBy", "SourceParams", "SourceParamsWebCrawler", + "SourceParamsWebCrawlerCrawlOptions", "SourceParamsWebCrawlerParseOptions", "SourceParamsWebCrawlerParseOptionsContentSelector", "SourceParamsWebCrawlerStoreOptions", @@ -115,6 +116,18 @@ class RetrievalOptions(BaseModel): """ +class SourceParamsWebCrawlerCrawlOptions(BaseModel): + depth: Optional[float] = None + + include_external_links: Optional[bool] = None + + include_subdomains: Optional[bool] = None + + max_age: Optional[float] = None + + source: Optional[Literal["all", "sitemaps", "links"]] = None + + class SourceParamsWebCrawlerParseOptionsContentSelector(BaseModel): path: str """Glob pattern to match against the page URL path. @@ -161,9 +174,11 @@ class SourceParamsWebCrawlerStoreOptions(BaseModel): class SourceParamsWebCrawler(BaseModel): + crawl_options: Optional[SourceParamsWebCrawlerCrawlOptions] = None + parse_options: Optional[SourceParamsWebCrawlerParseOptions] = None - parse_type: Optional[Literal["sitemap", "feed-rss"]] = None + parse_type: Optional[Literal["sitemap", "feed-rss", "crawl"]] = None store_options: Optional[SourceParamsWebCrawlerStoreOptions] = None diff --git a/src/cloudflare/types/aisearch/instance_update_params.py b/src/cloudflare/types/aisearch/instance_update_params.py index db2a4100f54..cde5573051d 100644 --- a/src/cloudflare/types/aisearch/instance_update_params.py +++ b/src/cloudflare/types/aisearch/instance_update_params.py @@ -22,6 +22,7 @@ "RetrievalOptionsBoostBy", "SourceParams", "SourceParamsWebCrawler", + "SourceParamsWebCrawlerCrawlOptions", "SourceParamsWebCrawlerParseOptions", "SourceParamsWebCrawlerParseOptionsContentSelector", "SourceParamsWebCrawlerStoreOptions", @@ -274,6 +275,18 @@ class RetrievalOptions(TypedDict, total=False): """ +class SourceParamsWebCrawlerCrawlOptions(TypedDict, total=False): + depth: float + + include_external_links: bool + + include_subdomains: bool + + max_age: float + + source: Literal["all", "sitemaps", "links"] + + class SourceParamsWebCrawlerParseOptionsContentSelector(TypedDict, total=False): path: Required[str] """Glob pattern to match against the page URL path. @@ -320,9 +333,11 @@ class SourceParamsWebCrawlerStoreOptions(TypedDict, total=False): class SourceParamsWebCrawler(TypedDict, total=False): + crawl_options: SourceParamsWebCrawlerCrawlOptions + parse_options: SourceParamsWebCrawlerParseOptions - parse_type: Literal["sitemap", "feed-rss"] + parse_type: Literal["sitemap", "feed-rss", "crawl"] store_options: SourceParamsWebCrawlerStoreOptions diff --git a/src/cloudflare/types/aisearch/instance_update_response.py b/src/cloudflare/types/aisearch/instance_update_response.py index 4ac93b2b86a..f04ceb5b49f 100644 --- a/src/cloudflare/types/aisearch/instance_update_response.py +++ b/src/cloudflare/types/aisearch/instance_update_response.py @@ -22,6 +22,7 @@ "RetrievalOptionsBoostBy", "SourceParams", "SourceParamsWebCrawler", + "SourceParamsWebCrawlerCrawlOptions", "SourceParamsWebCrawlerParseOptions", "SourceParamsWebCrawlerParseOptionsContentSelector", "SourceParamsWebCrawlerStoreOptions", @@ -115,6 +116,18 @@ class RetrievalOptions(BaseModel): """ +class SourceParamsWebCrawlerCrawlOptions(BaseModel): + depth: Optional[float] = None + + include_external_links: Optional[bool] = None + + include_subdomains: Optional[bool] = None + + max_age: Optional[float] = None + + source: Optional[Literal["all", "sitemaps", "links"]] = None + + class SourceParamsWebCrawlerParseOptionsContentSelector(BaseModel): path: str """Glob pattern to match against the page URL path. @@ -161,9 +174,11 @@ class SourceParamsWebCrawlerStoreOptions(BaseModel): class SourceParamsWebCrawler(BaseModel): + crawl_options: Optional[SourceParamsWebCrawlerCrawlOptions] = None + parse_options: Optional[SourceParamsWebCrawlerParseOptions] = None - parse_type: Optional[Literal["sitemap", "feed-rss"]] = None + parse_type: Optional[Literal["sitemap", "feed-rss", "crawl"]] = None store_options: Optional[SourceParamsWebCrawlerStoreOptions] = None diff --git a/src/cloudflare/types/aisearch/instances/__init__.py b/src/cloudflare/types/aisearch/instances/__init__.py index 68c80804a2a..2cad190e384 100644 --- a/src/cloudflare/types/aisearch/instances/__init__.py +++ b/src/cloudflare/types/aisearch/instances/__init__.py @@ -4,10 +4,8 @@ from .job_list_params import JobListParams as JobListParams from .job_logs_params import JobLogsParams as JobLogsParams -from .item_list_params import ItemListParams as ItemListParams from .job_get_response import JobGetResponse as JobGetResponse from .job_create_params import JobCreateParams as JobCreateParams from .job_list_response import JobListResponse as JobListResponse from .job_logs_response import JobLogsResponse as JobLogsResponse -from .item_list_response import ItemListResponse as ItemListResponse from .job_create_response import JobCreateResponse as JobCreateResponse diff --git a/src/cloudflare/types/aisearch/instances/item_list_params.py b/src/cloudflare/types/aisearch/instances/item_list_params.py deleted file mode 100644 index a21050011ba..00000000000 --- a/src/cloudflare/types/aisearch/instances/item_list_params.py +++ /dev/null @@ -1,19 +0,0 @@ -# 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__ = ["ItemListParams"] - - -class ItemListParams(TypedDict, total=False): - account_id: Required[str] - - page: int - - per_page: int - - search: str - - status: Literal["queued", "running", "completed", "error", "skipped"] diff --git a/src/cloudflare/types/aisearch/instances/item_list_response.py b/src/cloudflare/types/aisearch/instances/item_list_response.py deleted file mode 100644 index 5054e8ad74d..00000000000 --- a/src/cloudflare/types/aisearch/instances/item_list_response.py +++ /dev/null @@ -1,35 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Optional -from datetime import datetime -from typing_extensions import Literal - -from ...._models import BaseModel - -__all__ = ["ItemListResponse"] - - -class ItemListResponse(BaseModel): - id: float - - checksum: str - - chunks_count: Optional[int] = None - - created_at: datetime - - file_size: Optional[float] = None - - key: str - - last_seen_at: datetime - - namespace: str - - next_action: Optional[Literal["INDEX", "DELETE"]] = None - - status: Literal["queued", "running", "completed", "error", "skipped"] - - error: Optional[str] = None - - public_id: Optional[str] = None diff --git a/src/cloudflare/types/logpush/output_options.py b/src/cloudflare/types/logpush/output_options.py index e52fed2a7ce..0f1e54223a8 100644 --- a/src/cloudflare/types/logpush/output_options.py +++ b/src/cloudflare/types/logpush/output_options.py @@ -70,8 +70,8 @@ class OutputOptions(BaseModel): `sample_interval` of the data. """ - timestamp_format: Optional[Literal["unixnano", "unix", "rfc3339"]] = None + timestamp_format: Optional[Literal["unixnano", "unix", "rfc3339", "rfc3339nano"]] = None """ - String to specify the format for timestamps, such as `unixnano`, `unix`, or - `rfc3339`. + String to specify the format for timestamps, such as `unixnano`, `unix`, + `rfc3339` or `rfc3339nano`. """ diff --git a/src/cloudflare/types/logpush/output_options_param.py b/src/cloudflare/types/logpush/output_options_param.py index 29db19d9f66..4a069c7db44 100644 --- a/src/cloudflare/types/logpush/output_options_param.py +++ b/src/cloudflare/types/logpush/output_options_param.py @@ -71,8 +71,8 @@ class OutputOptionsParam(TypedDict, total=False): `sample_interval` of the data. """ - timestamp_format: Literal["unixnano", "unix", "rfc3339"] + timestamp_format: Literal["unixnano", "unix", "rfc3339", "rfc3339nano"] """ - String to specify the format for timestamps, such as `unixnano`, `unix`, or - `rfc3339`. + String to specify the format for timestamps, such as `unixnano`, `unix`, + `rfc3339` or `rfc3339nano`. """ diff --git a/tests/api_resources/aisearch/instances/test_items.py b/tests/api_resources/aisearch/instances/test_items.py deleted file mode 100644 index b95f7b5d460..00000000000 --- a/tests/api_resources/aisearch/instances/test_items.py +++ /dev/null @@ -1,145 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -import os -from typing import Any, cast - -import pytest - -from cloudflare import Cloudflare, AsyncCloudflare -from tests.utils import assert_matches_type -from cloudflare.pagination import SyncV4PagePaginationArray, AsyncV4PagePaginationArray -from cloudflare.types.aisearch.instances import ItemListResponse - -base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") - - -class TestItems: - parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) - - @parametrize - def test_method_list(self, client: Cloudflare) -> None: - item = client.aisearch.instances.items.list( - id="my-ai-search", - account_id="c3dc5f0b34a14ff8e1b3ec04895e1b22", - ) - assert_matches_type(SyncV4PagePaginationArray[ItemListResponse], item, path=["response"]) - - @parametrize - def test_method_list_with_all_params(self, client: Cloudflare) -> None: - item = client.aisearch.instances.items.list( - id="my-ai-search", - account_id="c3dc5f0b34a14ff8e1b3ec04895e1b22", - page=1, - per_page=0, - search="search", - status="queued", - ) - assert_matches_type(SyncV4PagePaginationArray[ItemListResponse], item, path=["response"]) - - @parametrize - def test_raw_response_list(self, client: Cloudflare) -> None: - response = client.aisearch.instances.items.with_raw_response.list( - id="my-ai-search", - account_id="c3dc5f0b34a14ff8e1b3ec04895e1b22", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - item = response.parse() - assert_matches_type(SyncV4PagePaginationArray[ItemListResponse], item, path=["response"]) - - @parametrize - def test_streaming_response_list(self, client: Cloudflare) -> None: - with client.aisearch.instances.items.with_streaming_response.list( - id="my-ai-search", - account_id="c3dc5f0b34a14ff8e1b3ec04895e1b22", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - item = response.parse() - assert_matches_type(SyncV4PagePaginationArray[ItemListResponse], item, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - def test_path_params_list(self, client: Cloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): - client.aisearch.instances.items.with_raw_response.list( - id="my-ai-search", - account_id="", - ) - - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.aisearch.instances.items.with_raw_response.list( - id="", - account_id="c3dc5f0b34a14ff8e1b3ec04895e1b22", - ) - - -class TestAsyncItems: - parametrize = pytest.mark.parametrize( - "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"] - ) - - @parametrize - async def test_method_list(self, async_client: AsyncCloudflare) -> None: - item = await async_client.aisearch.instances.items.list( - id="my-ai-search", - account_id="c3dc5f0b34a14ff8e1b3ec04895e1b22", - ) - assert_matches_type(AsyncV4PagePaginationArray[ItemListResponse], item, path=["response"]) - - @parametrize - async def test_method_list_with_all_params(self, async_client: AsyncCloudflare) -> None: - item = await async_client.aisearch.instances.items.list( - id="my-ai-search", - account_id="c3dc5f0b34a14ff8e1b3ec04895e1b22", - page=1, - per_page=0, - search="search", - status="queued", - ) - assert_matches_type(AsyncV4PagePaginationArray[ItemListResponse], item, path=["response"]) - - @parametrize - async def test_raw_response_list(self, async_client: AsyncCloudflare) -> None: - response = await async_client.aisearch.instances.items.with_raw_response.list( - id="my-ai-search", - account_id="c3dc5f0b34a14ff8e1b3ec04895e1b22", - ) - - assert response.is_closed is True - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - item = await response.parse() - assert_matches_type(AsyncV4PagePaginationArray[ItemListResponse], item, path=["response"]) - - @parametrize - async def test_streaming_response_list(self, async_client: AsyncCloudflare) -> None: - async with async_client.aisearch.instances.items.with_streaming_response.list( - id="my-ai-search", - account_id="c3dc5f0b34a14ff8e1b3ec04895e1b22", - ) as response: - assert not response.is_closed - assert response.http_request.headers.get("X-Stainless-Lang") == "python" - - item = await response.parse() - assert_matches_type(AsyncV4PagePaginationArray[ItemListResponse], item, path=["response"]) - - assert cast(Any, response.is_closed) is True - - @parametrize - async def test_path_params_list(self, async_client: AsyncCloudflare) -> None: - with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): - await async_client.aisearch.instances.items.with_raw_response.list( - id="my-ai-search", - account_id="", - ) - - with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.aisearch.instances.items.with_raw_response.list( - id="", - account_id="c3dc5f0b34a14ff8e1b3ec04895e1b22", - ) diff --git a/tests/api_resources/aisearch/test_instances.py b/tests/api_resources/aisearch/test_instances.py index ddfc0435184..1988f593cde 100644 --- a/tests/api_resources/aisearch/test_instances.py +++ b/tests/api_resources/aisearch/test_instances.py @@ -97,6 +97,13 @@ def test_method_create_with_all_params(self, client: Cloudflare) -> None: "prefix": "prefix", "r2_jurisdiction": "r2_jurisdiction", "web_crawler": { + "crawl_options": { + "depth": 1, + "include_external_links": True, + "include_subdomains": True, + "max_age": 0, + "source": "all", + }, "parse_options": { "content_selector": [ { @@ -229,6 +236,13 @@ def test_method_update_with_all_params(self, client: Cloudflare) -> None: "prefix": "prefix", "r2_jurisdiction": "r2_jurisdiction", "web_crawler": { + "crawl_options": { + "depth": 1, + "include_external_links": True, + "include_subdomains": True, + "max_age": 0, + "source": "all", + }, "parse_options": { "content_selector": [ { @@ -813,6 +827,13 @@ async def test_method_create_with_all_params(self, async_client: AsyncCloudflare "prefix": "prefix", "r2_jurisdiction": "r2_jurisdiction", "web_crawler": { + "crawl_options": { + "depth": 1, + "include_external_links": True, + "include_subdomains": True, + "max_age": 0, + "source": "all", + }, "parse_options": { "content_selector": [ { @@ -945,6 +966,13 @@ async def test_method_update_with_all_params(self, async_client: AsyncCloudflare "prefix": "prefix", "r2_jurisdiction": "r2_jurisdiction", "web_crawler": { + "crawl_options": { + "depth": 1, + "include_external_links": True, + "include_subdomains": True, + "max_age": 0, + "source": "all", + }, "parse_options": { "content_selector": [ { From fe38437fe5b36e74faef53fe394b620671c23c3e Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 6 Mar 2026 16:03:44 +0000 Subject: [PATCH 060/279] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 746a64c2f80..c14bf2fc019 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 2057 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-a531b799897a2903f62ece8f506cbbf9dd157373469af4e3d868544783eb92a0.yml -openapi_spec_hash: 10c604337dfdbf74ed0a68d07cc9625e +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-44beb073dc6b88309dcfe175e2dddf9f151d367b2b9b177749abe45cc4316a51.yml +openapi_spec_hash: f1e2069650e543d6ade41a90f42cc0cd config_hash: b78af95529f71a3da2339b6fd717ed86 From 8270297ac9ed0af06b09b8c84aa8d4d6a450b430 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 6 Mar 2026 16:09:38 +0000 Subject: [PATCH 061/279] feat: feat: add billable usage PayGo endpoint to billing resource * feat: add billable usage PayGo endpoint to billing resource --- .stats.yml | 4 +- api.md | 12 + src/cloudflare/resources/billing/__init__.py | 14 + src/cloudflare/resources/billing/billing.py | 32 +++ src/cloudflare/resources/billing/usage.py | 251 ++++++++++++++++++ src/cloudflare/types/billing/__init__.py | 2 + .../types/billing/usage_paygo_params.py | 36 +++ .../types/billing/usage_paygo_response.py | 51 ++++ tests/api_resources/billing/test_usage.py | 123 +++++++++ 9 files changed, 523 insertions(+), 2 deletions(-) create mode 100644 src/cloudflare/resources/billing/usage.py create mode 100644 src/cloudflare/types/billing/usage_paygo_params.py create mode 100644 src/cloudflare/types/billing/usage_paygo_response.py create mode 100644 tests/api_resources/billing/test_usage.py diff --git a/.stats.yml b/.stats.yml index c14bf2fc019..e49f0567111 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ -configured_endpoints: 2057 +configured_endpoints: 2058 openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-44beb073dc6b88309dcfe175e2dddf9f151d367b2b9b177749abe45cc4316a51.yml openapi_spec_hash: f1e2069650e543d6ade41a90f42cc0cd -config_hash: b78af95529f71a3da2339b6fd717ed86 +config_hash: be75bee0df4cf361df49284b77afc8a4 diff --git a/api.md b/api.md index dc970af1a71..1fd7450b5d5 100644 --- a/api.md +++ b/api.md @@ -3548,6 +3548,18 @@ Methods: - client.billing.profiles.get(\*, account_id) -> ProfileGetResponse +## Usage + +Types: + +```python +from cloudflare.types.billing import UsagePaygoResponse +``` + +Methods: + +- client.billing.usage.paygo(\*, account_id, \*\*params) -> UsagePaygoResponse + # BrandProtection Types: diff --git a/src/cloudflare/resources/billing/__init__.py b/src/cloudflare/resources/billing/__init__.py index c16ec03c4dc..a0005fa8305 100644 --- a/src/cloudflare/resources/billing/__init__.py +++ b/src/cloudflare/resources/billing/__init__.py @@ -1,5 +1,13 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. +from .usage import ( + UsageResource, + AsyncUsageResource, + UsageResourceWithRawResponse, + AsyncUsageResourceWithRawResponse, + UsageResourceWithStreamingResponse, + AsyncUsageResourceWithStreamingResponse, +) from .billing import ( BillingResource, AsyncBillingResource, @@ -24,6 +32,12 @@ "AsyncProfilesResourceWithRawResponse", "ProfilesResourceWithStreamingResponse", "AsyncProfilesResourceWithStreamingResponse", + "UsageResource", + "AsyncUsageResource", + "UsageResourceWithRawResponse", + "AsyncUsageResourceWithRawResponse", + "UsageResourceWithStreamingResponse", + "AsyncUsageResourceWithStreamingResponse", "BillingResource", "AsyncBillingResource", "BillingResourceWithRawResponse", diff --git a/src/cloudflare/resources/billing/billing.py b/src/cloudflare/resources/billing/billing.py index d57c019144e..5d7a8e1d11a 100644 --- a/src/cloudflare/resources/billing/billing.py +++ b/src/cloudflare/resources/billing/billing.py @@ -2,6 +2,14 @@ from __future__ import annotations +from .usage import ( + UsageResource, + AsyncUsageResource, + UsageResourceWithRawResponse, + AsyncUsageResourceWithRawResponse, + UsageResourceWithStreamingResponse, + AsyncUsageResourceWithStreamingResponse, +) from .profiles import ( ProfilesResource, AsyncProfilesResource, @@ -21,6 +29,10 @@ class BillingResource(SyncAPIResource): def profiles(self) -> ProfilesResource: return ProfilesResource(self._client) + @cached_property + def usage(self) -> UsageResource: + return UsageResource(self._client) + @cached_property def with_raw_response(self) -> BillingResourceWithRawResponse: """ @@ -46,6 +58,10 @@ class AsyncBillingResource(AsyncAPIResource): def profiles(self) -> AsyncProfilesResource: return AsyncProfilesResource(self._client) + @cached_property + def usage(self) -> AsyncUsageResource: + return AsyncUsageResource(self._client) + @cached_property def with_raw_response(self) -> AsyncBillingResourceWithRawResponse: """ @@ -74,6 +90,10 @@ def __init__(self, billing: BillingResource) -> None: def profiles(self) -> ProfilesResourceWithRawResponse: return ProfilesResourceWithRawResponse(self._billing.profiles) + @cached_property + def usage(self) -> UsageResourceWithRawResponse: + return UsageResourceWithRawResponse(self._billing.usage) + class AsyncBillingResourceWithRawResponse: def __init__(self, billing: AsyncBillingResource) -> None: @@ -83,6 +103,10 @@ def __init__(self, billing: AsyncBillingResource) -> None: def profiles(self) -> AsyncProfilesResourceWithRawResponse: return AsyncProfilesResourceWithRawResponse(self._billing.profiles) + @cached_property + def usage(self) -> AsyncUsageResourceWithRawResponse: + return AsyncUsageResourceWithRawResponse(self._billing.usage) + class BillingResourceWithStreamingResponse: def __init__(self, billing: BillingResource) -> None: @@ -92,6 +116,10 @@ def __init__(self, billing: BillingResource) -> None: def profiles(self) -> ProfilesResourceWithStreamingResponse: return ProfilesResourceWithStreamingResponse(self._billing.profiles) + @cached_property + def usage(self) -> UsageResourceWithStreamingResponse: + return UsageResourceWithStreamingResponse(self._billing.usage) + class AsyncBillingResourceWithStreamingResponse: def __init__(self, billing: AsyncBillingResource) -> None: @@ -100,3 +128,7 @@ def __init__(self, billing: AsyncBillingResource) -> None: @cached_property def profiles(self) -> AsyncProfilesResourceWithStreamingResponse: return AsyncProfilesResourceWithStreamingResponse(self._billing.profiles) + + @cached_property + def usage(self) -> AsyncUsageResourceWithStreamingResponse: + return AsyncUsageResourceWithStreamingResponse(self._billing.usage) diff --git a/src/cloudflare/resources/billing/usage.py b/src/cloudflare/resources/billing/usage.py new file mode 100644 index 00000000000..7e68c5f15ec --- /dev/null +++ b/src/cloudflare/resources/billing/usage.py @@ -0,0 +1,251 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Type, Union, cast +from datetime import date + +import httpx + +from ..._types import Body, Omit, Query, Headers, NotGiven, omit, not_given +from ..._utils import maybe_transform, async_maybe_transform +from ..._compat import cached_property +from ..._resource import SyncAPIResource, AsyncAPIResource +from ..._response import ( + to_raw_response_wrapper, + to_streamed_response_wrapper, + async_to_raw_response_wrapper, + async_to_streamed_response_wrapper, +) +from ..._wrappers import ResultWrapper +from ..._base_client import make_request_options +from ...types.billing import usage_paygo_params +from ...types.billing.usage_paygo_response import UsagePaygoResponse + +__all__ = ["UsageResource", "AsyncUsageResource"] + + +class UsageResource(SyncAPIResource): + @cached_property + def with_raw_response(self) -> UsageResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers + """ + return UsageResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> UsageResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/cloudflare/cloudflare-python#with_streaming_response + """ + return UsageResourceWithStreamingResponse(self) + + def paygo( + self, + *, + account_id: str, + from_: Union[str, date] | Omit = omit, + last_month_period_start: int | Omit = omit, + last_year_period_start: int | Omit = omit, + to: Union[str, date] | 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, + ) -> UsagePaygoResponse: + """Returns billable usage data for PayGo (self-serve) accounts. + + When no query + parameters are provided, returns usage for the current billing period. + + Supports two mutually exclusive query modes: + + **Billing period mode:** Use `last_year_period_start` and + `last_month_period_start` to query a specific billing period. + + **Date range mode:** Use `from` and `to` to query a custom date range (maximum + 62 days). + + This endpoint is currently in beta and access is restricted to select accounts. + + Args: + account_id: Represents a Cloudflare resource identifier tag. + + from_: Defines the start date for the usage query (e.g., 2025-02-01). + + last_month_period_start: Specifies the month of the billing period to query (1-12). Must be provided + together with last_year_period_start. Mutually exclusive with from/to. + + last_year_period_start: Specifies the year of the billing period to query (e.g., 2025). Must be provided + together with last_month_period_start. Mutually exclusive with from/to. + + to: Defines the end date for the usage query (e.g., 2025-03-01). + + 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( + f"/accounts/{account_id}/billing/usage/paygo", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=maybe_transform( + { + "from_": from_, + "last_month_period_start": last_month_period_start, + "last_year_period_start": last_year_period_start, + "to": to, + }, + usage_paygo_params.UsagePaygoParams, + ), + post_parser=ResultWrapper[UsagePaygoResponse]._unwrapper, + ), + cast_to=cast(Type[UsagePaygoResponse], ResultWrapper[UsagePaygoResponse]), + ) + + +class AsyncUsageResource(AsyncAPIResource): + @cached_property + def with_raw_response(self) -> AsyncUsageResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers + """ + return AsyncUsageResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> AsyncUsageResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/cloudflare/cloudflare-python#with_streaming_response + """ + return AsyncUsageResourceWithStreamingResponse(self) + + async def paygo( + self, + *, + account_id: str, + from_: Union[str, date] | Omit = omit, + last_month_period_start: int | Omit = omit, + last_year_period_start: int | Omit = omit, + to: Union[str, date] | 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, + ) -> UsagePaygoResponse: + """Returns billable usage data for PayGo (self-serve) accounts. + + When no query + parameters are provided, returns usage for the current billing period. + + Supports two mutually exclusive query modes: + + **Billing period mode:** Use `last_year_period_start` and + `last_month_period_start` to query a specific billing period. + + **Date range mode:** Use `from` and `to` to query a custom date range (maximum + 62 days). + + This endpoint is currently in beta and access is restricted to select accounts. + + Args: + account_id: Represents a Cloudflare resource identifier tag. + + from_: Defines the start date for the usage query (e.g., 2025-02-01). + + last_month_period_start: Specifies the month of the billing period to query (1-12). Must be provided + together with last_year_period_start. Mutually exclusive with from/to. + + last_year_period_start: Specifies the year of the billing period to query (e.g., 2025). Must be provided + together with last_month_period_start. Mutually exclusive with from/to. + + to: Defines the end date for the usage query (e.g., 2025-03-01). + + 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 await self._get( + f"/accounts/{account_id}/billing/usage/paygo", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=await async_maybe_transform( + { + "from_": from_, + "last_month_period_start": last_month_period_start, + "last_year_period_start": last_year_period_start, + "to": to, + }, + usage_paygo_params.UsagePaygoParams, + ), + post_parser=ResultWrapper[UsagePaygoResponse]._unwrapper, + ), + cast_to=cast(Type[UsagePaygoResponse], ResultWrapper[UsagePaygoResponse]), + ) + + +class UsageResourceWithRawResponse: + def __init__(self, usage: UsageResource) -> None: + self._usage = usage + + self.paygo = to_raw_response_wrapper( + usage.paygo, + ) + + +class AsyncUsageResourceWithRawResponse: + def __init__(self, usage: AsyncUsageResource) -> None: + self._usage = usage + + self.paygo = async_to_raw_response_wrapper( + usage.paygo, + ) + + +class UsageResourceWithStreamingResponse: + def __init__(self, usage: UsageResource) -> None: + self._usage = usage + + self.paygo = to_streamed_response_wrapper( + usage.paygo, + ) + + +class AsyncUsageResourceWithStreamingResponse: + def __init__(self, usage: AsyncUsageResource) -> None: + self._usage = usage + + self.paygo = async_to_streamed_response_wrapper( + usage.paygo, + ) diff --git a/src/cloudflare/types/billing/__init__.py b/src/cloudflare/types/billing/__init__.py index 94cf7da6397..acd998672a9 100644 --- a/src/cloudflare/types/billing/__init__.py +++ b/src/cloudflare/types/billing/__init__.py @@ -2,4 +2,6 @@ from __future__ import annotations +from .usage_paygo_params import UsagePaygoParams as UsagePaygoParams from .profile_get_response import ProfileGetResponse as ProfileGetResponse +from .usage_paygo_response import UsagePaygoResponse as UsagePaygoResponse diff --git a/src/cloudflare/types/billing/usage_paygo_params.py b/src/cloudflare/types/billing/usage_paygo_params.py new file mode 100644 index 00000000000..341df22b16c --- /dev/null +++ b/src/cloudflare/types/billing/usage_paygo_params.py @@ -0,0 +1,36 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Union +from datetime import date +from typing_extensions import Required, Annotated, TypedDict + +from ..._utils import PropertyInfo + +__all__ = ["UsagePaygoParams"] + + +class UsagePaygoParams(TypedDict, total=False): + account_id: Required[str] + """Represents a Cloudflare resource identifier tag.""" + + from_: Annotated[Union[str, date], PropertyInfo(alias="from", format="iso8601")] + """Defines the start date for the usage query (e.g., 2025-02-01).""" + + last_month_period_start: int + """Specifies the month of the billing period to query (1-12). + + Must be provided together with last_year_period_start. Mutually exclusive with + from/to. + """ + + last_year_period_start: int + """Specifies the year of the billing period to query (e.g., 2025). + + Must be provided together with last_month_period_start. Mutually exclusive with + from/to. + """ + + to: Annotated[Union[str, date], PropertyInfo(format="iso8601")] + """Defines the end date for the usage query (e.g., 2025-03-01).""" diff --git a/src/cloudflare/types/billing/usage_paygo_response.py b/src/cloudflare/types/billing/usage_paygo_response.py new file mode 100644 index 00000000000..23db8801493 --- /dev/null +++ b/src/cloudflare/types/billing/usage_paygo_response.py @@ -0,0 +1,51 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List +from datetime import datetime +from typing_extensions import TypeAlias + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel + +__all__ = ["UsagePaygoResponse", "UsagePaygoResponseItem"] + + +class UsagePaygoResponseItem(BaseModel): + """Represents a single billable usage record.""" + + billing_currency: str = FieldInfo(alias="BillingCurrency") + """Specifies the billing currency code (ISO 4217).""" + + billing_period_start: datetime = FieldInfo(alias="BillingPeriodStart") + """Indicates the start of the billing period.""" + + charge_period_end: datetime = FieldInfo(alias="ChargePeriodEnd") + """Indicates the end of the charge period.""" + + charge_period_start: datetime = FieldInfo(alias="ChargePeriodStart") + """Indicates the start of the charge period.""" + + consumed_quantity: float = FieldInfo(alias="ConsumedQuantity") + """Specifies the quantity consumed during this charge period.""" + + consumed_unit: str = FieldInfo(alias="ConsumedUnit") + """Specifies the unit of measurement for consumed quantity.""" + + contracted_cost: float = FieldInfo(alias="ContractedCost") + """Specifies the cost for this charge period in the billing currency.""" + + cumulated_contracted_cost: float = FieldInfo(alias="CumulatedContractedCost") + """Specifies the cumulated cost for the billing period in the billing currency.""" + + cumulated_pricing_quantity: int = FieldInfo(alias="CumulatedPricingQuantity") + """Specifies the cumulated pricing quantity for the billing period.""" + + pricing_quantity: int = FieldInfo(alias="PricingQuantity") + """Specifies the pricing quantity for this charge period.""" + + service_name: str = FieldInfo(alias="ServiceName") + """Identifies the Cloudflare service.""" + + +UsagePaygoResponse: TypeAlias = List[UsagePaygoResponseItem] diff --git a/tests/api_resources/billing/test_usage.py b/tests/api_resources/billing/test_usage.py new file mode 100644 index 00000000000..331eecf724c --- /dev/null +++ b/tests/api_resources/billing/test_usage.py @@ -0,0 +1,123 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +import os +from typing import Any, cast + +import pytest + +from cloudflare import Cloudflare, AsyncCloudflare +from tests.utils import assert_matches_type +from cloudflare._utils import parse_date +from cloudflare.types.billing import UsagePaygoResponse + +base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") + + +class TestUsage: + parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) + + @parametrize + def test_method_paygo(self, client: Cloudflare) -> None: + usage = client.billing.usage.paygo( + account_id="023e105f4ecef8ad9ca31a8372d0c353", + ) + assert_matches_type(UsagePaygoResponse, usage, path=["response"]) + + @parametrize + def test_method_paygo_with_all_params(self, client: Cloudflare) -> None: + usage = client.billing.usage.paygo( + account_id="023e105f4ecef8ad9ca31a8372d0c353", + from_=parse_date("2025-02-01"), + last_month_period_start=6, + last_year_period_start=2025, + to=parse_date("2025-03-01"), + ) + assert_matches_type(UsagePaygoResponse, usage, path=["response"]) + + @parametrize + def test_raw_response_paygo(self, client: Cloudflare) -> None: + response = client.billing.usage.with_raw_response.paygo( + account_id="023e105f4ecef8ad9ca31a8372d0c353", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + usage = response.parse() + assert_matches_type(UsagePaygoResponse, usage, path=["response"]) + + @parametrize + def test_streaming_response_paygo(self, client: Cloudflare) -> None: + with client.billing.usage.with_streaming_response.paygo( + account_id="023e105f4ecef8ad9ca31a8372d0c353", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + usage = response.parse() + assert_matches_type(UsagePaygoResponse, usage, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_paygo(self, client: Cloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + client.billing.usage.with_raw_response.paygo( + account_id="", + ) + + +class TestAsyncUsage: + parametrize = pytest.mark.parametrize( + "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"] + ) + + @parametrize + async def test_method_paygo(self, async_client: AsyncCloudflare) -> None: + usage = await async_client.billing.usage.paygo( + account_id="023e105f4ecef8ad9ca31a8372d0c353", + ) + assert_matches_type(UsagePaygoResponse, usage, path=["response"]) + + @parametrize + async def test_method_paygo_with_all_params(self, async_client: AsyncCloudflare) -> None: + usage = await async_client.billing.usage.paygo( + account_id="023e105f4ecef8ad9ca31a8372d0c353", + from_=parse_date("2025-02-01"), + last_month_period_start=6, + last_year_period_start=2025, + to=parse_date("2025-03-01"), + ) + assert_matches_type(UsagePaygoResponse, usage, path=["response"]) + + @parametrize + async def test_raw_response_paygo(self, async_client: AsyncCloudflare) -> None: + response = await async_client.billing.usage.with_raw_response.paygo( + account_id="023e105f4ecef8ad9ca31a8372d0c353", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + usage = await response.parse() + assert_matches_type(UsagePaygoResponse, usage, path=["response"]) + + @parametrize + async def test_streaming_response_paygo(self, async_client: AsyncCloudflare) -> None: + async with async_client.billing.usage.with_streaming_response.paygo( + account_id="023e105f4ecef8ad9ca31a8372d0c353", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + usage = await response.parse() + assert_matches_type(UsagePaygoResponse, usage, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_paygo(self, async_client: AsyncCloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `account_id` but received ''"): + await async_client.billing.usage.with_raw_response.paygo( + account_id="", + ) From df8b0dbdf37cdab598a5054be9e106caae87d398 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 6 Mar 2026 17:29:35 +0000 Subject: [PATCH 062/279] chore(api): update composite API spec --- .stats.yml | 4 +- .../workers/beta/workers/versions.py | 16 +++---- .../resources/workers/beta/workers/workers.py | 17 +++++++ .../dispatch/namespaces/scripts/settings.py | 8 ++++ src/cloudflare/types/workers/beta/worker.py | 6 +++ .../types/workers/beta/worker_list_params.py | 8 +++- .../types/workers/beta/workers/version.py | 21 +++++++- .../beta/workers/version_create_params.py | 21 +++++++- .../types/workers/script_update_params.py | 21 +++++++- .../script_and_version_setting_edit_params.py | 45 ++++++++++++++++- ...cript_and_version_setting_edit_response.py | 48 ++++++++++++++++++- ...script_and_version_setting_get_response.py | 48 ++++++++++++++++++- .../workers/scripts/version_create_params.py | 21 +++++++- .../scripts/version_create_response.py | 21 +++++++- .../workers/scripts/version_get_response.py | 21 +++++++- .../namespaces/script_update_params.py | 21 +++++++- .../scripts/binding_get_response.py | 21 +++++++- .../namespaces/scripts/setting_edit_params.py | 31 +++++++++++- .../scripts/setting_edit_response.py | 26 +++++++++- .../scripts/setting_get_response.py | 26 +++++++++- .../workers/beta/test_workers.py | 4 ++ .../test_script_and_version_settings.py | 8 ++++ 22 files changed, 437 insertions(+), 26 deletions(-) diff --git a/.stats.yml b/.stats.yml index e49f0567111..f6757e5d87e 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 2058 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-44beb073dc6b88309dcfe175e2dddf9f151d367b2b9b177749abe45cc4316a51.yml -openapi_spec_hash: f1e2069650e543d6ade41a90f42cc0cd +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-2c12b5f906dc770f62aa0a53f87f1c3568e6f0b6952a5fd44befba8c24cd1510.yml +openapi_spec_hash: 7fde83a4f201200d77ad6e995ad04527 config_hash: be75bee0df4cf361df49284b77afc8a4 diff --git a/src/cloudflare/resources/workers/beta/workers/versions.py b/src/cloudflare/resources/workers/beta/workers/versions.py index 9cdceef8780..f42771b0750 100644 --- a/src/cloudflare/resources/workers/beta/workers/versions.py +++ b/src/cloudflare/resources/workers/beta/workers/versions.py @@ -247,8 +247,8 @@ def delete( worker_id: Identifier for the Worker, which can be ID or name. - version_id: Identifier for the version, which can be ID or the literal "latest" to operate - on the most recently created version. + version_id: Identifier for the version, which can be a UUID, a UUID prefix (minimum length + 8), or the literal "latest" to operate on the most recently created version. extra_headers: Send extra headers @@ -294,8 +294,8 @@ def get( worker_id: Identifier for the Worker, which can be ID or name. - version_id: Identifier for the version, which can be ID or the literal "latest" to operate - on the most recently created version. + version_id: Identifier for the version, which can be a UUID, a UUID prefix (minimum length + 8), or the literal "latest" to operate on the most recently created version. include: Whether to include the `modules` property of the version in the response, which contains code and sourcemap content and may add several megabytes to the @@ -549,8 +549,8 @@ async def delete( worker_id: Identifier for the Worker, which can be ID or name. - version_id: Identifier for the version, which can be ID or the literal "latest" to operate - on the most recently created version. + version_id: Identifier for the version, which can be a UUID, a UUID prefix (minimum length + 8), or the literal "latest" to operate on the most recently created version. extra_headers: Send extra headers @@ -596,8 +596,8 @@ async def get( worker_id: Identifier for the Worker, which can be ID or name. - version_id: Identifier for the version, which can be ID or the literal "latest" to operate - on the most recently created version. + version_id: Identifier for the version, which can be a UUID, a UUID prefix (minimum length + 8), or the literal "latest" to operate on the most recently created version. include: Whether to include the `modules` property of the version in the response, which contains code and sourcemap content and may add several megabytes to the diff --git a/src/cloudflare/resources/workers/beta/workers/workers.py b/src/cloudflare/resources/workers/beta/workers/workers.py index fcaed3d877d..00cca91310c 100644 --- a/src/cloudflare/resources/workers/beta/workers/workers.py +++ b/src/cloudflare/resources/workers/beta/workers/workers.py @@ -3,6 +3,7 @@ from __future__ import annotations from typing import Type, Iterable, cast +from typing_extensions import Literal import httpx @@ -206,6 +207,8 @@ def list( self, *, account_id: str, + order: Literal["asc", "desc"] | Omit = omit, + order_by: Literal["deployed_on", "updated_on", "created_on", "name"] | Omit = omit, page: int | Omit = omit, per_page: int | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -221,6 +224,10 @@ def list( Args: account_id: Identifier. + order: Sort direction. + + order_by: Property to sort results by. + page: Current page. per_page: Items per-page. @@ -245,6 +252,8 @@ def list( timeout=timeout, query=maybe_transform( { + "order": order, + "order_by": order_by, "page": page, "per_page": per_page, }, @@ -585,6 +594,8 @@ def list( self, *, account_id: str, + order: Literal["asc", "desc"] | Omit = omit, + order_by: Literal["deployed_on", "updated_on", "created_on", "name"] | Omit = omit, page: int | Omit = omit, per_page: int | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -600,6 +611,10 @@ def list( Args: account_id: Identifier. + order: Sort direction. + + order_by: Property to sort results by. + page: Current page. per_page: Items per-page. @@ -624,6 +639,8 @@ def list( timeout=timeout, query=maybe_transform( { + "order": order, + "order_by": order_by, "page": page, "per_page": per_page, }, diff --git a/src/cloudflare/resources/workers_for_platforms/dispatch/namespaces/scripts/settings.py b/src/cloudflare/resources/workers_for_platforms/dispatch/namespaces/scripts/settings.py index ef6da967284..72c7db91d51 100644 --- a/src/cloudflare/resources/workers_for_platforms/dispatch/namespaces/scripts/settings.py +++ b/src/cloudflare/resources/workers_for_platforms/dispatch/namespaces/scripts/settings.py @@ -69,6 +69,10 @@ def edit( script_name: Name of the script, used in URLs and route configuration. + settings: Script and version settings for Workers for Platforms namespace scripts. Same as + script-and-version-settings-item but without annotations, which are not + supported for namespace scripts. + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -195,6 +199,10 @@ async def edit( script_name: Name of the script, used in URLs and route configuration. + settings: Script and version settings for Workers for Platforms namespace scripts. Same as + script-and-version-settings-item but without annotations, which are not + supported for namespace scripts. + extra_headers: Send extra headers extra_query: Add additional query parameters to the request diff --git a/src/cloudflare/types/workers/beta/worker.py b/src/cloudflare/types/workers/beta/worker.py index fb126cccc42..b3ec452bd0c 100644 --- a/src/cloudflare/types/workers/beta/worker.py +++ b/src/cloudflare/types/workers/beta/worker.py @@ -187,3 +187,9 @@ class Worker(BaseModel): updated_on: datetime """When the Worker was most recently updated.""" + + deployed_on: Optional[datetime] = None + """When the Worker's most recent deployment was created. + + `null` if the Worker has never been deployed. + """ diff --git a/src/cloudflare/types/workers/beta/worker_list_params.py b/src/cloudflare/types/workers/beta/worker_list_params.py index d92d9c624cc..27f46845688 100644 --- a/src/cloudflare/types/workers/beta/worker_list_params.py +++ b/src/cloudflare/types/workers/beta/worker_list_params.py @@ -2,7 +2,7 @@ from __future__ import annotations -from typing_extensions import Required, TypedDict +from typing_extensions import Literal, Required, TypedDict __all__ = ["WorkerListParams"] @@ -11,6 +11,12 @@ class WorkerListParams(TypedDict, total=False): account_id: Required[str] """Identifier.""" + order: Literal["asc", "desc"] + """Sort direction.""" + + order_by: Literal["deployed_on", "updated_on", "created_on", "name"] + """Property to sort results by.""" + page: int """Current page.""" diff --git a/src/cloudflare/types/workers/beta/workers/version.py b/src/cloudflare/types/workers/beta/workers/version.py index 640ea8501c8..71d0a2e055e 100644 --- a/src/cloudflare/types/workers/beta/workers/version.py +++ b/src/cloudflare/types/workers/beta/workers/version.py @@ -49,6 +49,7 @@ "BindingWorkersBindingKindSecretKey", "BindingWorkersBindingKindWorkflow", "BindingWorkersBindingKindWasmModule", + "BindingWorkersBindingKindVPCService", "Limits", "Migrations", "MigrationsWorkersMultipleStepMigrations", @@ -235,6 +236,9 @@ class BindingWorkersBindingKindDurableObjectNamespace(BaseModel): class_name: Optional[str] = None """The exported class name of the Durable Object.""" + dispatch_namespace: Optional[str] = None + """The dispatch namespace the Durable Object script belongs to.""" + environment: Optional[str] = None """The environment of the script_name to bind to.""" @@ -389,7 +393,7 @@ class BindingWorkersBindingKindR2Bucket(BaseModel): type: Literal["r2_bucket"] """The kind of resource that the binding provides.""" - jurisdiction: Optional[Literal["eu", "fedramp"]] = None + jurisdiction: Optional[Literal["eu", "fedramp", "fedramp-high"]] = None """ The [jurisdiction](https://developers.cloudflare.com/r2/reference/data-location/#jurisdictional-restrictions) @@ -432,6 +436,9 @@ class BindingWorkersBindingKindService(BaseModel): type: Literal["service"] """The kind of resource that the binding provides.""" + entrypoint: Optional[str] = None + """Entrypoint to invoke on the target Worker.""" + environment: Optional[str] = None """Optional environment if the Worker utilizes one.""" @@ -546,6 +553,17 @@ class BindingWorkersBindingKindWasmModule(BaseModel): """The kind of resource that the binding provides.""" +class BindingWorkersBindingKindVPCService(BaseModel): + name: str + """A JavaScript variable name for the binding.""" + + service_id: str + """Identifier of the VPC service to bind to.""" + + type: Literal["vpc_service"] + """The kind of resource that the binding provides.""" + + Binding: TypeAlias = Annotated[ Union[ BindingWorkersBindingKindAI, @@ -577,6 +595,7 @@ class BindingWorkersBindingKindWasmModule(BaseModel): BindingWorkersBindingKindSecretKey, BindingWorkersBindingKindWorkflow, BindingWorkersBindingKindWasmModule, + BindingWorkersBindingKindVPCService, ], PropertyInfo(discriminator="type"), ] 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 1adf686d88e..9891287a358 100644 --- a/src/cloudflare/types/workers/beta/workers/version_create_params.py +++ b/src/cloudflare/types/workers/beta/workers/version_create_params.py @@ -50,6 +50,7 @@ "BindingWorkersBindingKindSecretKey", "BindingWorkersBindingKindWorkflow", "BindingWorkersBindingKindWasmModule", + "BindingWorkersBindingKindVPCService", "Limits", "Migrations", "MigrationsWorkersMultipleStepMigrations", @@ -314,6 +315,9 @@ class BindingWorkersBindingKindDurableObjectNamespace(TypedDict, total=False): class_name: str """The exported class name of the Durable Object.""" + dispatch_namespace: str + """The dispatch namespace the Durable Object script belongs to.""" + environment: str """The environment of the script_name to bind to.""" @@ -468,7 +472,7 @@ class BindingWorkersBindingKindR2Bucket(TypedDict, total=False): type: Required[Literal["r2_bucket"]] """The kind of resource that the binding provides.""" - jurisdiction: Literal["eu", "fedramp"] + jurisdiction: Literal["eu", "fedramp", "fedramp-high"] """ The [jurisdiction](https://developers.cloudflare.com/r2/reference/data-location/#jurisdictional-restrictions) @@ -514,6 +518,9 @@ class BindingWorkersBindingKindService(TypedDict, total=False): type: Required[Literal["service"]] """The kind of resource that the binding provides.""" + entrypoint: str + """Entrypoint to invoke on the target Worker.""" + environment: str """Optional environment if the Worker utilizes one.""" @@ -640,6 +647,17 @@ class BindingWorkersBindingKindWasmModule(TypedDict, total=False): """The kind of resource that the binding provides.""" +class BindingWorkersBindingKindVPCService(TypedDict, total=False): + name: Required[str] + """A JavaScript variable name for the binding.""" + + service_id: Required[str] + """Identifier of the VPC service to bind to.""" + + type: Required[Literal["vpc_service"]] + """The kind of resource that the binding provides.""" + + Binding: TypeAlias = Union[ BindingWorkersBindingKindAI, BindingWorkersBindingKindAnalyticsEngine, @@ -670,6 +688,7 @@ class BindingWorkersBindingKindWasmModule(TypedDict, total=False): BindingWorkersBindingKindSecretKey, BindingWorkersBindingKindWorkflow, BindingWorkersBindingKindWasmModule, + BindingWorkersBindingKindVPCService, ] diff --git a/src/cloudflare/types/workers/script_update_params.py b/src/cloudflare/types/workers/script_update_params.py index 88b7317ca68..33fedd4e455 100644 --- a/src/cloudflare/types/workers/script_update_params.py +++ b/src/cloudflare/types/workers/script_update_params.py @@ -51,6 +51,7 @@ "MetadataBindingWorkersBindingKindSecretKey", "MetadataBindingWorkersBindingKindWorkflow", "MetadataBindingWorkersBindingKindWasmModule", + "MetadataBindingWorkersBindingKindVPCService", "MetadataLimits", "MetadataMigrations", "MetadataMigrationsWorkersMultipleStepMigrations", @@ -273,6 +274,9 @@ class MetadataBindingWorkersBindingKindDurableObjectNamespace(TypedDict, total=F class_name: str """The exported class name of the Durable Object.""" + dispatch_namespace: str + """The dispatch namespace the Durable Object script belongs to.""" + environment: str """The environment of the script_name to bind to.""" @@ -427,7 +431,7 @@ class MetadataBindingWorkersBindingKindR2Bucket(TypedDict, total=False): type: Required[Literal["r2_bucket"]] """The kind of resource that the binding provides.""" - jurisdiction: Literal["eu", "fedramp"] + jurisdiction: Literal["eu", "fedramp", "fedramp-high"] """ The [jurisdiction](https://developers.cloudflare.com/r2/reference/data-location/#jurisdictional-restrictions) @@ -473,6 +477,9 @@ class MetadataBindingWorkersBindingKindService(TypedDict, total=False): type: Required[Literal["service"]] """The kind of resource that the binding provides.""" + entrypoint: str + """Entrypoint to invoke on the target Worker.""" + environment: str """Optional environment if the Worker utilizes one.""" @@ -599,6 +606,17 @@ class MetadataBindingWorkersBindingKindWasmModule(TypedDict, total=False): """The kind of resource that the binding provides.""" +class MetadataBindingWorkersBindingKindVPCService(TypedDict, total=False): + name: Required[str] + """A JavaScript variable name for the binding.""" + + service_id: Required[str] + """Identifier of the VPC service to bind to.""" + + type: Required[Literal["vpc_service"]] + """The kind of resource that the binding provides.""" + + MetadataBinding: TypeAlias = Union[ MetadataBindingWorkersBindingKindAI, MetadataBindingWorkersBindingKindAnalyticsEngine, @@ -629,6 +647,7 @@ class MetadataBindingWorkersBindingKindWasmModule(TypedDict, total=False): MetadataBindingWorkersBindingKindSecretKey, MetadataBindingWorkersBindingKindWorkflow, MetadataBindingWorkersBindingKindWasmModule, + MetadataBindingWorkersBindingKindVPCService, ] 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 4e32a071f64..e71e26b9ade 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 @@ -3,9 +3,10 @@ from __future__ import annotations from typing import List, Union, Iterable, Optional -from typing_extensions import Literal, Required, TypeAlias, TypedDict +from typing_extensions import Literal, Required, Annotated, TypeAlias, TypedDict from ...._types import SequenceNotStr +from ...._utils import PropertyInfo from ..migration_step_param import MigrationStepParam from .consumer_script_param import ConsumerScriptParam from ..single_step_migration_param import SingleStepMigrationParam @@ -13,6 +14,7 @@ __all__ = [ "ScriptAndVersionSettingEditParams", "Settings", + "SettingsAnnotations", "SettingsBinding", "SettingsBindingWorkersBindingKindAI", "SettingsBindingWorkersBindingKindAnalyticsEngine", @@ -47,6 +49,7 @@ "SettingsBindingWorkersBindingKindSecretKey", "SettingsBindingWorkersBindingKindWorkflow", "SettingsBindingWorkersBindingKindWasmModule", + "SettingsBindingWorkersBindingKindVPCService", "SettingsLimits", "SettingsMigrations", "SettingsMigrationsWorkersMultipleStepMigrations", @@ -75,6 +78,19 @@ class ScriptAndVersionSettingEditParams(TypedDict, total=False): settings: Settings +class SettingsAnnotations(TypedDict, total=False): + """Annotations for the Worker version. + + Annotations are not inherited across settings updates; omitting this field means the new version will have no annotations. + """ + + workers_message: Annotated[str, PropertyInfo(alias="workers/message")] + """Human-readable message about the version.""" + + workers_tag: Annotated[str, PropertyInfo(alias="workers/tag")] + """User-provided identifier for the version.""" + + class SettingsBindingWorkersBindingKindAI(TypedDict, total=False): name: Required[str] """A JavaScript variable name for the binding.""" @@ -190,6 +206,9 @@ class SettingsBindingWorkersBindingKindDurableObjectNamespace(TypedDict, total=F class_name: str """The exported class name of the Durable Object.""" + dispatch_namespace: str + """The dispatch namespace the Durable Object script belongs to.""" + environment: str """The environment of the script_name to bind to.""" @@ -344,7 +363,7 @@ class SettingsBindingWorkersBindingKindR2Bucket(TypedDict, total=False): type: Required[Literal["r2_bucket"]] """The kind of resource that the binding provides.""" - jurisdiction: Literal["eu", "fedramp"] + jurisdiction: Literal["eu", "fedramp", "fedramp-high"] """ The [jurisdiction](https://developers.cloudflare.com/r2/reference/data-location/#jurisdictional-restrictions) @@ -390,6 +409,9 @@ class SettingsBindingWorkersBindingKindService(TypedDict, total=False): type: Required[Literal["service"]] """The kind of resource that the binding provides.""" + entrypoint: str + """Entrypoint to invoke on the target Worker.""" + environment: str """Optional environment if the Worker utilizes one.""" @@ -516,6 +538,17 @@ class SettingsBindingWorkersBindingKindWasmModule(TypedDict, total=False): """The kind of resource that the binding provides.""" +class SettingsBindingWorkersBindingKindVPCService(TypedDict, total=False): + name: Required[str] + """A JavaScript variable name for the binding.""" + + service_id: Required[str] + """Identifier of the VPC service to bind to.""" + + type: Required[Literal["vpc_service"]] + """The kind of resource that the binding provides.""" + + SettingsBinding: TypeAlias = Union[ SettingsBindingWorkersBindingKindAI, SettingsBindingWorkersBindingKindAnalyticsEngine, @@ -546,6 +579,7 @@ class SettingsBindingWorkersBindingKindWasmModule(TypedDict, total=False): SettingsBindingWorkersBindingKindSecretKey, SettingsBindingWorkersBindingKindWorkflow, SettingsBindingWorkersBindingKindWasmModule, + SettingsBindingWorkersBindingKindVPCService, ] @@ -702,6 +736,13 @@ class SettingsPlacementUnionMember7(TypedDict, total=False): class Settings(TypedDict, total=False): + annotations: SettingsAnnotations + """Annotations for the Worker version. + + Annotations are not inherited across settings updates; omitting this field means + the new version will have no annotations. + """ + bindings: Iterable[SettingsBinding] """List of bindings attached to a Worker. 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 474b8062273..d3209933e88 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 @@ -12,6 +12,7 @@ __all__ = [ "ScriptAndVersionSettingEditResponse", + "Annotations", "Binding", "BindingWorkersBindingKindAI", "BindingWorkersBindingKindAnalyticsEngine", @@ -46,6 +47,7 @@ "BindingWorkersBindingKindSecretKey", "BindingWorkersBindingKindWorkflow", "BindingWorkersBindingKindWasmModule", + "BindingWorkersBindingKindVPCService", "Limits", "Migrations", "MigrationsWorkersMultipleStepMigrations", @@ -67,6 +69,25 @@ ] +class Annotations(BaseModel): + """Annotations for the Worker version. + + Annotations are not inherited across settings updates; omitting this field means the new version will have no annotations. + """ + + workers_message: Optional[str] = FieldInfo(alias="workers/message", default=None) + """Human-readable message about the version.""" + + workers_tag: Optional[str] = FieldInfo(alias="workers/tag", default=None) + """User-provided identifier for the version.""" + + workers_triggered_by: Optional[str] = FieldInfo(alias="workers/triggered_by", default=None) + """Operation that triggered the creation of the version. + + This is read-only and set by the server. + """ + + class BindingWorkersBindingKindAI(BaseModel): name: str """A JavaScript variable name for the binding.""" @@ -182,6 +203,9 @@ class BindingWorkersBindingKindDurableObjectNamespace(BaseModel): class_name: Optional[str] = None """The exported class name of the Durable Object.""" + dispatch_namespace: Optional[str] = None + """The dispatch namespace the Durable Object script belongs to.""" + environment: Optional[str] = None """The environment of the script_name to bind to.""" @@ -336,7 +360,7 @@ class BindingWorkersBindingKindR2Bucket(BaseModel): type: Literal["r2_bucket"] """The kind of resource that the binding provides.""" - jurisdiction: Optional[Literal["eu", "fedramp"]] = None + jurisdiction: Optional[Literal["eu", "fedramp", "fedramp-high"]] = None """ The [jurisdiction](https://developers.cloudflare.com/r2/reference/data-location/#jurisdictional-restrictions) @@ -379,6 +403,9 @@ class BindingWorkersBindingKindService(BaseModel): type: Literal["service"] """The kind of resource that the binding provides.""" + entrypoint: Optional[str] = None + """Entrypoint to invoke on the target Worker.""" + environment: Optional[str] = None """Optional environment if the Worker utilizes one.""" @@ -493,6 +520,17 @@ class BindingWorkersBindingKindWasmModule(BaseModel): """The kind of resource that the binding provides.""" +class BindingWorkersBindingKindVPCService(BaseModel): + name: str + """A JavaScript variable name for the binding.""" + + service_id: str + """Identifier of the VPC service to bind to.""" + + type: Literal["vpc_service"] + """The kind of resource that the binding provides.""" + + Binding: TypeAlias = Annotated[ Union[ BindingWorkersBindingKindAI, @@ -524,6 +562,7 @@ class BindingWorkersBindingKindWasmModule(BaseModel): BindingWorkersBindingKindSecretKey, BindingWorkersBindingKindWorkflow, BindingWorkersBindingKindWasmModule, + BindingWorkersBindingKindVPCService, ], PropertyInfo(discriminator="type"), ] @@ -670,6 +709,13 @@ class PlacementUnionMember7(BaseModel): class ScriptAndVersionSettingEditResponse(BaseModel): + annotations: Optional[Annotations] = None + """Annotations for the Worker version. + + Annotations are not inherited across settings updates; omitting this field means + the new version will have no annotations. + """ + bindings: Optional[List[Binding]] = None """List of bindings attached to a Worker. 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 d46d7ba022e..653d555b153 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 @@ -12,6 +12,7 @@ __all__ = [ "ScriptAndVersionSettingGetResponse", + "Annotations", "Binding", "BindingWorkersBindingKindAI", "BindingWorkersBindingKindAnalyticsEngine", @@ -46,6 +47,7 @@ "BindingWorkersBindingKindSecretKey", "BindingWorkersBindingKindWorkflow", "BindingWorkersBindingKindWasmModule", + "BindingWorkersBindingKindVPCService", "Limits", "Migrations", "MigrationsWorkersMultipleStepMigrations", @@ -67,6 +69,25 @@ ] +class Annotations(BaseModel): + """Annotations for the Worker version. + + Annotations are not inherited across settings updates; omitting this field means the new version will have no annotations. + """ + + workers_message: Optional[str] = FieldInfo(alias="workers/message", default=None) + """Human-readable message about the version.""" + + workers_tag: Optional[str] = FieldInfo(alias="workers/tag", default=None) + """User-provided identifier for the version.""" + + workers_triggered_by: Optional[str] = FieldInfo(alias="workers/triggered_by", default=None) + """Operation that triggered the creation of the version. + + This is read-only and set by the server. + """ + + class BindingWorkersBindingKindAI(BaseModel): name: str """A JavaScript variable name for the binding.""" @@ -182,6 +203,9 @@ class BindingWorkersBindingKindDurableObjectNamespace(BaseModel): class_name: Optional[str] = None """The exported class name of the Durable Object.""" + dispatch_namespace: Optional[str] = None + """The dispatch namespace the Durable Object script belongs to.""" + environment: Optional[str] = None """The environment of the script_name to bind to.""" @@ -336,7 +360,7 @@ class BindingWorkersBindingKindR2Bucket(BaseModel): type: Literal["r2_bucket"] """The kind of resource that the binding provides.""" - jurisdiction: Optional[Literal["eu", "fedramp"]] = None + jurisdiction: Optional[Literal["eu", "fedramp", "fedramp-high"]] = None """ The [jurisdiction](https://developers.cloudflare.com/r2/reference/data-location/#jurisdictional-restrictions) @@ -379,6 +403,9 @@ class BindingWorkersBindingKindService(BaseModel): type: Literal["service"] """The kind of resource that the binding provides.""" + entrypoint: Optional[str] = None + """Entrypoint to invoke on the target Worker.""" + environment: Optional[str] = None """Optional environment if the Worker utilizes one.""" @@ -493,6 +520,17 @@ class BindingWorkersBindingKindWasmModule(BaseModel): """The kind of resource that the binding provides.""" +class BindingWorkersBindingKindVPCService(BaseModel): + name: str + """A JavaScript variable name for the binding.""" + + service_id: str + """Identifier of the VPC service to bind to.""" + + type: Literal["vpc_service"] + """The kind of resource that the binding provides.""" + + Binding: TypeAlias = Annotated[ Union[ BindingWorkersBindingKindAI, @@ -524,6 +562,7 @@ class BindingWorkersBindingKindWasmModule(BaseModel): BindingWorkersBindingKindSecretKey, BindingWorkersBindingKindWorkflow, BindingWorkersBindingKindWasmModule, + BindingWorkersBindingKindVPCService, ], PropertyInfo(discriminator="type"), ] @@ -670,6 +709,13 @@ class PlacementUnionMember7(BaseModel): class ScriptAndVersionSettingGetResponse(BaseModel): + annotations: Optional[Annotations] = None + """Annotations for the Worker version. + + Annotations are not inherited across settings updates; omitting this field means + the new version will have no annotations. + """ + bindings: Optional[List[Binding]] = None """List of bindings attached to a Worker. diff --git a/src/cloudflare/types/workers/scripts/version_create_params.py b/src/cloudflare/types/workers/scripts/version_create_params.py index 2699aed3f2d..01055e64340 100644 --- a/src/cloudflare/types/workers/scripts/version_create_params.py +++ b/src/cloudflare/types/workers/scripts/version_create_params.py @@ -46,6 +46,7 @@ "MetadataBindingWorkersBindingKindSecretKey", "MetadataBindingWorkersBindingKindWorkflow", "MetadataBindingWorkersBindingKindWasmModule", + "MetadataBindingWorkersBindingKindVPCService", ] @@ -201,6 +202,9 @@ class MetadataBindingWorkersBindingKindDurableObjectNamespace(TypedDict, total=F class_name: str """The exported class name of the Durable Object.""" + dispatch_namespace: str + """The dispatch namespace the Durable Object script belongs to.""" + environment: str """The environment of the script_name to bind to.""" @@ -355,7 +359,7 @@ class MetadataBindingWorkersBindingKindR2Bucket(TypedDict, total=False): type: Required[Literal["r2_bucket"]] """The kind of resource that the binding provides.""" - jurisdiction: Literal["eu", "fedramp"] + jurisdiction: Literal["eu", "fedramp", "fedramp-high"] """ The [jurisdiction](https://developers.cloudflare.com/r2/reference/data-location/#jurisdictional-restrictions) @@ -401,6 +405,9 @@ class MetadataBindingWorkersBindingKindService(TypedDict, total=False): type: Required[Literal["service"]] """The kind of resource that the binding provides.""" + entrypoint: str + """Entrypoint to invoke on the target Worker.""" + environment: str """Optional environment if the Worker utilizes one.""" @@ -527,6 +534,17 @@ class MetadataBindingWorkersBindingKindWasmModule(TypedDict, total=False): """The kind of resource that the binding provides.""" +class MetadataBindingWorkersBindingKindVPCService(TypedDict, total=False): + name: Required[str] + """A JavaScript variable name for the binding.""" + + service_id: Required[str] + """Identifier of the VPC service to bind to.""" + + type: Required[Literal["vpc_service"]] + """The kind of resource that the binding provides.""" + + MetadataBinding: TypeAlias = Union[ MetadataBindingWorkersBindingKindAI, MetadataBindingWorkersBindingKindAnalyticsEngine, @@ -557,6 +575,7 @@ class MetadataBindingWorkersBindingKindWasmModule(TypedDict, total=False): MetadataBindingWorkersBindingKindSecretKey, MetadataBindingWorkersBindingKindWorkflow, MetadataBindingWorkersBindingKindWasmModule, + MetadataBindingWorkersBindingKindVPCService, ] diff --git a/src/cloudflare/types/workers/scripts/version_create_response.py b/src/cloudflare/types/workers/scripts/version_create_response.py index f71f14a2e21..5f332a4d2e0 100644 --- a/src/cloudflare/types/workers/scripts/version_create_response.py +++ b/src/cloudflare/types/workers/scripts/version_create_response.py @@ -45,6 +45,7 @@ "ResourcesBindingWorkersBindingKindSecretKey", "ResourcesBindingWorkersBindingKindWorkflow", "ResourcesBindingWorkersBindingKindWasmModule", + "ResourcesBindingWorkersBindingKindVPCService", "ResourcesScript", "ResourcesScriptNamedHandler", "ResourcesScriptRuntime", @@ -168,6 +169,9 @@ class ResourcesBindingWorkersBindingKindDurableObjectNamespace(BaseModel): class_name: Optional[str] = None """The exported class name of the Durable Object.""" + dispatch_namespace: Optional[str] = None + """The dispatch namespace the Durable Object script belongs to.""" + environment: Optional[str] = None """The environment of the script_name to bind to.""" @@ -322,7 +326,7 @@ class ResourcesBindingWorkersBindingKindR2Bucket(BaseModel): type: Literal["r2_bucket"] """The kind of resource that the binding provides.""" - jurisdiction: Optional[Literal["eu", "fedramp"]] = None + jurisdiction: Optional[Literal["eu", "fedramp", "fedramp-high"]] = None """ The [jurisdiction](https://developers.cloudflare.com/r2/reference/data-location/#jurisdictional-restrictions) @@ -365,6 +369,9 @@ class ResourcesBindingWorkersBindingKindService(BaseModel): type: Literal["service"] """The kind of resource that the binding provides.""" + entrypoint: Optional[str] = None + """Entrypoint to invoke on the target Worker.""" + environment: Optional[str] = None """Optional environment if the Worker utilizes one.""" @@ -479,6 +486,17 @@ class ResourcesBindingWorkersBindingKindWasmModule(BaseModel): """The kind of resource that the binding provides.""" +class ResourcesBindingWorkersBindingKindVPCService(BaseModel): + name: str + """A JavaScript variable name for the binding.""" + + service_id: str + """Identifier of the VPC service to bind to.""" + + type: Literal["vpc_service"] + """The kind of resource that the binding provides.""" + + ResourcesBinding: TypeAlias = Annotated[ Union[ ResourcesBindingWorkersBindingKindAI, @@ -510,6 +528,7 @@ class ResourcesBindingWorkersBindingKindWasmModule(BaseModel): ResourcesBindingWorkersBindingKindSecretKey, ResourcesBindingWorkersBindingKindWorkflow, ResourcesBindingWorkersBindingKindWasmModule, + ResourcesBindingWorkersBindingKindVPCService, ], PropertyInfo(discriminator="type"), ] diff --git a/src/cloudflare/types/workers/scripts/version_get_response.py b/src/cloudflare/types/workers/scripts/version_get_response.py index 29b55aa6a3d..6f48ed56d40 100644 --- a/src/cloudflare/types/workers/scripts/version_get_response.py +++ b/src/cloudflare/types/workers/scripts/version_get_response.py @@ -45,6 +45,7 @@ "ResourcesBindingWorkersBindingKindSecretKey", "ResourcesBindingWorkersBindingKindWorkflow", "ResourcesBindingWorkersBindingKindWasmModule", + "ResourcesBindingWorkersBindingKindVPCService", "ResourcesScript", "ResourcesScriptNamedHandler", "ResourcesScriptRuntime", @@ -168,6 +169,9 @@ class ResourcesBindingWorkersBindingKindDurableObjectNamespace(BaseModel): class_name: Optional[str] = None """The exported class name of the Durable Object.""" + dispatch_namespace: Optional[str] = None + """The dispatch namespace the Durable Object script belongs to.""" + environment: Optional[str] = None """The environment of the script_name to bind to.""" @@ -322,7 +326,7 @@ class ResourcesBindingWorkersBindingKindR2Bucket(BaseModel): type: Literal["r2_bucket"] """The kind of resource that the binding provides.""" - jurisdiction: Optional[Literal["eu", "fedramp"]] = None + jurisdiction: Optional[Literal["eu", "fedramp", "fedramp-high"]] = None """ The [jurisdiction](https://developers.cloudflare.com/r2/reference/data-location/#jurisdictional-restrictions) @@ -365,6 +369,9 @@ class ResourcesBindingWorkersBindingKindService(BaseModel): type: Literal["service"] """The kind of resource that the binding provides.""" + entrypoint: Optional[str] = None + """Entrypoint to invoke on the target Worker.""" + environment: Optional[str] = None """Optional environment if the Worker utilizes one.""" @@ -479,6 +486,17 @@ class ResourcesBindingWorkersBindingKindWasmModule(BaseModel): """The kind of resource that the binding provides.""" +class ResourcesBindingWorkersBindingKindVPCService(BaseModel): + name: str + """A JavaScript variable name for the binding.""" + + service_id: str + """Identifier of the VPC service to bind to.""" + + type: Literal["vpc_service"] + """The kind of resource that the binding provides.""" + + ResourcesBinding: TypeAlias = Annotated[ Union[ ResourcesBindingWorkersBindingKindAI, @@ -510,6 +528,7 @@ class ResourcesBindingWorkersBindingKindWasmModule(BaseModel): ResourcesBindingWorkersBindingKindSecretKey, ResourcesBindingWorkersBindingKindWorkflow, ResourcesBindingWorkersBindingKindWasmModule, + ResourcesBindingWorkersBindingKindVPCService, ], PropertyInfo(discriminator="type"), ] diff --git a/src/cloudflare/types/workers_for_platforms/dispatch/namespaces/script_update_params.py b/src/cloudflare/types/workers_for_platforms/dispatch/namespaces/script_update_params.py index fec52d30d9b..152550c0e6c 100644 --- a/src/cloudflare/types/workers_for_platforms/dispatch/namespaces/script_update_params.py +++ b/src/cloudflare/types/workers_for_platforms/dispatch/namespaces/script_update_params.py @@ -49,6 +49,7 @@ "MetadataBindingWorkersBindingKindSecretKey", "MetadataBindingWorkersBindingKindWorkflow", "MetadataBindingWorkersBindingKindWasmModule", + "MetadataBindingWorkersBindingKindVPCService", "MetadataLimits", "MetadataMigrations", "MetadataMigrationsWorkersMultipleStepMigrations", @@ -264,6 +265,9 @@ class MetadataBindingWorkersBindingKindDurableObjectNamespace(TypedDict, total=F class_name: str """The exported class name of the Durable Object.""" + dispatch_namespace: str + """The dispatch namespace the Durable Object script belongs to.""" + environment: str """The environment of the script_name to bind to.""" @@ -418,7 +422,7 @@ class MetadataBindingWorkersBindingKindR2Bucket(TypedDict, total=False): type: Required[Literal["r2_bucket"]] """The kind of resource that the binding provides.""" - jurisdiction: Literal["eu", "fedramp"] + jurisdiction: Literal["eu", "fedramp", "fedramp-high"] """ The [jurisdiction](https://developers.cloudflare.com/r2/reference/data-location/#jurisdictional-restrictions) @@ -464,6 +468,9 @@ class MetadataBindingWorkersBindingKindService(TypedDict, total=False): type: Required[Literal["service"]] """The kind of resource that the binding provides.""" + entrypoint: str + """Entrypoint to invoke on the target Worker.""" + environment: str """Optional environment if the Worker utilizes one.""" @@ -590,6 +597,17 @@ class MetadataBindingWorkersBindingKindWasmModule(TypedDict, total=False): """The kind of resource that the binding provides.""" +class MetadataBindingWorkersBindingKindVPCService(TypedDict, total=False): + name: Required[str] + """A JavaScript variable name for the binding.""" + + service_id: Required[str] + """Identifier of the VPC service to bind to.""" + + type: Required[Literal["vpc_service"]] + """The kind of resource that the binding provides.""" + + MetadataBinding: TypeAlias = Union[ MetadataBindingWorkersBindingKindAI, MetadataBindingWorkersBindingKindAnalyticsEngine, @@ -620,6 +638,7 @@ class MetadataBindingWorkersBindingKindWasmModule(TypedDict, total=False): MetadataBindingWorkersBindingKindSecretKey, MetadataBindingWorkersBindingKindWorkflow, MetadataBindingWorkersBindingKindWasmModule, + MetadataBindingWorkersBindingKindVPCService, ] diff --git a/src/cloudflare/types/workers_for_platforms/dispatch/namespaces/scripts/binding_get_response.py b/src/cloudflare/types/workers_for_platforms/dispatch/namespaces/scripts/binding_get_response.py index 3aa0ba5e4f7..442430ade1e 100644 --- a/src/cloudflare/types/workers_for_platforms/dispatch/namespaces/scripts/binding_get_response.py +++ b/src/cloudflare/types/workers_for_platforms/dispatch/namespaces/scripts/binding_get_response.py @@ -43,6 +43,7 @@ "WorkersBindingKindSecretKey", "WorkersBindingKindWorkflow", "WorkersBindingKindWasmModule", + "WorkersBindingKindVPCService", ] @@ -161,6 +162,9 @@ class WorkersBindingKindDurableObjectNamespace(BaseModel): class_name: Optional[str] = None """The exported class name of the Durable Object.""" + dispatch_namespace: Optional[str] = None + """The dispatch namespace the Durable Object script belongs to.""" + environment: Optional[str] = None """The environment of the script_name to bind to.""" @@ -315,7 +319,7 @@ class WorkersBindingKindR2Bucket(BaseModel): type: Literal["r2_bucket"] """The kind of resource that the binding provides.""" - jurisdiction: Optional[Literal["eu", "fedramp"]] = None + jurisdiction: Optional[Literal["eu", "fedramp", "fedramp-high"]] = None """ The [jurisdiction](https://developers.cloudflare.com/r2/reference/data-location/#jurisdictional-restrictions) @@ -358,6 +362,9 @@ class WorkersBindingKindService(BaseModel): type: Literal["service"] """The kind of resource that the binding provides.""" + entrypoint: Optional[str] = None + """Entrypoint to invoke on the target Worker.""" + environment: Optional[str] = None """Optional environment if the Worker utilizes one.""" @@ -472,6 +479,17 @@ class WorkersBindingKindWasmModule(BaseModel): """The kind of resource that the binding provides.""" +class WorkersBindingKindVPCService(BaseModel): + name: str + """A JavaScript variable name for the binding.""" + + service_id: str + """Identifier of the VPC service to bind to.""" + + type: Literal["vpc_service"] + """The kind of resource that the binding provides.""" + + BindingGetResponse: TypeAlias = Annotated[ Union[ WorkersBindingKindAI, @@ -503,6 +521,7 @@ class WorkersBindingKindWasmModule(BaseModel): WorkersBindingKindSecretKey, WorkersBindingKindWorkflow, WorkersBindingKindWasmModule, + WorkersBindingKindVPCService, ], PropertyInfo(discriminator="type"), ] diff --git a/src/cloudflare/types/workers_for_platforms/dispatch/namespaces/scripts/setting_edit_params.py b/src/cloudflare/types/workers_for_platforms/dispatch/namespaces/scripts/setting_edit_params.py index 54136c13b2a..73f93190e4d 100644 --- a/src/cloudflare/types/workers_for_platforms/dispatch/namespaces/scripts/setting_edit_params.py +++ b/src/cloudflare/types/workers_for_platforms/dispatch/namespaces/scripts/setting_edit_params.py @@ -47,6 +47,7 @@ "SettingsBindingWorkersBindingKindSecretKey", "SettingsBindingWorkersBindingKindWorkflow", "SettingsBindingWorkersBindingKindWasmModule", + "SettingsBindingWorkersBindingKindVPCService", "SettingsLimits", "SettingsMigrations", "SettingsMigrationsWorkersMultipleStepMigrations", @@ -76,6 +77,11 @@ class SettingEditParams(TypedDict, total=False): """Name of the Workers for Platforms dispatch namespace.""" settings: Settings + """Script and version settings for Workers for Platforms namespace scripts. + + Same as script-and-version-settings-item but without annotations, which are not + supported for namespace scripts. + """ class SettingsBindingWorkersBindingKindAI(TypedDict, total=False): @@ -193,6 +199,9 @@ class SettingsBindingWorkersBindingKindDurableObjectNamespace(TypedDict, total=F class_name: str """The exported class name of the Durable Object.""" + dispatch_namespace: str + """The dispatch namespace the Durable Object script belongs to.""" + environment: str """The environment of the script_name to bind to.""" @@ -347,7 +356,7 @@ class SettingsBindingWorkersBindingKindR2Bucket(TypedDict, total=False): type: Required[Literal["r2_bucket"]] """The kind of resource that the binding provides.""" - jurisdiction: Literal["eu", "fedramp"] + jurisdiction: Literal["eu", "fedramp", "fedramp-high"] """ The [jurisdiction](https://developers.cloudflare.com/r2/reference/data-location/#jurisdictional-restrictions) @@ -393,6 +402,9 @@ class SettingsBindingWorkersBindingKindService(TypedDict, total=False): type: Required[Literal["service"]] """The kind of resource that the binding provides.""" + entrypoint: str + """Entrypoint to invoke on the target Worker.""" + environment: str """Optional environment if the Worker utilizes one.""" @@ -519,6 +531,17 @@ class SettingsBindingWorkersBindingKindWasmModule(TypedDict, total=False): """The kind of resource that the binding provides.""" +class SettingsBindingWorkersBindingKindVPCService(TypedDict, total=False): + name: Required[str] + """A JavaScript variable name for the binding.""" + + service_id: Required[str] + """Identifier of the VPC service to bind to.""" + + type: Required[Literal["vpc_service"]] + """The kind of resource that the binding provides.""" + + SettingsBinding: TypeAlias = Union[ SettingsBindingWorkersBindingKindAI, SettingsBindingWorkersBindingKindAnalyticsEngine, @@ -549,6 +572,7 @@ class SettingsBindingWorkersBindingKindWasmModule(TypedDict, total=False): SettingsBindingWorkersBindingKindSecretKey, SettingsBindingWorkersBindingKindWorkflow, SettingsBindingWorkersBindingKindWasmModule, + SettingsBindingWorkersBindingKindVPCService, ] @@ -705,6 +729,11 @@ class SettingsPlacementUnionMember7(TypedDict, total=False): class Settings(TypedDict, total=False): + """Script and version settings for Workers for Platforms namespace scripts. + + Same as script-and-version-settings-item but without annotations, which are not supported for namespace scripts. + """ + bindings: Iterable[SettingsBinding] """List of bindings attached to a Worker. diff --git a/src/cloudflare/types/workers_for_platforms/dispatch/namespaces/scripts/setting_edit_response.py b/src/cloudflare/types/workers_for_platforms/dispatch/namespaces/scripts/setting_edit_response.py index 0b34a93f024..81e4c80873c 100644 --- a/src/cloudflare/types/workers_for_platforms/dispatch/namespaces/scripts/setting_edit_response.py +++ b/src/cloudflare/types/workers_for_platforms/dispatch/namespaces/scripts/setting_edit_response.py @@ -46,6 +46,7 @@ "BindingWorkersBindingKindSecretKey", "BindingWorkersBindingKindWorkflow", "BindingWorkersBindingKindWasmModule", + "BindingWorkersBindingKindVPCService", "Limits", "Migrations", "MigrationsWorkersMultipleStepMigrations", @@ -182,6 +183,9 @@ class BindingWorkersBindingKindDurableObjectNamespace(BaseModel): class_name: Optional[str] = None """The exported class name of the Durable Object.""" + dispatch_namespace: Optional[str] = None + """The dispatch namespace the Durable Object script belongs to.""" + environment: Optional[str] = None """The environment of the script_name to bind to.""" @@ -336,7 +340,7 @@ class BindingWorkersBindingKindR2Bucket(BaseModel): type: Literal["r2_bucket"] """The kind of resource that the binding provides.""" - jurisdiction: Optional[Literal["eu", "fedramp"]] = None + jurisdiction: Optional[Literal["eu", "fedramp", "fedramp-high"]] = None """ The [jurisdiction](https://developers.cloudflare.com/r2/reference/data-location/#jurisdictional-restrictions) @@ -379,6 +383,9 @@ class BindingWorkersBindingKindService(BaseModel): type: Literal["service"] """The kind of resource that the binding provides.""" + entrypoint: Optional[str] = None + """Entrypoint to invoke on the target Worker.""" + environment: Optional[str] = None """Optional environment if the Worker utilizes one.""" @@ -493,6 +500,17 @@ class BindingWorkersBindingKindWasmModule(BaseModel): """The kind of resource that the binding provides.""" +class BindingWorkersBindingKindVPCService(BaseModel): + name: str + """A JavaScript variable name for the binding.""" + + service_id: str + """Identifier of the VPC service to bind to.""" + + type: Literal["vpc_service"] + """The kind of resource that the binding provides.""" + + Binding: TypeAlias = Annotated[ Union[ BindingWorkersBindingKindAI, @@ -524,6 +542,7 @@ class BindingWorkersBindingKindWasmModule(BaseModel): BindingWorkersBindingKindSecretKey, BindingWorkersBindingKindWorkflow, BindingWorkersBindingKindWasmModule, + BindingWorkersBindingKindVPCService, ], PropertyInfo(discriminator="type"), ] @@ -670,6 +689,11 @@ class PlacementUnionMember7(BaseModel): class SettingEditResponse(BaseModel): + """Script and version settings for Workers for Platforms namespace scripts. + + Same as script-and-version-settings-item but without annotations, which are not supported for namespace scripts. + """ + bindings: Optional[List[Binding]] = None """List of bindings attached to a Worker. diff --git a/src/cloudflare/types/workers_for_platforms/dispatch/namespaces/scripts/setting_get_response.py b/src/cloudflare/types/workers_for_platforms/dispatch/namespaces/scripts/setting_get_response.py index 25727f31b5d..ff45b0b1dca 100644 --- a/src/cloudflare/types/workers_for_platforms/dispatch/namespaces/scripts/setting_get_response.py +++ b/src/cloudflare/types/workers_for_platforms/dispatch/namespaces/scripts/setting_get_response.py @@ -46,6 +46,7 @@ "BindingWorkersBindingKindSecretKey", "BindingWorkersBindingKindWorkflow", "BindingWorkersBindingKindWasmModule", + "BindingWorkersBindingKindVPCService", "Limits", "Migrations", "MigrationsWorkersMultipleStepMigrations", @@ -182,6 +183,9 @@ class BindingWorkersBindingKindDurableObjectNamespace(BaseModel): class_name: Optional[str] = None """The exported class name of the Durable Object.""" + dispatch_namespace: Optional[str] = None + """The dispatch namespace the Durable Object script belongs to.""" + environment: Optional[str] = None """The environment of the script_name to bind to.""" @@ -336,7 +340,7 @@ class BindingWorkersBindingKindR2Bucket(BaseModel): type: Literal["r2_bucket"] """The kind of resource that the binding provides.""" - jurisdiction: Optional[Literal["eu", "fedramp"]] = None + jurisdiction: Optional[Literal["eu", "fedramp", "fedramp-high"]] = None """ The [jurisdiction](https://developers.cloudflare.com/r2/reference/data-location/#jurisdictional-restrictions) @@ -379,6 +383,9 @@ class BindingWorkersBindingKindService(BaseModel): type: Literal["service"] """The kind of resource that the binding provides.""" + entrypoint: Optional[str] = None + """Entrypoint to invoke on the target Worker.""" + environment: Optional[str] = None """Optional environment if the Worker utilizes one.""" @@ -493,6 +500,17 @@ class BindingWorkersBindingKindWasmModule(BaseModel): """The kind of resource that the binding provides.""" +class BindingWorkersBindingKindVPCService(BaseModel): + name: str + """A JavaScript variable name for the binding.""" + + service_id: str + """Identifier of the VPC service to bind to.""" + + type: Literal["vpc_service"] + """The kind of resource that the binding provides.""" + + Binding: TypeAlias = Annotated[ Union[ BindingWorkersBindingKindAI, @@ -524,6 +542,7 @@ class BindingWorkersBindingKindWasmModule(BaseModel): BindingWorkersBindingKindSecretKey, BindingWorkersBindingKindWorkflow, BindingWorkersBindingKindWasmModule, + BindingWorkersBindingKindVPCService, ], PropertyInfo(discriminator="type"), ] @@ -670,6 +689,11 @@ class PlacementUnionMember7(BaseModel): class SettingGetResponse(BaseModel): + """Script and version settings for Workers for Platforms namespace scripts. + + Same as script-and-version-settings-item but without annotations, which are not supported for namespace scripts. + """ + bindings: Optional[List[Binding]] = None """List of bindings attached to a Worker. diff --git a/tests/api_resources/workers/beta/test_workers.py b/tests/api_resources/workers/beta/test_workers.py index e6b2b864e3a..fe8e46b1d3e 100644 --- a/tests/api_resources/workers/beta/test_workers.py +++ b/tests/api_resources/workers/beta/test_workers.py @@ -182,6 +182,8 @@ def test_method_list(self, client: Cloudflare) -> None: def test_method_list_with_all_params(self, client: Cloudflare) -> None: worker = client.workers.beta.workers.list( account_id="023e105f4ecef8ad9ca31a8372d0c353", + order="asc", + order_by="deployed_on", page=1, per_page=1, ) @@ -584,6 +586,8 @@ async def test_method_list(self, async_client: AsyncCloudflare) -> None: async def test_method_list_with_all_params(self, async_client: AsyncCloudflare) -> None: worker = await async_client.workers.beta.workers.list( account_id="023e105f4ecef8ad9ca31a8372d0c353", + order="asc", + order_by="deployed_on", page=1, per_page=1, ) diff --git a/tests/api_resources/workers/scripts/test_script_and_version_settings.py b/tests/api_resources/workers/scripts/test_script_and_version_settings.py index 82a6d0cd8dd..ecff3e9309b 100644 --- a/tests/api_resources/workers/scripts/test_script_and_version_settings.py +++ b/tests/api_resources/workers/scripts/test_script_and_version_settings.py @@ -36,6 +36,10 @@ def test_method_edit_with_all_params(self, client: Cloudflare) -> None: script_name="this-is_my_script-01", account_id="023e105f4ecef8ad9ca31a8372d0c353", settings={ + "annotations": { + "workers_message": "Fixed bug.", + "workers_tag": "v1.0.1", + }, "bindings": [ { "name": "MY_ENV_VAR", @@ -205,6 +209,10 @@ async def test_method_edit_with_all_params(self, async_client: AsyncCloudflare) script_name="this-is_my_script-01", account_id="023e105f4ecef8ad9ca31a8372d0c353", settings={ + "annotations": { + "workers_message": "Fixed bug.", + "workers_tag": "v1.0.1", + }, "bindings": [ { "name": "MY_ENV_VAR", From f29b33744ed37da97c8d3f34df1bb285b1d0164a Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 6 Mar 2026 17:54:50 +0000 Subject: [PATCH 063/279] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index f6757e5d87e..978f48a1b7a 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 2058 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-2c12b5f906dc770f62aa0a53f87f1c3568e6f0b6952a5fd44befba8c24cd1510.yml -openapi_spec_hash: 7fde83a4f201200d77ad6e995ad04527 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-dc22e14b0568d616f1e08f2f82b1febe001510fc80066496c7d17b8a6bd900a5.yml +openapi_spec_hash: 4dcf3938180ca7b58a8ea77959a52a35 config_hash: be75bee0df4cf361df49284b77afc8a4 From 3e08ae0c9f66f347b428d064d657ef7b76884d4b Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 6 Mar 2026 19:12:08 +0000 Subject: [PATCH 064/279] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 978f48a1b7a..8b7129eed28 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 2058 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-dc22e14b0568d616f1e08f2f82b1febe001510fc80066496c7d17b8a6bd900a5.yml -openapi_spec_hash: 4dcf3938180ca7b58a8ea77959a52a35 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-2c9b08cacdeceaf19c73d98cb2262ebc8fe74b5658f6474a66186e419daa53a1.yml +openapi_spec_hash: f785a922c560f4e9b0b7f2487ae9aa36 config_hash: be75bee0df4cf361df49284b77afc8a4 From f7bd429f3d293d5b5d8cb961b023e2b21c4d3cbb Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 9 Mar 2026 10:07:10 +0000 Subject: [PATCH 065/279] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 8b7129eed28..8b7d38ed197 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 2058 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-2c9b08cacdeceaf19c73d98cb2262ebc8fe74b5658f6474a66186e419daa53a1.yml -openapi_spec_hash: f785a922c560f4e9b0b7f2487ae9aa36 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-a96e5c2f45b3e3bc42edb93ed34664ff1b5bd4e9b26239e048d5d037049fdf16.yml +openapi_spec_hash: afdbc3f2a0e2e27980e581bbc85530b3 config_hash: be75bee0df4cf361df49284b77afc8a4 From 22abcb99b9a961325ead049e3da68e4e9db502f2 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 9 Mar 2026 16:01:27 +0000 Subject: [PATCH 066/279] chore(api): update composite API spec --- .stats.yml | 4 ++-- src/cloudflare/resources/resource_sharing/resource_sharing.py | 2 -- src/cloudflare/resources/resource_sharing/resources.py | 4 ---- .../types/resource_sharing/resource_create_params.py | 1 - .../types/resource_sharing/resource_create_response.py | 1 - .../types/resource_sharing/resource_delete_response.py | 1 - .../types/resource_sharing/resource_get_response.py | 1 - src/cloudflare/types/resource_sharing/resource_list_params.py | 1 - .../types/resource_sharing/resource_list_response.py | 1 - .../types/resource_sharing/resource_sharing_create_params.py | 1 - .../resource_sharing/resource_sharing_create_response.py | 1 - .../resource_sharing/resource_sharing_delete_response.py | 1 - .../types/resource_sharing/resource_sharing_get_response.py | 1 - .../types/resource_sharing/resource_sharing_list_params.py | 1 - .../types/resource_sharing/resource_sharing_list_response.py | 1 - .../resource_sharing/resource_sharing_update_response.py | 1 - .../types/resource_sharing/resource_update_response.py | 1 - 17 files changed, 2 insertions(+), 22 deletions(-) diff --git a/.stats.yml b/.stats.yml index 8b7d38ed197..e3468e4dd47 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 2058 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-a96e5c2f45b3e3bc42edb93ed34664ff1b5bd4e9b26239e048d5d037049fdf16.yml -openapi_spec_hash: afdbc3f2a0e2e27980e581bbc85530b3 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-f24a76c0a6941d97a4d47ea6b183ce23f19586e95f306236b31841300e2dfbaf.yml +openapi_spec_hash: e24fc4a0d49c7fcd0461f8739af6e438 config_hash: be75bee0df4cf361df49284b77afc8a4 diff --git a/src/cloudflare/resources/resource_sharing/resource_sharing.py b/src/cloudflare/resources/resource_sharing/resource_sharing.py index 0ad7712a109..9de8b13def7 100644 --- a/src/cloudflare/resources/resource_sharing/resource_sharing.py +++ b/src/cloudflare/resources/resource_sharing/resource_sharing.py @@ -195,7 +195,6 @@ def list( resource_types: List[ Literal[ "custom-ruleset", - "widget", "gateway-policy", "gateway-destination-ip", "gateway-block-page-settings", @@ -524,7 +523,6 @@ def list( resource_types: List[ Literal[ "custom-ruleset", - "widget", "gateway-policy", "gateway-destination-ip", "gateway-block-page-settings", diff --git a/src/cloudflare/resources/resource_sharing/resources.py b/src/cloudflare/resources/resource_sharing/resources.py index 98f316493b6..b8609ba1b6b 100644 --- a/src/cloudflare/resources/resource_sharing/resources.py +++ b/src/cloudflare/resources/resource_sharing/resources.py @@ -60,7 +60,6 @@ def create( resource_id: str, resource_type: Literal[ "custom-ruleset", - "widget", "gateway-policy", "gateway-destination-ip", "gateway-block-page-settings", @@ -185,7 +184,6 @@ def list( per_page: int | Omit = omit, resource_type: Literal[ "custom-ruleset", - "widget", "gateway-policy", "gateway-destination-ip", "gateway-block-page-settings", @@ -379,7 +377,6 @@ async def create( resource_id: str, resource_type: Literal[ "custom-ruleset", - "widget", "gateway-policy", "gateway-destination-ip", "gateway-block-page-settings", @@ -504,7 +501,6 @@ def list( per_page: int | Omit = omit, resource_type: Literal[ "custom-ruleset", - "widget", "gateway-policy", "gateway-destination-ip", "gateway-block-page-settings", diff --git a/src/cloudflare/types/resource_sharing/resource_create_params.py b/src/cloudflare/types/resource_sharing/resource_create_params.py index 7af68bcd22e..a5b1f95764f 100644 --- a/src/cloudflare/types/resource_sharing/resource_create_params.py +++ b/src/cloudflare/types/resource_sharing/resource_create_params.py @@ -23,7 +23,6 @@ class ResourceCreateParams(TypedDict, total=False): resource_type: Required[ Literal[ "custom-ruleset", - "widget", "gateway-policy", "gateway-destination-ip", "gateway-block-page-settings", diff --git a/src/cloudflare/types/resource_sharing/resource_create_response.py b/src/cloudflare/types/resource_sharing/resource_create_response.py index 9f873832a6a..9100a80af02 100644 --- a/src/cloudflare/types/resource_sharing/resource_create_response.py +++ b/src/cloudflare/types/resource_sharing/resource_create_response.py @@ -29,7 +29,6 @@ class ResourceCreateResponse(BaseModel): resource_type: Literal[ "custom-ruleset", - "widget", "gateway-policy", "gateway-destination-ip", "gateway-block-page-settings", diff --git a/src/cloudflare/types/resource_sharing/resource_delete_response.py b/src/cloudflare/types/resource_sharing/resource_delete_response.py index 5e2f119697b..d1ddf972f39 100644 --- a/src/cloudflare/types/resource_sharing/resource_delete_response.py +++ b/src/cloudflare/types/resource_sharing/resource_delete_response.py @@ -29,7 +29,6 @@ class ResourceDeleteResponse(BaseModel): resource_type: Literal[ "custom-ruleset", - "widget", "gateway-policy", "gateway-destination-ip", "gateway-block-page-settings", diff --git a/src/cloudflare/types/resource_sharing/resource_get_response.py b/src/cloudflare/types/resource_sharing/resource_get_response.py index f161e8cd9cb..1eeb5c85987 100644 --- a/src/cloudflare/types/resource_sharing/resource_get_response.py +++ b/src/cloudflare/types/resource_sharing/resource_get_response.py @@ -29,7 +29,6 @@ class ResourceGetResponse(BaseModel): resource_type: Literal[ "custom-ruleset", - "widget", "gateway-policy", "gateway-destination-ip", "gateway-block-page-settings", diff --git a/src/cloudflare/types/resource_sharing/resource_list_params.py b/src/cloudflare/types/resource_sharing/resource_list_params.py index 02e586eb9c4..cad9c27cae1 100644 --- a/src/cloudflare/types/resource_sharing/resource_list_params.py +++ b/src/cloudflare/types/resource_sharing/resource_list_params.py @@ -19,7 +19,6 @@ class ResourceListParams(TypedDict, total=False): resource_type: Literal[ "custom-ruleset", - "widget", "gateway-policy", "gateway-destination-ip", "gateway-block-page-settings", diff --git a/src/cloudflare/types/resource_sharing/resource_list_response.py b/src/cloudflare/types/resource_sharing/resource_list_response.py index 7fd2ef4ec7c..bfda9a7d3da 100644 --- a/src/cloudflare/types/resource_sharing/resource_list_response.py +++ b/src/cloudflare/types/resource_sharing/resource_list_response.py @@ -29,7 +29,6 @@ class ResourceListResponse(BaseModel): resource_type: Literal[ "custom-ruleset", - "widget", "gateway-policy", "gateway-destination-ip", "gateway-block-page-settings", diff --git a/src/cloudflare/types/resource_sharing/resource_sharing_create_params.py b/src/cloudflare/types/resource_sharing/resource_sharing_create_params.py index d548d0941f9..d5adacfdba7 100644 --- a/src/cloudflare/types/resource_sharing/resource_sharing_create_params.py +++ b/src/cloudflare/types/resource_sharing/resource_sharing_create_params.py @@ -43,7 +43,6 @@ class Resource(TypedDict, total=False): resource_type: Required[ Literal[ "custom-ruleset", - "widget", "gateway-policy", "gateway-destination-ip", "gateway-block-page-settings", diff --git a/src/cloudflare/types/resource_sharing/resource_sharing_create_response.py b/src/cloudflare/types/resource_sharing/resource_sharing_create_response.py index d8821d70438..c0b6774c64e 100644 --- a/src/cloudflare/types/resource_sharing/resource_sharing_create_response.py +++ b/src/cloudflare/types/resource_sharing/resource_sharing_create_response.py @@ -30,7 +30,6 @@ class Resource(BaseModel): resource_type: Literal[ "custom-ruleset", - "widget", "gateway-policy", "gateway-destination-ip", "gateway-block-page-settings", diff --git a/src/cloudflare/types/resource_sharing/resource_sharing_delete_response.py b/src/cloudflare/types/resource_sharing/resource_sharing_delete_response.py index 764c032b5a9..c3cd3665093 100644 --- a/src/cloudflare/types/resource_sharing/resource_sharing_delete_response.py +++ b/src/cloudflare/types/resource_sharing/resource_sharing_delete_response.py @@ -30,7 +30,6 @@ class Resource(BaseModel): resource_type: Literal[ "custom-ruleset", - "widget", "gateway-policy", "gateway-destination-ip", "gateway-block-page-settings", diff --git a/src/cloudflare/types/resource_sharing/resource_sharing_get_response.py b/src/cloudflare/types/resource_sharing/resource_sharing_get_response.py index ee3d93457ec..2a3cdc1c320 100644 --- a/src/cloudflare/types/resource_sharing/resource_sharing_get_response.py +++ b/src/cloudflare/types/resource_sharing/resource_sharing_get_response.py @@ -30,7 +30,6 @@ class Resource(BaseModel): resource_type: Literal[ "custom-ruleset", - "widget", "gateway-policy", "gateway-destination-ip", "gateway-block-page-settings", diff --git a/src/cloudflare/types/resource_sharing/resource_sharing_list_params.py b/src/cloudflare/types/resource_sharing/resource_sharing_list_params.py index fc18c2f88d5..5b96649e2c3 100644 --- a/src/cloudflare/types/resource_sharing/resource_sharing_list_params.py +++ b/src/cloudflare/types/resource_sharing/resource_sharing_list_params.py @@ -36,7 +36,6 @@ class ResourceSharingListParams(TypedDict, total=False): resource_types: List[ Literal[ "custom-ruleset", - "widget", "gateway-policy", "gateway-destination-ip", "gateway-block-page-settings", diff --git a/src/cloudflare/types/resource_sharing/resource_sharing_list_response.py b/src/cloudflare/types/resource_sharing/resource_sharing_list_response.py index 6f5e2e494b7..4a89eb0af47 100644 --- a/src/cloudflare/types/resource_sharing/resource_sharing_list_response.py +++ b/src/cloudflare/types/resource_sharing/resource_sharing_list_response.py @@ -30,7 +30,6 @@ class Resource(BaseModel): resource_type: Literal[ "custom-ruleset", - "widget", "gateway-policy", "gateway-destination-ip", "gateway-block-page-settings", diff --git a/src/cloudflare/types/resource_sharing/resource_sharing_update_response.py b/src/cloudflare/types/resource_sharing/resource_sharing_update_response.py index 09ce8b67436..f8cf8f102b8 100644 --- a/src/cloudflare/types/resource_sharing/resource_sharing_update_response.py +++ b/src/cloudflare/types/resource_sharing/resource_sharing_update_response.py @@ -30,7 +30,6 @@ class Resource(BaseModel): resource_type: Literal[ "custom-ruleset", - "widget", "gateway-policy", "gateway-destination-ip", "gateway-block-page-settings", diff --git a/src/cloudflare/types/resource_sharing/resource_update_response.py b/src/cloudflare/types/resource_sharing/resource_update_response.py index 4d8f24e508b..0d53b6b87f1 100644 --- a/src/cloudflare/types/resource_sharing/resource_update_response.py +++ b/src/cloudflare/types/resource_sharing/resource_update_response.py @@ -29,7 +29,6 @@ class ResourceUpdateResponse(BaseModel): resource_type: Literal[ "custom-ruleset", - "widget", "gateway-policy", "gateway-destination-ip", "gateway-block-page-settings", From 9c384f3e631356c5e279eda869fec3295251a53c Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 9 Mar 2026 20:05:39 +0000 Subject: [PATCH 067/279] chore(api): update composite API spec --- .stats.yml | 4 ++-- .../custom_certificates/custom_certificates.py | 16 ++++++++++++++++ .../custom_certificates/custom_certificate.py | 3 +++ .../custom_certificate_create_params.py | 3 +++ .../custom_certificate_edit_params.py | 3 +++ .../custom_hostname_create_params.py | 3 +++ .../custom_hostname_edit_params.py | 3 +++ tests/api_resources/test_custom_certificates.py | 4 ++++ tests/api_resources/test_custom_hostnames.py | 4 ++++ 9 files changed, 41 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index e3468e4dd47..14dc14ef38d 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 2058 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-f24a76c0a6941d97a4d47ea6b183ce23f19586e95f306236b31841300e2dfbaf.yml -openapi_spec_hash: e24fc4a0d49c7fcd0461f8739af6e438 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-9a7a8994b197af9edac0674bc944bf99933837ac82cbba7991d006b2127cf6a9.yml +openapi_spec_hash: 54fc6d81dcb49dd26c7ba06d7ec0611b config_hash: be75bee0df4cf361df49284b77afc8a4 diff --git a/src/cloudflare/resources/custom_certificates/custom_certificates.py b/src/cloudflare/resources/custom_certificates/custom_certificates.py index 2e9c11871fd..f2819fb3a5f 100644 --- a/src/cloudflare/resources/custom_certificates/custom_certificates.py +++ b/src/cloudflare/resources/custom_certificates/custom_certificates.py @@ -73,6 +73,7 @@ def create( certificate: str, private_key: str, bundle_method: BundleMethod | Omit = omit, + custom_csr_id: str | Omit = omit, deploy: Literal["staging", "production"] | Omit = omit, geo_restrictions: GeoRestrictionsParam | Omit = omit, policy: str | Omit = omit, @@ -99,6 +100,8 @@ def create( the shortest chain and newest intermediates. And the force bundle verifies the chain, but does not otherwise modify it. + custom_csr_id: The identifier for the Custom CSR that was used. + deploy: The environment to deploy the certificate to, defaults to production geo_restrictions: Specify the region where your private key can be held locally for optimal TLS @@ -141,6 +144,7 @@ def create( "certificate": certificate, "private_key": private_key, "bundle_method": bundle_method, + "custom_csr_id": custom_csr_id, "deploy": deploy, "geo_restrictions": geo_restrictions, "policy": policy, @@ -276,6 +280,7 @@ def edit( zone_id: str, bundle_method: BundleMethod | Omit = omit, certificate: str | Omit = omit, + custom_csr_id: str | Omit = omit, deploy: Literal["staging", "production"] | Omit = omit, geo_restrictions: GeoRestrictionsParam | Omit = omit, policy: str | Omit = omit, @@ -305,6 +310,8 @@ def edit( certificate: The zone's SSL certificate or certificate and the intermediate(s). + custom_csr_id: The identifier for the Custom CSR that was used. + deploy: The environment to deploy the certificate to, defaults to production geo_restrictions: Specify the region where your private key can be held locally for optimal TLS @@ -349,6 +356,7 @@ def edit( { "bundle_method": bundle_method, "certificate": certificate, + "custom_csr_id": custom_csr_id, "deploy": deploy, "geo_restrictions": geo_restrictions, "policy": policy, @@ -446,6 +454,7 @@ async def create( certificate: str, private_key: str, bundle_method: BundleMethod | Omit = omit, + custom_csr_id: str | Omit = omit, deploy: Literal["staging", "production"] | Omit = omit, geo_restrictions: GeoRestrictionsParam | Omit = omit, policy: str | Omit = omit, @@ -472,6 +481,8 @@ async def create( the shortest chain and newest intermediates. And the force bundle verifies the chain, but does not otherwise modify it. + custom_csr_id: The identifier for the Custom CSR that was used. + deploy: The environment to deploy the certificate to, defaults to production geo_restrictions: Specify the region where your private key can be held locally for optimal TLS @@ -514,6 +525,7 @@ async def create( "certificate": certificate, "private_key": private_key, "bundle_method": bundle_method, + "custom_csr_id": custom_csr_id, "deploy": deploy, "geo_restrictions": geo_restrictions, "policy": policy, @@ -649,6 +661,7 @@ async def edit( zone_id: str, bundle_method: BundleMethod | Omit = omit, certificate: str | Omit = omit, + custom_csr_id: str | Omit = omit, deploy: Literal["staging", "production"] | Omit = omit, geo_restrictions: GeoRestrictionsParam | Omit = omit, policy: str | Omit = omit, @@ -678,6 +691,8 @@ async def edit( certificate: The zone's SSL certificate or certificate and the intermediate(s). + custom_csr_id: The identifier for the Custom CSR that was used. + deploy: The environment to deploy the certificate to, defaults to production geo_restrictions: Specify the region where your private key can be held locally for optimal TLS @@ -722,6 +737,7 @@ async def edit( { "bundle_method": bundle_method, "certificate": certificate, + "custom_csr_id": custom_csr_id, "deploy": deploy, "geo_restrictions": geo_restrictions, "policy": policy, diff --git a/src/cloudflare/types/custom_certificates/custom_certificate.py b/src/cloudflare/types/custom_certificates/custom_certificate.py index 7e148bfd616..1a592ebcda4 100644 --- a/src/cloudflare/types/custom_certificates/custom_certificate.py +++ b/src/cloudflare/types/custom_certificates/custom_certificate.py @@ -27,6 +27,9 @@ class CustomCertificate(BaseModel): chain, but does not otherwise modify it. """ + custom_csr_id: Optional[str] = None + """The identifier for the Custom CSR that was used.""" + expires_on: Optional[datetime] = None """When the certificate from the authority expires.""" diff --git a/src/cloudflare/types/custom_certificates/custom_certificate_create_params.py b/src/cloudflare/types/custom_certificates/custom_certificate_create_params.py index a5de8bba80e..d63b4653aa7 100644 --- a/src/cloudflare/types/custom_certificates/custom_certificate_create_params.py +++ b/src/cloudflare/types/custom_certificates/custom_certificate_create_params.py @@ -28,6 +28,9 @@ class CustomCertificateCreateParams(TypedDict, total=False): chain, but does not otherwise modify it. """ + custom_csr_id: str + """The identifier for the Custom CSR that was used.""" + deploy: Literal["staging", "production"] """The environment to deploy the certificate to, defaults to production""" diff --git a/src/cloudflare/types/custom_certificates/custom_certificate_edit_params.py b/src/cloudflare/types/custom_certificates/custom_certificate_edit_params.py index e94fb516789..c9bfbfc785e 100644 --- a/src/cloudflare/types/custom_certificates/custom_certificate_edit_params.py +++ b/src/cloudflare/types/custom_certificates/custom_certificate_edit_params.py @@ -25,6 +25,9 @@ class CustomCertificateEditParams(TypedDict, total=False): certificate: str """The zone's SSL certificate or certificate and the intermediate(s).""" + custom_csr_id: str + """The identifier for the Custom CSR that was used.""" + deploy: Literal["staging", "production"] """The environment to deploy the certificate to, defaults to production""" diff --git a/src/cloudflare/types/custom_hostnames/custom_hostname_create_params.py b/src/cloudflare/types/custom_hostnames/custom_hostname_create_params.py index bb62627ca00..7def1e47df9 100644 --- a/src/cloudflare/types/custom_hostnames/custom_hostname_create_params.py +++ b/src/cloudflare/types/custom_hostnames/custom_hostname_create_params.py @@ -88,6 +88,9 @@ class SSL(TypedDict, total=False): custom_certificate: str """If a custom uploaded certificate is used.""" + custom_csr_id: str + """The identifier for the Custom CSR that was used.""" + custom_key: str """The key for a custom uploaded certificate.""" diff --git a/src/cloudflare/types/custom_hostnames/custom_hostname_edit_params.py b/src/cloudflare/types/custom_hostnames/custom_hostname_edit_params.py index 027a31dcd58..9372bd89fa1 100644 --- a/src/cloudflare/types/custom_hostnames/custom_hostname_edit_params.py +++ b/src/cloudflare/types/custom_hostnames/custom_hostname_edit_params.py @@ -100,6 +100,9 @@ class SSL(TypedDict, total=False): custom_certificate: str """If a custom uploaded certificate is used.""" + custom_csr_id: str + """The identifier for the Custom CSR that was used.""" + custom_key: str """The key for a custom uploaded certificate.""" diff --git a/tests/api_resources/test_custom_certificates.py b/tests/api_resources/test_custom_certificates.py index 3109f005ac6..9b7e3939a74 100644 --- a/tests/api_resources/test_custom_certificates.py +++ b/tests/api_resources/test_custom_certificates.py @@ -37,6 +37,7 @@ def test_method_create_with_all_params(self, client: Cloudflare) -> None: certificate="-----BEGIN CERTIFICATE-----\nMIIDtTCCAp2gAwIBAgIJAMHAwfXZ5/PWMA0GCSqGSIb3DQEBCwUAMEUxCzAJBgNV\nBAYTAkFVMRMwEQYDVQQIEwpTb21lLVN0YXRlMSEwHwYDVQQKExhJbnRlcm5ldCBX\naWRnaXRzIFB0eSBMdGQwHhcNMTYwODI0MTY0MzAxWhcNMTYxMTIyMTY0MzAxWjBF\nMQswCQYDVQQGEwJBVTETMBEGA1UECBMKU29tZS1TdGF0ZTEhMB8GA1UEChMYSW50\nZXJuZXQgV2lkZ2l0cyBQdHkgTHRkMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIB\nCgKCAQEAwQHoetcl9+5ikGzV6cMzWtWPJHqXT3wpbEkRU9Yz7lgvddmGdtcGbg/1\nCGZu0jJGkMoppoUo4c3dts3iwqRYmBikUP77wwY2QGmDZw2FvkJCJlKnabIRuGvB\nKwzESIXgKk2016aTP6/dAjEHyo6SeoK8lkIySUvK0fyOVlsiEsCmOpidtnKX/a+5\n0GjB79CJH4ER2lLVZnhePFR/zUOyPxZQQ4naHf7yu/b5jhO0f8fwt+pyFxIXjbEI\ndZliWRkRMtzrHOJIhrmJ2A1J7iOrirbbwillwjjNVUWPf3IJ3M12S9pEewooaeO2\nizNTERcG9HzAacbVRn2Y2SWIyT/18QIDAQABo4GnMIGkMB0GA1UdDgQWBBT/LbE4\n9rWf288N6sJA5BRb6FJIGDB1BgNVHSMEbjBsgBT/LbE49rWf288N6sJA5BRb6FJI\nGKFJpEcwRTELMAkGA1UEBhMCQVUxEzARBgNVBAgTClNvbWUtU3RhdGUxITAfBgNV\nBAoTGEludGVybmV0IFdpZGdpdHMgUHR5IEx0ZIIJAMHAwfXZ5/PWMAwGA1UdEwQF\nMAMBAf8wDQYJKoZIhvcNAQELBQADggEBAHHFwl0tH0quUYZYO0dZYt4R7SJ0pCm2\n2satiyzHl4OnXcHDpekAo7/a09c6Lz6AU83cKy/+x3/djYHXWba7HpEu0dR3ugQP\nMlr4zrhd9xKZ0KZKiYmtJH+ak4OM4L3FbT0owUZPyjLSlhMtJVcoRp5CJsjAMBUG\nSvD8RX+T01wzox/Qb+lnnNnOlaWpqu8eoOenybxKp1a9ULzIVvN/LAcc+14vioFq\n2swRWtmocBAs8QR9n4uvbpiYvS8eYueDCWMM4fvFfBhaDZ3N9IbtySh3SpFdQDhw\nYbjM2rxXiyLGxB4Bol7QTv4zHif7Zt89FReT/NBy4rzaskDJY5L6xmY=\n-----END CERTIFICATE-----\n", private_key="-----BEGIN RSA PRIVATE KEY-----\nMIIEowIBAAKCAQEAwQHoetcl9+5ikGzV6cMzWtWPJHqXT3wpbEkRU9Yz7lgvddmG\ndtcGbg/1CGZu0jJGkMoppoUo4c3dts3iwqRYmBikUP77wwY2QGmDZw2FvkJCJlKn\nabIRuGvBKwzESIXgKk2016aTP6/dAjEHyo6SeoK8lkIySUvK0fyOVlsiEsCmOpid\ntnKX/a+50GjB79CJH4ER2lLVZnhePFR/zUOyPxZQQ4naHf7yu/b5jhO0f8fwt+py\nFxIXjbEIdZliWRkRMtzrHOJIhrmJ2A1J7iOrirbbwillwjjNVUWPf3IJ3M12S9pE\newooaeO2izNTERcG9HzAacbVRn2Y2SWIyT/18QIDAQABAoIBACbhTYXBZYKmYPCb\nHBR1IBlCQA2nLGf0qRuJNJZg5iEzXows/6tc8YymZkQE7nolapWsQ+upk2y5Xdp/\naxiuprIs9JzkYK8Ox0r+dlwCG1kSW+UAbX0bQ/qUqlsTvU6muVuMP8vZYHxJ3wmb\n+ufRBKztPTQ/rYWaYQcgC0RWI20HTFBMxlTAyNxYNWzX7RKFkGVVyB9RsAtmcc8g\n+j4OdosbfNoJPS0HeIfNpAznDfHKdxDk2Yc1tV6RHBrC1ynyLE9+TaflIAdo2MVv\nKLMLq51GqYKtgJFIlBRPQqKoyXdz3fGvXrTkf/WY9QNq0J1Vk5ERePZ54mN8iZB7\n9lwy/AkCgYEA6FXzosxswaJ2wQLeoYc7ceaweX/SwTvxHgXzRyJIIT0eJWgx13Wo\n/WA3Iziimsjf6qE+SI/8laxPp2A86VMaIt3Z3mJN/CqSVGw8LK2AQst+OwdPyDMu\niacE8lj/IFGC8mwNUAb9CzGU3JpU4PxxGFjS/eMtGeRXCWkK4NE+G08CgYEA1Kp9\nN2JrVlqUz+gAX+LPmE9OEMAS9WQSQsfCHGogIFDGGcNf7+uwBM7GAaSJIP01zcoe\nVAgWdzXCv3FLhsaZoJ6RyLOLay5phbu1iaTr4UNYm5WtYTzMzqh8l1+MFFDl9xDB\nvULuCIIrglM5MeS/qnSg1uMoH2oVPj9TVst/ir8CgYEAxrI7Ws9Zc4Bt70N1As+U\nlySjaEVZCMkqvHJ6TCuVZFfQoE0r0whdLdRLU2PsLFP+q7qaeZQqgBaNSKeVcDYR\n9B+nY/jOmQoPewPVsp/vQTCnE/R81spu0mp0YI6cIheT1Z9zAy322svcc43JaWB7\nmEbeqyLOP4Z4qSOcmghZBSECgYACvR9Xs0DGn+wCsW4vze/2ei77MD4OQvepPIFX\ndFZtlBy5ADcgE9z0cuVB6CiL8DbdK5kwY9pGNr8HUCI03iHkW6Zs+0L0YmihfEVe\nPG19PSzK9CaDdhD9KFZSbLyVFmWfxOt50H7YRTTiPMgjyFpfi5j2q348yVT0tEQS\nfhRqaQKBgAcWPokmJ7EbYQGeMbS7HC8eWO/RyamlnSffdCdSc7ue3zdVJxpAkQ8W\nqu80pEIF6raIQfAf8MXiiZ7auFOSnHQTXUbhCpvDLKi0Mwq3G8Pl07l+2s6dQG6T\nlv6XTQaMyf6n1yjzL+fzDrH3qXMxHMO/b13EePXpDMpY7HQpoLDi\n-----END RSA PRIVATE KEY-----\n", bundle_method="ubiquitous", + custom_csr_id="7b163417-1d2b-4c84-a38a-2fb7a0cd7752", deploy="staging", geo_restrictions={"label": "us"}, policy="(country: US) or (region: EU)", @@ -194,6 +195,7 @@ def test_method_edit_with_all_params(self, client: Cloudflare) -> None: zone_id="023e105f4ecef8ad9ca31a8372d0c353", bundle_method="ubiquitous", certificate="-----BEGIN CERTIFICATE-----\nMIIDtTCCAp2gAwIBAgIJAMHAwfXZ5/PWMA0GCSqGSIb3DQEBCwUAMEUxCzAJBgNV\nBAYTAkFVMRMwEQYDVQQIEwpTb21lLVN0YXRlMSEwHwYDVQQKExhJbnRlcm5ldCBX\naWRnaXRzIFB0eSBMdGQwHhcNMTYwODI0MTY0MzAxWhcNMTYxMTIyMTY0MzAxWjBF\nMQswCQYDVQQGEwJBVTETMBEGA1UECBMKU29tZS1TdGF0ZTEhMB8GA1UEChMYSW50\nZXJuZXQgV2lkZ2l0cyBQdHkgTHRkMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIB\nCgKCAQEAwQHoetcl9+5ikGzV6cMzWtWPJHqXT3wpbEkRU9Yz7lgvddmGdtcGbg/1\nCGZu0jJGkMoppoUo4c3dts3iwqRYmBikUP77wwY2QGmDZw2FvkJCJlKnabIRuGvB\nKwzESIXgKk2016aTP6/dAjEHyo6SeoK8lkIySUvK0fyOVlsiEsCmOpidtnKX/a+5\n0GjB79CJH4ER2lLVZnhePFR/zUOyPxZQQ4naHf7yu/b5jhO0f8fwt+pyFxIXjbEI\ndZliWRkRMtzrHOJIhrmJ2A1J7iOrirbbwillwjjNVUWPf3IJ3M12S9pEewooaeO2\nizNTERcG9HzAacbVRn2Y2SWIyT/18QIDAQABo4GnMIGkMB0GA1UdDgQWBBT/LbE4\n9rWf288N6sJA5BRb6FJIGDB1BgNVHSMEbjBsgBT/LbE49rWf288N6sJA5BRb6FJI\nGKFJpEcwRTELMAkGA1UEBhMCQVUxEzARBgNVBAgTClNvbWUtU3RhdGUxITAfBgNV\nBAoTGEludGVybmV0IFdpZGdpdHMgUHR5IEx0ZIIJAMHAwfXZ5/PWMAwGA1UdEwQF\nMAMBAf8wDQYJKoZIhvcNAQELBQADggEBAHHFwl0tH0quUYZYO0dZYt4R7SJ0pCm2\n2satiyzHl4OnXcHDpekAo7/a09c6Lz6AU83cKy/+x3/djYHXWba7HpEu0dR3ugQP\nMlr4zrhd9xKZ0KZKiYmtJH+ak4OM4L3FbT0owUZPyjLSlhMtJVcoRp5CJsjAMBUG\nSvD8RX+T01wzox/Qb+lnnNnOlaWpqu8eoOenybxKp1a9ULzIVvN/LAcc+14vioFq\n2swRWtmocBAs8QR9n4uvbpiYvS8eYueDCWMM4fvFfBhaDZ3N9IbtySh3SpFdQDhw\nYbjM2rxXiyLGxB4Bol7QTv4zHif7Zt89FReT/NBy4rzaskDJY5L6xmY=\n-----END CERTIFICATE-----\n", + custom_csr_id="7b163417-1d2b-4c84-a38a-2fb7a0cd7752", deploy="staging", geo_restrictions={"label": "us"}, policy="(country: US) or (region: EU)", @@ -313,6 +315,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncCloudflare certificate="-----BEGIN CERTIFICATE-----\nMIIDtTCCAp2gAwIBAgIJAMHAwfXZ5/PWMA0GCSqGSIb3DQEBCwUAMEUxCzAJBgNV\nBAYTAkFVMRMwEQYDVQQIEwpTb21lLVN0YXRlMSEwHwYDVQQKExhJbnRlcm5ldCBX\naWRnaXRzIFB0eSBMdGQwHhcNMTYwODI0MTY0MzAxWhcNMTYxMTIyMTY0MzAxWjBF\nMQswCQYDVQQGEwJBVTETMBEGA1UECBMKU29tZS1TdGF0ZTEhMB8GA1UEChMYSW50\nZXJuZXQgV2lkZ2l0cyBQdHkgTHRkMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIB\nCgKCAQEAwQHoetcl9+5ikGzV6cMzWtWPJHqXT3wpbEkRU9Yz7lgvddmGdtcGbg/1\nCGZu0jJGkMoppoUo4c3dts3iwqRYmBikUP77wwY2QGmDZw2FvkJCJlKnabIRuGvB\nKwzESIXgKk2016aTP6/dAjEHyo6SeoK8lkIySUvK0fyOVlsiEsCmOpidtnKX/a+5\n0GjB79CJH4ER2lLVZnhePFR/zUOyPxZQQ4naHf7yu/b5jhO0f8fwt+pyFxIXjbEI\ndZliWRkRMtzrHOJIhrmJ2A1J7iOrirbbwillwjjNVUWPf3IJ3M12S9pEewooaeO2\nizNTERcG9HzAacbVRn2Y2SWIyT/18QIDAQABo4GnMIGkMB0GA1UdDgQWBBT/LbE4\n9rWf288N6sJA5BRb6FJIGDB1BgNVHSMEbjBsgBT/LbE49rWf288N6sJA5BRb6FJI\nGKFJpEcwRTELMAkGA1UEBhMCQVUxEzARBgNVBAgTClNvbWUtU3RhdGUxITAfBgNV\nBAoTGEludGVybmV0IFdpZGdpdHMgUHR5IEx0ZIIJAMHAwfXZ5/PWMAwGA1UdEwQF\nMAMBAf8wDQYJKoZIhvcNAQELBQADggEBAHHFwl0tH0quUYZYO0dZYt4R7SJ0pCm2\n2satiyzHl4OnXcHDpekAo7/a09c6Lz6AU83cKy/+x3/djYHXWba7HpEu0dR3ugQP\nMlr4zrhd9xKZ0KZKiYmtJH+ak4OM4L3FbT0owUZPyjLSlhMtJVcoRp5CJsjAMBUG\nSvD8RX+T01wzox/Qb+lnnNnOlaWpqu8eoOenybxKp1a9ULzIVvN/LAcc+14vioFq\n2swRWtmocBAs8QR9n4uvbpiYvS8eYueDCWMM4fvFfBhaDZ3N9IbtySh3SpFdQDhw\nYbjM2rxXiyLGxB4Bol7QTv4zHif7Zt89FReT/NBy4rzaskDJY5L6xmY=\n-----END CERTIFICATE-----\n", private_key="-----BEGIN RSA PRIVATE KEY-----\nMIIEowIBAAKCAQEAwQHoetcl9+5ikGzV6cMzWtWPJHqXT3wpbEkRU9Yz7lgvddmG\ndtcGbg/1CGZu0jJGkMoppoUo4c3dts3iwqRYmBikUP77wwY2QGmDZw2FvkJCJlKn\nabIRuGvBKwzESIXgKk2016aTP6/dAjEHyo6SeoK8lkIySUvK0fyOVlsiEsCmOpid\ntnKX/a+50GjB79CJH4ER2lLVZnhePFR/zUOyPxZQQ4naHf7yu/b5jhO0f8fwt+py\nFxIXjbEIdZliWRkRMtzrHOJIhrmJ2A1J7iOrirbbwillwjjNVUWPf3IJ3M12S9pE\newooaeO2izNTERcG9HzAacbVRn2Y2SWIyT/18QIDAQABAoIBACbhTYXBZYKmYPCb\nHBR1IBlCQA2nLGf0qRuJNJZg5iEzXows/6tc8YymZkQE7nolapWsQ+upk2y5Xdp/\naxiuprIs9JzkYK8Ox0r+dlwCG1kSW+UAbX0bQ/qUqlsTvU6muVuMP8vZYHxJ3wmb\n+ufRBKztPTQ/rYWaYQcgC0RWI20HTFBMxlTAyNxYNWzX7RKFkGVVyB9RsAtmcc8g\n+j4OdosbfNoJPS0HeIfNpAznDfHKdxDk2Yc1tV6RHBrC1ynyLE9+TaflIAdo2MVv\nKLMLq51GqYKtgJFIlBRPQqKoyXdz3fGvXrTkf/WY9QNq0J1Vk5ERePZ54mN8iZB7\n9lwy/AkCgYEA6FXzosxswaJ2wQLeoYc7ceaweX/SwTvxHgXzRyJIIT0eJWgx13Wo\n/WA3Iziimsjf6qE+SI/8laxPp2A86VMaIt3Z3mJN/CqSVGw8LK2AQst+OwdPyDMu\niacE8lj/IFGC8mwNUAb9CzGU3JpU4PxxGFjS/eMtGeRXCWkK4NE+G08CgYEA1Kp9\nN2JrVlqUz+gAX+LPmE9OEMAS9WQSQsfCHGogIFDGGcNf7+uwBM7GAaSJIP01zcoe\nVAgWdzXCv3FLhsaZoJ6RyLOLay5phbu1iaTr4UNYm5WtYTzMzqh8l1+MFFDl9xDB\nvULuCIIrglM5MeS/qnSg1uMoH2oVPj9TVst/ir8CgYEAxrI7Ws9Zc4Bt70N1As+U\nlySjaEVZCMkqvHJ6TCuVZFfQoE0r0whdLdRLU2PsLFP+q7qaeZQqgBaNSKeVcDYR\n9B+nY/jOmQoPewPVsp/vQTCnE/R81spu0mp0YI6cIheT1Z9zAy322svcc43JaWB7\nmEbeqyLOP4Z4qSOcmghZBSECgYACvR9Xs0DGn+wCsW4vze/2ei77MD4OQvepPIFX\ndFZtlBy5ADcgE9z0cuVB6CiL8DbdK5kwY9pGNr8HUCI03iHkW6Zs+0L0YmihfEVe\nPG19PSzK9CaDdhD9KFZSbLyVFmWfxOt50H7YRTTiPMgjyFpfi5j2q348yVT0tEQS\nfhRqaQKBgAcWPokmJ7EbYQGeMbS7HC8eWO/RyamlnSffdCdSc7ue3zdVJxpAkQ8W\nqu80pEIF6raIQfAf8MXiiZ7auFOSnHQTXUbhCpvDLKi0Mwq3G8Pl07l+2s6dQG6T\nlv6XTQaMyf6n1yjzL+fzDrH3qXMxHMO/b13EePXpDMpY7HQpoLDi\n-----END RSA PRIVATE KEY-----\n", bundle_method="ubiquitous", + custom_csr_id="7b163417-1d2b-4c84-a38a-2fb7a0cd7752", deploy="staging", geo_restrictions={"label": "us"}, policy="(country: US) or (region: EU)", @@ -470,6 +473,7 @@ async def test_method_edit_with_all_params(self, async_client: AsyncCloudflare) zone_id="023e105f4ecef8ad9ca31a8372d0c353", bundle_method="ubiquitous", certificate="-----BEGIN CERTIFICATE-----\nMIIDtTCCAp2gAwIBAgIJAMHAwfXZ5/PWMA0GCSqGSIb3DQEBCwUAMEUxCzAJBgNV\nBAYTAkFVMRMwEQYDVQQIEwpTb21lLVN0YXRlMSEwHwYDVQQKExhJbnRlcm5ldCBX\naWRnaXRzIFB0eSBMdGQwHhcNMTYwODI0MTY0MzAxWhcNMTYxMTIyMTY0MzAxWjBF\nMQswCQYDVQQGEwJBVTETMBEGA1UECBMKU29tZS1TdGF0ZTEhMB8GA1UEChMYSW50\nZXJuZXQgV2lkZ2l0cyBQdHkgTHRkMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIB\nCgKCAQEAwQHoetcl9+5ikGzV6cMzWtWPJHqXT3wpbEkRU9Yz7lgvddmGdtcGbg/1\nCGZu0jJGkMoppoUo4c3dts3iwqRYmBikUP77wwY2QGmDZw2FvkJCJlKnabIRuGvB\nKwzESIXgKk2016aTP6/dAjEHyo6SeoK8lkIySUvK0fyOVlsiEsCmOpidtnKX/a+5\n0GjB79CJH4ER2lLVZnhePFR/zUOyPxZQQ4naHf7yu/b5jhO0f8fwt+pyFxIXjbEI\ndZliWRkRMtzrHOJIhrmJ2A1J7iOrirbbwillwjjNVUWPf3IJ3M12S9pEewooaeO2\nizNTERcG9HzAacbVRn2Y2SWIyT/18QIDAQABo4GnMIGkMB0GA1UdDgQWBBT/LbE4\n9rWf288N6sJA5BRb6FJIGDB1BgNVHSMEbjBsgBT/LbE49rWf288N6sJA5BRb6FJI\nGKFJpEcwRTELMAkGA1UEBhMCQVUxEzARBgNVBAgTClNvbWUtU3RhdGUxITAfBgNV\nBAoTGEludGVybmV0IFdpZGdpdHMgUHR5IEx0ZIIJAMHAwfXZ5/PWMAwGA1UdEwQF\nMAMBAf8wDQYJKoZIhvcNAQELBQADggEBAHHFwl0tH0quUYZYO0dZYt4R7SJ0pCm2\n2satiyzHl4OnXcHDpekAo7/a09c6Lz6AU83cKy/+x3/djYHXWba7HpEu0dR3ugQP\nMlr4zrhd9xKZ0KZKiYmtJH+ak4OM4L3FbT0owUZPyjLSlhMtJVcoRp5CJsjAMBUG\nSvD8RX+T01wzox/Qb+lnnNnOlaWpqu8eoOenybxKp1a9ULzIVvN/LAcc+14vioFq\n2swRWtmocBAs8QR9n4uvbpiYvS8eYueDCWMM4fvFfBhaDZ3N9IbtySh3SpFdQDhw\nYbjM2rxXiyLGxB4Bol7QTv4zHif7Zt89FReT/NBy4rzaskDJY5L6xmY=\n-----END CERTIFICATE-----\n", + custom_csr_id="7b163417-1d2b-4c84-a38a-2fb7a0cd7752", deploy="staging", geo_restrictions={"label": "us"}, policy="(country: US) or (region: EU)", diff --git a/tests/api_resources/test_custom_hostnames.py b/tests/api_resources/test_custom_hostnames.py index 0e8797357e1..5fcd62c6be2 100644 --- a/tests/api_resources/test_custom_hostnames.py +++ b/tests/api_resources/test_custom_hostnames.py @@ -49,6 +49,7 @@ def test_method_create_with_all_params(self, client: Cloudflare) -> None: } ], "custom_certificate": "-----BEGIN CERTIFICATE-----\nMIIFJDCCBAygAwIBAgIQD0ifmj/Yi5NP/2gdUySbfzANBgkqhkiG9w0BAQsFADBN\nMQswCQYDVQQGEwJVUzEVMBMGA1UEChMMRGlnaUNlcnQgSW5jMScwJQYDVQQDEx5E...SzSHfXp5lnu/3V08I72q1QNzOCgY1XeL4GKVcj4or6cT6tX6oJH7ePPmfrBfqI/O\nOeH8gMJ+FuwtXYEPa4hBf38M5eU5xWG7\n-----END CERTIFICATE-----\n", + "custom_csr_id": "7b163417-1d2b-4c84-a38a-2fb7a0cd7752", "custom_key": "-----BEGIN RSA PRIVATE KEY-----\nMIIEowIBAAKCAQEAwQHoetcl9+5ikGzV6cMzWtWPJHqXT3wpbEkRU9Yz7lgvddmG\ndtcGbg/1CGZu0jJGkMoppoUo4c3dts3iwqRYmBikUP77wwY2QGmDZw2FvkJCJlKn\nabIRuGvBKwzESIXgKk2016aTP6/dAjEHyo6SeoK8lkIySUvK0fyOVlsiEsCmOpid\ntnKX/a+50GjB79CJH4ER2lLVZnhePFR/zUOyPxZQQ4naHf7yu/b5jhO0f8fwt+py\nFxIXjbEIdZliWRkRMtzrHOJIhrmJ2A1J7iOrirbbwillwjjNVUWPf3IJ3M12S9pE\newooaeO2izNTERcG9HzAacbVRn2Y2SWIyT/18QIDAQABAoIBACbhTYXBZYKmYPCb\nHBR1IBlCQA2nLGf0qRuJNJZg5iEzXows/6tc8YymZkQE7nolapWsQ+upk2y5Xdp/\naxiuprIs9JzkYK8Ox0r+dlwCG1kSW+UAbX0bQ/qUqlsTvU6muVuMP8vZYHxJ3wmb\n+ufRBKztPTQ/rYWaYQcgC0RWI20HTFBMxlTAyNxYNWzX7RKFkGVVyB9RsAtmcc8g\n+j4OdosbfNoJPS0HeIfNpAznDfHKdxDk2Yc1tV6RHBrC1ynyLE9+TaflIAdo2MVv\nKLMLq51GqYKtgJFIlBRPQqKoyXdz3fGvXrTkf/WY9QNq0J1Vk5ERePZ54mN8iZB7\n9lwy/AkCgYEA6FXzosxswaJ2wQLeoYc7ceaweX/SwTvxHgXzRyJIIT0eJWgx13Wo\n/WA3Iziimsjf6qE+SI/8laxPp2A86VMaIt3Z3mJN/CqSVGw8LK2AQst+OwdPyDMu\niacE8lj/IFGC8mwNUAb9CzGU3JpU4PxxGFjS/eMtGeRXCWkK4NE+G08CgYEA1Kp9\nN2JrVlqUz+gAX+LPmE9OEMAS9WQSQsfCHGogIFDGGcNf7+uwBM7GAaSJIP01zcoe\nVAgWdzXCv3FLhsaZoJ6RyLOLay5phbu1iaTr4UNYm5WtYTzMzqh8l1+MFFDl9xDB\nvULuCIIrglM5MeS/qnSg1uMoH2oVPj9TVst/ir8CgYEAxrI7Ws9Zc4Bt70N1As+U\nlySjaEVZCMkqvHJ6TCuVZFfQoE0r0whdLdRLU2PsLFP+q7qaeZQqgBaNSKeVcDYR\n9B+nY/jOmQoPewPVsp/vQTCnE/R81spu0mp0YI6cIheT1Z9zAy322svcc43JaWB7\nmEbeqyLOP4Z4qSOcmghZBSECgYACvR9Xs0DGn+wCsW4vze/2ei77MD4OQvepPIFX\ndFZtlBy5ADcgE9z0cuVB6CiL8DbdK5kwY9pGNr8HUCI03iHkW6Zs+0L0YmihfEVe\nPG19PSzK9CaDdhD9KFZSbLyVFmWfxOt50H7YRTTiPMgjyFpfi5j2q348yVT0tEQS\nfhRqaQKBgAcWPokmJ7EbYQGeMbS7HC8eWO/RyamlnSffdCdSc7ue3zdVJxpAkQ8W\nqu80pEIF6raIQfAf8MXiiZ7auFOSnHQTXUbhCpvDLKi0Mwq3G8Pl07l+2s6dQG6T\nlv6XTQaMyf6n1yjzL+fzDrH3qXMxHMO/b13EePXpDMpY7HQpoLDi\n-----END RSA PRIVATE KEY-----\n", "method": "http", "settings": { @@ -227,6 +228,7 @@ def test_method_edit_with_all_params(self, client: Cloudflare) -> None: } ], "custom_certificate": "-----BEGIN CERTIFICATE-----\nMIIFJDCCBAygAwIBAgIQD0ifmj/Yi5NP/2gdUySbfzANBgkqhkiG9w0BAQsFADBN\nMQswCQYDVQQGEwJVUzEVMBMGA1UEChMMRGlnaUNlcnQgSW5jMScwJQYDVQQDEx5E...SzSHfXp5lnu/3V08I72q1QNzOCgY1XeL4GKVcj4or6cT6tX6oJH7ePPmfrBfqI/O\nOeH8gMJ+FuwtXYEPa4hBf38M5eU5xWG7\n-----END CERTIFICATE-----\n", + "custom_csr_id": "7b163417-1d2b-4c84-a38a-2fb7a0cd7752", "custom_key": "-----BEGIN RSA PRIVATE KEY-----\nMIIEowIBAAKCAQEAwQHoetcl9+5ikGzV6cMzWtWPJHqXT3wpbEkRU9Yz7lgvddmG\ndtcGbg/1CGZu0jJGkMoppoUo4c3dts3iwqRYmBikUP77wwY2QGmDZw2FvkJCJlKn\nabIRuGvBKwzESIXgKk2016aTP6/dAjEHyo6SeoK8lkIySUvK0fyOVlsiEsCmOpid\ntnKX/a+50GjB79CJH4ER2lLVZnhePFR/zUOyPxZQQ4naHf7yu/b5jhO0f8fwt+py\nFxIXjbEIdZliWRkRMtzrHOJIhrmJ2A1J7iOrirbbwillwjjNVUWPf3IJ3M12S9pE\newooaeO2izNTERcG9HzAacbVRn2Y2SWIyT/18QIDAQABAoIBACbhTYXBZYKmYPCb\nHBR1IBlCQA2nLGf0qRuJNJZg5iEzXows/6tc8YymZkQE7nolapWsQ+upk2y5Xdp/\naxiuprIs9JzkYK8Ox0r+dlwCG1kSW+UAbX0bQ/qUqlsTvU6muVuMP8vZYHxJ3wmb\n+ufRBKztPTQ/rYWaYQcgC0RWI20HTFBMxlTAyNxYNWzX7RKFkGVVyB9RsAtmcc8g\n+j4OdosbfNoJPS0HeIfNpAznDfHKdxDk2Yc1tV6RHBrC1ynyLE9+TaflIAdo2MVv\nKLMLq51GqYKtgJFIlBRPQqKoyXdz3fGvXrTkf/WY9QNq0J1Vk5ERePZ54mN8iZB7\n9lwy/AkCgYEA6FXzosxswaJ2wQLeoYc7ceaweX/SwTvxHgXzRyJIIT0eJWgx13Wo\n/WA3Iziimsjf6qE+SI/8laxPp2A86VMaIt3Z3mJN/CqSVGw8LK2AQst+OwdPyDMu\niacE8lj/IFGC8mwNUAb9CzGU3JpU4PxxGFjS/eMtGeRXCWkK4NE+G08CgYEA1Kp9\nN2JrVlqUz+gAX+LPmE9OEMAS9WQSQsfCHGogIFDGGcNf7+uwBM7GAaSJIP01zcoe\nVAgWdzXCv3FLhsaZoJ6RyLOLay5phbu1iaTr4UNYm5WtYTzMzqh8l1+MFFDl9xDB\nvULuCIIrglM5MeS/qnSg1uMoH2oVPj9TVst/ir8CgYEAxrI7Ws9Zc4Bt70N1As+U\nlySjaEVZCMkqvHJ6TCuVZFfQoE0r0whdLdRLU2PsLFP+q7qaeZQqgBaNSKeVcDYR\n9B+nY/jOmQoPewPVsp/vQTCnE/R81spu0mp0YI6cIheT1Z9zAy322svcc43JaWB7\nmEbeqyLOP4Z4qSOcmghZBSECgYACvR9Xs0DGn+wCsW4vze/2ei77MD4OQvepPIFX\ndFZtlBy5ADcgE9z0cuVB6CiL8DbdK5kwY9pGNr8HUCI03iHkW6Zs+0L0YmihfEVe\nPG19PSzK9CaDdhD9KFZSbLyVFmWfxOt50H7YRTTiPMgjyFpfi5j2q348yVT0tEQS\nfhRqaQKBgAcWPokmJ7EbYQGeMbS7HC8eWO/RyamlnSffdCdSc7ue3zdVJxpAkQ8W\nqu80pEIF6raIQfAf8MXiiZ7auFOSnHQTXUbhCpvDLKi0Mwq3G8Pl07l+2s6dQG6T\nlv6XTQaMyf6n1yjzL+fzDrH3qXMxHMO/b13EePXpDMpY7HQpoLDi\n-----END RSA PRIVATE KEY-----\n", "method": "http", "settings": { @@ -361,6 +363,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncCloudflare } ], "custom_certificate": "-----BEGIN CERTIFICATE-----\nMIIFJDCCBAygAwIBAgIQD0ifmj/Yi5NP/2gdUySbfzANBgkqhkiG9w0BAQsFADBN\nMQswCQYDVQQGEwJVUzEVMBMGA1UEChMMRGlnaUNlcnQgSW5jMScwJQYDVQQDEx5E...SzSHfXp5lnu/3V08I72q1QNzOCgY1XeL4GKVcj4or6cT6tX6oJH7ePPmfrBfqI/O\nOeH8gMJ+FuwtXYEPa4hBf38M5eU5xWG7\n-----END CERTIFICATE-----\n", + "custom_csr_id": "7b163417-1d2b-4c84-a38a-2fb7a0cd7752", "custom_key": "-----BEGIN RSA PRIVATE KEY-----\nMIIEowIBAAKCAQEAwQHoetcl9+5ikGzV6cMzWtWPJHqXT3wpbEkRU9Yz7lgvddmG\ndtcGbg/1CGZu0jJGkMoppoUo4c3dts3iwqRYmBikUP77wwY2QGmDZw2FvkJCJlKn\nabIRuGvBKwzESIXgKk2016aTP6/dAjEHyo6SeoK8lkIySUvK0fyOVlsiEsCmOpid\ntnKX/a+50GjB79CJH4ER2lLVZnhePFR/zUOyPxZQQ4naHf7yu/b5jhO0f8fwt+py\nFxIXjbEIdZliWRkRMtzrHOJIhrmJ2A1J7iOrirbbwillwjjNVUWPf3IJ3M12S9pE\newooaeO2izNTERcG9HzAacbVRn2Y2SWIyT/18QIDAQABAoIBACbhTYXBZYKmYPCb\nHBR1IBlCQA2nLGf0qRuJNJZg5iEzXows/6tc8YymZkQE7nolapWsQ+upk2y5Xdp/\naxiuprIs9JzkYK8Ox0r+dlwCG1kSW+UAbX0bQ/qUqlsTvU6muVuMP8vZYHxJ3wmb\n+ufRBKztPTQ/rYWaYQcgC0RWI20HTFBMxlTAyNxYNWzX7RKFkGVVyB9RsAtmcc8g\n+j4OdosbfNoJPS0HeIfNpAznDfHKdxDk2Yc1tV6RHBrC1ynyLE9+TaflIAdo2MVv\nKLMLq51GqYKtgJFIlBRPQqKoyXdz3fGvXrTkf/WY9QNq0J1Vk5ERePZ54mN8iZB7\n9lwy/AkCgYEA6FXzosxswaJ2wQLeoYc7ceaweX/SwTvxHgXzRyJIIT0eJWgx13Wo\n/WA3Iziimsjf6qE+SI/8laxPp2A86VMaIt3Z3mJN/CqSVGw8LK2AQst+OwdPyDMu\niacE8lj/IFGC8mwNUAb9CzGU3JpU4PxxGFjS/eMtGeRXCWkK4NE+G08CgYEA1Kp9\nN2JrVlqUz+gAX+LPmE9OEMAS9WQSQsfCHGogIFDGGcNf7+uwBM7GAaSJIP01zcoe\nVAgWdzXCv3FLhsaZoJ6RyLOLay5phbu1iaTr4UNYm5WtYTzMzqh8l1+MFFDl9xDB\nvULuCIIrglM5MeS/qnSg1uMoH2oVPj9TVst/ir8CgYEAxrI7Ws9Zc4Bt70N1As+U\nlySjaEVZCMkqvHJ6TCuVZFfQoE0r0whdLdRLU2PsLFP+q7qaeZQqgBaNSKeVcDYR\n9B+nY/jOmQoPewPVsp/vQTCnE/R81spu0mp0YI6cIheT1Z9zAy322svcc43JaWB7\nmEbeqyLOP4Z4qSOcmghZBSECgYACvR9Xs0DGn+wCsW4vze/2ei77MD4OQvepPIFX\ndFZtlBy5ADcgE9z0cuVB6CiL8DbdK5kwY9pGNr8HUCI03iHkW6Zs+0L0YmihfEVe\nPG19PSzK9CaDdhD9KFZSbLyVFmWfxOt50H7YRTTiPMgjyFpfi5j2q348yVT0tEQS\nfhRqaQKBgAcWPokmJ7EbYQGeMbS7HC8eWO/RyamlnSffdCdSc7ue3zdVJxpAkQ8W\nqu80pEIF6raIQfAf8MXiiZ7auFOSnHQTXUbhCpvDLKi0Mwq3G8Pl07l+2s6dQG6T\nlv6XTQaMyf6n1yjzL+fzDrH3qXMxHMO/b13EePXpDMpY7HQpoLDi\n-----END RSA PRIVATE KEY-----\n", "method": "http", "settings": { @@ -539,6 +542,7 @@ async def test_method_edit_with_all_params(self, async_client: AsyncCloudflare) } ], "custom_certificate": "-----BEGIN CERTIFICATE-----\nMIIFJDCCBAygAwIBAgIQD0ifmj/Yi5NP/2gdUySbfzANBgkqhkiG9w0BAQsFADBN\nMQswCQYDVQQGEwJVUzEVMBMGA1UEChMMRGlnaUNlcnQgSW5jMScwJQYDVQQDEx5E...SzSHfXp5lnu/3V08I72q1QNzOCgY1XeL4GKVcj4or6cT6tX6oJH7ePPmfrBfqI/O\nOeH8gMJ+FuwtXYEPa4hBf38M5eU5xWG7\n-----END CERTIFICATE-----\n", + "custom_csr_id": "7b163417-1d2b-4c84-a38a-2fb7a0cd7752", "custom_key": "-----BEGIN RSA PRIVATE KEY-----\nMIIEowIBAAKCAQEAwQHoetcl9+5ikGzV6cMzWtWPJHqXT3wpbEkRU9Yz7lgvddmG\ndtcGbg/1CGZu0jJGkMoppoUo4c3dts3iwqRYmBikUP77wwY2QGmDZw2FvkJCJlKn\nabIRuGvBKwzESIXgKk2016aTP6/dAjEHyo6SeoK8lkIySUvK0fyOVlsiEsCmOpid\ntnKX/a+50GjB79CJH4ER2lLVZnhePFR/zUOyPxZQQ4naHf7yu/b5jhO0f8fwt+py\nFxIXjbEIdZliWRkRMtzrHOJIhrmJ2A1J7iOrirbbwillwjjNVUWPf3IJ3M12S9pE\newooaeO2izNTERcG9HzAacbVRn2Y2SWIyT/18QIDAQABAoIBACbhTYXBZYKmYPCb\nHBR1IBlCQA2nLGf0qRuJNJZg5iEzXows/6tc8YymZkQE7nolapWsQ+upk2y5Xdp/\naxiuprIs9JzkYK8Ox0r+dlwCG1kSW+UAbX0bQ/qUqlsTvU6muVuMP8vZYHxJ3wmb\n+ufRBKztPTQ/rYWaYQcgC0RWI20HTFBMxlTAyNxYNWzX7RKFkGVVyB9RsAtmcc8g\n+j4OdosbfNoJPS0HeIfNpAznDfHKdxDk2Yc1tV6RHBrC1ynyLE9+TaflIAdo2MVv\nKLMLq51GqYKtgJFIlBRPQqKoyXdz3fGvXrTkf/WY9QNq0J1Vk5ERePZ54mN8iZB7\n9lwy/AkCgYEA6FXzosxswaJ2wQLeoYc7ceaweX/SwTvxHgXzRyJIIT0eJWgx13Wo\n/WA3Iziimsjf6qE+SI/8laxPp2A86VMaIt3Z3mJN/CqSVGw8LK2AQst+OwdPyDMu\niacE8lj/IFGC8mwNUAb9CzGU3JpU4PxxGFjS/eMtGeRXCWkK4NE+G08CgYEA1Kp9\nN2JrVlqUz+gAX+LPmE9OEMAS9WQSQsfCHGogIFDGGcNf7+uwBM7GAaSJIP01zcoe\nVAgWdzXCv3FLhsaZoJ6RyLOLay5phbu1iaTr4UNYm5WtYTzMzqh8l1+MFFDl9xDB\nvULuCIIrglM5MeS/qnSg1uMoH2oVPj9TVst/ir8CgYEAxrI7Ws9Zc4Bt70N1As+U\nlySjaEVZCMkqvHJ6TCuVZFfQoE0r0whdLdRLU2PsLFP+q7qaeZQqgBaNSKeVcDYR\n9B+nY/jOmQoPewPVsp/vQTCnE/R81spu0mp0YI6cIheT1Z9zAy322svcc43JaWB7\nmEbeqyLOP4Z4qSOcmghZBSECgYACvR9Xs0DGn+wCsW4vze/2ei77MD4OQvepPIFX\ndFZtlBy5ADcgE9z0cuVB6CiL8DbdK5kwY9pGNr8HUCI03iHkW6Zs+0L0YmihfEVe\nPG19PSzK9CaDdhD9KFZSbLyVFmWfxOt50H7YRTTiPMgjyFpfi5j2q348yVT0tEQS\nfhRqaQKBgAcWPokmJ7EbYQGeMbS7HC8eWO/RyamlnSffdCdSc7ue3zdVJxpAkQ8W\nqu80pEIF6raIQfAf8MXiiZ7auFOSnHQTXUbhCpvDLKi0Mwq3G8Pl07l+2s6dQG6T\nlv6XTQaMyf6n1yjzL+fzDrH3qXMxHMO/b13EePXpDMpY7HQpoLDi\n-----END RSA PRIVATE KEY-----\n", "method": "http", "settings": { From 049acfc0f98ad0f7f03b749be188a12b25efbb87 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 10 Mar 2026 05:37:08 +0000 Subject: [PATCH 068/279] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 14dc14ef38d..cd6f66d115b 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 2058 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-9a7a8994b197af9edac0674bc944bf99933837ac82cbba7991d006b2127cf6a9.yml -openapi_spec_hash: 54fc6d81dcb49dd26c7ba06d7ec0611b +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-aec269534c964d056a5a33acf613c2b5163b5b94e3a71ae35916f08342ccecc0.yml +openapi_spec_hash: 4e0bfdb1a2071e4355a8c5d916199f9d config_hash: be75bee0df4cf361df49284b77afc8a4 From 9dac69401712d457ac0b5bd01c215a033e84e529 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 10 Mar 2026 14:25:44 +0000 Subject: [PATCH 069/279] chore(api): update composite API spec --- .stats.yml | 4 ++-- .../types/aisearch/instance_chat_completions_params.py | 10 +++++----- .../types/aisearch/instance_create_params.py | 8 ++++---- .../types/aisearch/instance_create_response.py | 10 ++++------ .../types/aisearch/instance_delete_response.py | 10 ++++------ .../types/aisearch/instance_list_response.py | 10 ++++------ .../types/aisearch/instance_read_response.py | 10 ++++------ .../types/aisearch/instance_search_params.py | 10 +++++----- .../types/aisearch/instance_update_params.py | 8 ++++---- .../types/aisearch/instance_update_response.py | 10 ++++------ 10 files changed, 40 insertions(+), 50 deletions(-) diff --git a/.stats.yml b/.stats.yml index cd6f66d115b..ff5f20c4add 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 2058 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-aec269534c964d056a5a33acf613c2b5163b5b94e3a71ae35916f08342ccecc0.yml -openapi_spec_hash: 4e0bfdb1a2071e4355a8c5d916199f9d +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-fce3f8be7a792f75136c4a832ee3a6e338cc487acc828f995d57cfc4ea599cd6.yml +openapi_spec_hash: 5de2427661a82c666e847e0300aa24d3 config_hash: be75bee0df4cf361df49284b77afc8a4 diff --git a/src/cloudflare/types/aisearch/instance_chat_completions_params.py b/src/cloudflare/types/aisearch/instance_chat_completions_params.py index 47445b63283..c7e32fe6e7e 100644 --- a/src/cloudflare/types/aisearch/instance_chat_completions_params.py +++ b/src/cloudflare/types/aisearch/instance_chat_completions_params.py @@ -118,7 +118,7 @@ class AISearchOptionsRetrievalBoostBy(TypedDict, total=False): """Metadata field name to boost by. Use 'timestamp' for document freshness, or any custom_metadata field. Numeric - fields support asc/desc directions; text/boolean fields support + and datetime fields support asc/desc directions; text/boolean fields support exists/not_exists. """ @@ -127,8 +127,8 @@ class AISearchOptionsRetrievalBoostBy(TypedDict, total=False): 'desc' = higher values rank higher (e.g. newer timestamps). 'asc' = lower values rank higher. 'exists' = boost chunks that have the field. 'not_exists' = boost - chunks that lack the field. Optional ��� defaults to 'asc' for numeric fields, - 'exists' for text/boolean fields. + chunks that lack the field. Optional ��� defaults to 'asc' for numeric/datetime + fields, 'exists' for text/boolean fields. """ @@ -137,8 +137,8 @@ class AISearchOptionsRetrieval(TypedDict, total=False): """Metadata fields to boost search results by. Overrides the instance-level boost_by config. Direction defaults to 'asc' for - numeric fields, 'exists' for text/boolean fields. Fields must match 'timestamp' - or a defined custom_metadata field. + numeric/datetime fields, 'exists' for text/boolean fields. Fields must match + 'timestamp' or a defined custom_metadata field. """ context_expansion: int diff --git a/src/cloudflare/types/aisearch/instance_create_params.py b/src/cloudflare/types/aisearch/instance_create_params.py index b03f9c22edb..4f5d76f7f1b 100644 --- a/src/cloudflare/types/aisearch/instance_create_params.py +++ b/src/cloudflare/types/aisearch/instance_create_params.py @@ -155,7 +155,7 @@ class InstanceCreateParams(TypedDict, total=False): class CustomMetadata(TypedDict, total=False): - data_type: Required[Literal["text", "number", "boolean"]] + data_type: Required[Literal["text", "number", "boolean", "datetime"]] field_name: Required[str] @@ -210,7 +210,7 @@ class RetrievalOptionsBoostBy(TypedDict, total=False): """Metadata field name to boost by. Use 'timestamp' for document freshness, or any custom_metadata field. Numeric - fields support asc/desc directions; text/boolean fields support + and datetime fields support asc/desc directions; text/boolean fields support exists/not_exists. """ @@ -219,8 +219,8 @@ class RetrievalOptionsBoostBy(TypedDict, total=False): 'desc' = higher values rank higher (e.g. newer timestamps). 'asc' = lower values rank higher. 'exists' = boost chunks that have the field. 'not_exists' = boost - chunks that lack the field. Optional ��� defaults to 'asc' for numeric fields, - 'exists' for text/boolean fields. + chunks that lack the field. Optional ��� defaults to 'asc' for numeric/datetime + fields, 'exists' for text/boolean fields. """ diff --git a/src/cloudflare/types/aisearch/instance_create_response.py b/src/cloudflare/types/aisearch/instance_create_response.py index 9b87e82e89e..6188d56945f 100644 --- a/src/cloudflare/types/aisearch/instance_create_response.py +++ b/src/cloudflare/types/aisearch/instance_create_response.py @@ -30,7 +30,7 @@ class CustomMetadata(BaseModel): - data_type: Literal["text", "number", "boolean"] + data_type: Literal["text", "number", "boolean", "datetime"] field_name: str @@ -85,7 +85,7 @@ class RetrievalOptionsBoostBy(BaseModel): """Metadata field name to boost by. Use 'timestamp' for document freshness, or any custom_metadata field. Numeric - fields support asc/desc directions; text/boolean fields support + and datetime fields support asc/desc directions; text/boolean fields support exists/not_exists. """ @@ -94,8 +94,8 @@ class RetrievalOptionsBoostBy(BaseModel): 'desc' = higher values rank higher (e.g. newer timestamps). 'asc' = lower values rank higher. 'exists' = boost chunks that have the field. 'not_exists' = boost - chunks that lack the field. Optional ��� defaults to 'asc' for numeric fields, - 'exists' for text/boolean fields. + chunks that lack the field. Optional ��� defaults to 'asc' for numeric/datetime + fields, 'exists' for text/boolean fields. """ @@ -214,8 +214,6 @@ class InstanceCreateResponse(BaseModel): modified_at: datetime - vectorize_name: str - ai_gateway_id: Optional[str] = None aisearch_model: Optional[ diff --git a/src/cloudflare/types/aisearch/instance_delete_response.py b/src/cloudflare/types/aisearch/instance_delete_response.py index 652e4062de8..36a69bc5cd5 100644 --- a/src/cloudflare/types/aisearch/instance_delete_response.py +++ b/src/cloudflare/types/aisearch/instance_delete_response.py @@ -30,7 +30,7 @@ class CustomMetadata(BaseModel): - data_type: Literal["text", "number", "boolean"] + data_type: Literal["text", "number", "boolean", "datetime"] field_name: str @@ -85,7 +85,7 @@ class RetrievalOptionsBoostBy(BaseModel): """Metadata field name to boost by. Use 'timestamp' for document freshness, or any custom_metadata field. Numeric - fields support asc/desc directions; text/boolean fields support + and datetime fields support asc/desc directions; text/boolean fields support exists/not_exists. """ @@ -94,8 +94,8 @@ class RetrievalOptionsBoostBy(BaseModel): 'desc' = higher values rank higher (e.g. newer timestamps). 'asc' = lower values rank higher. 'exists' = boost chunks that have the field. 'not_exists' = boost - chunks that lack the field. Optional ��� defaults to 'asc' for numeric fields, - 'exists' for text/boolean fields. + chunks that lack the field. Optional ��� defaults to 'asc' for numeric/datetime + fields, 'exists' for text/boolean fields. """ @@ -214,8 +214,6 @@ class InstanceDeleteResponse(BaseModel): modified_at: datetime - vectorize_name: str - ai_gateway_id: Optional[str] = None aisearch_model: Optional[ diff --git a/src/cloudflare/types/aisearch/instance_list_response.py b/src/cloudflare/types/aisearch/instance_list_response.py index cabcc0e33c8..ee0655e37cd 100644 --- a/src/cloudflare/types/aisearch/instance_list_response.py +++ b/src/cloudflare/types/aisearch/instance_list_response.py @@ -30,7 +30,7 @@ class CustomMetadata(BaseModel): - data_type: Literal["text", "number", "boolean"] + data_type: Literal["text", "number", "boolean", "datetime"] field_name: str @@ -85,7 +85,7 @@ class RetrievalOptionsBoostBy(BaseModel): """Metadata field name to boost by. Use 'timestamp' for document freshness, or any custom_metadata field. Numeric - fields support asc/desc directions; text/boolean fields support + and datetime fields support asc/desc directions; text/boolean fields support exists/not_exists. """ @@ -94,8 +94,8 @@ class RetrievalOptionsBoostBy(BaseModel): 'desc' = higher values rank higher (e.g. newer timestamps). 'asc' = lower values rank higher. 'exists' = boost chunks that have the field. 'not_exists' = boost - chunks that lack the field. Optional ��� defaults to 'asc' for numeric fields, - 'exists' for text/boolean fields. + chunks that lack the field. Optional ��� defaults to 'asc' for numeric/datetime + fields, 'exists' for text/boolean fields. """ @@ -214,8 +214,6 @@ class InstanceListResponse(BaseModel): modified_at: datetime - vectorize_name: str - ai_gateway_id: Optional[str] = None aisearch_model: Optional[ diff --git a/src/cloudflare/types/aisearch/instance_read_response.py b/src/cloudflare/types/aisearch/instance_read_response.py index 84f5635100c..ebbf7ee9fde 100644 --- a/src/cloudflare/types/aisearch/instance_read_response.py +++ b/src/cloudflare/types/aisearch/instance_read_response.py @@ -30,7 +30,7 @@ class CustomMetadata(BaseModel): - data_type: Literal["text", "number", "boolean"] + data_type: Literal["text", "number", "boolean", "datetime"] field_name: str @@ -85,7 +85,7 @@ class RetrievalOptionsBoostBy(BaseModel): """Metadata field name to boost by. Use 'timestamp' for document freshness, or any custom_metadata field. Numeric - fields support asc/desc directions; text/boolean fields support + and datetime fields support asc/desc directions; text/boolean fields support exists/not_exists. """ @@ -94,8 +94,8 @@ class RetrievalOptionsBoostBy(BaseModel): 'desc' = higher values rank higher (e.g. newer timestamps). 'asc' = lower values rank higher. 'exists' = boost chunks that have the field. 'not_exists' = boost - chunks that lack the field. Optional ��� defaults to 'asc' for numeric fields, - 'exists' for text/boolean fields. + chunks that lack the field. Optional ��� defaults to 'asc' for numeric/datetime + fields, 'exists' for text/boolean fields. """ @@ -214,8 +214,6 @@ class InstanceReadResponse(BaseModel): modified_at: datetime - vectorize_name: str - ai_gateway_id: Optional[str] = None aisearch_model: Optional[ diff --git a/src/cloudflare/types/aisearch/instance_search_params.py b/src/cloudflare/types/aisearch/instance_search_params.py index a8c23c9992c..c7bca2ff481 100644 --- a/src/cloudflare/types/aisearch/instance_search_params.py +++ b/src/cloudflare/types/aisearch/instance_search_params.py @@ -85,7 +85,7 @@ class AISearchOptionsRetrievalBoostBy(TypedDict, total=False): """Metadata field name to boost by. Use 'timestamp' for document freshness, or any custom_metadata field. Numeric - fields support asc/desc directions; text/boolean fields support + and datetime fields support asc/desc directions; text/boolean fields support exists/not_exists. """ @@ -94,8 +94,8 @@ class AISearchOptionsRetrievalBoostBy(TypedDict, total=False): 'desc' = higher values rank higher (e.g. newer timestamps). 'asc' = lower values rank higher. 'exists' = boost chunks that have the field. 'not_exists' = boost - chunks that lack the field. Optional ��� defaults to 'asc' for numeric fields, - 'exists' for text/boolean fields. + chunks that lack the field. Optional ��� defaults to 'asc' for numeric/datetime + fields, 'exists' for text/boolean fields. """ @@ -104,8 +104,8 @@ class AISearchOptionsRetrieval(TypedDict, total=False): """Metadata fields to boost search results by. Overrides the instance-level boost_by config. Direction defaults to 'asc' for - numeric fields, 'exists' for text/boolean fields. Fields must match 'timestamp' - or a defined custom_metadata field. + numeric/datetime fields, 'exists' for text/boolean fields. Fields must match + 'timestamp' or a defined custom_metadata field. """ context_expansion: int diff --git a/src/cloudflare/types/aisearch/instance_update_params.py b/src/cloudflare/types/aisearch/instance_update_params.py index cde5573051d..ecb49a7f67f 100644 --- a/src/cloudflare/types/aisearch/instance_update_params.py +++ b/src/cloudflare/types/aisearch/instance_update_params.py @@ -189,7 +189,7 @@ class InstanceUpdateParams(TypedDict, total=False): class CustomMetadata(TypedDict, total=False): - data_type: Required[Literal["text", "number", "boolean"]] + data_type: Required[Literal["text", "number", "boolean", "datetime"]] field_name: Required[str] @@ -244,7 +244,7 @@ class RetrievalOptionsBoostBy(TypedDict, total=False): """Metadata field name to boost by. Use 'timestamp' for document freshness, or any custom_metadata field. Numeric - fields support asc/desc directions; text/boolean fields support + and datetime fields support asc/desc directions; text/boolean fields support exists/not_exists. """ @@ -253,8 +253,8 @@ class RetrievalOptionsBoostBy(TypedDict, total=False): 'desc' = higher values rank higher (e.g. newer timestamps). 'asc' = lower values rank higher. 'exists' = boost chunks that have the field. 'not_exists' = boost - chunks that lack the field. Optional ��� defaults to 'asc' for numeric fields, - 'exists' for text/boolean fields. + chunks that lack the field. Optional ��� defaults to 'asc' for numeric/datetime + fields, 'exists' for text/boolean fields. """ diff --git a/src/cloudflare/types/aisearch/instance_update_response.py b/src/cloudflare/types/aisearch/instance_update_response.py index f04ceb5b49f..a4fe002d355 100644 --- a/src/cloudflare/types/aisearch/instance_update_response.py +++ b/src/cloudflare/types/aisearch/instance_update_response.py @@ -30,7 +30,7 @@ class CustomMetadata(BaseModel): - data_type: Literal["text", "number", "boolean"] + data_type: Literal["text", "number", "boolean", "datetime"] field_name: str @@ -85,7 +85,7 @@ class RetrievalOptionsBoostBy(BaseModel): """Metadata field name to boost by. Use 'timestamp' for document freshness, or any custom_metadata field. Numeric - fields support asc/desc directions; text/boolean fields support + and datetime fields support asc/desc directions; text/boolean fields support exists/not_exists. """ @@ -94,8 +94,8 @@ class RetrievalOptionsBoostBy(BaseModel): 'desc' = higher values rank higher (e.g. newer timestamps). 'asc' = lower values rank higher. 'exists' = boost chunks that have the field. 'not_exists' = boost - chunks that lack the field. Optional ��� defaults to 'asc' for numeric fields, - 'exists' for text/boolean fields. + chunks that lack the field. Optional ��� defaults to 'asc' for numeric/datetime + fields, 'exists' for text/boolean fields. """ @@ -214,8 +214,6 @@ class InstanceUpdateResponse(BaseModel): modified_at: datetime - vectorize_name: str - ai_gateway_id: Optional[str] = None aisearch_model: Optional[ From ce6abd173eadbad5ec8f07a946eea35ba9585da7 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 10 Mar 2026 17:52:14 +0000 Subject: [PATCH 070/279] chore(api): update composite API spec --- .stats.yml | 4 ++-- src/cloudflare/resources/abuse_reports/mitigations.py | 2 ++ src/cloudflare/types/abuse_reports/mitigation_list_params.py | 1 + .../types/abuse_reports/mitigation_list_response.py | 1 + .../types/abuse_reports/mitigation_review_response.py | 1 + 5 files changed, 7 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index ff5f20c4add..a6931aacc9b 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 2058 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-fce3f8be7a792f75136c4a832ee3a6e338cc487acc828f995d57cfc4ea599cd6.yml -openapi_spec_hash: 5de2427661a82c666e847e0300aa24d3 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-aa101f875301217afce1e64acbe463560fc36cab72c9edef640e178a5a6d72bc.yml +openapi_spec_hash: 566d0cf05b3575a405bc92fa6bd55cc1 config_hash: be75bee0df4cf361df49284b77afc8a4 diff --git a/src/cloudflare/resources/abuse_reports/mitigations.py b/src/cloudflare/resources/abuse_reports/mitigations.py index 298b58d4143..854d18824d2 100644 --- a/src/cloudflare/resources/abuse_reports/mitigations.py +++ b/src/cloudflare/resources/abuse_reports/mitigations.py @@ -70,6 +70,7 @@ def list( status: Literal["pending", "active", "in_review", "cancelled", "removed"] | Omit = omit, type: Literal[ "legal_block", + "misleading_interstitial", "phishing_interstitial", "network_block", "rate_limit_cache", @@ -230,6 +231,7 @@ def list( status: Literal["pending", "active", "in_review", "cancelled", "removed"] | Omit = omit, type: Literal[ "legal_block", + "misleading_interstitial", "phishing_interstitial", "network_block", "rate_limit_cache", diff --git a/src/cloudflare/types/abuse_reports/mitigation_list_params.py b/src/cloudflare/types/abuse_reports/mitigation_list_params.py index 7cf26fad890..4093a07c4fb 100644 --- a/src/cloudflare/types/abuse_reports/mitigation_list_params.py +++ b/src/cloudflare/types/abuse_reports/mitigation_list_params.py @@ -42,6 +42,7 @@ class MitigationListParams(TypedDict, total=False): type: Literal[ "legal_block", + "misleading_interstitial", "phishing_interstitial", "network_block", "rate_limit_cache", diff --git a/src/cloudflare/types/abuse_reports/mitigation_list_response.py b/src/cloudflare/types/abuse_reports/mitigation_list_response.py index 36d3e8261d7..3e0f9fd8075 100644 --- a/src/cloudflare/types/abuse_reports/mitigation_list_response.py +++ b/src/cloudflare/types/abuse_reports/mitigation_list_response.py @@ -27,6 +27,7 @@ class Mitigation(BaseModel): type: Literal[ "legal_block", + "misleading_interstitial", "phishing_interstitial", "network_block", "rate_limit_cache", diff --git a/src/cloudflare/types/abuse_reports/mitigation_review_response.py b/src/cloudflare/types/abuse_reports/mitigation_review_response.py index a8c31fe7375..6e83c1f4ad3 100644 --- a/src/cloudflare/types/abuse_reports/mitigation_review_response.py +++ b/src/cloudflare/types/abuse_reports/mitigation_review_response.py @@ -26,6 +26,7 @@ class MitigationReviewResponse(BaseModel): type: Literal[ "legal_block", + "misleading_interstitial", "phishing_interstitial", "network_block", "rate_limit_cache", From f79025ea53c69c9eef458ce68f4ccee0b55b6d6d Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 10 Mar 2026 19:11:21 +0000 Subject: [PATCH 071/279] feat: feat: DISCO-101 add google_tag_gateway resource * feat: DISCO-101 add google_tag_gateway resource --- .stats.yml | 4 +- api.md | 15 + src/cloudflare/_client.py | 38 ++ .../resources/google_tag_gateway/__init__.py | 33 ++ .../resources/google_tag_gateway/config.py | 326 ++++++++++++++++++ .../google_tag_gateway/google_tag_gateway.py | 102 ++++++ .../types/google_tag_gateway/__init__.py | 6 + .../types/google_tag_gateway/config.py | 35 ++ .../config_update_params.py | 37 ++ .../google_tag_gateway/__init__.py | 1 + .../google_tag_gateway/test_config.py | 232 +++++++++++++ 11 files changed, 827 insertions(+), 2 deletions(-) create mode 100644 src/cloudflare/resources/google_tag_gateway/__init__.py create mode 100644 src/cloudflare/resources/google_tag_gateway/config.py create mode 100644 src/cloudflare/resources/google_tag_gateway/google_tag_gateway.py create mode 100644 src/cloudflare/types/google_tag_gateway/__init__.py create mode 100644 src/cloudflare/types/google_tag_gateway/config.py create mode 100644 src/cloudflare/types/google_tag_gateway/config_update_params.py create mode 100644 tests/api_resources/google_tag_gateway/__init__.py create mode 100644 tests/api_resources/google_tag_gateway/test_config.py diff --git a/.stats.yml b/.stats.yml index a6931aacc9b..2bff71c2090 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ -configured_endpoints: 2058 +configured_endpoints: 2060 openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-aa101f875301217afce1e64acbe463560fc36cab72c9edef640e178a5a6d72bc.yml openapi_spec_hash: 566d0cf05b3575a405bc92fa6bd55cc1 -config_hash: be75bee0df4cf361df49284b77afc8a4 +config_hash: 23a288f68b3f8deb8a159f3ec871d7c9 diff --git a/api.md b/api.md index 1fd7450b5d5..f7f2066c4a4 100644 --- a/api.md +++ b/api.md @@ -9334,6 +9334,21 @@ Methods: - client.origin_post_quantum_encryption.update(\*, zone_id, \*\*params) -> Optional[OriginPostQuantumEncryptionUpdateResponse] - client.origin_post_quantum_encryption.get(\*, zone_id) -> Optional[OriginPostQuantumEncryptionGetResponse] +# GoogleTagGateway + +## Config + +Types: + +```python +from cloudflare.types.google_tag_gateway import Config +``` + +Methods: + +- client.google_tag_gateway.config.update(\*, zone_id, \*\*params) -> Optional[Config] +- client.google_tag_gateway.config.get(\*, zone_id) -> Optional[Config] + # Zaraz Types: diff --git a/src/cloudflare/_client.py b/src/cloudflare/_client.py index 06911dbf10b..46b975fa01f 100644 --- a/src/cloudflare/_client.py +++ b/src/cloudflare/_client.py @@ -124,6 +124,7 @@ schema_validation, url_normalization, custom_nameservers, + google_tag_gateway, managed_transforms, client_certificates, custom_certificates, @@ -236,6 +237,7 @@ from .resources.browser_rendering.browser_rendering import BrowserRenderingResource, AsyncBrowserRenderingResource from .resources.mtls_certificates.mtls_certificates import MTLSCertificatesResource, AsyncMTLSCertificatesResource from .resources.schema_validation.schema_validation import SchemaValidationResource, AsyncSchemaValidationResource + from .resources.google_tag_gateway.google_tag_gateway import GoogleTagGatewayResource, AsyncGoogleTagGatewayResource from .resources.custom_certificates.custom_certificates import ( CustomCertificatesResource, AsyncCustomCertificatesResource, @@ -809,6 +811,12 @@ def origin_post_quantum_encryption(self) -> OriginPostQuantumEncryptionResource: return OriginPostQuantumEncryptionResource(self) + @cached_property + def google_tag_gateway(self) -> GoogleTagGatewayResource: + from .resources.google_tag_gateway import GoogleTagGatewayResource + + return GoogleTagGatewayResource(self) + @cached_property def zaraz(self) -> ZarazResource: from .resources.zaraz import ZarazResource @@ -1681,6 +1689,12 @@ def origin_post_quantum_encryption(self) -> AsyncOriginPostQuantumEncryptionReso return AsyncOriginPostQuantumEncryptionResource(self) + @cached_property + def google_tag_gateway(self) -> AsyncGoogleTagGatewayResource: + from .resources.google_tag_gateway import AsyncGoogleTagGatewayResource + + return AsyncGoogleTagGatewayResource(self) + @cached_property def zaraz(self) -> AsyncZarazResource: from .resources.zaraz import AsyncZarazResource @@ -2483,6 +2497,12 @@ def origin_post_quantum_encryption( return OriginPostQuantumEncryptionResourceWithRawResponse(self._client.origin_post_quantum_encryption) + @cached_property + def google_tag_gateway(self) -> google_tag_gateway.GoogleTagGatewayResourceWithRawResponse: + from .resources.google_tag_gateway import GoogleTagGatewayResourceWithRawResponse + + return GoogleTagGatewayResourceWithRawResponse(self._client.google_tag_gateway) + @cached_property def zaraz(self) -> zaraz.ZarazResourceWithRawResponse: from .resources.zaraz import ZarazResourceWithRawResponse @@ -3110,6 +3130,12 @@ def origin_post_quantum_encryption( return AsyncOriginPostQuantumEncryptionResourceWithRawResponse(self._client.origin_post_quantum_encryption) + @cached_property + def google_tag_gateway(self) -> google_tag_gateway.AsyncGoogleTagGatewayResourceWithRawResponse: + from .resources.google_tag_gateway import AsyncGoogleTagGatewayResourceWithRawResponse + + return AsyncGoogleTagGatewayResourceWithRawResponse(self._client.google_tag_gateway) + @cached_property def zaraz(self) -> zaraz.AsyncZarazResourceWithRawResponse: from .resources.zaraz import AsyncZarazResourceWithRawResponse @@ -3737,6 +3763,12 @@ def origin_post_quantum_encryption( return OriginPostQuantumEncryptionResourceWithStreamingResponse(self._client.origin_post_quantum_encryption) + @cached_property + def google_tag_gateway(self) -> google_tag_gateway.GoogleTagGatewayResourceWithStreamingResponse: + from .resources.google_tag_gateway import GoogleTagGatewayResourceWithStreamingResponse + + return GoogleTagGatewayResourceWithStreamingResponse(self._client.google_tag_gateway) + @cached_property def zaraz(self) -> zaraz.ZarazResourceWithStreamingResponse: from .resources.zaraz import ZarazResourceWithStreamingResponse @@ -4372,6 +4404,12 @@ def origin_post_quantum_encryption( self._client.origin_post_quantum_encryption ) + @cached_property + def google_tag_gateway(self) -> google_tag_gateway.AsyncGoogleTagGatewayResourceWithStreamingResponse: + from .resources.google_tag_gateway import AsyncGoogleTagGatewayResourceWithStreamingResponse + + return AsyncGoogleTagGatewayResourceWithStreamingResponse(self._client.google_tag_gateway) + @cached_property def zaraz(self) -> zaraz.AsyncZarazResourceWithStreamingResponse: from .resources.zaraz import AsyncZarazResourceWithStreamingResponse diff --git a/src/cloudflare/resources/google_tag_gateway/__init__.py b/src/cloudflare/resources/google_tag_gateway/__init__.py new file mode 100644 index 00000000000..155cd815f02 --- /dev/null +++ b/src/cloudflare/resources/google_tag_gateway/__init__.py @@ -0,0 +1,33 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from .config import ( + ConfigResource, + AsyncConfigResource, + ConfigResourceWithRawResponse, + AsyncConfigResourceWithRawResponse, + ConfigResourceWithStreamingResponse, + AsyncConfigResourceWithStreamingResponse, +) +from .google_tag_gateway import ( + GoogleTagGatewayResource, + AsyncGoogleTagGatewayResource, + GoogleTagGatewayResourceWithRawResponse, + AsyncGoogleTagGatewayResourceWithRawResponse, + GoogleTagGatewayResourceWithStreamingResponse, + AsyncGoogleTagGatewayResourceWithStreamingResponse, +) + +__all__ = [ + "ConfigResource", + "AsyncConfigResource", + "ConfigResourceWithRawResponse", + "AsyncConfigResourceWithRawResponse", + "ConfigResourceWithStreamingResponse", + "AsyncConfigResourceWithStreamingResponse", + "GoogleTagGatewayResource", + "AsyncGoogleTagGatewayResource", + "GoogleTagGatewayResourceWithRawResponse", + "AsyncGoogleTagGatewayResourceWithRawResponse", + "GoogleTagGatewayResourceWithStreamingResponse", + "AsyncGoogleTagGatewayResourceWithStreamingResponse", +] diff --git a/src/cloudflare/resources/google_tag_gateway/config.py b/src/cloudflare/resources/google_tag_gateway/config.py new file mode 100644 index 00000000000..1417f2e9a64 --- /dev/null +++ b/src/cloudflare/resources/google_tag_gateway/config.py @@ -0,0 +1,326 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Type, Optional, cast + +import httpx + +from ..._types import Body, Omit, Query, Headers, NotGiven, omit, not_given +from ..._utils import maybe_transform, async_maybe_transform +from ..._compat import cached_property +from ..._resource import SyncAPIResource, AsyncAPIResource +from ..._response import ( + to_raw_response_wrapper, + to_streamed_response_wrapper, + async_to_raw_response_wrapper, + async_to_streamed_response_wrapper, +) +from ..._wrappers import ResultWrapper +from ..._base_client import make_request_options +from ...types.google_tag_gateway import config_update_params +from ...types.google_tag_gateway.config import Config + +__all__ = ["ConfigResource", "AsyncConfigResource"] + + +class ConfigResource(SyncAPIResource): + @cached_property + def with_raw_response(self) -> ConfigResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers + """ + return ConfigResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> ConfigResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/cloudflare/cloudflare-python#with_streaming_response + """ + return ConfigResourceWithStreamingResponse(self) + + def update( + self, + *, + zone_id: str, + enabled: bool, + endpoint: str, + hide_original_ip: bool, + measurement_id: str, + set_up_tag: Optional[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, + ) -> Optional[Config]: + """ + Updates the Google Tag Gateway configuration for a zone. + + Args: + zone_id: Identifier. + + enabled: Enables or disables Google Tag Gateway for this zone. + + endpoint: Specifies the endpoint path for proxying Google Tag Manager requests. Use an + absolute path starting with '/', with no nested paths and alphanumeric + characters only (e.g. /metrics). + + hide_original_ip: Hides the original client IP address from Google when enabled. + + measurement_id: Specify the Google Tag Manager container or measurement ID (e.g. GTM-XXXXXXX or + G-XXXXXXXXXX). + + set_up_tag: Set up the associated Google Tag on the zone automatically when enabled. + + 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 zone_id: + raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") + return self._put( + f"/zones/{zone_id}/settings/google-tag-gateway/config", + body=maybe_transform( + { + "enabled": enabled, + "endpoint": endpoint, + "hide_original_ip": hide_original_ip, + "measurement_id": measurement_id, + "set_up_tag": set_up_tag, + }, + config_update_params.ConfigUpdateParams, + ), + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + post_parser=ResultWrapper[Optional[Config]]._unwrapper, + ), + cast_to=cast(Type[Optional[Config]], ResultWrapper[Config]), + ) + + def get( + self, + *, + zone_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[Config]: + """ + Gets the Google Tag Gateway configuration for a zone. + + Args: + zone_id: 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 zone_id: + raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") + return self._get( + f"/zones/{zone_id}/settings/google-tag-gateway/config", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + post_parser=ResultWrapper[Optional[Config]]._unwrapper, + ), + cast_to=cast(Type[Optional[Config]], ResultWrapper[Config]), + ) + + +class AsyncConfigResource(AsyncAPIResource): + @cached_property + def with_raw_response(self) -> AsyncConfigResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers + """ + return AsyncConfigResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> AsyncConfigResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/cloudflare/cloudflare-python#with_streaming_response + """ + return AsyncConfigResourceWithStreamingResponse(self) + + async def update( + self, + *, + zone_id: str, + enabled: bool, + endpoint: str, + hide_original_ip: bool, + measurement_id: str, + set_up_tag: Optional[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, + ) -> Optional[Config]: + """ + Updates the Google Tag Gateway configuration for a zone. + + Args: + zone_id: Identifier. + + enabled: Enables or disables Google Tag Gateway for this zone. + + endpoint: Specifies the endpoint path for proxying Google Tag Manager requests. Use an + absolute path starting with '/', with no nested paths and alphanumeric + characters only (e.g. /metrics). + + hide_original_ip: Hides the original client IP address from Google when enabled. + + measurement_id: Specify the Google Tag Manager container or measurement ID (e.g. GTM-XXXXXXX or + G-XXXXXXXXXX). + + set_up_tag: Set up the associated Google Tag on the zone automatically when enabled. + + 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 zone_id: + raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") + return await self._put( + f"/zones/{zone_id}/settings/google-tag-gateway/config", + body=await async_maybe_transform( + { + "enabled": enabled, + "endpoint": endpoint, + "hide_original_ip": hide_original_ip, + "measurement_id": measurement_id, + "set_up_tag": set_up_tag, + }, + config_update_params.ConfigUpdateParams, + ), + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + post_parser=ResultWrapper[Optional[Config]]._unwrapper, + ), + cast_to=cast(Type[Optional[Config]], ResultWrapper[Config]), + ) + + async def get( + self, + *, + zone_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[Config]: + """ + Gets the Google Tag Gateway configuration for a zone. + + Args: + zone_id: 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 zone_id: + raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}") + return await self._get( + f"/zones/{zone_id}/settings/google-tag-gateway/config", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + post_parser=ResultWrapper[Optional[Config]]._unwrapper, + ), + cast_to=cast(Type[Optional[Config]], ResultWrapper[Config]), + ) + + +class ConfigResourceWithRawResponse: + def __init__(self, config: ConfigResource) -> None: + self._config = config + + self.update = to_raw_response_wrapper( + config.update, + ) + self.get = to_raw_response_wrapper( + config.get, + ) + + +class AsyncConfigResourceWithRawResponse: + def __init__(self, config: AsyncConfigResource) -> None: + self._config = config + + self.update = async_to_raw_response_wrapper( + config.update, + ) + self.get = async_to_raw_response_wrapper( + config.get, + ) + + +class ConfigResourceWithStreamingResponse: + def __init__(self, config: ConfigResource) -> None: + self._config = config + + self.update = to_streamed_response_wrapper( + config.update, + ) + self.get = to_streamed_response_wrapper( + config.get, + ) + + +class AsyncConfigResourceWithStreamingResponse: + def __init__(self, config: AsyncConfigResource) -> None: + self._config = config + + self.update = async_to_streamed_response_wrapper( + config.update, + ) + self.get = async_to_streamed_response_wrapper( + config.get, + ) diff --git a/src/cloudflare/resources/google_tag_gateway/google_tag_gateway.py b/src/cloudflare/resources/google_tag_gateway/google_tag_gateway.py new file mode 100644 index 00000000000..474d3677fd1 --- /dev/null +++ b/src/cloudflare/resources/google_tag_gateway/google_tag_gateway.py @@ -0,0 +1,102 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from .config import ( + ConfigResource, + AsyncConfigResource, + ConfigResourceWithRawResponse, + AsyncConfigResourceWithRawResponse, + ConfigResourceWithStreamingResponse, + AsyncConfigResourceWithStreamingResponse, +) +from ..._compat import cached_property +from ..._resource import SyncAPIResource, AsyncAPIResource + +__all__ = ["GoogleTagGatewayResource", "AsyncGoogleTagGatewayResource"] + + +class GoogleTagGatewayResource(SyncAPIResource): + @cached_property + def config(self) -> ConfigResource: + return ConfigResource(self._client) + + @cached_property + def with_raw_response(self) -> GoogleTagGatewayResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers + """ + return GoogleTagGatewayResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> GoogleTagGatewayResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/cloudflare/cloudflare-python#with_streaming_response + """ + return GoogleTagGatewayResourceWithStreamingResponse(self) + + +class AsyncGoogleTagGatewayResource(AsyncAPIResource): + @cached_property + def config(self) -> AsyncConfigResource: + return AsyncConfigResource(self._client) + + @cached_property + def with_raw_response(self) -> AsyncGoogleTagGatewayResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers + """ + return AsyncGoogleTagGatewayResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> AsyncGoogleTagGatewayResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/cloudflare/cloudflare-python#with_streaming_response + """ + return AsyncGoogleTagGatewayResourceWithStreamingResponse(self) + + +class GoogleTagGatewayResourceWithRawResponse: + def __init__(self, google_tag_gateway: GoogleTagGatewayResource) -> None: + self._google_tag_gateway = google_tag_gateway + + @cached_property + def config(self) -> ConfigResourceWithRawResponse: + return ConfigResourceWithRawResponse(self._google_tag_gateway.config) + + +class AsyncGoogleTagGatewayResourceWithRawResponse: + def __init__(self, google_tag_gateway: AsyncGoogleTagGatewayResource) -> None: + self._google_tag_gateway = google_tag_gateway + + @cached_property + def config(self) -> AsyncConfigResourceWithRawResponse: + return AsyncConfigResourceWithRawResponse(self._google_tag_gateway.config) + + +class GoogleTagGatewayResourceWithStreamingResponse: + def __init__(self, google_tag_gateway: GoogleTagGatewayResource) -> None: + self._google_tag_gateway = google_tag_gateway + + @cached_property + def config(self) -> ConfigResourceWithStreamingResponse: + return ConfigResourceWithStreamingResponse(self._google_tag_gateway.config) + + +class AsyncGoogleTagGatewayResourceWithStreamingResponse: + def __init__(self, google_tag_gateway: AsyncGoogleTagGatewayResource) -> None: + self._google_tag_gateway = google_tag_gateway + + @cached_property + def config(self) -> AsyncConfigResourceWithStreamingResponse: + return AsyncConfigResourceWithStreamingResponse(self._google_tag_gateway.config) diff --git a/src/cloudflare/types/google_tag_gateway/__init__.py b/src/cloudflare/types/google_tag_gateway/__init__.py new file mode 100644 index 00000000000..912520cac95 --- /dev/null +++ b/src/cloudflare/types/google_tag_gateway/__init__.py @@ -0,0 +1,6 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from .config import Config as Config +from .config_update_params import ConfigUpdateParams as ConfigUpdateParams diff --git a/src/cloudflare/types/google_tag_gateway/config.py b/src/cloudflare/types/google_tag_gateway/config.py new file mode 100644 index 00000000000..b18c6d15660 --- /dev/null +++ b/src/cloudflare/types/google_tag_gateway/config.py @@ -0,0 +1,35 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional + +from pydantic import Field as FieldInfo + +from ..._models import BaseModel + +__all__ = ["Config"] + + +class Config(BaseModel): + """Google Tag Gateway configuration for a zone.""" + + enabled: bool + """Enables or disables Google Tag Gateway for this zone.""" + + endpoint: str + """Specifies the endpoint path for proxying Google Tag Manager requests. + + Use an absolute path starting with '/', with no nested paths and alphanumeric + characters only (e.g. /metrics). + """ + + hide_original_ip: bool = FieldInfo(alias="hideOriginalIp") + """Hides the original client IP address from Google when enabled.""" + + measurement_id: str = FieldInfo(alias="measurementId") + """Specify the Google Tag Manager container or measurement ID (e.g. + + GTM-XXXXXXX or G-XXXXXXXXXX). + """ + + set_up_tag: Optional[bool] = FieldInfo(alias="setUpTag", default=None) + """Set up the associated Google Tag on the zone automatically when enabled.""" diff --git a/src/cloudflare/types/google_tag_gateway/config_update_params.py b/src/cloudflare/types/google_tag_gateway/config_update_params.py new file mode 100644 index 00000000000..0fb64062ed9 --- /dev/null +++ b/src/cloudflare/types/google_tag_gateway/config_update_params.py @@ -0,0 +1,37 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Optional +from typing_extensions import Required, Annotated, TypedDict + +from ..._utils import PropertyInfo + +__all__ = ["ConfigUpdateParams"] + + +class ConfigUpdateParams(TypedDict, total=False): + zone_id: Required[str] + """Identifier.""" + + enabled: Required[bool] + """Enables or disables Google Tag Gateway for this zone.""" + + endpoint: Required[str] + """Specifies the endpoint path for proxying Google Tag Manager requests. + + Use an absolute path starting with '/', with no nested paths and alphanumeric + characters only (e.g. /metrics). + """ + + hide_original_ip: Required[Annotated[bool, PropertyInfo(alias="hideOriginalIp")]] + """Hides the original client IP address from Google when enabled.""" + + measurement_id: Required[Annotated[str, PropertyInfo(alias="measurementId")]] + """Specify the Google Tag Manager container or measurement ID (e.g. + + GTM-XXXXXXX or G-XXXXXXXXXX). + """ + + set_up_tag: Annotated[Optional[bool], PropertyInfo(alias="setUpTag")] + """Set up the associated Google Tag on the zone automatically when enabled.""" diff --git a/tests/api_resources/google_tag_gateway/__init__.py b/tests/api_resources/google_tag_gateway/__init__.py new file mode 100644 index 00000000000..fd8019a9a1a --- /dev/null +++ b/tests/api_resources/google_tag_gateway/__init__.py @@ -0,0 +1 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. diff --git a/tests/api_resources/google_tag_gateway/test_config.py b/tests/api_resources/google_tag_gateway/test_config.py new file mode 100644 index 00000000000..1e849a95d7a --- /dev/null +++ b/tests/api_resources/google_tag_gateway/test_config.py @@ -0,0 +1,232 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +import os +from typing import Any, Optional, cast + +import pytest + +from cloudflare import Cloudflare, AsyncCloudflare +from tests.utils import assert_matches_type +from cloudflare.types.google_tag_gateway import Config + +base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") + + +class TestConfig: + parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) + + @parametrize + def test_method_update(self, client: Cloudflare) -> None: + config = client.google_tag_gateway.config.update( + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + enabled=True, + endpoint="/metrics", + hide_original_ip=True, + measurement_id="GTM-P2F3N47Q", + ) + assert_matches_type(Optional[Config], config, path=["response"]) + + @parametrize + def test_method_update_with_all_params(self, client: Cloudflare) -> None: + config = client.google_tag_gateway.config.update( + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + enabled=True, + endpoint="/metrics", + hide_original_ip=True, + measurement_id="GTM-P2F3N47Q", + set_up_tag=True, + ) + assert_matches_type(Optional[Config], config, path=["response"]) + + @parametrize + def test_raw_response_update(self, client: Cloudflare) -> None: + response = client.google_tag_gateway.config.with_raw_response.update( + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + enabled=True, + endpoint="/metrics", + hide_original_ip=True, + measurement_id="GTM-P2F3N47Q", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + config = response.parse() + assert_matches_type(Optional[Config], config, path=["response"]) + + @parametrize + def test_streaming_response_update(self, client: Cloudflare) -> None: + with client.google_tag_gateway.config.with_streaming_response.update( + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + enabled=True, + endpoint="/metrics", + hide_original_ip=True, + measurement_id="GTM-P2F3N47Q", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + config = response.parse() + assert_matches_type(Optional[Config], config, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_update(self, client: Cloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + client.google_tag_gateway.config.with_raw_response.update( + zone_id="", + enabled=True, + endpoint="/metrics", + hide_original_ip=True, + measurement_id="GTM-P2F3N47Q", + ) + + @parametrize + def test_method_get(self, client: Cloudflare) -> None: + config = client.google_tag_gateway.config.get( + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + ) + assert_matches_type(Optional[Config], config, path=["response"]) + + @parametrize + def test_raw_response_get(self, client: Cloudflare) -> None: + response = client.google_tag_gateway.config.with_raw_response.get( + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + config = response.parse() + assert_matches_type(Optional[Config], config, path=["response"]) + + @parametrize + def test_streaming_response_get(self, client: Cloudflare) -> None: + with client.google_tag_gateway.config.with_streaming_response.get( + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + config = response.parse() + assert_matches_type(Optional[Config], config, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_get(self, client: Cloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + client.google_tag_gateway.config.with_raw_response.get( + zone_id="", + ) + + +class TestAsyncConfig: + parametrize = pytest.mark.parametrize( + "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"] + ) + + @parametrize + async def test_method_update(self, async_client: AsyncCloudflare) -> None: + config = await async_client.google_tag_gateway.config.update( + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + enabled=True, + endpoint="/metrics", + hide_original_ip=True, + measurement_id="GTM-P2F3N47Q", + ) + assert_matches_type(Optional[Config], config, path=["response"]) + + @parametrize + async def test_method_update_with_all_params(self, async_client: AsyncCloudflare) -> None: + config = await async_client.google_tag_gateway.config.update( + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + enabled=True, + endpoint="/metrics", + hide_original_ip=True, + measurement_id="GTM-P2F3N47Q", + set_up_tag=True, + ) + assert_matches_type(Optional[Config], config, path=["response"]) + + @parametrize + async def test_raw_response_update(self, async_client: AsyncCloudflare) -> None: + response = await async_client.google_tag_gateway.config.with_raw_response.update( + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + enabled=True, + endpoint="/metrics", + hide_original_ip=True, + measurement_id="GTM-P2F3N47Q", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + config = await response.parse() + assert_matches_type(Optional[Config], config, path=["response"]) + + @parametrize + async def test_streaming_response_update(self, async_client: AsyncCloudflare) -> None: + async with async_client.google_tag_gateway.config.with_streaming_response.update( + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + enabled=True, + endpoint="/metrics", + hide_original_ip=True, + measurement_id="GTM-P2F3N47Q", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + config = await response.parse() + assert_matches_type(Optional[Config], config, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_update(self, async_client: AsyncCloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + await async_client.google_tag_gateway.config.with_raw_response.update( + zone_id="", + enabled=True, + endpoint="/metrics", + hide_original_ip=True, + measurement_id="GTM-P2F3N47Q", + ) + + @parametrize + async def test_method_get(self, async_client: AsyncCloudflare) -> None: + config = await async_client.google_tag_gateway.config.get( + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + ) + assert_matches_type(Optional[Config], config, path=["response"]) + + @parametrize + async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: + response = await async_client.google_tag_gateway.config.with_raw_response.get( + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + config = await response.parse() + assert_matches_type(Optional[Config], config, path=["response"]) + + @parametrize + async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> None: + async with async_client.google_tag_gateway.config.with_streaming_response.get( + zone_id="023e105f4ecef8ad9ca31a8372d0c353", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + config = await response.parse() + assert_matches_type(Optional[Config], config, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_get(self, async_client: AsyncCloudflare) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"): + await async_client.google_tag_gateway.config.with_raw_response.get( + zone_id="", + ) From c22dae863091736906d58028616e06139eea0d33 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 10 Mar 2026 19:31:44 +0000 Subject: [PATCH 072/279] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index 2bff71c2090..e4602703e61 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 2060 openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-aa101f875301217afce1e64acbe463560fc36cab72c9edef640e178a5a6d72bc.yml openapi_spec_hash: 566d0cf05b3575a405bc92fa6bd55cc1 -config_hash: 23a288f68b3f8deb8a159f3ec871d7c9 +config_hash: c7d7b582d22030f4fc7dd2af213c6446 From b6e49856e9ef2459cfda95c108e45fb037ba88de Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 10 Mar 2026 22:09:55 +0000 Subject: [PATCH 073/279] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index e4602703e61..b1abc90aaa8 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 2060 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-aa101f875301217afce1e64acbe463560fc36cab72c9edef640e178a5a6d72bc.yml -openapi_spec_hash: 566d0cf05b3575a405bc92fa6bd55cc1 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-86f177a7bf320bf66c8d0f9d13d8926197731e6c42f5e42f9f0668e2ef47dce3.yml +openapi_spec_hash: 0d61388ecec9d4dd92f132f5b685474b config_hash: c7d7b582d22030f4fc7dd2af213c6446 From d7fb2328ee5e18376f162d5e36a41d2df4069f87 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 11 Mar 2026 06:54:03 +0000 Subject: [PATCH 074/279] chore(api): update composite API spec --- .stats.yml | 6 +- api.md | 18 + .../resources/browser_rendering/__init__.py | 14 + .../browser_rendering/browser_rendering.py | 32 + .../resources/browser_rendering/crawl.py | 1099 +++++++++++++++++ .../types/browser_rendering/__init__.py | 5 + .../browser_rendering/crawl_create_params.py | 495 ++++++++ .../crawl_create_response.py | 7 + .../crawl_delete_response.py | 13 + .../browser_rendering/crawl_get_params.py | 26 + .../browser_rendering/crawl_get_response.py | 69 ++ .../browser_rendering/test_crawl.py | 695 +++++++++++ 12 files changed, 2476 insertions(+), 3 deletions(-) create mode 100644 src/cloudflare/resources/browser_rendering/crawl.py create mode 100644 src/cloudflare/types/browser_rendering/crawl_create_params.py create mode 100644 src/cloudflare/types/browser_rendering/crawl_create_response.py create mode 100644 src/cloudflare/types/browser_rendering/crawl_delete_response.py create mode 100644 src/cloudflare/types/browser_rendering/crawl_get_params.py create mode 100644 src/cloudflare/types/browser_rendering/crawl_get_response.py create mode 100644 tests/api_resources/browser_rendering/test_crawl.py diff --git a/.stats.yml b/.stats.yml index b1abc90aaa8..1e20367e83f 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ -configured_endpoints: 2060 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-86f177a7bf320bf66c8d0f9d13d8926197731e6c42f5e42f9f0668e2ef47dce3.yml -openapi_spec_hash: 0d61388ecec9d4dd92f132f5b685474b +configured_endpoints: 2063 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-7b1d10a462c942123a375754cfcf64dcaad176c62bea7ad5caa4aa09ca8bdbef.yml +openapi_spec_hash: bd0181e71e73ecdd0ed5e820c8e43cf1 config_hash: c7d7b582d22030f4fc7dd2af213c6446 diff --git a/api.md b/api.md index f7f2066c4a4..aa9df5324e0 100644 --- a/api.md +++ b/api.md @@ -11056,6 +11056,24 @@ Methods: - client.browser_rendering.markdown.create(\*, account_id, \*\*params) -> str +## Crawl + +Types: + +```python +from cloudflare.types.browser_rendering import ( + CrawlCreateResponse, + CrawlDeleteResponse, + CrawlGetResponse, +) +``` + +Methods: + +- client.browser_rendering.crawl.create(\*, account_id, \*\*params) -> str +- client.browser_rendering.crawl.delete(job_id, \*, account_id) -> CrawlDeleteResponse +- client.browser_rendering.crawl.get(job_id, \*, account_id, \*\*params) -> CrawlGetResponse + # CustomPages Types: diff --git a/src/cloudflare/resources/browser_rendering/__init__.py b/src/cloudflare/resources/browser_rendering/__init__.py index ca6102ced41..9b2fe570bdb 100644 --- a/src/cloudflare/resources/browser_rendering/__init__.py +++ b/src/cloudflare/resources/browser_rendering/__init__.py @@ -16,6 +16,14 @@ JsonResourceWithStreamingResponse, AsyncJsonResourceWithStreamingResponse, ) +from .crawl import ( + CrawlResource, + AsyncCrawlResource, + CrawlResourceWithRawResponse, + AsyncCrawlResourceWithRawResponse, + CrawlResourceWithStreamingResponse, + AsyncCrawlResourceWithStreamingResponse, +) from .links import ( LinksResource, AsyncLinksResource, @@ -122,6 +130,12 @@ "AsyncMarkdownResourceWithRawResponse", "MarkdownResourceWithStreamingResponse", "AsyncMarkdownResourceWithStreamingResponse", + "CrawlResource", + "AsyncCrawlResource", + "CrawlResourceWithRawResponse", + "AsyncCrawlResourceWithRawResponse", + "CrawlResourceWithStreamingResponse", + "AsyncCrawlResourceWithStreamingResponse", "BrowserRenderingResource", "AsyncBrowserRenderingResource", "BrowserRenderingResourceWithRawResponse", diff --git a/src/cloudflare/resources/browser_rendering/browser_rendering.py b/src/cloudflare/resources/browser_rendering/browser_rendering.py index bee931f57df..608d0c027d3 100644 --- a/src/cloudflare/resources/browser_rendering/browser_rendering.py +++ b/src/cloudflare/resources/browser_rendering/browser_rendering.py @@ -18,6 +18,14 @@ JsonResourceWithStreamingResponse, AsyncJsonResourceWithStreamingResponse, ) +from .crawl import ( + CrawlResource, + AsyncCrawlResource, + CrawlResourceWithRawResponse, + AsyncCrawlResourceWithRawResponse, + CrawlResourceWithStreamingResponse, + AsyncCrawlResourceWithStreamingResponse, +) from .links import ( LinksResource, AsyncLinksResource, @@ -105,6 +113,10 @@ def links(self) -> LinksResource: def markdown(self) -> MarkdownResource: return MarkdownResource(self._client) + @cached_property + def crawl(self) -> CrawlResource: + return CrawlResource(self._client) + @cached_property def with_raw_response(self) -> BrowserRenderingResourceWithRawResponse: """ @@ -158,6 +170,10 @@ def links(self) -> AsyncLinksResource: def markdown(self) -> AsyncMarkdownResource: return AsyncMarkdownResource(self._client) + @cached_property + def crawl(self) -> AsyncCrawlResource: + return AsyncCrawlResource(self._client) + @cached_property def with_raw_response(self) -> AsyncBrowserRenderingResourceWithRawResponse: """ @@ -214,6 +230,10 @@ def links(self) -> LinksResourceWithRawResponse: def markdown(self) -> MarkdownResourceWithRawResponse: return MarkdownResourceWithRawResponse(self._browser_rendering.markdown) + @cached_property + def crawl(self) -> CrawlResourceWithRawResponse: + return CrawlResourceWithRawResponse(self._browser_rendering.crawl) + class AsyncBrowserRenderingResourceWithRawResponse: def __init__(self, browser_rendering: AsyncBrowserRenderingResource) -> None: @@ -251,6 +271,10 @@ def links(self) -> AsyncLinksResourceWithRawResponse: def markdown(self) -> AsyncMarkdownResourceWithRawResponse: return AsyncMarkdownResourceWithRawResponse(self._browser_rendering.markdown) + @cached_property + def crawl(self) -> AsyncCrawlResourceWithRawResponse: + return AsyncCrawlResourceWithRawResponse(self._browser_rendering.crawl) + class BrowserRenderingResourceWithStreamingResponse: def __init__(self, browser_rendering: BrowserRenderingResource) -> None: @@ -288,6 +312,10 @@ def links(self) -> LinksResourceWithStreamingResponse: def markdown(self) -> MarkdownResourceWithStreamingResponse: return MarkdownResourceWithStreamingResponse(self._browser_rendering.markdown) + @cached_property + def crawl(self) -> CrawlResourceWithStreamingResponse: + return CrawlResourceWithStreamingResponse(self._browser_rendering.crawl) + class AsyncBrowserRenderingResourceWithStreamingResponse: def __init__(self, browser_rendering: AsyncBrowserRenderingResource) -> None: @@ -324,3 +352,7 @@ def links(self) -> AsyncLinksResourceWithStreamingResponse: @cached_property def markdown(self) -> AsyncMarkdownResourceWithStreamingResponse: return AsyncMarkdownResourceWithStreamingResponse(self._browser_rendering.markdown) + + @cached_property + def crawl(self) -> AsyncCrawlResourceWithStreamingResponse: + return AsyncCrawlResourceWithStreamingResponse(self._browser_rendering.crawl) diff --git a/src/cloudflare/resources/browser_rendering/crawl.py b/src/cloudflare/resources/browser_rendering/crawl.py new file mode 100644 index 00000000000..4948bcb21d9 --- /dev/null +++ b/src/cloudflare/resources/browser_rendering/crawl.py @@ -0,0 +1,1099 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Dict, List, Type, Iterable, cast +from typing_extensions import Literal, overload + +import httpx + +from ..._types import Body, Omit, Query, Headers, NotGiven, SequenceNotStr, omit, not_given +from ..._utils import required_args, maybe_transform, async_maybe_transform +from ..._compat import cached_property +from ..._resource import SyncAPIResource, AsyncAPIResource +from ..._response import ( + to_raw_response_wrapper, + to_streamed_response_wrapper, + async_to_raw_response_wrapper, + async_to_streamed_response_wrapper, +) +from ..._wrappers import ResultWrapper +from ..._base_client import make_request_options +from ...types.browser_rendering import crawl_get_params, crawl_create_params +from ...types.browser_rendering.crawl_get_response import CrawlGetResponse +from ...types.browser_rendering.crawl_create_response import CrawlCreateResponse +from ...types.browser_rendering.crawl_delete_response import CrawlDeleteResponse + +__all__ = ["CrawlResource", "AsyncCrawlResource"] + + +class CrawlResource(SyncAPIResource): + @cached_property + def with_raw_response(self) -> CrawlResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers + """ + return CrawlResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> CrawlResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/cloudflare/cloudflare-python#with_streaming_response + """ + return CrawlResourceWithStreamingResponse(self) + + @overload + def create( + self, + *, + account_id: str, + url: str, + cache_ttl: float | Omit = omit, + action_timeout: float | Omit = omit, + add_script_tag: Iterable[crawl_create_params.Variant0AddScriptTag] | Omit = omit, + add_style_tag: Iterable[crawl_create_params.Variant0AddStyleTag] | Omit = omit, + allow_request_pattern: SequenceNotStr[str] | Omit = omit, + allow_resource_types: List[ + Literal[ + "document", + "stylesheet", + "image", + "media", + "font", + "script", + "texttrack", + "xhr", + "fetch", + "prefetch", + "eventsource", + "websocket", + "manifest", + "signedexchange", + "ping", + "cspviolationreport", + "preflight", + "other", + ] + ] + | Omit = omit, + authenticate: crawl_create_params.Variant0Authenticate | Omit = omit, + best_attempt: bool | Omit = omit, + cookies: Iterable[crawl_create_params.Variant0Cookie] | Omit = omit, + depth: float | Omit = omit, + emulate_media_type: str | Omit = omit, + formats: List[Literal["html", "markdown", "json"]] | Omit = omit, + goto_options: crawl_create_params.Variant0GotoOptions | Omit = omit, + json_options: crawl_create_params.Variant0JsonOptions | Omit = omit, + limit: float | Omit = omit, + max_age: float | Omit = omit, + modified_since: int | Omit = omit, + options: crawl_create_params.Variant0Options | Omit = omit, + reject_request_pattern: SequenceNotStr[str] | Omit = omit, + reject_resource_types: List[ + Literal[ + "document", + "stylesheet", + "image", + "media", + "font", + "script", + "texttrack", + "xhr", + "fetch", + "prefetch", + "eventsource", + "websocket", + "manifest", + "signedexchange", + "ping", + "cspviolationreport", + "preflight", + "other", + ] + ] + | Omit = omit, + render: Literal[True] | Omit = omit, + set_extra_http_headers: Dict[str, str] | Omit = omit, + set_java_script_enabled: bool | Omit = omit, + source: Literal["sitemaps", "links", "all"] | Omit = omit, + user_agent: str | Omit = omit, + viewport: crawl_create_params.Variant0Viewport | Omit = omit, + wait_for_selector: crawl_create_params.Variant0WaitForSelector | Omit = omit, + wait_for_timeout: float | 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, + ) -> str: + """Starts a crawl job for the provided URL and its children. + + Check available + options like `gotoOptions` and `waitFor*` to control page load behaviour. + + Args: + account_id: Account ID. + + url: URL to navigate to, eg. `https://example.com`. + + cache_ttl: Cache TTL default is 5s. Set to 0 to disable. + + action_timeout: The maximum duration allowed for the browser action to complete after the page + has loaded (such as taking screenshots, extracting content, or generating PDFs). + If this time limit is exceeded, the action stops and returns a timeout error. + + add_script_tag: Adds a `