Skip to content

Commit

Permalink
Generated from 00867e23eb2ef11b82341b5c0894acb104583e9c
Browse files Browse the repository at this point in the history
  • Loading branch information
SDK Automation committed Oct 29, 2020
1 parent b57bc01 commit ce64afd
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand All @@ -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
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand All @@ -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
Original file line number Diff line number Diff line change
Expand Up @@ -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.<br>Filter
can be applied to properties ['ResourceId', 'ResourceGroup',
'RecommendationTypeGuid', '[Category](#category)'] with operators
['eq', 'and', 'or'].<br>Example:<br>- $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.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,8 @@ def get(
deserialized response
:param operation_config: :ref:`Operation configuration
overrides<msrest:optionsforoperations>`.
: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<msrestazure.azure_exceptions.CloudError>`
"""
# Construct URL
Expand Down Expand Up @@ -87,14 +86,16 @@ 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

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)
Expand Down
4 changes: 3 additions & 1 deletion sdk/advisor/azure-mgmt-advisor/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,9 @@
pass

# Version extraction inspired from 'requests'
with open(os.path.join(package_folder_path, 'version.py'), 'r') as fd:
with open(os.path.join(package_folder_path, 'version.py')
if os.path.exists(os.path.join(package_folder_path, 'version.py'))
else os.path.join(package_folder_path, '_version.py'), 'r') as fd:
version = re.search(r'^VERSION\s*=\s*[\'"]([^\'"]*)[\'"]',
fd.read(), re.MULTILINE).group(1)

Expand Down

0 comments on commit ce64afd

Please sign in to comment.