diff --git a/azure-mgmt-iotcentral/MANIFEST.in b/azure-mgmt-iotcentral/MANIFEST.in index 6ceb27f7a96e..e4884efef41b 100644 --- a/azure-mgmt-iotcentral/MANIFEST.in +++ b/azure-mgmt-iotcentral/MANIFEST.in @@ -1,3 +1,4 @@ +recursive-include tests *.py *.yaml include *.rst include azure/__init__.py include azure/mgmt/__init__.py diff --git a/azure-mgmt-iotcentral/README.rst b/azure-mgmt-iotcentral/README.rst index d6799d8edf11..0df1920b383e 100644 --- a/azure-mgmt-iotcentral/README.rst +++ b/azure-mgmt-iotcentral/README.rst @@ -14,25 +14,6 @@ For the older Azure Service Management (ASM) libraries, see For a more complete set of Azure libraries, see the `azure `__ bundle package. -Compatibility -============= - -**IMPORTANT**: If you have an earlier version of the azure package -(version < 1.0), you should uninstall it before installing this package. - -You can check the version using pip: - -.. code:: shell - - pip freeze - -If you see azure==0.11.0 (or any version below 1.0), uninstall it first: - -.. code:: shell - - pip uninstall azure - - Usage ===== diff --git a/azure-mgmt-iotcentral/azure/mgmt/iotcentral/models/__init__.py b/azure-mgmt-iotcentral/azure/mgmt/iotcentral/models/__init__.py index 2819b4e949e1..33c557ff66d4 100644 --- a/azure-mgmt-iotcentral/azure/mgmt/iotcentral/models/__init__.py +++ b/azure-mgmt-iotcentral/azure/mgmt/iotcentral/models/__init__.py @@ -20,6 +20,7 @@ from .operation_py3 import Operation from .operation_inputs_py3 import OperationInputs from .app_availability_info_py3 import AppAvailabilityInfo + from .app_template_py3 import AppTemplate except (SyntaxError, ImportError): from .app_sku_info import AppSkuInfo from .app import App @@ -31,7 +32,9 @@ from .operation import Operation from .operation_inputs import OperationInputs from .app_availability_info import AppAvailabilityInfo + from .app_template import AppTemplate from .app_paged import AppPaged +from .app_template_paged import AppTemplatePaged from .operation_paged import OperationPaged from .iot_central_client_enums import ( AppSku, @@ -48,7 +51,9 @@ 'Operation', 'OperationInputs', 'AppAvailabilityInfo', + 'AppTemplate', 'AppPaged', + 'AppTemplatePaged', 'OperationPaged', 'AppSku', ] diff --git a/azure-mgmt-iotcentral/azure/mgmt/iotcentral/models/app_template.py b/azure-mgmt-iotcentral/azure/mgmt/iotcentral/models/app_template.py new file mode 100644 index 000000000000..579798560d84 --- /dev/null +++ b/azure-mgmt-iotcentral/azure/mgmt/iotcentral/models/app_template.py @@ -0,0 +1,60 @@ +# 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 AppTemplate(Model): + """IoT Central Application Template. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar manifest_id: The ID of the template. + :vartype manifest_id: str + :ivar manifest_version: The version of the template. + :vartype manifest_version: str + :ivar app_template_name: The name of the template. + :vartype app_template_name: str + :ivar title: The title of the template. + :vartype title: str + :ivar order: The order of the template in the templates list. + :vartype order: float + :ivar description: The description of the template. + :vartype description: str + """ + + _validation = { + 'manifest_id': {'readonly': True}, + 'manifest_version': {'readonly': True}, + 'app_template_name': {'readonly': True}, + 'title': {'readonly': True}, + 'order': {'readonly': True}, + 'description': {'readonly': True}, + } + + _attribute_map = { + 'manifest_id': {'key': 'manifestId', 'type': 'str'}, + 'manifest_version': {'key': 'manifestVersion', 'type': 'str'}, + 'app_template_name': {'key': 'appTemplateName', 'type': 'str'}, + 'title': {'key': 'title', 'type': 'str'}, + 'order': {'key': 'order', 'type': 'float'}, + 'description': {'key': 'description', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(AppTemplate, self).__init__(**kwargs) + self.manifest_id = None + self.manifest_version = None + self.app_template_name = None + self.title = None + self.order = None + self.description = None diff --git a/azure-mgmt-iotcentral/azure/mgmt/iotcentral/models/app_template_paged.py b/azure-mgmt-iotcentral/azure/mgmt/iotcentral/models/app_template_paged.py new file mode 100644 index 000000000000..5f0c936d66e9 --- /dev/null +++ b/azure-mgmt-iotcentral/azure/mgmt/iotcentral/models/app_template_paged.py @@ -0,0 +1,27 @@ +# 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.paging import Paged + + +class AppTemplatePaged(Paged): + """ + A paging container for iterating over a list of :class:`AppTemplate ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[AppTemplate]'} + } + + def __init__(self, *args, **kwargs): + + super(AppTemplatePaged, self).__init__(*args, **kwargs) diff --git a/azure-mgmt-iotcentral/azure/mgmt/iotcentral/models/app_template_py3.py b/azure-mgmt-iotcentral/azure/mgmt/iotcentral/models/app_template_py3.py new file mode 100644 index 000000000000..a97dea4e2845 --- /dev/null +++ b/azure-mgmt-iotcentral/azure/mgmt/iotcentral/models/app_template_py3.py @@ -0,0 +1,60 @@ +# 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 AppTemplate(Model): + """IoT Central Application Template. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar manifest_id: The ID of the template. + :vartype manifest_id: str + :ivar manifest_version: The version of the template. + :vartype manifest_version: str + :ivar app_template_name: The name of the template. + :vartype app_template_name: str + :ivar title: The title of the template. + :vartype title: str + :ivar order: The order of the template in the templates list. + :vartype order: float + :ivar description: The description of the template. + :vartype description: str + """ + + _validation = { + 'manifest_id': {'readonly': True}, + 'manifest_version': {'readonly': True}, + 'app_template_name': {'readonly': True}, + 'title': {'readonly': True}, + 'order': {'readonly': True}, + 'description': {'readonly': True}, + } + + _attribute_map = { + 'manifest_id': {'key': 'manifestId', 'type': 'str'}, + 'manifest_version': {'key': 'manifestVersion', 'type': 'str'}, + 'app_template_name': {'key': 'appTemplateName', 'type': 'str'}, + 'title': {'key': 'title', 'type': 'str'}, + 'order': {'key': 'order', 'type': 'float'}, + 'description': {'key': 'description', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(AppTemplate, self).__init__(**kwargs) + self.manifest_id = None + self.manifest_version = None + self.app_template_name = None + self.title = None + self.order = None + self.description = None diff --git a/azure-mgmt-iotcentral/azure/mgmt/iotcentral/operations/apps_operations.py b/azure-mgmt-iotcentral/azure/mgmt/iotcentral/operations/apps_operations.py index 72c8f74b58ad..ba79ae9edaae 100644 --- a/azure-mgmt-iotcentral/azure/mgmt/iotcentral/operations/apps_operations.py +++ b/azure-mgmt-iotcentral/azure/mgmt/iotcentral/operations/apps_operations.py @@ -651,3 +651,66 @@ def check_subdomain_availability( return deserialized check_subdomain_availability.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.IoTCentral/checkSubdomainAvailability'} + + def list_templates( + self, custom_headers=None, raw=False, **operation_config): + """Get all available application templates. + + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of AppTemplate + :rtype: + ~azure.mgmt.iotcentral.models.AppTemplatePaged[~azure.mgmt.iotcentral.models.AppTemplate] + :raises: + :class:`ErrorDetailsException` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list_templates.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorDetailsException(self._deserialize, response) + + return response + + # Deserialize response + deserialized = models.AppTemplatePaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.AppTemplatePaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list_templates.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.IoTCentral/appTemplates'} diff --git a/azure-mgmt-iotcentral/azure/mgmt/iotcentral/version.py b/azure-mgmt-iotcentral/azure/mgmt/iotcentral/version.py index a39916c162ce..c9a9b899085f 100644 --- a/azure-mgmt-iotcentral/azure/mgmt/iotcentral/version.py +++ b/azure-mgmt-iotcentral/azure/mgmt/iotcentral/version.py @@ -9,5 +9,5 @@ # regenerated. # -------------------------------------------------------------------------- -VERSION = "1.0.0" +VERSION = "2018-09-01" diff --git a/azure-mgmt-iotcentral/setup.py b/azure-mgmt-iotcentral/setup.py index 632e3aab0ccb..8dd132655809 100644 --- a/azure-mgmt-iotcentral/setup.py +++ b/azure-mgmt-iotcentral/setup.py @@ -53,6 +53,7 @@ version=version, description='Microsoft Azure {} Client Library for Python'.format(PACKAGE_PPRINT_NAME), long_description=readme + '\n\n' + history, + long_description_content_type='text/x-rst', license='MIT License', author='Microsoft Corporation', author_email='azpysdkhelp@microsoft.com',