Skip to content

Commit

Permalink
Generated from 098c87d37f661c1aa51916e5dd2026aa1902c806 (#2786)
Browse files Browse the repository at this point in the history
Fix contract for Error in OperationResultContract
  • Loading branch information
AutorestCI authored Jun 20, 2018
1 parent 8b91bcc commit 35ef4f4
Show file tree
Hide file tree
Showing 5 changed files with 83 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@

try:
from .error_field_contract_py3 import ErrorFieldContract
from .error_response_body_py3 import ErrorResponseBody
from .error_response_py3 import ErrorResponse, ErrorResponseException
from .policy_contract_py3 import PolicyContract
from .policy_collection_py3 import PolicyCollection
Expand Down Expand Up @@ -155,6 +156,7 @@
from .api_version_set_update_parameters_py3 import ApiVersionSetUpdateParameters
except (SyntaxError, ImportError):
from .error_field_contract import ErrorFieldContract
from .error_response_body import ErrorResponseBody
from .error_response import ErrorResponse, ErrorResponseException
from .policy_contract import PolicyContract
from .policy_collection import PolicyCollection
Expand Down Expand Up @@ -364,6 +366,7 @@

__all__ = [
'ErrorFieldContract',
'ErrorResponseBody',
'ErrorResponse', 'ErrorResponseException',
'PolicyContract',
'PolicyCollection',
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# 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


class ErrorResponseBody(Model):
"""Error Body contract.
:param code: Service-defined error code. This code serves as a sub-status
for the HTTP error code specified in the response.
:type code: str
:param message: Human-readable representation of the error.
:type message: str
:param details: The list of invalid fields send in request, in case of
validation error.
:type details: list[~azure.mgmt.apimanagement.models.ErrorFieldContract]
"""

_attribute_map = {
'code': {'key': 'code', 'type': 'str'},
'message': {'key': 'message', 'type': 'str'},
'details': {'key': 'details', 'type': '[ErrorFieldContract]'},
}

def __init__(self, **kwargs):
super(ErrorResponseBody, self).__init__(**kwargs)
self.code = kwargs.get('code', None)
self.message = kwargs.get('message', None)
self.details = kwargs.get('details', None)
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# 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


class ErrorResponseBody(Model):
"""Error Body contract.
:param code: Service-defined error code. This code serves as a sub-status
for the HTTP error code specified in the response.
:type code: str
:param message: Human-readable representation of the error.
:type message: str
:param details: The list of invalid fields send in request, in case of
validation error.
:type details: list[~azure.mgmt.apimanagement.models.ErrorFieldContract]
"""

_attribute_map = {
'code': {'key': 'code', 'type': 'str'},
'message': {'key': 'message', 'type': 'str'},
'details': {'key': 'details', 'type': '[ErrorFieldContract]'},
}

def __init__(self, *, code: str=None, message: str=None, details=None, **kwargs) -> None:
super(ErrorResponseBody, self).__init__(**kwargs)
self.code = code
self.message = message
self.details = details
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ class OperationResultContract(Model):
:param result_info: Optional result info.
:type result_info: str
:param error: Error Body Contract
:type error: ~azure.mgmt.apimanagement.models.ErrorResponse
:type error: ~azure.mgmt.apimanagement.models.ErrorResponseBody
:ivar action_log: This property if only provided as part of the
TenantConfiguration_Validate operation. It contains the log the entities
which will be updated/created/deleted as part of the
Expand All @@ -53,7 +53,7 @@ class OperationResultContract(Model):
'started': {'key': 'started', 'type': 'iso-8601'},
'updated': {'key': 'updated', 'type': 'iso-8601'},
'result_info': {'key': 'resultInfo', 'type': 'str'},
'error': {'key': 'error', 'type': 'ErrorResponse'},
'error': {'key': 'error', 'type': 'ErrorResponseBody'},
'action_log': {'key': 'actionLog', 'type': '[OperationResultLogItemContract]'},
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ class OperationResultContract(Model):
:param result_info: Optional result info.
:type result_info: str
:param error: Error Body Contract
:type error: ~azure.mgmt.apimanagement.models.ErrorResponse
:type error: ~azure.mgmt.apimanagement.models.ErrorResponseBody
:ivar action_log: This property if only provided as part of the
TenantConfiguration_Validate operation. It contains the log the entities
which will be updated/created/deleted as part of the
Expand All @@ -53,7 +53,7 @@ class OperationResultContract(Model):
'started': {'key': 'started', 'type': 'iso-8601'},
'updated': {'key': 'updated', 'type': 'iso-8601'},
'result_info': {'key': 'resultInfo', 'type': 'str'},
'error': {'key': 'error', 'type': 'ErrorResponse'},
'error': {'key': 'error', 'type': 'ErrorResponseBody'},
'action_log': {'key': 'actionLog', 'type': '[OperationResultLogItemContract]'},
}

Expand Down

0 comments on commit 35ef4f4

Please sign in to comment.