From a0562ccea6066c7408e3ba5068201f51f371ee06 Mon Sep 17 00:00:00 2001
From: "stainless-app[bot]"
<142633134+stainless-app[bot]@users.noreply.github.com>
Date: Fri, 22 Mar 2024 00:42:42 +0000
Subject: [PATCH] feat(api): update via SDK Studio (#168)
---
.stats.yml | 2 +-
api.md | 42 +-
src/cloudflare/_client.py | 14 +
src/cloudflare/resources/__init__.py | 14 +
.../magic_network_monitoring/__init__.py | 47 ++
.../configs/__init__.py | 33 +
.../configs/configs.py | 512 +++++++++++++++
.../magic_network_monitoring/configs/full.py | 150 +++++
.../magic_network_monitoring.py | 114 ++++
.../rules/__init__.py | 33 +
.../rules/advertisements.py | 156 +++++
.../magic_network_monitoring/rules/rules.py | 602 ++++++++++++++++++
src/cloudflare/resources/zones/__init__.py | 14 +
.../resources/zones/dns_settings.py | 262 ++++++++
src/cloudflare/resources/zones/zones.py | 32 +
.../magic_network_monitoring/__init__.py | 4 +
.../magic_visibility_mnm_config.py | 20 +
.../magic_visibility_mnm_rule.py | 51 ++
.../rule_list_response.py | 9 +
.../rules/__init__.py | 4 +
.../magic_visibility_mnm_rule_advertisable.py | 16 +
src/cloudflare/types/zones/__init__.py | 3 +
.../types/zones/dns_setting_edit_params.py | 22 +
.../types/zones/dns_setting_edit_response.py | 20 +
.../types/zones/dns_setting_get_response.py | 20 +
.../configs/test_full.py | 90 +++
.../rules/test_advertisements.py | 96 +++
.../magic_network_monitoring/test_configs.py | 362 +++++++++++
.../magic_network_monitoring/test_rules.py | 448 +++++++++++++
.../api_resources/zones/test_dns_settings.py | 208 ++++++
30 files changed, 3398 insertions(+), 2 deletions(-)
create mode 100644 src/cloudflare/resources/magic_network_monitoring/__init__.py
create mode 100644 src/cloudflare/resources/magic_network_monitoring/configs/__init__.py
create mode 100644 src/cloudflare/resources/magic_network_monitoring/configs/configs.py
create mode 100644 src/cloudflare/resources/magic_network_monitoring/configs/full.py
create mode 100644 src/cloudflare/resources/magic_network_monitoring/magic_network_monitoring.py
create mode 100644 src/cloudflare/resources/magic_network_monitoring/rules/__init__.py
create mode 100644 src/cloudflare/resources/magic_network_monitoring/rules/advertisements.py
create mode 100644 src/cloudflare/resources/magic_network_monitoring/rules/rules.py
create mode 100644 src/cloudflare/resources/zones/dns_settings.py
create mode 100644 src/cloudflare/types/magic_network_monitoring/magic_visibility_mnm_config.py
create mode 100644 src/cloudflare/types/magic_network_monitoring/magic_visibility_mnm_rule.py
create mode 100644 src/cloudflare/types/magic_network_monitoring/rule_list_response.py
create mode 100644 src/cloudflare/types/magic_network_monitoring/rules/magic_visibility_mnm_rule_advertisable.py
create mode 100644 src/cloudflare/types/zones/dns_setting_edit_params.py
create mode 100644 src/cloudflare/types/zones/dns_setting_edit_response.py
create mode 100644 src/cloudflare/types/zones/dns_setting_get_response.py
create mode 100644 tests/api_resources/magic_network_monitoring/configs/test_full.py
create mode 100644 tests/api_resources/magic_network_monitoring/rules/test_advertisements.py
create mode 100644 tests/api_resources/magic_network_monitoring/test_configs.py
create mode 100644 tests/api_resources/magic_network_monitoring/test_rules.py
create mode 100644 tests/api_resources/zones/test_dns_settings.py
diff --git a/.stats.yml b/.stats.yml
index 1c34ce1f747..81d04672fb2 100644
--- a/.stats.yml
+++ b/.stats.yml
@@ -1 +1 @@
-configured_endpoints: 1275
+configured_endpoints: 1290
diff --git a/api.md b/api.md
index 162b12360f8..56900d5be7e 100644
--- a/api.md
+++ b/api.md
@@ -387,6 +387,19 @@ Methods:
- client.zones.activation_check.trigger(\*, zone_id) -> ActivationCheckTriggerResponse
+## DNSSettings
+
+Types:
+
+```python
+from cloudflare.types.zones import DNSSettingEditResponse, DNSSettingGetResponse
+```
+
+Methods:
+
+- client.zones.dns_settings.edit(\*, zone_id, \*\*params) -> DNSSettingEditResponse
+- client.zones.dns_settings.get(\*, zone_id) -> DNSSettingGetResponse
+
## Settings
Types:
@@ -3938,14 +3951,37 @@ Types:
from cloudflare.types.magic_network_monitoring import MagicVisibilityMNMConfig
```
+Methods:
+
+- client.magic_network_monitoring.configs.create(\*, account_id) -> MagicVisibilityMNMConfig
+- client.magic_network_monitoring.configs.update(\*, account_id) -> MagicVisibilityMNMConfig
+- client.magic_network_monitoring.configs.delete(\*, account_id) -> MagicVisibilityMNMConfig
+- client.magic_network_monitoring.configs.edit(\*, account_id) -> MagicVisibilityMNMConfig
+- client.magic_network_monitoring.configs.get(\*, account_id) -> MagicVisibilityMNMConfig
+
+### Full
+
+Methods:
+
+- client.magic_network_monitoring.configs.full.get(\*, account_id) -> MagicVisibilityMNMConfig
+
## Rules
Types:
```python
-from cloudflare.types.magic_network_monitoring import MagicVisibilityMNMRule
+from cloudflare.types.magic_network_monitoring import MagicVisibilityMNMRule, RuleListResponse
```
+Methods:
+
+- client.magic_network_monitoring.rules.create(\*, account_id) -> Optional
+- client.magic_network_monitoring.rules.update(\*, account_id) -> Optional
+- client.magic_network_monitoring.rules.list(\*, account_id) -> Optional
+- client.magic_network_monitoring.rules.delete(rule_id, \*, account_id) -> Optional
+- client.magic_network_monitoring.rules.edit(rule_id, \*, account_id) -> Optional
+- client.magic_network_monitoring.rules.get(rule_id, \*, account_id) -> Optional
+
### Advertisements
Types:
@@ -3954,6 +3990,10 @@ Types:
from cloudflare.types.magic_network_monitoring.rules import MagicVisibilityMNMRuleAdvertisable
```
+Methods:
+
+- client.magic_network_monitoring.rules.advertisements.edit(rule_id, \*, account_id) -> Optional
+
# MTLSCertificates
Types:
diff --git a/src/cloudflare/_client.py b/src/cloudflare/_client.py
index 4ee77c97c2b..970437dd25b 100644
--- a/src/cloudflare/_client.py
+++ b/src/cloudflare/_client.py
@@ -98,6 +98,7 @@ class Cloudflare(SyncAPIClient):
images: resources.Images
intel: resources.Intel
magic_transit: resources.MagicTransit
+ magic_network_monitoring: resources.MagicNetworkMonitoring
mtls_certificates: resources.MTLSCertificates
pages: resources.Pages
pcaps: resources.PCAPs
@@ -250,6 +251,7 @@ def __init__(
self.images = resources.Images(self)
self.intel = resources.Intel(self)
self.magic_transit = resources.MagicTransit(self)
+ self.magic_network_monitoring = resources.MagicNetworkMonitoring(self)
self.mtls_certificates = resources.MTLSCertificates(self)
self.pages = resources.Pages(self)
self.pcaps = resources.PCAPs(self)
@@ -507,6 +509,7 @@ class AsyncCloudflare(AsyncAPIClient):
images: resources.AsyncImages
intel: resources.AsyncIntel
magic_transit: resources.AsyncMagicTransit
+ magic_network_monitoring: resources.AsyncMagicNetworkMonitoring
mtls_certificates: resources.AsyncMTLSCertificates
pages: resources.AsyncPages
pcaps: resources.AsyncPCAPs
@@ -659,6 +662,7 @@ def __init__(
self.images = resources.AsyncImages(self)
self.intel = resources.AsyncIntel(self)
self.magic_transit = resources.AsyncMagicTransit(self)
+ self.magic_network_monitoring = resources.AsyncMagicNetworkMonitoring(self)
self.mtls_certificates = resources.AsyncMTLSCertificates(self)
self.pages = resources.AsyncPages(self)
self.pcaps = resources.AsyncPCAPs(self)
@@ -917,6 +921,7 @@ def __init__(self, client: Cloudflare) -> None:
self.images = resources.ImagesWithRawResponse(client.images)
self.intel = resources.IntelWithRawResponse(client.intel)
self.magic_transit = resources.MagicTransitWithRawResponse(client.magic_transit)
+ self.magic_network_monitoring = resources.MagicNetworkMonitoringWithRawResponse(client.magic_network_monitoring)
self.mtls_certificates = resources.MTLSCertificatesWithRawResponse(client.mtls_certificates)
self.pages = resources.PagesWithRawResponse(client.pages)
self.pcaps = resources.PCAPsWithRawResponse(client.pcaps)
@@ -1004,6 +1009,9 @@ def __init__(self, client: AsyncCloudflare) -> None:
self.images = resources.AsyncImagesWithRawResponse(client.images)
self.intel = resources.AsyncIntelWithRawResponse(client.intel)
self.magic_transit = resources.AsyncMagicTransitWithRawResponse(client.magic_transit)
+ self.magic_network_monitoring = resources.AsyncMagicNetworkMonitoringWithRawResponse(
+ client.magic_network_monitoring
+ )
self.mtls_certificates = resources.AsyncMTLSCertificatesWithRawResponse(client.mtls_certificates)
self.pages = resources.AsyncPagesWithRawResponse(client.pages)
self.pcaps = resources.AsyncPCAPsWithRawResponse(client.pcaps)
@@ -1091,6 +1099,9 @@ def __init__(self, client: Cloudflare) -> None:
self.images = resources.ImagesWithStreamingResponse(client.images)
self.intel = resources.IntelWithStreamingResponse(client.intel)
self.magic_transit = resources.MagicTransitWithStreamingResponse(client.magic_transit)
+ self.magic_network_monitoring = resources.MagicNetworkMonitoringWithStreamingResponse(
+ client.magic_network_monitoring
+ )
self.mtls_certificates = resources.MTLSCertificatesWithStreamingResponse(client.mtls_certificates)
self.pages = resources.PagesWithStreamingResponse(client.pages)
self.pcaps = resources.PCAPsWithStreamingResponse(client.pcaps)
@@ -1182,6 +1193,9 @@ def __init__(self, client: AsyncCloudflare) -> None:
self.images = resources.AsyncImagesWithStreamingResponse(client.images)
self.intel = resources.AsyncIntelWithStreamingResponse(client.intel)
self.magic_transit = resources.AsyncMagicTransitWithStreamingResponse(client.magic_transit)
+ self.magic_network_monitoring = resources.AsyncMagicNetworkMonitoringWithStreamingResponse(
+ client.magic_network_monitoring
+ )
self.mtls_certificates = resources.AsyncMTLSCertificatesWithStreamingResponse(client.mtls_certificates)
self.pages = resources.AsyncPagesWithStreamingResponse(client.pages)
self.pcaps = resources.AsyncPCAPsWithStreamingResponse(client.pcaps)
diff --git a/src/cloudflare/resources/__init__.py b/src/cloudflare/resources/__init__.py
index 7c822596d8a..2c1ab6cf2c3 100644
--- a/src/cloudflare/resources/__init__.py
+++ b/src/cloudflare/resources/__init__.py
@@ -624,6 +624,14 @@
CertificateAuthoritiesWithStreamingResponse,
AsyncCertificateAuthoritiesWithStreamingResponse,
)
+from .magic_network_monitoring import (
+ MagicNetworkMonitoring,
+ AsyncMagicNetworkMonitoring,
+ MagicNetworkMonitoringWithRawResponse,
+ AsyncMagicNetworkMonitoringWithRawResponse,
+ MagicNetworkMonitoringWithStreamingResponse,
+ AsyncMagicNetworkMonitoringWithStreamingResponse,
+)
from .origin_post_quantum_encryption import (
OriginPostQuantumEncryption,
AsyncOriginPostQuantumEncryption,
@@ -940,6 +948,12 @@
"AsyncMagicTransitWithRawResponse",
"MagicTransitWithStreamingResponse",
"AsyncMagicTransitWithStreamingResponse",
+ "MagicNetworkMonitoring",
+ "AsyncMagicNetworkMonitoring",
+ "MagicNetworkMonitoringWithRawResponse",
+ "AsyncMagicNetworkMonitoringWithRawResponse",
+ "MagicNetworkMonitoringWithStreamingResponse",
+ "AsyncMagicNetworkMonitoringWithStreamingResponse",
"MTLSCertificates",
"AsyncMTLSCertificates",
"MTLSCertificatesWithRawResponse",
diff --git a/src/cloudflare/resources/magic_network_monitoring/__init__.py b/src/cloudflare/resources/magic_network_monitoring/__init__.py
new file mode 100644
index 00000000000..3149fd83017
--- /dev/null
+++ b/src/cloudflare/resources/magic_network_monitoring/__init__.py
@@ -0,0 +1,47 @@
+# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
+
+from .rules import (
+ Rules,
+ AsyncRules,
+ RulesWithRawResponse,
+ AsyncRulesWithRawResponse,
+ RulesWithStreamingResponse,
+ AsyncRulesWithStreamingResponse,
+)
+from .configs import (
+ Configs,
+ AsyncConfigs,
+ ConfigsWithRawResponse,
+ AsyncConfigsWithRawResponse,
+ ConfigsWithStreamingResponse,
+ AsyncConfigsWithStreamingResponse,
+)
+from .magic_network_monitoring import (
+ MagicNetworkMonitoring,
+ AsyncMagicNetworkMonitoring,
+ MagicNetworkMonitoringWithRawResponse,
+ AsyncMagicNetworkMonitoringWithRawResponse,
+ MagicNetworkMonitoringWithStreamingResponse,
+ AsyncMagicNetworkMonitoringWithStreamingResponse,
+)
+
+__all__ = [
+ "Configs",
+ "AsyncConfigs",
+ "ConfigsWithRawResponse",
+ "AsyncConfigsWithRawResponse",
+ "ConfigsWithStreamingResponse",
+ "AsyncConfigsWithStreamingResponse",
+ "Rules",
+ "AsyncRules",
+ "RulesWithRawResponse",
+ "AsyncRulesWithRawResponse",
+ "RulesWithStreamingResponse",
+ "AsyncRulesWithStreamingResponse",
+ "MagicNetworkMonitoring",
+ "AsyncMagicNetworkMonitoring",
+ "MagicNetworkMonitoringWithRawResponse",
+ "AsyncMagicNetworkMonitoringWithRawResponse",
+ "MagicNetworkMonitoringWithStreamingResponse",
+ "AsyncMagicNetworkMonitoringWithStreamingResponse",
+]
diff --git a/src/cloudflare/resources/magic_network_monitoring/configs/__init__.py b/src/cloudflare/resources/magic_network_monitoring/configs/__init__.py
new file mode 100644
index 00000000000..3925a938c90
--- /dev/null
+++ b/src/cloudflare/resources/magic_network_monitoring/configs/__init__.py
@@ -0,0 +1,33 @@
+# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
+
+from .full import (
+ Full,
+ AsyncFull,
+ FullWithRawResponse,
+ AsyncFullWithRawResponse,
+ FullWithStreamingResponse,
+ AsyncFullWithStreamingResponse,
+)
+from .configs import (
+ Configs,
+ AsyncConfigs,
+ ConfigsWithRawResponse,
+ AsyncConfigsWithRawResponse,
+ ConfigsWithStreamingResponse,
+ AsyncConfigsWithStreamingResponse,
+)
+
+__all__ = [
+ "Full",
+ "AsyncFull",
+ "FullWithRawResponse",
+ "AsyncFullWithRawResponse",
+ "FullWithStreamingResponse",
+ "AsyncFullWithStreamingResponse",
+ "Configs",
+ "AsyncConfigs",
+ "ConfigsWithRawResponse",
+ "AsyncConfigsWithRawResponse",
+ "ConfigsWithStreamingResponse",
+ "AsyncConfigsWithStreamingResponse",
+]
diff --git a/src/cloudflare/resources/magic_network_monitoring/configs/configs.py b/src/cloudflare/resources/magic_network_monitoring/configs/configs.py
new file mode 100644
index 00000000000..b6d2993b6fc
--- /dev/null
+++ b/src/cloudflare/resources/magic_network_monitoring/configs/configs.py
@@ -0,0 +1,512 @@
+# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
+
+from __future__ import annotations
+
+from typing import Type, cast
+
+import httpx
+
+from .full import (
+ Full,
+ AsyncFull,
+ FullWithRawResponse,
+ AsyncFullWithRawResponse,
+ FullWithStreamingResponse,
+ AsyncFullWithStreamingResponse,
+)
+from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven
+from ...._compat import cached_property
+from ...._resource import SyncAPIResource, AsyncAPIResource
+from ...._response import (
+ to_raw_response_wrapper,
+ to_streamed_response_wrapper,
+ async_to_raw_response_wrapper,
+ async_to_streamed_response_wrapper,
+)
+from ...._wrappers import ResultWrapper
+from ...._base_client import (
+ make_request_options,
+)
+from ....types.magic_network_monitoring import MagicVisibilityMNMConfig
+
+__all__ = ["Configs", "AsyncConfigs"]
+
+
+class Configs(SyncAPIResource):
+ @cached_property
+ def full(self) -> Full:
+ return Full(self._client)
+
+ @cached_property
+ def with_raw_response(self) -> ConfigsWithRawResponse:
+ return ConfigsWithRawResponse(self)
+
+ @cached_property
+ def with_streaming_response(self) -> ConfigsWithStreamingResponse:
+ return ConfigsWithStreamingResponse(self)
+
+ def create(
+ self,
+ *,
+ account_id: object,
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
+ # The extra values given here take precedence over values defined on the client or passed to this method.
+ extra_headers: Headers | None = None,
+ extra_query: Query | None = None,
+ extra_body: Body | None = None,
+ timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
+ ) -> MagicVisibilityMNMConfig:
+ """
+ Create a new network monitoring configuration.
+
+ Args:
+ extra_headers: Send extra headers
+
+ extra_query: Add additional query parameters to the request
+
+ extra_body: Add additional JSON properties to the request
+
+ timeout: Override the client-level default timeout for this request, in seconds
+ """
+ return self._post(
+ f"/accounts/{account_id}/mnm/config",
+ options=make_request_options(
+ extra_headers=extra_headers,
+ extra_query=extra_query,
+ extra_body=extra_body,
+ timeout=timeout,
+ post_parser=ResultWrapper._unwrapper,
+ ),
+ cast_to=cast(Type[MagicVisibilityMNMConfig], ResultWrapper[MagicVisibilityMNMConfig]),
+ )
+
+ def update(
+ self,
+ *,
+ account_id: object,
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
+ # The extra values given here take precedence over values defined on the client or passed to this method.
+ extra_headers: Headers | None = None,
+ extra_query: Query | None = None,
+ extra_body: Body | None = None,
+ timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
+ ) -> MagicVisibilityMNMConfig:
+ """
+ Update an existing network monitoring configuration, requires the entire
+ configuration to be updated at once.
+
+ Args:
+ extra_headers: Send extra headers
+
+ extra_query: Add additional query parameters to the request
+
+ extra_body: Add additional JSON properties to the request
+
+ timeout: Override the client-level default timeout for this request, in seconds
+ """
+ return self._put(
+ f"/accounts/{account_id}/mnm/config",
+ options=make_request_options(
+ extra_headers=extra_headers,
+ extra_query=extra_query,
+ extra_body=extra_body,
+ timeout=timeout,
+ post_parser=ResultWrapper._unwrapper,
+ ),
+ cast_to=cast(Type[MagicVisibilityMNMConfig], ResultWrapper[MagicVisibilityMNMConfig]),
+ )
+
+ def delete(
+ self,
+ *,
+ account_id: object,
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
+ # The extra values given here take precedence over values defined on the client or passed to this method.
+ extra_headers: Headers | None = None,
+ extra_query: Query | None = None,
+ extra_body: Body | None = None,
+ timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
+ ) -> MagicVisibilityMNMConfig:
+ """
+ Delete an existing network monitoring configuration.
+
+ Args:
+ extra_headers: Send extra headers
+
+ extra_query: Add additional query parameters to the request
+
+ extra_body: Add additional JSON properties to the request
+
+ timeout: Override the client-level default timeout for this request, in seconds
+ """
+ return self._delete(
+ f"/accounts/{account_id}/mnm/config",
+ options=make_request_options(
+ extra_headers=extra_headers,
+ extra_query=extra_query,
+ extra_body=extra_body,
+ timeout=timeout,
+ post_parser=ResultWrapper._unwrapper,
+ ),
+ cast_to=cast(Type[MagicVisibilityMNMConfig], ResultWrapper[MagicVisibilityMNMConfig]),
+ )
+
+ def edit(
+ self,
+ *,
+ account_id: object,
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
+ # The extra values given here take precedence over values defined on the client or passed to this method.
+ extra_headers: Headers | None = None,
+ extra_query: Query | None = None,
+ extra_body: Body | None = None,
+ timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
+ ) -> MagicVisibilityMNMConfig:
+ """
+ Update fields in an existing network monitoring configuration.
+
+ Args:
+ extra_headers: Send extra headers
+
+ extra_query: Add additional query parameters to the request
+
+ extra_body: Add additional JSON properties to the request
+
+ timeout: Override the client-level default timeout for this request, in seconds
+ """
+ return self._patch(
+ f"/accounts/{account_id}/mnm/config",
+ options=make_request_options(
+ extra_headers=extra_headers,
+ extra_query=extra_query,
+ extra_body=extra_body,
+ timeout=timeout,
+ post_parser=ResultWrapper._unwrapper,
+ ),
+ cast_to=cast(Type[MagicVisibilityMNMConfig], ResultWrapper[MagicVisibilityMNMConfig]),
+ )
+
+ def get(
+ self,
+ *,
+ account_id: object,
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
+ # The extra values given here take precedence over values defined on the client or passed to this method.
+ extra_headers: Headers | None = None,
+ extra_query: Query | None = None,
+ extra_body: Body | None = None,
+ timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
+ ) -> MagicVisibilityMNMConfig:
+ """
+ Lists default sampling and router IPs for account.
+
+ Args:
+ extra_headers: Send extra headers
+
+ extra_query: Add additional query parameters to the request
+
+ extra_body: Add additional JSON properties to the request
+
+ timeout: Override the client-level default timeout for this request, in seconds
+ """
+ return self._get(
+ f"/accounts/{account_id}/mnm/config",
+ options=make_request_options(
+ extra_headers=extra_headers,
+ extra_query=extra_query,
+ extra_body=extra_body,
+ timeout=timeout,
+ post_parser=ResultWrapper._unwrapper,
+ ),
+ cast_to=cast(Type[MagicVisibilityMNMConfig], ResultWrapper[MagicVisibilityMNMConfig]),
+ )
+
+
+class AsyncConfigs(AsyncAPIResource):
+ @cached_property
+ def full(self) -> AsyncFull:
+ return AsyncFull(self._client)
+
+ @cached_property
+ def with_raw_response(self) -> AsyncConfigsWithRawResponse:
+ return AsyncConfigsWithRawResponse(self)
+
+ @cached_property
+ def with_streaming_response(self) -> AsyncConfigsWithStreamingResponse:
+ return AsyncConfigsWithStreamingResponse(self)
+
+ async def create(
+ self,
+ *,
+ account_id: object,
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
+ # The extra values given here take precedence over values defined on the client or passed to this method.
+ extra_headers: Headers | None = None,
+ extra_query: Query | None = None,
+ extra_body: Body | None = None,
+ timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
+ ) -> MagicVisibilityMNMConfig:
+ """
+ Create a new network monitoring configuration.
+
+ Args:
+ extra_headers: Send extra headers
+
+ extra_query: Add additional query parameters to the request
+
+ extra_body: Add additional JSON properties to the request
+
+ timeout: Override the client-level default timeout for this request, in seconds
+ """
+ return await self._post(
+ f"/accounts/{account_id}/mnm/config",
+ options=make_request_options(
+ extra_headers=extra_headers,
+ extra_query=extra_query,
+ extra_body=extra_body,
+ timeout=timeout,
+ post_parser=ResultWrapper._unwrapper,
+ ),
+ cast_to=cast(Type[MagicVisibilityMNMConfig], ResultWrapper[MagicVisibilityMNMConfig]),
+ )
+
+ async def update(
+ self,
+ *,
+ account_id: object,
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
+ # The extra values given here take precedence over values defined on the client or passed to this method.
+ extra_headers: Headers | None = None,
+ extra_query: Query | None = None,
+ extra_body: Body | None = None,
+ timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
+ ) -> MagicVisibilityMNMConfig:
+ """
+ Update an existing network monitoring configuration, requires the entire
+ configuration to be updated at once.
+
+ Args:
+ extra_headers: Send extra headers
+
+ extra_query: Add additional query parameters to the request
+
+ extra_body: Add additional JSON properties to the request
+
+ timeout: Override the client-level default timeout for this request, in seconds
+ """
+ return await self._put(
+ f"/accounts/{account_id}/mnm/config",
+ options=make_request_options(
+ extra_headers=extra_headers,
+ extra_query=extra_query,
+ extra_body=extra_body,
+ timeout=timeout,
+ post_parser=ResultWrapper._unwrapper,
+ ),
+ cast_to=cast(Type[MagicVisibilityMNMConfig], ResultWrapper[MagicVisibilityMNMConfig]),
+ )
+
+ async def delete(
+ self,
+ *,
+ account_id: object,
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
+ # The extra values given here take precedence over values defined on the client or passed to this method.
+ extra_headers: Headers | None = None,
+ extra_query: Query | None = None,
+ extra_body: Body | None = None,
+ timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
+ ) -> MagicVisibilityMNMConfig:
+ """
+ Delete an existing network monitoring configuration.
+
+ Args:
+ extra_headers: Send extra headers
+
+ extra_query: Add additional query parameters to the request
+
+ extra_body: Add additional JSON properties to the request
+
+ timeout: Override the client-level default timeout for this request, in seconds
+ """
+ return await self._delete(
+ f"/accounts/{account_id}/mnm/config",
+ options=make_request_options(
+ extra_headers=extra_headers,
+ extra_query=extra_query,
+ extra_body=extra_body,
+ timeout=timeout,
+ post_parser=ResultWrapper._unwrapper,
+ ),
+ cast_to=cast(Type[MagicVisibilityMNMConfig], ResultWrapper[MagicVisibilityMNMConfig]),
+ )
+
+ async def edit(
+ self,
+ *,
+ account_id: object,
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
+ # The extra values given here take precedence over values defined on the client or passed to this method.
+ extra_headers: Headers | None = None,
+ extra_query: Query | None = None,
+ extra_body: Body | None = None,
+ timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
+ ) -> MagicVisibilityMNMConfig:
+ """
+ Update fields in an existing network monitoring configuration.
+
+ Args:
+ extra_headers: Send extra headers
+
+ extra_query: Add additional query parameters to the request
+
+ extra_body: Add additional JSON properties to the request
+
+ timeout: Override the client-level default timeout for this request, in seconds
+ """
+ return await self._patch(
+ f"/accounts/{account_id}/mnm/config",
+ options=make_request_options(
+ extra_headers=extra_headers,
+ extra_query=extra_query,
+ extra_body=extra_body,
+ timeout=timeout,
+ post_parser=ResultWrapper._unwrapper,
+ ),
+ cast_to=cast(Type[MagicVisibilityMNMConfig], ResultWrapper[MagicVisibilityMNMConfig]),
+ )
+
+ async def get(
+ self,
+ *,
+ account_id: object,
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
+ # The extra values given here take precedence over values defined on the client or passed to this method.
+ extra_headers: Headers | None = None,
+ extra_query: Query | None = None,
+ extra_body: Body | None = None,
+ timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
+ ) -> MagicVisibilityMNMConfig:
+ """
+ Lists default sampling and router IPs for account.
+
+ Args:
+ extra_headers: Send extra headers
+
+ extra_query: Add additional query parameters to the request
+
+ extra_body: Add additional JSON properties to the request
+
+ timeout: Override the client-level default timeout for this request, in seconds
+ """
+ return await self._get(
+ f"/accounts/{account_id}/mnm/config",
+ options=make_request_options(
+ extra_headers=extra_headers,
+ extra_query=extra_query,
+ extra_body=extra_body,
+ timeout=timeout,
+ post_parser=ResultWrapper._unwrapper,
+ ),
+ cast_to=cast(Type[MagicVisibilityMNMConfig], ResultWrapper[MagicVisibilityMNMConfig]),
+ )
+
+
+class ConfigsWithRawResponse:
+ def __init__(self, configs: Configs) -> None:
+ self._configs = configs
+
+ self.create = to_raw_response_wrapper(
+ configs.create,
+ )
+ self.update = to_raw_response_wrapper(
+ configs.update,
+ )
+ self.delete = to_raw_response_wrapper(
+ configs.delete,
+ )
+ self.edit = to_raw_response_wrapper(
+ configs.edit,
+ )
+ self.get = to_raw_response_wrapper(
+ configs.get,
+ )
+
+ @cached_property
+ def full(self) -> FullWithRawResponse:
+ return FullWithRawResponse(self._configs.full)
+
+
+class AsyncConfigsWithRawResponse:
+ def __init__(self, configs: AsyncConfigs) -> None:
+ self._configs = configs
+
+ self.create = async_to_raw_response_wrapper(
+ configs.create,
+ )
+ self.update = async_to_raw_response_wrapper(
+ configs.update,
+ )
+ self.delete = async_to_raw_response_wrapper(
+ configs.delete,
+ )
+ self.edit = async_to_raw_response_wrapper(
+ configs.edit,
+ )
+ self.get = async_to_raw_response_wrapper(
+ configs.get,
+ )
+
+ @cached_property
+ def full(self) -> AsyncFullWithRawResponse:
+ return AsyncFullWithRawResponse(self._configs.full)
+
+
+class ConfigsWithStreamingResponse:
+ def __init__(self, configs: Configs) -> None:
+ self._configs = configs
+
+ self.create = to_streamed_response_wrapper(
+ configs.create,
+ )
+ self.update = to_streamed_response_wrapper(
+ configs.update,
+ )
+ self.delete = to_streamed_response_wrapper(
+ configs.delete,
+ )
+ self.edit = to_streamed_response_wrapper(
+ configs.edit,
+ )
+ self.get = to_streamed_response_wrapper(
+ configs.get,
+ )
+
+ @cached_property
+ def full(self) -> FullWithStreamingResponse:
+ return FullWithStreamingResponse(self._configs.full)
+
+
+class AsyncConfigsWithStreamingResponse:
+ def __init__(self, configs: AsyncConfigs) -> None:
+ self._configs = configs
+
+ self.create = async_to_streamed_response_wrapper(
+ configs.create,
+ )
+ self.update = async_to_streamed_response_wrapper(
+ configs.update,
+ )
+ self.delete = async_to_streamed_response_wrapper(
+ configs.delete,
+ )
+ self.edit = async_to_streamed_response_wrapper(
+ configs.edit,
+ )
+ self.get = async_to_streamed_response_wrapper(
+ configs.get,
+ )
+
+ @cached_property
+ def full(self) -> AsyncFullWithStreamingResponse:
+ return AsyncFullWithStreamingResponse(self._configs.full)
diff --git a/src/cloudflare/resources/magic_network_monitoring/configs/full.py b/src/cloudflare/resources/magic_network_monitoring/configs/full.py
new file mode 100644
index 00000000000..b5671ded605
--- /dev/null
+++ b/src/cloudflare/resources/magic_network_monitoring/configs/full.py
@@ -0,0 +1,150 @@
+# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
+
+from __future__ import annotations
+
+from typing import Type, cast
+
+import httpx
+
+from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven
+from ...._compat import cached_property
+from ...._resource import SyncAPIResource, AsyncAPIResource
+from ...._response import (
+ to_raw_response_wrapper,
+ to_streamed_response_wrapper,
+ async_to_raw_response_wrapper,
+ async_to_streamed_response_wrapper,
+)
+from ...._wrappers import ResultWrapper
+from ...._base_client import (
+ make_request_options,
+)
+from ....types.magic_network_monitoring import MagicVisibilityMNMConfig
+
+__all__ = ["Full", "AsyncFull"]
+
+
+class Full(SyncAPIResource):
+ @cached_property
+ def with_raw_response(self) -> FullWithRawResponse:
+ return FullWithRawResponse(self)
+
+ @cached_property
+ def with_streaming_response(self) -> FullWithStreamingResponse:
+ return FullWithStreamingResponse(self)
+
+ def get(
+ self,
+ *,
+ account_id: object,
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
+ # The extra values given here take precedence over values defined on the client or passed to this method.
+ extra_headers: Headers | None = None,
+ extra_query: Query | None = None,
+ extra_body: Body | None = None,
+ timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
+ ) -> MagicVisibilityMNMConfig:
+ """
+ Lists default sampling, router IPs, and rules for account.
+
+ Args:
+ extra_headers: Send extra headers
+
+ extra_query: Add additional query parameters to the request
+
+ extra_body: Add additional JSON properties to the request
+
+ timeout: Override the client-level default timeout for this request, in seconds
+ """
+ return self._get(
+ f"/accounts/{account_id}/mnm/config/full",
+ options=make_request_options(
+ extra_headers=extra_headers,
+ extra_query=extra_query,
+ extra_body=extra_body,
+ timeout=timeout,
+ post_parser=ResultWrapper._unwrapper,
+ ),
+ cast_to=cast(Type[MagicVisibilityMNMConfig], ResultWrapper[MagicVisibilityMNMConfig]),
+ )
+
+
+class AsyncFull(AsyncAPIResource):
+ @cached_property
+ def with_raw_response(self) -> AsyncFullWithRawResponse:
+ return AsyncFullWithRawResponse(self)
+
+ @cached_property
+ def with_streaming_response(self) -> AsyncFullWithStreamingResponse:
+ return AsyncFullWithStreamingResponse(self)
+
+ async def get(
+ self,
+ *,
+ account_id: object,
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
+ # The extra values given here take precedence over values defined on the client or passed to this method.
+ extra_headers: Headers | None = None,
+ extra_query: Query | None = None,
+ extra_body: Body | None = None,
+ timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
+ ) -> MagicVisibilityMNMConfig:
+ """
+ Lists default sampling, router IPs, and rules for account.
+
+ Args:
+ extra_headers: Send extra headers
+
+ extra_query: Add additional query parameters to the request
+
+ extra_body: Add additional JSON properties to the request
+
+ timeout: Override the client-level default timeout for this request, in seconds
+ """
+ return await self._get(
+ f"/accounts/{account_id}/mnm/config/full",
+ options=make_request_options(
+ extra_headers=extra_headers,
+ extra_query=extra_query,
+ extra_body=extra_body,
+ timeout=timeout,
+ post_parser=ResultWrapper._unwrapper,
+ ),
+ cast_to=cast(Type[MagicVisibilityMNMConfig], ResultWrapper[MagicVisibilityMNMConfig]),
+ )
+
+
+class FullWithRawResponse:
+ def __init__(self, full: Full) -> None:
+ self._full = full
+
+ self.get = to_raw_response_wrapper(
+ full.get,
+ )
+
+
+class AsyncFullWithRawResponse:
+ def __init__(self, full: AsyncFull) -> None:
+ self._full = full
+
+ self.get = async_to_raw_response_wrapper(
+ full.get,
+ )
+
+
+class FullWithStreamingResponse:
+ def __init__(self, full: Full) -> None:
+ self._full = full
+
+ self.get = to_streamed_response_wrapper(
+ full.get,
+ )
+
+
+class AsyncFullWithStreamingResponse:
+ def __init__(self, full: AsyncFull) -> None:
+ self._full = full
+
+ self.get = async_to_streamed_response_wrapper(
+ full.get,
+ )
diff --git a/src/cloudflare/resources/magic_network_monitoring/magic_network_monitoring.py b/src/cloudflare/resources/magic_network_monitoring/magic_network_monitoring.py
new file mode 100644
index 00000000000..024fa234d68
--- /dev/null
+++ b/src/cloudflare/resources/magic_network_monitoring/magic_network_monitoring.py
@@ -0,0 +1,114 @@
+# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
+
+from __future__ import annotations
+
+from .rules import (
+ Rules,
+ AsyncRules,
+ RulesWithRawResponse,
+ AsyncRulesWithRawResponse,
+ RulesWithStreamingResponse,
+ AsyncRulesWithStreamingResponse,
+)
+from .configs import (
+ Configs,
+ AsyncConfigs,
+ ConfigsWithRawResponse,
+ AsyncConfigsWithRawResponse,
+ ConfigsWithStreamingResponse,
+ AsyncConfigsWithStreamingResponse,
+)
+from ..._compat import cached_property
+from ..._resource import SyncAPIResource, AsyncAPIResource
+from .rules.rules import Rules, AsyncRules
+from .configs.configs import Configs, AsyncConfigs
+
+__all__ = ["MagicNetworkMonitoring", "AsyncMagicNetworkMonitoring"]
+
+
+class MagicNetworkMonitoring(SyncAPIResource):
+ @cached_property
+ def configs(self) -> Configs:
+ return Configs(self._client)
+
+ @cached_property
+ def rules(self) -> Rules:
+ return Rules(self._client)
+
+ @cached_property
+ def with_raw_response(self) -> MagicNetworkMonitoringWithRawResponse:
+ return MagicNetworkMonitoringWithRawResponse(self)
+
+ @cached_property
+ def with_streaming_response(self) -> MagicNetworkMonitoringWithStreamingResponse:
+ return MagicNetworkMonitoringWithStreamingResponse(self)
+
+
+class AsyncMagicNetworkMonitoring(AsyncAPIResource):
+ @cached_property
+ def configs(self) -> AsyncConfigs:
+ return AsyncConfigs(self._client)
+
+ @cached_property
+ def rules(self) -> AsyncRules:
+ return AsyncRules(self._client)
+
+ @cached_property
+ def with_raw_response(self) -> AsyncMagicNetworkMonitoringWithRawResponse:
+ return AsyncMagicNetworkMonitoringWithRawResponse(self)
+
+ @cached_property
+ def with_streaming_response(self) -> AsyncMagicNetworkMonitoringWithStreamingResponse:
+ return AsyncMagicNetworkMonitoringWithStreamingResponse(self)
+
+
+class MagicNetworkMonitoringWithRawResponse:
+ def __init__(self, magic_network_monitoring: MagicNetworkMonitoring) -> None:
+ self._magic_network_monitoring = magic_network_monitoring
+
+ @cached_property
+ def configs(self) -> ConfigsWithRawResponse:
+ return ConfigsWithRawResponse(self._magic_network_monitoring.configs)
+
+ @cached_property
+ def rules(self) -> RulesWithRawResponse:
+ return RulesWithRawResponse(self._magic_network_monitoring.rules)
+
+
+class AsyncMagicNetworkMonitoringWithRawResponse:
+ def __init__(self, magic_network_monitoring: AsyncMagicNetworkMonitoring) -> None:
+ self._magic_network_monitoring = magic_network_monitoring
+
+ @cached_property
+ def configs(self) -> AsyncConfigsWithRawResponse:
+ return AsyncConfigsWithRawResponse(self._magic_network_monitoring.configs)
+
+ @cached_property
+ def rules(self) -> AsyncRulesWithRawResponse:
+ return AsyncRulesWithRawResponse(self._magic_network_monitoring.rules)
+
+
+class MagicNetworkMonitoringWithStreamingResponse:
+ def __init__(self, magic_network_monitoring: MagicNetworkMonitoring) -> None:
+ self._magic_network_monitoring = magic_network_monitoring
+
+ @cached_property
+ def configs(self) -> ConfigsWithStreamingResponse:
+ return ConfigsWithStreamingResponse(self._magic_network_monitoring.configs)
+
+ @cached_property
+ def rules(self) -> RulesWithStreamingResponse:
+ return RulesWithStreamingResponse(self._magic_network_monitoring.rules)
+
+
+class AsyncMagicNetworkMonitoringWithStreamingResponse:
+ def __init__(self, magic_network_monitoring: AsyncMagicNetworkMonitoring) -> None:
+ self._magic_network_monitoring = magic_network_monitoring
+
+ @cached_property
+ def configs(self) -> AsyncConfigsWithStreamingResponse:
+ return AsyncConfigsWithStreamingResponse(self._magic_network_monitoring.configs)
+
+ @cached_property
+ def rules(self) -> AsyncRulesWithStreamingResponse:
+ return AsyncRulesWithStreamingResponse(self._magic_network_monitoring.rules)
diff --git a/src/cloudflare/resources/magic_network_monitoring/rules/__init__.py b/src/cloudflare/resources/magic_network_monitoring/rules/__init__.py
new file mode 100644
index 00000000000..cba78cae500
--- /dev/null
+++ b/src/cloudflare/resources/magic_network_monitoring/rules/__init__.py
@@ -0,0 +1,33 @@
+# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
+
+from .rules import (
+ Rules,
+ AsyncRules,
+ RulesWithRawResponse,
+ AsyncRulesWithRawResponse,
+ RulesWithStreamingResponse,
+ AsyncRulesWithStreamingResponse,
+)
+from .advertisements import (
+ Advertisements,
+ AsyncAdvertisements,
+ AdvertisementsWithRawResponse,
+ AsyncAdvertisementsWithRawResponse,
+ AdvertisementsWithStreamingResponse,
+ AsyncAdvertisementsWithStreamingResponse,
+)
+
+__all__ = [
+ "Advertisements",
+ "AsyncAdvertisements",
+ "AdvertisementsWithRawResponse",
+ "AsyncAdvertisementsWithRawResponse",
+ "AdvertisementsWithStreamingResponse",
+ "AsyncAdvertisementsWithStreamingResponse",
+ "Rules",
+ "AsyncRules",
+ "RulesWithRawResponse",
+ "AsyncRulesWithRawResponse",
+ "RulesWithStreamingResponse",
+ "AsyncRulesWithStreamingResponse",
+]
diff --git a/src/cloudflare/resources/magic_network_monitoring/rules/advertisements.py b/src/cloudflare/resources/magic_network_monitoring/rules/advertisements.py
new file mode 100644
index 00000000000..c29fb40f590
--- /dev/null
+++ b/src/cloudflare/resources/magic_network_monitoring/rules/advertisements.py
@@ -0,0 +1,156 @@
+# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
+
+from __future__ import annotations
+
+from typing import Type, Optional, cast
+
+import httpx
+
+from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven
+from ...._compat import cached_property
+from ...._resource import SyncAPIResource, AsyncAPIResource
+from ...._response import (
+ to_raw_response_wrapper,
+ to_streamed_response_wrapper,
+ async_to_raw_response_wrapper,
+ async_to_streamed_response_wrapper,
+)
+from ...._wrappers import ResultWrapper
+from ...._base_client import (
+ make_request_options,
+)
+from ....types.magic_network_monitoring.rules import MagicVisibilityMNMRuleAdvertisable
+
+__all__ = ["Advertisements", "AsyncAdvertisements"]
+
+
+class Advertisements(SyncAPIResource):
+ @cached_property
+ def with_raw_response(self) -> AdvertisementsWithRawResponse:
+ return AdvertisementsWithRawResponse(self)
+
+ @cached_property
+ def with_streaming_response(self) -> AdvertisementsWithStreamingResponse:
+ return AdvertisementsWithStreamingResponse(self)
+
+ def edit(
+ self,
+ rule_id: object,
+ *,
+ account_id: object,
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
+ # The extra values given here take precedence over values defined on the client or passed to this 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[MagicVisibilityMNMRuleAdvertisable]:
+ """
+ Update advertisement for rule.
+
+ Args:
+ extra_headers: Send extra headers
+
+ extra_query: Add additional query parameters to the request
+
+ extra_body: Add additional JSON properties to the request
+
+ timeout: Override the client-level default timeout for this request, in seconds
+ """
+ return self._patch(
+ f"/accounts/{account_id}/mnm/rules/{rule_id}/advertisement",
+ options=make_request_options(
+ extra_headers=extra_headers,
+ extra_query=extra_query,
+ extra_body=extra_body,
+ timeout=timeout,
+ post_parser=ResultWrapper._unwrapper,
+ ),
+ cast_to=cast(
+ Type[Optional[MagicVisibilityMNMRuleAdvertisable]], ResultWrapper[MagicVisibilityMNMRuleAdvertisable]
+ ),
+ )
+
+
+class AsyncAdvertisements(AsyncAPIResource):
+ @cached_property
+ def with_raw_response(self) -> AsyncAdvertisementsWithRawResponse:
+ return AsyncAdvertisementsWithRawResponse(self)
+
+ @cached_property
+ def with_streaming_response(self) -> AsyncAdvertisementsWithStreamingResponse:
+ return AsyncAdvertisementsWithStreamingResponse(self)
+
+ async def edit(
+ self,
+ rule_id: object,
+ *,
+ account_id: object,
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
+ # The extra values given here take precedence over values defined on the client or passed to this 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[MagicVisibilityMNMRuleAdvertisable]:
+ """
+ Update advertisement for rule.
+
+ Args:
+ extra_headers: Send extra headers
+
+ extra_query: Add additional query parameters to the request
+
+ extra_body: Add additional JSON properties to the request
+
+ timeout: Override the client-level default timeout for this request, in seconds
+ """
+ return await self._patch(
+ f"/accounts/{account_id}/mnm/rules/{rule_id}/advertisement",
+ options=make_request_options(
+ extra_headers=extra_headers,
+ extra_query=extra_query,
+ extra_body=extra_body,
+ timeout=timeout,
+ post_parser=ResultWrapper._unwrapper,
+ ),
+ cast_to=cast(
+ Type[Optional[MagicVisibilityMNMRuleAdvertisable]], ResultWrapper[MagicVisibilityMNMRuleAdvertisable]
+ ),
+ )
+
+
+class AdvertisementsWithRawResponse:
+ def __init__(self, advertisements: Advertisements) -> None:
+ self._advertisements = advertisements
+
+ self.edit = to_raw_response_wrapper(
+ advertisements.edit,
+ )
+
+
+class AsyncAdvertisementsWithRawResponse:
+ def __init__(self, advertisements: AsyncAdvertisements) -> None:
+ self._advertisements = advertisements
+
+ self.edit = async_to_raw_response_wrapper(
+ advertisements.edit,
+ )
+
+
+class AdvertisementsWithStreamingResponse:
+ def __init__(self, advertisements: Advertisements) -> None:
+ self._advertisements = advertisements
+
+ self.edit = to_streamed_response_wrapper(
+ advertisements.edit,
+ )
+
+
+class AsyncAdvertisementsWithStreamingResponse:
+ def __init__(self, advertisements: AsyncAdvertisements) -> None:
+ self._advertisements = advertisements
+
+ self.edit = async_to_streamed_response_wrapper(
+ advertisements.edit,
+ )
diff --git a/src/cloudflare/resources/magic_network_monitoring/rules/rules.py b/src/cloudflare/resources/magic_network_monitoring/rules/rules.py
new file mode 100644
index 00000000000..dc02ad53d9f
--- /dev/null
+++ b/src/cloudflare/resources/magic_network_monitoring/rules/rules.py
@@ -0,0 +1,602 @@
+# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
+
+from __future__ import annotations
+
+from typing import Type, Optional, cast
+
+import httpx
+
+from ...._types import NOT_GIVEN, Body, Query, Headers, NotGiven
+from ...._compat import cached_property
+from ...._resource import SyncAPIResource, AsyncAPIResource
+from ...._response import (
+ to_raw_response_wrapper,
+ to_streamed_response_wrapper,
+ async_to_raw_response_wrapper,
+ async_to_streamed_response_wrapper,
+)
+from ...._wrappers import ResultWrapper
+from .advertisements import (
+ Advertisements,
+ AsyncAdvertisements,
+ AdvertisementsWithRawResponse,
+ AsyncAdvertisementsWithRawResponse,
+ AdvertisementsWithStreamingResponse,
+ AsyncAdvertisementsWithStreamingResponse,
+)
+from ...._base_client import (
+ make_request_options,
+)
+from ....types.magic_network_monitoring import RuleListResponse, MagicVisibilityMNMRule
+
+__all__ = ["Rules", "AsyncRules"]
+
+
+class Rules(SyncAPIResource):
+ @cached_property
+ def advertisements(self) -> Advertisements:
+ return Advertisements(self._client)
+
+ @cached_property
+ def with_raw_response(self) -> RulesWithRawResponse:
+ return RulesWithRawResponse(self)
+
+ @cached_property
+ def with_streaming_response(self) -> RulesWithStreamingResponse:
+ return RulesWithStreamingResponse(self)
+
+ def create(
+ self,
+ *,
+ account_id: object,
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
+ # The extra values given here take precedence over values defined on the client or passed to this 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[MagicVisibilityMNMRule]:
+ """Create network monitoring rules for account.
+
+ Currently only supports creating a
+ single rule per API request.
+
+ Args:
+ extra_headers: Send extra headers
+
+ extra_query: Add additional query parameters to the request
+
+ extra_body: Add additional JSON properties to the request
+
+ timeout: Override the client-level default timeout for this request, in seconds
+ """
+ return self._post(
+ f"/accounts/{account_id}/mnm/rules",
+ options=make_request_options(
+ extra_headers=extra_headers,
+ extra_query=extra_query,
+ extra_body=extra_body,
+ timeout=timeout,
+ post_parser=ResultWrapper._unwrapper,
+ ),
+ cast_to=cast(Type[Optional[MagicVisibilityMNMRule]], ResultWrapper[MagicVisibilityMNMRule]),
+ )
+
+ def update(
+ self,
+ *,
+ account_id: object,
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
+ # The extra values given here take precedence over values defined on the client or passed to this 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[MagicVisibilityMNMRule]:
+ """
+ Update network monitoring rules for account.
+
+ Args:
+ extra_headers: Send extra headers
+
+ extra_query: Add additional query parameters to the request
+
+ extra_body: Add additional JSON properties to the request
+
+ timeout: Override the client-level default timeout for this request, in seconds
+ """
+ return self._put(
+ f"/accounts/{account_id}/mnm/rules",
+ options=make_request_options(
+ extra_headers=extra_headers,
+ extra_query=extra_query,
+ extra_body=extra_body,
+ timeout=timeout,
+ post_parser=ResultWrapper._unwrapper,
+ ),
+ cast_to=cast(Type[Optional[MagicVisibilityMNMRule]], ResultWrapper[MagicVisibilityMNMRule]),
+ )
+
+ def list(
+ self,
+ *,
+ account_id: object,
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
+ # The extra values given here take precedence over values defined on the client or passed to this 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[RuleListResponse]:
+ """
+ Lists network monitoring rules for account.
+
+ Args:
+ extra_headers: Send extra headers
+
+ extra_query: Add additional query parameters to the request
+
+ extra_body: Add additional JSON properties to the request
+
+ timeout: Override the client-level default timeout for this request, in seconds
+ """
+ return self._get(
+ f"/accounts/{account_id}/mnm/rules",
+ options=make_request_options(
+ extra_headers=extra_headers,
+ extra_query=extra_query,
+ extra_body=extra_body,
+ timeout=timeout,
+ post_parser=ResultWrapper._unwrapper,
+ ),
+ cast_to=cast(Type[Optional[RuleListResponse]], ResultWrapper[RuleListResponse]),
+ )
+
+ def delete(
+ self,
+ rule_id: object,
+ *,
+ account_id: object,
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
+ # The extra values given here take precedence over values defined on the client or passed to this 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[MagicVisibilityMNMRule]:
+ """
+ Delete a network monitoring rule for account.
+
+ Args:
+ extra_headers: Send extra headers
+
+ extra_query: Add additional query parameters to the request
+
+ extra_body: Add additional JSON properties to the request
+
+ timeout: Override the client-level default timeout for this request, in seconds
+ """
+ return self._delete(
+ f"/accounts/{account_id}/mnm/rules/{rule_id}",
+ options=make_request_options(
+ extra_headers=extra_headers,
+ extra_query=extra_query,
+ extra_body=extra_body,
+ timeout=timeout,
+ post_parser=ResultWrapper._unwrapper,
+ ),
+ cast_to=cast(Type[Optional[MagicVisibilityMNMRule]], ResultWrapper[MagicVisibilityMNMRule]),
+ )
+
+ def edit(
+ self,
+ rule_id: object,
+ *,
+ account_id: object,
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
+ # The extra values given here take precedence over values defined on the client or passed to this 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[MagicVisibilityMNMRule]:
+ """
+ Update a network monitoring rule for account.
+
+ Args:
+ extra_headers: Send extra headers
+
+ extra_query: Add additional query parameters to the request
+
+ extra_body: Add additional JSON properties to the request
+
+ timeout: Override the client-level default timeout for this request, in seconds
+ """
+ return self._patch(
+ f"/accounts/{account_id}/mnm/rules/{rule_id}",
+ options=make_request_options(
+ extra_headers=extra_headers,
+ extra_query=extra_query,
+ extra_body=extra_body,
+ timeout=timeout,
+ post_parser=ResultWrapper._unwrapper,
+ ),
+ cast_to=cast(Type[Optional[MagicVisibilityMNMRule]], ResultWrapper[MagicVisibilityMNMRule]),
+ )
+
+ def get(
+ self,
+ rule_id: object,
+ *,
+ account_id: object,
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
+ # The extra values given here take precedence over values defined on the client or passed to this 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[MagicVisibilityMNMRule]:
+ """
+ List a single network monitoring rule for account.
+
+ Args:
+ extra_headers: Send extra headers
+
+ extra_query: Add additional query parameters to the request
+
+ extra_body: Add additional JSON properties to the request
+
+ timeout: Override the client-level default timeout for this request, in seconds
+ """
+ return self._get(
+ f"/accounts/{account_id}/mnm/rules/{rule_id}",
+ options=make_request_options(
+ extra_headers=extra_headers,
+ extra_query=extra_query,
+ extra_body=extra_body,
+ timeout=timeout,
+ post_parser=ResultWrapper._unwrapper,
+ ),
+ cast_to=cast(Type[Optional[MagicVisibilityMNMRule]], ResultWrapper[MagicVisibilityMNMRule]),
+ )
+
+
+class AsyncRules(AsyncAPIResource):
+ @cached_property
+ def advertisements(self) -> AsyncAdvertisements:
+ return AsyncAdvertisements(self._client)
+
+ @cached_property
+ def with_raw_response(self) -> AsyncRulesWithRawResponse:
+ return AsyncRulesWithRawResponse(self)
+
+ @cached_property
+ def with_streaming_response(self) -> AsyncRulesWithStreamingResponse:
+ return AsyncRulesWithStreamingResponse(self)
+
+ async def create(
+ self,
+ *,
+ account_id: object,
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
+ # The extra values given here take precedence over values defined on the client or passed to this 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[MagicVisibilityMNMRule]:
+ """Create network monitoring rules for account.
+
+ Currently only supports creating a
+ single rule per API request.
+
+ Args:
+ extra_headers: Send extra headers
+
+ extra_query: Add additional query parameters to the request
+
+ extra_body: Add additional JSON properties to the request
+
+ timeout: Override the client-level default timeout for this request, in seconds
+ """
+ return await self._post(
+ f"/accounts/{account_id}/mnm/rules",
+ options=make_request_options(
+ extra_headers=extra_headers,
+ extra_query=extra_query,
+ extra_body=extra_body,
+ timeout=timeout,
+ post_parser=ResultWrapper._unwrapper,
+ ),
+ cast_to=cast(Type[Optional[MagicVisibilityMNMRule]], ResultWrapper[MagicVisibilityMNMRule]),
+ )
+
+ async def update(
+ self,
+ *,
+ account_id: object,
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
+ # The extra values given here take precedence over values defined on the client or passed to this 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[MagicVisibilityMNMRule]:
+ """
+ Update network monitoring rules for account.
+
+ Args:
+ extra_headers: Send extra headers
+
+ extra_query: Add additional query parameters to the request
+
+ extra_body: Add additional JSON properties to the request
+
+ timeout: Override the client-level default timeout for this request, in seconds
+ """
+ return await self._put(
+ f"/accounts/{account_id}/mnm/rules",
+ options=make_request_options(
+ extra_headers=extra_headers,
+ extra_query=extra_query,
+ extra_body=extra_body,
+ timeout=timeout,
+ post_parser=ResultWrapper._unwrapper,
+ ),
+ cast_to=cast(Type[Optional[MagicVisibilityMNMRule]], ResultWrapper[MagicVisibilityMNMRule]),
+ )
+
+ async def list(
+ self,
+ *,
+ account_id: object,
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
+ # The extra values given here take precedence over values defined on the client or passed to this 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[RuleListResponse]:
+ """
+ Lists network monitoring rules for account.
+
+ Args:
+ extra_headers: Send extra headers
+
+ extra_query: Add additional query parameters to the request
+
+ extra_body: Add additional JSON properties to the request
+
+ timeout: Override the client-level default timeout for this request, in seconds
+ """
+ return await self._get(
+ f"/accounts/{account_id}/mnm/rules",
+ options=make_request_options(
+ extra_headers=extra_headers,
+ extra_query=extra_query,
+ extra_body=extra_body,
+ timeout=timeout,
+ post_parser=ResultWrapper._unwrapper,
+ ),
+ cast_to=cast(Type[Optional[RuleListResponse]], ResultWrapper[RuleListResponse]),
+ )
+
+ async def delete(
+ self,
+ rule_id: object,
+ *,
+ account_id: object,
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
+ # The extra values given here take precedence over values defined on the client or passed to this 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[MagicVisibilityMNMRule]:
+ """
+ Delete a network monitoring rule for account.
+
+ Args:
+ extra_headers: Send extra headers
+
+ extra_query: Add additional query parameters to the request
+
+ extra_body: Add additional JSON properties to the request
+
+ timeout: Override the client-level default timeout for this request, in seconds
+ """
+ return await self._delete(
+ f"/accounts/{account_id}/mnm/rules/{rule_id}",
+ options=make_request_options(
+ extra_headers=extra_headers,
+ extra_query=extra_query,
+ extra_body=extra_body,
+ timeout=timeout,
+ post_parser=ResultWrapper._unwrapper,
+ ),
+ cast_to=cast(Type[Optional[MagicVisibilityMNMRule]], ResultWrapper[MagicVisibilityMNMRule]),
+ )
+
+ async def edit(
+ self,
+ rule_id: object,
+ *,
+ account_id: object,
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
+ # The extra values given here take precedence over values defined on the client or passed to this 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[MagicVisibilityMNMRule]:
+ """
+ Update a network monitoring rule for account.
+
+ Args:
+ extra_headers: Send extra headers
+
+ extra_query: Add additional query parameters to the request
+
+ extra_body: Add additional JSON properties to the request
+
+ timeout: Override the client-level default timeout for this request, in seconds
+ """
+ return await self._patch(
+ f"/accounts/{account_id}/mnm/rules/{rule_id}",
+ options=make_request_options(
+ extra_headers=extra_headers,
+ extra_query=extra_query,
+ extra_body=extra_body,
+ timeout=timeout,
+ post_parser=ResultWrapper._unwrapper,
+ ),
+ cast_to=cast(Type[Optional[MagicVisibilityMNMRule]], ResultWrapper[MagicVisibilityMNMRule]),
+ )
+
+ async def get(
+ self,
+ rule_id: object,
+ *,
+ account_id: object,
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
+ # The extra values given here take precedence over values defined on the client or passed to this 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[MagicVisibilityMNMRule]:
+ """
+ List a single network monitoring rule for account.
+
+ Args:
+ extra_headers: Send extra headers
+
+ extra_query: Add additional query parameters to the request
+
+ extra_body: Add additional JSON properties to the request
+
+ timeout: Override the client-level default timeout for this request, in seconds
+ """
+ return await self._get(
+ f"/accounts/{account_id}/mnm/rules/{rule_id}",
+ options=make_request_options(
+ extra_headers=extra_headers,
+ extra_query=extra_query,
+ extra_body=extra_body,
+ timeout=timeout,
+ post_parser=ResultWrapper._unwrapper,
+ ),
+ cast_to=cast(Type[Optional[MagicVisibilityMNMRule]], ResultWrapper[MagicVisibilityMNMRule]),
+ )
+
+
+class RulesWithRawResponse:
+ def __init__(self, rules: Rules) -> None:
+ self._rules = rules
+
+ self.create = to_raw_response_wrapper(
+ rules.create,
+ )
+ self.update = to_raw_response_wrapper(
+ rules.update,
+ )
+ self.list = to_raw_response_wrapper(
+ rules.list,
+ )
+ self.delete = to_raw_response_wrapper(
+ rules.delete,
+ )
+ self.edit = to_raw_response_wrapper(
+ rules.edit,
+ )
+ self.get = to_raw_response_wrapper(
+ rules.get,
+ )
+
+ @cached_property
+ def advertisements(self) -> AdvertisementsWithRawResponse:
+ return AdvertisementsWithRawResponse(self._rules.advertisements)
+
+
+class AsyncRulesWithRawResponse:
+ def __init__(self, rules: AsyncRules) -> None:
+ self._rules = rules
+
+ self.create = async_to_raw_response_wrapper(
+ rules.create,
+ )
+ self.update = async_to_raw_response_wrapper(
+ rules.update,
+ )
+ self.list = async_to_raw_response_wrapper(
+ rules.list,
+ )
+ self.delete = async_to_raw_response_wrapper(
+ rules.delete,
+ )
+ self.edit = async_to_raw_response_wrapper(
+ rules.edit,
+ )
+ self.get = async_to_raw_response_wrapper(
+ rules.get,
+ )
+
+ @cached_property
+ def advertisements(self) -> AsyncAdvertisementsWithRawResponse:
+ return AsyncAdvertisementsWithRawResponse(self._rules.advertisements)
+
+
+class RulesWithStreamingResponse:
+ def __init__(self, rules: Rules) -> None:
+ self._rules = rules
+
+ self.create = to_streamed_response_wrapper(
+ rules.create,
+ )
+ self.update = to_streamed_response_wrapper(
+ rules.update,
+ )
+ self.list = to_streamed_response_wrapper(
+ rules.list,
+ )
+ self.delete = to_streamed_response_wrapper(
+ rules.delete,
+ )
+ self.edit = to_streamed_response_wrapper(
+ rules.edit,
+ )
+ self.get = to_streamed_response_wrapper(
+ rules.get,
+ )
+
+ @cached_property
+ def advertisements(self) -> AdvertisementsWithStreamingResponse:
+ return AdvertisementsWithStreamingResponse(self._rules.advertisements)
+
+
+class AsyncRulesWithStreamingResponse:
+ def __init__(self, rules: AsyncRules) -> None:
+ self._rules = rules
+
+ self.create = async_to_streamed_response_wrapper(
+ rules.create,
+ )
+ self.update = async_to_streamed_response_wrapper(
+ rules.update,
+ )
+ self.list = async_to_streamed_response_wrapper(
+ rules.list,
+ )
+ self.delete = async_to_streamed_response_wrapper(
+ rules.delete,
+ )
+ self.edit = async_to_streamed_response_wrapper(
+ rules.edit,
+ )
+ self.get = async_to_streamed_response_wrapper(
+ rules.get,
+ )
+
+ @cached_property
+ def advertisements(self) -> AsyncAdvertisementsWithStreamingResponse:
+ return AsyncAdvertisementsWithStreamingResponse(self._rules.advertisements)
diff --git a/src/cloudflare/resources/zones/__init__.py b/src/cloudflare/resources/zones/__init__.py
index 2782b074f1b..f5c9439914a 100644
--- a/src/cloudflare/resources/zones/__init__.py
+++ b/src/cloudflare/resources/zones/__init__.py
@@ -32,6 +32,14 @@
SettingsWithStreamingResponse,
AsyncSettingsWithStreamingResponse,
)
+from .dns_settings import (
+ DNSSettings,
+ AsyncDNSSettings,
+ DNSSettingsWithRawResponse,
+ AsyncDNSSettingsWithRawResponse,
+ DNSSettingsWithStreamingResponse,
+ AsyncDNSSettingsWithStreamingResponse,
+)
from .subscriptions import (
Subscriptions,
AsyncSubscriptions,
@@ -64,6 +72,12 @@
"AsyncActivationCheckWithRawResponse",
"ActivationCheckWithStreamingResponse",
"AsyncActivationCheckWithStreamingResponse",
+ "DNSSettings",
+ "AsyncDNSSettings",
+ "DNSSettingsWithRawResponse",
+ "AsyncDNSSettingsWithRawResponse",
+ "DNSSettingsWithStreamingResponse",
+ "AsyncDNSSettingsWithStreamingResponse",
"Settings",
"AsyncSettings",
"SettingsWithRawResponse",
diff --git a/src/cloudflare/resources/zones/dns_settings.py b/src/cloudflare/resources/zones/dns_settings.py
new file mode 100644
index 00000000000..b09d13d1041
--- /dev/null
+++ b/src/cloudflare/resources/zones/dns_settings.py
@@ -0,0 +1,262 @@
+# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
+
+from __future__ import annotations
+
+from typing import Type, cast
+
+import httpx
+
+from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven
+from ..._utils import (
+ maybe_transform,
+ async_maybe_transform,
+)
+from ..._compat import cached_property
+from ..._resource import SyncAPIResource, AsyncAPIResource
+from ..._response import (
+ to_raw_response_wrapper,
+ to_streamed_response_wrapper,
+ async_to_raw_response_wrapper,
+ async_to_streamed_response_wrapper,
+)
+from ..._wrappers import ResultWrapper
+from ...types.zones import DNSSettingGetResponse, DNSSettingEditResponse, dns_setting_edit_params
+from ..._base_client import (
+ make_request_options,
+)
+
+__all__ = ["DNSSettings", "AsyncDNSSettings"]
+
+
+class DNSSettings(SyncAPIResource):
+ @cached_property
+ def with_raw_response(self) -> DNSSettingsWithRawResponse:
+ return DNSSettingsWithRawResponse(self)
+
+ @cached_property
+ def with_streaming_response(self) -> DNSSettingsWithStreamingResponse:
+ return DNSSettingsWithStreamingResponse(self)
+
+ def edit(
+ self,
+ *,
+ zone_id: str,
+ nameservers: dns_setting_edit_params.Nameservers | 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,
+ ) -> DNSSettingEditResponse:
+ """
+ Update DNS settings for a zone
+
+ Args:
+ zone_id: Identifier
+
+ nameservers: Settings determining the nameservers through which the zone should be available.
+
+ extra_headers: Send extra headers
+
+ extra_query: Add additional query parameters to the request
+
+ extra_body: Add additional JSON properties to the request
+
+ timeout: Override the client-level default timeout for this request, in seconds
+ """
+ if not zone_id:
+ raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
+ return self._patch(
+ f"/zones/{zone_id}/dns_settings",
+ body=maybe_transform({"nameservers": nameservers}, dns_setting_edit_params.DNSSettingEditParams),
+ options=make_request_options(
+ extra_headers=extra_headers,
+ extra_query=extra_query,
+ extra_body=extra_body,
+ timeout=timeout,
+ post_parser=ResultWrapper._unwrapper,
+ ),
+ cast_to=cast(Type[DNSSettingEditResponse], ResultWrapper[DNSSettingEditResponse]),
+ )
+
+ def get(
+ self,
+ *,
+ zone_id: str,
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
+ # The extra values given here take precedence over values defined on the client or passed to this method.
+ extra_headers: Headers | None = None,
+ extra_query: Query | None = None,
+ extra_body: Body | None = None,
+ timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
+ ) -> DNSSettingGetResponse:
+ """
+ Show DNS settings for a zone
+
+ Args:
+ zone_id: Identifier
+
+ extra_headers: Send extra headers
+
+ extra_query: Add additional query parameters to the request
+
+ extra_body: Add additional JSON properties to the request
+
+ timeout: Override the client-level default timeout for this request, in seconds
+ """
+ if not zone_id:
+ raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
+ return self._get(
+ f"/zones/{zone_id}/dns_settings",
+ options=make_request_options(
+ extra_headers=extra_headers,
+ extra_query=extra_query,
+ extra_body=extra_body,
+ timeout=timeout,
+ post_parser=ResultWrapper._unwrapper,
+ ),
+ cast_to=cast(Type[DNSSettingGetResponse], ResultWrapper[DNSSettingGetResponse]),
+ )
+
+
+class AsyncDNSSettings(AsyncAPIResource):
+ @cached_property
+ def with_raw_response(self) -> AsyncDNSSettingsWithRawResponse:
+ return AsyncDNSSettingsWithRawResponse(self)
+
+ @cached_property
+ def with_streaming_response(self) -> AsyncDNSSettingsWithStreamingResponse:
+ return AsyncDNSSettingsWithStreamingResponse(self)
+
+ async def edit(
+ self,
+ *,
+ zone_id: str,
+ nameservers: dns_setting_edit_params.Nameservers | 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,
+ ) -> DNSSettingEditResponse:
+ """
+ Update DNS settings for a zone
+
+ Args:
+ zone_id: Identifier
+
+ nameservers: Settings determining the nameservers through which the zone should be available.
+
+ extra_headers: Send extra headers
+
+ extra_query: Add additional query parameters to the request
+
+ extra_body: Add additional JSON properties to the request
+
+ timeout: Override the client-level default timeout for this request, in seconds
+ """
+ if not zone_id:
+ raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
+ return await self._patch(
+ f"/zones/{zone_id}/dns_settings",
+ body=await async_maybe_transform(
+ {"nameservers": nameservers}, dns_setting_edit_params.DNSSettingEditParams
+ ),
+ options=make_request_options(
+ extra_headers=extra_headers,
+ extra_query=extra_query,
+ extra_body=extra_body,
+ timeout=timeout,
+ post_parser=ResultWrapper._unwrapper,
+ ),
+ cast_to=cast(Type[DNSSettingEditResponse], ResultWrapper[DNSSettingEditResponse]),
+ )
+
+ async def get(
+ self,
+ *,
+ zone_id: str,
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
+ # The extra values given here take precedence over values defined on the client or passed to this method.
+ extra_headers: Headers | None = None,
+ extra_query: Query | None = None,
+ extra_body: Body | None = None,
+ timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
+ ) -> DNSSettingGetResponse:
+ """
+ Show DNS settings for a zone
+
+ Args:
+ zone_id: Identifier
+
+ extra_headers: Send extra headers
+
+ extra_query: Add additional query parameters to the request
+
+ extra_body: Add additional JSON properties to the request
+
+ timeout: Override the client-level default timeout for this request, in seconds
+ """
+ if not zone_id:
+ raise ValueError(f"Expected a non-empty value for `zone_id` but received {zone_id!r}")
+ return await self._get(
+ f"/zones/{zone_id}/dns_settings",
+ options=make_request_options(
+ extra_headers=extra_headers,
+ extra_query=extra_query,
+ extra_body=extra_body,
+ timeout=timeout,
+ post_parser=ResultWrapper._unwrapper,
+ ),
+ cast_to=cast(Type[DNSSettingGetResponse], ResultWrapper[DNSSettingGetResponse]),
+ )
+
+
+class DNSSettingsWithRawResponse:
+ def __init__(self, dns_settings: DNSSettings) -> None:
+ self._dns_settings = dns_settings
+
+ self.edit = to_raw_response_wrapper(
+ dns_settings.edit,
+ )
+ self.get = to_raw_response_wrapper(
+ dns_settings.get,
+ )
+
+
+class AsyncDNSSettingsWithRawResponse:
+ def __init__(self, dns_settings: AsyncDNSSettings) -> None:
+ self._dns_settings = dns_settings
+
+ self.edit = async_to_raw_response_wrapper(
+ dns_settings.edit,
+ )
+ self.get = async_to_raw_response_wrapper(
+ dns_settings.get,
+ )
+
+
+class DNSSettingsWithStreamingResponse:
+ def __init__(self, dns_settings: DNSSettings) -> None:
+ self._dns_settings = dns_settings
+
+ self.edit = to_streamed_response_wrapper(
+ dns_settings.edit,
+ )
+ self.get = to_streamed_response_wrapper(
+ dns_settings.get,
+ )
+
+
+class AsyncDNSSettingsWithStreamingResponse:
+ def __init__(self, dns_settings: AsyncDNSSettings) -> None:
+ self._dns_settings = dns_settings
+
+ self.edit = async_to_streamed_response_wrapper(
+ dns_settings.edit,
+ )
+ self.get = async_to_streamed_response_wrapper(
+ dns_settings.get,
+ )
diff --git a/src/cloudflare/resources/zones/zones.py b/src/cloudflare/resources/zones/zones.py
index 508854493dd..cdfddc1a21f 100644
--- a/src/cloudflare/resources/zones/zones.py
+++ b/src/cloudflare/resources/zones/zones.py
@@ -47,6 +47,14 @@
)
from ..._wrappers import ResultWrapper
from ...pagination import SyncV4PagePaginationArray, AsyncV4PagePaginationArray
+from .dns_settings import (
+ DNSSettings,
+ AsyncDNSSettings,
+ DNSSettingsWithRawResponse,
+ AsyncDNSSettingsWithRawResponse,
+ DNSSettingsWithStreamingResponse,
+ AsyncDNSSettingsWithStreamingResponse,
+)
from .subscriptions import (
Subscriptions,
AsyncSubscriptions,
@@ -86,6 +94,10 @@ class Zones(SyncAPIResource):
def activation_check(self) -> ActivationCheck:
return ActivationCheck(self._client)
+ @cached_property
+ def dns_settings(self) -> DNSSettings:
+ return DNSSettings(self._client)
+
@cached_property
def settings(self) -> Settings:
return Settings(self._client)
@@ -390,6 +402,10 @@ class AsyncZones(AsyncAPIResource):
def activation_check(self) -> AsyncActivationCheck:
return AsyncActivationCheck(self._client)
+ @cached_property
+ def dns_settings(self) -> AsyncDNSSettings:
+ return AsyncDNSSettings(self._client)
+
@cached_property
def settings(self) -> AsyncSettings:
return AsyncSettings(self._client)
@@ -713,6 +729,10 @@ def __init__(self, zones: Zones) -> None:
def activation_check(self) -> ActivationCheckWithRawResponse:
return ActivationCheckWithRawResponse(self._zones.activation_check)
+ @cached_property
+ def dns_settings(self) -> DNSSettingsWithRawResponse:
+ return DNSSettingsWithRawResponse(self._zones.dns_settings)
+
@cached_property
def settings(self) -> SettingsWithRawResponse:
return SettingsWithRawResponse(self._zones.settings)
@@ -758,6 +778,10 @@ def __init__(self, zones: AsyncZones) -> None:
def activation_check(self) -> AsyncActivationCheckWithRawResponse:
return AsyncActivationCheckWithRawResponse(self._zones.activation_check)
+ @cached_property
+ def dns_settings(self) -> AsyncDNSSettingsWithRawResponse:
+ return AsyncDNSSettingsWithRawResponse(self._zones.dns_settings)
+
@cached_property
def settings(self) -> AsyncSettingsWithRawResponse:
return AsyncSettingsWithRawResponse(self._zones.settings)
@@ -803,6 +827,10 @@ def __init__(self, zones: Zones) -> None:
def activation_check(self) -> ActivationCheckWithStreamingResponse:
return ActivationCheckWithStreamingResponse(self._zones.activation_check)
+ @cached_property
+ def dns_settings(self) -> DNSSettingsWithStreamingResponse:
+ return DNSSettingsWithStreamingResponse(self._zones.dns_settings)
+
@cached_property
def settings(self) -> SettingsWithStreamingResponse:
return SettingsWithStreamingResponse(self._zones.settings)
@@ -848,6 +876,10 @@ def __init__(self, zones: AsyncZones) -> None:
def activation_check(self) -> AsyncActivationCheckWithStreamingResponse:
return AsyncActivationCheckWithStreamingResponse(self._zones.activation_check)
+ @cached_property
+ def dns_settings(self) -> AsyncDNSSettingsWithStreamingResponse:
+ return AsyncDNSSettingsWithStreamingResponse(self._zones.dns_settings)
+
@cached_property
def settings(self) -> AsyncSettingsWithStreamingResponse:
return AsyncSettingsWithStreamingResponse(self._zones.settings)
diff --git a/src/cloudflare/types/magic_network_monitoring/__init__.py b/src/cloudflare/types/magic_network_monitoring/__init__.py
index f8ee8b14b1c..855cef74221 100644
--- a/src/cloudflare/types/magic_network_monitoring/__init__.py
+++ b/src/cloudflare/types/magic_network_monitoring/__init__.py
@@ -1,3 +1,7 @@
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
from __future__ import annotations
+
+from .rule_list_response import RuleListResponse as RuleListResponse
+from .magic_visibility_mnm_rule import MagicVisibilityMNMRule as MagicVisibilityMNMRule
+from .magic_visibility_mnm_config import MagicVisibilityMNMConfig as MagicVisibilityMNMConfig
diff --git a/src/cloudflare/types/magic_network_monitoring/magic_visibility_mnm_config.py b/src/cloudflare/types/magic_network_monitoring/magic_visibility_mnm_config.py
new file mode 100644
index 00000000000..3e0c2dd03b1
--- /dev/null
+++ b/src/cloudflare/types/magic_network_monitoring/magic_visibility_mnm_config.py
@@ -0,0 +1,20 @@
+# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
+
+from typing import List
+
+from ..._models import BaseModel
+
+__all__ = ["MagicVisibilityMNMConfig"]
+
+
+class MagicVisibilityMNMConfig(BaseModel):
+ default_sampling: float
+ """Fallback sampling rate of flow messages being sent in packets per second.
+
+ This should match the packet sampling rate configured on the router.
+ """
+
+ name: str
+ """The account name."""
+
+ router_ips: List[str]
diff --git a/src/cloudflare/types/magic_network_monitoring/magic_visibility_mnm_rule.py b/src/cloudflare/types/magic_network_monitoring/magic_visibility_mnm_rule.py
new file mode 100644
index 00000000000..311b5209a0e
--- /dev/null
+++ b/src/cloudflare/types/magic_network_monitoring/magic_visibility_mnm_rule.py
@@ -0,0 +1,51 @@
+# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
+
+from typing import List, Optional
+
+from ..._models import BaseModel
+
+__all__ = ["MagicVisibilityMNMRule"]
+
+
+class MagicVisibilityMNMRule(BaseModel):
+ automatic_advertisement: Optional[bool] = None
+ """
+ Toggle on if you would like Cloudflare to automatically advertise the IP
+ Prefixes within the rule via Magic Transit when the rule is triggered. Only
+ available for users of Magic Transit.
+ """
+
+ duration: str
+ """
+ The amount of time that the rule threshold must be exceeded to send an alert
+ notification. The final value must be equivalent to one of the following 8
+ values ["1m","5m","10m","15m","20m","30m","45m","60m"]. The format is
+ AhBmCsDmsEusFns where A, B, C, D, E and F durations are optional; however at
+ least one unit must be provided.
+ """
+
+ name: str
+ """The name of the rule.
+
+ Must be unique. Supports characters A-Z, a-z, 0-9, underscore (\\__), dash (-),
+ period (.), and tilde (~). You can’t have a space in the rule name. Max 256
+ characters.
+ """
+
+ prefixes: List[str]
+
+ id: Optional[object] = None
+
+ bandwidth_threshold: Optional[float] = None
+ """The number of bits per second for the rule.
+
+ When this value is exceeded for the set duration, an alert notification is sent.
+ Minimum of 1 and no maximum.
+ """
+
+ packet_threshold: Optional[float] = None
+ """The number of packets per second for the rule.
+
+ When this value is exceeded for the set duration, an alert notification is sent.
+ Minimum of 1 and no maximum.
+ """
diff --git a/src/cloudflare/types/magic_network_monitoring/rule_list_response.py b/src/cloudflare/types/magic_network_monitoring/rule_list_response.py
new file mode 100644
index 00000000000..26b9278a876
--- /dev/null
+++ b/src/cloudflare/types/magic_network_monitoring/rule_list_response.py
@@ -0,0 +1,9 @@
+# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
+
+from typing import List, Optional
+
+from .magic_visibility_mnm_rule import MagicVisibilityMNMRule
+
+__all__ = ["RuleListResponse"]
+
+RuleListResponse = List[Optional[MagicVisibilityMNMRule]]
diff --git a/src/cloudflare/types/magic_network_monitoring/rules/__init__.py b/src/cloudflare/types/magic_network_monitoring/rules/__init__.py
index f8ee8b14b1c..23421e7b707 100644
--- a/src/cloudflare/types/magic_network_monitoring/rules/__init__.py
+++ b/src/cloudflare/types/magic_network_monitoring/rules/__init__.py
@@ -1,3 +1,7 @@
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
from __future__ import annotations
+
+from .magic_visibility_mnm_rule_advertisable import (
+ MagicVisibilityMNMRuleAdvertisable as MagicVisibilityMNMRuleAdvertisable,
+)
diff --git a/src/cloudflare/types/magic_network_monitoring/rules/magic_visibility_mnm_rule_advertisable.py b/src/cloudflare/types/magic_network_monitoring/rules/magic_visibility_mnm_rule_advertisable.py
new file mode 100644
index 00000000000..bfb67487939
--- /dev/null
+++ b/src/cloudflare/types/magic_network_monitoring/rules/magic_visibility_mnm_rule_advertisable.py
@@ -0,0 +1,16 @@
+# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
+
+from typing import Optional
+
+from ...._models import BaseModel
+
+__all__ = ["MagicVisibilityMNMRuleAdvertisable"]
+
+
+class MagicVisibilityMNMRuleAdvertisable(BaseModel):
+ automatic_advertisement: Optional[bool] = None
+ """
+ Toggle on if you would like Cloudflare to automatically advertise the IP
+ Prefixes within the rule via Magic Transit when the rule is triggered. Only
+ available for users of Magic Transit.
+ """
diff --git a/src/cloudflare/types/zones/__init__.py b/src/cloudflare/types/zones/__init__.py
index 2d56fc542ce..3fb58b135a5 100644
--- a/src/cloudflare/types/zones/__init__.py
+++ b/src/cloudflare/types/zones/__init__.py
@@ -10,6 +10,9 @@
from .hold_delete_response import HoldDeleteResponse as HoldDeleteResponse
from .setting_get_response import SettingGetResponse as SettingGetResponse
from .setting_edit_response import SettingEditResponse as SettingEditResponse
+from .dns_setting_edit_params import DNSSettingEditParams as DNSSettingEditParams
+from .dns_setting_get_response import DNSSettingGetResponse as DNSSettingGetResponse
+from .dns_setting_edit_response import DNSSettingEditResponse as DNSSettingEditResponse
from .subscription_get_response import SubscriptionGetResponse as SubscriptionGetResponse
from .subscription_create_params import SubscriptionCreateParams as SubscriptionCreateParams
from .subscription_list_response import SubscriptionListResponse as SubscriptionListResponse
diff --git a/src/cloudflare/types/zones/dns_setting_edit_params.py b/src/cloudflare/types/zones/dns_setting_edit_params.py
new file mode 100644
index 00000000000..63d0e28208c
--- /dev/null
+++ b/src/cloudflare/types/zones/dns_setting_edit_params.py
@@ -0,0 +1,22 @@
+# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
+
+from __future__ import annotations
+
+from typing_extensions import Literal, Required, TypedDict
+
+__all__ = ["DNSSettingEditParams", "Nameservers"]
+
+
+class DNSSettingEditParams(TypedDict, total=False):
+ zone_id: Required[str]
+ """Identifier"""
+
+ nameservers: Nameservers
+ """
+ Settings determining the nameservers through which the zone should be available.
+ """
+
+
+class Nameservers(TypedDict, total=False):
+ type: Required[Literal["cloudflare.standard", "cloudflare.foundation_dns"]]
+ """Nameserver type"""
diff --git a/src/cloudflare/types/zones/dns_setting_edit_response.py b/src/cloudflare/types/zones/dns_setting_edit_response.py
new file mode 100644
index 00000000000..e1a4b6d6c17
--- /dev/null
+++ b/src/cloudflare/types/zones/dns_setting_edit_response.py
@@ -0,0 +1,20 @@
+# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
+
+from typing import Optional
+from typing_extensions import Literal
+
+from ..._models import BaseModel
+
+__all__ = ["DNSSettingEditResponse", "Nameservers"]
+
+
+class Nameservers(BaseModel):
+ type: Literal["cloudflare.standard", "cloudflare.foundation_dns"]
+ """Nameserver type"""
+
+
+class DNSSettingEditResponse(BaseModel):
+ nameservers: Optional[Nameservers] = None
+ """
+ Settings determining the nameservers through which the zone should be available.
+ """
diff --git a/src/cloudflare/types/zones/dns_setting_get_response.py b/src/cloudflare/types/zones/dns_setting_get_response.py
new file mode 100644
index 00000000000..784da31db6e
--- /dev/null
+++ b/src/cloudflare/types/zones/dns_setting_get_response.py
@@ -0,0 +1,20 @@
+# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
+
+from typing import Optional
+from typing_extensions import Literal
+
+from ..._models import BaseModel
+
+__all__ = ["DNSSettingGetResponse", "Nameservers"]
+
+
+class Nameservers(BaseModel):
+ type: Literal["cloudflare.standard", "cloudflare.foundation_dns"]
+ """Nameserver type"""
+
+
+class DNSSettingGetResponse(BaseModel):
+ nameservers: Optional[Nameservers] = None
+ """
+ Settings determining the nameservers through which the zone should be available.
+ """
diff --git a/tests/api_resources/magic_network_monitoring/configs/test_full.py b/tests/api_resources/magic_network_monitoring/configs/test_full.py
new file mode 100644
index 00000000000..4659eff0b47
--- /dev/null
+++ b/tests/api_resources/magic_network_monitoring/configs/test_full.py
@@ -0,0 +1,90 @@
+# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
+
+from __future__ import annotations
+
+import os
+from typing import Any, cast
+
+import pytest
+
+from cloudflare import Cloudflare, AsyncCloudflare
+from tests.utils import assert_matches_type
+from cloudflare.types.magic_network_monitoring import MagicVisibilityMNMConfig
+
+base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010")
+
+
+class TestFull:
+ parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"])
+
+ @pytest.mark.skip()
+ @parametrize
+ def test_method_get(self, client: Cloudflare) -> None:
+ full = client.magic_network_monitoring.configs.full.get(
+ account_id="6f91088a406011ed95aed352566e8d4c",
+ )
+ assert_matches_type(MagicVisibilityMNMConfig, full, path=["response"])
+
+ @pytest.mark.skip()
+ @parametrize
+ def test_raw_response_get(self, client: Cloudflare) -> None:
+ response = client.magic_network_monitoring.configs.full.with_raw_response.get(
+ account_id="6f91088a406011ed95aed352566e8d4c",
+ )
+
+ assert response.is_closed is True
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+ full = response.parse()
+ assert_matches_type(MagicVisibilityMNMConfig, full, path=["response"])
+
+ @pytest.mark.skip()
+ @parametrize
+ def test_streaming_response_get(self, client: Cloudflare) -> None:
+ with client.magic_network_monitoring.configs.full.with_streaming_response.get(
+ account_id="6f91088a406011ed95aed352566e8d4c",
+ ) as response:
+ assert not response.is_closed
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+
+ full = response.parse()
+ assert_matches_type(MagicVisibilityMNMConfig, full, path=["response"])
+
+ assert cast(Any, response.is_closed) is True
+
+
+class TestAsyncFull:
+ parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"])
+
+ @pytest.mark.skip()
+ @parametrize
+ async def test_method_get(self, async_client: AsyncCloudflare) -> None:
+ full = await async_client.magic_network_monitoring.configs.full.get(
+ account_id="6f91088a406011ed95aed352566e8d4c",
+ )
+ assert_matches_type(MagicVisibilityMNMConfig, full, path=["response"])
+
+ @pytest.mark.skip()
+ @parametrize
+ async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None:
+ response = await async_client.magic_network_monitoring.configs.full.with_raw_response.get(
+ account_id="6f91088a406011ed95aed352566e8d4c",
+ )
+
+ assert response.is_closed is True
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+ full = await response.parse()
+ assert_matches_type(MagicVisibilityMNMConfig, full, path=["response"])
+
+ @pytest.mark.skip()
+ @parametrize
+ async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> None:
+ async with async_client.magic_network_monitoring.configs.full.with_streaming_response.get(
+ account_id="6f91088a406011ed95aed352566e8d4c",
+ ) as response:
+ assert not response.is_closed
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+
+ full = await response.parse()
+ assert_matches_type(MagicVisibilityMNMConfig, full, path=["response"])
+
+ assert cast(Any, response.is_closed) is True
diff --git a/tests/api_resources/magic_network_monitoring/rules/test_advertisements.py b/tests/api_resources/magic_network_monitoring/rules/test_advertisements.py
new file mode 100644
index 00000000000..5189fdad750
--- /dev/null
+++ b/tests/api_resources/magic_network_monitoring/rules/test_advertisements.py
@@ -0,0 +1,96 @@
+# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
+
+from __future__ import annotations
+
+import os
+from typing import Any, Optional, cast
+
+import pytest
+
+from cloudflare import Cloudflare, AsyncCloudflare
+from tests.utils import assert_matches_type
+from cloudflare.types.magic_network_monitoring.rules import MagicVisibilityMNMRuleAdvertisable
+
+base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010")
+
+
+class TestAdvertisements:
+ parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"])
+
+ @pytest.mark.skip()
+ @parametrize
+ def test_method_edit(self, client: Cloudflare) -> None:
+ advertisement = client.magic_network_monitoring.rules.advertisements.edit(
+ "2890e6fa406311ed9b5a23f70f6fb8cf",
+ account_id="6f91088a406011ed95aed352566e8d4c",
+ )
+ assert_matches_type(Optional[MagicVisibilityMNMRuleAdvertisable], advertisement, path=["response"])
+
+ @pytest.mark.skip()
+ @parametrize
+ def test_raw_response_edit(self, client: Cloudflare) -> None:
+ response = client.magic_network_monitoring.rules.advertisements.with_raw_response.edit(
+ "2890e6fa406311ed9b5a23f70f6fb8cf",
+ account_id="6f91088a406011ed95aed352566e8d4c",
+ )
+
+ assert response.is_closed is True
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+ advertisement = response.parse()
+ assert_matches_type(Optional[MagicVisibilityMNMRuleAdvertisable], advertisement, path=["response"])
+
+ @pytest.mark.skip()
+ @parametrize
+ def test_streaming_response_edit(self, client: Cloudflare) -> None:
+ with client.magic_network_monitoring.rules.advertisements.with_streaming_response.edit(
+ "2890e6fa406311ed9b5a23f70f6fb8cf",
+ account_id="6f91088a406011ed95aed352566e8d4c",
+ ) as response:
+ assert not response.is_closed
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+
+ advertisement = response.parse()
+ assert_matches_type(Optional[MagicVisibilityMNMRuleAdvertisable], advertisement, path=["response"])
+
+ assert cast(Any, response.is_closed) is True
+
+
+class TestAsyncAdvertisements:
+ parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"])
+
+ @pytest.mark.skip()
+ @parametrize
+ async def test_method_edit(self, async_client: AsyncCloudflare) -> None:
+ advertisement = await async_client.magic_network_monitoring.rules.advertisements.edit(
+ "2890e6fa406311ed9b5a23f70f6fb8cf",
+ account_id="6f91088a406011ed95aed352566e8d4c",
+ )
+ assert_matches_type(Optional[MagicVisibilityMNMRuleAdvertisable], advertisement, path=["response"])
+
+ @pytest.mark.skip()
+ @parametrize
+ async def test_raw_response_edit(self, async_client: AsyncCloudflare) -> None:
+ response = await async_client.magic_network_monitoring.rules.advertisements.with_raw_response.edit(
+ "2890e6fa406311ed9b5a23f70f6fb8cf",
+ account_id="6f91088a406011ed95aed352566e8d4c",
+ )
+
+ assert response.is_closed is True
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+ advertisement = await response.parse()
+ assert_matches_type(Optional[MagicVisibilityMNMRuleAdvertisable], advertisement, path=["response"])
+
+ @pytest.mark.skip()
+ @parametrize
+ async def test_streaming_response_edit(self, async_client: AsyncCloudflare) -> None:
+ async with async_client.magic_network_monitoring.rules.advertisements.with_streaming_response.edit(
+ "2890e6fa406311ed9b5a23f70f6fb8cf",
+ account_id="6f91088a406011ed95aed352566e8d4c",
+ ) as response:
+ assert not response.is_closed
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+
+ advertisement = await response.parse()
+ assert_matches_type(Optional[MagicVisibilityMNMRuleAdvertisable], advertisement, path=["response"])
+
+ assert cast(Any, response.is_closed) is True
diff --git a/tests/api_resources/magic_network_monitoring/test_configs.py b/tests/api_resources/magic_network_monitoring/test_configs.py
new file mode 100644
index 00000000000..55db17f9a44
--- /dev/null
+++ b/tests/api_resources/magic_network_monitoring/test_configs.py
@@ -0,0 +1,362 @@
+# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
+
+from __future__ import annotations
+
+import os
+from typing import Any, cast
+
+import pytest
+
+from cloudflare import Cloudflare, AsyncCloudflare
+from tests.utils import assert_matches_type
+from cloudflare.types.magic_network_monitoring import MagicVisibilityMNMConfig
+
+base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010")
+
+
+class TestConfigs:
+ parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"])
+
+ @pytest.mark.skip()
+ @parametrize
+ def test_method_create(self, client: Cloudflare) -> None:
+ config = client.magic_network_monitoring.configs.create(
+ account_id="6f91088a406011ed95aed352566e8d4c",
+ )
+ assert_matches_type(MagicVisibilityMNMConfig, config, path=["response"])
+
+ @pytest.mark.skip()
+ @parametrize
+ def test_raw_response_create(self, client: Cloudflare) -> None:
+ response = client.magic_network_monitoring.configs.with_raw_response.create(
+ account_id="6f91088a406011ed95aed352566e8d4c",
+ )
+
+ assert response.is_closed is True
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+ config = response.parse()
+ assert_matches_type(MagicVisibilityMNMConfig, config, path=["response"])
+
+ @pytest.mark.skip()
+ @parametrize
+ def test_streaming_response_create(self, client: Cloudflare) -> None:
+ with client.magic_network_monitoring.configs.with_streaming_response.create(
+ account_id="6f91088a406011ed95aed352566e8d4c",
+ ) as response:
+ assert not response.is_closed
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+
+ config = response.parse()
+ assert_matches_type(MagicVisibilityMNMConfig, config, path=["response"])
+
+ assert cast(Any, response.is_closed) is True
+
+ @pytest.mark.skip()
+ @parametrize
+ def test_method_update(self, client: Cloudflare) -> None:
+ config = client.magic_network_monitoring.configs.update(
+ account_id="6f91088a406011ed95aed352566e8d4c",
+ )
+ assert_matches_type(MagicVisibilityMNMConfig, config, path=["response"])
+
+ @pytest.mark.skip()
+ @parametrize
+ def test_raw_response_update(self, client: Cloudflare) -> None:
+ response = client.magic_network_monitoring.configs.with_raw_response.update(
+ account_id="6f91088a406011ed95aed352566e8d4c",
+ )
+
+ assert response.is_closed is True
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+ config = response.parse()
+ assert_matches_type(MagicVisibilityMNMConfig, config, path=["response"])
+
+ @pytest.mark.skip()
+ @parametrize
+ def test_streaming_response_update(self, client: Cloudflare) -> None:
+ with client.magic_network_monitoring.configs.with_streaming_response.update(
+ account_id="6f91088a406011ed95aed352566e8d4c",
+ ) as response:
+ assert not response.is_closed
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+
+ config = response.parse()
+ assert_matches_type(MagicVisibilityMNMConfig, config, path=["response"])
+
+ assert cast(Any, response.is_closed) is True
+
+ @pytest.mark.skip()
+ @parametrize
+ def test_method_delete(self, client: Cloudflare) -> None:
+ config = client.magic_network_monitoring.configs.delete(
+ account_id="6f91088a406011ed95aed352566e8d4c",
+ )
+ assert_matches_type(MagicVisibilityMNMConfig, config, path=["response"])
+
+ @pytest.mark.skip()
+ @parametrize
+ def test_raw_response_delete(self, client: Cloudflare) -> None:
+ response = client.magic_network_monitoring.configs.with_raw_response.delete(
+ account_id="6f91088a406011ed95aed352566e8d4c",
+ )
+
+ assert response.is_closed is True
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+ config = response.parse()
+ assert_matches_type(MagicVisibilityMNMConfig, config, path=["response"])
+
+ @pytest.mark.skip()
+ @parametrize
+ def test_streaming_response_delete(self, client: Cloudflare) -> None:
+ with client.magic_network_monitoring.configs.with_streaming_response.delete(
+ account_id="6f91088a406011ed95aed352566e8d4c",
+ ) as response:
+ assert not response.is_closed
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+
+ config = response.parse()
+ assert_matches_type(MagicVisibilityMNMConfig, config, path=["response"])
+
+ assert cast(Any, response.is_closed) is True
+
+ @pytest.mark.skip()
+ @parametrize
+ def test_method_edit(self, client: Cloudflare) -> None:
+ config = client.magic_network_monitoring.configs.edit(
+ account_id="6f91088a406011ed95aed352566e8d4c",
+ )
+ assert_matches_type(MagicVisibilityMNMConfig, config, path=["response"])
+
+ @pytest.mark.skip()
+ @parametrize
+ def test_raw_response_edit(self, client: Cloudflare) -> None:
+ response = client.magic_network_monitoring.configs.with_raw_response.edit(
+ account_id="6f91088a406011ed95aed352566e8d4c",
+ )
+
+ assert response.is_closed is True
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+ config = response.parse()
+ assert_matches_type(MagicVisibilityMNMConfig, config, path=["response"])
+
+ @pytest.mark.skip()
+ @parametrize
+ def test_streaming_response_edit(self, client: Cloudflare) -> None:
+ with client.magic_network_monitoring.configs.with_streaming_response.edit(
+ account_id="6f91088a406011ed95aed352566e8d4c",
+ ) as response:
+ assert not response.is_closed
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+
+ config = response.parse()
+ assert_matches_type(MagicVisibilityMNMConfig, config, path=["response"])
+
+ assert cast(Any, response.is_closed) is True
+
+ @pytest.mark.skip()
+ @parametrize
+ def test_method_get(self, client: Cloudflare) -> None:
+ config = client.magic_network_monitoring.configs.get(
+ account_id="6f91088a406011ed95aed352566e8d4c",
+ )
+ assert_matches_type(MagicVisibilityMNMConfig, config, path=["response"])
+
+ @pytest.mark.skip()
+ @parametrize
+ def test_raw_response_get(self, client: Cloudflare) -> None:
+ response = client.magic_network_monitoring.configs.with_raw_response.get(
+ account_id="6f91088a406011ed95aed352566e8d4c",
+ )
+
+ assert response.is_closed is True
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+ config = response.parse()
+ assert_matches_type(MagicVisibilityMNMConfig, config, path=["response"])
+
+ @pytest.mark.skip()
+ @parametrize
+ def test_streaming_response_get(self, client: Cloudflare) -> None:
+ with client.magic_network_monitoring.configs.with_streaming_response.get(
+ account_id="6f91088a406011ed95aed352566e8d4c",
+ ) as response:
+ assert not response.is_closed
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+
+ config = response.parse()
+ assert_matches_type(MagicVisibilityMNMConfig, config, path=["response"])
+
+ assert cast(Any, response.is_closed) is True
+
+
+class TestAsyncConfigs:
+ parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"])
+
+ @pytest.mark.skip()
+ @parametrize
+ async def test_method_create(self, async_client: AsyncCloudflare) -> None:
+ config = await async_client.magic_network_monitoring.configs.create(
+ account_id="6f91088a406011ed95aed352566e8d4c",
+ )
+ assert_matches_type(MagicVisibilityMNMConfig, config, path=["response"])
+
+ @pytest.mark.skip()
+ @parametrize
+ async def test_raw_response_create(self, async_client: AsyncCloudflare) -> None:
+ response = await async_client.magic_network_monitoring.configs.with_raw_response.create(
+ account_id="6f91088a406011ed95aed352566e8d4c",
+ )
+
+ assert response.is_closed is True
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+ config = await response.parse()
+ assert_matches_type(MagicVisibilityMNMConfig, config, path=["response"])
+
+ @pytest.mark.skip()
+ @parametrize
+ async def test_streaming_response_create(self, async_client: AsyncCloudflare) -> None:
+ async with async_client.magic_network_monitoring.configs.with_streaming_response.create(
+ account_id="6f91088a406011ed95aed352566e8d4c",
+ ) as response:
+ assert not response.is_closed
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+
+ config = await response.parse()
+ assert_matches_type(MagicVisibilityMNMConfig, config, path=["response"])
+
+ assert cast(Any, response.is_closed) is True
+
+ @pytest.mark.skip()
+ @parametrize
+ async def test_method_update(self, async_client: AsyncCloudflare) -> None:
+ config = await async_client.magic_network_monitoring.configs.update(
+ account_id="6f91088a406011ed95aed352566e8d4c",
+ )
+ assert_matches_type(MagicVisibilityMNMConfig, config, path=["response"])
+
+ @pytest.mark.skip()
+ @parametrize
+ async def test_raw_response_update(self, async_client: AsyncCloudflare) -> None:
+ response = await async_client.magic_network_monitoring.configs.with_raw_response.update(
+ account_id="6f91088a406011ed95aed352566e8d4c",
+ )
+
+ assert response.is_closed is True
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+ config = await response.parse()
+ assert_matches_type(MagicVisibilityMNMConfig, config, path=["response"])
+
+ @pytest.mark.skip()
+ @parametrize
+ async def test_streaming_response_update(self, async_client: AsyncCloudflare) -> None:
+ async with async_client.magic_network_monitoring.configs.with_streaming_response.update(
+ account_id="6f91088a406011ed95aed352566e8d4c",
+ ) as response:
+ assert not response.is_closed
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+
+ config = await response.parse()
+ assert_matches_type(MagicVisibilityMNMConfig, config, path=["response"])
+
+ assert cast(Any, response.is_closed) is True
+
+ @pytest.mark.skip()
+ @parametrize
+ async def test_method_delete(self, async_client: AsyncCloudflare) -> None:
+ config = await async_client.magic_network_monitoring.configs.delete(
+ account_id="6f91088a406011ed95aed352566e8d4c",
+ )
+ assert_matches_type(MagicVisibilityMNMConfig, config, path=["response"])
+
+ @pytest.mark.skip()
+ @parametrize
+ async def test_raw_response_delete(self, async_client: AsyncCloudflare) -> None:
+ response = await async_client.magic_network_monitoring.configs.with_raw_response.delete(
+ account_id="6f91088a406011ed95aed352566e8d4c",
+ )
+
+ assert response.is_closed is True
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+ config = await response.parse()
+ assert_matches_type(MagicVisibilityMNMConfig, config, path=["response"])
+
+ @pytest.mark.skip()
+ @parametrize
+ async def test_streaming_response_delete(self, async_client: AsyncCloudflare) -> None:
+ async with async_client.magic_network_monitoring.configs.with_streaming_response.delete(
+ account_id="6f91088a406011ed95aed352566e8d4c",
+ ) as response:
+ assert not response.is_closed
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+
+ config = await response.parse()
+ assert_matches_type(MagicVisibilityMNMConfig, config, path=["response"])
+
+ assert cast(Any, response.is_closed) is True
+
+ @pytest.mark.skip()
+ @parametrize
+ async def test_method_edit(self, async_client: AsyncCloudflare) -> None:
+ config = await async_client.magic_network_monitoring.configs.edit(
+ account_id="6f91088a406011ed95aed352566e8d4c",
+ )
+ assert_matches_type(MagicVisibilityMNMConfig, config, path=["response"])
+
+ @pytest.mark.skip()
+ @parametrize
+ async def test_raw_response_edit(self, async_client: AsyncCloudflare) -> None:
+ response = await async_client.magic_network_monitoring.configs.with_raw_response.edit(
+ account_id="6f91088a406011ed95aed352566e8d4c",
+ )
+
+ assert response.is_closed is True
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+ config = await response.parse()
+ assert_matches_type(MagicVisibilityMNMConfig, config, path=["response"])
+
+ @pytest.mark.skip()
+ @parametrize
+ async def test_streaming_response_edit(self, async_client: AsyncCloudflare) -> None:
+ async with async_client.magic_network_monitoring.configs.with_streaming_response.edit(
+ account_id="6f91088a406011ed95aed352566e8d4c",
+ ) as response:
+ assert not response.is_closed
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+
+ config = await response.parse()
+ assert_matches_type(MagicVisibilityMNMConfig, config, path=["response"])
+
+ assert cast(Any, response.is_closed) is True
+
+ @pytest.mark.skip()
+ @parametrize
+ async def test_method_get(self, async_client: AsyncCloudflare) -> None:
+ config = await async_client.magic_network_monitoring.configs.get(
+ account_id="6f91088a406011ed95aed352566e8d4c",
+ )
+ assert_matches_type(MagicVisibilityMNMConfig, config, path=["response"])
+
+ @pytest.mark.skip()
+ @parametrize
+ async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None:
+ response = await async_client.magic_network_monitoring.configs.with_raw_response.get(
+ account_id="6f91088a406011ed95aed352566e8d4c",
+ )
+
+ assert response.is_closed is True
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+ config = await response.parse()
+ assert_matches_type(MagicVisibilityMNMConfig, config, path=["response"])
+
+ @pytest.mark.skip()
+ @parametrize
+ async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> None:
+ async with async_client.magic_network_monitoring.configs.with_streaming_response.get(
+ account_id="6f91088a406011ed95aed352566e8d4c",
+ ) as response:
+ assert not response.is_closed
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+
+ config = await response.parse()
+ assert_matches_type(MagicVisibilityMNMConfig, config, path=["response"])
+
+ assert cast(Any, response.is_closed) is True
diff --git a/tests/api_resources/magic_network_monitoring/test_rules.py b/tests/api_resources/magic_network_monitoring/test_rules.py
new file mode 100644
index 00000000000..978dcecd754
--- /dev/null
+++ b/tests/api_resources/magic_network_monitoring/test_rules.py
@@ -0,0 +1,448 @@
+# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
+
+from __future__ import annotations
+
+import os
+from typing import Any, Optional, cast
+
+import pytest
+
+from cloudflare import Cloudflare, AsyncCloudflare
+from tests.utils import assert_matches_type
+from cloudflare.types.magic_network_monitoring import RuleListResponse, MagicVisibilityMNMRule
+
+base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010")
+
+
+class TestRules:
+ parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"])
+
+ @pytest.mark.skip()
+ @parametrize
+ def test_method_create(self, client: Cloudflare) -> None:
+ rule = client.magic_network_monitoring.rules.create(
+ account_id="6f91088a406011ed95aed352566e8d4c",
+ )
+ assert_matches_type(Optional[MagicVisibilityMNMRule], rule, path=["response"])
+
+ @pytest.mark.skip()
+ @parametrize
+ def test_raw_response_create(self, client: Cloudflare) -> None:
+ response = client.magic_network_monitoring.rules.with_raw_response.create(
+ account_id="6f91088a406011ed95aed352566e8d4c",
+ )
+
+ assert response.is_closed is True
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+ rule = response.parse()
+ assert_matches_type(Optional[MagicVisibilityMNMRule], rule, path=["response"])
+
+ @pytest.mark.skip()
+ @parametrize
+ def test_streaming_response_create(self, client: Cloudflare) -> None:
+ with client.magic_network_monitoring.rules.with_streaming_response.create(
+ account_id="6f91088a406011ed95aed352566e8d4c",
+ ) as response:
+ assert not response.is_closed
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+
+ rule = response.parse()
+ assert_matches_type(Optional[MagicVisibilityMNMRule], rule, path=["response"])
+
+ assert cast(Any, response.is_closed) is True
+
+ @pytest.mark.skip()
+ @parametrize
+ def test_method_update(self, client: Cloudflare) -> None:
+ rule = client.magic_network_monitoring.rules.update(
+ account_id="6f91088a406011ed95aed352566e8d4c",
+ )
+ assert_matches_type(Optional[MagicVisibilityMNMRule], rule, path=["response"])
+
+ @pytest.mark.skip()
+ @parametrize
+ def test_raw_response_update(self, client: Cloudflare) -> None:
+ response = client.magic_network_monitoring.rules.with_raw_response.update(
+ account_id="6f91088a406011ed95aed352566e8d4c",
+ )
+
+ assert response.is_closed is True
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+ rule = response.parse()
+ assert_matches_type(Optional[MagicVisibilityMNMRule], rule, path=["response"])
+
+ @pytest.mark.skip()
+ @parametrize
+ def test_streaming_response_update(self, client: Cloudflare) -> None:
+ with client.magic_network_monitoring.rules.with_streaming_response.update(
+ account_id="6f91088a406011ed95aed352566e8d4c",
+ ) as response:
+ assert not response.is_closed
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+
+ rule = response.parse()
+ assert_matches_type(Optional[MagicVisibilityMNMRule], rule, path=["response"])
+
+ assert cast(Any, response.is_closed) is True
+
+ @pytest.mark.skip()
+ @parametrize
+ def test_method_list(self, client: Cloudflare) -> None:
+ rule = client.magic_network_monitoring.rules.list(
+ account_id="6f91088a406011ed95aed352566e8d4c",
+ )
+ assert_matches_type(Optional[RuleListResponse], rule, path=["response"])
+
+ @pytest.mark.skip()
+ @parametrize
+ def test_raw_response_list(self, client: Cloudflare) -> None:
+ response = client.magic_network_monitoring.rules.with_raw_response.list(
+ account_id="6f91088a406011ed95aed352566e8d4c",
+ )
+
+ assert response.is_closed is True
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+ rule = response.parse()
+ assert_matches_type(Optional[RuleListResponse], rule, path=["response"])
+
+ @pytest.mark.skip()
+ @parametrize
+ def test_streaming_response_list(self, client: Cloudflare) -> None:
+ with client.magic_network_monitoring.rules.with_streaming_response.list(
+ account_id="6f91088a406011ed95aed352566e8d4c",
+ ) as response:
+ assert not response.is_closed
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+
+ rule = response.parse()
+ assert_matches_type(Optional[RuleListResponse], rule, path=["response"])
+
+ assert cast(Any, response.is_closed) is True
+
+ @pytest.mark.skip()
+ @parametrize
+ def test_method_delete(self, client: Cloudflare) -> None:
+ rule = client.magic_network_monitoring.rules.delete(
+ "2890e6fa406311ed9b5a23f70f6fb8cf",
+ account_id="6f91088a406011ed95aed352566e8d4c",
+ )
+ assert_matches_type(Optional[MagicVisibilityMNMRule], rule, path=["response"])
+
+ @pytest.mark.skip()
+ @parametrize
+ def test_raw_response_delete(self, client: Cloudflare) -> None:
+ response = client.magic_network_monitoring.rules.with_raw_response.delete(
+ "2890e6fa406311ed9b5a23f70f6fb8cf",
+ account_id="6f91088a406011ed95aed352566e8d4c",
+ )
+
+ assert response.is_closed is True
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+ rule = response.parse()
+ assert_matches_type(Optional[MagicVisibilityMNMRule], rule, path=["response"])
+
+ @pytest.mark.skip()
+ @parametrize
+ def test_streaming_response_delete(self, client: Cloudflare) -> None:
+ with client.magic_network_monitoring.rules.with_streaming_response.delete(
+ "2890e6fa406311ed9b5a23f70f6fb8cf",
+ account_id="6f91088a406011ed95aed352566e8d4c",
+ ) as response:
+ assert not response.is_closed
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+
+ rule = response.parse()
+ assert_matches_type(Optional[MagicVisibilityMNMRule], rule, path=["response"])
+
+ assert cast(Any, response.is_closed) is True
+
+ @pytest.mark.skip()
+ @parametrize
+ def test_method_edit(self, client: Cloudflare) -> None:
+ rule = client.magic_network_monitoring.rules.edit(
+ "2890e6fa406311ed9b5a23f70f6fb8cf",
+ account_id="6f91088a406011ed95aed352566e8d4c",
+ )
+ assert_matches_type(Optional[MagicVisibilityMNMRule], rule, path=["response"])
+
+ @pytest.mark.skip()
+ @parametrize
+ def test_raw_response_edit(self, client: Cloudflare) -> None:
+ response = client.magic_network_monitoring.rules.with_raw_response.edit(
+ "2890e6fa406311ed9b5a23f70f6fb8cf",
+ account_id="6f91088a406011ed95aed352566e8d4c",
+ )
+
+ assert response.is_closed is True
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+ rule = response.parse()
+ assert_matches_type(Optional[MagicVisibilityMNMRule], rule, path=["response"])
+
+ @pytest.mark.skip()
+ @parametrize
+ def test_streaming_response_edit(self, client: Cloudflare) -> None:
+ with client.magic_network_monitoring.rules.with_streaming_response.edit(
+ "2890e6fa406311ed9b5a23f70f6fb8cf",
+ account_id="6f91088a406011ed95aed352566e8d4c",
+ ) as response:
+ assert not response.is_closed
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+
+ rule = response.parse()
+ assert_matches_type(Optional[MagicVisibilityMNMRule], rule, path=["response"])
+
+ assert cast(Any, response.is_closed) is True
+
+ @pytest.mark.skip()
+ @parametrize
+ def test_method_get(self, client: Cloudflare) -> None:
+ rule = client.magic_network_monitoring.rules.get(
+ "2890e6fa406311ed9b5a23f70f6fb8cf",
+ account_id="6f91088a406011ed95aed352566e8d4c",
+ )
+ assert_matches_type(Optional[MagicVisibilityMNMRule], rule, path=["response"])
+
+ @pytest.mark.skip()
+ @parametrize
+ def test_raw_response_get(self, client: Cloudflare) -> None:
+ response = client.magic_network_monitoring.rules.with_raw_response.get(
+ "2890e6fa406311ed9b5a23f70f6fb8cf",
+ account_id="6f91088a406011ed95aed352566e8d4c",
+ )
+
+ assert response.is_closed is True
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+ rule = response.parse()
+ assert_matches_type(Optional[MagicVisibilityMNMRule], rule, path=["response"])
+
+ @pytest.mark.skip()
+ @parametrize
+ def test_streaming_response_get(self, client: Cloudflare) -> None:
+ with client.magic_network_monitoring.rules.with_streaming_response.get(
+ "2890e6fa406311ed9b5a23f70f6fb8cf",
+ account_id="6f91088a406011ed95aed352566e8d4c",
+ ) as response:
+ assert not response.is_closed
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+
+ rule = response.parse()
+ assert_matches_type(Optional[MagicVisibilityMNMRule], rule, path=["response"])
+
+ assert cast(Any, response.is_closed) is True
+
+
+class TestAsyncRules:
+ parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"])
+
+ @pytest.mark.skip()
+ @parametrize
+ async def test_method_create(self, async_client: AsyncCloudflare) -> None:
+ rule = await async_client.magic_network_monitoring.rules.create(
+ account_id="6f91088a406011ed95aed352566e8d4c",
+ )
+ assert_matches_type(Optional[MagicVisibilityMNMRule], rule, path=["response"])
+
+ @pytest.mark.skip()
+ @parametrize
+ async def test_raw_response_create(self, async_client: AsyncCloudflare) -> None:
+ response = await async_client.magic_network_monitoring.rules.with_raw_response.create(
+ account_id="6f91088a406011ed95aed352566e8d4c",
+ )
+
+ assert response.is_closed is True
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+ rule = await response.parse()
+ assert_matches_type(Optional[MagicVisibilityMNMRule], rule, path=["response"])
+
+ @pytest.mark.skip()
+ @parametrize
+ async def test_streaming_response_create(self, async_client: AsyncCloudflare) -> None:
+ async with async_client.magic_network_monitoring.rules.with_streaming_response.create(
+ account_id="6f91088a406011ed95aed352566e8d4c",
+ ) as response:
+ assert not response.is_closed
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+
+ rule = await response.parse()
+ assert_matches_type(Optional[MagicVisibilityMNMRule], rule, path=["response"])
+
+ assert cast(Any, response.is_closed) is True
+
+ @pytest.mark.skip()
+ @parametrize
+ async def test_method_update(self, async_client: AsyncCloudflare) -> None:
+ rule = await async_client.magic_network_monitoring.rules.update(
+ account_id="6f91088a406011ed95aed352566e8d4c",
+ )
+ assert_matches_type(Optional[MagicVisibilityMNMRule], rule, path=["response"])
+
+ @pytest.mark.skip()
+ @parametrize
+ async def test_raw_response_update(self, async_client: AsyncCloudflare) -> None:
+ response = await async_client.magic_network_monitoring.rules.with_raw_response.update(
+ account_id="6f91088a406011ed95aed352566e8d4c",
+ )
+
+ assert response.is_closed is True
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+ rule = await response.parse()
+ assert_matches_type(Optional[MagicVisibilityMNMRule], rule, path=["response"])
+
+ @pytest.mark.skip()
+ @parametrize
+ async def test_streaming_response_update(self, async_client: AsyncCloudflare) -> None:
+ async with async_client.magic_network_monitoring.rules.with_streaming_response.update(
+ account_id="6f91088a406011ed95aed352566e8d4c",
+ ) as response:
+ assert not response.is_closed
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+
+ rule = await response.parse()
+ assert_matches_type(Optional[MagicVisibilityMNMRule], rule, path=["response"])
+
+ assert cast(Any, response.is_closed) is True
+
+ @pytest.mark.skip()
+ @parametrize
+ async def test_method_list(self, async_client: AsyncCloudflare) -> None:
+ rule = await async_client.magic_network_monitoring.rules.list(
+ account_id="6f91088a406011ed95aed352566e8d4c",
+ )
+ assert_matches_type(Optional[RuleListResponse], rule, path=["response"])
+
+ @pytest.mark.skip()
+ @parametrize
+ async def test_raw_response_list(self, async_client: AsyncCloudflare) -> None:
+ response = await async_client.magic_network_monitoring.rules.with_raw_response.list(
+ account_id="6f91088a406011ed95aed352566e8d4c",
+ )
+
+ assert response.is_closed is True
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+ rule = await response.parse()
+ assert_matches_type(Optional[RuleListResponse], rule, path=["response"])
+
+ @pytest.mark.skip()
+ @parametrize
+ async def test_streaming_response_list(self, async_client: AsyncCloudflare) -> None:
+ async with async_client.magic_network_monitoring.rules.with_streaming_response.list(
+ account_id="6f91088a406011ed95aed352566e8d4c",
+ ) as response:
+ assert not response.is_closed
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+
+ rule = await response.parse()
+ assert_matches_type(Optional[RuleListResponse], rule, path=["response"])
+
+ assert cast(Any, response.is_closed) is True
+
+ @pytest.mark.skip()
+ @parametrize
+ async def test_method_delete(self, async_client: AsyncCloudflare) -> None:
+ rule = await async_client.magic_network_monitoring.rules.delete(
+ "2890e6fa406311ed9b5a23f70f6fb8cf",
+ account_id="6f91088a406011ed95aed352566e8d4c",
+ )
+ assert_matches_type(Optional[MagicVisibilityMNMRule], rule, path=["response"])
+
+ @pytest.mark.skip()
+ @parametrize
+ async def test_raw_response_delete(self, async_client: AsyncCloudflare) -> None:
+ response = await async_client.magic_network_monitoring.rules.with_raw_response.delete(
+ "2890e6fa406311ed9b5a23f70f6fb8cf",
+ account_id="6f91088a406011ed95aed352566e8d4c",
+ )
+
+ assert response.is_closed is True
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+ rule = await response.parse()
+ assert_matches_type(Optional[MagicVisibilityMNMRule], rule, path=["response"])
+
+ @pytest.mark.skip()
+ @parametrize
+ async def test_streaming_response_delete(self, async_client: AsyncCloudflare) -> None:
+ async with async_client.magic_network_monitoring.rules.with_streaming_response.delete(
+ "2890e6fa406311ed9b5a23f70f6fb8cf",
+ account_id="6f91088a406011ed95aed352566e8d4c",
+ ) as response:
+ assert not response.is_closed
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+
+ rule = await response.parse()
+ assert_matches_type(Optional[MagicVisibilityMNMRule], rule, path=["response"])
+
+ assert cast(Any, response.is_closed) is True
+
+ @pytest.mark.skip()
+ @parametrize
+ async def test_method_edit(self, async_client: AsyncCloudflare) -> None:
+ rule = await async_client.magic_network_monitoring.rules.edit(
+ "2890e6fa406311ed9b5a23f70f6fb8cf",
+ account_id="6f91088a406011ed95aed352566e8d4c",
+ )
+ assert_matches_type(Optional[MagicVisibilityMNMRule], rule, path=["response"])
+
+ @pytest.mark.skip()
+ @parametrize
+ async def test_raw_response_edit(self, async_client: AsyncCloudflare) -> None:
+ response = await async_client.magic_network_monitoring.rules.with_raw_response.edit(
+ "2890e6fa406311ed9b5a23f70f6fb8cf",
+ account_id="6f91088a406011ed95aed352566e8d4c",
+ )
+
+ assert response.is_closed is True
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+ rule = await response.parse()
+ assert_matches_type(Optional[MagicVisibilityMNMRule], rule, path=["response"])
+
+ @pytest.mark.skip()
+ @parametrize
+ async def test_streaming_response_edit(self, async_client: AsyncCloudflare) -> None:
+ async with async_client.magic_network_monitoring.rules.with_streaming_response.edit(
+ "2890e6fa406311ed9b5a23f70f6fb8cf",
+ account_id="6f91088a406011ed95aed352566e8d4c",
+ ) as response:
+ assert not response.is_closed
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+
+ rule = await response.parse()
+ assert_matches_type(Optional[MagicVisibilityMNMRule], rule, path=["response"])
+
+ assert cast(Any, response.is_closed) is True
+
+ @pytest.mark.skip()
+ @parametrize
+ async def test_method_get(self, async_client: AsyncCloudflare) -> None:
+ rule = await async_client.magic_network_monitoring.rules.get(
+ "2890e6fa406311ed9b5a23f70f6fb8cf",
+ account_id="6f91088a406011ed95aed352566e8d4c",
+ )
+ assert_matches_type(Optional[MagicVisibilityMNMRule], rule, path=["response"])
+
+ @pytest.mark.skip()
+ @parametrize
+ async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None:
+ response = await async_client.magic_network_monitoring.rules.with_raw_response.get(
+ "2890e6fa406311ed9b5a23f70f6fb8cf",
+ account_id="6f91088a406011ed95aed352566e8d4c",
+ )
+
+ assert response.is_closed is True
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+ rule = await response.parse()
+ assert_matches_type(Optional[MagicVisibilityMNMRule], rule, path=["response"])
+
+ @pytest.mark.skip()
+ @parametrize
+ async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> None:
+ async with async_client.magic_network_monitoring.rules.with_streaming_response.get(
+ "2890e6fa406311ed9b5a23f70f6fb8cf",
+ account_id="6f91088a406011ed95aed352566e8d4c",
+ ) as response:
+ assert not response.is_closed
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+
+ rule = await response.parse()
+ assert_matches_type(Optional[MagicVisibilityMNMRule], rule, path=["response"])
+
+ assert cast(Any, response.is_closed) is True
diff --git a/tests/api_resources/zones/test_dns_settings.py b/tests/api_resources/zones/test_dns_settings.py
new file mode 100644
index 00000000000..7f234aa2d37
--- /dev/null
+++ b/tests/api_resources/zones/test_dns_settings.py
@@ -0,0 +1,208 @@
+# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
+
+from __future__ import annotations
+
+import os
+from typing import Any, cast
+
+import pytest
+
+from cloudflare import Cloudflare, AsyncCloudflare
+from tests.utils import assert_matches_type
+from cloudflare.types.zones import DNSSettingGetResponse, DNSSettingEditResponse
+
+base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010")
+
+
+class TestDNSSettings:
+ parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"])
+
+ @pytest.mark.skip()
+ @parametrize
+ def test_method_edit(self, client: Cloudflare) -> None:
+ dns_setting = client.zones.dns_settings.edit(
+ zone_id="023e105f4ecef8ad9ca31a8372d0c353",
+ )
+ assert_matches_type(DNSSettingEditResponse, dns_setting, path=["response"])
+
+ @pytest.mark.skip()
+ @parametrize
+ def test_method_edit_with_all_params(self, client: Cloudflare) -> None:
+ dns_setting = client.zones.dns_settings.edit(
+ zone_id="023e105f4ecef8ad9ca31a8372d0c353",
+ nameservers={"type": "cloudflare.standard"},
+ )
+ assert_matches_type(DNSSettingEditResponse, dns_setting, path=["response"])
+
+ @pytest.mark.skip()
+ @parametrize
+ def test_raw_response_edit(self, client: Cloudflare) -> None:
+ response = client.zones.dns_settings.with_raw_response.edit(
+ zone_id="023e105f4ecef8ad9ca31a8372d0c353",
+ )
+
+ assert response.is_closed is True
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+ dns_setting = response.parse()
+ assert_matches_type(DNSSettingEditResponse, dns_setting, path=["response"])
+
+ @pytest.mark.skip()
+ @parametrize
+ def test_streaming_response_edit(self, client: Cloudflare) -> None:
+ with client.zones.dns_settings.with_streaming_response.edit(
+ zone_id="023e105f4ecef8ad9ca31a8372d0c353",
+ ) as response:
+ assert not response.is_closed
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+
+ dns_setting = response.parse()
+ assert_matches_type(DNSSettingEditResponse, dns_setting, path=["response"])
+
+ assert cast(Any, response.is_closed) is True
+
+ @pytest.mark.skip()
+ @parametrize
+ def test_path_params_edit(self, client: Cloudflare) -> None:
+ with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"):
+ client.zones.dns_settings.with_raw_response.edit(
+ zone_id="",
+ )
+
+ @pytest.mark.skip()
+ @parametrize
+ def test_method_get(self, client: Cloudflare) -> None:
+ dns_setting = client.zones.dns_settings.get(
+ zone_id="023e105f4ecef8ad9ca31a8372d0c353",
+ )
+ assert_matches_type(DNSSettingGetResponse, dns_setting, path=["response"])
+
+ @pytest.mark.skip()
+ @parametrize
+ def test_raw_response_get(self, client: Cloudflare) -> None:
+ response = client.zones.dns_settings.with_raw_response.get(
+ zone_id="023e105f4ecef8ad9ca31a8372d0c353",
+ )
+
+ assert response.is_closed is True
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+ dns_setting = response.parse()
+ assert_matches_type(DNSSettingGetResponse, dns_setting, path=["response"])
+
+ @pytest.mark.skip()
+ @parametrize
+ def test_streaming_response_get(self, client: Cloudflare) -> None:
+ with client.zones.dns_settings.with_streaming_response.get(
+ zone_id="023e105f4ecef8ad9ca31a8372d0c353",
+ ) as response:
+ assert not response.is_closed
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+
+ dns_setting = response.parse()
+ assert_matches_type(DNSSettingGetResponse, dns_setting, path=["response"])
+
+ assert cast(Any, response.is_closed) is True
+
+ @pytest.mark.skip()
+ @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.dns_settings.with_raw_response.get(
+ zone_id="",
+ )
+
+
+class TestAsyncDNSSettings:
+ parametrize = pytest.mark.parametrize("async_client", [False, True], indirect=True, ids=["loose", "strict"])
+
+ @pytest.mark.skip()
+ @parametrize
+ async def test_method_edit(self, async_client: AsyncCloudflare) -> None:
+ dns_setting = await async_client.zones.dns_settings.edit(
+ zone_id="023e105f4ecef8ad9ca31a8372d0c353",
+ )
+ assert_matches_type(DNSSettingEditResponse, dns_setting, path=["response"])
+
+ @pytest.mark.skip()
+ @parametrize
+ async def test_method_edit_with_all_params(self, async_client: AsyncCloudflare) -> None:
+ dns_setting = await async_client.zones.dns_settings.edit(
+ zone_id="023e105f4ecef8ad9ca31a8372d0c353",
+ nameservers={"type": "cloudflare.standard"},
+ )
+ assert_matches_type(DNSSettingEditResponse, dns_setting, path=["response"])
+
+ @pytest.mark.skip()
+ @parametrize
+ async def test_raw_response_edit(self, async_client: AsyncCloudflare) -> None:
+ response = await async_client.zones.dns_settings.with_raw_response.edit(
+ zone_id="023e105f4ecef8ad9ca31a8372d0c353",
+ )
+
+ assert response.is_closed is True
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+ dns_setting = await response.parse()
+ assert_matches_type(DNSSettingEditResponse, dns_setting, path=["response"])
+
+ @pytest.mark.skip()
+ @parametrize
+ async def test_streaming_response_edit(self, async_client: AsyncCloudflare) -> None:
+ async with async_client.zones.dns_settings.with_streaming_response.edit(
+ zone_id="023e105f4ecef8ad9ca31a8372d0c353",
+ ) as response:
+ assert not response.is_closed
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+
+ dns_setting = await response.parse()
+ assert_matches_type(DNSSettingEditResponse, dns_setting, path=["response"])
+
+ assert cast(Any, response.is_closed) is True
+
+ @pytest.mark.skip()
+ @parametrize
+ async def test_path_params_edit(self, async_client: AsyncCloudflare) -> None:
+ with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"):
+ await async_client.zones.dns_settings.with_raw_response.edit(
+ zone_id="",
+ )
+
+ @pytest.mark.skip()
+ @parametrize
+ async def test_method_get(self, async_client: AsyncCloudflare) -> None:
+ dns_setting = await async_client.zones.dns_settings.get(
+ zone_id="023e105f4ecef8ad9ca31a8372d0c353",
+ )
+ assert_matches_type(DNSSettingGetResponse, dns_setting, path=["response"])
+
+ @pytest.mark.skip()
+ @parametrize
+ async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None:
+ response = await async_client.zones.dns_settings.with_raw_response.get(
+ zone_id="023e105f4ecef8ad9ca31a8372d0c353",
+ )
+
+ assert response.is_closed is True
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+ dns_setting = await response.parse()
+ assert_matches_type(DNSSettingGetResponse, dns_setting, path=["response"])
+
+ @pytest.mark.skip()
+ @parametrize
+ async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> None:
+ async with async_client.zones.dns_settings.with_streaming_response.get(
+ zone_id="023e105f4ecef8ad9ca31a8372d0c353",
+ ) as response:
+ assert not response.is_closed
+ assert response.http_request.headers.get("X-Stainless-Lang") == "python"
+
+ dns_setting = await response.parse()
+ assert_matches_type(DNSSettingGetResponse, dns_setting, path=["response"])
+
+ assert cast(Any, response.is_closed) is True
+
+ @pytest.mark.skip()
+ @parametrize
+ async def test_path_params_get(self, async_client: AsyncCloudflare) -> None:
+ with pytest.raises(ValueError, match=r"Expected a non-empty value for `zone_id` but received ''"):
+ await async_client.zones.dns_settings.with_raw_response.get(
+ zone_id="",
+ )