# pylint: disable=line-too-long,useless-suppression,too-many-lines
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------

from collections.abc import MutableMapping
import datetime
from typing import Any, Dict, List, Optional, TYPE_CHECKING, Union

from .._utils import serialization as _serialization

if TYPE_CHECKING:
    from .. import models as _models
JSON = MutableMapping[str, Any]


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

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

    :ivar principal_id: Principal Id.
    :vartype principal_id: str
    :ivar tenant_id: Tenant Id.
    :vartype tenant_id: str
    :ivar type: The type of identity used for the resource. The type 'SystemAssigned,UserAssigned'
     includes both an implicitly created identity and a set of user assigned identities. The type
     'None' will remove any identities from the service. Known values are: "SystemAssigned",
     "UserAssigned", "SystemAssigned, UserAssigned", and "None".
    :vartype type: str or ~azure.mgmt.iothub.models.ResourceIdentityType
    :ivar user_assigned_identities: Dictionary of :code:`<ArmUserIdentity>`.
    :vartype user_assigned_identities: dict[str, ~azure.mgmt.iothub.models.ArmUserIdentity]
    """

    _validation = {
        "principal_id": {"readonly": True},
        "tenant_id": {"readonly": True},
    }

    _attribute_map = {
        "principal_id": {"key": "principalId", "type": "str"},
        "tenant_id": {"key": "tenantId", "type": "str"},
        "type": {"key": "type", "type": "str"},
        "user_assigned_identities": {"key": "userAssignedIdentities", "type": "{ArmUserIdentity}"},
    }

    def __init__(
        self,
        *,
        type: Optional[Union[str, "_models.ResourceIdentityType"]] = None,
        user_assigned_identities: Optional[Dict[str, "_models.ArmUserIdentity"]] = None,
        **kwargs: Any
    ) -> None:
        """
        :keyword type: The type of identity used for the resource. The type
         'SystemAssigned,UserAssigned' includes both an implicitly created identity and a set of user
         assigned identities. The type 'None' will remove any identities from the service. Known values
         are: "SystemAssigned", "UserAssigned", "SystemAssigned, UserAssigned", and "None".
        :paramtype type: str or ~azure.mgmt.iothub.models.ResourceIdentityType
        :keyword user_assigned_identities: Dictionary of :code:`<ArmUserIdentity>`.
        :paramtype user_assigned_identities: dict[str, ~azure.mgmt.iothub.models.ArmUserIdentity]
        """
        super().__init__(**kwargs)
        self.principal_id: Optional[str] = None
        self.tenant_id: Optional[str] = None
        self.type = type
        self.user_assigned_identities = user_assigned_identities


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

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

    :ivar principal_id:
    :vartype principal_id: str
    :ivar client_id:
    :vartype client_id: str
    """

    _validation = {
        "principal_id": {"readonly": True},
        "client_id": {"readonly": True},
    }

    _attribute_map = {
        "principal_id": {"key": "principalId", "type": "str"},
        "client_id": {"key": "clientId", "type": "str"},
    }

    def __init__(self, **kwargs: Any) -> None:
        """ """
        super().__init__(**kwargs)
        self.principal_id: Optional[str] = None
        self.client_id: Optional[str] = None


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
    :ivar is_verified: True indicates that the certificate will be created in verified state and
     proof of possession will not be required.
    :vartype is_verified: bool
    """

    _attribute_map = {
        "certificate": {"key": "certificate", "type": "str"},
        "is_verified": {"key": "isVerified", "type": "bool"},
    }

    def __init__(self, *, certificate: Optional[str] = None, is_verified: Optional[bool] = None, **kwargs: Any) -> None:
        """
        :keyword certificate: base-64 representation of the X509 leaf certificate .cer file or just
         .pem file content.
        :paramtype certificate: str
        :keyword is_verified: True indicates that the certificate will be created in verified state and
         proof of possession will not be required.
        :paramtype is_verified: bool
        """
        super().__init__(**kwargs)
        self.certificate = certificate
        self.is_verified = is_verified


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.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.models.CertificateProperties
        """
        super().__init__(**kwargs)
        self.properties = properties
        self.id: Optional[str] = None
        self.name: Optional[str] = None
        self.etag: Optional[str] = None
        self.type: Optional[str] = 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.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.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},
        "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, *, is_verified: Optional[bool] = None, certificate: Optional[str] = None, **kwargs: Any) -> None:
        """
        :keyword is_verified: Determines whether certificate has been verified.
        :paramtype is_verified: bool
        :keyword certificate: The certificate content.
        :paramtype certificate: str
        """
        super().__init__(**kwargs)
        self.subject: Optional[str] = None
        self.expiry: Optional[datetime.datetime] = None
        self.thumbprint: Optional[str] = None
        self.is_verified = is_verified
        self.created: Optional[datetime.datetime] = None
        self.updated: Optional[datetime.datetime] = 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: Optional[str] = None
        self.expiry: Optional[datetime.datetime] = None
        self.thumbprint: Optional[str] = None
        self.is_verified: Optional[bool] = None
        self.created: Optional[datetime.datetime] = None
        self.updated: Optional[datetime.datetime] = None
        self.verification_code: Optional[str] = None
        self.certificate: Optional[str] = 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.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.models.CertificatePropertiesWithNonce
        """
        super().__init__(**kwargs)
        self.properties = properties
        self.id: Optional[str] = None
        self.name: Optional[str] = None
        self.etag: Optional[str] = None
        self.type: Optional[str] = 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.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.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 EncryptionPropertiesDescription(_serialization.Model):
    """The encryption properties for the IoT hub.

    :ivar key_source: The source of the key.
    :vartype key_source: str
    :ivar key_vault_properties: The properties of the KeyVault key.
    :vartype key_vault_properties: list[~azure.mgmt.iothub.models.KeyVaultKeyProperties]
    """

    _attribute_map = {
        "key_source": {"key": "keySource", "type": "str"},
        "key_vault_properties": {"key": "keyVaultProperties", "type": "[KeyVaultKeyProperties]"},
    }

    def __init__(
        self,
        *,
        key_source: Optional[str] = None,
        key_vault_properties: Optional[List["_models.KeyVaultKeyProperties"]] = None,
        **kwargs: Any
    ) -> None:
        """
        :keyword key_source: The source of the key.
        :paramtype key_source: str
        :keyword key_vault_properties: The properties of the KeyVault key.
        :paramtype key_vault_properties: list[~azure.mgmt.iothub.models.KeyVaultKeyProperties]
        """
        super().__init__(**kwargs)
        self.key_source = key_source
        self.key_vault_properties = key_vault_properties


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", "degraded",
     "unhealthy", and "dead".
    :vartype health_status: str or ~azure.mgmt.iothub.models.EndpointHealthStatus
    :ivar last_known_error: Last error obtained when a message failed to be delivered to iot hub.
    :vartype last_known_error: str
    :ivar last_known_error_time: Time at which the last known error occurred.
    :vartype last_known_error_time: ~datetime.datetime
    :ivar last_successful_send_attempt_time: Last time iot hub successfully sent a message to the
     endpoint.
    :vartype last_successful_send_attempt_time: ~datetime.datetime
    :ivar last_send_attempt_time: Last time iot hub tried to send a message to the endpoint.
    :vartype last_send_attempt_time: ~datetime.datetime
    """

    _attribute_map = {
        "endpoint_id": {"key": "endpointId", "type": "str"},
        "health_status": {"key": "healthStatus", "type": "str"},
        "last_known_error": {"key": "lastKnownError", "type": "str"},
        "last_known_error_time": {"key": "lastKnownErrorTime", "type": "rfc-1123"},
        "last_successful_send_attempt_time": {"key": "lastSuccessfulSendAttemptTime", "type": "rfc-1123"},
        "last_send_attempt_time": {"key": "lastSendAttemptTime", "type": "rfc-1123"},
    }

    def __init__(
        self,
        *,
        endpoint_id: Optional[str] = None,
        health_status: Optional[Union[str, "_models.EndpointHealthStatus"]] = None,
        last_known_error: Optional[str] = None,
        last_known_error_time: Optional[datetime.datetime] = None,
        last_successful_send_attempt_time: Optional[datetime.datetime] = None,
        last_send_attempt_time: Optional[datetime.datetime] = 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",
         "degraded", "unhealthy", and "dead".
        :paramtype health_status: str or ~azure.mgmt.iothub.models.EndpointHealthStatus
        :keyword last_known_error: Last error obtained when a message failed to be delivered to iot
         hub.
        :paramtype last_known_error: str
        :keyword last_known_error_time: Time at which the last known error occurred.
        :paramtype last_known_error_time: ~datetime.datetime
        :keyword last_successful_send_attempt_time: Last time iot hub successfully sent a message to
         the endpoint.
        :paramtype last_successful_send_attempt_time: ~datetime.datetime
        :keyword last_send_attempt_time: Last time iot hub tried to send a message to the endpoint.
        :paramtype last_send_attempt_time: ~datetime.datetime
        """
        super().__init__(**kwargs)
        self.endpoint_id = endpoint_id
        self.health_status = health_status
        self.last_known_error = last_known_error
        self.last_known_error_time = last_known_error_time
        self.last_successful_send_attempt_time = last_successful_send_attempt_time
        self.last_send_attempt_time = last_send_attempt_time


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.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.models.EndpointHealthData]
        """
        super().__init__(**kwargs)
        self.value = value
        self.next_link: Optional[str] = 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 server.

    :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: Optional[str] = None
        self.http_status_code: Optional[str] = None
        self.message: Optional[str] = None
        self.details: Optional[str] = None


class EventHubConsumerGroupBodyDescription(_serialization.Model):
    """The EventHub consumer group.

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

    :ivar properties: The EventHub consumer group name. Required.
    :vartype properties: ~azure.mgmt.iothub.models.EventHubConsumerGroupName
    """

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

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

    def __init__(self, *, properties: "_models.EventHubConsumerGroupName", **kwargs: Any) -> None:
        """
        :keyword properties: The EventHub consumer group name. Required.
        :paramtype properties: ~azure.mgmt.iothub.models.EventHubConsumerGroupName
        """
        super().__init__(**kwargs)
        self.properties = properties


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, any]
    :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": "{object}"},
        "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, Any]] = None, **kwargs: Any) -> None:
        """
        :keyword properties: The tags.
        :paramtype properties: dict[str, any]
        """
        super().__init__(**kwargs)
        self.properties = properties
        self.id: Optional[str] = None
        self.name: Optional[str] = None
        self.type: Optional[str] = None
        self.etag: Optional[str] = None


class EventHubConsumerGroupName(_serialization.Model):
    """The EventHub consumer group name.

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

    :ivar name: EventHub consumer group name. 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: EventHub consumer group name. Required.
        :paramtype name: str
        """
        super().__init__(**kwargs)
        self.name = name


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.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.models.EventHubConsumerGroupInfo]
        """
        super().__init__(**kwargs)
        self.value = value
        self.next_link: Optional[str] = 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: Optional[List[str]] = None
        self.path: Optional[str] = None
        self.endpoint: Optional[str] = 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 server.

    :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
    :ivar export_blob_name: The name of the blob that will be created in the provided output blob
     container. This blob will contain the exported device registry information for the IoT Hub.
    :vartype export_blob_name: str
    :ivar authentication_type: Specifies authentication type being used for connecting to the
     storage account. Known values are: "keyBased" and "identityBased".
    :vartype authentication_type: str or ~azure.mgmt.iothub.models.AuthenticationType
    :ivar identity: Managed identity properties of storage endpoint for export devices.
    :vartype identity: ~azure.mgmt.iothub.models.ManagedIdentity
    :ivar include_configurations: The value indicating whether configurations should be exported.
    :vartype include_configurations: bool
    :ivar configurations_blob_name: The name of the blob that will be created in the provided
     output blob container. This blob will contain the exported configurations for the Iot Hub.
    :vartype configurations_blob_name: str
    """

    _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"},
        "export_blob_name": {"key": "exportBlobName", "type": "str"},
        "authentication_type": {"key": "authenticationType", "type": "str"},
        "identity": {"key": "identity", "type": "ManagedIdentity"},
        "include_configurations": {"key": "includeConfigurations", "type": "bool"},
        "configurations_blob_name": {"key": "configurationsBlobName", "type": "str"},
    }

    def __init__(
        self,
        *,
        export_blob_container_uri: str,
        exclude_keys: bool,
        export_blob_name: Optional[str] = None,
        authentication_type: Optional[Union[str, "_models.AuthenticationType"]] = None,
        identity: Optional["_models.ManagedIdentity"] = None,
        include_configurations: Optional[bool] = None,
        configurations_blob_name: Optional[str] = None,
        **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
        :keyword export_blob_name: The name of the blob that will be created in the provided output
         blob container. This blob will contain the exported device registry information for the IoT
         Hub.
        :paramtype export_blob_name: str
        :keyword authentication_type: Specifies authentication type being used for connecting to the
         storage account. Known values are: "keyBased" and "identityBased".
        :paramtype authentication_type: str or ~azure.mgmt.iothub.models.AuthenticationType
        :keyword identity: Managed identity properties of storage endpoint for export devices.
        :paramtype identity: ~azure.mgmt.iothub.models.ManagedIdentity
        :keyword include_configurations: The value indicating whether configurations should be
         exported.
        :paramtype include_configurations: bool
        :keyword configurations_blob_name: The name of the blob that will be created in the provided
         output blob container. This blob will contain the exported configurations for the Iot Hub.
        :paramtype configurations_blob_name: str
        """
        super().__init__(**kwargs)
        self.export_blob_container_uri = export_blob_container_uri
        self.exclude_keys = exclude_keys
        self.export_blob_name = export_blob_name
        self.authentication_type = authentication_type
        self.identity = identity
        self.include_configurations = include_configurations
        self.configurations_blob_name = configurations_blob_name


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 server.

    :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 server.

    :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", "DeviceJobLifecycleEvents", "DigitalTwinChangeEvents",
     "DeviceConnectionStateEvents", and "MqttBrokerMessages".
    :vartype source: str or ~azure.mgmt.iothub.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", "DeviceJobLifecycleEvents", "DigitalTwinChangeEvents",
         "DeviceConnectionStateEvents", and "MqttBrokerMessages".
        :paramtype source: str or ~azure.mgmt.iothub.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 GroupIdInformation(_serialization.Model):
    """The group information for creating a private endpoint on an IotHub.

    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 server.

    :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 properties: The properties for a group information object. Required.
    :vartype properties: ~azure.mgmt.iothub.models.GroupIdInformationProperties
    """

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

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

    def __init__(self, *, properties: "_models.GroupIdInformationProperties", **kwargs: Any) -> None:
        """
        :keyword properties: The properties for a group information object. Required.
        :paramtype properties: ~azure.mgmt.iothub.models.GroupIdInformationProperties
        """
        super().__init__(**kwargs)
        self.id: Optional[str] = None
        self.name: Optional[str] = None
        self.type: Optional[str] = None
        self.properties = properties


class GroupIdInformationProperties(_serialization.Model):
    """The properties for a group information object.

    :ivar group_id: The group id.
    :vartype group_id: str
    :ivar required_members: The required members for a specific group id.
    :vartype required_members: list[str]
    :ivar required_zone_names: The required DNS zones for a specific group id.
    :vartype required_zone_names: list[str]
    """

    _attribute_map = {
        "group_id": {"key": "groupId", "type": "str"},
        "required_members": {"key": "requiredMembers", "type": "[str]"},
        "required_zone_names": {"key": "requiredZoneNames", "type": "[str]"},
    }

    def __init__(
        self,
        *,
        group_id: Optional[str] = None,
        required_members: Optional[List[str]] = None,
        required_zone_names: Optional[List[str]] = None,
        **kwargs: Any
    ) -> None:
        """
        :keyword group_id: The group id.
        :paramtype group_id: str
        :keyword required_members: The required members for a specific group id.
        :paramtype required_members: list[str]
        :keyword required_zone_names: The required DNS zones for a specific group id.
        :paramtype required_zone_names: list[str]
        """
        super().__init__(**kwargs)
        self.group_id = group_id
        self.required_members = required_members
        self.required_zone_names = required_zone_names


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 server.

    :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
    :ivar input_blob_name: The blob name to be used when importing from the provided input blob
     container.
    :vartype input_blob_name: str
    :ivar output_blob_name: The blob name to use for storing the status of the import job.
    :vartype output_blob_name: str
    :ivar authentication_type: Specifies authentication type being used for connecting to the
     storage account. Known values are: "keyBased" and "identityBased".
    :vartype authentication_type: str or ~azure.mgmt.iothub.models.AuthenticationType
    :ivar identity: Managed identity properties of storage endpoint for import devices.
    :vartype identity: ~azure.mgmt.iothub.models.ManagedIdentity
    :ivar include_configurations: The value indicating whether configurations should be imported.
    :vartype include_configurations: bool
    :ivar configurations_blob_name: The blob name to be used when importing configurations from the
     provided input blob container.
    :vartype configurations_blob_name: 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"},
        "input_blob_name": {"key": "inputBlobName", "type": "str"},
        "output_blob_name": {"key": "outputBlobName", "type": "str"},
        "authentication_type": {"key": "authenticationType", "type": "str"},
        "identity": {"key": "identity", "type": "ManagedIdentity"},
        "include_configurations": {"key": "includeConfigurations", "type": "bool"},
        "configurations_blob_name": {"key": "configurationsBlobName", "type": "str"},
    }

    def __init__(
        self,
        *,
        input_blob_container_uri: str,
        output_blob_container_uri: str,
        input_blob_name: Optional[str] = None,
        output_blob_name: Optional[str] = None,
        authentication_type: Optional[Union[str, "_models.AuthenticationType"]] = None,
        identity: Optional["_models.ManagedIdentity"] = None,
        include_configurations: Optional[bool] = None,
        configurations_blob_name: Optional[str] = None,
        **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
        :keyword input_blob_name: The blob name to be used when importing from the provided input blob
         container.
        :paramtype input_blob_name: str
        :keyword output_blob_name: The blob name to use for storing the status of the import job.
        :paramtype output_blob_name: str
        :keyword authentication_type: Specifies authentication type being used for connecting to the
         storage account. Known values are: "keyBased" and "identityBased".
        :paramtype authentication_type: str or ~azure.mgmt.iothub.models.AuthenticationType
        :keyword identity: Managed identity properties of storage endpoint for import devices.
        :paramtype identity: ~azure.mgmt.iothub.models.ManagedIdentity
        :keyword include_configurations: The value indicating whether configurations should be
         imported.
        :paramtype include_configurations: bool
        :keyword configurations_blob_name: The blob name to be used when importing configurations from
         the provided input blob container.
        :paramtype configurations_blob_name: str
        """
        super().__init__(**kwargs)
        self.input_blob_container_uri = input_blob_container_uri
        self.output_blob_container_uri = output_blob_container_uri
        self.input_blob_name = input_blob_name
        self.output_blob_name = output_blob_name
        self.authentication_type = authentication_type
        self.identity = identity
        self.include_configurations = include_configurations
        self.configurations_blob_name = configurations_blob_name


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.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: Optional[int] = None
        self.maximum: Optional[int] = None
        self.default: Optional[int] = None
        self.scale_type: Optional[Union[str, "_models.IotHubScaleType"]] = 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 server.

    :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: Optional[str] = None
        self.name: Optional[str] = None
        self.type: Optional[str] = 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 server.

    :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.models.IotHubProperties
    :ivar sku: IotHub SKU info. Required.
    :vartype sku: ~azure.mgmt.iothub.models.IotHubSkuInfo
    :ivar identity: The managed identities for the IotHub.
    :vartype identity: ~azure.mgmt.iothub.models.ArmIdentity
    :ivar system_data: The system meta data relating to this resource.
    :vartype system_data: ~azure.mgmt.iothub.models.SystemData
    """

    _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},
        "system_data": {"readonly": 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"},
        "identity": {"key": "identity", "type": "ArmIdentity"},
        "system_data": {"key": "systemData", "type": "SystemData"},
    }

    def __init__(
        self,
        *,
        location: str,
        sku: "_models.IotHubSkuInfo",
        tags: Optional[Dict[str, str]] = None,
        etag: Optional[str] = None,
        properties: Optional["_models.IotHubProperties"] = None,
        identity: Optional["_models.ArmIdentity"] = 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.models.IotHubProperties
        :keyword sku: IotHub SKU info. Required.
        :paramtype sku: ~azure.mgmt.iothub.models.IotHubSkuInfo
        :keyword identity: The managed identities for the IotHub.
        :paramtype identity: ~azure.mgmt.iothub.models.ArmIdentity
        """
        super().__init__(location=location, tags=tags, **kwargs)
        self.etag = etag
        self.properties = properties
        self.sku = sku
        self.identity = identity
        self.system_data: Optional["_models.SystemData"] = None


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.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.models.IotHubDescription]
        """
        super().__init__(**kwargs)
        self.value = value
        self.next_link: Optional[str] = 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.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.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.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: Optional[bool] = None
        self.reason: Optional[Union[str, "_models.IotHubNameUnavailabilityReason"]] = None
        self.message = message


class IotHubProperties(_serialization.Model):
    """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.models.SharedAccessSignatureAuthorizationRule]
    :ivar disable_local_auth: If true, SAS tokens with Iot hub scoped SAS keys cannot be used for
     authentication.
    :vartype disable_local_auth: bool
    :ivar disable_device_sas: If true, all device(including Edge devices but excluding modules)
     scoped SAS keys cannot be used for authentication.
    :vartype disable_device_sas: bool
    :ivar disable_module_sas: If true, all module scoped SAS keys cannot be used for
     authentication.
    :vartype disable_module_sas: bool
    :ivar restrict_outbound_network_access: If true, egress from IotHub will be restricted to only
     the allowed FQDNs that are configured via allowedFqdnList.
    :vartype restrict_outbound_network_access: bool
    :ivar allowed_fqdn_list: List of allowed FQDNs(Fully Qualified Domain Name) for egress from Iot
     Hub.
    :vartype allowed_fqdn_list: list[str]
    :ivar public_network_access: Whether requests from Public Network are allowed. Known values
     are: "Enabled" and "Disabled".
    :vartype public_network_access: str or ~azure.mgmt.iothub.models.PublicNetworkAccess
    :ivar ip_filter_rules: The IP filter rules.
    :vartype ip_filter_rules: list[~azure.mgmt.iothub.models.IpFilterRule]
    :ivar network_rule_sets: Network Rule Set Properties of IotHub.
    :vartype network_rule_sets: ~azure.mgmt.iothub.models.NetworkRuleSetProperties
    :ivar min_tls_version: Specifies the minimum TLS version to support for this hub. Can be set to
     "1.2" to have clients that use a TLS version below 1.2 to be rejected.
    :vartype min_tls_version: str
    :ivar private_endpoint_connections: Private endpoint connections created on this IotHub.
    :vartype private_endpoint_connections:
     list[~azure.mgmt.iothub.models.PrivateEndpointConnection]
    :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.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.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.models.StorageEndpointProperties]
    :ivar messaging_endpoints: The messaging endpoint properties for the file upload notification
     queue.
    :vartype messaging_endpoints: dict[str, ~azure.mgmt.iothub.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.models.CloudToDeviceProperties
    :ivar comments: IoT hub comments.
    :vartype comments: str
    :ivar device_streams: The device streams properties of iothub.
    :vartype device_streams: ~azure.mgmt.iothub.models.IotHubPropertiesDeviceStreams
    :ivar features: The capabilities and features enabled for the IoT hub. Known values are: "None"
     and "DeviceManagement".
    :vartype features: str or ~azure.mgmt.iothub.models.Capabilities
    :ivar encryption: The encryption properties for the IoT hub.
    :vartype encryption: ~azure.mgmt.iothub.models.EncryptionPropertiesDescription
    :ivar locations: Primary and secondary location for iot hub.
    :vartype locations: list[~azure.mgmt.iothub.models.IotHubLocationDescription]
    :ivar enable_data_residency: This property when set to true, will enable data residency, thus,
     disabling disaster recovery.
    :vartype enable_data_residency: bool
    :ivar root_certificate: This property store root certificate related information.
    :vartype root_certificate: ~azure.mgmt.iothub.models.RootCertificateProperties
    :ivar ip_version: This property specifies the IP Version the hub is currently utilizing. Known
     values are: "ipv4", "ipv6", and "ipv4ipv6".
    :vartype ip_version: str or ~azure.mgmt.iothub.models.IpVersion
    """

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

    _attribute_map = {
        "authorization_policies": {"key": "authorizationPolicies", "type": "[SharedAccessSignatureAuthorizationRule]"},
        "disable_local_auth": {"key": "disableLocalAuth", "type": "bool"},
        "disable_device_sas": {"key": "disableDeviceSAS", "type": "bool"},
        "disable_module_sas": {"key": "disableModuleSAS", "type": "bool"},
        "restrict_outbound_network_access": {"key": "restrictOutboundNetworkAccess", "type": "bool"},
        "allowed_fqdn_list": {"key": "allowedFqdnList", "type": "[str]"},
        "public_network_access": {"key": "publicNetworkAccess", "type": "str"},
        "ip_filter_rules": {"key": "ipFilterRules", "type": "[IpFilterRule]"},
        "network_rule_sets": {"key": "networkRuleSets", "type": "NetworkRuleSetProperties"},
        "min_tls_version": {"key": "minTlsVersion", "type": "str"},
        "private_endpoint_connections": {"key": "privateEndpointConnections", "type": "[PrivateEndpointConnection]"},
        "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"},
        "device_streams": {"key": "deviceStreams", "type": "IotHubPropertiesDeviceStreams"},
        "features": {"key": "features", "type": "str"},
        "encryption": {"key": "encryption", "type": "EncryptionPropertiesDescription"},
        "locations": {"key": "locations", "type": "[IotHubLocationDescription]"},
        "enable_data_residency": {"key": "enableDataResidency", "type": "bool"},
        "root_certificate": {"key": "rootCertificate", "type": "RootCertificateProperties"},
        "ip_version": {"key": "ipVersion", "type": "str"},
    }

    def __init__(  # pylint: disable=too-many-locals
        self,
        *,
        authorization_policies: Optional[List["_models.SharedAccessSignatureAuthorizationRule"]] = None,
        disable_local_auth: Optional[bool] = None,
        disable_device_sas: Optional[bool] = None,
        disable_module_sas: Optional[bool] = None,
        restrict_outbound_network_access: Optional[bool] = None,
        allowed_fqdn_list: Optional[List[str]] = None,
        public_network_access: Optional[Union[str, "_models.PublicNetworkAccess"]] = None,
        ip_filter_rules: Optional[List["_models.IpFilterRule"]] = None,
        network_rule_sets: Optional["_models.NetworkRuleSetProperties"] = None,
        min_tls_version: Optional[str] = None,
        private_endpoint_connections: Optional[List["_models.PrivateEndpointConnection"]] = 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,
        device_streams: Optional["_models.IotHubPropertiesDeviceStreams"] = None,
        features: Optional[Union[str, "_models.Capabilities"]] = None,
        encryption: Optional["_models.EncryptionPropertiesDescription"] = None,
        enable_data_residency: Optional[bool] = None,
        root_certificate: Optional["_models.RootCertificateProperties"] = None,
        ip_version: Optional[Union[str, "_models.IpVersion"]] = 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.models.SharedAccessSignatureAuthorizationRule]
        :keyword disable_local_auth: If true, SAS tokens with Iot hub scoped SAS keys cannot be used
         for authentication.
        :paramtype disable_local_auth: bool
        :keyword disable_device_sas: If true, all device(including Edge devices but excluding modules)
         scoped SAS keys cannot be used for authentication.
        :paramtype disable_device_sas: bool
        :keyword disable_module_sas: If true, all module scoped SAS keys cannot be used for
         authentication.
        :paramtype disable_module_sas: bool
        :keyword restrict_outbound_network_access: If true, egress from IotHub will be restricted to
         only the allowed FQDNs that are configured via allowedFqdnList.
        :paramtype restrict_outbound_network_access: bool
        :keyword allowed_fqdn_list: List of allowed FQDNs(Fully Qualified Domain Name) for egress from
         Iot Hub.
        :paramtype allowed_fqdn_list: list[str]
        :keyword public_network_access: Whether requests from Public Network are allowed. Known values
         are: "Enabled" and "Disabled".
        :paramtype public_network_access: str or ~azure.mgmt.iothub.models.PublicNetworkAccess
        :keyword ip_filter_rules: The IP filter rules.
        :paramtype ip_filter_rules: list[~azure.mgmt.iothub.models.IpFilterRule]
        :keyword network_rule_sets: Network Rule Set Properties of IotHub.
        :paramtype network_rule_sets: ~azure.mgmt.iothub.models.NetworkRuleSetProperties
        :keyword min_tls_version: Specifies the minimum TLS version to support for this hub. Can be set
         to "1.2" to have clients that use a TLS version below 1.2 to be rejected.
        :paramtype min_tls_version: str
        :keyword private_endpoint_connections: Private endpoint connections created on this IotHub.
        :paramtype private_endpoint_connections:
         list[~azure.mgmt.iothub.models.PrivateEndpointConnection]
        :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.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.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.models.StorageEndpointProperties]
        :keyword messaging_endpoints: The messaging endpoint properties for the file upload
         notification queue.
        :paramtype messaging_endpoints: dict[str,
         ~azure.mgmt.iothub.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.models.CloudToDeviceProperties
        :keyword comments: IoT hub comments.
        :paramtype comments: str
        :keyword device_streams: The device streams properties of iothub.
        :paramtype device_streams: ~azure.mgmt.iothub.models.IotHubPropertiesDeviceStreams
        :keyword features: The capabilities and features enabled for the IoT hub. Known values are:
         "None" and "DeviceManagement".
        :paramtype features: str or ~azure.mgmt.iothub.models.Capabilities
        :keyword encryption: The encryption properties for the IoT hub.
        :paramtype encryption: ~azure.mgmt.iothub.models.EncryptionPropertiesDescription
        :keyword enable_data_residency: This property when set to true, will enable data residency,
         thus, disabling disaster recovery.
        :paramtype enable_data_residency: bool
        :keyword root_certificate: This property store root certificate related information.
        :paramtype root_certificate: ~azure.mgmt.iothub.models.RootCertificateProperties
        :keyword ip_version: This property specifies the IP Version the hub is currently utilizing.
         Known values are: "ipv4", "ipv6", and "ipv4ipv6".
        :paramtype ip_version: str or ~azure.mgmt.iothub.models.IpVersion
        """
        super().__init__(**kwargs)
        self.authorization_policies = authorization_policies
        self.disable_local_auth = disable_local_auth
        self.disable_device_sas = disable_device_sas
        self.disable_module_sas = disable_module_sas
        self.restrict_outbound_network_access = restrict_outbound_network_access
        self.allowed_fqdn_list = allowed_fqdn_list
        self.public_network_access = public_network_access
        self.ip_filter_rules = ip_filter_rules
        self.network_rule_sets = network_rule_sets
        self.min_tls_version = min_tls_version
        self.private_endpoint_connections = private_endpoint_connections
        self.provisioning_state: Optional[str] = None
        self.state: Optional[str] = None
        self.host_name: Optional[str] = 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.device_streams = device_streams
        self.features = features
        self.encryption = encryption
        self.locations: Optional[List["_models.IotHubLocationDescription"]] = None
        self.enable_data_residency = enable_data_residency
        self.root_certificate = root_certificate
        self.ip_version = ip_version


class IotHubPropertiesDeviceStreams(_serialization.Model):
    """The device streams properties of iothub.

    :ivar streaming_endpoints: List of Device Streams Endpoints.
    :vartype streaming_endpoints: list[str]
    """

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

    def __init__(self, *, streaming_endpoints: Optional[List[str]] = None, **kwargs: Any) -> None:
        """
        :keyword streaming_endpoints: List of Device Streams Endpoints.
        :paramtype streaming_endpoints: list[str]
        """
        super().__init__(**kwargs)
        self.streaming_endpoints = streaming_endpoints


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: Optional[str] = None
        self.current_value: Optional[int] = None
        self.max_value: Optional[int] = 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.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.models.IotHubQuotaMetricInfo]
        """
        super().__init__(**kwargs)
        self.value = value
        self.next_link: Optional[str] = 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 server.

    :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.models.IotHubSkuInfo
    :ivar capacity: IotHub capacity. Required.
    :vartype capacity: ~azure.mgmt.iothub.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.models.IotHubSkuInfo
        :keyword capacity: IotHub capacity. Required.
        :paramtype capacity: ~azure.mgmt.iothub.models.IotHubCapacity
        """
        super().__init__(**kwargs)
        self.resource_type: Optional[str] = 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.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.models.IotHubSkuDescription]
        """
        super().__init__(**kwargs)
        self.value = value
        self.next_link: Optional[str] = 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 server.

    :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.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.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.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: Optional[Union[str, "_models.IotHubSkuTier"]] = 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 server.

    :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.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.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", "firmwareUpdate", and "import".
    :vartype type: str or ~azure.mgmt.iothub.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.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: Optional[str] = None
        self.start_time_utc: Optional[datetime.datetime] = None
        self.end_time_utc: Optional[datetime.datetime] = None
        self.type: Optional[Union[str, "_models.JobType"]] = None
        self.status: Optional[Union[str, "_models.JobStatus"]] = None
        self.failure_reason: Optional[str] = None
        self.status_message: Optional[str] = None
        self.parent_job_id: Optional[str] = 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.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.models.JobResponse]
        """
        super().__init__(**kwargs)
        self.value = value
        self.next_link: Optional[str] = None


class KeyVaultKeyProperties(_serialization.Model):
    """The properties of the KeyVault key.

    :ivar key_identifier: The identifier of the key.
    :vartype key_identifier: str
    :ivar identity: Managed identity properties of KeyVault Key.
    :vartype identity: ~azure.mgmt.iothub.models.ManagedIdentity
    """

    _attribute_map = {
        "key_identifier": {"key": "keyIdentifier", "type": "str"},
        "identity": {"key": "identity", "type": "ManagedIdentity"},
    }

    def __init__(
        self,
        *,
        key_identifier: Optional[str] = None,
        identity: Optional["_models.ManagedIdentity"] = None,
        **kwargs: Any
    ) -> None:
        """
        :keyword key_identifier: The identifier of the key.
        :paramtype key_identifier: str
        :keyword identity: Managed identity properties of KeyVault Key.
        :paramtype identity: ~azure.mgmt.iothub.models.ManagedIdentity
        """
        super().__init__(**kwargs)
        self.key_identifier = key_identifier
        self.identity = identity


class ManagedIdentity(_serialization.Model):
    """The properties of the Managed identity.

    :ivar user_assigned_identity: The user assigned identity.
    :vartype user_assigned_identity: str
    """

    _attribute_map = {
        "user_assigned_identity": {"key": "userAssignedIdentity", "type": "str"},
    }

    def __init__(self, *, user_assigned_identity: Optional[str] = None, **kwargs: Any) -> None:
        """
        :keyword user_assigned_identity: The user assigned identity.
        :paramtype user_assigned_identity: str
        """
        super().__init__(**kwargs)
        self.user_assigned_identity = user_assigned_identity


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

    :ivar properties: Properties of routes that matched.
    :vartype properties: ~azure.mgmt.iothub.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.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 NetworkRuleSetIpRule(_serialization.Model):
    """IP Rule to be applied as part of Network Rule Set.

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

    :ivar filter_name: Name of the IP filter rule. Required.
    :vartype filter_name: str
    :ivar action: IP Filter Action. "Allow"
    :vartype action: str or ~azure.mgmt.iothub.models.NetworkRuleIPAction
    :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},
        "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,
        ip_mask: str,
        action: Union[str, "_models.NetworkRuleIPAction"] = "Allow",
        **kwargs: Any
    ) -> None:
        """
        :keyword filter_name: Name of the IP filter rule. Required.
        :paramtype filter_name: str
        :keyword action: IP Filter Action. "Allow"
        :paramtype action: str or ~azure.mgmt.iothub.models.NetworkRuleIPAction
        :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 NetworkRuleSetProperties(_serialization.Model):
    """Network Rule Set Properties of IotHub.

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

    :ivar default_action: Default Action for Network Rule Set. Known values are: "Deny" and
     "Allow".
    :vartype default_action: str or ~azure.mgmt.iothub.models.DefaultAction
    :ivar apply_to_built_in_event_hub_endpoint: If True, then Network Rule Set is also applied to
     BuiltIn EventHub EndPoint of IotHub. Required.
    :vartype apply_to_built_in_event_hub_endpoint: bool
    :ivar ip_rules: List of IP Rules. Required.
    :vartype ip_rules: list[~azure.mgmt.iothub.models.NetworkRuleSetIpRule]
    """

    _validation = {
        "apply_to_built_in_event_hub_endpoint": {"required": True},
        "ip_rules": {"required": True},
    }

    _attribute_map = {
        "default_action": {"key": "defaultAction", "type": "str"},
        "apply_to_built_in_event_hub_endpoint": {"key": "applyToBuiltInEventHubEndpoint", "type": "bool"},
        "ip_rules": {"key": "ipRules", "type": "[NetworkRuleSetIpRule]"},
    }

    def __init__(
        self,
        *,
        apply_to_built_in_event_hub_endpoint: bool,
        ip_rules: List["_models.NetworkRuleSetIpRule"],
        default_action: Union[str, "_models.DefaultAction"] = "Deny",
        **kwargs: Any
    ) -> None:
        """
        :keyword default_action: Default Action for Network Rule Set. Known values are: "Deny" and
         "Allow".
        :paramtype default_action: str or ~azure.mgmt.iothub.models.DefaultAction
        :keyword apply_to_built_in_event_hub_endpoint: If True, then Network Rule Set is also applied
         to BuiltIn EventHub EndPoint of IotHub. Required.
        :paramtype apply_to_built_in_event_hub_endpoint: bool
        :keyword ip_rules: List of IP Rules. Required.
        :paramtype ip_rules: list[~azure.mgmt.iothub.models.NetworkRuleSetIpRule]
        """
        super().__init__(**kwargs)
        self.default_action = default_action
        self.apply_to_built_in_event_hub_endpoint = apply_to_built_in_event_hub_endpoint
        self.ip_rules = ip_rules


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.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.models.OperationDisplay
        """
        super().__init__(**kwargs)
        self.name: Optional[str] = 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: Optional[str] = None
        self.resource: Optional[str] = None
        self.operation: Optional[str] = None
        self.description: Optional[str] = None


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

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

    :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.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: Optional[List["_models.Operation"]] = None
        self.next_link: Optional[str] = None


class PrivateEndpoint(_serialization.Model):
    """The private endpoint property of a private endpoint connection.

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

    :ivar id: The resource identifier.
    :vartype id: str
    """

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

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

    def __init__(self, **kwargs: Any) -> None:
        """ """
        super().__init__(**kwargs)
        self.id: Optional[str] = None


class PrivateEndpointConnection(_serialization.Model):
    """The private endpoint connection of an IotHub.

    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 server.

    :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 properties: The properties of a private endpoint connection. Required.
    :vartype properties: ~azure.mgmt.iothub.models.PrivateEndpointConnectionProperties
    """

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

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

    def __init__(self, *, properties: "_models.PrivateEndpointConnectionProperties", **kwargs: Any) -> None:
        """
        :keyword properties: The properties of a private endpoint connection. Required.
        :paramtype properties: ~azure.mgmt.iothub.models.PrivateEndpointConnectionProperties
        """
        super().__init__(**kwargs)
        self.id: Optional[str] = None
        self.name: Optional[str] = None
        self.type: Optional[str] = None
        self.properties = properties


class PrivateEndpointConnectionProperties(_serialization.Model):
    """The properties of a private endpoint connection.

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

    :ivar private_endpoint: The private endpoint property of a private endpoint connection.
    :vartype private_endpoint: ~azure.mgmt.iothub.models.PrivateEndpoint
    :ivar private_link_service_connection_state: The current state of a private endpoint
     connection. Required.
    :vartype private_link_service_connection_state:
     ~azure.mgmt.iothub.models.PrivateLinkServiceConnectionState
    """

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

    _attribute_map = {
        "private_endpoint": {"key": "privateEndpoint", "type": "PrivateEndpoint"},
        "private_link_service_connection_state": {
            "key": "privateLinkServiceConnectionState",
            "type": "PrivateLinkServiceConnectionState",
        },
    }

    def __init__(
        self,
        *,
        private_link_service_connection_state: "_models.PrivateLinkServiceConnectionState",
        private_endpoint: Optional["_models.PrivateEndpoint"] = None,
        **kwargs: Any
    ) -> None:
        """
        :keyword private_endpoint: The private endpoint property of a private endpoint connection.
        :paramtype private_endpoint: ~azure.mgmt.iothub.models.PrivateEndpoint
        :keyword private_link_service_connection_state: The current state of a private endpoint
         connection. Required.
        :paramtype private_link_service_connection_state:
         ~azure.mgmt.iothub.models.PrivateLinkServiceConnectionState
        """
        super().__init__(**kwargs)
        self.private_endpoint = private_endpoint
        self.private_link_service_connection_state = private_link_service_connection_state


class PrivateLinkResources(_serialization.Model):
    """The available private link resources for an IotHub.

    :ivar value: The list of available private link resources for an IotHub.
    :vartype value: list[~azure.mgmt.iothub.models.GroupIdInformation]
    """

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

    def __init__(self, *, value: Optional[List["_models.GroupIdInformation"]] = None, **kwargs: Any) -> None:
        """
        :keyword value: The list of available private link resources for an IotHub.
        :paramtype value: list[~azure.mgmt.iothub.models.GroupIdInformation]
        """
        super().__init__(**kwargs)
        self.value = value


class PrivateLinkServiceConnectionState(_serialization.Model):
    """The current state of a private endpoint connection.

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

    :ivar status: The status of a private endpoint connection. Required. Known values are:
     "Pending", "Approved", "Rejected", and "Disconnected".
    :vartype status: str or ~azure.mgmt.iothub.models.PrivateLinkServiceConnectionStatus
    :ivar description: The description for the current state of a private endpoint connection.
     Required.
    :vartype description: str
    :ivar actions_required: Actions required for a private endpoint connection.
    :vartype actions_required: str
    """

    _validation = {
        "status": {"required": True},
        "description": {"required": True},
    }

    _attribute_map = {
        "status": {"key": "status", "type": "str"},
        "description": {"key": "description", "type": "str"},
        "actions_required": {"key": "actionsRequired", "type": "str"},
    }

    def __init__(
        self,
        *,
        status: Union[str, "_models.PrivateLinkServiceConnectionStatus"],
        description: str,
        actions_required: Optional[str] = None,
        **kwargs: Any
    ) -> None:
        """
        :keyword status: The status of a private endpoint connection. Required. Known values are:
         "Pending", "Approved", "Rejected", and "Disconnected".
        :paramtype status: str or ~azure.mgmt.iothub.models.PrivateLinkServiceConnectionStatus
        :keyword description: The description for the current state of a private endpoint connection.
         Required.
        :paramtype description: str
        :keyword actions_required: Actions required for a private endpoint connection.
        :paramtype actions_required: str
        """
        super().__init__(**kwargs)
        self.status = status
        self.description = description
        self.actions_required = actions_required


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: Optional[int] = None
        self.enabled_device_count: Optional[int] = None
        self.disabled_device_count: Optional[int] = None


class RootCertificateProperties(_serialization.Model):
    """This property store root certificate related information.

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

    :ivar enable_root_certificate_v2: This property when set to true, hub will use G2 cert; while
     it's set to false, hub uses Baltimore Cert.
    :vartype enable_root_certificate_v2: bool
    :ivar last_updated_time_utc: the last update time to root certificate flag.
    :vartype last_updated_time_utc: ~datetime.datetime
    """

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

    _attribute_map = {
        "enable_root_certificate_v2": {"key": "enableRootCertificateV2", "type": "bool"},
        "last_updated_time_utc": {"key": "lastUpdatedTimeUtc", "type": "iso-8601"},
    }

    def __init__(self, *, enable_root_certificate_v2: Optional[bool] = None, **kwargs: Any) -> None:
        """
        :keyword enable_root_certificate_v2: This property when set to true, hub will use G2 cert;
         while it's set to false, hub uses Baltimore Cert.
        :paramtype enable_root_certificate_v2: bool
        """
        super().__init__(**kwargs)
        self.enable_root_certificate_v2 = enable_root_certificate_v2
        self.last_updated_time_utc: Optional[datetime.datetime] = 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.models.RouteErrorSeverity
    :ivar location: Location where the route error happened.
    :vartype location: ~azure.mgmt.iothub.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.models.RouteErrorSeverity
        :keyword location: Location where the route error happened.
        :paramtype location: ~azure.mgmt.iothub.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.models.RouteErrorPosition
    :ivar end: End where the route error happened.
    :vartype end: ~azure.mgmt.iothub.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.models.RouteErrorPosition
        :keyword end: End where the route error happened.
        :paramtype end: ~azure.mgmt.iothub.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 server.

    :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", "DeviceJobLifecycleEvents", "DigitalTwinChangeEvents",
     "DeviceConnectionStateEvents", and "MqttBrokerMessages".
    :vartype source: str or ~azure.mgmt.iothub.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", "DeviceJobLifecycleEvents", "DigitalTwinChangeEvents",
         "DeviceConnectionStateEvents", and "MqttBrokerMessages".
        :paramtype source: str or ~azure.mgmt.iothub.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 RoutingCosmosDBSqlApiProperties(_serialization.Model):
    """The properties related to a cosmos DB sql container endpoint.

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

    :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 id: Id of the cosmos DB sql container endpoint.
    :vartype id: str
    :ivar subscription_id: The subscription identifier of the cosmos DB account.
    :vartype subscription_id: str
    :ivar resource_group: The name of the resource group of the cosmos DB account.
    :vartype resource_group: str
    :ivar endpoint_uri: The url of the cosmos DB account. It must include the protocol https://.
     Required.
    :vartype endpoint_uri: str
    :ivar authentication_type: Method used to authenticate against the cosmos DB sql container
     endpoint. Known values are: "keyBased" and "identityBased".
    :vartype authentication_type: str or ~azure.mgmt.iothub.models.AuthenticationType
    :ivar identity: Managed identity properties of routing cosmos DB container endpoint.
    :vartype identity: ~azure.mgmt.iothub.models.ManagedIdentity
    :ivar primary_key: The primary key of the cosmos DB account.
    :vartype primary_key: str
    :ivar secondary_key: The secondary key of the cosmos DB account.
    :vartype secondary_key: str
    :ivar database_name: The name of the cosmos DB database in the cosmos DB account. Required.
    :vartype database_name: str
    :ivar container_name: The name of the cosmos DB sql container in the cosmos DB database.
     Required.
    :vartype container_name: str
    :ivar partition_key_name: The name of the partition key associated with this cosmos DB sql
     container if one exists. This is an optional parameter.
    :vartype partition_key_name: str
    :ivar partition_key_template: The template for generating a synthetic partition key value for
     use with this cosmos DB sql container. The template must include at least one of the following
     placeholders: {iothub}, {deviceid}, {DD}, {MM}, and {YYYY}. Any one placeholder may be
     specified at most once, but order and non-placeholder components are arbitrary. This parameter
     is only required if PartitionKeyName is specified.
    :vartype partition_key_template: str
    """

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

    _attribute_map = {
        "name": {"key": "name", "type": "str"},
        "id": {"key": "id", "type": "str"},
        "subscription_id": {"key": "subscriptionId", "type": "str"},
        "resource_group": {"key": "resourceGroup", "type": "str"},
        "endpoint_uri": {"key": "endpointUri", "type": "str"},
        "authentication_type": {"key": "authenticationType", "type": "str"},
        "identity": {"key": "identity", "type": "ManagedIdentity"},
        "primary_key": {"key": "primaryKey", "type": "str"},
        "secondary_key": {"key": "secondaryKey", "type": "str"},
        "database_name": {"key": "databaseName", "type": "str"},
        "container_name": {"key": "containerName", "type": "str"},
        "partition_key_name": {"key": "partitionKeyName", "type": "str"},
        "partition_key_template": {"key": "partitionKeyTemplate", "type": "str"},
    }

    def __init__(
        self,
        *,
        name: str,
        endpoint_uri: str,
        database_name: str,
        container_name: str,
        id: Optional[str] = None,  # pylint: disable=redefined-builtin
        subscription_id: Optional[str] = None,
        resource_group: Optional[str] = None,
        authentication_type: Optional[Union[str, "_models.AuthenticationType"]] = None,
        identity: Optional["_models.ManagedIdentity"] = None,
        primary_key: Optional[str] = None,
        secondary_key: Optional[str] = None,
        partition_key_name: Optional[str] = None,
        partition_key_template: Optional[str] = None,
        **kwargs: Any
    ) -> None:
        """
        :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 id: Id of the cosmos DB sql container endpoint.
        :paramtype id: str
        :keyword subscription_id: The subscription identifier of the cosmos DB account.
        :paramtype subscription_id: str
        :keyword resource_group: The name of the resource group of the cosmos DB account.
        :paramtype resource_group: str
        :keyword endpoint_uri: The url of the cosmos DB account. It must include the protocol https://.
         Required.
        :paramtype endpoint_uri: str
        :keyword authentication_type: Method used to authenticate against the cosmos DB sql container
         endpoint. Known values are: "keyBased" and "identityBased".
        :paramtype authentication_type: str or ~azure.mgmt.iothub.models.AuthenticationType
        :keyword identity: Managed identity properties of routing cosmos DB container endpoint.
        :paramtype identity: ~azure.mgmt.iothub.models.ManagedIdentity
        :keyword primary_key: The primary key of the cosmos DB account.
        :paramtype primary_key: str
        :keyword secondary_key: The secondary key of the cosmos DB account.
        :paramtype secondary_key: str
        :keyword database_name: The name of the cosmos DB database in the cosmos DB account. Required.
        :paramtype database_name: str
        :keyword container_name: The name of the cosmos DB sql container in the cosmos DB database.
         Required.
        :paramtype container_name: str
        :keyword partition_key_name: The name of the partition key associated with this cosmos DB sql
         container if one exists. This is an optional parameter.
        :paramtype partition_key_name: str
        :keyword partition_key_template: The template for generating a synthetic partition key value
         for use with this cosmos DB sql container. The template must include at least one of the
         following placeholders: {iothub}, {deviceid}, {DD}, {MM}, and {YYYY}. Any one placeholder may
         be specified at most once, but order and non-placeholder components are arbitrary. This
         parameter is only required if PartitionKeyName is specified.
        :paramtype partition_key_template: str
        """
        super().__init__(**kwargs)
        self.name = name
        self.id = id
        self.subscription_id = subscription_id
        self.resource_group = resource_group
        self.endpoint_uri = endpoint_uri
        self.authentication_type = authentication_type
        self.identity = identity
        self.primary_key = primary_key
        self.secondary_key = secondary_key
        self.database_name = database_name
        self.container_name = container_name
        self.partition_key_name = partition_key_name
        self.partition_key_template = partition_key_template


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.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.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.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.models.RoutingStorageContainerProperties]
    :ivar cosmos_db_sql_containers: The list of Cosmos DB container endpoints that IoT hub routes
     messages to, based on the routing rules.
    :vartype cosmos_db_sql_containers:
     list[~azure.mgmt.iothub.models.RoutingCosmosDBSqlApiProperties]
    """

    _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]"},
        "cosmos_db_sql_containers": {"key": "cosmosDBSqlContainers", "type": "[RoutingCosmosDBSqlApiProperties]"},
    }

    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,
        cosmos_db_sql_containers: Optional[List["_models.RoutingCosmosDBSqlApiProperties"]] = 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.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.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.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.models.RoutingStorageContainerProperties]
        :keyword cosmos_db_sql_containers: The list of Cosmos DB container endpoints that IoT hub
         routes messages to, based on the routing rules.
        :paramtype cosmos_db_sql_containers:
         list[~azure.mgmt.iothub.models.RoutingCosmosDBSqlApiProperties]
        """
        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
        self.cosmos_db_sql_containers = cosmos_db_sql_containers


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

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

    :ivar id: Id of the event hub endpoint.
    :vartype id: str
    :ivar connection_string: The connection string of the event hub endpoint.
    :vartype connection_string: str
    :ivar endpoint_uri: The url of the event hub endpoint. It must include the protocol sb://.
    :vartype endpoint_uri: str
    :ivar entity_path: Event hub name on the event hub namespace.
    :vartype entity_path: str
    :ivar authentication_type: Method used to authenticate against the event hub endpoint. Known
     values are: "keyBased" and "identityBased".
    :vartype authentication_type: str or ~azure.mgmt.iothub.models.AuthenticationType
    :ivar identity: Managed identity properties of routing event hub endpoint.
    :vartype identity: ~azure.mgmt.iothub.models.ManagedIdentity
    :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 = {
        "name": {"required": True, "pattern": r"^[A-Za-z0-9-._]{1,64}$"},
    }

    _attribute_map = {
        "id": {"key": "id", "type": "str"},
        "connection_string": {"key": "connectionString", "type": "str"},
        "endpoint_uri": {"key": "endpointUri", "type": "str"},
        "entity_path": {"key": "entityPath", "type": "str"},
        "authentication_type": {"key": "authenticationType", "type": "str"},
        "identity": {"key": "identity", "type": "ManagedIdentity"},
        "name": {"key": "name", "type": "str"},
        "subscription_id": {"key": "subscriptionId", "type": "str"},
        "resource_group": {"key": "resourceGroup", "type": "str"},
    }

    def __init__(
        self,
        *,
        name: str,
        id: Optional[str] = None,  # pylint: disable=redefined-builtin
        connection_string: Optional[str] = None,
        endpoint_uri: Optional[str] = None,
        entity_path: Optional[str] = None,
        authentication_type: Optional[Union[str, "_models.AuthenticationType"]] = None,
        identity: Optional["_models.ManagedIdentity"] = None,
        subscription_id: Optional[str] = None,
        resource_group: Optional[str] = None,
        **kwargs: Any
    ) -> None:
        """
        :keyword id: Id of the event hub endpoint.
        :paramtype id: str
        :keyword connection_string: The connection string of the event hub endpoint.
        :paramtype connection_string: str
        :keyword endpoint_uri: The url of the event hub endpoint. It must include the protocol sb://.
        :paramtype endpoint_uri: str
        :keyword entity_path: Event hub name on the event hub namespace.
        :paramtype entity_path: str
        :keyword authentication_type: Method used to authenticate against the event hub endpoint. Known
         values are: "keyBased" and "identityBased".
        :paramtype authentication_type: str or ~azure.mgmt.iothub.models.AuthenticationType
        :keyword identity: Managed identity properties of routing event hub endpoint.
        :paramtype identity: ~azure.mgmt.iothub.models.ManagedIdentity
        :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.id = id
        self.connection_string = connection_string
        self.endpoint_uri = endpoint_uri
        self.entity_path = entity_path
        self.authentication_type = authentication_type
        self.identity = identity
        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.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.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.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.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.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.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.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.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 server.

    :ivar id: Id of the service bus queue endpoint.
    :vartype id: str
    :ivar connection_string: The connection string of the service bus queue endpoint.
    :vartype connection_string: str
    :ivar endpoint_uri: The url of the service bus queue endpoint. It must include the protocol
     sb://.
    :vartype endpoint_uri: str
    :ivar entity_path: Queue name on the service bus namespace.
    :vartype entity_path: str
    :ivar authentication_type: Method used to authenticate against the service bus queue endpoint.
     Known values are: "keyBased" and "identityBased".
    :vartype authentication_type: str or ~azure.mgmt.iothub.models.AuthenticationType
    :ivar identity: Managed identity properties of routing service bus queue endpoint.
    :vartype identity: ~azure.mgmt.iothub.models.ManagedIdentity
    :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 = {
        "name": {"required": True, "pattern": r"^[A-Za-z0-9-._]{1,64}$"},
    }

    _attribute_map = {
        "id": {"key": "id", "type": "str"},
        "connection_string": {"key": "connectionString", "type": "str"},
        "endpoint_uri": {"key": "endpointUri", "type": "str"},
        "entity_path": {"key": "entityPath", "type": "str"},
        "authentication_type": {"key": "authenticationType", "type": "str"},
        "identity": {"key": "identity", "type": "ManagedIdentity"},
        "name": {"key": "name", "type": "str"},
        "subscription_id": {"key": "subscriptionId", "type": "str"},
        "resource_group": {"key": "resourceGroup", "type": "str"},
    }

    def __init__(
        self,
        *,
        name: str,
        id: Optional[str] = None,  # pylint: disable=redefined-builtin
        connection_string: Optional[str] = None,
        endpoint_uri: Optional[str] = None,
        entity_path: Optional[str] = None,
        authentication_type: Optional[Union[str, "_models.AuthenticationType"]] = None,
        identity: Optional["_models.ManagedIdentity"] = None,
        subscription_id: Optional[str] = None,
        resource_group: Optional[str] = None,
        **kwargs: Any
    ) -> None:
        """
        :keyword id: Id of the service bus queue endpoint.
        :paramtype id: str
        :keyword connection_string: The connection string of the service bus queue endpoint.
        :paramtype connection_string: str
        :keyword endpoint_uri: The url of the service bus queue endpoint. It must include the protocol
         sb://.
        :paramtype endpoint_uri: str
        :keyword entity_path: Queue name on the service bus namespace.
        :paramtype entity_path: str
        :keyword authentication_type: Method used to authenticate against the service bus queue
         endpoint. Known values are: "keyBased" and "identityBased".
        :paramtype authentication_type: str or ~azure.mgmt.iothub.models.AuthenticationType
        :keyword identity: Managed identity properties of routing service bus queue endpoint.
        :paramtype identity: ~azure.mgmt.iothub.models.ManagedIdentity
        :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.id = id
        self.connection_string = connection_string
        self.endpoint_uri = endpoint_uri
        self.entity_path = entity_path
        self.authentication_type = authentication_type
        self.identity = identity
        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 server.

    :ivar id: Id of the service bus topic endpoint.
    :vartype id: str
    :ivar connection_string: The connection string of the service bus topic endpoint.
    :vartype connection_string: str
    :ivar endpoint_uri: The url of the service bus topic endpoint. It must include the protocol
     sb://.
    :vartype endpoint_uri: str
    :ivar entity_path: Queue name on the service bus topic.
    :vartype entity_path: str
    :ivar authentication_type: Method used to authenticate against the service bus topic endpoint.
     Known values are: "keyBased" and "identityBased".
    :vartype authentication_type: str or ~azure.mgmt.iothub.models.AuthenticationType
    :ivar identity: Managed identity properties of routing service bus topic endpoint.
    :vartype identity: ~azure.mgmt.iothub.models.ManagedIdentity
    :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 = {
        "name": {"required": True, "pattern": r"^[A-Za-z0-9-._]{1,64}$"},
    }

    _attribute_map = {
        "id": {"key": "id", "type": "str"},
        "connection_string": {"key": "connectionString", "type": "str"},
        "endpoint_uri": {"key": "endpointUri", "type": "str"},
        "entity_path": {"key": "entityPath", "type": "str"},
        "authentication_type": {"key": "authenticationType", "type": "str"},
        "identity": {"key": "identity", "type": "ManagedIdentity"},
        "name": {"key": "name", "type": "str"},
        "subscription_id": {"key": "subscriptionId", "type": "str"},
        "resource_group": {"key": "resourceGroup", "type": "str"},
    }

    def __init__(
        self,
        *,
        name: str,
        id: Optional[str] = None,  # pylint: disable=redefined-builtin
        connection_string: Optional[str] = None,
        endpoint_uri: Optional[str] = None,
        entity_path: Optional[str] = None,
        authentication_type: Optional[Union[str, "_models.AuthenticationType"]] = None,
        identity: Optional["_models.ManagedIdentity"] = None,
        subscription_id: Optional[str] = None,
        resource_group: Optional[str] = None,
        **kwargs: Any
    ) -> None:
        """
        :keyword id: Id of the service bus topic endpoint.
        :paramtype id: str
        :keyword connection_string: The connection string of the service bus topic endpoint.
        :paramtype connection_string: str
        :keyword endpoint_uri: The url of the service bus topic endpoint. It must include the protocol
         sb://.
        :paramtype endpoint_uri: str
        :keyword entity_path: Queue name on the service bus topic.
        :paramtype entity_path: str
        :keyword authentication_type: Method used to authenticate against the service bus topic
         endpoint. Known values are: "keyBased" and "identityBased".
        :paramtype authentication_type: str or ~azure.mgmt.iothub.models.AuthenticationType
        :keyword identity: Managed identity properties of routing service bus topic endpoint.
        :paramtype identity: ~azure.mgmt.iothub.models.ManagedIdentity
        :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.id = id
        self.connection_string = connection_string
        self.endpoint_uri = endpoint_uri
        self.entity_path = entity_path
        self.authentication_type = authentication_type
        self.identity = identity
        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 server.

    :ivar id: Id of the storage container endpoint.
    :vartype id: str
    :ivar connection_string: The connection string of the storage account.
    :vartype connection_string: str
    :ivar endpoint_uri: The url of the storage endpoint. It must include the protocol https://.
    :vartype endpoint_uri: str
    :ivar authentication_type: Method used to authenticate against the storage endpoint. Known
     values are: "keyBased" and "identityBased".
    :vartype authentication_type: str or ~azure.mgmt.iothub.models.AuthenticationType
    :ivar identity: Managed identity properties of routing storage endpoint.
    :vartype identity: ~azure.mgmt.iothub.models.ManagedIdentity
    :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.models.RoutingStorageContainerPropertiesEncoding
    """

    _validation = {
        "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 = {
        "id": {"key": "id", "type": "str"},
        "connection_string": {"key": "connectionString", "type": "str"},
        "endpoint_uri": {"key": "endpointUri", "type": "str"},
        "authentication_type": {"key": "authenticationType", "type": "str"},
        "identity": {"key": "identity", "type": "ManagedIdentity"},
        "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,
        *,
        name: str,
        container_name: str,
        id: Optional[str] = None,  # pylint: disable=redefined-builtin
        connection_string: Optional[str] = None,
        endpoint_uri: Optional[str] = None,
        authentication_type: Optional[Union[str, "_models.AuthenticationType"]] = None,
        identity: Optional["_models.ManagedIdentity"] = None,
        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 id: Id of the storage container endpoint.
        :paramtype id: str
        :keyword connection_string: The connection string of the storage account.
        :paramtype connection_string: str
        :keyword endpoint_uri: The url of the storage endpoint. It must include the protocol https://.
        :paramtype endpoint_uri: str
        :keyword authentication_type: Method used to authenticate against the storage endpoint. Known
         values are: "keyBased" and "identityBased".
        :paramtype authentication_type: str or ~azure.mgmt.iothub.models.AuthenticationType
        :keyword identity: Managed identity properties of routing storage endpoint.
        :paramtype identity: ~azure.mgmt.iothub.models.ManagedIdentity
        :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.models.RoutingStorageContainerPropertiesEncoding
        """
        super().__init__(**kwargs)
        self.id = id
        self.connection_string = connection_string
        self.endpoint_uri = endpoint_uri
        self.authentication_type = authentication_type
        self.identity = identity
        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.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.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 server.

    :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.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.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):  # pylint: disable=name-too-long
    """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.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.models.SharedAccessSignatureAuthorizationRule]
        """
        super().__init__(**kwargs)
        self.value = value
        self.next_link: Optional[str] = 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 server.

    :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
    :ivar authentication_type: Specifies authentication type being used for connecting to the
     storage account. Known values are: "keyBased" and "identityBased".
    :vartype authentication_type: str or ~azure.mgmt.iothub.models.AuthenticationType
    :ivar identity: Managed identity properties of storage endpoint for file upload.
    :vartype identity: ~azure.mgmt.iothub.models.ManagedIdentity
    """

    _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"},
        "authentication_type": {"key": "authenticationType", "type": "str"},
        "identity": {"key": "identity", "type": "ManagedIdentity"},
    }

    def __init__(
        self,
        *,
        connection_string: str,
        container_name: str,
        sas_ttl_as_iso8601: Optional[datetime.timedelta] = None,
        authentication_type: Optional[Union[str, "_models.AuthenticationType"]] = None,
        identity: Optional["_models.ManagedIdentity"] = 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
        :keyword authentication_type: Specifies authentication type being used for connecting to the
         storage account. Known values are: "keyBased" and "identityBased".
        :paramtype authentication_type: str or ~azure.mgmt.iothub.models.AuthenticationType
        :keyword identity: Managed identity properties of storage endpoint for file upload.
        :paramtype identity: ~azure.mgmt.iothub.models.ManagedIdentity
        """
        super().__init__(**kwargs)
        self.sas_ttl_as_iso8601 = sas_ttl_as_iso8601
        self.connection_string = connection_string
        self.container_name = container_name
        self.authentication_type = authentication_type
        self.identity = identity


class SystemData(_serialization.Model):
    """Metadata pertaining to creation and last modification of the resource.

    :ivar created_by: The identity that created the resource.
    :vartype created_by: str
    :ivar created_by_type: The type of identity that created the resource. Known values are:
     "User", "Application", "ManagedIdentity", and "Key".
    :vartype created_by_type: str or ~azure.mgmt.iothub.models.CreatedByType
    :ivar created_at: The timestamp of resource creation (UTC).
    :vartype created_at: ~datetime.datetime
    :ivar last_modified_by: The identity that last modified the resource.
    :vartype last_modified_by: str
    :ivar last_modified_by_type: The type of identity that last modified the resource. Known values
     are: "User", "Application", "ManagedIdentity", and "Key".
    :vartype last_modified_by_type: str or ~azure.mgmt.iothub.models.CreatedByType
    :ivar last_modified_at: The timestamp of resource last modification (UTC).
    :vartype last_modified_at: ~datetime.datetime
    """

    _attribute_map = {
        "created_by": {"key": "createdBy", "type": "str"},
        "created_by_type": {"key": "createdByType", "type": "str"},
        "created_at": {"key": "createdAt", "type": "iso-8601"},
        "last_modified_by": {"key": "lastModifiedBy", "type": "str"},
        "last_modified_by_type": {"key": "lastModifiedByType", "type": "str"},
        "last_modified_at": {"key": "lastModifiedAt", "type": "iso-8601"},
    }

    def __init__(
        self,
        *,
        created_by: Optional[str] = None,
        created_by_type: Optional[Union[str, "_models.CreatedByType"]] = None,
        created_at: Optional[datetime.datetime] = None,
        last_modified_by: Optional[str] = None,
        last_modified_by_type: Optional[Union[str, "_models.CreatedByType"]] = None,
        last_modified_at: Optional[datetime.datetime] = None,
        **kwargs: Any
    ) -> None:
        """
        :keyword created_by: The identity that created the resource.
        :paramtype created_by: str
        :keyword created_by_type: The type of identity that created the resource. Known values are:
         "User", "Application", "ManagedIdentity", and "Key".
        :paramtype created_by_type: str or ~azure.mgmt.iothub.models.CreatedByType
        :keyword created_at: The timestamp of resource creation (UTC).
        :paramtype created_at: ~datetime.datetime
        :keyword last_modified_by: The identity that last modified the resource.
        :paramtype last_modified_by: str
        :keyword last_modified_by_type: The type of identity that last modified the resource. Known
         values are: "User", "Application", "ManagedIdentity", and "Key".
        :paramtype last_modified_by_type: str or ~azure.mgmt.iothub.models.CreatedByType
        :keyword last_modified_at: The timestamp of resource last modification (UTC).
        :paramtype last_modified_at: ~datetime.datetime
        """
        super().__init__(**kwargs)
        self.created_by = created_by
        self.created_by_type = created_by_type
        self.created_at = created_at
        self.last_modified_by = last_modified_by
        self.last_modified_by_type = last_modified_by_type
        self.last_modified_at = last_modified_at


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", "DeviceJobLifecycleEvents",
     "DigitalTwinChangeEvents", "DeviceConnectionStateEvents", and "MqttBrokerMessages".
    :vartype routing_source: str or ~azure.mgmt.iothub.models.RoutingSource
    :ivar message: Routing message.
    :vartype message: ~azure.mgmt.iothub.models.RoutingMessage
    :ivar twin: Routing Twin Reference.
    :vartype twin: ~azure.mgmt.iothub.models.RoutingTwin
    """

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

    def __init__(
        self,
        *,
        routing_source: 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", "DeviceJobLifecycleEvents",
         "DigitalTwinChangeEvents", "DeviceConnectionStateEvents", and "MqttBrokerMessages".
        :paramtype routing_source: str or ~azure.mgmt.iothub.models.RoutingSource
        :keyword message: Routing message.
        :paramtype message: ~azure.mgmt.iothub.models.RoutingMessage
        :keyword twin: Routing Twin Reference.
        :paramtype twin: ~azure.mgmt.iothub.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.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.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 server.

    :ivar message: Routing message.
    :vartype message: ~azure.mgmt.iothub.models.RoutingMessage
    :ivar route: Route properties. Required.
    :vartype route: ~azure.mgmt.iothub.models.RouteProperties
    :ivar twin: Routing Twin Reference.
    :vartype twin: ~azure.mgmt.iothub.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.models.RoutingMessage
        :keyword route: Route properties. Required.
        :paramtype route: ~azure.mgmt.iothub.models.RouteProperties
        :keyword twin: Routing Twin Reference.
        :paramtype twin: ~azure.mgmt.iothub.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.models.TestResultStatus
    :ivar details: Detailed result of testing route.
    :vartype details: ~azure.mgmt.iothub.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.models.TestResultStatus
        :keyword details: Detailed result of testing route.
        :paramtype details: ~azure.mgmt.iothub.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.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.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.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.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.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.models.UserSubscriptionQuota]
        """
        super().__init__(**kwargs)
        self.value = value
        self.next_link: Optional[str] = None
