Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Generated from 9e5daf5f1cd3c59140eec06d6fb55e6456323c54
Fixed reference to ErrorDetails
  • Loading branch information
AutorestCI committed Aug 14, 2018
commit 9163b0c2b711d907fa26a826a00bd3010332f5de
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@
from .effective_network_security_group_list_result_py3 import EffectiveNetworkSecurityGroupListResult
from .effective_route_py3 import EffectiveRoute
from .effective_route_list_result_py3 import EffectiveRouteListResult
from .error_response_py3 import ErrorResponse, ErrorResponseException
from .network_watcher_py3 import NetworkWatcher
from .topology_parameters_py3 import TopologyParameters
from .topology_association_py3 import TopologyAssociation
Expand Down Expand Up @@ -341,6 +342,7 @@
from .effective_network_security_group_list_result import EffectiveNetworkSecurityGroupListResult
from .effective_route import EffectiveRoute
from .effective_route_list_result import EffectiveRouteListResult
from .error_response import ErrorResponse, ErrorResponseException
from .network_watcher import NetworkWatcher
from .topology_parameters import TopologyParameters
from .topology_association import TopologyAssociation
Expand Down Expand Up @@ -695,6 +697,7 @@
'EffectiveNetworkSecurityGroupListResult',
'EffectiveRoute',
'EffectiveRouteListResult',
'ErrorResponse', 'ErrorResponseException',
'NetworkWatcher',
'TopologyParameters',
'TopologyAssociation',
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
# --------------------------------------------------------------------------

from msrest.serialization import Model
from msrest.exceptions import HttpOperationError


class ErrorResponse(Model):
"""The error object.

:param error: Error.
:type error: ~azure.mgmt.network.v2018_06_01.models.ErrorDetails
"""

_attribute_map = {
'error': {'key': 'error', 'type': 'ErrorDetails'},
}

def __init__(self, **kwargs):
super(ErrorResponse, self).__init__(**kwargs)
self.error = kwargs.get('error', None)


class ErrorResponseException(HttpOperationError):
"""Server responsed with exception of type: 'ErrorResponse'.

:param deserialize: A deserializer
:param response: Server response to be deserialized.
"""

def __init__(self, deserialize, response, *args):

super(ErrorResponseException, self).__init__(deserialize, response, 'ErrorResponse', *args)
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
# --------------------------------------------------------------------------

from msrest.serialization import Model
from msrest.exceptions import HttpOperationError


class ErrorResponse(Model):
"""The error object.

:param error: Error.
:type error: ~azure.mgmt.network.v2018_06_01.models.ErrorDetails
"""

_attribute_map = {
'error': {'key': 'error', 'type': 'ErrorDetails'},
}

def __init__(self, *, error=None, **kwargs) -> None:
super(ErrorResponse, self).__init__(**kwargs)
self.error = error


class ErrorResponseException(HttpOperationError):
"""Server responsed with exception of type: 'ErrorResponse'.

:param deserialize: A deserializer
:param response: Server response to be deserialized.
"""

def __init__(self, deserialize, response, *args):

super(ErrorResponseException, self).__init__(deserialize, response, 'ErrorResponse', *args)
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 msrest.polling import LROPoller, NoPolling
from msrestazure.polling.arm_polling import ARMPolling

Expand Down Expand Up @@ -75,9 +74,7 @@ def _create_or_update_initial(
response = self._client.send(request, stream=False, **operation_config)

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

deserialized = None

Expand Down Expand Up @@ -118,7 +115,8 @@ def create_or_update(
~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2018_06_01.models.ConnectionMonitorResult]
or
~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2018_06_01.models.ConnectionMonitorResult]]
:raises: :class:`CloudError<msrestazure.azure_exceptions.CloudError>`
:raises:
:class:`ErrorResponseException<azure.mgmt.network.v2018_06_01.models.ErrorResponseException>`
"""
raw_result = self._create_or_update_initial(
resource_group_name=resource_group_name,
Expand Down Expand Up @@ -167,7 +165,8 @@ def get(
:return: ConnectionMonitorResult or ClientRawResponse if raw=true
:rtype: ~azure.mgmt.network.v2018_06_01.models.ConnectionMonitorResult
or ~msrest.pipeline.ClientRawResponse
:raises: :class:`CloudError<msrestazure.azure_exceptions.CloudError>`
:raises:
:class:`ErrorResponseException<azure.mgmt.network.v2018_06_01.models.ErrorResponseException>`
"""
# Construct URL
url = self.get.metadata['url']
Expand Down Expand Up @@ -198,9 +197,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.ErrorResponseException(self._deserialize, response)

deserialized = None

Expand Down Expand Up @@ -245,9 +242,7 @@ def _delete_initial(
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.ErrorResponseException(self._deserialize, response)

if raw:
client_raw_response = ClientRawResponse(None, response)
Expand All @@ -273,7 +268,8 @@ def delete(
ClientRawResponse<None> if raw==True
:rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or
~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]]
:raises: :class:`CloudError<msrestazure.azure_exceptions.CloudError>`
:raises:
:class:`ErrorResponseException<azure.mgmt.network.v2018_06_01.models.ErrorResponseException>`
"""
raw_result = self._delete_initial(
resource_group_name=resource_group_name,
Expand Down Expand Up @@ -329,9 +325,7 @@ def _stop_initial(
response = self._client.send(request, stream=False, **operation_config)

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

if raw:
client_raw_response = ClientRawResponse(None, response)
Expand All @@ -357,7 +351,8 @@ def stop(
ClientRawResponse<None> if raw==True
:rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or
~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]]
:raises: :class:`CloudError<msrestazure.azure_exceptions.CloudError>`
:raises:
:class:`ErrorResponseException<azure.mgmt.network.v2018_06_01.models.ErrorResponseException>`
"""
raw_result = self._stop_initial(
resource_group_name=resource_group_name,
Expand Down Expand Up @@ -413,9 +408,7 @@ def _start_initial(
response = self._client.send(request, stream=False, **operation_config)

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

if raw:
client_raw_response = ClientRawResponse(None, response)
Expand All @@ -441,7 +434,8 @@ def start(
ClientRawResponse<None> if raw==True
:rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or
~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]]
:raises: :class:`CloudError<msrestazure.azure_exceptions.CloudError>`
:raises:
:class:`ErrorResponseException<azure.mgmt.network.v2018_06_01.models.ErrorResponseException>`
"""
raw_result = self._start_initial(
resource_group_name=resource_group_name,
Expand Down Expand Up @@ -498,9 +492,7 @@ def _query_initial(
response = self._client.send(request, stream=False, **operation_config)

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

deserialized = None

Expand Down Expand Up @@ -539,7 +531,8 @@ def query(
~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2018_06_01.models.ConnectionMonitorQueryResult]
or
~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2018_06_01.models.ConnectionMonitorQueryResult]]
:raises: :class:`CloudError<msrestazure.azure_exceptions.CloudError>`
:raises:
:class:`ErrorResponseException<azure.mgmt.network.v2018_06_01.models.ErrorResponseException>`
"""
raw_result = self._query_initial(
resource_group_name=resource_group_name,
Expand Down Expand Up @@ -585,7 +578,8 @@ def list(
:return: An iterator like instance of ConnectionMonitorResult
:rtype:
~azure.mgmt.network.v2018_06_01.models.ConnectionMonitorResultPaged[~azure.mgmt.network.v2018_06_01.models.ConnectionMonitorResult]
:raises: :class:`CloudError<msrestazure.azure_exceptions.CloudError>`
:raises:
:class:`ErrorResponseException<azure.mgmt.network.v2018_06_01.models.ErrorResponseException>`
"""
def internal_paging(next_link=None, raw=False):

Expand Down Expand Up @@ -622,9 +616,7 @@ def internal_paging(next_link=None, raw=False):
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.ErrorResponseException(self._deserialize, response)

return response

Expand Down
Loading