# 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) Python Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
# pylint: disable=useless-super-delegation

import datetime
from typing import Any, Mapping, Optional, TYPE_CHECKING, Union, overload

from .._utils.model_base import Model as _Model, rest_field

if TYPE_CHECKING:
    from .. import models as _models


class ArmIdentity(_Model):
    """ArmIdentity.

    :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 <ArmUserIdentity>.
    :vartype user_assigned_identities: dict[str, ~azure.mgmt.iothub.models.ArmUserIdentity]
    """

    principal_id: Optional[str] = rest_field(name="principalId", visibility=["read"])
    """Principal Id."""
    tenant_id: Optional[str] = rest_field(name="tenantId", visibility=["read"])
    """Tenant Id."""
    type: Optional[Union[str, "_models.ResourceIdentityType"]] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """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\"."""
    user_assigned_identities: Optional[dict[str, "_models.ArmUserIdentity"]] = rest_field(
        name="userAssignedIdentities", visibility=["read", "create", "update", "delete", "query"]
    )
    """Dictionary of <ArmUserIdentity>."""

    @overload
    def __init__(
        self,
        *,
        type: Optional[Union[str, "_models.ResourceIdentityType"]] = None,
        user_assigned_identities: Optional[dict[str, "_models.ArmUserIdentity"]] = None,
    ) -> None: ...

    @overload
    def __init__(self, mapping: Mapping[str, Any]) -> None:
        """
        :param mapping: raw JSON to initialize the model.
        :type mapping: Mapping[str, Any]
        """

    def __init__(self, *args: Any, **kwargs: Any) -> None:
        super().__init__(*args, **kwargs)


class ArmUserIdentity(_Model):
    """ArmUserIdentity.

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

    principal_id: Optional[str] = rest_field(name="principalId", visibility=["read"])
    client_id: Optional[str] = rest_field(name="clientId", visibility=["read"])


class Resource(_Model):
    """Resource.

    :ivar id: Fully qualified resource ID for the resource. Ex -
     /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}.
    :vartype id: str
    :ivar name: The name of the resource.
    :vartype name: str
    :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or
     "Microsoft.Storage/storageAccounts".
    :vartype type: str
    :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy
     information.
    :vartype system_data: ~azure.mgmt.iothub.models.SystemData
    """

    id: Optional[str] = rest_field(visibility=["read"])
    """Fully qualified resource ID for the resource. Ex -
     /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}."""
    name: Optional[str] = rest_field(visibility=["read"])
    """The name of the resource."""
    type: Optional[str] = rest_field(visibility=["read"])
    """The type of the resource. E.g. \"Microsoft.Compute/virtualMachines\" or
     \"Microsoft.Storage/storageAccounts\"."""
    system_data: Optional["_models.SystemData"] = rest_field(name="systemData", visibility=["read"])
    """Azure Resource Manager metadata containing createdBy and modifiedBy information."""


class ProxyResource(Resource):
    """Proxy Resource.

    :ivar id: Fully qualified resource ID for the resource. Ex -
     /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}.
    :vartype id: str
    :ivar name: The name of the resource.
    :vartype name: str
    :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or
     "Microsoft.Storage/storageAccounts".
    :vartype type: str
    :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy
     information.
    :vartype system_data: ~azure.mgmt.iothub.models.SystemData
    """


class CertificateDescription(ProxyResource):
    """The X509 Certificate.

    :ivar id: Fully qualified resource ID for the resource. Ex -
     /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}.
    :vartype id: str
    :ivar name: The name of the resource.
    :vartype name: str
    :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or
     "Microsoft.Storage/storageAccounts".
    :vartype type: str
    :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy
     information.
    :vartype system_data: ~azure.mgmt.iothub.models.SystemData
    :ivar properties: The description of an X509 CA Certificate.
    :vartype properties: ~azure.mgmt.iothub.models.CertificateProperties
    :ivar etag: The entity tag.
    :vartype etag: str
    """

    properties: Optional["_models.CertificateProperties"] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """The description of an X509 CA Certificate."""
    etag: Optional[str] = rest_field(visibility=["read"])
    """The entity tag."""

    @overload
    def __init__(
        self,
        *,
        properties: Optional["_models.CertificateProperties"] = None,
    ) -> None: ...

    @overload
    def __init__(self, mapping: Mapping[str, Any]) -> None:
        """
        :param mapping: raw JSON to initialize the model.
        :type mapping: Mapping[str, Any]
        """

    def __init__(self, *args: Any, **kwargs: Any) -> None:
        super().__init__(*args, **kwargs)


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

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

    value: Optional[list["_models.CertificateDescription"]] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """The array of Certificate objects."""

    @overload
    def __init__(
        self,
        *,
        value: Optional[list["_models.CertificateDescription"]] = None,
    ) -> None: ...

    @overload
    def __init__(self, mapping: Mapping[str, Any]) -> None:
        """
        :param mapping: raw JSON to initialize the model.
        :type mapping: Mapping[str, Any]
        """

    def __init__(self, *args: Any, **kwargs: Any) -> None:
        super().__init__(*args, **kwargs)


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

    :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
    :ivar policy_resource_id: The reference to policy stored in Azure Device Registry (ADR).
    :vartype policy_resource_id: str
    """

    subject: Optional[str] = rest_field(visibility=["read"])
    """The certificate's subject name."""
    expiry: Optional[datetime.datetime] = rest_field(visibility=["read"], format="rfc7231")
    """The certificate's expiration date and time."""
    thumbprint: Optional[str] = rest_field(visibility=["read"])
    """The certificate's thumbprint."""
    is_verified: Optional[bool] = rest_field(
        name="isVerified", visibility=["read", "create", "update", "delete", "query"]
    )
    """Determines whether certificate has been verified."""
    created: Optional[datetime.datetime] = rest_field(visibility=["read"], format="rfc7231")
    """The certificate's create date and time."""
    updated: Optional[datetime.datetime] = rest_field(visibility=["read"], format="rfc7231")
    """The certificate's last update date and time."""
    certificate: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """The certificate content."""
    policy_resource_id: Optional[str] = rest_field(
        name="policyResourceId", visibility=["read", "create", "update", "delete", "query"]
    )
    """The reference to policy stored in Azure Device Registry (ADR)."""

    @overload
    def __init__(
        self,
        *,
        is_verified: Optional[bool] = None,
        certificate: Optional[str] = None,
        policy_resource_id: Optional[str] = None,
    ) -> None: ...

    @overload
    def __init__(self, mapping: Mapping[str, Any]) -> None:
        """
        :param mapping: raw JSON to initialize the model.
        :type mapping: Mapping[str, Any]
        """

    def __init__(self, *args: Any, **kwargs: Any) -> None:
        super().__init__(*args, **kwargs)


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

    :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
    :ivar policy_resource_id: The reference to policy stored in Azure Device Registry (ADR).
    :vartype policy_resource_id: str
    """

    subject: Optional[str] = rest_field(visibility=["read"])
    """The certificate's subject name."""
    expiry: Optional[datetime.datetime] = rest_field(visibility=["read"], format="rfc7231")
    """The certificate's expiration date and time."""
    thumbprint: Optional[str] = rest_field(visibility=["read"])
    """The certificate's thumbprint."""
    is_verified: Optional[bool] = rest_field(name="isVerified", visibility=["read"])
    """Determines whether certificate has been verified."""
    created: Optional[datetime.datetime] = rest_field(visibility=["read"], format="rfc7231")
    """The certificate's create date and time."""
    updated: Optional[datetime.datetime] = rest_field(visibility=["read"], format="rfc7231")
    """The certificate's last update date and time."""
    verification_code: Optional[str] = rest_field(name="verificationCode", visibility=["read"])
    """The certificate's verification code that will be used for proof of possession."""
    certificate: Optional[str] = rest_field(visibility=["read"])
    """The certificate content."""
    policy_resource_id: Optional[str] = rest_field(
        name="policyResourceId", visibility=["read", "create", "update", "delete", "query"]
    )
    """The reference to policy stored in Azure Device Registry (ADR)."""

    @overload
    def __init__(
        self,
        *,
        policy_resource_id: Optional[str] = None,
    ) -> None: ...

    @overload
    def __init__(self, mapping: Mapping[str, Any]) -> None:
        """
        :param mapping: raw JSON to initialize the model.
        :type mapping: Mapping[str, Any]
        """

    def __init__(self, *args: Any, **kwargs: Any) -> None:
        super().__init__(*args, **kwargs)


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

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

    certificate: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """base-64 representation of X509 certificate .cer file or just .pem file content."""

    @overload
    def __init__(
        self,
        *,
        certificate: Optional[str] = None,
    ) -> None: ...

    @overload
    def __init__(self, mapping: Mapping[str, Any]) -> None:
        """
        :param mapping: raw JSON to initialize the model.
        :type mapping: Mapping[str, Any]
        """

    def __init__(self, *args: Any, **kwargs: Any) -> None:
        super().__init__(*args, **kwargs)


class CertificateWithNonceDescription(_Model):
    """The X509 Certificate.

    :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
    """

    properties: Optional["_models.CertificatePropertiesWithNonce"] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """The description of an X509 CA Certificate including the challenge nonce issued for the
     Proof-Of-Possession flow."""
    id: Optional[str] = rest_field(visibility=["read"])
    """The resource identifier."""
    name: Optional[str] = rest_field(visibility=["read"])
    """The name of the certificate."""
    etag: Optional[str] = rest_field(visibility=["read"])
    """The entity tag."""
    type: Optional[str] = rest_field(visibility=["read"])
    """The resource type."""

    @overload
    def __init__(
        self,
        *,
        properties: Optional["_models.CertificatePropertiesWithNonce"] = None,
    ) -> None: ...

    @overload
    def __init__(self, mapping: Mapping[str, Any]) -> None:
        """
        :param mapping: raw JSON to initialize the model.
        :type mapping: Mapping[str, Any]
        """

    def __init__(self, *args: Any, **kwargs: Any) -> None:
        super().__init__(*args, **kwargs)


class CloudToDeviceProperties(_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
     <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
     <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
    """

    max_delivery_count: Optional[int] = rest_field(
        name="maxDeliveryCount", visibility=["read", "create", "update", "delete", "query"]
    )
    """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
     <https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-messaging#cloud-to-device-messages>`_."""
    default_ttl_as_iso8601: Optional[datetime.timedelta] = rest_field(
        name="defaultTtlAsIso8601", visibility=["read", "create", "update", "delete", "query"]
    )
    """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
     <https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-messaging#cloud-to-device-messages>`_."""
    feedback: Optional["_models.FeedbackProperties"] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """The properties of the feedback queue for cloud-to-device messages."""

    @overload
    def __init__(
        self,
        *,
        max_delivery_count: Optional[int] = None,
        default_ttl_as_iso8601: Optional[datetime.timedelta] = None,
        feedback: Optional["_models.FeedbackProperties"] = None,
    ) -> None: ...

    @overload
    def __init__(self, mapping: Mapping[str, Any]) -> None:
        """
        :param mapping: raw JSON to initialize the model.
        :type mapping: Mapping[str, Any]
        """

    def __init__(self, *args: Any, **kwargs: Any) -> None:
        super().__init__(*args, **kwargs)


class DeviceRegistry(_Model):
    """Represents properties related to the Azure Device Registry (ADR).

    :ivar namespace_resource_id: The identifier of the Azure Device Registry namespace associated
     with the GEN2 SKU hub.
    :vartype namespace_resource_id: str
    :ivar identity_resource_id: The identity used to manage the ADR namespace from the data plane.
    :vartype identity_resource_id: str
    """

    namespace_resource_id: Optional[str] = rest_field(
        name="namespaceResourceId", visibility=["read", "create", "update", "delete", "query"]
    )
    """The identifier of the Azure Device Registry namespace associated with the GEN2 SKU hub."""
    identity_resource_id: Optional[str] = rest_field(
        name="identityResourceId", visibility=["read", "create", "update", "delete", "query"]
    )
    """The identity used to manage the ADR namespace from the data plane."""

    @overload
    def __init__(
        self,
        *,
        namespace_resource_id: Optional[str] = None,
        identity_resource_id: Optional[str] = None,
    ) -> None: ...

    @overload
    def __init__(self, mapping: Mapping[str, Any]) -> None:
        """
        :param mapping: raw JSON to initialize the model.
        :type mapping: Mapping[str, Any]
        """

    def __init__(self, *args: Any, **kwargs: Any) -> None:
        super().__init__(*args, **kwargs)


class EncryptionPropertiesDescription(_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]
    """

    key_source: Optional[str] = rest_field(name="keySource", visibility=["read", "create", "update", "delete", "query"])
    """The source of the key."""
    key_vault_properties: Optional[list["_models.KeyVaultKeyProperties"]] = rest_field(
        name="keyVaultProperties", visibility=["read", "create", "update", "delete", "query"]
    )
    """The properties of the KeyVault key."""

    @overload
    def __init__(
        self,
        *,
        key_source: Optional[str] = None,
        key_vault_properties: Optional[list["_models.KeyVaultKeyProperties"]] = None,
    ) -> None: ...

    @overload
    def __init__(self, mapping: Mapping[str, Any]) -> None:
        """
        :param mapping: raw JSON to initialize the model.
        :type mapping: Mapping[str, Any]
        """

    def __init__(self, *args: Any, **kwargs: Any) -> None:
        super().__init__(*args, **kwargs)


class EndpointHealthData(_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
    """

    endpoint_id: Optional[str] = rest_field(
        name="endpointId", visibility=["read", "create", "update", "delete", "query"]
    )
    """Id of the endpoint."""
    health_status: Optional[Union[str, "_models.EndpointHealthStatus"]] = rest_field(
        name="healthStatus", visibility=["read", "create", "update", "delete", "query"]
    )
    """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\"."""
    last_known_error: Optional[str] = rest_field(
        name="lastKnownError", visibility=["read", "create", "update", "delete", "query"]
    )
    """Last error obtained when a message failed to be delivered to iot hub."""
    last_known_error_time: Optional[datetime.datetime] = rest_field(
        name="lastKnownErrorTime", visibility=["read", "create", "update", "delete", "query"], format="rfc7231"
    )
    """Time at which the last known error occurred."""
    last_successful_send_attempt_time: Optional[datetime.datetime] = rest_field(
        name="lastSuccessfulSendAttemptTime",
        visibility=["read", "create", "update", "delete", "query"],
        format="rfc7231",
    )
    """Last time iot hub successfully sent a message to the endpoint."""
    last_send_attempt_time: Optional[datetime.datetime] = rest_field(
        name="lastSendAttemptTime", visibility=["read", "create", "update", "delete", "query"], format="rfc7231"
    )
    """Last time iot hub tried to send a message to the endpoint."""

    @overload
    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,
    ) -> None: ...

    @overload
    def __init__(self, mapping: Mapping[str, Any]) -> None:
        """
        :param mapping: raw JSON to initialize the model.
        :type mapping: Mapping[str, Any]
        """

    def __init__(self, *args: Any, **kwargs: Any) -> None:
        super().__init__(*args, **kwargs)


class EnrichmentProperties(_Model):
    """The properties of an enrichment that your IoT hub applies to messages delivered to endpoints.

    :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]
    """

    key: str = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """The key or name for the enrichment property. Required."""
    value: str = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """The value for the enrichment property. Required."""
    endpoint_names: list[str] = rest_field(
        name="endpointNames", visibility=["read", "create", "update", "delete", "query"]
    )
    """The list of endpoints for which the enrichment is applied to the message. Required."""

    @overload
    def __init__(
        self,
        *,
        key: str,
        value: str,
        endpoint_names: list[str],
    ) -> None: ...

    @overload
    def __init__(self, mapping: Mapping[str, Any]) -> None:
        """
        :param mapping: raw JSON to initialize the model.
        :type mapping: Mapping[str, Any]
        """

    def __init__(self, *args: Any, **kwargs: Any) -> None:
        super().__init__(*args, **kwargs)


class ErrorDetails(_Model):
    """Error details.

    :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
    """

    code: Optional[str] = rest_field(visibility=["read"])
    """The error code."""
    http_status_code: Optional[str] = rest_field(name="httpStatusCode", visibility=["read"])
    """The HTTP status code."""
    message: Optional[str] = rest_field(visibility=["read"])
    """The error message."""
    details: Optional[str] = rest_field(visibility=["read"])
    """The error details."""


class EventHubConsumerGroupBodyDescription(_Model):
    """The EventHub consumer group.

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

    properties: "_models.EventHubConsumerGroupName" = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """The EventHub consumer group name. Required."""

    @overload
    def __init__(
        self,
        *,
        properties: "_models.EventHubConsumerGroupName",
    ) -> None: ...

    @overload
    def __init__(self, mapping: Mapping[str, Any]) -> None:
        """
        :param mapping: raw JSON to initialize the model.
        :type mapping: Mapping[str, Any]
        """

    def __init__(self, *args: Any, **kwargs: Any) -> None:
        super().__init__(*args, **kwargs)


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

    :ivar id: Fully qualified resource ID for the resource. Ex -
     /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}.
    :vartype id: str
    :ivar name: The name of the resource.
    :vartype name: str
    :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or
     "Microsoft.Storage/storageAccounts".
    :vartype type: str
    :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy
     information.
    :vartype system_data: ~azure.mgmt.iothub.models.SystemData
    :ivar properties: The tags.
    :vartype properties: dict[str, any]
    :ivar etag: The etag.
    :vartype etag: str
    """

    properties: Optional[dict[str, Any]] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """The tags."""
    etag: Optional[str] = rest_field(visibility=["read"])
    """The etag."""

    @overload
    def __init__(
        self,
        *,
        properties: Optional[dict[str, Any]] = None,
    ) -> None: ...

    @overload
    def __init__(self, mapping: Mapping[str, Any]) -> None:
        """
        :param mapping: raw JSON to initialize the model.
        :type mapping: Mapping[str, Any]
        """

    def __init__(self, *args: Any, **kwargs: Any) -> None:
        super().__init__(*args, **kwargs)


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

    :ivar name: EventHub consumer group name. Required.
    :vartype name: str
    """

    name: str = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """EventHub consumer group name. Required."""

    @overload
    def __init__(
        self,
        *,
        name: str,
    ) -> None: ...

    @overload
    def __init__(self, mapping: Mapping[str, Any]) -> None:
        """
        :param mapping: raw JSON to initialize the model.
        :type mapping: Mapping[str, Any]
        """

    def __init__(self, *args: Any, **kwargs: Any) -> None:
        super().__init__(*args, **kwargs)


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

    :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
     <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
     <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
    """

    retention_time_in_days: Optional[int] = rest_field(
        name="retentionTimeInDays", visibility=["read", "create", "update", "delete", "query"]
    )
    """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
     <https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-messaging#device-to-cloud-messages>`_."""
    partition_count: Optional[int] = rest_field(
        name="partitionCount", visibility=["read", "create", "update", "delete", "query"]
    )
    """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
     <https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-messaging#device-to-cloud-messages>`_."""
    partition_ids: Optional[list[str]] = rest_field(name="partitionIds", visibility=["read"])
    """The partition ids in the Event Hub-compatible endpoint."""
    path: Optional[str] = rest_field(visibility=["read"])
    """The Event Hub-compatible name."""
    endpoint: Optional[str] = rest_field(visibility=["read"])
    """The Event Hub-compatible endpoint."""

    @overload
    def __init__(
        self,
        *,
        retention_time_in_days: Optional[int] = None,
        partition_count: Optional[int] = None,
    ) -> None: ...

    @overload
    def __init__(self, mapping: Mapping[str, Any]) -> None:
        """
        :param mapping: raw JSON to initialize the model.
        :type mapping: Mapping[str, Any]
        """

    def __init__(self, *args: Any, **kwargs: Any) -> None:
        super().__init__(*args, **kwargs)


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

    :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
    """

    export_blob_container_uri: str = rest_field(
        name="exportBlobContainerUri", visibility=["read", "create", "update", "delete", "query"]
    )
    """The export blob container URI. Required."""
    exclude_keys: bool = rest_field(name="excludeKeys", visibility=["read", "create", "update", "delete", "query"])
    """The value indicating whether keys should be excluded during export. Required."""
    export_blob_name: Optional[str] = rest_field(
        name="exportBlobName", visibility=["read", "create", "update", "delete", "query"]
    )
    """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."""
    authentication_type: Optional[Union[str, "_models.AuthenticationType"]] = rest_field(
        name="authenticationType", visibility=["read", "create", "update", "delete", "query"]
    )
    """Specifies authentication type being used for connecting to the storage account. Known values
     are: \"keyBased\" and \"identityBased\"."""
    identity: Optional["_models.ManagedIdentity"] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """Managed identity properties of storage endpoint for export devices."""
    include_configurations: Optional[bool] = rest_field(
        name="includeConfigurations", visibility=["read", "create", "update", "delete", "query"]
    )
    """The value indicating whether configurations should be exported."""
    configurations_blob_name: Optional[str] = rest_field(
        name="configurationsBlobName", visibility=["read", "create", "update", "delete", "query"]
    )
    """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."""

    @overload
    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,
    ) -> None: ...

    @overload
    def __init__(self, mapping: Mapping[str, Any]) -> None:
        """
        :param mapping: raw JSON to initialize the model.
        :type mapping: Mapping[str, Any]
        """

    def __init__(self, *args: Any, **kwargs: Any) -> None:
        super().__init__(*args, **kwargs)


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

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

    failover_region: str = rest_field(name="failoverRegion", visibility=["read", "create", "update", "delete", "query"])
    """Region the hub will be failed over to. Required."""

    @overload
    def __init__(
        self,
        *,
        failover_region: str,
    ) -> None: ...

    @overload
    def __init__(self, mapping: Mapping[str, Any]) -> None:
        """
        :param mapping: raw JSON to initialize the model.
        :type mapping: Mapping[str, Any]
        """

    def __init__(self, *args: Any, **kwargs: Any) -> None:
        super().__init__(*args, **kwargs)


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

    :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
     <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
    """

    name: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """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."""
    source: Union[str, "_models.RoutingSource"] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """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\"."""
    condition: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """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
     <https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-query-language>`_."""
    endpoint_names: list[str] = rest_field(
        name="endpointNames", visibility=["read", "create", "update", "delete", "query"]
    )
    """The list of endpoints to which the messages that satisfy the condition are routed to. Currently
     only 1 endpoint is allowed. Required."""
    is_enabled: bool = rest_field(name="isEnabled", visibility=["read", "create", "update", "delete", "query"])
    """Used to specify whether the fallback route is enabled. Required."""

    @overload
    def __init__(
        self,
        *,
        source: Union[str, "_models.RoutingSource"],
        endpoint_names: list[str],
        is_enabled: bool,
        name: Optional[str] = None,
        condition: Optional[str] = None,
    ) -> None: ...

    @overload
    def __init__(self, mapping: Mapping[str, Any]) -> None:
        """
        :param mapping: raw JSON to initialize the model.
        :type mapping: Mapping[str, Any]
        """

    def __init__(self, *args: Any, **kwargs: Any) -> None:
        super().__init__(*args, **kwargs)


class FeedbackProperties(_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
     <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
     <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
     <https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-messaging#cloud-to-device-messages>`_.
    :vartype max_delivery_count: int
    """

    lock_duration_as_iso8601: Optional[datetime.timedelta] = rest_field(
        name="lockDurationAsIso8601", visibility=["read", "create", "update", "delete", "query"]
    )
    """The lock duration for the feedback queue. See:
     `https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-messaging#cloud-to-device-messages
     <https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-messaging#cloud-to-device-messages>`_."""
    ttl_as_iso8601: Optional[datetime.timedelta] = rest_field(
        name="ttlAsIso8601", visibility=["read", "create", "update", "delete", "query"]
    )
    """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
     <https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-messaging#cloud-to-device-messages>`_."""
    max_delivery_count: Optional[int] = rest_field(
        name="maxDeliveryCount", visibility=["read", "create", "update", "delete", "query"]
    )
    """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
     <https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-messaging#cloud-to-device-messages>`_."""

    @overload
    def __init__(
        self,
        *,
        lock_duration_as_iso8601: Optional[datetime.timedelta] = None,
        ttl_as_iso8601: Optional[datetime.timedelta] = None,
        max_delivery_count: Optional[int] = None,
    ) -> None: ...

    @overload
    def __init__(self, mapping: Mapping[str, Any]) -> None:
        """
        :param mapping: raw JSON to initialize the model.
        :type mapping: Mapping[str, Any]
        """

    def __init__(self, *args: Any, **kwargs: Any) -> None:
        super().__init__(*args, **kwargs)


class GroupIdInformation(_Model):
    """The group information for creating a private endpoint on an IotHub.

    :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
    """

    id: Optional[str] = rest_field(visibility=["read"])
    """The resource identifier."""
    name: Optional[str] = rest_field(visibility=["read"])
    """The resource name."""
    type: Optional[str] = rest_field(visibility=["read"])
    """The resource type."""
    properties: "_models.GroupIdInformationProperties" = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """The properties for a group information object. Required."""

    @overload
    def __init__(
        self,
        *,
        properties: "_models.GroupIdInformationProperties",
    ) -> None: ...

    @overload
    def __init__(self, mapping: Mapping[str, Any]) -> None:
        """
        :param mapping: raw JSON to initialize the model.
        :type mapping: Mapping[str, Any]
        """

    def __init__(self, *args: Any, **kwargs: Any) -> None:
        super().__init__(*args, **kwargs)


class GroupIdInformationProperties(_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]
    """

    group_id: Optional[str] = rest_field(name="groupId", visibility=["read", "create", "update", "delete", "query"])
    """The group id."""
    required_members: Optional[list[str]] = rest_field(
        name="requiredMembers", visibility=["read", "create", "update", "delete", "query"]
    )
    """The required members for a specific group id."""
    required_zone_names: Optional[list[str]] = rest_field(
        name="requiredZoneNames", visibility=["read", "create", "update", "delete", "query"]
    )
    """The required DNS zones for a specific group id."""

    @overload
    def __init__(
        self,
        *,
        group_id: Optional[str] = None,
        required_members: Optional[list[str]] = None,
        required_zone_names: Optional[list[str]] = None,
    ) -> None: ...

    @overload
    def __init__(self, mapping: Mapping[str, Any]) -> None:
        """
        :param mapping: raw JSON to initialize the model.
        :type mapping: Mapping[str, Any]
        """

    def __init__(self, *args: Any, **kwargs: Any) -> None:
        super().__init__(*args, **kwargs)


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

    :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
    """

    input_blob_container_uri: str = rest_field(
        name="inputBlobContainerUri", visibility=["read", "create", "update", "delete", "query"]
    )
    """The input blob container URI. Required."""
    output_blob_container_uri: str = rest_field(
        name="outputBlobContainerUri", visibility=["read", "create", "update", "delete", "query"]
    )
    """The output blob container URI. Required."""
    input_blob_name: Optional[str] = rest_field(
        name="inputBlobName", visibility=["read", "create", "update", "delete", "query"]
    )
    """The blob name to be used when importing from the provided input blob container."""
    output_blob_name: Optional[str] = rest_field(
        name="outputBlobName", visibility=["read", "create", "update", "delete", "query"]
    )
    """The blob name to use for storing the status of the import job."""
    authentication_type: Optional[Union[str, "_models.AuthenticationType"]] = rest_field(
        name="authenticationType", visibility=["read", "create", "update", "delete", "query"]
    )
    """Specifies authentication type being used for connecting to the storage account. Known values
     are: \"keyBased\" and \"identityBased\"."""
    identity: Optional["_models.ManagedIdentity"] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """Managed identity properties of storage endpoint for import devices."""
    include_configurations: Optional[bool] = rest_field(
        name="includeConfigurations", visibility=["read", "create", "update", "delete", "query"]
    )
    """The value indicating whether configurations should be imported."""
    configurations_blob_name: Optional[str] = rest_field(
        name="configurationsBlobName", visibility=["read", "create", "update", "delete", "query"]
    )
    """The blob name to be used when importing configurations from the provided input blob container."""

    @overload
    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,
    ) -> None: ...

    @overload
    def __init__(self, mapping: Mapping[str, Any]) -> None:
        """
        :param mapping: raw JSON to initialize the model.
        :type mapping: Mapping[str, Any]
        """

    def __init__(self, *args: Any, **kwargs: Any) -> None:
        super().__init__(*args, **kwargs)


class IotHubCapacity(_Model):
    """IoT Hub capacity information.

    :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
    """

    minimum: Optional[int] = rest_field(visibility=["read"])
    """The minimum number of units."""
    maximum: Optional[int] = rest_field(visibility=["read"])
    """The maximum number of units."""
    default: Optional[int] = rest_field(visibility=["read"])
    """The default number of units."""
    scale_type: Optional[Union[str, "_models.IotHubScaleType"]] = rest_field(name="scaleType", visibility=["read"])
    """The type of the scaling enabled. Known values are: \"Automatic\", \"Manual\", and \"None\"."""


class TrackedResource(Resource):
    """Tracked Resource.

    :ivar id: Fully qualified resource ID for the resource. Ex -
     /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}.
    :vartype id: str
    :ivar name: The name of the resource.
    :vartype name: str
    :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or
     "Microsoft.Storage/storageAccounts".
    :vartype type: str
    :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy
     information.
    :vartype system_data: ~azure.mgmt.iothub.models.SystemData
    :ivar tags: Resource tags.
    :vartype tags: dict[str, str]
    :ivar location: The geo-location where the resource lives. Required.
    :vartype location: str
    """

    tags: Optional[dict[str, str]] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """Resource tags."""
    location: str = rest_field(visibility=["read", "create"])
    """The geo-location where the resource lives. Required."""

    @overload
    def __init__(
        self,
        *,
        location: str,
        tags: Optional[dict[str, str]] = None,
    ) -> None: ...

    @overload
    def __init__(self, mapping: Mapping[str, Any]) -> None:
        """
        :param mapping: raw JSON to initialize the model.
        :type mapping: Mapping[str, Any]
        """

    def __init__(self, *args: Any, **kwargs: Any) -> None:
        super().__init__(*args, **kwargs)


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

    :ivar id: Fully qualified resource ID for the resource. Ex -
     /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}.
    :vartype id: str
    :ivar name: The name of the resource.
    :vartype name: str
    :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or
     "Microsoft.Storage/storageAccounts".
    :vartype type: str
    :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy
     information.
    :vartype system_data: ~azure.mgmt.iothub.models.SystemData
    :ivar tags: Resource tags.
    :vartype tags: dict[str, str]
    :ivar location: The geo-location where the resource lives. Required.
    :vartype location: str
    :ivar properties: IotHub properties.
    :vartype properties: ~azure.mgmt.iothub.models.IotHubProperties
    :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 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
    """

    properties: Optional["_models.IotHubProperties"] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """IotHub properties."""
    etag: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """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."""
    sku: "_models.IotHubSkuInfo" = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """IotHub SKU info. Required."""
    identity: Optional["_models.ArmIdentity"] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """The managed identities for the IotHub."""

    @overload
    def __init__(
        self,
        *,
        location: str,
        sku: "_models.IotHubSkuInfo",
        tags: Optional[dict[str, str]] = None,
        properties: Optional["_models.IotHubProperties"] = None,
        etag: Optional[str] = None,
        identity: Optional["_models.ArmIdentity"] = None,
    ) -> None: ...

    @overload
    def __init__(self, mapping: Mapping[str, Any]) -> None:
        """
        :param mapping: raw JSON to initialize the model.
        :type mapping: Mapping[str, Any]
        """

    def __init__(self, *args: Any, **kwargs: Any) -> None:
        super().__init__(*args, **kwargs)


class IotHubDetails(_Model):
    """Set of additional read-only properties for the IoT hub.

    :ivar gateway_version: The IoT hub Gateway version. Known values are: "V1" and "V2".
    :vartype gateway_version: str or ~azure.mgmt.iothub.models.GatewayVersion
    """

    gateway_version: Optional[Union[str, "_models.GatewayVersion"]] = rest_field(
        name="gatewayVersion", visibility=["read", "create", "update", "delete", "query"]
    )
    """The IoT hub Gateway version. Known values are: \"V1\" and \"V2\"."""

    @overload
    def __init__(
        self,
        *,
        gateway_version: Optional[Union[str, "_models.GatewayVersion"]] = None,
    ) -> None: ...

    @overload
    def __init__(self, mapping: Mapping[str, Any]) -> None:
        """
        :param mapping: raw JSON to initialize the model.
        :type mapping: Mapping[str, Any]
        """

    def __init__(self, *args: Any, **kwargs: Any) -> None:
        super().__init__(*args, **kwargs)


class IotHubLocationDescription(_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
    """

    location: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """The name of the Azure region."""
    role: Optional[Union[str, "_models.IotHubReplicaRoleType"]] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """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\"."""

    @overload
    def __init__(
        self,
        *,
        location: Optional[str] = None,
        role: Optional[Union[str, "_models.IotHubReplicaRoleType"]] = None,
    ) -> None: ...

    @overload
    def __init__(self, mapping: Mapping[str, Any]) -> None:
        """
        :param mapping: raw JSON to initialize the model.
        :type mapping: Mapping[str, Any]
        """

    def __init__(self, *args: Any, **kwargs: Any) -> None:
        super().__init__(*args, **kwargs)


class IotHubNameAvailabilityInfo(_Model):
    """The properties indicating whether a given IoT hub name is available.

    :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
    """

    name_available: Optional[bool] = rest_field(name="nameAvailable", visibility=["read"])
    """The value which indicates whether the provided name is available."""
    reason: Optional[Union[str, "_models.IotHubNameUnavailabilityReason"]] = rest_field(visibility=["read"])
    """The reason for unavailability. Known values are: \"Invalid\" and \"AlreadyExists\"."""
    message: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """The detailed reason message."""

    @overload
    def __init__(
        self,
        *,
        message: Optional[str] = None,
    ) -> None: ...

    @overload
    def __init__(self, mapping: Mapping[str, Any]) -> None:
        """
        :param mapping: raw JSON to initialize the model.
        :type mapping: Mapping[str, Any]
        """

    def __init__(self, *args: Any, **kwargs: Any) -> None:
        super().__init__(*args, **kwargs)


class IotHubProperties(_Model):
    """The properties of an IoT hub.

    :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 device_host_name: The name of the device host. Supports secure connections over TLS 1.3.
    :vartype device_host_name: str
    :ivar service_host_name: The name of the service host. Supports secure connections over TLS
     1.3.
    :vartype service_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
     <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
    :ivar device_registry: Represents properties related to the Azure Device Registry (ADR).
    :vartype device_registry: ~azure.mgmt.iothub.models.DeviceRegistry
    :ivar iot_hub_details: Set of additional read-only properties for the IoT hub.
    :vartype iot_hub_details: ~azure.mgmt.iothub.models.IotHubDetails
    """

    authorization_policies: Optional[list["_models.SharedAccessSignatureAuthorizationRule"]] = rest_field(
        name="authorizationPolicies", visibility=["read", "create", "update", "delete", "query"]
    )
    """The shared access policies you can use to secure a connection to the IoT hub."""
    disable_local_auth: Optional[bool] = rest_field(
        name="disableLocalAuth", visibility=["read", "create", "update", "delete", "query"]
    )
    """If true, SAS tokens with Iot hub scoped SAS keys cannot be used for authentication."""
    disable_device_sas: Optional[bool] = rest_field(
        name="disableDeviceSAS", visibility=["read", "create", "update", "delete", "query"]
    )
    """If true, all device(including Edge devices but excluding modules) scoped SAS keys cannot be
     used for authentication."""
    disable_module_sas: Optional[bool] = rest_field(
        name="disableModuleSAS", visibility=["read", "create", "update", "delete", "query"]
    )
    """If true, all module scoped SAS keys cannot be used for authentication."""
    restrict_outbound_network_access: Optional[bool] = rest_field(
        name="restrictOutboundNetworkAccess", visibility=["read", "create", "update", "delete", "query"]
    )
    """If true, egress from IotHub will be restricted to only the allowed FQDNs that are configured
     via allowedFqdnList."""
    allowed_fqdn_list: Optional[list[str]] = rest_field(
        name="allowedFqdnList", visibility=["read", "create", "update", "delete", "query"]
    )
    """List of allowed FQDNs(Fully Qualified Domain Name) for egress from Iot Hub."""
    public_network_access: Optional[Union[str, "_models.PublicNetworkAccess"]] = rest_field(
        name="publicNetworkAccess", visibility=["read", "create", "update", "delete", "query"]
    )
    """Whether requests from Public Network are allowed. Known values are: \"Enabled\" and
     \"Disabled\"."""
    ip_filter_rules: Optional[list["_models.IpFilterRule"]] = rest_field(
        name="ipFilterRules", visibility=["read", "create", "update", "delete", "query"]
    )
    """The IP filter rules."""
    network_rule_sets: Optional["_models.NetworkRuleSetProperties"] = rest_field(
        name="networkRuleSets", visibility=["read", "create", "update", "delete", "query"]
    )
    """Network Rule Set Properties of IotHub."""
    min_tls_version: Optional[str] = rest_field(
        name="minTlsVersion", visibility=["read", "create", "update", "delete", "query"]
    )
    """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."""
    private_endpoint_connections: Optional[list["_models.PrivateEndpointConnection"]] = rest_field(
        name="privateEndpointConnections", visibility=["read", "create", "update", "delete", "query"]
    )
    """Private endpoint connections created on this IotHub."""
    provisioning_state: Optional[str] = rest_field(name="provisioningState", visibility=["read"])
    """The provisioning state."""
    state: Optional[str] = rest_field(visibility=["read"])
    """The hub state."""
    host_name: Optional[str] = rest_field(name="hostName", visibility=["read"])
    """The name of the host."""
    device_host_name: Optional[str] = rest_field(name="deviceHostName", visibility=["read"])
    """The name of the device host. Supports secure connections over TLS 1.3."""
    service_host_name: Optional[str] = rest_field(name="serviceHostName", visibility=["read"])
    """The name of the service host. Supports secure connections over TLS 1.3."""
    event_hub_endpoints: Optional[dict[str, "_models.EventHubProperties"]] = rest_field(
        name="eventHubEndpoints", visibility=["read", "create", "update", "delete", "query"]
    )
    """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."""
    routing: Optional["_models.RoutingProperties"] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """The routing related properties of the IoT hub. See:
     `https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-messaging
     <https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-messaging>`_."""
    storage_endpoints: Optional[dict[str, "_models.StorageEndpointProperties"]] = rest_field(
        name="storageEndpoints", visibility=["read", "create", "update", "delete", "query"]
    )
    """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."""
    messaging_endpoints: Optional[dict[str, "_models.MessagingEndpointProperties"]] = rest_field(
        name="messagingEndpoints", visibility=["read", "create", "update", "delete", "query"]
    )
    """The messaging endpoint properties for the file upload notification queue."""
    enable_file_upload_notifications: Optional[bool] = rest_field(
        name="enableFileUploadNotifications", visibility=["read", "create", "update", "delete", "query"]
    )
    """If True, file upload notifications are enabled."""
    cloud_to_device: Optional["_models.CloudToDeviceProperties"] = rest_field(
        name="cloudToDevice", visibility=["read", "create", "update", "delete", "query"]
    )
    """The IoT hub cloud-to-device messaging properties."""
    comments: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """IoT hub comments."""
    device_streams: Optional["_models.IotHubPropertiesDeviceStreams"] = rest_field(
        name="deviceStreams", visibility=["read", "create", "update", "delete", "query"]
    )
    """The device streams properties of iothub."""
    features: Optional[Union[str, "_models.Capabilities"]] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """The capabilities and features enabled for the IoT hub. Known values are: \"None\" and
     \"DeviceManagement\"."""
    encryption: Optional["_models.EncryptionPropertiesDescription"] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """The encryption properties for the IoT hub."""
    locations: Optional[list["_models.IotHubLocationDescription"]] = rest_field(visibility=["read"])
    """Primary and secondary location for iot hub."""
    enable_data_residency: Optional[bool] = rest_field(
        name="enableDataResidency", visibility=["read", "create", "update", "delete", "query"]
    )
    """This property when set to true, will enable data residency, thus, disabling disaster recovery."""
    root_certificate: Optional["_models.RootCertificateProperties"] = rest_field(
        name="rootCertificate", visibility=["read", "create", "update", "delete", "query"]
    )
    """This property store root certificate related information."""
    ip_version: Optional[Union[str, "_models.IpVersion"]] = rest_field(
        name="ipVersion", visibility=["read", "create", "update", "delete", "query"]
    )
    """This property specifies the IP Version the hub is currently utilizing. Known values are:
     \"ipv4\", \"ipv6\", and \"ipv4ipv6\"."""
    device_registry: Optional["_models.DeviceRegistry"] = rest_field(
        name="deviceRegistry", visibility=["read", "create", "update", "delete", "query"]
    )
    """Represents properties related to the Azure Device Registry (ADR)."""
    iot_hub_details: Optional["_models.IotHubDetails"] = rest_field(name="iotHubDetails", visibility=["read"])
    """Set of additional read-only properties for the IoT hub."""

    @overload
    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,
        device_registry: Optional["_models.DeviceRegistry"] = None,
    ) -> None: ...

    @overload
    def __init__(self, mapping: Mapping[str, Any]) -> None:
        """
        :param mapping: raw JSON to initialize the model.
        :type mapping: Mapping[str, Any]
        """

    def __init__(self, *args: Any, **kwargs: Any) -> None:
        super().__init__(*args, **kwargs)


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

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

    streaming_endpoints: Optional[list[str]] = rest_field(
        name="streamingEndpoints", visibility=["read", "create", "update", "delete", "query"]
    )
    """List of Device Streams Endpoints."""

    @overload
    def __init__(
        self,
        *,
        streaming_endpoints: Optional[list[str]] = None,
    ) -> None: ...

    @overload
    def __init__(self, mapping: Mapping[str, Any]) -> None:
        """
        :param mapping: raw JSON to initialize the model.
        :type mapping: Mapping[str, Any]
        """

    def __init__(self, *args: Any, **kwargs: Any) -> None:
        super().__init__(*args, **kwargs)


class IotHubQuotaMetricInfo(_Model):
    """Quota metrics properties.

    :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
    """

    name: Optional[str] = rest_field(visibility=["read"])
    """The name of the quota metric."""
    current_value: Optional[int] = rest_field(name="currentValue", visibility=["read"])
    """The current value for the quota metric."""
    max_value: Optional[int] = rest_field(name="maxValue", visibility=["read"])
    """The maximum value of the quota metric."""


class IotHubSkuDescription(_Model):
    """SKU properties.

    :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
    """

    resource_type: Optional[str] = rest_field(name="resourceType", visibility=["read"])
    """The type of the resource."""
    sku: "_models.IotHubSkuInfo" = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """The type of the resource. Required."""
    capacity: "_models.IotHubCapacity" = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """IotHub capacity. Required."""

    @overload
    def __init__(
        self,
        *,
        sku: "_models.IotHubSkuInfo",
        capacity: "_models.IotHubCapacity",
    ) -> None: ...

    @overload
    def __init__(self, mapping: Mapping[str, Any]) -> None:
        """
        :param mapping: raw JSON to initialize the model.
        :type mapping: Mapping[str, Any]
        """

    def __init__(self, *args: Any, **kwargs: Any) -> None:
        super().__init__(*args, **kwargs)


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

    :ivar name: The name of the SKU. Required. Known values are: "F1", "S1", "S2", "S3", "B1",
     "B2", "B3", and "GEN2".
    :vartype name: str or ~azure.mgmt.iothub.models.IotHubSku
    :ivar tier: The billing tier for the IoT hub. Known values are: "Free", "Standard", "Basic",
     and "Generation2".
    :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
     <https://docs.microsoft.com/azure/azure-subscription-service-limits#iot-hub-limits>`_.
    :vartype capacity: int
    """

    name: Union[str, "_models.IotHubSku"] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """The name of the SKU. Required. Known values are: \"F1\", \"S1\", \"S2\", \"S3\", \"B1\",
     \"B2\", \"B3\", and \"GEN2\"."""
    tier: Optional[Union[str, "_models.IotHubSkuTier"]] = rest_field(visibility=["read"])
    """The billing tier for the IoT hub. Known values are: \"Free\", \"Standard\", \"Basic\", and
     \"Generation2\"."""
    capacity: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """The number of provisioned IoT Hub units. See:
     `https://docs.microsoft.com/azure/azure-subscription-service-limits#iot-hub-limits
     <https://docs.microsoft.com/azure/azure-subscription-service-limits#iot-hub-limits>`_."""

    @overload
    def __init__(
        self,
        *,
        name: Union[str, "_models.IotHubSku"],
        capacity: Optional[int] = None,
    ) -> None: ...

    @overload
    def __init__(self, mapping: Mapping[str, Any]) -> None:
        """
        :param mapping: raw JSON to initialize the model.
        :type mapping: Mapping[str, Any]
        """

    def __init__(self, *args: Any, **kwargs: Any) -> None:
        super().__init__(*args, **kwargs)


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

    :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
    """

    filter_name: str = rest_field(name="filterName", visibility=["read", "create", "update", "delete", "query"])
    """The name of the IP filter rule. Required."""
    action: Union[str, "_models.IpFilterActionType"] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """The desired action for requests captured by this rule. Required. Known values are: \"Accept\"
     and \"Reject\"."""
    ip_mask: str = rest_field(name="ipMask", visibility=["read", "create", "update", "delete", "query"])
    """A string that contains the IP address range in CIDR notation for the rule. Required."""

    @overload
    def __init__(
        self,
        *,
        filter_name: str,
        action: Union[str, "_models.IpFilterActionType"],
        ip_mask: str,
    ) -> None: ...

    @overload
    def __init__(self, mapping: Mapping[str, Any]) -> None:
        """
        :param mapping: raw JSON to initialize the model.
        :type mapping: Mapping[str, Any]
        """

    def __init__(self, *args: Any, **kwargs: Any) -> None:
        super().__init__(*args, **kwargs)


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

    :ivar job_id: The job identifier.
    :vartype job_id: str
    :ivar start_time_utc: The start time of the job.
    :vartype start_time_utc: ~datetime.datetime
    :ivar end_time_utc: The time the job stopped processing.
    :vartype end_time_utc: ~datetime.datetime
    :ivar type: The type of the job. Known values are: "unknown", "export", "import", "backup",
     "readDeviceProperties", "writeDeviceProperties", "updateDeviceConfiguration", "rebootDevice",
     "factoryResetDevice", and "firmwareUpdate".
    :vartype type: str or ~azure.mgmt.iothub.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
    """

    job_id: Optional[str] = rest_field(name="jobId", visibility=["read"])
    """The job identifier."""
    start_time_utc: Optional[datetime.datetime] = rest_field(name="startTimeUtc", visibility=["read"], format="rfc7231")
    """The start time of the job."""
    end_time_utc: Optional[datetime.datetime] = rest_field(name="endTimeUtc", visibility=["read"], format="rfc7231")
    """The time the job stopped processing."""
    type: Optional[Union[str, "_models.JobType"]] = rest_field(visibility=["read"])
    """The type of the job. Known values are: \"unknown\", \"export\", \"import\", \"backup\",
     \"readDeviceProperties\", \"writeDeviceProperties\", \"updateDeviceConfiguration\",
     \"rebootDevice\", \"factoryResetDevice\", and \"firmwareUpdate\"."""
    status: Optional[Union[str, "_models.JobStatus"]] = rest_field(visibility=["read"])
    """The status of the job. Known values are: \"unknown\", \"enqueued\", \"running\", \"completed\",
     \"failed\", and \"cancelled\"."""
    failure_reason: Optional[str] = rest_field(name="failureReason", visibility=["read"])
    """If status == failed, this string containing the reason for the failure."""
    status_message: Optional[str] = rest_field(name="statusMessage", visibility=["read"])
    """The status message for the job."""
    parent_job_id: Optional[str] = rest_field(name="parentJobId", visibility=["read"])
    """The job identifier of the parent job, if any."""


class KeyVaultKeyProperties(_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
    """

    key_identifier: Optional[str] = rest_field(
        name="keyIdentifier", visibility=["read", "create", "update", "delete", "query"]
    )
    """The identifier of the key."""
    identity: Optional["_models.ManagedIdentity"] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """Managed identity properties of KeyVault Key."""

    @overload
    def __init__(
        self,
        *,
        key_identifier: Optional[str] = None,
        identity: Optional["_models.ManagedIdentity"] = None,
    ) -> None: ...

    @overload
    def __init__(self, mapping: Mapping[str, Any]) -> None:
        """
        :param mapping: raw JSON to initialize the model.
        :type mapping: Mapping[str, Any]
        """

    def __init__(self, *args: Any, **kwargs: Any) -> None:
        super().__init__(*args, **kwargs)


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

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

    user_assigned_identity: Optional[str] = rest_field(
        name="userAssignedIdentity", visibility=["read", "create", "update", "delete", "query"]
    )
    """The user assigned identity."""

    @overload
    def __init__(
        self,
        *,
        user_assigned_identity: Optional[str] = None,
    ) -> None: ...

    @overload
    def __init__(self, mapping: Mapping[str, Any]) -> None:
        """
        :param mapping: raw JSON to initialize the model.
        :type mapping: Mapping[str, Any]
        """

    def __init__(self, *args: Any, **kwargs: Any) -> None:
        super().__init__(*args, **kwargs)


class MatchedRoute(_Model):
    """Routes that matched.

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

    properties: Optional["_models.RouteProperties"] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """Properties of routes that matched."""

    @overload
    def __init__(
        self,
        *,
        properties: Optional["_models.RouteProperties"] = None,
    ) -> None: ...

    @overload
    def __init__(self, mapping: Mapping[str, Any]) -> None:
        """
        :param mapping: raw JSON to initialize the model.
        :type mapping: Mapping[str, Any]
        """

    def __init__(self, *args: Any, **kwargs: Any) -> None:
        super().__init__(*args, **kwargs)


class MessagingEndpointProperties(_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
     <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
     <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
     <https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-file-upload>`_.
    :vartype max_delivery_count: int
    """

    lock_duration_as_iso8601: Optional[datetime.timedelta] = rest_field(
        name="lockDurationAsIso8601", visibility=["read", "create", "update", "delete", "query"]
    )
    """The lock duration. See: `https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-file-upload
     <https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-file-upload>`_."""
    ttl_as_iso8601: Optional[datetime.timedelta] = rest_field(
        name="ttlAsIso8601", visibility=["read", "create", "update", "delete", "query"]
    )
    """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
     <https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-file-upload>`_."""
    max_delivery_count: Optional[int] = rest_field(
        name="maxDeliveryCount", visibility=["read", "create", "update", "delete", "query"]
    )
    """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
     <https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-file-upload>`_."""

    @overload
    def __init__(
        self,
        *,
        lock_duration_as_iso8601: Optional[datetime.timedelta] = None,
        ttl_as_iso8601: Optional[datetime.timedelta] = None,
        max_delivery_count: Optional[int] = None,
    ) -> None: ...

    @overload
    def __init__(self, mapping: Mapping[str, Any]) -> None:
        """
        :param mapping: raw JSON to initialize the model.
        :type mapping: Mapping[str, Any]
        """

    def __init__(self, *args: Any, **kwargs: Any) -> None:
        super().__init__(*args, **kwargs)


class Name(_Model):
    """Name of Iot Hub type.

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

    value: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """IotHub type."""
    localized_value: Optional[str] = rest_field(
        name="localizedValue", visibility=["read", "create", "update", "delete", "query"]
    )
    """Localized value of name."""

    @overload
    def __init__(
        self,
        *,
        value: Optional[str] = None,
        localized_value: Optional[str] = None,
    ) -> None: ...

    @overload
    def __init__(self, mapping: Mapping[str, Any]) -> None:
        """
        :param mapping: raw JSON to initialize the model.
        :type mapping: Mapping[str, Any]
        """

    def __init__(self, *args: Any, **kwargs: Any) -> None:
        super().__init__(*args, **kwargs)


class NetworkRuleSetIpRule(_Model):
    """IP Rule to be applied as part of Network Rule Set.

    :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
    """

    filter_name: str = rest_field(name="filterName", visibility=["read", "create", "update", "delete", "query"])
    """Name of the IP filter rule. Required."""
    action: Optional[Union[str, "_models.NetworkRuleIPAction"]] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """IP Filter Action. \"Allow\""""
    ip_mask: str = rest_field(name="ipMask", visibility=["read", "create", "update", "delete", "query"])
    """A string that contains the IP address range in CIDR notation for the rule. Required."""

    @overload
    def __init__(
        self,
        *,
        filter_name: str,
        ip_mask: str,
        action: Optional[Union[str, "_models.NetworkRuleIPAction"]] = None,
    ) -> None: ...

    @overload
    def __init__(self, mapping: Mapping[str, Any]) -> None:
        """
        :param mapping: raw JSON to initialize the model.
        :type mapping: Mapping[str, Any]
        """

    def __init__(self, *args: Any, **kwargs: Any) -> None:
        super().__init__(*args, **kwargs)


class NetworkRuleSetProperties(_Model):
    """Network Rule Set Properties of IotHub.

    :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]
    """

    default_action: Optional[Union[str, "_models.DefaultAction"]] = rest_field(
        name="defaultAction", visibility=["read", "create", "update", "delete", "query"]
    )
    """Default Action for Network Rule Set. Known values are: \"Deny\" and \"Allow\"."""
    apply_to_built_in_event_hub_endpoint: bool = rest_field(
        name="applyToBuiltInEventHubEndpoint", visibility=["read", "create", "update", "delete", "query"]
    )
    """If True, then Network Rule Set is also applied to BuiltIn EventHub EndPoint of IotHub.
     Required."""
    ip_rules: list["_models.NetworkRuleSetIpRule"] = rest_field(
        name="ipRules", visibility=["read", "create", "update", "delete", "query"]
    )
    """List of IP Rules. Required."""

    @overload
    def __init__(
        self,
        *,
        apply_to_built_in_event_hub_endpoint: bool,
        ip_rules: list["_models.NetworkRuleSetIpRule"],
        default_action: Optional[Union[str, "_models.DefaultAction"]] = None,
    ) -> None: ...

    @overload
    def __init__(self, mapping: Mapping[str, Any]) -> None:
        """
        :param mapping: raw JSON to initialize the model.
        :type mapping: Mapping[str, Any]
        """

    def __init__(self, *args: Any, **kwargs: Any) -> None:
        super().__init__(*args, **kwargs)


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

    :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
    """

    name: Optional[str] = rest_field(visibility=["read"])
    """Operation name: {provider}/{resource}/{read | write | action | delete}."""
    display: Optional["_models.OperationDisplay"] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """The object that represents the operation."""

    @overload
    def __init__(
        self,
        *,
        display: Optional["_models.OperationDisplay"] = None,
    ) -> None: ...

    @overload
    def __init__(self, mapping: Mapping[str, Any]) -> None:
        """
        :param mapping: raw JSON to initialize the model.
        :type mapping: Mapping[str, Any]
        """

    def __init__(self, *args: Any, **kwargs: Any) -> None:
        super().__init__(*args, **kwargs)


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

    :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
    """

    provider: Optional[str] = rest_field(visibility=["read"])
    """Service provider: Microsoft Devices."""
    resource: Optional[str] = rest_field(visibility=["read"])
    """Resource Type: IotHubs."""
    operation: Optional[str] = rest_field(visibility=["read"])
    """Name of the operation."""
    description: Optional[str] = rest_field(visibility=["read"])
    """Description of the operation."""


class OperationInputs(_Model):
    """Input values.

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

    name: str = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """The name of the IoT hub to check. Required."""

    @overload
    def __init__(
        self,
        *,
        name: str,
    ) -> None: ...

    @overload
    def __init__(self, mapping: Mapping[str, Any]) -> None:
        """
        :param mapping: raw JSON to initialize the model.
        :type mapping: Mapping[str, Any]
        """

    def __init__(self, *args: Any, **kwargs: Any) -> None:
        super().__init__(*args, **kwargs)


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

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

    id: Optional[str] = rest_field(visibility=["read"])
    """The resource identifier."""


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

    :ivar id: Fully qualified resource ID for the resource. Ex -
     /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}.
    :vartype id: str
    :ivar name: The name of the resource.
    :vartype name: str
    :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or
     "Microsoft.Storage/storageAccounts".
    :vartype type: str
    :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy
     information.
    :vartype system_data: ~azure.mgmt.iothub.models.SystemData
    :ivar properties: The properties of a private endpoint connection. Required.
    :vartype properties: ~azure.mgmt.iothub.models.PrivateEndpointConnectionProperties
    """

    properties: "_models.PrivateEndpointConnectionProperties" = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """The properties of a private endpoint connection. Required."""

    @overload
    def __init__(
        self,
        *,
        properties: "_models.PrivateEndpointConnectionProperties",
    ) -> None: ...

    @overload
    def __init__(self, mapping: Mapping[str, Any]) -> None:
        """
        :param mapping: raw JSON to initialize the model.
        :type mapping: Mapping[str, Any]
        """

    def __init__(self, *args: Any, **kwargs: Any) -> None:
        super().__init__(*args, **kwargs)


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

    :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
    """

    private_endpoint: Optional["_models.PrivateEndpoint"] = rest_field(
        name="privateEndpoint", visibility=["read", "create", "update", "delete", "query"]
    )
    """The private endpoint property of a private endpoint connection."""
    private_link_service_connection_state: "_models.PrivateLinkServiceConnectionState" = rest_field(
        name="privateLinkServiceConnectionState", visibility=["read", "create", "update", "delete", "query"]
    )
    """The current state of a private endpoint connection. Required."""

    @overload
    def __init__(
        self,
        *,
        private_link_service_connection_state: "_models.PrivateLinkServiceConnectionState",
        private_endpoint: Optional["_models.PrivateEndpoint"] = None,
    ) -> None: ...

    @overload
    def __init__(self, mapping: Mapping[str, Any]) -> None:
        """
        :param mapping: raw JSON to initialize the model.
        :type mapping: Mapping[str, Any]
        """

    def __init__(self, *args: Any, **kwargs: Any) -> None:
        super().__init__(*args, **kwargs)


class PrivateLinkResources(_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]
    """

    value: Optional[list["_models.GroupIdInformation"]] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """The list of available private link resources for an IotHub."""

    @overload
    def __init__(
        self,
        *,
        value: Optional[list["_models.GroupIdInformation"]] = None,
    ) -> None: ...

    @overload
    def __init__(self, mapping: Mapping[str, Any]) -> None:
        """
        :param mapping: raw JSON to initialize the model.
        :type mapping: Mapping[str, Any]
        """

    def __init__(self, *args: Any, **kwargs: Any) -> None:
        super().__init__(*args, **kwargs)


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

    :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
    """

    status: Union[str, "_models.PrivateLinkServiceConnectionStatus"] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """The status of a private endpoint connection. Required. Known values are: \"Pending\",
     \"Approved\", \"Rejected\", and \"Disconnected\"."""
    description: str = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """The description for the current state of a private endpoint connection. Required."""
    actions_required: Optional[str] = rest_field(
        name="actionsRequired", visibility=["read", "create", "update", "delete", "query"]
    )
    """Actions required for a private endpoint connection."""

    @overload
    def __init__(
        self,
        *,
        status: Union[str, "_models.PrivateLinkServiceConnectionStatus"],
        description: str,
        actions_required: Optional[str] = None,
    ) -> None: ...

    @overload
    def __init__(self, mapping: Mapping[str, Any]) -> None:
        """
        :param mapping: raw JSON to initialize the model.
        :type mapping: Mapping[str, Any]
        """

    def __init__(self, *args: Any, **kwargs: Any) -> None:
        super().__init__(*args, **kwargs)


class RegistryStatistics(_Model):
    """Identity registry statistics.

    :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
    """

    total_device_count: Optional[int] = rest_field(name="totalDeviceCount", visibility=["read"])
    """The total count of devices in the identity registry."""
    enabled_device_count: Optional[int] = rest_field(name="enabledDeviceCount", visibility=["read"])
    """The count of enabled devices in the identity registry."""
    disabled_device_count: Optional[int] = rest_field(name="disabledDeviceCount", visibility=["read"])
    """The count of disabled devices in the identity registry."""


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

    :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
    """

    enable_root_certificate_v2: Optional[bool] = rest_field(
        name="enableRootCertificateV2", visibility=["read", "create", "update", "delete", "query"]
    )
    """This property when set to true, hub will use G2 cert; while it's set to false, hub uses
     Baltimore Cert."""
    last_updated_time_utc: Optional[datetime.datetime] = rest_field(
        name="lastUpdatedTimeUtc", visibility=["read"], format="rfc3339"
    )
    """the last update time to root certificate flag."""

    @overload
    def __init__(
        self,
        *,
        enable_root_certificate_v2: Optional[bool] = None,
    ) -> None: ...

    @overload
    def __init__(self, mapping: Mapping[str, Any]) -> None:
        """
        :param mapping: raw JSON to initialize the model.
        :type mapping: Mapping[str, Any]
        """

    def __init__(self, *args: Any, **kwargs: Any) -> None:
        super().__init__(*args, **kwargs)


class RouteCompilationError(_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
    """

    message: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """Route error message."""
    severity: Optional[Union[str, "_models.RouteErrorSeverity"]] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """Severity of the route error. Known values are: \"error\" and \"warning\"."""
    location: Optional["_models.RouteErrorRange"] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """Location where the route error happened."""

    @overload
    def __init__(
        self,
        *,
        message: Optional[str] = None,
        severity: Optional[Union[str, "_models.RouteErrorSeverity"]] = None,
        location: Optional["_models.RouteErrorRange"] = None,
    ) -> None: ...

    @overload
    def __init__(self, mapping: Mapping[str, Any]) -> None:
        """
        :param mapping: raw JSON to initialize the model.
        :type mapping: Mapping[str, Any]
        """

    def __init__(self, *args: Any, **kwargs: Any) -> None:
        super().__init__(*args, **kwargs)


class RouteErrorPosition(_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
    """

    line: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """Line where the route error happened."""
    column: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """Column where the route error happened."""

    @overload
    def __init__(
        self,
        *,
        line: Optional[int] = None,
        column: Optional[int] = None,
    ) -> None: ...

    @overload
    def __init__(self, mapping: Mapping[str, Any]) -> None:
        """
        :param mapping: raw JSON to initialize the model.
        :type mapping: Mapping[str, Any]
        """

    def __init__(self, *args: Any, **kwargs: Any) -> None:
        super().__init__(*args, **kwargs)


class RouteErrorRange(_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
    """

    start: Optional["_models.RouteErrorPosition"] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """Start where the route error happened."""
    end: Optional["_models.RouteErrorPosition"] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """End where the route error happened."""

    @overload
    def __init__(
        self,
        *,
        start: Optional["_models.RouteErrorPosition"] = None,
        end: Optional["_models.RouteErrorPosition"] = None,
    ) -> None: ...

    @overload
    def __init__(self, mapping: Mapping[str, Any]) -> None:
        """
        :param mapping: raw JSON to initialize the model.
        :type mapping: Mapping[str, Any]
        """

    def __init__(self, *args: Any, **kwargs: Any) -> None:
        super().__init__(*args, **kwargs)


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

    :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
     <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
    """

    name: str = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """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."""
    source: Union[str, "_models.RoutingSource"] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """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\"."""
    condition: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """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
     <https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-query-language>`_."""
    endpoint_names: list[str] = rest_field(
        name="endpointNames", visibility=["read", "create", "update", "delete", "query"]
    )
    """The list of endpoints to which messages that satisfy the condition are routed. Currently only
     one endpoint is allowed. Required."""
    is_enabled: bool = rest_field(name="isEnabled", visibility=["read", "create", "update", "delete", "query"])
    """Used to specify whether a route is enabled. Required."""

    @overload
    def __init__(
        self,
        *,
        name: str,
        source: Union[str, "_models.RoutingSource"],
        endpoint_names: list[str],
        is_enabled: bool,
        condition: Optional[str] = None,
    ) -> None: ...

    @overload
    def __init__(self, mapping: Mapping[str, Any]) -> None:
        """
        :param mapping: raw JSON to initialize the model.
        :type mapping: Mapping[str, Any]
        """

    def __init__(self, *args: Any, **kwargs: Any) -> None:
        super().__init__(*args, **kwargs)


class RoutingCosmosDBSqlApiProperties(_Model):
    """The properties related to a cosmos DB sql container endpoint.

    :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
    """

    name: str = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """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."""
    id: Optional[str] = rest_field(visibility=["read"])
    """Id of the cosmos DB sql container endpoint."""
    subscription_id: Optional[str] = rest_field(
        name="subscriptionId", visibility=["read", "create", "update", "delete", "query"]
    )
    """The subscription identifier of the cosmos DB account."""
    resource_group: Optional[str] = rest_field(
        name="resourceGroup", visibility=["read", "create", "update", "delete", "query"]
    )
    """The name of the resource group of the cosmos DB account."""
    endpoint_uri: str = rest_field(name="endpointUri", visibility=["read", "create", "update", "delete", "query"])
    """The url of the cosmos DB account. It must include the protocol https://. Required."""
    authentication_type: Optional[Union[str, "_models.AuthenticationType"]] = rest_field(
        name="authenticationType", visibility=["read", "create", "update", "delete", "query"]
    )
    """Method used to authenticate against the cosmos DB sql container endpoint. Known values are:
     \"keyBased\" and \"identityBased\"."""
    identity: Optional["_models.ManagedIdentity"] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """Managed identity properties of routing cosmos DB container endpoint."""
    primary_key: Optional[str] = rest_field(
        name="primaryKey", visibility=["read", "create", "update", "delete", "query"]
    )
    """The primary key of the cosmos DB account."""
    secondary_key: Optional[str] = rest_field(
        name="secondaryKey", visibility=["read", "create", "update", "delete", "query"]
    )
    """The secondary key of the cosmos DB account."""
    database_name: str = rest_field(name="databaseName", visibility=["read", "create", "update", "delete", "query"])
    """The name of the cosmos DB database in the cosmos DB account. Required."""
    container_name: str = rest_field(name="containerName", visibility=["read", "create", "update", "delete", "query"])
    """The name of the cosmos DB sql container in the cosmos DB database. Required."""
    partition_key_name: Optional[str] = rest_field(
        name="partitionKeyName", visibility=["read", "create", "update", "delete", "query"]
    )
    """The name of the partition key associated with this cosmos DB sql container if one exists. This
     is an optional parameter."""
    partition_key_template: Optional[str] = rest_field(
        name="partitionKeyTemplate", visibility=["read", "create", "update", "delete", "query"]
    )
    """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."""

    @overload
    def __init__(
        self,
        *,
        name: str,
        endpoint_uri: str,
        database_name: str,
        container_name: str,
        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,
    ) -> None: ...

    @overload
    def __init__(self, mapping: Mapping[str, Any]) -> None:
        """
        :param mapping: raw JSON to initialize the model.
        :type mapping: Mapping[str, Any]
        """

    def __init__(self, *args: Any, **kwargs: Any) -> None:
        super().__init__(*args, **kwargs)


class RoutingEndpoints(_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]
    """

    service_bus_queues: Optional[list["_models.RoutingServiceBusQueueEndpointProperties"]] = rest_field(
        name="serviceBusQueues", visibility=["read", "create", "update", "delete", "query"]
    )
    """The list of Service Bus queue endpoints that IoT hub routes the messages to, based on the
     routing rules."""
    service_bus_topics: Optional[list["_models.RoutingServiceBusTopicEndpointProperties"]] = rest_field(
        name="serviceBusTopics", visibility=["read", "create", "update", "delete", "query"]
    )
    """The list of Service Bus topic endpoints that the IoT hub routes the messages to, based on the
     routing rules."""
    event_hubs: Optional[list["_models.RoutingEventHubProperties"]] = rest_field(
        name="eventHubs", visibility=["read", "create", "update", "delete", "query"]
    )
    """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."""
    storage_containers: Optional[list["_models.RoutingStorageContainerProperties"]] = rest_field(
        name="storageContainers", visibility=["read", "create", "update", "delete", "query"]
    )
    """The list of storage container endpoints that IoT hub routes messages to, based on the routing
     rules."""
    cosmos_db_sql_containers: Optional[list["_models.RoutingCosmosDBSqlApiProperties"]] = rest_field(
        name="cosmosDBSqlContainers", visibility=["read", "create", "update", "delete", "query"]
    )
    """The list of Cosmos DB container endpoints that IoT hub routes messages to, based on the routing
     rules."""

    @overload
    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,
    ) -> None: ...

    @overload
    def __init__(self, mapping: Mapping[str, Any]) -> None:
        """
        :param mapping: raw JSON to initialize the model.
        :type mapping: Mapping[str, Any]
        """

    def __init__(self, *args: Any, **kwargs: Any) -> None:
        super().__init__(*args, **kwargs)


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

    :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
    """

    id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """Id of the event hub endpoint."""
    connection_string: Optional[str] = rest_field(
        name="connectionString", visibility=["read", "create", "update", "delete", "query"]
    )
    """The connection string of the event hub endpoint."""
    endpoint_uri: Optional[str] = rest_field(
        name="endpointUri", visibility=["read", "create", "update", "delete", "query"]
    )
    """The url of the event hub endpoint. It must include the protocol sb://."""
    entity_path: Optional[str] = rest_field(
        name="entityPath", visibility=["read", "create", "update", "delete", "query"]
    )
    """Event hub name on the event hub namespace."""
    authentication_type: Optional[Union[str, "_models.AuthenticationType"]] = rest_field(
        name="authenticationType", visibility=["read", "create", "update", "delete", "query"]
    )
    """Method used to authenticate against the event hub endpoint. Known values are: \"keyBased\" and
     \"identityBased\"."""
    identity: Optional["_models.ManagedIdentity"] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """Managed identity properties of routing event hub endpoint."""
    name: str = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """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."""
    subscription_id: Optional[str] = rest_field(
        name="subscriptionId", visibility=["read", "create", "update", "delete", "query"]
    )
    """The subscription identifier of the event hub endpoint."""
    resource_group: Optional[str] = rest_field(
        name="resourceGroup", visibility=["read", "create", "update", "delete", "query"]
    )
    """The name of the resource group of the event hub endpoint."""

    @overload
    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,
    ) -> None: ...

    @overload
    def __init__(self, mapping: Mapping[str, Any]) -> None:
        """
        :param mapping: raw JSON to initialize the model.
        :type mapping: Mapping[str, Any]
        """

    def __init__(self, *args: Any, **kwargs: Any) -> None:
        super().__init__(*args, **kwargs)


class RoutingMessage(_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]
    """

    body: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """Body of routing message."""
    app_properties: Optional[dict[str, str]] = rest_field(
        name="appProperties", visibility=["read", "create", "update", "delete", "query"]
    )
    """App properties."""
    system_properties: Optional[dict[str, str]] = rest_field(
        name="systemProperties", visibility=["read", "create", "update", "delete", "query"]
    )
    """System properties."""

    @overload
    def __init__(
        self,
        *,
        body: Optional[str] = None,
        app_properties: Optional[dict[str, str]] = None,
        system_properties: Optional[dict[str, str]] = None,
    ) -> None: ...

    @overload
    def __init__(self, mapping: Mapping[str, Any]) -> None:
        """
        :param mapping: raw JSON to initialize the model.
        :type mapping: Mapping[str, Any]
        """

    def __init__(self, *args: Any, **kwargs: Any) -> None:
        super().__init__(*args, **kwargs)


class RoutingProperties(_Model):
    """The routing related properties of the IoT hub. See:
    `https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-messaging
    <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
     <https://aka.ms/telemetryoneventgrid>`_.
    :vartype enrichments: list[~azure.mgmt.iothub.models.EnrichmentProperties]
    """

    endpoints: Optional["_models.RoutingEndpoints"] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """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."""
    routes: Optional[list["_models.RouteProperties"]] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """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."""
    fallback_route: Optional["_models.FallbackRouteProperties"] = rest_field(
        name="fallbackRoute", visibility=["read", "create", "update", "delete", "query"]
    )
    """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."""
    enrichments: Optional[list["_models.EnrichmentProperties"]] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """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
     <https://aka.ms/telemetryoneventgrid>`_."""

    @overload
    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,
    ) -> None: ...

    @overload
    def __init__(self, mapping: Mapping[str, Any]) -> None:
        """
        :param mapping: raw JSON to initialize the model.
        :type mapping: Mapping[str, Any]
        """

    def __init__(self, *args: Any, **kwargs: Any) -> None:
        super().__init__(*args, **kwargs)


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

    :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
    """

    id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """Id of the service bus queue endpoint."""
    connection_string: Optional[str] = rest_field(
        name="connectionString", visibility=["read", "create", "update", "delete", "query"]
    )
    """The connection string of the service bus queue endpoint."""
    endpoint_uri: Optional[str] = rest_field(
        name="endpointUri", visibility=["read", "create", "update", "delete", "query"]
    )
    """The url of the service bus queue endpoint. It must include the protocol sb://."""
    entity_path: Optional[str] = rest_field(
        name="entityPath", visibility=["read", "create", "update", "delete", "query"]
    )
    """Queue name on the service bus namespace."""
    authentication_type: Optional[Union[str, "_models.AuthenticationType"]] = rest_field(
        name="authenticationType", visibility=["read", "create", "update", "delete", "query"]
    )
    """Method used to authenticate against the service bus queue endpoint. Known values are:
     \"keyBased\" and \"identityBased\"."""
    identity: Optional["_models.ManagedIdentity"] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """Managed identity properties of routing service bus queue endpoint."""
    name: str = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """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."""
    subscription_id: Optional[str] = rest_field(
        name="subscriptionId", visibility=["read", "create", "update", "delete", "query"]
    )
    """The subscription identifier of the service bus queue endpoint."""
    resource_group: Optional[str] = rest_field(
        name="resourceGroup", visibility=["read", "create", "update", "delete", "query"]
    )
    """The name of the resource group of the service bus queue endpoint."""

    @overload
    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,
    ) -> None: ...

    @overload
    def __init__(self, mapping: Mapping[str, Any]) -> None:
        """
        :param mapping: raw JSON to initialize the model.
        :type mapping: Mapping[str, Any]
        """

    def __init__(self, *args: Any, **kwargs: Any) -> None:
        super().__init__(*args, **kwargs)


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

    :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
    """

    id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """Id of the service bus topic endpoint."""
    connection_string: Optional[str] = rest_field(
        name="connectionString", visibility=["read", "create", "update", "delete", "query"]
    )
    """The connection string of the service bus topic endpoint."""
    endpoint_uri: Optional[str] = rest_field(
        name="endpointUri", visibility=["read", "create", "update", "delete", "query"]
    )
    """The url of the service bus topic endpoint. It must include the protocol sb://."""
    entity_path: Optional[str] = rest_field(
        name="entityPath", visibility=["read", "create", "update", "delete", "query"]
    )
    """Queue name on the service bus topic."""
    authentication_type: Optional[Union[str, "_models.AuthenticationType"]] = rest_field(
        name="authenticationType", visibility=["read", "create", "update", "delete", "query"]
    )
    """Method used to authenticate against the service bus topic endpoint. Known values are:
     \"keyBased\" and \"identityBased\"."""
    identity: Optional["_models.ManagedIdentity"] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """Managed identity properties of routing service bus topic endpoint."""
    name: str = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """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."""
    subscription_id: Optional[str] = rest_field(
        name="subscriptionId", visibility=["read", "create", "update", "delete", "query"]
    )
    """The subscription identifier of the service bus topic endpoint."""
    resource_group: Optional[str] = rest_field(
        name="resourceGroup", visibility=["read", "create", "update", "delete", "query"]
    )
    """The name of the resource group of the service bus topic endpoint."""

    @overload
    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,
    ) -> None: ...

    @overload
    def __init__(self, mapping: Mapping[str, Any]) -> None:
        """
        :param mapping: raw JSON to initialize the model.
        :type mapping: Mapping[str, Any]
        """

    def __init__(self, *args: Any, **kwargs: Any) -> None:
        super().__init__(*args, **kwargs)


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

    :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
    """

    id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """Id of the storage container endpoint."""
    connection_string: Optional[str] = rest_field(
        name="connectionString", visibility=["read", "create", "update", "delete", "query"]
    )
    """The connection string of the storage account."""
    endpoint_uri: Optional[str] = rest_field(
        name="endpointUri", visibility=["read", "create", "update", "delete", "query"]
    )
    """The url of the storage endpoint. It must include the protocol https://."""
    authentication_type: Optional[Union[str, "_models.AuthenticationType"]] = rest_field(
        name="authenticationType", visibility=["read", "create", "update", "delete", "query"]
    )
    """Method used to authenticate against the storage endpoint. Known values are: \"keyBased\" and
     \"identityBased\"."""
    identity: Optional["_models.ManagedIdentity"] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """Managed identity properties of routing storage endpoint."""
    name: str = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """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."""
    subscription_id: Optional[str] = rest_field(
        name="subscriptionId", visibility=["read", "create", "update", "delete", "query"]
    )
    """The subscription identifier of the storage account."""
    resource_group: Optional[str] = rest_field(
        name="resourceGroup", visibility=["read", "create", "update", "delete", "query"]
    )
    """The name of the resource group of the storage account."""
    container_name: str = rest_field(name="containerName", visibility=["read", "create", "update", "delete", "query"])
    """The name of storage container in the storage account. Required."""
    file_name_format: Optional[str] = rest_field(
        name="fileNameFormat", visibility=["read", "create", "update", "delete", "query"]
    )
    """File name format for the blob. Default format is
     {iothub}/{partition}/{YYYY}/{MM}/{DD}/{HH}/{mm}. All parameters are mandatory but can be
     reordered."""
    batch_frequency_in_seconds: Optional[int] = rest_field(
        name="batchFrequencyInSeconds", visibility=["read", "create", "update", "delete", "query"]
    )
    """Time interval at which blobs are written to storage. Value should be between 60 and 720
     seconds. Default value is 300 seconds."""
    max_chunk_size_in_bytes: Optional[int] = rest_field(
        name="maxChunkSizeInBytes", visibility=["read", "create", "update", "delete", "query"]
    )
    """Maximum number of bytes for each blob written to storage. Value should be between
     10485760(10MB) and 524288000(500MB). Default value is 314572800(300MB)."""
    encoding: Optional[Union[str, "_models.RoutingStorageContainerPropertiesEncoding"]] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """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\"."""

    @overload
    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,
    ) -> None: ...

    @overload
    def __init__(self, mapping: Mapping[str, Any]) -> None:
        """
        :param mapping: raw JSON to initialize the model.
        :type mapping: Mapping[str, Any]
        """

    def __init__(self, *args: Any, **kwargs: Any) -> None:
        super().__init__(*args, **kwargs)


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

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

    tags: Optional[Any] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """Twin Tags."""
    properties: Optional["_models.RoutingTwinProperties"] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )

    @overload
    def __init__(
        self,
        *,
        tags: Optional[Any] = None,
        properties: Optional["_models.RoutingTwinProperties"] = None,
    ) -> None: ...

    @overload
    def __init__(self, mapping: Mapping[str, Any]) -> None:
        """
        :param mapping: raw JSON to initialize the model.
        :type mapping: Mapping[str, Any]
        """

    def __init__(self, *args: Any, **kwargs: Any) -> None:
        super().__init__(*args, **kwargs)


class RoutingTwinProperties(_Model):
    """RoutingTwinProperties.

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

    desired: Optional[Any] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """Twin desired properties."""
    reported: Optional[Any] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """Twin desired properties."""

    @overload
    def __init__(
        self,
        *,
        desired: Optional[Any] = None,
        reported: Optional[Any] = None,
    ) -> None: ...

    @overload
    def __init__(self, mapping: Mapping[str, Any]) -> None:
        """
        :param mapping: raw JSON to initialize the model.
        :type mapping: Mapping[str, Any]
        """

    def __init__(self, *args: Any, **kwargs: Any) -> None:
        super().__init__(*args, **kwargs)


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

    :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
    """

    key_name: str = rest_field(name="keyName", visibility=["read", "create", "update", "delete", "query"])
    """The name of the shared access policy. Required."""
    primary_key: Optional[str] = rest_field(
        name="primaryKey", visibility=["read", "create", "update", "delete", "query"]
    )
    """The primary key."""
    secondary_key: Optional[str] = rest_field(
        name="secondaryKey", visibility=["read", "create", "update", "delete", "query"]
    )
    """The secondary key."""
    rights: Union[str, "_models.AccessRights"] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """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\"."""

    @overload
    def __init__(
        self,
        *,
        key_name: str,
        rights: Union[str, "_models.AccessRights"],
        primary_key: Optional[str] = None,
        secondary_key: Optional[str] = None,
    ) -> None: ...

    @overload
    def __init__(self, mapping: Mapping[str, Any]) -> None:
        """
        :param mapping: raw JSON to initialize the model.
        :type mapping: Mapping[str, Any]
        """

    def __init__(self, *args: Any, **kwargs: Any) -> None:
        super().__init__(*args, **kwargs)


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

    :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
     <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
    """

    sas_ttl_as_iso8601: Optional[datetime.timedelta] = rest_field(
        name="sasTtlAsIso8601", visibility=["read", "create", "update", "delete", "query"]
    )
    """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
     <https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-file-upload#file-upload-notification-configuration-options>`_."""
    connection_string: str = rest_field(
        name="connectionString", visibility=["read", "create", "update", "delete", "query"]
    )
    """The connection string for the Azure Storage account to which files are uploaded. Required."""
    container_name: str = rest_field(name="containerName", visibility=["read", "create", "update", "delete", "query"])
    """The name of the root container where you upload files. The container need not exist but should
     be creatable using the connectionString specified. Required."""
    authentication_type: Optional[Union[str, "_models.AuthenticationType"]] = rest_field(
        name="authenticationType", visibility=["read", "create", "update", "delete", "query"]
    )
    """Specifies authentication type being used for connecting to the storage account. Known values
     are: \"keyBased\" and \"identityBased\"."""
    identity: Optional["_models.ManagedIdentity"] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """Managed identity properties of storage endpoint for file upload."""

    @overload
    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,
    ) -> None: ...

    @overload
    def __init__(self, mapping: Mapping[str, Any]) -> None:
        """
        :param mapping: raw JSON to initialize the model.
        :type mapping: Mapping[str, Any]
        """

    def __init__(self, *args: Any, **kwargs: Any) -> None:
        super().__init__(*args, **kwargs)


class SystemData(_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
    """

    created_by: Optional[str] = rest_field(name="createdBy", visibility=["read", "create", "update", "delete", "query"])
    """The identity that created the resource."""
    created_by_type: Optional[Union[str, "_models.CreatedByType"]] = rest_field(
        name="createdByType", visibility=["read", "create", "update", "delete", "query"]
    )
    """The type of identity that created the resource. Known values are: \"User\", \"Application\",
     \"ManagedIdentity\", and \"Key\"."""
    created_at: Optional[datetime.datetime] = rest_field(
        name="createdAt", visibility=["read", "create", "update", "delete", "query"], format="rfc3339"
    )
    """The timestamp of resource creation (UTC)."""
    last_modified_by: Optional[str] = rest_field(
        name="lastModifiedBy", visibility=["read", "create", "update", "delete", "query"]
    )
    """The identity that last modified the resource."""
    last_modified_by_type: Optional[Union[str, "_models.CreatedByType"]] = rest_field(
        name="lastModifiedByType", visibility=["read", "create", "update", "delete", "query"]
    )
    """The type of identity that last modified the resource. Known values are: \"User\",
     \"Application\", \"ManagedIdentity\", and \"Key\"."""
    last_modified_at: Optional[datetime.datetime] = rest_field(
        name="lastModifiedAt", visibility=["read", "create", "update", "delete", "query"], format="rfc3339"
    )
    """The timestamp of resource last modification (UTC)."""

    @overload
    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,
    ) -> None: ...

    @overload
    def __init__(self, mapping: Mapping[str, Any]) -> None:
        """
        :param mapping: raw JSON to initialize the model.
        :type mapping: Mapping[str, Any]
        """

    def __init__(self, *args: Any, **kwargs: Any) -> None:
        super().__init__(*args, **kwargs)


class TagsResource(_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]
    """

    tags: Optional[dict[str, str]] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """Resource tags."""

    @overload
    def __init__(
        self,
        *,
        tags: Optional[dict[str, str]] = None,
    ) -> None: ...

    @overload
    def __init__(self, mapping: Mapping[str, Any]) -> None:
        """
        :param mapping: raw JSON to initialize the model.
        :type mapping: Mapping[str, Any]
        """

    def __init__(self, *args: Any, **kwargs: Any) -> None:
        super().__init__(*args, **kwargs)


class TestAllRoutesInput(_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
    """

    routing_source: Optional[Union[str, "_models.RoutingSource"]] = rest_field(
        name="routingSource", visibility=["read", "create", "update", "delete", "query"]
    )
    """Routing source. Known values are: \"Invalid\", \"DeviceMessages\", \"TwinChangeEvents\",
     \"DeviceLifecycleEvents\", \"DeviceJobLifecycleEvents\", \"DigitalTwinChangeEvents\",
     \"DeviceConnectionStateEvents\", and \"MqttBrokerMessages\"."""
    message: Optional["_models.RoutingMessage"] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """Routing message."""
    twin: Optional["_models.RoutingTwin"] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """Routing Twin Reference."""

    @overload
    def __init__(
        self,
        *,
        routing_source: Optional[Union[str, "_models.RoutingSource"]] = None,
        message: Optional["_models.RoutingMessage"] = None,
        twin: Optional["_models.RoutingTwin"] = None,
    ) -> None: ...

    @overload
    def __init__(self, mapping: Mapping[str, Any]) -> None:
        """
        :param mapping: raw JSON to initialize the model.
        :type mapping: Mapping[str, Any]
        """

    def __init__(self, *args: Any, **kwargs: Any) -> None:
        super().__init__(*args, **kwargs)


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

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

    routes: Optional[list["_models.MatchedRoute"]] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """JSON-serialized array of matched routes."""

    @overload
    def __init__(
        self,
        *,
        routes: Optional[list["_models.MatchedRoute"]] = None,
    ) -> None: ...

    @overload
    def __init__(self, mapping: Mapping[str, Any]) -> None:
        """
        :param mapping: raw JSON to initialize the model.
        :type mapping: Mapping[str, Any]
        """

    def __init__(self, *args: Any, **kwargs: Any) -> None:
        super().__init__(*args, **kwargs)


class TestRouteInput(_Model):
    """Input for testing route.

    :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
    """

    message: Optional["_models.RoutingMessage"] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """Routing message."""
    route: "_models.RouteProperties" = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """Route properties. Required."""
    twin: Optional["_models.RoutingTwin"] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """Routing Twin Reference."""

    @overload
    def __init__(
        self,
        *,
        route: "_models.RouteProperties",
        message: Optional["_models.RoutingMessage"] = None,
        twin: Optional["_models.RoutingTwin"] = None,
    ) -> None: ...

    @overload
    def __init__(self, mapping: Mapping[str, Any]) -> None:
        """
        :param mapping: raw JSON to initialize the model.
        :type mapping: Mapping[str, Any]
        """

    def __init__(self, *args: Any, **kwargs: Any) -> None:
        super().__init__(*args, **kwargs)


class TestRouteResult(_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
    """

    result: Optional[Union[str, "_models.TestResultStatus"]] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """Result of testing route. Known values are: \"undefined\", \"false\", and \"true\"."""
    details: Optional["_models.TestRouteResultDetails"] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """Detailed result of testing route."""

    @overload
    def __init__(
        self,
        *,
        result: Optional[Union[str, "_models.TestResultStatus"]] = None,
        details: Optional["_models.TestRouteResultDetails"] = None,
    ) -> None: ...

    @overload
    def __init__(self, mapping: Mapping[str, Any]) -> None:
        """
        :param mapping: raw JSON to initialize the model.
        :type mapping: Mapping[str, Any]
        """

    def __init__(self, *args: Any, **kwargs: Any) -> None:
        super().__init__(*args, **kwargs)


class TestRouteResultDetails(_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]
    """

    compilation_errors: Optional[list["_models.RouteCompilationError"]] = rest_field(
        name="compilationErrors", visibility=["read", "create", "update", "delete", "query"]
    )
    """JSON-serialized list of route compilation errors."""

    @overload
    def __init__(
        self,
        *,
        compilation_errors: Optional[list["_models.RouteCompilationError"]] = None,
    ) -> None: ...

    @overload
    def __init__(self, mapping: Mapping[str, Any]) -> None:
        """
        :param mapping: raw JSON to initialize the model.
        :type mapping: Mapping[str, Any]
        """

    def __init__(self, *args: Any, **kwargs: Any) -> None:
        super().__init__(*args, **kwargs)


class UserSubscriptionQuota(_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
    """

    id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """IotHub type id."""
    type: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """Response type."""
    unit: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """Unit of IotHub type."""
    current_value: Optional[int] = rest_field(
        name="currentValue", visibility=["read", "create", "update", "delete", "query"]
    )
    """Current number of IotHub type."""
    limit: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """Numerical limit on IotHub type."""
    name: Optional["_models.Name"] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """IotHub type."""

    @overload
    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,
    ) -> None: ...

    @overload
    def __init__(self, mapping: Mapping[str, Any]) -> None:
        """
        :param mapping: raw JSON to initialize the model.
        :type mapping: Mapping[str, Any]
        """

    def __init__(self, *args: Any, **kwargs: Any) -> None:
        super().__init__(*args, **kwargs)


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

    :ivar value: The UserSubscriptionQuota items on this page.
    :vartype value: list[~azure.mgmt.iothub.models.UserSubscriptionQuota]
    :ivar next_link: The link to the next page of items.
    :vartype next_link: str
    """

    value: Optional[list["_models.UserSubscriptionQuota"]] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """The UserSubscriptionQuota items on this page."""
    next_link: Optional[str] = rest_field(name="nextLink", visibility=["read"])
    """The link to the next page of items."""

    @overload
    def __init__(
        self,
        *,
        value: Optional[list["_models.UserSubscriptionQuota"]] = None,
    ) -> None: ...

    @overload
    def __init__(self, mapping: Mapping[str, Any]) -> None:
        """
        :param mapping: raw JSON to initialize the model.
        :type mapping: Mapping[str, Any]
        """

    def __init__(self, *args: Any, **kwargs: Any) -> None:
        super().__init__(*args, **kwargs)
