Skip to content
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
1 change: 1 addition & 0 deletions azure-mgmt-iotcentral/MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
recursive-include tests *.py *.yaml
include *.rst
include azure/__init__.py
include azure/mgmt/__init__.py
Expand Down
19 changes: 0 additions & 19 deletions azure-mgmt-iotcentral/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -14,25 +14,6 @@ For the older Azure Service Management (ASM) libraries, see
For a more complete set of Azure libraries, see the `azure <https://pypi.python.org/pypi/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
=====

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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,
Expand All @@ -48,7 +51,9 @@
'Operation',
'OperationInputs',
'AppAvailabilityInfo',
'AppTemplate',
'AppPaged',
'AppTemplatePaged',
'OperationPaged',
'AppSku',
]
60 changes: 60 additions & 0 deletions azure-mgmt-iotcentral/azure/mgmt/iotcentral/models/app_template.py
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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 <azure.mgmt.iotcentral.models.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)
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
Expand Up @@ -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<msrest:optionsforoperations>`.
:return: An iterator like instance of AppTemplate
:rtype:
~azure.mgmt.iotcentral.models.AppTemplatePaged[~azure.mgmt.iotcentral.models.AppTemplate]
:raises:
:class:`ErrorDetailsException<azure.mgmt.iotcentral.models.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'}
2 changes: 1 addition & 1 deletion azure-mgmt-iotcentral/azure/mgmt/iotcentral/version.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,5 @@
# regenerated.
# --------------------------------------------------------------------------

VERSION = "1.0.0"
VERSION = "2018-09-01"

1 change: 1 addition & 0 deletions azure-mgmt-iotcentral/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down