From 8ea683db882ea80f4d9a2548951c8599b59e3050 Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Tue, 24 Nov 2020 02:59:24 +0000 Subject: [PATCH] CodeGen from PR 11433 in Azure/azure-rest-api-specs Updates advisor.Json to improve Documentation for Suppressions_Get operation (#11433) Co-authored-by: Yen-Chun Chang --- .../azure/mgmt/advisor/models/_models.py | 5 +++++ .../azure/mgmt/advisor/models/_models_py3.py | 5 +++++ .../advisor/operations/_recommendations_operations.py | 6 +++++- .../mgmt/advisor/operations/_suppressions_operations.py | 9 +++++---- 4 files changed, 20 insertions(+), 5 deletions(-) diff --git a/sdk/advisor/azure-mgmt-advisor/azure/mgmt/advisor/models/_models.py b/sdk/advisor/azure-mgmt-advisor/azure/mgmt/advisor/models/_models.py index f9a772563e1f..a9f2d6865224 100644 --- a/sdk/advisor/azure-mgmt-advisor/azure/mgmt/advisor/models/_models.py +++ b/sdk/advisor/azure-mgmt-advisor/azure/mgmt/advisor/models/_models.py @@ -444,12 +444,15 @@ class SuppressionContract(Resource): :type suppression_id: str :param ttl: The duration for which the suppression is valid. :type ttl: str + :ivar expiration_time_stamp: Gets or sets the expiration time stamp. + :vartype expiration_time_stamp: datetime """ _validation = { 'id': {'readonly': True}, 'name': {'readonly': True}, 'type': {'readonly': True}, + 'expiration_time_stamp': {'readonly': True}, } _attribute_map = { @@ -458,9 +461,11 @@ class SuppressionContract(Resource): 'type': {'key': 'type', 'type': 'str'}, 'suppression_id': {'key': 'properties.suppressionId', 'type': 'str'}, 'ttl': {'key': 'properties.ttl', 'type': 'str'}, + 'expiration_time_stamp': {'key': 'properties.expirationTimeStamp', 'type': 'iso-8601'}, } def __init__(self, **kwargs): super(SuppressionContract, self).__init__(**kwargs) self.suppression_id = kwargs.get('suppression_id', None) self.ttl = kwargs.get('ttl', None) + self.expiration_time_stamp = None diff --git a/sdk/advisor/azure-mgmt-advisor/azure/mgmt/advisor/models/_models_py3.py b/sdk/advisor/azure-mgmt-advisor/azure/mgmt/advisor/models/_models_py3.py index f9115380f584..d137dbb9263e 100644 --- a/sdk/advisor/azure-mgmt-advisor/azure/mgmt/advisor/models/_models_py3.py +++ b/sdk/advisor/azure-mgmt-advisor/azure/mgmt/advisor/models/_models_py3.py @@ -444,12 +444,15 @@ class SuppressionContract(Resource): :type suppression_id: str :param ttl: The duration for which the suppression is valid. :type ttl: str + :ivar expiration_time_stamp: Gets or sets the expiration time stamp. + :vartype expiration_time_stamp: datetime """ _validation = { 'id': {'readonly': True}, 'name': {'readonly': True}, 'type': {'readonly': True}, + 'expiration_time_stamp': {'readonly': True}, } _attribute_map = { @@ -458,9 +461,11 @@ class SuppressionContract(Resource): 'type': {'key': 'type', 'type': 'str'}, 'suppression_id': {'key': 'properties.suppressionId', 'type': 'str'}, 'ttl': {'key': 'properties.ttl', 'type': 'str'}, + 'expiration_time_stamp': {'key': 'properties.expirationTimeStamp', 'type': 'iso-8601'}, } def __init__(self, *, suppression_id: str=None, ttl: str=None, **kwargs) -> None: super(SuppressionContract, self).__init__(**kwargs) self.suppression_id = suppression_id self.ttl = ttl + self.expiration_time_stamp = None diff --git a/sdk/advisor/azure-mgmt-advisor/azure/mgmt/advisor/operations/_recommendations_operations.py b/sdk/advisor/azure-mgmt-advisor/azure/mgmt/advisor/operations/_recommendations_operations.py index 600cd2c43ff7..b618296ec639 100644 --- a/sdk/advisor/azure-mgmt-advisor/azure/mgmt/advisor/operations/_recommendations_operations.py +++ b/sdk/advisor/azure-mgmt-advisor/azure/mgmt/advisor/operations/_recommendations_operations.py @@ -151,7 +151,11 @@ def list( """Obtains cached recommendations for a subscription. The recommendations are generated or computed by invoking generateRecommendations. - :param filter: The filter to apply to the recommendations. + :param filter: The filter to apply to the recommendations.
Filter + can be applied to properties ['ResourceId', 'ResourceGroup', + 'RecommendationTypeGuid', '[Category](#category)'] with operators + ['eq', 'and', 'or'].
Example:
- $filter=Category eq 'Cost' and + ResourceGroup eq 'MyResourceGroup' :type filter: str :param top: The number of recommendations per page if a paged version of this API is being used. diff --git a/sdk/advisor/azure-mgmt-advisor/azure/mgmt/advisor/operations/_suppressions_operations.py b/sdk/advisor/azure-mgmt-advisor/azure/mgmt/advisor/operations/_suppressions_operations.py index e8ee6264d4d6..cb8fa2991e67 100644 --- a/sdk/advisor/azure-mgmt-advisor/azure/mgmt/advisor/operations/_suppressions_operations.py +++ b/sdk/advisor/azure-mgmt-advisor/azure/mgmt/advisor/operations/_suppressions_operations.py @@ -55,9 +55,8 @@ def get( deserialized response :param operation_config: :ref:`Operation configuration overrides`. - :return: SuppressionContract or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.advisor.models.SuppressionContract or - ~msrest.pipeline.ClientRawResponse + :return: object or ClientRawResponse if raw=true + :rtype: object or ~msrest.pipeline.ClientRawResponse :raises: :class:`CloudError` """ # Construct URL @@ -87,7 +86,7 @@ def get( request = self._client.get(url, query_parameters, header_parameters) response = self._client.send(request, stream=False, **operation_config) - if response.status_code not in [200]: + if response.status_code not in [200, 404]: exp = CloudError(response) exp.request_id = response.headers.get('x-ms-request-id') raise exp @@ -95,6 +94,8 @@ def get( deserialized = None if response.status_code == 200: deserialized = self._deserialize('SuppressionContract', response) + if response.status_code == 404: + deserialized = self._deserialize('ARMErrorResponseBody', response) if raw: client_raw_response = ClientRawResponse(deserialized, response)