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
6 changes: 6 additions & 0 deletions azure-mgmt-iothub/azure/mgmt/iothub/models/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,8 @@
from .user_subscription_quota_py3 import UserSubscriptionQuota
from .user_subscription_quota_list_result_py3 import UserSubscriptionQuotaListResult
from .routing_message_py3 import RoutingMessage
from .routing_twin_properties_py3 import RoutingTwinProperties
from .routing_twin_py3 import RoutingTwin
from .test_all_routes_input_py3 import TestAllRoutesInput
from .matched_route_py3 import MatchedRoute
from .test_all_routes_result_py3 import TestAllRoutesResult
Expand Down Expand Up @@ -110,6 +112,8 @@
from .user_subscription_quota import UserSubscriptionQuota
from .user_subscription_quota_list_result import UserSubscriptionQuotaListResult
from .routing_message import RoutingMessage
from .routing_twin_properties import RoutingTwinProperties
from .routing_twin import RoutingTwin
from .test_all_routes_input import TestAllRoutesInput
from .matched_route import MatchedRoute
from .test_all_routes_result import TestAllRoutesResult
Expand Down Expand Up @@ -191,6 +195,8 @@
'UserSubscriptionQuota',
'UserSubscriptionQuotaListResult',
'RoutingMessage',
'RoutingTwinProperties',
'RoutingTwin',
'TestAllRoutesInput',
'MatchedRoute',
'TestAllRoutesResult',
Expand Down
32 changes: 32 additions & 0 deletions azure-mgmt-iothub/azure/mgmt/iothub/models/routing_twin.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# 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 RoutingTwin(Model):
"""Twin reference input parameter. This is an optional parameter.

:param tags: Twin Tags
:type tags: object
:param properties:
:type properties: ~azure.mgmt.iothub.models.RoutingTwinProperties
"""

_attribute_map = {
'tags': {'key': 'tags', 'type': 'object'},
'properties': {'key': 'properties', 'type': 'RoutingTwinProperties'},
}

def __init__(self, **kwargs):
super(RoutingTwin, self).__init__(**kwargs)
self.tags = kwargs.get('tags', None)
self.properties = kwargs.get('properties', None)
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# 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 RoutingTwinProperties(Model):
"""RoutingTwinProperties.

:param desired_properties: Twin desired properties
:type desired_properties: object
:param reported_properties: Twin desired properties
:type reported_properties: object
"""

_attribute_map = {
'desired_properties': {'key': 'desiredProperties', 'type': 'object'},
'reported_properties': {'key': 'reportedProperties', 'type': 'object'},
}

def __init__(self, **kwargs):
super(RoutingTwinProperties, self).__init__(**kwargs)
self.desired_properties = kwargs.get('desired_properties', None)
self.reported_properties = kwargs.get('reported_properties', None)
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# 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 RoutingTwinProperties(Model):
"""RoutingTwinProperties.

:param desired_properties: Twin desired properties
:type desired_properties: object
:param reported_properties: Twin desired properties
:type reported_properties: object
"""

_attribute_map = {
'desired_properties': {'key': 'desiredProperties', 'type': 'object'},
'reported_properties': {'key': 'reportedProperties', 'type': 'object'},
}

def __init__(self, *, desired_properties=None, reported_properties=None, **kwargs) -> None:
super(RoutingTwinProperties, self).__init__(**kwargs)
self.desired_properties = desired_properties
self.reported_properties = reported_properties
32 changes: 32 additions & 0 deletions azure-mgmt-iothub/azure/mgmt/iothub/models/routing_twin_py3.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# 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 RoutingTwin(Model):
"""Twin reference input parameter. This is an optional parameter.

:param tags: Twin Tags
:type tags: object
:param properties:
:type properties: ~azure.mgmt.iothub.models.RoutingTwinProperties
"""

_attribute_map = {
'tags': {'key': 'tags', 'type': 'object'},
'properties': {'key': 'properties', 'type': 'RoutingTwinProperties'},
}

def __init__(self, *, tags=None, properties=None, **kwargs) -> None:
super(RoutingTwin, self).__init__(**kwargs)
self.tags = tags
self.properties = properties
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,18 @@ class TestAllRoutesInput(Model):
:type routing_source: str or ~azure.mgmt.iothub.models.RoutingSource
:param message: Routing message
:type message: ~azure.mgmt.iothub.models.RoutingMessage
:param twin: Routing Twin Reference
:type twin: ~azure.mgmt.iothub.models.RoutingTwin
"""

_attribute_map = {
'routing_source': {'key': 'routingSource', 'type': 'str'},
'message': {'key': 'message', 'type': 'RoutingMessage'},
'twin': {'key': 'twin', 'type': 'RoutingTwin'},
}

def __init__(self, **kwargs):
super(TestAllRoutesInput, self).__init__(**kwargs)
self.routing_source = kwargs.get('routing_source', None)
self.message = kwargs.get('message', None)
self.twin = kwargs.get('twin', None)
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,18 @@ class TestAllRoutesInput(Model):
:type routing_source: str or ~azure.mgmt.iothub.models.RoutingSource
:param message: Routing message
:type message: ~azure.mgmt.iothub.models.RoutingMessage
:param twin: Routing Twin Reference
:type twin: ~azure.mgmt.iothub.models.RoutingTwin
"""

_attribute_map = {
'routing_source': {'key': 'routingSource', 'type': 'str'},
'message': {'key': 'message', 'type': 'RoutingMessage'},
'twin': {'key': 'twin', 'type': 'RoutingTwin'},
}

def __init__(self, *, routing_source=None, message=None, **kwargs) -> None:
def __init__(self, *, routing_source=None, message=None, twin=None, **kwargs) -> None:
super(TestAllRoutesInput, self).__init__(**kwargs)
self.routing_source = routing_source
self.message = message
self.twin = twin
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ class TestRouteInput(Model):
:type message: ~azure.mgmt.iothub.models.RoutingMessage
:param route: Required. Route properties
:type route: ~azure.mgmt.iothub.models.RouteProperties
:param twin: Routing Twin Reference
:type twin: ~azure.mgmt.iothub.models.RoutingTwin
"""

_validation = {
Expand All @@ -30,9 +32,11 @@ class TestRouteInput(Model):
_attribute_map = {
'message': {'key': 'message', 'type': 'RoutingMessage'},
'route': {'key': 'route', 'type': 'RouteProperties'},
'twin': {'key': 'twin', 'type': 'RoutingTwin'},
}

def __init__(self, **kwargs):
super(TestRouteInput, self).__init__(**kwargs)
self.message = kwargs.get('message', None)
self.route = kwargs.get('route', None)
self.twin = kwargs.get('twin', None)
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ class TestRouteInput(Model):
:type message: ~azure.mgmt.iothub.models.RoutingMessage
:param route: Required. Route properties
:type route: ~azure.mgmt.iothub.models.RouteProperties
:param twin: Routing Twin Reference
:type twin: ~azure.mgmt.iothub.models.RoutingTwin
"""

_validation = {
Expand All @@ -30,9 +32,11 @@ class TestRouteInput(Model):
_attribute_map = {
'message': {'key': 'message', 'type': 'RoutingMessage'},
'route': {'key': 'route', 'type': 'RouteProperties'},
'twin': {'key': 'twin', 'type': 'RoutingTwin'},
}

def __init__(self, *, route, message=None, **kwargs) -> None:
def __init__(self, *, route, message=None, twin=None, **kwargs) -> None:
super(TestRouteInput, self).__init__(**kwargs)
self.message = message
self.route = route
self.twin = twin
Original file line number Diff line number Diff line change
Expand Up @@ -1327,21 +1327,17 @@ def check_name_availability(
check_name_availability.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Devices/checkNameAvailability'}

def test_all_routes(
self, iot_hub_name, resource_group_name, routing_source=None, message=None, custom_headers=None, raw=False, **operation_config):
self, input, iot_hub_name, resource_group_name, custom_headers=None, raw=False, **operation_config):
"""Test all routes.

Test all routes configured in this Iot Hub.

:param input: Input for testing all routes
:type input: ~azure.mgmt.iothub.models.TestAllRoutesInput
:param iot_hub_name: IotHub to be tested
:type iot_hub_name: str
:param resource_group_name: resource group which Iot Hub belongs to
:type resource_group_name: str
:param routing_source: Routing source. Possible values include:
'Invalid', 'DeviceMessages', 'TwinChangeEvents',
'DeviceLifecycleEvents', 'DeviceJobLifecycleEvents'
:type routing_source: str or ~azure.mgmt.iothub.models.RoutingSource
:param message: Routing message
:type message: ~azure.mgmt.iothub.models.RoutingMessage
:param dict custom_headers: headers that will be added to the request
:param bool raw: returns the direct response alongside the
deserialized response
Expand All @@ -1353,8 +1349,6 @@ def test_all_routes(
:raises:
:class:`ErrorDetailsException<azure.mgmt.iothub.models.ErrorDetailsException>`
"""
input = models.TestAllRoutesInput(routing_source=routing_source, message=message)

# Construct URL
url = self.test_all_routes.metadata['url']
path_format_arguments = {
Expand Down Expand Up @@ -1402,19 +1396,17 @@ def test_all_routes(
test_all_routes.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/IotHubs/{iotHubName}/routing/routes/$testall'}

def test_route(
self, iot_hub_name, resource_group_name, route, message=None, custom_headers=None, raw=False, **operation_config):
self, input, iot_hub_name, resource_group_name, custom_headers=None, raw=False, **operation_config):
"""Test the new route.

Test the new route for this Iot Hub.

:param input: Route that needs to be tested
:type input: ~azure.mgmt.iothub.models.TestRouteInput
:param iot_hub_name: IotHub to be tested
:type iot_hub_name: str
:param resource_group_name: resource group which Iot Hub belongs to
:type resource_group_name: str
:param route: Route properties
:type route: ~azure.mgmt.iothub.models.RouteProperties
:param message: Routing message
:type message: ~azure.mgmt.iothub.models.RoutingMessage
:param dict custom_headers: headers that will be added to the request
:param bool raw: returns the direct response alongside the
deserialized response
Expand All @@ -1426,8 +1418,6 @@ def test_route(
:raises:
:class:`ErrorDetailsException<azure.mgmt.iothub.models.ErrorDetailsException>`
"""
input = models.TestRouteInput(message=message, route=route)

# Construct URL
url = self.test_route.metadata['url']
path_format_arguments = {
Expand Down