Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[AutoPR apimanagement/resource-manager] Fix contract for Error in OperationResultContract #2786

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
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
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