# coding=utf-8
# pylint: disable=too-many-lines
# --------------------------------------------------------------------------
# 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.
# --------------------------------------------------------------------------

import datetime
import sys
from typing import Any, Dict, List, Optional, TYPE_CHECKING, Union

from ... import _serialization

if sys.version_info >= (3, 9):
    from collections.abc import MutableMapping
else:
    from typing import MutableMapping  # type: ignore  # pylint: disable=ungrouped-imports

if TYPE_CHECKING:
    # pylint: disable=unused-import,ungrouped-imports
    from .. import models as _models
JSON = MutableMapping[str, Any]  # pylint: disable=unsubscriptable-object


class CertificateBodyDescription(_serialization.Model):
    """The JSON-serialized X509 Certificate.

    :ivar certificate: base-64 representation of the X509 leaf certificate .cer file or just .pem
     file content.
    :vartype certificate: str
    """

    _attribute_map = {
        "certificate": {"key": "certificate", "type": "str"},
    }

    def __init__(self, *, certificate: Optional[str] = None, **kwargs: Any) -> None:
        """
        :keyword certificate: base-64 representation of the X509 leaf certificate .cer file or just
         .pem file content.
        :paramtype certificate: str
        """
        super().__init__(**kwargs)
        self.certificate = certificate


class CertificateDescription(_serialization.Model):
    """The X509 Certificate.

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

    :ivar properties: The description of an X509 CA Certificate.
    :vartype properties: ~azure.mgmt.iothub.v2019_11_04.models.CertificateProperties
    :ivar id: The resource identifier.
    :vartype id: str
    :ivar name: The name of the certificate.
    :vartype name: str
    :ivar etag: The entity tag.
    :vartype etag: str
    :ivar type: The resource type.
    :vartype type: str
    """

    _validation = {
        "id": {"readonly": True},
        "name": {"readonly": True},
        "etag": {"readonly": True},
        "type": {"readonly": True},
    }

    _attribute_map = {
        "properties": {"key": "properties", "type": "CertificateProperties"},
        "id": {"key": "id", "type": "str"},
        "name": {"key": "name", "type": "str"},
        "etag": {"key": "etag", "type": "str"},
        "type": {"key": "type", "type": "str"},
    }

    def __init__(self, *, properties: Optional["_models.CertificateProperties"] = None, **kwargs: Any) -> None:
        """
        :keyword properties: The description of an X509 CA Certificate.
        :paramtype properties: ~azure.mgmt.iothub.v2019_11_04.models.CertificateProperties
        """
        super().__init__(**kwargs)
        self.properties = properties
        self.id = None
        self.name = None
        self.etag = None
        self.type = None


class CertificateListDescription(_serialization.Model):
    """The JSON-serialized array of Certificate objects.

    :ivar value: The array of Certificate objects.
    :vartype value: list[~azure.mgmt.iothub.v2019_11_04.models.CertificateDescription]
    """

    _attribute_map = {
        "value": {"key": "value", "type": "[CertificateDescription]"},
    }

    def __init__(self, *, value: Optional[List["_models.CertificateDescription"]] = None, **kwargs: Any) -> None:
        """
        :keyword value: The array of Certificate objects.
        :paramtype value: list[~azure.mgmt.iothub.v2019_11_04.models.CertificateDescription]
        """
        super().__init__(**kwargs)
        self.value = value


class CertificateProperties(_serialization.Model):
    """The description of an X509 CA Certificate.

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

    :ivar subject: The certificate's subject name.
    :vartype subject: str
    :ivar expiry: The certificate's expiration date and time.
    :vartype expiry: ~datetime.datetime
    :ivar thumbprint: The certificate's thumbprint.
    :vartype thumbprint: str
    :ivar is_verified: Determines whether certificate has been verified.
    :vartype is_verified: bool
    :ivar created: The certificate's create date and time.
    :vartype created: ~datetime.datetime
    :ivar updated: The certificate's last update date and time.
    :vartype updated: ~datetime.datetime
    :ivar certificate: The certificate content.
    :vartype certificate: str
    """

    _validation = {
        "subject": {"readonly": True},
        "expiry": {"readonly": True},
        "thumbprint": {"readonly": True},
        "is_verified": {"readonly": True},
        "created": {"readonly": True},
        "updated": {"readonly": True},
    }

    _attribute_map = {
        "subject": {"key": "subject", "type": "str"},
        "expiry": {"key": "expiry", "type": "rfc-1123"},
        "thumbprint": {"key": "thumbprint", "type": "str"},
        "is_verified": {"key": "isVerified", "type": "bool"},
        "created": {"key": "created", "type": "rfc-1123"},
        "updated": {"key": "updated", "type": "rfc-1123"},
        "certificate": {"key": "certificate", "type": "str"},
    }

    def __init__(self, *, certificate: Optional[str] = None, **kwargs: Any) -> None:
        """
        :keyword certificate: The certificate content.
        :paramtype certificate: str
        """
        super().__init__(**kwargs)
        self.subject = None
        self.expiry = None
        self.thumbprint = None
        self.is_verified = None
        self.created = None
        self.updated = None
        self.certificate = certificate


class CertificatePropertiesWithNonce(_serialization.Model):
    """The description of an X509 CA Certificate including the challenge nonce issued for the
    Proof-Of-Possession flow.

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

    :ivar subject: The certificate's subject name.
    :vartype subject: str
    :ivar expiry: The certificate's expiration date and time.
    :vartype expiry: ~datetime.datetime
    :ivar thumbprint: The certificate's thumbprint.
    :vartype thumbprint: str
    :ivar is_verified: Determines whether certificate has been verified.
    :vartype is_verified: bool
    :ivar created: The certificate's create date and time.
    :vartype created: ~datetime.datetime
    :ivar updated: The certificate's last update date and time.
    :vartype updated: ~datetime.datetime
    :ivar verification_code: The certificate's verification code that will be used for proof of
     possession.
    :vartype verification_code: str
    :ivar certificate: The certificate content.
    :vartype certificate: str
    """

    _validation = {
        "subject": {"readonly": True},
        "expiry": {"readonly": True},
        "thumbprint": {"readonly": True},
        "is_verified": {"readonly": True},
        "created": {"readonly": True},
        "updated": {"readonly": True},
        "verification_code": {"readonly": True},
        "certificate": {"readonly": True},
    }

    _attribute_map = {
        "subject": {"key": "subject", "type": "str"},
        "expiry": {"key": "expiry", "type": "rfc-1123"},
        "thumbprint": {"key": "thumbprint", "type": "str"},
        "is_verified": {"key": "isVerified", "type": "bool"},
        "created": {"key": "created", "type": "rfc-1123"},
        "updated": {"key": "updated", "type": "rfc-1123"},
        "verification_code": {"key": "verificationCode", "type": "str"},
        "certificate": {"key": "certificate", "type": "str"},
    }

    def __init__(self, **kwargs: Any) -> None:
        """ """
        super().__init__(**kwargs)
        self.subject = None
        self.expiry = None
        self.thumbprint = None
        self.is_verified = None
        self.created = None
        self.updated = None
        self.verification_code = None
        self.certificate = None


class CertificateVerificationDescription(_serialization.Model):
    """The JSON-serialized leaf certificate.

    :ivar certificate: base-64 representation of X509 certificate .cer file or just .pem file
     content.
    :vartype certificate: str
    """

    _attribute_map = {
        "certificate": {"key": "certificate", "type": "str"},
    }

    def __init__(self, *, certificate: Optional[str] = None, **kwargs: Any) -> None:
        """
        :keyword certificate: base-64 representation of X509 certificate .cer file or just .pem file
         content.
        :paramtype certificate: str
        """
        super().__init__(**kwargs)
        self.certificate = certificate


class CertificateWithNonceDescription(_serialization.Model):
    """The X509 Certificate.

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

    :ivar properties: The description of an X509 CA Certificate including the challenge nonce
     issued for the Proof-Of-Possession flow.
    :vartype properties: ~azure.mgmt.iothub.v2019_11_04.models.CertificatePropertiesWithNonce
    :ivar id: The resource identifier.
    :vartype id: str
    :ivar name: The name of the certificate.
    :vartype name: str
    :ivar etag: The entity tag.
    :vartype etag: str
    :ivar type: The resource type.
    :vartype type: str
    """

    _validation = {
        "id": {"readonly": True},
        "name": {"readonly": True},
        "etag": {"readonly": True},
        "type": {"readonly": True},
    }

    _attribute_map = {
        "properties": {"key": "properties", "type": "CertificatePropertiesWithNonce"},
        "id": {"key": "id", "type": "str"},
        "name": {"key": "name", "type": "str"},
        "etag": {"key": "etag", "type": "str"},
        "type": {"key": "type", "type": "str"},
    }

    def __init__(self, *, properties: Optional["_models.CertificatePropertiesWithNonce"] = None, **kwargs: Any) -> None:
        """
        :keyword properties: The description of an X509 CA Certificate including the challenge nonce
         issued for the Proof-Of-Possession flow.
        :paramtype properties: ~azure.mgmt.iothub.v2019_11_04.models.CertificatePropertiesWithNonce
        """
        super().__init__(**kwargs)
        self.properties = properties
        self.id = None
        self.name = None
        self.etag = None
        self.type = None


class CloudToDeviceProperties(_serialization.Model):
    """The IoT hub cloud-to-device messaging properties.

    :ivar max_delivery_count: The max delivery count for cloud-to-device messages in the device
     queue. See:
     https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-messaging#cloud-to-device-messages.
    :vartype max_delivery_count: int
    :ivar default_ttl_as_iso8601: The default time to live for cloud-to-device messages in the
     device queue. See:
     https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-messaging#cloud-to-device-messages.
    :vartype default_ttl_as_iso8601: ~datetime.timedelta
    :ivar feedback: The properties of the feedback queue for cloud-to-device messages.
    :vartype feedback: ~azure.mgmt.iothub.v2019_11_04.models.FeedbackProperties
    """

    _validation = {
        "max_delivery_count": {"maximum": 100, "minimum": 1},
    }

    _attribute_map = {
        "max_delivery_count": {"key": "maxDeliveryCount", "type": "int"},
        "default_ttl_as_iso8601": {"key": "defaultTtlAsIso8601", "type": "duration"},
        "feedback": {"key": "feedback", "type": "FeedbackProperties"},
    }

    def __init__(
        self,
        *,
        max_delivery_count: Optional[int] = None,
        default_ttl_as_iso8601: Optional[datetime.timedelta] = None,
        feedback: Optional["_models.FeedbackProperties"] = None,
        **kwargs: Any
    ) -> None:
        """
        :keyword max_delivery_count: The max delivery count for cloud-to-device messages in the device
         queue. See:
         https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-messaging#cloud-to-device-messages.
        :paramtype max_delivery_count: int
        :keyword default_ttl_as_iso8601: The default time to live for cloud-to-device messages in the
         device queue. See:
         https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-messaging#cloud-to-device-messages.
        :paramtype default_ttl_as_iso8601: ~datetime.timedelta
        :keyword feedback: The properties of the feedback queue for cloud-to-device messages.
        :paramtype feedback: ~azure.mgmt.iothub.v2019_11_04.models.FeedbackProperties
        """
        super().__init__(**kwargs)
        self.max_delivery_count = max_delivery_count
        self.default_ttl_as_iso8601 = default_ttl_as_iso8601
        self.feedback = feedback


class EndpointHealthData(_serialization.Model):
    """The health data for an endpoint.

    :ivar endpoint_id: Id of the endpoint.
    :vartype endpoint_id: str
    :ivar health_status: Health statuses have following meanings. The 'healthy' status shows that
     the endpoint is accepting messages as expected. The 'unhealthy' status shows that the endpoint
     is not accepting messages as expected and IoT Hub is retrying to send data to this endpoint.
     The status of an unhealthy endpoint will be updated to healthy when IoT Hub has established an
     eventually consistent state of health. The 'dead' status shows that the endpoint is not
     accepting messages, after IoT Hub retried sending messages for the retrial period. See IoT Hub
     metrics to identify errors and monitor issues with endpoints. The 'unknown' status shows that
     the IoT Hub has not established a connection with the endpoint. No messages have been delivered
     to or rejected from this endpoint. Known values are: "unknown", "healthy", "unhealthy", and
     "dead".
    :vartype health_status: str or ~azure.mgmt.iothub.v2019_11_04.models.EndpointHealthStatus
    """

    _attribute_map = {
        "endpoint_id": {"key": "endpointId", "type": "str"},
        "health_status": {"key": "healthStatus", "type": "str"},
    }

    def __init__(
        self,
        *,
        endpoint_id: Optional[str] = None,
        health_status: Optional[Union[str, "_models.EndpointHealthStatus"]] = None,
        **kwargs: Any
    ) -> None:
        """
        :keyword endpoint_id: Id of the endpoint.
        :paramtype endpoint_id: str
        :keyword health_status: Health statuses have following meanings. The 'healthy' status shows
         that the endpoint is accepting messages as expected. The 'unhealthy' status shows that the
         endpoint is not accepting messages as expected and IoT Hub is retrying to send data to this
         endpoint. The status of an unhealthy endpoint will be updated to healthy when IoT Hub has
         established an eventually consistent state of health. The 'dead' status shows that the endpoint
         is not accepting messages, after IoT Hub retried sending messages for the retrial period. See
         IoT Hub metrics to identify errors and monitor issues with endpoints. The 'unknown' status
         shows that the IoT Hub has not established a connection with the endpoint. No messages have
         been delivered to or rejected from this endpoint. Known values are: "unknown", "healthy",
         "unhealthy", and "dead".
        :paramtype health_status: str or ~azure.mgmt.iothub.v2019_11_04.models.EndpointHealthStatus
        """
        super().__init__(**kwargs)
        self.endpoint_id = endpoint_id
        self.health_status = health_status


class EndpointHealthDataListResult(_serialization.Model):
    """The JSON-serialized array of EndpointHealthData objects with a next link.

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

    :ivar value: JSON-serialized array of Endpoint health data.
    :vartype value: list[~azure.mgmt.iothub.v2019_11_04.models.EndpointHealthData]
    :ivar next_link: Link to more results.
    :vartype next_link: str
    """

    _validation = {
        "next_link": {"readonly": True},
    }

    _attribute_map = {
        "value": {"key": "value", "type": "[EndpointHealthData]"},
        "next_link": {"key": "nextLink", "type": "str"},
    }

    def __init__(self, *, value: Optional[List["_models.EndpointHealthData"]] = None, **kwargs: Any) -> None:
        """
        :keyword value: JSON-serialized array of Endpoint health data.
        :paramtype value: list[~azure.mgmt.iothub.v2019_11_04.models.EndpointHealthData]
        """
        super().__init__(**kwargs)
        self.value = value
        self.next_link = None


class EnrichmentProperties(_serialization.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.

    :ivar key: The key or name for the enrichment property. Required.
    :vartype key: str
    :ivar value: The value for the enrichment property. Required.
    :vartype value: str
    :ivar endpoint_names: The list of endpoints for which the enrichment is applied to the message.
     Required.
    :vartype 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: List[str], **kwargs: Any) -> None:
        """
        :keyword key: The key or name for the enrichment property. Required.
        :paramtype key: str
        :keyword value: The value for the enrichment property. Required.
        :paramtype value: str
        :keyword endpoint_names: The list of endpoints for which the enrichment is applied to the
         message. Required.
        :paramtype endpoint_names: list[str]
        """
        super().__init__(**kwargs)
        self.key = key
        self.value = value
        self.endpoint_names = endpoint_names


class ErrorDetails(_serialization.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 http_status_code: The HTTP status code.
    :vartype http_status_code: str
    :ivar message: The error message.
    :vartype message: str
    :ivar details: The error details.
    :vartype details: str
    """

    _validation = {
        "code": {"readonly": True},
        "http_status_code": {"readonly": True},
        "message": {"readonly": True},
        "details": {"readonly": True},
    }

    _attribute_map = {
        "code": {"key": "code", "type": "str"},
        "http_status_code": {"key": "httpStatusCode", "type": "str"},
        "message": {"key": "message", "type": "str"},
        "details": {"key": "details", "type": "str"},
    }

    def __init__(self, **kwargs: Any) -> None:
        """ """
        super().__init__(**kwargs)
        self.code = None
        self.http_status_code = None
        self.message = None
        self.details = None


class EventHubConsumerGroupInfo(_serialization.Model):
    """The properties of the EventHubConsumerGroupInfo object.

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

    :ivar properties: The tags.
    :vartype properties: dict[str, str]
    :ivar id: The Event Hub-compatible consumer group identifier.
    :vartype id: str
    :ivar name: The Event Hub-compatible consumer group name.
    :vartype name: str
    :ivar type: the resource type.
    :vartype type: str
    :ivar etag: The etag.
    :vartype etag: str
    """

    _validation = {
        "id": {"readonly": True},
        "name": {"readonly": True},
        "type": {"readonly": True},
        "etag": {"readonly": True},
    }

    _attribute_map = {
        "properties": {"key": "properties", "type": "{str}"},
        "id": {"key": "id", "type": "str"},
        "name": {"key": "name", "type": "str"},
        "type": {"key": "type", "type": "str"},
        "etag": {"key": "etag", "type": "str"},
    }

    def __init__(self, *, properties: Optional[Dict[str, str]] = None, **kwargs: Any) -> None:
        """
        :keyword properties: The tags.
        :paramtype properties: dict[str, str]
        """
        super().__init__(**kwargs)
        self.properties = properties
        self.id = None
        self.name = None
        self.type = None
        self.etag = None


class EventHubConsumerGroupsListResult(_serialization.Model):
    """The JSON-serialized array of Event Hub-compatible consumer group names with a next link.

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

    :ivar value: List of consumer groups objects.
    :vartype value: list[~azure.mgmt.iothub.v2019_11_04.models.EventHubConsumerGroupInfo]
    :ivar next_link: The next link.
    :vartype next_link: str
    """

    _validation = {
        "next_link": {"readonly": True},
    }

    _attribute_map = {
        "value": {"key": "value", "type": "[EventHubConsumerGroupInfo]"},
        "next_link": {"key": "nextLink", "type": "str"},
    }

    def __init__(self, *, value: Optional[List["_models.EventHubConsumerGroupInfo"]] = None, **kwargs: Any) -> None:
        """
        :keyword value: List of consumer groups objects.
        :paramtype value: list[~azure.mgmt.iothub.v2019_11_04.models.EventHubConsumerGroupInfo]
        """
        super().__init__(**kwargs)
        self.value = value
        self.next_link = None


class EventHubProperties(_serialization.Model):
    """The properties of the provisioned Event Hub-compatible endpoint used by the IoT hub.

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

    :ivar retention_time_in_days: The retention time for device-to-cloud messages in days. See:
     https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-messaging#device-to-cloud-messages.
    :vartype retention_time_in_days: int
    :ivar partition_count: The number of partitions for receiving device-to-cloud messages in the
     Event Hub-compatible endpoint. See:
     https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-messaging#device-to-cloud-messages.
    :vartype partition_count: int
    :ivar partition_ids: The partition ids in the Event Hub-compatible endpoint.
    :vartype partition_ids: list[str]
    :ivar path: The Event Hub-compatible name.
    :vartype path: str
    :ivar endpoint: The Event Hub-compatible endpoint.
    :vartype endpoint: str
    """

    _validation = {
        "partition_ids": {"readonly": True},
        "path": {"readonly": True},
        "endpoint": {"readonly": True},
    }

    _attribute_map = {
        "retention_time_in_days": {"key": "retentionTimeInDays", "type": "int"},
        "partition_count": {"key": "partitionCount", "type": "int"},
        "partition_ids": {"key": "partitionIds", "type": "[str]"},
        "path": {"key": "path", "type": "str"},
        "endpoint": {"key": "endpoint", "type": "str"},
    }

    def __init__(
        self, *, retention_time_in_days: Optional[int] = None, partition_count: Optional[int] = None, **kwargs: Any
    ) -> None:
        """
        :keyword retention_time_in_days: The retention time for device-to-cloud messages in days. See:
         https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-messaging#device-to-cloud-messages.
        :paramtype retention_time_in_days: int
        :keyword partition_count: The number of partitions for receiving device-to-cloud messages in
         the Event Hub-compatible endpoint. See:
         https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-messaging#device-to-cloud-messages.
        :paramtype partition_count: int
        """
        super().__init__(**kwargs)
        self.retention_time_in_days = retention_time_in_days
        self.partition_count = partition_count
        self.partition_ids = None
        self.path = None
        self.endpoint = None


class ExportDevicesRequest(_serialization.Model):
    """Use to provide parameters when requesting an export of all devices in the IoT hub.

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

    :ivar export_blob_container_uri: The export blob container URI. Required.
    :vartype export_blob_container_uri: str
    :ivar exclude_keys: The value indicating whether keys should be excluded during export.
     Required.
    :vartype exclude_keys: bool
    """

    _validation = {
        "export_blob_container_uri": {"required": True},
        "exclude_keys": {"required": True},
    }

    _attribute_map = {
        "export_blob_container_uri": {"key": "exportBlobContainerUri", "type": "str"},
        "exclude_keys": {"key": "excludeKeys", "type": "bool"},
    }

    def __init__(self, *, export_blob_container_uri: str, exclude_keys: bool, **kwargs: Any) -> None:
        """
        :keyword export_blob_container_uri: The export blob container URI. Required.
        :paramtype export_blob_container_uri: str
        :keyword exclude_keys: The value indicating whether keys should be excluded during export.
         Required.
        :paramtype exclude_keys: bool
        """
        super().__init__(**kwargs)
        self.export_blob_container_uri = export_blob_container_uri
        self.exclude_keys = exclude_keys


class FailoverInput(_serialization.Model):
    """Use to provide failover region when requesting manual Failover for a hub.

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

    :ivar failover_region: Region the hub will be failed over to. Required.
    :vartype failover_region: str
    """

    _validation = {
        "failover_region": {"required": True},
    }

    _attribute_map = {
        "failover_region": {"key": "failoverRegion", "type": "str"},
    }

    def __init__(self, *, failover_region: str, **kwargs: Any) -> None:
        """
        :keyword failover_region: Region the hub will be failed over to. Required.
        :paramtype failover_region: str
        """
        super().__init__(**kwargs)
        self.failover_region = failover_region


class FallbackRouteProperties(_serialization.Model):
    """The properties of the fallback route. IoT Hub uses these properties when it routes messages to
    the fallback endpoint.

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

    :ivar name: The name of the route. The name can only include alphanumeric characters, periods,
     underscores, hyphens, has a maximum length of 64 characters, and must be unique.
    :vartype name: str
    :ivar source: The source to which the routing rule is to be applied to. For example,
     DeviceMessages. Required. Known values are: "Invalid", "DeviceMessages", "TwinChangeEvents",
     "DeviceLifecycleEvents", and "DeviceJobLifecycleEvents".
    :vartype source: str or ~azure.mgmt.iothub.v2019_11_04.models.RoutingSource
    :ivar condition: The condition which is evaluated in order to apply the fallback route. If the
     condition is not provided it will evaluate to true by default. For grammar, See:
     https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-query-language.
    :vartype condition: str
    :ivar endpoint_names: The list of endpoints to which the messages that satisfy the condition
     are routed to. Currently only 1 endpoint is allowed. Required.
    :vartype endpoint_names: list[str]
    :ivar is_enabled: Used to specify whether the fallback route is enabled. Required.
    :vartype is_enabled: bool
    """

    _validation = {
        "source": {"required": True},
        "endpoint_names": {"required": True, "max_items": 1, "min_items": 1},
        "is_enabled": {"required": True},
    }

    _attribute_map = {
        "name": {"key": "name", "type": "str"},
        "source": {"key": "source", "type": "str"},
        "condition": {"key": "condition", "type": "str"},
        "endpoint_names": {"key": "endpointNames", "type": "[str]"},
        "is_enabled": {"key": "isEnabled", "type": "bool"},
    }

    def __init__(
        self,
        *,
        source: Union[str, "_models.RoutingSource"],
        endpoint_names: List[str],
        is_enabled: bool,
        name: Optional[str] = None,
        condition: Optional[str] = None,
        **kwargs: Any
    ) -> None:
        """
        :keyword name: The name of the route. The name can only include alphanumeric characters,
         periods, underscores, hyphens, has a maximum length of 64 characters, and must be unique.
        :paramtype name: str
        :keyword source: The source to which the routing rule is to be applied to. For example,
         DeviceMessages. Required. Known values are: "Invalid", "DeviceMessages", "TwinChangeEvents",
         "DeviceLifecycleEvents", and "DeviceJobLifecycleEvents".
        :paramtype source: str or ~azure.mgmt.iothub.v2019_11_04.models.RoutingSource
        :keyword condition: The condition which is evaluated in order to apply the fallback route. If
         the condition is not provided it will evaluate to true by default. For grammar, See:
         https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-query-language.
        :paramtype condition: str
        :keyword endpoint_names: The list of endpoints to which the messages that satisfy the condition
         are routed to. Currently only 1 endpoint is allowed. Required.
        :paramtype endpoint_names: list[str]
        :keyword is_enabled: Used to specify whether the fallback route is enabled. Required.
        :paramtype is_enabled: bool
        """
        super().__init__(**kwargs)
        self.name = name
        self.source = source
        self.condition = condition
        self.endpoint_names = endpoint_names
        self.is_enabled = is_enabled


class FeedbackProperties(_serialization.Model):
    """The properties of the feedback queue for cloud-to-device messages.

    :ivar lock_duration_as_iso8601: The lock duration for the feedback queue. See:
     https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-messaging#cloud-to-device-messages.
    :vartype lock_duration_as_iso8601: ~datetime.timedelta
    :ivar ttl_as_iso8601: The period of time for which a message is available to consume before it
     is expired by the IoT hub. See:
     https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-messaging#cloud-to-device-messages.
    :vartype ttl_as_iso8601: ~datetime.timedelta
    :ivar max_delivery_count: The number of times the IoT hub attempts to deliver a message on the
     feedback queue. See:
     https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-messaging#cloud-to-device-messages.
    :vartype max_delivery_count: int
    """

    _validation = {
        "max_delivery_count": {"maximum": 100, "minimum": 1},
    }

    _attribute_map = {
        "lock_duration_as_iso8601": {"key": "lockDurationAsIso8601", "type": "duration"},
        "ttl_as_iso8601": {"key": "ttlAsIso8601", "type": "duration"},
        "max_delivery_count": {"key": "maxDeliveryCount", "type": "int"},
    }

    def __init__(
        self,
        *,
        lock_duration_as_iso8601: Optional[datetime.timedelta] = None,
        ttl_as_iso8601: Optional[datetime.timedelta] = None,
        max_delivery_count: Optional[int] = None,
        **kwargs: Any
    ) -> None:
        """
        :keyword lock_duration_as_iso8601: The lock duration for the feedback queue. See:
         https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-messaging#cloud-to-device-messages.
        :paramtype lock_duration_as_iso8601: ~datetime.timedelta
        :keyword ttl_as_iso8601: The period of time for which a message is available to consume before
         it is expired by the IoT hub. See:
         https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-messaging#cloud-to-device-messages.
        :paramtype ttl_as_iso8601: ~datetime.timedelta
        :keyword max_delivery_count: The number of times the IoT hub attempts to deliver a message on
         the feedback queue. See:
         https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-messaging#cloud-to-device-messages.
        :paramtype max_delivery_count: int
        """
        super().__init__(**kwargs)
        self.lock_duration_as_iso8601 = lock_duration_as_iso8601
        self.ttl_as_iso8601 = ttl_as_iso8601
        self.max_delivery_count = max_delivery_count


class ImportDevicesRequest(_serialization.Model):
    """Use to provide parameters when requesting an import of all devices in the hub.

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

    :ivar input_blob_container_uri: The input blob container URI. Required.
    :vartype input_blob_container_uri: str
    :ivar output_blob_container_uri: The output blob container URI. Required.
    :vartype output_blob_container_uri: str
    """

    _validation = {
        "input_blob_container_uri": {"required": True},
        "output_blob_container_uri": {"required": True},
    }

    _attribute_map = {
        "input_blob_container_uri": {"key": "inputBlobContainerUri", "type": "str"},
        "output_blob_container_uri": {"key": "outputBlobContainerUri", "type": "str"},
    }

    def __init__(self, *, input_blob_container_uri: str, output_blob_container_uri: str, **kwargs: Any) -> None:
        """
        :keyword input_blob_container_uri: The input blob container URI. Required.
        :paramtype input_blob_container_uri: str
        :keyword output_blob_container_uri: The output blob container URI. Required.
        :paramtype output_blob_container_uri: str
        """
        super().__init__(**kwargs)
        self.input_blob_container_uri = input_blob_container_uri
        self.output_blob_container_uri = output_blob_container_uri


class IotHubCapacity(_serialization.Model):
    """IoT Hub capacity information.

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

    :ivar minimum: The minimum number of units.
    :vartype minimum: int
    :ivar maximum: The maximum number of units.
    :vartype maximum: int
    :ivar default: The default number of units.
    :vartype default: int
    :ivar scale_type: The type of the scaling enabled. Known values are: "Automatic", "Manual", and
     "None".
    :vartype scale_type: str or ~azure.mgmt.iothub.v2019_11_04.models.IotHubScaleType
    """

    _validation = {
        "minimum": {"readonly": True, "maximum": 1, "minimum": 1},
        "maximum": {"readonly": True},
        "default": {"readonly": True},
        "scale_type": {"readonly": True},
    }

    _attribute_map = {
        "minimum": {"key": "minimum", "type": "int"},
        "maximum": {"key": "maximum", "type": "int"},
        "default": {"key": "default", "type": "int"},
        "scale_type": {"key": "scaleType", "type": "str"},
    }

    def __init__(self, **kwargs: Any) -> None:
        """ """
        super().__init__(**kwargs)
        self.minimum = None
        self.maximum = None
        self.default = None
        self.scale_type = None


class Resource(_serialization.Model):
    """The common properties of an Azure resource.

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

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

    :ivar id: The resource identifier.
    :vartype id: str
    :ivar name: The resource name.
    :vartype name: str
    :ivar type: The resource type.
    :vartype type: str
    :ivar location: The resource location. Required.
    :vartype location: str
    :ivar tags: The resource tags.
    :vartype tags: dict[str, str]
    """

    _validation = {
        "id": {"readonly": True},
        "name": {"readonly": True, "pattern": r"^(?![0-9]+$)(?!-)[a-zA-Z0-9-]{2,49}[a-zA-Z0-9]$"},
        "type": {"readonly": True},
        "location": {"required": True},
    }

    _attribute_map = {
        "id": {"key": "id", "type": "str"},
        "name": {"key": "name", "type": "str"},
        "type": {"key": "type", "type": "str"},
        "location": {"key": "location", "type": "str"},
        "tags": {"key": "tags", "type": "{str}"},
    }

    def __init__(self, *, location: str, tags: Optional[Dict[str, str]] = None, **kwargs: Any) -> None:
        """
        :keyword location: The resource location. Required.
        :paramtype location: str
        :keyword tags: The resource tags.
        :paramtype tags: dict[str, str]
        """
        super().__init__(**kwargs)
        self.id = None
        self.name = None
        self.type = None
        self.location = location
        self.tags = tags


class IotHubDescription(Resource):
    """The description of the IoT hub.

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

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

    :ivar id: The resource identifier.
    :vartype id: str
    :ivar name: The resource name.
    :vartype name: str
    :ivar type: The resource type.
    :vartype type: str
    :ivar location: The resource location. Required.
    :vartype location: str
    :ivar tags: The resource tags.
    :vartype tags: dict[str, str]
    :ivar etag: The Etag field is *not* required. If it is provided in the response body, it must
     also be provided as a header per the normal ETag convention.
    :vartype etag: str
    :ivar properties: IotHub properties.
    :vartype properties: ~azure.mgmt.iothub.v2019_11_04.models.IotHubProperties
    :ivar sku: IotHub SKU info. Required.
    :vartype sku: ~azure.mgmt.iothub.v2019_11_04.models.IotHubSkuInfo
    """

    _validation = {
        "id": {"readonly": True},
        "name": {"readonly": True, "pattern": r"^(?![0-9]+$)(?!-)[a-zA-Z0-9-]{2,49}[a-zA-Z0-9]$"},
        "type": {"readonly": True},
        "location": {"required": True},
        "sku": {"required": True},
    }

    _attribute_map = {
        "id": {"key": "id", "type": "str"},
        "name": {"key": "name", "type": "str"},
        "type": {"key": "type", "type": "str"},
        "location": {"key": "location", "type": "str"},
        "tags": {"key": "tags", "type": "{str}"},
        "etag": {"key": "etag", "type": "str"},
        "properties": {"key": "properties", "type": "IotHubProperties"},
        "sku": {"key": "sku", "type": "IotHubSkuInfo"},
    }

    def __init__(
        self,
        *,
        location: str,
        sku: "_models.IotHubSkuInfo",
        tags: Optional[Dict[str, str]] = None,
        etag: Optional[str] = None,
        properties: Optional["_models.IotHubProperties"] = None,
        **kwargs: Any
    ) -> None:
        """
        :keyword location: The resource location. Required.
        :paramtype location: str
        :keyword tags: The resource tags.
        :paramtype tags: dict[str, str]
        :keyword etag: The Etag field is *not* required. If it is provided in the response body, it
         must also be provided as a header per the normal ETag convention.
        :paramtype etag: str
        :keyword properties: IotHub properties.
        :paramtype properties: ~azure.mgmt.iothub.v2019_11_04.models.IotHubProperties
        :keyword sku: IotHub SKU info. Required.
        :paramtype sku: ~azure.mgmt.iothub.v2019_11_04.models.IotHubSkuInfo
        """
        super().__init__(location=location, tags=tags, **kwargs)
        self.etag = etag
        self.properties = properties
        self.sku = sku


class IotHubDescriptionListResult(_serialization.Model):
    """The JSON-serialized array of IotHubDescription objects with a next link.

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

    :ivar value: The array of IotHubDescription objects.
    :vartype value: list[~azure.mgmt.iothub.v2019_11_04.models.IotHubDescription]
    :ivar next_link: The next link.
    :vartype next_link: str
    """

    _validation = {
        "next_link": {"readonly": True},
    }

    _attribute_map = {
        "value": {"key": "value", "type": "[IotHubDescription]"},
        "next_link": {"key": "nextLink", "type": "str"},
    }

    def __init__(self, *, value: Optional[List["_models.IotHubDescription"]] = None, **kwargs: Any) -> None:
        """
        :keyword value: The array of IotHubDescription objects.
        :paramtype value: list[~azure.mgmt.iothub.v2019_11_04.models.IotHubDescription]
        """
        super().__init__(**kwargs)
        self.value = value
        self.next_link = None


class IotHubLocationDescription(_serialization.Model):
    """Public representation of one of the locations where a resource is provisioned.

    :ivar location: The name of the Azure region.
    :vartype location: str
    :ivar 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. Known values are:
     "primary" and "secondary".
    :vartype role: str or ~azure.mgmt.iothub.v2019_11_04.models.IotHubReplicaRoleType
    """

    _attribute_map = {
        "location": {"key": "location", "type": "str"},
        "role": {"key": "role", "type": "str"},
    }

    def __init__(
        self,
        *,
        location: Optional[str] = None,
        role: Optional[Union[str, "_models.IotHubReplicaRoleType"]] = None,
        **kwargs: Any
    ) -> None:
        """
        :keyword location: The name of the Azure region.
        :paramtype location: str
        :keyword 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. Known values
         are: "primary" and "secondary".
        :paramtype role: str or ~azure.mgmt.iothub.v2019_11_04.models.IotHubReplicaRoleType
        """
        super().__init__(**kwargs)
        self.location = location
        self.role = role


class IotHubNameAvailabilityInfo(_serialization.Model):
    """The properties indicating whether a given IoT hub name 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. Known values are: "Invalid" and "AlreadyExists".
    :vartype reason: str or ~azure.mgmt.iothub.v2019_11_04.models.IotHubNameUnavailabilityReason
    :ivar message: The detailed reason message.
    :vartype message: str
    """

    _validation = {
        "name_available": {"readonly": True},
        "reason": {"readonly": True},
    }

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

    def __init__(self, *, message: Optional[str] = None, **kwargs: Any) -> None:
        """
        :keyword message: The detailed reason message.
        :paramtype message: str
        """
        super().__init__(**kwargs)
        self.name_available = None
        self.reason = None
        self.message = message


class IotHubProperties(_serialization.Model):  # pylint: disable=too-many-instance-attributes
    """The properties of an IoT hub.

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

    :ivar authorization_policies: The shared access policies you can use to secure a connection to
     the IoT hub.
    :vartype authorization_policies:
     list[~azure.mgmt.iothub.v2019_11_04.models.SharedAccessSignatureAuthorizationRule]
    :ivar ip_filter_rules: The IP filter rules.
    :vartype ip_filter_rules: list[~azure.mgmt.iothub.v2019_11_04.models.IpFilterRule]
    :ivar provisioning_state: The provisioning state.
    :vartype provisioning_state: str
    :ivar state: The hub state.
    :vartype state: str
    :ivar host_name: The name of the host.
    :vartype host_name: str
    :ivar event_hub_endpoints: The Event Hub-compatible endpoint properties. The only possible keys
     to this dictionary is events. This key has to be present in the dictionary while making create
     or update calls for the IoT hub.
    :vartype event_hub_endpoints: dict[str,
     ~azure.mgmt.iothub.v2019_11_04.models.EventHubProperties]
    :ivar routing: The routing related properties of the IoT hub. See:
     https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-messaging.
    :vartype routing: ~azure.mgmt.iothub.v2019_11_04.models.RoutingProperties
    :ivar storage_endpoints: The list of Azure Storage endpoints where you can upload files.
     Currently you can configure only one Azure Storage account and that MUST have its key as
     $default. Specifying more than one storage account causes an error to be thrown. Not specifying
     a value for this property when the enableFileUploadNotifications property is set to True,
     causes an error to be thrown.
    :vartype storage_endpoints: dict[str,
     ~azure.mgmt.iothub.v2019_11_04.models.StorageEndpointProperties]
    :ivar messaging_endpoints: The messaging endpoint properties for the file upload notification
     queue.
    :vartype messaging_endpoints: dict[str,
     ~azure.mgmt.iothub.v2019_11_04.models.MessagingEndpointProperties]
    :ivar enable_file_upload_notifications: If True, file upload notifications are enabled.
    :vartype enable_file_upload_notifications: bool
    :ivar cloud_to_device: The IoT hub cloud-to-device messaging properties.
    :vartype cloud_to_device: ~azure.mgmt.iothub.v2019_11_04.models.CloudToDeviceProperties
    :ivar comments: IoT hub comments.
    :vartype comments: str
    :ivar features: The capabilities and features enabled for the IoT hub. Known values are: "None"
     and "DeviceManagement".
    :vartype features: str or ~azure.mgmt.iothub.v2019_11_04.models.Capabilities
    :ivar locations: Primary and secondary location for iot hub.
    :vartype locations: list[~azure.mgmt.iothub.v2019_11_04.models.IotHubLocationDescription]
    """

    _validation = {
        "provisioning_state": {"readonly": True},
        "state": {"readonly": True},
        "host_name": {"readonly": True},
        "locations": {"readonly": True},
    }

    _attribute_map = {
        "authorization_policies": {"key": "authorizationPolicies", "type": "[SharedAccessSignatureAuthorizationRule]"},
        "ip_filter_rules": {"key": "ipFilterRules", "type": "[IpFilterRule]"},
        "provisioning_state": {"key": "provisioningState", "type": "str"},
        "state": {"key": "state", "type": "str"},
        "host_name": {"key": "hostName", "type": "str"},
        "event_hub_endpoints": {"key": "eventHubEndpoints", "type": "{EventHubProperties}"},
        "routing": {"key": "routing", "type": "RoutingProperties"},
        "storage_endpoints": {"key": "storageEndpoints", "type": "{StorageEndpointProperties}"},
        "messaging_endpoints": {"key": "messagingEndpoints", "type": "{MessagingEndpointProperties}"},
        "enable_file_upload_notifications": {"key": "enableFileUploadNotifications", "type": "bool"},
        "cloud_to_device": {"key": "cloudToDevice", "type": "CloudToDeviceProperties"},
        "comments": {"key": "comments", "type": "str"},
        "features": {"key": "features", "type": "str"},
        "locations": {"key": "locations", "type": "[IotHubLocationDescription]"},
    }

    def __init__(
        self,
        *,
        authorization_policies: Optional[List["_models.SharedAccessSignatureAuthorizationRule"]] = None,
        ip_filter_rules: Optional[List["_models.IpFilterRule"]] = None,
        event_hub_endpoints: Optional[Dict[str, "_models.EventHubProperties"]] = None,
        routing: Optional["_models.RoutingProperties"] = None,
        storage_endpoints: Optional[Dict[str, "_models.StorageEndpointProperties"]] = None,
        messaging_endpoints: Optional[Dict[str, "_models.MessagingEndpointProperties"]] = None,
        enable_file_upload_notifications: Optional[bool] = None,
        cloud_to_device: Optional["_models.CloudToDeviceProperties"] = None,
        comments: Optional[str] = None,
        features: Optional[Union[str, "_models.Capabilities"]] = None,
        **kwargs: Any
    ) -> None:
        """
        :keyword authorization_policies: The shared access policies you can use to secure a connection
         to the IoT hub.
        :paramtype authorization_policies:
         list[~azure.mgmt.iothub.v2019_11_04.models.SharedAccessSignatureAuthorizationRule]
        :keyword ip_filter_rules: The IP filter rules.
        :paramtype ip_filter_rules: list[~azure.mgmt.iothub.v2019_11_04.models.IpFilterRule]
        :keyword event_hub_endpoints: The Event Hub-compatible endpoint properties. The only possible
         keys to this dictionary is events. This key has to be present in the dictionary while making
         create or update calls for the IoT hub.
        :paramtype event_hub_endpoints: dict[str,
         ~azure.mgmt.iothub.v2019_11_04.models.EventHubProperties]
        :keyword routing: The routing related properties of the IoT hub. See:
         https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-messaging.
        :paramtype routing: ~azure.mgmt.iothub.v2019_11_04.models.RoutingProperties
        :keyword storage_endpoints: The list of Azure Storage endpoints where you can upload files.
         Currently you can configure only one Azure Storage account and that MUST have its key as
         $default. Specifying more than one storage account causes an error to be thrown. Not specifying
         a value for this property when the enableFileUploadNotifications property is set to True,
         causes an error to be thrown.
        :paramtype storage_endpoints: dict[str,
         ~azure.mgmt.iothub.v2019_11_04.models.StorageEndpointProperties]
        :keyword messaging_endpoints: The messaging endpoint properties for the file upload
         notification queue.
        :paramtype messaging_endpoints: dict[str,
         ~azure.mgmt.iothub.v2019_11_04.models.MessagingEndpointProperties]
        :keyword enable_file_upload_notifications: If True, file upload notifications are enabled.
        :paramtype enable_file_upload_notifications: bool
        :keyword cloud_to_device: The IoT hub cloud-to-device messaging properties.
        :paramtype cloud_to_device: ~azure.mgmt.iothub.v2019_11_04.models.CloudToDeviceProperties
        :keyword comments: IoT hub comments.
        :paramtype comments: str
        :keyword features: The capabilities and features enabled for the IoT hub. Known values are:
         "None" and "DeviceManagement".
        :paramtype features: str or ~azure.mgmt.iothub.v2019_11_04.models.Capabilities
        """
        super().__init__(**kwargs)
        self.authorization_policies = authorization_policies
        self.ip_filter_rules = ip_filter_rules
        self.provisioning_state = None
        self.state = None
        self.host_name = None
        self.event_hub_endpoints = event_hub_endpoints
        self.routing = routing
        self.storage_endpoints = storage_endpoints
        self.messaging_endpoints = messaging_endpoints
        self.enable_file_upload_notifications = enable_file_upload_notifications
        self.cloud_to_device = cloud_to_device
        self.comments = comments
        self.features = features
        self.locations = None


class IotHubQuotaMetricInfo(_serialization.Model):
    """Quota metrics properties.

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

    :ivar name: The name of the quota metric.
    :vartype name: str
    :ivar current_value: The current value for the quota metric.
    :vartype current_value: int
    :ivar max_value: The maximum value of the quota metric.
    :vartype max_value: int
    """

    _validation = {
        "name": {"readonly": True},
        "current_value": {"readonly": True},
        "max_value": {"readonly": True},
    }

    _attribute_map = {
        "name": {"key": "name", "type": "str"},
        "current_value": {"key": "currentValue", "type": "int"},
        "max_value": {"key": "maxValue", "type": "int"},
    }

    def __init__(self, **kwargs: Any) -> None:
        """ """
        super().__init__(**kwargs)
        self.name = None
        self.current_value = None
        self.max_value = None


class IotHubQuotaMetricInfoListResult(_serialization.Model):
    """The JSON-serialized array of IotHubQuotaMetricInfo objects with a next link.

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

    :ivar value: The array of quota metrics objects.
    :vartype value: list[~azure.mgmt.iothub.v2019_11_04.models.IotHubQuotaMetricInfo]
    :ivar next_link: The next link.
    :vartype next_link: str
    """

    _validation = {
        "next_link": {"readonly": True},
    }

    _attribute_map = {
        "value": {"key": "value", "type": "[IotHubQuotaMetricInfo]"},
        "next_link": {"key": "nextLink", "type": "str"},
    }

    def __init__(self, *, value: Optional[List["_models.IotHubQuotaMetricInfo"]] = None, **kwargs: Any) -> None:
        """
        :keyword value: The array of quota metrics objects.
        :paramtype value: list[~azure.mgmt.iothub.v2019_11_04.models.IotHubQuotaMetricInfo]
        """
        super().__init__(**kwargs)
        self.value = value
        self.next_link = None


class IotHubSkuDescription(_serialization.Model):
    """SKU properties.

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

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

    :ivar resource_type: The type of the resource.
    :vartype resource_type: str
    :ivar sku: The type of the resource. Required.
    :vartype sku: ~azure.mgmt.iothub.v2019_11_04.models.IotHubSkuInfo
    :ivar capacity: IotHub capacity. Required.
    :vartype capacity: ~azure.mgmt.iothub.v2019_11_04.models.IotHubCapacity
    """

    _validation = {
        "resource_type": {"readonly": True},
        "sku": {"required": True},
        "capacity": {"required": True},
    }

    _attribute_map = {
        "resource_type": {"key": "resourceType", "type": "str"},
        "sku": {"key": "sku", "type": "IotHubSkuInfo"},
        "capacity": {"key": "capacity", "type": "IotHubCapacity"},
    }

    def __init__(self, *, sku: "_models.IotHubSkuInfo", capacity: "_models.IotHubCapacity", **kwargs: Any) -> None:
        """
        :keyword sku: The type of the resource. Required.
        :paramtype sku: ~azure.mgmt.iothub.v2019_11_04.models.IotHubSkuInfo
        :keyword capacity: IotHub capacity. Required.
        :paramtype capacity: ~azure.mgmt.iothub.v2019_11_04.models.IotHubCapacity
        """
        super().__init__(**kwargs)
        self.resource_type = None
        self.sku = sku
        self.capacity = capacity


class IotHubSkuDescriptionListResult(_serialization.Model):
    """The JSON-serialized array of IotHubSkuDescription objects with a next link.

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

    :ivar value: The array of IotHubSkuDescription.
    :vartype value: list[~azure.mgmt.iothub.v2019_11_04.models.IotHubSkuDescription]
    :ivar next_link: The next link.
    :vartype next_link: str
    """

    _validation = {
        "next_link": {"readonly": True},
    }

    _attribute_map = {
        "value": {"key": "value", "type": "[IotHubSkuDescription]"},
        "next_link": {"key": "nextLink", "type": "str"},
    }

    def __init__(self, *, value: Optional[List["_models.IotHubSkuDescription"]] = None, **kwargs: Any) -> None:
        """
        :keyword value: The array of IotHubSkuDescription.
        :paramtype value: list[~azure.mgmt.iothub.v2019_11_04.models.IotHubSkuDescription]
        """
        super().__init__(**kwargs)
        self.value = value
        self.next_link = None


class IotHubSkuInfo(_serialization.Model):
    """Information about the SKU of the IoT hub.

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

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

    :ivar name: The name of the SKU. Required. Known values are: "F1", "S1", "S2", "S3", "B1",
     "B2", and "B3".
    :vartype name: str or ~azure.mgmt.iothub.v2019_11_04.models.IotHubSku
    :ivar tier: The billing tier for the IoT hub. Known values are: "Free", "Standard", and
     "Basic".
    :vartype tier: str or ~azure.mgmt.iothub.v2019_11_04.models.IotHubSkuTier
    :ivar capacity: The number of provisioned IoT Hub units. See:
     https://docs.microsoft.com/azure/azure-subscription-service-limits#iot-hub-limits.
    :vartype capacity: int
    """

    _validation = {
        "name": {"required": True},
        "tier": {"readonly": True},
    }

    _attribute_map = {
        "name": {"key": "name", "type": "str"},
        "tier": {"key": "tier", "type": "str"},
        "capacity": {"key": "capacity", "type": "int"},
    }

    def __init__(self, *, name: Union[str, "_models.IotHubSku"], capacity: Optional[int] = None, **kwargs: Any) -> None:
        """
        :keyword name: The name of the SKU. Required. Known values are: "F1", "S1", "S2", "S3", "B1",
         "B2", and "B3".
        :paramtype name: str or ~azure.mgmt.iothub.v2019_11_04.models.IotHubSku
        :keyword capacity: The number of provisioned IoT Hub units. See:
         https://docs.microsoft.com/azure/azure-subscription-service-limits#iot-hub-limits.
        :paramtype capacity: int
        """
        super().__init__(**kwargs)
        self.name = name
        self.tier = None
        self.capacity = capacity


class IpFilterRule(_serialization.Model):
    """The IP filter rules for the IoT hub.

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

    :ivar filter_name: The name of the IP filter rule. Required.
    :vartype filter_name: str
    :ivar action: The desired action for requests captured by this rule. Required. Known values
     are: "Accept" and "Reject".
    :vartype action: str or ~azure.mgmt.iothub.v2019_11_04.models.IpFilterActionType
    :ivar ip_mask: A string that contains the IP address range in CIDR notation for the rule.
     Required.
    :vartype ip_mask: str
    """

    _validation = {
        "filter_name": {"required": True},
        "action": {"required": True},
        "ip_mask": {"required": True},
    }

    _attribute_map = {
        "filter_name": {"key": "filterName", "type": "str"},
        "action": {"key": "action", "type": "str"},
        "ip_mask": {"key": "ipMask", "type": "str"},
    }

    def __init__(
        self, *, filter_name: str, action: Union[str, "_models.IpFilterActionType"], ip_mask: str, **kwargs: Any
    ) -> None:
        """
        :keyword filter_name: The name of the IP filter rule. Required.
        :paramtype filter_name: str
        :keyword action: The desired action for requests captured by this rule. Required. Known values
         are: "Accept" and "Reject".
        :paramtype action: str or ~azure.mgmt.iothub.v2019_11_04.models.IpFilterActionType
        :keyword ip_mask: A string that contains the IP address range in CIDR notation for the rule.
         Required.
        :paramtype ip_mask: str
        """
        super().__init__(**kwargs)
        self.filter_name = filter_name
        self.action = action
        self.ip_mask = ip_mask


class JobResponse(_serialization.Model):
    """The properties of the Job Response object.

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

    :ivar job_id: The job identifier.
    :vartype job_id: str
    :ivar start_time_utc: The start time of the job.
    :vartype start_time_utc: ~datetime.datetime
    :ivar end_time_utc: The time the job stopped processing.
    :vartype end_time_utc: ~datetime.datetime
    :ivar type: The type of the job. Known values are: "unknown", "export", "import", "backup",
     "readDeviceProperties", "writeDeviceProperties", "updateDeviceConfiguration", "rebootDevice",
     "factoryResetDevice", and "firmwareUpdate".
    :vartype type: str or ~azure.mgmt.iothub.v2019_11_04.models.JobType
    :ivar status: The status of the job. Known values are: "unknown", "enqueued", "running",
     "completed", "failed", and "cancelled".
    :vartype status: str or ~azure.mgmt.iothub.v2019_11_04.models.JobStatus
    :ivar failure_reason: If status == failed, this string containing the reason for the failure.
    :vartype failure_reason: str
    :ivar status_message: The status message for the job.
    :vartype status_message: str
    :ivar parent_job_id: The job identifier of the parent job, if any.
    :vartype parent_job_id: str
    """

    _validation = {
        "job_id": {"readonly": True},
        "start_time_utc": {"readonly": True},
        "end_time_utc": {"readonly": True},
        "type": {"readonly": True},
        "status": {"readonly": True},
        "failure_reason": {"readonly": True},
        "status_message": {"readonly": True},
        "parent_job_id": {"readonly": True},
    }

    _attribute_map = {
        "job_id": {"key": "jobId", "type": "str"},
        "start_time_utc": {"key": "startTimeUtc", "type": "rfc-1123"},
        "end_time_utc": {"key": "endTimeUtc", "type": "rfc-1123"},
        "type": {"key": "type", "type": "str"},
        "status": {"key": "status", "type": "str"},
        "failure_reason": {"key": "failureReason", "type": "str"},
        "status_message": {"key": "statusMessage", "type": "str"},
        "parent_job_id": {"key": "parentJobId", "type": "str"},
    }

    def __init__(self, **kwargs: Any) -> None:
        """ """
        super().__init__(**kwargs)
        self.job_id = None
        self.start_time_utc = None
        self.end_time_utc = None
        self.type = None
        self.status = None
        self.failure_reason = None
        self.status_message = None
        self.parent_job_id = None


class JobResponseListResult(_serialization.Model):
    """The JSON-serialized array of JobResponse objects with a next link.

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

    :ivar value: The array of JobResponse objects.
    :vartype value: list[~azure.mgmt.iothub.v2019_11_04.models.JobResponse]
    :ivar next_link: The next link.
    :vartype next_link: str
    """

    _validation = {
        "next_link": {"readonly": True},
    }

    _attribute_map = {
        "value": {"key": "value", "type": "[JobResponse]"},
        "next_link": {"key": "nextLink", "type": "str"},
    }

    def __init__(self, *, value: Optional[List["_models.JobResponse"]] = None, **kwargs: Any) -> None:
        """
        :keyword value: The array of JobResponse objects.
        :paramtype value: list[~azure.mgmt.iothub.v2019_11_04.models.JobResponse]
        """
        super().__init__(**kwargs)
        self.value = value
        self.next_link = None


class MatchedRoute(_serialization.Model):
    """Routes that matched.

    :ivar properties: Properties of routes that matched.
    :vartype properties: ~azure.mgmt.iothub.v2019_11_04.models.RouteProperties
    """

    _attribute_map = {
        "properties": {"key": "properties", "type": "RouteProperties"},
    }

    def __init__(self, *, properties: Optional["_models.RouteProperties"] = None, **kwargs: Any) -> None:
        """
        :keyword properties: Properties of routes that matched.
        :paramtype properties: ~azure.mgmt.iothub.v2019_11_04.models.RouteProperties
        """
        super().__init__(**kwargs)
        self.properties = properties


class MessagingEndpointProperties(_serialization.Model):
    """The properties of the messaging endpoints used by this IoT hub.

    :ivar lock_duration_as_iso8601: The lock duration. See:
     https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-file-upload.
    :vartype lock_duration_as_iso8601: ~datetime.timedelta
    :ivar ttl_as_iso8601: The period of time for which a message is available to consume before it
     is expired by the IoT hub. See:
     https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-file-upload.
    :vartype ttl_as_iso8601: ~datetime.timedelta
    :ivar max_delivery_count: The number of times the IoT hub attempts to deliver a message. See:
     https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-file-upload.
    :vartype max_delivery_count: int
    """

    _validation = {
        "max_delivery_count": {"maximum": 100, "minimum": 1},
    }

    _attribute_map = {
        "lock_duration_as_iso8601": {"key": "lockDurationAsIso8601", "type": "duration"},
        "ttl_as_iso8601": {"key": "ttlAsIso8601", "type": "duration"},
        "max_delivery_count": {"key": "maxDeliveryCount", "type": "int"},
    }

    def __init__(
        self,
        *,
        lock_duration_as_iso8601: Optional[datetime.timedelta] = None,
        ttl_as_iso8601: Optional[datetime.timedelta] = None,
        max_delivery_count: Optional[int] = None,
        **kwargs: Any
    ) -> None:
        """
        :keyword lock_duration_as_iso8601: The lock duration. See:
         https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-file-upload.
        :paramtype lock_duration_as_iso8601: ~datetime.timedelta
        :keyword ttl_as_iso8601: The period of time for which a message is available to consume before
         it is expired by the IoT hub. See:
         https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-file-upload.
        :paramtype ttl_as_iso8601: ~datetime.timedelta
        :keyword max_delivery_count: The number of times the IoT hub attempts to deliver a message.
         See: https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-file-upload.
        :paramtype max_delivery_count: int
        """
        super().__init__(**kwargs)
        self.lock_duration_as_iso8601 = lock_duration_as_iso8601
        self.ttl_as_iso8601 = ttl_as_iso8601
        self.max_delivery_count = max_delivery_count


class Name(_serialization.Model):
    """Name of Iot Hub type.

    :ivar value: IotHub type.
    :vartype value: str
    :ivar localized_value: Localized value of name.
    :vartype localized_value: str
    """

    _attribute_map = {
        "value": {"key": "value", "type": "str"},
        "localized_value": {"key": "localizedValue", "type": "str"},
    }

    def __init__(self, *, value: Optional[str] = None, localized_value: Optional[str] = None, **kwargs: Any) -> None:
        """
        :keyword value: IotHub type.
        :paramtype value: str
        :keyword localized_value: Localized value of name.
        :paramtype localized_value: str
        """
        super().__init__(**kwargs)
        self.value = value
        self.localized_value = localized_value


class Operation(_serialization.Model):
    """IoT Hub REST API operation.

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

    :ivar name: Operation name: {provider}/{resource}/{read | write | action | delete}.
    :vartype name: str
    :ivar display: The object that represents the operation.
    :vartype display: ~azure.mgmt.iothub.v2019_11_04.models.OperationDisplay
    """

    _validation = {
        "name": {"readonly": True},
    }

    _attribute_map = {
        "name": {"key": "name", "type": "str"},
        "display": {"key": "display", "type": "OperationDisplay"},
    }

    def __init__(self, *, display: Optional["_models.OperationDisplay"] = None, **kwargs: Any) -> None:
        """
        :keyword display: The object that represents the operation.
        :paramtype display: ~azure.mgmt.iothub.v2019_11_04.models.OperationDisplay
        """
        super().__init__(**kwargs)
        self.name = None
        self.display = display


class OperationDisplay(_serialization.Model):
    """The object that represents the operation.

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

    :ivar provider: Service provider: Microsoft Devices.
    :vartype provider: str
    :ivar resource: Resource Type: IotHubs.
    :vartype resource: str
    :ivar operation: Name of the operation.
    :vartype operation: str
    :ivar description: Description of the operation.
    :vartype description: str
    """

    _validation = {
        "provider": {"readonly": True},
        "resource": {"readonly": True},
        "operation": {"readonly": True},
        "description": {"readonly": True},
    }

    _attribute_map = {
        "provider": {"key": "provider", "type": "str"},
        "resource": {"key": "resource", "type": "str"},
        "operation": {"key": "operation", "type": "str"},
        "description": {"key": "description", "type": "str"},
    }

    def __init__(self, **kwargs: Any) -> None:
        """ """
        super().__init__(**kwargs)
        self.provider = None
        self.resource = None
        self.operation = None
        self.description = None


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

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

    :ivar name: The name of the IoT hub to check. Required.
    :vartype name: str
    """

    _validation = {
        "name": {"required": True},
    }

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

    def __init__(self, *, name: str, **kwargs: Any) -> None:
        """
        :keyword name: The name of the IoT hub to check. Required.
        :paramtype name: str
        """
        super().__init__(**kwargs)
        self.name = name


class OperationListResult(_serialization.Model):
    """Result of the request to list IoT Hub operations. It contains a list of operations and a URL
    link to get the next set of results.

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

    :ivar value: List of IoT Hub operations supported by the Microsoft.Devices resource provider.
    :vartype value: list[~azure.mgmt.iothub.v2019_11_04.models.Operation]
    :ivar next_link: URL to get the next set of operation list results if there are any.
    :vartype next_link: str
    """

    _validation = {
        "value": {"readonly": True},
        "next_link": {"readonly": True},
    }

    _attribute_map = {
        "value": {"key": "value", "type": "[Operation]"},
        "next_link": {"key": "nextLink", "type": "str"},
    }

    def __init__(self, **kwargs: Any) -> None:
        """ """
        super().__init__(**kwargs)
        self.value = None
        self.next_link = None


class RegistryStatistics(_serialization.Model):
    """Identity registry statistics.

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

    :ivar total_device_count: The total count of devices in the identity registry.
    :vartype total_device_count: int
    :ivar enabled_device_count: The count of enabled devices in the identity registry.
    :vartype enabled_device_count: int
    :ivar disabled_device_count: The count of disabled devices in the identity registry.
    :vartype disabled_device_count: int
    """

    _validation = {
        "total_device_count": {"readonly": True},
        "enabled_device_count": {"readonly": True},
        "disabled_device_count": {"readonly": True},
    }

    _attribute_map = {
        "total_device_count": {"key": "totalDeviceCount", "type": "int"},
        "enabled_device_count": {"key": "enabledDeviceCount", "type": "int"},
        "disabled_device_count": {"key": "disabledDeviceCount", "type": "int"},
    }

    def __init__(self, **kwargs: Any) -> None:
        """ """
        super().__init__(**kwargs)
        self.total_device_count = None
        self.enabled_device_count = None
        self.disabled_device_count = None


class RouteCompilationError(_serialization.Model):
    """Compilation error when evaluating route.

    :ivar message: Route error message.
    :vartype message: str
    :ivar severity: Severity of the route error. Known values are: "error" and "warning".
    :vartype severity: str or ~azure.mgmt.iothub.v2019_11_04.models.RouteErrorSeverity
    :ivar location: Location where the route error happened.
    :vartype location: ~azure.mgmt.iothub.v2019_11_04.models.RouteErrorRange
    """

    _attribute_map = {
        "message": {"key": "message", "type": "str"},
        "severity": {"key": "severity", "type": "str"},
        "location": {"key": "location", "type": "RouteErrorRange"},
    }

    def __init__(
        self,
        *,
        message: Optional[str] = None,
        severity: Optional[Union[str, "_models.RouteErrorSeverity"]] = None,
        location: Optional["_models.RouteErrorRange"] = None,
        **kwargs: Any
    ) -> None:
        """
        :keyword message: Route error message.
        :paramtype message: str
        :keyword severity: Severity of the route error. Known values are: "error" and "warning".
        :paramtype severity: str or ~azure.mgmt.iothub.v2019_11_04.models.RouteErrorSeverity
        :keyword location: Location where the route error happened.
        :paramtype location: ~azure.mgmt.iothub.v2019_11_04.models.RouteErrorRange
        """
        super().__init__(**kwargs)
        self.message = message
        self.severity = severity
        self.location = location


class RouteErrorPosition(_serialization.Model):
    """Position where the route error happened.

    :ivar line: Line where the route error happened.
    :vartype line: int
    :ivar column: Column where the route error happened.
    :vartype column: int
    """

    _attribute_map = {
        "line": {"key": "line", "type": "int"},
        "column": {"key": "column", "type": "int"},
    }

    def __init__(self, *, line: Optional[int] = None, column: Optional[int] = None, **kwargs: Any) -> None:
        """
        :keyword line: Line where the route error happened.
        :paramtype line: int
        :keyword column: Column where the route error happened.
        :paramtype column: int
        """
        super().__init__(**kwargs)
        self.line = line
        self.column = column


class RouteErrorRange(_serialization.Model):
    """Range of route errors.

    :ivar start: Start where the route error happened.
    :vartype start: ~azure.mgmt.iothub.v2019_11_04.models.RouteErrorPosition
    :ivar end: End where the route error happened.
    :vartype end: ~azure.mgmt.iothub.v2019_11_04.models.RouteErrorPosition
    """

    _attribute_map = {
        "start": {"key": "start", "type": "RouteErrorPosition"},
        "end": {"key": "end", "type": "RouteErrorPosition"},
    }

    def __init__(
        self,
        *,
        start: Optional["_models.RouteErrorPosition"] = None,
        end: Optional["_models.RouteErrorPosition"] = None,
        **kwargs: Any
    ) -> None:
        """
        :keyword start: Start where the route error happened.
        :paramtype start: ~azure.mgmt.iothub.v2019_11_04.models.RouteErrorPosition
        :keyword end: End where the route error happened.
        :paramtype end: ~azure.mgmt.iothub.v2019_11_04.models.RouteErrorPosition
        """
        super().__init__(**kwargs)
        self.start = start
        self.end = end


class RouteProperties(_serialization.Model):
    """The properties of a routing rule that your IoT hub uses to route messages to endpoints.

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

    :ivar name: The name of the route. The name can only include alphanumeric characters, periods,
     underscores, hyphens, has a maximum length of 64 characters, and must be unique. Required.
    :vartype name: str
    :ivar source: The source that the routing rule is to be applied to, such as DeviceMessages.
     Required. Known values are: "Invalid", "DeviceMessages", "TwinChangeEvents",
     "DeviceLifecycleEvents", and "DeviceJobLifecycleEvents".
    :vartype source: str or ~azure.mgmt.iothub.v2019_11_04.models.RoutingSource
    :ivar condition: The condition that is evaluated to apply the routing rule. If no condition is
     provided, it evaluates to true by default. For grammar, see:
     https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-query-language.
    :vartype condition: str
    :ivar endpoint_names: The list of endpoints to which messages that satisfy the condition are
     routed. Currently only one endpoint is allowed. Required.
    :vartype endpoint_names: list[str]
    :ivar is_enabled: Used to specify whether a route is enabled. Required.
    :vartype is_enabled: bool
    """

    _validation = {
        "name": {"required": True, "pattern": r"^[A-Za-z0-9-._]{1,64}$"},
        "source": {"required": True},
        "endpoint_names": {"required": True, "max_items": 1, "min_items": 1},
        "is_enabled": {"required": True},
    }

    _attribute_map = {
        "name": {"key": "name", "type": "str"},
        "source": {"key": "source", "type": "str"},
        "condition": {"key": "condition", "type": "str"},
        "endpoint_names": {"key": "endpointNames", "type": "[str]"},
        "is_enabled": {"key": "isEnabled", "type": "bool"},
    }

    def __init__(
        self,
        *,
        name: str,
        source: Union[str, "_models.RoutingSource"],
        endpoint_names: List[str],
        is_enabled: bool,
        condition: Optional[str] = None,
        **kwargs: Any
    ) -> None:
        """
        :keyword name: The name of the route. The name can only include alphanumeric characters,
         periods, underscores, hyphens, has a maximum length of 64 characters, and must be unique.
         Required.
        :paramtype name: str
        :keyword source: The source that the routing rule is to be applied to, such as DeviceMessages.
         Required. Known values are: "Invalid", "DeviceMessages", "TwinChangeEvents",
         "DeviceLifecycleEvents", and "DeviceJobLifecycleEvents".
        :paramtype source: str or ~azure.mgmt.iothub.v2019_11_04.models.RoutingSource
        :keyword condition: The condition that is evaluated to apply the routing rule. If no condition
         is provided, it evaluates to true by default. For grammar, see:
         https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-query-language.
        :paramtype condition: str
        :keyword endpoint_names: The list of endpoints to which messages that satisfy the condition are
         routed. Currently only one endpoint is allowed. Required.
        :paramtype endpoint_names: list[str]
        :keyword is_enabled: Used to specify whether a route is enabled. Required.
        :paramtype is_enabled: bool
        """
        super().__init__(**kwargs)
        self.name = name
        self.source = source
        self.condition = condition
        self.endpoint_names = endpoint_names
        self.is_enabled = is_enabled


class RoutingEndpoints(_serialization.Model):
    """The properties related to the custom endpoints to which your IoT hub routes messages based on
    the routing rules. A maximum of 10 custom endpoints are allowed across all endpoint types for
    paid hubs and only 1 custom endpoint is allowed across all endpoint types for free hubs.

    :ivar service_bus_queues: The list of Service Bus queue endpoints that IoT hub routes the
     messages to, based on the routing rules.
    :vartype service_bus_queues:
     list[~azure.mgmt.iothub.v2019_11_04.models.RoutingServiceBusQueueEndpointProperties]
    :ivar service_bus_topics: The list of Service Bus topic endpoints that the IoT hub routes the
     messages to, based on the routing rules.
    :vartype service_bus_topics:
     list[~azure.mgmt.iothub.v2019_11_04.models.RoutingServiceBusTopicEndpointProperties]
    :ivar event_hubs: The list of Event Hubs endpoints that IoT hub routes messages to, based on
     the routing rules. This list does not include the built-in Event Hubs endpoint.
    :vartype event_hubs: list[~azure.mgmt.iothub.v2019_11_04.models.RoutingEventHubProperties]
    :ivar storage_containers: The list of storage container endpoints that IoT hub routes messages
     to, based on the routing rules.
    :vartype storage_containers:
     list[~azure.mgmt.iothub.v2019_11_04.models.RoutingStorageContainerProperties]
    """

    _attribute_map = {
        "service_bus_queues": {"key": "serviceBusQueues", "type": "[RoutingServiceBusQueueEndpointProperties]"},
        "service_bus_topics": {"key": "serviceBusTopics", "type": "[RoutingServiceBusTopicEndpointProperties]"},
        "event_hubs": {"key": "eventHubs", "type": "[RoutingEventHubProperties]"},
        "storage_containers": {"key": "storageContainers", "type": "[RoutingStorageContainerProperties]"},
    }

    def __init__(
        self,
        *,
        service_bus_queues: Optional[List["_models.RoutingServiceBusQueueEndpointProperties"]] = None,
        service_bus_topics: Optional[List["_models.RoutingServiceBusTopicEndpointProperties"]] = None,
        event_hubs: Optional[List["_models.RoutingEventHubProperties"]] = None,
        storage_containers: Optional[List["_models.RoutingStorageContainerProperties"]] = None,
        **kwargs: Any
    ) -> None:
        """
        :keyword service_bus_queues: The list of Service Bus queue endpoints that IoT hub routes the
         messages to, based on the routing rules.
        :paramtype service_bus_queues:
         list[~azure.mgmt.iothub.v2019_11_04.models.RoutingServiceBusQueueEndpointProperties]
        :keyword service_bus_topics: The list of Service Bus topic endpoints that the IoT hub routes
         the messages to, based on the routing rules.
        :paramtype service_bus_topics:
         list[~azure.mgmt.iothub.v2019_11_04.models.RoutingServiceBusTopicEndpointProperties]
        :keyword event_hubs: The list of Event Hubs endpoints that IoT hub routes messages to, based on
         the routing rules. This list does not include the built-in Event Hubs endpoint.
        :paramtype event_hubs: list[~azure.mgmt.iothub.v2019_11_04.models.RoutingEventHubProperties]
        :keyword storage_containers: The list of storage container endpoints that IoT hub routes
         messages to, based on the routing rules.
        :paramtype storage_containers:
         list[~azure.mgmt.iothub.v2019_11_04.models.RoutingStorageContainerProperties]
        """
        super().__init__(**kwargs)
        self.service_bus_queues = service_bus_queues
        self.service_bus_topics = service_bus_topics
        self.event_hubs = event_hubs
        self.storage_containers = storage_containers


class RoutingEventHubProperties(_serialization.Model):
    """The properties related to an event hub endpoint.

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

    :ivar connection_string: The connection string of the event hub endpoint. Required.
    :vartype connection_string: str
    :ivar name: The name that identifies this endpoint. The name can only include alphanumeric
     characters, periods, underscores, hyphens and has a maximum length of 64 characters. The
     following names are reserved:  events, fileNotifications, $default. Endpoint names must be
     unique across endpoint types. Required.
    :vartype name: str
    :ivar subscription_id: The subscription identifier of the event hub endpoint.
    :vartype subscription_id: str
    :ivar resource_group: The name of the resource group of the event hub endpoint.
    :vartype resource_group: str
    """

    _validation = {
        "connection_string": {"required": True},
        "name": {"required": True, "pattern": r"^[A-Za-z0-9-._]{1,64}$"},
    }

    _attribute_map = {
        "connection_string": {"key": "connectionString", "type": "str"},
        "name": {"key": "name", "type": "str"},
        "subscription_id": {"key": "subscriptionId", "type": "str"},
        "resource_group": {"key": "resourceGroup", "type": "str"},
    }

    def __init__(
        self,
        *,
        connection_string: str,
        name: str,
        subscription_id: Optional[str] = None,
        resource_group: Optional[str] = None,
        **kwargs: Any
    ) -> None:
        """
        :keyword connection_string: The connection string of the event hub endpoint. Required.
        :paramtype connection_string: str
        :keyword name: The name that identifies this endpoint. The name can only include alphanumeric
         characters, periods, underscores, hyphens and has a maximum length of 64 characters. The
         following names are reserved:  events, fileNotifications, $default. Endpoint names must be
         unique across endpoint types. Required.
        :paramtype name: str
        :keyword subscription_id: The subscription identifier of the event hub endpoint.
        :paramtype subscription_id: str
        :keyword resource_group: The name of the resource group of the event hub endpoint.
        :paramtype resource_group: str
        """
        super().__init__(**kwargs)
        self.connection_string = connection_string
        self.name = name
        self.subscription_id = subscription_id
        self.resource_group = resource_group


class RoutingMessage(_serialization.Model):
    """Routing message.

    :ivar body: Body of routing message.
    :vartype body: str
    :ivar app_properties: App properties.
    :vartype app_properties: dict[str, str]
    :ivar system_properties: System properties.
    :vartype system_properties: dict[str, str]
    """

    _attribute_map = {
        "body": {"key": "body", "type": "str"},
        "app_properties": {"key": "appProperties", "type": "{str}"},
        "system_properties": {"key": "systemProperties", "type": "{str}"},
    }

    def __init__(
        self,
        *,
        body: Optional[str] = None,
        app_properties: Optional[Dict[str, str]] = None,
        system_properties: Optional[Dict[str, str]] = None,
        **kwargs: Any
    ) -> None:
        """
        :keyword body: Body of routing message.
        :paramtype body: str
        :keyword app_properties: App properties.
        :paramtype app_properties: dict[str, str]
        :keyword system_properties: System properties.
        :paramtype system_properties: dict[str, str]
        """
        super().__init__(**kwargs)
        self.body = body
        self.app_properties = app_properties
        self.system_properties = system_properties


class RoutingProperties(_serialization.Model):
    """The routing related properties of the IoT hub. See:
    https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-messaging.

    :ivar endpoints: The properties related to the custom endpoints to which your IoT hub routes
     messages based on the routing rules. A maximum of 10 custom endpoints are allowed across all
     endpoint types for paid hubs and only 1 custom endpoint is allowed across all endpoint types
     for free hubs.
    :vartype endpoints: ~azure.mgmt.iothub.v2019_11_04.models.RoutingEndpoints
    :ivar routes: The list of user-provided routing rules that the IoT hub uses to route messages
     to built-in and custom endpoints. A maximum of 100 routing rules are allowed for paid hubs and
     a maximum of 5 routing rules are allowed for free hubs.
    :vartype routes: list[~azure.mgmt.iothub.v2019_11_04.models.RouteProperties]
    :ivar fallback_route: The properties of the route that is used as a fall-back route when none
     of the conditions specified in the 'routes' section are met. This is an optional parameter.
     When this property is not set, the messages which do not meet any of the conditions specified
     in the 'routes' section get routed to the built-in eventhub endpoint.
    :vartype fallback_route: ~azure.mgmt.iothub.v2019_11_04.models.FallbackRouteProperties
    :ivar 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/telemetryoneventgrid.
    :vartype enrichments: list[~azure.mgmt.iothub.v2019_11_04.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: Optional["_models.RoutingEndpoints"] = None,
        routes: Optional[List["_models.RouteProperties"]] = None,
        fallback_route: Optional["_models.FallbackRouteProperties"] = None,
        enrichments: Optional[List["_models.EnrichmentProperties"]] = None,
        **kwargs: Any
    ) -> None:
        """
        :keyword endpoints: The properties related to the custom endpoints to which your IoT hub routes
         messages based on the routing rules. A maximum of 10 custom endpoints are allowed across all
         endpoint types for paid hubs and only 1 custom endpoint is allowed across all endpoint types
         for free hubs.
        :paramtype endpoints: ~azure.mgmt.iothub.v2019_11_04.models.RoutingEndpoints
        :keyword routes: The list of user-provided routing rules that the IoT hub uses to route
         messages to built-in and custom endpoints. A maximum of 100 routing rules are allowed for paid
         hubs and a maximum of 5 routing rules are allowed for free hubs.
        :paramtype routes: list[~azure.mgmt.iothub.v2019_11_04.models.RouteProperties]
        :keyword fallback_route: The properties of the route that is used as a fall-back route when
         none of the conditions specified in the 'routes' section are met. This is an optional
         parameter. When this property is not set, the messages which do not meet any of the conditions
         specified in the 'routes' section get routed to the built-in eventhub endpoint.
        :paramtype fallback_route: ~azure.mgmt.iothub.v2019_11_04.models.FallbackRouteProperties
        :keyword 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/telemetryoneventgrid.
        :paramtype enrichments: list[~azure.mgmt.iothub.v2019_11_04.models.EnrichmentProperties]
        """
        super().__init__(**kwargs)
        self.endpoints = endpoints
        self.routes = routes
        self.fallback_route = fallback_route
        self.enrichments = enrichments


class RoutingServiceBusQueueEndpointProperties(_serialization.Model):
    """The properties related to service bus queue endpoint types.

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

    :ivar connection_string: The connection string of the service bus queue endpoint. Required.
    :vartype connection_string: str
    :ivar name: The name that identifies this endpoint. The name can only include alphanumeric
     characters, periods, underscores, hyphens and has a maximum length of 64 characters. The
     following names are reserved:  events, fileNotifications, $default. Endpoint names must be
     unique across endpoint types. The name need not be the same as the actual queue name. Required.
    :vartype name: str
    :ivar subscription_id: The subscription identifier of the service bus queue endpoint.
    :vartype subscription_id: str
    :ivar resource_group: The name of the resource group of the service bus queue endpoint.
    :vartype resource_group: str
    """

    _validation = {
        "connection_string": {"required": True},
        "name": {"required": True, "pattern": r"^[A-Za-z0-9-._]{1,64}$"},
    }

    _attribute_map = {
        "connection_string": {"key": "connectionString", "type": "str"},
        "name": {"key": "name", "type": "str"},
        "subscription_id": {"key": "subscriptionId", "type": "str"},
        "resource_group": {"key": "resourceGroup", "type": "str"},
    }

    def __init__(
        self,
        *,
        connection_string: str,
        name: str,
        subscription_id: Optional[str] = None,
        resource_group: Optional[str] = None,
        **kwargs: Any
    ) -> None:
        """
        :keyword connection_string: The connection string of the service bus queue endpoint. Required.
        :paramtype connection_string: str
        :keyword name: The name that identifies this endpoint. The name can only include alphanumeric
         characters, periods, underscores, hyphens and has a maximum length of 64 characters. The
         following names are reserved:  events, fileNotifications, $default. Endpoint names must be
         unique across endpoint types. The name need not be the same as the actual queue name. Required.
        :paramtype name: str
        :keyword subscription_id: The subscription identifier of the service bus queue endpoint.
        :paramtype subscription_id: str
        :keyword resource_group: The name of the resource group of the service bus queue endpoint.
        :paramtype resource_group: str
        """
        super().__init__(**kwargs)
        self.connection_string = connection_string
        self.name = name
        self.subscription_id = subscription_id
        self.resource_group = resource_group


class RoutingServiceBusTopicEndpointProperties(_serialization.Model):
    """The properties related to service bus topic endpoint types.

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

    :ivar connection_string: The connection string of the service bus topic endpoint. Required.
    :vartype connection_string: str
    :ivar name: The name that identifies this endpoint. The name can only include alphanumeric
     characters, periods, underscores, hyphens and has a maximum length of 64 characters. The
     following names are reserved:  events, fileNotifications, $default. Endpoint names must be
     unique across endpoint types.  The name need not be the same as the actual topic name.
     Required.
    :vartype name: str
    :ivar subscription_id: The subscription identifier of the service bus topic endpoint.
    :vartype subscription_id: str
    :ivar resource_group: The name of the resource group of the service bus topic endpoint.
    :vartype resource_group: str
    """

    _validation = {
        "connection_string": {"required": True},
        "name": {"required": True, "pattern": r"^[A-Za-z0-9-._]{1,64}$"},
    }

    _attribute_map = {
        "connection_string": {"key": "connectionString", "type": "str"},
        "name": {"key": "name", "type": "str"},
        "subscription_id": {"key": "subscriptionId", "type": "str"},
        "resource_group": {"key": "resourceGroup", "type": "str"},
    }

    def __init__(
        self,
        *,
        connection_string: str,
        name: str,
        subscription_id: Optional[str] = None,
        resource_group: Optional[str] = None,
        **kwargs: Any
    ) -> None:
        """
        :keyword connection_string: The connection string of the service bus topic endpoint. Required.
        :paramtype connection_string: str
        :keyword name: The name that identifies this endpoint. The name can only include alphanumeric
         characters, periods, underscores, hyphens and has a maximum length of 64 characters. The
         following names are reserved:  events, fileNotifications, $default. Endpoint names must be
         unique across endpoint types.  The name need not be the same as the actual topic name.
         Required.
        :paramtype name: str
        :keyword subscription_id: The subscription identifier of the service bus topic endpoint.
        :paramtype subscription_id: str
        :keyword resource_group: The name of the resource group of the service bus topic endpoint.
        :paramtype resource_group: str
        """
        super().__init__(**kwargs)
        self.connection_string = connection_string
        self.name = name
        self.subscription_id = subscription_id
        self.resource_group = resource_group


class RoutingStorageContainerProperties(_serialization.Model):
    """The properties related to a storage container endpoint.

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

    :ivar connection_string: The connection string of the storage account. Required.
    :vartype connection_string: str
    :ivar name: The name that identifies this endpoint. The name can only include alphanumeric
     characters, periods, underscores, hyphens and has a maximum length of 64 characters. The
     following names are reserved:  events, fileNotifications, $default. Endpoint names must be
     unique across endpoint types. Required.
    :vartype name: str
    :ivar subscription_id: The subscription identifier of the storage account.
    :vartype subscription_id: str
    :ivar resource_group: The name of the resource group of the storage account.
    :vartype resource_group: str
    :ivar container_name: The name of storage container in the storage account. Required.
    :vartype container_name: str
    :ivar file_name_format: File name format for the blob. Default format is
     {iothub}/{partition}/{YYYY}/{MM}/{DD}/{HH}/{mm}. All parameters are mandatory but can be
     reordered.
    :vartype file_name_format: str
    :ivar batch_frequency_in_seconds: Time interval at which blobs are written to storage. Value
     should be between 60 and 720 seconds. Default value is 300 seconds.
    :vartype batch_frequency_in_seconds: int
    :ivar max_chunk_size_in_bytes: Maximum number of bytes for each blob written to storage. Value
     should be between 10485760(10MB) and 524288000(500MB). Default value is 314572800(300MB).
    :vartype max_chunk_size_in_bytes: int
    :ivar encoding: Encoding that is used to serialize messages to blobs. Supported values are
     'avro', 'avrodeflate', and 'JSON'. Default value is 'avro'. Known values are: "Avro",
     "AvroDeflate", and "JSON".
    :vartype encoding: str or
     ~azure.mgmt.iothub.v2019_11_04.models.RoutingStorageContainerPropertiesEncoding
    """

    _validation = {
        "connection_string": {"required": True},
        "name": {"required": True, "pattern": r"^[A-Za-z0-9-._]{1,64}$"},
        "container_name": {"required": True},
        "batch_frequency_in_seconds": {"maximum": 720, "minimum": 60},
        "max_chunk_size_in_bytes": {"maximum": 524288000, "minimum": 10485760},
    }

    _attribute_map = {
        "connection_string": {"key": "connectionString", "type": "str"},
        "name": {"key": "name", "type": "str"},
        "subscription_id": {"key": "subscriptionId", "type": "str"},
        "resource_group": {"key": "resourceGroup", "type": "str"},
        "container_name": {"key": "containerName", "type": "str"},
        "file_name_format": {"key": "fileNameFormat", "type": "str"},
        "batch_frequency_in_seconds": {"key": "batchFrequencyInSeconds", "type": "int"},
        "max_chunk_size_in_bytes": {"key": "maxChunkSizeInBytes", "type": "int"},
        "encoding": {"key": "encoding", "type": "str"},
    }

    def __init__(
        self,
        *,
        connection_string: str,
        name: str,
        container_name: str,
        subscription_id: Optional[str] = None,
        resource_group: Optional[str] = None,
        file_name_format: Optional[str] = None,
        batch_frequency_in_seconds: Optional[int] = None,
        max_chunk_size_in_bytes: Optional[int] = None,
        encoding: Optional[Union[str, "_models.RoutingStorageContainerPropertiesEncoding"]] = None,
        **kwargs: Any
    ) -> None:
        """
        :keyword connection_string: The connection string of the storage account. Required.
        :paramtype connection_string: str
        :keyword name: The name that identifies this endpoint. The name can only include alphanumeric
         characters, periods, underscores, hyphens and has a maximum length of 64 characters. The
         following names are reserved:  events, fileNotifications, $default. Endpoint names must be
         unique across endpoint types. Required.
        :paramtype name: str
        :keyword subscription_id: The subscription identifier of the storage account.
        :paramtype subscription_id: str
        :keyword resource_group: The name of the resource group of the storage account.
        :paramtype resource_group: str
        :keyword container_name: The name of storage container in the storage account. Required.
        :paramtype container_name: str
        :keyword file_name_format: File name format for the blob. Default format is
         {iothub}/{partition}/{YYYY}/{MM}/{DD}/{HH}/{mm}. All parameters are mandatory but can be
         reordered.
        :paramtype file_name_format: str
        :keyword batch_frequency_in_seconds: Time interval at which blobs are written to storage. Value
         should be between 60 and 720 seconds. Default value is 300 seconds.
        :paramtype batch_frequency_in_seconds: int
        :keyword max_chunk_size_in_bytes: Maximum number of bytes for each blob written to storage.
         Value should be between 10485760(10MB) and 524288000(500MB). Default value is 314572800(300MB).
        :paramtype max_chunk_size_in_bytes: int
        :keyword encoding: Encoding that is used to serialize messages to blobs. Supported values are
         'avro', 'avrodeflate', and 'JSON'. Default value is 'avro'. Known values are: "Avro",
         "AvroDeflate", and "JSON".
        :paramtype encoding: str or
         ~azure.mgmt.iothub.v2019_11_04.models.RoutingStorageContainerPropertiesEncoding
        """
        super().__init__(**kwargs)
        self.connection_string = connection_string
        self.name = name
        self.subscription_id = subscription_id
        self.resource_group = resource_group
        self.container_name = container_name
        self.file_name_format = file_name_format
        self.batch_frequency_in_seconds = batch_frequency_in_seconds
        self.max_chunk_size_in_bytes = max_chunk_size_in_bytes
        self.encoding = encoding


class RoutingTwin(_serialization.Model):
    """Twin reference input parameter. This is an optional parameter.

    :ivar tags: Twin Tags.
    :vartype tags: JSON
    :ivar properties:
    :vartype properties: ~azure.mgmt.iothub.v2019_11_04.models.RoutingTwinProperties
    """

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

    def __init__(
        self,
        *,
        tags: Optional[JSON] = None,
        properties: Optional["_models.RoutingTwinProperties"] = None,
        **kwargs: Any
    ) -> None:
        """
        :keyword tags: Twin Tags.
        :paramtype tags: JSON
        :keyword properties:
        :paramtype properties: ~azure.mgmt.iothub.v2019_11_04.models.RoutingTwinProperties
        """
        super().__init__(**kwargs)
        self.tags = tags
        self.properties = properties


class RoutingTwinProperties(_serialization.Model):
    """RoutingTwinProperties.

    :ivar desired: Twin desired properties.
    :vartype desired: JSON
    :ivar reported: Twin desired properties.
    :vartype reported: JSON
    """

    _attribute_map = {
        "desired": {"key": "desired", "type": "object"},
        "reported": {"key": "reported", "type": "object"},
    }

    def __init__(self, *, desired: Optional[JSON] = None, reported: Optional[JSON] = None, **kwargs: Any) -> None:
        """
        :keyword desired: Twin desired properties.
        :paramtype desired: JSON
        :keyword reported: Twin desired properties.
        :paramtype reported: JSON
        """
        super().__init__(**kwargs)
        self.desired = desired
        self.reported = reported


class SharedAccessSignatureAuthorizationRule(_serialization.Model):
    """The properties of an IoT hub shared access policy.

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

    :ivar key_name: The name of the shared access policy. Required.
    :vartype key_name: str
    :ivar primary_key: The primary key.
    :vartype primary_key: str
    :ivar secondary_key: The secondary key.
    :vartype secondary_key: str
    :ivar rights: The permissions assigned to the shared access policy. Required. Known values are:
     "RegistryRead", "RegistryWrite", "ServiceConnect", "DeviceConnect", "RegistryRead,
     RegistryWrite", "RegistryRead, ServiceConnect", "RegistryRead, DeviceConnect", "RegistryWrite,
     ServiceConnect", "RegistryWrite, DeviceConnect", "ServiceConnect, DeviceConnect",
     "RegistryRead, RegistryWrite, ServiceConnect", "RegistryRead, RegistryWrite, DeviceConnect",
     "RegistryRead, ServiceConnect, DeviceConnect", "RegistryWrite, ServiceConnect, DeviceConnect",
     and "RegistryRead, RegistryWrite, ServiceConnect, DeviceConnect".
    :vartype rights: str or ~azure.mgmt.iothub.v2019_11_04.models.AccessRights
    """

    _validation = {
        "key_name": {"required": True},
        "rights": {"required": True},
    }

    _attribute_map = {
        "key_name": {"key": "keyName", "type": "str"},
        "primary_key": {"key": "primaryKey", "type": "str"},
        "secondary_key": {"key": "secondaryKey", "type": "str"},
        "rights": {"key": "rights", "type": "str"},
    }

    def __init__(
        self,
        *,
        key_name: str,
        rights: Union[str, "_models.AccessRights"],
        primary_key: Optional[str] = None,
        secondary_key: Optional[str] = None,
        **kwargs: Any
    ) -> None:
        """
        :keyword key_name: The name of the shared access policy. Required.
        :paramtype key_name: str
        :keyword primary_key: The primary key.
        :paramtype primary_key: str
        :keyword secondary_key: The secondary key.
        :paramtype secondary_key: str
        :keyword rights: The permissions assigned to the shared access policy. Required. Known values
         are: "RegistryRead", "RegistryWrite", "ServiceConnect", "DeviceConnect", "RegistryRead,
         RegistryWrite", "RegistryRead, ServiceConnect", "RegistryRead, DeviceConnect", "RegistryWrite,
         ServiceConnect", "RegistryWrite, DeviceConnect", "ServiceConnect, DeviceConnect",
         "RegistryRead, RegistryWrite, ServiceConnect", "RegistryRead, RegistryWrite, DeviceConnect",
         "RegistryRead, ServiceConnect, DeviceConnect", "RegistryWrite, ServiceConnect, DeviceConnect",
         and "RegistryRead, RegistryWrite, ServiceConnect, DeviceConnect".
        :paramtype rights: str or ~azure.mgmt.iothub.v2019_11_04.models.AccessRights
        """
        super().__init__(**kwargs)
        self.key_name = key_name
        self.primary_key = primary_key
        self.secondary_key = secondary_key
        self.rights = rights


class SharedAccessSignatureAuthorizationRuleListResult(_serialization.Model):
    """The list of shared access policies with a next link.

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

    :ivar value: The list of shared access policies.
    :vartype value:
     list[~azure.mgmt.iothub.v2019_11_04.models.SharedAccessSignatureAuthorizationRule]
    :ivar next_link: The next link.
    :vartype next_link: str
    """

    _validation = {
        "next_link": {"readonly": True},
    }

    _attribute_map = {
        "value": {"key": "value", "type": "[SharedAccessSignatureAuthorizationRule]"},
        "next_link": {"key": "nextLink", "type": "str"},
    }

    def __init__(
        self, *, value: Optional[List["_models.SharedAccessSignatureAuthorizationRule"]] = None, **kwargs: Any
    ) -> None:
        """
        :keyword value: The list of shared access policies.
        :paramtype value:
         list[~azure.mgmt.iothub.v2019_11_04.models.SharedAccessSignatureAuthorizationRule]
        """
        super().__init__(**kwargs)
        self.value = value
        self.next_link = None


class StorageEndpointProperties(_serialization.Model):
    """The properties of the Azure Storage endpoint for file upload.

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

    :ivar sas_ttl_as_iso8601: The period of time for which the SAS URI generated by IoT Hub for
     file upload is valid. See:
     https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-file-upload#file-upload-notification-configuration-options.
    :vartype sas_ttl_as_iso8601: ~datetime.timedelta
    :ivar connection_string: The connection string for the Azure Storage account to which files are
     uploaded. Required.
    :vartype connection_string: str
    :ivar container_name: The name of the root container where you upload files. The container need
     not exist but should be creatable using the connectionString specified. Required.
    :vartype container_name: str
    """

    _validation = {
        "connection_string": {"required": True},
        "container_name": {"required": True},
    }

    _attribute_map = {
        "sas_ttl_as_iso8601": {"key": "sasTtlAsIso8601", "type": "duration"},
        "connection_string": {"key": "connectionString", "type": "str"},
        "container_name": {"key": "containerName", "type": "str"},
    }

    def __init__(
        self,
        *,
        connection_string: str,
        container_name: str,
        sas_ttl_as_iso8601: Optional[datetime.timedelta] = None,
        **kwargs: Any
    ) -> None:
        """
        :keyword sas_ttl_as_iso8601: The period of time for which the SAS URI generated by IoT Hub for
         file upload is valid. See:
         https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-file-upload#file-upload-notification-configuration-options.
        :paramtype sas_ttl_as_iso8601: ~datetime.timedelta
        :keyword connection_string: The connection string for the Azure Storage account to which files
         are uploaded. Required.
        :paramtype connection_string: str
        :keyword container_name: The name of the root container where you upload files. The container
         need not exist but should be creatable using the connectionString specified. Required.
        :paramtype container_name: str
        """
        super().__init__(**kwargs)
        self.sas_ttl_as_iso8601 = sas_ttl_as_iso8601
        self.connection_string = connection_string
        self.container_name = container_name


class TagsResource(_serialization.Model):
    """A container holding only the Tags for a resource, allowing the user to update the tags on an
    IoT Hub instance.

    :ivar tags: Resource tags.
    :vartype tags: dict[str, str]
    """

    _attribute_map = {
        "tags": {"key": "tags", "type": "{str}"},
    }

    def __init__(self, *, tags: Optional[Dict[str, str]] = None, **kwargs: Any) -> None:
        """
        :keyword tags: Resource tags.
        :paramtype tags: dict[str, str]
        """
        super().__init__(**kwargs)
        self.tags = tags


class TestAllRoutesInput(_serialization.Model):
    """Input for testing all routes.

    :ivar routing_source: Routing source. Known values are: "Invalid", "DeviceMessages",
     "TwinChangeEvents", "DeviceLifecycleEvents", and "DeviceJobLifecycleEvents".
    :vartype routing_source: str or ~azure.mgmt.iothub.v2019_11_04.models.RoutingSource
    :ivar message: Routing message.
    :vartype message: ~azure.mgmt.iothub.v2019_11_04.models.RoutingMessage
    :ivar twin: Routing Twin Reference.
    :vartype twin: ~azure.mgmt.iothub.v2019_11_04.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: Optional[Union[str, "_models.RoutingSource"]] = None,
        message: Optional["_models.RoutingMessage"] = None,
        twin: Optional["_models.RoutingTwin"] = None,
        **kwargs: Any
    ) -> None:
        """
        :keyword routing_source: Routing source. Known values are: "Invalid", "DeviceMessages",
         "TwinChangeEvents", "DeviceLifecycleEvents", and "DeviceJobLifecycleEvents".
        :paramtype routing_source: str or ~azure.mgmt.iothub.v2019_11_04.models.RoutingSource
        :keyword message: Routing message.
        :paramtype message: ~azure.mgmt.iothub.v2019_11_04.models.RoutingMessage
        :keyword twin: Routing Twin Reference.
        :paramtype twin: ~azure.mgmt.iothub.v2019_11_04.models.RoutingTwin
        """
        super().__init__(**kwargs)
        self.routing_source = routing_source
        self.message = message
        self.twin = twin


class TestAllRoutesResult(_serialization.Model):
    """Result of testing all routes.

    :ivar routes: JSON-serialized array of matched routes.
    :vartype routes: list[~azure.mgmt.iothub.v2019_11_04.models.MatchedRoute]
    """

    _attribute_map = {
        "routes": {"key": "routes", "type": "[MatchedRoute]"},
    }

    def __init__(self, *, routes: Optional[List["_models.MatchedRoute"]] = None, **kwargs: Any) -> None:
        """
        :keyword routes: JSON-serialized array of matched routes.
        :paramtype routes: list[~azure.mgmt.iothub.v2019_11_04.models.MatchedRoute]
        """
        super().__init__(**kwargs)
        self.routes = routes


class TestRouteInput(_serialization.Model):
    """Input for testing route.

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

    :ivar message: Routing message.
    :vartype message: ~azure.mgmt.iothub.v2019_11_04.models.RoutingMessage
    :ivar route: Route properties. Required.
    :vartype route: ~azure.mgmt.iothub.v2019_11_04.models.RouteProperties
    :ivar twin: Routing Twin Reference.
    :vartype twin: ~azure.mgmt.iothub.v2019_11_04.models.RoutingTwin
    """

    _validation = {
        "route": {"required": True},
    }

    _attribute_map = {
        "message": {"key": "message", "type": "RoutingMessage"},
        "route": {"key": "route", "type": "RouteProperties"},
        "twin": {"key": "twin", "type": "RoutingTwin"},
    }

    def __init__(
        self,
        *,
        route: "_models.RouteProperties",
        message: Optional["_models.RoutingMessage"] = None,
        twin: Optional["_models.RoutingTwin"] = None,
        **kwargs: Any
    ) -> None:
        """
        :keyword message: Routing message.
        :paramtype message: ~azure.mgmt.iothub.v2019_11_04.models.RoutingMessage
        :keyword route: Route properties. Required.
        :paramtype route: ~azure.mgmt.iothub.v2019_11_04.models.RouteProperties
        :keyword twin: Routing Twin Reference.
        :paramtype twin: ~azure.mgmt.iothub.v2019_11_04.models.RoutingTwin
        """
        super().__init__(**kwargs)
        self.message = message
        self.route = route
        self.twin = twin


class TestRouteResult(_serialization.Model):
    """Result of testing one route.

    :ivar result: Result of testing route. Known values are: "undefined", "false", and "true".
    :vartype result: str or ~azure.mgmt.iothub.v2019_11_04.models.TestResultStatus
    :ivar details: Detailed result of testing route.
    :vartype details: ~azure.mgmt.iothub.v2019_11_04.models.TestRouteResultDetails
    """

    _attribute_map = {
        "result": {"key": "result", "type": "str"},
        "details": {"key": "details", "type": "TestRouteResultDetails"},
    }

    def __init__(
        self,
        *,
        result: Optional[Union[str, "_models.TestResultStatus"]] = None,
        details: Optional["_models.TestRouteResultDetails"] = None,
        **kwargs: Any
    ) -> None:
        """
        :keyword result: Result of testing route. Known values are: "undefined", "false", and "true".
        :paramtype result: str or ~azure.mgmt.iothub.v2019_11_04.models.TestResultStatus
        :keyword details: Detailed result of testing route.
        :paramtype details: ~azure.mgmt.iothub.v2019_11_04.models.TestRouteResultDetails
        """
        super().__init__(**kwargs)
        self.result = result
        self.details = details


class TestRouteResultDetails(_serialization.Model):
    """Detailed result of testing a route.

    :ivar compilation_errors: JSON-serialized list of route compilation errors.
    :vartype compilation_errors: list[~azure.mgmt.iothub.v2019_11_04.models.RouteCompilationError]
    """

    _attribute_map = {
        "compilation_errors": {"key": "compilationErrors", "type": "[RouteCompilationError]"},
    }

    def __init__(
        self, *, compilation_errors: Optional[List["_models.RouteCompilationError"]] = None, **kwargs: Any
    ) -> None:
        """
        :keyword compilation_errors: JSON-serialized list of route compilation errors.
        :paramtype compilation_errors:
         list[~azure.mgmt.iothub.v2019_11_04.models.RouteCompilationError]
        """
        super().__init__(**kwargs)
        self.compilation_errors = compilation_errors


class UserSubscriptionQuota(_serialization.Model):
    """User subscription quota response.

    :ivar id: IotHub type id.
    :vartype id: str
    :ivar type: Response type.
    :vartype type: str
    :ivar unit: Unit of IotHub type.
    :vartype unit: str
    :ivar current_value: Current number of IotHub type.
    :vartype current_value: int
    :ivar limit: Numerical limit on IotHub type.
    :vartype limit: int
    :ivar name: IotHub type.
    :vartype name: ~azure.mgmt.iothub.v2019_11_04.models.Name
    """

    _attribute_map = {
        "id": {"key": "id", "type": "str"},
        "type": {"key": "type", "type": "str"},
        "unit": {"key": "unit", "type": "str"},
        "current_value": {"key": "currentValue", "type": "int"},
        "limit": {"key": "limit", "type": "int"},
        "name": {"key": "name", "type": "Name"},
    }

    def __init__(
        self,
        *,
        id: Optional[str] = None,  # pylint: disable=redefined-builtin
        type: Optional[str] = None,
        unit: Optional[str] = None,
        current_value: Optional[int] = None,
        limit: Optional[int] = None,
        name: Optional["_models.Name"] = None,
        **kwargs: Any
    ) -> None:
        """
        :keyword id: IotHub type id.
        :paramtype id: str
        :keyword type: Response type.
        :paramtype type: str
        :keyword unit: Unit of IotHub type.
        :paramtype unit: str
        :keyword current_value: Current number of IotHub type.
        :paramtype current_value: int
        :keyword limit: Numerical limit on IotHub type.
        :paramtype limit: int
        :keyword name: IotHub type.
        :paramtype name: ~azure.mgmt.iothub.v2019_11_04.models.Name
        """
        super().__init__(**kwargs)
        self.id = id
        self.type = type
        self.unit = unit
        self.current_value = current_value
        self.limit = limit
        self.name = name


class UserSubscriptionQuotaListResult(_serialization.Model):
    """Json-serialized array of User subscription quota response.

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

    :ivar value:
    :vartype value: list[~azure.mgmt.iothub.v2019_11_04.models.UserSubscriptionQuota]
    :ivar next_link:
    :vartype next_link: str
    """

    _validation = {
        "next_link": {"readonly": True},
    }

    _attribute_map = {
        "value": {"key": "value", "type": "[UserSubscriptionQuota]"},
        "next_link": {"key": "nextLink", "type": "str"},
    }

    def __init__(self, *, value: Optional[List["_models.UserSubscriptionQuota"]] = None, **kwargs: Any) -> None:
        """
        :keyword value:
        :paramtype value: list[~azure.mgmt.iothub.v2019_11_04.models.UserSubscriptionQuota]
        """
        super().__init__(**kwargs)
        self.value = value
        self.next_link = None
