Skip to content

Commit

Permalink
CodeGen from PR 11516 in Azure/azure-rest-api-specs
Browse files Browse the repository at this point in the history
add advisor track2 config (Azure#11516)
  • Loading branch information
SDKAuto committed Jan 15, 2021
1 parent 6f142b0 commit 3f28497
Show file tree
Hide file tree
Showing 6 changed files with 58 additions and 57 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 @@ -11,7 +11,6 @@

import uuid
from msrest.pipeline import ClientRawResponse
from msrestazure.azure_exceptions import CloudError

from .. import models

Expand Down Expand Up @@ -51,7 +50,8 @@ def list(
:return: An iterator like instance of OperationEntity
:rtype:
~azure.mgmt.advisor.models.OperationEntityPaged[~azure.mgmt.advisor.models.OperationEntity]
:raises: :class:`CloudError<msrestazure.azure_exceptions.CloudError>`
:raises:
:class:`ArmErrorResponseException<azure.mgmt.advisor.models.ArmErrorResponseException>`
"""
def prepare_request(next_link=None):
if not next_link:
Expand Down Expand Up @@ -86,9 +86,7 @@ def internal_paging(next_link=None):
response = self._client.send(request, stream=False, **operation_config)

if response.status_code not in [200]:
exp = CloudError(response)
exp.request_id = response.headers.get('x-ms-request-id')
raise exp
raise models.ArmErrorResponseException(self._deserialize, response)

return response

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@

import uuid
from msrest.pipeline import ClientRawResponse
from msrestazure.azure_exceptions import CloudError

from .. import models

Expand Down Expand Up @@ -52,7 +51,8 @@ def get(
overrides<msrest:optionsforoperations>`.
:return: object or ClientRawResponse if raw=true
:rtype: object or ~msrest.pipeline.ClientRawResponse
:raises: :class:`CloudError<msrestazure.azure_exceptions.CloudError>`
:raises:
:class:`ArmErrorResponseException<azure.mgmt.advisor.models.ArmErrorResponseException>`
"""
# Construct URL
url = self.get.metadata['url']
Expand Down Expand Up @@ -80,9 +80,7 @@ def get(
response = self._client.send(request, stream=False, **operation_config)

if response.status_code not in [200, 404]:
exp = CloudError(response)
exp.request_id = response.headers.get('x-ms-request-id')
raise exp
raise models.ArmErrorResponseException(self._deserialize, response)

deserialized = None
if response.status_code == 200:
Expand All @@ -109,7 +107,8 @@ def list(
:return: An iterator like instance of MetadataEntity
:rtype:
~azure.mgmt.advisor.models.MetadataEntityPaged[~azure.mgmt.advisor.models.MetadataEntity]
:raises: :class:`CloudError<msrestazure.azure_exceptions.CloudError>`
:raises:
:class:`ArmErrorResponseException<azure.mgmt.advisor.models.ArmErrorResponseException>`
"""
def prepare_request(next_link=None):
if not next_link:
Expand Down Expand Up @@ -144,9 +143,7 @@ def internal_paging(next_link=None):
response = self._client.send(request, stream=False, **operation_config)

if response.status_code not in [200]:
exp = CloudError(response)
exp.request_id = response.headers.get('x-ms-request-id')
raise exp
raise models.ArmErrorResponseException(self._deserialize, response)

return response

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@

import uuid
from msrest.pipeline import ClientRawResponse
from msrestazure.azure_exceptions import CloudError

from .. import models

Expand Down Expand Up @@ -52,7 +51,8 @@ def generate(
overrides<msrest:optionsforoperations>`.
:return: None or ClientRawResponse if raw=true
:rtype: None or ~msrest.pipeline.ClientRawResponse
:raises: :class:`CloudError<msrestazure.azure_exceptions.CloudError>`
:raises:
:class:`ArmErrorResponseException<azure.mgmt.advisor.models.ArmErrorResponseException>`
"""
# Construct URL
url = self.generate.metadata['url']
Expand All @@ -79,9 +79,7 @@ def generate(
response = self._client.send(request, stream=False, **operation_config)

if response.status_code not in [202]:
exp = CloudError(response)
exp.request_id = response.headers.get('x-ms-request-id')
raise exp
raise models.ArmErrorResponseException(self._deserialize, response)

if raw:
client_raw_response = ClientRawResponse(None, response)
Expand Down Expand Up @@ -109,7 +107,8 @@ def get_generate_status(
overrides<msrest:optionsforoperations>`.
:return: None or ClientRawResponse if raw=true
:rtype: None or ~msrest.pipeline.ClientRawResponse
:raises: :class:`CloudError<msrestazure.azure_exceptions.CloudError>`
:raises:
:class:`ArmErrorResponseException<azure.mgmt.advisor.models.ArmErrorResponseException>`
"""
# Construct URL
url = self.get_generate_status.metadata['url']
Expand Down Expand Up @@ -137,9 +136,7 @@ def get_generate_status(
response = self._client.send(request, stream=False, **operation_config)

if response.status_code not in [202, 204]:
exp = CloudError(response)
exp.request_id = response.headers.get('x-ms-request-id')
raise exp
raise models.ArmErrorResponseException(self._deserialize, response)

if raw:
client_raw_response = ClientRawResponse(None, response)
Expand All @@ -151,7 +148,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 All @@ -167,7 +168,8 @@ def list(
:return: An iterator like instance of ResourceRecommendationBase
:rtype:
~azure.mgmt.advisor.models.ResourceRecommendationBasePaged[~azure.mgmt.advisor.models.ResourceRecommendationBase]
:raises: :class:`CloudError<msrestazure.azure_exceptions.CloudError>`
:raises:
:class:`ArmErrorResponseException<azure.mgmt.advisor.models.ArmErrorResponseException>`
"""
def prepare_request(next_link=None):
if not next_link:
Expand Down Expand Up @@ -212,9 +214,7 @@ def internal_paging(next_link=None):
response = self._client.send(request, stream=False, **operation_config)

if response.status_code not in [200]:
exp = CloudError(response)
exp.request_id = response.headers.get('x-ms-request-id')
raise exp
raise models.ArmErrorResponseException(self._deserialize, response)

return response

Expand Down Expand Up @@ -244,7 +244,8 @@ def get(
:return: ResourceRecommendationBase or ClientRawResponse if raw=true
:rtype: ~azure.mgmt.advisor.models.ResourceRecommendationBase or
~msrest.pipeline.ClientRawResponse
:raises: :class:`CloudError<msrestazure.azure_exceptions.CloudError>`
:raises:
:class:`ArmErrorResponseException<azure.mgmt.advisor.models.ArmErrorResponseException>`
"""
# Construct URL
url = self.get.metadata['url']
Expand Down Expand Up @@ -273,9 +274,7 @@ def get(
response = self._client.send(request, stream=False, **operation_config)

if response.status_code not in [200]:
exp = CloudError(response)
exp.request_id = response.headers.get('x-ms-request-id')
raise exp
raise models.ArmErrorResponseException(self._deserialize, response)

deserialized = None
if response.status_code == 200:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@

import uuid
from msrest.pipeline import ClientRawResponse
from msrestazure.azure_exceptions import CloudError

from .. import models

Expand Down Expand Up @@ -55,10 +54,10 @@ 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
:raises: :class:`CloudError<msrestazure.azure_exceptions.CloudError>`
:return: object or ClientRawResponse if raw=true
:rtype: object or ~msrest.pipeline.ClientRawResponse
:raises:
:class:`ArmErrorResponseException<azure.mgmt.advisor.models.ArmErrorResponseException>`
"""
# Construct URL
url = self.get.metadata['url']
Expand Down Expand Up @@ -87,14 +86,14 @@ 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]:
exp = CloudError(response)
exp.request_id = response.headers.get('x-ms-request-id')
raise exp
if response.status_code not in [200, 404]:
raise models.ArmErrorResponseException(self._deserialize, response)

deserialized = None
if response.status_code == 200:
deserialized = self._deserialize('SuppressionContract', response)
if response.status_code == 404:
deserialized = self._deserialize('ArmErrorResponse', response)

if raw:
client_raw_response = ClientRawResponse(deserialized, response)
Expand Down Expand Up @@ -126,10 +125,10 @@ def create(
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
:raises: :class:`CloudError<msrestazure.azure_exceptions.CloudError>`
:return: object or ClientRawResponse if raw=true
:rtype: object or ~msrest.pipeline.ClientRawResponse
:raises:
:class:`ArmErrorResponseException<azure.mgmt.advisor.models.ArmErrorResponseException>`
"""
suppression_contract = models.SuppressionContract(suppression_id=suppression_id, ttl=ttl)

Expand Down Expand Up @@ -164,14 +163,14 @@ def create(
request = self._client.put(url, query_parameters, header_parameters, body_content)
response = self._client.send(request, stream=False, **operation_config)

if response.status_code not in [200]:
exp = CloudError(response)
exp.request_id = response.headers.get('x-ms-request-id')
raise exp
if response.status_code not in [200, 404]:
raise models.ArmErrorResponseException(self._deserialize, response)

deserialized = None
if response.status_code == 200:
deserialized = self._deserialize('SuppressionContract', response)
if response.status_code == 404:
deserialized = self._deserialize('ArmErrorResponse', response)

if raw:
client_raw_response = ClientRawResponse(deserialized, response)
Expand Down Expand Up @@ -200,7 +199,8 @@ def delete(
overrides<msrest:optionsforoperations>`.
:return: None or ClientRawResponse if raw=true
:rtype: None or ~msrest.pipeline.ClientRawResponse
:raises: :class:`CloudError<msrestazure.azure_exceptions.CloudError>`
:raises:
:class:`ArmErrorResponseException<azure.mgmt.advisor.models.ArmErrorResponseException>`
"""
# Construct URL
url = self.delete.metadata['url']
Expand Down Expand Up @@ -229,9 +229,7 @@ def delete(
response = self._client.send(request, stream=False, **operation_config)

if response.status_code not in [204]:
exp = CloudError(response)
exp.request_id = response.headers.get('x-ms-request-id')
raise exp
raise models.ArmErrorResponseException(self._deserialize, response)

if raw:
client_raw_response = ClientRawResponse(None, response)
Expand All @@ -258,7 +256,8 @@ def list(
:return: An iterator like instance of SuppressionContract
:rtype:
~azure.mgmt.advisor.models.SuppressionContractPaged[~azure.mgmt.advisor.models.SuppressionContract]
:raises: :class:`CloudError<msrestazure.azure_exceptions.CloudError>`
:raises:
:class:`ArmErrorResponseException<azure.mgmt.advisor.models.ArmErrorResponseException>`
"""
def prepare_request(next_link=None):
if not next_link:
Expand Down Expand Up @@ -301,9 +300,7 @@ def internal_paging(next_link=None):
response = self._client.send(request, stream=False, **operation_config)

if response.status_code not in [200]:
exp = CloudError(response)
exp.request_id = response.headers.get('x-ms-request-id')
raise exp
raise models.ArmErrorResponseException(self._deserialize, response)

return response

Expand Down

0 comments on commit 3f28497

Please sign in to comment.