Skip to content

Commit

Permalink
CodeGen from PR 11958 in Azure/azure-rest-api-specs
Browse files Browse the repository at this point in the history
Merge b716c042e6f30a61d9d01562d2d1bebc65151b0b into 7b34c62
  • Loading branch information
SDKAuto committed Dec 11, 2020
1 parent e1f2009 commit ab21947
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 18 deletions.
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 @@ -57,7 +56,8 @@ def list_locations(
:return: An iterator like instance of Location
:rtype:
~azure.mgmt.subscription.models.LocationPaged[~azure.mgmt.subscription.models.Location]
:raises: :class:`CloudError<msrestazure.azure_exceptions.CloudError>`
:raises:
:class:`ErrorResponseBodyException<azure.mgmt.subscription.models.ErrorResponseBodyException>`
"""
def prepare_request(next_link=None):
if not next_link:
Expand Down Expand Up @@ -96,9 +96,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.ErrorResponseBodyException(self._deserialize, response)

return response

Expand All @@ -125,7 +123,8 @@ def get(
:return: Subscription or ClientRawResponse if raw=true
:rtype: ~azure.mgmt.subscription.models.Subscription or
~msrest.pipeline.ClientRawResponse
:raises: :class:`CloudError<msrestazure.azure_exceptions.CloudError>`
:raises:
:class:`ErrorResponseBodyException<azure.mgmt.subscription.models.ErrorResponseBodyException>`
"""
# Construct URL
url = self.get.metadata['url']
Expand Down Expand Up @@ -153,9 +152,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.ErrorResponseBodyException(self._deserialize, response)

deserialized = None
if response.status_code == 200:
Expand All @@ -180,7 +177,8 @@ def list(
:return: An iterator like instance of Subscription
:rtype:
~azure.mgmt.subscription.models.SubscriptionPaged[~azure.mgmt.subscription.models.Subscription]
:raises: :class:`CloudError<msrestazure.azure_exceptions.CloudError>`
:raises:
:class:`ErrorResponseBodyException<azure.mgmt.subscription.models.ErrorResponseBodyException>`
"""
def prepare_request(next_link=None):
if not next_link:
Expand Down Expand Up @@ -215,9 +213,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.ErrorResponseBodyException(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 @@ -51,7 +50,8 @@ def list(
:return: An iterator like instance of TenantIdDescription
:rtype:
~azure.mgmt.subscription.models.TenantIdDescriptionPaged[~azure.mgmt.subscription.models.TenantIdDescription]
:raises: :class:`CloudError<msrestazure.azure_exceptions.CloudError>`
:raises:
:class:`ErrorResponseBodyException<azure.mgmt.subscription.models.ErrorResponseBodyException>`
"""
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.ErrorResponseBodyException(self._deserialize, response)

return response

Expand Down

0 comments on commit ab21947

Please sign in to comment.