From 2ee13005b2b4bebaff556e646492c3b48489158f Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 21 Mar 2024 16:40:17 +0000 Subject: [PATCH] feat(api): OpenAPI spec update via Stainless API (#160) --- .stats.yml | 2 +- api.md | 29 +- 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 ------------------ .../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 - .../configs/test_full.py | 90 --- .../rules/test_advertisements.py | 96 --- .../magic_network_monitoring/test_configs.py | 362 ----------- .../magic_network_monitoring/test_rules.py | 448 ------------- 22 files changed, 2 insertions(+), 2804 deletions(-) delete mode 100644 src/cloudflare/resources/magic_network_monitoring/__init__.py delete mode 100644 src/cloudflare/resources/magic_network_monitoring/configs/__init__.py delete mode 100644 src/cloudflare/resources/magic_network_monitoring/configs/configs.py delete mode 100644 src/cloudflare/resources/magic_network_monitoring/configs/full.py delete mode 100644 src/cloudflare/resources/magic_network_monitoring/magic_network_monitoring.py delete mode 100644 src/cloudflare/resources/magic_network_monitoring/rules/__init__.py delete mode 100644 src/cloudflare/resources/magic_network_monitoring/rules/advertisements.py delete mode 100644 src/cloudflare/resources/magic_network_monitoring/rules/rules.py delete mode 100644 src/cloudflare/types/magic_network_monitoring/magic_visibility_mnm_config.py delete mode 100644 src/cloudflare/types/magic_network_monitoring/magic_visibility_mnm_rule.py delete mode 100644 src/cloudflare/types/magic_network_monitoring/rule_list_response.py delete mode 100644 src/cloudflare/types/magic_network_monitoring/rules/magic_visibility_mnm_rule_advertisable.py delete mode 100644 tests/api_resources/magic_network_monitoring/configs/test_full.py delete mode 100644 tests/api_resources/magic_network_monitoring/rules/test_advertisements.py delete mode 100644 tests/api_resources/magic_network_monitoring/test_configs.py delete mode 100644 tests/api_resources/magic_network_monitoring/test_rules.py diff --git a/.stats.yml b/.stats.yml index cb1412e7ab3..1c34ce1f747 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1 +1 @@ -configured_endpoints: 1288 +configured_endpoints: 1275 diff --git a/api.md b/api.md index eb000051e6a..a24d8f4e3aa 100644 --- a/api.md +++ b/api.md @@ -3938,37 +3938,14 @@ Types: from cloudflare.types.magic_network_monitoring import MagicVisibilityMNMConfig ``` -Methods: - -- client.magic_network_monitoring.configs.create(account_identifier) -> MagicVisibilityMNMConfig -- client.magic_network_monitoring.configs.update(account_identifier) -> MagicVisibilityMNMConfig -- client.magic_network_monitoring.configs.delete(account_identifier) -> MagicVisibilityMNMConfig -- client.magic_network_monitoring.configs.edit(account_identifier) -> MagicVisibilityMNMConfig -- client.magic_network_monitoring.configs.get(account_identifier) -> MagicVisibilityMNMConfig - -### Full - -Methods: - -- client.magic_network_monitoring.configs.full.get(account_identifier) -> MagicVisibilityMNMConfig - ## Rules Types: ```python -from cloudflare.types.magic_network_monitoring import MagicVisibilityMNMRule, RuleListResponse +from cloudflare.types.magic_network_monitoring import MagicVisibilityMNMRule ``` -Methods: - -- client.magic_network_monitoring.rules.create(account_identifier) -> Optional -- client.magic_network_monitoring.rules.update(account_identifier) -> Optional -- client.magic_network_monitoring.rules.list(account_identifier) -> Optional -- client.magic_network_monitoring.rules.delete(rule_identifier, \*, account_identifier) -> Optional -- client.magic_network_monitoring.rules.edit(rule_identifier, \*, account_identifier) -> Optional -- client.magic_network_monitoring.rules.get(rule_identifier, \*, account_identifier) -> Optional - ### Advertisements Types: @@ -3977,10 +3954,6 @@ Types: from cloudflare.types.magic_network_monitoring.rules import MagicVisibilityMNMRuleAdvertisable ``` -Methods: - -- client.magic_network_monitoring.rules.advertisements.edit(rule_identifier, \*, account_identifier) -> Optional - # MTLSCertificates Types: diff --git a/src/cloudflare/_client.py b/src/cloudflare/_client.py index 970437dd25b..4ee77c97c2b 100644 --- a/src/cloudflare/_client.py +++ b/src/cloudflare/_client.py @@ -98,7 +98,6 @@ 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 @@ -251,7 +250,6 @@ 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) @@ -509,7 +507,6 @@ 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 @@ -662,7 +659,6 @@ 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) @@ -921,7 +917,6 @@ 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) @@ -1009,9 +1004,6 @@ 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) @@ -1099,9 +1091,6 @@ 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) @@ -1193,9 +1182,6 @@ 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 2c1ab6cf2c3..7c822596d8a 100644 --- a/src/cloudflare/resources/__init__.py +++ b/src/cloudflare/resources/__init__.py @@ -624,14 +624,6 @@ CertificateAuthoritiesWithStreamingResponse, AsyncCertificateAuthoritiesWithStreamingResponse, ) -from .magic_network_monitoring import ( - MagicNetworkMonitoring, - AsyncMagicNetworkMonitoring, - MagicNetworkMonitoringWithRawResponse, - AsyncMagicNetworkMonitoringWithRawResponse, - MagicNetworkMonitoringWithStreamingResponse, - AsyncMagicNetworkMonitoringWithStreamingResponse, -) from .origin_post_quantum_encryption import ( OriginPostQuantumEncryption, AsyncOriginPostQuantumEncryption, @@ -948,12 +940,6 @@ "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 deleted file mode 100644 index 3149fd83017..00000000000 --- a/src/cloudflare/resources/magic_network_monitoring/__init__.py +++ /dev/null @@ -1,47 +0,0 @@ -# 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 deleted file mode 100644 index 3925a938c90..00000000000 --- a/src/cloudflare/resources/magic_network_monitoring/configs/__init__.py +++ /dev/null @@ -1,33 +0,0 @@ -# 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 deleted file mode 100644 index 89e7770ff27..00000000000 --- a/src/cloudflare/resources/magic_network_monitoring/configs/configs.py +++ /dev/null @@ -1,512 +0,0 @@ -# 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_identifier: 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_identifier}/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_identifier: 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_identifier}/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_identifier: 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_identifier}/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_identifier: 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_identifier}/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_identifier: 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_identifier}/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_identifier: 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_identifier}/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_identifier: 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_identifier}/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_identifier: 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_identifier}/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_identifier: 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_identifier}/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_identifier: 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_identifier}/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 deleted file mode 100644 index dd713a5c55d..00000000000 --- a/src/cloudflare/resources/magic_network_monitoring/configs/full.py +++ /dev/null @@ -1,150 +0,0 @@ -# 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_identifier: 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_identifier}/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_identifier: 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_identifier}/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 deleted file mode 100644 index 024fa234d68..00000000000 --- a/src/cloudflare/resources/magic_network_monitoring/magic_network_monitoring.py +++ /dev/null @@ -1,114 +0,0 @@ -# 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 deleted file mode 100644 index cba78cae500..00000000000 --- a/src/cloudflare/resources/magic_network_monitoring/rules/__init__.py +++ /dev/null @@ -1,33 +0,0 @@ -# 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 deleted file mode 100644 index 96865753337..00000000000 --- a/src/cloudflare/resources/magic_network_monitoring/rules/advertisements.py +++ /dev/null @@ -1,156 +0,0 @@ -# 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_identifier: object, - *, - account_identifier: 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_identifier}/mnm/rules/{rule_identifier}/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_identifier: object, - *, - account_identifier: 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_identifier}/mnm/rules/{rule_identifier}/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 deleted file mode 100644 index 05af0d63fff..00000000000 --- a/src/cloudflare/resources/magic_network_monitoring/rules/rules.py +++ /dev/null @@ -1,602 +0,0 @@ -# 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_identifier: 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_identifier}/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_identifier: 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_identifier}/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_identifier: 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_identifier}/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_identifier: object, - *, - account_identifier: 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_identifier}/mnm/rules/{rule_identifier}", - 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_identifier: object, - *, - account_identifier: 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_identifier}/mnm/rules/{rule_identifier}", - 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_identifier: object, - *, - account_identifier: 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_identifier}/mnm/rules/{rule_identifier}", - 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_identifier: 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_identifier}/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_identifier: 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_identifier}/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_identifier: 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_identifier}/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_identifier: object, - *, - account_identifier: 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_identifier}/mnm/rules/{rule_identifier}", - 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_identifier: object, - *, - account_identifier: 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_identifier}/mnm/rules/{rule_identifier}", - 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_identifier: object, - *, - account_identifier: 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_identifier}/mnm/rules/{rule_identifier}", - 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/types/magic_network_monitoring/__init__.py b/src/cloudflare/types/magic_network_monitoring/__init__.py index 855cef74221..f8ee8b14b1c 100644 --- a/src/cloudflare/types/magic_network_monitoring/__init__.py +++ b/src/cloudflare/types/magic_network_monitoring/__init__.py @@ -1,7 +1,3 @@ # 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 deleted file mode 100644 index 3e0c2dd03b1..00000000000 --- a/src/cloudflare/types/magic_network_monitoring/magic_visibility_mnm_config.py +++ /dev/null @@ -1,20 +0,0 @@ -# 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 deleted file mode 100644 index 311b5209a0e..00000000000 --- a/src/cloudflare/types/magic_network_monitoring/magic_visibility_mnm_rule.py +++ /dev/null @@ -1,51 +0,0 @@ -# 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 deleted file mode 100644 index 26b9278a876..00000000000 --- a/src/cloudflare/types/magic_network_monitoring/rule_list_response.py +++ /dev/null @@ -1,9 +0,0 @@ -# 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 23421e7b707..f8ee8b14b1c 100644 --- a/src/cloudflare/types/magic_network_monitoring/rules/__init__.py +++ b/src/cloudflare/types/magic_network_monitoring/rules/__init__.py @@ -1,7 +1,3 @@ # 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 deleted file mode 100644 index bfb67487939..00000000000 --- a/src/cloudflare/types/magic_network_monitoring/rules/magic_visibility_mnm_rule_advertisable.py +++ /dev/null @@ -1,16 +0,0 @@ -# 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/tests/api_resources/magic_network_monitoring/configs/test_full.py b/tests/api_resources/magic_network_monitoring/configs/test_full.py deleted file mode 100644 index 7211a14d994..00000000000 --- a/tests/api_resources/magic_network_monitoring/configs/test_full.py +++ /dev/null @@ -1,90 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -import os -from typing import Any, cast - -import pytest - -from cloudflare import Cloudflare, AsyncCloudflare -from tests.utils import assert_matches_type -from cloudflare.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( - "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( - "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( - "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( - "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( - "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( - "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 deleted file mode 100644 index 156fa626be3..00000000000 --- a/tests/api_resources/magic_network_monitoring/rules/test_advertisements.py +++ /dev/null @@ -1,96 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -import os -from typing import Any, 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_identifier="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_identifier="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_identifier="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_identifier="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_identifier="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_identifier="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 deleted file mode 100644 index beae68c4bf5..00000000000 --- a/tests/api_resources/magic_network_monitoring/test_configs.py +++ /dev/null @@ -1,362 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -import os -from typing import Any, cast - -import pytest - -from cloudflare import Cloudflare, AsyncCloudflare -from tests.utils import assert_matches_type -from cloudflare.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( - "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( - "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( - "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( - "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( - "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( - "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( - "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( - "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( - "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( - "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( - "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( - "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( - "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( - "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( - "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( - "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( - "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( - "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( - "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( - "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( - "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( - "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( - "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( - "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( - "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( - "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( - "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( - "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( - "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( - "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 deleted file mode 100644 index 91e201e6ab2..00000000000 --- a/tests/api_resources/magic_network_monitoring/test_rules.py +++ /dev/null @@ -1,448 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -import os -from typing import Any, 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( - "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( - "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( - "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( - "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( - "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( - "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( - "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( - "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( - "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_identifier="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_identifier="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_identifier="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_identifier="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_identifier="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_identifier="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_identifier="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_identifier="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_identifier="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( - "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( - "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( - "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( - "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( - "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( - "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( - "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( - "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( - "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_identifier="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_identifier="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_identifier="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_identifier="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_identifier="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_identifier="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_identifier="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_identifier="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_identifier="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