Skip to content

Commit

Permalink
Generated from ea1dcaaff2c62789169209eea0e3f80cd735bae4
Browse files Browse the repository at this point in the history
[IoTCentral] Change error definition
  • Loading branch information
SDK Automation committed Mar 2, 2020
1 parent 92b9ac2 commit d5fff26
Show file tree
Hide file tree
Showing 5 changed files with 67 additions and 82 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,7 @@
from ._models_py3 import AppPatch
from ._models_py3 import AppSkuInfo
from ._models_py3 import AppTemplate
from ._models_py3 import ErrorDetails, ErrorDetailsException
from ._models_py3 import ErrorResponseBody
from ._models_py3 import CloudErrorBody
from ._models_py3 import Operation
from ._models_py3 import OperationDisplay
from ._models_py3 import OperationInputs
Expand All @@ -27,8 +26,7 @@
from ._models import AppPatch
from ._models import AppSkuInfo
from ._models import AppTemplate
from ._models import ErrorDetails, ErrorDetailsException
from ._models import ErrorResponseBody
from ._models import CloudErrorBody
from ._models import Operation
from ._models import OperationDisplay
from ._models import OperationInputs
Expand All @@ -46,8 +44,7 @@
'AppPatch',
'AppSkuInfo',
'AppTemplate',
'ErrorDetails', 'ErrorDetailsException',
'ErrorResponseBody',
'CloudErrorBody',
'Operation',
'OperationDisplay',
'OperationInputs',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,8 +96,6 @@ class App(Resource):
'type': {'readonly': True},
'location': {'required': True},
'application_id': {'readonly': True},
'display_name': {'pattern': r'^.{1,200}$'},
'subdomain': {'pattern': r'^[a-z0-9-]{1,63}$'},
'sku': {'required': True},
}

Expand Down Expand Up @@ -181,8 +179,6 @@ class AppPatch(Model):

_validation = {
'application_id': {'readonly': True},
'display_name': {'pattern': r'^.{1,200}$'},
'subdomain': {'pattern': r'^[a-z0-9-]{1,63}$'},
}

_attribute_map = {
Expand Down Expand Up @@ -274,14 +270,6 @@ def __init__(self, **kwargs):


class CloudError(Model):
"""CloudError.
"""

_attribute_map = {
}


class ErrorDetails(Model):
"""Error details.
Variables are only populated by the server, and will be ignored when
Expand All @@ -294,7 +282,7 @@ class ErrorDetails(Model):
:ivar target: The target of the particular error.
:vartype target: str
:param details: A list of additional details about the error.
:type details: list[~azure.mgmt.iotcentral.models.ErrorResponseBody]
:type details: list[~azure.mgmt.iotcentral.models.CloudErrorBody]
"""

_validation = {
Expand All @@ -307,30 +295,30 @@ class ErrorDetails(Model):
'code': {'key': 'error.code', 'type': 'str'},
'message': {'key': 'error.message', 'type': 'str'},
'target': {'key': 'error.target', 'type': 'str'},
'details': {'key': 'error.details', 'type': '[ErrorResponseBody]'},
'details': {'key': 'error.details', 'type': '[CloudErrorBody]'},
}

def __init__(self, **kwargs):
super(ErrorDetails, self).__init__(**kwargs)
super(CloudError, self).__init__(**kwargs)
self.code = None
self.message = None
self.target = None
self.details = kwargs.get('details', None)


class ErrorDetailsException(HttpOperationError):
"""Server responsed with exception of type: 'ErrorDetails'.
class CloudErrorException(HttpOperationError):
"""Server responsed with exception of type: 'CloudError'.
:param deserialize: A deserializer
:param response: Server response to be deserialized.
"""

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

super(ErrorDetailsException, self).__init__(deserialize, response, 'ErrorDetails', *args)
super(CloudErrorException, self).__init__(deserialize, response, 'CloudError', *args)


class ErrorResponseBody(Model):
class CloudErrorBody(Model):
"""Details of error response.
Variables are only populated by the server, and will be ignored when
Expand All @@ -343,7 +331,7 @@ class ErrorResponseBody(Model):
:ivar target: The target of the particular error.
:vartype target: str
:param details: A list of additional details about the error.
:type details: list[~azure.mgmt.iotcentral.models.ErrorResponseBody]
:type details: list[~azure.mgmt.iotcentral.models.CloudErrorBody]
"""

_validation = {
Expand All @@ -356,11 +344,11 @@ class ErrorResponseBody(Model):
'code': {'key': 'code', 'type': 'str'},
'message': {'key': 'message', 'type': 'str'},
'target': {'key': 'target', 'type': 'str'},
'details': {'key': 'details', 'type': '[ErrorResponseBody]'},
'details': {'key': 'details', 'type': '[CloudErrorBody]'},
}

def __init__(self, **kwargs):
super(ErrorResponseBody, self).__init__(**kwargs)
super(CloudErrorBody, self).__init__(**kwargs)
self.code = None
self.message = None
self.target = None
Expand Down Expand Up @@ -447,7 +435,7 @@ class OperationInputs(Model):
"""

_validation = {
'name': {'required': True, 'pattern': r'^[a-z0-9-]{1,63}$'},
'name': {'required': True},
}

_attribute_map = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,8 +96,6 @@ class App(Resource):
'type': {'readonly': True},
'location': {'required': True},
'application_id': {'readonly': True},
'display_name': {'pattern': r'^.{1,200}$'},
'subdomain': {'pattern': r'^[a-z0-9-]{1,63}$'},
'sku': {'required': True},
}

Expand Down Expand Up @@ -181,8 +179,6 @@ class AppPatch(Model):

_validation = {
'application_id': {'readonly': True},
'display_name': {'pattern': r'^.{1,200}$'},
'subdomain': {'pattern': r'^[a-z0-9-]{1,63}$'},
}

_attribute_map = {
Expand Down Expand Up @@ -274,14 +270,6 @@ def __init__(self, **kwargs) -> None:


class CloudError(Model):
"""CloudError.
"""

_attribute_map = {
}


class ErrorDetails(Model):
"""Error details.
Variables are only populated by the server, and will be ignored when
Expand All @@ -294,7 +282,7 @@ class ErrorDetails(Model):
:ivar target: The target of the particular error.
:vartype target: str
:param details: A list of additional details about the error.
:type details: list[~azure.mgmt.iotcentral.models.ErrorResponseBody]
:type details: list[~azure.mgmt.iotcentral.models.CloudErrorBody]
"""

_validation = {
Expand All @@ -307,30 +295,30 @@ class ErrorDetails(Model):
'code': {'key': 'error.code', 'type': 'str'},
'message': {'key': 'error.message', 'type': 'str'},
'target': {'key': 'error.target', 'type': 'str'},
'details': {'key': 'error.details', 'type': '[ErrorResponseBody]'},
'details': {'key': 'error.details', 'type': '[CloudErrorBody]'},
}

def __init__(self, *, details=None, **kwargs) -> None:
super(ErrorDetails, self).__init__(**kwargs)
super(CloudError, self).__init__(**kwargs)
self.code = None
self.message = None
self.target = None
self.details = details


class ErrorDetailsException(HttpOperationError):
"""Server responsed with exception of type: 'ErrorDetails'.
class CloudErrorException(HttpOperationError):
"""Server responsed with exception of type: 'CloudError'.
:param deserialize: A deserializer
:param response: Server response to be deserialized.
"""

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

super(ErrorDetailsException, self).__init__(deserialize, response, 'ErrorDetails', *args)
super(CloudErrorException, self).__init__(deserialize, response, 'CloudError', *args)


class ErrorResponseBody(Model):
class CloudErrorBody(Model):
"""Details of error response.
Variables are only populated by the server, and will be ignored when
Expand All @@ -343,7 +331,7 @@ class ErrorResponseBody(Model):
:ivar target: The target of the particular error.
:vartype target: str
:param details: A list of additional details about the error.
:type details: list[~azure.mgmt.iotcentral.models.ErrorResponseBody]
:type details: list[~azure.mgmt.iotcentral.models.CloudErrorBody]
"""

_validation = {
Expand All @@ -356,11 +344,11 @@ class ErrorResponseBody(Model):
'code': {'key': 'code', 'type': 'str'},
'message': {'key': 'message', 'type': 'str'},
'target': {'key': 'target', 'type': 'str'},
'details': {'key': 'details', 'type': '[ErrorResponseBody]'},
'details': {'key': 'details', 'type': '[CloudErrorBody]'},
}

def __init__(self, *, details=None, **kwargs) -> None:
super(ErrorResponseBody, self).__init__(**kwargs)
super(CloudErrorBody, self).__init__(**kwargs)
self.code = None
self.message = None
self.target = None
Expand Down Expand Up @@ -447,7 +435,7 @@ class OperationInputs(Model):
"""

_validation = {
'name': {'required': True, 'pattern': r'^[a-z0-9-]{1,63}$'},
'name': {'required': True},
}

_attribute_map = {
Expand Down
Loading

0 comments on commit d5fff26

Please sign in to comment.