From de4e3480493c1a6da37373f8cb06df8dacfd0bfa Mon Sep 17 00:00:00 2001
From: "stainless-app[bot]"
<142633134+stainless-app[bot]@users.noreply.github.com>
Date: Thu, 27 Jun 2024 03:25:53 +0000
Subject: [PATCH] feat(api): OpenAPI spec update via Stainless API (#1147)
---
.stats.yml | 2 +-
api.md | 2 +-
src/cloudflare/resources/zones/settings.py | 4558 +++++++++++-
src/cloudflare/types/zones/__init__.py | 4 +
.../automatic_platform_optimization_param.py | 39 +
.../types/zones/setting_edit_params.py | 848 +++
.../types/zones/setting_edit_response.py | 49 +-
tests/api_resources/zones/test_settings.py | 6513 ++++++++++++++++-
8 files changed, 11904 insertions(+), 111 deletions(-)
create mode 100644 src/cloudflare/types/zones/automatic_platform_optimization_param.py
create mode 100644 src/cloudflare/types/zones/setting_edit_params.py
diff --git a/.stats.yml b/.stats.yml
index c6fd4e3d54d..04aa11159dd 100644
--- a/.stats.yml
+++ b/.stats.yml
@@ -1,2 +1,2 @@
configured_endpoints: 1254
-openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-4b5d09861a06c00be9bfe41e442a9ed48d4e0dca267ed70d7677ef78159ab997.yml
+openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-5e3cc17dacbf34ea6c55cfa520e9852ce21b11a0a722ad53edcc7e7fe4299a1e.yml
diff --git a/api.md b/api.md
index f005ad1776f..b00839577e9 100644
--- a/api.md
+++ b/api.md
@@ -369,7 +369,7 @@ from cloudflare.types.zones import (
Methods:
-- client.zones.settings.edit(setting_id, \*, zone_id) -> Optional
+- client.zones.settings.edit(setting_id, \*, zone_id, \*\*params) -> Optional
- client.zones.settings.get(setting_id, \*, zone_id) -> Optional
## CustomNameservers
diff --git a/src/cloudflare/resources/zones/settings.py b/src/cloudflare/resources/zones/settings.py
index 480341ab1ce..1d80cf04b08 100644
--- a/src/cloudflare/resources/zones/settings.py
+++ b/src/cloudflare/resources/zones/settings.py
@@ -2,11 +2,17 @@
from __future__ import annotations
-from typing import Any, Type, Optional, cast
+from typing import Any, List, Optional, cast, overload
+from typing_extensions import Literal
import httpx
from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven
+from ..._utils import (
+ required_args,
+ maybe_transform,
+ async_maybe_transform,
+)
from ..._compat import cached_property
from ..._resource import SyncAPIResource, AsyncAPIResource
from ..._response import (
@@ -16,11 +22,13 @@
async_to_streamed_response_wrapper,
)
from ..._wrappers import ResultWrapper
+from ...types.zones import setting_edit_params
from ..._base_client import (
make_request_options,
)
from ...types.zones.setting_get_response import SettingGetResponse
from ...types.zones.setting_edit_response import SettingEditResponse
+from ...types.zones.automatic_platform_optimization_param import AutomaticPlatformOptimizationParam
__all__ = ["SettingsResource", "AsyncSettingsResource"]
@@ -34,11 +42,14 @@ def with_raw_response(self) -> SettingsResourceWithRawResponse:
def with_streaming_response(self) -> SettingsResourceWithStreamingResponse:
return SettingsResourceWithStreamingResponse(self)
+ @overload
def edit(
self,
setting_id: str,
*,
zone_id: str,
+ id: Literal["0rtt"],
+ value: Literal["on", "off"],
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
@@ -54,6 +65,10 @@ def edit(
setting_id: Setting name
+ id: ID of the zone setting.
+
+ value: Current value of the zone setting.
+
extra_headers: Send extra headers
extra_query: Add additional query parameters to the request
@@ -62,42 +77,35 @@ def edit(
timeout: Override the client-level default timeout for this request, in seconds
"""
- if not zone_id:
- raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
- if not setting_id:
- raise ValueError(f"Expected a non-empty value for `setting_id` but received {setting_id!r}")
- return self._patch(
- f"/zones/{zone_id}/settings/{setting_id}",
- options=make_request_options(
- extra_headers=extra_headers,
- extra_query=extra_query,
- extra_body=extra_body,
- timeout=timeout,
- post_parser=ResultWrapper[Optional[SettingEditResponse]]._unwrapper,
- ),
- cast_to=cast(Type[Optional[SettingEditResponse]], ResultWrapper[SettingEditResponse]),
- )
+ ...
- def get(
+ @overload
+ def edit(
self,
setting_id: str,
*,
zone_id: str,
+ id: Literal["advanced_ddos"],
+ value: Literal["on", "off"],
# Use the following arguments if you need to pass additional parameters to the API that aren't available via 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[SettingGetResponse]:
+ ) -> Optional[SettingEditResponse]:
"""
- Fetch a single zone setting by name
+ Updates a single zone setting by the identifier
Args:
zone_id: Identifier
setting_id: Setting name
+ id: ID of the zone setting.
+
+ value: Current value of the zone setting.
+
extra_headers: Send extra headers
extra_query: Add additional query parameters to the request
@@ -106,42 +114,53 @@ def get(
timeout: Override the client-level default timeout for this request, in seconds
"""
- if not zone_id:
- raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
- if not setting_id:
- raise ValueError(f"Expected a non-empty value for `setting_id` but received {setting_id!r}")
- return cast(
- Optional[SettingGetResponse],
- self._get(
- f"/zones/{zone_id}/settings/{setting_id}",
- options=make_request_options(
- extra_headers=extra_headers,
- extra_query=extra_query,
- extra_body=extra_body,
- timeout=timeout,
- post_parser=ResultWrapper[Optional[SettingGetResponse]]._unwrapper,
- ),
- cast_to=cast(
- Any, ResultWrapper[SettingGetResponse]
- ), # Union types cannot be passed in as arguments in the type system
- ),
- )
+ ...
+
+ @overload
+ def edit(
+ self,
+ setting_id: str,
+ *,
+ zone_id: str,
+ id: Literal["always_online"],
+ value: Literal["on", "off"],
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via 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[SettingEditResponse]:
+ """
+ Updates a single zone setting by the identifier
+ Args:
+ zone_id: Identifier
-class AsyncSettingsResource(AsyncAPIResource):
- @cached_property
- def with_raw_response(self) -> AsyncSettingsResourceWithRawResponse:
- return AsyncSettingsResourceWithRawResponse(self)
+ setting_id: Setting name
- @cached_property
- def with_streaming_response(self) -> AsyncSettingsResourceWithStreamingResponse:
- return AsyncSettingsResourceWithStreamingResponse(self)
+ id: ID of the zone setting.
- async def edit(
+ value: Current value of the zone setting.
+
+ 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,
setting_id: str,
*,
zone_id: str,
+ id: Literal["always_use_https"],
+ value: Literal["on", "off"],
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
@@ -157,6 +176,10 @@ async def edit(
setting_id: Setting name
+ id: ID of the zone setting.
+
+ value: Current value of the zone setting.
+
extra_headers: Send extra headers
extra_query: Add additional query parameters to the request
@@ -165,20 +188,4435 @@ async def edit(
timeout: Override the client-level default timeout for this request, in seconds
"""
- if not zone_id:
- raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
- if not setting_id:
- raise ValueError(f"Expected a non-empty value for `setting_id` but received {setting_id!r}")
- return await self._patch(
- f"/zones/{zone_id}/settings/{setting_id}",
- options=make_request_options(
- extra_headers=extra_headers,
- extra_query=extra_query,
- extra_body=extra_body,
- timeout=timeout,
- post_parser=ResultWrapper[Optional[SettingEditResponse]]._unwrapper,
+ ...
+
+ @overload
+ def edit(
+ self,
+ setting_id: str,
+ *,
+ zone_id: str,
+ id: Literal["automatic_https_rewrites"],
+ value: Literal["on", "off"],
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via 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[SettingEditResponse]:
+ """
+ Updates a single zone setting by the identifier
+
+ Args:
+ zone_id: Identifier
+
+ setting_id: Setting name
+
+ id: ID of the zone setting.
+
+ value: Current value of the zone setting.
+
+ 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,
+ setting_id: str,
+ *,
+ zone_id: str,
+ id: Literal["brotli"],
+ value: Literal["off", "on"],
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via 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[SettingEditResponse]:
+ """
+ Updates a single zone setting by the identifier
+
+ Args:
+ zone_id: Identifier
+
+ setting_id: Setting name
+
+ id: ID of the zone setting.
+
+ value: Current value of the zone setting.
+
+ 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,
+ setting_id: str,
+ *,
+ zone_id: str,
+ id: Literal["browser_cache_ttl"],
+ value: Literal[
+ 0,
+ 30,
+ 60,
+ 120,
+ 300,
+ 1200,
+ 1800,
+ 3600,
+ 7200,
+ 10800,
+ 14400,
+ 18000,
+ 28800,
+ 43200,
+ 57600,
+ 72000,
+ 86400,
+ 172800,
+ 259200,
+ 345600,
+ 432000,
+ 691200,
+ 1382400,
+ 2073600,
+ 2678400,
+ 5356800,
+ 16070400,
+ 31536000,
+ ],
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via 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[SettingEditResponse]:
+ """
+ Updates a single zone setting by the identifier
+
+ Args:
+ zone_id: Identifier
+
+ setting_id: Setting name
+
+ id: ID of the zone setting.
+
+ value: Current value of the zone setting.
+
+ 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,
+ setting_id: str,
+ *,
+ zone_id: str,
+ id: Literal["browser_check"],
+ value: Literal["on", "off"],
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via 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[SettingEditResponse]:
+ """
+ Updates a single zone setting by the identifier
+
+ Args:
+ zone_id: Identifier
+
+ setting_id: Setting name
+
+ id: ID of the zone setting.
+
+ value: Current value of the zone setting.
+
+ 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,
+ setting_id: str,
+ *,
+ zone_id: str,
+ id: Literal["cache_level"],
+ value: Literal["aggressive", "basic", "simplified"],
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via 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[SettingEditResponse]:
+ """
+ Updates a single zone setting by the identifier
+
+ Args:
+ zone_id: Identifier
+
+ setting_id: Setting name
+
+ id: ID of the zone setting.
+
+ value: Current value of the zone setting.
+
+ 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,
+ setting_id: str,
+ *,
+ zone_id: str,
+ id: Literal["challenge_ttl"],
+ value: Literal[300, 900, 1800, 2700, 3600, 7200, 10800, 14400, 28800, 57600, 86400, 604800, 2592000, 31536000],
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via 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[SettingEditResponse]:
+ """
+ Updates a single zone setting by the identifier
+
+ Args:
+ zone_id: Identifier
+
+ setting_id: Setting name
+
+ id: ID of the zone setting.
+
+ value: Current value of the zone setting.
+
+ 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,
+ setting_id: str,
+ *,
+ zone_id: str,
+ id: Literal["ciphers"],
+ value: List[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[SettingEditResponse]:
+ """
+ Updates a single zone setting by the identifier
+
+ Args:
+ zone_id: Identifier
+
+ setting_id: Setting name
+
+ id: ID of the zone setting.
+
+ value: Current value of the zone setting.
+
+ 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,
+ setting_id: str,
+ *,
+ zone_id: str,
+ id: Literal["cname_flattening"],
+ value: Literal["flatten_at_root", "flatten_all"],
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via 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[SettingEditResponse]:
+ """
+ Updates a single zone setting by the identifier
+
+ Args:
+ zone_id: Identifier
+
+ setting_id: Setting name
+
+ id: How to flatten the cname destination.
+
+ value: Current value of the zone setting.
+
+ 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,
+ setting_id: str,
+ *,
+ zone_id: str,
+ id: Literal["development_mode"],
+ value: Literal["on", "off"],
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via 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[SettingEditResponse]:
+ """
+ Updates a single zone setting by the identifier
+
+ Args:
+ zone_id: Identifier
+
+ setting_id: Setting name
+
+ id: ID of the zone setting.
+
+ value: Current value of the zone setting.
+
+ 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,
+ setting_id: str,
+ *,
+ zone_id: str,
+ id: Literal["early_hints"],
+ value: Literal["on", "off"],
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via 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[SettingEditResponse]:
+ """
+ Updates a single zone setting by the identifier
+
+ Args:
+ zone_id: Identifier
+
+ setting_id: Setting name
+
+ id: ID of the zone setting.
+
+ value: Current value of the zone setting.
+
+ 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,
+ setting_id: str,
+ *,
+ zone_id: str,
+ id: Literal["edge_cache_ttl"],
+ value: Literal[
+ 30,
+ 60,
+ 300,
+ 1200,
+ 1800,
+ 3600,
+ 7200,
+ 10800,
+ 14400,
+ 18000,
+ 28800,
+ 43200,
+ 57600,
+ 72000,
+ 86400,
+ 172800,
+ 259200,
+ 345600,
+ 432000,
+ 518400,
+ 604800,
+ ],
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via 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[SettingEditResponse]:
+ """
+ Updates a single zone setting by the identifier
+
+ Args:
+ zone_id: Identifier
+
+ setting_id: Setting name
+
+ id: ID of the zone setting.
+
+ value: Current value of the zone setting.
+
+ 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,
+ setting_id: str,
+ *,
+ zone_id: str,
+ id: Literal["email_obfuscation"],
+ value: Literal["on", "off"],
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via 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[SettingEditResponse]:
+ """
+ Updates a single zone setting by the identifier
+
+ Args:
+ zone_id: Identifier
+
+ setting_id: Setting name
+
+ id: ID of the zone setting.
+
+ value: Current value of the zone setting.
+
+ 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,
+ setting_id: str,
+ *,
+ zone_id: str,
+ id: Literal["h2_prioritization"],
+ value: Literal["on", "off", "custom"],
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via 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[SettingEditResponse]:
+ """
+ Updates a single zone setting by the identifier
+
+ Args:
+ zone_id: Identifier
+
+ setting_id: Setting name
+
+ id: ID of the zone setting.
+
+ value: Current value of the zone setting.
+
+ 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,
+ setting_id: str,
+ *,
+ zone_id: str,
+ id: Literal["hotlink_protection"],
+ value: Literal["on", "off"],
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via 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[SettingEditResponse]:
+ """
+ Updates a single zone setting by the identifier
+
+ Args:
+ zone_id: Identifier
+
+ setting_id: Setting name
+
+ id: ID of the zone setting.
+
+ value: Current value of the zone setting.
+
+ 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,
+ setting_id: str,
+ *,
+ zone_id: str,
+ id: Literal["http2"],
+ value: Literal["on", "off"],
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via 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[SettingEditResponse]:
+ """
+ Updates a single zone setting by the identifier
+
+ Args:
+ zone_id: Identifier
+
+ setting_id: Setting name
+
+ id: ID of the zone setting.
+
+ value: Current value of the zone setting.
+
+ 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,
+ setting_id: str,
+ *,
+ zone_id: str,
+ id: Literal["http3"],
+ value: Literal["on", "off"],
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via 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[SettingEditResponse]:
+ """
+ Updates a single zone setting by the identifier
+
+ Args:
+ zone_id: Identifier
+
+ setting_id: Setting name
+
+ id: ID of the zone setting.
+
+ value: Current value of the zone setting.
+
+ 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,
+ setting_id: str,
+ *,
+ zone_id: str,
+ id: Literal["image_resizing"],
+ value: Literal["on", "off", "open"],
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via 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[SettingEditResponse]:
+ """
+ Updates a single zone setting by the identifier
+
+ Args:
+ zone_id: Identifier
+
+ setting_id: Setting name
+
+ id: ID of the zone setting.
+
+ value: Current value of the zone setting.
+
+ 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,
+ setting_id: str,
+ *,
+ zone_id: str,
+ id: Literal["ip_geolocation"],
+ value: Literal["on", "off"],
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via 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[SettingEditResponse]:
+ """
+ Updates a single zone setting by the identifier
+
+ Args:
+ zone_id: Identifier
+
+ setting_id: Setting name
+
+ id: ID of the zone setting.
+
+ value: Current value of the zone setting.
+
+ 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,
+ setting_id: str,
+ *,
+ zone_id: str,
+ id: Literal["ipv6"],
+ value: Literal["off", "on"],
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via 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[SettingEditResponse]:
+ """
+ Updates a single zone setting by the identifier
+
+ Args:
+ zone_id: Identifier
+
+ setting_id: Setting name
+
+ id: ID of the zone setting.
+
+ value: Current value of the zone setting.
+
+ 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,
+ setting_id: str,
+ *,
+ zone_id: str,
+ id: Literal["max_upload"],
+ value: Literal[100, 200, 500],
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via 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[SettingEditResponse]:
+ """
+ Updates a single zone setting by the identifier
+
+ Args:
+ zone_id: Identifier
+
+ setting_id: Setting name
+
+ id: identifier of the zone setting.
+
+ value: Current value of the zone setting.
+
+ 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,
+ setting_id: str,
+ *,
+ zone_id: str,
+ id: Literal["min_tls_version"],
+ value: Literal["1.0", "1.1", "1.2", "1.3"],
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via 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[SettingEditResponse]:
+ """
+ Updates a single zone setting by the identifier
+
+ Args:
+ zone_id: Identifier
+
+ setting_id: Setting name
+
+ id: ID of the zone setting.
+
+ value: Current value of the zone setting.
+
+ 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,
+ setting_id: str,
+ *,
+ zone_id: str,
+ id: Literal["minify"],
+ value: setting_edit_params.MinifyValue,
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via 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[SettingEditResponse]:
+ """
+ Updates a single zone setting by the identifier
+
+ Args:
+ zone_id: Identifier
+
+ setting_id: Setting name
+
+ id: Zone setting identifier.
+
+ value: Current value of the zone setting.
+
+ 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,
+ setting_id: str,
+ *,
+ zone_id: str,
+ id: Literal["mirage"],
+ value: Literal["on", "off"],
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via 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[SettingEditResponse]:
+ """
+ Updates a single zone setting by the identifier
+
+ Args:
+ zone_id: Identifier
+
+ setting_id: Setting name
+
+ id: ID of the zone setting.
+
+ value: Current value of the zone setting.
+
+ 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,
+ setting_id: str,
+ *,
+ zone_id: str,
+ id: Literal["mobile_redirect"],
+ value: setting_edit_params.MobileRedirectValue,
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via 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[SettingEditResponse]:
+ """
+ Updates a single zone setting by the identifier
+
+ Args:
+ zone_id: Identifier
+
+ setting_id: Setting name
+
+ id: Identifier of the zone setting.
+
+ value: Current value of the zone setting.
+
+ 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,
+ setting_id: str,
+ *,
+ zone_id: str,
+ id: Literal["nel"],
+ value: setting_edit_params.NELValue,
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via 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[SettingEditResponse]:
+ """
+ Updates a single zone setting by the identifier
+
+ Args:
+ zone_id: Identifier
+
+ setting_id: Setting name
+
+ id: Zone setting identifier.
+
+ value: Current value of the zone setting.
+
+ 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,
+ setting_id: str,
+ *,
+ zone_id: str,
+ id: Literal["opportunistic_encryption"],
+ value: Literal["on", "off"],
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via 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[SettingEditResponse]:
+ """
+ Updates a single zone setting by the identifier
+
+ Args:
+ zone_id: Identifier
+
+ setting_id: Setting name
+
+ id: ID of the zone setting.
+
+ value: Current value of the zone setting.
+
+ 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,
+ setting_id: str,
+ *,
+ zone_id: str,
+ id: Literal["opportunistic_onion"],
+ value: Literal["on", "off"],
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via 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[SettingEditResponse]:
+ """
+ Updates a single zone setting by the identifier
+
+ Args:
+ zone_id: Identifier
+
+ setting_id: Setting name
+
+ id: ID of the zone setting.
+
+ value: Current value of the zone setting.
+
+ 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,
+ setting_id: str,
+ *,
+ zone_id: str,
+ id: Literal["orange_to_orange"],
+ value: Literal["on", "off"],
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via 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[SettingEditResponse]:
+ """
+ Updates a single zone setting by the identifier
+
+ Args:
+ zone_id: Identifier
+
+ setting_id: Setting name
+
+ id: ID of the zone setting.
+
+ value: Current value of the zone setting.
+
+ 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,
+ setting_id: str,
+ *,
+ zone_id: str,
+ id: Literal["origin_error_page_pass_thru"],
+ value: Literal["on", "off"],
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via 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[SettingEditResponse]:
+ """
+ Updates a single zone setting by the identifier
+
+ Args:
+ zone_id: Identifier
+
+ setting_id: Setting name
+
+ id: ID of the zone setting.
+
+ value: Current value of the zone setting.
+
+ 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,
+ setting_id: str,
+ *,
+ zone_id: str,
+ id: Literal["polish"],
+ value: Literal["off", "lossless", "lossy"],
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via 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[SettingEditResponse]:
+ """
+ Updates a single zone setting by the identifier
+
+ Args:
+ zone_id: Identifier
+
+ setting_id: Setting name
+
+ id: ID of the zone setting.
+
+ value: Current value of the zone setting.
+
+ 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,
+ setting_id: str,
+ *,
+ zone_id: str,
+ id: Literal["prefetch_preload"],
+ value: Literal["on", "off"],
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via 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[SettingEditResponse]:
+ """
+ Updates a single zone setting by the identifier
+
+ Args:
+ zone_id: Identifier
+
+ setting_id: Setting name
+
+ id: ID of the zone setting.
+
+ value: Current value of the zone setting.
+
+ 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,
+ setting_id: str,
+ *,
+ zone_id: str,
+ id: Literal["proxy_read_timeout"],
+ value: float,
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via 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[SettingEditResponse]:
+ """
+ Updates a single zone setting by the identifier
+
+ Args:
+ zone_id: Identifier
+
+ setting_id: Setting name
+
+ id: ID of the zone setting.
+
+ value: Current value of the zone setting.
+
+ 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,
+ setting_id: str,
+ *,
+ zone_id: str,
+ id: Literal["pseudo_ipv4"],
+ value: Literal["off", "add_header", "overwrite_header"],
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via 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[SettingEditResponse]:
+ """
+ Updates a single zone setting by the identifier
+
+ Args:
+ zone_id: Identifier
+
+ setting_id: Setting name
+
+ id: Value of the Pseudo IPv4 setting.
+
+ value: Current value of the zone setting.
+
+ 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,
+ setting_id: str,
+ *,
+ zone_id: str,
+ id: Literal["replace_insecure_js"],
+ value: Literal["on", "off"],
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via 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[SettingEditResponse]:
+ """
+ Updates a single zone setting by the identifier
+
+ Args:
+ zone_id: Identifier
+
+ setting_id: Setting name
+
+ id: ID of the zone setting.
+
+ value: Current value of the zone setting.
+
+ 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,
+ setting_id: str,
+ *,
+ zone_id: str,
+ id: Literal["response_buffering"],
+ value: Literal["on", "off"],
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via 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[SettingEditResponse]:
+ """
+ Updates a single zone setting by the identifier
+
+ Args:
+ zone_id: Identifier
+
+ setting_id: Setting name
+
+ id: ID of the zone setting.
+
+ value: Current value of the zone setting.
+
+ 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,
+ setting_id: str,
+ *,
+ zone_id: str,
+ id: Literal["rocket_loader"],
+ value: Literal["on", "off"],
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via 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[SettingEditResponse]:
+ """
+ Updates a single zone setting by the identifier
+
+ Args:
+ zone_id: Identifier
+
+ setting_id: Setting name
+
+ id: ID of the zone setting.
+
+ value: Current value of the zone setting.
+
+ 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,
+ setting_id: str,
+ *,
+ zone_id: str,
+ id: Literal["automatic_platform_optimization"],
+ value: AutomaticPlatformOptimizationParam,
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via 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[SettingEditResponse]:
+ """
+ Updates a single zone setting by the identifier
+
+ Args:
+ zone_id: Identifier
+
+ setting_id: Setting name
+
+ id: ID of the zone setting.
+
+ value: Current value of the zone setting.
+
+ 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,
+ setting_id: str,
+ *,
+ zone_id: str,
+ id: Literal["security_header"],
+ value: setting_edit_params.SecurityHeadersValue,
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via 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[SettingEditResponse]:
+ """
+ Updates a single zone setting by the identifier
+
+ Args:
+ zone_id: Identifier
+
+ setting_id: Setting name
+
+ id: ID of the zone's security header.
+
+ value: Current value of the zone setting.
+
+ 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,
+ setting_id: str,
+ *,
+ zone_id: str,
+ id: Literal["security_level"],
+ value: Literal["off", "essentially_off", "low", "medium", "high", "under_attack"],
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via 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[SettingEditResponse]:
+ """
+ Updates a single zone setting by the identifier
+
+ Args:
+ zone_id: Identifier
+
+ setting_id: Setting name
+
+ id: ID of the zone setting.
+
+ value: Current value of the zone setting.
+
+ 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,
+ setting_id: str,
+ *,
+ zone_id: str,
+ id: Literal["server_side_exclude"],
+ value: Literal["on", "off"],
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via 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[SettingEditResponse]:
+ """
+ Updates a single zone setting by the identifier
+
+ Args:
+ zone_id: Identifier
+
+ setting_id: Setting name
+
+ id: ID of the zone setting.
+
+ value: Current value of the zone setting.
+
+ 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,
+ setting_id: str,
+ *,
+ zone_id: str,
+ id: Literal["sha1_support"],
+ value: Literal["off", "on"],
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via 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[SettingEditResponse]:
+ """
+ Updates a single zone setting by the identifier
+
+ Args:
+ zone_id: Identifier
+
+ setting_id: Setting name
+
+ id: Zone setting identifier.
+
+ value: Current value of the zone setting.
+
+ 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,
+ setting_id: str,
+ *,
+ zone_id: str,
+ id: Literal["sort_query_string_for_cache"],
+ value: Literal["on", "off"],
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via 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[SettingEditResponse]:
+ """
+ Updates a single zone setting by the identifier
+
+ Args:
+ zone_id: Identifier
+
+ setting_id: Setting name
+
+ id: ID of the zone setting.
+
+ value: Current value of the zone setting.
+
+ 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,
+ setting_id: str,
+ *,
+ zone_id: str,
+ id: Literal["ssl"],
+ value: Literal["off", "flexible", "full", "strict"],
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via 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[SettingEditResponse]:
+ """
+ Updates a single zone setting by the identifier
+
+ Args:
+ zone_id: Identifier
+
+ setting_id: Setting name
+
+ id: ID of the zone setting.
+
+ value: Current value of the zone setting.
+
+ 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,
+ setting_id: str,
+ *,
+ zone_id: str,
+ id: Literal["ssl_recommender"] | NotGiven = NOT_GIVEN,
+ enabled: bool | NotGiven = NOT_GIVEN,
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
+ # The extra values given here take precedence over values defined on the client or passed to this method.
+ extra_headers: Headers | None = None,
+ extra_query: Query | None = None,
+ extra_body: Body | None = None,
+ timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
+ ) -> Optional[SettingEditResponse]:
+ """
+ Updates a single zone setting by the identifier
+
+ Args:
+ zone_id: Identifier
+
+ setting_id: Setting name
+
+ id: Enrollment value for SSL/TLS Recommender.
+
+ enabled: ssl-recommender enrollment setting.
+
+ 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,
+ setting_id: str,
+ *,
+ zone_id: str,
+ id: Literal["tls_1_2_only"],
+ value: Literal["off", "on"],
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via 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[SettingEditResponse]:
+ """
+ Updates a single zone setting by the identifier
+
+ Args:
+ zone_id: Identifier
+
+ setting_id: Setting name
+
+ id: Zone setting identifier.
+
+ value: Current value of the zone setting.
+
+ 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,
+ setting_id: str,
+ *,
+ zone_id: str,
+ id: Literal["tls_1_3"],
+ value: Literal["on", "off", "zrt"],
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via 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[SettingEditResponse]:
+ """
+ Updates a single zone setting by the identifier
+
+ Args:
+ zone_id: Identifier
+
+ setting_id: Setting name
+
+ id: ID of the zone setting.
+
+ value: Current value of the zone setting.
+
+ 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,
+ setting_id: str,
+ *,
+ zone_id: str,
+ id: Literal["tls_client_auth"],
+ value: Literal["on", "off"],
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via 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[SettingEditResponse]:
+ """
+ Updates a single zone setting by the identifier
+
+ Args:
+ zone_id: Identifier
+
+ setting_id: Setting name
+
+ id: ID of the zone setting.
+
+ value: Current value of the zone setting.
+
+ 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,
+ setting_id: str,
+ *,
+ zone_id: str,
+ id: Literal["true_client_ip_header"],
+ value: Literal["on", "off"],
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via 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[SettingEditResponse]:
+ """
+ Updates a single zone setting by the identifier
+
+ Args:
+ zone_id: Identifier
+
+ setting_id: Setting name
+
+ id: ID of the zone setting.
+
+ value: Current value of the zone setting.
+
+ 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,
+ setting_id: str,
+ *,
+ zone_id: str,
+ id: Literal["waf"],
+ value: Literal["on", "off"],
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via 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[SettingEditResponse]:
+ """
+ Updates a single zone setting by the identifier
+
+ Args:
+ zone_id: Identifier
+
+ setting_id: Setting name
+
+ id: ID of the zone setting.
+
+ value: Current value of the zone setting.
+
+ 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,
+ setting_id: str,
+ *,
+ zone_id: str,
+ id: Literal["webp"],
+ value: Literal["off", "on"],
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via 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[SettingEditResponse]:
+ """
+ Updates a single zone setting by the identifier
+
+ Args:
+ zone_id: Identifier
+
+ setting_id: Setting name
+
+ id: ID of the zone setting.
+
+ value: Current value of the zone setting.
+
+ 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,
+ setting_id: str,
+ *,
+ zone_id: str,
+ id: Literal["websockets"],
+ value: Literal["off", "on"],
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via 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[SettingEditResponse]:
+ """
+ Updates a single zone setting by the identifier
+
+ Args:
+ zone_id: Identifier
+
+ setting_id: Setting name
+
+ id: ID of the zone setting.
+
+ value: Current value of the zone setting.
+
+ extra_headers: Send extra headers
+
+ extra_query: Add additional query parameters to the request
+
+ extra_body: Add additional JSON properties to the request
+
+ timeout: Override the client-level default timeout for this request, in seconds
+ """
+ ...
+
+ @required_args(["zone_id", "id", "value"], ["zone_id"])
+ def edit(
+ self,
+ setting_id: str,
+ *,
+ zone_id: str,
+ id: Literal["0rtt"]
+ | Literal["advanced_ddos"]
+ | Literal["always_online"]
+ | Literal["always_use_https"]
+ | Literal["automatic_https_rewrites"]
+ | Literal["brotli"]
+ | Literal["browser_cache_ttl"]
+ | Literal["browser_check"]
+ | Literal["cache_level"]
+ | Literal["challenge_ttl"]
+ | Literal["ciphers"]
+ | Literal["cname_flattening"]
+ | Literal["development_mode"]
+ | Literal["early_hints"]
+ | Literal["edge_cache_ttl"]
+ | Literal["email_obfuscation"]
+ | Literal["h2_prioritization"]
+ | Literal["hotlink_protection"]
+ | Literal["http2"]
+ | Literal["http3"]
+ | Literal["image_resizing"]
+ | Literal["ip_geolocation"]
+ | Literal["ipv6"]
+ | Literal["max_upload"]
+ | Literal["min_tls_version"]
+ | Literal["minify"]
+ | Literal["mirage"]
+ | Literal["mobile_redirect"]
+ | Literal["nel"]
+ | Literal["opportunistic_encryption"]
+ | Literal["opportunistic_onion"]
+ | Literal["orange_to_orange"]
+ | Literal["origin_error_page_pass_thru"]
+ | Literal["polish"]
+ | Literal["prefetch_preload"]
+ | Literal["proxy_read_timeout"]
+ | Literal["pseudo_ipv4"]
+ | Literal["replace_insecure_js"]
+ | Literal["response_buffering"]
+ | Literal["rocket_loader"]
+ | Literal["automatic_platform_optimization"]
+ | Literal["security_header"]
+ | Literal["security_level"]
+ | Literal["server_side_exclude"]
+ | Literal["sha1_support"]
+ | Literal["sort_query_string_for_cache"]
+ | Literal["ssl"]
+ | Literal["ssl_recommender"]
+ | Literal["tls_1_2_only"]
+ | Literal["tls_1_3"]
+ | Literal["tls_client_auth"]
+ | Literal["true_client_ip_header"]
+ | Literal["waf"]
+ | Literal["webp"]
+ | Literal["websockets"]
+ | NotGiven = NOT_GIVEN,
+ value: Literal["on", "off"]
+ | Literal[
+ 0,
+ 30,
+ 60,
+ 120,
+ 300,
+ 1200,
+ 1800,
+ 3600,
+ 7200,
+ 10800,
+ 14400,
+ 18000,
+ 28800,
+ 43200,
+ 57600,
+ 72000,
+ 86400,
+ 172800,
+ 259200,
+ 345600,
+ 432000,
+ 691200,
+ 1382400,
+ 2073600,
+ 2678400,
+ 5356800,
+ 16070400,
+ 31536000,
+ ]
+ | Literal["aggressive", "basic", "simplified"]
+ | Literal[300, 900, 1800, 2700, 3600, 7200, 10800, 14400, 28800, 57600, 86400, 604800, 2592000, 31536000]
+ | List[str]
+ | Literal["flatten_at_root", "flatten_all"]
+ | Literal[
+ 30,
+ 60,
+ 300,
+ 1200,
+ 1800,
+ 3600,
+ 7200,
+ 10800,
+ 14400,
+ 18000,
+ 28800,
+ 43200,
+ 57600,
+ 72000,
+ 86400,
+ 172800,
+ 259200,
+ 345600,
+ 432000,
+ 518400,
+ 604800,
+ ]
+ | Literal["on", "off", "custom"]
+ | Literal["on", "off", "open"]
+ | Literal[100, 200, 500]
+ | Literal["1.0", "1.1", "1.2", "1.3"]
+ | setting_edit_params.MinifyValue
+ | setting_edit_params.MobileRedirectValue
+ | setting_edit_params.NELValue
+ | Literal["off", "lossless", "lossy"]
+ | float
+ | Literal["off", "add_header", "overwrite_header"]
+ | AutomaticPlatformOptimizationParam
+ | setting_edit_params.SecurityHeadersValue
+ | Literal["off", "essentially_off", "low", "medium", "high", "under_attack"]
+ | Literal["off", "flexible", "full", "strict"]
+ | Literal["on", "off", "zrt"]
+ | NotGiven = NOT_GIVEN,
+ enabled: bool | NotGiven = NOT_GIVEN,
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
+ # The extra values given here take precedence over values defined on the client or passed to this method.
+ extra_headers: Headers | None = None,
+ extra_query: Query | None = None,
+ extra_body: Body | None = None,
+ timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
+ ) -> Optional[SettingEditResponse]:
+ if not zone_id:
+ raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
+ if not setting_id:
+ raise ValueError(f"Expected a non-empty value for `setting_id` but received {setting_id!r}")
+ return cast(
+ Optional[SettingEditResponse],
+ self._patch(
+ f"/zones/{zone_id}/settings/{setting_id}",
+ body=maybe_transform(
+ {
+ "id": id,
+ "value": value,
+ "enabled": enabled,
+ },
+ setting_edit_params.SettingEditParams,
+ ),
+ options=make_request_options(
+ extra_headers=extra_headers,
+ extra_query=extra_query,
+ extra_body=extra_body,
+ timeout=timeout,
+ post_parser=ResultWrapper[Optional[SettingEditResponse]]._unwrapper,
+ ),
+ cast_to=cast(
+ Any, ResultWrapper[SettingEditResponse]
+ ), # Union types cannot be passed in as arguments in the type system
+ ),
+ )
+
+ def get(
+ self,
+ setting_id: str,
+ *,
+ zone_id: str,
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
+ # The extra values given here take precedence over values defined on the client or passed to this method.
+ extra_headers: Headers | None = None,
+ extra_query: Query | None = None,
+ extra_body: Body | None = None,
+ timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
+ ) -> Optional[SettingGetResponse]:
+ """
+ Fetch a single zone setting by name
+
+ Args:
+ zone_id: Identifier
+
+ setting_id: Setting name
+
+ extra_headers: Send extra headers
+
+ extra_query: Add additional query parameters to the request
+
+ extra_body: Add additional JSON properties to the request
+
+ timeout: Override the client-level default timeout for this request, in seconds
+ """
+ if not zone_id:
+ raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
+ if not setting_id:
+ raise ValueError(f"Expected a non-empty value for `setting_id` but received {setting_id!r}")
+ return cast(
+ Optional[SettingGetResponse],
+ self._get(
+ f"/zones/{zone_id}/settings/{setting_id}",
+ options=make_request_options(
+ extra_headers=extra_headers,
+ extra_query=extra_query,
+ extra_body=extra_body,
+ timeout=timeout,
+ post_parser=ResultWrapper[Optional[SettingGetResponse]]._unwrapper,
+ ),
+ cast_to=cast(
+ Any, ResultWrapper[SettingGetResponse]
+ ), # Union types cannot be passed in as arguments in the type system
+ ),
+ )
+
+
+class AsyncSettingsResource(AsyncAPIResource):
+ @cached_property
+ def with_raw_response(self) -> AsyncSettingsResourceWithRawResponse:
+ return AsyncSettingsResourceWithRawResponse(self)
+
+ @cached_property
+ def with_streaming_response(self) -> AsyncSettingsResourceWithStreamingResponse:
+ return AsyncSettingsResourceWithStreamingResponse(self)
+
+ @overload
+ async def edit(
+ self,
+ setting_id: str,
+ *,
+ zone_id: str,
+ id: Literal["0rtt"],
+ value: Literal["on", "off"],
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via 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[SettingEditResponse]:
+ """
+ Updates a single zone setting by the identifier
+
+ Args:
+ zone_id: Identifier
+
+ setting_id: Setting name
+
+ id: ID of the zone setting.
+
+ value: Current value of the zone setting.
+
+ 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,
+ setting_id: str,
+ *,
+ zone_id: str,
+ id: Literal["advanced_ddos"],
+ value: Literal["on", "off"],
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via 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[SettingEditResponse]:
+ """
+ Updates a single zone setting by the identifier
+
+ Args:
+ zone_id: Identifier
+
+ setting_id: Setting name
+
+ id: ID of the zone setting.
+
+ value: Current value of the zone setting.
+
+ 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,
+ setting_id: str,
+ *,
+ zone_id: str,
+ id: Literal["always_online"],
+ value: Literal["on", "off"],
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via 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[SettingEditResponse]:
+ """
+ Updates a single zone setting by the identifier
+
+ Args:
+ zone_id: Identifier
+
+ setting_id: Setting name
+
+ id: ID of the zone setting.
+
+ value: Current value of the zone setting.
+
+ 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,
+ setting_id: str,
+ *,
+ zone_id: str,
+ id: Literal["always_use_https"],
+ value: Literal["on", "off"],
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via 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[SettingEditResponse]:
+ """
+ Updates a single zone setting by the identifier
+
+ Args:
+ zone_id: Identifier
+
+ setting_id: Setting name
+
+ id: ID of the zone setting.
+
+ value: Current value of the zone setting.
+
+ 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,
+ setting_id: str,
+ *,
+ zone_id: str,
+ id: Literal["automatic_https_rewrites"],
+ value: Literal["on", "off"],
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via 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[SettingEditResponse]:
+ """
+ Updates a single zone setting by the identifier
+
+ Args:
+ zone_id: Identifier
+
+ setting_id: Setting name
+
+ id: ID of the zone setting.
+
+ value: Current value of the zone setting.
+
+ 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,
+ setting_id: str,
+ *,
+ zone_id: str,
+ id: Literal["brotli"],
+ value: Literal["off", "on"],
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via 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[SettingEditResponse]:
+ """
+ Updates a single zone setting by the identifier
+
+ Args:
+ zone_id: Identifier
+
+ setting_id: Setting name
+
+ id: ID of the zone setting.
+
+ value: Current value of the zone setting.
+
+ 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,
+ setting_id: str,
+ *,
+ zone_id: str,
+ id: Literal["browser_cache_ttl"],
+ value: Literal[
+ 0,
+ 30,
+ 60,
+ 120,
+ 300,
+ 1200,
+ 1800,
+ 3600,
+ 7200,
+ 10800,
+ 14400,
+ 18000,
+ 28800,
+ 43200,
+ 57600,
+ 72000,
+ 86400,
+ 172800,
+ 259200,
+ 345600,
+ 432000,
+ 691200,
+ 1382400,
+ 2073600,
+ 2678400,
+ 5356800,
+ 16070400,
+ 31536000,
+ ],
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via 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[SettingEditResponse]:
+ """
+ Updates a single zone setting by the identifier
+
+ Args:
+ zone_id: Identifier
+
+ setting_id: Setting name
+
+ id: ID of the zone setting.
+
+ value: Current value of the zone setting.
+
+ 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,
+ setting_id: str,
+ *,
+ zone_id: str,
+ id: Literal["browser_check"],
+ value: Literal["on", "off"],
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via 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[SettingEditResponse]:
+ """
+ Updates a single zone setting by the identifier
+
+ Args:
+ zone_id: Identifier
+
+ setting_id: Setting name
+
+ id: ID of the zone setting.
+
+ value: Current value of the zone setting.
+
+ 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,
+ setting_id: str,
+ *,
+ zone_id: str,
+ id: Literal["cache_level"],
+ value: Literal["aggressive", "basic", "simplified"],
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via 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[SettingEditResponse]:
+ """
+ Updates a single zone setting by the identifier
+
+ Args:
+ zone_id: Identifier
+
+ setting_id: Setting name
+
+ id: ID of the zone setting.
+
+ value: Current value of the zone setting.
+
+ 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,
+ setting_id: str,
+ *,
+ zone_id: str,
+ id: Literal["challenge_ttl"],
+ value: Literal[300, 900, 1800, 2700, 3600, 7200, 10800, 14400, 28800, 57600, 86400, 604800, 2592000, 31536000],
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via 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[SettingEditResponse]:
+ """
+ Updates a single zone setting by the identifier
+
+ Args:
+ zone_id: Identifier
+
+ setting_id: Setting name
+
+ id: ID of the zone setting.
+
+ value: Current value of the zone setting.
+
+ 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,
+ setting_id: str,
+ *,
+ zone_id: str,
+ id: Literal["ciphers"],
+ value: List[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[SettingEditResponse]:
+ """
+ Updates a single zone setting by the identifier
+
+ Args:
+ zone_id: Identifier
+
+ setting_id: Setting name
+
+ id: ID of the zone setting.
+
+ value: Current value of the zone setting.
+
+ 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,
+ setting_id: str,
+ *,
+ zone_id: str,
+ id: Literal["cname_flattening"],
+ value: Literal["flatten_at_root", "flatten_all"],
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via 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[SettingEditResponse]:
+ """
+ Updates a single zone setting by the identifier
+
+ Args:
+ zone_id: Identifier
+
+ setting_id: Setting name
+
+ id: How to flatten the cname destination.
+
+ value: Current value of the zone setting.
+
+ 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,
+ setting_id: str,
+ *,
+ zone_id: str,
+ id: Literal["development_mode"],
+ value: Literal["on", "off"],
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via 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[SettingEditResponse]:
+ """
+ Updates a single zone setting by the identifier
+
+ Args:
+ zone_id: Identifier
+
+ setting_id: Setting name
+
+ id: ID of the zone setting.
+
+ value: Current value of the zone setting.
+
+ 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,
+ setting_id: str,
+ *,
+ zone_id: str,
+ id: Literal["early_hints"],
+ value: Literal["on", "off"],
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via 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[SettingEditResponse]:
+ """
+ Updates a single zone setting by the identifier
+
+ Args:
+ zone_id: Identifier
+
+ setting_id: Setting name
+
+ id: ID of the zone setting.
+
+ value: Current value of the zone setting.
+
+ 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,
+ setting_id: str,
+ *,
+ zone_id: str,
+ id: Literal["edge_cache_ttl"],
+ value: Literal[
+ 30,
+ 60,
+ 300,
+ 1200,
+ 1800,
+ 3600,
+ 7200,
+ 10800,
+ 14400,
+ 18000,
+ 28800,
+ 43200,
+ 57600,
+ 72000,
+ 86400,
+ 172800,
+ 259200,
+ 345600,
+ 432000,
+ 518400,
+ 604800,
+ ],
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via 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[SettingEditResponse]:
+ """
+ Updates a single zone setting by the identifier
+
+ Args:
+ zone_id: Identifier
+
+ setting_id: Setting name
+
+ id: ID of the zone setting.
+
+ value: Current value of the zone setting.
+
+ 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,
+ setting_id: str,
+ *,
+ zone_id: str,
+ id: Literal["email_obfuscation"],
+ value: Literal["on", "off"],
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via 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[SettingEditResponse]:
+ """
+ Updates a single zone setting by the identifier
+
+ Args:
+ zone_id: Identifier
+
+ setting_id: Setting name
+
+ id: ID of the zone setting.
+
+ value: Current value of the zone setting.
+
+ 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,
+ setting_id: str,
+ *,
+ zone_id: str,
+ id: Literal["h2_prioritization"],
+ value: Literal["on", "off", "custom"],
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via 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[SettingEditResponse]:
+ """
+ Updates a single zone setting by the identifier
+
+ Args:
+ zone_id: Identifier
+
+ setting_id: Setting name
+
+ id: ID of the zone setting.
+
+ value: Current value of the zone setting.
+
+ 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,
+ setting_id: str,
+ *,
+ zone_id: str,
+ id: Literal["hotlink_protection"],
+ value: Literal["on", "off"],
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via 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[SettingEditResponse]:
+ """
+ Updates a single zone setting by the identifier
+
+ Args:
+ zone_id: Identifier
+
+ setting_id: Setting name
+
+ id: ID of the zone setting.
+
+ value: Current value of the zone setting.
+
+ 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,
+ setting_id: str,
+ *,
+ zone_id: str,
+ id: Literal["http2"],
+ value: Literal["on", "off"],
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via 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[SettingEditResponse]:
+ """
+ Updates a single zone setting by the identifier
+
+ Args:
+ zone_id: Identifier
+
+ setting_id: Setting name
+
+ id: ID of the zone setting.
+
+ value: Current value of the zone setting.
+
+ 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,
+ setting_id: str,
+ *,
+ zone_id: str,
+ id: Literal["http3"],
+ value: Literal["on", "off"],
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via 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[SettingEditResponse]:
+ """
+ Updates a single zone setting by the identifier
+
+ Args:
+ zone_id: Identifier
+
+ setting_id: Setting name
+
+ id: ID of the zone setting.
+
+ value: Current value of the zone setting.
+
+ 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,
+ setting_id: str,
+ *,
+ zone_id: str,
+ id: Literal["image_resizing"],
+ value: Literal["on", "off", "open"],
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via 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[SettingEditResponse]:
+ """
+ Updates a single zone setting by the identifier
+
+ Args:
+ zone_id: Identifier
+
+ setting_id: Setting name
+
+ id: ID of the zone setting.
+
+ value: Current value of the zone setting.
+
+ 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,
+ setting_id: str,
+ *,
+ zone_id: str,
+ id: Literal["ip_geolocation"],
+ value: Literal["on", "off"],
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via 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[SettingEditResponse]:
+ """
+ Updates a single zone setting by the identifier
+
+ Args:
+ zone_id: Identifier
+
+ setting_id: Setting name
+
+ id: ID of the zone setting.
+
+ value: Current value of the zone setting.
+
+ 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,
+ setting_id: str,
+ *,
+ zone_id: str,
+ id: Literal["ipv6"],
+ value: Literal["off", "on"],
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via 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[SettingEditResponse]:
+ """
+ Updates a single zone setting by the identifier
+
+ Args:
+ zone_id: Identifier
+
+ setting_id: Setting name
+
+ id: ID of the zone setting.
+
+ value: Current value of the zone setting.
+
+ 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,
+ setting_id: str,
+ *,
+ zone_id: str,
+ id: Literal["max_upload"],
+ value: Literal[100, 200, 500],
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via 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[SettingEditResponse]:
+ """
+ Updates a single zone setting by the identifier
+
+ Args:
+ zone_id: Identifier
+
+ setting_id: Setting name
+
+ id: identifier of the zone setting.
+
+ value: Current value of the zone setting.
+
+ 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,
+ setting_id: str,
+ *,
+ zone_id: str,
+ id: Literal["min_tls_version"],
+ value: Literal["1.0", "1.1", "1.2", "1.3"],
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via 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[SettingEditResponse]:
+ """
+ Updates a single zone setting by the identifier
+
+ Args:
+ zone_id: Identifier
+
+ setting_id: Setting name
+
+ id: ID of the zone setting.
+
+ value: Current value of the zone setting.
+
+ 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,
+ setting_id: str,
+ *,
+ zone_id: str,
+ id: Literal["minify"],
+ value: setting_edit_params.MinifyValue,
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via 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[SettingEditResponse]:
+ """
+ Updates a single zone setting by the identifier
+
+ Args:
+ zone_id: Identifier
+
+ setting_id: Setting name
+
+ id: Zone setting identifier.
+
+ value: Current value of the zone setting.
+
+ 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,
+ setting_id: str,
+ *,
+ zone_id: str,
+ id: Literal["mirage"],
+ value: Literal["on", "off"],
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via 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[SettingEditResponse]:
+ """
+ Updates a single zone setting by the identifier
+
+ Args:
+ zone_id: Identifier
+
+ setting_id: Setting name
+
+ id: ID of the zone setting.
+
+ value: Current value of the zone setting.
+
+ 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,
+ setting_id: str,
+ *,
+ zone_id: str,
+ id: Literal["mobile_redirect"],
+ value: setting_edit_params.MobileRedirectValue,
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via 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[SettingEditResponse]:
+ """
+ Updates a single zone setting by the identifier
+
+ Args:
+ zone_id: Identifier
+
+ setting_id: Setting name
+
+ id: Identifier of the zone setting.
+
+ value: Current value of the zone setting.
+
+ 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,
+ setting_id: str,
+ *,
+ zone_id: str,
+ id: Literal["nel"],
+ value: setting_edit_params.NELValue,
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via 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[SettingEditResponse]:
+ """
+ Updates a single zone setting by the identifier
+
+ Args:
+ zone_id: Identifier
+
+ setting_id: Setting name
+
+ id: Zone setting identifier.
+
+ value: Current value of the zone setting.
+
+ 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,
+ setting_id: str,
+ *,
+ zone_id: str,
+ id: Literal["opportunistic_encryption"],
+ value: Literal["on", "off"],
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via 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[SettingEditResponse]:
+ """
+ Updates a single zone setting by the identifier
+
+ Args:
+ zone_id: Identifier
+
+ setting_id: Setting name
+
+ id: ID of the zone setting.
+
+ value: Current value of the zone setting.
+
+ 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,
+ setting_id: str,
+ *,
+ zone_id: str,
+ id: Literal["opportunistic_onion"],
+ value: Literal["on", "off"],
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via 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[SettingEditResponse]:
+ """
+ Updates a single zone setting by the identifier
+
+ Args:
+ zone_id: Identifier
+
+ setting_id: Setting name
+
+ id: ID of the zone setting.
+
+ value: Current value of the zone setting.
+
+ 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,
+ setting_id: str,
+ *,
+ zone_id: str,
+ id: Literal["orange_to_orange"],
+ value: Literal["on", "off"],
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via 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[SettingEditResponse]:
+ """
+ Updates a single zone setting by the identifier
+
+ Args:
+ zone_id: Identifier
+
+ setting_id: Setting name
+
+ id: ID of the zone setting.
+
+ value: Current value of the zone setting.
+
+ 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,
+ setting_id: str,
+ *,
+ zone_id: str,
+ id: Literal["origin_error_page_pass_thru"],
+ value: Literal["on", "off"],
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via 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[SettingEditResponse]:
+ """
+ Updates a single zone setting by the identifier
+
+ Args:
+ zone_id: Identifier
+
+ setting_id: Setting name
+
+ id: ID of the zone setting.
+
+ value: Current value of the zone setting.
+
+ 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,
+ setting_id: str,
+ *,
+ zone_id: str,
+ id: Literal["polish"],
+ value: Literal["off", "lossless", "lossy"],
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via 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[SettingEditResponse]:
+ """
+ Updates a single zone setting by the identifier
+
+ Args:
+ zone_id: Identifier
+
+ setting_id: Setting name
+
+ id: ID of the zone setting.
+
+ value: Current value of the zone setting.
+
+ 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,
+ setting_id: str,
+ *,
+ zone_id: str,
+ id: Literal["prefetch_preload"],
+ value: Literal["on", "off"],
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via 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[SettingEditResponse]:
+ """
+ Updates a single zone setting by the identifier
+
+ Args:
+ zone_id: Identifier
+
+ setting_id: Setting name
+
+ id: ID of the zone setting.
+
+ value: Current value of the zone setting.
+
+ 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,
+ setting_id: str,
+ *,
+ zone_id: str,
+ id: Literal["proxy_read_timeout"],
+ value: float,
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via 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[SettingEditResponse]:
+ """
+ Updates a single zone setting by the identifier
+
+ Args:
+ zone_id: Identifier
+
+ setting_id: Setting name
+
+ id: ID of the zone setting.
+
+ value: Current value of the zone setting.
+
+ 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,
+ setting_id: str,
+ *,
+ zone_id: str,
+ id: Literal["pseudo_ipv4"],
+ value: Literal["off", "add_header", "overwrite_header"],
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via 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[SettingEditResponse]:
+ """
+ Updates a single zone setting by the identifier
+
+ Args:
+ zone_id: Identifier
+
+ setting_id: Setting name
+
+ id: Value of the Pseudo IPv4 setting.
+
+ value: Current value of the zone setting.
+
+ 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,
+ setting_id: str,
+ *,
+ zone_id: str,
+ id: Literal["replace_insecure_js"],
+ value: Literal["on", "off"],
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via 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[SettingEditResponse]:
+ """
+ Updates a single zone setting by the identifier
+
+ Args:
+ zone_id: Identifier
+
+ setting_id: Setting name
+
+ id: ID of the zone setting.
+
+ value: Current value of the zone setting.
+
+ 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,
+ setting_id: str,
+ *,
+ zone_id: str,
+ id: Literal["response_buffering"],
+ value: Literal["on", "off"],
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via 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[SettingEditResponse]:
+ """
+ Updates a single zone setting by the identifier
+
+ Args:
+ zone_id: Identifier
+
+ setting_id: Setting name
+
+ id: ID of the zone setting.
+
+ value: Current value of the zone setting.
+
+ 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,
+ setting_id: str,
+ *,
+ zone_id: str,
+ id: Literal["rocket_loader"],
+ value: Literal["on", "off"],
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via 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[SettingEditResponse]:
+ """
+ Updates a single zone setting by the identifier
+
+ Args:
+ zone_id: Identifier
+
+ setting_id: Setting name
+
+ id: ID of the zone setting.
+
+ value: Current value of the zone setting.
+
+ 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,
+ setting_id: str,
+ *,
+ zone_id: str,
+ id: Literal["automatic_platform_optimization"],
+ value: AutomaticPlatformOptimizationParam,
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via 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[SettingEditResponse]:
+ """
+ Updates a single zone setting by the identifier
+
+ Args:
+ zone_id: Identifier
+
+ setting_id: Setting name
+
+ id: ID of the zone setting.
+
+ value: Current value of the zone setting.
+
+ 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,
+ setting_id: str,
+ *,
+ zone_id: str,
+ id: Literal["security_header"],
+ value: setting_edit_params.SecurityHeadersValue,
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via 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[SettingEditResponse]:
+ """
+ Updates a single zone setting by the identifier
+
+ Args:
+ zone_id: Identifier
+
+ setting_id: Setting name
+
+ id: ID of the zone's security header.
+
+ value: Current value of the zone setting.
+
+ 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,
+ setting_id: str,
+ *,
+ zone_id: str,
+ id: Literal["security_level"],
+ value: Literal["off", "essentially_off", "low", "medium", "high", "under_attack"],
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via 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[SettingEditResponse]:
+ """
+ Updates a single zone setting by the identifier
+
+ Args:
+ zone_id: Identifier
+
+ setting_id: Setting name
+
+ id: ID of the zone setting.
+
+ value: Current value of the zone setting.
+
+ 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,
+ setting_id: str,
+ *,
+ zone_id: str,
+ id: Literal["server_side_exclude"],
+ value: Literal["on", "off"],
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via 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[SettingEditResponse]:
+ """
+ Updates a single zone setting by the identifier
+
+ Args:
+ zone_id: Identifier
+
+ setting_id: Setting name
+
+ id: ID of the zone setting.
+
+ value: Current value of the zone setting.
+
+ 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,
+ setting_id: str,
+ *,
+ zone_id: str,
+ id: Literal["sha1_support"],
+ value: Literal["off", "on"],
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via 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[SettingEditResponse]:
+ """
+ Updates a single zone setting by the identifier
+
+ Args:
+ zone_id: Identifier
+
+ setting_id: Setting name
+
+ id: Zone setting identifier.
+
+ value: Current value of the zone setting.
+
+ 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,
+ setting_id: str,
+ *,
+ zone_id: str,
+ id: Literal["sort_query_string_for_cache"],
+ value: Literal["on", "off"],
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via 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[SettingEditResponse]:
+ """
+ Updates a single zone setting by the identifier
+
+ Args:
+ zone_id: Identifier
+
+ setting_id: Setting name
+
+ id: ID of the zone setting.
+
+ value: Current value of the zone setting.
+
+ 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,
+ setting_id: str,
+ *,
+ zone_id: str,
+ id: Literal["ssl"],
+ value: Literal["off", "flexible", "full", "strict"],
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via 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[SettingEditResponse]:
+ """
+ Updates a single zone setting by the identifier
+
+ Args:
+ zone_id: Identifier
+
+ setting_id: Setting name
+
+ id: ID of the zone setting.
+
+ value: Current value of the zone setting.
+
+ 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,
+ setting_id: str,
+ *,
+ zone_id: str,
+ id: Literal["ssl_recommender"] | NotGiven = NOT_GIVEN,
+ enabled: bool | NotGiven = NOT_GIVEN,
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
+ # The extra values given here take precedence over values defined on the client or passed to this method.
+ extra_headers: Headers | None = None,
+ extra_query: Query | None = None,
+ extra_body: Body | None = None,
+ timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
+ ) -> Optional[SettingEditResponse]:
+ """
+ Updates a single zone setting by the identifier
+
+ Args:
+ zone_id: Identifier
+
+ setting_id: Setting name
+
+ id: Enrollment value for SSL/TLS Recommender.
+
+ enabled: ssl-recommender enrollment setting.
+
+ 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,
+ setting_id: str,
+ *,
+ zone_id: str,
+ id: Literal["tls_1_2_only"],
+ value: Literal["off", "on"],
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via 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[SettingEditResponse]:
+ """
+ Updates a single zone setting by the identifier
+
+ Args:
+ zone_id: Identifier
+
+ setting_id: Setting name
+
+ id: Zone setting identifier.
+
+ value: Current value of the zone setting.
+
+ 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,
+ setting_id: str,
+ *,
+ zone_id: str,
+ id: Literal["tls_1_3"],
+ value: Literal["on", "off", "zrt"],
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via 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[SettingEditResponse]:
+ """
+ Updates a single zone setting by the identifier
+
+ Args:
+ zone_id: Identifier
+
+ setting_id: Setting name
+
+ id: ID of the zone setting.
+
+ value: Current value of the zone setting.
+
+ 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,
+ setting_id: str,
+ *,
+ zone_id: str,
+ id: Literal["tls_client_auth"],
+ value: Literal["on", "off"],
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via 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[SettingEditResponse]:
+ """
+ Updates a single zone setting by the identifier
+
+ Args:
+ zone_id: Identifier
+
+ setting_id: Setting name
+
+ id: ID of the zone setting.
+
+ value: Current value of the zone setting.
+
+ 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,
+ setting_id: str,
+ *,
+ zone_id: str,
+ id: Literal["true_client_ip_header"],
+ value: Literal["on", "off"],
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via 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[SettingEditResponse]:
+ """
+ Updates a single zone setting by the identifier
+
+ Args:
+ zone_id: Identifier
+
+ setting_id: Setting name
+
+ id: ID of the zone setting.
+
+ value: Current value of the zone setting.
+
+ 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,
+ setting_id: str,
+ *,
+ zone_id: str,
+ id: Literal["waf"],
+ value: Literal["on", "off"],
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via 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[SettingEditResponse]:
+ """
+ Updates a single zone setting by the identifier
+
+ Args:
+ zone_id: Identifier
+
+ setting_id: Setting name
+
+ id: ID of the zone setting.
+
+ value: Current value of the zone setting.
+
+ 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,
+ setting_id: str,
+ *,
+ zone_id: str,
+ id: Literal["webp"],
+ value: Literal["off", "on"],
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via 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[SettingEditResponse]:
+ """
+ Updates a single zone setting by the identifier
+
+ Args:
+ zone_id: Identifier
+
+ setting_id: Setting name
+
+ id: ID of the zone setting.
+
+ value: Current value of the zone setting.
+
+ 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,
+ setting_id: str,
+ *,
+ zone_id: str,
+ id: Literal["websockets"],
+ value: Literal["off", "on"],
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via 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[SettingEditResponse]:
+ """
+ Updates a single zone setting by the identifier
+
+ Args:
+ zone_id: Identifier
+
+ setting_id: Setting name
+
+ id: ID of the zone setting.
+
+ value: Current value of the zone setting.
+
+ extra_headers: Send extra headers
+
+ extra_query: Add additional query parameters to the request
+
+ extra_body: Add additional JSON properties to the request
+
+ timeout: Override the client-level default timeout for this request, in seconds
+ """
+ ...
+
+ @required_args(["zone_id", "id", "value"], ["zone_id"])
+ async def edit(
+ self,
+ setting_id: str,
+ *,
+ zone_id: str,
+ id: Literal["0rtt"]
+ | Literal["advanced_ddos"]
+ | Literal["always_online"]
+ | Literal["always_use_https"]
+ | Literal["automatic_https_rewrites"]
+ | Literal["brotli"]
+ | Literal["browser_cache_ttl"]
+ | Literal["browser_check"]
+ | Literal["cache_level"]
+ | Literal["challenge_ttl"]
+ | Literal["ciphers"]
+ | Literal["cname_flattening"]
+ | Literal["development_mode"]
+ | Literal["early_hints"]
+ | Literal["edge_cache_ttl"]
+ | Literal["email_obfuscation"]
+ | Literal["h2_prioritization"]
+ | Literal["hotlink_protection"]
+ | Literal["http2"]
+ | Literal["http3"]
+ | Literal["image_resizing"]
+ | Literal["ip_geolocation"]
+ | Literal["ipv6"]
+ | Literal["max_upload"]
+ | Literal["min_tls_version"]
+ | Literal["minify"]
+ | Literal["mirage"]
+ | Literal["mobile_redirect"]
+ | Literal["nel"]
+ | Literal["opportunistic_encryption"]
+ | Literal["opportunistic_onion"]
+ | Literal["orange_to_orange"]
+ | Literal["origin_error_page_pass_thru"]
+ | Literal["polish"]
+ | Literal["prefetch_preload"]
+ | Literal["proxy_read_timeout"]
+ | Literal["pseudo_ipv4"]
+ | Literal["replace_insecure_js"]
+ | Literal["response_buffering"]
+ | Literal["rocket_loader"]
+ | Literal["automatic_platform_optimization"]
+ | Literal["security_header"]
+ | Literal["security_level"]
+ | Literal["server_side_exclude"]
+ | Literal["sha1_support"]
+ | Literal["sort_query_string_for_cache"]
+ | Literal["ssl"]
+ | Literal["ssl_recommender"]
+ | Literal["tls_1_2_only"]
+ | Literal["tls_1_3"]
+ | Literal["tls_client_auth"]
+ | Literal["true_client_ip_header"]
+ | Literal["waf"]
+ | Literal["webp"]
+ | Literal["websockets"]
+ | NotGiven = NOT_GIVEN,
+ value: Literal["on", "off"]
+ | Literal[
+ 0,
+ 30,
+ 60,
+ 120,
+ 300,
+ 1200,
+ 1800,
+ 3600,
+ 7200,
+ 10800,
+ 14400,
+ 18000,
+ 28800,
+ 43200,
+ 57600,
+ 72000,
+ 86400,
+ 172800,
+ 259200,
+ 345600,
+ 432000,
+ 691200,
+ 1382400,
+ 2073600,
+ 2678400,
+ 5356800,
+ 16070400,
+ 31536000,
+ ]
+ | Literal["aggressive", "basic", "simplified"]
+ | Literal[300, 900, 1800, 2700, 3600, 7200, 10800, 14400, 28800, 57600, 86400, 604800, 2592000, 31536000]
+ | List[str]
+ | Literal["flatten_at_root", "flatten_all"]
+ | Literal[
+ 30,
+ 60,
+ 300,
+ 1200,
+ 1800,
+ 3600,
+ 7200,
+ 10800,
+ 14400,
+ 18000,
+ 28800,
+ 43200,
+ 57600,
+ 72000,
+ 86400,
+ 172800,
+ 259200,
+ 345600,
+ 432000,
+ 518400,
+ 604800,
+ ]
+ | Literal["on", "off", "custom"]
+ | Literal["on", "off", "open"]
+ | Literal[100, 200, 500]
+ | Literal["1.0", "1.1", "1.2", "1.3"]
+ | setting_edit_params.MinifyValue
+ | setting_edit_params.MobileRedirectValue
+ | setting_edit_params.NELValue
+ | Literal["off", "lossless", "lossy"]
+ | float
+ | Literal["off", "add_header", "overwrite_header"]
+ | AutomaticPlatformOptimizationParam
+ | setting_edit_params.SecurityHeadersValue
+ | Literal["off", "essentially_off", "low", "medium", "high", "under_attack"]
+ | Literal["off", "flexible", "full", "strict"]
+ | Literal["on", "off", "zrt"]
+ | NotGiven = NOT_GIVEN,
+ enabled: bool | NotGiven = NOT_GIVEN,
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
+ # The extra values given here take precedence over values defined on the client or passed to this method.
+ extra_headers: Headers | None = None,
+ extra_query: Query | None = None,
+ extra_body: Body | None = None,
+ timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
+ ) -> Optional[SettingEditResponse]:
+ if not zone_id:
+ raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
+ if not setting_id:
+ raise ValueError(f"Expected a non-empty value for `setting_id` but received {setting_id!r}")
+ return cast(
+ Optional[SettingEditResponse],
+ await self._patch(
+ f"/zones/{zone_id}/settings/{setting_id}",
+ body=await async_maybe_transform(
+ {
+ "id": id,
+ "value": value,
+ "enabled": enabled,
+ },
+ setting_edit_params.SettingEditParams,
+ ),
+ options=make_request_options(
+ extra_headers=extra_headers,
+ extra_query=extra_query,
+ extra_body=extra_body,
+ timeout=timeout,
+ post_parser=ResultWrapper[Optional[SettingEditResponse]]._unwrapper,
+ ),
+ cast_to=cast(
+ Any, ResultWrapper[SettingEditResponse]
+ ), # Union types cannot be passed in as arguments in the type system
),
- cast_to=cast(Type[Optional[SettingEditResponse]], ResultWrapper[SettingEditResponse]),
)
async def get(
diff --git a/src/cloudflare/types/zones/__init__.py b/src/cloudflare/types/zones/__init__.py
index bccc236417f..fa271c04ce3 100644
--- a/src/cloudflare/types/zones/__init__.py
+++ b/src/cloudflare/types/zones/__init__.py
@@ -52,6 +52,7 @@
from .response_buffering import ResponseBuffering as ResponseBuffering
from .zone_create_params import ZoneCreateParams as ZoneCreateParams
from .opportunistic_onion import OpportunisticOnion as OpportunisticOnion
+from .setting_edit_params import SettingEditParams as SettingEditParams
from .server_side_excludes import ServerSideExcludes as ServerSideExcludes
from .setting_get_response import SettingGetResponse as SettingGetResponse
from .zone_delete_response import ZoneDeleteResponse as ZoneDeleteResponse
@@ -70,3 +71,6 @@
from .custom_nameserver_update_params import CustomNameserverUpdateParams as CustomNameserverUpdateParams
from .activation_check_trigger_response import ActivationCheckTriggerResponse as ActivationCheckTriggerResponse
from .custom_nameserver_update_response import CustomNameserverUpdateResponse as CustomNameserverUpdateResponse
+from .automatic_platform_optimization_param import (
+ AutomaticPlatformOptimizationParam as AutomaticPlatformOptimizationParam,
+)
diff --git a/src/cloudflare/types/zones/automatic_platform_optimization_param.py b/src/cloudflare/types/zones/automatic_platform_optimization_param.py
new file mode 100644
index 00000000000..b39664ca0e8
--- /dev/null
+++ b/src/cloudflare/types/zones/automatic_platform_optimization_param.py
@@ -0,0 +1,39 @@
+# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
+
+from __future__ import annotations
+
+from typing import List
+from typing_extensions import Required, TypedDict
+
+__all__ = ["AutomaticPlatformOptimizationParam"]
+
+
+class AutomaticPlatformOptimizationParam(TypedDict, total=False):
+ cache_by_device_type: Required[bool]
+ """
+ Indicates whether or not
+ [cache by device type](https://developers.cloudflare.com/automatic-platform-optimization/reference/cache-device-type/)
+ is enabled.
+ """
+
+ cf: Required[bool]
+ """Indicates whether or not Cloudflare proxy is enabled."""
+
+ enabled: Required[bool]
+ """Indicates whether or not Automatic Platform Optimization is enabled."""
+
+ hostnames: Required[List[str]]
+ """
+ An array of hostnames where Automatic Platform Optimization for WordPress is
+ activated.
+ """
+
+ wordpress: Required[bool]
+ """Indicates whether or not site is powered by WordPress."""
+
+ wp_plugin: Required[bool]
+ """
+ Indicates whether or not
+ [Cloudflare for WordPress plugin](https://wordpress.org/plugins/cloudflare/) is
+ installed.
+ """
diff --git a/src/cloudflare/types/zones/setting_edit_params.py b/src/cloudflare/types/zones/setting_edit_params.py
new file mode 100644
index 00000000000..32be3362213
--- /dev/null
+++ b/src/cloudflare/types/zones/setting_edit_params.py
@@ -0,0 +1,848 @@
+# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
+
+from __future__ import annotations
+
+from typing import List, Union, Optional
+from typing_extensions import Literal, Required, TypedDict
+
+from .automatic_platform_optimization_param import AutomaticPlatformOptimizationParam
+
+__all__ = [
+ "SettingEditParams",
+ "ZeroRTT",
+ "AdvancedDDoS",
+ "AlwaysOnline",
+ "AlwaysUseHTTPS",
+ "AutomaticHTTPSRewrites",
+ "Brotli",
+ "BrowserCacheTTL",
+ "BrowserCheck",
+ "CacheLevel",
+ "ChallengeTTL",
+ "Ciphers",
+ "ZonesCNAMEFlattening",
+ "DevelopmentMode",
+ "EarlyHints",
+ "ZonesEdgeCacheTTL",
+ "EmailObfuscation",
+ "H2Prioritization",
+ "HotlinkProtection",
+ "HTTP2",
+ "HTTP3",
+ "ImageResizing",
+ "IPGeolocation",
+ "IPV6",
+ "ZonesMaxUpload",
+ "MinTLSVersion",
+ "Minify",
+ "MinifyValue",
+ "Mirage",
+ "MobileRedirect",
+ "MobileRedirectValue",
+ "NEL",
+ "NELValue",
+ "OpportunisticEncryption",
+ "OpportunisticOnion",
+ "OrangeToOrange",
+ "OriginErrorPagePassThru",
+ "Polish",
+ "PrefetchPreload",
+ "ProxyReadTimeout",
+ "PseudoIPV4",
+ "ZonesReplaceInsecureJS",
+ "ResponseBuffering",
+ "RocketLoader",
+ "ZonesSchemasAutomaticPlatformOptimization",
+ "SecurityHeaders",
+ "SecurityHeadersValue",
+ "SecurityHeadersValueStrictTransportSecurity",
+ "SecurityLevel",
+ "ServerSideExcludes",
+ "ZonesSha1Support",
+ "SortQueryStringForCache",
+ "SSL",
+ "SSLRecommender",
+ "ZonesTLS1_2Only",
+ "TLS1_3",
+ "TLSClientAuth",
+ "TrueClientIPHeader",
+ "WAF",
+ "WebP",
+ "Websocket",
+]
+
+
+class ZeroRTT(TypedDict, total=False):
+ zone_id: Required[str]
+ """Identifier"""
+
+ id: Required[Literal["0rtt"]]
+ """ID of the zone setting."""
+
+ value: Required[Literal["on", "off"]]
+ """Current value of the zone setting."""
+
+
+class AdvancedDDoS(TypedDict, total=False):
+ zone_id: Required[str]
+ """Identifier"""
+
+ id: Required[Literal["advanced_ddos"]]
+ """ID of the zone setting."""
+
+ value: Required[Literal["on", "off"]]
+ """Current value of the zone setting."""
+
+
+class AlwaysOnline(TypedDict, total=False):
+ zone_id: Required[str]
+ """Identifier"""
+
+ id: Required[Literal["always_online"]]
+ """ID of the zone setting."""
+
+ value: Required[Literal["on", "off"]]
+ """Current value of the zone setting."""
+
+
+class AlwaysUseHTTPS(TypedDict, total=False):
+ zone_id: Required[str]
+ """Identifier"""
+
+ id: Required[Literal["always_use_https"]]
+ """ID of the zone setting."""
+
+ value: Required[Literal["on", "off"]]
+ """Current value of the zone setting."""
+
+
+class AutomaticHTTPSRewrites(TypedDict, total=False):
+ zone_id: Required[str]
+ """Identifier"""
+
+ id: Required[Literal["automatic_https_rewrites"]]
+ """ID of the zone setting."""
+
+ value: Required[Literal["on", "off"]]
+ """Current value of the zone setting."""
+
+
+class Brotli(TypedDict, total=False):
+ zone_id: Required[str]
+ """Identifier"""
+
+ id: Required[Literal["brotli"]]
+ """ID of the zone setting."""
+
+ value: Required[Literal["off", "on"]]
+ """Current value of the zone setting."""
+
+
+class BrowserCacheTTL(TypedDict, total=False):
+ zone_id: Required[str]
+ """Identifier"""
+
+ id: Required[Literal["browser_cache_ttl"]]
+ """ID of the zone setting."""
+
+ value: Required[
+ Literal[
+ 0,
+ 30,
+ 60,
+ 120,
+ 300,
+ 1200,
+ 1800,
+ 3600,
+ 7200,
+ 10800,
+ 14400,
+ 18000,
+ 28800,
+ 43200,
+ 57600,
+ 72000,
+ 86400,
+ 172800,
+ 259200,
+ 345600,
+ 432000,
+ 691200,
+ 1382400,
+ 2073600,
+ 2678400,
+ 5356800,
+ 16070400,
+ 31536000,
+ ]
+ ]
+ """Current value of the zone setting."""
+
+
+class BrowserCheck(TypedDict, total=False):
+ zone_id: Required[str]
+ """Identifier"""
+
+ id: Required[Literal["browser_check"]]
+ """ID of the zone setting."""
+
+ value: Required[Literal["on", "off"]]
+ """Current value of the zone setting."""
+
+
+class CacheLevel(TypedDict, total=False):
+ zone_id: Required[str]
+ """Identifier"""
+
+ id: Required[Literal["cache_level"]]
+ """ID of the zone setting."""
+
+ value: Required[Literal["aggressive", "basic", "simplified"]]
+ """Current value of the zone setting."""
+
+
+class ChallengeTTL(TypedDict, total=False):
+ zone_id: Required[str]
+ """Identifier"""
+
+ id: Required[Literal["challenge_ttl"]]
+ """ID of the zone setting."""
+
+ value: Required[
+ Literal[300, 900, 1800, 2700, 3600, 7200, 10800, 14400, 28800, 57600, 86400, 604800, 2592000, 31536000]
+ ]
+ """Current value of the zone setting."""
+
+
+class Ciphers(TypedDict, total=False):
+ zone_id: Required[str]
+ """Identifier"""
+
+ id: Required[Literal["ciphers"]]
+ """ID of the zone setting."""
+
+ value: Required[List[str]]
+ """Current value of the zone setting."""
+
+
+class ZonesCNAMEFlattening(TypedDict, total=False):
+ zone_id: Required[str]
+ """Identifier"""
+
+ id: Required[Literal["cname_flattening"]]
+ """How to flatten the cname destination."""
+
+ value: Required[Literal["flatten_at_root", "flatten_all"]]
+ """Current value of the zone setting."""
+
+
+class DevelopmentMode(TypedDict, total=False):
+ zone_id: Required[str]
+ """Identifier"""
+
+ id: Required[Literal["development_mode"]]
+ """ID of the zone setting."""
+
+ value: Required[Literal["on", "off"]]
+ """Current value of the zone setting."""
+
+
+class EarlyHints(TypedDict, total=False):
+ zone_id: Required[str]
+ """Identifier"""
+
+ id: Required[Literal["early_hints"]]
+ """ID of the zone setting."""
+
+ value: Required[Literal["on", "off"]]
+ """Current value of the zone setting."""
+
+
+class ZonesEdgeCacheTTL(TypedDict, total=False):
+ zone_id: Required[str]
+ """Identifier"""
+
+ id: Required[Literal["edge_cache_ttl"]]
+ """ID of the zone setting."""
+
+ value: Required[
+ Literal[
+ 30,
+ 60,
+ 300,
+ 1200,
+ 1800,
+ 3600,
+ 7200,
+ 10800,
+ 14400,
+ 18000,
+ 28800,
+ 43200,
+ 57600,
+ 72000,
+ 86400,
+ 172800,
+ 259200,
+ 345600,
+ 432000,
+ 518400,
+ 604800,
+ ]
+ ]
+ """Current value of the zone setting."""
+
+
+class EmailObfuscation(TypedDict, total=False):
+ zone_id: Required[str]
+ """Identifier"""
+
+ id: Required[Literal["email_obfuscation"]]
+ """ID of the zone setting."""
+
+ value: Required[Literal["on", "off"]]
+ """Current value of the zone setting."""
+
+
+class H2Prioritization(TypedDict, total=False):
+ zone_id: Required[str]
+ """Identifier"""
+
+ id: Required[Literal["h2_prioritization"]]
+ """ID of the zone setting."""
+
+ value: Required[Literal["on", "off", "custom"]]
+ """Current value of the zone setting."""
+
+
+class HotlinkProtection(TypedDict, total=False):
+ zone_id: Required[str]
+ """Identifier"""
+
+ id: Required[Literal["hotlink_protection"]]
+ """ID of the zone setting."""
+
+ value: Required[Literal["on", "off"]]
+ """Current value of the zone setting."""
+
+
+class HTTP2(TypedDict, total=False):
+ zone_id: Required[str]
+ """Identifier"""
+
+ id: Required[Literal["http2"]]
+ """ID of the zone setting."""
+
+ value: Required[Literal["on", "off"]]
+ """Current value of the zone setting."""
+
+
+class HTTP3(TypedDict, total=False):
+ zone_id: Required[str]
+ """Identifier"""
+
+ id: Required[Literal["http3"]]
+ """ID of the zone setting."""
+
+ value: Required[Literal["on", "off"]]
+ """Current value of the zone setting."""
+
+
+class ImageResizing(TypedDict, total=False):
+ zone_id: Required[str]
+ """Identifier"""
+
+ id: Required[Literal["image_resizing"]]
+ """ID of the zone setting."""
+
+ value: Required[Literal["on", "off", "open"]]
+ """Current value of the zone setting."""
+
+
+class IPGeolocation(TypedDict, total=False):
+ zone_id: Required[str]
+ """Identifier"""
+
+ id: Required[Literal["ip_geolocation"]]
+ """ID of the zone setting."""
+
+ value: Required[Literal["on", "off"]]
+ """Current value of the zone setting."""
+
+
+class IPV6(TypedDict, total=False):
+ zone_id: Required[str]
+ """Identifier"""
+
+ id: Required[Literal["ipv6"]]
+ """ID of the zone setting."""
+
+ value: Required[Literal["off", "on"]]
+ """Current value of the zone setting."""
+
+
+class ZonesMaxUpload(TypedDict, total=False):
+ zone_id: Required[str]
+ """Identifier"""
+
+ id: Required[Literal["max_upload"]]
+ """identifier of the zone setting."""
+
+ value: Required[Literal[100, 200, 500]]
+ """Current value of the zone setting."""
+
+
+class MinTLSVersion(TypedDict, total=False):
+ zone_id: Required[str]
+ """Identifier"""
+
+ id: Required[Literal["min_tls_version"]]
+ """ID of the zone setting."""
+
+ value: Required[Literal["1.0", "1.1", "1.2", "1.3"]]
+ """Current value of the zone setting."""
+
+
+class Minify(TypedDict, total=False):
+ zone_id: Required[str]
+ """Identifier"""
+
+ id: Required[Literal["minify"]]
+ """Zone setting identifier."""
+
+ value: Required[MinifyValue]
+ """Current value of the zone setting."""
+
+
+class MinifyValue(TypedDict, total=False):
+ css: Literal["on", "off"]
+ """Automatically minify all CSS files for your website."""
+
+ html: Literal["on", "off"]
+ """Automatically minify all HTML files for your website."""
+
+ js: Literal["on", "off"]
+ """Automatically minify all JavaScript files for your website."""
+
+
+class Mirage(TypedDict, total=False):
+ zone_id: Required[str]
+ """Identifier"""
+
+ id: Required[Literal["mirage"]]
+ """ID of the zone setting."""
+
+ value: Required[Literal["on", "off"]]
+ """Current value of the zone setting."""
+
+
+class MobileRedirect(TypedDict, total=False):
+ zone_id: Required[str]
+ """Identifier"""
+
+ id: Required[Literal["mobile_redirect"]]
+ """Identifier of the zone setting."""
+
+ value: Required[MobileRedirectValue]
+ """Current value of the zone setting."""
+
+
+class MobileRedirectValue(TypedDict, total=False):
+ mobile_subdomain: Optional[str]
+ """
+ Which subdomain prefix you wish to redirect visitors on mobile devices to
+ (subdomain must already exist).
+ """
+
+ status: Literal["on", "off"]
+ """
+ Deprecated: Use Single Redirects instead
+ https://developers.cloudflare.com/rules/url-forwarding/single-redirects/examples/#perform-mobile-redirects.
+ Whether or not mobile redirect is enabled.
+ """
+
+ strip_uri: bool
+ """
+ Whether to drop the current page path and redirect to the mobile subdomain URL
+ root, or keep the path and redirect to the same page on the mobile subdomain.
+ """
+
+
+class NEL(TypedDict, total=False):
+ zone_id: Required[str]
+ """Identifier"""
+
+ id: Required[Literal["nel"]]
+ """Zone setting identifier."""
+
+ value: Required[NELValue]
+ """Current value of the zone setting."""
+
+
+class NELValue(TypedDict, total=False):
+ enabled: bool
+
+
+class OpportunisticEncryption(TypedDict, total=False):
+ zone_id: Required[str]
+ """Identifier"""
+
+ id: Required[Literal["opportunistic_encryption"]]
+ """ID of the zone setting."""
+
+ value: Required[Literal["on", "off"]]
+ """Current value of the zone setting."""
+
+
+class OpportunisticOnion(TypedDict, total=False):
+ zone_id: Required[str]
+ """Identifier"""
+
+ id: Required[Literal["opportunistic_onion"]]
+ """ID of the zone setting."""
+
+ value: Required[Literal["on", "off"]]
+ """Current value of the zone setting."""
+
+
+class OrangeToOrange(TypedDict, total=False):
+ zone_id: Required[str]
+ """Identifier"""
+
+ id: Required[Literal["orange_to_orange"]]
+ """ID of the zone setting."""
+
+ value: Required[Literal["on", "off"]]
+ """Current value of the zone setting."""
+
+
+class OriginErrorPagePassThru(TypedDict, total=False):
+ zone_id: Required[str]
+ """Identifier"""
+
+ id: Required[Literal["origin_error_page_pass_thru"]]
+ """ID of the zone setting."""
+
+ value: Required[Literal["on", "off"]]
+ """Current value of the zone setting."""
+
+
+class Polish(TypedDict, total=False):
+ zone_id: Required[str]
+ """Identifier"""
+
+ id: Required[Literal["polish"]]
+ """ID of the zone setting."""
+
+ value: Required[Literal["off", "lossless", "lossy"]]
+ """Current value of the zone setting."""
+
+
+class PrefetchPreload(TypedDict, total=False):
+ zone_id: Required[str]
+ """Identifier"""
+
+ id: Required[Literal["prefetch_preload"]]
+ """ID of the zone setting."""
+
+ value: Required[Literal["on", "off"]]
+ """Current value of the zone setting."""
+
+
+class ProxyReadTimeout(TypedDict, total=False):
+ zone_id: Required[str]
+ """Identifier"""
+
+ id: Required[Literal["proxy_read_timeout"]]
+ """ID of the zone setting."""
+
+ value: Required[float]
+ """Current value of the zone setting."""
+
+
+class PseudoIPV4(TypedDict, total=False):
+ zone_id: Required[str]
+ """Identifier"""
+
+ id: Required[Literal["pseudo_ipv4"]]
+ """Value of the Pseudo IPv4 setting."""
+
+ value: Required[Literal["off", "add_header", "overwrite_header"]]
+ """Current value of the zone setting."""
+
+
+class ZonesReplaceInsecureJS(TypedDict, total=False):
+ zone_id: Required[str]
+ """Identifier"""
+
+ id: Required[Literal["replace_insecure_js"]]
+ """ID of the zone setting."""
+
+ value: Required[Literal["on", "off"]]
+ """Current value of the zone setting."""
+
+
+class ResponseBuffering(TypedDict, total=False):
+ zone_id: Required[str]
+ """Identifier"""
+
+ id: Required[Literal["response_buffering"]]
+ """ID of the zone setting."""
+
+ value: Required[Literal["on", "off"]]
+ """Current value of the zone setting."""
+
+
+class RocketLoader(TypedDict, total=False):
+ zone_id: Required[str]
+ """Identifier"""
+
+ id: Required[Literal["rocket_loader"]]
+ """ID of the zone setting."""
+
+ value: Required[Literal["on", "off"]]
+ """Current value of the zone setting."""
+
+
+class ZonesSchemasAutomaticPlatformOptimization(TypedDict, total=False):
+ zone_id: Required[str]
+ """Identifier"""
+
+ id: Required[Literal["automatic_platform_optimization"]]
+ """ID of the zone setting."""
+
+ value: Required[AutomaticPlatformOptimizationParam]
+ """Current value of the zone setting."""
+
+
+class SecurityHeaders(TypedDict, total=False):
+ zone_id: Required[str]
+ """Identifier"""
+
+ id: Required[Literal["security_header"]]
+ """ID of the zone's security header."""
+
+ value: Required[SecurityHeadersValue]
+ """Current value of the zone setting."""
+
+
+class SecurityHeadersValueStrictTransportSecurity(TypedDict, total=False):
+ enabled: bool
+ """Whether or not strict transport security is enabled."""
+
+ include_subdomains: bool
+ """Include all subdomains for strict transport security."""
+
+ max_age: float
+ """Max age in seconds of the strict transport security."""
+
+ nosniff: bool
+ """Whether or not to include 'X-Content-Type-Options: nosniff' header."""
+
+
+class SecurityHeadersValue(TypedDict, total=False):
+ strict_transport_security: SecurityHeadersValueStrictTransportSecurity
+ """Strict Transport Security."""
+
+
+class SecurityLevel(TypedDict, total=False):
+ zone_id: Required[str]
+ """Identifier"""
+
+ id: Required[Literal["security_level"]]
+ """ID of the zone setting."""
+
+ value: Required[Literal["off", "essentially_off", "low", "medium", "high", "under_attack"]]
+ """Current value of the zone setting."""
+
+
+class ServerSideExcludes(TypedDict, total=False):
+ zone_id: Required[str]
+ """Identifier"""
+
+ id: Required[Literal["server_side_exclude"]]
+ """ID of the zone setting."""
+
+ value: Required[Literal["on", "off"]]
+ """Current value of the zone setting."""
+
+
+class ZonesSha1Support(TypedDict, total=False):
+ zone_id: Required[str]
+ """Identifier"""
+
+ id: Required[Literal["sha1_support"]]
+ """Zone setting identifier."""
+
+ value: Required[Literal["off", "on"]]
+ """Current value of the zone setting."""
+
+
+class SortQueryStringForCache(TypedDict, total=False):
+ zone_id: Required[str]
+ """Identifier"""
+
+ id: Required[Literal["sort_query_string_for_cache"]]
+ """ID of the zone setting."""
+
+ value: Required[Literal["on", "off"]]
+ """Current value of the zone setting."""
+
+
+class SSL(TypedDict, total=False):
+ zone_id: Required[str]
+ """Identifier"""
+
+ id: Required[Literal["ssl"]]
+ """ID of the zone setting."""
+
+ value: Required[Literal["off", "flexible", "full", "strict"]]
+ """Current value of the zone setting."""
+
+
+class SSLRecommender(TypedDict, total=False):
+ zone_id: Required[str]
+ """Identifier"""
+
+ id: Literal["ssl_recommender"]
+ """Enrollment value for SSL/TLS Recommender."""
+
+ enabled: bool
+ """ssl-recommender enrollment setting."""
+
+
+class ZonesTLS1_2Only(TypedDict, total=False):
+ zone_id: Required[str]
+ """Identifier"""
+
+ id: Required[Literal["tls_1_2_only"]]
+ """Zone setting identifier."""
+
+ value: Required[Literal["off", "on"]]
+ """Current value of the zone setting."""
+
+
+class TLS1_3(TypedDict, total=False):
+ zone_id: Required[str]
+ """Identifier"""
+
+ id: Required[Literal["tls_1_3"]]
+ """ID of the zone setting."""
+
+ value: Required[Literal["on", "off", "zrt"]]
+ """Current value of the zone setting."""
+
+
+class TLSClientAuth(TypedDict, total=False):
+ zone_id: Required[str]
+ """Identifier"""
+
+ id: Required[Literal["tls_client_auth"]]
+ """ID of the zone setting."""
+
+ value: Required[Literal["on", "off"]]
+ """Current value of the zone setting."""
+
+
+class TrueClientIPHeader(TypedDict, total=False):
+ zone_id: Required[str]
+ """Identifier"""
+
+ id: Required[Literal["true_client_ip_header"]]
+ """ID of the zone setting."""
+
+ value: Required[Literal["on", "off"]]
+ """Current value of the zone setting."""
+
+
+class WAF(TypedDict, total=False):
+ zone_id: Required[str]
+ """Identifier"""
+
+ id: Required[Literal["waf"]]
+ """ID of the zone setting."""
+
+ value: Required[Literal["on", "off"]]
+ """Current value of the zone setting."""
+
+
+class WebP(TypedDict, total=False):
+ zone_id: Required[str]
+ """Identifier"""
+
+ id: Required[Literal["webp"]]
+ """ID of the zone setting."""
+
+ value: Required[Literal["off", "on"]]
+ """Current value of the zone setting."""
+
+
+class Websocket(TypedDict, total=False):
+ zone_id: Required[str]
+ """Identifier"""
+
+ id: Required[Literal["websockets"]]
+ """ID of the zone setting."""
+
+ value: Required[Literal["off", "on"]]
+ """Current value of the zone setting."""
+
+
+SettingEditParams = Union[
+ ZeroRTT,
+ AdvancedDDoS,
+ AlwaysOnline,
+ AlwaysUseHTTPS,
+ AutomaticHTTPSRewrites,
+ Brotli,
+ BrowserCacheTTL,
+ BrowserCheck,
+ CacheLevel,
+ ChallengeTTL,
+ Ciphers,
+ ZonesCNAMEFlattening,
+ DevelopmentMode,
+ EarlyHints,
+ ZonesEdgeCacheTTL,
+ EmailObfuscation,
+ H2Prioritization,
+ HotlinkProtection,
+ HTTP2,
+ HTTP3,
+ ImageResizing,
+ IPGeolocation,
+ IPV6,
+ ZonesMaxUpload,
+ MinTLSVersion,
+ Minify,
+ Mirage,
+ MobileRedirect,
+ NEL,
+ OpportunisticEncryption,
+ OpportunisticOnion,
+ OrangeToOrange,
+ OriginErrorPagePassThru,
+ Polish,
+ PrefetchPreload,
+ ProxyReadTimeout,
+ PseudoIPV4,
+ ZonesReplaceInsecureJS,
+ ResponseBuffering,
+ RocketLoader,
+ ZonesSchemasAutomaticPlatformOptimization,
+ SecurityHeaders,
+ SecurityLevel,
+ ServerSideExcludes,
+ ZonesSha1Support,
+ SortQueryStringForCache,
+ SSL,
+ SSLRecommender,
+ ZonesTLS1_2Only,
+ TLS1_3,
+ TLSClientAuth,
+ TrueClientIPHeader,
+ WAF,
+ WebP,
+ Websocket,
+]
diff --git a/src/cloudflare/types/zones/setting_edit_response.py b/src/cloudflare/types/zones/setting_edit_response.py
index 6806ed49d02..3c12f6a75d6 100644
--- a/src/cloudflare/types/zones/setting_edit_response.py
+++ b/src/cloudflare/types/zones/setting_edit_response.py
@@ -1,6 +1,6 @@
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
-from typing import List, Union, Optional
+from typing import Union, Optional
from datetime import datetime
from typing_extensions import Literal
@@ -57,18 +57,17 @@
__all__ = [
"SettingEditResponse",
- "SettingEditResponseItem",
- "SettingEditResponseItemZonesCNAMEFlattening",
- "SettingEditResponseItemZonesEdgeCacheTTL",
- "SettingEditResponseItemZonesMaxUpload",
- "SettingEditResponseItemZonesReplaceInsecureJS",
- "SettingEditResponseItemZonesSchemasAutomaticPlatformOptimization",
- "SettingEditResponseItemZonesSha1Support",
- "SettingEditResponseItemZonesTLS1_2Only",
+ "ZonesCNAMEFlattening",
+ "ZonesEdgeCacheTTL",
+ "ZonesMaxUpload",
+ "ZonesReplaceInsecureJS",
+ "ZonesSchemasAutomaticPlatformOptimization",
+ "ZonesSha1Support",
+ "ZonesTLS1_2Only",
]
-class SettingEditResponseItemZonesCNAMEFlattening(BaseModel):
+class ZonesCNAMEFlattening(BaseModel):
id: Literal["cname_flattening"]
"""How to flatten the cname destination."""
@@ -85,7 +84,7 @@ class SettingEditResponseItemZonesCNAMEFlattening(BaseModel):
"""last time this setting was modified."""
-class SettingEditResponseItemZonesEdgeCacheTTL(BaseModel):
+class ZonesEdgeCacheTTL(BaseModel):
id: Literal["edge_cache_ttl"]
"""ID of the zone setting."""
@@ -124,7 +123,7 @@ class SettingEditResponseItemZonesEdgeCacheTTL(BaseModel):
"""last time this setting was modified."""
-class SettingEditResponseItemZonesMaxUpload(BaseModel):
+class ZonesMaxUpload(BaseModel):
id: Literal["max_upload"]
"""identifier of the zone setting."""
@@ -141,7 +140,7 @@ class SettingEditResponseItemZonesMaxUpload(BaseModel):
"""last time this setting was modified."""
-class SettingEditResponseItemZonesReplaceInsecureJS(BaseModel):
+class ZonesReplaceInsecureJS(BaseModel):
id: Literal["replace_insecure_js"]
"""ID of the zone setting."""
@@ -158,7 +157,7 @@ class SettingEditResponseItemZonesReplaceInsecureJS(BaseModel):
"""last time this setting was modified."""
-class SettingEditResponseItemZonesSchemasAutomaticPlatformOptimization(BaseModel):
+class ZonesSchemasAutomaticPlatformOptimization(BaseModel):
id: Literal["automatic_platform_optimization"]
"""ID of the zone setting."""
@@ -175,7 +174,7 @@ class SettingEditResponseItemZonesSchemasAutomaticPlatformOptimization(BaseModel
"""last time this setting was modified."""
-class SettingEditResponseItemZonesSha1Support(BaseModel):
+class ZonesSha1Support(BaseModel):
id: Literal["sha1_support"]
"""Zone setting identifier."""
@@ -192,7 +191,7 @@ class SettingEditResponseItemZonesSha1Support(BaseModel):
"""last time this setting was modified."""
-class SettingEditResponseItemZonesTLS1_2Only(BaseModel):
+class ZonesTLS1_2Only(BaseModel):
id: Literal["tls_1_2_only"]
"""Zone setting identifier."""
@@ -209,7 +208,7 @@ class SettingEditResponseItemZonesTLS1_2Only(BaseModel):
"""last time this setting was modified."""
-SettingEditResponseItem = Union[
+SettingEditResponse = Union[
ZeroRTT,
AdvancedDDoS,
AlwaysOnline,
@@ -221,10 +220,10 @@ class SettingEditResponseItemZonesTLS1_2Only(BaseModel):
CacheLevel,
ChallengeTTL,
Ciphers,
- SettingEditResponseItemZonesCNAMEFlattening,
+ ZonesCNAMEFlattening,
DevelopmentMode,
EarlyHints,
- SettingEditResponseItemZonesEdgeCacheTTL,
+ ZonesEdgeCacheTTL,
EmailObfuscation,
H2Prioritization,
HotlinkProtection,
@@ -233,7 +232,7 @@ class SettingEditResponseItemZonesTLS1_2Only(BaseModel):
ImageResizing,
IPGeolocation,
IPV6,
- SettingEditResponseItemZonesMaxUpload,
+ ZonesMaxUpload,
MinTLSVersion,
Minify,
Mirage,
@@ -247,18 +246,18 @@ class SettingEditResponseItemZonesTLS1_2Only(BaseModel):
PrefetchPreload,
ProxyReadTimeout,
PseudoIPV4,
- SettingEditResponseItemZonesReplaceInsecureJS,
+ ZonesReplaceInsecureJS,
ResponseBuffering,
RocketLoader,
- SettingEditResponseItemZonesSchemasAutomaticPlatformOptimization,
+ ZonesSchemasAutomaticPlatformOptimization,
SecurityHeaders,
SecurityLevel,
ServerSideExcludes,
- SettingEditResponseItemZonesSha1Support,
+ ZonesSha1Support,
SortQueryStringForCache,
SSL,
SSLRecommender,
- SettingEditResponseItemZonesTLS1_2Only,
+ ZonesTLS1_2Only,
TLS1_3,
TLSClientAuth,
TrueClientIPHeader,
@@ -266,5 +265,3 @@ class SettingEditResponseItemZonesTLS1_2Only(BaseModel):
WebP,
Websocket,
]
-
-SettingEditResponse = List[SettingEditResponseItem]
diff --git a/tests/api_resources/zones/test_settings.py b/tests/api_resources/zones/test_settings.py
index e3fcc0ac04c..13ce80fe063 100644
--- a/tests/api_resources/zones/test_settings.py
+++ b/tests/api_resources/zones/test_settings.py
@@ -9,7 +9,10 @@
from cloudflare import Cloudflare, AsyncCloudflare
from tests.utils import assert_matches_type
-from cloudflare.types.zones import SettingGetResponse, SettingEditResponse
+from cloudflare.types.zones import (
+ SettingGetResponse,
+ SettingEditResponse,
+)
base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010")
@@ -18,18 +21,22 @@ class TestSettings:
parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"])
@parametrize
- def test_method_edit(self, client: Cloudflare) -> None:
+ def test_method_edit_overload_1(self, client: Cloudflare) -> None:
setting = client.zones.settings.edit(
"always_online",
zone_id="023e105f4ecef8ad9ca31a8372d0c353",
+ id="0rtt",
+ value="on",
)
assert_matches_type(Optional[SettingEditResponse], setting, path=["response"])
@parametrize
- def test_raw_response_edit(self, client: Cloudflare) -> None:
+ def test_raw_response_edit_overload_1(self, client: Cloudflare) -> None:
response = client.zones.settings.with_raw_response.edit(
"always_online",
zone_id="023e105f4ecef8ad9ca31a8372d0c353",
+ id="0rtt",
+ value="on",
)
assert response.is_closed is True
@@ -38,10 +45,12 @@ def test_raw_response_edit(self, client: Cloudflare) -> None:
assert_matches_type(Optional[SettingEditResponse], setting, path=["response"])
@parametrize
- def test_streaming_response_edit(self, client: Cloudflare) -> None:
+ def test_streaming_response_edit_overload_1(self, client: Cloudflare) -> None:
with client.zones.settings.with_streaming_response.edit(
"always_online",
zone_id="023e105f4ecef8ad9ca31a8372d0c353",
+ id="0rtt",
+ value="on",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
@@ -52,84 +61,6536 @@ def test_streaming_response_edit(self, client: Cloudflare) -> None:
assert cast(Any, response.is_closed) is True
@parametrize
- def test_path_params_edit(self, client: Cloudflare) -> None:
+ 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.zones.settings.with_raw_response.edit(
"always_online",
zone_id="",
+ id="0rtt",
+ value="on",
)
with pytest.raises(ValueError, match=r"Expected a non-empty value for `setting_id` but received ''"):
client.zones.settings.with_raw_response.edit(
"",
zone_id="023e105f4ecef8ad9ca31a8372d0c353",
+ id="0rtt",
+ value="on",
)
@parametrize
- def test_method_get(self, client: Cloudflare) -> None:
- setting = client.zones.settings.get(
+ def test_method_edit_overload_2(self, client: Cloudflare) -> None:
+ setting = client.zones.settings.edit(
"always_online",
zone_id="023e105f4ecef8ad9ca31a8372d0c353",
+ id="advanced_ddos",
+ value="on",
)
- assert_matches_type(Optional[SettingGetResponse], setting, path=["response"])
+ assert_matches_type(Optional[SettingEditResponse], setting, path=["response"])
@parametrize
- def test_raw_response_get(self, client: Cloudflare) -> None:
- response = client.zones.settings.with_raw_response.get(
+ def test_raw_response_edit_overload_2(self, client: Cloudflare) -> None:
+ response = client.zones.settings.with_raw_response.edit(
"always_online",
zone_id="023e105f4ecef8ad9ca31a8372d0c353",
+ id="advanced_ddos",
+ value="on",
)
assert response.is_closed is True
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
setting = response.parse()
- assert_matches_type(Optional[SettingGetResponse], setting, path=["response"])
+ assert_matches_type(Optional[SettingEditResponse], setting, path=["response"])
@parametrize
- def test_streaming_response_get(self, client: Cloudflare) -> None:
- with client.zones.settings.with_streaming_response.get(
+ def test_streaming_response_edit_overload_2(self, client: Cloudflare) -> None:
+ with client.zones.settings.with_streaming_response.edit(
"always_online",
zone_id="023e105f4ecef8ad9ca31a8372d0c353",
+ id="advanced_ddos",
+ value="on",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
setting = response.parse()
- assert_matches_type(Optional[SettingGetResponse], setting, path=["response"])
+ assert_matches_type(Optional[SettingEditResponse], setting, path=["response"])
assert cast(Any, response.is_closed) is True
@parametrize
- def test_path_params_get(self, client: Cloudflare) -> None:
+ def test_path_params_edit_overload_2(self, client: Cloudflare) -> None:
with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"):
- client.zones.settings.with_raw_response.get(
+ client.zones.settings.with_raw_response.edit(
"always_online",
zone_id="",
+ id="advanced_ddos",
+ value="on",
)
with pytest.raises(ValueError, match=r"Expected a non-empty value for `setting_id` but received ''"):
- client.zones.settings.with_raw_response.get(
+ client.zones.settings.with_raw_response.edit(
"",
zone_id="023e105f4ecef8ad9ca31a8372d0c353",
+ id="advanced_ddos",
+ value="on",
)
+ @parametrize
+ def test_method_edit_overload_3(self, client: Cloudflare) -> None:
+ setting = client.zones.settings.edit(
+ "always_online",
+ zone_id="023e105f4ecef8ad9ca31a8372d0c353",
+ id="always_online",
+ value="on",
+ )
+ assert_matches_type(Optional[SettingEditResponse], setting, path=["response"])
-class TestAsyncSettings:
- parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"])
+ @parametrize
+ def test_raw_response_edit_overload_3(self, client: Cloudflare) -> None:
+ response = client.zones.settings.with_raw_response.edit(
+ "always_online",
+ zone_id="023e105f4ecef8ad9ca31a8372d0c353",
+ id="always_online",
+ value="on",
+ )
+
+ assert response.is_closed is True
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+ setting = response.parse()
+ assert_matches_type(Optional[SettingEditResponse], setting, path=["response"])
+
+ @parametrize
+ def test_streaming_response_edit_overload_3(self, client: Cloudflare) -> None:
+ with client.zones.settings.with_streaming_response.edit(
+ "always_online",
+ zone_id="023e105f4ecef8ad9ca31a8372d0c353",
+ id="always_online",
+ value="on",
+ ) as response:
+ assert not response.is_closed
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+
+ setting = response.parse()
+ assert_matches_type(Optional[SettingEditResponse], setting, path=["response"])
+
+ assert cast(Any, response.is_closed) is True
+
+ @parametrize
+ def test_path_params_edit_overload_3(self, client: Cloudflare) -> None:
+ with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"):
+ client.zones.settings.with_raw_response.edit(
+ "always_online",
+ zone_id="",
+ id="always_online",
+ value="on",
+ )
+
+ with pytest.raises(ValueError, match=r"Expected a non-empty value for `setting_id` but received ''"):
+ client.zones.settings.with_raw_response.edit(
+ "",
+ zone_id="023e105f4ecef8ad9ca31a8372d0c353",
+ id="always_online",
+ value="on",
+ )
+
+ @parametrize
+ def test_method_edit_overload_4(self, client: Cloudflare) -> None:
+ setting = client.zones.settings.edit(
+ "always_online",
+ zone_id="023e105f4ecef8ad9ca31a8372d0c353",
+ id="always_use_https",
+ value="on",
+ )
+ assert_matches_type(Optional[SettingEditResponse], setting, path=["response"])
+
+ @parametrize
+ def test_raw_response_edit_overload_4(self, client: Cloudflare) -> None:
+ response = client.zones.settings.with_raw_response.edit(
+ "always_online",
+ zone_id="023e105f4ecef8ad9ca31a8372d0c353",
+ id="always_use_https",
+ value="on",
+ )
+
+ assert response.is_closed is True
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+ setting = response.parse()
+ assert_matches_type(Optional[SettingEditResponse], setting, path=["response"])
+
+ @parametrize
+ def test_streaming_response_edit_overload_4(self, client: Cloudflare) -> None:
+ with client.zones.settings.with_streaming_response.edit(
+ "always_online",
+ zone_id="023e105f4ecef8ad9ca31a8372d0c353",
+ id="always_use_https",
+ value="on",
+ ) as response:
+ assert not response.is_closed
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+
+ setting = response.parse()
+ assert_matches_type(Optional[SettingEditResponse], setting, path=["response"])
+
+ assert cast(Any, response.is_closed) is True
+
+ @parametrize
+ def test_path_params_edit_overload_4(self, client: Cloudflare) -> None:
+ with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"):
+ client.zones.settings.with_raw_response.edit(
+ "always_online",
+ zone_id="",
+ id="always_use_https",
+ value="on",
+ )
+
+ with pytest.raises(ValueError, match=r"Expected a non-empty value for `setting_id` but received ''"):
+ client.zones.settings.with_raw_response.edit(
+ "",
+ zone_id="023e105f4ecef8ad9ca31a8372d0c353",
+ id="always_use_https",
+ value="on",
+ )
+
+ @parametrize
+ def test_method_edit_overload_5(self, client: Cloudflare) -> None:
+ setting = client.zones.settings.edit(
+ "always_online",
+ zone_id="023e105f4ecef8ad9ca31a8372d0c353",
+ id="automatic_https_rewrites",
+ value="on",
+ )
+ assert_matches_type(Optional[SettingEditResponse], setting, path=["response"])
+
+ @parametrize
+ def test_raw_response_edit_overload_5(self, client: Cloudflare) -> None:
+ response = client.zones.settings.with_raw_response.edit(
+ "always_online",
+ zone_id="023e105f4ecef8ad9ca31a8372d0c353",
+ id="automatic_https_rewrites",
+ value="on",
+ )
+
+ assert response.is_closed is True
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+ setting = response.parse()
+ assert_matches_type(Optional[SettingEditResponse], setting, path=["response"])
+
+ @parametrize
+ def test_streaming_response_edit_overload_5(self, client: Cloudflare) -> None:
+ with client.zones.settings.with_streaming_response.edit(
+ "always_online",
+ zone_id="023e105f4ecef8ad9ca31a8372d0c353",
+ id="automatic_https_rewrites",
+ value="on",
+ ) as response:
+ assert not response.is_closed
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+
+ setting = response.parse()
+ assert_matches_type(Optional[SettingEditResponse], setting, path=["response"])
+
+ assert cast(Any, response.is_closed) is True
+
+ @parametrize
+ def test_path_params_edit_overload_5(self, client: Cloudflare) -> None:
+ with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"):
+ client.zones.settings.with_raw_response.edit(
+ "always_online",
+ zone_id="",
+ id="automatic_https_rewrites",
+ value="on",
+ )
+
+ with pytest.raises(ValueError, match=r"Expected a non-empty value for `setting_id` but received ''"):
+ client.zones.settings.with_raw_response.edit(
+ "",
+ zone_id="023e105f4ecef8ad9ca31a8372d0c353",
+ id="automatic_https_rewrites",
+ value="on",
+ )
+
+ @parametrize
+ def test_method_edit_overload_6(self, client: Cloudflare) -> None:
+ setting = client.zones.settings.edit(
+ "always_online",
+ zone_id="023e105f4ecef8ad9ca31a8372d0c353",
+ id="brotli",
+ value="on",
+ )
+ assert_matches_type(Optional[SettingEditResponse], setting, path=["response"])
+
+ @parametrize
+ def test_raw_response_edit_overload_6(self, client: Cloudflare) -> None:
+ response = client.zones.settings.with_raw_response.edit(
+ "always_online",
+ zone_id="023e105f4ecef8ad9ca31a8372d0c353",
+ id="brotli",
+ value="on",
+ )
+
+ assert response.is_closed is True
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+ setting = response.parse()
+ assert_matches_type(Optional[SettingEditResponse], setting, path=["response"])
+
+ @parametrize
+ def test_streaming_response_edit_overload_6(self, client: Cloudflare) -> None:
+ with client.zones.settings.with_streaming_response.edit(
+ "always_online",
+ zone_id="023e105f4ecef8ad9ca31a8372d0c353",
+ id="brotli",
+ value="on",
+ ) as response:
+ assert not response.is_closed
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+
+ setting = response.parse()
+ assert_matches_type(Optional[SettingEditResponse], setting, path=["response"])
+
+ assert cast(Any, response.is_closed) is True
+
+ @parametrize
+ def test_path_params_edit_overload_6(self, client: Cloudflare) -> None:
+ with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"):
+ client.zones.settings.with_raw_response.edit(
+ "always_online",
+ zone_id="",
+ id="brotli",
+ value="on",
+ )
+
+ with pytest.raises(ValueError, match=r"Expected a non-empty value for `setting_id` but received ''"):
+ client.zones.settings.with_raw_response.edit(
+ "",
+ zone_id="023e105f4ecef8ad9ca31a8372d0c353",
+ id="brotli",
+ value="on",
+ )
+
+ @parametrize
+ def test_method_edit_overload_7(self, client: Cloudflare) -> None:
+ setting = client.zones.settings.edit(
+ "always_online",
+ zone_id="023e105f4ecef8ad9ca31a8372d0c353",
+ id="browser_cache_ttl",
+ value=0,
+ )
+ assert_matches_type(Optional[SettingEditResponse], setting, path=["response"])
+
+ @parametrize
+ def test_raw_response_edit_overload_7(self, client: Cloudflare) -> None:
+ response = client.zones.settings.with_raw_response.edit(
+ "always_online",
+ zone_id="023e105f4ecef8ad9ca31a8372d0c353",
+ id="browser_cache_ttl",
+ value=0,
+ )
+
+ assert response.is_closed is True
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+ setting = response.parse()
+ assert_matches_type(Optional[SettingEditResponse], setting, path=["response"])
+
+ @parametrize
+ def test_streaming_response_edit_overload_7(self, client: Cloudflare) -> None:
+ with client.zones.settings.with_streaming_response.edit(
+ "always_online",
+ zone_id="023e105f4ecef8ad9ca31a8372d0c353",
+ id="browser_cache_ttl",
+ value=0,
+ ) as response:
+ assert not response.is_closed
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+
+ setting = response.parse()
+ assert_matches_type(Optional[SettingEditResponse], setting, path=["response"])
+
+ assert cast(Any, response.is_closed) is True
+
+ @parametrize
+ def test_path_params_edit_overload_7(self, client: Cloudflare) -> None:
+ with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"):
+ client.zones.settings.with_raw_response.edit(
+ "always_online",
+ zone_id="",
+ id="browser_cache_ttl",
+ value=0,
+ )
+
+ with pytest.raises(ValueError, match=r"Expected a non-empty value for `setting_id` but received ''"):
+ client.zones.settings.with_raw_response.edit(
+ "",
+ zone_id="023e105f4ecef8ad9ca31a8372d0c353",
+ id="browser_cache_ttl",
+ value=0,
+ )
+
+ @parametrize
+ def test_method_edit_overload_8(self, client: Cloudflare) -> None:
+ setting = client.zones.settings.edit(
+ "always_online",
+ zone_id="023e105f4ecef8ad9ca31a8372d0c353",
+ id="browser_check",
+ value="on",
+ )
+ assert_matches_type(Optional[SettingEditResponse], setting, path=["response"])
+
+ @parametrize
+ def test_raw_response_edit_overload_8(self, client: Cloudflare) -> None:
+ response = client.zones.settings.with_raw_response.edit(
+ "always_online",
+ zone_id="023e105f4ecef8ad9ca31a8372d0c353",
+ id="browser_check",
+ value="on",
+ )
+
+ assert response.is_closed is True
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+ setting = response.parse()
+ assert_matches_type(Optional[SettingEditResponse], setting, path=["response"])
+
+ @parametrize
+ def test_streaming_response_edit_overload_8(self, client: Cloudflare) -> None:
+ with client.zones.settings.with_streaming_response.edit(
+ "always_online",
+ zone_id="023e105f4ecef8ad9ca31a8372d0c353",
+ id="browser_check",
+ value="on",
+ ) as response:
+ assert not response.is_closed
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+
+ setting = response.parse()
+ assert_matches_type(Optional[SettingEditResponse], setting, path=["response"])
+
+ assert cast(Any, response.is_closed) is True
+
+ @parametrize
+ def test_path_params_edit_overload_8(self, client: Cloudflare) -> None:
+ with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"):
+ client.zones.settings.with_raw_response.edit(
+ "always_online",
+ zone_id="",
+ id="browser_check",
+ value="on",
+ )
+
+ with pytest.raises(ValueError, match=r"Expected a non-empty value for `setting_id` but received ''"):
+ client.zones.settings.with_raw_response.edit(
+ "",
+ zone_id="023e105f4ecef8ad9ca31a8372d0c353",
+ id="browser_check",
+ value="on",
+ )
+
+ @parametrize
+ def test_method_edit_overload_9(self, client: Cloudflare) -> None:
+ setting = client.zones.settings.edit(
+ "always_online",
+ zone_id="023e105f4ecef8ad9ca31a8372d0c353",
+ id="cache_level",
+ value="aggressive",
+ )
+ assert_matches_type(Optional[SettingEditResponse], setting, path=["response"])
+
+ @parametrize
+ def test_raw_response_edit_overload_9(self, client: Cloudflare) -> None:
+ response = client.zones.settings.with_raw_response.edit(
+ "always_online",
+ zone_id="023e105f4ecef8ad9ca31a8372d0c353",
+ id="cache_level",
+ value="aggressive",
+ )
+
+ assert response.is_closed is True
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+ setting = response.parse()
+ assert_matches_type(Optional[SettingEditResponse], setting, path=["response"])
+
+ @parametrize
+ def test_streaming_response_edit_overload_9(self, client: Cloudflare) -> None:
+ with client.zones.settings.with_streaming_response.edit(
+ "always_online",
+ zone_id="023e105f4ecef8ad9ca31a8372d0c353",
+ id="cache_level",
+ value="aggressive",
+ ) as response:
+ assert not response.is_closed
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+
+ setting = response.parse()
+ assert_matches_type(Optional[SettingEditResponse], setting, path=["response"])
+
+ assert cast(Any, response.is_closed) is True
+
+ @parametrize
+ def test_path_params_edit_overload_9(self, client: Cloudflare) -> None:
+ with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"):
+ client.zones.settings.with_raw_response.edit(
+ "always_online",
+ zone_id="",
+ id="cache_level",
+ value="aggressive",
+ )
+
+ with pytest.raises(ValueError, match=r"Expected a non-empty value for `setting_id` but received ''"):
+ client.zones.settings.with_raw_response.edit(
+ "",
+ zone_id="023e105f4ecef8ad9ca31a8372d0c353",
+ id="cache_level",
+ value="aggressive",
+ )
+
+ @parametrize
+ def test_method_edit_overload_10(self, client: Cloudflare) -> None:
+ setting = client.zones.settings.edit(
+ "always_online",
+ zone_id="023e105f4ecef8ad9ca31a8372d0c353",
+ id="challenge_ttl",
+ value=300,
+ )
+ assert_matches_type(Optional[SettingEditResponse], setting, path=["response"])
+
+ @parametrize
+ def test_raw_response_edit_overload_10(self, client: Cloudflare) -> None:
+ response = client.zones.settings.with_raw_response.edit(
+ "always_online",
+ zone_id="023e105f4ecef8ad9ca31a8372d0c353",
+ id="challenge_ttl",
+ value=300,
+ )
+
+ assert response.is_closed is True
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+ setting = response.parse()
+ assert_matches_type(Optional[SettingEditResponse], setting, path=["response"])
+
+ @parametrize
+ def test_streaming_response_edit_overload_10(self, client: Cloudflare) -> None:
+ with client.zones.settings.with_streaming_response.edit(
+ "always_online",
+ zone_id="023e105f4ecef8ad9ca31a8372d0c353",
+ id="challenge_ttl",
+ value=300,
+ ) as response:
+ assert not response.is_closed
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+
+ setting = response.parse()
+ assert_matches_type(Optional[SettingEditResponse], setting, path=["response"])
+
+ assert cast(Any, response.is_closed) is True
+
+ @parametrize
+ def test_path_params_edit_overload_10(self, client: Cloudflare) -> None:
+ with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"):
+ client.zones.settings.with_raw_response.edit(
+ "always_online",
+ zone_id="",
+ id="challenge_ttl",
+ value=300,
+ )
+
+ with pytest.raises(ValueError, match=r"Expected a non-empty value for `setting_id` but received ''"):
+ client.zones.settings.with_raw_response.edit(
+ "",
+ zone_id="023e105f4ecef8ad9ca31a8372d0c353",
+ id="challenge_ttl",
+ value=300,
+ )
+
+ @parametrize
+ def test_method_edit_overload_11(self, client: Cloudflare) -> None:
+ setting = client.zones.settings.edit(
+ "always_online",
+ zone_id="023e105f4ecef8ad9ca31a8372d0c353",
+ id="ciphers",
+ value=["ECDHE-RSA-AES128-GCM-SHA256", "AES128-SHA"],
+ )
+ assert_matches_type(Optional[SettingEditResponse], setting, path=["response"])
+
+ @parametrize
+ def test_raw_response_edit_overload_11(self, client: Cloudflare) -> None:
+ response = client.zones.settings.with_raw_response.edit(
+ "always_online",
+ zone_id="023e105f4ecef8ad9ca31a8372d0c353",
+ id="ciphers",
+ value=["ECDHE-RSA-AES128-GCM-SHA256", "AES128-SHA"],
+ )
+
+ assert response.is_closed is True
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+ setting = response.parse()
+ assert_matches_type(Optional[SettingEditResponse], setting, path=["response"])
+
+ @parametrize
+ def test_streaming_response_edit_overload_11(self, client: Cloudflare) -> None:
+ with client.zones.settings.with_streaming_response.edit(
+ "always_online",
+ zone_id="023e105f4ecef8ad9ca31a8372d0c353",
+ id="ciphers",
+ value=["ECDHE-RSA-AES128-GCM-SHA256", "AES128-SHA"],
+ ) as response:
+ assert not response.is_closed
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+
+ setting = response.parse()
+ assert_matches_type(Optional[SettingEditResponse], setting, path=["response"])
+
+ assert cast(Any, response.is_closed) is True
+
+ @parametrize
+ def test_path_params_edit_overload_11(self, client: Cloudflare) -> None:
+ with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"):
+ client.zones.settings.with_raw_response.edit(
+ "always_online",
+ zone_id="",
+ id="ciphers",
+ value=["ECDHE-RSA-AES128-GCM-SHA256", "AES128-SHA"],
+ )
+
+ with pytest.raises(ValueError, match=r"Expected a non-empty value for `setting_id` but received ''"):
+ client.zones.settings.with_raw_response.edit(
+ "",
+ zone_id="023e105f4ecef8ad9ca31a8372d0c353",
+ id="ciphers",
+ value=["ECDHE-RSA-AES128-GCM-SHA256", "AES128-SHA"],
+ )
+
+ @parametrize
+ def test_method_edit_overload_12(self, client: Cloudflare) -> None:
+ setting = client.zones.settings.edit(
+ "always_online",
+ zone_id="023e105f4ecef8ad9ca31a8372d0c353",
+ id="cname_flattening",
+ value="flatten_at_root",
+ )
+ assert_matches_type(Optional[SettingEditResponse], setting, path=["response"])
+
+ @parametrize
+ def test_raw_response_edit_overload_12(self, client: Cloudflare) -> None:
+ response = client.zones.settings.with_raw_response.edit(
+ "always_online",
+ zone_id="023e105f4ecef8ad9ca31a8372d0c353",
+ id="cname_flattening",
+ value="flatten_at_root",
+ )
+
+ assert response.is_closed is True
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+ setting = response.parse()
+ assert_matches_type(Optional[SettingEditResponse], setting, path=["response"])
+
+ @parametrize
+ def test_streaming_response_edit_overload_12(self, client: Cloudflare) -> None:
+ with client.zones.settings.with_streaming_response.edit(
+ "always_online",
+ zone_id="023e105f4ecef8ad9ca31a8372d0c353",
+ id="cname_flattening",
+ value="flatten_at_root",
+ ) as response:
+ assert not response.is_closed
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+
+ setting = response.parse()
+ assert_matches_type(Optional[SettingEditResponse], setting, path=["response"])
+
+ assert cast(Any, response.is_closed) is True
+
+ @parametrize
+ def test_path_params_edit_overload_12(self, client: Cloudflare) -> None:
+ with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"):
+ client.zones.settings.with_raw_response.edit(
+ "always_online",
+ zone_id="",
+ id="cname_flattening",
+ value="flatten_at_root",
+ )
+
+ with pytest.raises(ValueError, match=r"Expected a non-empty value for `setting_id` but received ''"):
+ client.zones.settings.with_raw_response.edit(
+ "",
+ zone_id="023e105f4ecef8ad9ca31a8372d0c353",
+ id="cname_flattening",
+ value="flatten_at_root",
+ )
+
+ @parametrize
+ def test_method_edit_overload_13(self, client: Cloudflare) -> None:
+ setting = client.zones.settings.edit(
+ "always_online",
+ zone_id="023e105f4ecef8ad9ca31a8372d0c353",
+ id="development_mode",
+ value="on",
+ )
+ assert_matches_type(Optional[SettingEditResponse], setting, path=["response"])
+
+ @parametrize
+ def test_raw_response_edit_overload_13(self, client: Cloudflare) -> None:
+ response = client.zones.settings.with_raw_response.edit(
+ "always_online",
+ zone_id="023e105f4ecef8ad9ca31a8372d0c353",
+ id="development_mode",
+ value="on",
+ )
+
+ assert response.is_closed is True
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+ setting = response.parse()
+ assert_matches_type(Optional[SettingEditResponse], setting, path=["response"])
+
+ @parametrize
+ def test_streaming_response_edit_overload_13(self, client: Cloudflare) -> None:
+ with client.zones.settings.with_streaming_response.edit(
+ "always_online",
+ zone_id="023e105f4ecef8ad9ca31a8372d0c353",
+ id="development_mode",
+ value="on",
+ ) as response:
+ assert not response.is_closed
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+
+ setting = response.parse()
+ assert_matches_type(Optional[SettingEditResponse], setting, path=["response"])
+
+ assert cast(Any, response.is_closed) is True
+
+ @parametrize
+ def test_path_params_edit_overload_13(self, client: Cloudflare) -> None:
+ with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"):
+ client.zones.settings.with_raw_response.edit(
+ "always_online",
+ zone_id="",
+ id="development_mode",
+ value="on",
+ )
+
+ with pytest.raises(ValueError, match=r"Expected a non-empty value for `setting_id` but received ''"):
+ client.zones.settings.with_raw_response.edit(
+ "",
+ zone_id="023e105f4ecef8ad9ca31a8372d0c353",
+ id="development_mode",
+ value="on",
+ )
+
+ @parametrize
+ def test_method_edit_overload_14(self, client: Cloudflare) -> None:
+ setting = client.zones.settings.edit(
+ "always_online",
+ zone_id="023e105f4ecef8ad9ca31a8372d0c353",
+ id="early_hints",
+ value="on",
+ )
+ assert_matches_type(Optional[SettingEditResponse], setting, path=["response"])
+
+ @parametrize
+ def test_raw_response_edit_overload_14(self, client: Cloudflare) -> None:
+ response = client.zones.settings.with_raw_response.edit(
+ "always_online",
+ zone_id="023e105f4ecef8ad9ca31a8372d0c353",
+ id="early_hints",
+ value="on",
+ )
+
+ assert response.is_closed is True
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+ setting = response.parse()
+ assert_matches_type(Optional[SettingEditResponse], setting, path=["response"])
+
+ @parametrize
+ def test_streaming_response_edit_overload_14(self, client: Cloudflare) -> None:
+ with client.zones.settings.with_streaming_response.edit(
+ "always_online",
+ zone_id="023e105f4ecef8ad9ca31a8372d0c353",
+ id="early_hints",
+ value="on",
+ ) as response:
+ assert not response.is_closed
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+
+ setting = response.parse()
+ assert_matches_type(Optional[SettingEditResponse], setting, path=["response"])
+
+ assert cast(Any, response.is_closed) is True
+
+ @parametrize
+ def test_path_params_edit_overload_14(self, client: Cloudflare) -> None:
+ with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"):
+ client.zones.settings.with_raw_response.edit(
+ "always_online",
+ zone_id="",
+ id="early_hints",
+ value="on",
+ )
+
+ with pytest.raises(ValueError, match=r"Expected a non-empty value for `setting_id` but received ''"):
+ client.zones.settings.with_raw_response.edit(
+ "",
+ zone_id="023e105f4ecef8ad9ca31a8372d0c353",
+ id="early_hints",
+ value="on",
+ )
+
+ @parametrize
+ def test_method_edit_overload_15(self, client: Cloudflare) -> None:
+ setting = client.zones.settings.edit(
+ "always_online",
+ zone_id="023e105f4ecef8ad9ca31a8372d0c353",
+ id="edge_cache_ttl",
+ value=30,
+ )
+ assert_matches_type(Optional[SettingEditResponse], setting, path=["response"])
+
+ @parametrize
+ def test_raw_response_edit_overload_15(self, client: Cloudflare) -> None:
+ response = client.zones.settings.with_raw_response.edit(
+ "always_online",
+ zone_id="023e105f4ecef8ad9ca31a8372d0c353",
+ id="edge_cache_ttl",
+ value=30,
+ )
+
+ assert response.is_closed is True
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+ setting = response.parse()
+ assert_matches_type(Optional[SettingEditResponse], setting, path=["response"])
+
+ @parametrize
+ def test_streaming_response_edit_overload_15(self, client: Cloudflare) -> None:
+ with client.zones.settings.with_streaming_response.edit(
+ "always_online",
+ zone_id="023e105f4ecef8ad9ca31a8372d0c353",
+ id="edge_cache_ttl",
+ value=30,
+ ) as response:
+ assert not response.is_closed
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+
+ setting = response.parse()
+ assert_matches_type(Optional[SettingEditResponse], setting, path=["response"])
+
+ assert cast(Any, response.is_closed) is True
+
+ @parametrize
+ def test_path_params_edit_overload_15(self, client: Cloudflare) -> None:
+ with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"):
+ client.zones.settings.with_raw_response.edit(
+ "always_online",
+ zone_id="",
+ id="edge_cache_ttl",
+ value=30,
+ )
+
+ with pytest.raises(ValueError, match=r"Expected a non-empty value for `setting_id` but received ''"):
+ client.zones.settings.with_raw_response.edit(
+ "",
+ zone_id="023e105f4ecef8ad9ca31a8372d0c353",
+ id="edge_cache_ttl",
+ value=30,
+ )
+
+ @parametrize
+ def test_method_edit_overload_16(self, client: Cloudflare) -> None:
+ setting = client.zones.settings.edit(
+ "always_online",
+ zone_id="023e105f4ecef8ad9ca31a8372d0c353",
+ id="email_obfuscation",
+ value="on",
+ )
+ assert_matches_type(Optional[SettingEditResponse], setting, path=["response"])
+
+ @parametrize
+ def test_raw_response_edit_overload_16(self, client: Cloudflare) -> None:
+ response = client.zones.settings.with_raw_response.edit(
+ "always_online",
+ zone_id="023e105f4ecef8ad9ca31a8372d0c353",
+ id="email_obfuscation",
+ value="on",
+ )
+
+ assert response.is_closed is True
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+ setting = response.parse()
+ assert_matches_type(Optional[SettingEditResponse], setting, path=["response"])
+
+ @parametrize
+ def test_streaming_response_edit_overload_16(self, client: Cloudflare) -> None:
+ with client.zones.settings.with_streaming_response.edit(
+ "always_online",
+ zone_id="023e105f4ecef8ad9ca31a8372d0c353",
+ id="email_obfuscation",
+ value="on",
+ ) as response:
+ assert not response.is_closed
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+
+ setting = response.parse()
+ assert_matches_type(Optional[SettingEditResponse], setting, path=["response"])
+
+ assert cast(Any, response.is_closed) is True
+
+ @parametrize
+ def test_path_params_edit_overload_16(self, client: Cloudflare) -> None:
+ with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"):
+ client.zones.settings.with_raw_response.edit(
+ "always_online",
+ zone_id="",
+ id="email_obfuscation",
+ value="on",
+ )
+
+ with pytest.raises(ValueError, match=r"Expected a non-empty value for `setting_id` but received ''"):
+ client.zones.settings.with_raw_response.edit(
+ "",
+ zone_id="023e105f4ecef8ad9ca31a8372d0c353",
+ id="email_obfuscation",
+ value="on",
+ )
+
+ @parametrize
+ def test_method_edit_overload_17(self, client: Cloudflare) -> None:
+ setting = client.zones.settings.edit(
+ "always_online",
+ zone_id="023e105f4ecef8ad9ca31a8372d0c353",
+ id="h2_prioritization",
+ value="on",
+ )
+ assert_matches_type(Optional[SettingEditResponse], setting, path=["response"])
+
+ @parametrize
+ def test_raw_response_edit_overload_17(self, client: Cloudflare) -> None:
+ response = client.zones.settings.with_raw_response.edit(
+ "always_online",
+ zone_id="023e105f4ecef8ad9ca31a8372d0c353",
+ id="h2_prioritization",
+ value="on",
+ )
+
+ assert response.is_closed is True
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+ setting = response.parse()
+ assert_matches_type(Optional[SettingEditResponse], setting, path=["response"])
+
+ @parametrize
+ def test_streaming_response_edit_overload_17(self, client: Cloudflare) -> None:
+ with client.zones.settings.with_streaming_response.edit(
+ "always_online",
+ zone_id="023e105f4ecef8ad9ca31a8372d0c353",
+ id="h2_prioritization",
+ value="on",
+ ) as response:
+ assert not response.is_closed
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+
+ setting = response.parse()
+ assert_matches_type(Optional[SettingEditResponse], setting, path=["response"])
+
+ assert cast(Any, response.is_closed) is True
+
+ @parametrize
+ def test_path_params_edit_overload_17(self, client: Cloudflare) -> None:
+ with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"):
+ client.zones.settings.with_raw_response.edit(
+ "always_online",
+ zone_id="",
+ id="h2_prioritization",
+ value="on",
+ )
+
+ with pytest.raises(ValueError, match=r"Expected a non-empty value for `setting_id` but received ''"):
+ client.zones.settings.with_raw_response.edit(
+ "",
+ zone_id="023e105f4ecef8ad9ca31a8372d0c353",
+ id="h2_prioritization",
+ value="on",
+ )
+
+ @parametrize
+ def test_method_edit_overload_18(self, client: Cloudflare) -> None:
+ setting = client.zones.settings.edit(
+ "always_online",
+ zone_id="023e105f4ecef8ad9ca31a8372d0c353",
+ id="hotlink_protection",
+ value="on",
+ )
+ assert_matches_type(Optional[SettingEditResponse], setting, path=["response"])
+
+ @parametrize
+ def test_raw_response_edit_overload_18(self, client: Cloudflare) -> None:
+ response = client.zones.settings.with_raw_response.edit(
+ "always_online",
+ zone_id="023e105f4ecef8ad9ca31a8372d0c353",
+ id="hotlink_protection",
+ value="on",
+ )
+
+ assert response.is_closed is True
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+ setting = response.parse()
+ assert_matches_type(Optional[SettingEditResponse], setting, path=["response"])
+
+ @parametrize
+ def test_streaming_response_edit_overload_18(self, client: Cloudflare) -> None:
+ with client.zones.settings.with_streaming_response.edit(
+ "always_online",
+ zone_id="023e105f4ecef8ad9ca31a8372d0c353",
+ id="hotlink_protection",
+ value="on",
+ ) as response:
+ assert not response.is_closed
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+
+ setting = response.parse()
+ assert_matches_type(Optional[SettingEditResponse], setting, path=["response"])
+
+ assert cast(Any, response.is_closed) is True
+
+ @parametrize
+ def test_path_params_edit_overload_18(self, client: Cloudflare) -> None:
+ with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"):
+ client.zones.settings.with_raw_response.edit(
+ "always_online",
+ zone_id="",
+ id="hotlink_protection",
+ value="on",
+ )
+
+ with pytest.raises(ValueError, match=r"Expected a non-empty value for `setting_id` but received ''"):
+ client.zones.settings.with_raw_response.edit(
+ "",
+ zone_id="023e105f4ecef8ad9ca31a8372d0c353",
+ id="hotlink_protection",
+ value="on",
+ )
+
+ @parametrize
+ def test_method_edit_overload_19(self, client: Cloudflare) -> None:
+ setting = client.zones.settings.edit(
+ "always_online",
+ zone_id="023e105f4ecef8ad9ca31a8372d0c353",
+ id="http2",
+ value="on",
+ )
+ assert_matches_type(Optional[SettingEditResponse], setting, path=["response"])
+
+ @parametrize
+ def test_raw_response_edit_overload_19(self, client: Cloudflare) -> None:
+ response = client.zones.settings.with_raw_response.edit(
+ "always_online",
+ zone_id="023e105f4ecef8ad9ca31a8372d0c353",
+ id="http2",
+ value="on",
+ )
+
+ assert response.is_closed is True
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+ setting = response.parse()
+ assert_matches_type(Optional[SettingEditResponse], setting, path=["response"])
+
+ @parametrize
+ def test_streaming_response_edit_overload_19(self, client: Cloudflare) -> None:
+ with client.zones.settings.with_streaming_response.edit(
+ "always_online",
+ zone_id="023e105f4ecef8ad9ca31a8372d0c353",
+ id="http2",
+ value="on",
+ ) as response:
+ assert not response.is_closed
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+
+ setting = response.parse()
+ assert_matches_type(Optional[SettingEditResponse], setting, path=["response"])
+
+ assert cast(Any, response.is_closed) is True
+
+ @parametrize
+ def test_path_params_edit_overload_19(self, client: Cloudflare) -> None:
+ with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"):
+ client.zones.settings.with_raw_response.edit(
+ "always_online",
+ zone_id="",
+ id="http2",
+ value="on",
+ )
+
+ with pytest.raises(ValueError, match=r"Expected a non-empty value for `setting_id` but received ''"):
+ client.zones.settings.with_raw_response.edit(
+ "",
+ zone_id="023e105f4ecef8ad9ca31a8372d0c353",
+ id="http2",
+ value="on",
+ )
+
+ @parametrize
+ def test_method_edit_overload_20(self, client: Cloudflare) -> None:
+ setting = client.zones.settings.edit(
+ "always_online",
+ zone_id="023e105f4ecef8ad9ca31a8372d0c353",
+ id="http3",
+ value="on",
+ )
+ assert_matches_type(Optional[SettingEditResponse], setting, path=["response"])
+
+ @parametrize
+ def test_raw_response_edit_overload_20(self, client: Cloudflare) -> None:
+ response = client.zones.settings.with_raw_response.edit(
+ "always_online",
+ zone_id="023e105f4ecef8ad9ca31a8372d0c353",
+ id="http3",
+ value="on",
+ )
+
+ assert response.is_closed is True
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+ setting = response.parse()
+ assert_matches_type(Optional[SettingEditResponse], setting, path=["response"])
+
+ @parametrize
+ def test_streaming_response_edit_overload_20(self, client: Cloudflare) -> None:
+ with client.zones.settings.with_streaming_response.edit(
+ "always_online",
+ zone_id="023e105f4ecef8ad9ca31a8372d0c353",
+ id="http3",
+ value="on",
+ ) as response:
+ assert not response.is_closed
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+
+ setting = response.parse()
+ assert_matches_type(Optional[SettingEditResponse], setting, path=["response"])
+
+ assert cast(Any, response.is_closed) is True
+
+ @parametrize
+ def test_path_params_edit_overload_20(self, client: Cloudflare) -> None:
+ with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"):
+ client.zones.settings.with_raw_response.edit(
+ "always_online",
+ zone_id="",
+ id="http3",
+ value="on",
+ )
+
+ with pytest.raises(ValueError, match=r"Expected a non-empty value for `setting_id` but received ''"):
+ client.zones.settings.with_raw_response.edit(
+ "",
+ zone_id="023e105f4ecef8ad9ca31a8372d0c353",
+ id="http3",
+ value="on",
+ )
+
+ @parametrize
+ def test_method_edit_overload_21(self, client: Cloudflare) -> None:
+ setting = client.zones.settings.edit(
+ "always_online",
+ zone_id="023e105f4ecef8ad9ca31a8372d0c353",
+ id="image_resizing",
+ value="on",
+ )
+ assert_matches_type(Optional[SettingEditResponse], setting, path=["response"])
+
+ @parametrize
+ def test_raw_response_edit_overload_21(self, client: Cloudflare) -> None:
+ response = client.zones.settings.with_raw_response.edit(
+ "always_online",
+ zone_id="023e105f4ecef8ad9ca31a8372d0c353",
+ id="image_resizing",
+ value="on",
+ )
+
+ assert response.is_closed is True
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+ setting = response.parse()
+ assert_matches_type(Optional[SettingEditResponse], setting, path=["response"])
+
+ @parametrize
+ def test_streaming_response_edit_overload_21(self, client: Cloudflare) -> None:
+ with client.zones.settings.with_streaming_response.edit(
+ "always_online",
+ zone_id="023e105f4ecef8ad9ca31a8372d0c353",
+ id="image_resizing",
+ value="on",
+ ) as response:
+ assert not response.is_closed
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+
+ setting = response.parse()
+ assert_matches_type(Optional[SettingEditResponse], setting, path=["response"])
+
+ assert cast(Any, response.is_closed) is True
+
+ @parametrize
+ def test_path_params_edit_overload_21(self, client: Cloudflare) -> None:
+ with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"):
+ client.zones.settings.with_raw_response.edit(
+ "always_online",
+ zone_id="",
+ id="image_resizing",
+ value="on",
+ )
+
+ with pytest.raises(ValueError, match=r"Expected a non-empty value for `setting_id` but received ''"):
+ client.zones.settings.with_raw_response.edit(
+ "",
+ zone_id="023e105f4ecef8ad9ca31a8372d0c353",
+ id="image_resizing",
+ value="on",
+ )
+
+ @parametrize
+ def test_method_edit_overload_22(self, client: Cloudflare) -> None:
+ setting = client.zones.settings.edit(
+ "always_online",
+ zone_id="023e105f4ecef8ad9ca31a8372d0c353",
+ id="ip_geolocation",
+ value="on",
+ )
+ assert_matches_type(Optional[SettingEditResponse], setting, path=["response"])
+
+ @parametrize
+ def test_raw_response_edit_overload_22(self, client: Cloudflare) -> None:
+ response = client.zones.settings.with_raw_response.edit(
+ "always_online",
+ zone_id="023e105f4ecef8ad9ca31a8372d0c353",
+ id="ip_geolocation",
+ value="on",
+ )
+
+ assert response.is_closed is True
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+ setting = response.parse()
+ assert_matches_type(Optional[SettingEditResponse], setting, path=["response"])
+
+ @parametrize
+ def test_streaming_response_edit_overload_22(self, client: Cloudflare) -> None:
+ with client.zones.settings.with_streaming_response.edit(
+ "always_online",
+ zone_id="023e105f4ecef8ad9ca31a8372d0c353",
+ id="ip_geolocation",
+ value="on",
+ ) as response:
+ assert not response.is_closed
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+
+ setting = response.parse()
+ assert_matches_type(Optional[SettingEditResponse], setting, path=["response"])
+
+ assert cast(Any, response.is_closed) is True
+
+ @parametrize
+ def test_path_params_edit_overload_22(self, client: Cloudflare) -> None:
+ with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"):
+ client.zones.settings.with_raw_response.edit(
+ "always_online",
+ zone_id="",
+ id="ip_geolocation",
+ value="on",
+ )
+
+ with pytest.raises(ValueError, match=r"Expected a non-empty value for `setting_id` but received ''"):
+ client.zones.settings.with_raw_response.edit(
+ "",
+ zone_id="023e105f4ecef8ad9ca31a8372d0c353",
+ id="ip_geolocation",
+ value="on",
+ )
+
+ @parametrize
+ def test_method_edit_overload_23(self, client: Cloudflare) -> None:
+ setting = client.zones.settings.edit(
+ "always_online",
+ zone_id="023e105f4ecef8ad9ca31a8372d0c353",
+ id="ipv6",
+ value="on",
+ )
+ assert_matches_type(Optional[SettingEditResponse], setting, path=["response"])
+
+ @parametrize
+ def test_raw_response_edit_overload_23(self, client: Cloudflare) -> None:
+ response = client.zones.settings.with_raw_response.edit(
+ "always_online",
+ zone_id="023e105f4ecef8ad9ca31a8372d0c353",
+ id="ipv6",
+ value="on",
+ )
+
+ assert response.is_closed is True
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+ setting = response.parse()
+ assert_matches_type(Optional[SettingEditResponse], setting, path=["response"])
+
+ @parametrize
+ def test_streaming_response_edit_overload_23(self, client: Cloudflare) -> None:
+ with client.zones.settings.with_streaming_response.edit(
+ "always_online",
+ zone_id="023e105f4ecef8ad9ca31a8372d0c353",
+ id="ipv6",
+ value="on",
+ ) as response:
+ assert not response.is_closed
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+
+ setting = response.parse()
+ assert_matches_type(Optional[SettingEditResponse], setting, path=["response"])
+
+ assert cast(Any, response.is_closed) is True
+
+ @parametrize
+ def test_path_params_edit_overload_23(self, client: Cloudflare) -> None:
+ with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"):
+ client.zones.settings.with_raw_response.edit(
+ "always_online",
+ zone_id="",
+ id="ipv6",
+ value="on",
+ )
+
+ with pytest.raises(ValueError, match=r"Expected a non-empty value for `setting_id` but received ''"):
+ client.zones.settings.with_raw_response.edit(
+ "",
+ zone_id="023e105f4ecef8ad9ca31a8372d0c353",
+ id="ipv6",
+ value="on",
+ )
+
+ @parametrize
+ def test_method_edit_overload_24(self, client: Cloudflare) -> None:
+ setting = client.zones.settings.edit(
+ "always_online",
+ zone_id="023e105f4ecef8ad9ca31a8372d0c353",
+ id="max_upload",
+ value=100,
+ )
+ assert_matches_type(Optional[SettingEditResponse], setting, path=["response"])
+
+ @parametrize
+ def test_raw_response_edit_overload_24(self, client: Cloudflare) -> None:
+ response = client.zones.settings.with_raw_response.edit(
+ "always_online",
+ zone_id="023e105f4ecef8ad9ca31a8372d0c353",
+ id="max_upload",
+ value=100,
+ )
+
+ assert response.is_closed is True
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+ setting = response.parse()
+ assert_matches_type(Optional[SettingEditResponse], setting, path=["response"])
+
+ @parametrize
+ def test_streaming_response_edit_overload_24(self, client: Cloudflare) -> None:
+ with client.zones.settings.with_streaming_response.edit(
+ "always_online",
+ zone_id="023e105f4ecef8ad9ca31a8372d0c353",
+ id="max_upload",
+ value=100,
+ ) as response:
+ assert not response.is_closed
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+
+ setting = response.parse()
+ assert_matches_type(Optional[SettingEditResponse], setting, path=["response"])
+
+ assert cast(Any, response.is_closed) is True
+
+ @parametrize
+ def test_path_params_edit_overload_24(self, client: Cloudflare) -> None:
+ with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"):
+ client.zones.settings.with_raw_response.edit(
+ "always_online",
+ zone_id="",
+ id="max_upload",
+ value=100,
+ )
+
+ with pytest.raises(ValueError, match=r"Expected a non-empty value for `setting_id` but received ''"):
+ client.zones.settings.with_raw_response.edit(
+ "",
+ zone_id="023e105f4ecef8ad9ca31a8372d0c353",
+ id="max_upload",
+ value=100,
+ )
+
+ @parametrize
+ def test_method_edit_overload_25(self, client: Cloudflare) -> None:
+ setting = client.zones.settings.edit(
+ "always_online",
+ zone_id="023e105f4ecef8ad9ca31a8372d0c353",
+ id="min_tls_version",
+ value="1.0",
+ )
+ assert_matches_type(Optional[SettingEditResponse], setting, path=["response"])
+
+ @parametrize
+ def test_raw_response_edit_overload_25(self, client: Cloudflare) -> None:
+ response = client.zones.settings.with_raw_response.edit(
+ "always_online",
+ zone_id="023e105f4ecef8ad9ca31a8372d0c353",
+ id="min_tls_version",
+ value="1.0",
+ )
+
+ assert response.is_closed is True
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+ setting = response.parse()
+ assert_matches_type(Optional[SettingEditResponse], setting, path=["response"])
+
+ @parametrize
+ def test_streaming_response_edit_overload_25(self, client: Cloudflare) -> None:
+ with client.zones.settings.with_streaming_response.edit(
+ "always_online",
+ zone_id="023e105f4ecef8ad9ca31a8372d0c353",
+ id="min_tls_version",
+ value="1.0",
+ ) as response:
+ assert not response.is_closed
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+
+ setting = response.parse()
+ assert_matches_type(Optional[SettingEditResponse], setting, path=["response"])
+
+ assert cast(Any, response.is_closed) is True
+
+ @parametrize
+ def test_path_params_edit_overload_25(self, client: Cloudflare) -> None:
+ with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"):
+ client.zones.settings.with_raw_response.edit(
+ "always_online",
+ zone_id="",
+ id="min_tls_version",
+ value="1.0",
+ )
+
+ with pytest.raises(ValueError, match=r"Expected a non-empty value for `setting_id` but received ''"):
+ client.zones.settings.with_raw_response.edit(
+ "",
+ zone_id="023e105f4ecef8ad9ca31a8372d0c353",
+ id="min_tls_version",
+ value="1.0",
+ )
+
+ @parametrize
+ def test_method_edit_overload_26(self, client: Cloudflare) -> None:
+ setting = client.zones.settings.edit(
+ "always_online",
+ zone_id="023e105f4ecef8ad9ca31a8372d0c353",
+ id="minify",
+ value={},
+ )
+ assert_matches_type(Optional[SettingEditResponse], setting, path=["response"])
+
+ @parametrize
+ def test_method_edit_with_all_params_overload_26(self, client: Cloudflare) -> None:
+ setting = client.zones.settings.edit(
+ "always_online",
+ zone_id="023e105f4ecef8ad9ca31a8372d0c353",
+ id="minify",
+ value={
+ "css": "on",
+ "html": "on",
+ "js": "on",
+ },
+ )
+ assert_matches_type(Optional[SettingEditResponse], setting, path=["response"])
+
+ @parametrize
+ def test_raw_response_edit_overload_26(self, client: Cloudflare) -> None:
+ response = client.zones.settings.with_raw_response.edit(
+ "always_online",
+ zone_id="023e105f4ecef8ad9ca31a8372d0c353",
+ id="minify",
+ value={},
+ )
+
+ assert response.is_closed is True
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+ setting = response.parse()
+ assert_matches_type(Optional[SettingEditResponse], setting, path=["response"])
+
+ @parametrize
+ def test_streaming_response_edit_overload_26(self, client: Cloudflare) -> None:
+ with client.zones.settings.with_streaming_response.edit(
+ "always_online",
+ zone_id="023e105f4ecef8ad9ca31a8372d0c353",
+ id="minify",
+ value={},
+ ) as response:
+ assert not response.is_closed
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+
+ setting = response.parse()
+ assert_matches_type(Optional[SettingEditResponse], setting, path=["response"])
+
+ assert cast(Any, response.is_closed) is True
+
+ @parametrize
+ def test_path_params_edit_overload_26(self, client: Cloudflare) -> None:
+ with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"):
+ client.zones.settings.with_raw_response.edit(
+ "always_online",
+ zone_id="",
+ id="minify",
+ value={},
+ )
+
+ with pytest.raises(ValueError, match=r"Expected a non-empty value for `setting_id` but received ''"):
+ client.zones.settings.with_raw_response.edit(
+ "",
+ zone_id="023e105f4ecef8ad9ca31a8372d0c353",
+ id="minify",
+ value={},
+ )
+
+ @parametrize
+ def test_method_edit_overload_27(self, client: Cloudflare) -> None:
+ setting = client.zones.settings.edit(
+ "always_online",
+ zone_id="023e105f4ecef8ad9ca31a8372d0c353",
+ id="mirage",
+ value="on",
+ )
+ assert_matches_type(Optional[SettingEditResponse], setting, path=["response"])
+
+ @parametrize
+ def test_raw_response_edit_overload_27(self, client: Cloudflare) -> None:
+ response = client.zones.settings.with_raw_response.edit(
+ "always_online",
+ zone_id="023e105f4ecef8ad9ca31a8372d0c353",
+ id="mirage",
+ value="on",
+ )
+
+ assert response.is_closed is True
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+ setting = response.parse()
+ assert_matches_type(Optional[SettingEditResponse], setting, path=["response"])
+
+ @parametrize
+ def test_streaming_response_edit_overload_27(self, client: Cloudflare) -> None:
+ with client.zones.settings.with_streaming_response.edit(
+ "always_online",
+ zone_id="023e105f4ecef8ad9ca31a8372d0c353",
+ id="mirage",
+ value="on",
+ ) as response:
+ assert not response.is_closed
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+
+ setting = response.parse()
+ assert_matches_type(Optional[SettingEditResponse], setting, path=["response"])
+
+ assert cast(Any, response.is_closed) is True
+
+ @parametrize
+ def test_path_params_edit_overload_27(self, client: Cloudflare) -> None:
+ with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"):
+ client.zones.settings.with_raw_response.edit(
+ "always_online",
+ zone_id="",
+ id="mirage",
+ value="on",
+ )
+
+ with pytest.raises(ValueError, match=r"Expected a non-empty value for `setting_id` but received ''"):
+ client.zones.settings.with_raw_response.edit(
+ "",
+ zone_id="023e105f4ecef8ad9ca31a8372d0c353",
+ id="mirage",
+ value="on",
+ )
+
+ @parametrize
+ def test_method_edit_overload_28(self, client: Cloudflare) -> None:
+ setting = client.zones.settings.edit(
+ "always_online",
+ zone_id="023e105f4ecef8ad9ca31a8372d0c353",
+ id="mobile_redirect",
+ value={},
+ )
+ assert_matches_type(Optional[SettingEditResponse], setting, path=["response"])
+
+ @parametrize
+ def test_method_edit_with_all_params_overload_28(self, client: Cloudflare) -> None:
+ setting = client.zones.settings.edit(
+ "always_online",
+ zone_id="023e105f4ecef8ad9ca31a8372d0c353",
+ id="mobile_redirect",
+ value={
+ "mobile_subdomain": "m",
+ "status": "on",
+ "strip_uri": False,
+ },
+ )
+ assert_matches_type(Optional[SettingEditResponse], setting, path=["response"])
+
+ @parametrize
+ def test_raw_response_edit_overload_28(self, client: Cloudflare) -> None:
+ response = client.zones.settings.with_raw_response.edit(
+ "always_online",
+ zone_id="023e105f4ecef8ad9ca31a8372d0c353",
+ id="mobile_redirect",
+ value={},
+ )
+
+ assert response.is_closed is True
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+ setting = response.parse()
+ assert_matches_type(Optional[SettingEditResponse], setting, path=["response"])
+
+ @parametrize
+ def test_streaming_response_edit_overload_28(self, client: Cloudflare) -> None:
+ with client.zones.settings.with_streaming_response.edit(
+ "always_online",
+ zone_id="023e105f4ecef8ad9ca31a8372d0c353",
+ id="mobile_redirect",
+ value={},
+ ) as response:
+ assert not response.is_closed
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+
+ setting = response.parse()
+ assert_matches_type(Optional[SettingEditResponse], setting, path=["response"])
+
+ assert cast(Any, response.is_closed) is True
+
+ @parametrize
+ def test_path_params_edit_overload_28(self, client: Cloudflare) -> None:
+ with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"):
+ client.zones.settings.with_raw_response.edit(
+ "always_online",
+ zone_id="",
+ id="mobile_redirect",
+ value={},
+ )
+
+ with pytest.raises(ValueError, match=r"Expected a non-empty value for `setting_id` but received ''"):
+ client.zones.settings.with_raw_response.edit(
+ "",
+ zone_id="023e105f4ecef8ad9ca31a8372d0c353",
+ id="mobile_redirect",
+ value={},
+ )
+
+ @parametrize
+ def test_method_edit_overload_29(self, client: Cloudflare) -> None:
+ setting = client.zones.settings.edit(
+ "always_online",
+ zone_id="023e105f4ecef8ad9ca31a8372d0c353",
+ id="nel",
+ value={},
+ )
+ assert_matches_type(Optional[SettingEditResponse], setting, path=["response"])
+
+ @parametrize
+ def test_method_edit_with_all_params_overload_29(self, client: Cloudflare) -> None:
+ setting = client.zones.settings.edit(
+ "always_online",
+ zone_id="023e105f4ecef8ad9ca31a8372d0c353",
+ id="nel",
+ value={"enabled": False},
+ )
+ assert_matches_type(Optional[SettingEditResponse], setting, path=["response"])
+
+ @parametrize
+ def test_raw_response_edit_overload_29(self, client: Cloudflare) -> None:
+ response = client.zones.settings.with_raw_response.edit(
+ "always_online",
+ zone_id="023e105f4ecef8ad9ca31a8372d0c353",
+ id="nel",
+ value={},
+ )
+
+ assert response.is_closed is True
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+ setting = response.parse()
+ assert_matches_type(Optional[SettingEditResponse], setting, path=["response"])
+
+ @parametrize
+ def test_streaming_response_edit_overload_29(self, client: Cloudflare) -> None:
+ with client.zones.settings.with_streaming_response.edit(
+ "always_online",
+ zone_id="023e105f4ecef8ad9ca31a8372d0c353",
+ id="nel",
+ value={},
+ ) as response:
+ assert not response.is_closed
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+
+ setting = response.parse()
+ assert_matches_type(Optional[SettingEditResponse], setting, path=["response"])
+
+ assert cast(Any, response.is_closed) is True
+
+ @parametrize
+ def test_path_params_edit_overload_29(self, client: Cloudflare) -> None:
+ with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"):
+ client.zones.settings.with_raw_response.edit(
+ "always_online",
+ zone_id="",
+ id="nel",
+ value={},
+ )
+
+ with pytest.raises(ValueError, match=r"Expected a non-empty value for `setting_id` but received ''"):
+ client.zones.settings.with_raw_response.edit(
+ "",
+ zone_id="023e105f4ecef8ad9ca31a8372d0c353",
+ id="nel",
+ value={},
+ )
+
+ @parametrize
+ def test_method_edit_overload_30(self, client: Cloudflare) -> None:
+ setting = client.zones.settings.edit(
+ "always_online",
+ zone_id="023e105f4ecef8ad9ca31a8372d0c353",
+ id="opportunistic_encryption",
+ value="on",
+ )
+ assert_matches_type(Optional[SettingEditResponse], setting, path=["response"])
+
+ @parametrize
+ def test_raw_response_edit_overload_30(self, client: Cloudflare) -> None:
+ response = client.zones.settings.with_raw_response.edit(
+ "always_online",
+ zone_id="023e105f4ecef8ad9ca31a8372d0c353",
+ id="opportunistic_encryption",
+ value="on",
+ )
+
+ assert response.is_closed is True
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+ setting = response.parse()
+ assert_matches_type(Optional[SettingEditResponse], setting, path=["response"])
+
+ @parametrize
+ def test_streaming_response_edit_overload_30(self, client: Cloudflare) -> None:
+ with client.zones.settings.with_streaming_response.edit(
+ "always_online",
+ zone_id="023e105f4ecef8ad9ca31a8372d0c353",
+ id="opportunistic_encryption",
+ value="on",
+ ) as response:
+ assert not response.is_closed
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+
+ setting = response.parse()
+ assert_matches_type(Optional[SettingEditResponse], setting, path=["response"])
+
+ assert cast(Any, response.is_closed) is True
+
+ @parametrize
+ def test_path_params_edit_overload_30(self, client: Cloudflare) -> None:
+ with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"):
+ client.zones.settings.with_raw_response.edit(
+ "always_online",
+ zone_id="",
+ id="opportunistic_encryption",
+ value="on",
+ )
+
+ with pytest.raises(ValueError, match=r"Expected a non-empty value for `setting_id` but received ''"):
+ client.zones.settings.with_raw_response.edit(
+ "",
+ zone_id="023e105f4ecef8ad9ca31a8372d0c353",
+ id="opportunistic_encryption",
+ value="on",
+ )
+
+ @parametrize
+ def test_method_edit_overload_31(self, client: Cloudflare) -> None:
+ setting = client.zones.settings.edit(
+ "always_online",
+ zone_id="023e105f4ecef8ad9ca31a8372d0c353",
+ id="opportunistic_onion",
+ value="on",
+ )
+ assert_matches_type(Optional[SettingEditResponse], setting, path=["response"])
+
+ @parametrize
+ def test_raw_response_edit_overload_31(self, client: Cloudflare) -> None:
+ response = client.zones.settings.with_raw_response.edit(
+ "always_online",
+ zone_id="023e105f4ecef8ad9ca31a8372d0c353",
+ id="opportunistic_onion",
+ value="on",
+ )
+
+ assert response.is_closed is True
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+ setting = response.parse()
+ assert_matches_type(Optional[SettingEditResponse], setting, path=["response"])
+
+ @parametrize
+ def test_streaming_response_edit_overload_31(self, client: Cloudflare) -> None:
+ with client.zones.settings.with_streaming_response.edit(
+ "always_online",
+ zone_id="023e105f4ecef8ad9ca31a8372d0c353",
+ id="opportunistic_onion",
+ value="on",
+ ) as response:
+ assert not response.is_closed
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+
+ setting = response.parse()
+ assert_matches_type(Optional[SettingEditResponse], setting, path=["response"])
+
+ assert cast(Any, response.is_closed) is True
+
+ @parametrize
+ def test_path_params_edit_overload_31(self, client: Cloudflare) -> None:
+ with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"):
+ client.zones.settings.with_raw_response.edit(
+ "always_online",
+ zone_id="",
+ id="opportunistic_onion",
+ value="on",
+ )
+
+ with pytest.raises(ValueError, match=r"Expected a non-empty value for `setting_id` but received ''"):
+ client.zones.settings.with_raw_response.edit(
+ "",
+ zone_id="023e105f4ecef8ad9ca31a8372d0c353",
+ id="opportunistic_onion",
+ value="on",
+ )
+
+ @parametrize
+ def test_method_edit_overload_32(self, client: Cloudflare) -> None:
+ setting = client.zones.settings.edit(
+ "always_online",
+ zone_id="023e105f4ecef8ad9ca31a8372d0c353",
+ id="orange_to_orange",
+ value="on",
+ )
+ assert_matches_type(Optional[SettingEditResponse], setting, path=["response"])
+
+ @parametrize
+ def test_raw_response_edit_overload_32(self, client: Cloudflare) -> None:
+ response = client.zones.settings.with_raw_response.edit(
+ "always_online",
+ zone_id="023e105f4ecef8ad9ca31a8372d0c353",
+ id="orange_to_orange",
+ value="on",
+ )
+
+ assert response.is_closed is True
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+ setting = response.parse()
+ assert_matches_type(Optional[SettingEditResponse], setting, path=["response"])
+
+ @parametrize
+ def test_streaming_response_edit_overload_32(self, client: Cloudflare) -> None:
+ with client.zones.settings.with_streaming_response.edit(
+ "always_online",
+ zone_id="023e105f4ecef8ad9ca31a8372d0c353",
+ id="orange_to_orange",
+ value="on",
+ ) as response:
+ assert not response.is_closed
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+
+ setting = response.parse()
+ assert_matches_type(Optional[SettingEditResponse], setting, path=["response"])
+
+ assert cast(Any, response.is_closed) is True
+
+ @parametrize
+ def test_path_params_edit_overload_32(self, client: Cloudflare) -> None:
+ with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"):
+ client.zones.settings.with_raw_response.edit(
+ "always_online",
+ zone_id="",
+ id="orange_to_orange",
+ value="on",
+ )
+
+ with pytest.raises(ValueError, match=r"Expected a non-empty value for `setting_id` but received ''"):
+ client.zones.settings.with_raw_response.edit(
+ "",
+ zone_id="023e105f4ecef8ad9ca31a8372d0c353",
+ id="orange_to_orange",
+ value="on",
+ )
+
+ @parametrize
+ def test_method_edit_overload_33(self, client: Cloudflare) -> None:
+ setting = client.zones.settings.edit(
+ "always_online",
+ zone_id="023e105f4ecef8ad9ca31a8372d0c353",
+ id="origin_error_page_pass_thru",
+ value="on",
+ )
+ assert_matches_type(Optional[SettingEditResponse], setting, path=["response"])
+
+ @parametrize
+ def test_raw_response_edit_overload_33(self, client: Cloudflare) -> None:
+ response = client.zones.settings.with_raw_response.edit(
+ "always_online",
+ zone_id="023e105f4ecef8ad9ca31a8372d0c353",
+ id="origin_error_page_pass_thru",
+ value="on",
+ )
+
+ assert response.is_closed is True
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+ setting = response.parse()
+ assert_matches_type(Optional[SettingEditResponse], setting, path=["response"])
+
+ @parametrize
+ def test_streaming_response_edit_overload_33(self, client: Cloudflare) -> None:
+ with client.zones.settings.with_streaming_response.edit(
+ "always_online",
+ zone_id="023e105f4ecef8ad9ca31a8372d0c353",
+ id="origin_error_page_pass_thru",
+ value="on",
+ ) as response:
+ assert not response.is_closed
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+
+ setting = response.parse()
+ assert_matches_type(Optional[SettingEditResponse], setting, path=["response"])
+
+ assert cast(Any, response.is_closed) is True
+
+ @parametrize
+ def test_path_params_edit_overload_33(self, client: Cloudflare) -> None:
+ with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"):
+ client.zones.settings.with_raw_response.edit(
+ "always_online",
+ zone_id="",
+ id="origin_error_page_pass_thru",
+ value="on",
+ )
+
+ with pytest.raises(ValueError, match=r"Expected a non-empty value for `setting_id` but received ''"):
+ client.zones.settings.with_raw_response.edit(
+ "",
+ zone_id="023e105f4ecef8ad9ca31a8372d0c353",
+ id="origin_error_page_pass_thru",
+ value="on",
+ )
+
+ @parametrize
+ def test_method_edit_overload_34(self, client: Cloudflare) -> None:
+ setting = client.zones.settings.edit(
+ "always_online",
+ zone_id="023e105f4ecef8ad9ca31a8372d0c353",
+ id="polish",
+ value="off",
+ )
+ assert_matches_type(Optional[SettingEditResponse], setting, path=["response"])
+
+ @parametrize
+ def test_raw_response_edit_overload_34(self, client: Cloudflare) -> None:
+ response = client.zones.settings.with_raw_response.edit(
+ "always_online",
+ zone_id="023e105f4ecef8ad9ca31a8372d0c353",
+ id="polish",
+ value="off",
+ )
+
+ assert response.is_closed is True
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+ setting = response.parse()
+ assert_matches_type(Optional[SettingEditResponse], setting, path=["response"])
+
+ @parametrize
+ def test_streaming_response_edit_overload_34(self, client: Cloudflare) -> None:
+ with client.zones.settings.with_streaming_response.edit(
+ "always_online",
+ zone_id="023e105f4ecef8ad9ca31a8372d0c353",
+ id="polish",
+ value="off",
+ ) as response:
+ assert not response.is_closed
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+
+ setting = response.parse()
+ assert_matches_type(Optional[SettingEditResponse], setting, path=["response"])
+
+ assert cast(Any, response.is_closed) is True
+
+ @parametrize
+ def test_path_params_edit_overload_34(self, client: Cloudflare) -> None:
+ with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"):
+ client.zones.settings.with_raw_response.edit(
+ "always_online",
+ zone_id="",
+ id="polish",
+ value="off",
+ )
+
+ with pytest.raises(ValueError, match=r"Expected a non-empty value for `setting_id` but received ''"):
+ client.zones.settings.with_raw_response.edit(
+ "",
+ zone_id="023e105f4ecef8ad9ca31a8372d0c353",
+ id="polish",
+ value="off",
+ )
+
+ @parametrize
+ def test_method_edit_overload_35(self, client: Cloudflare) -> None:
+ setting = client.zones.settings.edit(
+ "always_online",
+ zone_id="023e105f4ecef8ad9ca31a8372d0c353",
+ id="prefetch_preload",
+ value="on",
+ )
+ assert_matches_type(Optional[SettingEditResponse], setting, path=["response"])
+
+ @parametrize
+ def test_raw_response_edit_overload_35(self, client: Cloudflare) -> None:
+ response = client.zones.settings.with_raw_response.edit(
+ "always_online",
+ zone_id="023e105f4ecef8ad9ca31a8372d0c353",
+ id="prefetch_preload",
+ value="on",
+ )
+
+ assert response.is_closed is True
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+ setting = response.parse()
+ assert_matches_type(Optional[SettingEditResponse], setting, path=["response"])
+
+ @parametrize
+ def test_streaming_response_edit_overload_35(self, client: Cloudflare) -> None:
+ with client.zones.settings.with_streaming_response.edit(
+ "always_online",
+ zone_id="023e105f4ecef8ad9ca31a8372d0c353",
+ id="prefetch_preload",
+ value="on",
+ ) as response:
+ assert not response.is_closed
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+
+ setting = response.parse()
+ assert_matches_type(Optional[SettingEditResponse], setting, path=["response"])
+
+ assert cast(Any, response.is_closed) is True
+
+ @parametrize
+ def test_path_params_edit_overload_35(self, client: Cloudflare) -> None:
+ with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"):
+ client.zones.settings.with_raw_response.edit(
+ "always_online",
+ zone_id="",
+ id="prefetch_preload",
+ value="on",
+ )
+
+ with pytest.raises(ValueError, match=r"Expected a non-empty value for `setting_id` but received ''"):
+ client.zones.settings.with_raw_response.edit(
+ "",
+ zone_id="023e105f4ecef8ad9ca31a8372d0c353",
+ id="prefetch_preload",
+ value="on",
+ )
+
+ @parametrize
+ def test_method_edit_overload_36(self, client: Cloudflare) -> None:
+ setting = client.zones.settings.edit(
+ "always_online",
+ zone_id="023e105f4ecef8ad9ca31a8372d0c353",
+ id="proxy_read_timeout",
+ value=0,
+ )
+ assert_matches_type(Optional[SettingEditResponse], setting, path=["response"])
+
+ @parametrize
+ def test_raw_response_edit_overload_36(self, client: Cloudflare) -> None:
+ response = client.zones.settings.with_raw_response.edit(
+ "always_online",
+ zone_id="023e105f4ecef8ad9ca31a8372d0c353",
+ id="proxy_read_timeout",
+ value=0,
+ )
+
+ assert response.is_closed is True
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+ setting = response.parse()
+ assert_matches_type(Optional[SettingEditResponse], setting, path=["response"])
+
+ @parametrize
+ def test_streaming_response_edit_overload_36(self, client: Cloudflare) -> None:
+ with client.zones.settings.with_streaming_response.edit(
+ "always_online",
+ zone_id="023e105f4ecef8ad9ca31a8372d0c353",
+ id="proxy_read_timeout",
+ value=0,
+ ) as response:
+ assert not response.is_closed
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+
+ setting = response.parse()
+ assert_matches_type(Optional[SettingEditResponse], setting, path=["response"])
+
+ assert cast(Any, response.is_closed) is True
+
+ @parametrize
+ def test_path_params_edit_overload_36(self, client: Cloudflare) -> None:
+ with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"):
+ client.zones.settings.with_raw_response.edit(
+ "always_online",
+ zone_id="",
+ id="proxy_read_timeout",
+ value=0,
+ )
+
+ with pytest.raises(ValueError, match=r"Expected a non-empty value for `setting_id` but received ''"):
+ client.zones.settings.with_raw_response.edit(
+ "",
+ zone_id="023e105f4ecef8ad9ca31a8372d0c353",
+ id="proxy_read_timeout",
+ value=0,
+ )
+
+ @parametrize
+ def test_method_edit_overload_37(self, client: Cloudflare) -> None:
+ setting = client.zones.settings.edit(
+ "always_online",
+ zone_id="023e105f4ecef8ad9ca31a8372d0c353",
+ id="pseudo_ipv4",
+ value="off",
+ )
+ assert_matches_type(Optional[SettingEditResponse], setting, path=["response"])
+
+ @parametrize
+ def test_raw_response_edit_overload_37(self, client: Cloudflare) -> None:
+ response = client.zones.settings.with_raw_response.edit(
+ "always_online",
+ zone_id="023e105f4ecef8ad9ca31a8372d0c353",
+ id="pseudo_ipv4",
+ value="off",
+ )
+
+ assert response.is_closed is True
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+ setting = response.parse()
+ assert_matches_type(Optional[SettingEditResponse], setting, path=["response"])
+
+ @parametrize
+ def test_streaming_response_edit_overload_37(self, client: Cloudflare) -> None:
+ with client.zones.settings.with_streaming_response.edit(
+ "always_online",
+ zone_id="023e105f4ecef8ad9ca31a8372d0c353",
+ id="pseudo_ipv4",
+ value="off",
+ ) as response:
+ assert not response.is_closed
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+
+ setting = response.parse()
+ assert_matches_type(Optional[SettingEditResponse], setting, path=["response"])
+
+ assert cast(Any, response.is_closed) is True
+
+ @parametrize
+ def test_path_params_edit_overload_37(self, client: Cloudflare) -> None:
+ with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"):
+ client.zones.settings.with_raw_response.edit(
+ "always_online",
+ zone_id="",
+ id="pseudo_ipv4",
+ value="off",
+ )
+
+ with pytest.raises(ValueError, match=r"Expected a non-empty value for `setting_id` but received ''"):
+ client.zones.settings.with_raw_response.edit(
+ "",
+ zone_id="023e105f4ecef8ad9ca31a8372d0c353",
+ id="pseudo_ipv4",
+ value="off",
+ )
+
+ @parametrize
+ def test_method_edit_overload_38(self, client: Cloudflare) -> None:
+ setting = client.zones.settings.edit(
+ "always_online",
+ zone_id="023e105f4ecef8ad9ca31a8372d0c353",
+ id="replace_insecure_js",
+ value="on",
+ )
+ assert_matches_type(Optional[SettingEditResponse], setting, path=["response"])
+
+ @parametrize
+ def test_raw_response_edit_overload_38(self, client: Cloudflare) -> None:
+ response = client.zones.settings.with_raw_response.edit(
+ "always_online",
+ zone_id="023e105f4ecef8ad9ca31a8372d0c353",
+ id="replace_insecure_js",
+ value="on",
+ )
+
+ assert response.is_closed is True
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+ setting = response.parse()
+ assert_matches_type(Optional[SettingEditResponse], setting, path=["response"])
+
+ @parametrize
+ def test_streaming_response_edit_overload_38(self, client: Cloudflare) -> None:
+ with client.zones.settings.with_streaming_response.edit(
+ "always_online",
+ zone_id="023e105f4ecef8ad9ca31a8372d0c353",
+ id="replace_insecure_js",
+ value="on",
+ ) as response:
+ assert not response.is_closed
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+
+ setting = response.parse()
+ assert_matches_type(Optional[SettingEditResponse], setting, path=["response"])
+
+ assert cast(Any, response.is_closed) is True
+
+ @parametrize
+ def test_path_params_edit_overload_38(self, client: Cloudflare) -> None:
+ with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"):
+ client.zones.settings.with_raw_response.edit(
+ "always_online",
+ zone_id="",
+ id="replace_insecure_js",
+ value="on",
+ )
+
+ with pytest.raises(ValueError, match=r"Expected a non-empty value for `setting_id` but received ''"):
+ client.zones.settings.with_raw_response.edit(
+ "",
+ zone_id="023e105f4ecef8ad9ca31a8372d0c353",
+ id="replace_insecure_js",
+ value="on",
+ )
+
+ @parametrize
+ def test_method_edit_overload_39(self, client: Cloudflare) -> None:
+ setting = client.zones.settings.edit(
+ "always_online",
+ zone_id="023e105f4ecef8ad9ca31a8372d0c353",
+ id="response_buffering",
+ value="on",
+ )
+ assert_matches_type(Optional[SettingEditResponse], setting, path=["response"])
+
+ @parametrize
+ def test_raw_response_edit_overload_39(self, client: Cloudflare) -> None:
+ response = client.zones.settings.with_raw_response.edit(
+ "always_online",
+ zone_id="023e105f4ecef8ad9ca31a8372d0c353",
+ id="response_buffering",
+ value="on",
+ )
+
+ assert response.is_closed is True
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+ setting = response.parse()
+ assert_matches_type(Optional[SettingEditResponse], setting, path=["response"])
+
+ @parametrize
+ def test_streaming_response_edit_overload_39(self, client: Cloudflare) -> None:
+ with client.zones.settings.with_streaming_response.edit(
+ "always_online",
+ zone_id="023e105f4ecef8ad9ca31a8372d0c353",
+ id="response_buffering",
+ value="on",
+ ) as response:
+ assert not response.is_closed
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+
+ setting = response.parse()
+ assert_matches_type(Optional[SettingEditResponse], setting, path=["response"])
+
+ assert cast(Any, response.is_closed) is True
+
+ @parametrize
+ def test_path_params_edit_overload_39(self, client: Cloudflare) -> None:
+ with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"):
+ client.zones.settings.with_raw_response.edit(
+ "always_online",
+ zone_id="",
+ id="response_buffering",
+ value="on",
+ )
+
+ with pytest.raises(ValueError, match=r"Expected a non-empty value for `setting_id` but received ''"):
+ client.zones.settings.with_raw_response.edit(
+ "",
+ zone_id="023e105f4ecef8ad9ca31a8372d0c353",
+ id="response_buffering",
+ value="on",
+ )
+
+ @parametrize
+ def test_method_edit_overload_40(self, client: Cloudflare) -> None:
+ setting = client.zones.settings.edit(
+ "always_online",
+ zone_id="023e105f4ecef8ad9ca31a8372d0c353",
+ id="rocket_loader",
+ value="on",
+ )
+ assert_matches_type(Optional[SettingEditResponse], setting, path=["response"])
+
+ @parametrize
+ def test_raw_response_edit_overload_40(self, client: Cloudflare) -> None:
+ response = client.zones.settings.with_raw_response.edit(
+ "always_online",
+ zone_id="023e105f4ecef8ad9ca31a8372d0c353",
+ id="rocket_loader",
+ value="on",
+ )
+
+ assert response.is_closed is True
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+ setting = response.parse()
+ assert_matches_type(Optional[SettingEditResponse], setting, path=["response"])
+
+ @parametrize
+ def test_streaming_response_edit_overload_40(self, client: Cloudflare) -> None:
+ with client.zones.settings.with_streaming_response.edit(
+ "always_online",
+ zone_id="023e105f4ecef8ad9ca31a8372d0c353",
+ id="rocket_loader",
+ value="on",
+ ) as response:
+ assert not response.is_closed
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+
+ setting = response.parse()
+ assert_matches_type(Optional[SettingEditResponse], setting, path=["response"])
+
+ assert cast(Any, response.is_closed) is True
+
+ @parametrize
+ def test_path_params_edit_overload_40(self, client: Cloudflare) -> None:
+ with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"):
+ client.zones.settings.with_raw_response.edit(
+ "always_online",
+ zone_id="",
+ id="rocket_loader",
+ value="on",
+ )
+
+ with pytest.raises(ValueError, match=r"Expected a non-empty value for `setting_id` but received ''"):
+ client.zones.settings.with_raw_response.edit(
+ "",
+ zone_id="023e105f4ecef8ad9ca31a8372d0c353",
+ id="rocket_loader",
+ value="on",
+ )
+
+ @parametrize
+ def test_method_edit_overload_41(self, client: Cloudflare) -> None:
+ setting = client.zones.settings.edit(
+ "always_online",
+ zone_id="023e105f4ecef8ad9ca31a8372d0c353",
+ id="automatic_platform_optimization",
+ value={
+ "cache_by_device_type": False,
+ "cf": True,
+ "enabled": True,
+ "hostnames": ["www.example.com", "example.com", "shop.example.com"],
+ "wordpress": True,
+ "wp_plugin": True,
+ },
+ )
+ assert_matches_type(Optional[SettingEditResponse], setting, path=["response"])
+
+ @parametrize
+ def test_raw_response_edit_overload_41(self, client: Cloudflare) -> None:
+ response = client.zones.settings.with_raw_response.edit(
+ "always_online",
+ zone_id="023e105f4ecef8ad9ca31a8372d0c353",
+ id="automatic_platform_optimization",
+ value={
+ "cache_by_device_type": False,
+ "cf": True,
+ "enabled": True,
+ "hostnames": ["www.example.com", "example.com", "shop.example.com"],
+ "wordpress": True,
+ "wp_plugin": True,
+ },
+ )
+
+ assert response.is_closed is True
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+ setting = response.parse()
+ assert_matches_type(Optional[SettingEditResponse], setting, path=["response"])
+
+ @parametrize
+ def test_streaming_response_edit_overload_41(self, client: Cloudflare) -> None:
+ with client.zones.settings.with_streaming_response.edit(
+ "always_online",
+ zone_id="023e105f4ecef8ad9ca31a8372d0c353",
+ id="automatic_platform_optimization",
+ value={
+ "cache_by_device_type": False,
+ "cf": True,
+ "enabled": True,
+ "hostnames": ["www.example.com", "example.com", "shop.example.com"],
+ "wordpress": True,
+ "wp_plugin": True,
+ },
+ ) as response:
+ assert not response.is_closed
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+
+ setting = response.parse()
+ assert_matches_type(Optional[SettingEditResponse], setting, path=["response"])
+
+ assert cast(Any, response.is_closed) is True
+
+ @parametrize
+ def test_path_params_edit_overload_41(self, client: Cloudflare) -> None:
+ with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"):
+ client.zones.settings.with_raw_response.edit(
+ "always_online",
+ zone_id="",
+ id="automatic_platform_optimization",
+ value={
+ "cache_by_device_type": False,
+ "cf": True,
+ "enabled": True,
+ "hostnames": ["www.example.com", "example.com", "shop.example.com"],
+ "wordpress": True,
+ "wp_plugin": True,
+ },
+ )
+
+ with pytest.raises(ValueError, match=r"Expected a non-empty value for `setting_id` but received ''"):
+ client.zones.settings.with_raw_response.edit(
+ "",
+ zone_id="023e105f4ecef8ad9ca31a8372d0c353",
+ id="automatic_platform_optimization",
+ value={
+ "cache_by_device_type": False,
+ "cf": True,
+ "enabled": True,
+ "hostnames": ["www.example.com", "example.com", "shop.example.com"],
+ "wordpress": True,
+ "wp_plugin": True,
+ },
+ )
+
+ @parametrize
+ def test_method_edit_overload_42(self, client: Cloudflare) -> None:
+ setting = client.zones.settings.edit(
+ "always_online",
+ zone_id="023e105f4ecef8ad9ca31a8372d0c353",
+ id="security_header",
+ value={},
+ )
+ assert_matches_type(Optional[SettingEditResponse], setting, path=["response"])
+
+ @parametrize
+ def test_method_edit_with_all_params_overload_42(self, client: Cloudflare) -> None:
+ setting = client.zones.settings.edit(
+ "always_online",
+ zone_id="023e105f4ecef8ad9ca31a8372d0c353",
+ id="security_header",
+ value={
+ "strict_transport_security": {
+ "enabled": True,
+ "include_subdomains": True,
+ "max_age": 86400,
+ "nosniff": True,
+ }
+ },
+ )
+ assert_matches_type(Optional[SettingEditResponse], setting, path=["response"])
+
+ @parametrize
+ def test_raw_response_edit_overload_42(self, client: Cloudflare) -> None:
+ response = client.zones.settings.with_raw_response.edit(
+ "always_online",
+ zone_id="023e105f4ecef8ad9ca31a8372d0c353",
+ id="security_header",
+ value={},
+ )
+
+ assert response.is_closed is True
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+ setting = response.parse()
+ assert_matches_type(Optional[SettingEditResponse], setting, path=["response"])
+
+ @parametrize
+ def test_streaming_response_edit_overload_42(self, client: Cloudflare) -> None:
+ with client.zones.settings.with_streaming_response.edit(
+ "always_online",
+ zone_id="023e105f4ecef8ad9ca31a8372d0c353",
+ id="security_header",
+ value={},
+ ) as response:
+ assert not response.is_closed
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+
+ setting = response.parse()
+ assert_matches_type(Optional[SettingEditResponse], setting, path=["response"])
+
+ assert cast(Any, response.is_closed) is True
+
+ @parametrize
+ def test_path_params_edit_overload_42(self, client: Cloudflare) -> None:
+ with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"):
+ client.zones.settings.with_raw_response.edit(
+ "always_online",
+ zone_id="",
+ id="security_header",
+ value={},
+ )
+
+ with pytest.raises(ValueError, match=r"Expected a non-empty value for `setting_id` but received ''"):
+ client.zones.settings.with_raw_response.edit(
+ "",
+ zone_id="023e105f4ecef8ad9ca31a8372d0c353",
+ id="security_header",
+ value={},
+ )
+
+ @parametrize
+ def test_method_edit_overload_43(self, client: Cloudflare) -> None:
+ setting = client.zones.settings.edit(
+ "always_online",
+ zone_id="023e105f4ecef8ad9ca31a8372d0c353",
+ id="security_level",
+ value="off",
+ )
+ assert_matches_type(Optional[SettingEditResponse], setting, path=["response"])
+
+ @parametrize
+ def test_raw_response_edit_overload_43(self, client: Cloudflare) -> None:
+ response = client.zones.settings.with_raw_response.edit(
+ "always_online",
+ zone_id="023e105f4ecef8ad9ca31a8372d0c353",
+ id="security_level",
+ value="off",
+ )
+
+ assert response.is_closed is True
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+ setting = response.parse()
+ assert_matches_type(Optional[SettingEditResponse], setting, path=["response"])
+
+ @parametrize
+ def test_streaming_response_edit_overload_43(self, client: Cloudflare) -> None:
+ with client.zones.settings.with_streaming_response.edit(
+ "always_online",
+ zone_id="023e105f4ecef8ad9ca31a8372d0c353",
+ id="security_level",
+ value="off",
+ ) as response:
+ assert not response.is_closed
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+
+ setting = response.parse()
+ assert_matches_type(Optional[SettingEditResponse], setting, path=["response"])
+
+ assert cast(Any, response.is_closed) is True
+
+ @parametrize
+ def test_path_params_edit_overload_43(self, client: Cloudflare) -> None:
+ with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"):
+ client.zones.settings.with_raw_response.edit(
+ "always_online",
+ zone_id="",
+ id="security_level",
+ value="off",
+ )
+
+ with pytest.raises(ValueError, match=r"Expected a non-empty value for `setting_id` but received ''"):
+ client.zones.settings.with_raw_response.edit(
+ "",
+ zone_id="023e105f4ecef8ad9ca31a8372d0c353",
+ id="security_level",
+ value="off",
+ )
+
+ @parametrize
+ def test_method_edit_overload_44(self, client: Cloudflare) -> None:
+ setting = client.zones.settings.edit(
+ "always_online",
+ zone_id="023e105f4ecef8ad9ca31a8372d0c353",
+ id="server_side_exclude",
+ value="on",
+ )
+ assert_matches_type(Optional[SettingEditResponse], setting, path=["response"])
+
+ @parametrize
+ def test_raw_response_edit_overload_44(self, client: Cloudflare) -> None:
+ response = client.zones.settings.with_raw_response.edit(
+ "always_online",
+ zone_id="023e105f4ecef8ad9ca31a8372d0c353",
+ id="server_side_exclude",
+ value="on",
+ )
+
+ assert response.is_closed is True
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+ setting = response.parse()
+ assert_matches_type(Optional[SettingEditResponse], setting, path=["response"])
+
+ @parametrize
+ def test_streaming_response_edit_overload_44(self, client: Cloudflare) -> None:
+ with client.zones.settings.with_streaming_response.edit(
+ "always_online",
+ zone_id="023e105f4ecef8ad9ca31a8372d0c353",
+ id="server_side_exclude",
+ value="on",
+ ) as response:
+ assert not response.is_closed
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+
+ setting = response.parse()
+ assert_matches_type(Optional[SettingEditResponse], setting, path=["response"])
+
+ assert cast(Any, response.is_closed) is True
+
+ @parametrize
+ def test_path_params_edit_overload_44(self, client: Cloudflare) -> None:
+ with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"):
+ client.zones.settings.with_raw_response.edit(
+ "always_online",
+ zone_id="",
+ id="server_side_exclude",
+ value="on",
+ )
+
+ with pytest.raises(ValueError, match=r"Expected a non-empty value for `setting_id` but received ''"):
+ client.zones.settings.with_raw_response.edit(
+ "",
+ zone_id="023e105f4ecef8ad9ca31a8372d0c353",
+ id="server_side_exclude",
+ value="on",
+ )
+
+ @parametrize
+ def test_method_edit_overload_45(self, client: Cloudflare) -> None:
+ setting = client.zones.settings.edit(
+ "always_online",
+ zone_id="023e105f4ecef8ad9ca31a8372d0c353",
+ id="sha1_support",
+ value="on",
+ )
+ assert_matches_type(Optional[SettingEditResponse], setting, path=["response"])
+
+ @parametrize
+ def test_raw_response_edit_overload_45(self, client: Cloudflare) -> None:
+ response = client.zones.settings.with_raw_response.edit(
+ "always_online",
+ zone_id="023e105f4ecef8ad9ca31a8372d0c353",
+ id="sha1_support",
+ value="on",
+ )
+
+ assert response.is_closed is True
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+ setting = response.parse()
+ assert_matches_type(Optional[SettingEditResponse], setting, path=["response"])
+
+ @parametrize
+ def test_streaming_response_edit_overload_45(self, client: Cloudflare) -> None:
+ with client.zones.settings.with_streaming_response.edit(
+ "always_online",
+ zone_id="023e105f4ecef8ad9ca31a8372d0c353",
+ id="sha1_support",
+ value="on",
+ ) as response:
+ assert not response.is_closed
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+
+ setting = response.parse()
+ assert_matches_type(Optional[SettingEditResponse], setting, path=["response"])
+
+ assert cast(Any, response.is_closed) is True
+
+ @parametrize
+ def test_path_params_edit_overload_45(self, client: Cloudflare) -> None:
+ with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"):
+ client.zones.settings.with_raw_response.edit(
+ "always_online",
+ zone_id="",
+ id="sha1_support",
+ value="on",
+ )
+
+ with pytest.raises(ValueError, match=r"Expected a non-empty value for `setting_id` but received ''"):
+ client.zones.settings.with_raw_response.edit(
+ "",
+ zone_id="023e105f4ecef8ad9ca31a8372d0c353",
+ id="sha1_support",
+ value="on",
+ )
+
+ @parametrize
+ def test_method_edit_overload_46(self, client: Cloudflare) -> None:
+ setting = client.zones.settings.edit(
+ "always_online",
+ zone_id="023e105f4ecef8ad9ca31a8372d0c353",
+ id="sort_query_string_for_cache",
+ value="on",
+ )
+ assert_matches_type(Optional[SettingEditResponse], setting, path=["response"])
+
+ @parametrize
+ def test_raw_response_edit_overload_46(self, client: Cloudflare) -> None:
+ response = client.zones.settings.with_raw_response.edit(
+ "always_online",
+ zone_id="023e105f4ecef8ad9ca31a8372d0c353",
+ id="sort_query_string_for_cache",
+ value="on",
+ )
+
+ assert response.is_closed is True
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+ setting = response.parse()
+ assert_matches_type(Optional[SettingEditResponse], setting, path=["response"])
+
+ @parametrize
+ def test_streaming_response_edit_overload_46(self, client: Cloudflare) -> None:
+ with client.zones.settings.with_streaming_response.edit(
+ "always_online",
+ zone_id="023e105f4ecef8ad9ca31a8372d0c353",
+ id="sort_query_string_for_cache",
+ value="on",
+ ) as response:
+ assert not response.is_closed
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+
+ setting = response.parse()
+ assert_matches_type(Optional[SettingEditResponse], setting, path=["response"])
+
+ assert cast(Any, response.is_closed) is True
+
+ @parametrize
+ def test_path_params_edit_overload_46(self, client: Cloudflare) -> None:
+ with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"):
+ client.zones.settings.with_raw_response.edit(
+ "always_online",
+ zone_id="",
+ id="sort_query_string_for_cache",
+ value="on",
+ )
+
+ with pytest.raises(ValueError, match=r"Expected a non-empty value for `setting_id` but received ''"):
+ client.zones.settings.with_raw_response.edit(
+ "",
+ zone_id="023e105f4ecef8ad9ca31a8372d0c353",
+ id="sort_query_string_for_cache",
+ value="on",
+ )
+
+ @parametrize
+ def test_method_edit_overload_47(self, client: Cloudflare) -> None:
+ setting = client.zones.settings.edit(
+ "always_online",
+ zone_id="023e105f4ecef8ad9ca31a8372d0c353",
+ id="ssl",
+ value="off",
+ )
+ assert_matches_type(Optional[SettingEditResponse], setting, path=["response"])
+
+ @parametrize
+ def test_raw_response_edit_overload_47(self, client: Cloudflare) -> None:
+ response = client.zones.settings.with_raw_response.edit(
+ "always_online",
+ zone_id="023e105f4ecef8ad9ca31a8372d0c353",
+ id="ssl",
+ value="off",
+ )
+
+ assert response.is_closed is True
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+ setting = response.parse()
+ assert_matches_type(Optional[SettingEditResponse], setting, path=["response"])
+
+ @parametrize
+ def test_streaming_response_edit_overload_47(self, client: Cloudflare) -> None:
+ with client.zones.settings.with_streaming_response.edit(
+ "always_online",
+ zone_id="023e105f4ecef8ad9ca31a8372d0c353",
+ id="ssl",
+ value="off",
+ ) as response:
+ assert not response.is_closed
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+
+ setting = response.parse()
+ assert_matches_type(Optional[SettingEditResponse], setting, path=["response"])
+
+ assert cast(Any, response.is_closed) is True
+
+ @parametrize
+ def test_path_params_edit_overload_47(self, client: Cloudflare) -> None:
+ with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"):
+ client.zones.settings.with_raw_response.edit(
+ "always_online",
+ zone_id="",
+ id="ssl",
+ value="off",
+ )
+
+ with pytest.raises(ValueError, match=r"Expected a non-empty value for `setting_id` but received ''"):
+ client.zones.settings.with_raw_response.edit(
+ "",
+ zone_id="023e105f4ecef8ad9ca31a8372d0c353",
+ id="ssl",
+ value="off",
+ )
+
+ @parametrize
+ def test_method_edit_overload_48(self, client: Cloudflare) -> None:
+ setting = client.zones.settings.edit(
+ "always_online",
+ zone_id="023e105f4ecef8ad9ca31a8372d0c353",
+ )
+ assert_matches_type(Optional[SettingEditResponse], setting, path=["response"])
+
+ @parametrize
+ def test_method_edit_with_all_params_overload_48(self, client: Cloudflare) -> None:
+ setting = client.zones.settings.edit(
+ "always_online",
+ zone_id="023e105f4ecef8ad9ca31a8372d0c353",
+ id="ssl_recommender",
+ enabled=True,
+ )
+ assert_matches_type(Optional[SettingEditResponse], setting, path=["response"])
+
+ @parametrize
+ def test_raw_response_edit_overload_48(self, client: Cloudflare) -> None:
+ response = client.zones.settings.with_raw_response.edit(
+ "always_online",
+ zone_id="023e105f4ecef8ad9ca31a8372d0c353",
+ )
+
+ assert response.is_closed is True
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+ setting = response.parse()
+ assert_matches_type(Optional[SettingEditResponse], setting, path=["response"])
+
+ @parametrize
+ def test_streaming_response_edit_overload_48(self, client: Cloudflare) -> None:
+ with client.zones.settings.with_streaming_response.edit(
+ "always_online",
+ zone_id="023e105f4ecef8ad9ca31a8372d0c353",
+ ) as response:
+ assert not response.is_closed
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+
+ setting = response.parse()
+ assert_matches_type(Optional[SettingEditResponse], setting, path=["response"])
+
+ assert cast(Any, response.is_closed) is True
+
+ @parametrize
+ def test_path_params_edit_overload_48(self, client: Cloudflare) -> None:
+ with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"):
+ client.zones.settings.with_raw_response.edit(
+ "always_online",
+ zone_id="",
+ )
+
+ with pytest.raises(ValueError, match=r"Expected a non-empty value for `setting_id` but received ''"):
+ client.zones.settings.with_raw_response.edit(
+ "",
+ zone_id="023e105f4ecef8ad9ca31a8372d0c353",
+ )
+
+ @parametrize
+ def test_method_edit_overload_49(self, client: Cloudflare) -> None:
+ setting = client.zones.settings.edit(
+ "always_online",
+ zone_id="023e105f4ecef8ad9ca31a8372d0c353",
+ id="tls_1_2_only",
+ value="on",
+ )
+ assert_matches_type(Optional[SettingEditResponse], setting, path=["response"])
+
+ @parametrize
+ def test_raw_response_edit_overload_49(self, client: Cloudflare) -> None:
+ response = client.zones.settings.with_raw_response.edit(
+ "always_online",
+ zone_id="023e105f4ecef8ad9ca31a8372d0c353",
+ id="tls_1_2_only",
+ value="on",
+ )
+
+ assert response.is_closed is True
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+ setting = response.parse()
+ assert_matches_type(Optional[SettingEditResponse], setting, path=["response"])
+
+ @parametrize
+ def test_streaming_response_edit_overload_49(self, client: Cloudflare) -> None:
+ with client.zones.settings.with_streaming_response.edit(
+ "always_online",
+ zone_id="023e105f4ecef8ad9ca31a8372d0c353",
+ id="tls_1_2_only",
+ value="on",
+ ) as response:
+ assert not response.is_closed
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+
+ setting = response.parse()
+ assert_matches_type(Optional[SettingEditResponse], setting, path=["response"])
+
+ assert cast(Any, response.is_closed) is True
+
+ @parametrize
+ def test_path_params_edit_overload_49(self, client: Cloudflare) -> None:
+ with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"):
+ client.zones.settings.with_raw_response.edit(
+ "always_online",
+ zone_id="",
+ id="tls_1_2_only",
+ value="on",
+ )
+
+ with pytest.raises(ValueError, match=r"Expected a non-empty value for `setting_id` but received ''"):
+ client.zones.settings.with_raw_response.edit(
+ "",
+ zone_id="023e105f4ecef8ad9ca31a8372d0c353",
+ id="tls_1_2_only",
+ value="on",
+ )
+
+ @parametrize
+ def test_method_edit_overload_50(self, client: Cloudflare) -> None:
+ setting = client.zones.settings.edit(
+ "always_online",
+ zone_id="023e105f4ecef8ad9ca31a8372d0c353",
+ id="tls_1_3",
+ value="on",
+ )
+ assert_matches_type(Optional[SettingEditResponse], setting, path=["response"])
+
+ @parametrize
+ def test_raw_response_edit_overload_50(self, client: Cloudflare) -> None:
+ response = client.zones.settings.with_raw_response.edit(
+ "always_online",
+ zone_id="023e105f4ecef8ad9ca31a8372d0c353",
+ id="tls_1_3",
+ value="on",
+ )
+
+ assert response.is_closed is True
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+ setting = response.parse()
+ assert_matches_type(Optional[SettingEditResponse], setting, path=["response"])
+
+ @parametrize
+ def test_streaming_response_edit_overload_50(self, client: Cloudflare) -> None:
+ with client.zones.settings.with_streaming_response.edit(
+ "always_online",
+ zone_id="023e105f4ecef8ad9ca31a8372d0c353",
+ id="tls_1_3",
+ value="on",
+ ) as response:
+ assert not response.is_closed
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+
+ setting = response.parse()
+ assert_matches_type(Optional[SettingEditResponse], setting, path=["response"])
+
+ assert cast(Any, response.is_closed) is True
+
+ @parametrize
+ def test_path_params_edit_overload_50(self, client: Cloudflare) -> None:
+ with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"):
+ client.zones.settings.with_raw_response.edit(
+ "always_online",
+ zone_id="",
+ id="tls_1_3",
+ value="on",
+ )
+
+ with pytest.raises(ValueError, match=r"Expected a non-empty value for `setting_id` but received ''"):
+ client.zones.settings.with_raw_response.edit(
+ "",
+ zone_id="023e105f4ecef8ad9ca31a8372d0c353",
+ id="tls_1_3",
+ value="on",
+ )
+
+ @parametrize
+ def test_method_edit_overload_51(self, client: Cloudflare) -> None:
+ setting = client.zones.settings.edit(
+ "always_online",
+ zone_id="023e105f4ecef8ad9ca31a8372d0c353",
+ id="tls_client_auth",
+ value="on",
+ )
+ assert_matches_type(Optional[SettingEditResponse], setting, path=["response"])
+
+ @parametrize
+ def test_raw_response_edit_overload_51(self, client: Cloudflare) -> None:
+ response = client.zones.settings.with_raw_response.edit(
+ "always_online",
+ zone_id="023e105f4ecef8ad9ca31a8372d0c353",
+ id="tls_client_auth",
+ value="on",
+ )
+
+ assert response.is_closed is True
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+ setting = response.parse()
+ assert_matches_type(Optional[SettingEditResponse], setting, path=["response"])
+
+ @parametrize
+ def test_streaming_response_edit_overload_51(self, client: Cloudflare) -> None:
+ with client.zones.settings.with_streaming_response.edit(
+ "always_online",
+ zone_id="023e105f4ecef8ad9ca31a8372d0c353",
+ id="tls_client_auth",
+ value="on",
+ ) as response:
+ assert not response.is_closed
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+
+ setting = response.parse()
+ assert_matches_type(Optional[SettingEditResponse], setting, path=["response"])
+
+ assert cast(Any, response.is_closed) is True
+
+ @parametrize
+ def test_path_params_edit_overload_51(self, client: Cloudflare) -> None:
+ with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"):
+ client.zones.settings.with_raw_response.edit(
+ "always_online",
+ zone_id="",
+ id="tls_client_auth",
+ value="on",
+ )
+
+ with pytest.raises(ValueError, match=r"Expected a non-empty value for `setting_id` but received ''"):
+ client.zones.settings.with_raw_response.edit(
+ "",
+ zone_id="023e105f4ecef8ad9ca31a8372d0c353",
+ id="tls_client_auth",
+ value="on",
+ )
+
+ @parametrize
+ def test_method_edit_overload_52(self, client: Cloudflare) -> None:
+ setting = client.zones.settings.edit(
+ "always_online",
+ zone_id="023e105f4ecef8ad9ca31a8372d0c353",
+ id="true_client_ip_header",
+ value="on",
+ )
+ assert_matches_type(Optional[SettingEditResponse], setting, path=["response"])
+
+ @parametrize
+ def test_raw_response_edit_overload_52(self, client: Cloudflare) -> None:
+ response = client.zones.settings.with_raw_response.edit(
+ "always_online",
+ zone_id="023e105f4ecef8ad9ca31a8372d0c353",
+ id="true_client_ip_header",
+ value="on",
+ )
+
+ assert response.is_closed is True
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+ setting = response.parse()
+ assert_matches_type(Optional[SettingEditResponse], setting, path=["response"])
+
+ @parametrize
+ def test_streaming_response_edit_overload_52(self, client: Cloudflare) -> None:
+ with client.zones.settings.with_streaming_response.edit(
+ "always_online",
+ zone_id="023e105f4ecef8ad9ca31a8372d0c353",
+ id="true_client_ip_header",
+ value="on",
+ ) as response:
+ assert not response.is_closed
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+
+ setting = response.parse()
+ assert_matches_type(Optional[SettingEditResponse], setting, path=["response"])
+
+ assert cast(Any, response.is_closed) is True
+
+ @parametrize
+ def test_path_params_edit_overload_52(self, client: Cloudflare) -> None:
+ with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"):
+ client.zones.settings.with_raw_response.edit(
+ "always_online",
+ zone_id="",
+ id="true_client_ip_header",
+ value="on",
+ )
+
+ with pytest.raises(ValueError, match=r"Expected a non-empty value for `setting_id` but received ''"):
+ client.zones.settings.with_raw_response.edit(
+ "",
+ zone_id="023e105f4ecef8ad9ca31a8372d0c353",
+ id="true_client_ip_header",
+ value="on",
+ )
+
+ @parametrize
+ def test_method_edit_overload_53(self, client: Cloudflare) -> None:
+ setting = client.zones.settings.edit(
+ "always_online",
+ zone_id="023e105f4ecef8ad9ca31a8372d0c353",
+ id="waf",
+ value="on",
+ )
+ assert_matches_type(Optional[SettingEditResponse], setting, path=["response"])
+
+ @parametrize
+ def test_raw_response_edit_overload_53(self, client: Cloudflare) -> None:
+ response = client.zones.settings.with_raw_response.edit(
+ "always_online",
+ zone_id="023e105f4ecef8ad9ca31a8372d0c353",
+ id="waf",
+ value="on",
+ )
+
+ assert response.is_closed is True
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+ setting = response.parse()
+ assert_matches_type(Optional[SettingEditResponse], setting, path=["response"])
+
+ @parametrize
+ def test_streaming_response_edit_overload_53(self, client: Cloudflare) -> None:
+ with client.zones.settings.with_streaming_response.edit(
+ "always_online",
+ zone_id="023e105f4ecef8ad9ca31a8372d0c353",
+ id="waf",
+ value="on",
+ ) as response:
+ assert not response.is_closed
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+
+ setting = response.parse()
+ assert_matches_type(Optional[SettingEditResponse], setting, path=["response"])
+
+ assert cast(Any, response.is_closed) is True
+
+ @parametrize
+ def test_path_params_edit_overload_53(self, client: Cloudflare) -> None:
+ with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"):
+ client.zones.settings.with_raw_response.edit(
+ "always_online",
+ zone_id="",
+ id="waf",
+ value="on",
+ )
+
+ with pytest.raises(ValueError, match=r"Expected a non-empty value for `setting_id` but received ''"):
+ client.zones.settings.with_raw_response.edit(
+ "",
+ zone_id="023e105f4ecef8ad9ca31a8372d0c353",
+ id="waf",
+ value="on",
+ )
+
+ @parametrize
+ def test_method_edit_overload_54(self, client: Cloudflare) -> None:
+ setting = client.zones.settings.edit(
+ "always_online",
+ zone_id="023e105f4ecef8ad9ca31a8372d0c353",
+ id="webp",
+ value="on",
+ )
+ assert_matches_type(Optional[SettingEditResponse], setting, path=["response"])
+
+ @parametrize
+ def test_raw_response_edit_overload_54(self, client: Cloudflare) -> None:
+ response = client.zones.settings.with_raw_response.edit(
+ "always_online",
+ zone_id="023e105f4ecef8ad9ca31a8372d0c353",
+ id="webp",
+ value="on",
+ )
+
+ assert response.is_closed is True
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+ setting = response.parse()
+ assert_matches_type(Optional[SettingEditResponse], setting, path=["response"])
+
+ @parametrize
+ def test_streaming_response_edit_overload_54(self, client: Cloudflare) -> None:
+ with client.zones.settings.with_streaming_response.edit(
+ "always_online",
+ zone_id="023e105f4ecef8ad9ca31a8372d0c353",
+ id="webp",
+ value="on",
+ ) as response:
+ assert not response.is_closed
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+
+ setting = response.parse()
+ assert_matches_type(Optional[SettingEditResponse], setting, path=["response"])
+
+ assert cast(Any, response.is_closed) is True
+
+ @parametrize
+ def test_path_params_edit_overload_54(self, client: Cloudflare) -> None:
+ with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"):
+ client.zones.settings.with_raw_response.edit(
+ "always_online",
+ zone_id="",
+ id="webp",
+ value="on",
+ )
+
+ with pytest.raises(ValueError, match=r"Expected a non-empty value for `setting_id` but received ''"):
+ client.zones.settings.with_raw_response.edit(
+ "",
+ zone_id="023e105f4ecef8ad9ca31a8372d0c353",
+ id="webp",
+ value="on",
+ )
+
+ @parametrize
+ def test_method_edit_overload_55(self, client: Cloudflare) -> None:
+ setting = client.zones.settings.edit(
+ "always_online",
+ zone_id="023e105f4ecef8ad9ca31a8372d0c353",
+ id="websockets",
+ value="on",
+ )
+ assert_matches_type(Optional[SettingEditResponse], setting, path=["response"])
+
+ @parametrize
+ def test_raw_response_edit_overload_55(self, client: Cloudflare) -> None:
+ response = client.zones.settings.with_raw_response.edit(
+ "always_online",
+ zone_id="023e105f4ecef8ad9ca31a8372d0c353",
+ id="websockets",
+ value="on",
+ )
+
+ assert response.is_closed is True
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+ setting = response.parse()
+ assert_matches_type(Optional[SettingEditResponse], setting, path=["response"])
+
+ @parametrize
+ def test_streaming_response_edit_overload_55(self, client: Cloudflare) -> None:
+ with client.zones.settings.with_streaming_response.edit(
+ "always_online",
+ zone_id="023e105f4ecef8ad9ca31a8372d0c353",
+ id="websockets",
+ value="on",
+ ) as response:
+ assert not response.is_closed
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+
+ setting = response.parse()
+ assert_matches_type(Optional[SettingEditResponse], setting, path=["response"])
+
+ assert cast(Any, response.is_closed) is True
+
+ @parametrize
+ def test_path_params_edit_overload_55(self, client: Cloudflare) -> None:
+ with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"):
+ client.zones.settings.with_raw_response.edit(
+ "always_online",
+ zone_id="",
+ id="websockets",
+ value="on",
+ )
+
+ with pytest.raises(ValueError, match=r"Expected a non-empty value for `setting_id` but received ''"):
+ client.zones.settings.with_raw_response.edit(
+ "",
+ zone_id="023e105f4ecef8ad9ca31a8372d0c353",
+ id="websockets",
+ value="on",
+ )
+
+ @parametrize
+ def test_method_get(self, client: Cloudflare) -> None:
+ setting = client.zones.settings.get(
+ "always_online",
+ zone_id="023e105f4ecef8ad9ca31a8372d0c353",
+ )
+ assert_matches_type(Optional[SettingGetResponse], setting, path=["response"])
+
+ @parametrize
+ def test_raw_response_get(self, client: Cloudflare) -> None:
+ response = client.zones.settings.with_raw_response.get(
+ "always_online",
+ zone_id="023e105f4ecef8ad9ca31a8372d0c353",
+ )
+
+ assert response.is_closed is True
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+ setting = response.parse()
+ assert_matches_type(Optional[SettingGetResponse], setting, path=["response"])
+
+ @parametrize
+ def test_streaming_response_get(self, client: Cloudflare) -> None:
+ with client.zones.settings.with_streaming_response.get(
+ "always_online",
+ zone_id="023e105f4ecef8ad9ca31a8372d0c353",
+ ) as response:
+ assert not response.is_closed
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+
+ setting = response.parse()
+ assert_matches_type(Optional[SettingGetResponse], setting, path=["response"])
+
+ assert cast(Any, response.is_closed) is True
+
+ @parametrize
+ def test_path_params_get(self, client: Cloudflare) -> None:
+ with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"):
+ client.zones.settings.with_raw_response.get(
+ "always_online",
+ zone_id="",
+ )
+
+ with pytest.raises(ValueError, match=r"Expected a non-empty value for `setting_id` but received ''"):
+ client.zones.settings.with_raw_response.get(
+ "",
+ zone_id="023e105f4ecef8ad9ca31a8372d0c353",
+ )
+
+
+class TestAsyncSettings:
+ parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"])
+
+ @parametrize
+ async def test_method_edit_overload_1(self, async_client: AsyncCloudflare) -> None:
+ setting = await async_client.zones.settings.edit(
+ "always_online",
+ zone_id="023e105f4ecef8ad9ca31a8372d0c353",
+ id="0rtt",
+ value="on",
+ )
+ assert_matches_type(Optional[SettingEditResponse], setting, path=["response"])
+
+ @parametrize
+ async def test_raw_response_edit_overload_1(self, async_client: AsyncCloudflare) -> None:
+ response = await async_client.zones.settings.with_raw_response.edit(
+ "always_online",
+ zone_id="023e105f4ecef8ad9ca31a8372d0c353",
+ id="0rtt",
+ value="on",
+ )
+
+ assert response.is_closed is True
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+ setting = await response.parse()
+ assert_matches_type(Optional[SettingEditResponse], setting, path=["response"])
+
+ @parametrize
+ async def test_streaming_response_edit_overload_1(self, async_client: AsyncCloudflare) -> None:
+ async with async_client.zones.settings.with_streaming_response.edit(
+ "always_online",
+ zone_id="023e105f4ecef8ad9ca31a8372d0c353",
+ id="0rtt",
+ value="on",
+ ) as response:
+ assert not response.is_closed
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+
+ setting = await response.parse()
+ assert_matches_type(Optional[SettingEditResponse], setting, 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.zones.settings.with_raw_response.edit(
+ "always_online",
+ zone_id="",
+ id="0rtt",
+ value="on",
+ )
+
+ with pytest.raises(ValueError, match=r"Expected a non-empty value for `setting_id` but received ''"):
+ await async_client.zones.settings.with_raw_response.edit(
+ "",
+ zone_id="023e105f4ecef8ad9ca31a8372d0c353",
+ id="0rtt",
+ value="on",
+ )
+
+ @parametrize
+ async def test_method_edit_overload_2(self, async_client: AsyncCloudflare) -> None:
+ setting = await async_client.zones.settings.edit(
+ "always_online",
+ zone_id="023e105f4ecef8ad9ca31a8372d0c353",
+ id="advanced_ddos",
+ value="on",
+ )
+ assert_matches_type(Optional[SettingEditResponse], setting, path=["response"])
+
+ @parametrize
+ async def test_raw_response_edit_overload_2(self, async_client: AsyncCloudflare) -> None:
+ response = await async_client.zones.settings.with_raw_response.edit(
+ "always_online",
+ zone_id="023e105f4ecef8ad9ca31a8372d0c353",
+ id="advanced_ddos",
+ value="on",
+ )
+
+ assert response.is_closed is True
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+ setting = await response.parse()
+ assert_matches_type(Optional[SettingEditResponse], setting, path=["response"])
+
+ @parametrize
+ async def test_streaming_response_edit_overload_2(self, async_client: AsyncCloudflare) -> None:
+ async with async_client.zones.settings.with_streaming_response.edit(
+ "always_online",
+ zone_id="023e105f4ecef8ad9ca31a8372d0c353",
+ id="advanced_ddos",
+ value="on",
+ ) as response:
+ assert not response.is_closed
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+
+ setting = await response.parse()
+ assert_matches_type(Optional[SettingEditResponse], setting, path=["response"])
+
+ assert cast(Any, response.is_closed) is True
+
+ @parametrize
+ async def test_path_params_edit_overload_2(self, async_client: AsyncCloudflare) -> None:
+ with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"):
+ await async_client.zones.settings.with_raw_response.edit(
+ "always_online",
+ zone_id="",
+ id="advanced_ddos",
+ value="on",
+ )
+
+ with pytest.raises(ValueError, match=r"Expected a non-empty value for `setting_id` but received ''"):
+ await async_client.zones.settings.with_raw_response.edit(
+ "",
+ zone_id="023e105f4ecef8ad9ca31a8372d0c353",
+ id="advanced_ddos",
+ value="on",
+ )
+
+ @parametrize
+ async def test_method_edit_overload_3(self, async_client: AsyncCloudflare) -> None:
+ setting = await async_client.zones.settings.edit(
+ "always_online",
+ zone_id="023e105f4ecef8ad9ca31a8372d0c353",
+ id="always_online",
+ value="on",
+ )
+ assert_matches_type(Optional[SettingEditResponse], setting, path=["response"])
+
+ @parametrize
+ async def test_raw_response_edit_overload_3(self, async_client: AsyncCloudflare) -> None:
+ response = await async_client.zones.settings.with_raw_response.edit(
+ "always_online",
+ zone_id="023e105f4ecef8ad9ca31a8372d0c353",
+ id="always_online",
+ value="on",
+ )
+
+ assert response.is_closed is True
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+ setting = await response.parse()
+ assert_matches_type(Optional[SettingEditResponse], setting, path=["response"])
+
+ @parametrize
+ async def test_streaming_response_edit_overload_3(self, async_client: AsyncCloudflare) -> None:
+ async with async_client.zones.settings.with_streaming_response.edit(
+ "always_online",
+ zone_id="023e105f4ecef8ad9ca31a8372d0c353",
+ id="always_online",
+ value="on",
+ ) as response:
+ assert not response.is_closed
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+
+ setting = await response.parse()
+ assert_matches_type(Optional[SettingEditResponse], setting, path=["response"])
+
+ assert cast(Any, response.is_closed) is True
+
+ @parametrize
+ async def test_path_params_edit_overload_3(self, async_client: AsyncCloudflare) -> None:
+ with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"):
+ await async_client.zones.settings.with_raw_response.edit(
+ "always_online",
+ zone_id="",
+ id="always_online",
+ value="on",
+ )
+
+ with pytest.raises(ValueError, match=r"Expected a non-empty value for `setting_id` but received ''"):
+ await async_client.zones.settings.with_raw_response.edit(
+ "",
+ zone_id="023e105f4ecef8ad9ca31a8372d0c353",
+ id="always_online",
+ value="on",
+ )
+
+ @parametrize
+ async def test_method_edit_overload_4(self, async_client: AsyncCloudflare) -> None:
+ setting = await async_client.zones.settings.edit(
+ "always_online",
+ zone_id="023e105f4ecef8ad9ca31a8372d0c353",
+ id="always_use_https",
+ value="on",
+ )
+ assert_matches_type(Optional[SettingEditResponse], setting, path=["response"])
+
+ @parametrize
+ async def test_raw_response_edit_overload_4(self, async_client: AsyncCloudflare) -> None:
+ response = await async_client.zones.settings.with_raw_response.edit(
+ "always_online",
+ zone_id="023e105f4ecef8ad9ca31a8372d0c353",
+ id="always_use_https",
+ value="on",
+ )
+
+ assert response.is_closed is True
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+ setting = await response.parse()
+ assert_matches_type(Optional[SettingEditResponse], setting, path=["response"])
+
+ @parametrize
+ async def test_streaming_response_edit_overload_4(self, async_client: AsyncCloudflare) -> None:
+ async with async_client.zones.settings.with_streaming_response.edit(
+ "always_online",
+ zone_id="023e105f4ecef8ad9ca31a8372d0c353",
+ id="always_use_https",
+ value="on",
+ ) as response:
+ assert not response.is_closed
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+
+ setting = await response.parse()
+ assert_matches_type(Optional[SettingEditResponse], setting, path=["response"])
+
+ assert cast(Any, response.is_closed) is True
+
+ @parametrize
+ async def test_path_params_edit_overload_4(self, async_client: AsyncCloudflare) -> None:
+ with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"):
+ await async_client.zones.settings.with_raw_response.edit(
+ "always_online",
+ zone_id="",
+ id="always_use_https",
+ value="on",
+ )
+
+ with pytest.raises(ValueError, match=r"Expected a non-empty value for `setting_id` but received ''"):
+ await async_client.zones.settings.with_raw_response.edit(
+ "",
+ zone_id="023e105f4ecef8ad9ca31a8372d0c353",
+ id="always_use_https",
+ value="on",
+ )
+
+ @parametrize
+ async def test_method_edit_overload_5(self, async_client: AsyncCloudflare) -> None:
+ setting = await async_client.zones.settings.edit(
+ "always_online",
+ zone_id="023e105f4ecef8ad9ca31a8372d0c353",
+ id="automatic_https_rewrites",
+ value="on",
+ )
+ assert_matches_type(Optional[SettingEditResponse], setting, path=["response"])
+
+ @parametrize
+ async def test_raw_response_edit_overload_5(self, async_client: AsyncCloudflare) -> None:
+ response = await async_client.zones.settings.with_raw_response.edit(
+ "always_online",
+ zone_id="023e105f4ecef8ad9ca31a8372d0c353",
+ id="automatic_https_rewrites",
+ value="on",
+ )
+
+ assert response.is_closed is True
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+ setting = await response.parse()
+ assert_matches_type(Optional[SettingEditResponse], setting, path=["response"])
+
+ @parametrize
+ async def test_streaming_response_edit_overload_5(self, async_client: AsyncCloudflare) -> None:
+ async with async_client.zones.settings.with_streaming_response.edit(
+ "always_online",
+ zone_id="023e105f4ecef8ad9ca31a8372d0c353",
+ id="automatic_https_rewrites",
+ value="on",
+ ) as response:
+ assert not response.is_closed
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+
+ setting = await response.parse()
+ assert_matches_type(Optional[SettingEditResponse], setting, path=["response"])
+
+ assert cast(Any, response.is_closed) is True
+
+ @parametrize
+ async def test_path_params_edit_overload_5(self, async_client: AsyncCloudflare) -> None:
+ with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"):
+ await async_client.zones.settings.with_raw_response.edit(
+ "always_online",
+ zone_id="",
+ id="automatic_https_rewrites",
+ value="on",
+ )
+
+ with pytest.raises(ValueError, match=r"Expected a non-empty value for `setting_id` but received ''"):
+ await async_client.zones.settings.with_raw_response.edit(
+ "",
+ zone_id="023e105f4ecef8ad9ca31a8372d0c353",
+ id="automatic_https_rewrites",
+ value="on",
+ )
+
+ @parametrize
+ async def test_method_edit_overload_6(self, async_client: AsyncCloudflare) -> None:
+ setting = await async_client.zones.settings.edit(
+ "always_online",
+ zone_id="023e105f4ecef8ad9ca31a8372d0c353",
+ id="brotli",
+ value="on",
+ )
+ assert_matches_type(Optional[SettingEditResponse], setting, path=["response"])
+
+ @parametrize
+ async def test_raw_response_edit_overload_6(self, async_client: AsyncCloudflare) -> None:
+ response = await async_client.zones.settings.with_raw_response.edit(
+ "always_online",
+ zone_id="023e105f4ecef8ad9ca31a8372d0c353",
+ id="brotli",
+ value="on",
+ )
+
+ assert response.is_closed is True
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+ setting = await response.parse()
+ assert_matches_type(Optional[SettingEditResponse], setting, path=["response"])
+
+ @parametrize
+ async def test_streaming_response_edit_overload_6(self, async_client: AsyncCloudflare) -> None:
+ async with async_client.zones.settings.with_streaming_response.edit(
+ "always_online",
+ zone_id="023e105f4ecef8ad9ca31a8372d0c353",
+ id="brotli",
+ value="on",
+ ) as response:
+ assert not response.is_closed
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+
+ setting = await response.parse()
+ assert_matches_type(Optional[SettingEditResponse], setting, path=["response"])
+
+ assert cast(Any, response.is_closed) is True
+
+ @parametrize
+ async def test_path_params_edit_overload_6(self, async_client: AsyncCloudflare) -> None:
+ with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"):
+ await async_client.zones.settings.with_raw_response.edit(
+ "always_online",
+ zone_id="",
+ id="brotli",
+ value="on",
+ )
+
+ with pytest.raises(ValueError, match=r"Expected a non-empty value for `setting_id` but received ''"):
+ await async_client.zones.settings.with_raw_response.edit(
+ "",
+ zone_id="023e105f4ecef8ad9ca31a8372d0c353",
+ id="brotli",
+ value="on",
+ )
+
+ @parametrize
+ async def test_method_edit_overload_7(self, async_client: AsyncCloudflare) -> None:
+ setting = await async_client.zones.settings.edit(
+ "always_online",
+ zone_id="023e105f4ecef8ad9ca31a8372d0c353",
+ id="browser_cache_ttl",
+ value=0,
+ )
+ assert_matches_type(Optional[SettingEditResponse], setting, path=["response"])
+
+ @parametrize
+ async def test_raw_response_edit_overload_7(self, async_client: AsyncCloudflare) -> None:
+ response = await async_client.zones.settings.with_raw_response.edit(
+ "always_online",
+ zone_id="023e105f4ecef8ad9ca31a8372d0c353",
+ id="browser_cache_ttl",
+ value=0,
+ )
+
+ assert response.is_closed is True
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+ setting = await response.parse()
+ assert_matches_type(Optional[SettingEditResponse], setting, path=["response"])
+
+ @parametrize
+ async def test_streaming_response_edit_overload_7(self, async_client: AsyncCloudflare) -> None:
+ async with async_client.zones.settings.with_streaming_response.edit(
+ "always_online",
+ zone_id="023e105f4ecef8ad9ca31a8372d0c353",
+ id="browser_cache_ttl",
+ value=0,
+ ) as response:
+ assert not response.is_closed
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+
+ setting = await response.parse()
+ assert_matches_type(Optional[SettingEditResponse], setting, path=["response"])
+
+ assert cast(Any, response.is_closed) is True
+
+ @parametrize
+ async def test_path_params_edit_overload_7(self, async_client: AsyncCloudflare) -> None:
+ with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"):
+ await async_client.zones.settings.with_raw_response.edit(
+ "always_online",
+ zone_id="",
+ id="browser_cache_ttl",
+ value=0,
+ )
+
+ with pytest.raises(ValueError, match=r"Expected a non-empty value for `setting_id` but received ''"):
+ await async_client.zones.settings.with_raw_response.edit(
+ "",
+ zone_id="023e105f4ecef8ad9ca31a8372d0c353",
+ id="browser_cache_ttl",
+ value=0,
+ )
+
+ @parametrize
+ async def test_method_edit_overload_8(self, async_client: AsyncCloudflare) -> None:
+ setting = await async_client.zones.settings.edit(
+ "always_online",
+ zone_id="023e105f4ecef8ad9ca31a8372d0c353",
+ id="browser_check",
+ value="on",
+ )
+ assert_matches_type(Optional[SettingEditResponse], setting, path=["response"])
+
+ @parametrize
+ async def test_raw_response_edit_overload_8(self, async_client: AsyncCloudflare) -> None:
+ response = await async_client.zones.settings.with_raw_response.edit(
+ "always_online",
+ zone_id="023e105f4ecef8ad9ca31a8372d0c353",
+ id="browser_check",
+ value="on",
+ )
+
+ assert response.is_closed is True
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+ setting = await response.parse()
+ assert_matches_type(Optional[SettingEditResponse], setting, path=["response"])
+
+ @parametrize
+ async def test_streaming_response_edit_overload_8(self, async_client: AsyncCloudflare) -> None:
+ async with async_client.zones.settings.with_streaming_response.edit(
+ "always_online",
+ zone_id="023e105f4ecef8ad9ca31a8372d0c353",
+ id="browser_check",
+ value="on",
+ ) as response:
+ assert not response.is_closed
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+
+ setting = await response.parse()
+ assert_matches_type(Optional[SettingEditResponse], setting, path=["response"])
+
+ assert cast(Any, response.is_closed) is True
+
+ @parametrize
+ async def test_path_params_edit_overload_8(self, async_client: AsyncCloudflare) -> None:
+ with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"):
+ await async_client.zones.settings.with_raw_response.edit(
+ "always_online",
+ zone_id="",
+ id="browser_check",
+ value="on",
+ )
+
+ with pytest.raises(ValueError, match=r"Expected a non-empty value for `setting_id` but received ''"):
+ await async_client.zones.settings.with_raw_response.edit(
+ "",
+ zone_id="023e105f4ecef8ad9ca31a8372d0c353",
+ id="browser_check",
+ value="on",
+ )
+
+ @parametrize
+ async def test_method_edit_overload_9(self, async_client: AsyncCloudflare) -> None:
+ setting = await async_client.zones.settings.edit(
+ "always_online",
+ zone_id="023e105f4ecef8ad9ca31a8372d0c353",
+ id="cache_level",
+ value="aggressive",
+ )
+ assert_matches_type(Optional[SettingEditResponse], setting, path=["response"])
+
+ @parametrize
+ async def test_raw_response_edit_overload_9(self, async_client: AsyncCloudflare) -> None:
+ response = await async_client.zones.settings.with_raw_response.edit(
+ "always_online",
+ zone_id="023e105f4ecef8ad9ca31a8372d0c353",
+ id="cache_level",
+ value="aggressive",
+ )
+
+ assert response.is_closed is True
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+ setting = await response.parse()
+ assert_matches_type(Optional[SettingEditResponse], setting, path=["response"])
+
+ @parametrize
+ async def test_streaming_response_edit_overload_9(self, async_client: AsyncCloudflare) -> None:
+ async with async_client.zones.settings.with_streaming_response.edit(
+ "always_online",
+ zone_id="023e105f4ecef8ad9ca31a8372d0c353",
+ id="cache_level",
+ value="aggressive",
+ ) as response:
+ assert not response.is_closed
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+
+ setting = await response.parse()
+ assert_matches_type(Optional[SettingEditResponse], setting, path=["response"])
+
+ assert cast(Any, response.is_closed) is True
+
+ @parametrize
+ async def test_path_params_edit_overload_9(self, async_client: AsyncCloudflare) -> None:
+ with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"):
+ await async_client.zones.settings.with_raw_response.edit(
+ "always_online",
+ zone_id="",
+ id="cache_level",
+ value="aggressive",
+ )
+
+ with pytest.raises(ValueError, match=r"Expected a non-empty value for `setting_id` but received ''"):
+ await async_client.zones.settings.with_raw_response.edit(
+ "",
+ zone_id="023e105f4ecef8ad9ca31a8372d0c353",
+ id="cache_level",
+ value="aggressive",
+ )
+
+ @parametrize
+ async def test_method_edit_overload_10(self, async_client: AsyncCloudflare) -> None:
+ setting = await async_client.zones.settings.edit(
+ "always_online",
+ zone_id="023e105f4ecef8ad9ca31a8372d0c353",
+ id="challenge_ttl",
+ value=300,
+ )
+ assert_matches_type(Optional[SettingEditResponse], setting, path=["response"])
+
+ @parametrize
+ async def test_raw_response_edit_overload_10(self, async_client: AsyncCloudflare) -> None:
+ response = await async_client.zones.settings.with_raw_response.edit(
+ "always_online",
+ zone_id="023e105f4ecef8ad9ca31a8372d0c353",
+ id="challenge_ttl",
+ value=300,
+ )
+
+ assert response.is_closed is True
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+ setting = await response.parse()
+ assert_matches_type(Optional[SettingEditResponse], setting, path=["response"])
+
+ @parametrize
+ async def test_streaming_response_edit_overload_10(self, async_client: AsyncCloudflare) -> None:
+ async with async_client.zones.settings.with_streaming_response.edit(
+ "always_online",
+ zone_id="023e105f4ecef8ad9ca31a8372d0c353",
+ id="challenge_ttl",
+ value=300,
+ ) as response:
+ assert not response.is_closed
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+
+ setting = await response.parse()
+ assert_matches_type(Optional[SettingEditResponse], setting, path=["response"])
+
+ assert cast(Any, response.is_closed) is True
+
+ @parametrize
+ async def test_path_params_edit_overload_10(self, async_client: AsyncCloudflare) -> None:
+ with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"):
+ await async_client.zones.settings.with_raw_response.edit(
+ "always_online",
+ zone_id="",
+ id="challenge_ttl",
+ value=300,
+ )
+
+ with pytest.raises(ValueError, match=r"Expected a non-empty value for `setting_id` but received ''"):
+ await async_client.zones.settings.with_raw_response.edit(
+ "",
+ zone_id="023e105f4ecef8ad9ca31a8372d0c353",
+ id="challenge_ttl",
+ value=300,
+ )
+
+ @parametrize
+ async def test_method_edit_overload_11(self, async_client: AsyncCloudflare) -> None:
+ setting = await async_client.zones.settings.edit(
+ "always_online",
+ zone_id="023e105f4ecef8ad9ca31a8372d0c353",
+ id="ciphers",
+ value=["ECDHE-RSA-AES128-GCM-SHA256", "AES128-SHA"],
+ )
+ assert_matches_type(Optional[SettingEditResponse], setting, path=["response"])
+
+ @parametrize
+ async def test_raw_response_edit_overload_11(self, async_client: AsyncCloudflare) -> None:
+ response = await async_client.zones.settings.with_raw_response.edit(
+ "always_online",
+ zone_id="023e105f4ecef8ad9ca31a8372d0c353",
+ id="ciphers",
+ value=["ECDHE-RSA-AES128-GCM-SHA256", "AES128-SHA"],
+ )
+
+ assert response.is_closed is True
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+ setting = await response.parse()
+ assert_matches_type(Optional[SettingEditResponse], setting, path=["response"])
+
+ @parametrize
+ async def test_streaming_response_edit_overload_11(self, async_client: AsyncCloudflare) -> None:
+ async with async_client.zones.settings.with_streaming_response.edit(
+ "always_online",
+ zone_id="023e105f4ecef8ad9ca31a8372d0c353",
+ id="ciphers",
+ value=["ECDHE-RSA-AES128-GCM-SHA256", "AES128-SHA"],
+ ) as response:
+ assert not response.is_closed
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+
+ setting = await response.parse()
+ assert_matches_type(Optional[SettingEditResponse], setting, path=["response"])
+
+ assert cast(Any, response.is_closed) is True
+
+ @parametrize
+ async def test_path_params_edit_overload_11(self, async_client: AsyncCloudflare) -> None:
+ with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"):
+ await async_client.zones.settings.with_raw_response.edit(
+ "always_online",
+ zone_id="",
+ id="ciphers",
+ value=["ECDHE-RSA-AES128-GCM-SHA256", "AES128-SHA"],
+ )
+
+ with pytest.raises(ValueError, match=r"Expected a non-empty value for `setting_id` but received ''"):
+ await async_client.zones.settings.with_raw_response.edit(
+ "",
+ zone_id="023e105f4ecef8ad9ca31a8372d0c353",
+ id="ciphers",
+ value=["ECDHE-RSA-AES128-GCM-SHA256", "AES128-SHA"],
+ )
+
+ @parametrize
+ async def test_method_edit_overload_12(self, async_client: AsyncCloudflare) -> None:
+ setting = await async_client.zones.settings.edit(
+ "always_online",
+ zone_id="023e105f4ecef8ad9ca31a8372d0c353",
+ id="cname_flattening",
+ value="flatten_at_root",
+ )
+ assert_matches_type(Optional[SettingEditResponse], setting, path=["response"])
+
+ @parametrize
+ async def test_raw_response_edit_overload_12(self, async_client: AsyncCloudflare) -> None:
+ response = await async_client.zones.settings.with_raw_response.edit(
+ "always_online",
+ zone_id="023e105f4ecef8ad9ca31a8372d0c353",
+ id="cname_flattening",
+ value="flatten_at_root",
+ )
+
+ assert response.is_closed is True
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+ setting = await response.parse()
+ assert_matches_type(Optional[SettingEditResponse], setting, path=["response"])
+
+ @parametrize
+ async def test_streaming_response_edit_overload_12(self, async_client: AsyncCloudflare) -> None:
+ async with async_client.zones.settings.with_streaming_response.edit(
+ "always_online",
+ zone_id="023e105f4ecef8ad9ca31a8372d0c353",
+ id="cname_flattening",
+ value="flatten_at_root",
+ ) as response:
+ assert not response.is_closed
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+
+ setting = await response.parse()
+ assert_matches_type(Optional[SettingEditResponse], setting, path=["response"])
+
+ assert cast(Any, response.is_closed) is True
+
+ @parametrize
+ async def test_path_params_edit_overload_12(self, async_client: AsyncCloudflare) -> None:
+ with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"):
+ await async_client.zones.settings.with_raw_response.edit(
+ "always_online",
+ zone_id="",
+ id="cname_flattening",
+ value="flatten_at_root",
+ )
+
+ with pytest.raises(ValueError, match=r"Expected a non-empty value for `setting_id` but received ''"):
+ await async_client.zones.settings.with_raw_response.edit(
+ "",
+ zone_id="023e105f4ecef8ad9ca31a8372d0c353",
+ id="cname_flattening",
+ value="flatten_at_root",
+ )
+
+ @parametrize
+ async def test_method_edit_overload_13(self, async_client: AsyncCloudflare) -> None:
+ setting = await async_client.zones.settings.edit(
+ "always_online",
+ zone_id="023e105f4ecef8ad9ca31a8372d0c353",
+ id="development_mode",
+ value="on",
+ )
+ assert_matches_type(Optional[SettingEditResponse], setting, path=["response"])
+
+ @parametrize
+ async def test_raw_response_edit_overload_13(self, async_client: AsyncCloudflare) -> None:
+ response = await async_client.zones.settings.with_raw_response.edit(
+ "always_online",
+ zone_id="023e105f4ecef8ad9ca31a8372d0c353",
+ id="development_mode",
+ value="on",
+ )
+
+ assert response.is_closed is True
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+ setting = await response.parse()
+ assert_matches_type(Optional[SettingEditResponse], setting, path=["response"])
+
+ @parametrize
+ async def test_streaming_response_edit_overload_13(self, async_client: AsyncCloudflare) -> None:
+ async with async_client.zones.settings.with_streaming_response.edit(
+ "always_online",
+ zone_id="023e105f4ecef8ad9ca31a8372d0c353",
+ id="development_mode",
+ value="on",
+ ) as response:
+ assert not response.is_closed
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+
+ setting = await response.parse()
+ assert_matches_type(Optional[SettingEditResponse], setting, path=["response"])
+
+ assert cast(Any, response.is_closed) is True
+
+ @parametrize
+ async def test_path_params_edit_overload_13(self, async_client: AsyncCloudflare) -> None:
+ with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"):
+ await async_client.zones.settings.with_raw_response.edit(
+ "always_online",
+ zone_id="",
+ id="development_mode",
+ value="on",
+ )
+
+ with pytest.raises(ValueError, match=r"Expected a non-empty value for `setting_id` but received ''"):
+ await async_client.zones.settings.with_raw_response.edit(
+ "",
+ zone_id="023e105f4ecef8ad9ca31a8372d0c353",
+ id="development_mode",
+ value="on",
+ )
+
+ @parametrize
+ async def test_method_edit_overload_14(self, async_client: AsyncCloudflare) -> None:
+ setting = await async_client.zones.settings.edit(
+ "always_online",
+ zone_id="023e105f4ecef8ad9ca31a8372d0c353",
+ id="early_hints",
+ value="on",
+ )
+ assert_matches_type(Optional[SettingEditResponse], setting, path=["response"])
+
+ @parametrize
+ async def test_raw_response_edit_overload_14(self, async_client: AsyncCloudflare) -> None:
+ response = await async_client.zones.settings.with_raw_response.edit(
+ "always_online",
+ zone_id="023e105f4ecef8ad9ca31a8372d0c353",
+ id="early_hints",
+ value="on",
+ )
+
+ assert response.is_closed is True
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+ setting = await response.parse()
+ assert_matches_type(Optional[SettingEditResponse], setting, path=["response"])
+
+ @parametrize
+ async def test_streaming_response_edit_overload_14(self, async_client: AsyncCloudflare) -> None:
+ async with async_client.zones.settings.with_streaming_response.edit(
+ "always_online",
+ zone_id="023e105f4ecef8ad9ca31a8372d0c353",
+ id="early_hints",
+ value="on",
+ ) as response:
+ assert not response.is_closed
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+
+ setting = await response.parse()
+ assert_matches_type(Optional[SettingEditResponse], setting, path=["response"])
+
+ assert cast(Any, response.is_closed) is True
+
+ @parametrize
+ async def test_path_params_edit_overload_14(self, async_client: AsyncCloudflare) -> None:
+ with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"):
+ await async_client.zones.settings.with_raw_response.edit(
+ "always_online",
+ zone_id="",
+ id="early_hints",
+ value="on",
+ )
+
+ with pytest.raises(ValueError, match=r"Expected a non-empty value for `setting_id` but received ''"):
+ await async_client.zones.settings.with_raw_response.edit(
+ "",
+ zone_id="023e105f4ecef8ad9ca31a8372d0c353",
+ id="early_hints",
+ value="on",
+ )
+
+ @parametrize
+ async def test_method_edit_overload_15(self, async_client: AsyncCloudflare) -> None:
+ setting = await async_client.zones.settings.edit(
+ "always_online",
+ zone_id="023e105f4ecef8ad9ca31a8372d0c353",
+ id="edge_cache_ttl",
+ value=30,
+ )
+ assert_matches_type(Optional[SettingEditResponse], setting, path=["response"])
+
+ @parametrize
+ async def test_raw_response_edit_overload_15(self, async_client: AsyncCloudflare) -> None:
+ response = await async_client.zones.settings.with_raw_response.edit(
+ "always_online",
+ zone_id="023e105f4ecef8ad9ca31a8372d0c353",
+ id="edge_cache_ttl",
+ value=30,
+ )
+
+ assert response.is_closed is True
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+ setting = await response.parse()
+ assert_matches_type(Optional[SettingEditResponse], setting, path=["response"])
+
+ @parametrize
+ async def test_streaming_response_edit_overload_15(self, async_client: AsyncCloudflare) -> None:
+ async with async_client.zones.settings.with_streaming_response.edit(
+ "always_online",
+ zone_id="023e105f4ecef8ad9ca31a8372d0c353",
+ id="edge_cache_ttl",
+ value=30,
+ ) as response:
+ assert not response.is_closed
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+
+ setting = await response.parse()
+ assert_matches_type(Optional[SettingEditResponse], setting, path=["response"])
+
+ assert cast(Any, response.is_closed) is True
+
+ @parametrize
+ async def test_path_params_edit_overload_15(self, async_client: AsyncCloudflare) -> None:
+ with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"):
+ await async_client.zones.settings.with_raw_response.edit(
+ "always_online",
+ zone_id="",
+ id="edge_cache_ttl",
+ value=30,
+ )
+
+ with pytest.raises(ValueError, match=r"Expected a non-empty value for `setting_id` but received ''"):
+ await async_client.zones.settings.with_raw_response.edit(
+ "",
+ zone_id="023e105f4ecef8ad9ca31a8372d0c353",
+ id="edge_cache_ttl",
+ value=30,
+ )
+
+ @parametrize
+ async def test_method_edit_overload_16(self, async_client: AsyncCloudflare) -> None:
+ setting = await async_client.zones.settings.edit(
+ "always_online",
+ zone_id="023e105f4ecef8ad9ca31a8372d0c353",
+ id="email_obfuscation",
+ value="on",
+ )
+ assert_matches_type(Optional[SettingEditResponse], setting, path=["response"])
+
+ @parametrize
+ async def test_raw_response_edit_overload_16(self, async_client: AsyncCloudflare) -> None:
+ response = await async_client.zones.settings.with_raw_response.edit(
+ "always_online",
+ zone_id="023e105f4ecef8ad9ca31a8372d0c353",
+ id="email_obfuscation",
+ value="on",
+ )
+
+ assert response.is_closed is True
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+ setting = await response.parse()
+ assert_matches_type(Optional[SettingEditResponse], setting, path=["response"])
+
+ @parametrize
+ async def test_streaming_response_edit_overload_16(self, async_client: AsyncCloudflare) -> None:
+ async with async_client.zones.settings.with_streaming_response.edit(
+ "always_online",
+ zone_id="023e105f4ecef8ad9ca31a8372d0c353",
+ id="email_obfuscation",
+ value="on",
+ ) as response:
+ assert not response.is_closed
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+
+ setting = await response.parse()
+ assert_matches_type(Optional[SettingEditResponse], setting, path=["response"])
+
+ assert cast(Any, response.is_closed) is True
+
+ @parametrize
+ async def test_path_params_edit_overload_16(self, async_client: AsyncCloudflare) -> None:
+ with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"):
+ await async_client.zones.settings.with_raw_response.edit(
+ "always_online",
+ zone_id="",
+ id="email_obfuscation",
+ value="on",
+ )
+
+ with pytest.raises(ValueError, match=r"Expected a non-empty value for `setting_id` but received ''"):
+ await async_client.zones.settings.with_raw_response.edit(
+ "",
+ zone_id="023e105f4ecef8ad9ca31a8372d0c353",
+ id="email_obfuscation",
+ value="on",
+ )
+
+ @parametrize
+ async def test_method_edit_overload_17(self, async_client: AsyncCloudflare) -> None:
+ setting = await async_client.zones.settings.edit(
+ "always_online",
+ zone_id="023e105f4ecef8ad9ca31a8372d0c353",
+ id="h2_prioritization",
+ value="on",
+ )
+ assert_matches_type(Optional[SettingEditResponse], setting, path=["response"])
+
+ @parametrize
+ async def test_raw_response_edit_overload_17(self, async_client: AsyncCloudflare) -> None:
+ response = await async_client.zones.settings.with_raw_response.edit(
+ "always_online",
+ zone_id="023e105f4ecef8ad9ca31a8372d0c353",
+ id="h2_prioritization",
+ value="on",
+ )
+
+ assert response.is_closed is True
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+ setting = await response.parse()
+ assert_matches_type(Optional[SettingEditResponse], setting, path=["response"])
+
+ @parametrize
+ async def test_streaming_response_edit_overload_17(self, async_client: AsyncCloudflare) -> None:
+ async with async_client.zones.settings.with_streaming_response.edit(
+ "always_online",
+ zone_id="023e105f4ecef8ad9ca31a8372d0c353",
+ id="h2_prioritization",
+ value="on",
+ ) as response:
+ assert not response.is_closed
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+
+ setting = await response.parse()
+ assert_matches_type(Optional[SettingEditResponse], setting, path=["response"])
+
+ assert cast(Any, response.is_closed) is True
+
+ @parametrize
+ async def test_path_params_edit_overload_17(self, async_client: AsyncCloudflare) -> None:
+ with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"):
+ await async_client.zones.settings.with_raw_response.edit(
+ "always_online",
+ zone_id="",
+ id="h2_prioritization",
+ value="on",
+ )
+
+ with pytest.raises(ValueError, match=r"Expected a non-empty value for `setting_id` but received ''"):
+ await async_client.zones.settings.with_raw_response.edit(
+ "",
+ zone_id="023e105f4ecef8ad9ca31a8372d0c353",
+ id="h2_prioritization",
+ value="on",
+ )
+
+ @parametrize
+ async def test_method_edit_overload_18(self, async_client: AsyncCloudflare) -> None:
+ setting = await async_client.zones.settings.edit(
+ "always_online",
+ zone_id="023e105f4ecef8ad9ca31a8372d0c353",
+ id="hotlink_protection",
+ value="on",
+ )
+ assert_matches_type(Optional[SettingEditResponse], setting, path=["response"])
+
+ @parametrize
+ async def test_raw_response_edit_overload_18(self, async_client: AsyncCloudflare) -> None:
+ response = await async_client.zones.settings.with_raw_response.edit(
+ "always_online",
+ zone_id="023e105f4ecef8ad9ca31a8372d0c353",
+ id="hotlink_protection",
+ value="on",
+ )
+
+ assert response.is_closed is True
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+ setting = await response.parse()
+ assert_matches_type(Optional[SettingEditResponse], setting, path=["response"])
+
+ @parametrize
+ async def test_streaming_response_edit_overload_18(self, async_client: AsyncCloudflare) -> None:
+ async with async_client.zones.settings.with_streaming_response.edit(
+ "always_online",
+ zone_id="023e105f4ecef8ad9ca31a8372d0c353",
+ id="hotlink_protection",
+ value="on",
+ ) as response:
+ assert not response.is_closed
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+
+ setting = await response.parse()
+ assert_matches_type(Optional[SettingEditResponse], setting, path=["response"])
+
+ assert cast(Any, response.is_closed) is True
+
+ @parametrize
+ async def test_path_params_edit_overload_18(self, async_client: AsyncCloudflare) -> None:
+ with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"):
+ await async_client.zones.settings.with_raw_response.edit(
+ "always_online",
+ zone_id="",
+ id="hotlink_protection",
+ value="on",
+ )
+
+ with pytest.raises(ValueError, match=r"Expected a non-empty value for `setting_id` but received ''"):
+ await async_client.zones.settings.with_raw_response.edit(
+ "",
+ zone_id="023e105f4ecef8ad9ca31a8372d0c353",
+ id="hotlink_protection",
+ value="on",
+ )
+
+ @parametrize
+ async def test_method_edit_overload_19(self, async_client: AsyncCloudflare) -> None:
+ setting = await async_client.zones.settings.edit(
+ "always_online",
+ zone_id="023e105f4ecef8ad9ca31a8372d0c353",
+ id="http2",
+ value="on",
+ )
+ assert_matches_type(Optional[SettingEditResponse], setting, path=["response"])
+
+ @parametrize
+ async def test_raw_response_edit_overload_19(self, async_client: AsyncCloudflare) -> None:
+ response = await async_client.zones.settings.with_raw_response.edit(
+ "always_online",
+ zone_id="023e105f4ecef8ad9ca31a8372d0c353",
+ id="http2",
+ value="on",
+ )
+
+ assert response.is_closed is True
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+ setting = await response.parse()
+ assert_matches_type(Optional[SettingEditResponse], setting, path=["response"])
+
+ @parametrize
+ async def test_streaming_response_edit_overload_19(self, async_client: AsyncCloudflare) -> None:
+ async with async_client.zones.settings.with_streaming_response.edit(
+ "always_online",
+ zone_id="023e105f4ecef8ad9ca31a8372d0c353",
+ id="http2",
+ value="on",
+ ) as response:
+ assert not response.is_closed
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+
+ setting = await response.parse()
+ assert_matches_type(Optional[SettingEditResponse], setting, path=["response"])
+
+ assert cast(Any, response.is_closed) is True
+
+ @parametrize
+ async def test_path_params_edit_overload_19(self, async_client: AsyncCloudflare) -> None:
+ with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"):
+ await async_client.zones.settings.with_raw_response.edit(
+ "always_online",
+ zone_id="",
+ id="http2",
+ value="on",
+ )
+
+ with pytest.raises(ValueError, match=r"Expected a non-empty value for `setting_id` but received ''"):
+ await async_client.zones.settings.with_raw_response.edit(
+ "",
+ zone_id="023e105f4ecef8ad9ca31a8372d0c353",
+ id="http2",
+ value="on",
+ )
+
+ @parametrize
+ async def test_method_edit_overload_20(self, async_client: AsyncCloudflare) -> None:
+ setting = await async_client.zones.settings.edit(
+ "always_online",
+ zone_id="023e105f4ecef8ad9ca31a8372d0c353",
+ id="http3",
+ value="on",
+ )
+ assert_matches_type(Optional[SettingEditResponse], setting, path=["response"])
+
+ @parametrize
+ async def test_raw_response_edit_overload_20(self, async_client: AsyncCloudflare) -> None:
+ response = await async_client.zones.settings.with_raw_response.edit(
+ "always_online",
+ zone_id="023e105f4ecef8ad9ca31a8372d0c353",
+ id="http3",
+ value="on",
+ )
+
+ assert response.is_closed is True
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+ setting = await response.parse()
+ assert_matches_type(Optional[SettingEditResponse], setting, path=["response"])
+
+ @parametrize
+ async def test_streaming_response_edit_overload_20(self, async_client: AsyncCloudflare) -> None:
+ async with async_client.zones.settings.with_streaming_response.edit(
+ "always_online",
+ zone_id="023e105f4ecef8ad9ca31a8372d0c353",
+ id="http3",
+ value="on",
+ ) as response:
+ assert not response.is_closed
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+
+ setting = await response.parse()
+ assert_matches_type(Optional[SettingEditResponse], setting, path=["response"])
+
+ assert cast(Any, response.is_closed) is True
+
+ @parametrize
+ async def test_path_params_edit_overload_20(self, async_client: AsyncCloudflare) -> None:
+ with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"):
+ await async_client.zones.settings.with_raw_response.edit(
+ "always_online",
+ zone_id="",
+ id="http3",
+ value="on",
+ )
+
+ with pytest.raises(ValueError, match=r"Expected a non-empty value for `setting_id` but received ''"):
+ await async_client.zones.settings.with_raw_response.edit(
+ "",
+ zone_id="023e105f4ecef8ad9ca31a8372d0c353",
+ id="http3",
+ value="on",
+ )
+
+ @parametrize
+ async def test_method_edit_overload_21(self, async_client: AsyncCloudflare) -> None:
+ setting = await async_client.zones.settings.edit(
+ "always_online",
+ zone_id="023e105f4ecef8ad9ca31a8372d0c353",
+ id="image_resizing",
+ value="on",
+ )
+ assert_matches_type(Optional[SettingEditResponse], setting, path=["response"])
+
+ @parametrize
+ async def test_raw_response_edit_overload_21(self, async_client: AsyncCloudflare) -> None:
+ response = await async_client.zones.settings.with_raw_response.edit(
+ "always_online",
+ zone_id="023e105f4ecef8ad9ca31a8372d0c353",
+ id="image_resizing",
+ value="on",
+ )
+
+ assert response.is_closed is True
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+ setting = await response.parse()
+ assert_matches_type(Optional[SettingEditResponse], setting, path=["response"])
+
+ @parametrize
+ async def test_streaming_response_edit_overload_21(self, async_client: AsyncCloudflare) -> None:
+ async with async_client.zones.settings.with_streaming_response.edit(
+ "always_online",
+ zone_id="023e105f4ecef8ad9ca31a8372d0c353",
+ id="image_resizing",
+ value="on",
+ ) as response:
+ assert not response.is_closed
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+
+ setting = await response.parse()
+ assert_matches_type(Optional[SettingEditResponse], setting, path=["response"])
+
+ assert cast(Any, response.is_closed) is True
+
+ @parametrize
+ async def test_path_params_edit_overload_21(self, async_client: AsyncCloudflare) -> None:
+ with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"):
+ await async_client.zones.settings.with_raw_response.edit(
+ "always_online",
+ zone_id="",
+ id="image_resizing",
+ value="on",
+ )
+
+ with pytest.raises(ValueError, match=r"Expected a non-empty value for `setting_id` but received ''"):
+ await async_client.zones.settings.with_raw_response.edit(
+ "",
+ zone_id="023e105f4ecef8ad9ca31a8372d0c353",
+ id="image_resizing",
+ value="on",
+ )
+
+ @parametrize
+ async def test_method_edit_overload_22(self, async_client: AsyncCloudflare) -> None:
+ setting = await async_client.zones.settings.edit(
+ "always_online",
+ zone_id="023e105f4ecef8ad9ca31a8372d0c353",
+ id="ip_geolocation",
+ value="on",
+ )
+ assert_matches_type(Optional[SettingEditResponse], setting, path=["response"])
+
+ @parametrize
+ async def test_raw_response_edit_overload_22(self, async_client: AsyncCloudflare) -> None:
+ response = await async_client.zones.settings.with_raw_response.edit(
+ "always_online",
+ zone_id="023e105f4ecef8ad9ca31a8372d0c353",
+ id="ip_geolocation",
+ value="on",
+ )
+
+ assert response.is_closed is True
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+ setting = await response.parse()
+ assert_matches_type(Optional[SettingEditResponse], setting, path=["response"])
+
+ @parametrize
+ async def test_streaming_response_edit_overload_22(self, async_client: AsyncCloudflare) -> None:
+ async with async_client.zones.settings.with_streaming_response.edit(
+ "always_online",
+ zone_id="023e105f4ecef8ad9ca31a8372d0c353",
+ id="ip_geolocation",
+ value="on",
+ ) as response:
+ assert not response.is_closed
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+
+ setting = await response.parse()
+ assert_matches_type(Optional[SettingEditResponse], setting, path=["response"])
+
+ assert cast(Any, response.is_closed) is True
+
+ @parametrize
+ async def test_path_params_edit_overload_22(self, async_client: AsyncCloudflare) -> None:
+ with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"):
+ await async_client.zones.settings.with_raw_response.edit(
+ "always_online",
+ zone_id="",
+ id="ip_geolocation",
+ value="on",
+ )
+
+ with pytest.raises(ValueError, match=r"Expected a non-empty value for `setting_id` but received ''"):
+ await async_client.zones.settings.with_raw_response.edit(
+ "",
+ zone_id="023e105f4ecef8ad9ca31a8372d0c353",
+ id="ip_geolocation",
+ value="on",
+ )
+
+ @parametrize
+ async def test_method_edit_overload_23(self, async_client: AsyncCloudflare) -> None:
+ setting = await async_client.zones.settings.edit(
+ "always_online",
+ zone_id="023e105f4ecef8ad9ca31a8372d0c353",
+ id="ipv6",
+ value="on",
+ )
+ assert_matches_type(Optional[SettingEditResponse], setting, path=["response"])
+
+ @parametrize
+ async def test_raw_response_edit_overload_23(self, async_client: AsyncCloudflare) -> None:
+ response = await async_client.zones.settings.with_raw_response.edit(
+ "always_online",
+ zone_id="023e105f4ecef8ad9ca31a8372d0c353",
+ id="ipv6",
+ value="on",
+ )
+
+ assert response.is_closed is True
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+ setting = await response.parse()
+ assert_matches_type(Optional[SettingEditResponse], setting, path=["response"])
+
+ @parametrize
+ async def test_streaming_response_edit_overload_23(self, async_client: AsyncCloudflare) -> None:
+ async with async_client.zones.settings.with_streaming_response.edit(
+ "always_online",
+ zone_id="023e105f4ecef8ad9ca31a8372d0c353",
+ id="ipv6",
+ value="on",
+ ) as response:
+ assert not response.is_closed
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+
+ setting = await response.parse()
+ assert_matches_type(Optional[SettingEditResponse], setting, path=["response"])
+
+ assert cast(Any, response.is_closed) is True
+
+ @parametrize
+ async def test_path_params_edit_overload_23(self, async_client: AsyncCloudflare) -> None:
+ with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"):
+ await async_client.zones.settings.with_raw_response.edit(
+ "always_online",
+ zone_id="",
+ id="ipv6",
+ value="on",
+ )
+
+ with pytest.raises(ValueError, match=r"Expected a non-empty value for `setting_id` but received ''"):
+ await async_client.zones.settings.with_raw_response.edit(
+ "",
+ zone_id="023e105f4ecef8ad9ca31a8372d0c353",
+ id="ipv6",
+ value="on",
+ )
+
+ @parametrize
+ async def test_method_edit_overload_24(self, async_client: AsyncCloudflare) -> None:
+ setting = await async_client.zones.settings.edit(
+ "always_online",
+ zone_id="023e105f4ecef8ad9ca31a8372d0c353",
+ id="max_upload",
+ value=100,
+ )
+ assert_matches_type(Optional[SettingEditResponse], setting, path=["response"])
+
+ @parametrize
+ async def test_raw_response_edit_overload_24(self, async_client: AsyncCloudflare) -> None:
+ response = await async_client.zones.settings.with_raw_response.edit(
+ "always_online",
+ zone_id="023e105f4ecef8ad9ca31a8372d0c353",
+ id="max_upload",
+ value=100,
+ )
+
+ assert response.is_closed is True
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+ setting = await response.parse()
+ assert_matches_type(Optional[SettingEditResponse], setting, path=["response"])
+
+ @parametrize
+ async def test_streaming_response_edit_overload_24(self, async_client: AsyncCloudflare) -> None:
+ async with async_client.zones.settings.with_streaming_response.edit(
+ "always_online",
+ zone_id="023e105f4ecef8ad9ca31a8372d0c353",
+ id="max_upload",
+ value=100,
+ ) as response:
+ assert not response.is_closed
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+
+ setting = await response.parse()
+ assert_matches_type(Optional[SettingEditResponse], setting, path=["response"])
+
+ assert cast(Any, response.is_closed) is True
+
+ @parametrize
+ async def test_path_params_edit_overload_24(self, async_client: AsyncCloudflare) -> None:
+ with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"):
+ await async_client.zones.settings.with_raw_response.edit(
+ "always_online",
+ zone_id="",
+ id="max_upload",
+ value=100,
+ )
+
+ with pytest.raises(ValueError, match=r"Expected a non-empty value for `setting_id` but received ''"):
+ await async_client.zones.settings.with_raw_response.edit(
+ "",
+ zone_id="023e105f4ecef8ad9ca31a8372d0c353",
+ id="max_upload",
+ value=100,
+ )
+
+ @parametrize
+ async def test_method_edit_overload_25(self, async_client: AsyncCloudflare) -> None:
+ setting = await async_client.zones.settings.edit(
+ "always_online",
+ zone_id="023e105f4ecef8ad9ca31a8372d0c353",
+ id="min_tls_version",
+ value="1.0",
+ )
+ assert_matches_type(Optional[SettingEditResponse], setting, path=["response"])
+
+ @parametrize
+ async def test_raw_response_edit_overload_25(self, async_client: AsyncCloudflare) -> None:
+ response = await async_client.zones.settings.with_raw_response.edit(
+ "always_online",
+ zone_id="023e105f4ecef8ad9ca31a8372d0c353",
+ id="min_tls_version",
+ value="1.0",
+ )
+
+ assert response.is_closed is True
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+ setting = await response.parse()
+ assert_matches_type(Optional[SettingEditResponse], setting, path=["response"])
+
+ @parametrize
+ async def test_streaming_response_edit_overload_25(self, async_client: AsyncCloudflare) -> None:
+ async with async_client.zones.settings.with_streaming_response.edit(
+ "always_online",
+ zone_id="023e105f4ecef8ad9ca31a8372d0c353",
+ id="min_tls_version",
+ value="1.0",
+ ) as response:
+ assert not response.is_closed
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+
+ setting = await response.parse()
+ assert_matches_type(Optional[SettingEditResponse], setting, path=["response"])
+
+ assert cast(Any, response.is_closed) is True
+
+ @parametrize
+ async def test_path_params_edit_overload_25(self, async_client: AsyncCloudflare) -> None:
+ with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"):
+ await async_client.zones.settings.with_raw_response.edit(
+ "always_online",
+ zone_id="",
+ id="min_tls_version",
+ value="1.0",
+ )
+
+ with pytest.raises(ValueError, match=r"Expected a non-empty value for `setting_id` but received ''"):
+ await async_client.zones.settings.with_raw_response.edit(
+ "",
+ zone_id="023e105f4ecef8ad9ca31a8372d0c353",
+ id="min_tls_version",
+ value="1.0",
+ )
+
+ @parametrize
+ async def test_method_edit_overload_26(self, async_client: AsyncCloudflare) -> None:
+ setting = await async_client.zones.settings.edit(
+ "always_online",
+ zone_id="023e105f4ecef8ad9ca31a8372d0c353",
+ id="minify",
+ value={},
+ )
+ assert_matches_type(Optional[SettingEditResponse], setting, path=["response"])
+
+ @parametrize
+ async def test_method_edit_with_all_params_overload_26(self, async_client: AsyncCloudflare) -> None:
+ setting = await async_client.zones.settings.edit(
+ "always_online",
+ zone_id="023e105f4ecef8ad9ca31a8372d0c353",
+ id="minify",
+ value={
+ "css": "on",
+ "html": "on",
+ "js": "on",
+ },
+ )
+ assert_matches_type(Optional[SettingEditResponse], setting, path=["response"])
+
+ @parametrize
+ async def test_raw_response_edit_overload_26(self, async_client: AsyncCloudflare) -> None:
+ response = await async_client.zones.settings.with_raw_response.edit(
+ "always_online",
+ zone_id="023e105f4ecef8ad9ca31a8372d0c353",
+ id="minify",
+ value={},
+ )
+
+ assert response.is_closed is True
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+ setting = await response.parse()
+ assert_matches_type(Optional[SettingEditResponse], setting, path=["response"])
+
+ @parametrize
+ async def test_streaming_response_edit_overload_26(self, async_client: AsyncCloudflare) -> None:
+ async with async_client.zones.settings.with_streaming_response.edit(
+ "always_online",
+ zone_id="023e105f4ecef8ad9ca31a8372d0c353",
+ id="minify",
+ value={},
+ ) as response:
+ assert not response.is_closed
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+
+ setting = await response.parse()
+ assert_matches_type(Optional[SettingEditResponse], setting, path=["response"])
+
+ assert cast(Any, response.is_closed) is True
+
+ @parametrize
+ async def test_path_params_edit_overload_26(self, async_client: AsyncCloudflare) -> None:
+ with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"):
+ await async_client.zones.settings.with_raw_response.edit(
+ "always_online",
+ zone_id="",
+ id="minify",
+ value={},
+ )
+
+ with pytest.raises(ValueError, match=r"Expected a non-empty value for `setting_id` but received ''"):
+ await async_client.zones.settings.with_raw_response.edit(
+ "",
+ zone_id="023e105f4ecef8ad9ca31a8372d0c353",
+ id="minify",
+ value={},
+ )
+
+ @parametrize
+ async def test_method_edit_overload_27(self, async_client: AsyncCloudflare) -> None:
+ setting = await async_client.zones.settings.edit(
+ "always_online",
+ zone_id="023e105f4ecef8ad9ca31a8372d0c353",
+ id="mirage",
+ value="on",
+ )
+ assert_matches_type(Optional[SettingEditResponse], setting, path=["response"])
+
+ @parametrize
+ async def test_raw_response_edit_overload_27(self, async_client: AsyncCloudflare) -> None:
+ response = await async_client.zones.settings.with_raw_response.edit(
+ "always_online",
+ zone_id="023e105f4ecef8ad9ca31a8372d0c353",
+ id="mirage",
+ value="on",
+ )
+
+ assert response.is_closed is True
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+ setting = await response.parse()
+ assert_matches_type(Optional[SettingEditResponse], setting, path=["response"])
+
+ @parametrize
+ async def test_streaming_response_edit_overload_27(self, async_client: AsyncCloudflare) -> None:
+ async with async_client.zones.settings.with_streaming_response.edit(
+ "always_online",
+ zone_id="023e105f4ecef8ad9ca31a8372d0c353",
+ id="mirage",
+ value="on",
+ ) as response:
+ assert not response.is_closed
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+
+ setting = await response.parse()
+ assert_matches_type(Optional[SettingEditResponse], setting, path=["response"])
+
+ assert cast(Any, response.is_closed) is True
+
+ @parametrize
+ async def test_path_params_edit_overload_27(self, async_client: AsyncCloudflare) -> None:
+ with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"):
+ await async_client.zones.settings.with_raw_response.edit(
+ "always_online",
+ zone_id="",
+ id="mirage",
+ value="on",
+ )
+
+ with pytest.raises(ValueError, match=r"Expected a non-empty value for `setting_id` but received ''"):
+ await async_client.zones.settings.with_raw_response.edit(
+ "",
+ zone_id="023e105f4ecef8ad9ca31a8372d0c353",
+ id="mirage",
+ value="on",
+ )
+
+ @parametrize
+ async def test_method_edit_overload_28(self, async_client: AsyncCloudflare) -> None:
+ setting = await async_client.zones.settings.edit(
+ "always_online",
+ zone_id="023e105f4ecef8ad9ca31a8372d0c353",
+ id="mobile_redirect",
+ value={},
+ )
+ assert_matches_type(Optional[SettingEditResponse], setting, path=["response"])
+
+ @parametrize
+ async def test_method_edit_with_all_params_overload_28(self, async_client: AsyncCloudflare) -> None:
+ setting = await async_client.zones.settings.edit(
+ "always_online",
+ zone_id="023e105f4ecef8ad9ca31a8372d0c353",
+ id="mobile_redirect",
+ value={
+ "mobile_subdomain": "m",
+ "status": "on",
+ "strip_uri": False,
+ },
+ )
+ assert_matches_type(Optional[SettingEditResponse], setting, path=["response"])
+
+ @parametrize
+ async def test_raw_response_edit_overload_28(self, async_client: AsyncCloudflare) -> None:
+ response = await async_client.zones.settings.with_raw_response.edit(
+ "always_online",
+ zone_id="023e105f4ecef8ad9ca31a8372d0c353",
+ id="mobile_redirect",
+ value={},
+ )
+
+ assert response.is_closed is True
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+ setting = await response.parse()
+ assert_matches_type(Optional[SettingEditResponse], setting, path=["response"])
+
+ @parametrize
+ async def test_streaming_response_edit_overload_28(self, async_client: AsyncCloudflare) -> None:
+ async with async_client.zones.settings.with_streaming_response.edit(
+ "always_online",
+ zone_id="023e105f4ecef8ad9ca31a8372d0c353",
+ id="mobile_redirect",
+ value={},
+ ) as response:
+ assert not response.is_closed
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+
+ setting = await response.parse()
+ assert_matches_type(Optional[SettingEditResponse], setting, path=["response"])
+
+ assert cast(Any, response.is_closed) is True
+
+ @parametrize
+ async def test_path_params_edit_overload_28(self, async_client: AsyncCloudflare) -> None:
+ with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"):
+ await async_client.zones.settings.with_raw_response.edit(
+ "always_online",
+ zone_id="",
+ id="mobile_redirect",
+ value={},
+ )
+
+ with pytest.raises(ValueError, match=r"Expected a non-empty value for `setting_id` but received ''"):
+ await async_client.zones.settings.with_raw_response.edit(
+ "",
+ zone_id="023e105f4ecef8ad9ca31a8372d0c353",
+ id="mobile_redirect",
+ value={},
+ )
+
+ @parametrize
+ async def test_method_edit_overload_29(self, async_client: AsyncCloudflare) -> None:
+ setting = await async_client.zones.settings.edit(
+ "always_online",
+ zone_id="023e105f4ecef8ad9ca31a8372d0c353",
+ id="nel",
+ value={},
+ )
+ assert_matches_type(Optional[SettingEditResponse], setting, path=["response"])
+
+ @parametrize
+ async def test_method_edit_with_all_params_overload_29(self, async_client: AsyncCloudflare) -> None:
+ setting = await async_client.zones.settings.edit(
+ "always_online",
+ zone_id="023e105f4ecef8ad9ca31a8372d0c353",
+ id="nel",
+ value={"enabled": False},
+ )
+ assert_matches_type(Optional[SettingEditResponse], setting, path=["response"])
+
+ @parametrize
+ async def test_raw_response_edit_overload_29(self, async_client: AsyncCloudflare) -> None:
+ response = await async_client.zones.settings.with_raw_response.edit(
+ "always_online",
+ zone_id="023e105f4ecef8ad9ca31a8372d0c353",
+ id="nel",
+ value={},
+ )
+
+ assert response.is_closed is True
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+ setting = await response.parse()
+ assert_matches_type(Optional[SettingEditResponse], setting, path=["response"])
+
+ @parametrize
+ async def test_streaming_response_edit_overload_29(self, async_client: AsyncCloudflare) -> None:
+ async with async_client.zones.settings.with_streaming_response.edit(
+ "always_online",
+ zone_id="023e105f4ecef8ad9ca31a8372d0c353",
+ id="nel",
+ value={},
+ ) as response:
+ assert not response.is_closed
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+
+ setting = await response.parse()
+ assert_matches_type(Optional[SettingEditResponse], setting, path=["response"])
+
+ assert cast(Any, response.is_closed) is True
+
+ @parametrize
+ async def test_path_params_edit_overload_29(self, async_client: AsyncCloudflare) -> None:
+ with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"):
+ await async_client.zones.settings.with_raw_response.edit(
+ "always_online",
+ zone_id="",
+ id="nel",
+ value={},
+ )
+
+ with pytest.raises(ValueError, match=r"Expected a non-empty value for `setting_id` but received ''"):
+ await async_client.zones.settings.with_raw_response.edit(
+ "",
+ zone_id="023e105f4ecef8ad9ca31a8372d0c353",
+ id="nel",
+ value={},
+ )
+
+ @parametrize
+ async def test_method_edit_overload_30(self, async_client: AsyncCloudflare) -> None:
+ setting = await async_client.zones.settings.edit(
+ "always_online",
+ zone_id="023e105f4ecef8ad9ca31a8372d0c353",
+ id="opportunistic_encryption",
+ value="on",
+ )
+ assert_matches_type(Optional[SettingEditResponse], setting, path=["response"])
+
+ @parametrize
+ async def test_raw_response_edit_overload_30(self, async_client: AsyncCloudflare) -> None:
+ response = await async_client.zones.settings.with_raw_response.edit(
+ "always_online",
+ zone_id="023e105f4ecef8ad9ca31a8372d0c353",
+ id="opportunistic_encryption",
+ value="on",
+ )
+
+ assert response.is_closed is True
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+ setting = await response.parse()
+ assert_matches_type(Optional[SettingEditResponse], setting, path=["response"])
+
+ @parametrize
+ async def test_streaming_response_edit_overload_30(self, async_client: AsyncCloudflare) -> None:
+ async with async_client.zones.settings.with_streaming_response.edit(
+ "always_online",
+ zone_id="023e105f4ecef8ad9ca31a8372d0c353",
+ id="opportunistic_encryption",
+ value="on",
+ ) as response:
+ assert not response.is_closed
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+
+ setting = await response.parse()
+ assert_matches_type(Optional[SettingEditResponse], setting, path=["response"])
+
+ assert cast(Any, response.is_closed) is True
+
+ @parametrize
+ async def test_path_params_edit_overload_30(self, async_client: AsyncCloudflare) -> None:
+ with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"):
+ await async_client.zones.settings.with_raw_response.edit(
+ "always_online",
+ zone_id="",
+ id="opportunistic_encryption",
+ value="on",
+ )
+
+ with pytest.raises(ValueError, match=r"Expected a non-empty value for `setting_id` but received ''"):
+ await async_client.zones.settings.with_raw_response.edit(
+ "",
+ zone_id="023e105f4ecef8ad9ca31a8372d0c353",
+ id="opportunistic_encryption",
+ value="on",
+ )
+
+ @parametrize
+ async def test_method_edit_overload_31(self, async_client: AsyncCloudflare) -> None:
+ setting = await async_client.zones.settings.edit(
+ "always_online",
+ zone_id="023e105f4ecef8ad9ca31a8372d0c353",
+ id="opportunistic_onion",
+ value="on",
+ )
+ assert_matches_type(Optional[SettingEditResponse], setting, path=["response"])
+
+ @parametrize
+ async def test_raw_response_edit_overload_31(self, async_client: AsyncCloudflare) -> None:
+ response = await async_client.zones.settings.with_raw_response.edit(
+ "always_online",
+ zone_id="023e105f4ecef8ad9ca31a8372d0c353",
+ id="opportunistic_onion",
+ value="on",
+ )
+
+ assert response.is_closed is True
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+ setting = await response.parse()
+ assert_matches_type(Optional[SettingEditResponse], setting, path=["response"])
+
+ @parametrize
+ async def test_streaming_response_edit_overload_31(self, async_client: AsyncCloudflare) -> None:
+ async with async_client.zones.settings.with_streaming_response.edit(
+ "always_online",
+ zone_id="023e105f4ecef8ad9ca31a8372d0c353",
+ id="opportunistic_onion",
+ value="on",
+ ) as response:
+ assert not response.is_closed
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+
+ setting = await response.parse()
+ assert_matches_type(Optional[SettingEditResponse], setting, path=["response"])
+
+ assert cast(Any, response.is_closed) is True
+
+ @parametrize
+ async def test_path_params_edit_overload_31(self, async_client: AsyncCloudflare) -> None:
+ with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"):
+ await async_client.zones.settings.with_raw_response.edit(
+ "always_online",
+ zone_id="",
+ id="opportunistic_onion",
+ value="on",
+ )
+
+ with pytest.raises(ValueError, match=r"Expected a non-empty value for `setting_id` but received ''"):
+ await async_client.zones.settings.with_raw_response.edit(
+ "",
+ zone_id="023e105f4ecef8ad9ca31a8372d0c353",
+ id="opportunistic_onion",
+ value="on",
+ )
+
+ @parametrize
+ async def test_method_edit_overload_32(self, async_client: AsyncCloudflare) -> None:
+ setting = await async_client.zones.settings.edit(
+ "always_online",
+ zone_id="023e105f4ecef8ad9ca31a8372d0c353",
+ id="orange_to_orange",
+ value="on",
+ )
+ assert_matches_type(Optional[SettingEditResponse], setting, path=["response"])
+
+ @parametrize
+ async def test_raw_response_edit_overload_32(self, async_client: AsyncCloudflare) -> None:
+ response = await async_client.zones.settings.with_raw_response.edit(
+ "always_online",
+ zone_id="023e105f4ecef8ad9ca31a8372d0c353",
+ id="orange_to_orange",
+ value="on",
+ )
+
+ assert response.is_closed is True
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+ setting = await response.parse()
+ assert_matches_type(Optional[SettingEditResponse], setting, path=["response"])
+
+ @parametrize
+ async def test_streaming_response_edit_overload_32(self, async_client: AsyncCloudflare) -> None:
+ async with async_client.zones.settings.with_streaming_response.edit(
+ "always_online",
+ zone_id="023e105f4ecef8ad9ca31a8372d0c353",
+ id="orange_to_orange",
+ value="on",
+ ) as response:
+ assert not response.is_closed
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+
+ setting = await response.parse()
+ assert_matches_type(Optional[SettingEditResponse], setting, path=["response"])
+
+ assert cast(Any, response.is_closed) is True
+
+ @parametrize
+ async def test_path_params_edit_overload_32(self, async_client: AsyncCloudflare) -> None:
+ with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"):
+ await async_client.zones.settings.with_raw_response.edit(
+ "always_online",
+ zone_id="",
+ id="orange_to_orange",
+ value="on",
+ )
+
+ with pytest.raises(ValueError, match=r"Expected a non-empty value for `setting_id` but received ''"):
+ await async_client.zones.settings.with_raw_response.edit(
+ "",
+ zone_id="023e105f4ecef8ad9ca31a8372d0c353",
+ id="orange_to_orange",
+ value="on",
+ )
+
+ @parametrize
+ async def test_method_edit_overload_33(self, async_client: AsyncCloudflare) -> None:
+ setting = await async_client.zones.settings.edit(
+ "always_online",
+ zone_id="023e105f4ecef8ad9ca31a8372d0c353",
+ id="origin_error_page_pass_thru",
+ value="on",
+ )
+ assert_matches_type(Optional[SettingEditResponse], setting, path=["response"])
+
+ @parametrize
+ async def test_raw_response_edit_overload_33(self, async_client: AsyncCloudflare) -> None:
+ response = await async_client.zones.settings.with_raw_response.edit(
+ "always_online",
+ zone_id="023e105f4ecef8ad9ca31a8372d0c353",
+ id="origin_error_page_pass_thru",
+ value="on",
+ )
+
+ assert response.is_closed is True
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+ setting = await response.parse()
+ assert_matches_type(Optional[SettingEditResponse], setting, path=["response"])
+
+ @parametrize
+ async def test_streaming_response_edit_overload_33(self, async_client: AsyncCloudflare) -> None:
+ async with async_client.zones.settings.with_streaming_response.edit(
+ "always_online",
+ zone_id="023e105f4ecef8ad9ca31a8372d0c353",
+ id="origin_error_page_pass_thru",
+ value="on",
+ ) as response:
+ assert not response.is_closed
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+
+ setting = await response.parse()
+ assert_matches_type(Optional[SettingEditResponse], setting, path=["response"])
+
+ assert cast(Any, response.is_closed) is True
+
+ @parametrize
+ async def test_path_params_edit_overload_33(self, async_client: AsyncCloudflare) -> None:
+ with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"):
+ await async_client.zones.settings.with_raw_response.edit(
+ "always_online",
+ zone_id="",
+ id="origin_error_page_pass_thru",
+ value="on",
+ )
+
+ with pytest.raises(ValueError, match=r"Expected a non-empty value for `setting_id` but received ''"):
+ await async_client.zones.settings.with_raw_response.edit(
+ "",
+ zone_id="023e105f4ecef8ad9ca31a8372d0c353",
+ id="origin_error_page_pass_thru",
+ value="on",
+ )
+
+ @parametrize
+ async def test_method_edit_overload_34(self, async_client: AsyncCloudflare) -> None:
+ setting = await async_client.zones.settings.edit(
+ "always_online",
+ zone_id="023e105f4ecef8ad9ca31a8372d0c353",
+ id="polish",
+ value="off",
+ )
+ assert_matches_type(Optional[SettingEditResponse], setting, path=["response"])
+
+ @parametrize
+ async def test_raw_response_edit_overload_34(self, async_client: AsyncCloudflare) -> None:
+ response = await async_client.zones.settings.with_raw_response.edit(
+ "always_online",
+ zone_id="023e105f4ecef8ad9ca31a8372d0c353",
+ id="polish",
+ value="off",
+ )
+
+ assert response.is_closed is True
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+ setting = await response.parse()
+ assert_matches_type(Optional[SettingEditResponse], setting, path=["response"])
+
+ @parametrize
+ async def test_streaming_response_edit_overload_34(self, async_client: AsyncCloudflare) -> None:
+ async with async_client.zones.settings.with_streaming_response.edit(
+ "always_online",
+ zone_id="023e105f4ecef8ad9ca31a8372d0c353",
+ id="polish",
+ value="off",
+ ) as response:
+ assert not response.is_closed
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+
+ setting = await response.parse()
+ assert_matches_type(Optional[SettingEditResponse], setting, path=["response"])
+
+ assert cast(Any, response.is_closed) is True
+
+ @parametrize
+ async def test_path_params_edit_overload_34(self, async_client: AsyncCloudflare) -> None:
+ with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"):
+ await async_client.zones.settings.with_raw_response.edit(
+ "always_online",
+ zone_id="",
+ id="polish",
+ value="off",
+ )
+
+ with pytest.raises(ValueError, match=r"Expected a non-empty value for `setting_id` but received ''"):
+ await async_client.zones.settings.with_raw_response.edit(
+ "",
+ zone_id="023e105f4ecef8ad9ca31a8372d0c353",
+ id="polish",
+ value="off",
+ )
+
+ @parametrize
+ async def test_method_edit_overload_35(self, async_client: AsyncCloudflare) -> None:
+ setting = await async_client.zones.settings.edit(
+ "always_online",
+ zone_id="023e105f4ecef8ad9ca31a8372d0c353",
+ id="prefetch_preload",
+ value="on",
+ )
+ assert_matches_type(Optional[SettingEditResponse], setting, path=["response"])
+
+ @parametrize
+ async def test_raw_response_edit_overload_35(self, async_client: AsyncCloudflare) -> None:
+ response = await async_client.zones.settings.with_raw_response.edit(
+ "always_online",
+ zone_id="023e105f4ecef8ad9ca31a8372d0c353",
+ id="prefetch_preload",
+ value="on",
+ )
+
+ assert response.is_closed is True
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+ setting = await response.parse()
+ assert_matches_type(Optional[SettingEditResponse], setting, path=["response"])
+
+ @parametrize
+ async def test_streaming_response_edit_overload_35(self, async_client: AsyncCloudflare) -> None:
+ async with async_client.zones.settings.with_streaming_response.edit(
+ "always_online",
+ zone_id="023e105f4ecef8ad9ca31a8372d0c353",
+ id="prefetch_preload",
+ value="on",
+ ) as response:
+ assert not response.is_closed
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+
+ setting = await response.parse()
+ assert_matches_type(Optional[SettingEditResponse], setting, path=["response"])
+
+ assert cast(Any, response.is_closed) is True
+
+ @parametrize
+ async def test_path_params_edit_overload_35(self, async_client: AsyncCloudflare) -> None:
+ with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"):
+ await async_client.zones.settings.with_raw_response.edit(
+ "always_online",
+ zone_id="",
+ id="prefetch_preload",
+ value="on",
+ )
+
+ with pytest.raises(ValueError, match=r"Expected a non-empty value for `setting_id` but received ''"):
+ await async_client.zones.settings.with_raw_response.edit(
+ "",
+ zone_id="023e105f4ecef8ad9ca31a8372d0c353",
+ id="prefetch_preload",
+ value="on",
+ )
+
+ @parametrize
+ async def test_method_edit_overload_36(self, async_client: AsyncCloudflare) -> None:
+ setting = await async_client.zones.settings.edit(
+ "always_online",
+ zone_id="023e105f4ecef8ad9ca31a8372d0c353",
+ id="proxy_read_timeout",
+ value=0,
+ )
+ assert_matches_type(Optional[SettingEditResponse], setting, path=["response"])
+
+ @parametrize
+ async def test_raw_response_edit_overload_36(self, async_client: AsyncCloudflare) -> None:
+ response = await async_client.zones.settings.with_raw_response.edit(
+ "always_online",
+ zone_id="023e105f4ecef8ad9ca31a8372d0c353",
+ id="proxy_read_timeout",
+ value=0,
+ )
+
+ assert response.is_closed is True
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+ setting = await response.parse()
+ assert_matches_type(Optional[SettingEditResponse], setting, path=["response"])
+
+ @parametrize
+ async def test_streaming_response_edit_overload_36(self, async_client: AsyncCloudflare) -> None:
+ async with async_client.zones.settings.with_streaming_response.edit(
+ "always_online",
+ zone_id="023e105f4ecef8ad9ca31a8372d0c353",
+ id="proxy_read_timeout",
+ value=0,
+ ) as response:
+ assert not response.is_closed
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+
+ setting = await response.parse()
+ assert_matches_type(Optional[SettingEditResponse], setting, path=["response"])
+
+ assert cast(Any, response.is_closed) is True
+
+ @parametrize
+ async def test_path_params_edit_overload_36(self, async_client: AsyncCloudflare) -> None:
+ with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"):
+ await async_client.zones.settings.with_raw_response.edit(
+ "always_online",
+ zone_id="",
+ id="proxy_read_timeout",
+ value=0,
+ )
+
+ with pytest.raises(ValueError, match=r"Expected a non-empty value for `setting_id` but received ''"):
+ await async_client.zones.settings.with_raw_response.edit(
+ "",
+ zone_id="023e105f4ecef8ad9ca31a8372d0c353",
+ id="proxy_read_timeout",
+ value=0,
+ )
+
+ @parametrize
+ async def test_method_edit_overload_37(self, async_client: AsyncCloudflare) -> None:
+ setting = await async_client.zones.settings.edit(
+ "always_online",
+ zone_id="023e105f4ecef8ad9ca31a8372d0c353",
+ id="pseudo_ipv4",
+ value="off",
+ )
+ assert_matches_type(Optional[SettingEditResponse], setting, path=["response"])
+
+ @parametrize
+ async def test_raw_response_edit_overload_37(self, async_client: AsyncCloudflare) -> None:
+ response = await async_client.zones.settings.with_raw_response.edit(
+ "always_online",
+ zone_id="023e105f4ecef8ad9ca31a8372d0c353",
+ id="pseudo_ipv4",
+ value="off",
+ )
+
+ assert response.is_closed is True
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+ setting = await response.parse()
+ assert_matches_type(Optional[SettingEditResponse], setting, path=["response"])
+
+ @parametrize
+ async def test_streaming_response_edit_overload_37(self, async_client: AsyncCloudflare) -> None:
+ async with async_client.zones.settings.with_streaming_response.edit(
+ "always_online",
+ zone_id="023e105f4ecef8ad9ca31a8372d0c353",
+ id="pseudo_ipv4",
+ value="off",
+ ) as response:
+ assert not response.is_closed
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+
+ setting = await response.parse()
+ assert_matches_type(Optional[SettingEditResponse], setting, path=["response"])
+
+ assert cast(Any, response.is_closed) is True
+
+ @parametrize
+ async def test_path_params_edit_overload_37(self, async_client: AsyncCloudflare) -> None:
+ with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"):
+ await async_client.zones.settings.with_raw_response.edit(
+ "always_online",
+ zone_id="",
+ id="pseudo_ipv4",
+ value="off",
+ )
+
+ with pytest.raises(ValueError, match=r"Expected a non-empty value for `setting_id` but received ''"):
+ await async_client.zones.settings.with_raw_response.edit(
+ "",
+ zone_id="023e105f4ecef8ad9ca31a8372d0c353",
+ id="pseudo_ipv4",
+ value="off",
+ )
+
+ @parametrize
+ async def test_method_edit_overload_38(self, async_client: AsyncCloudflare) -> None:
+ setting = await async_client.zones.settings.edit(
+ "always_online",
+ zone_id="023e105f4ecef8ad9ca31a8372d0c353",
+ id="replace_insecure_js",
+ value="on",
+ )
+ assert_matches_type(Optional[SettingEditResponse], setting, path=["response"])
+
+ @parametrize
+ async def test_raw_response_edit_overload_38(self, async_client: AsyncCloudflare) -> None:
+ response = await async_client.zones.settings.with_raw_response.edit(
+ "always_online",
+ zone_id="023e105f4ecef8ad9ca31a8372d0c353",
+ id="replace_insecure_js",
+ value="on",
+ )
+
+ assert response.is_closed is True
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+ setting = await response.parse()
+ assert_matches_type(Optional[SettingEditResponse], setting, path=["response"])
+
+ @parametrize
+ async def test_streaming_response_edit_overload_38(self, async_client: AsyncCloudflare) -> None:
+ async with async_client.zones.settings.with_streaming_response.edit(
+ "always_online",
+ zone_id="023e105f4ecef8ad9ca31a8372d0c353",
+ id="replace_insecure_js",
+ value="on",
+ ) as response:
+ assert not response.is_closed
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+
+ setting = await response.parse()
+ assert_matches_type(Optional[SettingEditResponse], setting, path=["response"])
+
+ assert cast(Any, response.is_closed) is True
+
+ @parametrize
+ async def test_path_params_edit_overload_38(self, async_client: AsyncCloudflare) -> None:
+ with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"):
+ await async_client.zones.settings.with_raw_response.edit(
+ "always_online",
+ zone_id="",
+ id="replace_insecure_js",
+ value="on",
+ )
+
+ with pytest.raises(ValueError, match=r"Expected a non-empty value for `setting_id` but received ''"):
+ await async_client.zones.settings.with_raw_response.edit(
+ "",
+ zone_id="023e105f4ecef8ad9ca31a8372d0c353",
+ id="replace_insecure_js",
+ value="on",
+ )
+
+ @parametrize
+ async def test_method_edit_overload_39(self, async_client: AsyncCloudflare) -> None:
+ setting = await async_client.zones.settings.edit(
+ "always_online",
+ zone_id="023e105f4ecef8ad9ca31a8372d0c353",
+ id="response_buffering",
+ value="on",
+ )
+ assert_matches_type(Optional[SettingEditResponse], setting, path=["response"])
+
+ @parametrize
+ async def test_raw_response_edit_overload_39(self, async_client: AsyncCloudflare) -> None:
+ response = await async_client.zones.settings.with_raw_response.edit(
+ "always_online",
+ zone_id="023e105f4ecef8ad9ca31a8372d0c353",
+ id="response_buffering",
+ value="on",
+ )
+
+ assert response.is_closed is True
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+ setting = await response.parse()
+ assert_matches_type(Optional[SettingEditResponse], setting, path=["response"])
+
+ @parametrize
+ async def test_streaming_response_edit_overload_39(self, async_client: AsyncCloudflare) -> None:
+ async with async_client.zones.settings.with_streaming_response.edit(
+ "always_online",
+ zone_id="023e105f4ecef8ad9ca31a8372d0c353",
+ id="response_buffering",
+ value="on",
+ ) as response:
+ assert not response.is_closed
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+
+ setting = await response.parse()
+ assert_matches_type(Optional[SettingEditResponse], setting, path=["response"])
+
+ assert cast(Any, response.is_closed) is True
+
+ @parametrize
+ async def test_path_params_edit_overload_39(self, async_client: AsyncCloudflare) -> None:
+ with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"):
+ await async_client.zones.settings.with_raw_response.edit(
+ "always_online",
+ zone_id="",
+ id="response_buffering",
+ value="on",
+ )
+
+ with pytest.raises(ValueError, match=r"Expected a non-empty value for `setting_id` but received ''"):
+ await async_client.zones.settings.with_raw_response.edit(
+ "",
+ zone_id="023e105f4ecef8ad9ca31a8372d0c353",
+ id="response_buffering",
+ value="on",
+ )
+
+ @parametrize
+ async def test_method_edit_overload_40(self, async_client: AsyncCloudflare) -> None:
+ setting = await async_client.zones.settings.edit(
+ "always_online",
+ zone_id="023e105f4ecef8ad9ca31a8372d0c353",
+ id="rocket_loader",
+ value="on",
+ )
+ assert_matches_type(Optional[SettingEditResponse], setting, path=["response"])
+
+ @parametrize
+ async def test_raw_response_edit_overload_40(self, async_client: AsyncCloudflare) -> None:
+ response = await async_client.zones.settings.with_raw_response.edit(
+ "always_online",
+ zone_id="023e105f4ecef8ad9ca31a8372d0c353",
+ id="rocket_loader",
+ value="on",
+ )
+
+ assert response.is_closed is True
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+ setting = await response.parse()
+ assert_matches_type(Optional[SettingEditResponse], setting, path=["response"])
+
+ @parametrize
+ async def test_streaming_response_edit_overload_40(self, async_client: AsyncCloudflare) -> None:
+ async with async_client.zones.settings.with_streaming_response.edit(
+ "always_online",
+ zone_id="023e105f4ecef8ad9ca31a8372d0c353",
+ id="rocket_loader",
+ value="on",
+ ) as response:
+ assert not response.is_closed
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+
+ setting = await response.parse()
+ assert_matches_type(Optional[SettingEditResponse], setting, path=["response"])
+
+ assert cast(Any, response.is_closed) is True
+
+ @parametrize
+ async def test_path_params_edit_overload_40(self, async_client: AsyncCloudflare) -> None:
+ with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"):
+ await async_client.zones.settings.with_raw_response.edit(
+ "always_online",
+ zone_id="",
+ id="rocket_loader",
+ value="on",
+ )
+
+ with pytest.raises(ValueError, match=r"Expected a non-empty value for `setting_id` but received ''"):
+ await async_client.zones.settings.with_raw_response.edit(
+ "",
+ zone_id="023e105f4ecef8ad9ca31a8372d0c353",
+ id="rocket_loader",
+ value="on",
+ )
+
+ @parametrize
+ async def test_method_edit_overload_41(self, async_client: AsyncCloudflare) -> None:
+ setting = await async_client.zones.settings.edit(
+ "always_online",
+ zone_id="023e105f4ecef8ad9ca31a8372d0c353",
+ id="automatic_platform_optimization",
+ value={
+ "cache_by_device_type": False,
+ "cf": True,
+ "enabled": True,
+ "hostnames": ["www.example.com", "example.com", "shop.example.com"],
+ "wordpress": True,
+ "wp_plugin": True,
+ },
+ )
+ assert_matches_type(Optional[SettingEditResponse], setting, path=["response"])
+
+ @parametrize
+ async def test_raw_response_edit_overload_41(self, async_client: AsyncCloudflare) -> None:
+ response = await async_client.zones.settings.with_raw_response.edit(
+ "always_online",
+ zone_id="023e105f4ecef8ad9ca31a8372d0c353",
+ id="automatic_platform_optimization",
+ value={
+ "cache_by_device_type": False,
+ "cf": True,
+ "enabled": True,
+ "hostnames": ["www.example.com", "example.com", "shop.example.com"],
+ "wordpress": True,
+ "wp_plugin": True,
+ },
+ )
+
+ assert response.is_closed is True
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+ setting = await response.parse()
+ assert_matches_type(Optional[SettingEditResponse], setting, path=["response"])
+
+ @parametrize
+ async def test_streaming_response_edit_overload_41(self, async_client: AsyncCloudflare) -> None:
+ async with async_client.zones.settings.with_streaming_response.edit(
+ "always_online",
+ zone_id="023e105f4ecef8ad9ca31a8372d0c353",
+ id="automatic_platform_optimization",
+ value={
+ "cache_by_device_type": False,
+ "cf": True,
+ "enabled": True,
+ "hostnames": ["www.example.com", "example.com", "shop.example.com"],
+ "wordpress": True,
+ "wp_plugin": True,
+ },
+ ) as response:
+ assert not response.is_closed
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+
+ setting = await response.parse()
+ assert_matches_type(Optional[SettingEditResponse], setting, path=["response"])
+
+ assert cast(Any, response.is_closed) is True
+
+ @parametrize
+ async def test_path_params_edit_overload_41(self, async_client: AsyncCloudflare) -> None:
+ with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"):
+ await async_client.zones.settings.with_raw_response.edit(
+ "always_online",
+ zone_id="",
+ id="automatic_platform_optimization",
+ value={
+ "cache_by_device_type": False,
+ "cf": True,
+ "enabled": True,
+ "hostnames": ["www.example.com", "example.com", "shop.example.com"],
+ "wordpress": True,
+ "wp_plugin": True,
+ },
+ )
+
+ with pytest.raises(ValueError, match=r"Expected a non-empty value for `setting_id` but received ''"):
+ await async_client.zones.settings.with_raw_response.edit(
+ "",
+ zone_id="023e105f4ecef8ad9ca31a8372d0c353",
+ id="automatic_platform_optimization",
+ value={
+ "cache_by_device_type": False,
+ "cf": True,
+ "enabled": True,
+ "hostnames": ["www.example.com", "example.com", "shop.example.com"],
+ "wordpress": True,
+ "wp_plugin": True,
+ },
+ )
+
+ @parametrize
+ async def test_method_edit_overload_42(self, async_client: AsyncCloudflare) -> None:
+ setting = await async_client.zones.settings.edit(
+ "always_online",
+ zone_id="023e105f4ecef8ad9ca31a8372d0c353",
+ id="security_header",
+ value={},
+ )
+ assert_matches_type(Optional[SettingEditResponse], setting, path=["response"])
+
+ @parametrize
+ async def test_method_edit_with_all_params_overload_42(self, async_client: AsyncCloudflare) -> None:
+ setting = await async_client.zones.settings.edit(
+ "always_online",
+ zone_id="023e105f4ecef8ad9ca31a8372d0c353",
+ id="security_header",
+ value={
+ "strict_transport_security": {
+ "enabled": True,
+ "include_subdomains": True,
+ "max_age": 86400,
+ "nosniff": True,
+ }
+ },
+ )
+ assert_matches_type(Optional[SettingEditResponse], setting, path=["response"])
+
+ @parametrize
+ async def test_raw_response_edit_overload_42(self, async_client: AsyncCloudflare) -> None:
+ response = await async_client.zones.settings.with_raw_response.edit(
+ "always_online",
+ zone_id="023e105f4ecef8ad9ca31a8372d0c353",
+ id="security_header",
+ value={},
+ )
+
+ assert response.is_closed is True
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+ setting = await response.parse()
+ assert_matches_type(Optional[SettingEditResponse], setting, path=["response"])
+
+ @parametrize
+ async def test_streaming_response_edit_overload_42(self, async_client: AsyncCloudflare) -> None:
+ async with async_client.zones.settings.with_streaming_response.edit(
+ "always_online",
+ zone_id="023e105f4ecef8ad9ca31a8372d0c353",
+ id="security_header",
+ value={},
+ ) as response:
+ assert not response.is_closed
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+
+ setting = await response.parse()
+ assert_matches_type(Optional[SettingEditResponse], setting, path=["response"])
+
+ assert cast(Any, response.is_closed) is True
+
+ @parametrize
+ async def test_path_params_edit_overload_42(self, async_client: AsyncCloudflare) -> None:
+ with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"):
+ await async_client.zones.settings.with_raw_response.edit(
+ "always_online",
+ zone_id="",
+ id="security_header",
+ value={},
+ )
+
+ with pytest.raises(ValueError, match=r"Expected a non-empty value for `setting_id` but received ''"):
+ await async_client.zones.settings.with_raw_response.edit(
+ "",
+ zone_id="023e105f4ecef8ad9ca31a8372d0c353",
+ id="security_header",
+ value={},
+ )
+
+ @parametrize
+ async def test_method_edit_overload_43(self, async_client: AsyncCloudflare) -> None:
+ setting = await async_client.zones.settings.edit(
+ "always_online",
+ zone_id="023e105f4ecef8ad9ca31a8372d0c353",
+ id="security_level",
+ value="off",
+ )
+ assert_matches_type(Optional[SettingEditResponse], setting, path=["response"])
+
+ @parametrize
+ async def test_raw_response_edit_overload_43(self, async_client: AsyncCloudflare) -> None:
+ response = await async_client.zones.settings.with_raw_response.edit(
+ "always_online",
+ zone_id="023e105f4ecef8ad9ca31a8372d0c353",
+ id="security_level",
+ value="off",
+ )
+
+ assert response.is_closed is True
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+ setting = await response.parse()
+ assert_matches_type(Optional[SettingEditResponse], setting, path=["response"])
+
+ @parametrize
+ async def test_streaming_response_edit_overload_43(self, async_client: AsyncCloudflare) -> None:
+ async with async_client.zones.settings.with_streaming_response.edit(
+ "always_online",
+ zone_id="023e105f4ecef8ad9ca31a8372d0c353",
+ id="security_level",
+ value="off",
+ ) as response:
+ assert not response.is_closed
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+
+ setting = await response.parse()
+ assert_matches_type(Optional[SettingEditResponse], setting, path=["response"])
+
+ assert cast(Any, response.is_closed) is True
+
+ @parametrize
+ async def test_path_params_edit_overload_43(self, async_client: AsyncCloudflare) -> None:
+ with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"):
+ await async_client.zones.settings.with_raw_response.edit(
+ "always_online",
+ zone_id="",
+ id="security_level",
+ value="off",
+ )
+
+ with pytest.raises(ValueError, match=r"Expected a non-empty value for `setting_id` but received ''"):
+ await async_client.zones.settings.with_raw_response.edit(
+ "",
+ zone_id="023e105f4ecef8ad9ca31a8372d0c353",
+ id="security_level",
+ value="off",
+ )
+
+ @parametrize
+ async def test_method_edit_overload_44(self, async_client: AsyncCloudflare) -> None:
+ setting = await async_client.zones.settings.edit(
+ "always_online",
+ zone_id="023e105f4ecef8ad9ca31a8372d0c353",
+ id="server_side_exclude",
+ value="on",
+ )
+ assert_matches_type(Optional[SettingEditResponse], setting, path=["response"])
+
+ @parametrize
+ async def test_raw_response_edit_overload_44(self, async_client: AsyncCloudflare) -> None:
+ response = await async_client.zones.settings.with_raw_response.edit(
+ "always_online",
+ zone_id="023e105f4ecef8ad9ca31a8372d0c353",
+ id="server_side_exclude",
+ value="on",
+ )
+
+ assert response.is_closed is True
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+ setting = await response.parse()
+ assert_matches_type(Optional[SettingEditResponse], setting, path=["response"])
+
+ @parametrize
+ async def test_streaming_response_edit_overload_44(self, async_client: AsyncCloudflare) -> None:
+ async with async_client.zones.settings.with_streaming_response.edit(
+ "always_online",
+ zone_id="023e105f4ecef8ad9ca31a8372d0c353",
+ id="server_side_exclude",
+ value="on",
+ ) as response:
+ assert not response.is_closed
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+
+ setting = await response.parse()
+ assert_matches_type(Optional[SettingEditResponse], setting, path=["response"])
+
+ assert cast(Any, response.is_closed) is True
+
+ @parametrize
+ async def test_path_params_edit_overload_44(self, async_client: AsyncCloudflare) -> None:
+ with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"):
+ await async_client.zones.settings.with_raw_response.edit(
+ "always_online",
+ zone_id="",
+ id="server_side_exclude",
+ value="on",
+ )
+
+ with pytest.raises(ValueError, match=r"Expected a non-empty value for `setting_id` but received ''"):
+ await async_client.zones.settings.with_raw_response.edit(
+ "",
+ zone_id="023e105f4ecef8ad9ca31a8372d0c353",
+ id="server_side_exclude",
+ value="on",
+ )
+
+ @parametrize
+ async def test_method_edit_overload_45(self, async_client: AsyncCloudflare) -> None:
+ setting = await async_client.zones.settings.edit(
+ "always_online",
+ zone_id="023e105f4ecef8ad9ca31a8372d0c353",
+ id="sha1_support",
+ value="on",
+ )
+ assert_matches_type(Optional[SettingEditResponse], setting, path=["response"])
+
+ @parametrize
+ async def test_raw_response_edit_overload_45(self, async_client: AsyncCloudflare) -> None:
+ response = await async_client.zones.settings.with_raw_response.edit(
+ "always_online",
+ zone_id="023e105f4ecef8ad9ca31a8372d0c353",
+ id="sha1_support",
+ value="on",
+ )
+
+ assert response.is_closed is True
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+ setting = await response.parse()
+ assert_matches_type(Optional[SettingEditResponse], setting, path=["response"])
+
+ @parametrize
+ async def test_streaming_response_edit_overload_45(self, async_client: AsyncCloudflare) -> None:
+ async with async_client.zones.settings.with_streaming_response.edit(
+ "always_online",
+ zone_id="023e105f4ecef8ad9ca31a8372d0c353",
+ id="sha1_support",
+ value="on",
+ ) as response:
+ assert not response.is_closed
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+
+ setting = await response.parse()
+ assert_matches_type(Optional[SettingEditResponse], setting, path=["response"])
+
+ assert cast(Any, response.is_closed) is True
+
+ @parametrize
+ async def test_path_params_edit_overload_45(self, async_client: AsyncCloudflare) -> None:
+ with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"):
+ await async_client.zones.settings.with_raw_response.edit(
+ "always_online",
+ zone_id="",
+ id="sha1_support",
+ value="on",
+ )
+
+ with pytest.raises(ValueError, match=r"Expected a non-empty value for `setting_id` but received ''"):
+ await async_client.zones.settings.with_raw_response.edit(
+ "",
+ zone_id="023e105f4ecef8ad9ca31a8372d0c353",
+ id="sha1_support",
+ value="on",
+ )
+
+ @parametrize
+ async def test_method_edit_overload_46(self, async_client: AsyncCloudflare) -> None:
+ setting = await async_client.zones.settings.edit(
+ "always_online",
+ zone_id="023e105f4ecef8ad9ca31a8372d0c353",
+ id="sort_query_string_for_cache",
+ value="on",
+ )
+ assert_matches_type(Optional[SettingEditResponse], setting, path=["response"])
+
+ @parametrize
+ async def test_raw_response_edit_overload_46(self, async_client: AsyncCloudflare) -> None:
+ response = await async_client.zones.settings.with_raw_response.edit(
+ "always_online",
+ zone_id="023e105f4ecef8ad9ca31a8372d0c353",
+ id="sort_query_string_for_cache",
+ value="on",
+ )
+
+ assert response.is_closed is True
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+ setting = await response.parse()
+ assert_matches_type(Optional[SettingEditResponse], setting, path=["response"])
+
+ @parametrize
+ async def test_streaming_response_edit_overload_46(self, async_client: AsyncCloudflare) -> None:
+ async with async_client.zones.settings.with_streaming_response.edit(
+ "always_online",
+ zone_id="023e105f4ecef8ad9ca31a8372d0c353",
+ id="sort_query_string_for_cache",
+ value="on",
+ ) as response:
+ assert not response.is_closed
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+
+ setting = await response.parse()
+ assert_matches_type(Optional[SettingEditResponse], setting, path=["response"])
+
+ assert cast(Any, response.is_closed) is True
+
+ @parametrize
+ async def test_path_params_edit_overload_46(self, async_client: AsyncCloudflare) -> None:
+ with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"):
+ await async_client.zones.settings.with_raw_response.edit(
+ "always_online",
+ zone_id="",
+ id="sort_query_string_for_cache",
+ value="on",
+ )
+
+ with pytest.raises(ValueError, match=r"Expected a non-empty value for `setting_id` but received ''"):
+ await async_client.zones.settings.with_raw_response.edit(
+ "",
+ zone_id="023e105f4ecef8ad9ca31a8372d0c353",
+ id="sort_query_string_for_cache",
+ value="on",
+ )
+
+ @parametrize
+ async def test_method_edit_overload_47(self, async_client: AsyncCloudflare) -> None:
+ setting = await async_client.zones.settings.edit(
+ "always_online",
+ zone_id="023e105f4ecef8ad9ca31a8372d0c353",
+ id="ssl",
+ value="off",
+ )
+ assert_matches_type(Optional[SettingEditResponse], setting, path=["response"])
+
+ @parametrize
+ async def test_raw_response_edit_overload_47(self, async_client: AsyncCloudflare) -> None:
+ response = await async_client.zones.settings.with_raw_response.edit(
+ "always_online",
+ zone_id="023e105f4ecef8ad9ca31a8372d0c353",
+ id="ssl",
+ value="off",
+ )
+
+ assert response.is_closed is True
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+ setting = await response.parse()
+ assert_matches_type(Optional[SettingEditResponse], setting, path=["response"])
+
+ @parametrize
+ async def test_streaming_response_edit_overload_47(self, async_client: AsyncCloudflare) -> None:
+ async with async_client.zones.settings.with_streaming_response.edit(
+ "always_online",
+ zone_id="023e105f4ecef8ad9ca31a8372d0c353",
+ id="ssl",
+ value="off",
+ ) as response:
+ assert not response.is_closed
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+
+ setting = await response.parse()
+ assert_matches_type(Optional[SettingEditResponse], setting, path=["response"])
+
+ assert cast(Any, response.is_closed) is True
+
+ @parametrize
+ async def test_path_params_edit_overload_47(self, async_client: AsyncCloudflare) -> None:
+ with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"):
+ await async_client.zones.settings.with_raw_response.edit(
+ "always_online",
+ zone_id="",
+ id="ssl",
+ value="off",
+ )
+
+ with pytest.raises(ValueError, match=r"Expected a non-empty value for `setting_id` but received ''"):
+ await async_client.zones.settings.with_raw_response.edit(
+ "",
+ zone_id="023e105f4ecef8ad9ca31a8372d0c353",
+ id="ssl",
+ value="off",
+ )
+
+ @parametrize
+ async def test_method_edit_overload_48(self, async_client: AsyncCloudflare) -> None:
+ setting = await async_client.zones.settings.edit(
+ "always_online",
+ zone_id="023e105f4ecef8ad9ca31a8372d0c353",
+ )
+ assert_matches_type(Optional[SettingEditResponse], setting, path=["response"])
+
+ @parametrize
+ async def test_method_edit_with_all_params_overload_48(self, async_client: AsyncCloudflare) -> None:
+ setting = await async_client.zones.settings.edit(
+ "always_online",
+ zone_id="023e105f4ecef8ad9ca31a8372d0c353",
+ id="ssl_recommender",
+ enabled=True,
+ )
+ assert_matches_type(Optional[SettingEditResponse], setting, path=["response"])
+
+ @parametrize
+ async def test_raw_response_edit_overload_48(self, async_client: AsyncCloudflare) -> None:
+ response = await async_client.zones.settings.with_raw_response.edit(
+ "always_online",
+ zone_id="023e105f4ecef8ad9ca31a8372d0c353",
+ )
+
+ assert response.is_closed is True
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+ setting = await response.parse()
+ assert_matches_type(Optional[SettingEditResponse], setting, path=["response"])
+
+ @parametrize
+ async def test_streaming_response_edit_overload_48(self, async_client: AsyncCloudflare) -> None:
+ async with async_client.zones.settings.with_streaming_response.edit(
+ "always_online",
+ zone_id="023e105f4ecef8ad9ca31a8372d0c353",
+ ) as response:
+ assert not response.is_closed
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+
+ setting = await response.parse()
+ assert_matches_type(Optional[SettingEditResponse], setting, path=["response"])
+
+ assert cast(Any, response.is_closed) is True
+
+ @parametrize
+ async def test_path_params_edit_overload_48(self, async_client: AsyncCloudflare) -> None:
+ with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"):
+ await async_client.zones.settings.with_raw_response.edit(
+ "always_online",
+ zone_id="",
+ )
+
+ with pytest.raises(ValueError, match=r"Expected a non-empty value for `setting_id` but received ''"):
+ await async_client.zones.settings.with_raw_response.edit(
+ "",
+ zone_id="023e105f4ecef8ad9ca31a8372d0c353",
+ )
+
+ @parametrize
+ async def test_method_edit_overload_49(self, async_client: AsyncCloudflare) -> None:
+ setting = await async_client.zones.settings.edit(
+ "always_online",
+ zone_id="023e105f4ecef8ad9ca31a8372d0c353",
+ id="tls_1_2_only",
+ value="on",
+ )
+ assert_matches_type(Optional[SettingEditResponse], setting, path=["response"])
+
+ @parametrize
+ async def test_raw_response_edit_overload_49(self, async_client: AsyncCloudflare) -> None:
+ response = await async_client.zones.settings.with_raw_response.edit(
+ "always_online",
+ zone_id="023e105f4ecef8ad9ca31a8372d0c353",
+ id="tls_1_2_only",
+ value="on",
+ )
+
+ assert response.is_closed is True
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+ setting = await response.parse()
+ assert_matches_type(Optional[SettingEditResponse], setting, path=["response"])
+
+ @parametrize
+ async def test_streaming_response_edit_overload_49(self, async_client: AsyncCloudflare) -> None:
+ async with async_client.zones.settings.with_streaming_response.edit(
+ "always_online",
+ zone_id="023e105f4ecef8ad9ca31a8372d0c353",
+ id="tls_1_2_only",
+ value="on",
+ ) as response:
+ assert not response.is_closed
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+
+ setting = await response.parse()
+ assert_matches_type(Optional[SettingEditResponse], setting, path=["response"])
+
+ assert cast(Any, response.is_closed) is True
+
+ @parametrize
+ async def test_path_params_edit_overload_49(self, async_client: AsyncCloudflare) -> None:
+ with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"):
+ await async_client.zones.settings.with_raw_response.edit(
+ "always_online",
+ zone_id="",
+ id="tls_1_2_only",
+ value="on",
+ )
+
+ with pytest.raises(ValueError, match=r"Expected a non-empty value for `setting_id` but received ''"):
+ await async_client.zones.settings.with_raw_response.edit(
+ "",
+ zone_id="023e105f4ecef8ad9ca31a8372d0c353",
+ id="tls_1_2_only",
+ value="on",
+ )
+
+ @parametrize
+ async def test_method_edit_overload_50(self, async_client: AsyncCloudflare) -> None:
+ setting = await async_client.zones.settings.edit(
+ "always_online",
+ zone_id="023e105f4ecef8ad9ca31a8372d0c353",
+ id="tls_1_3",
+ value="on",
+ )
+ assert_matches_type(Optional[SettingEditResponse], setting, path=["response"])
+
+ @parametrize
+ async def test_raw_response_edit_overload_50(self, async_client: AsyncCloudflare) -> None:
+ response = await async_client.zones.settings.with_raw_response.edit(
+ "always_online",
+ zone_id="023e105f4ecef8ad9ca31a8372d0c353",
+ id="tls_1_3",
+ value="on",
+ )
+
+ assert response.is_closed is True
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+ setting = await response.parse()
+ assert_matches_type(Optional[SettingEditResponse], setting, path=["response"])
+
+ @parametrize
+ async def test_streaming_response_edit_overload_50(self, async_client: AsyncCloudflare) -> None:
+ async with async_client.zones.settings.with_streaming_response.edit(
+ "always_online",
+ zone_id="023e105f4ecef8ad9ca31a8372d0c353",
+ id="tls_1_3",
+ value="on",
+ ) as response:
+ assert not response.is_closed
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+
+ setting = await response.parse()
+ assert_matches_type(Optional[SettingEditResponse], setting, path=["response"])
+
+ assert cast(Any, response.is_closed) is True
+
+ @parametrize
+ async def test_path_params_edit_overload_50(self, async_client: AsyncCloudflare) -> None:
+ with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"):
+ await async_client.zones.settings.with_raw_response.edit(
+ "always_online",
+ zone_id="",
+ id="tls_1_3",
+ value="on",
+ )
+
+ with pytest.raises(ValueError, match=r"Expected a non-empty value for `setting_id` but received ''"):
+ await async_client.zones.settings.with_raw_response.edit(
+ "",
+ zone_id="023e105f4ecef8ad9ca31a8372d0c353",
+ id="tls_1_3",
+ value="on",
+ )
+
+ @parametrize
+ async def test_method_edit_overload_51(self, async_client: AsyncCloudflare) -> None:
+ setting = await async_client.zones.settings.edit(
+ "always_online",
+ zone_id="023e105f4ecef8ad9ca31a8372d0c353",
+ id="tls_client_auth",
+ value="on",
+ )
+ assert_matches_type(Optional[SettingEditResponse], setting, path=["response"])
+
+ @parametrize
+ async def test_raw_response_edit_overload_51(self, async_client: AsyncCloudflare) -> None:
+ response = await async_client.zones.settings.with_raw_response.edit(
+ "always_online",
+ zone_id="023e105f4ecef8ad9ca31a8372d0c353",
+ id="tls_client_auth",
+ value="on",
+ )
+
+ assert response.is_closed is True
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+ setting = await response.parse()
+ assert_matches_type(Optional[SettingEditResponse], setting, path=["response"])
+
+ @parametrize
+ async def test_streaming_response_edit_overload_51(self, async_client: AsyncCloudflare) -> None:
+ async with async_client.zones.settings.with_streaming_response.edit(
+ "always_online",
+ zone_id="023e105f4ecef8ad9ca31a8372d0c353",
+ id="tls_client_auth",
+ value="on",
+ ) as response:
+ assert not response.is_closed
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+
+ setting = await response.parse()
+ assert_matches_type(Optional[SettingEditResponse], setting, path=["response"])
+
+ assert cast(Any, response.is_closed) is True
+
+ @parametrize
+ async def test_path_params_edit_overload_51(self, async_client: AsyncCloudflare) -> None:
+ with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"):
+ await async_client.zones.settings.with_raw_response.edit(
+ "always_online",
+ zone_id="",
+ id="tls_client_auth",
+ value="on",
+ )
+
+ with pytest.raises(ValueError, match=r"Expected a non-empty value for `setting_id` but received ''"):
+ await async_client.zones.settings.with_raw_response.edit(
+ "",
+ zone_id="023e105f4ecef8ad9ca31a8372d0c353",
+ id="tls_client_auth",
+ value="on",
+ )
+
+ @parametrize
+ async def test_method_edit_overload_52(self, async_client: AsyncCloudflare) -> None:
+ setting = await async_client.zones.settings.edit(
+ "always_online",
+ zone_id="023e105f4ecef8ad9ca31a8372d0c353",
+ id="true_client_ip_header",
+ value="on",
+ )
+ assert_matches_type(Optional[SettingEditResponse], setting, path=["response"])
+
+ @parametrize
+ async def test_raw_response_edit_overload_52(self, async_client: AsyncCloudflare) -> None:
+ response = await async_client.zones.settings.with_raw_response.edit(
+ "always_online",
+ zone_id="023e105f4ecef8ad9ca31a8372d0c353",
+ id="true_client_ip_header",
+ value="on",
+ )
+
+ assert response.is_closed is True
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+ setting = await response.parse()
+ assert_matches_type(Optional[SettingEditResponse], setting, path=["response"])
+
+ @parametrize
+ async def test_streaming_response_edit_overload_52(self, async_client: AsyncCloudflare) -> None:
+ async with async_client.zones.settings.with_streaming_response.edit(
+ "always_online",
+ zone_id="023e105f4ecef8ad9ca31a8372d0c353",
+ id="true_client_ip_header",
+ value="on",
+ ) as response:
+ assert not response.is_closed
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+
+ setting = await response.parse()
+ assert_matches_type(Optional[SettingEditResponse], setting, path=["response"])
+
+ assert cast(Any, response.is_closed) is True
+
+ @parametrize
+ async def test_path_params_edit_overload_52(self, async_client: AsyncCloudflare) -> None:
+ with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"):
+ await async_client.zones.settings.with_raw_response.edit(
+ "always_online",
+ zone_id="",
+ id="true_client_ip_header",
+ value="on",
+ )
+
+ with pytest.raises(ValueError, match=r"Expected a non-empty value for `setting_id` but received ''"):
+ await async_client.zones.settings.with_raw_response.edit(
+ "",
+ zone_id="023e105f4ecef8ad9ca31a8372d0c353",
+ id="true_client_ip_header",
+ value="on",
+ )
+
+ @parametrize
+ async def test_method_edit_overload_53(self, async_client: AsyncCloudflare) -> None:
+ setting = await async_client.zones.settings.edit(
+ "always_online",
+ zone_id="023e105f4ecef8ad9ca31a8372d0c353",
+ id="waf",
+ value="on",
+ )
+ assert_matches_type(Optional[SettingEditResponse], setting, path=["response"])
+
+ @parametrize
+ async def test_raw_response_edit_overload_53(self, async_client: AsyncCloudflare) -> None:
+ response = await async_client.zones.settings.with_raw_response.edit(
+ "always_online",
+ zone_id="023e105f4ecef8ad9ca31a8372d0c353",
+ id="waf",
+ value="on",
+ )
+
+ assert response.is_closed is True
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+ setting = await response.parse()
+ assert_matches_type(Optional[SettingEditResponse], setting, path=["response"])
+
+ @parametrize
+ async def test_streaming_response_edit_overload_53(self, async_client: AsyncCloudflare) -> None:
+ async with async_client.zones.settings.with_streaming_response.edit(
+ "always_online",
+ zone_id="023e105f4ecef8ad9ca31a8372d0c353",
+ id="waf",
+ value="on",
+ ) as response:
+ assert not response.is_closed
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+
+ setting = await response.parse()
+ assert_matches_type(Optional[SettingEditResponse], setting, path=["response"])
+
+ assert cast(Any, response.is_closed) is True
+
+ @parametrize
+ async def test_path_params_edit_overload_53(self, async_client: AsyncCloudflare) -> None:
+ with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"):
+ await async_client.zones.settings.with_raw_response.edit(
+ "always_online",
+ zone_id="",
+ id="waf",
+ value="on",
+ )
+
+ with pytest.raises(ValueError, match=r"Expected a non-empty value for `setting_id` but received ''"):
+ await async_client.zones.settings.with_raw_response.edit(
+ "",
+ zone_id="023e105f4ecef8ad9ca31a8372d0c353",
+ id="waf",
+ value="on",
+ )
+
+ @parametrize
+ async def test_method_edit_overload_54(self, async_client: AsyncCloudflare) -> None:
+ setting = await async_client.zones.settings.edit(
+ "always_online",
+ zone_id="023e105f4ecef8ad9ca31a8372d0c353",
+ id="webp",
+ value="on",
+ )
+ assert_matches_type(Optional[SettingEditResponse], setting, path=["response"])
+
+ @parametrize
+ async def test_raw_response_edit_overload_54(self, async_client: AsyncCloudflare) -> None:
+ response = await async_client.zones.settings.with_raw_response.edit(
+ "always_online",
+ zone_id="023e105f4ecef8ad9ca31a8372d0c353",
+ id="webp",
+ value="on",
+ )
+
+ assert response.is_closed is True
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+ setting = await response.parse()
+ assert_matches_type(Optional[SettingEditResponse], setting, path=["response"])
+
+ @parametrize
+ async def test_streaming_response_edit_overload_54(self, async_client: AsyncCloudflare) -> None:
+ async with async_client.zones.settings.with_streaming_response.edit(
+ "always_online",
+ zone_id="023e105f4ecef8ad9ca31a8372d0c353",
+ id="webp",
+ value="on",
+ ) as response:
+ assert not response.is_closed
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+
+ setting = await response.parse()
+ assert_matches_type(Optional[SettingEditResponse], setting, path=["response"])
+
+ assert cast(Any, response.is_closed) is True
+
+ @parametrize
+ async def test_path_params_edit_overload_54(self, async_client: AsyncCloudflare) -> None:
+ with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"):
+ await async_client.zones.settings.with_raw_response.edit(
+ "always_online",
+ zone_id="",
+ id="webp",
+ value="on",
+ )
+
+ with pytest.raises(ValueError, match=r"Expected a non-empty value for `setting_id` but received ''"):
+ await async_client.zones.settings.with_raw_response.edit(
+ "",
+ zone_id="023e105f4ecef8ad9ca31a8372d0c353",
+ id="webp",
+ value="on",
+ )
@parametrize
- async def test_method_edit(self, async_client: AsyncCloudflare) -> None:
+ async def test_method_edit_overload_55(self, async_client: AsyncCloudflare) -> None:
setting = await async_client.zones.settings.edit(
"always_online",
zone_id="023e105f4ecef8ad9ca31a8372d0c353",
+ id="websockets",
+ value="on",
)
assert_matches_type(Optional[SettingEditResponse], setting, path=["response"])
@parametrize
- async def test_raw_response_edit(self, async_client: AsyncCloudflare) -> None:
+ async def test_raw_response_edit_overload_55(self, async_client: AsyncCloudflare) -> None:
response = await async_client.zones.settings.with_raw_response.edit(
"always_online",
zone_id="023e105f4ecef8ad9ca31a8372d0c353",
+ id="websockets",
+ value="on",
)
assert response.is_closed is True
@@ -138,10 +6599,12 @@ async def test_raw_response_edit(self, async_client: AsyncCloudflare) -> None:
assert_matches_type(Optional[SettingEditResponse], setting, path=["response"])
@parametrize
- async def test_streaming_response_edit(self, async_client: AsyncCloudflare) -> None:
+ async def test_streaming_response_edit_overload_55(self, async_client: AsyncCloudflare) -> None:
async with async_client.zones.settings.with_streaming_response.edit(
"always_online",
zone_id="023e105f4ecef8ad9ca31a8372d0c353",
+ id="websockets",
+ value="on",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
@@ -152,17 +6615,21 @@ async def test_streaming_response_edit(self, async_client: AsyncCloudflare) -> N
assert cast(Any, response.is_closed) is True
@parametrize
- async def test_path_params_edit(self, async_client: AsyncCloudflare) -> None:
+ async def test_path_params_edit_overload_55(self, async_client: AsyncCloudflare) -> None:
with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"):
await async_client.zones.settings.with_raw_response.edit(
"always_online",
zone_id="",
+ id="websockets",
+ value="on",
)
with pytest.raises(ValueError, match=r"Expected a non-empty value for `setting_id` but received ''"):
await async_client.zones.settings.with_raw_response.edit(
"",
zone_id="023e105f4ecef8ad9ca31a8372d0c353",
+ id="websockets",
+ value="on",
)
@parametrize