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 01/19] 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+5ik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ZFfQoE0r0whdLdRLU2PsLFP+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/PW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It3Z3mJN/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/PW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It3Z3mJN/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\nabI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ewPVsp/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+5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uVZFfQoE0r0whdLdRLU2PsLFP+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\nMQswCQYDVQQGEwJBVT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J6RyLOLay5phbu1iaTr4UNYm5WtYTzMzqh8l1+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\nBAYTAkFVMRMwEQYDVQQIEwpTb21lLVN0YXRlMSEwHw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XCWkK4NE+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\naWRnaXRzIFB0eSBMdGQwHhcNMTYwODI0MTY0Mz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FDGGcNf7+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\nZXJuZXQgV2lkZ2l0cyBQ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1uMoH2oVPj9TVst/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\nMAMBAf8wDQYJKoZIhvcNAQELB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tgJFIlBRPQqKoyXdz3fGvXrTkf/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\nMAMBAf8wDQYJKoZ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LMLq51GqYKtgJFIlBRPQqKoyXdz3fGvXrTkf/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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h8l1+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\naWRnaXRzIFB0eSBMdGQwHhcNMTYwODI0MTY0MzAxW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GcNf7+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-----\nMIIDtTCCAp2gAwIBAgIJAM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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\nMAMBAf8wDQYJKoZIhvcNAQELBQADggEBAHHFwl0tH0quUYZ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GvXrTkf/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="023e105f4ec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J2wQLeoYc7ceaweX/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 02/19] 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 03/19] 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 04/19] 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 05/19] 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-----\nMIIDmDCCAoCgAwIBAgIUKTOAZNjcXVZRj4oQt0SHsl1c1vMwDQYJKoZIhvcNAQELBQAwUTELMAkGA1UEBhMCVVMxFjAUBgNVBAgMDVNhbiBGcmFuY2lzY28xEzARBgNVBAcMCkNhbGlmb3JuaWExFTATBgNVBAoMDEV4YW1wbGUgSW5jLjAgFw0yMjExMjIxNjU5NDdaGA8yMTIyMTAyOTE2NTk0N1owUTELMAkGA1UEBhMCVVMxFjAUBgNVBAgMDVNhbiBGcmFuY2lzY28xEzARBgNVBAcMCkNhbGlmb3J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NDswCLF8bIZYwUBEe+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+c3AXsYTEWHh7z2czMB8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n+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-----\nMIIDmDCCAoCgAwIBAgIUKTOAZNjcXVZRj4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qGSIb3DQEBCwUAA4IBAQBc+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/8Kt1EKFyobOjuZs2SwyVyJ2sStvQuUQEosULZCNGZEqoH5g6zhMPxaxm7ZLrrsDZ9maNGVqo7EW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LjCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAMRcORwg\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="-----B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1UdDwEB/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/8Kt1EKFyobOjuZs2SwyVyJ2s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VBAcMCkNhbGlmb3JuaWExFTATBgNVBAoMDEV4\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/whNxwEZhB9HZ7111Oa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R0OBBYEFP5JzLUawNF+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/R3vgujGWJnaihCN5tv5sM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ocmOAS3PGGAhM5T3HLnUCQfnK4qgps1Lq\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-----\nMIIDmDCCAoCgAwIBAgIUKTOAZNjcXVZRj4oQt0SHsl1c1vMwDQYJKoZIhvcNAQELBQAwUTELMAkGA1UEBhMCVVMxFjAUBgNVBAgMDVNhbiBGcmFuY2lzY28xEzARBgNVBAcMCkNhbGlmb3JuaWExFTATBgNVBAoMDEV4YW1wbGUgSW5jLjAgFw0yMjExMjIxNjU5NDdaGA8yMTIyMTAyOT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m4EF0mWjHhQ5Nxpnp00Bqn5g1x8CyTDypgmugnep+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/i9IFcLypXsuz7DjrJPtP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osULZ\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-----\nMIIDmDCCAoCgAwIBAgIUKTOAZNjcXVZRj4oQt0SHsl1c1vMwDQYJKoZIhvcNAQELBQAwUTELMAkGA1UEBhMCVVMxFjAUBgNVBAgMDVNhbiBGcmFuY2lzY28xEzARBgNVBAcMCkNhbGlmb3Jua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mjAHCKBAJ76moK8tkG0aqdYpJ4ZcJTVBB7l98Rvgc7zfTi\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 06/19] 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 07/19] 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 08/19] 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 09/19] 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 10/19] 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/18QI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yFpfi5j2q348yVT0tEQS\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/1CGZ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oE0r0whdLdRLU2PsLFP+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\nMQswCQYDVQ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8mwNUAb9CzGU3JpU4PxxGFjS/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----- MIIDtTCCAp2gAwIB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BgNVBAgTClNvbWUtU3RhdGUxITAfBgNV\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 LIyTNNQH7CJecE1nbTf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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 RKFJpEcwRTEL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fSO5h2u5TaWVuSIzBvYs7Vza6m+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 BAYTAlVTMRMwEQYDVQQIEwpTb21lLVN0YXRlMSEwHwYDVQQ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\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 nTJHlHA2ozZta6YBBfVfhHWl1F0IfNbXCLKvGwWWMbCx43OfW6KTkbRnE6g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-----", 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 MAMBAf8w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lZ\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 MQswCQYDVQQGEwJVUzETMBEGA1UEC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a8RzwOmc0NT1NQqzSyktt\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 5FAw4B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gKCAQEAvq3sKsHpeduJHimOK+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 MAMBAf8wDQYJKoZIhvcNAQEFBQADggEBABY2ZzBaW0dMsAAT7tPJzrVWVzQx6KU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A1UdDgQWBBRvavf+\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 ZXJuZXQgV2lkZ2l0cyBQdHkgTHRkMI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/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 11/19] 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 12/19] 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 13/19] 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 14/19] 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 15/19] 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 16/19] 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 17/19] 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 18/19] 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 88efc7b7ea3587d4c7803fc1abaf6f6e7e1086cf 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:13:31 +0000 Subject: [PATCH 19/19] release: 5.0.0-beta.2 --- .release-please-manifest.json | 2 +- CHANGELOG.md | 27 +++++++++++++++++++++++++++ pyproject.toml | 2 +- src/cloudflare/_version.py | 2 +- 4 files changed, 30 insertions(+), 3 deletions(-) diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 1aa8e3f282a..2c9fce78b18 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "5.0.0-beta.1" + ".": "5.0.0-beta.2" } \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index 13307919a9f..436550485b5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,32 @@ # Changelog +## 5.0.0-beta.2 (2026-02-19) + +Full Changelog: [v5.0.0-beta.1...v5.0.0-beta.2](https://github.com/cloudflare/cloudflare-python/compare/v5.0.0-beta.1...v5.0.0-beta.2) + +### Features + +* feat: GIN-1439: Add gateway PAC files ([89ad3ec](https://github.com/cloudflare/cloudflare-python/commit/89ad3ecda80085641644c675ebd4581d5688edf8)) +* feat(dex): add DEX rules ([1e9c242](https://github.com/cloudflare/cloudflare-python/commit/1e9c2423aed148c30b92b5a3d25b3d62252f4137)) +* feat(stainless): TUN-10249 Add WARP Subnet endpoints ([3accc56](https://github.com/cloudflare/cloudflare-python/commit/3accc56c43e04292b700ea573d036872a8e9cb7b)) + + +### Chores + +* **api:** update composite API spec ([79a09b5](https://github.com/cloudflare/cloudflare-python/commit/79a09b5304a8733b5eff39931f5f3b26d92d7cc9)) +* **api:** update composite API spec ([a0a0048](https://github.com/cloudflare/cloudflare-python/commit/a0a00481356d678ec42a357483e3da472a16d86d)) +* **api:** update composite API spec ([2b950cf](https://github.com/cloudflare/cloudflare-python/commit/2b950cfd2456c31b7c85174f23605cb9e8a470c0)) +* **api:** update composite API spec ([6e6f2f5](https://github.com/cloudflare/cloudflare-python/commit/6e6f2f55b1da2f39b4578fa86840f8687f5d4581)) +* **api:** update composite API spec ([146459d](https://github.com/cloudflare/cloudflare-python/commit/146459da763b77bcd858d6550ed77e8477bc6e24)) +* **api:** update composite API spec ([17a33ff](https://github.com/cloudflare/cloudflare-python/commit/17a33ff8bba4c8adceb155db74bc6a606a3a43cc)) +* **api:** update composite API spec ([09e3fb1](https://github.com/cloudflare/cloudflare-python/commit/09e3fb14dfba4fdf088feaa2d567e63065c5960e)) +* **api:** update composite API spec ([ad6565c](https://github.com/cloudflare/cloudflare-python/commit/ad6565c1373fc9c7fe70358fe1df4bbd4ef3f831)) +* **api:** update composite API spec ([dd1052d](https://github.com/cloudflare/cloudflare-python/commit/dd1052dec57ca99a90848910908b05680428b9a8)) +* **api:** update composite API spec ([20bfdf8](https://github.com/cloudflare/cloudflare-python/commit/20bfdf876f557f7b581728db112789cc583d7aa6)) +* **api:** update composite API spec ([bb37db8](https://github.com/cloudflare/cloudflare-python/commit/bb37db8de6c2e0b289b0a7eb60fcabf178f43a50)) +* **api:** update composite API spec ([e531924](https://github.com/cloudflare/cloudflare-python/commit/e531924080c7d5d184a0734932f08ee59b5d085f)) +* **api:** update composite API spec ([4727ace](https://github.com/cloudflare/cloudflare-python/commit/4727acec0eb9ce14c6a1d8ded3d69a00a3bf22c9)) + ## 5.0.0-beta.1 (2026-02-13) Full Changelog: [v4.3.1...v5.0.0-beta.1](https://github.com/cloudflare/cloudflare-python/compare/v4.3.1...v5.0.0-beta.1) diff --git a/pyproject.toml b/pyproject.toml index a5a2adb78ec..2375f19d098 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "cloudflare" -version = "5.0.0-beta.1" +version = "5.0.0-beta.2" description = "The official Python library for the cloudflare API" dynamic = ["readme"] license = "Apache-2.0" diff --git a/src/cloudflare/_version.py b/src/cloudflare/_version.py index d358440ad0c..f204e83c6ac 100644 --- a/src/cloudflare/_version.py +++ b/src/cloudflare/_version.py @@ -1,4 +1,4 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. __title__ = "cloudflare" -__version__ = "5.0.0-beta.1" # x-release-please-version +__version__ = "5.0.0-beta.2" # x-release-please-version