From 4926402f5d9e020bed71bb2ff59ec20b93ae9d97 Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Mon, 28 Jun 2021 02:35:01 +0000 Subject: [PATCH] CodeGen from PR 15000 in Azure/azure-rest-api-specs alertsmanagement,applicationinsights,attestation,batch,cost-management,netapp,synapse (#15000) --- .../azure-mgmt-alertsmanagement/MANIFEST.in | 1 + .../azure-mgmt-alertsmanagement/_meta.json | 11 ++ .../_alerts_management_client.py | 20 ++++ .../mgmt/alertsmanagement/_metadata.json | 107 ++++++++++++++++++ .../azure/mgmt/alertsmanagement/_version.py | 2 +- .../aio/_alerts_management_client.py | 19 ++++ .../operations/_action_rules_operations.py | 24 ++-- .../aio/operations/_alerts_operations.py | 38 +++---- .../aio/operations/_operations.py | 2 +- .../_smart_detector_alert_rules_operations.py | 24 ++-- .../operations/_smart_groups_operations.py | 16 +-- .../mgmt/alertsmanagement/models/_models.py | 8 +- .../alertsmanagement/models/_models_py3.py | 14 +-- .../operations/_action_rules_operations.py | 12 +- .../operations/_alerts_operations.py | 26 ++--- .../_smart_detector_alert_rules_operations.py | 12 +- .../operations/_smart_groups_operations.py | 8 +- 17 files changed, 251 insertions(+), 93 deletions(-) create mode 100644 sdk/alertsmanagement/azure-mgmt-alertsmanagement/_meta.json create mode 100644 sdk/alertsmanagement/azure-mgmt-alertsmanagement/azure/mgmt/alertsmanagement/_metadata.json diff --git a/sdk/alertsmanagement/azure-mgmt-alertsmanagement/MANIFEST.in b/sdk/alertsmanagement/azure-mgmt-alertsmanagement/MANIFEST.in index a3cb07df8765..3a9b6517412b 100644 --- a/sdk/alertsmanagement/azure-mgmt-alertsmanagement/MANIFEST.in +++ b/sdk/alertsmanagement/azure-mgmt-alertsmanagement/MANIFEST.in @@ -1,3 +1,4 @@ +include _meta.json recursive-include tests *.py *.yaml include *.md include azure/__init__.py diff --git a/sdk/alertsmanagement/azure-mgmt-alertsmanagement/_meta.json b/sdk/alertsmanagement/azure-mgmt-alertsmanagement/_meta.json new file mode 100644 index 000000000000..f7500b7f1eb0 --- /dev/null +++ b/sdk/alertsmanagement/azure-mgmt-alertsmanagement/_meta.json @@ -0,0 +1,11 @@ +{ + "autorest": "3.4.2", + "use": [ + "@autorest/python@5.8.1", + "@autorest/modelerfour@4.19.2" + ], + "commit": "25af5c1c0fae2bc594c1932445d06209745f5917", + "repository_url": "https://github.com/Azure/azure-rest-api-specs", + "autorest_command": "autorest specification/alertsmanagement/resource-manager/readme.md --multiapi --python --python-mode=update --python-sdks-folder=/home/vsts/work/1/s/azure-sdk-for-python/sdk --track2 --use=@autorest/python@5.8.1 --use=@autorest/modelerfour@4.19.2 --version=3.4.2", + "readme": "specification/alertsmanagement/resource-manager/readme.md" +} \ No newline at end of file diff --git a/sdk/alertsmanagement/azure-mgmt-alertsmanagement/azure/mgmt/alertsmanagement/_alerts_management_client.py b/sdk/alertsmanagement/azure-mgmt-alertsmanagement/azure/mgmt/alertsmanagement/_alerts_management_client.py index b2f9a29fd2e7..5141eab238ee 100644 --- a/sdk/alertsmanagement/azure-mgmt-alertsmanagement/azure/mgmt/alertsmanagement/_alerts_management_client.py +++ b/sdk/alertsmanagement/azure-mgmt-alertsmanagement/azure/mgmt/alertsmanagement/_alerts_management_client.py @@ -16,6 +16,7 @@ from typing import Any, Optional from azure.core.credentials import TokenCredential + from azure.core.pipeline.transport import HttpRequest, HttpResponse from ._configuration import AlertsManagementClientConfiguration from .operations import ActionRulesOperations @@ -61,6 +62,7 @@ def __init__( client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) + self._serialize.client_side_validation = False self._deserialize = Deserializer(client_models) self.action_rules = ActionRulesOperations( @@ -74,6 +76,24 @@ def __init__( self.smart_detector_alert_rules = SmartDetectorAlertRulesOperations( self._client, self._config, self._serialize, self._deserialize) + def _send_request(self, http_request, **kwargs): + # type: (HttpRequest, Any) -> HttpResponse + """Runs the network request through the client's chained policies. + + :param http_request: The network request you want to make. Required. + :type http_request: ~azure.core.pipeline.transport.HttpRequest + :keyword bool stream: Whether the response payload will be streamed. Defaults to True. + :return: The response of your network call. Does not do error handling on your response. + :rtype: ~azure.core.pipeline.transport.HttpResponse + """ + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + } + http_request.url = self._client.format_url(http_request.url, **path_format_arguments) + stream = kwargs.pop("stream", True) + pipeline_response = self._client._pipeline.run(http_request, stream=stream, **kwargs) + return pipeline_response.http_response + def close(self): # type: () -> None self._client.close() diff --git a/sdk/alertsmanagement/azure-mgmt-alertsmanagement/azure/mgmt/alertsmanagement/_metadata.json b/sdk/alertsmanagement/azure-mgmt-alertsmanagement/azure/mgmt/alertsmanagement/_metadata.json new file mode 100644 index 000000000000..f23390600c9d --- /dev/null +++ b/sdk/alertsmanagement/azure-mgmt-alertsmanagement/azure/mgmt/alertsmanagement/_metadata.json @@ -0,0 +1,107 @@ +{ + "chosen_version": "", + "total_api_version_list": ["2019-05-05-preview", "2019-06-01"], + "client": { + "name": "AlertsManagementClient", + "filename": "_alerts_management_client", + "description": "AlertsManagement Client.", + "base_url": "\u0027https://management.azure.com\u0027", + "custom_base_url": null, + "azure_arm": true, + "has_lro_operations": false, + "client_side_validation": false, + "sync_imports": "{\"typing\": {\"azurecore\": {\"azure.core.credentials\": [\"TokenCredential\"]}}, \"regular\": {\"azurecore\": {\"azure.profiles\": [\"KnownProfiles\", \"ProfileDefinition\"], \"azure.profiles.multiapiclient\": [\"MultiApiClientMixin\"], \"msrest\": [\"Deserializer\", \"Serializer\"], \"azure.mgmt.core\": [\"ARMPipelineClient\"]}, \"local\": {\"._configuration\": [\"AlertsManagementClientConfiguration\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}, \"azurecore\": {\"azure.core.pipeline.transport\": [\"HttpRequest\", \"HttpResponse\"]}}}", + "async_imports": "{\"typing\": {\"azurecore\": {\"azure.core.credentials_async\": [\"AsyncTokenCredential\"]}}, \"regular\": {\"azurecore\": {\"azure.profiles\": [\"KnownProfiles\", \"ProfileDefinition\"], \"azure.profiles.multiapiclient\": [\"MultiApiClientMixin\"], \"msrest\": [\"Deserializer\", \"Serializer\"], \"azure.mgmt.core\": [\"AsyncARMPipelineClient\"]}, \"local\": {\"._configuration\": [\"AlertsManagementClientConfiguration\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}, \"azurecore\": {\"azure.core.pipeline.transport\": [\"AsyncHttpResponse\", \"HttpRequest\"]}}}" + }, + "global_parameters": { + "sync": { + "credential": { + "signature": "credential, # type: \"TokenCredential\"", + "description": "Credential needed for the client to connect to Azure.", + "docstring_type": "~azure.core.credentials.TokenCredential", + "required": true + }, + "subscription_id": { + "signature": "subscription_id, # type: str", + "description": "The ID of the target subscription.", + "docstring_type": "str", + "required": true + } + }, + "async": { + "credential": { + "signature": "credential: \"AsyncTokenCredential\",", + "description": "Credential needed for the client to connect to Azure.", + "docstring_type": "~azure.core.credentials_async.AsyncTokenCredential", + "required": true + }, + "subscription_id": { + "signature": "subscription_id: str,", + "description": "The ID of the target subscription.", + "docstring_type": "str", + "required": true + } + }, + "constant": { + }, + "call": "credential, subscription_id", + "service_client_specific": { + "sync": { + "api_version": { + "signature": "api_version=None, # type: Optional[str]", + "description": "API version to use if no profile is provided, or if missing in profile.", + "docstring_type": "str", + "required": false + }, + "base_url": { + "signature": "base_url=None, # type: Optional[str]", + "description": "Service URL", + "docstring_type": "str", + "required": false + }, + "profile": { + "signature": "profile=KnownProfiles.default, # type: KnownProfiles", + "description": "A profile definition, from KnownProfiles to dict.", + "docstring_type": "azure.profiles.KnownProfiles", + "required": false + } + }, + "async": { + "api_version": { + "signature": "api_version: Optional[str] = None,", + "description": "API version to use if no profile is provided, or if missing in profile.", + "docstring_type": "str", + "required": false + }, + "base_url": { + "signature": "base_url: Optional[str] = None,", + "description": "Service URL", + "docstring_type": "str", + "required": false + }, + "profile": { + "signature": "profile: KnownProfiles = KnownProfiles.default,", + "description": "A profile definition, from KnownProfiles to dict.", + "docstring_type": "azure.profiles.KnownProfiles", + "required": false + } + } + } + }, + "config": { + "credential": true, + "credential_scopes": ["https://management.azure.com/.default"], + "credential_default_policy_type": "BearerTokenCredentialPolicy", + "credential_default_policy_type_has_async_version": true, + "credential_key_header_name": null, + "sync_imports": "{\"regular\": {\"azurecore\": {\"azure.core.configuration\": [\"Configuration\"], \"azure.core.pipeline\": [\"policies\"], \"azure.mgmt.core.policies\": [\"ARMHttpLoggingPolicy\"]}, \"local\": {\"._version\": [\"VERSION\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\"]}}, \"typing\": {\"azurecore\": {\"azure.core.credentials\": [\"TokenCredential\"]}}}", + "async_imports": "{\"regular\": {\"azurecore\": {\"azure.core.configuration\": [\"Configuration\"], \"azure.core.pipeline\": [\"policies\"], \"azure.mgmt.core.policies\": [\"ARMHttpLoggingPolicy\"]}, \"local\": {\".._version\": [\"VERSION\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\"]}}, \"typing\": {\"azurecore\": {\"azure.core.credentials_async\": [\"AsyncTokenCredential\"]}}}" + }, + "operation_groups": { + "action_rules": "ActionRulesOperations", + "operations": "Operations", + "alerts": "AlertsOperations", + "smart_groups": "SmartGroupsOperations", + "smart_detector_alert_rules": "SmartDetectorAlertRulesOperations" + } +} \ No newline at end of file diff --git a/sdk/alertsmanagement/azure-mgmt-alertsmanagement/azure/mgmt/alertsmanagement/_version.py b/sdk/alertsmanagement/azure-mgmt-alertsmanagement/azure/mgmt/alertsmanagement/_version.py index c47f66669f1b..e5754a47ce68 100644 --- a/sdk/alertsmanagement/azure-mgmt-alertsmanagement/azure/mgmt/alertsmanagement/_version.py +++ b/sdk/alertsmanagement/azure-mgmt-alertsmanagement/azure/mgmt/alertsmanagement/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "1.0.0" +VERSION = "1.0.0b1" diff --git a/sdk/alertsmanagement/azure-mgmt-alertsmanagement/azure/mgmt/alertsmanagement/aio/_alerts_management_client.py b/sdk/alertsmanagement/azure-mgmt-alertsmanagement/azure/mgmt/alertsmanagement/aio/_alerts_management_client.py index 44af7da286eb..569cfc244c13 100644 --- a/sdk/alertsmanagement/azure-mgmt-alertsmanagement/azure/mgmt/alertsmanagement/aio/_alerts_management_client.py +++ b/sdk/alertsmanagement/azure-mgmt-alertsmanagement/azure/mgmt/alertsmanagement/aio/_alerts_management_client.py @@ -8,6 +8,7 @@ from typing import Any, Optional, TYPE_CHECKING +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core import AsyncARMPipelineClient from msrest import Deserializer, Serializer @@ -58,6 +59,7 @@ def __init__( client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) + self._serialize.client_side_validation = False self._deserialize = Deserializer(client_models) self.action_rules = ActionRulesOperations( @@ -71,6 +73,23 @@ def __init__( self.smart_detector_alert_rules = SmartDetectorAlertRulesOperations( self._client, self._config, self._serialize, self._deserialize) + async def _send_request(self, http_request: HttpRequest, **kwargs: Any) -> AsyncHttpResponse: + """Runs the network request through the client's chained policies. + + :param http_request: The network request you want to make. Required. + :type http_request: ~azure.core.pipeline.transport.HttpRequest + :keyword bool stream: Whether the response payload will be streamed. Defaults to True. + :return: The response of your network call. Does not do error handling on your response. + :rtype: ~azure.core.pipeline.transport.AsyncHttpResponse + """ + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + } + http_request.url = self._client.format_url(http_request.url, **path_format_arguments) + stream = kwargs.pop("stream", True) + pipeline_response = await self._client._pipeline.run(http_request, stream=stream, **kwargs) + return pipeline_response.http_response + async def close(self) -> None: await self._client.close() diff --git a/sdk/alertsmanagement/azure-mgmt-alertsmanagement/azure/mgmt/alertsmanagement/aio/operations/_action_rules_operations.py b/sdk/alertsmanagement/azure-mgmt-alertsmanagement/azure/mgmt/alertsmanagement/aio/operations/_action_rules_operations.py index 9021e45cdc06..f169dd7fcb57 100644 --- a/sdk/alertsmanagement/azure-mgmt-alertsmanagement/azure/mgmt/alertsmanagement/aio/operations/_action_rules_operations.py +++ b/sdk/alertsmanagement/azure-mgmt-alertsmanagement/azure/mgmt/alertsmanagement/aio/operations/_action_rules_operations.py @@ -53,7 +53,7 @@ def list_by_subscription( alert_rule_id: Optional[str] = None, action_group: Optional[str] = None, name: Optional[str] = None, - **kwargs + **kwargs: Any ) -> AsyncIterable["_models.ActionRulesList"]: """Get all action rule in a given subscription. @@ -153,7 +153,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(_models.ErrorResponse, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -177,7 +177,7 @@ def list_by_resource_group( alert_rule_id: Optional[str] = None, action_group: Optional[str] = None, name: Optional[str] = None, - **kwargs + **kwargs: Any ) -> AsyncIterable["_models.ActionRulesList"]: """Get all action rules created in a resource group. @@ -281,7 +281,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(_models.ErrorResponse, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -296,7 +296,7 @@ async def get_by_name( self, resource_group_name: str, action_rule_name: str, - **kwargs + **kwargs: Any ) -> "_models.ActionRule": """Get action rule by name. @@ -342,7 +342,7 @@ async def get_by_name( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(_models.ErrorResponse, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) response_headers = {} @@ -360,7 +360,7 @@ async def create_update( resource_group_name: str, action_rule_name: str, action_rule: "_models.ActionRule", - **kwargs + **kwargs: Any ) -> "_models.ActionRule": """Create/update an action rule. @@ -413,7 +413,7 @@ async def create_update( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(_models.ErrorResponse, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) response_headers = {} @@ -430,7 +430,7 @@ async def delete( self, resource_group_name: str, action_rule_name: str, - **kwargs + **kwargs: Any ) -> bool: """Delete action rule. @@ -476,7 +476,7 @@ async def delete( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(_models.ErrorResponse, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) response_headers = {} @@ -494,7 +494,7 @@ async def update( resource_group_name: str, action_rule_name: str, action_rule_patch: "_models.PatchObject", - **kwargs + **kwargs: Any ) -> "_models.ActionRule": """Patch action rule. @@ -547,7 +547,7 @@ async def update( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(_models.ErrorResponse, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) response_headers = {} diff --git a/sdk/alertsmanagement/azure-mgmt-alertsmanagement/azure/mgmt/alertsmanagement/aio/operations/_alerts_operations.py b/sdk/alertsmanagement/azure-mgmt-alertsmanagement/azure/mgmt/alertsmanagement/aio/operations/_alerts_operations.py index 3f540db7c3a0..76b111f7c741 100644 --- a/sdk/alertsmanagement/azure-mgmt-alertsmanagement/azure/mgmt/alertsmanagement/aio/operations/_alerts_operations.py +++ b/sdk/alertsmanagement/azure-mgmt-alertsmanagement/azure/mgmt/alertsmanagement/aio/operations/_alerts_operations.py @@ -44,7 +44,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: async def meta_data( self, identifier: Union[str, "_models.Identifier"], - **kwargs + **kwargs: Any ) -> "_models.AlertsMetaData": """List alerts meta data information based on value of identifier parameter. @@ -110,7 +110,7 @@ def get_all( select: Optional[str] = None, time_range: Optional[Union[str, "_models.TimeRange"]] = None, custom_time_range: Optional[str] = None, - **kwargs + **kwargs: Any ) -> AsyncIterable["_models.AlertsList"]: """List all existing alerts, where the results can be filtered on the basis of multiple parameters (e.g. time range). The results can then be sorted on the basis specific fields, with the @@ -160,10 +160,10 @@ def get_all( :type select: str :param time_range: Filter by time range by below listed values. Default value is 1 day. :type time_range: str or ~azure.mgmt.alertsmanagement.models.TimeRange - :param custom_time_range: Filter by custom time range in the format :code:``/:code:`` where time is in (ISO-8601 format)'. Permissible values is within 30 - days from query time. Either timeRange or customTimeRange could be used but not both. Default - is none. + :param custom_time_range: Filter by custom time range in the format + :code:``/:code:`` where time is in (ISO-8601 format)'. Permissible + values is within 30 days from query time. Either timeRange or customTimeRange could be used + but not both. Default is none. :type custom_time_range: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either AlertsList or the result of cls(response) @@ -249,7 +249,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(_models.ErrorResponseAutoGenerated, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponseAutoGenerated, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -263,7 +263,7 @@ async def get_next(next_link=None): async def get_by_id( self, alert_id: str, - **kwargs + **kwargs: Any ) -> "_models.Alert": """Get a specific alert. @@ -306,7 +306,7 @@ async def get_by_id( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(_models.ErrorResponseAutoGenerated, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponseAutoGenerated, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('Alert', pipeline_response) @@ -321,7 +321,7 @@ async def change_state( self, alert_id: str, new_state: Union[str, "_models.AlertState"], - **kwargs + **kwargs: Any ) -> "_models.Alert": """Change the state of an alert. @@ -365,7 +365,7 @@ async def change_state( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(_models.ErrorResponseAutoGenerated, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponseAutoGenerated, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('Alert', pipeline_response) @@ -379,7 +379,7 @@ async def change_state( async def get_history( self, alert_id: str, - **kwargs + **kwargs: Any ) -> "_models.AlertModification": """Get the history of an alert, which captures any monitor condition changes (Fired/Resolved) and alert state changes (New/Acknowledged/Closed). @@ -421,7 +421,7 @@ async def get_history( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(_models.ErrorResponseAutoGenerated, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponseAutoGenerated, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('AlertModification', pipeline_response) @@ -446,7 +446,7 @@ async def get_summary( alert_rule: Optional[str] = None, time_range: Optional[Union[str, "_models.TimeRange"]] = None, custom_time_range: Optional[str] = None, - **kwargs + **kwargs: Any ) -> "_models.AlertsSummary": """Get a summarized count of your alerts grouped by various parameters (e.g. grouping by 'Severity' returns the count of alerts for each severity). @@ -480,10 +480,10 @@ async def get_summary( :type alert_rule: str :param time_range: Filter by time range by below listed values. Default value is 1 day. :type time_range: str or ~azure.mgmt.alertsmanagement.models.TimeRange - :param custom_time_range: Filter by custom time range in the format :code:``/:code:`` where time is in (ISO-8601 format)'. Permissible values is within 30 - days from query time. Either timeRange or customTimeRange could be used but not both. Default - is none. + :param custom_time_range: Filter by custom time range in the format + :code:``/:code:`` where time is in (ISO-8601 format)'. Permissible + values is within 30 days from query time. Either timeRange or customTimeRange could be used + but not both. Default is none. :type custom_time_range: str :keyword callable cls: A custom type or function that will be passed the direct response :return: AlertsSummary, or the result of cls(response) @@ -542,7 +542,7 @@ async def get_summary( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(_models.ErrorResponseAutoGenerated, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponseAutoGenerated, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('AlertsSummary', pipeline_response) diff --git a/sdk/alertsmanagement/azure-mgmt-alertsmanagement/azure/mgmt/alertsmanagement/aio/operations/_operations.py b/sdk/alertsmanagement/azure-mgmt-alertsmanagement/azure/mgmt/alertsmanagement/aio/operations/_operations.py index e666b633c3b3..e1be8e02b119 100644 --- a/sdk/alertsmanagement/azure-mgmt-alertsmanagement/azure/mgmt/alertsmanagement/aio/operations/_operations.py +++ b/sdk/alertsmanagement/azure-mgmt-alertsmanagement/azure/mgmt/alertsmanagement/aio/operations/_operations.py @@ -43,7 +43,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: def list( self, - **kwargs + **kwargs: Any ) -> AsyncIterable["_models.OperationsList"]: """List all operations available through Azure Alerts Management Resource Provider. diff --git a/sdk/alertsmanagement/azure-mgmt-alertsmanagement/azure/mgmt/alertsmanagement/aio/operations/_smart_detector_alert_rules_operations.py b/sdk/alertsmanagement/azure-mgmt-alertsmanagement/azure/mgmt/alertsmanagement/aio/operations/_smart_detector_alert_rules_operations.py index 3170a1f68923..b4d05ff36574 100644 --- a/sdk/alertsmanagement/azure-mgmt-alertsmanagement/azure/mgmt/alertsmanagement/aio/operations/_smart_detector_alert_rules_operations.py +++ b/sdk/alertsmanagement/azure-mgmt-alertsmanagement/azure/mgmt/alertsmanagement/aio/operations/_smart_detector_alert_rules_operations.py @@ -44,7 +44,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: def list( self, expand_detector: Optional[bool] = None, - **kwargs + **kwargs: Any ) -> AsyncIterable["_models.AlertRulesList"]: """List all the existing Smart Detector alert rules within the subscription. @@ -102,7 +102,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(_models.SmartDetectorErrorResponse, response) + error = self._deserialize.failsafe_deserialize(_models.SmartDetectorErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -117,7 +117,7 @@ def list_by_resource_group( self, resource_group_name: str, expand_detector: Optional[bool] = None, - **kwargs + **kwargs: Any ) -> AsyncIterable["_models.AlertRulesList"]: """List all the existing Smart Detector alert rules within the subscription and resource group. @@ -178,7 +178,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(_models.SmartDetectorErrorResponse, response) + error = self._deserialize.failsafe_deserialize(_models.SmartDetectorErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -194,7 +194,7 @@ async def get( resource_group_name: str, alert_rule_name: str, expand_detector: Optional[bool] = None, - **kwargs + **kwargs: Any ) -> "_models.AlertRule": """Get a specific Smart Detector alert rule. @@ -242,7 +242,7 @@ async def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(_models.SmartDetectorErrorResponse, response) + error = self._deserialize.failsafe_deserialize(_models.SmartDetectorErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('AlertRule', pipeline_response) @@ -258,7 +258,7 @@ async def create_or_update( resource_group_name: str, alert_rule_name: str, parameters: "_models.AlertRule", - **kwargs + **kwargs: Any ) -> "_models.AlertRule": """Create or update a Smart Detector alert rule. @@ -309,7 +309,7 @@ async def create_or_update( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(_models.SmartDetectorErrorResponse, response) + error = self._deserialize.failsafe_deserialize(_models.SmartDetectorErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -329,7 +329,7 @@ async def patch( resource_group_name: str, alert_rule_name: str, parameters: "_models.AlertRulePatchObject", - **kwargs + **kwargs: Any ) -> "_models.AlertRule": """Patch a specific Smart Detector alert rule. @@ -380,7 +380,7 @@ async def patch( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(_models.SmartDetectorErrorResponse, response) + error = self._deserialize.failsafe_deserialize(_models.SmartDetectorErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('AlertRule', pipeline_response) @@ -395,7 +395,7 @@ async def delete( self, resource_group_name: str, alert_rule_name: str, - **kwargs + **kwargs: Any ) -> None: """Delete an existing Smart Detector alert rule. @@ -439,7 +439,7 @@ async def delete( if response.status_code not in [200, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(_models.SmartDetectorErrorResponse, response) + error = self._deserialize.failsafe_deserialize(_models.SmartDetectorErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: diff --git a/sdk/alertsmanagement/azure-mgmt-alertsmanagement/azure/mgmt/alertsmanagement/aio/operations/_smart_groups_operations.py b/sdk/alertsmanagement/azure-mgmt-alertsmanagement/azure/mgmt/alertsmanagement/aio/operations/_smart_groups_operations.py index 51dbfdf0dcb1..fd5211d0a18a 100644 --- a/sdk/alertsmanagement/azure-mgmt-alertsmanagement/azure/mgmt/alertsmanagement/aio/operations/_smart_groups_operations.py +++ b/sdk/alertsmanagement/azure-mgmt-alertsmanagement/azure/mgmt/alertsmanagement/aio/operations/_smart_groups_operations.py @@ -54,7 +54,7 @@ def get_all( page_count: Optional[int] = None, sort_by: Optional[Union[str, "_models.SmartGroupsSortByFields"]] = None, sort_order: Optional[Union[str, "_models.Enum11"]] = None, - **kwargs + **kwargs: Any ) -> AsyncIterable["_models.SmartGroupsList"]: """Get all Smart Groups within a specified subscription. @@ -162,7 +162,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(_models.ErrorResponseAutoGenerated2, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponseAutoGenerated2, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -176,7 +176,7 @@ async def get_next(next_link=None): async def get_by_id( self, smart_group_id: str, - **kwargs + **kwargs: Any ) -> "_models.SmartGroup": """Get information related to a specific Smart Group. @@ -219,7 +219,7 @@ async def get_by_id( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(_models.ErrorResponseAutoGenerated2, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponseAutoGenerated2, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) response_headers = {} @@ -236,7 +236,7 @@ async def change_state( self, smart_group_id: str, new_state: Union[str, "_models.AlertState"], - **kwargs + **kwargs: Any ) -> "_models.SmartGroup": """Change the state of a Smart Group. @@ -280,7 +280,7 @@ async def change_state( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(_models.ErrorResponseAutoGenerated2, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponseAutoGenerated2, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) response_headers = {} @@ -296,7 +296,7 @@ async def change_state( async def get_history( self, smart_group_id: str, - **kwargs + **kwargs: Any ) -> "_models.SmartGroupModification": """Get the history a smart group, which captures any Smart Group state changes (New/Acknowledged/Closed) . @@ -338,7 +338,7 @@ async def get_history( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(_models.ErrorResponseAutoGenerated2, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponseAutoGenerated2, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('SmartGroupModification', pipeline_response) diff --git a/sdk/alertsmanagement/azure-mgmt-alertsmanagement/azure/mgmt/alertsmanagement/models/_models.py b/sdk/alertsmanagement/azure-mgmt-alertsmanagement/azure/mgmt/alertsmanagement/models/_models.py index d9f76afbd787..94dda8711da9 100644 --- a/sdk/alertsmanagement/azure-mgmt-alertsmanagement/azure/mgmt/alertsmanagement/models/_models.py +++ b/sdk/alertsmanagement/azure-mgmt-alertsmanagement/azure/mgmt/alertsmanagement/models/_models.py @@ -479,9 +479,9 @@ class AlertProperties(msrest.serialization.Model): :param essentials: This object contains consistent fields across different monitor services. :type essentials: ~azure.mgmt.alertsmanagement.models.Essentials :ivar context: Any object. - :vartype context: object + :vartype context: any :ivar egress_config: Any object. - :vartype egress_config: object + :vartype egress_config: any """ _validation = { @@ -956,7 +956,7 @@ class Detector(msrest.serialization.Model): :param id: Required. The detector id. :type id: str :param parameters: The detector's parameters.'. - :type parameters: dict[str, object] + :type parameters: dict[str, any] :param name: The Smart Detector name. By default this is not populated, unless it's specified in expandDetector. :type name: str @@ -1461,7 +1461,7 @@ class PatchObject(msrest.serialization.Model): """Data contract for patch. :param tags: A set of tags. tags to be updated. - :type tags: object + :type tags: any :param status: Indicates if the given action rule is enabled or disabled. Possible values include: "Enabled", "Disabled". :type status: str or ~azure.mgmt.alertsmanagement.models.ActionRuleStatus diff --git a/sdk/alertsmanagement/azure-mgmt-alertsmanagement/azure/mgmt/alertsmanagement/models/_models_py3.py b/sdk/alertsmanagement/azure-mgmt-alertsmanagement/azure/mgmt/alertsmanagement/models/_models_py3.py index 9505b1d2be24..43f599d57be4 100644 --- a/sdk/alertsmanagement/azure-mgmt-alertsmanagement/azure/mgmt/alertsmanagement/models/_models_py3.py +++ b/sdk/alertsmanagement/azure-mgmt-alertsmanagement/azure/mgmt/alertsmanagement/models/_models_py3.py @@ -7,7 +7,7 @@ # -------------------------------------------------------------------------- import datetime -from typing import Dict, List, Optional, Union +from typing import Any, Dict, List, Optional, Union from azure.core.exceptions import HttpResponseError import msrest.serialization @@ -523,9 +523,9 @@ class AlertProperties(msrest.serialization.Model): :param essentials: This object contains consistent fields across different monitor services. :type essentials: ~azure.mgmt.alertsmanagement.models.Essentials :ivar context: Any object. - :vartype context: object + :vartype context: any :ivar egress_config: Any object. - :vartype egress_config: object + :vartype egress_config: any """ _validation = { @@ -1055,7 +1055,7 @@ class Detector(msrest.serialization.Model): :param id: Required. The detector id. :type id: str :param parameters: The detector's parameters.'. - :type parameters: dict[str, object] + :type parameters: dict[str, any] :param name: The Smart Detector name. By default this is not populated, unless it's specified in expandDetector. :type name: str @@ -1087,7 +1087,7 @@ def __init__( self, *, id: str, - parameters: Optional[Dict[str, object]] = None, + parameters: Optional[Dict[str, Any]] = None, name: Optional[str] = None, description: Optional[str] = None, supported_resource_types: Optional[List[str]] = None, @@ -1614,7 +1614,7 @@ class PatchObject(msrest.serialization.Model): """Data contract for patch. :param tags: A set of tags. tags to be updated. - :type tags: object + :type tags: any :param status: Indicates if the given action rule is enabled or disabled. Possible values include: "Enabled", "Disabled". :type status: str or ~azure.mgmt.alertsmanagement.models.ActionRuleStatus @@ -1628,7 +1628,7 @@ class PatchObject(msrest.serialization.Model): def __init__( self, *, - tags: Optional[object] = None, + tags: Optional[Any] = None, status: Optional[Union[str, "ActionRuleStatus"]] = None, **kwargs ): diff --git a/sdk/alertsmanagement/azure-mgmt-alertsmanagement/azure/mgmt/alertsmanagement/operations/_action_rules_operations.py b/sdk/alertsmanagement/azure-mgmt-alertsmanagement/azure/mgmt/alertsmanagement/operations/_action_rules_operations.py index 181be6ee583e..c80eb4f60600 100644 --- a/sdk/alertsmanagement/azure-mgmt-alertsmanagement/azure/mgmt/alertsmanagement/operations/_action_rules_operations.py +++ b/sdk/alertsmanagement/azure-mgmt-alertsmanagement/azure/mgmt/alertsmanagement/operations/_action_rules_operations.py @@ -158,7 +158,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(_models.ErrorResponse, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -287,7 +287,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(_models.ErrorResponse, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -349,7 +349,7 @@ def get_by_name( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(_models.ErrorResponse, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) response_headers = {} @@ -421,7 +421,7 @@ def create_update( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(_models.ErrorResponse, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) response_headers = {} @@ -485,7 +485,7 @@ def delete( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(_models.ErrorResponse, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) response_headers = {} @@ -557,7 +557,7 @@ def update( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(_models.ErrorResponse, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) response_headers = {} diff --git a/sdk/alertsmanagement/azure-mgmt-alertsmanagement/azure/mgmt/alertsmanagement/operations/_alerts_operations.py b/sdk/alertsmanagement/azure-mgmt-alertsmanagement/azure/mgmt/alertsmanagement/operations/_alerts_operations.py index a9a11f009898..25aa4e73d4e1 100644 --- a/sdk/alertsmanagement/azure-mgmt-alertsmanagement/azure/mgmt/alertsmanagement/operations/_alerts_operations.py +++ b/sdk/alertsmanagement/azure-mgmt-alertsmanagement/azure/mgmt/alertsmanagement/operations/_alerts_operations.py @@ -166,10 +166,10 @@ def get_all( :type select: str :param time_range: Filter by time range by below listed values. Default value is 1 day. :type time_range: str or ~azure.mgmt.alertsmanagement.models.TimeRange - :param custom_time_range: Filter by custom time range in the format :code:``/:code:`` where time is in (ISO-8601 format)'. Permissible values is within 30 - days from query time. Either timeRange or customTimeRange could be used but not both. Default - is none. + :param custom_time_range: Filter by custom time range in the format + :code:``/:code:`` where time is in (ISO-8601 format)'. Permissible + values is within 30 days from query time. Either timeRange or customTimeRange could be used + but not both. Default is none. :type custom_time_range: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either AlertsList or the result of cls(response) @@ -255,7 +255,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(_models.ErrorResponseAutoGenerated, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponseAutoGenerated, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -313,7 +313,7 @@ def get_by_id( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(_models.ErrorResponseAutoGenerated, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponseAutoGenerated, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('Alert', pipeline_response) @@ -373,7 +373,7 @@ def change_state( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(_models.ErrorResponseAutoGenerated, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponseAutoGenerated, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('Alert', pipeline_response) @@ -430,7 +430,7 @@ def get_history( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(_models.ErrorResponseAutoGenerated, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponseAutoGenerated, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('AlertModification', pipeline_response) @@ -490,10 +490,10 @@ def get_summary( :type alert_rule: str :param time_range: Filter by time range by below listed values. Default value is 1 day. :type time_range: str or ~azure.mgmt.alertsmanagement.models.TimeRange - :param custom_time_range: Filter by custom time range in the format :code:``/:code:`` where time is in (ISO-8601 format)'. Permissible values is within 30 - days from query time. Either timeRange or customTimeRange could be used but not both. Default - is none. + :param custom_time_range: Filter by custom time range in the format + :code:``/:code:`` where time is in (ISO-8601 format)'. Permissible + values is within 30 days from query time. Either timeRange or customTimeRange could be used + but not both. Default is none. :type custom_time_range: str :keyword callable cls: A custom type or function that will be passed the direct response :return: AlertsSummary, or the result of cls(response) @@ -552,7 +552,7 @@ def get_summary( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(_models.ErrorResponseAutoGenerated, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponseAutoGenerated, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('AlertsSummary', pipeline_response) diff --git a/sdk/alertsmanagement/azure-mgmt-alertsmanagement/azure/mgmt/alertsmanagement/operations/_smart_detector_alert_rules_operations.py b/sdk/alertsmanagement/azure-mgmt-alertsmanagement/azure/mgmt/alertsmanagement/operations/_smart_detector_alert_rules_operations.py index 0eb0820bf1f7..7cec0c0197fe 100644 --- a/sdk/alertsmanagement/azure-mgmt-alertsmanagement/azure/mgmt/alertsmanagement/operations/_smart_detector_alert_rules_operations.py +++ b/sdk/alertsmanagement/azure-mgmt-alertsmanagement/azure/mgmt/alertsmanagement/operations/_smart_detector_alert_rules_operations.py @@ -107,7 +107,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(_models.SmartDetectorErrorResponse, response) + error = self._deserialize.failsafe_deserialize(_models.SmartDetectorErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -184,7 +184,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(_models.SmartDetectorErrorResponse, response) + error = self._deserialize.failsafe_deserialize(_models.SmartDetectorErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -249,7 +249,7 @@ def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(_models.SmartDetectorErrorResponse, response) + error = self._deserialize.failsafe_deserialize(_models.SmartDetectorErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('AlertRule', pipeline_response) @@ -317,7 +317,7 @@ def create_or_update( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(_models.SmartDetectorErrorResponse, response) + error = self._deserialize.failsafe_deserialize(_models.SmartDetectorErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -389,7 +389,7 @@ def patch( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(_models.SmartDetectorErrorResponse, response) + error = self._deserialize.failsafe_deserialize(_models.SmartDetectorErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('AlertRule', pipeline_response) @@ -449,7 +449,7 @@ def delete( if response.status_code not in [200, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(_models.SmartDetectorErrorResponse, response) + error = self._deserialize.failsafe_deserialize(_models.SmartDetectorErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: diff --git a/sdk/alertsmanagement/azure-mgmt-alertsmanagement/azure/mgmt/alertsmanagement/operations/_smart_groups_operations.py b/sdk/alertsmanagement/azure-mgmt-alertsmanagement/azure/mgmt/alertsmanagement/operations/_smart_groups_operations.py index 36ca85cbb1c7..1f0f915311a8 100644 --- a/sdk/alertsmanagement/azure-mgmt-alertsmanagement/azure/mgmt/alertsmanagement/operations/_smart_groups_operations.py +++ b/sdk/alertsmanagement/azure-mgmt-alertsmanagement/azure/mgmt/alertsmanagement/operations/_smart_groups_operations.py @@ -167,7 +167,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(_models.ErrorResponseAutoGenerated2, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponseAutoGenerated2, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -225,7 +225,7 @@ def get_by_id( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(_models.ErrorResponseAutoGenerated2, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponseAutoGenerated2, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) response_headers = {} @@ -287,7 +287,7 @@ def change_state( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(_models.ErrorResponseAutoGenerated2, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponseAutoGenerated2, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) response_headers = {} @@ -346,7 +346,7 @@ def get_history( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(_models.ErrorResponseAutoGenerated2, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponseAutoGenerated2, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('SmartGroupModification', pipeline_response)