Skip to content
Merged
Next Next commit
Generated from ddbb8ffb2dd676863a74cd5d44748fbd93a93025
Update models to align with expected responses
  • Loading branch information
AutorestCI committed Sep 27, 2018
commit 3313c8cda67be153ecd81fe9a9407173072eb4d0
20 changes: 12 additions & 8 deletions azure-mgmt-iotcentral/azure/mgmt/iotcentral/models/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,40 +14,44 @@
from .app_py3 import App
from .app_patch_py3 import AppPatch
from .resource_py3 import Resource
from .error_response_body_py3 import ErrorResponseBody
from .error_details_py3 import ErrorDetails, ErrorDetailsException
from .operation_display_py3 import OperationDisplay
from .operation_py3 import Operation
from .operation_inputs_py3 import OperationInputs
from .app_name_availability_info_py3 import AppNameAvailabilityInfo
from .name_availability_inputs_py3 import NameAvailabilityInputs
from .subdomain_availability_inputs_py3 import SubdomainAvailabilityInputs
from .app_availability_info_py3 import AppAvailabilityInfo
except (SyntaxError, ImportError):
from .app_sku_info import AppSkuInfo
from .app import App
from .app_patch import AppPatch
from .resource import Resource
from .error_response_body import ErrorResponseBody
from .error_details import ErrorDetails, ErrorDetailsException
from .operation_display import OperationDisplay
from .operation import Operation
from .operation_inputs import OperationInputs
from .app_name_availability_info import AppNameAvailabilityInfo
from .name_availability_inputs import NameAvailabilityInputs
from .subdomain_availability_inputs import SubdomainAvailabilityInputs
from .app_availability_info import AppAvailabilityInfo
from .app_paged import AppPaged
from .operation_paged import OperationPaged
from .iot_central_client_enums import (
AppSku,
AppNameUnavailabilityReason,
)

__all__ = [
'AppSkuInfo',
'App',
'AppPatch',
'Resource',
'ErrorResponseBody',
'ErrorDetails', 'ErrorDetailsException',
'OperationDisplay',
'Operation',
'OperationInputs',
'AppNameAvailabilityInfo',
'NameAvailabilityInputs',
'SubdomainAvailabilityInputs',
'AppAvailabilityInfo',
'AppPaged',
'OperationPaged',
'AppSku',
'AppNameUnavailabilityReason',
]
Original file line number Diff line number Diff line change
Expand Up @@ -12,37 +12,36 @@
from msrest.serialization import Model


class AppNameAvailabilityInfo(Model):
"""The properties indicating whether a given IoT Central application name is
available.
class AppAvailabilityInfo(Model):
"""The properties indicating whether a given IoT Central application name or
subdomain is available.

Variables are only populated by the server, and will be ignored when
sending a request.

:ivar name_available: The value which indicates whether the provided name
is available.
:vartype name_available: bool
:ivar reason: The reason for unavailability. Possible values include:
'Invalid', 'AlreadyExists'
:vartype reason: str or
~azure.mgmt.iotcentral.models.AppNameUnavailabilityReason
:param message: The detailed reason message.
:type message: str
:ivar reason: The reason for unavailability.
:vartype reason: str
:ivar message: The detailed reason message.
:vartype message: str
"""

_validation = {
'name_available': {'readonly': True},
'reason': {'readonly': True},
'message': {'readonly': True},
}

_attribute_map = {
'name_available': {'key': 'nameAvailable', 'type': 'bool'},
'reason': {'key': 'reason', 'type': 'AppNameUnavailabilityReason'},
'reason': {'key': 'reason', 'type': 'str'},
'message': {'key': 'message', 'type': 'str'},
}

def __init__(self, **kwargs):
super(AppNameAvailabilityInfo, self).__init__(**kwargs)
super(AppAvailabilityInfo, self).__init__(**kwargs)
self.name_available = None
self.reason = None
self.message = kwargs.get('message', None)
self.message = None
Original file line number Diff line number Diff line change
Expand Up @@ -12,37 +12,36 @@
from msrest.serialization import Model


class AppNameAvailabilityInfo(Model):
"""The properties indicating whether a given IoT Central application name is
available.
class AppAvailabilityInfo(Model):
"""The properties indicating whether a given IoT Central application name or
subdomain is available.

Variables are only populated by the server, and will be ignored when
sending a request.

:ivar name_available: The value which indicates whether the provided name
is available.
:vartype name_available: bool
:ivar reason: The reason for unavailability. Possible values include:
'Invalid', 'AlreadyExists'
:vartype reason: str or
~azure.mgmt.iotcentral.models.AppNameUnavailabilityReason
:param message: The detailed reason message.
:type message: str
:ivar reason: The reason for unavailability.
:vartype reason: str
:ivar message: The detailed reason message.
:vartype message: str
"""

_validation = {
'name_available': {'readonly': True},
'reason': {'readonly': True},
'message': {'readonly': True},
}

_attribute_map = {
'name_available': {'key': 'nameAvailable', 'type': 'bool'},
'reason': {'key': 'reason', 'type': 'AppNameUnavailabilityReason'},
'reason': {'key': 'reason', 'type': 'str'},
'message': {'key': 'message', 'type': 'str'},
}

def __init__(self, *, message: str=None, **kwargs) -> None:
super(AppNameAvailabilityInfo, self).__init__(**kwargs)
def __init__(self, **kwargs) -> None:
super(AppAvailabilityInfo, self).__init__(**kwargs)
self.name_available = None
self.reason = None
self.message = message
self.message = None
Original file line number Diff line number Diff line change
Expand Up @@ -16,34 +16,17 @@
class ErrorDetails(Model):
"""Error details.

Variables are only populated by the server, and will be ignored when
sending a request.

:ivar code: The error code.
:vartype code: str
:ivar message: The error message.
:vartype message: str
:ivar target: The target of the particular error.
:vartype target: str
:param error:
:type error: ~azure.mgmt.iotcentral.models.ErrorResponseBody
"""

_validation = {
'code': {'readonly': True},
'message': {'readonly': True},
'target': {'readonly': True},
}

_attribute_map = {
'code': {'key': 'code', 'type': 'str'},
'message': {'key': 'message', 'type': 'str'},
'target': {'key': 'target', 'type': 'str'},
'error': {'key': 'error', 'type': 'ErrorResponseBody'},
}

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


class ErrorDetailsException(HttpOperationError):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,34 +16,17 @@
class ErrorDetails(Model):
"""Error details.

Variables are only populated by the server, and will be ignored when
sending a request.

:ivar code: The error code.
:vartype code: str
:ivar message: The error message.
:vartype message: str
:ivar target: The target of the particular error.
:vartype target: str
:param error:
:type error: ~azure.mgmt.iotcentral.models.ErrorResponseBody
"""

_validation = {
'code': {'readonly': True},
'message': {'readonly': True},
'target': {'readonly': True},
}

_attribute_map = {
'code': {'key': 'code', 'type': 'str'},
'message': {'key': 'message', 'type': 'str'},
'target': {'key': 'target', 'type': 'str'},
'error': {'key': 'error', 'type': 'ErrorResponseBody'},
}

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


class ErrorDetailsException(HttpOperationError):
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
# 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):
"""Details of error response.

Variables are only populated by the server, and will be ignored when
sending a request.

:ivar code: The error code.
:vartype code: str
:ivar message: The error message.
:vartype message: str
: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]
"""

_validation = {
'code': {'readonly': True},
'message': {'readonly': True},
'target': {'readonly': True},
}

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

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

Variables are only populated by the server, and will be ignored when
sending a request.

:ivar code: The error code.
:vartype code: str
:ivar message: The error message.
:vartype message: str
: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]
"""

_validation = {
'code': {'readonly': True},
'message': {'readonly': True},
'target': {'readonly': True},
}

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

def __init__(self, *, details=None, **kwargs) -> None:
super(ErrorResponseBody, self).__init__(**kwargs)
self.code = None
self.message = None
self.target = None
self.details = details
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,3 @@ class AppSku(str, Enum):

f1 = "F1"
s1 = "S1"


class AppNameUnavailabilityReason(str, Enum):

invalid = "Invalid"
already_exists = "AlreadyExists"
Original file line number Diff line number Diff line change
Expand Up @@ -12,24 +12,29 @@
from msrest.serialization import Model


class OperationInputs(Model):
class NameAvailabilityInputs(Model):
"""Input values.

All required parameters must be populated in order to send to Azure.

:param name: Required. The name of the IoT Central application instance to
check.
:type name: str
:param type: The type of the IoT Central resource to query. Default value:
"IoTApps" .
:type type: str
"""

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

_attribute_map = {
'name': {'key': 'name', 'type': 'str'},
'type': {'key': 'type', 'type': 'str'},
}

def __init__(self, **kwargs):
super(OperationInputs, self).__init__(**kwargs)
super(NameAvailabilityInputs, self).__init__(**kwargs)
self.name = kwargs.get('name', None)
self.type = kwargs.get('type', "IoTApps")
Loading