Compare commits

...

4 commits

Author SHA1 Message Date
stainless-app[bot]
643c8ba843 feat(api): OpenAPI spec update via Stainless API (#160) 2024-03-21 16:40:20 +00:00
stainless-app[bot]
abb60d42cd feat(api): update via SDK Studio (#159) 2024-03-21 11:15:57 +00:00
stainless-app[bot]
15686e43fb feat(api): update via SDK Studio (#158) 2024-03-21 04:36:39 +00:00
stainless-app[bot]
3c1de95c64 feat(api): update via SDK Studio (#156) 2024-03-21 04:12:36 +00:00
43 changed files with 135 additions and 2867 deletions

View file

@ -1 +1 @@
configured_endpoints: 1288
configured_endpoints: 1275

View file

@ -306,6 +306,41 @@ with client.zones.with_streaming_response.create(
The context manager is required so that the response will reliably be closed.
### Making custom/undocumented requests
This library is typed for convenient access the documented API.
If you need to access undocumented endpoints, params, or response properties, the library can still be used.
#### Undocumented endpoints
To make requests to undocumented endpoints, you can make requests using `client.get`, `client.post`, and other
http verbs. Options on the client will be respected (such as retries) will be respected when making this
request.
```py
import httpx
response = client.post(
"/foo",
cast_to=httpx.Response,
body={"my_param": True},
)
print(response.headers.get("x-foo"))
```
#### Undocumented params
If you want to explicitly send an extra param, you can do so with the `extra_query`, `extra_body`, and `extra_headers` request
options.
#### Undocumented properties
To access undocumented response properties, you can access the extra fields like `response.unknown_prop`. You
can also get all the extra fields on the Pydantic model as a dict with
[`response.model_extra`](https://docs.pydantic.dev/latest/api/base_model/#pydantic.BaseModel.model_extra).
### Configuring the HTTP client
You can directly override the [httpx client](https://www.python-httpx.org/api/#client) to customize it for your use case, including:

35
api.md
View file

@ -1,3 +1,9 @@
# Shared Types
```python
from cloudflare.types import ErrorData
```
# Accounts
Types:
@ -3932,37 +3938,14 @@ Types:
from cloudflare.types.magic_network_monitoring import MagicVisibilityMNMConfig
```
Methods:
- <code title="post /accounts/{account_identifier}/mnm/config">client.magic_network_monitoring.configs.<a href="./src/cloudflare/resources/magic_network_monitoring/configs/configs.py">create</a>(account_identifier) -> <a href="./src/cloudflare/types/magic_network_monitoring/magic_visibility_mnm_config.py">MagicVisibilityMNMConfig</a></code>
- <code title="put /accounts/{account_identifier}/mnm/config">client.magic_network_monitoring.configs.<a href="./src/cloudflare/resources/magic_network_monitoring/configs/configs.py">update</a>(account_identifier) -> <a href="./src/cloudflare/types/magic_network_monitoring/magic_visibility_mnm_config.py">MagicVisibilityMNMConfig</a></code>
- <code title="delete /accounts/{account_identifier}/mnm/config">client.magic_network_monitoring.configs.<a href="./src/cloudflare/resources/magic_network_monitoring/configs/configs.py">delete</a>(account_identifier) -> <a href="./src/cloudflare/types/magic_network_monitoring/magic_visibility_mnm_config.py">MagicVisibilityMNMConfig</a></code>
- <code title="patch /accounts/{account_identifier}/mnm/config">client.magic_network_monitoring.configs.<a href="./src/cloudflare/resources/magic_network_monitoring/configs/configs.py">edit</a>(account_identifier) -> <a href="./src/cloudflare/types/magic_network_monitoring/magic_visibility_mnm_config.py">MagicVisibilityMNMConfig</a></code>
- <code title="get /accounts/{account_identifier}/mnm/config">client.magic_network_monitoring.configs.<a href="./src/cloudflare/resources/magic_network_monitoring/configs/configs.py">get</a>(account_identifier) -> <a href="./src/cloudflare/types/magic_network_monitoring/magic_visibility_mnm_config.py">MagicVisibilityMNMConfig</a></code>
### Full
Methods:
- <code title="get /accounts/{account_identifier}/mnm/config/full">client.magic_network_monitoring.configs.full.<a href="./src/cloudflare/resources/magic_network_monitoring/configs/full.py">get</a>(account_identifier) -> <a href="./src/cloudflare/types/magic_network_monitoring/magic_visibility_mnm_config.py">MagicVisibilityMNMConfig</a></code>
## Rules
Types:
```python
from cloudflare.types.magic_network_monitoring import MagicVisibilityMNMRule, RuleListResponse
from cloudflare.types.magic_network_monitoring import MagicVisibilityMNMRule
```
Methods:
- <code title="post /accounts/{account_identifier}/mnm/rules">client.magic_network_monitoring.rules.<a href="./src/cloudflare/resources/magic_network_monitoring/rules/rules.py">create</a>(account_identifier) -> <a href="./src/cloudflare/types/magic_network_monitoring/magic_visibility_mnm_rule.py">Optional</a></code>
- <code title="put /accounts/{account_identifier}/mnm/rules">client.magic_network_monitoring.rules.<a href="./src/cloudflare/resources/magic_network_monitoring/rules/rules.py">update</a>(account_identifier) -> <a href="./src/cloudflare/types/magic_network_monitoring/magic_visibility_mnm_rule.py">Optional</a></code>
- <code title="get /accounts/{account_identifier}/mnm/rules">client.magic_network_monitoring.rules.<a href="./src/cloudflare/resources/magic_network_monitoring/rules/rules.py">list</a>(account_identifier) -> <a href="./src/cloudflare/types/magic_network_monitoring/rule_list_response.py">Optional</a></code>
- <code title="delete /accounts/{account_identifier}/mnm/rules/{rule_identifier}">client.magic_network_monitoring.rules.<a href="./src/cloudflare/resources/magic_network_monitoring/rules/rules.py">delete</a>(rule_identifier, \*, account_identifier) -> <a href="./src/cloudflare/types/magic_network_monitoring/magic_visibility_mnm_rule.py">Optional</a></code>
- <code title="patch /accounts/{account_identifier}/mnm/rules/{rule_identifier}">client.magic_network_monitoring.rules.<a href="./src/cloudflare/resources/magic_network_monitoring/rules/rules.py">edit</a>(rule_identifier, \*, account_identifier) -> <a href="./src/cloudflare/types/magic_network_monitoring/magic_visibility_mnm_rule.py">Optional</a></code>
- <code title="get /accounts/{account_identifier}/mnm/rules/{rule_identifier}">client.magic_network_monitoring.rules.<a href="./src/cloudflare/resources/magic_network_monitoring/rules/rules.py">get</a>(rule_identifier, \*, account_identifier) -> <a href="./src/cloudflare/types/magic_network_monitoring/magic_visibility_mnm_rule.py">Optional</a></code>
### Advertisements
Types:
@ -3971,10 +3954,6 @@ Types:
from cloudflare.types.magic_network_monitoring.rules import MagicVisibilityMNMRuleAdvertisable
```
Methods:
- <code title="patch /accounts/{account_identifier}/mnm/rules/{rule_identifier}/advertisement">client.magic_network_monitoring.rules.advertisements.<a href="./src/cloudflare/resources/magic_network_monitoring/rules/advertisements.py">edit</a>(rule_identifier, \*, account_identifier) -> <a href="./src/cloudflare/types/magic_network_monitoring/rules/magic_visibility_mnm_rule_advertisable.py">Optional</a></code>
# MTLSCertificates
Types:

View file

@ -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 @@ class Cloudflare(SyncAPIClient):
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 @@ class AsyncCloudflare(AsyncAPIClient):
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 @@ class CloudflareWithRawResponse:
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 @@ class AsyncCloudflareWithRawResponse:
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 @@ class CloudflareWithStreamedResponse:
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 @@ class AsyncCloudflareWithStreamedResponse:
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)

View file

@ -2,10 +2,15 @@
from __future__ import annotations
from typing import Any, List, cast
from typing_extensions import Literal
import httpx
from ._utils import is_dict
from ._models import construct_type
from .types.shared import ErrorData
__all__ = [
"BadRequestError",
"AuthenticationError",
@ -37,12 +42,19 @@ class APIError(CloudflareError):
If there was no response associated with this error then it will be `None`.
"""
def __init__(self, message: str, request: httpx.Request, *, body: object | None) -> None: # noqa: ARG002
errors: List[ErrorData]
def __init__(self, message: str, request: httpx.Request, *, body: object | None) -> None:
super().__init__(message)
self.request = request
self.message = message
self.body = body
if is_dict(body):
self.errors = cast(Any, construct_type(type_=List[ErrorData], value=body.get("errors")))
else:
self.errors = []
class APIResponseValidationError(APIError):
response: httpx.Response

View file

@ -624,14 +624,6 @@ from .certificate_authorities import (
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 @@ __all__ = [
"AsyncMagicTransitWithRawResponse",
"MagicTransitWithStreamingResponse",
"AsyncMagicTransitWithStreamingResponse",
"MagicNetworkMonitoring",
"AsyncMagicNetworkMonitoring",
"MagicNetworkMonitoringWithRawResponse",
"AsyncMagicNetworkMonitoringWithRawResponse",
"MagicNetworkMonitoringWithStreamingResponse",
"AsyncMagicNetworkMonitoringWithStreamingResponse",
"MTLSCertificates",
"AsyncMTLSCertificates",
"MTLSCertificatesWithRawResponse",

View file

@ -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",
]

View file

@ -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",
]

View file

@ -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)

View file

@ -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,
)

View file

@ -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)

View file

@ -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",
]

View file

@ -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,
)

View file

@ -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)

View file

@ -4,6 +4,7 @@ from __future__ import annotations
from .ips import IPs as IPs
from .zone import Zone as Zone
from .shared import ErrorData as ErrorData
from .account import Account as Account
from .snippet import Snippet as Snippet
from .calls_app import CallsApp as CallsApp

View file

@ -16,9 +16,9 @@ __all__ = [
"CAA",
"CAAData",
"CAAMeta",
"Cert",
"CertData",
"CertMeta",
"CERT",
"CERTData",
"CERTMeta",
"CNAME",
"CNAMEMeta",
"DNSKEY",
@ -42,9 +42,9 @@ __all__ = [
"NSMeta",
"PTR",
"PTRMeta",
"Smimea",
"SmimeaData",
"SmimeaMeta",
"SMIMEA",
"SMIMEAData",
"SMIMEAMeta",
"SRV",
"SRVData",
"SRVMeta",
@ -286,7 +286,7 @@ class CAA(BaseModel):
"""The domain of the record."""
class CertData(BaseModel):
class CERTData(BaseModel):
algorithm: Optional[float] = None
"""Algorithm."""
@ -300,7 +300,7 @@ class CertData(BaseModel):
"""Type."""
class CertMeta(BaseModel):
class CERTMeta(BaseModel):
auto_added: Optional[bool] = None
"""
Will exist if Cloudflare automatically added this DNS record during initial
@ -311,8 +311,8 @@ class CertMeta(BaseModel):
"""Where the record originated from."""
class Cert(BaseModel):
data: CertData
class CERT(BaseModel):
data: CERTData
"""Components of a CERT record."""
name: str
@ -342,7 +342,7 @@ class Cert(BaseModel):
Cloudflare).
"""
meta: Optional[CertMeta] = None
meta: Optional[CERTMeta] = None
"""Extra Cloudflare-specific information about the record."""
modified_on: Optional[datetime] = None
@ -1077,7 +1077,7 @@ class PTR(BaseModel):
"""The domain of the record."""
class SmimeaData(BaseModel):
class SMIMEAData(BaseModel):
certificate: Optional[str] = None
"""Certificate."""
@ -1091,7 +1091,7 @@ class SmimeaData(BaseModel):
"""Usage."""
class SmimeaMeta(BaseModel):
class SMIMEAMeta(BaseModel):
auto_added: Optional[bool] = None
"""
Will exist if Cloudflare automatically added this DNS record during initial
@ -1102,8 +1102,8 @@ class SmimeaMeta(BaseModel):
"""Where the record originated from."""
class Smimea(BaseModel):
data: SmimeaData
class SMIMEA(BaseModel):
data: SMIMEAData
"""Components of a SMIMEA record."""
name: str
@ -1133,7 +1133,7 @@ class Smimea(BaseModel):
Cloudflare).
"""
meta: Optional[SmimeaMeta] = None
meta: Optional[SMIMEAMeta] = None
"""Extra Cloudflare-specific information about the record."""
modified_on: Optional[datetime] = None
@ -1662,7 +1662,7 @@ class URI(BaseModel):
DNSRecord = Annotated[
Union[
A, AAAA, CAA, Cert, CNAME, DNSKEY, DS, HTTPS, LOC, MX, NAPTR, NS, PTR, Smimea, SRV, SSHFP, SVCB, TLSA, TXT, URI
A, AAAA, CAA, CERT, CNAME, DNSKEY, DS, HTTPS, LOC, MX, NAPTR, NS, PTR, SMIMEA, SRV, SSHFP, SVCB, TLSA, TXT, URI
],
PropertyInfo(discriminator="type"),
]

View file

@ -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

View file

@ -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]

View file

@ -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 cant 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.
"""

View file

@ -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]]

View file

@ -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,
)

View file

@ -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.
"""

View file

@ -0,0 +1,3 @@
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
from .error_data import ErrorData as ErrorData

View file

@ -0,0 +1,13 @@
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
from typing import Optional
from ..._models import BaseModel
__all__ = ["ErrorData"]
class ErrorData(BaseModel):
code: Optional[int] = None
message: Optional[str] = None

View file

@ -21,7 +21,7 @@ __all__ = [
"SettingsResultBindingWorkersDispatchNamespaceBinding",
"SettingsResultBindingWorkersDispatchNamespaceBindingOutbound",
"SettingsResultBindingWorkersDispatchNamespaceBindingOutboundWorker",
"SettingsResultBindingWorkersMTLSCertBinding",
"SettingsResultBindingWorkersMTLSCERTBinding",
"SettingsResultMigrations",
"SettingsResultMigrationsWorkersSingleStepMigrations",
"SettingsResultMigrationsWorkersSingleStepMigrationsRenamedClass",
@ -143,7 +143,7 @@ class SettingsResultBindingWorkersDispatchNamespaceBinding(TypedDict, total=Fals
"""Outbound worker"""
class SettingsResultBindingWorkersMTLSCertBinding(TypedDict, total=False):
class SettingsResultBindingWorkersMTLSCERTBinding(TypedDict, total=False):
type: Required[Literal["mtls_certificate"]]
"""The class of resource that the binding provides."""
@ -159,7 +159,7 @@ SettingsResultBinding = Union[
SettingsResultBindingWorkersQueueBinding,
SettingsResultBindingWorkersD1Binding,
SettingsResultBindingWorkersDispatchNamespaceBinding,
SettingsResultBindingWorkersMTLSCertBinding,
SettingsResultBindingWorkersMTLSCERTBinding,
]
_SettingsResultMigrationsWorkersSingleStepMigrationsRenamedClassReservedKeywords = TypedDict(

View file

@ -19,7 +19,7 @@ __all__ = [
"BindingWorkersDispatchNamespaceBinding",
"BindingWorkersDispatchNamespaceBindingOutbound",
"BindingWorkersDispatchNamespaceBindingOutboundWorker",
"BindingWorkersMTLSCertBinding",
"BindingWorkersMTLSCERTBinding",
"Migrations",
"MigrationsWorkersSingleStepMigrations",
"MigrationsWorkersSingleStepMigrationsRenamedClass",
@ -149,7 +149,7 @@ class BindingWorkersDispatchNamespaceBinding(BaseModel):
"""Outbound worker"""
class BindingWorkersMTLSCertBinding(BaseModel):
class BindingWorkersMTLSCERTBinding(BaseModel):
name: str
"""A JavaScript variable name for the binding."""
@ -168,7 +168,7 @@ Binding = Union[
BindingWorkersQueueBinding,
BindingWorkersD1Binding,
BindingWorkersDispatchNamespaceBinding,
BindingWorkersMTLSCertBinding,
BindingWorkersMTLSCERTBinding,
]

View file

@ -19,7 +19,7 @@ __all__ = [
"BindingWorkersDispatchNamespaceBinding",
"BindingWorkersDispatchNamespaceBindingOutbound",
"BindingWorkersDispatchNamespaceBindingOutboundWorker",
"BindingWorkersMTLSCertBinding",
"BindingWorkersMTLSCERTBinding",
"Migrations",
"MigrationsWorkersSingleStepMigrations",
"MigrationsWorkersSingleStepMigrationsRenamedClass",
@ -149,7 +149,7 @@ class BindingWorkersDispatchNamespaceBinding(BaseModel):
"""Outbound worker"""
class BindingWorkersMTLSCertBinding(BaseModel):
class BindingWorkersMTLSCERTBinding(BaseModel):
name: str
"""A JavaScript variable name for the binding."""
@ -168,7 +168,7 @@ Binding = Union[
BindingWorkersQueueBinding,
BindingWorkersD1Binding,
BindingWorkersDispatchNamespaceBinding,
BindingWorkersMTLSCertBinding,
BindingWorkersMTLSCERTBinding,
]

View file

@ -20,7 +20,7 @@ __all__ = [
"ResultBindingWorkersDispatchNamespaceBinding",
"ResultBindingWorkersDispatchNamespaceBindingOutbound",
"ResultBindingWorkersDispatchNamespaceBindingOutboundWorker",
"ResultBindingWorkersMTLSCertBinding",
"ResultBindingWorkersMTLSCERTBinding",
"ResultMigrations",
"ResultMigrationsWorkersSingleStepMigrations",
"ResultMigrationsWorkersSingleStepMigrationsRenamedClass",
@ -152,7 +152,7 @@ class ResultBindingWorkersDispatchNamespaceBinding(TypedDict, total=False):
"""Outbound worker"""
class ResultBindingWorkersMTLSCertBinding(TypedDict, total=False):
class ResultBindingWorkersMTLSCERTBinding(TypedDict, total=False):
type: Required[Literal["mtls_certificate"]]
"""The class of resource that the binding provides."""
@ -168,7 +168,7 @@ ResultBinding = Union[
ResultBindingWorkersQueueBinding,
ResultBindingWorkersD1Binding,
ResultBindingWorkersDispatchNamespaceBinding,
ResultBindingWorkersMTLSCertBinding,
ResultBindingWorkersMTLSCERTBinding,
]
_ResultMigrationsWorkersSingleStepMigrationsRenamedClassReservedKeywords = TypedDict(

View file

@ -19,7 +19,7 @@ __all__ = [
"BindingWorkersDispatchNamespaceBinding",
"BindingWorkersDispatchNamespaceBindingOutbound",
"BindingWorkersDispatchNamespaceBindingOutboundWorker",
"BindingWorkersMTLSCertBinding",
"BindingWorkersMTLSCERTBinding",
"Migrations",
"MigrationsWorkersSingleStepMigrations",
"MigrationsWorkersSingleStepMigrationsRenamedClass",
@ -149,7 +149,7 @@ class BindingWorkersDispatchNamespaceBinding(BaseModel):
"""Outbound worker"""
class BindingWorkersMTLSCertBinding(BaseModel):
class BindingWorkersMTLSCERTBinding(BaseModel):
name: str
"""A JavaScript variable name for the binding."""
@ -168,7 +168,7 @@ Binding = Union[
BindingWorkersQueueBinding,
BindingWorkersD1Binding,
BindingWorkersDispatchNamespaceBinding,
BindingWorkersMTLSCertBinding,
BindingWorkersMTLSCERTBinding,
]

View file

@ -19,7 +19,7 @@ __all__ = [
"BindingWorkersDispatchNamespaceBinding",
"BindingWorkersDispatchNamespaceBindingOutbound",
"BindingWorkersDispatchNamespaceBindingOutboundWorker",
"BindingWorkersMTLSCertBinding",
"BindingWorkersMTLSCERTBinding",
"Migrations",
"MigrationsWorkersSingleStepMigrations",
"MigrationsWorkersSingleStepMigrationsRenamedClass",
@ -149,7 +149,7 @@ class BindingWorkersDispatchNamespaceBinding(BaseModel):
"""Outbound worker"""
class BindingWorkersMTLSCertBinding(BaseModel):
class BindingWorkersMTLSCERTBinding(BaseModel):
name: str
"""A JavaScript variable name for the binding."""
@ -168,7 +168,7 @@ Binding = Union[
BindingWorkersQueueBinding,
BindingWorkersD1Binding,
BindingWorkersDispatchNamespaceBinding,
BindingWorkersMTLSCertBinding,
BindingWorkersMTLSCERTBinding,
]

View file

@ -16,7 +16,7 @@ __all__ = [
"WorkersDispatchNamespaceBinding",
"WorkersDispatchNamespaceBindingOutbound",
"WorkersDispatchNamespaceBindingOutboundWorker",
"WorkersMTLSCertBinding",
"WorkersMTLSCERTBinding",
]
@ -136,7 +136,7 @@ class WorkersDispatchNamespaceBinding(BaseModel):
"""Outbound worker"""
class WorkersMTLSCertBinding(BaseModel):
class WorkersMTLSCERTBinding(BaseModel):
name: str
"""A JavaScript variable name for the binding."""
@ -155,5 +155,5 @@ BindingGetResponse = Union[
WorkersQueueBinding,
WorkersD1Binding,
WorkersDispatchNamespaceBinding,
WorkersMTLSCertBinding,
WorkersMTLSCERTBinding,
]

View file

@ -20,7 +20,7 @@ __all__ = [
"ResultBindingWorkersDispatchNamespaceBinding",
"ResultBindingWorkersDispatchNamespaceBindingOutbound",
"ResultBindingWorkersDispatchNamespaceBindingOutboundWorker",
"ResultBindingWorkersMTLSCertBinding",
"ResultBindingWorkersMTLSCERTBinding",
"ResultMigrations",
"ResultMigrationsWorkersSingleStepMigrations",
"ResultMigrationsWorkersSingleStepMigrationsRenamedClass",
@ -152,7 +152,7 @@ class ResultBindingWorkersDispatchNamespaceBinding(TypedDict, total=False):
"""Outbound worker"""
class ResultBindingWorkersMTLSCertBinding(TypedDict, total=False):
class ResultBindingWorkersMTLSCERTBinding(TypedDict, total=False):
type: Required[Literal["mtls_certificate"]]
"""The class of resource that the binding provides."""
@ -168,7 +168,7 @@ ResultBinding = Union[
ResultBindingWorkersQueueBinding,
ResultBindingWorkersD1Binding,
ResultBindingWorkersDispatchNamespaceBinding,
ResultBindingWorkersMTLSCertBinding,
ResultBindingWorkersMTLSCERTBinding,
]
_ResultMigrationsWorkersSingleStepMigrationsRenamedClassReservedKeywords = TypedDict(

View file

@ -19,7 +19,7 @@ __all__ = [
"BindingWorkersDispatchNamespaceBinding",
"BindingWorkersDispatchNamespaceBindingOutbound",
"BindingWorkersDispatchNamespaceBindingOutboundWorker",
"BindingWorkersMTLSCertBinding",
"BindingWorkersMTLSCERTBinding",
"Migrations",
"MigrationsWorkersSingleStepMigrations",
"MigrationsWorkersSingleStepMigrationsRenamedClass",
@ -149,7 +149,7 @@ class BindingWorkersDispatchNamespaceBinding(BaseModel):
"""Outbound worker"""
class BindingWorkersMTLSCertBinding(BaseModel):
class BindingWorkersMTLSCERTBinding(BaseModel):
name: str
"""A JavaScript variable name for the binding."""
@ -168,7 +168,7 @@ Binding = Union[
BindingWorkersQueueBinding,
BindingWorkersD1Binding,
BindingWorkersDispatchNamespaceBinding,
BindingWorkersMTLSCertBinding,
BindingWorkersMTLSCERTBinding,
]

View file

@ -19,7 +19,7 @@ __all__ = [
"BindingWorkersDispatchNamespaceBinding",
"BindingWorkersDispatchNamespaceBindingOutbound",
"BindingWorkersDispatchNamespaceBindingOutboundWorker",
"BindingWorkersMTLSCertBinding",
"BindingWorkersMTLSCERTBinding",
"Migrations",
"MigrationsWorkersSingleStepMigrations",
"MigrationsWorkersSingleStepMigrationsRenamedClass",
@ -149,7 +149,7 @@ class BindingWorkersDispatchNamespaceBinding(BaseModel):
"""Outbound worker"""
class BindingWorkersMTLSCertBinding(BaseModel):
class BindingWorkersMTLSCERTBinding(BaseModel):
name: str
"""A JavaScript variable name for the binding."""
@ -168,7 +168,7 @@ Binding = Union[
BindingWorkersQueueBinding,
BindingWorkersD1Binding,
BindingWorkersDispatchNamespaceBinding,
BindingWorkersMTLSCertBinding,
BindingWorkersMTLSCERTBinding,
]

View file

@ -6,7 +6,7 @@ from pydantic import Field as FieldInfo
from ....._models import BaseModel
__all__ = ["AccessIdentity", "DeviceSessions", "DevicePosture", "DevicePostureCheck", "Geo", "Idp", "MTLSAuth"]
__all__ = ["AccessIdentity", "DeviceSessions", "DevicePosture", "DevicePostureCheck", "Geo", "IDP", "MTLSAuth"]
class DeviceSessions(BaseModel):
@ -43,7 +43,7 @@ class Geo(BaseModel):
country: Optional[str] = None
class Idp(BaseModel):
class IDP(BaseModel):
id: Optional[str] = None
type: Optional[str] = None
@ -80,7 +80,7 @@ class AccessIdentity(BaseModel):
iat: Optional[float] = None
idp: Optional[Idp] = None
idp: Optional[IDP] = None
ip: Optional[str] = None

View file

@ -12,7 +12,7 @@ __all__ = [
"DevicePosture",
"DevicePostureCheck",
"Geo",
"Idp",
"IDP",
"MTLSAuth",
]
@ -51,7 +51,7 @@ class Geo(BaseModel):
country: Optional[str] = None
class Idp(BaseModel):
class IDP(BaseModel):
id: Optional[str] = None
type: Optional[str] = None
@ -88,7 +88,7 @@ class ActiveSessionGetResponse(BaseModel):
iat: Optional[float] = None
idp: Optional[Idp] = None
idp: Optional[IDP] = None
ip: Optional[str] = None

View file

@ -18,7 +18,7 @@ __all__ = [
"RuleSettingsL4override",
"RuleSettingsNotificationSettings",
"RuleSettingsPayloadLog",
"RuleSettingsUntrustedCert",
"RuleSettingsUntrustedCERT",
"Schedule",
]
@ -208,7 +208,7 @@ class RuleSettingsPayloadLog(TypedDict, total=False):
"""Set to true to enable DLP payload logging for this rule."""
class RuleSettingsUntrustedCert(TypedDict, total=False):
class RuleSettingsUntrustedCERT(TypedDict, total=False):
action: Literal["pass_through", "block", "error"]
"""The action performed when an untrusted certificate is seen.
@ -300,7 +300,7 @@ class RuleSettings(TypedDict, total=False):
resolver. Cannot be set when dns_resolvers are specified.
"""
untrusted_cert: RuleSettingsUntrustedCert
untrusted_cert: RuleSettingsUntrustedCERT
"""Configure behavior when an upstream cert is invalid or an SSL error occurs."""

View file

@ -18,7 +18,7 @@ __all__ = [
"RuleSettingsL4override",
"RuleSettingsNotificationSettings",
"RuleSettingsPayloadLog",
"RuleSettingsUntrustedCert",
"RuleSettingsUntrustedCERT",
"Schedule",
]
@ -208,7 +208,7 @@ class RuleSettingsPayloadLog(TypedDict, total=False):
"""Set to true to enable DLP payload logging for this rule."""
class RuleSettingsUntrustedCert(TypedDict, total=False):
class RuleSettingsUntrustedCERT(TypedDict, total=False):
action: Literal["pass_through", "block", "error"]
"""The action performed when an untrusted certificate is seen.
@ -300,7 +300,7 @@ class RuleSettings(TypedDict, total=False):
resolver. Cannot be set when dns_resolvers are specified.
"""
untrusted_cert: RuleSettingsUntrustedCert
untrusted_cert: RuleSettingsUntrustedCERT
"""Configure behavior when an upstream cert is invalid or an SSL error occurs."""

View file

@ -19,7 +19,7 @@ __all__ = [
"RuleSettingsL4override",
"RuleSettingsNotificationSettings",
"RuleSettingsPayloadLog",
"RuleSettingsUntrustedCert",
"RuleSettingsUntrustedCERT",
"Schedule",
]
@ -142,7 +142,7 @@ class RuleSettingsPayloadLog(BaseModel):
"""Set to true to enable DLP payload logging for this rule."""
class RuleSettingsUntrustedCert(BaseModel):
class RuleSettingsUntrustedCERT(BaseModel):
action: Optional[Literal["pass_through", "block", "error"]] = None
"""The action performed when an untrusted certificate is seen.
@ -234,7 +234,7 @@ class RuleSettings(BaseModel):
resolver. Cannot be set when dns_resolvers are specified.
"""
untrusted_cert: Optional[RuleSettingsUntrustedCert] = None
untrusted_cert: Optional[RuleSettingsUntrustedCERT] = None
"""Configure behavior when an upstream cert is invalid or an SSL error occurs."""

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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