diff --git a/api.md b/api.md index d22784b732b..af34e305ade 100644 --- a/api.md +++ b/api.md @@ -2857,9 +2857,9 @@ from cloudflare.types.rulesets import VersionListResponse, VersionGetResponse Methods: -- client.rulesets.versions.list(ruleset_id, \*, account_id, zone_id) -> SyncSinglePage[VersionListResponse] -- client.rulesets.versions.delete(ruleset_version, \*, ruleset_id, account_id, zone_id) -> None -- client.rulesets.versions.get(ruleset_version, \*, ruleset_id, account_id, zone_id) -> VersionGetResponse +- client.rulesets.versions.list(ruleset_id, \*, account_id, zone_id) -> SyncSinglePage[VersionListResponse] +- client.rulesets.versions.delete(ruleset_version, \*, ruleset_id, account_id, zone_id) -> None +- client.rulesets.versions.get(ruleset_version, \*, ruleset_id, account_id, zone_id) -> VersionGetResponse # URLNormalization @@ -3797,70 +3797,51 @@ Methods: Types: ```python -from cloudflare.types.magic_network_monitoring import ( - ConfigCreateResponse, - ConfigUpdateResponse, - ConfigDeleteResponse, - ConfigEditResponse, - ConfigGetResponse, -) +from cloudflare.types.magic_network_monitoring import Configuration ``` Methods: -- client.magic_network_monitoring.configs.create(\*, account_id, \*\*params) -> ConfigCreateResponse -- client.magic_network_monitoring.configs.update(\*, account_id, \*\*params) -> ConfigUpdateResponse -- client.magic_network_monitoring.configs.delete(\*, account_id) -> ConfigDeleteResponse -- client.magic_network_monitoring.configs.edit(\*, account_id, \*\*params) -> ConfigEditResponse -- client.magic_network_monitoring.configs.get(\*, account_id) -> ConfigGetResponse +- client.magic_network_monitoring.configs.create(\*, account_id, \*\*params) -> Configuration +- client.magic_network_monitoring.configs.update(\*, account_id, \*\*params) -> Configuration +- client.magic_network_monitoring.configs.delete(\*, account_id) -> Configuration +- client.magic_network_monitoring.configs.edit(\*, account_id, \*\*params) -> Configuration +- client.magic_network_monitoring.configs.get(\*, account_id) -> Configuration ### Full -Types: - -```python -from cloudflare.types.magic_network_monitoring.configs import FullGetResponse -``` - Methods: -- client.magic_network_monitoring.configs.full.get(\*, account_id) -> FullGetResponse +- client.magic_network_monitoring.configs.full.get(\*, account_id) -> Configuration ## Rules Types: ```python -from cloudflare.types.magic_network_monitoring import ( - RuleCreateResponse, - RuleUpdateResponse, - RuleListResponse, - RuleDeleteResponse, - RuleEditResponse, - RuleGetResponse, -) +from cloudflare.types.magic_network_monitoring import MagicNetworkMonitoringRule ``` Methods: -- client.magic_network_monitoring.rules.create(\*, account_id, \*\*params) -> Optional -- client.magic_network_monitoring.rules.update(\*, account_id, \*\*params) -> Optional -- client.magic_network_monitoring.rules.list(\*, account_id) -> SyncSinglePage[Optional] -- client.magic_network_monitoring.rules.delete(rule_id, \*, account_id) -> Optional -- client.magic_network_monitoring.rules.edit(rule_id, \*, account_id, \*\*params) -> Optional -- client.magic_network_monitoring.rules.get(rule_id, \*, account_id) -> Optional +- client.magic_network_monitoring.rules.create(\*, account_id, \*\*params) -> Optional +- client.magic_network_monitoring.rules.update(\*, account_id, \*\*params) -> Optional +- client.magic_network_monitoring.rules.list(\*, account_id) -> SyncSinglePage[Optional] +- client.magic_network_monitoring.rules.delete(rule_id, \*, account_id) -> Optional +- client.magic_network_monitoring.rules.edit(rule_id, \*, account_id, \*\*params) -> Optional +- client.magic_network_monitoring.rules.get(rule_id, \*, account_id) -> Optional ### Advertisements Types: ```python -from cloudflare.types.magic_network_monitoring.rules import AdvertisementEditResponse +from cloudflare.types.magic_network_monitoring.rules import Advertisement ``` Methods: -- client.magic_network_monitoring.rules.advertisements.edit(rule_id, \*, account_id, \*\*params) -> Optional +- client.magic_network_monitoring.rules.advertisements.edit(rule_id, \*, account_id, \*\*params) -> Optional # MTLSCertificates diff --git a/src/cloudflare/resources/magic_network_monitoring/configs/configs.py b/src/cloudflare/resources/magic_network_monitoring/configs/configs.py index 00cbf9aa6f8..81996968348 100644 --- a/src/cloudflare/resources/magic_network_monitoring/configs/configs.py +++ b/src/cloudflare/resources/magic_network_monitoring/configs/configs.py @@ -30,11 +30,7 @@ from ...._wrappers import ResultWrapper from ...._base_client import make_request_options from ....types.magic_network_monitoring import config_edit_params, config_create_params, config_update_params -from ....types.magic_network_monitoring.config_get_response import ConfigGetResponse -from ....types.magic_network_monitoring.config_edit_response import ConfigEditResponse -from ....types.magic_network_monitoring.config_create_response import ConfigCreateResponse -from ....types.magic_network_monitoring.config_delete_response import ConfigDeleteResponse -from ....types.magic_network_monitoring.config_update_response import ConfigUpdateResponse +from ....types.magic_network_monitoring.configuration import Configuration __all__ = ["ConfigsResource", "AsyncConfigsResource"] @@ -77,7 +73,7 @@ def create( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> ConfigCreateResponse: + ) -> Configuration: """ Create a new network monitoring configuration. @@ -113,9 +109,9 @@ def create( extra_query=extra_query, extra_body=extra_body, timeout=timeout, - post_parser=ResultWrapper[ConfigCreateResponse]._unwrapper, + post_parser=ResultWrapper[Configuration]._unwrapper, ), - cast_to=cast(Type[ConfigCreateResponse], ResultWrapper[ConfigCreateResponse]), + cast_to=cast(Type[Configuration], ResultWrapper[Configuration]), ) def update( @@ -132,7 +128,7 @@ def update( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> ConfigUpdateResponse: + ) -> Configuration: """ Update an existing network monitoring configuration, requires the entire configuration to be updated at once. @@ -169,9 +165,9 @@ def update( extra_query=extra_query, extra_body=extra_body, timeout=timeout, - post_parser=ResultWrapper[ConfigUpdateResponse]._unwrapper, + post_parser=ResultWrapper[Configuration]._unwrapper, ), - cast_to=cast(Type[ConfigUpdateResponse], ResultWrapper[ConfigUpdateResponse]), + cast_to=cast(Type[Configuration], ResultWrapper[Configuration]), ) def delete( @@ -184,7 +180,7 @@ def delete( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> ConfigDeleteResponse: + ) -> Configuration: """ Delete an existing network monitoring configuration. @@ -206,9 +202,9 @@ def delete( extra_query=extra_query, extra_body=extra_body, timeout=timeout, - post_parser=ResultWrapper[ConfigDeleteResponse]._unwrapper, + post_parser=ResultWrapper[Configuration]._unwrapper, ), - cast_to=cast(Type[ConfigDeleteResponse], ResultWrapper[ConfigDeleteResponse]), + cast_to=cast(Type[Configuration], ResultWrapper[Configuration]), ) def edit( @@ -225,7 +221,7 @@ def edit( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> ConfigEditResponse: + ) -> Configuration: """ Update fields in an existing network monitoring configuration. @@ -261,9 +257,9 @@ def edit( extra_query=extra_query, extra_body=extra_body, timeout=timeout, - post_parser=ResultWrapper[ConfigEditResponse]._unwrapper, + post_parser=ResultWrapper[Configuration]._unwrapper, ), - cast_to=cast(Type[ConfigEditResponse], ResultWrapper[ConfigEditResponse]), + cast_to=cast(Type[Configuration], ResultWrapper[Configuration]), ) def get( @@ -276,7 +272,7 @@ def get( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> ConfigGetResponse: + ) -> Configuration: """ Lists default sampling, router IPs and warp devices for account. @@ -298,9 +294,9 @@ def get( extra_query=extra_query, extra_body=extra_body, timeout=timeout, - post_parser=ResultWrapper[ConfigGetResponse]._unwrapper, + post_parser=ResultWrapper[Configuration]._unwrapper, ), - cast_to=cast(Type[ConfigGetResponse], ResultWrapper[ConfigGetResponse]), + cast_to=cast(Type[Configuration], ResultWrapper[Configuration]), ) @@ -342,7 +338,7 @@ async def create( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> ConfigCreateResponse: + ) -> Configuration: """ Create a new network monitoring configuration. @@ -378,9 +374,9 @@ async def create( extra_query=extra_query, extra_body=extra_body, timeout=timeout, - post_parser=ResultWrapper[ConfigCreateResponse]._unwrapper, + post_parser=ResultWrapper[Configuration]._unwrapper, ), - cast_to=cast(Type[ConfigCreateResponse], ResultWrapper[ConfigCreateResponse]), + cast_to=cast(Type[Configuration], ResultWrapper[Configuration]), ) async def update( @@ -397,7 +393,7 @@ async def update( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> ConfigUpdateResponse: + ) -> Configuration: """ Update an existing network monitoring configuration, requires the entire configuration to be updated at once. @@ -434,9 +430,9 @@ async def update( extra_query=extra_query, extra_body=extra_body, timeout=timeout, - post_parser=ResultWrapper[ConfigUpdateResponse]._unwrapper, + post_parser=ResultWrapper[Configuration]._unwrapper, ), - cast_to=cast(Type[ConfigUpdateResponse], ResultWrapper[ConfigUpdateResponse]), + cast_to=cast(Type[Configuration], ResultWrapper[Configuration]), ) async def delete( @@ -449,7 +445,7 @@ async def delete( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> ConfigDeleteResponse: + ) -> Configuration: """ Delete an existing network monitoring configuration. @@ -471,9 +467,9 @@ async def delete( extra_query=extra_query, extra_body=extra_body, timeout=timeout, - post_parser=ResultWrapper[ConfigDeleteResponse]._unwrapper, + post_parser=ResultWrapper[Configuration]._unwrapper, ), - cast_to=cast(Type[ConfigDeleteResponse], ResultWrapper[ConfigDeleteResponse]), + cast_to=cast(Type[Configuration], ResultWrapper[Configuration]), ) async def edit( @@ -490,7 +486,7 @@ async def edit( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> ConfigEditResponse: + ) -> Configuration: """ Update fields in an existing network monitoring configuration. @@ -526,9 +522,9 @@ async def edit( extra_query=extra_query, extra_body=extra_body, timeout=timeout, - post_parser=ResultWrapper[ConfigEditResponse]._unwrapper, + post_parser=ResultWrapper[Configuration]._unwrapper, ), - cast_to=cast(Type[ConfigEditResponse], ResultWrapper[ConfigEditResponse]), + cast_to=cast(Type[Configuration], ResultWrapper[Configuration]), ) async def get( @@ -541,7 +537,7 @@ async def get( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> ConfigGetResponse: + ) -> Configuration: """ Lists default sampling, router IPs and warp devices for account. @@ -563,9 +559,9 @@ async def get( extra_query=extra_query, extra_body=extra_body, timeout=timeout, - post_parser=ResultWrapper[ConfigGetResponse]._unwrapper, + post_parser=ResultWrapper[Configuration]._unwrapper, ), - cast_to=cast(Type[ConfigGetResponse], ResultWrapper[ConfigGetResponse]), + cast_to=cast(Type[Configuration], ResultWrapper[Configuration]), ) diff --git a/src/cloudflare/resources/magic_network_monitoring/configs/full.py b/src/cloudflare/resources/magic_network_monitoring/configs/full.py index 464da47eff9..bdfd8e8bbf6 100644 --- a/src/cloudflare/resources/magic_network_monitoring/configs/full.py +++ b/src/cloudflare/resources/magic_network_monitoring/configs/full.py @@ -17,7 +17,7 @@ ) from ...._wrappers import ResultWrapper from ...._base_client import make_request_options -from ....types.magic_network_monitoring.configs.full_get_response import FullGetResponse +from ....types.magic_network_monitoring.configuration import Configuration __all__ = ["FullResource", "AsyncFullResource"] @@ -52,7 +52,7 @@ def get( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> FullGetResponse: + ) -> Configuration: """ Lists default sampling, router IPs, warp devices, and rules for account. @@ -74,9 +74,9 @@ def get( extra_query=extra_query, extra_body=extra_body, timeout=timeout, - post_parser=ResultWrapper[FullGetResponse]._unwrapper, + post_parser=ResultWrapper[Configuration]._unwrapper, ), - cast_to=cast(Type[FullGetResponse], ResultWrapper[FullGetResponse]), + cast_to=cast(Type[Configuration], ResultWrapper[Configuration]), ) @@ -110,7 +110,7 @@ async def get( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> FullGetResponse: + ) -> Configuration: """ Lists default sampling, router IPs, warp devices, and rules for account. @@ -132,9 +132,9 @@ async def get( extra_query=extra_query, extra_body=extra_body, timeout=timeout, - post_parser=ResultWrapper[FullGetResponse]._unwrapper, + post_parser=ResultWrapper[Configuration]._unwrapper, ), - cast_to=cast(Type[FullGetResponse], ResultWrapper[FullGetResponse]), + cast_to=cast(Type[Configuration], ResultWrapper[Configuration]), ) diff --git a/src/cloudflare/resources/magic_network_monitoring/rules/advertisements.py b/src/cloudflare/resources/magic_network_monitoring/rules/advertisements.py index cad61c84f48..482662f8d5a 100644 --- a/src/cloudflare/resources/magic_network_monitoring/rules/advertisements.py +++ b/src/cloudflare/resources/magic_network_monitoring/rules/advertisements.py @@ -22,7 +22,7 @@ from ...._wrappers import ResultWrapper from ...._base_client import make_request_options from ....types.magic_network_monitoring.rules import advertisement_edit_params -from ....types.magic_network_monitoring.rules.advertisement_edit_response import AdvertisementEditResponse +from ....types.magic_network_monitoring.rules.advertisement import Advertisement __all__ = ["AdvertisementsResource", "AsyncAdvertisementsResource"] @@ -59,7 +59,7 @@ def edit( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[AdvertisementEditResponse]: + ) -> Optional[Advertisement]: """Update advertisement for rule. Args: @@ -87,9 +87,9 @@ def edit( extra_query=extra_query, extra_body=extra_body, timeout=timeout, - post_parser=ResultWrapper[Optional[AdvertisementEditResponse]]._unwrapper, + post_parser=ResultWrapper[Optional[Advertisement]]._unwrapper, ), - cast_to=cast(Type[Optional[AdvertisementEditResponse]], ResultWrapper[AdvertisementEditResponse]), + cast_to=cast(Type[Optional[Advertisement]], ResultWrapper[Advertisement]), ) @@ -125,7 +125,7 @@ async def edit( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[AdvertisementEditResponse]: + ) -> Optional[Advertisement]: """Update advertisement for rule. Args: @@ -153,9 +153,9 @@ async def edit( extra_query=extra_query, extra_body=extra_body, timeout=timeout, - post_parser=ResultWrapper[Optional[AdvertisementEditResponse]]._unwrapper, + post_parser=ResultWrapper[Optional[Advertisement]]._unwrapper, ), - cast_to=cast(Type[Optional[AdvertisementEditResponse]], ResultWrapper[AdvertisementEditResponse]), + cast_to=cast(Type[Optional[Advertisement]], ResultWrapper[Advertisement]), ) diff --git a/src/cloudflare/resources/magic_network_monitoring/rules/rules.py b/src/cloudflare/resources/magic_network_monitoring/rules/rules.py index d4b1ace7da5..80062c1b487 100644 --- a/src/cloudflare/resources/magic_network_monitoring/rules/rules.py +++ b/src/cloudflare/resources/magic_network_monitoring/rules/rules.py @@ -31,12 +31,7 @@ ) from ...._base_client import AsyncPaginator, make_request_options from ....types.magic_network_monitoring import rule_edit_params, rule_create_params, rule_update_params -from ....types.magic_network_monitoring.rule_get_response import RuleGetResponse -from ....types.magic_network_monitoring.rule_edit_response import RuleEditResponse -from ....types.magic_network_monitoring.rule_list_response import RuleListResponse -from ....types.magic_network_monitoring.rule_create_response import RuleCreateResponse -from ....types.magic_network_monitoring.rule_delete_response import RuleDeleteResponse -from ....types.magic_network_monitoring.rule_update_response import RuleUpdateResponse +from ....types.magic_network_monitoring.magic_network_monitoring_rule import MagicNetworkMonitoringRule __all__ = ["RulesResource", "AsyncRulesResource"] @@ -81,7 +76,7 @@ def create( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[RuleCreateResponse]: + ) -> Optional[MagicNetworkMonitoringRule]: """Create network monitoring rules for account. Currently only supports creating a @@ -136,9 +131,9 @@ def create( extra_query=extra_query, extra_body=extra_body, timeout=timeout, - post_parser=ResultWrapper[Optional[RuleCreateResponse]]._unwrapper, + post_parser=ResultWrapper[Optional[MagicNetworkMonitoringRule]]._unwrapper, ), - cast_to=cast(Type[Optional[RuleCreateResponse]], ResultWrapper[RuleCreateResponse]), + cast_to=cast(Type[Optional[MagicNetworkMonitoringRule]], ResultWrapper[MagicNetworkMonitoringRule]), ) def update( @@ -158,7 +153,7 @@ def update( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[RuleUpdateResponse]: + ) -> Optional[MagicNetworkMonitoringRule]: """ Update network monitoring rules for account. @@ -214,9 +209,9 @@ def update( extra_query=extra_query, extra_body=extra_body, timeout=timeout, - post_parser=ResultWrapper[Optional[RuleUpdateResponse]]._unwrapper, + post_parser=ResultWrapper[Optional[MagicNetworkMonitoringRule]]._unwrapper, ), - cast_to=cast(Type[Optional[RuleUpdateResponse]], ResultWrapper[RuleUpdateResponse]), + cast_to=cast(Type[Optional[MagicNetworkMonitoringRule]], ResultWrapper[MagicNetworkMonitoringRule]), ) def list( @@ -229,7 +224,7 @@ def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> SyncSinglePage[Optional[RuleListResponse]]: + ) -> SyncSinglePage[Optional[MagicNetworkMonitoringRule]]: """ Lists network monitoring rules for account. @@ -246,11 +241,11 @@ def list( raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get_api_list( f"/accounts/{account_id}/mnm/rules", - page=SyncSinglePage[Optional[RuleListResponse]], + page=SyncSinglePage[Optional[MagicNetworkMonitoringRule]], options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - model=RuleListResponse, + model=MagicNetworkMonitoringRule, ) def delete( @@ -264,7 +259,7 @@ def delete( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[RuleDeleteResponse]: + ) -> Optional[MagicNetworkMonitoringRule]: """ Delete a network monitoring rule for account. @@ -290,9 +285,9 @@ def delete( extra_query=extra_query, extra_body=extra_body, timeout=timeout, - post_parser=ResultWrapper[Optional[RuleDeleteResponse]]._unwrapper, + post_parser=ResultWrapper[Optional[MagicNetworkMonitoringRule]]._unwrapper, ), - cast_to=cast(Type[Optional[RuleDeleteResponse]], ResultWrapper[RuleDeleteResponse]), + cast_to=cast(Type[Optional[MagicNetworkMonitoringRule]], ResultWrapper[MagicNetworkMonitoringRule]), ) def edit( @@ -312,7 +307,7 @@ def edit( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[RuleEditResponse]: + ) -> Optional[MagicNetworkMonitoringRule]: """ Update a network monitoring rule for account. @@ -369,9 +364,9 @@ def edit( extra_query=extra_query, extra_body=extra_body, timeout=timeout, - post_parser=ResultWrapper[Optional[RuleEditResponse]]._unwrapper, + post_parser=ResultWrapper[Optional[MagicNetworkMonitoringRule]]._unwrapper, ), - cast_to=cast(Type[Optional[RuleEditResponse]], ResultWrapper[RuleEditResponse]), + cast_to=cast(Type[Optional[MagicNetworkMonitoringRule]], ResultWrapper[MagicNetworkMonitoringRule]), ) def get( @@ -385,7 +380,7 @@ def get( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[RuleGetResponse]: + ) -> Optional[MagicNetworkMonitoringRule]: """ List a single network monitoring rule for account. @@ -411,9 +406,9 @@ def get( extra_query=extra_query, extra_body=extra_body, timeout=timeout, - post_parser=ResultWrapper[Optional[RuleGetResponse]]._unwrapper, + post_parser=ResultWrapper[Optional[MagicNetworkMonitoringRule]]._unwrapper, ), - cast_to=cast(Type[Optional[RuleGetResponse]], ResultWrapper[RuleGetResponse]), + cast_to=cast(Type[Optional[MagicNetworkMonitoringRule]], ResultWrapper[MagicNetworkMonitoringRule]), ) @@ -457,7 +452,7 @@ async def create( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[RuleCreateResponse]: + ) -> Optional[MagicNetworkMonitoringRule]: """Create network monitoring rules for account. Currently only supports creating a @@ -512,9 +507,9 @@ async def create( extra_query=extra_query, extra_body=extra_body, timeout=timeout, - post_parser=ResultWrapper[Optional[RuleCreateResponse]]._unwrapper, + post_parser=ResultWrapper[Optional[MagicNetworkMonitoringRule]]._unwrapper, ), - cast_to=cast(Type[Optional[RuleCreateResponse]], ResultWrapper[RuleCreateResponse]), + cast_to=cast(Type[Optional[MagicNetworkMonitoringRule]], ResultWrapper[MagicNetworkMonitoringRule]), ) async def update( @@ -534,7 +529,7 @@ async def update( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[RuleUpdateResponse]: + ) -> Optional[MagicNetworkMonitoringRule]: """ Update network monitoring rules for account. @@ -590,9 +585,9 @@ async def update( extra_query=extra_query, extra_body=extra_body, timeout=timeout, - post_parser=ResultWrapper[Optional[RuleUpdateResponse]]._unwrapper, + post_parser=ResultWrapper[Optional[MagicNetworkMonitoringRule]]._unwrapper, ), - cast_to=cast(Type[Optional[RuleUpdateResponse]], ResultWrapper[RuleUpdateResponse]), + cast_to=cast(Type[Optional[MagicNetworkMonitoringRule]], ResultWrapper[MagicNetworkMonitoringRule]), ) def list( @@ -605,7 +600,7 @@ def list( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> AsyncPaginator[Optional[RuleListResponse], AsyncSinglePage[Optional[RuleListResponse]]]: + ) -> AsyncPaginator[Optional[MagicNetworkMonitoringRule], AsyncSinglePage[Optional[MagicNetworkMonitoringRule]]]: """ Lists network monitoring rules for account. @@ -622,11 +617,11 @@ def list( raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}") return self._get_api_list( f"/accounts/{account_id}/mnm/rules", - page=AsyncSinglePage[Optional[RuleListResponse]], + page=AsyncSinglePage[Optional[MagicNetworkMonitoringRule]], options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - model=RuleListResponse, + model=MagicNetworkMonitoringRule, ) async def delete( @@ -640,7 +635,7 @@ async def delete( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[RuleDeleteResponse]: + ) -> Optional[MagicNetworkMonitoringRule]: """ Delete a network monitoring rule for account. @@ -666,9 +661,9 @@ async def delete( extra_query=extra_query, extra_body=extra_body, timeout=timeout, - post_parser=ResultWrapper[Optional[RuleDeleteResponse]]._unwrapper, + post_parser=ResultWrapper[Optional[MagicNetworkMonitoringRule]]._unwrapper, ), - cast_to=cast(Type[Optional[RuleDeleteResponse]], ResultWrapper[RuleDeleteResponse]), + cast_to=cast(Type[Optional[MagicNetworkMonitoringRule]], ResultWrapper[MagicNetworkMonitoringRule]), ) async def edit( @@ -688,7 +683,7 @@ async def edit( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[RuleEditResponse]: + ) -> Optional[MagicNetworkMonitoringRule]: """ Update a network monitoring rule for account. @@ -745,9 +740,9 @@ async def edit( extra_query=extra_query, extra_body=extra_body, timeout=timeout, - post_parser=ResultWrapper[Optional[RuleEditResponse]]._unwrapper, + post_parser=ResultWrapper[Optional[MagicNetworkMonitoringRule]]._unwrapper, ), - cast_to=cast(Type[Optional[RuleEditResponse]], ResultWrapper[RuleEditResponse]), + cast_to=cast(Type[Optional[MagicNetworkMonitoringRule]], ResultWrapper[MagicNetworkMonitoringRule]), ) async def get( @@ -761,7 +756,7 @@ async def get( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> Optional[RuleGetResponse]: + ) -> Optional[MagicNetworkMonitoringRule]: """ List a single network monitoring rule for account. @@ -787,9 +782,9 @@ async def get( extra_query=extra_query, extra_body=extra_body, timeout=timeout, - post_parser=ResultWrapper[Optional[RuleGetResponse]]._unwrapper, + post_parser=ResultWrapper[Optional[MagicNetworkMonitoringRule]]._unwrapper, ), - cast_to=cast(Type[Optional[RuleGetResponse]], ResultWrapper[RuleGetResponse]), + cast_to=cast(Type[Optional[MagicNetworkMonitoringRule]], ResultWrapper[MagicNetworkMonitoringRule]), ) diff --git a/src/cloudflare/resources/rulesets/rulesets.py b/src/cloudflare/resources/rulesets/rulesets.py index b7379f9d8d5..ab563958453 100644 --- a/src/cloudflare/resources/rulesets/rulesets.py +++ b/src/cloudflare/resources/rulesets/rulesets.py @@ -48,7 +48,6 @@ from .phases.phases import PhasesResource, AsyncPhasesResource from ..._base_client import AsyncPaginator, make_request_options from ...types.rulesets import Kind, Phase, ruleset_create_params, ruleset_update_params -from .versions.versions import VersionsResource, AsyncVersionsResource from ...types.rulesets.kind import Kind from ...types.rulesets.phase import Phase from ...types.rulesets.ruleset_get_response import RulesetGetResponse diff --git a/src/cloudflare/resources/rulesets/versions/versions.py b/src/cloudflare/resources/rulesets/versions.py similarity index 97% rename from src/cloudflare/resources/rulesets/versions/versions.py rename to src/cloudflare/resources/rulesets/versions.py index 50dc513715f..0d424b1c5fd 100644 --- a/src/cloudflare/resources/rulesets/versions/versions.py +++ b/src/cloudflare/resources/rulesets/versions.py @@ -6,20 +6,20 @@ import httpx -from ...._types import NOT_GIVEN, Body, Query, Headers, NoneType, NotGiven -from ...._compat import cached_property -from ...._resource import SyncAPIResource, AsyncAPIResource -from ...._response import ( +from ..._types import NOT_GIVEN, Body, Query, Headers, NoneType, 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 ....pagination import SyncSinglePage, AsyncSinglePage -from ...._base_client import AsyncPaginator, make_request_options -from ....types.rulesets.version_get_response import VersionGetResponse -from ....types.rulesets.version_list_response import VersionListResponse +from ..._wrappers import ResultWrapper +from ...pagination import SyncSinglePage, AsyncSinglePage +from ..._base_client import AsyncPaginator, make_request_options +from ...types.rulesets.version_get_response import VersionGetResponse +from ...types.rulesets.version_list_response import VersionListResponse __all__ = ["VersionsResource", "AsyncVersionsResource"] diff --git a/src/cloudflare/resources/rulesets/versions/__init__.py b/src/cloudflare/resources/rulesets/versions/__init__.py deleted file mode 100644 index 558ba02c362..00000000000 --- a/src/cloudflare/resources/rulesets/versions/__init__.py +++ /dev/null @@ -1,19 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from .versions import ( - VersionsResource, - AsyncVersionsResource, - VersionsResourceWithRawResponse, - AsyncVersionsResourceWithRawResponse, - VersionsResourceWithStreamingResponse, - AsyncVersionsResourceWithStreamingResponse, -) - -__all__ = [ - "VersionsResource", - "AsyncVersionsResource", - "VersionsResourceWithRawResponse", - "AsyncVersionsResourceWithRawResponse", - "VersionsResourceWithStreamingResponse", - "AsyncVersionsResourceWithStreamingResponse", -] diff --git a/src/cloudflare/types/magic_network_monitoring/__init__.py b/src/cloudflare/types/magic_network_monitoring/__init__.py index 72b74144290..68ec6897c01 100644 --- a/src/cloudflare/types/magic_network_monitoring/__init__.py +++ b/src/cloudflare/types/magic_network_monitoring/__init__.py @@ -2,20 +2,11 @@ from __future__ import annotations +from .configuration import Configuration as Configuration from .rule_edit_params import RuleEditParams as RuleEditParams -from .rule_get_response import RuleGetResponse as RuleGetResponse from .config_edit_params import ConfigEditParams as ConfigEditParams from .rule_create_params import RuleCreateParams as RuleCreateParams -from .rule_edit_response import RuleEditResponse as RuleEditResponse -from .rule_list_response import RuleListResponse as RuleListResponse from .rule_update_params import RuleUpdateParams as RuleUpdateParams -from .config_get_response import ConfigGetResponse as ConfigGetResponse from .config_create_params import ConfigCreateParams as ConfigCreateParams -from .config_edit_response import ConfigEditResponse as ConfigEditResponse from .config_update_params import ConfigUpdateParams as ConfigUpdateParams -from .rule_create_response import RuleCreateResponse as RuleCreateResponse -from .rule_delete_response import RuleDeleteResponse as RuleDeleteResponse -from .rule_update_response import RuleUpdateResponse as RuleUpdateResponse -from .config_create_response import ConfigCreateResponse as ConfigCreateResponse -from .config_delete_response import ConfigDeleteResponse as ConfigDeleteResponse -from .config_update_response import ConfigUpdateResponse as ConfigUpdateResponse +from .magic_network_monitoring_rule import MagicNetworkMonitoringRule as MagicNetworkMonitoringRule diff --git a/src/cloudflare/types/magic_network_monitoring/config_create_response.py b/src/cloudflare/types/magic_network_monitoring/config_create_response.py deleted file mode 100644 index 28067ab7182..00000000000 --- a/src/cloudflare/types/magic_network_monitoring/config_create_response.py +++ /dev/null @@ -1,36 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List - -from ..._models import BaseModel - -__all__ = ["ConfigCreateResponse", "WARPDevice"] - - -class WARPDevice(BaseModel): - id: str - """Unique identifier for the warp device.""" - - name: str - """Name of the warp device.""" - - router_ip: str - """IPv4 CIDR of the router sourcing flow data associated with this warp device. - - Only /32 addresses are currently supported. - """ - - -class ConfigCreateResponse(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] - - warp_devices: List[WARPDevice] diff --git a/src/cloudflare/types/magic_network_monitoring/config_delete_response.py b/src/cloudflare/types/magic_network_monitoring/config_delete_response.py deleted file mode 100644 index 2c75653c1b9..00000000000 --- a/src/cloudflare/types/magic_network_monitoring/config_delete_response.py +++ /dev/null @@ -1,36 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List - -from ..._models import BaseModel - -__all__ = ["ConfigDeleteResponse", "WARPDevice"] - - -class WARPDevice(BaseModel): - id: str - """Unique identifier for the warp device.""" - - name: str - """Name of the warp device.""" - - router_ip: str - """IPv4 CIDR of the router sourcing flow data associated with this warp device. - - Only /32 addresses are currently supported. - """ - - -class ConfigDeleteResponse(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] - - warp_devices: List[WARPDevice] diff --git a/src/cloudflare/types/magic_network_monitoring/config_edit_response.py b/src/cloudflare/types/magic_network_monitoring/config_edit_response.py deleted file mode 100644 index 58938dacee7..00000000000 --- a/src/cloudflare/types/magic_network_monitoring/config_edit_response.py +++ /dev/null @@ -1,36 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List - -from ..._models import BaseModel - -__all__ = ["ConfigEditResponse", "WARPDevice"] - - -class WARPDevice(BaseModel): - id: str - """Unique identifier for the warp device.""" - - name: str - """Name of the warp device.""" - - router_ip: str - """IPv4 CIDR of the router sourcing flow data associated with this warp device. - - Only /32 addresses are currently supported. - """ - - -class ConfigEditResponse(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] - - warp_devices: List[WARPDevice] diff --git a/src/cloudflare/types/magic_network_monitoring/config_update_response.py b/src/cloudflare/types/magic_network_monitoring/config_update_response.py deleted file mode 100644 index e2eb501eac2..00000000000 --- a/src/cloudflare/types/magic_network_monitoring/config_update_response.py +++ /dev/null @@ -1,36 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List - -from ..._models import BaseModel - -__all__ = ["ConfigUpdateResponse", "WARPDevice"] - - -class WARPDevice(BaseModel): - id: str - """Unique identifier for the warp device.""" - - name: str - """Name of the warp device.""" - - router_ip: str - """IPv4 CIDR of the router sourcing flow data associated with this warp device. - - Only /32 addresses are currently supported. - """ - - -class ConfigUpdateResponse(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] - - warp_devices: List[WARPDevice] diff --git a/src/cloudflare/types/magic_network_monitoring/configs/__init__.py b/src/cloudflare/types/magic_network_monitoring/configs/__init__.py index c604655de2e..f8ee8b14b1c 100644 --- a/src/cloudflare/types/magic_network_monitoring/configs/__init__.py +++ b/src/cloudflare/types/magic_network_monitoring/configs/__init__.py @@ -1,5 +1,3 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. from __future__ import annotations - -from .full_get_response import FullGetResponse as FullGetResponse diff --git a/src/cloudflare/types/magic_network_monitoring/configs/full_get_response.py b/src/cloudflare/types/magic_network_monitoring/configs/full_get_response.py deleted file mode 100644 index ebcb8b43a47..00000000000 --- a/src/cloudflare/types/magic_network_monitoring/configs/full_get_response.py +++ /dev/null @@ -1,36 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List - -from ...._models import BaseModel - -__all__ = ["FullGetResponse", "WARPDevice"] - - -class WARPDevice(BaseModel): - id: str - """Unique identifier for the warp device.""" - - name: str - """Name of the warp device.""" - - router_ip: str - """IPv4 CIDR of the router sourcing flow data associated with this warp device. - - Only /32 addresses are currently supported. - """ - - -class FullGetResponse(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] - - warp_devices: List[WARPDevice] diff --git a/src/cloudflare/types/magic_network_monitoring/config_get_response.py b/src/cloudflare/types/magic_network_monitoring/configuration.py similarity index 90% rename from src/cloudflare/types/magic_network_monitoring/config_get_response.py rename to src/cloudflare/types/magic_network_monitoring/configuration.py index 40dc76aabbc..462a3ef6e7d 100644 --- a/src/cloudflare/types/magic_network_monitoring/config_get_response.py +++ b/src/cloudflare/types/magic_network_monitoring/configuration.py @@ -4,7 +4,7 @@ from ..._models import BaseModel -__all__ = ["ConfigGetResponse", "WARPDevice"] +__all__ = ["Configuration", "WARPDevice"] class WARPDevice(BaseModel): @@ -21,7 +21,7 @@ class WARPDevice(BaseModel): """ -class ConfigGetResponse(BaseModel): +class Configuration(BaseModel): default_sampling: float """Fallback sampling rate of flow messages being sent in packets per second. diff --git a/src/cloudflare/types/magic_network_monitoring/rule_create_response.py b/src/cloudflare/types/magic_network_monitoring/magic_network_monitoring_rule.py similarity index 94% rename from src/cloudflare/types/magic_network_monitoring/rule_create_response.py rename to src/cloudflare/types/magic_network_monitoring/magic_network_monitoring_rule.py index 9fa5944102b..3dbb9d85afa 100644 --- a/src/cloudflare/types/magic_network_monitoring/rule_create_response.py +++ b/src/cloudflare/types/magic_network_monitoring/magic_network_monitoring_rule.py @@ -4,10 +4,10 @@ from ..._models import BaseModel -__all__ = ["RuleCreateResponse"] +__all__ = ["MagicNetworkMonitoringRule"] -class RuleCreateResponse(BaseModel): +class MagicNetworkMonitoringRule(BaseModel): automatic_advertisement: Optional[bool] = None """ Toggle on if you would like Cloudflare to automatically advertise the IP diff --git a/src/cloudflare/types/magic_network_monitoring/rule_delete_response.py b/src/cloudflare/types/magic_network_monitoring/rule_delete_response.py deleted file mode 100644 index 2624dce9cb5..00000000000 --- a/src/cloudflare/types/magic_network_monitoring/rule_delete_response.py +++ /dev/null @@ -1,52 +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__ = ["RuleDeleteResponse"] - - -class RuleDeleteResponse(BaseModel): - automatic_advertisement: Optional[bool] = None - """ - Toggle on if you would like Cloudflare to automatically advertise the IP - Prefixes within the rule via Magic Transit when the rule is triggered. Only - available for users of Magic Transit. - """ - - duration: str - """ - The amount of time that the rule threshold must be exceeded to send an alert - notification. The final value must be equivalent to one of the following 8 - values ["1m","5m","10m","15m","20m","30m","45m","60m"]. The format is - AhBmCsDmsEusFns where A, B, C, D, E and F durations are optional; however at - least one unit must be provided. - """ - - name: str - """The name of the rule. - - Must be unique. Supports characters A-Z, a-z, 0-9, underscore (\\__), dash (-), - period (.), and tilde (~). You can’t have a space in the rule name. Max 256 - characters. - """ - - prefixes: List[str] - - id: Optional[str] = None - """The id of the rule. Must be unique.""" - - bandwidth_threshold: Optional[float] = None - """The number of bits per second for the rule. - - When this value is exceeded for the set duration, an alert notification is sent. - Minimum of 1 and no maximum. - """ - - packet_threshold: Optional[float] = None - """The number of packets per second for the rule. - - When this value is exceeded for the set duration, an alert notification is sent. - Minimum of 1 and no maximum. - """ diff --git a/src/cloudflare/types/magic_network_monitoring/rule_edit_response.py b/src/cloudflare/types/magic_network_monitoring/rule_edit_response.py deleted file mode 100644 index 36734257121..00000000000 --- a/src/cloudflare/types/magic_network_monitoring/rule_edit_response.py +++ /dev/null @@ -1,52 +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__ = ["RuleEditResponse"] - - -class RuleEditResponse(BaseModel): - automatic_advertisement: Optional[bool] = None - """ - Toggle on if you would like Cloudflare to automatically advertise the IP - Prefixes within the rule via Magic Transit when the rule is triggered. Only - available for users of Magic Transit. - """ - - duration: str - """ - The amount of time that the rule threshold must be exceeded to send an alert - notification. The final value must be equivalent to one of the following 8 - values ["1m","5m","10m","15m","20m","30m","45m","60m"]. The format is - AhBmCsDmsEusFns where A, B, C, D, E and F durations are optional; however at - least one unit must be provided. - """ - - name: str - """The name of the rule. - - Must be unique. Supports characters A-Z, a-z, 0-9, underscore (\\__), dash (-), - period (.), and tilde (~). You can’t have a space in the rule name. Max 256 - characters. - """ - - prefixes: List[str] - - id: Optional[str] = None - """The id of the rule. Must be unique.""" - - bandwidth_threshold: Optional[float] = None - """The number of bits per second for the rule. - - When this value is exceeded for the set duration, an alert notification is sent. - Minimum of 1 and no maximum. - """ - - packet_threshold: Optional[float] = None - """The number of packets per second for the rule. - - When this value is exceeded for the set duration, an alert notification is sent. - Minimum of 1 and no maximum. - """ diff --git a/src/cloudflare/types/magic_network_monitoring/rule_get_response.py b/src/cloudflare/types/magic_network_monitoring/rule_get_response.py deleted file mode 100644 index c81a370b779..00000000000 --- a/src/cloudflare/types/magic_network_monitoring/rule_get_response.py +++ /dev/null @@ -1,52 +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__ = ["RuleGetResponse"] - - -class RuleGetResponse(BaseModel): - automatic_advertisement: Optional[bool] = None - """ - Toggle on if you would like Cloudflare to automatically advertise the IP - Prefixes within the rule via Magic Transit when the rule is triggered. Only - available for users of Magic Transit. - """ - - duration: str - """ - The amount of time that the rule threshold must be exceeded to send an alert - notification. The final value must be equivalent to one of the following 8 - values ["1m","5m","10m","15m","20m","30m","45m","60m"]. The format is - AhBmCsDmsEusFns where A, B, C, D, E and F durations are optional; however at - least one unit must be provided. - """ - - name: str - """The name of the rule. - - Must be unique. Supports characters A-Z, a-z, 0-9, underscore (\\__), dash (-), - period (.), and tilde (~). You can’t have a space in the rule name. Max 256 - characters. - """ - - prefixes: List[str] - - id: Optional[str] = None - """The id of the rule. Must be unique.""" - - bandwidth_threshold: Optional[float] = None - """The number of bits per second for the rule. - - When this value is exceeded for the set duration, an alert notification is sent. - Minimum of 1 and no maximum. - """ - - packet_threshold: Optional[float] = None - """The number of packets per second for the rule. - - When this value is exceeded for the set duration, an alert notification is sent. - Minimum of 1 and no maximum. - """ diff --git a/src/cloudflare/types/magic_network_monitoring/rule_list_response.py b/src/cloudflare/types/magic_network_monitoring/rule_list_response.py deleted file mode 100644 index a85e2744341..00000000000 --- a/src/cloudflare/types/magic_network_monitoring/rule_list_response.py +++ /dev/null @@ -1,52 +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__ = ["RuleListResponse"] - - -class RuleListResponse(BaseModel): - automatic_advertisement: Optional[bool] = None - """ - Toggle on if you would like Cloudflare to automatically advertise the IP - Prefixes within the rule via Magic Transit when the rule is triggered. Only - available for users of Magic Transit. - """ - - duration: str - """ - The amount of time that the rule threshold must be exceeded to send an alert - notification. The final value must be equivalent to one of the following 8 - values ["1m","5m","10m","15m","20m","30m","45m","60m"]. The format is - AhBmCsDmsEusFns where A, B, C, D, E and F durations are optional; however at - least one unit must be provided. - """ - - name: str - """The name of the rule. - - Must be unique. Supports characters A-Z, a-z, 0-9, underscore (\\__), dash (-), - period (.), and tilde (~). You can’t have a space in the rule name. Max 256 - characters. - """ - - prefixes: List[str] - - id: Optional[str] = None - """The id of the rule. Must be unique.""" - - bandwidth_threshold: Optional[float] = None - """The number of bits per second for the rule. - - When this value is exceeded for the set duration, an alert notification is sent. - Minimum of 1 and no maximum. - """ - - packet_threshold: Optional[float] = None - """The number of packets per second for the rule. - - When this value is exceeded for the set duration, an alert notification is sent. - Minimum of 1 and no maximum. - """ diff --git a/src/cloudflare/types/magic_network_monitoring/rule_update_response.py b/src/cloudflare/types/magic_network_monitoring/rule_update_response.py deleted file mode 100644 index 357b3324cf3..00000000000 --- a/src/cloudflare/types/magic_network_monitoring/rule_update_response.py +++ /dev/null @@ -1,52 +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__ = ["RuleUpdateResponse"] - - -class RuleUpdateResponse(BaseModel): - automatic_advertisement: Optional[bool] = None - """ - Toggle on if you would like Cloudflare to automatically advertise the IP - Prefixes within the rule via Magic Transit when the rule is triggered. Only - available for users of Magic Transit. - """ - - duration: str - """ - The amount of time that the rule threshold must be exceeded to send an alert - notification. The final value must be equivalent to one of the following 8 - values ["1m","5m","10m","15m","20m","30m","45m","60m"]. The format is - AhBmCsDmsEusFns where A, B, C, D, E and F durations are optional; however at - least one unit must be provided. - """ - - name: str - """The name of the rule. - - Must be unique. Supports characters A-Z, a-z, 0-9, underscore (\\__), dash (-), - period (.), and tilde (~). You can’t have a space in the rule name. Max 256 - characters. - """ - - prefixes: List[str] - - id: Optional[str] = None - """The id of the rule. Must be unique.""" - - bandwidth_threshold: Optional[float] = None - """The number of bits per second for the rule. - - When this value is exceeded for the set duration, an alert notification is sent. - Minimum of 1 and no maximum. - """ - - packet_threshold: Optional[float] = None - """The number of packets per second for the rule. - - When this value is exceeded for the set duration, an alert notification is sent. - Minimum of 1 and no maximum. - """ diff --git a/src/cloudflare/types/magic_network_monitoring/rules/__init__.py b/src/cloudflare/types/magic_network_monitoring/rules/__init__.py index 68d05903e3f..776662f22d8 100644 --- a/src/cloudflare/types/magic_network_monitoring/rules/__init__.py +++ b/src/cloudflare/types/magic_network_monitoring/rules/__init__.py @@ -2,5 +2,5 @@ from __future__ import annotations +from .advertisement import Advertisement as Advertisement from .advertisement_edit_params import AdvertisementEditParams as AdvertisementEditParams -from .advertisement_edit_response import AdvertisementEditResponse as AdvertisementEditResponse diff --git a/src/cloudflare/types/magic_network_monitoring/rules/advertisement_edit_response.py b/src/cloudflare/types/magic_network_monitoring/rules/advertisement.py similarity index 83% rename from src/cloudflare/types/magic_network_monitoring/rules/advertisement_edit_response.py rename to src/cloudflare/types/magic_network_monitoring/rules/advertisement.py index 81e66d3c64f..145c988ae89 100644 --- a/src/cloudflare/types/magic_network_monitoring/rules/advertisement_edit_response.py +++ b/src/cloudflare/types/magic_network_monitoring/rules/advertisement.py @@ -4,10 +4,10 @@ from ...._models import BaseModel -__all__ = ["AdvertisementEditResponse"] +__all__ = ["Advertisement"] -class AdvertisementEditResponse(BaseModel): +class Advertisement(BaseModel): automatic_advertisement: Optional[bool] = None """ Toggle on if you would like Cloudflare to automatically advertise the IP diff --git a/src/cloudflare/types/rulesets/versions/__init__.py b/src/cloudflare/types/rulesets/versions/__init__.py deleted file mode 100644 index f8ee8b14b1c..00000000000 --- a/src/cloudflare/types/rulesets/versions/__init__.py +++ /dev/null @@ -1,3 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations diff --git a/tests/api_resources/magic_network_monitoring/configs/test_full.py b/tests/api_resources/magic_network_monitoring/configs/test_full.py index 73999495acb..fa2d1efd518 100644 --- a/tests/api_resources/magic_network_monitoring/configs/test_full.py +++ b/tests/api_resources/magic_network_monitoring/configs/test_full.py @@ -9,7 +9,7 @@ from cloudflare import Cloudflare, AsyncCloudflare from tests.utils import assert_matches_type -from cloudflare.types.magic_network_monitoring.configs import FullGetResponse +from cloudflare.types.magic_network_monitoring import Configuration base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") @@ -22,7 +22,7 @@ def test_method_get(self, client: Cloudflare) -> None: full = client.magic_network_monitoring.configs.full.get( account_id="6f91088a406011ed95aed352566e8d4c", ) - assert_matches_type(FullGetResponse, full, path=["response"]) + assert_matches_type(Configuration, full, path=["response"]) @parametrize def test_raw_response_get(self, client: Cloudflare) -> None: @@ -33,7 +33,7 @@ def test_raw_response_get(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" full = response.parse() - assert_matches_type(FullGetResponse, full, path=["response"]) + assert_matches_type(Configuration, full, path=["response"]) @parametrize def test_streaming_response_get(self, client: Cloudflare) -> None: @@ -44,7 +44,7 @@ def test_streaming_response_get(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" full = response.parse() - assert_matches_type(FullGetResponse, full, path=["response"]) + assert_matches_type(Configuration, full, path=["response"]) assert cast(Any, response.is_closed) is True @@ -64,7 +64,7 @@ async def test_method_get(self, async_client: AsyncCloudflare) -> None: full = await async_client.magic_network_monitoring.configs.full.get( account_id="6f91088a406011ed95aed352566e8d4c", ) - assert_matches_type(FullGetResponse, full, path=["response"]) + assert_matches_type(Configuration, full, path=["response"]) @parametrize async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: @@ -75,7 +75,7 @@ async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" full = await response.parse() - assert_matches_type(FullGetResponse, full, path=["response"]) + assert_matches_type(Configuration, full, path=["response"]) @parametrize async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> None: @@ -86,7 +86,7 @@ async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> No assert response.http_request.headers.get("X-Stainless-Lang") == "python" full = await response.parse() - assert_matches_type(FullGetResponse, full, path=["response"]) + assert_matches_type(Configuration, full, path=["response"]) assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/magic_network_monitoring/rules/test_advertisements.py b/tests/api_resources/magic_network_monitoring/rules/test_advertisements.py index 6d94cb3f20f..46761c021c6 100644 --- a/tests/api_resources/magic_network_monitoring/rules/test_advertisements.py +++ b/tests/api_resources/magic_network_monitoring/rules/test_advertisements.py @@ -9,7 +9,7 @@ from cloudflare import Cloudflare, AsyncCloudflare from tests.utils import assert_matches_type -from cloudflare.types.magic_network_monitoring.rules import AdvertisementEditResponse +from cloudflare.types.magic_network_monitoring.rules import Advertisement base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") @@ -24,7 +24,7 @@ def test_method_edit(self, client: Cloudflare) -> None: account_id="6f91088a406011ed95aed352566e8d4c", body={}, ) - assert_matches_type(Optional[AdvertisementEditResponse], advertisement, path=["response"]) + assert_matches_type(Optional[Advertisement], advertisement, path=["response"]) @parametrize def test_raw_response_edit(self, client: Cloudflare) -> None: @@ -37,7 +37,7 @@ def test_raw_response_edit(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" advertisement = response.parse() - assert_matches_type(Optional[AdvertisementEditResponse], advertisement, path=["response"]) + assert_matches_type(Optional[Advertisement], advertisement, path=["response"]) @parametrize def test_streaming_response_edit(self, client: Cloudflare) -> None: @@ -50,7 +50,7 @@ def test_streaming_response_edit(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" advertisement = response.parse() - assert_matches_type(Optional[AdvertisementEditResponse], advertisement, path=["response"]) + assert_matches_type(Optional[Advertisement], advertisement, path=["response"]) assert cast(Any, response.is_closed) is True @@ -81,7 +81,7 @@ async def test_method_edit(self, async_client: AsyncCloudflare) -> None: account_id="6f91088a406011ed95aed352566e8d4c", body={}, ) - assert_matches_type(Optional[AdvertisementEditResponse], advertisement, path=["response"]) + assert_matches_type(Optional[Advertisement], advertisement, path=["response"]) @parametrize async def test_raw_response_edit(self, async_client: AsyncCloudflare) -> None: @@ -94,7 +94,7 @@ async def test_raw_response_edit(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" advertisement = await response.parse() - assert_matches_type(Optional[AdvertisementEditResponse], advertisement, path=["response"]) + assert_matches_type(Optional[Advertisement], advertisement, path=["response"]) @parametrize async def test_streaming_response_edit(self, async_client: AsyncCloudflare) -> None: @@ -107,7 +107,7 @@ async def test_streaming_response_edit(self, async_client: AsyncCloudflare) -> N assert response.http_request.headers.get("X-Stainless-Lang") == "python" advertisement = await response.parse() - assert_matches_type(Optional[AdvertisementEditResponse], advertisement, path=["response"]) + assert_matches_type(Optional[Advertisement], advertisement, path=["response"]) assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/magic_network_monitoring/test_configs.py b/tests/api_resources/magic_network_monitoring/test_configs.py index 57adb1b342e..ac018d0f5fb 100644 --- a/tests/api_resources/magic_network_monitoring/test_configs.py +++ b/tests/api_resources/magic_network_monitoring/test_configs.py @@ -10,11 +10,7 @@ from cloudflare import Cloudflare, AsyncCloudflare from tests.utils import assert_matches_type from cloudflare.types.magic_network_monitoring import ( - ConfigGetResponse, - ConfigEditResponse, - ConfigCreateResponse, - ConfigDeleteResponse, - ConfigUpdateResponse, + Configuration, ) base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") @@ -30,7 +26,7 @@ def test_method_create(self, client: Cloudflare) -> None: default_sampling=1, name="cloudflare user's account", ) - assert_matches_type(ConfigCreateResponse, config, path=["response"]) + assert_matches_type(Configuration, config, path=["response"]) @parametrize def test_method_create_with_all_params(self, client: Cloudflare) -> None: @@ -57,7 +53,7 @@ def test_method_create_with_all_params(self, client: Cloudflare) -> None: }, ], ) - assert_matches_type(ConfigCreateResponse, config, path=["response"]) + assert_matches_type(Configuration, config, path=["response"]) @parametrize def test_raw_response_create(self, client: Cloudflare) -> None: @@ -70,7 +66,7 @@ def test_raw_response_create(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" config = response.parse() - assert_matches_type(ConfigCreateResponse, config, path=["response"]) + assert_matches_type(Configuration, config, path=["response"]) @parametrize def test_streaming_response_create(self, client: Cloudflare) -> None: @@ -83,7 +79,7 @@ def test_streaming_response_create(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" config = response.parse() - assert_matches_type(ConfigCreateResponse, config, path=["response"]) + assert_matches_type(Configuration, config, path=["response"]) assert cast(Any, response.is_closed) is True @@ -103,7 +99,7 @@ def test_method_update(self, client: Cloudflare) -> None: default_sampling=1, name="cloudflare user's account", ) - assert_matches_type(ConfigUpdateResponse, config, path=["response"]) + assert_matches_type(Configuration, config, path=["response"]) @parametrize def test_method_update_with_all_params(self, client: Cloudflare) -> None: @@ -130,7 +126,7 @@ def test_method_update_with_all_params(self, client: Cloudflare) -> None: }, ], ) - assert_matches_type(ConfigUpdateResponse, config, path=["response"]) + assert_matches_type(Configuration, config, path=["response"]) @parametrize def test_raw_response_update(self, client: Cloudflare) -> None: @@ -143,7 +139,7 @@ def test_raw_response_update(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" config = response.parse() - assert_matches_type(ConfigUpdateResponse, config, path=["response"]) + assert_matches_type(Configuration, config, path=["response"]) @parametrize def test_streaming_response_update(self, client: Cloudflare) -> None: @@ -156,7 +152,7 @@ def test_streaming_response_update(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" config = response.parse() - assert_matches_type(ConfigUpdateResponse, config, path=["response"]) + assert_matches_type(Configuration, config, path=["response"]) assert cast(Any, response.is_closed) is True @@ -174,7 +170,7 @@ def test_method_delete(self, client: Cloudflare) -> None: config = client.magic_network_monitoring.configs.delete( account_id="6f91088a406011ed95aed352566e8d4c", ) - assert_matches_type(ConfigDeleteResponse, config, path=["response"]) + assert_matches_type(Configuration, config, path=["response"]) @parametrize def test_raw_response_delete(self, client: Cloudflare) -> None: @@ -185,7 +181,7 @@ def test_raw_response_delete(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" config = response.parse() - assert_matches_type(ConfigDeleteResponse, config, path=["response"]) + assert_matches_type(Configuration, config, path=["response"]) @parametrize def test_streaming_response_delete(self, client: Cloudflare) -> None: @@ -196,7 +192,7 @@ def test_streaming_response_delete(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" config = response.parse() - assert_matches_type(ConfigDeleteResponse, config, path=["response"]) + assert_matches_type(Configuration, config, path=["response"]) assert cast(Any, response.is_closed) is True @@ -212,7 +208,7 @@ def test_method_edit(self, client: Cloudflare) -> None: config = client.magic_network_monitoring.configs.edit( account_id="6f91088a406011ed95aed352566e8d4c", ) - assert_matches_type(ConfigEditResponse, config, path=["response"]) + assert_matches_type(Configuration, config, path=["response"]) @parametrize def test_method_edit_with_all_params(self, client: Cloudflare) -> None: @@ -239,7 +235,7 @@ def test_method_edit_with_all_params(self, client: Cloudflare) -> None: }, ], ) - assert_matches_type(ConfigEditResponse, config, path=["response"]) + assert_matches_type(Configuration, config, path=["response"]) @parametrize def test_raw_response_edit(self, client: Cloudflare) -> None: @@ -250,7 +246,7 @@ def test_raw_response_edit(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" config = response.parse() - assert_matches_type(ConfigEditResponse, config, path=["response"]) + assert_matches_type(Configuration, config, path=["response"]) @parametrize def test_streaming_response_edit(self, client: Cloudflare) -> None: @@ -261,7 +257,7 @@ def test_streaming_response_edit(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" config = response.parse() - assert_matches_type(ConfigEditResponse, config, path=["response"]) + assert_matches_type(Configuration, config, path=["response"]) assert cast(Any, response.is_closed) is True @@ -277,7 +273,7 @@ def test_method_get(self, client: Cloudflare) -> None: config = client.magic_network_monitoring.configs.get( account_id="6f91088a406011ed95aed352566e8d4c", ) - assert_matches_type(ConfigGetResponse, config, path=["response"]) + assert_matches_type(Configuration, config, path=["response"]) @parametrize def test_raw_response_get(self, client: Cloudflare) -> None: @@ -288,7 +284,7 @@ def test_raw_response_get(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" config = response.parse() - assert_matches_type(ConfigGetResponse, config, path=["response"]) + assert_matches_type(Configuration, config, path=["response"]) @parametrize def test_streaming_response_get(self, client: Cloudflare) -> None: @@ -299,7 +295,7 @@ def test_streaming_response_get(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" config = response.parse() - assert_matches_type(ConfigGetResponse, config, path=["response"]) + assert_matches_type(Configuration, config, path=["response"]) assert cast(Any, response.is_closed) is True @@ -321,7 +317,7 @@ async def test_method_create(self, async_client: AsyncCloudflare) -> None: default_sampling=1, name="cloudflare user's account", ) - assert_matches_type(ConfigCreateResponse, config, path=["response"]) + assert_matches_type(Configuration, config, path=["response"]) @parametrize async def test_method_create_with_all_params(self, async_client: AsyncCloudflare) -> None: @@ -348,7 +344,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncCloudflare }, ], ) - assert_matches_type(ConfigCreateResponse, config, path=["response"]) + assert_matches_type(Configuration, config, path=["response"]) @parametrize async def test_raw_response_create(self, async_client: AsyncCloudflare) -> None: @@ -361,7 +357,7 @@ async def test_raw_response_create(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" config = await response.parse() - assert_matches_type(ConfigCreateResponse, config, path=["response"]) + assert_matches_type(Configuration, config, path=["response"]) @parametrize async def test_streaming_response_create(self, async_client: AsyncCloudflare) -> None: @@ -374,7 +370,7 @@ async def test_streaming_response_create(self, async_client: AsyncCloudflare) -> assert response.http_request.headers.get("X-Stainless-Lang") == "python" config = await response.parse() - assert_matches_type(ConfigCreateResponse, config, path=["response"]) + assert_matches_type(Configuration, config, path=["response"]) assert cast(Any, response.is_closed) is True @@ -394,7 +390,7 @@ async def test_method_update(self, async_client: AsyncCloudflare) -> None: default_sampling=1, name="cloudflare user's account", ) - assert_matches_type(ConfigUpdateResponse, config, path=["response"]) + assert_matches_type(Configuration, config, path=["response"]) @parametrize async def test_method_update_with_all_params(self, async_client: AsyncCloudflare) -> None: @@ -421,7 +417,7 @@ async def test_method_update_with_all_params(self, async_client: AsyncCloudflare }, ], ) - assert_matches_type(ConfigUpdateResponse, config, path=["response"]) + assert_matches_type(Configuration, config, path=["response"]) @parametrize async def test_raw_response_update(self, async_client: AsyncCloudflare) -> None: @@ -434,7 +430,7 @@ async def test_raw_response_update(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" config = await response.parse() - assert_matches_type(ConfigUpdateResponse, config, path=["response"]) + assert_matches_type(Configuration, config, path=["response"]) @parametrize async def test_streaming_response_update(self, async_client: AsyncCloudflare) -> None: @@ -447,7 +443,7 @@ async def test_streaming_response_update(self, async_client: AsyncCloudflare) -> assert response.http_request.headers.get("X-Stainless-Lang") == "python" config = await response.parse() - assert_matches_type(ConfigUpdateResponse, config, path=["response"]) + assert_matches_type(Configuration, config, path=["response"]) assert cast(Any, response.is_closed) is True @@ -465,7 +461,7 @@ async def test_method_delete(self, async_client: AsyncCloudflare) -> None: config = await async_client.magic_network_monitoring.configs.delete( account_id="6f91088a406011ed95aed352566e8d4c", ) - assert_matches_type(ConfigDeleteResponse, config, path=["response"]) + assert_matches_type(Configuration, config, path=["response"]) @parametrize async def test_raw_response_delete(self, async_client: AsyncCloudflare) -> None: @@ -476,7 +472,7 @@ async def test_raw_response_delete(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" config = await response.parse() - assert_matches_type(ConfigDeleteResponse, config, path=["response"]) + assert_matches_type(Configuration, config, path=["response"]) @parametrize async def test_streaming_response_delete(self, async_client: AsyncCloudflare) -> None: @@ -487,7 +483,7 @@ async def test_streaming_response_delete(self, async_client: AsyncCloudflare) -> assert response.http_request.headers.get("X-Stainless-Lang") == "python" config = await response.parse() - assert_matches_type(ConfigDeleteResponse, config, path=["response"]) + assert_matches_type(Configuration, config, path=["response"]) assert cast(Any, response.is_closed) is True @@ -503,7 +499,7 @@ async def test_method_edit(self, async_client: AsyncCloudflare) -> None: config = await async_client.magic_network_monitoring.configs.edit( account_id="6f91088a406011ed95aed352566e8d4c", ) - assert_matches_type(ConfigEditResponse, config, path=["response"]) + assert_matches_type(Configuration, config, path=["response"]) @parametrize async def test_method_edit_with_all_params(self, async_client: AsyncCloudflare) -> None: @@ -530,7 +526,7 @@ async def test_method_edit_with_all_params(self, async_client: AsyncCloudflare) }, ], ) - assert_matches_type(ConfigEditResponse, config, path=["response"]) + assert_matches_type(Configuration, config, path=["response"]) @parametrize async def test_raw_response_edit(self, async_client: AsyncCloudflare) -> None: @@ -541,7 +537,7 @@ async def test_raw_response_edit(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" config = await response.parse() - assert_matches_type(ConfigEditResponse, config, path=["response"]) + assert_matches_type(Configuration, config, path=["response"]) @parametrize async def test_streaming_response_edit(self, async_client: AsyncCloudflare) -> None: @@ -552,7 +548,7 @@ async def test_streaming_response_edit(self, async_client: AsyncCloudflare) -> N assert response.http_request.headers.get("X-Stainless-Lang") == "python" config = await response.parse() - assert_matches_type(ConfigEditResponse, config, path=["response"]) + assert_matches_type(Configuration, config, path=["response"]) assert cast(Any, response.is_closed) is True @@ -568,7 +564,7 @@ async def test_method_get(self, async_client: AsyncCloudflare) -> None: config = await async_client.magic_network_monitoring.configs.get( account_id="6f91088a406011ed95aed352566e8d4c", ) - assert_matches_type(ConfigGetResponse, config, path=["response"]) + assert_matches_type(Configuration, config, path=["response"]) @parametrize async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: @@ -579,7 +575,7 @@ async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" config = await response.parse() - assert_matches_type(ConfigGetResponse, config, path=["response"]) + assert_matches_type(Configuration, config, path=["response"]) @parametrize async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> None: @@ -590,7 +586,7 @@ async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> No assert response.http_request.headers.get("X-Stainless-Lang") == "python" config = await response.parse() - assert_matches_type(ConfigGetResponse, config, path=["response"]) + assert_matches_type(Configuration, config, path=["response"]) assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/magic_network_monitoring/test_rules.py b/tests/api_resources/magic_network_monitoring/test_rules.py index ec577d0e947..d7341ff05f2 100644 --- a/tests/api_resources/magic_network_monitoring/test_rules.py +++ b/tests/api_resources/magic_network_monitoring/test_rules.py @@ -11,12 +11,7 @@ from tests.utils import assert_matches_type from cloudflare.pagination import SyncSinglePage, AsyncSinglePage from cloudflare.types.magic_network_monitoring import ( - RuleGetResponse, - RuleEditResponse, - RuleListResponse, - RuleCreateResponse, - RuleDeleteResponse, - RuleUpdateResponse, + MagicNetworkMonitoringRule, ) base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") @@ -32,7 +27,7 @@ def test_method_create(self, client: Cloudflare) -> None: duration="300s", name="my_rule_1", ) - assert_matches_type(Optional[RuleCreateResponse], rule, path=["response"]) + assert_matches_type(Optional[MagicNetworkMonitoringRule], rule, path=["response"]) @parametrize def test_method_create_with_all_params(self, client: Cloudflare) -> None: @@ -45,7 +40,7 @@ def test_method_create_with_all_params(self, client: Cloudflare) -> None: packet_threshold=10000, prefixes=["203.0.113.1/32", "203.0.113.1/32", "203.0.113.1/32"], ) - assert_matches_type(Optional[RuleCreateResponse], rule, path=["response"]) + assert_matches_type(Optional[MagicNetworkMonitoringRule], rule, path=["response"]) @parametrize def test_raw_response_create(self, client: Cloudflare) -> None: @@ -58,7 +53,7 @@ def test_raw_response_create(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" rule = response.parse() - assert_matches_type(Optional[RuleCreateResponse], rule, path=["response"]) + assert_matches_type(Optional[MagicNetworkMonitoringRule], rule, path=["response"]) @parametrize def test_streaming_response_create(self, client: Cloudflare) -> None: @@ -71,7 +66,7 @@ def test_streaming_response_create(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" rule = response.parse() - assert_matches_type(Optional[RuleCreateResponse], rule, path=["response"]) + assert_matches_type(Optional[MagicNetworkMonitoringRule], rule, path=["response"]) assert cast(Any, response.is_closed) is True @@ -91,7 +86,7 @@ def test_method_update(self, client: Cloudflare) -> None: duration="300s", name="my_rule_1", ) - assert_matches_type(Optional[RuleUpdateResponse], rule, path=["response"]) + assert_matches_type(Optional[MagicNetworkMonitoringRule], rule, path=["response"]) @parametrize def test_method_update_with_all_params(self, client: Cloudflare) -> None: @@ -105,7 +100,7 @@ def test_method_update_with_all_params(self, client: Cloudflare) -> None: packet_threshold=10000, prefixes=["203.0.113.1/32", "203.0.113.1/32", "203.0.113.1/32"], ) - assert_matches_type(Optional[RuleUpdateResponse], rule, path=["response"]) + assert_matches_type(Optional[MagicNetworkMonitoringRule], rule, path=["response"]) @parametrize def test_raw_response_update(self, client: Cloudflare) -> None: @@ -118,7 +113,7 @@ def test_raw_response_update(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" rule = response.parse() - assert_matches_type(Optional[RuleUpdateResponse], rule, path=["response"]) + assert_matches_type(Optional[MagicNetworkMonitoringRule], rule, path=["response"]) @parametrize def test_streaming_response_update(self, client: Cloudflare) -> None: @@ -131,7 +126,7 @@ def test_streaming_response_update(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" rule = response.parse() - assert_matches_type(Optional[RuleUpdateResponse], rule, path=["response"]) + assert_matches_type(Optional[MagicNetworkMonitoringRule], rule, path=["response"]) assert cast(Any, response.is_closed) is True @@ -149,7 +144,7 @@ def test_method_list(self, client: Cloudflare) -> None: rule = client.magic_network_monitoring.rules.list( account_id="6f91088a406011ed95aed352566e8d4c", ) - assert_matches_type(SyncSinglePage[Optional[RuleListResponse]], rule, path=["response"]) + assert_matches_type(SyncSinglePage[Optional[MagicNetworkMonitoringRule]], rule, path=["response"]) @parametrize def test_raw_response_list(self, client: Cloudflare) -> None: @@ -160,7 +155,7 @@ def test_raw_response_list(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" rule = response.parse() - assert_matches_type(SyncSinglePage[Optional[RuleListResponse]], rule, path=["response"]) + assert_matches_type(SyncSinglePage[Optional[MagicNetworkMonitoringRule]], rule, path=["response"]) @parametrize def test_streaming_response_list(self, client: Cloudflare) -> None: @@ -171,7 +166,7 @@ def test_streaming_response_list(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" rule = response.parse() - assert_matches_type(SyncSinglePage[Optional[RuleListResponse]], rule, path=["response"]) + assert_matches_type(SyncSinglePage[Optional[MagicNetworkMonitoringRule]], rule, path=["response"]) assert cast(Any, response.is_closed) is True @@ -188,7 +183,7 @@ def test_method_delete(self, client: Cloudflare) -> None: rule_id="2890e6fa406311ed9b5a23f70f6fb8cf", account_id="6f91088a406011ed95aed352566e8d4c", ) - assert_matches_type(Optional[RuleDeleteResponse], rule, path=["response"]) + assert_matches_type(Optional[MagicNetworkMonitoringRule], rule, path=["response"]) @parametrize def test_raw_response_delete(self, client: Cloudflare) -> None: @@ -200,7 +195,7 @@ def test_raw_response_delete(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" rule = response.parse() - assert_matches_type(Optional[RuleDeleteResponse], rule, path=["response"]) + assert_matches_type(Optional[MagicNetworkMonitoringRule], rule, path=["response"]) @parametrize def test_streaming_response_delete(self, client: Cloudflare) -> None: @@ -212,7 +207,7 @@ def test_streaming_response_delete(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" rule = response.parse() - assert_matches_type(Optional[RuleDeleteResponse], rule, path=["response"]) + assert_matches_type(Optional[MagicNetworkMonitoringRule], rule, path=["response"]) assert cast(Any, response.is_closed) is True @@ -236,7 +231,7 @@ def test_method_edit(self, client: Cloudflare) -> None: rule_id="2890e6fa406311ed9b5a23f70f6fb8cf", account_id="6f91088a406011ed95aed352566e8d4c", ) - assert_matches_type(Optional[RuleEditResponse], rule, path=["response"]) + assert_matches_type(Optional[MagicNetworkMonitoringRule], rule, path=["response"]) @parametrize def test_method_edit_with_all_params(self, client: Cloudflare) -> None: @@ -250,7 +245,7 @@ def test_method_edit_with_all_params(self, client: Cloudflare) -> None: packet_threshold=10000, prefixes=["203.0.113.1/32", "203.0.113.1/32", "203.0.113.1/32"], ) - assert_matches_type(Optional[RuleEditResponse], rule, path=["response"]) + assert_matches_type(Optional[MagicNetworkMonitoringRule], rule, path=["response"]) @parametrize def test_raw_response_edit(self, client: Cloudflare) -> None: @@ -262,7 +257,7 @@ def test_raw_response_edit(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" rule = response.parse() - assert_matches_type(Optional[RuleEditResponse], rule, path=["response"]) + assert_matches_type(Optional[MagicNetworkMonitoringRule], rule, path=["response"]) @parametrize def test_streaming_response_edit(self, client: Cloudflare) -> None: @@ -274,7 +269,7 @@ def test_streaming_response_edit(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" rule = response.parse() - assert_matches_type(Optional[RuleEditResponse], rule, path=["response"]) + assert_matches_type(Optional[MagicNetworkMonitoringRule], rule, path=["response"]) assert cast(Any, response.is_closed) is True @@ -298,7 +293,7 @@ def test_method_get(self, client: Cloudflare) -> None: rule_id="2890e6fa406311ed9b5a23f70f6fb8cf", account_id="6f91088a406011ed95aed352566e8d4c", ) - assert_matches_type(Optional[RuleGetResponse], rule, path=["response"]) + assert_matches_type(Optional[MagicNetworkMonitoringRule], rule, path=["response"]) @parametrize def test_raw_response_get(self, client: Cloudflare) -> None: @@ -310,7 +305,7 @@ def test_raw_response_get(self, client: Cloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" rule = response.parse() - assert_matches_type(Optional[RuleGetResponse], rule, path=["response"]) + assert_matches_type(Optional[MagicNetworkMonitoringRule], rule, path=["response"]) @parametrize def test_streaming_response_get(self, client: Cloudflare) -> None: @@ -322,7 +317,7 @@ def test_streaming_response_get(self, client: Cloudflare) -> None: assert response.http_request.headers.get("X-Stainless-Lang") == "python" rule = response.parse() - assert_matches_type(Optional[RuleGetResponse], rule, path=["response"]) + assert_matches_type(Optional[MagicNetworkMonitoringRule], rule, path=["response"]) assert cast(Any, response.is_closed) is True @@ -351,7 +346,7 @@ async def test_method_create(self, async_client: AsyncCloudflare) -> None: duration="300s", name="my_rule_1", ) - assert_matches_type(Optional[RuleCreateResponse], rule, path=["response"]) + assert_matches_type(Optional[MagicNetworkMonitoringRule], rule, path=["response"]) @parametrize async def test_method_create_with_all_params(self, async_client: AsyncCloudflare) -> None: @@ -364,7 +359,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncCloudflare packet_threshold=10000, prefixes=["203.0.113.1/32", "203.0.113.1/32", "203.0.113.1/32"], ) - assert_matches_type(Optional[RuleCreateResponse], rule, path=["response"]) + assert_matches_type(Optional[MagicNetworkMonitoringRule], rule, path=["response"]) @parametrize async def test_raw_response_create(self, async_client: AsyncCloudflare) -> None: @@ -377,7 +372,7 @@ async def test_raw_response_create(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" rule = await response.parse() - assert_matches_type(Optional[RuleCreateResponse], rule, path=["response"]) + assert_matches_type(Optional[MagicNetworkMonitoringRule], rule, path=["response"]) @parametrize async def test_streaming_response_create(self, async_client: AsyncCloudflare) -> None: @@ -390,7 +385,7 @@ async def test_streaming_response_create(self, async_client: AsyncCloudflare) -> assert response.http_request.headers.get("X-Stainless-Lang") == "python" rule = await response.parse() - assert_matches_type(Optional[RuleCreateResponse], rule, path=["response"]) + assert_matches_type(Optional[MagicNetworkMonitoringRule], rule, path=["response"]) assert cast(Any, response.is_closed) is True @@ -410,7 +405,7 @@ async def test_method_update(self, async_client: AsyncCloudflare) -> None: duration="300s", name="my_rule_1", ) - assert_matches_type(Optional[RuleUpdateResponse], rule, path=["response"]) + assert_matches_type(Optional[MagicNetworkMonitoringRule], rule, path=["response"]) @parametrize async def test_method_update_with_all_params(self, async_client: AsyncCloudflare) -> None: @@ -424,7 +419,7 @@ async def test_method_update_with_all_params(self, async_client: AsyncCloudflare packet_threshold=10000, prefixes=["203.0.113.1/32", "203.0.113.1/32", "203.0.113.1/32"], ) - assert_matches_type(Optional[RuleUpdateResponse], rule, path=["response"]) + assert_matches_type(Optional[MagicNetworkMonitoringRule], rule, path=["response"]) @parametrize async def test_raw_response_update(self, async_client: AsyncCloudflare) -> None: @@ -437,7 +432,7 @@ async def test_raw_response_update(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" rule = await response.parse() - assert_matches_type(Optional[RuleUpdateResponse], rule, path=["response"]) + assert_matches_type(Optional[MagicNetworkMonitoringRule], rule, path=["response"]) @parametrize async def test_streaming_response_update(self, async_client: AsyncCloudflare) -> None: @@ -450,7 +445,7 @@ async def test_streaming_response_update(self, async_client: AsyncCloudflare) -> assert response.http_request.headers.get("X-Stainless-Lang") == "python" rule = await response.parse() - assert_matches_type(Optional[RuleUpdateResponse], rule, path=["response"]) + assert_matches_type(Optional[MagicNetworkMonitoringRule], rule, path=["response"]) assert cast(Any, response.is_closed) is True @@ -468,7 +463,7 @@ async def test_method_list(self, async_client: AsyncCloudflare) -> None: rule = await async_client.magic_network_monitoring.rules.list( account_id="6f91088a406011ed95aed352566e8d4c", ) - assert_matches_type(AsyncSinglePage[Optional[RuleListResponse]], rule, path=["response"]) + assert_matches_type(AsyncSinglePage[Optional[MagicNetworkMonitoringRule]], rule, path=["response"]) @parametrize async def test_raw_response_list(self, async_client: AsyncCloudflare) -> None: @@ -479,7 +474,7 @@ async def test_raw_response_list(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" rule = await response.parse() - assert_matches_type(AsyncSinglePage[Optional[RuleListResponse]], rule, path=["response"]) + assert_matches_type(AsyncSinglePage[Optional[MagicNetworkMonitoringRule]], rule, path=["response"]) @parametrize async def test_streaming_response_list(self, async_client: AsyncCloudflare) -> None: @@ -490,7 +485,7 @@ async def test_streaming_response_list(self, async_client: AsyncCloudflare) -> N assert response.http_request.headers.get("X-Stainless-Lang") == "python" rule = await response.parse() - assert_matches_type(AsyncSinglePage[Optional[RuleListResponse]], rule, path=["response"]) + assert_matches_type(AsyncSinglePage[Optional[MagicNetworkMonitoringRule]], rule, path=["response"]) assert cast(Any, response.is_closed) is True @@ -507,7 +502,7 @@ async def test_method_delete(self, async_client: AsyncCloudflare) -> None: rule_id="2890e6fa406311ed9b5a23f70f6fb8cf", account_id="6f91088a406011ed95aed352566e8d4c", ) - assert_matches_type(Optional[RuleDeleteResponse], rule, path=["response"]) + assert_matches_type(Optional[MagicNetworkMonitoringRule], rule, path=["response"]) @parametrize async def test_raw_response_delete(self, async_client: AsyncCloudflare) -> None: @@ -519,7 +514,7 @@ async def test_raw_response_delete(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" rule = await response.parse() - assert_matches_type(Optional[RuleDeleteResponse], rule, path=["response"]) + assert_matches_type(Optional[MagicNetworkMonitoringRule], rule, path=["response"]) @parametrize async def test_streaming_response_delete(self, async_client: AsyncCloudflare) -> None: @@ -531,7 +526,7 @@ async def test_streaming_response_delete(self, async_client: AsyncCloudflare) -> assert response.http_request.headers.get("X-Stainless-Lang") == "python" rule = await response.parse() - assert_matches_type(Optional[RuleDeleteResponse], rule, path=["response"]) + assert_matches_type(Optional[MagicNetworkMonitoringRule], rule, path=["response"]) assert cast(Any, response.is_closed) is True @@ -555,7 +550,7 @@ async def test_method_edit(self, async_client: AsyncCloudflare) -> None: rule_id="2890e6fa406311ed9b5a23f70f6fb8cf", account_id="6f91088a406011ed95aed352566e8d4c", ) - assert_matches_type(Optional[RuleEditResponse], rule, path=["response"]) + assert_matches_type(Optional[MagicNetworkMonitoringRule], rule, path=["response"]) @parametrize async def test_method_edit_with_all_params(self, async_client: AsyncCloudflare) -> None: @@ -569,7 +564,7 @@ async def test_method_edit_with_all_params(self, async_client: AsyncCloudflare) packet_threshold=10000, prefixes=["203.0.113.1/32", "203.0.113.1/32", "203.0.113.1/32"], ) - assert_matches_type(Optional[RuleEditResponse], rule, path=["response"]) + assert_matches_type(Optional[MagicNetworkMonitoringRule], rule, path=["response"]) @parametrize async def test_raw_response_edit(self, async_client: AsyncCloudflare) -> None: @@ -581,7 +576,7 @@ async def test_raw_response_edit(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" rule = await response.parse() - assert_matches_type(Optional[RuleEditResponse], rule, path=["response"]) + assert_matches_type(Optional[MagicNetworkMonitoringRule], rule, path=["response"]) @parametrize async def test_streaming_response_edit(self, async_client: AsyncCloudflare) -> None: @@ -593,7 +588,7 @@ async def test_streaming_response_edit(self, async_client: AsyncCloudflare) -> N assert response.http_request.headers.get("X-Stainless-Lang") == "python" rule = await response.parse() - assert_matches_type(Optional[RuleEditResponse], rule, path=["response"]) + assert_matches_type(Optional[MagicNetworkMonitoringRule], rule, path=["response"]) assert cast(Any, response.is_closed) is True @@ -617,7 +612,7 @@ async def test_method_get(self, async_client: AsyncCloudflare) -> None: rule_id="2890e6fa406311ed9b5a23f70f6fb8cf", account_id="6f91088a406011ed95aed352566e8d4c", ) - assert_matches_type(Optional[RuleGetResponse], rule, path=["response"]) + assert_matches_type(Optional[MagicNetworkMonitoringRule], rule, path=["response"]) @parametrize async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: @@ -629,7 +624,7 @@ async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None: assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" rule = await response.parse() - assert_matches_type(Optional[RuleGetResponse], rule, path=["response"]) + assert_matches_type(Optional[MagicNetworkMonitoringRule], rule, path=["response"]) @parametrize async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> None: @@ -641,7 +636,7 @@ async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> No assert response.http_request.headers.get("X-Stainless-Lang") == "python" rule = await response.parse() - assert_matches_type(Optional[RuleGetResponse], rule, path=["response"]) + assert_matches_type(Optional[MagicNetworkMonitoringRule], rule, path=["response"]) assert cast(Any, response.is_closed) is True diff --git a/tests/api_resources/rulesets/versions/__init__.py b/tests/api_resources/rulesets/versions/__init__.py deleted file mode 100644 index fd8019a9a1a..00000000000 --- a/tests/api_resources/rulesets/versions/__init__.py +++ /dev/null @@ -1 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.