Skip to content

Commit

Permalink
Generated from aafad88743ef7a4dcd7bbfa6afd4591ba4e327bb (#7278)
Browse files Browse the repository at this point in the history
new source
  • Loading branch information
AutorestCI authored and Zim Kalinowski committed Sep 29, 2019
1 parent 50675b7 commit d74a450
Show file tree
Hide file tree
Showing 10 changed files with 154 additions and 33 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ def __init__(
super(IotHubClient, self).__init__(self.config.credentials, self.config)

client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)}
self.api_version = '2019-03-22'
self.api_version = '2019-07-01-preview'
self._serialize = Serializer(client_models)
self._deserialize = Deserializer(client_models)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
from ._models_py3 import CertificateWithNonceDescription
from ._models_py3 import CloudToDeviceProperties
from ._models_py3 import EndpointHealthData
from ._models_py3 import EnrichmentProperties
from ._models_py3 import ErrorDetails, ErrorDetailsException
from ._models_py3 import EventHubConsumerGroupInfo
from ._models_py3 import EventHubProperties
Expand All @@ -32,6 +33,7 @@
from ._models_py3 import IotHubLocationDescription
from ._models_py3 import IotHubNameAvailabilityInfo
from ._models_py3 import IotHubProperties
from ._models_py3 import IotHubPropertiesDeviceStreams
from ._models_py3 import IotHubQuotaMetricInfo
from ._models_py3 import IotHubSkuDescription
from ._models_py3 import IotHubSkuInfo
Expand Down Expand Up @@ -78,6 +80,7 @@
from ._models import CertificateWithNonceDescription
from ._models import CloudToDeviceProperties
from ._models import EndpointHealthData
from ._models import EnrichmentProperties
from ._models import ErrorDetails, ErrorDetailsException
from ._models import EventHubConsumerGroupInfo
from ._models import EventHubProperties
Expand All @@ -91,6 +94,7 @@
from ._models import IotHubLocationDescription
from ._models import IotHubNameAvailabilityInfo
from ._models import IotHubProperties
from ._models import IotHubPropertiesDeviceStreams
from ._models import IotHubQuotaMetricInfo
from ._models import IotHubSkuDescription
from ._models import IotHubSkuInfo
Expand Down Expand Up @@ -162,6 +166,7 @@
'CertificateWithNonceDescription',
'CloudToDeviceProperties',
'EndpointHealthData',
'EnrichmentProperties',
'ErrorDetails', 'ErrorDetailsException',
'EventHubConsumerGroupInfo',
'EventHubProperties',
Expand All @@ -175,6 +180,7 @@
'IotHubLocationDescription',
'IotHubNameAvailabilityInfo',
'IotHubProperties',
'IotHubPropertiesDeviceStreams',
'IotHubQuotaMetricInfo',
'IotHubSkuDescription',
'IotHubSkuInfo',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ class RoutingSource(str, Enum):
twin_change_events = "TwinChangeEvents"
device_lifecycle_events = "DeviceLifecycleEvents"
device_job_lifecycle_events = "DeviceJobLifecycleEvents"
digital_twin_change_events = "DigitalTwinChangeEvents"


class Capabilities(str, Enum):
Expand Down
72 changes: 65 additions & 7 deletions sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/models/_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -330,6 +330,40 @@ def __init__(self, **kwargs):
self.health_status = kwargs.get('health_status', None)


class EnrichmentProperties(Model):
"""The properties of an enrichment that your IoT hub applies to messages
delivered to endpoints.
All required parameters must be populated in order to send to Azure.
:param key: Required. The key or name for the enrichment property.
:type key: str
:param value: Required. The value for the enrichment property.
:type value: str
:param endpoint_names: Required. The list of endpoints for which the
enrichment is applied to the message.
:type endpoint_names: list[str]
"""

_validation = {
'key': {'required': True},
'value': {'required': True},
'endpoint_names': {'required': True, 'min_items': 1},
}

_attribute_map = {
'key': {'key': 'key', 'type': 'str'},
'value': {'key': 'value', 'type': 'str'},
'endpoint_names': {'key': 'endpointNames', 'type': '[str]'},
}

def __init__(self, **kwargs):
super(EnrichmentProperties, self).__init__(**kwargs)
self.key = kwargs.get('key', None)
self.value = kwargs.get('value', None)
self.endpoint_names = kwargs.get('endpoint_names', None)


class ErrorDetails(Model):
"""Error details.
Expand Down Expand Up @@ -777,12 +811,9 @@ class IotHubLocationDescription(Model):
"""Public representation of one of the locations where a resource is
provisioned.
:param location: The name of the Azure region
:param location: Azure Geo Regions
:type location: str
:param role: The role of the region, can be either primary or secondary.
The primary region is where the IoT hub is currently provisioned. The
secondary region is the Azure disaster recovery (DR) paired region and
also the region where the IoT hub can failover to. Possible values
:param role: Specific Role assigned to this location. Possible values
include: 'primary', 'secondary'
:type role: str or ~azure.mgmt.iothub.models.IotHubReplicaRoleType
"""
Expand Down Expand Up @@ -878,6 +909,9 @@ class IotHubProperties(Model):
:type cloud_to_device: ~azure.mgmt.iothub.models.CloudToDeviceProperties
:param comments: IoT hub comments.
:type comments: str
:param device_streams: The device streams properties of iothub.
:type device_streams:
~azure.mgmt.iothub.models.IotHubPropertiesDeviceStreams
:param features: The capabilities and features enabled for the IoT hub.
Possible values include: 'None', 'DeviceManagement'
:type features: str or ~azure.mgmt.iothub.models.Capabilities
Expand Down Expand Up @@ -906,6 +940,7 @@ class IotHubProperties(Model):
'enable_file_upload_notifications': {'key': 'enableFileUploadNotifications', 'type': 'bool'},
'cloud_to_device': {'key': 'cloudToDevice', 'type': 'CloudToDeviceProperties'},
'comments': {'key': 'comments', 'type': 'str'},
'device_streams': {'key': 'deviceStreams', 'type': 'IotHubPropertiesDeviceStreams'},
'features': {'key': 'features', 'type': 'str'},
'locations': {'key': 'locations', 'type': '[IotHubLocationDescription]'},
}
Expand All @@ -924,10 +959,27 @@ def __init__(self, **kwargs):
self.enable_file_upload_notifications = kwargs.get('enable_file_upload_notifications', None)
self.cloud_to_device = kwargs.get('cloud_to_device', None)
self.comments = kwargs.get('comments', None)
self.device_streams = kwargs.get('device_streams', None)
self.features = kwargs.get('features', None)
self.locations = None


class IotHubPropertiesDeviceStreams(Model):
"""The device streams properties of iothub.
:param streaming_endpoints: List of Device Streams Endpoints.
:type streaming_endpoints: list[str]
"""

_attribute_map = {
'streaming_endpoints': {'key': 'streamingEndpoints', 'type': '[str]'},
}

def __init__(self, **kwargs):
super(IotHubPropertiesDeviceStreams, self).__init__(**kwargs)
self.streaming_endpoints = kwargs.get('streaming_endpoints', None)


class IotHubQuotaMetricInfo(Model):
"""Quota metrics properties.
Expand Down Expand Up @@ -1401,7 +1453,7 @@ class RouteProperties(Model):
:param source: Required. The source that the routing rule is to be applied
to, such as DeviceMessages. Possible values include: 'Invalid',
'DeviceMessages', 'TwinChangeEvents', 'DeviceLifecycleEvents',
'DeviceJobLifecycleEvents'
'DeviceJobLifecycleEvents', 'DigitalTwinChangeEvents'
:type source: str or ~azure.mgmt.iothub.models.RoutingSource
:param condition: The condition that is evaluated to apply the routing
rule. If no condition is provided, it evaluates to true by default. For
Expand Down Expand Up @@ -1563,19 +1615,25 @@ class RoutingProperties(Model):
set, the messages which do not meet any of the conditions specified in the
'routes' section get routed to the built-in eventhub endpoint.
:type fallback_route: ~azure.mgmt.iothub.models.FallbackRouteProperties
:param enrichments: The list of user-provided enrichments that the IoT hub
applies to messages to be delivered to built-in and custom endpoints. See:
https://aka.ms/iotmsgenrich
:type enrichments: list[~azure.mgmt.iothub.models.EnrichmentProperties]
"""

_attribute_map = {
'endpoints': {'key': 'endpoints', 'type': 'RoutingEndpoints'},
'routes': {'key': 'routes', 'type': '[RouteProperties]'},
'fallback_route': {'key': 'fallbackRoute', 'type': 'FallbackRouteProperties'},
'enrichments': {'key': 'enrichments', 'type': '[EnrichmentProperties]'},
}

def __init__(self, **kwargs):
super(RoutingProperties, self).__init__(**kwargs)
self.endpoints = kwargs.get('endpoints', None)
self.routes = kwargs.get('routes', None)
self.fallback_route = kwargs.get('fallback_route', None)
self.enrichments = kwargs.get('enrichments', None)


class RoutingServiceBusQueueEndpointProperties(Model):
Expand Down Expand Up @@ -1880,7 +1938,7 @@ class TestAllRoutesInput(Model):
:param routing_source: Routing source. Possible values include: 'Invalid',
'DeviceMessages', 'TwinChangeEvents', 'DeviceLifecycleEvents',
'DeviceJobLifecycleEvents'
'DeviceJobLifecycleEvents', 'DigitalTwinChangeEvents'
:type routing_source: str or ~azure.mgmt.iothub.models.RoutingSource
:param message: Routing message
:type message: ~azure.mgmt.iothub.models.RoutingMessage
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -330,6 +330,40 @@ def __init__(self, *, endpoint_id: str=None, health_status=None, **kwargs) -> No
self.health_status = health_status


class EnrichmentProperties(Model):
"""The properties of an enrichment that your IoT hub applies to messages
delivered to endpoints.
All required parameters must be populated in order to send to Azure.
:param key: Required. The key or name for the enrichment property.
:type key: str
:param value: Required. The value for the enrichment property.
:type value: str
:param endpoint_names: Required. The list of endpoints for which the
enrichment is applied to the message.
:type endpoint_names: list[str]
"""

_validation = {
'key': {'required': True},
'value': {'required': True},
'endpoint_names': {'required': True, 'min_items': 1},
}

_attribute_map = {
'key': {'key': 'key', 'type': 'str'},
'value': {'key': 'value', 'type': 'str'},
'endpoint_names': {'key': 'endpointNames', 'type': '[str]'},
}

def __init__(self, *, key: str, value: str, endpoint_names, **kwargs) -> None:
super(EnrichmentProperties, self).__init__(**kwargs)
self.key = key
self.value = value
self.endpoint_names = endpoint_names


class ErrorDetails(Model):
"""Error details.
Expand Down Expand Up @@ -777,12 +811,9 @@ class IotHubLocationDescription(Model):
"""Public representation of one of the locations where a resource is
provisioned.
:param location: The name of the Azure region
:param location: Azure Geo Regions
:type location: str
:param role: The role of the region, can be either primary or secondary.
The primary region is where the IoT hub is currently provisioned. The
secondary region is the Azure disaster recovery (DR) paired region and
also the region where the IoT hub can failover to. Possible values
:param role: Specific Role assigned to this location. Possible values
include: 'primary', 'secondary'
:type role: str or ~azure.mgmt.iothub.models.IotHubReplicaRoleType
"""
Expand Down Expand Up @@ -878,6 +909,9 @@ class IotHubProperties(Model):
:type cloud_to_device: ~azure.mgmt.iothub.models.CloudToDeviceProperties
:param comments: IoT hub comments.
:type comments: str
:param device_streams: The device streams properties of iothub.
:type device_streams:
~azure.mgmt.iothub.models.IotHubPropertiesDeviceStreams
:param features: The capabilities and features enabled for the IoT hub.
Possible values include: 'None', 'DeviceManagement'
:type features: str or ~azure.mgmt.iothub.models.Capabilities
Expand Down Expand Up @@ -906,11 +940,12 @@ class IotHubProperties(Model):
'enable_file_upload_notifications': {'key': 'enableFileUploadNotifications', 'type': 'bool'},
'cloud_to_device': {'key': 'cloudToDevice', 'type': 'CloudToDeviceProperties'},
'comments': {'key': 'comments', 'type': 'str'},
'device_streams': {'key': 'deviceStreams', 'type': 'IotHubPropertiesDeviceStreams'},
'features': {'key': 'features', 'type': 'str'},
'locations': {'key': 'locations', 'type': '[IotHubLocationDescription]'},
}

def __init__(self, *, authorization_policies=None, ip_filter_rules=None, event_hub_endpoints=None, routing=None, storage_endpoints=None, messaging_endpoints=None, enable_file_upload_notifications: bool=None, cloud_to_device=None, comments: str=None, features=None, **kwargs) -> None:
def __init__(self, *, authorization_policies=None, ip_filter_rules=None, event_hub_endpoints=None, routing=None, storage_endpoints=None, messaging_endpoints=None, enable_file_upload_notifications: bool=None, cloud_to_device=None, comments: str=None, device_streams=None, features=None, **kwargs) -> None:
super(IotHubProperties, self).__init__(**kwargs)
self.authorization_policies = authorization_policies
self.ip_filter_rules = ip_filter_rules
Expand All @@ -924,10 +959,27 @@ def __init__(self, *, authorization_policies=None, ip_filter_rules=None, event_h
self.enable_file_upload_notifications = enable_file_upload_notifications
self.cloud_to_device = cloud_to_device
self.comments = comments
self.device_streams = device_streams
self.features = features
self.locations = None


class IotHubPropertiesDeviceStreams(Model):
"""The device streams properties of iothub.
:param streaming_endpoints: List of Device Streams Endpoints.
:type streaming_endpoints: list[str]
"""

_attribute_map = {
'streaming_endpoints': {'key': 'streamingEndpoints', 'type': '[str]'},
}

def __init__(self, *, streaming_endpoints=None, **kwargs) -> None:
super(IotHubPropertiesDeviceStreams, self).__init__(**kwargs)
self.streaming_endpoints = streaming_endpoints


class IotHubQuotaMetricInfo(Model):
"""Quota metrics properties.
Expand Down Expand Up @@ -1401,7 +1453,7 @@ class RouteProperties(Model):
:param source: Required. The source that the routing rule is to be applied
to, such as DeviceMessages. Possible values include: 'Invalid',
'DeviceMessages', 'TwinChangeEvents', 'DeviceLifecycleEvents',
'DeviceJobLifecycleEvents'
'DeviceJobLifecycleEvents', 'DigitalTwinChangeEvents'
:type source: str or ~azure.mgmt.iothub.models.RoutingSource
:param condition: The condition that is evaluated to apply the routing
rule. If no condition is provided, it evaluates to true by default. For
Expand Down Expand Up @@ -1563,19 +1615,25 @@ class RoutingProperties(Model):
set, the messages which do not meet any of the conditions specified in the
'routes' section get routed to the built-in eventhub endpoint.
:type fallback_route: ~azure.mgmt.iothub.models.FallbackRouteProperties
:param enrichments: The list of user-provided enrichments that the IoT hub
applies to messages to be delivered to built-in and custom endpoints. See:
https://aka.ms/iotmsgenrich
:type enrichments: list[~azure.mgmt.iothub.models.EnrichmentProperties]
"""

_attribute_map = {
'endpoints': {'key': 'endpoints', 'type': 'RoutingEndpoints'},
'routes': {'key': 'routes', 'type': '[RouteProperties]'},
'fallback_route': {'key': 'fallbackRoute', 'type': 'FallbackRouteProperties'},
'enrichments': {'key': 'enrichments', 'type': '[EnrichmentProperties]'},
}

def __init__(self, *, endpoints=None, routes=None, fallback_route=None, **kwargs) -> None:
def __init__(self, *, endpoints=None, routes=None, fallback_route=None, enrichments=None, **kwargs) -> None:
super(RoutingProperties, self).__init__(**kwargs)
self.endpoints = endpoints
self.routes = routes
self.fallback_route = fallback_route
self.enrichments = enrichments


class RoutingServiceBusQueueEndpointProperties(Model):
Expand Down Expand Up @@ -1880,7 +1938,7 @@ class TestAllRoutesInput(Model):
:param routing_source: Routing source. Possible values include: 'Invalid',
'DeviceMessages', 'TwinChangeEvents', 'DeviceLifecycleEvents',
'DeviceJobLifecycleEvents'
'DeviceJobLifecycleEvents', 'DigitalTwinChangeEvents'
:type routing_source: str or ~azure.mgmt.iothub.models.RoutingSource
:param message: Routing message
:type message: ~azure.mgmt.iothub.models.RoutingMessage
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ class CertificatesOperations(object):
:param config: Configuration of service client.
:param serializer: An object model serializer.
:param deserializer: An object model deserializer.
:ivar api_version: The version of the API. Constant value: "2019-03-22".
:ivar api_version: The version of the API. Constant value: "2019-07-01-preview".
"""

models = models
Expand All @@ -34,7 +34,7 @@ def __init__(self, client, config, serializer, deserializer):
self._client = client
self._serialize = serializer
self._deserialize = deserializer
self.api_version = "2019-03-22"
self.api_version = "2019-07-01-preview"

self.config = config

Expand Down
Loading

0 comments on commit d74a450

Please sign in to comment.