# 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, Literal, Mapping, Optional, TYPE_CHECKING, Union, overload

from .._utils.model_base import Model as _Model, rest_discriminator, rest_field
from ._enums import (
    AdvancedFilterOperatorType,
    DeadLetterEndPointType,
    DeliveryAttributeMappingType,
    EndpointType,
    FilterOperatorType,
    InputSchemaMappingType,
    PartnerClientAuthenticationType,
    PartnerEndpointType,
    StaticRoutingEnrichmentType,
)

if TYPE_CHECKING:
    from .. import models as _models


class AdvancedFilter(_Model):
    """This is the base type that represents an advanced filter. To configure an advanced filter, do
    not directly instantiate an object of this class. Instead, instantiate an object of a derived
    class such as BoolEqualsAdvancedFilter, NumberInAdvancedFilter, StringEqualsAdvancedFilter etc.
    depending on the type of the key based on which you want to filter.

    You probably want to use the sub-classes and not this class directly. Known sub-classes are:
    BoolEqualsAdvancedFilter, IsNotNullAdvancedFilter, IsNullOrUndefinedAdvancedFilter,
    NumberGreaterThanAdvancedFilter, NumberGreaterThanOrEqualsAdvancedFilter,
    NumberInAdvancedFilter, NumberInRangeAdvancedFilter, NumberLessThanAdvancedFilter,
    NumberLessThanOrEqualsAdvancedFilter, NumberNotInAdvancedFilter,
    NumberNotInRangeAdvancedFilter, StringBeginsWithAdvancedFilter, StringContainsAdvancedFilter,
    StringEndsWithAdvancedFilter, StringInAdvancedFilter, StringNotBeginsWithAdvancedFilter,
    StringNotContainsAdvancedFilter, StringNotEndsWithAdvancedFilter, StringNotInAdvancedFilter

    :ivar operator_type: The operator type used for filtering, e.g., NumberIn, StringContains,
     BoolEquals and others. Required. Known values are: "NumberIn", "NumberNotIn", "NumberLessThan",
     "NumberGreaterThan", "NumberLessThanOrEquals", "NumberGreaterThanOrEquals", "BoolEquals",
     "StringIn", "StringNotIn", "StringBeginsWith", "StringEndsWith", "StringContains",
     "NumberInRange", "NumberNotInRange", "StringNotBeginsWith", "StringNotEndsWith",
     "StringNotContains", "IsNullOrUndefined", and "IsNotNull".
    :vartype operator_type: str or ~azure.mgmt.eventgrid.models.AdvancedFilterOperatorType
    :ivar key: The field/property in the event based on which you want to filter.
    :vartype key: str
    """

    __mapping__: dict[str, _Model] = {}
    operator_type: str = rest_discriminator(
        name="operatorType", visibility=["read", "create", "update", "delete", "query"]
    )
    """The operator type used for filtering, e.g., NumberIn, StringContains, BoolEquals and others.
     Required. Known values are: \"NumberIn\", \"NumberNotIn\", \"NumberLessThan\",
     \"NumberGreaterThan\", \"NumberLessThanOrEquals\", \"NumberGreaterThanOrEquals\",
     \"BoolEquals\", \"StringIn\", \"StringNotIn\", \"StringBeginsWith\", \"StringEndsWith\",
     \"StringContains\", \"NumberInRange\", \"NumberNotInRange\", \"StringNotBeginsWith\",
     \"StringNotEndsWith\", \"StringNotContains\", \"IsNullOrUndefined\", and \"IsNotNull\"."""
    key: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """The field/property in the event based on which you want to filter."""

    @overload
    def __init__(
        self,
        *,
        operator_type: str,
        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 PartnerClientAuthentication(_Model):
    """Partner client authentication.

    You probably want to use the sub-classes and not this class directly. Known sub-classes are:
    AzureADPartnerClientAuthentication

    :ivar client_authentication_type: Type of client authentication. Required. "AzureAD"
    :vartype client_authentication_type: str or
     ~azure.mgmt.eventgrid.models.PartnerClientAuthenticationType
    """

    __mapping__: dict[str, _Model] = {}
    client_authentication_type: str = rest_discriminator(
        name="clientAuthenticationType", visibility=["read", "create", "update", "delete", "query"]
    )
    """Type of client authentication. Required. \"AzureAD\""""

    @overload
    def __init__(
        self,
        *,
        client_authentication_type: 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 AzureADPartnerClientAuthentication(PartnerClientAuthentication, discriminator="AzureAD"):
    """Microsoft Entra ID Partner Client Authentication.

    :ivar properties: Microsoft Entra ID ClientAuthentication Properties.
    :vartype properties: ~azure.mgmt.eventgrid.models.AzureADPartnerClientAuthenticationProperties
    :ivar client_authentication_type: Type of client authentication. Required. AzureAD.
    :vartype client_authentication_type: str or ~azure.mgmt.eventgrid.models.AZURE_AD
    """

    properties: Optional["_models.AzureADPartnerClientAuthenticationProperties"] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """Microsoft Entra ID ClientAuthentication Properties."""
    client_authentication_type: Literal[PartnerClientAuthenticationType.AZURE_AD] = rest_discriminator(name="clientAuthenticationType", visibility=["read", "create", "update", "delete", "query"])  # type: ignore
    """Type of client authentication. Required. AzureAD."""

    __flattened_items = ["azure_active_directory_tenant_id", "azure_active_directory_application_id_or_uri"]

    @overload
    def __init__(
        self,
        *,
        properties: Optional["_models.AzureADPartnerClientAuthenticationProperties"] = 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:
        _flattened_input = {k: kwargs.pop(k) for k in kwargs.keys() & self.__flattened_items}
        super().__init__(*args, **kwargs)
        for k, v in _flattened_input.items():
            setattr(self, k, v)

    def __getattr__(self, name: str) -> Any:
        if name in self.__flattened_items:
            if self.properties is None:
                return None
            return getattr(self.properties, name)
        raise AttributeError(f"'{self.__class__.__name__}' object has no attribute '{name}'")

    def __setattr__(self, key: str, value: Any) -> None:
        if key in self.__flattened_items:
            if self.properties is None:
                self.properties = self._attr_to_rest_field["properties"]._class_type()
            setattr(self.properties, key, value)
        else:
            super().__setattr__(key, value)


class AzureADPartnerClientAuthenticationProperties(_Model):  # pylint: disable=name-too-long
    """Properties of a Microsoft Entra ID Partner Client Authentication.

    :ivar azure_active_directory_tenant_id: The Microsoft Entra ID Tenant ID to get the access
     token that will be included as the bearer token in delivery requests.
    :vartype azure_active_directory_tenant_id: str
    :ivar azure_active_directory_application_id_or_uri: The Microsoft Entra ID Application ID or
     URI to get the access token that will be included as the bearer token in delivery requests.
    :vartype azure_active_directory_application_id_or_uri: str
    """

    azure_active_directory_tenant_id: Optional[str] = rest_field(
        name="azureActiveDirectoryTenantId", visibility=["read", "create", "update", "delete", "query"]
    )
    """The Microsoft Entra ID Tenant ID to get the access token that will be included as the bearer
     token in delivery requests."""
    azure_active_directory_application_id_or_uri: Optional[str] = rest_field(
        name="azureActiveDirectoryApplicationIdOrUri", visibility=["read", "create", "update", "delete", "query"]
    )
    """The Microsoft Entra ID Application ID or URI to get the access token that will be included as
     the bearer token in delivery requests."""

    @overload
    def __init__(
        self,
        *,
        azure_active_directory_tenant_id: Optional[str] = None,
        azure_active_directory_application_id_or_uri: 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 EventSubscriptionDestination(_Model):
    """Information about the destination for an event subscription.

    You probably want to use the sub-classes and not this class directly. Known sub-classes are:
    AzureFunctionEventSubscriptionDestination, EventHubEventSubscriptionDestination,
    HybridConnectionEventSubscriptionDestination, MonitorAlertEventSubscriptionDestination,
    NamespaceTopicEventSubscriptionDestination, PartnerEventSubscriptionDestination,
    ServiceBusQueueEventSubscriptionDestination, ServiceBusTopicEventSubscriptionDestination,
    StorageQueueEventSubscriptionDestination, WebHookEventSubscriptionDestination

    :ivar endpoint_type: Type of the endpoint for the event subscription destination. Required.
     Known values are: "WebHook", "EventHub", "StorageQueue", "HybridConnection", "ServiceBusQueue",
     "ServiceBusTopic", "AzureFunction", "PartnerDestination", "MonitorAlert", and "NamespaceTopic".
    :vartype endpoint_type: str or ~azure.mgmt.eventgrid.models.EndpointType
    """

    __mapping__: dict[str, _Model] = {}
    endpoint_type: str = rest_discriminator(
        name="endpointType", visibility=["read", "create", "update", "delete", "query"]
    )
    """Type of the endpoint for the event subscription destination. Required. Known values are:
     \"WebHook\", \"EventHub\", \"StorageQueue\", \"HybridConnection\", \"ServiceBusQueue\",
     \"ServiceBusTopic\", \"AzureFunction\", \"PartnerDestination\", \"MonitorAlert\", and
     \"NamespaceTopic\"."""

    @overload
    def __init__(
        self,
        *,
        endpoint_type: 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 AzureFunctionEventSubscriptionDestination(
    EventSubscriptionDestination, discriminator="AzureFunction"
):  # pylint: disable=name-too-long
    """Information about the azure function destination for an event subscription.

    :ivar properties: Azure Function Properties of the event subscription destination.
    :vartype properties:
     ~azure.mgmt.eventgrid.models.AzureFunctionEventSubscriptionDestinationProperties
    :ivar endpoint_type: Type of the endpoint for the event subscription destination. Required.
     AzureFunction.
    :vartype endpoint_type: str or ~azure.mgmt.eventgrid.models.AZURE_FUNCTION
    """

    properties: Optional["_models.AzureFunctionEventSubscriptionDestinationProperties"] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """Azure Function Properties of the event subscription destination."""
    endpoint_type: Literal[EndpointType.AZURE_FUNCTION] = rest_discriminator(name="endpointType", visibility=["read", "create", "update", "delete", "query"])  # type: ignore
    """Type of the endpoint for the event subscription destination. Required. AzureFunction."""

    __flattened_items = [
        "resource_id",
        "max_events_per_batch",
        "preferred_batch_size_in_kilobytes",
        "delivery_attribute_mappings",
    ]

    @overload
    def __init__(
        self,
        *,
        properties: Optional["_models.AzureFunctionEventSubscriptionDestinationProperties"] = 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:
        _flattened_input = {k: kwargs.pop(k) for k in kwargs.keys() & self.__flattened_items}
        super().__init__(*args, **kwargs)
        for k, v in _flattened_input.items():
            setattr(self, k, v)

    def __getattr__(self, name: str) -> Any:
        if name in self.__flattened_items:
            if self.properties is None:
                return None
            return getattr(self.properties, name)
        raise AttributeError(f"'{self.__class__.__name__}' object has no attribute '{name}'")

    def __setattr__(self, key: str, value: Any) -> None:
        if key in self.__flattened_items:
            if self.properties is None:
                self.properties = self._attr_to_rest_field["properties"]._class_type()
            setattr(self.properties, key, value)
        else:
            super().__setattr__(key, value)


class AzureFunctionEventSubscriptionDestinationProperties(_Model):  # pylint: disable=name-too-long
    """The properties that represent the Azure Function destination of an event subscription.

    :ivar resource_id: The Azure Resource Id that represents the endpoint of the Azure Function
     destination of an event subscription.
    :vartype resource_id: str
    :ivar max_events_per_batch: Maximum number of events per batch.
    :vartype max_events_per_batch: int
    :ivar preferred_batch_size_in_kilobytes: Preferred batch size in Kilobytes.
    :vartype preferred_batch_size_in_kilobytes: int
    :ivar delivery_attribute_mappings: Delivery attribute details.
    :vartype delivery_attribute_mappings:
     list[~azure.mgmt.eventgrid.models.DeliveryAttributeMapping]
    """

    resource_id: Optional[str] = rest_field(
        name="resourceId", visibility=["read", "create", "update", "delete", "query"]
    )
    """The Azure Resource Id that represents the endpoint of the Azure Function destination of an
     event subscription."""
    max_events_per_batch: Optional[int] = rest_field(
        name="maxEventsPerBatch", visibility=["read", "create", "update", "delete", "query"]
    )
    """Maximum number of events per batch."""
    preferred_batch_size_in_kilobytes: Optional[int] = rest_field(
        name="preferredBatchSizeInKilobytes", visibility=["read", "create", "update", "delete", "query"]
    )
    """Preferred batch size in Kilobytes."""
    delivery_attribute_mappings: Optional[list["_models.DeliveryAttributeMapping"]] = rest_field(
        name="deliveryAttributeMappings", visibility=["read", "create", "update", "delete", "query"]
    )
    """Delivery attribute details."""

    @overload
    def __init__(
        self,
        *,
        resource_id: Optional[str] = None,
        max_events_per_batch: Optional[int] = None,
        preferred_batch_size_in_kilobytes: Optional[int] = None,
        delivery_attribute_mappings: Optional[list["_models.DeliveryAttributeMapping"]] = 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 BoolEqualsAdvancedFilter(AdvancedFilter, discriminator="BoolEquals"):
    """BoolEquals Advanced Filter.

    :ivar key: The field/property in the event based on which you want to filter.
    :vartype key: str
    :ivar value: The boolean filter value.
    :vartype value: bool
    :ivar operator_type: The operator type used for filtering, e.g., NumberIn, StringContains,
     BoolEquals and others. Required. BoolEquals.
    :vartype operator_type: str or ~azure.mgmt.eventgrid.models.BOOL_EQUALS
    """

    value: Optional[bool] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """The boolean filter value."""
    operator_type: Literal[AdvancedFilterOperatorType.BOOL_EQUALS] = rest_discriminator(name="operatorType", visibility=["read", "create", "update", "delete", "query"])  # type: ignore
    """The operator type used for filtering, e.g., NumberIn, StringContains, BoolEquals and others.
     Required. BoolEquals."""

    @overload
    def __init__(
        self,
        *,
        key: Optional[str] = None,
        value: 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)
        self.operator_type = AdvancedFilterOperatorType.BOOL_EQUALS  # type: ignore


class Filter(_Model):
    """This is the base type that represents a filter. To configure a filter, do not directly
    instantiate an object of this class. Instead, instantiate an object of a derived class such as
    BoolEqualsFilter, NumberInFilter etc depending on the type of the key based on which you want
    to filter.

    You probably want to use the sub-classes and not this class directly. Known sub-classes are:
    BoolEqualsFilter, IsNotNullFilter, IsNullOrUndefinedFilter, NumberGreaterThanFilter,
    NumberGreaterThanOrEqualsFilter, NumberInFilter, NumberInRangeFilter, NumberLessThanFilter,
    NumberLessThanOrEqualsFilter, NumberNotInFilter, NumberNotInRangeFilter,
    StringBeginsWithFilter, StringContainsFilter, StringEndsWithFilter, StringInFilter,
    StringNotBeginsWithFilter, StringNotContainsFilter, StringNotEndsWithFilter, StringNotInFilter

    :ivar operator_type: The operator type used for filtering, e.g., NumberIn, StringContains,
     BoolEquals and others. Required. Known values are: "NumberIn", "NumberNotIn", "NumberLessThan",
     "NumberGreaterThan", "NumberLessThanOrEquals", "NumberGreaterThanOrEquals", "BoolEquals",
     "StringIn", "StringNotIn", "StringBeginsWith", "StringEndsWith", "StringContains",
     "NumberInRange", "NumberNotInRange", "StringNotBeginsWith", "StringNotEndsWith",
     "StringNotContains", "IsNullOrUndefined", and "IsNotNull".
    :vartype operator_type: str or ~azure.mgmt.eventgrid.models.FilterOperatorType
    :ivar key: The field/property in the event based on which you want to filter.
    :vartype key: str
    """

    __mapping__: dict[str, _Model] = {}
    operator_type: str = rest_discriminator(
        name="operatorType", visibility=["read", "create", "update", "delete", "query"]
    )
    """The operator type used for filtering, e.g., NumberIn, StringContains, BoolEquals and others.
     Required. Known values are: \"NumberIn\", \"NumberNotIn\", \"NumberLessThan\",
     \"NumberGreaterThan\", \"NumberLessThanOrEquals\", \"NumberGreaterThanOrEquals\",
     \"BoolEquals\", \"StringIn\", \"StringNotIn\", \"StringBeginsWith\", \"StringEndsWith\",
     \"StringContains\", \"NumberInRange\", \"NumberNotInRange\", \"StringNotBeginsWith\",
     \"StringNotEndsWith\", \"StringNotContains\", \"IsNullOrUndefined\", and \"IsNotNull\"."""
    key: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """The field/property in the event based on which you want to filter."""

    @overload
    def __init__(
        self,
        *,
        operator_type: str,
        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 BoolEqualsFilter(Filter, discriminator="BoolEquals"):
    """BoolEquals Filter.

    :ivar key: The field/property in the event based on which you want to filter.
    :vartype key: str
    :ivar value: The boolean filter value.
    :vartype value: bool
    :ivar operator_type: The operator type used for filtering, e.g., NumberIn, StringContains,
     BoolEquals and others. Required. BoolEquals.
    :vartype operator_type: str or ~azure.mgmt.eventgrid.models.BOOL_EQUALS
    """

    value: Optional[bool] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """The boolean filter value."""
    operator_type: Literal[FilterOperatorType.BOOL_EQUALS] = rest_discriminator(name="operatorType", visibility=["read", "create", "update", "delete", "query"])  # type: ignore
    """The operator type used for filtering, e.g., NumberIn, StringContains, BoolEquals and others.
     Required. BoolEquals."""

    @overload
    def __init__(
        self,
        *,
        key: Optional[str] = None,
        value: 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)
        self.operator_type = FilterOperatorType.BOOL_EQUALS  # type: ignore


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.eventgrid.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.eventgrid.models.SystemData
    """


class CaCertificate(ProxyResource):
    """The CA Certificate 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.eventgrid.models.SystemData
    :ivar properties: The properties of CA certificate.
    :vartype properties: ~azure.mgmt.eventgrid.models.CaCertificateProperties
    """

    properties: Optional["_models.CaCertificateProperties"] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """The properties of CA certificate."""

    __flattened_items = [
        "description",
        "encoded_certificate",
        "issue_time_in_utc",
        "expiry_time_in_utc",
        "provisioning_state",
    ]

    @overload
    def __init__(
        self,
        *,
        properties: Optional["_models.CaCertificateProperties"] = 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:
        _flattened_input = {k: kwargs.pop(k) for k in kwargs.keys() & self.__flattened_items}
        super().__init__(*args, **kwargs)
        for k, v in _flattened_input.items():
            setattr(self, k, v)

    def __getattr__(self, name: str) -> Any:
        if name in self.__flattened_items:
            if self.properties is None:
                return None
            return getattr(self.properties, name)
        raise AttributeError(f"'{self.__class__.__name__}' object has no attribute '{name}'")

    def __setattr__(self, key: str, value: Any) -> None:
        if key in self.__flattened_items:
            if self.properties is None:
                self.properties = self._attr_to_rest_field["properties"]._class_type()
            setattr(self.properties, key, value)
        else:
            super().__setattr__(key, value)


class CaCertificateProperties(_Model):
    """The properties of CA certificate.

    :ivar description: Description for the CA Certificate resource.
    :vartype description: str
    :ivar encoded_certificate: Base64 encoded PEM (Privacy Enhanced Mail) format certificate data.
    :vartype encoded_certificate: str
    :ivar issue_time_in_utc: Certificate issue time in UTC. This is a read-only field.
    :vartype issue_time_in_utc: ~datetime.datetime
    :ivar expiry_time_in_utc: Certificate expiry time in UTC. This is a read-only field.
    :vartype expiry_time_in_utc: ~datetime.datetime
    :ivar provisioning_state: Provisioning state of the CA Certificate resource. Known values are:
     "Creating", "Updating", "Deleting", "Succeeded", "Canceled", "Failed", and "Deleted".
    :vartype provisioning_state: str or ~azure.mgmt.eventgrid.models.CaCertificateProvisioningState
    """

    description: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """Description for the CA Certificate resource."""
    encoded_certificate: Optional[str] = rest_field(
        name="encodedCertificate", visibility=["read", "create", "update", "delete", "query"]
    )
    """Base64 encoded PEM (Privacy Enhanced Mail) format certificate data."""
    issue_time_in_utc: Optional[datetime.datetime] = rest_field(
        name="issueTimeInUtc", visibility=["read"], format="rfc3339"
    )
    """Certificate issue time in UTC. This is a read-only field."""
    expiry_time_in_utc: Optional[datetime.datetime] = rest_field(
        name="expiryTimeInUtc", visibility=["read"], format="rfc3339"
    )
    """Certificate expiry time in UTC. This is a read-only field."""
    provisioning_state: Optional[Union[str, "_models.CaCertificateProvisioningState"]] = rest_field(
        name="provisioningState", visibility=["read"]
    )
    """Provisioning state of the CA Certificate resource. Known values are: \"Creating\",
     \"Updating\", \"Deleting\", \"Succeeded\", \"Canceled\", \"Failed\", and \"Deleted\"."""

    @overload
    def __init__(
        self,
        *,
        description: Optional[str] = None,
        encoded_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 Channel(ProxyResource):
    """Channel info.

    :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.eventgrid.models.SystemData
    :ivar properties: Properties of the Channel.
    :vartype properties: ~azure.mgmt.eventgrid.models.ChannelProperties
    """

    properties: Optional["_models.ChannelProperties"] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """Properties of the Channel."""

    __flattened_items = [
        "channel_type",
        "partner_topic_info",
        "partner_destination_info",
        "message_for_activation",
        "provisioning_state",
        "readiness_state",
        "expiration_time_if_not_activated_utc",
    ]

    @overload
    def __init__(
        self,
        *,
        properties: Optional["_models.ChannelProperties"] = 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:
        _flattened_input = {k: kwargs.pop(k) for k in kwargs.keys() & self.__flattened_items}
        super().__init__(*args, **kwargs)
        for k, v in _flattened_input.items():
            setattr(self, k, v)

    def __getattr__(self, name: str) -> Any:
        if name in self.__flattened_items:
            if self.properties is None:
                return None
            return getattr(self.properties, name)
        raise AttributeError(f"'{self.__class__.__name__}' object has no attribute '{name}'")

    def __setattr__(self, key: str, value: Any) -> None:
        if key in self.__flattened_items:
            if self.properties is None:
                self.properties = self._attr_to_rest_field["properties"]._class_type()
            setattr(self.properties, key, value)
        else:
            super().__setattr__(key, value)


class ChannelProperties(_Model):
    """Properties of the Channel.

    :ivar channel_type: The type of the event channel which represents the direction flow of
     events. Known values are: "PartnerTopic" and "PartnerDestination".
    :vartype channel_type: str or ~azure.mgmt.eventgrid.models.ChannelType
    :ivar partner_topic_info: This property should be populated when channelType is PartnerTopic
     and represents information about the partner topic resource corresponding to the channel.
    :vartype partner_topic_info: ~azure.mgmt.eventgrid.models.PartnerTopicInfo
    :ivar partner_destination_info: This property should be populated when channelType is
     PartnerDestination and represents information about the partner destination resource
     corresponding to the channel.
    :vartype partner_destination_info: ~azure.mgmt.eventgrid.models.PartnerDestinationInfo
    :ivar message_for_activation: Context or helpful message that can be used during the approval
     process by the subscriber.
    :vartype message_for_activation: str
    :ivar provisioning_state: Provisioning state of the channel. Known values are: "Creating",
     "Updating", "Deleting", "Succeeded", "Canceled", "Failed",
     "IdleDueToMirroredPartnerTopicDeletion", and "IdleDueToMirroredPartnerDestinationDeletion".
    :vartype provisioning_state: str or ~azure.mgmt.eventgrid.models.ChannelProvisioningState
    :ivar readiness_state: The readiness state of the corresponding partner topic. Known values
     are: "NeverActivated" and "Activated".
    :vartype readiness_state: str or ~azure.mgmt.eventgrid.models.ReadinessState
    :ivar expiration_time_if_not_activated_utc: Expiration time of the channel. If this timer
     expires while the corresponding partner topic is never activated, the channel and corresponding
     partner topic are deleted.
    :vartype expiration_time_if_not_activated_utc: ~datetime.datetime
    """

    channel_type: Optional[Union[str, "_models.ChannelType"]] = rest_field(
        name="channelType", visibility=["read", "create", "update", "delete", "query"]
    )
    """The type of the event channel which represents the direction flow of events. Known values are:
     \"PartnerTopic\" and \"PartnerDestination\"."""
    partner_topic_info: Optional["_models.PartnerTopicInfo"] = rest_field(
        name="partnerTopicInfo", visibility=["read", "create", "update", "delete", "query"]
    )
    """This property should be populated when channelType is PartnerTopic and represents information
     about the partner topic resource corresponding to the channel."""
    partner_destination_info: Optional["_models.PartnerDestinationInfo"] = rest_field(
        name="partnerDestinationInfo", visibility=["read", "create", "update", "delete", "query"]
    )
    """This property should be populated when channelType is PartnerDestination and represents
     information about the partner destination resource corresponding to the channel."""
    message_for_activation: Optional[str] = rest_field(
        name="messageForActivation", visibility=["read", "create", "update", "delete", "query"]
    )
    """Context or helpful message that can be used during the approval process by the subscriber."""
    provisioning_state: Optional[Union[str, "_models.ChannelProvisioningState"]] = rest_field(
        name="provisioningState", visibility=["read", "create", "update", "delete", "query"]
    )
    """Provisioning state of the channel. Known values are: \"Creating\", \"Updating\", \"Deleting\",
     \"Succeeded\", \"Canceled\", \"Failed\", \"IdleDueToMirroredPartnerTopicDeletion\", and
     \"IdleDueToMirroredPartnerDestinationDeletion\"."""
    readiness_state: Optional[Union[str, "_models.ReadinessState"]] = rest_field(
        name="readinessState", visibility=["read", "create", "update", "delete", "query"]
    )
    """The readiness state of the corresponding partner topic. Known values are: \"NeverActivated\"
     and \"Activated\"."""
    expiration_time_if_not_activated_utc: Optional[datetime.datetime] = rest_field(
        name="expirationTimeIfNotActivatedUtc",
        visibility=["read", "create", "update", "delete", "query"],
        format="rfc3339",
    )
    """Expiration time of the channel. If this timer expires while the corresponding partner topic is
     never activated, the channel and corresponding partner topic are deleted."""

    @overload
    def __init__(
        self,
        *,
        channel_type: Optional[Union[str, "_models.ChannelType"]] = None,
        partner_topic_info: Optional["_models.PartnerTopicInfo"] = None,
        partner_destination_info: Optional["_models.PartnerDestinationInfo"] = None,
        message_for_activation: Optional[str] = None,
        provisioning_state: Optional[Union[str, "_models.ChannelProvisioningState"]] = None,
        readiness_state: Optional[Union[str, "_models.ReadinessState"]] = None,
        expiration_time_if_not_activated_utc: 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 ChannelUpdateParameters(_Model):
    """Properties of the Channel update.

    :ivar properties: Properties of the channel update parameters.
    :vartype properties: ~azure.mgmt.eventgrid.models.ChannelUpdateParametersProperties
    """

    properties: Optional["_models.ChannelUpdateParametersProperties"] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """Properties of the channel update parameters."""

    __flattened_items = ["expiration_time_if_not_activated_utc", "partner_destination_info", "partner_topic_info"]

    @overload
    def __init__(
        self,
        *,
        properties: Optional["_models.ChannelUpdateParametersProperties"] = 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:
        _flattened_input = {k: kwargs.pop(k) for k in kwargs.keys() & self.__flattened_items}
        super().__init__(*args, **kwargs)
        for k, v in _flattened_input.items():
            setattr(self, k, v)

    def __getattr__(self, name: str) -> Any:
        if name in self.__flattened_items:
            if self.properties is None:
                return None
            return getattr(self.properties, name)
        raise AttributeError(f"'{self.__class__.__name__}' object has no attribute '{name}'")

    def __setattr__(self, key: str, value: Any) -> None:
        if key in self.__flattened_items:
            if self.properties is None:
                self.properties = self._attr_to_rest_field["properties"]._class_type()
            setattr(self.properties, key, value)
        else:
            super().__setattr__(key, value)


class ChannelUpdateParametersProperties(_Model):
    """Properties of the channel update parameters.

    :ivar expiration_time_if_not_activated_utc: Expiration time of the channel. If this timer
     expires while the corresponding partner topic or partner destination is never activated, the
     channel and corresponding partner topic or partner destination are deleted.
    :vartype expiration_time_if_not_activated_utc: ~datetime.datetime
    :ivar partner_destination_info: Partner destination properties which can be updated if the
     channel is of type PartnerDestination.
    :vartype partner_destination_info: ~azure.mgmt.eventgrid.models.PartnerUpdateDestinationInfo
    :ivar partner_topic_info: Partner topic properties which can be updated if the channel is of
     type PartnerTopic.
    :vartype partner_topic_info: ~azure.mgmt.eventgrid.models.PartnerUpdateTopicInfo
    """

    expiration_time_if_not_activated_utc: Optional[datetime.datetime] = rest_field(
        name="expirationTimeIfNotActivatedUtc",
        visibility=["read", "create", "update", "delete", "query"],
        format="rfc3339",
    )
    """Expiration time of the channel. If this timer expires while the corresponding partner topic or
     partner destination is never activated, the channel and corresponding partner topic or partner
     destination are deleted."""
    partner_destination_info: Optional["_models.PartnerUpdateDestinationInfo"] = rest_field(
        name="partnerDestinationInfo", visibility=["read", "create", "update", "delete", "query"]
    )
    """Partner destination properties which can be updated if the channel is of type
     PartnerDestination."""
    partner_topic_info: Optional["_models.PartnerUpdateTopicInfo"] = rest_field(
        name="partnerTopicInfo", visibility=["read", "create", "update", "delete", "query"]
    )
    """Partner topic properties which can be updated if the channel is of type PartnerTopic."""

    @overload
    def __init__(
        self,
        *,
        expiration_time_if_not_activated_utc: Optional[datetime.datetime] = None,
        partner_destination_info: Optional["_models.PartnerUpdateDestinationInfo"] = None,
        partner_topic_info: Optional["_models.PartnerUpdateTopicInfo"] = 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 Client(ProxyResource):
    """The Client 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.eventgrid.models.SystemData
    :ivar properties: The properties of client.
    :vartype properties: ~azure.mgmt.eventgrid.models.ClientProperties
    """

    properties: Optional["_models.ClientProperties"] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """The properties of client."""

    __flattened_items = [
        "description",
        "authentication_name",
        "client_certificate_authentication",
        "state",
        "attributes",
        "provisioning_state",
    ]

    @overload
    def __init__(
        self,
        *,
        properties: Optional["_models.ClientProperties"] = 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:
        _flattened_input = {k: kwargs.pop(k) for k in kwargs.keys() & self.__flattened_items}
        super().__init__(*args, **kwargs)
        for k, v in _flattened_input.items():
            setattr(self, k, v)

    def __getattr__(self, name: str) -> Any:
        if name in self.__flattened_items:
            if self.properties is None:
                return None
            return getattr(self.properties, name)
        raise AttributeError(f"'{self.__class__.__name__}' object has no attribute '{name}'")

    def __setattr__(self, key: str, value: Any) -> None:
        if key in self.__flattened_items:
            if self.properties is None:
                self.properties = self._attr_to_rest_field["properties"]._class_type()
            setattr(self.properties, key, value)
        else:
            super().__setattr__(key, value)


class ClientAuthenticationSettings(_Model):
    """Client authentication settings for namespace resource.

    :ivar alternative_authentication_name_sources: Alternative authentication name sources related
     to client authentication settings for namespace resource.
    :vartype alternative_authentication_name_sources: list[str or
     ~azure.mgmt.eventgrid.models.AlternativeAuthenticationNameSource]
    :ivar custom_jwt_authentication: Custom JWT authentication settings for namespace resource.
    :vartype custom_jwt_authentication:
     ~azure.mgmt.eventgrid.models.CustomJwtAuthenticationSettings
    :ivar webhook_authentication: Authentication settings for a webhook endpoint within a Namespace
     resource.
    :vartype webhook_authentication: ~azure.mgmt.eventgrid.models.WebhookAuthenticationSettings
    """

    alternative_authentication_name_sources: Optional[
        list[Union[str, "_models.AlternativeAuthenticationNameSource"]]
    ] = rest_field(
        name="alternativeAuthenticationNameSources", visibility=["read", "create", "update", "delete", "query"]
    )
    """Alternative authentication name sources related to client authentication settings for namespace
     resource."""
    custom_jwt_authentication: Optional["_models.CustomJwtAuthenticationSettings"] = rest_field(
        name="customJwtAuthentication", visibility=["read", "create", "update", "delete", "query"]
    )
    """Custom JWT authentication settings for namespace resource."""
    webhook_authentication: Optional["_models.WebhookAuthenticationSettings"] = rest_field(
        name="webhookAuthentication", visibility=["read", "create", "update", "delete", "query"]
    )
    """Authentication settings for a webhook endpoint within a Namespace resource."""

    @overload
    def __init__(
        self,
        *,
        alternative_authentication_name_sources: Optional[
            list[Union[str, "_models.AlternativeAuthenticationNameSource"]]
        ] = None,
        custom_jwt_authentication: Optional["_models.CustomJwtAuthenticationSettings"] = None,
        webhook_authentication: Optional["_models.WebhookAuthenticationSettings"] = 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 ClientCertificateAuthentication(_Model):
    """The certificate authentication properties for the client.

    :ivar validation_scheme: The validation scheme used to authenticate the client. Default value
     is SubjectMatchesAuthenticationName. Known values are: "SubjectMatchesAuthenticationName",
     "DnsMatchesAuthenticationName", "UriMatchesAuthenticationName", "IpMatchesAuthenticationName",
     "EmailMatchesAuthenticationName", and "ThumbprintMatch".
    :vartype validation_scheme: str or
     ~azure.mgmt.eventgrid.models.ClientCertificateValidationScheme
    :ivar allowed_thumbprints: The list of thumbprints that are allowed during client
     authentication. This property is required only if the validationScheme is 'ThumbprintMatch'.
    :vartype allowed_thumbprints: list[str]
    """

    validation_scheme: Optional[Union[str, "_models.ClientCertificateValidationScheme"]] = rest_field(
        name="validationScheme", visibility=["read", "create", "update", "delete", "query"]
    )
    """The validation scheme used to authenticate the client. Default value is
     SubjectMatchesAuthenticationName. Known values are: \"SubjectMatchesAuthenticationName\",
     \"DnsMatchesAuthenticationName\", \"UriMatchesAuthenticationName\",
     \"IpMatchesAuthenticationName\", \"EmailMatchesAuthenticationName\", and \"ThumbprintMatch\"."""
    allowed_thumbprints: Optional[list[str]] = rest_field(
        name="allowedThumbprints", visibility=["read", "create", "update", "delete", "query"]
    )
    """The list of thumbprints that are allowed during client authentication. This property is
     required only if the validationScheme is 'ThumbprintMatch'."""

    @overload
    def __init__(
        self,
        *,
        validation_scheme: Optional[Union[str, "_models.ClientCertificateValidationScheme"]] = None,
        allowed_thumbprints: 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 ClientGroup(ProxyResource):
    """The Client group 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.eventgrid.models.SystemData
    :ivar properties: The properties of client group.
    :vartype properties: ~azure.mgmt.eventgrid.models.ClientGroupProperties
    """

    properties: Optional["_models.ClientGroupProperties"] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """The properties of client group."""

    __flattened_items = ["description", "query", "provisioning_state"]

    @overload
    def __init__(
        self,
        *,
        properties: Optional["_models.ClientGroupProperties"] = 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:
        _flattened_input = {k: kwargs.pop(k) for k in kwargs.keys() & self.__flattened_items}
        super().__init__(*args, **kwargs)
        for k, v in _flattened_input.items():
            setattr(self, k, v)

    def __getattr__(self, name: str) -> Any:
        if name in self.__flattened_items:
            if self.properties is None:
                return None
            return getattr(self.properties, name)
        raise AttributeError(f"'{self.__class__.__name__}' object has no attribute '{name}'")

    def __setattr__(self, key: str, value: Any) -> None:
        if key in self.__flattened_items:
            if self.properties is None:
                self.properties = self._attr_to_rest_field["properties"]._class_type()
            setattr(self.properties, key, value)
        else:
            super().__setattr__(key, value)


class ClientGroupProperties(_Model):
    """The properties of client group.

    :ivar description: Description for the Client Group resource.
    :vartype description: str
    :ivar query: The grouping query for the clients. Example : attributes.keyName IN ['a', 'b',
     'c'].
    :vartype query: str
    :ivar provisioning_state: Provisioning state of the ClientGroup resource. Known values are:
     "Creating", "Updating", "Deleting", "Succeeded", "Canceled", "Failed", and "Deleted".
    :vartype provisioning_state: str or ~azure.mgmt.eventgrid.models.ClientGroupProvisioningState
    """

    description: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """Description for the Client Group resource."""
    query: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """The grouping query for the clients. Example : attributes.keyName IN ['a', 'b', 'c']."""
    provisioning_state: Optional[Union[str, "_models.ClientGroupProvisioningState"]] = rest_field(
        name="provisioningState", visibility=["read"]
    )
    """Provisioning state of the ClientGroup resource. Known values are: \"Creating\", \"Updating\",
     \"Deleting\", \"Succeeded\", \"Canceled\", \"Failed\", and \"Deleted\"."""

    @overload
    def __init__(
        self,
        *,
        description: Optional[str] = None,
        query: 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 ClientProperties(_Model):
    """The properties of client.

    :ivar description: Description for the Client resource.
    :vartype description: str
    :ivar authentication_name: The name presented by the client for authentication. The default
     value is the name of the resource.
    :vartype authentication_name: str
    :ivar client_certificate_authentication: The client certificate authentication information.
    :vartype client_certificate_authentication:
     ~azure.mgmt.eventgrid.models.ClientCertificateAuthentication
    :ivar state: Indicates if the client is enabled or not. Default value is Enabled. Known values
     are: "Enabled" and "Disabled".
    :vartype state: str or ~azure.mgmt.eventgrid.models.ClientState
    :ivar attributes: Attributes for the client. Supported values are int, bool, string, string[].
     Example: "attributes": { "room": "345", "floor": 12, "deviceTypes": ["Fan", "Light"] }.
    :vartype attributes: dict[str, any]
    :ivar provisioning_state: Provisioning state of the Client resource. Known values are:
     "Creating", "Updating", "Deleting", "Succeeded", "Canceled", "Failed", and "Deleted".
    :vartype provisioning_state: str or ~azure.mgmt.eventgrid.models.ClientProvisioningState
    """

    description: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """Description for the Client resource."""
    authentication_name: Optional[str] = rest_field(
        name="authenticationName", visibility=["read", "create", "update", "delete", "query"]
    )
    """The name presented by the client for authentication. The default value is the name of the
     resource."""
    client_certificate_authentication: Optional["_models.ClientCertificateAuthentication"] = rest_field(
        name="clientCertificateAuthentication", visibility=["read", "create", "update", "delete", "query"]
    )
    """The client certificate authentication information."""
    state: Optional[Union[str, "_models.ClientState"]] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """Indicates if the client is enabled or not. Default value is Enabled. Known values are:
     \"Enabled\" and \"Disabled\"."""
    attributes: Optional[dict[str, Any]] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """Attributes for the client. Supported values are int, bool, string, string[]. Example:
     \"attributes\": { \"room\": \"345\", \"floor\": 12, \"deviceTypes\": [\"Fan\", \"Light\"] }."""
    provisioning_state: Optional[Union[str, "_models.ClientProvisioningState"]] = rest_field(
        name="provisioningState", visibility=["read"]
    )
    """Provisioning state of the Client resource. Known values are: \"Creating\", \"Updating\",
     \"Deleting\", \"Succeeded\", \"Canceled\", \"Failed\", and \"Deleted\"."""

    @overload
    def __init__(
        self,
        *,
        description: Optional[str] = None,
        authentication_name: Optional[str] = None,
        client_certificate_authentication: Optional["_models.ClientCertificateAuthentication"] = None,
        state: Optional[Union[str, "_models.ClientState"]] = None,
        attributes: 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 ConfidentialCompute(_Model):
    """Azure Confidential Compute properties of the resource.

    :ivar mode: This property specifies the mode of the Azure Confidential Compute configuration.
     Possible values are 'Disabled' or 'Enabled'. This is an immutable property set at the time of
     resource creation and cannot be modified later. Enabling this property ensures that messages
     are processed and stored in a Azure Confidential Compute environment. Required. Known values
     are: "Disabled" and "Enabled".
    :vartype mode: str or ~azure.mgmt.eventgrid.models.ConfidentialComputeMode
    """

    mode: Union[str, "_models.ConfidentialComputeMode"] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """This property specifies the mode of the Azure Confidential Compute configuration. Possible
     values are 'Disabled' or 'Enabled'. This is an immutable property set at the time of resource
     creation and cannot be modified later. Enabling this property ensures that messages are
     processed and stored in a Azure Confidential Compute environment. Required. Known values are:
     \"Disabled\" and \"Enabled\"."""

    @overload
    def __init__(
        self,
        *,
        mode: Union[str, "_models.ConfidentialComputeMode"],
    ) -> 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 ConnectionState(_Model):
    """ConnectionState information.

    :ivar status: Status of the connection. Known values are: "Pending", "Approved", "Rejected",
     and "Disconnected".
    :vartype status: str or ~azure.mgmt.eventgrid.models.PersistedConnectionStatus
    :ivar description: Description of the connection state.
    :vartype description: str
    :ivar actions_required: Actions required (if any).
    :vartype actions_required: str
    """

    status: Optional[Union[str, "_models.PersistedConnectionStatus"]] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """Status of the connection. Known values are: \"Pending\", \"Approved\", \"Rejected\", and
     \"Disconnected\"."""
    description: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """Description of the connection state."""
    actions_required: Optional[str] = rest_field(
        name="actionsRequired", visibility=["read", "create", "update", "delete", "query"]
    )
    """Actions required (if any)."""

    @overload
    def __init__(
        self,
        *,
        status: Optional[Union[str, "_models.PersistedConnectionStatus"]] = None,
        description: Optional[str] = None,
        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 CustomDomainConfiguration(_Model):
    """A custom domain configuration that allows users to publish to their own domain name.

    :ivar fully_qualified_domain_name: Fully Qualified Domain Name (FQDN) for the custom domain.
     Required.
    :vartype fully_qualified_domain_name: str
    :ivar validation_state: Validation state for the custom domain. This is a read only property
     and is initially set to 'Pending' and will be updated to 'Approved' by Event Grid only after
     ownership of the domain name has been successfully validated. Known values are: "Pending",
     "Approved", and "ErrorRetrievingDnsRecord".
    :vartype validation_state: str or ~azure.mgmt.eventgrid.models.CustomDomainValidationState
    :ivar identity: Identity info for accessing the certificate for the custom domain. This
     identity info must match an identity that has been set on the namespace.
    :vartype identity: ~azure.mgmt.eventgrid.models.CustomDomainIdentity
    :ivar certificate_url: The URL for the certificate that is used for publishing to the custom
     domain. We currently support certificates stored in Azure Key Vault only. While certificate URL
     can be either versioned URL of the following format
     https://{key-vault-name}.vault.azure.net/certificates/{certificate-name}/{version-id}, or
     unversioned URL of the following format (e.g.,
     `https://contosovault.vault.azure.net/certificates/contosocert
     <https://contosovault.vault.azure.net/certificates/contosocert>`_, we support unversioned
     certificate URL only (e.g., `https://contosovault.vault.azure.net/certificates/contosocert
     <https://contosovault.vault.azure.net/certificates/contosocert>`_).
    :vartype certificate_url: str
    :ivar expected_txt_record_name: Expected DNS TXT record name. Event Grid will check for a TXT
     record with this name in the DNS record set of the custom domain name to prove ownership over
     the domain. The values under this TXT record must contain the expected TXT record value.
    :vartype expected_txt_record_name: str
    :ivar expected_txt_record_value: Expected DNS TXT record value. Event Grid will check for a TXT
     record with this value in the DNS record set of the custom domain name to prove ownership over
     the domain.
    :vartype expected_txt_record_value: str
    """

    fully_qualified_domain_name: str = rest_field(
        name="fullyQualifiedDomainName", visibility=["read", "create", "update", "delete", "query"]
    )
    """Fully Qualified Domain Name (FQDN) for the custom domain. Required."""
    validation_state: Optional[Union[str, "_models.CustomDomainValidationState"]] = rest_field(
        name="validationState", visibility=["read", "create", "update", "delete", "query"]
    )
    """Validation state for the custom domain. This is a read only property and is initially set to
     'Pending' and will be updated to 'Approved' by Event Grid only after ownership of the domain
     name has been successfully validated. Known values are: \"Pending\", \"Approved\", and
     \"ErrorRetrievingDnsRecord\"."""
    identity: Optional["_models.CustomDomainIdentity"] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """Identity info for accessing the certificate for the custom domain. This identity info must
     match an identity that has been set on the namespace."""
    certificate_url: Optional[str] = rest_field(
        name="certificateUrl", visibility=["read", "create", "update", "delete", "query"]
    )
    """The URL for the certificate that is used for publishing to the custom domain. We currently
     support certificates stored in Azure Key Vault only. While certificate URL can be either
     versioned URL of the following format
     https://{key-vault-name}.vault.azure.net/certificates/{certificate-name}/{version-id}, or
     unversioned URL of the following format (e.g.,
     `https://contosovault.vault.azure.net/certificates/contosocert
     <https://contosovault.vault.azure.net/certificates/contosocert>`_, we support unversioned
     certificate URL only (e.g., `https://contosovault.vault.azure.net/certificates/contosocert
     <https://contosovault.vault.azure.net/certificates/contosocert>`_)."""
    expected_txt_record_name: Optional[str] = rest_field(
        name="expectedTxtRecordName", visibility=["read", "create", "update", "delete", "query"]
    )
    """Expected DNS TXT record name. Event Grid will check for a TXT record with this name in the DNS
     record set of the custom domain name to prove ownership over the domain. The values under this
     TXT record must contain the expected TXT record value."""
    expected_txt_record_value: Optional[str] = rest_field(
        name="expectedTxtRecordValue", visibility=["read", "create", "update", "delete", "query"]
    )
    """Expected DNS TXT record value. Event Grid will check for a TXT record with this value in the
     DNS record set of the custom domain name to prove ownership over the domain."""

    @overload
    def __init__(
        self,
        *,
        fully_qualified_domain_name: str,
        validation_state: Optional[Union[str, "_models.CustomDomainValidationState"]] = None,
        identity: Optional["_models.CustomDomainIdentity"] = None,
        certificate_url: Optional[str] = None,
        expected_txt_record_name: Optional[str] = None,
        expected_txt_record_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 CustomDomainIdentity(_Model):
    """The identity information for retrieving the certificate for the custom domain.

    :ivar type: The type of managed identity used. Can be either 'SystemAssigned' or
     'UserAssigned'. Known values are: "SystemAssigned" and "UserAssigned".
    :vartype type: str or ~azure.mgmt.eventgrid.models.CustomDomainIdentityType
    :ivar user_assigned_identity: The user identity associated with the resource.
    :vartype user_assigned_identity: str
    """

    type: Optional[Union[str, "_models.CustomDomainIdentityType"]] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """The type of managed identity used. Can be either 'SystemAssigned' or 'UserAssigned'. Known
     values are: \"SystemAssigned\" and \"UserAssigned\"."""
    user_assigned_identity: Optional[str] = rest_field(
        name="userAssignedIdentity", visibility=["read", "create", "update", "delete", "query"]
    )
    """The user identity associated with the resource."""

    @overload
    def __init__(
        self,
        *,
        type: Optional[Union[str, "_models.CustomDomainIdentityType"]] = None,
        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 CustomDomainOwnershipValidationResult(_Model):
    """Namespace custom domain ownership validation result.

    :ivar custom_domains_for_topics_configuration: List of custom domain configurations for the
     namespace under topics configuration.
    :vartype custom_domains_for_topics_configuration:
     list[~azure.mgmt.eventgrid.models.CustomDomainConfiguration]
    :ivar custom_domains_for_topic_spaces_configuration: List of custom domain configurations for
     the namespace under topic spaces configuration.
    :vartype custom_domains_for_topic_spaces_configuration:
     list[~azure.mgmt.eventgrid.models.CustomDomainConfiguration]
    """

    custom_domains_for_topics_configuration: Optional[list["_models.CustomDomainConfiguration"]] = rest_field(
        name="customDomainsForTopicsConfiguration", visibility=["read", "create", "update", "delete", "query"]
    )
    """List of custom domain configurations for the namespace under topics configuration."""
    custom_domains_for_topic_spaces_configuration: Optional[list["_models.CustomDomainConfiguration"]] = rest_field(
        name="customDomainsForTopicSpacesConfiguration", visibility=["read", "create", "update", "delete", "query"]
    )
    """List of custom domain configurations for the namespace under topic spaces configuration."""

    @overload
    def __init__(
        self,
        *,
        custom_domains_for_topics_configuration: Optional[list["_models.CustomDomainConfiguration"]] = None,
        custom_domains_for_topic_spaces_configuration: Optional[list["_models.CustomDomainConfiguration"]] = 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 CustomerManagedKeyEncryption(_Model):
    """All Customer-managed key encryption properties for the resource.

    :ivar key_encryption_key_url: Key encryption key URL. This URL can be either versioned (e.g.,
     `https://contosovault.vault.azure.net/keys/contosokek/562a4bb76b524a1493a6afe8e536ee78
     <https://contosovault.vault.azure.net/keys/contosokek/562a4bb76b524a1493a6afe8e536ee78>`_), or
     unversioned (e.g., `https://contosovault.vault.azure.net/keys/contosokek
     <https://contosovault.vault.azure.net/keys/contosokek>`_. When versioned URL is used, this
     version of the key will be used by Event Grid Runtime even if it is rotated. It is user
     responsibility to update the URL with the new version by updating the namespace resource. When
     URL without version is used, Event Grid will query and get latest version and will be used
     automatically. Required.
    :vartype key_encryption_key_url: str
    :ivar key_encryption_key_identity: All identity configuration for Customer-managed key settings
     defining which identity should be used to auth to Key Vault. This is an optional property. When
     not specified, the SystemAssigned identity will be used.
    :vartype key_encryption_key_identity: ~azure.mgmt.eventgrid.models.KeyEncryptionKeyIdentity
    :ivar key_encryption_key_status: The state of the Customer Managed Key (CMK) encryption. This
     is a read-only property which determines if the associated key is active and valid and used
     actively by runtime as expected. When the associated CMK becomes invalid (e.g., if it is
     deleted, or if versioned CMK is not current anymore), Event Grid Service will set this state to
     disabled to indicate that this key is not valid anymore and requires action from user. Known
     values are: "Active" and "Revoked".
    :vartype key_encryption_key_status: str or ~azure.mgmt.eventgrid.models.KeyEncryptionKeyStatus
    :ivar key_encryption_key_status_friendly_description: Friendly description about the Customer
     Managed Key (CMK) encryption state. This is a read-only property which determines why the
     associated key is revoked which will help user to mitigate the issue and re-enable the CMK key.
    :vartype key_encryption_key_status_friendly_description: str
    """

    key_encryption_key_url: str = rest_field(
        name="keyEncryptionKeyUrl", visibility=["read", "create", "update", "delete", "query"]
    )
    """Key encryption key URL. This URL can be either versioned (e.g.,
     `https://contosovault.vault.azure.net/keys/contosokek/562a4bb76b524a1493a6afe8e536ee78
     <https://contosovault.vault.azure.net/keys/contosokek/562a4bb76b524a1493a6afe8e536ee78>`_), or
     unversioned (e.g., `https://contosovault.vault.azure.net/keys/contosokek
     <https://contosovault.vault.azure.net/keys/contosokek>`_. When versioned URL is used, this
     version of the key will be used by Event Grid Runtime even if it is rotated. It is user
     responsibility to update the URL with the new version by updating the namespace resource. When
     URL without version is used, Event Grid will query and get latest version and will be used
     automatically. Required."""
    key_encryption_key_identity: Optional["_models.KeyEncryptionKeyIdentity"] = rest_field(
        name="keyEncryptionKeyIdentity", visibility=["read", "create", "update", "delete", "query"]
    )
    """All identity configuration for Customer-managed key settings defining which identity should be
     used to auth to Key Vault. This is an optional property. When not specified, the SystemAssigned
     identity will be used."""
    key_encryption_key_status: Optional[Union[str, "_models.KeyEncryptionKeyStatus"]] = rest_field(
        name="keyEncryptionKeyStatus", visibility=["read"]
    )
    """The state of the Customer Managed Key (CMK) encryption. This is a read-only property which
     determines if the associated key is active and valid and used actively by runtime as expected.
     When the associated CMK becomes invalid (e.g., if it is deleted, or if versioned CMK is not
     current anymore), Event Grid Service will set this state to disabled to indicate that this key
     is not valid anymore and requires action from user. Known values are: \"Active\" and
     \"Revoked\"."""
    key_encryption_key_status_friendly_description: Optional[str] = rest_field(
        name="keyEncryptionKeyStatusFriendlyDescription", visibility=["read"]
    )
    """Friendly description about the Customer Managed Key (CMK) encryption state. This is a read-only
     property which determines why the associated key is revoked which will help user to mitigate
     the issue and re-enable the CMK key."""

    @overload
    def __init__(
        self,
        *,
        key_encryption_key_url: str,
        key_encryption_key_identity: Optional["_models.KeyEncryptionKeyIdentity"] = 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 CustomJwtAuthenticationManagedIdentity(_Model):
    """The identity information for retrieving the certificate for custom JWT authentication.

    :ivar type: The type of managed identity used. Can be either 'SystemAssigned' or
     'UserAssigned'. Required. Known values are: "SystemAssigned" and "UserAssigned".
    :vartype type: str or ~azure.mgmt.eventgrid.models.CustomJwtAuthenticationManagedIdentityType
    :ivar user_assigned_identity: The user identity associated with the resource.
    :vartype user_assigned_identity: str
    """

    type: Union[str, "_models.CustomJwtAuthenticationManagedIdentityType"] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """The type of managed identity used. Can be either 'SystemAssigned' or 'UserAssigned'. Required.
     Known values are: \"SystemAssigned\" and \"UserAssigned\"."""
    user_assigned_identity: Optional[str] = rest_field(
        name="userAssignedIdentity", visibility=["read", "create", "update", "delete", "query"]
    )
    """The user identity associated with the resource."""

    @overload
    def __init__(
        self,
        *,
        type: Union[str, "_models.CustomJwtAuthenticationManagedIdentityType"],
        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 CustomJwtAuthenticationSettings(_Model):
    """Custom JWT authentication settings for namespace resource.

    :ivar token_issuer: Expected JWT token issuer.
    :vartype token_issuer: str
    :ivar issuer_certificates: Information about the certificates that are used for token
     validation. We currently support maximum 2 certificates.
    :vartype issuer_certificates: list[~azure.mgmt.eventgrid.models.IssuerCertificateInfo]
    :ivar encoded_issuer_certificates: Information about the encoded public certificates that are
     used for custom authentication.
    :vartype encoded_issuer_certificates:
     list[~azure.mgmt.eventgrid.models.EncodedIssuerCertificateInfo]
    """

    token_issuer: Optional[str] = rest_field(
        name="tokenIssuer", visibility=["read", "create", "update", "delete", "query"]
    )
    """Expected JWT token issuer."""
    issuer_certificates: Optional[list["_models.IssuerCertificateInfo"]] = rest_field(
        name="issuerCertificates", visibility=["read", "create", "update", "delete", "query"]
    )
    """Information about the certificates that are used for token validation. We currently support
     maximum 2 certificates."""
    encoded_issuer_certificates: Optional[list["_models.EncodedIssuerCertificateInfo"]] = rest_field(
        name="encodedIssuerCertificates", visibility=["read", "create", "update", "delete", "query"]
    )
    """Information about the encoded public certificates that are used for custom authentication."""

    @overload
    def __init__(
        self,
        *,
        token_issuer: Optional[str] = None,
        issuer_certificates: Optional[list["_models.IssuerCertificateInfo"]] = None,
        encoded_issuer_certificates: Optional[list["_models.EncodedIssuerCertificateInfo"]] = 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 CustomWebhookAuthenticationManagedIdentity(_Model):  # pylint: disable=name-too-long
    """The identity configuration required for authenticating a custom webhook.

    :ivar type: The type of managed identity used. Can be either 'SystemAssigned' or
     'UserAssigned'. Required. Known values are: "SystemAssigned" and "UserAssigned".
    :vartype type: str or
     ~azure.mgmt.eventgrid.models.CustomWebhookAuthenticationManagedIdentityType
    :ivar user_assigned_identity: The user identity associated with the resource.
    :vartype user_assigned_identity: str
    """

    type: Union[str, "_models.CustomWebhookAuthenticationManagedIdentityType"] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """The type of managed identity used. Can be either 'SystemAssigned' or 'UserAssigned'. Required.
     Known values are: \"SystemAssigned\" and \"UserAssigned\"."""
    user_assigned_identity: Optional[str] = rest_field(
        name="userAssignedIdentity", visibility=["read", "create", "update", "delete", "query"]
    )
    """The user identity associated with the resource."""

    @overload
    def __init__(
        self,
        *,
        type: Union[str, "_models.CustomWebhookAuthenticationManagedIdentityType"],
        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 DeadLetterDestination(_Model):
    """Information about the dead letter destination for an event subscription. To configure a
    deadletter destination, do not directly instantiate an object of this class. Instead,
    instantiate an object of a derived class. Currently, StorageBlobDeadLetterDestination is the
    only class that derives from this class.

    You probably want to use the sub-classes and not this class directly. Known sub-classes are:
    StorageBlobDeadLetterDestination

    :ivar endpoint_type: Type of the endpoint for the dead letter destination. Required.
     "StorageBlob"
    :vartype endpoint_type: str or ~azure.mgmt.eventgrid.models.DeadLetterEndPointType
    """

    __mapping__: dict[str, _Model] = {}
    endpoint_type: str = rest_discriminator(
        name="endpointType", visibility=["read", "create", "update", "delete", "query"]
    )
    """Type of the endpoint for the dead letter destination. Required. \"StorageBlob\""""

    @overload
    def __init__(
        self,
        *,
        endpoint_type: 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 DeadLetterWithResourceIdentity(_Model):
    """Information about the deadletter destination with resource identity.

    :ivar identity: The identity to use when dead-lettering events.
    :vartype identity: ~azure.mgmt.eventgrid.models.EventSubscriptionIdentity
    :ivar dead_letter_destination: Information about the destination where events have to be
     delivered for the event subscription. Uses the managed identity setup on the parent resource
     (namely, topic or domain) to acquire the authentication tokens being used during
     dead-lettering.
    :vartype dead_letter_destination: ~azure.mgmt.eventgrid.models.DeadLetterDestination
    """

    identity: Optional["_models.EventSubscriptionIdentity"] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """The identity to use when dead-lettering events."""
    dead_letter_destination: Optional["_models.DeadLetterDestination"] = rest_field(
        name="deadLetterDestination", visibility=["read", "create", "update", "delete", "query"]
    )
    """Information about the destination where events have to be delivered for the event subscription.
     Uses the managed identity setup on the parent resource (namely, topic or domain) to acquire the
     authentication tokens being used during dead-lettering."""

    @overload
    def __init__(
        self,
        *,
        identity: Optional["_models.EventSubscriptionIdentity"] = None,
        dead_letter_destination: Optional["_models.DeadLetterDestination"] = 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 DeliveryAttributeListResult(_Model):
    """Result of the Get delivery attributes operation.

    :ivar value: A collection of DeliveryAttributeMapping.
    :vartype value: list[~azure.mgmt.eventgrid.models.DeliveryAttributeMapping]
    """

    value: Optional[list["_models.DeliveryAttributeMapping"]] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """A collection of DeliveryAttributeMapping."""

    @overload
    def __init__(
        self,
        *,
        value: Optional[list["_models.DeliveryAttributeMapping"]] = 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 DeliveryAttributeMapping(_Model):
    """Delivery attribute mapping details.

    You probably want to use the sub-classes and not this class directly. Known sub-classes are:
    DynamicDeliveryAttributeMapping, StaticDeliveryAttributeMapping

    :ivar name: Name of the delivery attribute or header.
    :vartype name: str
    :ivar type: Type of the delivery attribute or header name. Required. Known values are: "Static"
     and "Dynamic".
    :vartype type: str or ~azure.mgmt.eventgrid.models.DeliveryAttributeMappingType
    """

    __mapping__: dict[str, _Model] = {}
    name: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """Name of the delivery attribute or header."""
    type: str = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"])
    """Type of the delivery attribute or header name. Required. Known values are: \"Static\" and
     \"Dynamic\"."""

    @overload
    def __init__(
        self,
        *,
        type: str,
        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 DeliveryConfiguration(_Model):
    """Properties of the delivery configuration information of the event subscription.

    :ivar delivery_mode: Delivery mode of the event subscription. Known values are: "Queue" and
     "Push".
    :vartype delivery_mode: str or ~azure.mgmt.eventgrid.models.DeliveryMode
    :ivar queue: This property should be populated when deliveryMode is queue and represents
     information about the queue subscription.
    :vartype queue: ~azure.mgmt.eventgrid.models.QueueInfo
    :ivar push: This property should be populated when deliveryMode is push and represents
     information about the push subscription.
    :vartype push: ~azure.mgmt.eventgrid.models.PushInfo
    """

    delivery_mode: Optional[Union[str, "_models.DeliveryMode"]] = rest_field(
        name="deliveryMode", visibility=["read", "create", "update", "delete", "query"]
    )
    """Delivery mode of the event subscription. Known values are: \"Queue\" and \"Push\"."""
    queue: Optional["_models.QueueInfo"] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """This property should be populated when deliveryMode is queue and represents information about
     the queue subscription."""
    push: Optional["_models.PushInfo"] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """This property should be populated when deliveryMode is push and represents information about
     the push subscription."""

    @overload
    def __init__(
        self,
        *,
        delivery_mode: Optional[Union[str, "_models.DeliveryMode"]] = None,
        queue: Optional["_models.QueueInfo"] = None,
        push: Optional["_models.PushInfo"] = 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 DeliveryWithResourceIdentity(_Model):
    """Information about the delivery for an event subscription with resource identity.

    :ivar identity: The identity to use when delivering events.
    :vartype identity: ~azure.mgmt.eventgrid.models.EventSubscriptionIdentity
    :ivar destination: Information about the destination where events have to be delivered for the
     event subscription. Uses the managed identity setup on the parent resource (namely, topic or
     domain) to acquire the authentication tokens being used during delivery.
    :vartype destination: ~azure.mgmt.eventgrid.models.EventSubscriptionDestination
    """

    identity: Optional["_models.EventSubscriptionIdentity"] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """The identity to use when delivering events."""
    destination: Optional["_models.EventSubscriptionDestination"] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """Information about the destination where events have to be delivered for the event subscription.
     Uses the managed identity setup on the parent resource (namely, topic or domain) to acquire the
     authentication tokens being used during delivery."""

    @overload
    def __init__(
        self,
        *,
        identity: Optional["_models.EventSubscriptionIdentity"] = None,
        destination: Optional["_models.EventSubscriptionDestination"] = 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 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.eventgrid.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 Domain(TrackedResource):
    """EventGrid Domain.

    :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.eventgrid.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: Properties of the Event Grid Domain resource.
    :vartype properties: ~azure.mgmt.eventgrid.models.DomainProperties
    :ivar sku: The Sku pricing tier for the Event Grid Domain resource.
    :vartype sku: ~azure.mgmt.eventgrid.models.ResourceSku
    :ivar identity: Identity information for the Event Grid Domain resource.
    :vartype identity: ~azure.mgmt.eventgrid.models.IdentityInfo
    """

    properties: Optional["_models.DomainProperties"] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """Properties of the Event Grid Domain resource."""
    sku: Optional["_models.ResourceSku"] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """The Sku pricing tier for the Event Grid Domain resource."""
    identity: Optional["_models.IdentityInfo"] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """Identity information for the Event Grid Domain resource."""

    __flattened_items = [
        "private_endpoint_connections",
        "provisioning_state",
        "minimum_tls_version_allowed",
        "endpoint",
        "input_schema",
        "event_type_info",
        "input_schema_mapping",
        "metric_resource_id",
        "public_network_access",
        "inbound_ip_rules",
        "disable_local_auth",
        "auto_create_topic_with_first_subscription",
        "auto_delete_topic_with_last_subscription",
        "data_residency_boundary",
    ]

    @overload
    def __init__(
        self,
        *,
        location: str,
        tags: Optional[dict[str, str]] = None,
        properties: Optional["_models.DomainProperties"] = None,
        sku: Optional["_models.ResourceSku"] = None,
        identity: Optional["_models.IdentityInfo"] = 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:
        _flattened_input = {k: kwargs.pop(k) for k in kwargs.keys() & self.__flattened_items}
        super().__init__(*args, **kwargs)
        for k, v in _flattened_input.items():
            setattr(self, k, v)

    def __getattr__(self, name: str) -> Any:
        if name in self.__flattened_items:
            if self.properties is None:
                return None
            return getattr(self.properties, name)
        raise AttributeError(f"'{self.__class__.__name__}' object has no attribute '{name}'")

    def __setattr__(self, key: str, value: Any) -> None:
        if key in self.__flattened_items:
            if self.properties is None:
                self.properties = self._attr_to_rest_field["properties"]._class_type()
            setattr(self.properties, key, value)
        else:
            super().__setattr__(key, value)


class DomainProperties(_Model):
    """Properties of the Event Grid Domain Resource.

    :ivar private_endpoint_connections: List of private endpoint connections.
    :vartype private_endpoint_connections:
     list[~azure.mgmt.eventgrid.models.PrivateEndpointConnection]
    :ivar provisioning_state: Provisioning state of the Event Grid Domain Resource. Known values
     are: "Creating", "Updating", "Deleting", "Succeeded", "Canceled", and "Failed".
    :vartype provisioning_state: str or ~azure.mgmt.eventgrid.models.DomainProvisioningState
    :ivar minimum_tls_version_allowed: Minimum TLS version of the publisher allowed to publish to
     this domain. Known values are: "1.0", "1.1", and "1.2".
    :vartype minimum_tls_version_allowed: str or ~azure.mgmt.eventgrid.models.TlsVersion
    :ivar endpoint: Endpoint for the Event Grid Domain Resource which is used for publishing the
     events.
    :vartype endpoint: str
    :ivar input_schema: This determines the format that Event Grid should expect for incoming
     events published to the Event Grid Domain Resource. Known values are: "EventGridSchema",
     "CustomEventSchema", and "CloudEventSchemaV1_0".
    :vartype input_schema: str or ~azure.mgmt.eventgrid.models.InputSchema
    :ivar event_type_info: Event Type Information for the domain. This information is provided by
     the publisher and can be used by the subscriber to view different types of events that are
     published.
    :vartype event_type_info: ~azure.mgmt.eventgrid.models.EventTypeInfo
    :ivar input_schema_mapping: Information about the InputSchemaMapping which specified the info
     about mapping event payload.
    :vartype input_schema_mapping: ~azure.mgmt.eventgrid.models.InputSchemaMapping
    :ivar metric_resource_id: Metric resource id for the Event Grid Domain Resource.
    :vartype metric_resource_id: str
    :ivar public_network_access: This determines if traffic is allowed over public network. By
     default it is enabled. You can further restrict to specific IPs by configuring <seealso
     cref="P:Microsoft.Azure.Events.ResourceProvider.Common.Contracts.DomainProperties.InboundIpRules"
     />. Known values are: "Enabled", "Disabled", and "SecuredByPerimeter".
    :vartype public_network_access: str or ~azure.mgmt.eventgrid.models.PublicNetworkAccess
    :ivar inbound_ip_rules: This can be used to restrict traffic from specific IPs instead of all
     IPs. Note: These are considered only if PublicNetworkAccess is enabled.
    :vartype inbound_ip_rules: list[~azure.mgmt.eventgrid.models.InboundIpRule]
    :ivar disable_local_auth: This boolean is used to enable or disable local auth. Default value
     is false. When the property is set to true, only Microsoft Entra ID token will be used to
     authenticate if user is allowed to publish to the domain.
    :vartype disable_local_auth: bool
    :ivar auto_create_topic_with_first_subscription: This Boolean is used to specify the creation
     mechanism for 'all' the Event Grid Domain Topics associated with this Event Grid Domain
     resource. In this context, creation of domain topic can be auto-managed (when true) or
     self-managed (when false). The default value for this property is true. When this property is
     null or set to true, Event Grid is responsible of automatically creating the domain topic when
     the first event subscription is created at the scope of the domain topic. If this property is
     set to false, then creating the first event subscription will require creating a domain topic
     by the user. The self-management mode can be used if the user wants full control of when the
     domain topic is created, while auto-managed mode provides the flexibility to perform less
     operations and manage fewer resources by the user. Also, note that in auto-managed creation
     mode, user is allowed to create the domain topic on demand if needed.
    :vartype auto_create_topic_with_first_subscription: bool
    :ivar auto_delete_topic_with_last_subscription: This Boolean is used to specify the deletion
     mechanism for 'all' the Event Grid Domain Topics associated with this Event Grid Domain
     resource. In this context, deletion of domain topic can be auto-managed (when true) or
     self-managed (when false). The default value for this property is true. When this property is
     set to true, Event Grid is responsible of automatically deleting the domain topic when the last
     event subscription at the scope of the domain topic is deleted. If this property is set to
     false, then the user needs to manually delete the domain topic when it is no longer needed
     (e.g., when last event subscription is deleted and the resource needs to be cleaned up). The
     self-management mode can be used if the user wants full control of when the domain topic needs
     to be deleted, while auto-managed mode provides the flexibility to perform less operations and
     manage fewer resources by the user.
    :vartype auto_delete_topic_with_last_subscription: bool
    :ivar data_residency_boundary: Data Residency Boundary of the resource. Known values are:
     "WithinGeopair" and "WithinRegion".
    :vartype data_residency_boundary: str or ~azure.mgmt.eventgrid.models.DataResidencyBoundary
    """

    private_endpoint_connections: Optional[list["_models.PrivateEndpointConnection"]] = rest_field(
        name="privateEndpointConnections", visibility=["read"]
    )
    """List of private endpoint connections."""
    provisioning_state: Optional[Union[str, "_models.DomainProvisioningState"]] = rest_field(
        name="provisioningState", visibility=["read"]
    )
    """Provisioning state of the Event Grid Domain Resource. Known values are: \"Creating\",
     \"Updating\", \"Deleting\", \"Succeeded\", \"Canceled\", and \"Failed\"."""
    minimum_tls_version_allowed: Optional[Union[str, "_models.TlsVersion"]] = rest_field(
        name="minimumTlsVersionAllowed", visibility=["read", "create", "update", "delete", "query"]
    )
    """Minimum TLS version of the publisher allowed to publish to this domain. Known values are:
     \"1.0\", \"1.1\", and \"1.2\"."""
    endpoint: Optional[str] = rest_field(visibility=["read"])
    """Endpoint for the Event Grid Domain Resource which is used for publishing the events."""
    input_schema: Optional[Union[str, "_models.InputSchema"]] = rest_field(
        name="inputSchema", visibility=["read", "create", "update", "delete", "query"]
    )
    """This determines the format that Event Grid should expect for incoming events published to the
     Event Grid Domain Resource. Known values are: \"EventGridSchema\", \"CustomEventSchema\", and
     \"CloudEventSchemaV1_0\"."""
    event_type_info: Optional["_models.EventTypeInfo"] = rest_field(
        name="eventTypeInfo", visibility=["read", "create", "update", "delete", "query"]
    )
    """Event Type Information for the domain. This information is provided by the publisher and can be
     used by the subscriber to view different types of events that are published."""
    input_schema_mapping: Optional["_models.InputSchemaMapping"] = rest_field(
        name="inputSchemaMapping", visibility=["read", "create", "update", "delete", "query"]
    )
    """Information about the InputSchemaMapping which specified the info about mapping event payload."""
    metric_resource_id: Optional[str] = rest_field(name="metricResourceId", visibility=["read"])
    """Metric resource id for the Event Grid Domain Resource."""
    public_network_access: Optional[Union[str, "_models.PublicNetworkAccess"]] = rest_field(
        name="publicNetworkAccess", visibility=["read", "create", "update", "delete", "query"]
    )
    """This determines if traffic is allowed over public network. By default it is enabled. You can
     further restrict to specific IPs by configuring <seealso
     cref=\"P:Microsoft.Azure.Events.ResourceProvider.Common.Contracts.DomainProperties.InboundIpRules\"
     />. Known values are: \"Enabled\", \"Disabled\", and \"SecuredByPerimeter\"."""
    inbound_ip_rules: Optional[list["_models.InboundIpRule"]] = rest_field(
        name="inboundIpRules", visibility=["read", "create", "update", "delete", "query"]
    )
    """This can be used to restrict traffic from specific IPs instead of all IPs. Note: These are
     considered only if PublicNetworkAccess is enabled."""
    disable_local_auth: Optional[bool] = rest_field(
        name="disableLocalAuth", visibility=["read", "create", "update", "delete", "query"]
    )
    """This boolean is used to enable or disable local auth. Default value is false. When the property
     is set to true, only Microsoft Entra ID token will be used to authenticate if user is allowed
     to publish to the domain."""
    auto_create_topic_with_first_subscription: Optional[bool] = rest_field(
        name="autoCreateTopicWithFirstSubscription", visibility=["read", "create", "update", "delete", "query"]
    )
    """This Boolean is used to specify the creation mechanism for 'all' the Event Grid Domain Topics
     associated with this Event Grid Domain resource. In this context, creation of domain topic can
     be auto-managed (when true) or self-managed (when false). The default value for this property
     is true. When this property is null or set to true, Event Grid is responsible of automatically
     creating the domain topic when the first event subscription is created at the scope of the
     domain topic. If this property is set to false, then creating the first event subscription will
     require creating a domain topic by the user. The self-management mode can be used if the user
     wants full control of when the domain topic is created, while auto-managed mode provides the
     flexibility to perform less operations and manage fewer resources by the user. Also, note that
     in auto-managed creation mode, user is allowed to create the domain topic on demand if needed."""
    auto_delete_topic_with_last_subscription: Optional[bool] = rest_field(
        name="autoDeleteTopicWithLastSubscription", visibility=["read", "create", "update", "delete", "query"]
    )
    """This Boolean is used to specify the deletion mechanism for 'all' the Event Grid Domain Topics
     associated with this Event Grid Domain resource. In this context, deletion of domain topic can
     be auto-managed (when true) or self-managed (when false). The default value for this property
     is true. When this property is set to true, Event Grid is responsible of automatically deleting
     the domain topic when the last event subscription at the scope of the domain topic is deleted.
     If this property is set to false, then the user needs to manually delete the domain topic when
     it is no longer needed (e.g., when last event subscription is deleted and the resource needs to
     be cleaned up). The self-management mode can be used if the user wants full control of when the
     domain topic needs to be deleted, while auto-managed mode provides the flexibility to perform
     less operations and manage fewer resources by the user."""
    data_residency_boundary: Optional[Union[str, "_models.DataResidencyBoundary"]] = rest_field(
        name="dataResidencyBoundary", visibility=["read", "create", "update", "delete", "query"]
    )
    """Data Residency Boundary of the resource. Known values are: \"WithinGeopair\" and
     \"WithinRegion\"."""

    @overload
    def __init__(
        self,
        *,
        minimum_tls_version_allowed: Optional[Union[str, "_models.TlsVersion"]] = None,
        input_schema: Optional[Union[str, "_models.InputSchema"]] = None,
        event_type_info: Optional["_models.EventTypeInfo"] = None,
        input_schema_mapping: Optional["_models.InputSchemaMapping"] = None,
        public_network_access: Optional[Union[str, "_models.PublicNetworkAccess"]] = None,
        inbound_ip_rules: Optional[list["_models.InboundIpRule"]] = None,
        disable_local_auth: Optional[bool] = None,
        auto_create_topic_with_first_subscription: Optional[bool] = None,
        auto_delete_topic_with_last_subscription: Optional[bool] = None,
        data_residency_boundary: Optional[Union[str, "_models.DataResidencyBoundary"]] = 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 DomainRegenerateKeyRequest(_Model):
    """Domain regenerate share access key request.

    :ivar key_name: Key name to regenerate key1 or key2. Required.
    :vartype key_name: str
    """

    key_name: str = rest_field(name="keyName", visibility=["read", "create", "update", "delete", "query"])
    """Key name to regenerate key1 or key2. Required."""

    @overload
    def __init__(
        self,
        *,
        key_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 DomainSharedAccessKeys(_Model):
    """Shared access keys of the Domain.

    :ivar key1: Shared access key1 for the domain.
    :vartype key1: str
    :ivar key2: Shared access key2 for the domain.
    :vartype key2: str
    """

    key1: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """Shared access key1 for the domain."""
    key2: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """Shared access key2 for the domain."""

    @overload
    def __init__(
        self,
        *,
        key1: Optional[str] = None,
        key2: 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 DomainTopic(ProxyResource):
    """Domain Topic.

    :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.eventgrid.models.SystemData
    :ivar properties: Properties of the Domain Topic.
    :vartype properties: ~azure.mgmt.eventgrid.models.DomainTopicProperties
    """

    properties: Optional["_models.DomainTopicProperties"] = rest_field(visibility=["read"])
    """Properties of the Domain Topic."""

    __flattened_items = ["provisioning_state"]


class DomainTopicProperties(_Model):
    """Properties of the Domain Topic.

    :ivar provisioning_state: Provisioning state of the domain topic. Known values are: "Creating",
     "Updating", "Deleting", "Succeeded", "Canceled", and "Failed".
    :vartype provisioning_state: str or ~azure.mgmt.eventgrid.models.DomainTopicProvisioningState
    """

    provisioning_state: Optional[Union[str, "_models.DomainTopicProvisioningState"]] = rest_field(
        name="provisioningState", visibility=["read"]
    )
    """Provisioning state of the domain topic. Known values are: \"Creating\", \"Updating\",
     \"Deleting\", \"Succeeded\", \"Canceled\", and \"Failed\"."""


class DomainUpdateParameterProperties(_Model):
    """Information of domain update parameter properties.

    :ivar public_network_access: This determines if traffic is allowed over public network. By
     default it is enabled. You can further restrict to specific IPs by configuring <seealso
     cref="P:Microsoft.Azure.Events.ResourceProvider.Common.Contracts.DomainUpdateParameterProperties.InboundIpRules"
     />. Known values are: "Enabled", "Disabled", and "SecuredByPerimeter".
    :vartype public_network_access: str or ~azure.mgmt.eventgrid.models.PublicNetworkAccess
    :ivar inbound_ip_rules: This can be used to restrict traffic from specific IPs instead of all
     IPs. Note: These are considered only if PublicNetworkAccess is enabled.
    :vartype inbound_ip_rules: list[~azure.mgmt.eventgrid.models.InboundIpRule]
    :ivar minimum_tls_version_allowed: Minimum TLS version of the publisher allowed to publish to
     this domain. Known values are: "1.0", "1.1", and "1.2".
    :vartype minimum_tls_version_allowed: str or ~azure.mgmt.eventgrid.models.TlsVersion
    :ivar disable_local_auth: This boolean is used to enable or disable local auth. Default value
     is false. When the property is set to true, only Microsoft Entra ID token will be used to
     authenticate if user is allowed to publish to the domain.
    :vartype disable_local_auth: bool
    :ivar auto_create_topic_with_first_subscription: This Boolean is used to specify the creation
     mechanism for 'all' the Event Grid Domain Topics associated with this Event Grid Domain
     resource. In this context, creation of domain topic can be auto-managed (when true) or
     self-managed (when false). The default value for this property is true. When this property is
     null or set to true, Event Grid is responsible of automatically creating the domain topic when
     the first event subscription is created at the scope of the domain topic. If this property is
     set to false, then creating the first event subscription will require creating a domain topic
     by the user. The self-management mode can be used if the user wants full control of when the
     domain topic is created, while auto-managed mode provides the flexibility to perform less
     operations and manage fewer resources by the user. Also, note that in auto-managed creation
     mode, user is allowed to create the domain topic on demand if needed.
    :vartype auto_create_topic_with_first_subscription: bool
    :ivar auto_delete_topic_with_last_subscription: This Boolean is used to specify the deletion
     mechanism for 'all' the Event Grid Domain Topics associated with this Event Grid Domain
     resource. In this context, deletion of domain topic can be auto-managed (when true) or
     self-managed (when false). The default value for this property is true. When this property is
     set to true, Event Grid is responsible of automatically deleting the domain topic when the last
     event subscription at the scope of the domain topic is deleted. If this property is set to
     false, then the user needs to manually delete the domain topic when it is no longer needed
     (e.g., when last event subscription is deleted and the resource needs to be cleaned up). The
     self-management mode can be used if the user wants full control of when the domain topic needs
     to be deleted, while auto-managed mode provides the flexibility to perform less operations and
     manage fewer resources by the user.
    :vartype auto_delete_topic_with_last_subscription: bool
    :ivar data_residency_boundary: The data residency boundary for the domain. Known values are:
     "WithinGeopair" and "WithinRegion".
    :vartype data_residency_boundary: str or ~azure.mgmt.eventgrid.models.DataResidencyBoundary
    :ivar event_type_info: The eventTypeInfo for the domain.
    :vartype event_type_info: ~azure.mgmt.eventgrid.models.EventTypeInfo
    """

    public_network_access: Optional[Union[str, "_models.PublicNetworkAccess"]] = rest_field(
        name="publicNetworkAccess", visibility=["read", "create", "update", "delete", "query"]
    )
    """This determines if traffic is allowed over public network. By default it is enabled. You can
     further restrict to specific IPs by configuring <seealso
     cref=\"P:Microsoft.Azure.Events.ResourceProvider.Common.Contracts.DomainUpdateParameterProperties.InboundIpRules\"
     />. Known values are: \"Enabled\", \"Disabled\", and \"SecuredByPerimeter\"."""
    inbound_ip_rules: Optional[list["_models.InboundIpRule"]] = rest_field(
        name="inboundIpRules", visibility=["read", "create", "update", "delete", "query"]
    )
    """This can be used to restrict traffic from specific IPs instead of all IPs. Note: These are
     considered only if PublicNetworkAccess is enabled."""
    minimum_tls_version_allowed: Optional[Union[str, "_models.TlsVersion"]] = rest_field(
        name="minimumTlsVersionAllowed", visibility=["read", "create", "update", "delete", "query"]
    )
    """Minimum TLS version of the publisher allowed to publish to this domain. Known values are:
     \"1.0\", \"1.1\", and \"1.2\"."""
    disable_local_auth: Optional[bool] = rest_field(
        name="disableLocalAuth", visibility=["read", "create", "update", "delete", "query"]
    )
    """This boolean is used to enable or disable local auth. Default value is false. When the property
     is set to true, only Microsoft Entra ID token will be used to authenticate if user is allowed
     to publish to the domain."""
    auto_create_topic_with_first_subscription: Optional[bool] = rest_field(
        name="autoCreateTopicWithFirstSubscription", visibility=["read", "create", "update", "delete", "query"]
    )
    """This Boolean is used to specify the creation mechanism for 'all' the Event Grid Domain Topics
     associated with this Event Grid Domain resource. In this context, creation of domain topic can
     be auto-managed (when true) or self-managed (when false). The default value for this property
     is true. When this property is null or set to true, Event Grid is responsible of automatically
     creating the domain topic when the first event subscription is created at the scope of the
     domain topic. If this property is set to false, then creating the first event subscription will
     require creating a domain topic by the user. The self-management mode can be used if the user
     wants full control of when the domain topic is created, while auto-managed mode provides the
     flexibility to perform less operations and manage fewer resources by the user. Also, note that
     in auto-managed creation mode, user is allowed to create the domain topic on demand if needed."""
    auto_delete_topic_with_last_subscription: Optional[bool] = rest_field(
        name="autoDeleteTopicWithLastSubscription", visibility=["read", "create", "update", "delete", "query"]
    )
    """This Boolean is used to specify the deletion mechanism for 'all' the Event Grid Domain Topics
     associated with this Event Grid Domain resource. In this context, deletion of domain topic can
     be auto-managed (when true) or self-managed (when false). The default value for this property
     is true. When this property is set to true, Event Grid is responsible of automatically deleting
     the domain topic when the last event subscription at the scope of the domain topic is deleted.
     If this property is set to false, then the user needs to manually delete the domain topic when
     it is no longer needed (e.g., when last event subscription is deleted and the resource needs to
     be cleaned up). The self-management mode can be used if the user wants full control of when the
     domain topic needs to be deleted, while auto-managed mode provides the flexibility to perform
     less operations and manage fewer resources by the user."""
    data_residency_boundary: Optional[Union[str, "_models.DataResidencyBoundary"]] = rest_field(
        name="dataResidencyBoundary", visibility=["read", "create", "update", "delete", "query"]
    )
    """The data residency boundary for the domain. Known values are: \"WithinGeopair\" and
     \"WithinRegion\"."""
    event_type_info: Optional["_models.EventTypeInfo"] = rest_field(
        name="eventTypeInfo", visibility=["read", "create", "update", "delete", "query"]
    )
    """The eventTypeInfo for the domain."""

    @overload
    def __init__(
        self,
        *,
        public_network_access: Optional[Union[str, "_models.PublicNetworkAccess"]] = None,
        inbound_ip_rules: Optional[list["_models.InboundIpRule"]] = None,
        minimum_tls_version_allowed: Optional[Union[str, "_models.TlsVersion"]] = None,
        disable_local_auth: Optional[bool] = None,
        auto_create_topic_with_first_subscription: Optional[bool] = None,
        auto_delete_topic_with_last_subscription: Optional[bool] = None,
        data_residency_boundary: Optional[Union[str, "_models.DataResidencyBoundary"]] = None,
        event_type_info: Optional["_models.EventTypeInfo"] = 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 DomainUpdateParameters(_Model):
    """Properties of the Domain update.

    :ivar tags: Tags of the domains resource.
    :vartype tags: dict[str, str]
    :ivar properties: Properties of the resource.
    :vartype properties: ~azure.mgmt.eventgrid.models.DomainUpdateParameterProperties
    :ivar identity: Identity information for the resource.
    :vartype identity: ~azure.mgmt.eventgrid.models.IdentityInfo
    :ivar sku: The Sku pricing tier for the domain.
    :vartype sku: ~azure.mgmt.eventgrid.models.ResourceSku
    """

    tags: Optional[dict[str, str]] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """Tags of the domains resource."""
    properties: Optional["_models.DomainUpdateParameterProperties"] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """Properties of the resource."""
    identity: Optional["_models.IdentityInfo"] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """Identity information for the resource."""
    sku: Optional["_models.ResourceSku"] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """The Sku pricing tier for the domain."""

    __flattened_items = [
        "public_network_access",
        "inbound_ip_rules",
        "minimum_tls_version_allowed",
        "disable_local_auth",
        "auto_create_topic_with_first_subscription",
        "auto_delete_topic_with_last_subscription",
        "data_residency_boundary",
        "event_type_info",
    ]

    @overload
    def __init__(
        self,
        *,
        tags: Optional[dict[str, str]] = None,
        properties: Optional["_models.DomainUpdateParameterProperties"] = None,
        identity: Optional["_models.IdentityInfo"] = None,
        sku: Optional["_models.ResourceSku"] = 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:
        _flattened_input = {k: kwargs.pop(k) for k in kwargs.keys() & self.__flattened_items}
        super().__init__(*args, **kwargs)
        for k, v in _flattened_input.items():
            setattr(self, k, v)

    def __getattr__(self, name: str) -> Any:
        if name in self.__flattened_items:
            if self.properties is None:
                return None
            return getattr(self.properties, name)
        raise AttributeError(f"'{self.__class__.__name__}' object has no attribute '{name}'")

    def __setattr__(self, key: str, value: Any) -> None:
        if key in self.__flattened_items:
            if self.properties is None:
                self.properties = self._attr_to_rest_field["properties"]._class_type()
            setattr(self.properties, key, value)
        else:
            super().__setattr__(key, value)


class DynamicDeliveryAttributeMapping(DeliveryAttributeMapping, discriminator="Dynamic"):
    """Dynamic delivery attribute mapping details.

    :ivar name: Name of the delivery attribute or header.
    :vartype name: str
    :ivar properties: Properties of dynamic delivery attribute mapping.
    :vartype properties: ~azure.mgmt.eventgrid.models.DynamicDeliveryAttributeMappingProperties
    :ivar type: Type of the delivery attribute or header name. Required. Dynamic.
    :vartype type: str or ~azure.mgmt.eventgrid.models.DYNAMIC
    """

    properties: Optional["_models.DynamicDeliveryAttributeMappingProperties"] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """Properties of dynamic delivery attribute mapping."""
    type: Literal[DeliveryAttributeMappingType.DYNAMIC] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"])  # type: ignore
    """Type of the delivery attribute or header name. Required. Dynamic."""

    __flattened_items = ["source_field"]

    @overload
    def __init__(
        self,
        *,
        name: Optional[str] = None,
        properties: Optional["_models.DynamicDeliveryAttributeMappingProperties"] = 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:
        _flattened_input = {k: kwargs.pop(k) for k in kwargs.keys() & self.__flattened_items}
        super().__init__(*args, **kwargs)
        for k, v in _flattened_input.items():
            setattr(self, k, v)

    def __getattr__(self, name: str) -> Any:
        if name in self.__flattened_items:
            if self.properties is None:
                return None
            return getattr(self.properties, name)
        raise AttributeError(f"'{self.__class__.__name__}' object has no attribute '{name}'")

    def __setattr__(self, key: str, value: Any) -> None:
        if key in self.__flattened_items:
            if self.properties is None:
                self.properties = self._attr_to_rest_field["properties"]._class_type()
            setattr(self.properties, key, value)
        else:
            super().__setattr__(key, value)


class DynamicDeliveryAttributeMappingProperties(_Model):  # pylint: disable=name-too-long
    """Properties of dynamic delivery attribute mapping.

    :ivar source_field: JSON path in the event which contains attribute value.
    :vartype source_field: str
    """

    source_field: Optional[str] = rest_field(
        name="sourceField", visibility=["read", "create", "update", "delete", "query"]
    )
    """JSON path in the event which contains attribute value."""

    @overload
    def __init__(
        self,
        *,
        source_field: 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 DynamicRoutingEnrichment(_Model):
    """DynamicRoutingEnrichment.

    :ivar key: Dynamic routing enrichment key.
    :vartype key: str
    :ivar value: Dynamic routing enrichment value.
    :vartype value: str
    """

    key: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """Dynamic routing enrichment key."""
    value: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """Dynamic routing enrichment value."""

    @overload
    def __init__(
        self,
        *,
        key: Optional[str] = None,
        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 EncodedIssuerCertificateInfo(_Model):
    """Information about the public certificate that is used for custom authentication.

    :ivar kid: Identifier for the certificate. Required.
    :vartype kid: str
    :ivar encoded_certificate: Certificate in pem format. Required.
    :vartype encoded_certificate: str
    """

    kid: str = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """Identifier for the certificate. Required."""
    encoded_certificate: str = rest_field(
        name="encodedCertificate", visibility=["read", "create", "update", "delete", "query"]
    )
    """Certificate in pem format. Required."""

    @overload
    def __init__(
        self,
        *,
        kid: str,
        encoded_certificate: 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 ErrorAdditionalInfo(_Model):
    """The resource management error additional info.

    :ivar type: The additional info type.
    :vartype type: str
    :ivar info: The additional info.
    :vartype info: any
    """

    type: Optional[str] = rest_field(visibility=["read"])
    """The additional info type."""
    info: Optional[Any] = rest_field(visibility=["read"])
    """The additional info."""


class ErrorDetail(_Model):
    """The error detail.

    :ivar code: The error code.
    :vartype code: str
    :ivar message: The error message.
    :vartype message: str
    :ivar target: The error target.
    :vartype target: str
    :ivar details: The error details.
    :vartype details: list[~azure.mgmt.eventgrid.models.ErrorDetail]
    :ivar additional_info: The error additional info.
    :vartype additional_info: list[~azure.mgmt.eventgrid.models.ErrorAdditionalInfo]
    """

    code: Optional[str] = rest_field(visibility=["read"])
    """The error code."""
    message: Optional[str] = rest_field(visibility=["read"])
    """The error message."""
    target: Optional[str] = rest_field(visibility=["read"])
    """The error target."""
    details: Optional[list["_models.ErrorDetail"]] = rest_field(visibility=["read"])
    """The error details."""
    additional_info: Optional[list["_models.ErrorAdditionalInfo"]] = rest_field(
        name="additionalInfo", visibility=["read"]
    )
    """The error additional info."""


class ErrorResponse(_Model):
    """Error response.

    :ivar error: The error object.
    :vartype error: ~azure.mgmt.eventgrid.models.ErrorDetail
    """

    error: Optional["_models.ErrorDetail"] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """The error object."""

    @overload
    def __init__(
        self,
        *,
        error: Optional["_models.ErrorDetail"] = 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 EventHubEventSubscriptionDestination(EventSubscriptionDestination, discriminator="EventHub"):
    """Information about the event hub destination for an event subscription.

    :ivar properties: Event Hub Properties of the event subscription destination.
    :vartype properties:
     ~azure.mgmt.eventgrid.models.EventHubEventSubscriptionDestinationProperties
    :ivar endpoint_type: Type of the endpoint for the event subscription destination. Required.
     EventHub.
    :vartype endpoint_type: str or ~azure.mgmt.eventgrid.models.EVENT_HUB
    """

    properties: Optional["_models.EventHubEventSubscriptionDestinationProperties"] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """Event Hub Properties of the event subscription destination."""
    endpoint_type: Literal[EndpointType.EVENT_HUB] = rest_discriminator(name="endpointType", visibility=["read", "create", "update", "delete", "query"])  # type: ignore
    """Type of the endpoint for the event subscription destination. Required. EventHub."""

    __flattened_items = ["resource_id", "delivery_attribute_mappings"]

    @overload
    def __init__(
        self,
        *,
        properties: Optional["_models.EventHubEventSubscriptionDestinationProperties"] = 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:
        _flattened_input = {k: kwargs.pop(k) for k in kwargs.keys() & self.__flattened_items}
        super().__init__(*args, **kwargs)
        for k, v in _flattened_input.items():
            setattr(self, k, v)

    def __getattr__(self, name: str) -> Any:
        if name in self.__flattened_items:
            if self.properties is None:
                return None
            return getattr(self.properties, name)
        raise AttributeError(f"'{self.__class__.__name__}' object has no attribute '{name}'")

    def __setattr__(self, key: str, value: Any) -> None:
        if key in self.__flattened_items:
            if self.properties is None:
                self.properties = self._attr_to_rest_field["properties"]._class_type()
            setattr(self.properties, key, value)
        else:
            super().__setattr__(key, value)


class EventHubEventSubscriptionDestinationProperties(_Model):  # pylint: disable=name-too-long
    """The properties for a event hub destination.

    :ivar resource_id: The Azure Resource Id that represents the endpoint of an Event Hub
     destination of an event subscription.
    :vartype resource_id: str
    :ivar delivery_attribute_mappings: Delivery attribute details.
    :vartype delivery_attribute_mappings:
     list[~azure.mgmt.eventgrid.models.DeliveryAttributeMapping]
    """

    resource_id: Optional[str] = rest_field(
        name="resourceId", visibility=["read", "create", "update", "delete", "query"]
    )
    """The Azure Resource Id that represents the endpoint of an Event Hub destination of an event
     subscription."""
    delivery_attribute_mappings: Optional[list["_models.DeliveryAttributeMapping"]] = rest_field(
        name="deliveryAttributeMappings", visibility=["read", "create", "update", "delete", "query"]
    )
    """Delivery attribute details."""

    @overload
    def __init__(
        self,
        *,
        resource_id: Optional[str] = None,
        delivery_attribute_mappings: Optional[list["_models.DeliveryAttributeMapping"]] = 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 EventSubscription(ProxyResource):
    """Event Subscription.

    :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.eventgrid.models.SystemData
    :ivar properties: Properties of the event subscription.
    :vartype properties: ~azure.mgmt.eventgrid.models.EventSubscriptionProperties
    """

    properties: Optional["_models.EventSubscriptionProperties"] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """Properties of the event subscription."""

    __flattened_items = [
        "topic",
        "provisioning_state",
        "destination",
        "delivery_with_resource_identity",
        "filter",
        "labels",
        "expiration_time_utc",
        "event_delivery_schema",
        "retry_policy",
        "dead_letter_destination",
        "dead_letter_with_resource_identity",
    ]

    @overload
    def __init__(
        self,
        *,
        properties: Optional["_models.EventSubscriptionProperties"] = 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:
        _flattened_input = {k: kwargs.pop(k) for k in kwargs.keys() & self.__flattened_items}
        super().__init__(*args, **kwargs)
        for k, v in _flattened_input.items():
            setattr(self, k, v)

    def __getattr__(self, name: str) -> Any:
        if name in self.__flattened_items:
            if self.properties is None:
                return None
            return getattr(self.properties, name)
        raise AttributeError(f"'{self.__class__.__name__}' object has no attribute '{name}'")

    def __setattr__(self, key: str, value: Any) -> None:
        if key in self.__flattened_items:
            if self.properties is None:
                self.properties = self._attr_to_rest_field["properties"]._class_type()
            setattr(self.properties, key, value)
        else:
            super().__setattr__(key, value)


class EventSubscriptionFilter(_Model):
    """Filter for the Event Subscription.

    :ivar subject_begins_with: An optional string to filter events for an event subscription based
     on a resource path prefix. The format of this depends on the publisher of the events. Wildcard
     characters are not supported in this path.
    :vartype subject_begins_with: str
    :ivar subject_ends_with: An optional string to filter events for an event subscription based on
     a resource path suffix. Wildcard characters are not supported in this path.
    :vartype subject_ends_with: str
    :ivar included_event_types: A list of applicable event types that need to be part of the event
     subscription. If it is desired to subscribe to all default event types, set the
     IncludedEventTypes to null.
    :vartype included_event_types: list[str]
    :ivar is_subject_case_sensitive: Specifies if the SubjectBeginsWith and SubjectEndsWith
     properties of the filter should be compared in a case sensitive manner.
    :vartype is_subject_case_sensitive: bool
    :ivar enable_advanced_filtering_on_arrays: Allows advanced filters to be evaluated against an
     array of values instead of expecting a singular value.
    :vartype enable_advanced_filtering_on_arrays: bool
    :ivar advanced_filters: An array of advanced filters that are used for filtering event
     subscriptions.
    :vartype advanced_filters: list[~azure.mgmt.eventgrid.models.AdvancedFilter]
    """

    subject_begins_with: Optional[str] = rest_field(
        name="subjectBeginsWith", visibility=["read", "create", "update", "delete", "query"]
    )
    """An optional string to filter events for an event subscription based on a resource path prefix.
     The format of this depends on the publisher of the events. Wildcard characters are not
     supported in this path."""
    subject_ends_with: Optional[str] = rest_field(
        name="subjectEndsWith", visibility=["read", "create", "update", "delete", "query"]
    )
    """An optional string to filter events for an event subscription based on a resource path suffix.
     Wildcard characters are not supported in this path."""
    included_event_types: Optional[list[str]] = rest_field(
        name="includedEventTypes", visibility=["read", "create", "update", "delete", "query"]
    )
    """A list of applicable event types that need to be part of the event subscription. If it is
     desired to subscribe to all default event types, set the IncludedEventTypes to null."""
    is_subject_case_sensitive: Optional[bool] = rest_field(
        name="isSubjectCaseSensitive", visibility=["read", "create", "update", "delete", "query"]
    )
    """Specifies if the SubjectBeginsWith and SubjectEndsWith properties of the filter should be
     compared in a case sensitive manner."""
    enable_advanced_filtering_on_arrays: Optional[bool] = rest_field(
        name="enableAdvancedFilteringOnArrays", visibility=["read", "create", "update", "delete", "query"]
    )
    """Allows advanced filters to be evaluated against an array of values instead of expecting a
     singular value."""
    advanced_filters: Optional[list["_models.AdvancedFilter"]] = rest_field(
        name="advancedFilters", visibility=["read", "create", "update", "delete", "query"]
    )
    """An array of advanced filters that are used for filtering event subscriptions."""

    @overload
    def __init__(
        self,
        *,
        subject_begins_with: Optional[str] = None,
        subject_ends_with: Optional[str] = None,
        included_event_types: Optional[list[str]] = None,
        is_subject_case_sensitive: Optional[bool] = None,
        enable_advanced_filtering_on_arrays: Optional[bool] = None,
        advanced_filters: Optional[list["_models.AdvancedFilter"]] = 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 EventSubscriptionFullUrl(_Model):
    """Full endpoint URL of an event subscription.

    :ivar endpoint_url: The URL that represents the endpoint of the destination of an event
     subscription.
    :vartype endpoint_url: str
    """

    endpoint_url: Optional[str] = rest_field(
        name="endpointUrl", visibility=["read", "create", "update", "delete", "query"]
    )
    """The URL that represents the endpoint of the destination of an event subscription."""

    @overload
    def __init__(
        self,
        *,
        endpoint_url: 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 EventSubscriptionIdentity(_Model):
    """The identity information with the event subscription.

    :ivar type: The type of managed identity used. Can be either 'SystemAssigned' or
     'UserAssigned'. Known values are: "SystemAssigned" and "UserAssigned".
    :vartype type: str or ~azure.mgmt.eventgrid.models.EventSubscriptionIdentityType
    :ivar user_assigned_identity: The user identity associated with the resource.
    :vartype user_assigned_identity: str
    :ivar federated_identity_credential_info: The details of the Federated Identity Credential
     (FIC) used with the resource delivery.
    :vartype federated_identity_credential_info:
     ~azure.mgmt.eventgrid.models.FederatedIdentityCredentialInfo
    """

    type: Optional[Union[str, "_models.EventSubscriptionIdentityType"]] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """The type of managed identity used. Can be either 'SystemAssigned' or 'UserAssigned'. Known
     values are: \"SystemAssigned\" and \"UserAssigned\"."""
    user_assigned_identity: Optional[str] = rest_field(
        name="userAssignedIdentity", visibility=["read", "create", "update", "delete", "query"]
    )
    """The user identity associated with the resource."""
    federated_identity_credential_info: Optional["_models.FederatedIdentityCredentialInfo"] = rest_field(
        name="federatedIdentityCredentialInfo", visibility=["read", "create", "update", "delete", "query"]
    )
    """The details of the Federated Identity Credential (FIC) used with the resource delivery."""

    @overload
    def __init__(
        self,
        *,
        type: Optional[Union[str, "_models.EventSubscriptionIdentityType"]] = None,
        user_assigned_identity: Optional[str] = None,
        federated_identity_credential_info: Optional["_models.FederatedIdentityCredentialInfo"] = 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 EventSubscriptionProperties(_Model):
    """Properties of the Event Subscription.

    :ivar topic: Name of the topic of the event subscription.
    :vartype topic: str
    :ivar provisioning_state: Provisioning state of the event subscription. Known values are:
     "Creating", "Updating", "Deleting", "Succeeded", "Canceled", "Failed", and
     "AwaitingManualAction".
    :vartype provisioning_state: str or
     ~azure.mgmt.eventgrid.models.EventSubscriptionProvisioningState
    :ivar destination: Information about the destination where events have to be delivered for the
     event subscription. Uses Azure Event Grid's identity to acquire the authentication tokens being
     used during delivery / dead-lettering.
    :vartype destination: ~azure.mgmt.eventgrid.models.EventSubscriptionDestination
    :ivar delivery_with_resource_identity: Information about the destination where events have to
     be delivered for the event subscription. Uses the managed identity setup on the parent resource
     (namely, topic or domain) to acquire the authentication tokens being used during delivery /
     dead-lettering.
    :vartype delivery_with_resource_identity:
     ~azure.mgmt.eventgrid.models.DeliveryWithResourceIdentity
    :ivar filter: Information about the filter for the event subscription.
    :vartype filter: ~azure.mgmt.eventgrid.models.EventSubscriptionFilter
    :ivar labels: List of user defined labels.
    :vartype labels: list[str]
    :ivar expiration_time_utc: Expiration time of the event subscription.
    :vartype expiration_time_utc: ~datetime.datetime
    :ivar event_delivery_schema: The event delivery schema for the event subscription. Known values
     are: "EventGridSchema", "CustomInputSchema", and "CloudEventSchemaV1_0".
    :vartype event_delivery_schema: str or ~azure.mgmt.eventgrid.models.EventDeliverySchema
    :ivar retry_policy: The retry policy for events. This can be used to configure maximum number
     of delivery attempts and time to live for events.
    :vartype retry_policy: ~azure.mgmt.eventgrid.models.RetryPolicy
    :ivar dead_letter_destination: The dead letter destination of the event subscription. Any event
     that cannot be delivered to its' destination is sent to the dead letter destination. Uses Azure
     Event Grid's identity to acquire the authentication tokens being used during delivery /
     dead-lettering.
    :vartype dead_letter_destination: ~azure.mgmt.eventgrid.models.DeadLetterDestination
    :ivar dead_letter_with_resource_identity: The dead letter destination of the event
     subscription. Any event that cannot be delivered to its' destination is sent to the dead letter
     destination. Uses the managed identity setup on the parent resource (namely, topic or domain)
     to acquire the authentication tokens being used during delivery / dead-lettering.
    :vartype dead_letter_with_resource_identity:
     ~azure.mgmt.eventgrid.models.DeadLetterWithResourceIdentity
    """

    topic: Optional[str] = rest_field(visibility=["read"])
    """Name of the topic of the event subscription."""
    provisioning_state: Optional[Union[str, "_models.EventSubscriptionProvisioningState"]] = rest_field(
        name="provisioningState", visibility=["read"]
    )
    """Provisioning state of the event subscription. Known values are: \"Creating\", \"Updating\",
     \"Deleting\", \"Succeeded\", \"Canceled\", \"Failed\", and \"AwaitingManualAction\"."""
    destination: Optional["_models.EventSubscriptionDestination"] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """Information about the destination where events have to be delivered for the event subscription.
     Uses Azure Event Grid's identity to acquire the authentication tokens being used during
     delivery / dead-lettering."""
    delivery_with_resource_identity: Optional["_models.DeliveryWithResourceIdentity"] = rest_field(
        name="deliveryWithResourceIdentity", visibility=["read", "create", "update", "delete", "query"]
    )
    """Information about the destination where events have to be delivered for the event subscription.
     Uses the managed identity setup on the parent resource (namely, topic or domain) to acquire the
     authentication tokens being used during delivery / dead-lettering."""
    filter: Optional["_models.EventSubscriptionFilter"] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """Information about the filter for the event subscription."""
    labels: Optional[list[str]] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """List of user defined labels."""
    expiration_time_utc: Optional[datetime.datetime] = rest_field(
        name="expirationTimeUtc", visibility=["read", "create", "update", "delete", "query"], format="rfc3339"
    )
    """Expiration time of the event subscription."""
    event_delivery_schema: Optional[Union[str, "_models.EventDeliverySchema"]] = rest_field(
        name="eventDeliverySchema", visibility=["read", "create", "update", "delete", "query"]
    )
    """The event delivery schema for the event subscription. Known values are: \"EventGridSchema\",
     \"CustomInputSchema\", and \"CloudEventSchemaV1_0\"."""
    retry_policy: Optional["_models.RetryPolicy"] = rest_field(
        name="retryPolicy", visibility=["read", "create", "update", "delete", "query"]
    )
    """The retry policy for events. This can be used to configure maximum number of delivery attempts
     and time to live for events."""
    dead_letter_destination: Optional["_models.DeadLetterDestination"] = rest_field(
        name="deadLetterDestination", visibility=["read", "create", "update", "delete", "query"]
    )
    """The dead letter destination of the event subscription. Any event that cannot be delivered to
     its' destination is sent to the dead letter destination. Uses Azure Event Grid's identity to
     acquire the authentication tokens being used during delivery / dead-lettering."""
    dead_letter_with_resource_identity: Optional["_models.DeadLetterWithResourceIdentity"] = rest_field(
        name="deadLetterWithResourceIdentity", visibility=["read", "create", "update", "delete", "query"]
    )
    """The dead letter destination of the event subscription. Any event that cannot be delivered to
     its' destination is sent to the dead letter destination. Uses the managed identity setup on the
     parent resource (namely, topic or domain) to acquire the authentication tokens being used
     during delivery / dead-lettering."""

    @overload
    def __init__(
        self,
        *,
        destination: Optional["_models.EventSubscriptionDestination"] = None,
        delivery_with_resource_identity: Optional["_models.DeliveryWithResourceIdentity"] = None,
        filter: Optional["_models.EventSubscriptionFilter"] = None,  # pylint: disable=redefined-builtin
        labels: Optional[list[str]] = None,
        expiration_time_utc: Optional[datetime.datetime] = None,
        event_delivery_schema: Optional[Union[str, "_models.EventDeliverySchema"]] = None,
        retry_policy: Optional["_models.RetryPolicy"] = None,
        dead_letter_destination: Optional["_models.DeadLetterDestination"] = None,
        dead_letter_with_resource_identity: Optional["_models.DeadLetterWithResourceIdentity"] = 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 EventSubscriptionUpdateParameters(_Model):
    """Properties of the Event Subscription update.

    :ivar destination: Information about the destination where events have to be delivered for the
     event subscription. Uses Azure Event Grid's identity to acquire the authentication tokens being
     used during delivery / dead-lettering.
    :vartype destination: ~azure.mgmt.eventgrid.models.EventSubscriptionDestination
    :ivar delivery_with_resource_identity: Information about the destination where events have to
     be delivered for the event subscription. Uses the managed identity setup on the parent resource
     (topic / domain) to acquire the authentication tokens being used during delivery /
     dead-lettering.
    :vartype delivery_with_resource_identity:
     ~azure.mgmt.eventgrid.models.DeliveryWithResourceIdentity
    :ivar filter: Information about the filter for the event subscription.
    :vartype filter: ~azure.mgmt.eventgrid.models.EventSubscriptionFilter
    :ivar labels: List of user defined labels.
    :vartype labels: list[str]
    :ivar expiration_time_utc: Information about the expiration time for the event subscription.
    :vartype expiration_time_utc: ~datetime.datetime
    :ivar event_delivery_schema: The event delivery schema for the event subscription. Known values
     are: "EventGridSchema", "CustomInputSchema", and "CloudEventSchemaV1_0".
    :vartype event_delivery_schema: str or ~azure.mgmt.eventgrid.models.EventDeliverySchema
    :ivar retry_policy: The retry policy for events. This can be used to configure maximum number
     of delivery attempts and time to live for events.
    :vartype retry_policy: ~azure.mgmt.eventgrid.models.RetryPolicy
    :ivar dead_letter_destination: The dead letter destination of the event subscription. Any event
     that cannot be delivered to its' destination is sent to the dead letter destination. Uses Azure
     Event Grid's identity to acquire the authentication tokens being used during delivery /
     dead-lettering.
    :vartype dead_letter_destination: ~azure.mgmt.eventgrid.models.DeadLetterDestination
    :ivar dead_letter_with_resource_identity: The dead letter destination of the event
     subscription. Any event that cannot be delivered to its' destination is sent to the dead letter
     destination. Uses the managed identity setup on the parent resource (topic / domain) to acquire
     the authentication tokens being used during delivery / dead-lettering.
    :vartype dead_letter_with_resource_identity:
     ~azure.mgmt.eventgrid.models.DeadLetterWithResourceIdentity
    """

    destination: Optional["_models.EventSubscriptionDestination"] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """Information about the destination where events have to be delivered for the event subscription.
     Uses Azure Event Grid's identity to acquire the authentication tokens being used during
     delivery / dead-lettering."""
    delivery_with_resource_identity: Optional["_models.DeliveryWithResourceIdentity"] = rest_field(
        name="deliveryWithResourceIdentity", visibility=["read", "create", "update", "delete", "query"]
    )
    """Information about the destination where events have to be delivered for the event subscription.
     Uses the managed identity setup on the parent resource (topic / domain) to acquire the
     authentication tokens being used during delivery / dead-lettering."""
    filter: Optional["_models.EventSubscriptionFilter"] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """Information about the filter for the event subscription."""
    labels: Optional[list[str]] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """List of user defined labels."""
    expiration_time_utc: Optional[datetime.datetime] = rest_field(
        name="expirationTimeUtc", visibility=["read", "create", "update", "delete", "query"], format="rfc3339"
    )
    """Information about the expiration time for the event subscription."""
    event_delivery_schema: Optional[Union[str, "_models.EventDeliverySchema"]] = rest_field(
        name="eventDeliverySchema", visibility=["read", "create", "update", "delete", "query"]
    )
    """The event delivery schema for the event subscription. Known values are: \"EventGridSchema\",
     \"CustomInputSchema\", and \"CloudEventSchemaV1_0\"."""
    retry_policy: Optional["_models.RetryPolicy"] = rest_field(
        name="retryPolicy", visibility=["read", "create", "update", "delete", "query"]
    )
    """The retry policy for events. This can be used to configure maximum number of delivery attempts
     and time to live for events."""
    dead_letter_destination: Optional["_models.DeadLetterDestination"] = rest_field(
        name="deadLetterDestination", visibility=["read", "create", "update", "delete", "query"]
    )
    """The dead letter destination of the event subscription. Any event that cannot be delivered to
     its' destination is sent to the dead letter destination. Uses Azure Event Grid's identity to
     acquire the authentication tokens being used during delivery / dead-lettering."""
    dead_letter_with_resource_identity: Optional["_models.DeadLetterWithResourceIdentity"] = rest_field(
        name="deadLetterWithResourceIdentity", visibility=["read", "create", "update", "delete", "query"]
    )
    """The dead letter destination of the event subscription. Any event that cannot be delivered to
     its' destination is sent to the dead letter destination. Uses the managed identity setup on the
     parent resource (topic / domain) to acquire the authentication tokens being used during
     delivery / dead-lettering."""

    @overload
    def __init__(
        self,
        *,
        destination: Optional["_models.EventSubscriptionDestination"] = None,
        delivery_with_resource_identity: Optional["_models.DeliveryWithResourceIdentity"] = None,
        filter: Optional["_models.EventSubscriptionFilter"] = None,  # pylint: disable=redefined-builtin
        labels: Optional[list[str]] = None,
        expiration_time_utc: Optional[datetime.datetime] = None,
        event_delivery_schema: Optional[Union[str, "_models.EventDeliverySchema"]] = None,
        retry_policy: Optional["_models.RetryPolicy"] = None,
        dead_letter_destination: Optional["_models.DeadLetterDestination"] = None,
        dead_letter_with_resource_identity: Optional["_models.DeadLetterWithResourceIdentity"] = 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 EventType(Resource):
    """Event Type for a subject under a topic.

    :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.eventgrid.models.SystemData
    :ivar properties: Properties of the event type.
    :vartype properties: ~azure.mgmt.eventgrid.models.EventTypeProperties
    """

    properties: Optional["_models.EventTypeProperties"] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """Properties of the event type."""

    __flattened_items = ["display_name", "description", "schema_url", "is_in_default_set"]

    @overload
    def __init__(
        self,
        *,
        properties: Optional["_models.EventTypeProperties"] = 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:
        _flattened_input = {k: kwargs.pop(k) for k in kwargs.keys() & self.__flattened_items}
        super().__init__(*args, **kwargs)
        for k, v in _flattened_input.items():
            setattr(self, k, v)

    def __getattr__(self, name: str) -> Any:
        if name in self.__flattened_items:
            if self.properties is None:
                return None
            return getattr(self.properties, name)
        raise AttributeError(f"'{self.__class__.__name__}' object has no attribute '{name}'")

    def __setattr__(self, key: str, value: Any) -> None:
        if key in self.__flattened_items:
            if self.properties is None:
                self.properties = self._attr_to_rest_field["properties"]._class_type()
            setattr(self.properties, key, value)
        else:
            super().__setattr__(key, value)


class EventTypeInfo(_Model):
    """The event type information for Channels.

    :ivar kind: The kind of event type used. "Inline"
    :vartype kind: str or ~azure.mgmt.eventgrid.models.EventDefinitionKind
    :ivar inline_event_types: A collection of inline event types for the resource. The inline event
     type keys are of type string which represents the name of the event. An example of a valid
     inline event name is "Contoso.OrderCreated". The inline event type values are of type
     InlineEventProperties and will contain additional information for every inline event type.
    :vartype inline_event_types: dict[str, ~azure.mgmt.eventgrid.models.InlineEventProperties]
    """

    kind: Optional[Union[str, "_models.EventDefinitionKind"]] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """The kind of event type used. \"Inline\""""
    inline_event_types: Optional[dict[str, "_models.InlineEventProperties"]] = rest_field(
        name="inlineEventTypes", visibility=["read", "create", "update", "delete", "query"]
    )
    """A collection of inline event types for the resource. The inline event type keys are of type
     string which represents the name of the event. An example of a valid inline event name is
     \"Contoso.OrderCreated\". The inline event type values are of type InlineEventProperties and
     will contain additional information for every inline event type."""

    @overload
    def __init__(
        self,
        *,
        kind: Optional[Union[str, "_models.EventDefinitionKind"]] = None,
        inline_event_types: Optional[dict[str, "_models.InlineEventProperties"]] = 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 EventTypeProperties(_Model):
    """Properties of the event type.

    :ivar display_name: Display name of the event type.
    :vartype display_name: str
    :ivar description: Description of the event type.
    :vartype description: str
    :ivar schema_url: URL of the schema for this event type.
    :vartype schema_url: str
    :ivar is_in_default_set: IsInDefaultSet flag of the event type.
    :vartype is_in_default_set: bool
    """

    display_name: Optional[str] = rest_field(
        name="displayName", visibility=["read", "create", "update", "delete", "query"]
    )
    """Display name of the event type."""
    description: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """Description of the event type."""
    schema_url: Optional[str] = rest_field(name="schemaUrl", visibility=["read", "create", "update", "delete", "query"])
    """URL of the schema for this event type."""
    is_in_default_set: Optional[bool] = rest_field(
        name="isInDefaultSet", visibility=["read", "create", "update", "delete", "query"]
    )
    """IsInDefaultSet flag of the event type."""

    @overload
    def __init__(
        self,
        *,
        display_name: Optional[str] = None,
        description: Optional[str] = None,
        schema_url: Optional[str] = None,
        is_in_default_set: 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 ExtendedLocation(_Model):
    """Definition of an Extended Location.

    :ivar name: Fully qualified name of the extended location.
    :vartype name: str
    :ivar type: Type of the extended location.
    :vartype type: str
    """

    name: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """Fully qualified name of the extended location."""
    type: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """Type of the extended location."""

    @overload
    def __init__(
        self,
        *,
        name: Optional[str] = None,
        type: 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 ExtensionResource(Resource):
    """The base extension 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.eventgrid.models.SystemData
    """


class ExtensionTopic(ExtensionResource):
    """Event grid Extension Topic. This is used for getting Event Grid related metrics for Azure
    resources.

    :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.eventgrid.models.SystemData
    :ivar properties: Properties of the extension topic.
    :vartype properties: ~azure.mgmt.eventgrid.models.ExtensionTopicProperties
    """

    properties: Optional["_models.ExtensionTopicProperties"] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """Properties of the extension topic."""

    __flattened_items = ["description", "system_topic"]

    @overload
    def __init__(
        self,
        *,
        properties: Optional["_models.ExtensionTopicProperties"] = 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:
        _flattened_input = {k: kwargs.pop(k) for k in kwargs.keys() & self.__flattened_items}
        super().__init__(*args, **kwargs)
        for k, v in _flattened_input.items():
            setattr(self, k, v)

    def __getattr__(self, name: str) -> Any:
        if name in self.__flattened_items:
            if self.properties is None:
                return None
            return getattr(self.properties, name)
        raise AttributeError(f"'{self.__class__.__name__}' object has no attribute '{name}'")

    def __setattr__(self, key: str, value: Any) -> None:
        if key in self.__flattened_items:
            if self.properties is None:
                self.properties = self._attr_to_rest_field["properties"]._class_type()
            setattr(self.properties, key, value)
        else:
            super().__setattr__(key, value)


class ExtensionTopicProperties(_Model):
    """Properties of the Extension Topic.

    :ivar description: Description of the extension topic.
    :vartype description: str
    :ivar system_topic: System topic resource id which is mapped to the source.
    :vartype system_topic: str
    """

    description: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """Description of the extension topic."""
    system_topic: Optional[str] = rest_field(
        name="systemTopic", visibility=["read", "create", "update", "delete", "query"]
    )
    """System topic resource id which is mapped to the source."""

    @overload
    def __init__(
        self,
        *,
        description: Optional[str] = None,
        system_topic: 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 FederatedIdentityCredentialInfo(_Model):
    """The details of the Federated Identity Credential (FIC) used with the resource.

    :ivar federated_client_id: The Multi-Tenant Microsoft Entra ID Application where the Federated
     Identity Credential (FIC) is associated with. Required.
    :vartype federated_client_id: str
    """

    federated_client_id: str = rest_field(
        name="federatedClientId", visibility=["read", "create", "update", "delete", "query"]
    )
    """The Multi-Tenant Microsoft Entra ID Application where the Federated Identity Credential (FIC)
     is associated with. Required."""

    @overload
    def __init__(
        self,
        *,
        federated_client_id: 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 FiltersConfiguration(_Model):
    """Filters configuration for the Event Subscription.

    :ivar included_event_types: A list of applicable event types that need to be part of the event
     subscription. If it is desired to subscribe to all default event types, set the
     IncludedEventTypes to null.
    :vartype included_event_types: list[str]
    :ivar filters: An array of filters that are used for filtering event subscriptions.
    :vartype filters: list[~azure.mgmt.eventgrid.models.Filter]
    """

    included_event_types: Optional[list[str]] = rest_field(
        name="includedEventTypes", visibility=["read", "create", "update", "delete", "query"]
    )
    """A list of applicable event types that need to be part of the event subscription. If it is
     desired to subscribe to all default event types, set the IncludedEventTypes to null."""
    filters: Optional[list["_models.Filter"]] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """An array of filters that are used for filtering event subscriptions."""

    @overload
    def __init__(
        self,
        *,
        included_event_types: Optional[list[str]] = None,
        filters: Optional[list["_models.Filter"]] = 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 HybridConnectionEventSubscriptionDestination(
    EventSubscriptionDestination, discriminator="HybridConnection"
):  # pylint: disable=name-too-long
    """Information about the HybridConnection destination for an event subscription.

    :ivar properties: Hybrid connection Properties of the event subscription destination.
    :vartype properties:
     ~azure.mgmt.eventgrid.models.HybridConnectionEventSubscriptionDestinationProperties
    :ivar endpoint_type: Type of the endpoint for the event subscription destination. Required.
     HybridConnection.
    :vartype endpoint_type: str or ~azure.mgmt.eventgrid.models.HYBRID_CONNECTION
    """

    properties: Optional["_models.HybridConnectionEventSubscriptionDestinationProperties"] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """Hybrid connection Properties of the event subscription destination."""
    endpoint_type: Literal[EndpointType.HYBRID_CONNECTION] = rest_discriminator(name="endpointType", visibility=["read", "create", "update", "delete", "query"])  # type: ignore
    """Type of the endpoint for the event subscription destination. Required. HybridConnection."""

    __flattened_items = ["resource_id", "delivery_attribute_mappings"]

    @overload
    def __init__(
        self,
        *,
        properties: Optional["_models.HybridConnectionEventSubscriptionDestinationProperties"] = 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:
        _flattened_input = {k: kwargs.pop(k) for k in kwargs.keys() & self.__flattened_items}
        super().__init__(*args, **kwargs)
        for k, v in _flattened_input.items():
            setattr(self, k, v)

    def __getattr__(self, name: str) -> Any:
        if name in self.__flattened_items:
            if self.properties is None:
                return None
            return getattr(self.properties, name)
        raise AttributeError(f"'{self.__class__.__name__}' object has no attribute '{name}'")

    def __setattr__(self, key: str, value: Any) -> None:
        if key in self.__flattened_items:
            if self.properties is None:
                self.properties = self._attr_to_rest_field["properties"]._class_type()
            setattr(self.properties, key, value)
        else:
            super().__setattr__(key, value)


class HybridConnectionEventSubscriptionDestinationProperties(_Model):  # pylint: disable=name-too-long
    """The properties for a hybrid connection destination.

    :ivar resource_id: The Azure Resource ID of an hybrid connection that is the destination of an
     event subscription.
    :vartype resource_id: str
    :ivar delivery_attribute_mappings: Delivery attribute details.
    :vartype delivery_attribute_mappings:
     list[~azure.mgmt.eventgrid.models.DeliveryAttributeMapping]
    """

    resource_id: Optional[str] = rest_field(
        name="resourceId", visibility=["read", "create", "update", "delete", "query"]
    )
    """The Azure Resource ID of an hybrid connection that is the destination of an event subscription."""
    delivery_attribute_mappings: Optional[list["_models.DeliveryAttributeMapping"]] = rest_field(
        name="deliveryAttributeMappings", visibility=["read", "create", "update", "delete", "query"]
    )
    """Delivery attribute details."""

    @overload
    def __init__(
        self,
        *,
        resource_id: Optional[str] = None,
        delivery_attribute_mappings: Optional[list["_models.DeliveryAttributeMapping"]] = 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 IdentityInfo(_Model):
    """The identity information for the resource.

    :ivar type: The type of managed identity used. The type 'SystemAssigned, UserAssigned' includes
     both an implicitly created identity and a set of user-assigned identities. The type 'None' will
     remove any identity. Known values are: "None", "SystemAssigned", "UserAssigned", and
     "SystemAssigned, UserAssigned".
    :vartype type: str or ~azure.mgmt.eventgrid.models.IdentityType
    :ivar principal_id: The principal ID of resource identity.
    :vartype principal_id: str
    :ivar tenant_id: The tenant ID of resource.
    :vartype tenant_id: str
    :ivar user_assigned_identities: The list of user identities associated with the resource. The
     user identity dictionary key references will be ARM resource ids in the form:
     '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'.
     This property is currently not used and reserved for future usage.
    :vartype user_assigned_identities: dict[str,
     ~azure.mgmt.eventgrid.models.UserIdentityProperties]
    """

    type: Optional[Union[str, "_models.IdentityType"]] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """The type of managed identity used. The type 'SystemAssigned, UserAssigned' includes both an
     implicitly created identity and a set of user-assigned identities. The type 'None' will remove
     any identity. Known values are: \"None\", \"SystemAssigned\", \"UserAssigned\", and
     \"SystemAssigned, UserAssigned\"."""
    principal_id: Optional[str] = rest_field(
        name="principalId", visibility=["read", "create", "update", "delete", "query"]
    )
    """The principal ID of resource identity."""
    tenant_id: Optional[str] = rest_field(name="tenantId", visibility=["read", "create", "update", "delete", "query"])
    """The tenant ID of resource."""
    user_assigned_identities: Optional[dict[str, "_models.UserIdentityProperties"]] = rest_field(
        name="userAssignedIdentities", visibility=["read", "create", "update", "delete", "query"]
    )
    """The list of user identities associated with the resource. The user identity dictionary key
     references will be ARM resource ids in the form:
     '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'.
     This property is currently not used and reserved for future usage."""

    @overload
    def __init__(
        self,
        *,
        type: Optional[Union[str, "_models.IdentityType"]] = None,
        principal_id: Optional[str] = None,
        tenant_id: Optional[str] = None,
        user_assigned_identities: Optional[dict[str, "_models.UserIdentityProperties"]] = 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 InboundIpRule(_Model):
    """InboundIpRule.

    :ivar ip_mask: IP Address in CIDR notation e.g., 10.0.0.0/8.
    :vartype ip_mask: str
    :ivar action: Action to perform based on the match or no match of the IpMask. "Allow"
    :vartype action: str or ~azure.mgmt.eventgrid.models.IpActionType
    """

    ip_mask: Optional[str] = rest_field(name="ipMask", visibility=["read", "create", "update", "delete", "query"])
    """IP Address in CIDR notation e.g., 10.0.0.0/8."""
    action: Optional[Union[str, "_models.IpActionType"]] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """Action to perform based on the match or no match of the IpMask. \"Allow\""""

    @overload
    def __init__(
        self,
        *,
        ip_mask: Optional[str] = None,
        action: Optional[Union[str, "_models.IpActionType"]] = 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 InlineEventProperties(_Model):
    """Additional information about every inline event.

    :ivar description: The description for the inline event.
    :vartype description: str
    :ivar display_name: The displayName for the inline event.
    :vartype display_name: str
    :ivar documentation_url: The documentationUrl for the inline event.
    :vartype documentation_url: str
    :ivar data_schema_url: The dataSchemaUrl for the inline event.
    :vartype data_schema_url: str
    """

    description: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """The description for the inline event."""
    display_name: Optional[str] = rest_field(
        name="displayName", visibility=["read", "create", "update", "delete", "query"]
    )
    """The displayName for the inline event."""
    documentation_url: Optional[str] = rest_field(
        name="documentationUrl", visibility=["read", "create", "update", "delete", "query"]
    )
    """The documentationUrl for the inline event."""
    data_schema_url: Optional[str] = rest_field(
        name="dataSchemaUrl", visibility=["read", "create", "update", "delete", "query"]
    )
    """The dataSchemaUrl for the inline event."""

    @overload
    def __init__(
        self,
        *,
        description: Optional[str] = None,
        display_name: Optional[str] = None,
        documentation_url: Optional[str] = None,
        data_schema_url: 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 InputSchemaMapping(_Model):
    """By default, Event Grid expects events to be in the Event Grid event schema. Specifying an input
    schema mapping enables publishing to Event Grid using a custom input schema. Currently, the
    only supported type of InputSchemaMapping is 'JsonInputSchemaMapping'.

    You probably want to use the sub-classes and not this class directly. Known sub-classes are:
    JsonInputSchemaMapping

    :ivar input_schema_mapping_type: Type of the custom mapping. Required. "Json"
    :vartype input_schema_mapping_type: str or ~azure.mgmt.eventgrid.models.InputSchemaMappingType
    """

    __mapping__: dict[str, _Model] = {}
    input_schema_mapping_type: str = rest_discriminator(
        name="inputSchemaMappingType", visibility=["read", "create", "update", "delete", "query"]
    )
    """Type of the custom mapping. Required. \"Json\""""

    @overload
    def __init__(
        self,
        *,
        input_schema_mapping_type: 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 IsNotNullAdvancedFilter(AdvancedFilter, discriminator="IsNotNull"):
    """IsNotNull Advanced Filter.

    :ivar key: The field/property in the event based on which you want to filter.
    :vartype key: str
    :ivar operator_type: The operator type used for filtering, e.g., NumberIn, StringContains,
     BoolEquals and others. Required. IsNotNull.
    :vartype operator_type: str or ~azure.mgmt.eventgrid.models.IS_NOT_NULL
    """

    operator_type: Literal[AdvancedFilterOperatorType.IS_NOT_NULL] = rest_discriminator(name="operatorType", visibility=["read", "create", "update", "delete", "query"])  # type: ignore
    """The operator type used for filtering, e.g., NumberIn, StringContains, BoolEquals and others.
     Required. IsNotNull."""

    @overload
    def __init__(
        self,
        *,
        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)
        self.operator_type = AdvancedFilterOperatorType.IS_NOT_NULL  # type: ignore


class IsNotNullFilter(Filter, discriminator="IsNotNull"):
    """IsNotNull Filter.

    :ivar key: The field/property in the event based on which you want to filter.
    :vartype key: str
    :ivar operator_type: The operator type used for filtering, e.g., NumberIn, StringContains,
     BoolEquals and others. Required. IsNotNull.
    :vartype operator_type: str or ~azure.mgmt.eventgrid.models.IS_NOT_NULL
    """

    operator_type: Literal[FilterOperatorType.IS_NOT_NULL] = rest_discriminator(name="operatorType", visibility=["read", "create", "update", "delete", "query"])  # type: ignore
    """The operator type used for filtering, e.g., NumberIn, StringContains, BoolEquals and others.
     Required. IsNotNull."""

    @overload
    def __init__(
        self,
        *,
        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)
        self.operator_type = FilterOperatorType.IS_NOT_NULL  # type: ignore


class IsNullOrUndefinedAdvancedFilter(AdvancedFilter, discriminator="IsNullOrUndefined"):
    """IsNullOrUndefined Advanced Filter.

    :ivar key: The field/property in the event based on which you want to filter.
    :vartype key: str
    :ivar operator_type: The operator type used for filtering, e.g., NumberIn, StringContains,
     BoolEquals and others. Required. IsNullOrUndefined.
    :vartype operator_type: str or ~azure.mgmt.eventgrid.models.IS_NULL_OR_UNDEFINED
    """

    operator_type: Literal[AdvancedFilterOperatorType.IS_NULL_OR_UNDEFINED] = rest_discriminator(name="operatorType", visibility=["read", "create", "update", "delete", "query"])  # type: ignore
    """The operator type used for filtering, e.g., NumberIn, StringContains, BoolEquals and others.
     Required. IsNullOrUndefined."""

    @overload
    def __init__(
        self,
        *,
        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)
        self.operator_type = AdvancedFilterOperatorType.IS_NULL_OR_UNDEFINED  # type: ignore


class IsNullOrUndefinedFilter(Filter, discriminator="IsNullOrUndefined"):
    """IsNullOrUndefined Filter.

    :ivar key: The field/property in the event based on which you want to filter.
    :vartype key: str
    :ivar operator_type: The operator type used for filtering, e.g., NumberIn, StringContains,
     BoolEquals and others. Required. IsNullOrUndefined.
    :vartype operator_type: str or ~azure.mgmt.eventgrid.models.IS_NULL_OR_UNDEFINED
    """

    operator_type: Literal[FilterOperatorType.IS_NULL_OR_UNDEFINED] = rest_discriminator(name="operatorType", visibility=["read", "create", "update", "delete", "query"])  # type: ignore
    """The operator type used for filtering, e.g., NumberIn, StringContains, BoolEquals and others.
     Required. IsNullOrUndefined."""

    @overload
    def __init__(
        self,
        *,
        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)
        self.operator_type = FilterOperatorType.IS_NULL_OR_UNDEFINED  # type: ignore


class IssuerCertificateInfo(_Model):
    """Information about the certificate that is used for token validation.

    :ivar certificate_url: Keyvault certificate URL in
     `https://keyvaultname.vault.azure.net/certificates/certificateName/certificateVersion
     <https://keyvaultname.vault.azure.net/certificates/certificateName/certificateVersion>`_
     format. Required.
    :vartype certificate_url: str
    :ivar identity: The identity that will be used to access the certificate.
    :vartype identity: ~azure.mgmt.eventgrid.models.CustomJwtAuthenticationManagedIdentity
    """

    certificate_url: str = rest_field(name="certificateUrl", visibility=["read", "create", "update", "delete", "query"])
    """Keyvault certificate URL in
     `https://keyvaultname.vault.azure.net/certificates/certificateName/certificateVersion
     <https://keyvaultname.vault.azure.net/certificates/certificateName/certificateVersion>`_
     format. Required."""
    identity: Optional["_models.CustomJwtAuthenticationManagedIdentity"] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """The identity that will be used to access the certificate."""

    @overload
    def __init__(
        self,
        *,
        certificate_url: str,
        identity: Optional["_models.CustomJwtAuthenticationManagedIdentity"] = 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 JsonField(_Model):
    """This is used to express the source of an input schema mapping for a single target field in the
    Event Grid Event schema. This is currently used in the mappings for the 'id', 'topic' and
    'eventtime' properties. This represents a field in the input event schema.

    :ivar source_field: Name of a field in the input event schema that's to be used as the source
     of a mapping.
    :vartype source_field: str
    """

    source_field: Optional[str] = rest_field(
        name="sourceField", visibility=["read", "create", "update", "delete", "query"]
    )
    """Name of a field in the input event schema that's to be used as the source of a mapping."""

    @overload
    def __init__(
        self,
        *,
        source_field: 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 JsonFieldWithDefault(_Model):
    """This is used to express the source of an input schema mapping for a single target field in the
    Event Grid Event schema. This is currently used in the mappings for the 'subject', 'eventtype'
    and 'dataversion' properties. This represents a field in the input event schema along with a
    default value to be used, and at least one of these two properties should be provided.

    :ivar source_field: Name of a field in the input event schema that's to be used as the source
     of a mapping.
    :vartype source_field: str
    :ivar default_value: The default value to be used for mapping when a SourceField is not
     provided or if there's no property with the specified name in the published JSON event payload.
    :vartype default_value: str
    """

    source_field: Optional[str] = rest_field(
        name="sourceField", visibility=["read", "create", "update", "delete", "query"]
    )
    """Name of a field in the input event schema that's to be used as the source of a mapping."""
    default_value: Optional[str] = rest_field(
        name="defaultValue", visibility=["read", "create", "update", "delete", "query"]
    )
    """The default value to be used for mapping when a SourceField is not provided or if there's no
     property with the specified name in the published JSON event payload."""

    @overload
    def __init__(
        self,
        *,
        source_field: Optional[str] = None,
        default_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 JsonInputSchemaMapping(InputSchemaMapping, discriminator="Json"):
    """This enables publishing to Event Grid using a custom input schema. This can be used to map
    properties from a custom input JSON schema to the Event Grid event schema.

    :ivar properties: JSON Properties of the input schema mapping.
    :vartype properties: ~azure.mgmt.eventgrid.models.JsonInputSchemaMappingProperties
    :ivar input_schema_mapping_type: Type of the custom mapping. Required. Json.
    :vartype input_schema_mapping_type: str or ~azure.mgmt.eventgrid.models.JSON
    """

    properties: Optional["_models.JsonInputSchemaMappingProperties"] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """JSON Properties of the input schema mapping."""
    input_schema_mapping_type: Literal[InputSchemaMappingType.JSON] = rest_discriminator(name="inputSchemaMappingType", visibility=["read", "create", "update", "delete", "query"])  # type: ignore
    """Type of the custom mapping. Required. Json."""

    __flattened_items = ["id", "topic", "event_time", "event_type", "subject", "data_version"]

    @overload
    def __init__(
        self,
        *,
        properties: Optional["_models.JsonInputSchemaMappingProperties"] = 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:
        _flattened_input = {k: kwargs.pop(k) for k in kwargs.keys() & self.__flattened_items}
        super().__init__(*args, **kwargs)
        for k, v in _flattened_input.items():
            setattr(self, k, v)

    def __getattr__(self, name: str) -> Any:
        if name in self.__flattened_items:
            if self.properties is None:
                return None
            return getattr(self.properties, name)
        raise AttributeError(f"'{self.__class__.__name__}' object has no attribute '{name}'")

    def __setattr__(self, key: str, value: Any) -> None:
        if key in self.__flattened_items:
            if self.properties is None:
                self.properties = self._attr_to_rest_field["properties"]._class_type()
            setattr(self.properties, key, value)
        else:
            super().__setattr__(key, value)


class JsonInputSchemaMappingProperties(_Model):
    """This can be used to map properties of a source schema (or default values, for certain supported
    properties) to properties of the EventGridEvent schema.

    :ivar id: The mapping information for the Id property of the Event Grid Event.
    :vartype id: ~azure.mgmt.eventgrid.models.JsonField
    :ivar topic: The mapping information for the Topic property of the Event Grid Event.
    :vartype topic: ~azure.mgmt.eventgrid.models.JsonField
    :ivar event_time: The mapping information for the EventTime property of the Event Grid Event.
    :vartype event_time: ~azure.mgmt.eventgrid.models.JsonField
    :ivar event_type: The mapping information for the EventType property of the Event Grid Event.
    :vartype event_type: ~azure.mgmt.eventgrid.models.JsonFieldWithDefault
    :ivar subject: The mapping information for the Subject property of the Event Grid Event.
    :vartype subject: ~azure.mgmt.eventgrid.models.JsonFieldWithDefault
    :ivar data_version: The mapping information for the DataVersion property of the Event Grid
     Event.
    :vartype data_version: ~azure.mgmt.eventgrid.models.JsonFieldWithDefault
    """

    id: Optional["_models.JsonField"] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """The mapping information for the Id property of the Event Grid Event."""
    topic: Optional["_models.JsonField"] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """The mapping information for the Topic property of the Event Grid Event."""
    event_time: Optional["_models.JsonField"] = rest_field(
        name="eventTime", visibility=["read", "create", "update", "delete", "query"]
    )
    """The mapping information for the EventTime property of the Event Grid Event."""
    event_type: Optional["_models.JsonFieldWithDefault"] = rest_field(
        name="eventType", visibility=["read", "create", "update", "delete", "query"]
    )
    """The mapping information for the EventType property of the Event Grid Event."""
    subject: Optional["_models.JsonFieldWithDefault"] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """The mapping information for the Subject property of the Event Grid Event."""
    data_version: Optional["_models.JsonFieldWithDefault"] = rest_field(
        name="dataVersion", visibility=["read", "create", "update", "delete", "query"]
    )
    """The mapping information for the DataVersion property of the Event Grid Event."""

    @overload
    def __init__(
        self,
        *,
        id: Optional["_models.JsonField"] = None,  # pylint: disable=redefined-builtin
        topic: Optional["_models.JsonField"] = None,
        event_time: Optional["_models.JsonField"] = None,
        event_type: Optional["_models.JsonFieldWithDefault"] = None,
        subject: Optional["_models.JsonFieldWithDefault"] = None,
        data_version: Optional["_models.JsonFieldWithDefault"] = 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 KeyEncryption(_Model):
    """Properties of the Encryption settings.

    :ivar customer_managed_key_encryption: List of all customer-managed key encryption properties
     for the resource. However only one key is supported at a time. Required.
    :vartype customer_managed_key_encryption:
     list[~azure.mgmt.eventgrid.models.CustomerManagedKeyEncryption]
    """

    customer_managed_key_encryption: list["_models.CustomerManagedKeyEncryption"] = rest_field(
        name="customerManagedKeyEncryption", visibility=["read", "create", "update", "delete", "query"]
    )
    """List of all customer-managed key encryption properties for the resource. However only one key
     is supported at a time. Required."""

    @overload
    def __init__(
        self,
        *,
        customer_managed_key_encryption: list["_models.CustomerManagedKeyEncryption"],
    ) -> 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 KeyEncryptionKeyIdentity(_Model):
    """KeyEncryptionKeyIdentity.

    :ivar type: The type of managed identity used. Only UserAssigned or SystemAssigned Identity are
     supported. Required. Known values are: "SystemAssigned" and "UserAssigned".
    :vartype type: str or ~azure.mgmt.eventgrid.models.KeyEncryptionIdentityType
    :ivar user_assigned_identity_resource_id: Azure Resource fully qualified Id for the
     user-assigned identity associated with the resource. The resource Id takes the following
     format:
     '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'.
    :vartype user_assigned_identity_resource_id: str
    """

    type: Union[str, "_models.KeyEncryptionIdentityType"] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """The type of managed identity used. Only UserAssigned or SystemAssigned Identity are supported.
     Required. Known values are: \"SystemAssigned\" and \"UserAssigned\"."""
    user_assigned_identity_resource_id: Optional[str] = rest_field(
        name="userAssignedIdentityResourceId", visibility=["read", "create", "update", "delete", "query"]
    )
    """Azure Resource fully qualified Id for the user-assigned identity associated with the resource.
     The resource Id takes the following format:
     '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'."""

    @overload
    def __init__(
        self,
        *,
        type: Union[str, "_models.KeyEncryptionIdentityType"],
        user_assigned_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 MonitorAlertEventSubscriptionDestination(EventSubscriptionDestination, discriminator="MonitorAlert"):
    """Information about the Monitor Alert destination for an event subscription.

    :ivar properties: Monitor Alert properties of the event subscription destination.
    :vartype properties:
     ~azure.mgmt.eventgrid.models.MonitorAlertEventSubscriptionDestinationProperties
    :ivar endpoint_type: Type of the endpoint for the event subscription destination. Required.
     MonitorAlert.
    :vartype endpoint_type: str or ~azure.mgmt.eventgrid.models.MONITOR_ALERT
    """

    properties: Optional["_models.MonitorAlertEventSubscriptionDestinationProperties"] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """Monitor Alert properties of the event subscription destination."""
    endpoint_type: Literal[EndpointType.MONITOR_ALERT] = rest_discriminator(name="endpointType", visibility=["read", "create", "update", "delete", "query"])  # type: ignore
    """Type of the endpoint for the event subscription destination. Required. MonitorAlert."""

    __flattened_items = ["severity", "description", "action_groups"]

    @overload
    def __init__(
        self,
        *,
        properties: Optional["_models.MonitorAlertEventSubscriptionDestinationProperties"] = 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:
        _flattened_input = {k: kwargs.pop(k) for k in kwargs.keys() & self.__flattened_items}
        super().__init__(*args, **kwargs)
        for k, v in _flattened_input.items():
            setattr(self, k, v)

    def __getattr__(self, name: str) -> Any:
        if name in self.__flattened_items:
            if self.properties is None:
                return None
            return getattr(self.properties, name)
        raise AttributeError(f"'{self.__class__.__name__}' object has no attribute '{name}'")

    def __setattr__(self, key: str, value: Any) -> None:
        if key in self.__flattened_items:
            if self.properties is None:
                self.properties = self._attr_to_rest_field["properties"]._class_type()
            setattr(self.properties, key, value)
        else:
            super().__setattr__(key, value)


class MonitorAlertEventSubscriptionDestinationProperties(_Model):  # pylint: disable=name-too-long
    """The properties that represent the Monitor Alert destination of an event subscription.

    :ivar severity: The severity that will be attached to every Alert fired through this event
     subscription. This field must be provided. Known values are: "Sev0", "Sev1", "Sev2", "Sev3",
     and "Sev4".
    :vartype severity: str or ~azure.mgmt.eventgrid.models.MonitorAlertSeverity
    :ivar description: The description that will be attached to every Alert fired through this
     event subscription.
    :vartype description: str
    :ivar action_groups: The list of ARM Ids of Action Groups that will be triggered on every Alert
     fired through this event subscription. Each resource ARM Id should follow this pattern:
     /subscriptions/{AzureSubscriptionId}/resourceGroups/{ResourceGroupName}/providers/Microsoft.Insights/actionGroups/{ActionGroupName}.
    :vartype action_groups: list[str]
    """

    severity: Optional[Union[str, "_models.MonitorAlertSeverity"]] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """The severity that will be attached to every Alert fired through this event subscription. This
     field must be provided. Known values are: \"Sev0\", \"Sev1\", \"Sev2\", \"Sev3\", and \"Sev4\"."""
    description: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """The description that will be attached to every Alert fired through this event subscription."""
    action_groups: Optional[list[str]] = rest_field(
        name="actionGroups", visibility=["read", "create", "update", "delete", "query"]
    )
    """The list of ARM Ids of Action Groups that will be triggered on every Alert fired through this
     event subscription. Each resource ARM Id should follow this pattern:
     /subscriptions/{AzureSubscriptionId}/resourceGroups/{ResourceGroupName}/providers/Microsoft.Insights/actionGroups/{ActionGroupName}."""

    @overload
    def __init__(
        self,
        *,
        severity: Optional[Union[str, "_models.MonitorAlertSeverity"]] = None,
        description: Optional[str] = None,
        action_groups: 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 Namespace(TrackedResource):
    """Namespace 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.eventgrid.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: Properties of the Namespace resource.
    :vartype properties: ~azure.mgmt.eventgrid.models.NamespaceProperties
    :ivar sku: Represents available Sku pricing tiers.
    :vartype sku: ~azure.mgmt.eventgrid.models.NamespaceSku
    :ivar identity: Identity information for the Namespace resource.
    :vartype identity: ~azure.mgmt.eventgrid.models.IdentityInfo
    """

    properties: Optional["_models.NamespaceProperties"] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """Properties of the Namespace resource."""
    sku: Optional["_models.NamespaceSku"] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """Represents available Sku pricing tiers."""
    identity: Optional["_models.IdentityInfo"] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """Identity information for the Namespace resource."""

    __flattened_items = [
        "private_endpoint_connections",
        "provisioning_state",
        "topics_configuration",
        "topic_spaces_configuration",
        "is_zone_redundant",
        "public_network_access",
        "inbound_ip_rules",
        "minimum_tls_version_allowed",
    ]

    @overload
    def __init__(
        self,
        *,
        location: str,
        tags: Optional[dict[str, str]] = None,
        properties: Optional["_models.NamespaceProperties"] = None,
        sku: Optional["_models.NamespaceSku"] = None,
        identity: Optional["_models.IdentityInfo"] = 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:
        _flattened_input = {k: kwargs.pop(k) for k in kwargs.keys() & self.__flattened_items}
        super().__init__(*args, **kwargs)
        for k, v in _flattened_input.items():
            setattr(self, k, v)

    def __getattr__(self, name: str) -> Any:
        if name in self.__flattened_items:
            if self.properties is None:
                return None
            return getattr(self.properties, name)
        raise AttributeError(f"'{self.__class__.__name__}' object has no attribute '{name}'")

    def __setattr__(self, key: str, value: Any) -> None:
        if key in self.__flattened_items:
            if self.properties is None:
                self.properties = self._attr_to_rest_field["properties"]._class_type()
            setattr(self.properties, key, value)
        else:
            super().__setattr__(key, value)


class NamespaceProperties(_Model):
    """Properties of the namespace resource.

    :ivar private_endpoint_connections: List of private endpoint connections.
    :vartype private_endpoint_connections:
     list[~azure.mgmt.eventgrid.models.PrivateEndpointConnection]
    :ivar provisioning_state: Provisioning state of the namespace resource. Known values are:
     "Creating", "Updating", "Deleting", "Succeeded", "Canceled", "Failed", "Deleted",
     "DeleteFailed", "CreateFailed", and "UpdatedFailed".
    :vartype provisioning_state: str or ~azure.mgmt.eventgrid.models.NamespaceProvisioningState
    :ivar topics_configuration: Topics configuration information for the namespace resource.
    :vartype topics_configuration: ~azure.mgmt.eventgrid.models.TopicsConfiguration
    :ivar topic_spaces_configuration: Topic spaces configuration information for the namespace
     resource.
    :vartype topic_spaces_configuration: ~azure.mgmt.eventgrid.models.TopicSpacesConfiguration
    :ivar is_zone_redundant: This is an optional property and it allows the user to specify if the
     namespace resource supports zone-redundancy capability or not. If this property is not
     specified explicitly by the user, its default value depends on the following conditions: a. For
     Availability Zones enabled regions - The default property value would be true. b. For
     non-Availability Zones enabled regions - The default property value would be false. Once
     specified, this property cannot be updated.
    :vartype is_zone_redundant: bool
    :ivar public_network_access: This determines if traffic is allowed over public network. By
     default it is enabled. You can further restrict to specific IPs by configuring <seealso
     cref="P:Microsoft.Azure.Events.ResourceProvider.Common.Contracts.PubSub.NamespaceProperties.InboundIpRules"
     />. Known values are: "Enabled", "Disabled", and "SecuredByPerimeter".
    :vartype public_network_access: str or ~azure.mgmt.eventgrid.models.PublicNetworkAccess
    :ivar inbound_ip_rules: This can be used to restrict traffic from specific IPs instead of all
     IPs. Note: These are considered only if PublicNetworkAccess is enabled.
    :vartype inbound_ip_rules: list[~azure.mgmt.eventgrid.models.InboundIpRule]
    :ivar minimum_tls_version_allowed: Minimum TLS version of the publisher allowed to publish to
     this namespace. Only TLS version 1.2 is supported. Known values are: "1.0", "1.1", and "1.2".
    :vartype minimum_tls_version_allowed: str or ~azure.mgmt.eventgrid.models.TlsVersion
    """

    private_endpoint_connections: Optional[list["_models.PrivateEndpointConnection"]] = rest_field(
        name="privateEndpointConnections", visibility=["read", "create", "update", "delete", "query"]
    )
    """List of private endpoint connections."""
    provisioning_state: Optional[Union[str, "_models.NamespaceProvisioningState"]] = rest_field(
        name="provisioningState", visibility=["read"]
    )
    """Provisioning state of the namespace resource. Known values are: \"Creating\", \"Updating\",
     \"Deleting\", \"Succeeded\", \"Canceled\", \"Failed\", \"Deleted\", \"DeleteFailed\",
     \"CreateFailed\", and \"UpdatedFailed\"."""
    topics_configuration: Optional["_models.TopicsConfiguration"] = rest_field(
        name="topicsConfiguration", visibility=["read", "create", "update", "delete", "query"]
    )
    """Topics configuration information for the namespace resource."""
    topic_spaces_configuration: Optional["_models.TopicSpacesConfiguration"] = rest_field(
        name="topicSpacesConfiguration", visibility=["read", "create", "update", "delete", "query"]
    )
    """Topic spaces configuration information for the namespace resource."""
    is_zone_redundant: Optional[bool] = rest_field(
        name="isZoneRedundant", visibility=["read", "create", "update", "delete", "query"]
    )
    """This is an optional property and it allows the user to specify if the namespace resource
     supports zone-redundancy capability or not. If this property is not specified explicitly by the
     user, its default value depends on the following conditions: a. For Availability Zones enabled
     regions - The default property value would be true. b. For non-Availability Zones enabled
     regions - The default property value would be false. Once specified, this property cannot be
     updated."""
    public_network_access: Optional[Union[str, "_models.PublicNetworkAccess"]] = rest_field(
        name="publicNetworkAccess", visibility=["read", "create", "update", "delete", "query"]
    )
    """This determines if traffic is allowed over public network. By default it is enabled. You can
     further restrict to specific IPs by configuring <seealso
     cref=\"P:Microsoft.Azure.Events.ResourceProvider.Common.Contracts.PubSub.NamespaceProperties.InboundIpRules\"
     />. Known values are: \"Enabled\", \"Disabled\", and \"SecuredByPerimeter\"."""
    inbound_ip_rules: Optional[list["_models.InboundIpRule"]] = rest_field(
        name="inboundIpRules", visibility=["read", "create", "update", "delete", "query"]
    )
    """This can be used to restrict traffic from specific IPs instead of all IPs. Note: These are
     considered only if PublicNetworkAccess is enabled."""
    minimum_tls_version_allowed: Optional[Union[str, "_models.TlsVersion"]] = rest_field(
        name="minimumTlsVersionAllowed", visibility=["read", "create", "update", "delete", "query"]
    )
    """Minimum TLS version of the publisher allowed to publish to this namespace. Only TLS version 1.2
     is supported. Known values are: \"1.0\", \"1.1\", and \"1.2\"."""

    @overload
    def __init__(
        self,
        *,
        private_endpoint_connections: Optional[list["_models.PrivateEndpointConnection"]] = None,
        topics_configuration: Optional["_models.TopicsConfiguration"] = None,
        topic_spaces_configuration: Optional["_models.TopicSpacesConfiguration"] = None,
        is_zone_redundant: Optional[bool] = None,
        public_network_access: Optional[Union[str, "_models.PublicNetworkAccess"]] = None,
        inbound_ip_rules: Optional[list["_models.InboundIpRule"]] = None,
        minimum_tls_version_allowed: Optional[Union[str, "_models.TlsVersion"]] = 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 NamespaceRegenerateKeyRequest(_Model):
    """Namespace regenerate share access key request.

    :ivar key_name: Key name to regenerate key1 or key2. Required.
    :vartype key_name: str
    """

    key_name: str = rest_field(name="keyName", visibility=["read", "create", "update", "delete", "query"])
    """Key name to regenerate key1 or key2. Required."""

    @overload
    def __init__(
        self,
        *,
        key_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 NamespaceSharedAccessKeys(_Model):
    """Shared access keys of the Namespace.

    :ivar key1: Shared access key1 for the namespace.
    :vartype key1: str
    :ivar key2: Shared access key2 for the namespace.
    :vartype key2: str
    """

    key1: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """Shared access key1 for the namespace."""
    key2: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """Shared access key2 for the namespace."""

    @overload
    def __init__(
        self,
        *,
        key1: Optional[str] = None,
        key2: 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 NamespaceSku(_Model):
    """Represents available Sku pricing tiers.

    :ivar name: The name of the SKU. "Standard"
    :vartype name: str or ~azure.mgmt.eventgrid.models.SkuName
    :ivar capacity: Specifies the number of Throughput Units that defines the capacity for the
     namespace. The property default value is 1 which signifies 1 Throughput Unit = 1MB/s ingress
     and 2MB/s egress per namespace. Min capacity is 1 and max allowed capacity is 20.
    :vartype capacity: int
    """

    name: Optional[Union[str, "_models.SkuName"]] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """The name of the SKU. \"Standard\""""
    capacity: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """Specifies the number of Throughput Units that defines the capacity for the namespace. The
     property default value is 1 which signifies 1 Throughput Unit = 1MB/s ingress and 2MB/s egress
     per namespace. Min capacity is 1 and max allowed capacity is 20."""

    @overload
    def __init__(
        self,
        *,
        name: Optional[Union[str, "_models.SkuName"]] = None,
        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 NamespaceTopic(ProxyResource):
    """Namespace topic details.

    :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.eventgrid.models.SystemData
    :ivar properties: Properties of the namespace topic.
    :vartype properties: ~azure.mgmt.eventgrid.models.NamespaceTopicProperties
    """

    properties: Optional["_models.NamespaceTopicProperties"] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """Properties of the namespace topic."""

    __flattened_items = ["provisioning_state", "publisher_type", "input_schema", "event_retention_in_days"]

    @overload
    def __init__(
        self,
        *,
        properties: Optional["_models.NamespaceTopicProperties"] = 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:
        _flattened_input = {k: kwargs.pop(k) for k in kwargs.keys() & self.__flattened_items}
        super().__init__(*args, **kwargs)
        for k, v in _flattened_input.items():
            setattr(self, k, v)

    def __getattr__(self, name: str) -> Any:
        if name in self.__flattened_items:
            if self.properties is None:
                return None
            return getattr(self.properties, name)
        raise AttributeError(f"'{self.__class__.__name__}' object has no attribute '{name}'")

    def __setattr__(self, key: str, value: Any) -> None:
        if key in self.__flattened_items:
            if self.properties is None:
                self.properties = self._attr_to_rest_field["properties"]._class_type()
            setattr(self.properties, key, value)
        else:
            super().__setattr__(key, value)


class NamespaceTopicEventSubscriptionDestination(
    EventSubscriptionDestination, discriminator="NamespaceTopic"
):  # pylint: disable=name-too-long
    """Information about the Namespace Topic destination for an event subscription.

    :ivar properties: Namespace Topic properties of the event subscription destination.
    :vartype properties:
     ~azure.mgmt.eventgrid.models.NamespaceTopicEventSubscriptionDestinationProperties
    :ivar endpoint_type: Type of the endpoint for the event subscription destination. Required.
     NamespaceTopic.
    :vartype endpoint_type: str or ~azure.mgmt.eventgrid.models.NAMESPACE_TOPIC
    """

    properties: Optional["_models.NamespaceTopicEventSubscriptionDestinationProperties"] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """Namespace Topic properties of the event subscription destination."""
    endpoint_type: Literal[EndpointType.NAMESPACE_TOPIC] = rest_discriminator(name="endpointType", visibility=["read", "create", "update", "delete", "query"])  # type: ignore
    """Type of the endpoint for the event subscription destination. Required. NamespaceTopic."""

    __flattened_items = ["resource_id"]

    @overload
    def __init__(
        self,
        *,
        properties: Optional["_models.NamespaceTopicEventSubscriptionDestinationProperties"] = 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:
        _flattened_input = {k: kwargs.pop(k) for k in kwargs.keys() & self.__flattened_items}
        super().__init__(*args, **kwargs)
        for k, v in _flattened_input.items():
            setattr(self, k, v)

    def __getattr__(self, name: str) -> Any:
        if name in self.__flattened_items:
            if self.properties is None:
                return None
            return getattr(self.properties, name)
        raise AttributeError(f"'{self.__class__.__name__}' object has no attribute '{name}'")

    def __setattr__(self, key: str, value: Any) -> None:
        if key in self.__flattened_items:
            if self.properties is None:
                self.properties = self._attr_to_rest_field["properties"]._class_type()
            setattr(self.properties, key, value)
        else:
            super().__setattr__(key, value)


class NamespaceTopicEventSubscriptionDestinationProperties(_Model):  # pylint: disable=name-too-long
    """The properties that represent the Event Grid Namespace Topic destination of an event
    subscription.

    :ivar resource_id: The Azure resource Id that represents the endpoint of the Event Grid
     Namespace Topic destination of an event subscription. This field is required and the Namespace
     Topic resource listed must already exist. The resource ARM Id should follow this pattern:
     /subscriptions/{AzureSubscriptionId}/resourceGroups/{ResourceGroupName}/providers/Microsoft.EventGrid/namespaces/{NamespaceName}/topics/{TopicName}.
    :vartype resource_id: str
    """

    resource_id: Optional[str] = rest_field(
        name="resourceId", visibility=["read", "create", "update", "delete", "query"]
    )
    """The Azure resource Id that represents the endpoint of the Event Grid Namespace Topic
     destination of an event subscription. This field is required and the Namespace Topic resource
     listed must already exist. The resource ARM Id should follow this pattern:
     /subscriptions/{AzureSubscriptionId}/resourceGroups/{ResourceGroupName}/providers/Microsoft.EventGrid/namespaces/{NamespaceName}/topics/{TopicName}."""

    @overload
    def __init__(
        self,
        *,
        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 NamespaceTopicProperties(_Model):
    """Properties of the namespace topic.

    :ivar provisioning_state: Provisioning state of the namespace topic. Known values are:
     "Creating", "Updating", "Deleting", "Succeeded", "Canceled", "Failed", "Deleted",
     "DeleteFailed", "CreateFailed", and "UpdatedFailed".
    :vartype provisioning_state: str or
     ~azure.mgmt.eventgrid.models.NamespaceTopicProvisioningState
    :ivar publisher_type: Publisher type of the namespace topic. "Custom"
    :vartype publisher_type: str or ~azure.mgmt.eventgrid.models.PublisherType
    :ivar input_schema: This determines the format that is expected for incoming events published
     to the topic. "CloudEventSchemaV1_0"
    :vartype input_schema: str or ~azure.mgmt.eventgrid.models.EventInputSchema
    :ivar event_retention_in_days: Event retention for the namespace topic expressed in days. The
     property default value is 1 day. Min event retention duration value is 1 day and max event
     retention duration value is 1 day.
    :vartype event_retention_in_days: int
    """

    provisioning_state: Optional[Union[str, "_models.NamespaceTopicProvisioningState"]] = rest_field(
        name="provisioningState", visibility=["read"]
    )
    """Provisioning state of the namespace topic. Known values are: \"Creating\", \"Updating\",
     \"Deleting\", \"Succeeded\", \"Canceled\", \"Failed\", \"Deleted\", \"DeleteFailed\",
     \"CreateFailed\", and \"UpdatedFailed\"."""
    publisher_type: Optional[Union[str, "_models.PublisherType"]] = rest_field(
        name="publisherType", visibility=["read", "create", "update", "delete", "query"]
    )
    """Publisher type of the namespace topic. \"Custom\""""
    input_schema: Optional[Union[str, "_models.EventInputSchema"]] = rest_field(
        name="inputSchema", visibility=["read", "create", "update", "delete", "query"]
    )
    """This determines the format that is expected for incoming events published to the topic.
     \"CloudEventSchemaV1_0\""""
    event_retention_in_days: Optional[int] = rest_field(
        name="eventRetentionInDays", visibility=["read", "create", "update", "delete", "query"]
    )
    """Event retention for the namespace topic expressed in days. The property default value is 1 day.
     Min event retention duration value is 1 day and max event retention duration value is 1 day."""

    @overload
    def __init__(
        self,
        *,
        publisher_type: Optional[Union[str, "_models.PublisherType"]] = None,
        input_schema: Optional[Union[str, "_models.EventInputSchema"]] = None,
        event_retention_in_days: 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 NamespaceTopicUpdateParameterProperties(_Model):
    """Information of namespace topic update parameter properties.

    :ivar event_retention_in_days: Event retention for the namespace topic expressed in days. The
     property default value is 1 day. Min event retention duration value is 1 day and max event
     retention duration value is 1 day.
    :vartype event_retention_in_days: int
    """

    event_retention_in_days: Optional[int] = rest_field(
        name="eventRetentionInDays", visibility=["read", "create", "update", "delete", "query"]
    )
    """Event retention for the namespace topic expressed in days. The property default value is 1 day.
     Min event retention duration value is 1 day and max event retention duration value is 1 day."""

    @overload
    def __init__(
        self,
        *,
        event_retention_in_days: 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 NamespaceTopicUpdateParameters(_Model):
    """Properties of the namespace topic update.

    :ivar properties: Properties of the namespace topic resource.
    :vartype properties: ~azure.mgmt.eventgrid.models.NamespaceTopicUpdateParameterProperties
    """

    properties: Optional["_models.NamespaceTopicUpdateParameterProperties"] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """Properties of the namespace topic resource."""

    __flattened_items = ["event_retention_in_days"]

    @overload
    def __init__(
        self,
        *,
        properties: Optional["_models.NamespaceTopicUpdateParameterProperties"] = 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:
        _flattened_input = {k: kwargs.pop(k) for k in kwargs.keys() & self.__flattened_items}
        super().__init__(*args, **kwargs)
        for k, v in _flattened_input.items():
            setattr(self, k, v)

    def __getattr__(self, name: str) -> Any:
        if name in self.__flattened_items:
            if self.properties is None:
                return None
            return getattr(self.properties, name)
        raise AttributeError(f"'{self.__class__.__name__}' object has no attribute '{name}'")

    def __setattr__(self, key: str, value: Any) -> None:
        if key in self.__flattened_items:
            if self.properties is None:
                self.properties = self._attr_to_rest_field["properties"]._class_type()
            setattr(self.properties, key, value)
        else:
            super().__setattr__(key, value)


class NamespaceUpdateParameterProperties(_Model):
    """Information of namespace update parameter properties.

    :ivar topic_spaces_configuration: Topic spaces configuration properties that can be updated.
    :vartype topic_spaces_configuration:
     ~azure.mgmt.eventgrid.models.UpdateTopicSpacesConfigurationInfo
    :ivar topics_configuration: Topics configuration properties that can be updated.
    :vartype topics_configuration: ~azure.mgmt.eventgrid.models.UpdateTopicsConfigurationInfo
    :ivar public_network_access: This determines if traffic is allowed over public network. By
     default it is enabled. You can further restrict to specific IPs by configuring <seealso
     cref="P:Microsoft.Azure.Events.ResourceProvider.Common.Contracts.PubSub.NamespaceUpdateParameterProperties.InboundIpRules"
     />. Known values are: "Enabled", "Disabled", and "SecuredByPerimeter".
    :vartype public_network_access: str or ~azure.mgmt.eventgrid.models.PublicNetworkAccess
    :ivar inbound_ip_rules: This can be used to restrict traffic from specific IPs instead of all
     IPs. Note: These are considered only if PublicNetworkAccess is enabled.
    :vartype inbound_ip_rules: list[~azure.mgmt.eventgrid.models.InboundIpRule]
    """

    topic_spaces_configuration: Optional["_models.UpdateTopicSpacesConfigurationInfo"] = rest_field(
        name="topicSpacesConfiguration", visibility=["read", "create", "update", "delete", "query"]
    )
    """Topic spaces configuration properties that can be updated."""
    topics_configuration: Optional["_models.UpdateTopicsConfigurationInfo"] = rest_field(
        name="topicsConfiguration", visibility=["read", "create", "update", "delete", "query"]
    )
    """Topics configuration properties that can be updated."""
    public_network_access: Optional[Union[str, "_models.PublicNetworkAccess"]] = rest_field(
        name="publicNetworkAccess", visibility=["read", "create", "update", "delete", "query"]
    )
    """This determines if traffic is allowed over public network. By default it is enabled. You can
     further restrict to specific IPs by configuring <seealso
     cref=\"P:Microsoft.Azure.Events.ResourceProvider.Common.Contracts.PubSub.NamespaceUpdateParameterProperties.InboundIpRules\"
     />. Known values are: \"Enabled\", \"Disabled\", and \"SecuredByPerimeter\"."""
    inbound_ip_rules: Optional[list["_models.InboundIpRule"]] = rest_field(
        name="inboundIpRules", visibility=["read", "create", "update", "delete", "query"]
    )
    """This can be used to restrict traffic from specific IPs instead of all IPs. Note: These are
     considered only if PublicNetworkAccess is enabled."""

    @overload
    def __init__(
        self,
        *,
        topic_spaces_configuration: Optional["_models.UpdateTopicSpacesConfigurationInfo"] = None,
        topics_configuration: Optional["_models.UpdateTopicsConfigurationInfo"] = None,
        public_network_access: Optional[Union[str, "_models.PublicNetworkAccess"]] = None,
        inbound_ip_rules: Optional[list["_models.InboundIpRule"]] = 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 NamespaceUpdateParameters(_Model):
    """Properties to update namespace.

    :ivar tags: Tags of the namespace resource.
    :vartype tags: dict[str, str]
    :ivar identity: Namespace resource identity information.
    :vartype identity: ~azure.mgmt.eventgrid.models.IdentityInfo
    :ivar sku: Represents available Sku pricing tiers.
    :vartype sku: ~azure.mgmt.eventgrid.models.NamespaceSku
    :ivar properties: Properties of the namespace resource.
    :vartype properties: ~azure.mgmt.eventgrid.models.NamespaceUpdateParameterProperties
    """

    tags: Optional[dict[str, str]] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """Tags of the namespace resource."""
    identity: Optional["_models.IdentityInfo"] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """Namespace resource identity information."""
    sku: Optional["_models.NamespaceSku"] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """Represents available Sku pricing tiers."""
    properties: Optional["_models.NamespaceUpdateParameterProperties"] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """Properties of the namespace resource."""

    __flattened_items = [
        "topic_spaces_configuration",
        "topics_configuration",
        "public_network_access",
        "inbound_ip_rules",
    ]

    @overload
    def __init__(
        self,
        *,
        tags: Optional[dict[str, str]] = None,
        identity: Optional["_models.IdentityInfo"] = None,
        sku: Optional["_models.NamespaceSku"] = None,
        properties: Optional["_models.NamespaceUpdateParameterProperties"] = 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:
        _flattened_input = {k: kwargs.pop(k) for k in kwargs.keys() & self.__flattened_items}
        super().__init__(*args, **kwargs)
        for k, v in _flattened_input.items():
            setattr(self, k, v)

    def __getattr__(self, name: str) -> Any:
        if name in self.__flattened_items:
            if self.properties is None:
                return None
            return getattr(self.properties, name)
        raise AttributeError(f"'{self.__class__.__name__}' object has no attribute '{name}'")

    def __setattr__(self, key: str, value: Any) -> None:
        if key in self.__flattened_items:
            if self.properties is None:
                self.properties = self._attr_to_rest_field["properties"]._class_type()
            setattr(self.properties, key, value)
        else:
            super().__setattr__(key, value)


class NetworkSecurityPerimeterConfiguration(ProxyResource):
    """Network security perimeter configuration.

    :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.eventgrid.models.SystemData
    :ivar properties: Properties of the network security perimeter configuration.
    :vartype properties:
     ~azure.mgmt.eventgrid.models.NetworkSecurityPerimeterConfigurationProperties
    """

    properties: Optional["_models.NetworkSecurityPerimeterConfigurationProperties"] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """Properties of the network security perimeter configuration."""

    __flattened_items = [
        "provisioning_state",
        "provisioning_issues",
        "network_security_perimeter",
        "resource_association",
        "profile",
    ]

    @overload
    def __init__(
        self,
        *,
        properties: Optional["_models.NetworkSecurityPerimeterConfigurationProperties"] = 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:
        _flattened_input = {k: kwargs.pop(k) for k in kwargs.keys() & self.__flattened_items}
        super().__init__(*args, **kwargs)
        for k, v in _flattened_input.items():
            setattr(self, k, v)

    def __getattr__(self, name: str) -> Any:
        if name in self.__flattened_items:
            if self.properties is None:
                return None
            return getattr(self.properties, name)
        raise AttributeError(f"'{self.__class__.__name__}' object has no attribute '{name}'")

    def __setattr__(self, key: str, value: Any) -> None:
        if key in self.__flattened_items:
            if self.properties is None:
                self.properties = self._attr_to_rest_field["properties"]._class_type()
            setattr(self.properties, key, value)
        else:
            super().__setattr__(key, value)


class NetworkSecurityPerimeterConfigurationIssues(_Model):  # pylint: disable=name-too-long
    """Network security perimeter configuration issues.

    :ivar name: Provisioning issue name.
    :vartype name: str
    :ivar properties: Provisioning issue properties.
    :vartype properties:
     ~azure.mgmt.eventgrid.models.NetworkSecurityPerimeterConfigurationIssuesProperties
    """

    name: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """Provisioning issue name."""
    properties: Optional["_models.NetworkSecurityPerimeterConfigurationIssuesProperties"] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """Provisioning issue properties."""

    __flattened_items = ["issue_type", "severity", "description", "suggested_resource_ids", "suggested_access_rules"]

    @overload
    def __init__(
        self,
        *,
        name: Optional[str] = None,
        properties: Optional["_models.NetworkSecurityPerimeterConfigurationIssuesProperties"] = 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:
        _flattened_input = {k: kwargs.pop(k) for k in kwargs.keys() & self.__flattened_items}
        super().__init__(*args, **kwargs)
        for k, v in _flattened_input.items():
            setattr(self, k, v)

    def __getattr__(self, name: str) -> Any:
        if name in self.__flattened_items:
            if self.properties is None:
                return None
            return getattr(self.properties, name)
        raise AttributeError(f"'{self.__class__.__name__}' object has no attribute '{name}'")

    def __setattr__(self, key: str, value: Any) -> None:
        if key in self.__flattened_items:
            if self.properties is None:
                self.properties = self._attr_to_rest_field["properties"]._class_type()
            setattr(self.properties, key, value)
        else:
            super().__setattr__(key, value)


class NetworkSecurityPerimeterConfigurationIssuesProperties(_Model):  # pylint: disable=name-too-long
    """Network security perimeter configuration issues properties.

    :ivar issue_type: Provisioning issue type. Known values are: "MissingPerimeterConfiguration",
     "MissingIdentityConfiguration", "ConfigurationPropagationFailure", and "Other".
    :vartype issue_type: str or
     ~azure.mgmt.eventgrid.models.NetworkSecurityPerimeterConfigurationIssueType
    :ivar severity: Provisioning issue severity. Known values are: "Warning" and "Error".
    :vartype severity: str or
     ~azure.mgmt.eventgrid.models.NetworkSecurityPerimeterConfigurationIssueSeverity
    :ivar description: Provisioning issue description.
    :vartype description: str
    :ivar suggested_resource_ids: ARM IDs of resources that can be associated to the same perimeter
     to remediate the issue.
    :vartype suggested_resource_ids: list[str]
    :ivar suggested_access_rules: Access rules that can be added to the same profile to remediate
     the issue.
    :vartype suggested_access_rules: list[str]
    """

    issue_type: Optional[Union[str, "_models.NetworkSecurityPerimeterConfigurationIssueType"]] = rest_field(
        name="issueType", visibility=["read", "create", "update", "delete", "query"]
    )
    """Provisioning issue type. Known values are: \"MissingPerimeterConfiguration\",
     \"MissingIdentityConfiguration\", \"ConfigurationPropagationFailure\", and \"Other\"."""
    severity: Optional[Union[str, "_models.NetworkSecurityPerimeterConfigurationIssueSeverity"]] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """Provisioning issue severity. Known values are: \"Warning\" and \"Error\"."""
    description: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """Provisioning issue description."""
    suggested_resource_ids: Optional[list[str]] = rest_field(
        name="suggestedResourceIds", visibility=["read", "create", "update", "delete", "query"]
    )
    """ARM IDs of resources that can be associated to the same perimeter to remediate the issue."""
    suggested_access_rules: Optional[list[str]] = rest_field(
        name="suggestedAccessRules", visibility=["read", "create", "update", "delete", "query"]
    )
    """Access rules that can be added to the same profile to remediate the issue."""

    @overload
    def __init__(
        self,
        *,
        issue_type: Optional[Union[str, "_models.NetworkSecurityPerimeterConfigurationIssueType"]] = None,
        severity: Optional[Union[str, "_models.NetworkSecurityPerimeterConfigurationIssueSeverity"]] = None,
        description: Optional[str] = None,
        suggested_resource_ids: Optional[list[str]] = None,
        suggested_access_rules: 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 NetworkSecurityPerimeterConfigurationProfile(_Model):  # pylint: disable=name-too-long
    """Nsp configuration with profile information.

    :ivar name: Nsp configuration profile name.
    :vartype name: str
    :ivar access_rules_version: Access rules version number for nsp profile.
    :vartype access_rules_version: str
    :ivar access_rules: List of inbound or outbound access rule setup on the nsp profile.
    :vartype access_rules:
     list[~azure.mgmt.eventgrid.models.NetworkSecurityPerimeterProfileAccessRule]
    :ivar diagnostic_settings_version: Diagnostic settings version number for nsp profile.
    :vartype diagnostic_settings_version: str
    :ivar enabled_log_categories: Enabled log categories for nsp profile.
    :vartype enabled_log_categories: list[str]
    """

    name: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """Nsp configuration profile name."""
    access_rules_version: Optional[str] = rest_field(
        name="accessRulesVersion", visibility=["read", "create", "update", "delete", "query"]
    )
    """Access rules version number for nsp profile."""
    access_rules: Optional[list["_models.NetworkSecurityPerimeterProfileAccessRule"]] = rest_field(
        name="accessRules", visibility=["read", "create", "update", "delete", "query"]
    )
    """List of inbound or outbound access rule setup on the nsp profile."""
    diagnostic_settings_version: Optional[str] = rest_field(
        name="diagnosticSettingsVersion", visibility=["read", "create", "update", "delete", "query"]
    )
    """Diagnostic settings version number for nsp profile."""
    enabled_log_categories: Optional[list[str]] = rest_field(
        name="enabledLogCategories", visibility=["read", "create", "update", "delete", "query"]
    )
    """Enabled log categories for nsp profile."""

    @overload
    def __init__(
        self,
        *,
        name: Optional[str] = None,
        access_rules_version: Optional[str] = None,
        access_rules: Optional[list["_models.NetworkSecurityPerimeterProfileAccessRule"]] = None,
        diagnostic_settings_version: Optional[str] = None,
        enabled_log_categories: 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 NetworkSecurityPerimeterConfigurationProperties(_Model):  # pylint: disable=name-too-long
    """Network security perimeter configuration information to reflect latest association and nsp
    profile configuration.

    :ivar provisioning_state: Provisioning state to reflect configuration state and indicate status
     of nsp profile configuration retrieval. Known values are: "Creating", "Updating", "Deleting",
     "Succeeded", "Canceled", "Failed", "Deleted", and "Accepted".
    :vartype provisioning_state: str or
     ~azure.mgmt.eventgrid.models.NetworkSecurityPerimeterConfigProvisioningState
    :ivar provisioning_issues: Provisioning issues to reflect status when attempting to retrieve
     nsp profile configuration.
    :vartype provisioning_issues:
     list[~azure.mgmt.eventgrid.models.NetworkSecurityPerimeterConfigurationIssues]
    :ivar network_security_perimeter: Perimeter info for nsp association.
    :vartype network_security_perimeter: ~azure.mgmt.eventgrid.models.NetworkSecurityPerimeterInfo
    :ivar resource_association: Nsp association name and access mode of association.
    :vartype resource_association: ~azure.mgmt.eventgrid.models.ResourceAssociation
    :ivar profile: Nsp profile configuration, access rules and diagnostic settings.
    :vartype profile: ~azure.mgmt.eventgrid.models.NetworkSecurityPerimeterConfigurationProfile
    """

    provisioning_state: Optional[Union[str, "_models.NetworkSecurityPerimeterConfigProvisioningState"]] = rest_field(
        name="provisioningState", visibility=["read", "create", "update", "delete", "query"]
    )
    """Provisioning state to reflect configuration state and indicate status of nsp profile
     configuration retrieval. Known values are: \"Creating\", \"Updating\", \"Deleting\",
     \"Succeeded\", \"Canceled\", \"Failed\", \"Deleted\", and \"Accepted\"."""
    provisioning_issues: Optional[list["_models.NetworkSecurityPerimeterConfigurationIssues"]] = rest_field(
        name="provisioningIssues", visibility=["read", "create", "update", "delete", "query"]
    )
    """Provisioning issues to reflect status when attempting to retrieve nsp profile configuration."""
    network_security_perimeter: Optional["_models.NetworkSecurityPerimeterInfo"] = rest_field(
        name="networkSecurityPerimeter", visibility=["read", "create", "update", "delete", "query"]
    )
    """Perimeter info for nsp association."""
    resource_association: Optional["_models.ResourceAssociation"] = rest_field(
        name="resourceAssociation", visibility=["read", "create", "update", "delete", "query"]
    )
    """Nsp association name and access mode of association."""
    profile: Optional["_models.NetworkSecurityPerimeterConfigurationProfile"] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """Nsp profile configuration, access rules and diagnostic settings."""

    @overload
    def __init__(
        self,
        *,
        provisioning_state: Optional[Union[str, "_models.NetworkSecurityPerimeterConfigProvisioningState"]] = None,
        provisioning_issues: Optional[list["_models.NetworkSecurityPerimeterConfigurationIssues"]] = None,
        network_security_perimeter: Optional["_models.NetworkSecurityPerimeterInfo"] = None,
        resource_association: Optional["_models.ResourceAssociation"] = None,
        profile: Optional["_models.NetworkSecurityPerimeterConfigurationProfile"] = 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 NetworkSecurityPerimeterInfo(_Model):
    """Network security perimeter info.

    :ivar id: Arm id for network security perimeter.
    :vartype id: str
    :ivar perimeter_guid: Network security perimeter guid.
    :vartype perimeter_guid: str
    :ivar location: Network security perimeter location.
    :vartype location: str
    """

    id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """Arm id for network security perimeter."""
    perimeter_guid: Optional[str] = rest_field(
        name="perimeterGuid", visibility=["read", "create", "update", "delete", "query"]
    )
    """Network security perimeter guid."""
    location: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """Network security perimeter location."""

    @overload
    def __init__(
        self,
        *,
        id: Optional[str] = None,  # pylint: disable=redefined-builtin
        perimeter_guid: Optional[str] = None,
        location: 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 NetworkSecurityPerimeterProfileAccessRule(_Model):  # pylint: disable=name-too-long
    """Network security perimeter profile access rule.

    :ivar fully_qualified_arm_id: Fully Qualified Arm id for network security perimeter profile
     access rule.
    :vartype fully_qualified_arm_id: str
    :ivar name: Name for nsp access rule.
    :vartype name: str
    :ivar type: nsp access rule type.
    :vartype type: str
    :ivar properties: NSP access rule properties.
    :vartype properties:
     ~azure.mgmt.eventgrid.models.NetworkSecurityPerimeterProfileAccessRuleProperties
    """

    fully_qualified_arm_id: Optional[str] = rest_field(
        name="fullyQualifiedArmId", visibility=["read", "create", "update", "delete", "query"]
    )
    """Fully Qualified Arm id for network security perimeter profile access rule."""
    name: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """Name for nsp access rule."""
    type: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """nsp access rule type."""
    properties: Optional["_models.NetworkSecurityPerimeterProfileAccessRuleProperties"] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """NSP access rule properties."""

    __flattened_items = [
        "direction",
        "address_prefixes",
        "subscriptions",
        "network_security_perimeters",
        "fully_qualified_domain_names",
        "email_addresses",
        "phone_numbers",
    ]

    @overload
    def __init__(
        self,
        *,
        fully_qualified_arm_id: Optional[str] = None,
        name: Optional[str] = None,
        type: Optional[str] = None,
        properties: Optional["_models.NetworkSecurityPerimeterProfileAccessRuleProperties"] = 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:
        _flattened_input = {k: kwargs.pop(k) for k in kwargs.keys() & self.__flattened_items}
        super().__init__(*args, **kwargs)
        for k, v in _flattened_input.items():
            setattr(self, k, v)

    def __getattr__(self, name: str) -> Any:
        if name in self.__flattened_items:
            if self.properties is None:
                return None
            return getattr(self.properties, name)
        raise AttributeError(f"'{self.__class__.__name__}' object has no attribute '{name}'")

    def __setattr__(self, key: str, value: Any) -> None:
        if key in self.__flattened_items:
            if self.properties is None:
                self.properties = self._attr_to_rest_field["properties"]._class_type()
            setattr(self.properties, key, value)
        else:
            super().__setattr__(key, value)


class NetworkSecurityPerimeterProfileAccessRuleProperties(_Model):  # pylint: disable=name-too-long
    """Network security perimeter profile access rule properties.

    :ivar direction: NSP access rule direction. Known values are: "Inbound" and "Outbound".
    :vartype direction: str or
     ~azure.mgmt.eventgrid.models.NetworkSecurityPerimeterProfileAccessRuleDirection
    :ivar address_prefixes: Address prefixes.
    :vartype address_prefixes: list[str]
    :ivar subscriptions: List of subscriptions.
    :vartype subscriptions: list[~azure.mgmt.eventgrid.models.NetworkSecurityPerimeterSubscription]
    :ivar network_security_perimeters: Network security perimeters.
    :vartype network_security_perimeters:
     list[~azure.mgmt.eventgrid.models.NetworkSecurityPerimeterInfo]
    :ivar fully_qualified_domain_names: Fully qualified domain names.
    :vartype fully_qualified_domain_names: list[str]
    :ivar email_addresses: List of email addresses.
    :vartype email_addresses: list[str]
    :ivar phone_numbers: List of phone numbers.
    :vartype phone_numbers: list[str]
    """

    direction: Optional[Union[str, "_models.NetworkSecurityPerimeterProfileAccessRuleDirection"]] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """NSP access rule direction. Known values are: \"Inbound\" and \"Outbound\"."""
    address_prefixes: Optional[list[str]] = rest_field(
        name="addressPrefixes", visibility=["read", "create", "update", "delete", "query"]
    )
    """Address prefixes."""
    subscriptions: Optional[list["_models.NetworkSecurityPerimeterSubscription"]] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """List of subscriptions."""
    network_security_perimeters: Optional[list["_models.NetworkSecurityPerimeterInfo"]] = rest_field(
        name="networkSecurityPerimeters", visibility=["read", "create", "update", "delete", "query"]
    )
    """Network security perimeters."""
    fully_qualified_domain_names: Optional[list[str]] = rest_field(
        name="fullyQualifiedDomainNames", visibility=["read", "create", "update", "delete", "query"]
    )
    """Fully qualified domain names."""
    email_addresses: Optional[list[str]] = rest_field(
        name="emailAddresses", visibility=["read", "create", "update", "delete", "query"]
    )
    """List of email addresses."""
    phone_numbers: Optional[list[str]] = rest_field(
        name="phoneNumbers", visibility=["read", "create", "update", "delete", "query"]
    )
    """List of phone numbers."""

    @overload
    def __init__(
        self,
        *,
        direction: Optional[Union[str, "_models.NetworkSecurityPerimeterProfileAccessRuleDirection"]] = None,
        address_prefixes: Optional[list[str]] = None,
        subscriptions: Optional[list["_models.NetworkSecurityPerimeterSubscription"]] = None,
        network_security_perimeters: Optional[list["_models.NetworkSecurityPerimeterInfo"]] = None,
        fully_qualified_domain_names: Optional[list[str]] = None,
        email_addresses: Optional[list[str]] = None,
        phone_numbers: 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 NetworkSecurityPerimeterSubscription(_Model):
    """Network security perimeter subscription inbound access rule.

    :ivar id: Subscription id.
    :vartype id: str
    """

    id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """Subscription id."""

    @overload
    def __init__(
        self,
        *,
        id: Optional[str] = None,  # pylint: disable=redefined-builtin
    ) -> 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 NumberGreaterThanAdvancedFilter(AdvancedFilter, discriminator="NumberGreaterThan"):
    """NumberGreaterThan Advanced Filter.

    :ivar key: The field/property in the event based on which you want to filter.
    :vartype key: str
    :ivar value: The filter value.
    :vartype value: float
    :ivar operator_type: The operator type used for filtering, e.g., NumberIn, StringContains,
     BoolEquals and others. Required. NumberGreaterThan.
    :vartype operator_type: str or ~azure.mgmt.eventgrid.models.NUMBER_GREATER_THAN
    """

    value: Optional[float] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """The filter value."""
    operator_type: Literal[AdvancedFilterOperatorType.NUMBER_GREATER_THAN] = rest_discriminator(name="operatorType", visibility=["read", "create", "update", "delete", "query"])  # type: ignore
    """The operator type used for filtering, e.g., NumberIn, StringContains, BoolEquals and others.
     Required. NumberGreaterThan."""

    @overload
    def __init__(
        self,
        *,
        key: Optional[str] = None,
        value: Optional[float] = 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)
        self.operator_type = AdvancedFilterOperatorType.NUMBER_GREATER_THAN  # type: ignore


class NumberGreaterThanFilter(Filter, discriminator="NumberGreaterThan"):
    """NumberGreaterThan Filter.

    :ivar key: The field/property in the event based on which you want to filter.
    :vartype key: str
    :ivar value: The filter value.
    :vartype value: float
    :ivar operator_type: The operator type used for filtering, e.g., NumberIn, StringContains,
     BoolEquals and others. Required. NumberGreaterThan.
    :vartype operator_type: str or ~azure.mgmt.eventgrid.models.NUMBER_GREATER_THAN
    """

    value: Optional[float] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """The filter value."""
    operator_type: Literal[FilterOperatorType.NUMBER_GREATER_THAN] = rest_discriminator(name="operatorType", visibility=["read", "create", "update", "delete", "query"])  # type: ignore
    """The operator type used for filtering, e.g., NumberIn, StringContains, BoolEquals and others.
     Required. NumberGreaterThan."""

    @overload
    def __init__(
        self,
        *,
        key: Optional[str] = None,
        value: Optional[float] = 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)
        self.operator_type = FilterOperatorType.NUMBER_GREATER_THAN  # type: ignore


class NumberGreaterThanOrEqualsAdvancedFilter(AdvancedFilter, discriminator="NumberGreaterThanOrEquals"):
    """NumberGreaterThanOrEquals Advanced Filter.

    :ivar key: The field/property in the event based on which you want to filter.
    :vartype key: str
    :ivar value: The filter value.
    :vartype value: float
    :ivar operator_type: The operator type used for filtering, e.g., NumberIn, StringContains,
     BoolEquals and others. Required. NumberGreaterThanOrEquals.
    :vartype operator_type: str or ~azure.mgmt.eventgrid.models.NUMBER_GREATER_THAN_OR_EQUALS
    """

    value: Optional[float] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """The filter value."""
    operator_type: Literal[AdvancedFilterOperatorType.NUMBER_GREATER_THAN_OR_EQUALS] = rest_discriminator(name="operatorType", visibility=["read", "create", "update", "delete", "query"])  # type: ignore
    """The operator type used for filtering, e.g., NumberIn, StringContains, BoolEquals and others.
     Required. NumberGreaterThanOrEquals."""

    @overload
    def __init__(
        self,
        *,
        key: Optional[str] = None,
        value: Optional[float] = 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)
        self.operator_type = AdvancedFilterOperatorType.NUMBER_GREATER_THAN_OR_EQUALS  # type: ignore


class NumberGreaterThanOrEqualsFilter(Filter, discriminator="NumberGreaterThanOrEquals"):
    """NumberGreaterThanOrEquals Filter.

    :ivar key: The field/property in the event based on which you want to filter.
    :vartype key: str
    :ivar value: The filter value.
    :vartype value: float
    :ivar operator_type: The operator type used for filtering, e.g., NumberIn, StringContains,
     BoolEquals and others. Required. NumberGreaterThanOrEquals.
    :vartype operator_type: str or ~azure.mgmt.eventgrid.models.NUMBER_GREATER_THAN_OR_EQUALS
    """

    value: Optional[float] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """The filter value."""
    operator_type: Literal[FilterOperatorType.NUMBER_GREATER_THAN_OR_EQUALS] = rest_discriminator(name="operatorType", visibility=["read", "create", "update", "delete", "query"])  # type: ignore
    """The operator type used for filtering, e.g., NumberIn, StringContains, BoolEquals and others.
     Required. NumberGreaterThanOrEquals."""

    @overload
    def __init__(
        self,
        *,
        key: Optional[str] = None,
        value: Optional[float] = 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)
        self.operator_type = FilterOperatorType.NUMBER_GREATER_THAN_OR_EQUALS  # type: ignore


class NumberInAdvancedFilter(AdvancedFilter, discriminator="NumberIn"):
    """NumberIn Advanced Filter.

    :ivar key: The field/property in the event based on which you want to filter.
    :vartype key: str
    :ivar values_property: The set of filter values.
    :vartype values_property: list[float]
    :ivar operator_type: The operator type used for filtering, e.g., NumberIn, StringContains,
     BoolEquals and others. Required. NumberIn.
    :vartype operator_type: str or ~azure.mgmt.eventgrid.models.NUMBER_IN
    """

    values_property: Optional[list[float]] = rest_field(
        name="values", visibility=["read", "create", "update", "delete", "query"], original_tsp_name="values"
    )
    """The set of filter values."""
    operator_type: Literal[AdvancedFilterOperatorType.NUMBER_IN] = rest_discriminator(name="operatorType", visibility=["read", "create", "update", "delete", "query"])  # type: ignore
    """The operator type used for filtering, e.g., NumberIn, StringContains, BoolEquals and others.
     Required. NumberIn."""

    @overload
    def __init__(
        self,
        *,
        key: Optional[str] = None,
        values_property: Optional[list[float]] = 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)
        self.operator_type = AdvancedFilterOperatorType.NUMBER_IN  # type: ignore


class NumberInFilter(Filter, discriminator="NumberIn"):
    """NumberIn Filter.

    :ivar key: The field/property in the event based on which you want to filter.
    :vartype key: str
    :ivar values_property: The set of filter values.
    :vartype values_property: list[float]
    :ivar operator_type: The operator type used for filtering, e.g., NumberIn, StringContains,
     BoolEquals and others. Required. NumberIn.
    :vartype operator_type: str or ~azure.mgmt.eventgrid.models.NUMBER_IN
    """

    values_property: Optional[list[float]] = rest_field(
        name="values", visibility=["read", "create", "update", "delete", "query"], original_tsp_name="values"
    )
    """The set of filter values."""
    operator_type: Literal[FilterOperatorType.NUMBER_IN] = rest_discriminator(name="operatorType", visibility=["read", "create", "update", "delete", "query"])  # type: ignore
    """The operator type used for filtering, e.g., NumberIn, StringContains, BoolEquals and others.
     Required. NumberIn."""

    @overload
    def __init__(
        self,
        *,
        key: Optional[str] = None,
        values_property: Optional[list[float]] = 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)
        self.operator_type = FilterOperatorType.NUMBER_IN  # type: ignore


class NumberInRangeAdvancedFilter(AdvancedFilter, discriminator="NumberInRange"):
    """NumberInRange Advanced Filter.

    :ivar key: The field/property in the event based on which you want to filter.
    :vartype key: str
    :ivar values_property: The set of filter values.
    :vartype values_property: list[list[float]]
    :ivar operator_type: The operator type used for filtering, e.g., NumberIn, StringContains,
     BoolEquals and others. Required. NumberInRange.
    :vartype operator_type: str or ~azure.mgmt.eventgrid.models.NUMBER_IN_RANGE
    """

    values_property: Optional[list[list[float]]] = rest_field(
        name="values", visibility=["read", "create", "update", "delete", "query"], original_tsp_name="values"
    )
    """The set of filter values."""
    operator_type: Literal[AdvancedFilterOperatorType.NUMBER_IN_RANGE] = rest_discriminator(name="operatorType", visibility=["read", "create", "update", "delete", "query"])  # type: ignore
    """The operator type used for filtering, e.g., NumberIn, StringContains, BoolEquals and others.
     Required. NumberInRange."""

    @overload
    def __init__(
        self,
        *,
        key: Optional[str] = None,
        values_property: Optional[list[list[float]]] = 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)
        self.operator_type = AdvancedFilterOperatorType.NUMBER_IN_RANGE  # type: ignore


class NumberInRangeFilter(Filter, discriminator="NumberInRange"):
    """NumberInRange Filter.

    :ivar key: The field/property in the event based on which you want to filter.
    :vartype key: str
    :ivar values_property: The set of filter values.
    :vartype values_property: list[list[float]]
    :ivar operator_type: The operator type used for filtering, e.g., NumberIn, StringContains,
     BoolEquals and others. Required. NumberInRange.
    :vartype operator_type: str or ~azure.mgmt.eventgrid.models.NUMBER_IN_RANGE
    """

    values_property: Optional[list[list[float]]] = rest_field(
        name="values", visibility=["read", "create", "update", "delete", "query"], original_tsp_name="values"
    )
    """The set of filter values."""
    operator_type: Literal[FilterOperatorType.NUMBER_IN_RANGE] = rest_discriminator(name="operatorType", visibility=["read", "create", "update", "delete", "query"])  # type: ignore
    """The operator type used for filtering, e.g., NumberIn, StringContains, BoolEquals and others.
     Required. NumberInRange."""

    @overload
    def __init__(
        self,
        *,
        key: Optional[str] = None,
        values_property: Optional[list[list[float]]] = 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)
        self.operator_type = FilterOperatorType.NUMBER_IN_RANGE  # type: ignore


class NumberLessThanAdvancedFilter(AdvancedFilter, discriminator="NumberLessThan"):
    """NumberLessThan Advanced Filter.

    :ivar key: The field/property in the event based on which you want to filter.
    :vartype key: str
    :ivar value: The filter value.
    :vartype value: float
    :ivar operator_type: The operator type used for filtering, e.g., NumberIn, StringContains,
     BoolEquals and others. Required. NumberLessThan.
    :vartype operator_type: str or ~azure.mgmt.eventgrid.models.NUMBER_LESS_THAN
    """

    value: Optional[float] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """The filter value."""
    operator_type: Literal[AdvancedFilterOperatorType.NUMBER_LESS_THAN] = rest_discriminator(name="operatorType", visibility=["read", "create", "update", "delete", "query"])  # type: ignore
    """The operator type used for filtering, e.g., NumberIn, StringContains, BoolEquals and others.
     Required. NumberLessThan."""

    @overload
    def __init__(
        self,
        *,
        key: Optional[str] = None,
        value: Optional[float] = 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)
        self.operator_type = AdvancedFilterOperatorType.NUMBER_LESS_THAN  # type: ignore


class NumberLessThanFilter(Filter, discriminator="NumberLessThan"):
    """NumberLessThan Filter.

    :ivar key: The field/property in the event based on which you want to filter.
    :vartype key: str
    :ivar value: The filter value.
    :vartype value: float
    :ivar operator_type: The operator type used for filtering, e.g., NumberIn, StringContains,
     BoolEquals and others. Required. NumberLessThan.
    :vartype operator_type: str or ~azure.mgmt.eventgrid.models.NUMBER_LESS_THAN
    """

    value: Optional[float] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """The filter value."""
    operator_type: Literal[FilterOperatorType.NUMBER_LESS_THAN] = rest_discriminator(name="operatorType", visibility=["read", "create", "update", "delete", "query"])  # type: ignore
    """The operator type used for filtering, e.g., NumberIn, StringContains, BoolEquals and others.
     Required. NumberLessThan."""

    @overload
    def __init__(
        self,
        *,
        key: Optional[str] = None,
        value: Optional[float] = 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)
        self.operator_type = FilterOperatorType.NUMBER_LESS_THAN  # type: ignore


class NumberLessThanOrEqualsAdvancedFilter(AdvancedFilter, discriminator="NumberLessThanOrEquals"):
    """NumberLessThanOrEquals Advanced Filter.

    :ivar key: The field/property in the event based on which you want to filter.
    :vartype key: str
    :ivar value: The filter value.
    :vartype value: float
    :ivar operator_type: The operator type used for filtering, e.g., NumberIn, StringContains,
     BoolEquals and others. Required. NumberLessThanOrEquals.
    :vartype operator_type: str or ~azure.mgmt.eventgrid.models.NUMBER_LESS_THAN_OR_EQUALS
    """

    value: Optional[float] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """The filter value."""
    operator_type: Literal[AdvancedFilterOperatorType.NUMBER_LESS_THAN_OR_EQUALS] = rest_discriminator(name="operatorType", visibility=["read", "create", "update", "delete", "query"])  # type: ignore
    """The operator type used for filtering, e.g., NumberIn, StringContains, BoolEquals and others.
     Required. NumberLessThanOrEquals."""

    @overload
    def __init__(
        self,
        *,
        key: Optional[str] = None,
        value: Optional[float] = 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)
        self.operator_type = AdvancedFilterOperatorType.NUMBER_LESS_THAN_OR_EQUALS  # type: ignore


class NumberLessThanOrEqualsFilter(Filter, discriminator="NumberLessThanOrEquals"):
    """NumberLessThanOrEquals Filter.

    :ivar key: The field/property in the event based on which you want to filter.
    :vartype key: str
    :ivar value: The filter value.
    :vartype value: float
    :ivar operator_type: The operator type used for filtering, e.g., NumberIn, StringContains,
     BoolEquals and others. Required. NumberLessThanOrEquals.
    :vartype operator_type: str or ~azure.mgmt.eventgrid.models.NUMBER_LESS_THAN_OR_EQUALS
    """

    value: Optional[float] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """The filter value."""
    operator_type: Literal[FilterOperatorType.NUMBER_LESS_THAN_OR_EQUALS] = rest_discriminator(name="operatorType", visibility=["read", "create", "update", "delete", "query"])  # type: ignore
    """The operator type used for filtering, e.g., NumberIn, StringContains, BoolEquals and others.
     Required. NumberLessThanOrEquals."""

    @overload
    def __init__(
        self,
        *,
        key: Optional[str] = None,
        value: Optional[float] = 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)
        self.operator_type = FilterOperatorType.NUMBER_LESS_THAN_OR_EQUALS  # type: ignore


class NumberNotInAdvancedFilter(AdvancedFilter, discriminator="NumberNotIn"):
    """NumberNotIn Advanced Filter.

    :ivar key: The field/property in the event based on which you want to filter.
    :vartype key: str
    :ivar values_property: The set of filter values.
    :vartype values_property: list[float]
    :ivar operator_type: The operator type used for filtering, e.g., NumberIn, StringContains,
     BoolEquals and others. Required. NumberNotIn.
    :vartype operator_type: str or ~azure.mgmt.eventgrid.models.NUMBER_NOT_IN
    """

    values_property: Optional[list[float]] = rest_field(
        name="values", visibility=["read", "create", "update", "delete", "query"], original_tsp_name="values"
    )
    """The set of filter values."""
    operator_type: Literal[AdvancedFilterOperatorType.NUMBER_NOT_IN] = rest_discriminator(name="operatorType", visibility=["read", "create", "update", "delete", "query"])  # type: ignore
    """The operator type used for filtering, e.g., NumberIn, StringContains, BoolEquals and others.
     Required. NumberNotIn."""

    @overload
    def __init__(
        self,
        *,
        key: Optional[str] = None,
        values_property: Optional[list[float]] = 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)
        self.operator_type = AdvancedFilterOperatorType.NUMBER_NOT_IN  # type: ignore


class NumberNotInFilter(Filter, discriminator="NumberNotIn"):
    """NumberNotIn Filter.

    :ivar key: The field/property in the event based on which you want to filter.
    :vartype key: str
    :ivar values_property: The set of filter values.
    :vartype values_property: list[float]
    :ivar operator_type: The operator type used for filtering, e.g., NumberIn, StringContains,
     BoolEquals and others. Required. NumberNotIn.
    :vartype operator_type: str or ~azure.mgmt.eventgrid.models.NUMBER_NOT_IN
    """

    values_property: Optional[list[float]] = rest_field(
        name="values", visibility=["read", "create", "update", "delete", "query"], original_tsp_name="values"
    )
    """The set of filter values."""
    operator_type: Literal[FilterOperatorType.NUMBER_NOT_IN] = rest_discriminator(name="operatorType", visibility=["read", "create", "update", "delete", "query"])  # type: ignore
    """The operator type used for filtering, e.g., NumberIn, StringContains, BoolEquals and others.
     Required. NumberNotIn."""

    @overload
    def __init__(
        self,
        *,
        key: Optional[str] = None,
        values_property: Optional[list[float]] = 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)
        self.operator_type = FilterOperatorType.NUMBER_NOT_IN  # type: ignore


class NumberNotInRangeAdvancedFilter(AdvancedFilter, discriminator="NumberNotInRange"):
    """NumberNotInRange Advanced Filter.

    :ivar key: The field/property in the event based on which you want to filter.
    :vartype key: str
    :ivar values_property: The set of filter values.
    :vartype values_property: list[list[float]]
    :ivar operator_type: The operator type used for filtering, e.g., NumberIn, StringContains,
     BoolEquals and others. Required. NumberNotInRange.
    :vartype operator_type: str or ~azure.mgmt.eventgrid.models.NUMBER_NOT_IN_RANGE
    """

    values_property: Optional[list[list[float]]] = rest_field(
        name="values", visibility=["read", "create", "update", "delete", "query"], original_tsp_name="values"
    )
    """The set of filter values."""
    operator_type: Literal[AdvancedFilterOperatorType.NUMBER_NOT_IN_RANGE] = rest_discriminator(name="operatorType", visibility=["read", "create", "update", "delete", "query"])  # type: ignore
    """The operator type used for filtering, e.g., NumberIn, StringContains, BoolEquals and others.
     Required. NumberNotInRange."""

    @overload
    def __init__(
        self,
        *,
        key: Optional[str] = None,
        values_property: Optional[list[list[float]]] = 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)
        self.operator_type = AdvancedFilterOperatorType.NUMBER_NOT_IN_RANGE  # type: ignore


class NumberNotInRangeFilter(Filter, discriminator="NumberNotInRange"):
    """NumberNotInRange Filter.

    :ivar key: The field/property in the event based on which you want to filter.
    :vartype key: str
    :ivar values_property: The set of filter values.
    :vartype values_property: list[list[float]]
    :ivar operator_type: The operator type used for filtering, e.g., NumberIn, StringContains,
     BoolEquals and others. Required. NumberNotInRange.
    :vartype operator_type: str or ~azure.mgmt.eventgrid.models.NUMBER_NOT_IN_RANGE
    """

    values_property: Optional[list[list[float]]] = rest_field(
        name="values", visibility=["read", "create", "update", "delete", "query"], original_tsp_name="values"
    )
    """The set of filter values."""
    operator_type: Literal[FilterOperatorType.NUMBER_NOT_IN_RANGE] = rest_discriminator(name="operatorType", visibility=["read", "create", "update", "delete", "query"])  # type: ignore
    """The operator type used for filtering, e.g., NumberIn, StringContains, BoolEquals and others.
     Required. NumberNotInRange."""

    @overload
    def __init__(
        self,
        *,
        key: Optional[str] = None,
        values_property: Optional[list[list[float]]] = 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)
        self.operator_type = FilterOperatorType.NUMBER_NOT_IN_RANGE  # type: ignore


class Operation(_Model):
    """Represents an operation returned by the GetOperations request.

    :ivar name: Name of the operation.
    :vartype name: str
    :ivar display: Display name of the operation.
    :vartype display: ~azure.mgmt.eventgrid.models.OperationInfo
    :ivar origin: Origin of the operation.
    :vartype origin: str
    :ivar is_data_action: This Boolean is used to determine if the operation is a data plane action
     or not.
    :vartype is_data_action: bool
    :ivar properties: Properties of the operation.
    :vartype properties: any
    """

    name: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """Name of the operation."""
    display: Optional["_models.OperationInfo"] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """Display name of the operation."""
    origin: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """Origin of the operation."""
    is_data_action: Optional[bool] = rest_field(
        name="isDataAction", visibility=["read", "create", "update", "delete", "query"]
    )
    """This Boolean is used to determine if the operation is a data plane action or not."""
    properties: Optional[Any] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """Properties of the operation."""

    __flattened_items = [""]

    @overload
    def __init__(
        self,
        *,
        name: Optional[str] = None,
        display: Optional["_models.OperationInfo"] = None,
        origin: Optional[str] = None,
        is_data_action: Optional[bool] = None,
        properties: 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:
        _flattened_input = {k: kwargs.pop(k) for k in kwargs.keys() & self.__flattened_items}
        super().__init__(*args, **kwargs)
        for k, v in _flattened_input.items():
            setattr(self, k, v)

    def __getattr__(self, name: str) -> Any:
        if name in self.__flattened_items:
            if self.properties is None:
                return None
            return getattr(self.properties, name)
        raise AttributeError(f"'{self.__class__.__name__}' object has no attribute '{name}'")

    def __setattr__(self, key: str, value: Any) -> None:
        if key in self.__flattened_items:
            if self.properties is None:
                self.properties = self._attr_to_rest_field["properties"]._class_type()
            setattr(self.properties, key, value)
        else:
            super().__setattr__(key, value)


class OperationInfo(_Model):
    """Information about an operation.

    :ivar provider: Name of the provider.
    :vartype provider: str
    :ivar resource: Name of the resource type.
    :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", "create", "update", "delete", "query"])
    """Name of the provider."""
    resource: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """Name of the resource type."""
    operation: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """Name of the operation."""
    description: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """Description of the operation."""

    @overload
    def __init__(
        self,
        *,
        provider: Optional[str] = None,
        resource: Optional[str] = None,
        operation: Optional[str] = None,
        description: 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 Partner(_Model):
    """Information about the partner.

    :ivar partner_registration_immutable_id: The immutableId of the corresponding partner
     registration.
    :vartype partner_registration_immutable_id: str
    :ivar partner_name: The partner name.
    :vartype partner_name: str
    :ivar authorization_expiration_time_in_utc: Expiration time of the partner authorization. If
     this timer expires, any request from this partner to create, update or delete resources in
     subscriber's context will fail. If specified, the allowed values are between 1 to the value of
     defaultMaximumExpirationTimeInDays specified in PartnerConfiguration. If not specified, the
     default value will be the value of defaultMaximumExpirationTimeInDays specified in
     PartnerConfiguration or 7 if this value is not specified.
    :vartype authorization_expiration_time_in_utc: ~datetime.datetime
    """

    partner_registration_immutable_id: Optional[str] = rest_field(
        name="partnerRegistrationImmutableId", visibility=["read", "create", "update", "delete", "query"]
    )
    """The immutableId of the corresponding partner registration."""
    partner_name: Optional[str] = rest_field(
        name="partnerName", visibility=["read", "create", "update", "delete", "query"]
    )
    """The partner name."""
    authorization_expiration_time_in_utc: Optional[datetime.datetime] = rest_field(
        name="authorizationExpirationTimeInUtc",
        visibility=["read", "create", "update", "delete", "query"],
        format="rfc3339",
    )
    """Expiration time of the partner authorization. If this timer expires, any request from this
     partner to create, update or delete resources in subscriber's context will fail. If specified,
     the allowed values are between 1 to the value of defaultMaximumExpirationTimeInDays specified
     in PartnerConfiguration. If not specified, the default value will be the value of
     defaultMaximumExpirationTimeInDays specified in PartnerConfiguration or 7 if this value is not
     specified."""

    @overload
    def __init__(
        self,
        *,
        partner_registration_immutable_id: Optional[str] = None,
        partner_name: Optional[str] = None,
        authorization_expiration_time_in_utc: 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 PartnerAuthorization(_Model):
    """The partner authorization details.

    :ivar default_maximum_expiration_time_in_days: Time used to validate the authorization
     expiration time for each authorized partner. If DefaultMaximumExpirationTimeInDays is not
     specified, the default is 7 days. Otherwise, allowed values are between 1 and 365 days.
    :vartype default_maximum_expiration_time_in_days: int
    :ivar authorized_partners_list: The list of authorized partners.
    :vartype authorized_partners_list: list[~azure.mgmt.eventgrid.models.Partner]
    """

    default_maximum_expiration_time_in_days: Optional[int] = rest_field(
        name="defaultMaximumExpirationTimeInDays", visibility=["read", "create", "update", "delete", "query"]
    )
    """Time used to validate the authorization expiration time for each authorized partner. If
     DefaultMaximumExpirationTimeInDays is not specified, the default is 7 days. Otherwise, allowed
     values are between 1 and 365 days."""
    authorized_partners_list: Optional[list["_models.Partner"]] = rest_field(
        name="authorizedPartnersList", visibility=["read", "create", "update", "delete", "query"]
    )
    """The list of authorized partners."""

    @overload
    def __init__(
        self,
        *,
        default_maximum_expiration_time_in_days: Optional[int] = None,
        authorized_partners_list: Optional[list["_models.Partner"]] = 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 PartnerConfiguration(Resource):
    """Partner configuration information.

    :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.eventgrid.models.SystemData
    :ivar properties: Properties of the partner configuration.
    :vartype properties: ~azure.mgmt.eventgrid.models.PartnerConfigurationProperties
    :ivar tags: Resource tags.
    :vartype tags: dict[str, str]
    :ivar location: The geo-location where the resource lives.
    :vartype location: str
    """

    properties: Optional["_models.PartnerConfigurationProperties"] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """Properties of the partner configuration."""
    tags: Optional[dict[str, str]] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """Resource tags."""
    location: Optional[str] = rest_field(visibility=["read", "create", "update"])
    """The geo-location where the resource lives."""

    __flattened_items = ["partner_authorization", "provisioning_state"]

    @overload
    def __init__(
        self,
        *,
        properties: Optional["_models.PartnerConfigurationProperties"] = None,
        tags: Optional[dict[str, str]] = None,
        location: 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:
        _flattened_input = {k: kwargs.pop(k) for k in kwargs.keys() & self.__flattened_items}
        super().__init__(*args, **kwargs)
        for k, v in _flattened_input.items():
            setattr(self, k, v)

    def __getattr__(self, name: str) -> Any:
        if name in self.__flattened_items:
            if self.properties is None:
                return None
            return getattr(self.properties, name)
        raise AttributeError(f"'{self.__class__.__name__}' object has no attribute '{name}'")

    def __setattr__(self, key: str, value: Any) -> None:
        if key in self.__flattened_items:
            if self.properties is None:
                self.properties = self._attr_to_rest_field["properties"]._class_type()
            setattr(self.properties, key, value)
        else:
            super().__setattr__(key, value)


class PartnerConfigurationProperties(_Model):
    """Properties of the partner configuration.

    :ivar partner_authorization: The details of authorized partners.
    :vartype partner_authorization: ~azure.mgmt.eventgrid.models.PartnerAuthorization
    :ivar provisioning_state: Provisioning state of the partner configuration. Known values are:
     "Creating", "Updating", "Deleting", "Succeeded", "Canceled", and "Failed".
    :vartype provisioning_state: str or
     ~azure.mgmt.eventgrid.models.PartnerConfigurationProvisioningState
    """

    partner_authorization: Optional["_models.PartnerAuthorization"] = rest_field(
        name="partnerAuthorization", visibility=["read", "create", "update", "delete", "query"]
    )
    """The details of authorized partners."""
    provisioning_state: Optional[Union[str, "_models.PartnerConfigurationProvisioningState"]] = rest_field(
        name="provisioningState", visibility=["read", "create", "update", "delete", "query"]
    )
    """Provisioning state of the partner configuration. Known values are: \"Creating\", \"Updating\",
     \"Deleting\", \"Succeeded\", \"Canceled\", and \"Failed\"."""

    @overload
    def __init__(
        self,
        *,
        partner_authorization: Optional["_models.PartnerAuthorization"] = None,
        provisioning_state: Optional[Union[str, "_models.PartnerConfigurationProvisioningState"]] = 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 PartnerConfigurationUpdateParameterProperties(_Model):  # pylint: disable=name-too-long
    """Information of partner configuration update parameter properties.

    :ivar default_maximum_expiration_time_in_days: The default time used to validate the maximum
     expiration time for each authorized partners in days. Allowed values ar between 1 and 365 days.
    :vartype default_maximum_expiration_time_in_days: int
    """

    default_maximum_expiration_time_in_days: Optional[int] = rest_field(
        name="defaultMaximumExpirationTimeInDays", visibility=["read", "create", "update", "delete", "query"]
    )
    """The default time used to validate the maximum expiration time for each authorized partners in
     days. Allowed values ar between 1 and 365 days."""

    @overload
    def __init__(
        self,
        *,
        default_maximum_expiration_time_in_days: 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 PartnerConfigurationUpdateParameters(_Model):
    """Properties of the partner configuration update.

    :ivar tags: Tags of the partner configuration resource.
    :vartype tags: dict[str, str]
    :ivar properties: Properties of the Topic resource.
    :vartype properties: ~azure.mgmt.eventgrid.models.PartnerConfigurationUpdateParameterProperties
    """

    tags: Optional[dict[str, str]] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """Tags of the partner configuration resource."""
    properties: Optional["_models.PartnerConfigurationUpdateParameterProperties"] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """Properties of the Topic resource."""

    __flattened_items = ["default_maximum_expiration_time_in_days"]

    @overload
    def __init__(
        self,
        *,
        tags: Optional[dict[str, str]] = None,
        properties: Optional["_models.PartnerConfigurationUpdateParameterProperties"] = 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:
        _flattened_input = {k: kwargs.pop(k) for k in kwargs.keys() & self.__flattened_items}
        super().__init__(*args, **kwargs)
        for k, v in _flattened_input.items():
            setattr(self, k, v)

    def __getattr__(self, name: str) -> Any:
        if name in self.__flattened_items:
            if self.properties is None:
                return None
            return getattr(self.properties, name)
        raise AttributeError(f"'{self.__class__.__name__}' object has no attribute '{name}'")

    def __setattr__(self, key: str, value: Any) -> None:
        if key in self.__flattened_items:
            if self.properties is None:
                self.properties = self._attr_to_rest_field["properties"]._class_type()
            setattr(self.properties, key, value)
        else:
            super().__setattr__(key, value)


class PartnerDestination(TrackedResource):
    """Event Grid Partner Destination.

    :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.eventgrid.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: Properties of the Partner Destination.
    :vartype properties: ~azure.mgmt.eventgrid.models.PartnerDestinationProperties
    """

    properties: Optional["_models.PartnerDestinationProperties"] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """Properties of the Partner Destination."""

    __flattened_items = [
        "partner_registration_immutable_id",
        "endpoint_service_context",
        "expiration_time_if_not_activated_utc",
        "provisioning_state",
        "activation_state",
        "endpoint_base_url",
        "message_for_activation",
    ]

    @overload
    def __init__(
        self,
        *,
        location: str,
        tags: Optional[dict[str, str]] = None,
        properties: Optional["_models.PartnerDestinationProperties"] = 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:
        _flattened_input = {k: kwargs.pop(k) for k in kwargs.keys() & self.__flattened_items}
        super().__init__(*args, **kwargs)
        for k, v in _flattened_input.items():
            setattr(self, k, v)

    def __getattr__(self, name: str) -> Any:
        if name in self.__flattened_items:
            if self.properties is None:
                return None
            return getattr(self.properties, name)
        raise AttributeError(f"'{self.__class__.__name__}' object has no attribute '{name}'")

    def __setattr__(self, key: str, value: Any) -> None:
        if key in self.__flattened_items:
            if self.properties is None:
                self.properties = self._attr_to_rest_field["properties"]._class_type()
            setattr(self.properties, key, value)
        else:
            super().__setattr__(key, value)


class PartnerDestinationInfo(_Model):
    """Properties of the corresponding partner destination of a Channel.

    You probably want to use the sub-classes and not this class directly. Known sub-classes are:
    WebhookPartnerDestinationInfo

    :ivar azure_subscription_id: Azure subscription ID of the subscriber. The partner destination
     associated with the channel will be created under this Azure subscription.
    :vartype azure_subscription_id: str
    :ivar resource_group_name: Azure Resource Group of the subscriber. The partner destination
     associated with the channel will be created under this resource group.
    :vartype resource_group_name: str
    :ivar name: Name of the partner destination associated with the channel.
    :vartype name: str
    :ivar endpoint_type: Type of the endpoint for the partner destination. Required. "WebHook"
    :vartype endpoint_type: str or ~azure.mgmt.eventgrid.models.PartnerEndpointType
    :ivar endpoint_service_context: Additional context of the partner destination endpoint.
    :vartype endpoint_service_context: str
    :ivar resource_move_change_history: Change history of the resource move.
    :vartype resource_move_change_history:
     list[~azure.mgmt.eventgrid.models.ResourceMoveChangeHistory]
    """

    __mapping__: dict[str, _Model] = {}
    azure_subscription_id: Optional[str] = rest_field(
        name="azureSubscriptionId", visibility=["read", "create", "update", "delete", "query"]
    )
    """Azure subscription ID of the subscriber. The partner destination associated with the channel
     will be created under this Azure subscription."""
    resource_group_name: Optional[str] = rest_field(
        name="resourceGroupName", visibility=["read", "create", "update", "delete", "query"]
    )
    """Azure Resource Group of the subscriber. The partner destination associated with the channel
     will be created under this resource group."""
    name: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """Name of the partner destination associated with the channel."""
    endpoint_type: str = rest_discriminator(
        name="endpointType", visibility=["read", "create", "update", "delete", "query"]
    )
    """Type of the endpoint for the partner destination. Required. \"WebHook\""""
    endpoint_service_context: Optional[str] = rest_field(
        name="endpointServiceContext", visibility=["read", "create", "update", "delete", "query"]
    )
    """Additional context of the partner destination endpoint."""
    resource_move_change_history: Optional[list["_models.ResourceMoveChangeHistory"]] = rest_field(
        name="resourceMoveChangeHistory", visibility=["read", "create", "update", "delete", "query"]
    )
    """Change history of the resource move."""

    @overload
    def __init__(
        self,
        *,
        endpoint_type: str,
        azure_subscription_id: Optional[str] = None,
        resource_group_name: Optional[str] = None,
        name: Optional[str] = None,
        endpoint_service_context: Optional[str] = None,
        resource_move_change_history: Optional[list["_models.ResourceMoveChangeHistory"]] = 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 PartnerDestinationProperties(_Model):
    """Properties of the Partner Destination.

    :ivar partner_registration_immutable_id: The immutable Id of the corresponding partner
     registration.
    :vartype partner_registration_immutable_id: str
    :ivar endpoint_service_context: Endpoint context associated with this partner destination.
    :vartype endpoint_service_context: str
    :ivar expiration_time_if_not_activated_utc: Expiration time of the partner destination. If this
     timer expires and the partner destination was never activated, the partner destination and
     corresponding channel are deleted.
    :vartype expiration_time_if_not_activated_utc: ~datetime.datetime
    :ivar provisioning_state: Provisioning state of the partner destination. Known values are:
     "Creating", "Updating", "Deleting", "Succeeded", "Canceled", "Failed", and
     "IdleDueToMirroredChannelResourceDeletion".
    :vartype provisioning_state: str or
     ~azure.mgmt.eventgrid.models.PartnerDestinationProvisioningState
    :ivar activation_state: Activation state of the partner destination. Known values are:
     "NeverActivated" and "Activated".
    :vartype activation_state: str or
     ~azure.mgmt.eventgrid.models.PartnerDestinationActivationState
    :ivar endpoint_base_url: Endpoint Base URL of the partner destination.
    :vartype endpoint_base_url: str
    :ivar message_for_activation: Context or helpful message that can be used during the approval
     process.
    :vartype message_for_activation: str
    """

    partner_registration_immutable_id: Optional[str] = rest_field(
        name="partnerRegistrationImmutableId", visibility=["read", "create", "update", "delete", "query"]
    )
    """The immutable Id of the corresponding partner registration."""
    endpoint_service_context: Optional[str] = rest_field(
        name="endpointServiceContext", visibility=["read", "create", "update", "delete", "query"]
    )
    """Endpoint context associated with this partner destination."""
    expiration_time_if_not_activated_utc: Optional[datetime.datetime] = rest_field(
        name="expirationTimeIfNotActivatedUtc",
        visibility=["read", "create", "update", "delete", "query"],
        format="rfc3339",
    )
    """Expiration time of the partner destination. If this timer expires and the partner destination
     was never activated, the partner destination and corresponding channel are deleted."""
    provisioning_state: Optional[Union[str, "_models.PartnerDestinationProvisioningState"]] = rest_field(
        name="provisioningState", visibility=["read"]
    )
    """Provisioning state of the partner destination. Known values are: \"Creating\", \"Updating\",
     \"Deleting\", \"Succeeded\", \"Canceled\", \"Failed\", and
     \"IdleDueToMirroredChannelResourceDeletion\"."""
    activation_state: Optional[Union[str, "_models.PartnerDestinationActivationState"]] = rest_field(
        name="activationState", visibility=["read", "create", "update", "delete", "query"]
    )
    """Activation state of the partner destination. Known values are: \"NeverActivated\" and
     \"Activated\"."""
    endpoint_base_url: Optional[str] = rest_field(
        name="endpointBaseUrl", visibility=["read", "create", "update", "delete", "query"]
    )
    """Endpoint Base URL of the partner destination."""
    message_for_activation: Optional[str] = rest_field(
        name="messageForActivation", visibility=["read", "create", "update", "delete", "query"]
    )
    """Context or helpful message that can be used during the approval process."""

    @overload
    def __init__(
        self,
        *,
        partner_registration_immutable_id: Optional[str] = None,
        endpoint_service_context: Optional[str] = None,
        expiration_time_if_not_activated_utc: Optional[datetime.datetime] = None,
        activation_state: Optional[Union[str, "_models.PartnerDestinationActivationState"]] = None,
        endpoint_base_url: Optional[str] = None,
        message_for_activation: 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 PartnerDestinationUpdateParameters(_Model):
    """Properties of the Partner Destination that can be updated.

    :ivar tags: Tags of the Partner Destination resource.
    :vartype tags: dict[str, str]
    """

    tags: Optional[dict[str, str]] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """Tags of the Partner Destination resource."""

    @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 PartnerDetails(_Model):
    """Information about the partner.

    :ivar description: This is short description about the partner. The length of this description
     should not exceed 256 characters.
    :vartype description: str
    :ivar long_description: Long description for the partner's scenarios and integration.Length of
     this description should not exceed 2048 characters.
    :vartype long_description: str
    :ivar setup_uri: URI of the partner website that can be used by Azure customers to setup Event
     Grid integration on an event source.
    :vartype setup_uri: str
    """

    description: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """This is short description about the partner. The length of this description should not exceed
     256 characters."""
    long_description: Optional[str] = rest_field(
        name="longDescription", visibility=["read", "create", "update", "delete", "query"]
    )
    """Long description for the partner's scenarios and integration.Length of this description should
     not exceed 2048 characters."""
    setup_uri: Optional[str] = rest_field(name="setupUri", visibility=["read", "create", "update", "delete", "query"])
    """URI of the partner website that can be used by Azure customers to setup Event Grid integration
     on an event source."""

    @overload
    def __init__(
        self,
        *,
        description: Optional[str] = None,
        long_description: Optional[str] = None,
        setup_uri: 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 PartnerEventSubscriptionDestination(EventSubscriptionDestination, discriminator="PartnerDestination"):
    """PartnerEventSubscriptionDestination.

    :ivar properties: Partner Destination Properties of the event subscription destination.
    :vartype properties: ~azure.mgmt.eventgrid.models.PartnerEventSubscriptionDestinationProperties
    :ivar endpoint_type: Type of the endpoint for the event subscription destination. Required.
     PartnerDestination.
    :vartype endpoint_type: str or ~azure.mgmt.eventgrid.models.PARTNER_DESTINATION
    """

    properties: Optional["_models.PartnerEventSubscriptionDestinationProperties"] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """Partner Destination Properties of the event subscription destination."""
    endpoint_type: Literal[EndpointType.PARTNER_DESTINATION] = rest_discriminator(name="endpointType", visibility=["read", "create", "update", "delete", "query"])  # type: ignore
    """Type of the endpoint for the event subscription destination. Required. PartnerDestination."""

    __flattened_items = ["resource_id"]

    @overload
    def __init__(
        self,
        *,
        properties: Optional["_models.PartnerEventSubscriptionDestinationProperties"] = 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:
        _flattened_input = {k: kwargs.pop(k) for k in kwargs.keys() & self.__flattened_items}
        super().__init__(*args, **kwargs)
        for k, v in _flattened_input.items():
            setattr(self, k, v)

    def __getattr__(self, name: str) -> Any:
        if name in self.__flattened_items:
            if self.properties is None:
                return None
            return getattr(self.properties, name)
        raise AttributeError(f"'{self.__class__.__name__}' object has no attribute '{name}'")

    def __setattr__(self, key: str, value: Any) -> None:
        if key in self.__flattened_items:
            if self.properties is None:
                self.properties = self._attr_to_rest_field["properties"]._class_type()
            setattr(self.properties, key, value)
        else:
            super().__setattr__(key, value)


class PartnerEventSubscriptionDestinationProperties(_Model):  # pylint: disable=name-too-long
    """PartnerEventSubscriptionDestinationProperties.

    :ivar resource_id: The Azure Resource Id that represents the endpoint of a Partner Destination
     of an event subscription.
    :vartype resource_id: str
    """

    resource_id: Optional[str] = rest_field(
        name="resourceId", visibility=["read", "create", "update", "delete", "query"]
    )
    """The Azure Resource Id that represents the endpoint of a Partner Destination of an event
     subscription."""

    @overload
    def __init__(
        self,
        *,
        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 PartnerNamespace(TrackedResource):
    """EventGrid Partner Namespace.

    :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.eventgrid.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: Properties of the Partner Namespace.
    :vartype properties: ~azure.mgmt.eventgrid.models.PartnerNamespaceProperties
    """

    properties: Optional["_models.PartnerNamespaceProperties"] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """Properties of the Partner Namespace."""

    __flattened_items = [
        "private_endpoint_connections",
        "provisioning_state",
        "partner_registration_fully_qualified_id",
        "minimum_tls_version_allowed",
        "endpoint",
        "public_network_access",
        "inbound_ip_rules",
        "disable_local_auth",
        "partner_topic_routing_mode",
    ]

    @overload
    def __init__(
        self,
        *,
        location: str,
        tags: Optional[dict[str, str]] = None,
        properties: Optional["_models.PartnerNamespaceProperties"] = 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:
        _flattened_input = {k: kwargs.pop(k) for k in kwargs.keys() & self.__flattened_items}
        super().__init__(*args, **kwargs)
        for k, v in _flattened_input.items():
            setattr(self, k, v)

    def __getattr__(self, name: str) -> Any:
        if name in self.__flattened_items:
            if self.properties is None:
                return None
            return getattr(self.properties, name)
        raise AttributeError(f"'{self.__class__.__name__}' object has no attribute '{name}'")

    def __setattr__(self, key: str, value: Any) -> None:
        if key in self.__flattened_items:
            if self.properties is None:
                self.properties = self._attr_to_rest_field["properties"]._class_type()
            setattr(self.properties, key, value)
        else:
            super().__setattr__(key, value)


class PartnerNamespaceProperties(_Model):
    """Properties of the partner namespace.

    :ivar private_endpoint_connections: List of private endpoint connections.
    :vartype private_endpoint_connections:
     list[~azure.mgmt.eventgrid.models.PrivateEndpointConnection]
    :ivar provisioning_state: Provisioning state of the partner namespace. Known values are:
     "Creating", "Updating", "Deleting", "Succeeded", "Canceled", and "Failed".
    :vartype provisioning_state: str or
     ~azure.mgmt.eventgrid.models.PartnerNamespaceProvisioningState
    :ivar partner_registration_fully_qualified_id: The fully qualified ARM Id of the partner
     registration that should be associated with this partner namespace. This takes the following
     format:
     /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/partnerRegistrations/{partnerRegistrationName}.
    :vartype partner_registration_fully_qualified_id: str
    :ivar minimum_tls_version_allowed: Minimum TLS version of the publisher allowed to publish to
     this partner namespace. Known values are: "1.0", "1.1", and "1.2".
    :vartype minimum_tls_version_allowed: str or ~azure.mgmt.eventgrid.models.TlsVersion
    :ivar endpoint: Endpoint for the partner namespace.
    :vartype endpoint: str
    :ivar public_network_access: This determines if traffic is allowed over public network. By
     default it is enabled. You can further restrict to specific IPs by configuring <seealso
     cref="P:Microsoft.Azure.Events.ResourceProvider.Common.Contracts.PartnerNamespaceProperties.InboundIpRules"
     />. Known values are: "Enabled", "Disabled", and "SecuredByPerimeter".
    :vartype public_network_access: str or ~azure.mgmt.eventgrid.models.PublicNetworkAccess
    :ivar inbound_ip_rules: This can be used to restrict traffic from specific IPs instead of all
     IPs. Note: These are considered only if PublicNetworkAccess is enabled.
    :vartype inbound_ip_rules: list[~azure.mgmt.eventgrid.models.InboundIpRule]
    :ivar disable_local_auth: This boolean is used to enable or disable local auth. Default value
     is false. When the property is set to true, only Microsoft Entra ID token will be used to
     authenticate if user is allowed to publish to the partner namespace.
    :vartype disable_local_auth: bool
    :ivar partner_topic_routing_mode: This determines if events published to this partner namespace
     should use the source attribute in the event payload or use the channel name in the header when
     matching to the partner topic. If none is specified, source attribute routing will be used to
     match the partner topic. Known values are: "SourceEventAttribute" and "ChannelNameHeader".
    :vartype partner_topic_routing_mode: str or
     ~azure.mgmt.eventgrid.models.PartnerTopicRoutingMode
    """

    private_endpoint_connections: Optional[list["_models.PrivateEndpointConnection"]] = rest_field(
        name="privateEndpointConnections", visibility=["read"]
    )
    """List of private endpoint connections."""
    provisioning_state: Optional[Union[str, "_models.PartnerNamespaceProvisioningState"]] = rest_field(
        name="provisioningState", visibility=["read"]
    )
    """Provisioning state of the partner namespace. Known values are: \"Creating\", \"Updating\",
     \"Deleting\", \"Succeeded\", \"Canceled\", and \"Failed\"."""
    partner_registration_fully_qualified_id: Optional[str] = rest_field(
        name="partnerRegistrationFullyQualifiedId", visibility=["read", "create", "update", "delete", "query"]
    )
    """The fully qualified ARM Id of the partner registration that should be associated with this
     partner namespace. This takes the following format:
     /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/partnerRegistrations/{partnerRegistrationName}."""
    minimum_tls_version_allowed: Optional[Union[str, "_models.TlsVersion"]] = rest_field(
        name="minimumTlsVersionAllowed", visibility=["read", "create", "update", "delete", "query"]
    )
    """Minimum TLS version of the publisher allowed to publish to this partner namespace. Known values
     are: \"1.0\", \"1.1\", and \"1.2\"."""
    endpoint: Optional[str] = rest_field(visibility=["read"])
    """Endpoint for the partner namespace."""
    public_network_access: Optional[Union[str, "_models.PublicNetworkAccess"]] = rest_field(
        name="publicNetworkAccess", visibility=["read", "create", "update", "delete", "query"]
    )
    """This determines if traffic is allowed over public network. By default it is enabled. You can
     further restrict to specific IPs by configuring <seealso
     cref=\"P:Microsoft.Azure.Events.ResourceProvider.Common.Contracts.PartnerNamespaceProperties.InboundIpRules\"
     />. Known values are: \"Enabled\", \"Disabled\", and \"SecuredByPerimeter\"."""
    inbound_ip_rules: Optional[list["_models.InboundIpRule"]] = rest_field(
        name="inboundIpRules", visibility=["read", "create", "update", "delete", "query"]
    )
    """This can be used to restrict traffic from specific IPs instead of all IPs. Note: These are
     considered only if PublicNetworkAccess is enabled."""
    disable_local_auth: Optional[bool] = rest_field(
        name="disableLocalAuth", visibility=["read", "create", "update", "delete", "query"]
    )
    """This boolean is used to enable or disable local auth. Default value is false. When the property
     is set to true, only Microsoft Entra ID token will be used to authenticate if user is allowed
     to publish to the partner namespace."""
    partner_topic_routing_mode: Optional[Union[str, "_models.PartnerTopicRoutingMode"]] = rest_field(
        name="partnerTopicRoutingMode", visibility=["read", "create", "update", "delete", "query"]
    )
    """This determines if events published to this partner namespace should use the source attribute
     in the event payload or use the channel name in the header when matching to the partner topic.
     If none is specified, source attribute routing will be used to match the partner topic. Known
     values are: \"SourceEventAttribute\" and \"ChannelNameHeader\"."""

    @overload
    def __init__(
        self,
        *,
        partner_registration_fully_qualified_id: Optional[str] = None,
        minimum_tls_version_allowed: Optional[Union[str, "_models.TlsVersion"]] = None,
        public_network_access: Optional[Union[str, "_models.PublicNetworkAccess"]] = None,
        inbound_ip_rules: Optional[list["_models.InboundIpRule"]] = None,
        disable_local_auth: Optional[bool] = None,
        partner_topic_routing_mode: Optional[Union[str, "_models.PartnerTopicRoutingMode"]] = 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 PartnerNamespaceRegenerateKeyRequest(_Model):
    """PartnerNamespace regenerate shared access key request.

    :ivar key_name: Key name to regenerate (key1 or key2). Required.
    :vartype key_name: str
    """

    key_name: str = rest_field(name="keyName", visibility=["read", "create", "update", "delete", "query"])
    """Key name to regenerate (key1 or key2). Required."""

    @overload
    def __init__(
        self,
        *,
        key_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 PartnerNamespaceSharedAccessKeys(_Model):
    """Shared access keys of the partner namespace.

    :ivar key1: Shared access key1 for the partner namespace.
    :vartype key1: str
    :ivar key2: Shared access key2 for the partner namespace.
    :vartype key2: str
    """

    key1: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """Shared access key1 for the partner namespace."""
    key2: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """Shared access key2 for the partner namespace."""

    @overload
    def __init__(
        self,
        *,
        key1: Optional[str] = None,
        key2: 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 PartnerNamespaceUpdateParameterProperties(_Model):  # pylint: disable=name-too-long
    """Information of Partner Namespace update parameter properties.

    :ivar public_network_access: This determines if traffic is allowed over public network. By
     default it is enabled. You can further restrict to specific IPs by configuring <seealso
     cref="P:Microsoft.Azure.Events.ResourceProvider.Common.Contracts.PartnerNamespaceUpdateParameterProperties.InboundIpRules"
     />. Known values are: "Enabled", "Disabled", and "SecuredByPerimeter".
    :vartype public_network_access: str or ~azure.mgmt.eventgrid.models.PublicNetworkAccess
    :ivar inbound_ip_rules: This can be used to restrict traffic from specific IPs instead of all
     IPs. Note: These are considered only if PublicNetworkAccess is enabled.
    :vartype inbound_ip_rules: list[~azure.mgmt.eventgrid.models.InboundIpRule]
    :ivar minimum_tls_version_allowed: Minimum TLS version of the publisher allowed to publish to
     this domain. Known values are: "1.0", "1.1", and "1.2".
    :vartype minimum_tls_version_allowed: str or ~azure.mgmt.eventgrid.models.TlsVersion
    :ivar disable_local_auth: This boolean is used to enable or disable local auth. Default value
     is false. When the property is set to true, only Microsoft Entra ID token will be used to
     authenticate if user is allowed to publish to the partner namespace.
    :vartype disable_local_auth: bool
    """

    public_network_access: Optional[Union[str, "_models.PublicNetworkAccess"]] = rest_field(
        name="publicNetworkAccess", visibility=["read", "create", "update", "delete", "query"]
    )
    """This determines if traffic is allowed over public network. By default it is enabled. You can
     further restrict to specific IPs by configuring <seealso
     cref=\"P:Microsoft.Azure.Events.ResourceProvider.Common.Contracts.PartnerNamespaceUpdateParameterProperties.InboundIpRules\"
     />. Known values are: \"Enabled\", \"Disabled\", and \"SecuredByPerimeter\"."""
    inbound_ip_rules: Optional[list["_models.InboundIpRule"]] = rest_field(
        name="inboundIpRules", visibility=["read", "create", "update", "delete", "query"]
    )
    """This can be used to restrict traffic from specific IPs instead of all IPs. Note: These are
     considered only if PublicNetworkAccess is enabled."""
    minimum_tls_version_allowed: Optional[Union[str, "_models.TlsVersion"]] = rest_field(
        name="minimumTlsVersionAllowed", visibility=["read", "create", "update", "delete", "query"]
    )
    """Minimum TLS version of the publisher allowed to publish to this domain. Known values are:
     \"1.0\", \"1.1\", and \"1.2\"."""
    disable_local_auth: Optional[bool] = rest_field(
        name="disableLocalAuth", visibility=["read", "create", "update", "delete", "query"]
    )
    """This boolean is used to enable or disable local auth. Default value is false. When the property
     is set to true, only Microsoft Entra ID token will be used to authenticate if user is allowed
     to publish to the partner namespace."""

    @overload
    def __init__(
        self,
        *,
        public_network_access: Optional[Union[str, "_models.PublicNetworkAccess"]] = None,
        inbound_ip_rules: Optional[list["_models.InboundIpRule"]] = None,
        minimum_tls_version_allowed: Optional[Union[str, "_models.TlsVersion"]] = None,
        disable_local_auth: 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 PartnerNamespaceUpdateParameters(_Model):
    """Properties of the Partner Namespace update.

    :ivar tags: Tags of the Partner Namespace.
    :vartype tags: dict[str, str]
    :ivar properties: Properties of the Partner Namespace.
    :vartype properties: ~azure.mgmt.eventgrid.models.PartnerNamespaceUpdateParameterProperties
    """

    tags: Optional[dict[str, str]] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """Tags of the Partner Namespace."""
    properties: Optional["_models.PartnerNamespaceUpdateParameterProperties"] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """Properties of the Partner Namespace."""

    __flattened_items = [
        "public_network_access",
        "inbound_ip_rules",
        "minimum_tls_version_allowed",
        "disable_local_auth",
    ]

    @overload
    def __init__(
        self,
        *,
        tags: Optional[dict[str, str]] = None,
        properties: Optional["_models.PartnerNamespaceUpdateParameterProperties"] = 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:
        _flattened_input = {k: kwargs.pop(k) for k in kwargs.keys() & self.__flattened_items}
        super().__init__(*args, **kwargs)
        for k, v in _flattened_input.items():
            setattr(self, k, v)

    def __getattr__(self, name: str) -> Any:
        if name in self.__flattened_items:
            if self.properties is None:
                return None
            return getattr(self.properties, name)
        raise AttributeError(f"'{self.__class__.__name__}' object has no attribute '{name}'")

    def __setattr__(self, key: str, value: Any) -> None:
        if key in self.__flattened_items:
            if self.properties is None:
                self.properties = self._attr_to_rest_field["properties"]._class_type()
            setattr(self.properties, key, value)
        else:
            super().__setattr__(key, value)


class PartnerRegistration(TrackedResource):
    """Information about a partner registration.

    :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.eventgrid.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: Properties of the partner registration.
    :vartype properties: ~azure.mgmt.eventgrid.models.PartnerRegistrationProperties
    """

    properties: Optional["_models.PartnerRegistrationProperties"] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """Properties of the partner registration."""

    __flattened_items = ["provisioning_state", "partner_registration_immutable_id"]

    @overload
    def __init__(
        self,
        *,
        location: str,
        tags: Optional[dict[str, str]] = None,
        properties: Optional["_models.PartnerRegistrationProperties"] = 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:
        _flattened_input = {k: kwargs.pop(k) for k in kwargs.keys() & self.__flattened_items}
        super().__init__(*args, **kwargs)
        for k, v in _flattened_input.items():
            setattr(self, k, v)

    def __getattr__(self, name: str) -> Any:
        if name in self.__flattened_items:
            if self.properties is None:
                return None
            return getattr(self.properties, name)
        raise AttributeError(f"'{self.__class__.__name__}' object has no attribute '{name}'")

    def __setattr__(self, key: str, value: Any) -> None:
        if key in self.__flattened_items:
            if self.properties is None:
                self.properties = self._attr_to_rest_field["properties"]._class_type()
            setattr(self.properties, key, value)
        else:
            super().__setattr__(key, value)


class PartnerRegistrationProperties(_Model):
    """Properties of the partner registration.

    :ivar provisioning_state: Provisioning state of the partner registration. Known values are:
     "Creating", "Updating", "Deleting", "Succeeded", "Canceled", and "Failed".
    :vartype provisioning_state: str or
     ~azure.mgmt.eventgrid.models.PartnerRegistrationProvisioningState
    :ivar partner_registration_immutable_id: The immutableId of the corresponding partner
     registration. Note: This property is marked for deprecation and is not supported in any future
     GA API version.
    :vartype partner_registration_immutable_id: str
    """

    provisioning_state: Optional[Union[str, "_models.PartnerRegistrationProvisioningState"]] = rest_field(
        name="provisioningState", visibility=["read"]
    )
    """Provisioning state of the partner registration. Known values are: \"Creating\", \"Updating\",
     \"Deleting\", \"Succeeded\", \"Canceled\", and \"Failed\"."""
    partner_registration_immutable_id: Optional[str] = rest_field(
        name="partnerRegistrationImmutableId", visibility=["read", "create", "update", "delete", "query"]
    )
    """The immutableId of the corresponding partner registration. Note: This property is marked for
     deprecation and is not supported in any future GA API version."""

    @overload
    def __init__(
        self,
        *,
        partner_registration_immutable_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 PartnerRegistrationUpdateParameters(_Model):
    """Properties of the Partner Registration update.

    :ivar tags: Tags of the partner registration resource.
    :vartype tags: dict[str, str]
    """

    tags: Optional[dict[str, str]] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """Tags of the partner registration resource."""

    @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 PartnerTopic(TrackedResource):
    """Event Grid Partner Topic.

    :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.eventgrid.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: Properties of the Partner Topic.
    :vartype properties: ~azure.mgmt.eventgrid.models.PartnerTopicProperties
    :ivar identity: Identity information for the Partner Topic resource.
    :vartype identity: ~azure.mgmt.eventgrid.models.IdentityInfo
    """

    properties: Optional["_models.PartnerTopicProperties"] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """Properties of the Partner Topic."""
    identity: Optional["_models.IdentityInfo"] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """Identity information for the Partner Topic resource."""

    __flattened_items = [
        "partner_registration_immutable_id",
        "source",
        "event_type_info",
        "expiration_time_if_not_activated_utc",
        "provisioning_state",
        "activation_state",
        "partner_topic_friendly_description",
        "message_for_activation",
    ]

    @overload
    def __init__(
        self,
        *,
        location: str,
        tags: Optional[dict[str, str]] = None,
        properties: Optional["_models.PartnerTopicProperties"] = None,
        identity: Optional["_models.IdentityInfo"] = 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:
        _flattened_input = {k: kwargs.pop(k) for k in kwargs.keys() & self.__flattened_items}
        super().__init__(*args, **kwargs)
        for k, v in _flattened_input.items():
            setattr(self, k, v)

    def __getattr__(self, name: str) -> Any:
        if name in self.__flattened_items:
            if self.properties is None:
                return None
            return getattr(self.properties, name)
        raise AttributeError(f"'{self.__class__.__name__}' object has no attribute '{name}'")

    def __setattr__(self, key: str, value: Any) -> None:
        if key in self.__flattened_items:
            if self.properties is None:
                self.properties = self._attr_to_rest_field["properties"]._class_type()
            setattr(self.properties, key, value)
        else:
            super().__setattr__(key, value)


class PartnerTopicInfo(_Model):
    """Properties of the corresponding partner topic of a Channel.

    :ivar azure_subscription_id: Azure subscription ID of the subscriber. The partner topic
     associated with the channel will be created under this Azure subscription.
    :vartype azure_subscription_id: str
    :ivar resource_group_name: Azure Resource Group of the subscriber. The partner topic associated
     with the channel will be created under this resource group.
    :vartype resource_group_name: str
    :ivar name: Name of the partner topic associated with the channel.
    :vartype name: str
    :ivar event_type_info: Event Type Information for the partner topic. This information is
     provided by the publisher and can be used by the subscriber to view different types of events
     that are published.
    :vartype event_type_info: ~azure.mgmt.eventgrid.models.EventTypeInfo
    :ivar source: The source information is provided by the publisher to determine the scope or
     context from which the events are originating. This information can be used by the subscriber
     during the approval process of the created partner topic.
    :vartype source: str
    """

    azure_subscription_id: Optional[str] = rest_field(
        name="azureSubscriptionId", visibility=["read", "create", "update", "delete", "query"]
    )
    """Azure subscription ID of the subscriber. The partner topic associated with the channel will be
     created under this Azure subscription."""
    resource_group_name: Optional[str] = rest_field(
        name="resourceGroupName", visibility=["read", "create", "update", "delete", "query"]
    )
    """Azure Resource Group of the subscriber. The partner topic associated with the channel will be
     created under this resource group."""
    name: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """Name of the partner topic associated with the channel."""
    event_type_info: Optional["_models.EventTypeInfo"] = rest_field(
        name="eventTypeInfo", visibility=["read", "create", "update", "delete", "query"]
    )
    """Event Type Information for the partner topic. This information is provided by the publisher and
     can be used by the subscriber to view different types of events that are published."""
    source: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """The source information is provided by the publisher to determine the scope or context from
     which the events are originating. This information can be used by the subscriber during the
     approval process of the created partner topic."""

    @overload
    def __init__(
        self,
        *,
        azure_subscription_id: Optional[str] = None,
        resource_group_name: Optional[str] = None,
        name: Optional[str] = None,
        event_type_info: Optional["_models.EventTypeInfo"] = None,
        source: 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 PartnerTopicProperties(_Model):
    """Properties of the Partner Topic.

    :ivar partner_registration_immutable_id: The immutableId of the corresponding partner
     registration.
    :vartype partner_registration_immutable_id: str
    :ivar source: Source associated with this partner topic. This represents a unique partner
     resource.
    :vartype source: str
    :ivar event_type_info: Event Type information from the corresponding event channel.
    :vartype event_type_info: ~azure.mgmt.eventgrid.models.EventTypeInfo
    :ivar expiration_time_if_not_activated_utc: Expiration time of the partner topic. If this timer
     expires while the partner topic is still never activated, the partner topic and corresponding
     event channel are deleted.
    :vartype expiration_time_if_not_activated_utc: ~datetime.datetime
    :ivar provisioning_state: Provisioning state of the partner topic. Known values are:
     "Creating", "Updating", "Deleting", "Succeeded", "Canceled", "Failed", and
     "IdleDueToMirroredChannelResourceDeletion".
    :vartype provisioning_state: str or ~azure.mgmt.eventgrid.models.PartnerTopicProvisioningState
    :ivar activation_state: Activation state of the partner topic. Known values are:
     "NeverActivated", "Activated", and "Deactivated".
    :vartype activation_state: str or ~azure.mgmt.eventgrid.models.PartnerTopicActivationState
    :ivar partner_topic_friendly_description: Friendly description about the topic. This can be set
     by the publisher/partner to show custom description for the customer partner topic. This will
     be helpful to remove any ambiguity of the origin of creation of the partner topic for the
     customer.
    :vartype partner_topic_friendly_description: str
    :ivar message_for_activation: Context or helpful message that can be used during the approval
     process by the subscriber.
    :vartype message_for_activation: str
    """

    partner_registration_immutable_id: Optional[str] = rest_field(
        name="partnerRegistrationImmutableId", visibility=["read", "create", "update", "delete", "query"]
    )
    """The immutableId of the corresponding partner registration."""
    source: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """Source associated with this partner topic. This represents a unique partner resource."""
    event_type_info: Optional["_models.EventTypeInfo"] = rest_field(
        name="eventTypeInfo", visibility=["read", "create", "update", "delete", "query"]
    )
    """Event Type information from the corresponding event channel."""
    expiration_time_if_not_activated_utc: Optional[datetime.datetime] = rest_field(
        name="expirationTimeIfNotActivatedUtc",
        visibility=["read", "create", "update", "delete", "query"],
        format="rfc3339",
    )
    """Expiration time of the partner topic. If this timer expires while the partner topic is still
     never activated, the partner topic and corresponding event channel are deleted."""
    provisioning_state: Optional[Union[str, "_models.PartnerTopicProvisioningState"]] = rest_field(
        name="provisioningState", visibility=["read"]
    )
    """Provisioning state of the partner topic. Known values are: \"Creating\", \"Updating\",
     \"Deleting\", \"Succeeded\", \"Canceled\", \"Failed\", and
     \"IdleDueToMirroredChannelResourceDeletion\"."""
    activation_state: Optional[Union[str, "_models.PartnerTopicActivationState"]] = rest_field(
        name="activationState", visibility=["read", "create", "update", "delete", "query"]
    )
    """Activation state of the partner topic. Known values are: \"NeverActivated\", \"Activated\", and
     \"Deactivated\"."""
    partner_topic_friendly_description: Optional[str] = rest_field(
        name="partnerTopicFriendlyDescription", visibility=["read", "create", "update", "delete", "query"]
    )
    """Friendly description about the topic. This can be set by the publisher/partner to show custom
     description for the customer partner topic. This will be helpful to remove any ambiguity of the
     origin of creation of the partner topic for the customer."""
    message_for_activation: Optional[str] = rest_field(
        name="messageForActivation", visibility=["read", "create", "update", "delete", "query"]
    )
    """Context or helpful message that can be used during the approval process by the subscriber."""

    @overload
    def __init__(
        self,
        *,
        partner_registration_immutable_id: Optional[str] = None,
        source: Optional[str] = None,
        event_type_info: Optional["_models.EventTypeInfo"] = None,
        expiration_time_if_not_activated_utc: Optional[datetime.datetime] = None,
        activation_state: Optional[Union[str, "_models.PartnerTopicActivationState"]] = None,
        partner_topic_friendly_description: Optional[str] = None,
        message_for_activation: 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 PartnerTopicUpdateParameters(_Model):
    """Properties of the Partner Topic update.

    :ivar tags: Tags of the Partner Topic resource.
    :vartype tags: dict[str, str]
    :ivar identity: Identity information for the Partner Topic resource.
    :vartype identity: ~azure.mgmt.eventgrid.models.IdentityInfo
    """

    tags: Optional[dict[str, str]] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """Tags of the Partner Topic resource."""
    identity: Optional["_models.IdentityInfo"] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """Identity information for the Partner Topic resource."""

    @overload
    def __init__(
        self,
        *,
        tags: Optional[dict[str, str]] = None,
        identity: Optional["_models.IdentityInfo"] = 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 PartnerUpdateDestinationInfo(_Model):
    """Properties of the corresponding partner destination of a Channel.

    You probably want to use the sub-classes and not this class directly. Known sub-classes are:
    WebhookUpdatePartnerDestinationInfo

    :ivar endpoint_type: Type of the endpoint for the partner destination. Required. "WebHook"
    :vartype endpoint_type: str or ~azure.mgmt.eventgrid.models.PartnerEndpointType
    """

    __mapping__: dict[str, _Model] = {}
    endpoint_type: str = rest_discriminator(
        name="endpointType", visibility=["read", "create", "update", "delete", "query"]
    )
    """Type of the endpoint for the partner destination. Required. \"WebHook\""""

    @overload
    def __init__(
        self,
        *,
        endpoint_type: 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 PartnerUpdateTopicInfo(_Model):
    """Update properties for the corresponding partner topic of a channel.

    :ivar event_type_info: Event type info for the partner topic.
    :vartype event_type_info: ~azure.mgmt.eventgrid.models.EventTypeInfo
    """

    event_type_info: Optional["_models.EventTypeInfo"] = rest_field(
        name="eventTypeInfo", visibility=["read", "create", "update", "delete", "query"]
    )
    """Event type info for the partner topic."""

    @overload
    def __init__(
        self,
        *,
        event_type_info: Optional["_models.EventTypeInfo"] = 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 PermissionBinding(ProxyResource):
    """The Permission binding 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.eventgrid.models.SystemData
    :ivar properties: The properties of permission binding.
    :vartype properties: ~azure.mgmt.eventgrid.models.PermissionBindingProperties
    """

    properties: Optional["_models.PermissionBindingProperties"] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """The properties of permission binding."""

    __flattened_items = ["description", "topic_space_name", "permission", "client_group_name", "provisioning_state"]

    @overload
    def __init__(
        self,
        *,
        properties: Optional["_models.PermissionBindingProperties"] = 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:
        _flattened_input = {k: kwargs.pop(k) for k in kwargs.keys() & self.__flattened_items}
        super().__init__(*args, **kwargs)
        for k, v in _flattened_input.items():
            setattr(self, k, v)

    def __getattr__(self, name: str) -> Any:
        if name in self.__flattened_items:
            if self.properties is None:
                return None
            return getattr(self.properties, name)
        raise AttributeError(f"'{self.__class__.__name__}' object has no attribute '{name}'")

    def __setattr__(self, key: str, value: Any) -> None:
        if key in self.__flattened_items:
            if self.properties is None:
                self.properties = self._attr_to_rest_field["properties"]._class_type()
            setattr(self.properties, key, value)
        else:
            super().__setattr__(key, value)


class PermissionBindingProperties(_Model):
    """The properties of permission binding.

    :ivar description: Description for the Permission Binding resource.
    :vartype description: str
    :ivar topic_space_name: The name of the Topic Space resource that the permission is bound to.
     The Topic space needs to be a resource under the same namespace the permission binding is a
     part of.
    :vartype topic_space_name: str
    :ivar permission: The allowed permission. Known values are: "Publisher" and "Subscriber".
    :vartype permission: str or ~azure.mgmt.eventgrid.models.PermissionType
    :ivar client_group_name: The name of the client group resource that the permission is bound to.
     The client group needs to be a resource under the same namespace the permission binding is a
     part of.
    :vartype client_group_name: str
    :ivar provisioning_state: Provisioning state of the PermissionBinding resource. Known values
     are: "Creating", "Updating", "Deleting", "Succeeded", "Canceled", "Failed", and "Deleted".
    :vartype provisioning_state: str or
     ~azure.mgmt.eventgrid.models.PermissionBindingProvisioningState
    """

    description: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """Description for the Permission Binding resource."""
    topic_space_name: Optional[str] = rest_field(
        name="topicSpaceName", visibility=["read", "create", "update", "delete", "query"]
    )
    """The name of the Topic Space resource that the permission is bound to. The Topic space needs to
     be a resource under the same namespace the permission binding is a part of."""
    permission: Optional[Union[str, "_models.PermissionType"]] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """The allowed permission. Known values are: \"Publisher\" and \"Subscriber\"."""
    client_group_name: Optional[str] = rest_field(
        name="clientGroupName", visibility=["read", "create", "update", "delete", "query"]
    )
    """The name of the client group resource that the permission is bound to. The client group needs
     to be a resource under the same namespace the permission binding is a part of."""
    provisioning_state: Optional[Union[str, "_models.PermissionBindingProvisioningState"]] = rest_field(
        name="provisioningState", visibility=["read"]
    )
    """Provisioning state of the PermissionBinding resource. Known values are: \"Creating\",
     \"Updating\", \"Deleting\", \"Succeeded\", \"Canceled\", \"Failed\", and \"Deleted\"."""

    @overload
    def __init__(
        self,
        *,
        description: Optional[str] = None,
        topic_space_name: Optional[str] = None,
        permission: Optional[Union[str, "_models.PermissionType"]] = None,
        client_group_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 PlatformCapabilities(_Model):
    """Platform capabilities properties of the resource.

    :ivar confidential_compute: Represents the Azure Confidential Compute properties of the
     resource.
    :vartype confidential_compute: ~azure.mgmt.eventgrid.models.ConfidentialCompute
    """

    confidential_compute: Optional["_models.ConfidentialCompute"] = rest_field(
        name="confidentialCompute", visibility=["read", "create", "update", "delete", "query"]
    )
    """Represents the Azure Confidential Compute properties of the resource."""

    @overload
    def __init__(
        self,
        *,
        confidential_compute: Optional["_models.ConfidentialCompute"] = 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 PrivateEndpoint(_Model):
    """PrivateEndpoint information.

    :ivar id: The ARM identifier for Private Endpoint.
    :vartype id: str
    """

    id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """The ARM identifier for Private Endpoint."""

    @overload
    def __init__(
        self,
        *,
        id: Optional[str] = None,  # pylint: disable=redefined-builtin
    ) -> 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 PrivateEndpointConnection(ProxyResource):
    """Concrete proxy resource types can be created by aliasing this type using a specific property
    type.

    :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.eventgrid.models.SystemData
    :ivar properties: Properties of the PrivateEndpointConnection.
    :vartype properties: ~azure.mgmt.eventgrid.models.PrivateEndpointConnectionProperties
    """

    properties: Optional["_models.PrivateEndpointConnectionProperties"] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """Properties of the PrivateEndpointConnection."""

    __flattened_items = ["private_endpoint", "group_ids", "private_link_service_connection_state", "provisioning_state"]

    @overload
    def __init__(
        self,
        *,
        properties: Optional["_models.PrivateEndpointConnectionProperties"] = 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:
        _flattened_input = {k: kwargs.pop(k) for k in kwargs.keys() & self.__flattened_items}
        super().__init__(*args, **kwargs)
        for k, v in _flattened_input.items():
            setattr(self, k, v)

    def __getattr__(self, name: str) -> Any:
        if name in self.__flattened_items:
            if self.properties is None:
                return None
            return getattr(self.properties, name)
        raise AttributeError(f"'{self.__class__.__name__}' object has no attribute '{name}'")

    def __setattr__(self, key: str, value: Any) -> None:
        if key in self.__flattened_items:
            if self.properties is None:
                self.properties = self._attr_to_rest_field["properties"]._class_type()
            setattr(self.properties, key, value)
        else:
            super().__setattr__(key, value)


class PrivateEndpointConnectionProperties(_Model):
    """Properties of the private endpoint connection resource.

    :ivar private_endpoint: The Private Endpoint resource for this Connection.
    :vartype private_endpoint: ~azure.mgmt.eventgrid.models.PrivateEndpoint
    :ivar group_ids: GroupIds from the private link service resource.
    :vartype group_ids: list[str]
    :ivar private_link_service_connection_state: Details about the state of the connection.
    :vartype private_link_service_connection_state: ~azure.mgmt.eventgrid.models.ConnectionState
    :ivar provisioning_state: Provisioning state of the Private Endpoint Connection. Known values
     are: "Creating", "Updating", "Deleting", "Succeeded", "Canceled", and "Failed".
    :vartype provisioning_state: str or ~azure.mgmt.eventgrid.models.ResourceProvisioningState
    """

    private_endpoint: Optional["_models.PrivateEndpoint"] = rest_field(
        name="privateEndpoint", visibility=["read", "create", "update", "delete", "query"]
    )
    """The Private Endpoint resource for this Connection."""
    group_ids: Optional[list[str]] = rest_field(
        name="groupIds", visibility=["read", "create", "update", "delete", "query"]
    )
    """GroupIds from the private link service resource."""
    private_link_service_connection_state: Optional["_models.ConnectionState"] = rest_field(
        name="privateLinkServiceConnectionState", visibility=["read", "create", "update", "delete", "query"]
    )
    """Details about the state of the connection."""
    provisioning_state: Optional[Union[str, "_models.ResourceProvisioningState"]] = rest_field(
        name="provisioningState", visibility=["read", "create", "update", "delete", "query"]
    )
    """Provisioning state of the Private Endpoint Connection. Known values are: \"Creating\",
     \"Updating\", \"Deleting\", \"Succeeded\", \"Canceled\", and \"Failed\"."""

    @overload
    def __init__(
        self,
        *,
        private_endpoint: Optional["_models.PrivateEndpoint"] = None,
        group_ids: Optional[list[str]] = None,
        private_link_service_connection_state: Optional["_models.ConnectionState"] = None,
        provisioning_state: Optional[Union[str, "_models.ResourceProvisioningState"]] = 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 PrivateLinkResource(_Model):
    """Information of the private link resource.

    :ivar properties: Properties of the private link resource.
    :vartype properties: ~azure.mgmt.eventgrid.models.PrivateLinkResourceProperties
    :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 private link resource will be either topic, domain, partnerNamespace or
     namespace.
    :vartype name: str
    :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or
     "Microsoft.Storage/storageAccounts".
    :vartype type: str
    """

    properties: Optional["_models.PrivateLinkResourceProperties"] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """Properties of the private link resource."""
    id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """Fully qualified resource ID for the resource. Ex -
     /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}."""
    name: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """The name of private link resource will be either topic, domain, partnerNamespace or namespace."""
    type: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """The type of the resource. E.g. \"Microsoft.Compute/virtualMachines\" or
     \"Microsoft.Storage/storageAccounts\"."""

    __flattened_items = ["group_id", "display_name", "required_members", "required_zone_names"]

    @overload
    def __init__(
        self,
        *,
        properties: Optional["_models.PrivateLinkResourceProperties"] = None,
        id: Optional[str] = None,  # pylint: disable=redefined-builtin
        name: Optional[str] = None,
        type: 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:
        _flattened_input = {k: kwargs.pop(k) for k in kwargs.keys() & self.__flattened_items}
        super().__init__(*args, **kwargs)
        for k, v in _flattened_input.items():
            setattr(self, k, v)

    def __getattr__(self, name: str) -> Any:
        if name in self.__flattened_items:
            if self.properties is None:
                return None
            return getattr(self.properties, name)
        raise AttributeError(f"'{self.__class__.__name__}' object has no attribute '{name}'")

    def __setattr__(self, key: str, value: Any) -> None:
        if key in self.__flattened_items:
            if self.properties is None:
                self.properties = self._attr_to_rest_field["properties"]._class_type()
            setattr(self.properties, key, value)
        else:
            super().__setattr__(key, value)


class PrivateLinkResourceProperties(_Model):
    """PrivateLinkResourceProperties.

    :ivar group_id:
    :vartype group_id: str
    :ivar display_name:
    :vartype display_name: str
    :ivar required_members:
    :vartype required_members: list[str]
    :ivar required_zone_names:
    :vartype required_zone_names: list[str]
    """

    group_id: Optional[str] = rest_field(name="groupId", visibility=["read", "create", "update", "delete", "query"])
    display_name: Optional[str] = rest_field(
        name="displayName", visibility=["read", "create", "update", "delete", "query"]
    )
    required_members: Optional[list[str]] = rest_field(
        name="requiredMembers", visibility=["read", "create", "update", "delete", "query"]
    )
    required_zone_names: Optional[list[str]] = rest_field(
        name="requiredZoneNames", visibility=["read", "create", "update", "delete", "query"]
    )

    @overload
    def __init__(
        self,
        *,
        group_id: Optional[str] = None,
        display_name: 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 PushInfo(_Model):
    """Properties of the destination info for event subscription supporting push.

    :ivar max_delivery_count: The maximum delivery count of the events.
    :vartype max_delivery_count: int
    :ivar event_time_to_live: Time span duration in ISO 8601 format that determines how long
     messages are available to the subscription from the time the message was published. This
     duration value is expressed using the following format: \\'P(n)Y(n)M(n)DT(n)H(n)M(n)S\\',
     where:

     * (n) is replaced by the value of each time element that follows the (n).
     * P is the duration (or Period) designator and is always placed at the beginning of the
       duration.
     * Y is the year designator, and it follows the value for the number of years.
     * M is the month designator, and it follows the value for the number of months.
     * W is the week designator, and it follows the value for the number of weeks.
     * D is the day designator, and it follows the value for the number of days.
     * T is the time designator, and it precedes the time components.
     * H is the hour designator, and it follows the value for the number of hours.
     * M is the minute designator, and it follows the value for the number of minutes.
     * S is the second designator, and it follows the value for the number of seconds.
     This duration value cannot be set greater than the topic’s EventRetentionInDays. It is is
     an optional field where its minimum value is 1 minute, and its maximum is determined
     by topic’s EventRetentionInDays value. The followings are examples of valid values:
     * \\'P0DT23H12M\\' or \\'PT23H12M\\': for duration of 23 hours and 12 minutes.
     * \\'P1D\\' or \\'P1DT0H0M0S\\': for duration of 1 day.
    :vartype event_time_to_live: str
    :ivar dead_letter_destination_with_resource_identity: The dead letter destination of the event
     subscription. Any event that cannot be delivered to its' destination is sent to the dead letter
     destination. Uses the managed identity setup on the parent resource (namely, namespace) to
     acquire the authentication tokens being used during dead-lettering.
    :vartype dead_letter_destination_with_resource_identity:
     ~azure.mgmt.eventgrid.models.DeadLetterWithResourceIdentity
    :ivar delivery_with_resource_identity: Information about the destination where events have to
     be delivered for the event subscription. Uses the managed identity setup on the parent resource
     (namely, topic or domain) to acquire the authentication tokens being used during delivery.
    :vartype delivery_with_resource_identity:
     ~azure.mgmt.eventgrid.models.DeliveryWithResourceIdentity
    :ivar destination: Information about the destination where events have to be delivered for the
     event subscription. Uses Azure Event Grid's identity to acquire the authentication tokens being
     used during delivery.
    :vartype destination: ~azure.mgmt.eventgrid.models.EventSubscriptionDestination
    """

    max_delivery_count: Optional[int] = rest_field(
        name="maxDeliveryCount", visibility=["read", "create", "update", "delete", "query"]
    )
    """The maximum delivery count of the events."""
    event_time_to_live: Optional[str] = rest_field(
        name="eventTimeToLive", visibility=["read", "create", "update", "delete", "query"]
    )
    """Time span duration in ISO 8601 format that determines how long messages are available to the
      subscription from the time the message was published. This duration value is expressed using
      the following format: \'P(n)Y(n)M(n)DT(n)H(n)M(n)S\', where:
 
      * (n) is replaced by the value of each time element that follows the (n).
      * P is the duration (or Period) designator and is always placed at the beginning of the
        duration.
      * Y is the year designator, and it follows the value for the number of years.
      * M is the month designator, and it follows the value for the number of months.
      * W is the week designator, and it follows the value for the number of weeks.
      * D is the day designator, and it follows the value for the number of days.
      * T is the time designator, and it precedes the time components.
      * H is the hour designator, and it follows the value for the number of hours.
      * M is the minute designator, and it follows the value for the number of minutes.
      * S is the second designator, and it follows the value for the number of seconds.
      This duration value cannot be set greater than the topic’s EventRetentionInDays. It is is
      an optional field where its minimum value is 1 minute, and its maximum is determined
      by topic’s EventRetentionInDays value. The followings are examples of valid values:
      * \'P0DT23H12M\' or \'PT23H12M\': for duration of 23 hours and 12 minutes.
      * \'P1D\' or \'P1DT0H0M0S\': for duration of 1 day."""
    dead_letter_destination_with_resource_identity: Optional["_models.DeadLetterWithResourceIdentity"] = rest_field(
        name="deadLetterDestinationWithResourceIdentity", visibility=["read", "create", "update", "delete", "query"]
    )
    """The dead letter destination of the event subscription. Any event that cannot be delivered to
     its' destination is sent to the dead letter destination. Uses the managed identity setup on the
     parent resource (namely, namespace) to acquire the authentication tokens being used during
     dead-lettering."""
    delivery_with_resource_identity: Optional["_models.DeliveryWithResourceIdentity"] = rest_field(
        name="deliveryWithResourceIdentity", visibility=["read", "create", "update", "delete", "query"]
    )
    """Information about the destination where events have to be delivered for the event subscription.
     Uses the managed identity setup on the parent resource (namely, topic or domain) to acquire the
     authentication tokens being used during delivery."""
    destination: Optional["_models.EventSubscriptionDestination"] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """Information about the destination where events have to be delivered for the event subscription.
     Uses Azure Event Grid's identity to acquire the authentication tokens being used during
     delivery."""

    @overload
    def __init__(
        self,
        *,
        max_delivery_count: Optional[int] = None,
        event_time_to_live: Optional[str] = None,
        dead_letter_destination_with_resource_identity: Optional["_models.DeadLetterWithResourceIdentity"] = None,
        delivery_with_resource_identity: Optional["_models.DeliveryWithResourceIdentity"] = None,
        destination: Optional["_models.EventSubscriptionDestination"] = 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 QueueInfo(_Model):
    """Properties of the Queue info for event subscription.

    :ivar receive_lock_duration_in_seconds: Maximum period in seconds in which once the message is
     in received (by the client) state and waiting to be accepted, released or rejected. If this
     time elapsed after a message has been received by the client and not transitioned into accepted
     (not processed), released or rejected, the message is available for redelivery. This is an
     optional field, where default is 60 seconds, minimum is 60 seconds and maximum is 300 seconds.
    :vartype receive_lock_duration_in_seconds: int
    :ivar max_delivery_count: The maximum delivery count of the events.
    :vartype max_delivery_count: int
    :ivar dead_letter_destination_with_resource_identity: The dead letter destination of the event
     subscription. Any event that cannot be delivered to its' destination is sent to the dead letter
     destination. Uses the managed identity setup on the parent resource (namely, topic) to acquire
     the authentication tokens being used during delivery / dead-lettering.
    :vartype dead_letter_destination_with_resource_identity:
     ~azure.mgmt.eventgrid.models.DeadLetterWithResourceIdentity
    :ivar event_time_to_live: Time span duration in ISO 8601 format that determines how long
     messages are available to the subscription from the time the message was published. This
     duration value is expressed using the following format: \\'P(n)Y(n)M(n)DT(n)H(n)M(n)S\\',
     where:

     * (n) is replaced by the value of each time element that follows the (n).
     * P is the duration (or Period) designator and is always placed at the beginning of the
       duration.
     * Y is the year designator, and it follows the value for the number of years.
     * M is the month designator, and it follows the value for the number of months.
     * W is the week designator, and it follows the value for the number of weeks.
     * D is the day designator, and it follows the value for the number of days.
     * T is the time designator, and it precedes the time components.
     * H is the hour designator, and it follows the value for the number of hours.
     * M is the minute designator, and it follows the value for the number of minutes.
     * S is the second designator, and it follows the value for the number of seconds.
     This duration value cannot be set greater than the topic’s EventRetentionInDays. It is is
     an optional field where its minimum value is 1 minute, and its maximum is determined
     by topic’s EventRetentionInDays value. The followings are examples of valid values:
     * \\'P0DT23H12M\\' or \\'PT23H12M\\': for duration of 23 hours and 12 minutes.
     * \\'P1D\\' or \\'P1DT0H0M0S\\': for duration of 1 day.
    :vartype event_time_to_live: ~datetime.timedelta
    """

    receive_lock_duration_in_seconds: Optional[int] = rest_field(
        name="receiveLockDurationInSeconds", visibility=["read", "create", "update", "delete", "query"]
    )
    """Maximum period in seconds in which once the message is in received (by the client) state and
     waiting to be accepted, released or rejected. If this time elapsed after a message has been
     received by the client and not transitioned into accepted (not processed), released or
     rejected, the message is available for redelivery. This is an optional field, where default is
     60 seconds, minimum is 60 seconds and maximum is 300 seconds."""
    max_delivery_count: Optional[int] = rest_field(
        name="maxDeliveryCount", visibility=["read", "create", "update", "delete", "query"]
    )
    """The maximum delivery count of the events."""
    dead_letter_destination_with_resource_identity: Optional["_models.DeadLetterWithResourceIdentity"] = rest_field(
        name="deadLetterDestinationWithResourceIdentity", visibility=["read", "create", "update", "delete", "query"]
    )
    """The dead letter destination of the event subscription. Any event that cannot be delivered to
     its' destination is sent to the dead letter destination. Uses the managed identity setup on the
     parent resource (namely, topic) to acquire the authentication tokens being used during delivery
     / dead-lettering."""
    event_time_to_live: Optional[datetime.timedelta] = rest_field(
        name="eventTimeToLive", visibility=["read", "create", "update", "delete", "query"]
    )
    """Time span duration in ISO 8601 format that determines how long messages are available to the
      subscription from the time the message was published. This duration value is expressed using
      the following format: \'P(n)Y(n)M(n)DT(n)H(n)M(n)S\', where:
 
      * (n) is replaced by the value of each time element that follows the (n).
      * P is the duration (or Period) designator and is always placed at the beginning of the
        duration.
      * Y is the year designator, and it follows the value for the number of years.
      * M is the month designator, and it follows the value for the number of months.
      * W is the week designator, and it follows the value for the number of weeks.
      * D is the day designator, and it follows the value for the number of days.
      * T is the time designator, and it precedes the time components.
      * H is the hour designator, and it follows the value for the number of hours.
      * M is the minute designator, and it follows the value for the number of minutes.
      * S is the second designator, and it follows the value for the number of seconds.
      This duration value cannot be set greater than the topic’s EventRetentionInDays. It is is
      an optional field where its minimum value is 1 minute, and its maximum is determined
      by topic’s EventRetentionInDays value. The followings are examples of valid values:
      * \'P0DT23H12M\' or \'PT23H12M\': for duration of 23 hours and 12 minutes.
      * \'P1D\' or \'P1DT0H0M0S\': for duration of 1 day."""

    @overload
    def __init__(
        self,
        *,
        receive_lock_duration_in_seconds: Optional[int] = None,
        max_delivery_count: Optional[int] = None,
        dead_letter_destination_with_resource_identity: Optional["_models.DeadLetterWithResourceIdentity"] = None,
        event_time_to_live: Optional[datetime.timedelta] = 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 ResourceAssociation(_Model):
    """Nsp resource association.

    :ivar name: Association name.
    :vartype name: str
    :ivar access_mode: Network security perimeter access mode. Known values are: "Learning",
     "Enforced", and "Audit".
    :vartype access_mode: str or
     ~azure.mgmt.eventgrid.models.NetworkSecurityPerimeterAssociationAccessMode
    """

    name: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """Association name."""
    access_mode: Optional[Union[str, "_models.NetworkSecurityPerimeterAssociationAccessMode"]] = rest_field(
        name="accessMode", visibility=["read", "create", "update", "delete", "query"]
    )
    """Network security perimeter access mode. Known values are: \"Learning\", \"Enforced\", and
     \"Audit\"."""

    @overload
    def __init__(
        self,
        *,
        name: Optional[str] = None,
        access_mode: Optional[Union[str, "_models.NetworkSecurityPerimeterAssociationAccessMode"]] = 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 ResourceMoveChangeHistory(_Model):
    """The change history of the resource move.

    :ivar azure_subscription_id: Azure subscription ID of the resource.
    :vartype azure_subscription_id: str
    :ivar resource_group_name: Azure Resource Group of the resource.
    :vartype resource_group_name: str
    :ivar changed_time_utc: UTC timestamp of when the resource was changed.
    :vartype changed_time_utc: ~datetime.datetime
    """

    azure_subscription_id: Optional[str] = rest_field(
        name="azureSubscriptionId", visibility=["read", "create", "update", "delete", "query"]
    )
    """Azure subscription ID of the resource."""
    resource_group_name: Optional[str] = rest_field(
        name="resourceGroupName", visibility=["read", "create", "update", "delete", "query"]
    )
    """Azure Resource Group of the resource."""
    changed_time_utc: Optional[datetime.datetime] = rest_field(
        name="changedTimeUtc", visibility=["read", "create", "update", "delete", "query"], format="rfc3339"
    )
    """UTC timestamp of when the resource was changed."""

    @overload
    def __init__(
        self,
        *,
        azure_subscription_id: Optional[str] = None,
        resource_group_name: Optional[str] = None,
        changed_time_utc: 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 ResourceSku(_Model):
    """Describes an EventGrid Resource Sku.

    :ivar name: The Sku name of the resource. The possible values are: Basic or Premium. Known
     values are: "Basic" and "Premium".
    :vartype name: str or ~azure.mgmt.eventgrid.models.Sku
    """

    name: Optional[Union[str, "_models.Sku"]] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """The Sku name of the resource. The possible values are: Basic or Premium. Known values are:
     \"Basic\" and \"Premium\"."""

    @overload
    def __init__(
        self,
        *,
        name: Optional[Union[str, "_models.Sku"]] = 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 RetryPolicy(_Model):
    """Information about the retry policy for an event subscription.

    :ivar max_delivery_attempts: Maximum number of delivery retry attempts for events.
    :vartype max_delivery_attempts: int
    :ivar event_time_to_live_in_minutes: Time To Live (in minutes) for events.
    :vartype event_time_to_live_in_minutes: int
    """

    max_delivery_attempts: Optional[int] = rest_field(
        name="maxDeliveryAttempts", visibility=["read", "create", "update", "delete", "query"]
    )
    """Maximum number of delivery retry attempts for events."""
    event_time_to_live_in_minutes: Optional[int] = rest_field(
        name="eventTimeToLiveInMinutes", visibility=["read", "create", "update", "delete", "query"]
    )
    """Time To Live (in minutes) for events."""

    @overload
    def __init__(
        self,
        *,
        max_delivery_attempts: Optional[int] = None,
        event_time_to_live_in_minutes: 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 RoutingEnrichments(_Model):
    """RoutingEnrichments.

    :ivar static:
    :vartype static: list[~azure.mgmt.eventgrid.models.StaticRoutingEnrichment]
    :ivar dynamic:
    :vartype dynamic: list[~azure.mgmt.eventgrid.models.DynamicRoutingEnrichment]
    """

    static: Optional[list["_models.StaticRoutingEnrichment"]] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    dynamic: Optional[list["_models.DynamicRoutingEnrichment"]] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )

    @overload
    def __init__(
        self,
        *,
        static: Optional[list["_models.StaticRoutingEnrichment"]] = None,
        dynamic: Optional[list["_models.DynamicRoutingEnrichment"]] = 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 RoutingIdentityInfo(_Model):
    """Routing identity info for topic spaces configuration.

    :ivar type: Routing identity type for topic spaces configuration. Known values are: "None",
     "SystemAssigned", and "UserAssigned".
    :vartype type: str or ~azure.mgmt.eventgrid.models.RoutingIdentityType
    :ivar user_assigned_identity:
    :vartype user_assigned_identity: str
    """

    type: Optional[Union[str, "_models.RoutingIdentityType"]] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """Routing identity type for topic spaces configuration. Known values are: \"None\",
     \"SystemAssigned\", and \"UserAssigned\"."""
    user_assigned_identity: Optional[str] = rest_field(
        name="userAssignedIdentity", visibility=["read", "create", "update", "delete", "query"]
    )

    @overload
    def __init__(
        self,
        *,
        type: Optional[Union[str, "_models.RoutingIdentityType"]] = None,
        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 ServiceBusQueueEventSubscriptionDestination(
    EventSubscriptionDestination, discriminator="ServiceBusQueue"
):  # pylint: disable=name-too-long
    """Information about the service bus destination for an event subscription.

    :ivar properties: Service Bus Properties of the event subscription destination.
    :vartype properties:
     ~azure.mgmt.eventgrid.models.ServiceBusQueueEventSubscriptionDestinationProperties
    :ivar endpoint_type: Type of the endpoint for the event subscription destination. Required.
     ServiceBusQueue.
    :vartype endpoint_type: str or ~azure.mgmt.eventgrid.models.SERVICE_BUS_QUEUE
    """

    properties: Optional["_models.ServiceBusQueueEventSubscriptionDestinationProperties"] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """Service Bus Properties of the event subscription destination."""
    endpoint_type: Literal[EndpointType.SERVICE_BUS_QUEUE] = rest_discriminator(name="endpointType", visibility=["read", "create", "update", "delete", "query"])  # type: ignore
    """Type of the endpoint for the event subscription destination. Required. ServiceBusQueue."""

    __flattened_items = ["resource_id", "delivery_attribute_mappings"]

    @overload
    def __init__(
        self,
        *,
        properties: Optional["_models.ServiceBusQueueEventSubscriptionDestinationProperties"] = 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:
        _flattened_input = {k: kwargs.pop(k) for k in kwargs.keys() & self.__flattened_items}
        super().__init__(*args, **kwargs)
        for k, v in _flattened_input.items():
            setattr(self, k, v)

    def __getattr__(self, name: str) -> Any:
        if name in self.__flattened_items:
            if self.properties is None:
                return None
            return getattr(self.properties, name)
        raise AttributeError(f"'{self.__class__.__name__}' object has no attribute '{name}'")

    def __setattr__(self, key: str, value: Any) -> None:
        if key in self.__flattened_items:
            if self.properties is None:
                self.properties = self._attr_to_rest_field["properties"]._class_type()
            setattr(self.properties, key, value)
        else:
            super().__setattr__(key, value)


class ServiceBusQueueEventSubscriptionDestinationProperties(_Model):  # pylint: disable=name-too-long
    """The properties that represent the Service Bus destination of an event subscription.

    :ivar resource_id: The Azure Resource Id that represents the endpoint of the Service Bus
     destination of an event subscription.
    :vartype resource_id: str
    :ivar delivery_attribute_mappings: Delivery attribute details.
    :vartype delivery_attribute_mappings:
     list[~azure.mgmt.eventgrid.models.DeliveryAttributeMapping]
    """

    resource_id: Optional[str] = rest_field(
        name="resourceId", visibility=["read", "create", "update", "delete", "query"]
    )
    """The Azure Resource Id that represents the endpoint of the Service Bus destination of an event
     subscription."""
    delivery_attribute_mappings: Optional[list["_models.DeliveryAttributeMapping"]] = rest_field(
        name="deliveryAttributeMappings", visibility=["read", "create", "update", "delete", "query"]
    )
    """Delivery attribute details."""

    @overload
    def __init__(
        self,
        *,
        resource_id: Optional[str] = None,
        delivery_attribute_mappings: Optional[list["_models.DeliveryAttributeMapping"]] = 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 ServiceBusTopicEventSubscriptionDestination(
    EventSubscriptionDestination, discriminator="ServiceBusTopic"
):  # pylint: disable=name-too-long
    """Information about the service bus topic destination for an event subscription.

    :ivar properties: Service Bus Topic Properties of the event subscription destination.
    :vartype properties:
     ~azure.mgmt.eventgrid.models.ServiceBusTopicEventSubscriptionDestinationProperties
    :ivar endpoint_type: Type of the endpoint for the event subscription destination. Required.
     ServiceBusTopic.
    :vartype endpoint_type: str or ~azure.mgmt.eventgrid.models.SERVICE_BUS_TOPIC
    """

    properties: Optional["_models.ServiceBusTopicEventSubscriptionDestinationProperties"] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """Service Bus Topic Properties of the event subscription destination."""
    endpoint_type: Literal[EndpointType.SERVICE_BUS_TOPIC] = rest_discriminator(name="endpointType", visibility=["read", "create", "update", "delete", "query"])  # type: ignore
    """Type of the endpoint for the event subscription destination. Required. ServiceBusTopic."""

    __flattened_items = ["resource_id", "delivery_attribute_mappings"]

    @overload
    def __init__(
        self,
        *,
        properties: Optional["_models.ServiceBusTopicEventSubscriptionDestinationProperties"] = 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:
        _flattened_input = {k: kwargs.pop(k) for k in kwargs.keys() & self.__flattened_items}
        super().__init__(*args, **kwargs)
        for k, v in _flattened_input.items():
            setattr(self, k, v)

    def __getattr__(self, name: str) -> Any:
        if name in self.__flattened_items:
            if self.properties is None:
                return None
            return getattr(self.properties, name)
        raise AttributeError(f"'{self.__class__.__name__}' object has no attribute '{name}'")

    def __setattr__(self, key: str, value: Any) -> None:
        if key in self.__flattened_items:
            if self.properties is None:
                self.properties = self._attr_to_rest_field["properties"]._class_type()
            setattr(self.properties, key, value)
        else:
            super().__setattr__(key, value)


class ServiceBusTopicEventSubscriptionDestinationProperties(_Model):  # pylint: disable=name-too-long
    """The properties that represent the Service Bus Topic destination of an event subscription.

    :ivar resource_id: The Azure Resource Id that represents the endpoint of the Service Bus Topic
     destination of an event subscription.
    :vartype resource_id: str
    :ivar delivery_attribute_mappings: Delivery attribute details.
    :vartype delivery_attribute_mappings:
     list[~azure.mgmt.eventgrid.models.DeliveryAttributeMapping]
    """

    resource_id: Optional[str] = rest_field(
        name="resourceId", visibility=["read", "create", "update", "delete", "query"]
    )
    """The Azure Resource Id that represents the endpoint of the Service Bus Topic destination of an
     event subscription."""
    delivery_attribute_mappings: Optional[list["_models.DeliveryAttributeMapping"]] = rest_field(
        name="deliveryAttributeMappings", visibility=["read", "create", "update", "delete", "query"]
    )
    """Delivery attribute details."""

    @overload
    def __init__(
        self,
        *,
        resource_id: Optional[str] = None,
        delivery_attribute_mappings: Optional[list["_models.DeliveryAttributeMapping"]] = 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 StaticDeliveryAttributeMapping(DeliveryAttributeMapping, discriminator="Static"):
    """Static delivery attribute mapping details.

    :ivar name: Name of the delivery attribute or header.
    :vartype name: str
    :ivar properties: Properties of static delivery attribute mapping.
    :vartype properties: ~azure.mgmt.eventgrid.models.StaticDeliveryAttributeMappingProperties
    :ivar type: Type of the delivery attribute or header name. Required. Static.
    :vartype type: str or ~azure.mgmt.eventgrid.models.STATIC
    """

    properties: Optional["_models.StaticDeliveryAttributeMappingProperties"] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """Properties of static delivery attribute mapping."""
    type: Literal[DeliveryAttributeMappingType.STATIC] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"])  # type: ignore
    """Type of the delivery attribute or header name. Required. Static."""

    __flattened_items = ["value", "is_secret"]

    @overload
    def __init__(
        self,
        *,
        name: Optional[str] = None,
        properties: Optional["_models.StaticDeliveryAttributeMappingProperties"] = 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:
        _flattened_input = {k: kwargs.pop(k) for k in kwargs.keys() & self.__flattened_items}
        super().__init__(*args, **kwargs)
        for k, v in _flattened_input.items():
            setattr(self, k, v)

    def __getattr__(self, name: str) -> Any:
        if name in self.__flattened_items:
            if self.properties is None:
                return None
            return getattr(self.properties, name)
        raise AttributeError(f"'{self.__class__.__name__}' object has no attribute '{name}'")

    def __setattr__(self, key: str, value: Any) -> None:
        if key in self.__flattened_items:
            if self.properties is None:
                self.properties = self._attr_to_rest_field["properties"]._class_type()
            setattr(self.properties, key, value)
        else:
            super().__setattr__(key, value)


class StaticDeliveryAttributeMappingProperties(_Model):
    """Properties of static delivery attribute mapping.

    :ivar value: Value of the delivery attribute.
    :vartype value: str
    :ivar is_secret: Boolean flag to tell if the attribute contains sensitive information .
    :vartype is_secret: bool
    """

    value: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """Value of the delivery attribute."""
    is_secret: Optional[bool] = rest_field(name="isSecret", visibility=["read", "create", "update", "delete", "query"])
    """Boolean flag to tell if the attribute contains sensitive information ."""

    @overload
    def __init__(
        self,
        *,
        value: Optional[str] = None,
        is_secret: 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 StaticRoutingEnrichment(_Model):
    """Static routing enrichment details.

    You probably want to use the sub-classes and not this class directly. Known sub-classes are:
    StaticStringRoutingEnrichment

    :ivar key: Static routing enrichment key.
    :vartype key: str
    :ivar value_type: Static routing enrichment value type. For e.g. this property value can be
     'String'. Required. "String"
    :vartype value_type: str or ~azure.mgmt.eventgrid.models.StaticRoutingEnrichmentType
    """

    __mapping__: dict[str, _Model] = {}
    key: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """Static routing enrichment key."""
    value_type: str = rest_discriminator(name="valueType", visibility=["read", "create", "update", "delete", "query"])
    """Static routing enrichment value type. For e.g. this property value can be 'String'. Required.
     \"String\""""

    @overload
    def __init__(
        self,
        *,
        value_type: str,
        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 StaticStringRoutingEnrichment(StaticRoutingEnrichment, discriminator="String"):
    """StaticStringRoutingEnrichment.

    :ivar key: Static routing enrichment key.
    :vartype key: str
    :ivar value: String type routing enrichment value.
    :vartype value: str
    :ivar value_type: Static routing enrichment value type. For e.g. this property value can be
     'String'. Required. String.
    :vartype value_type: str or ~azure.mgmt.eventgrid.models.STRING
    """

    value: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """String type routing enrichment value."""
    value_type: Literal[StaticRoutingEnrichmentType.STRING] = rest_discriminator(name="valueType", visibility=["read", "create", "update", "delete", "query"])  # type: ignore
    """Static routing enrichment value type. For e.g. this property value can be 'String'. Required.
     String."""

    @overload
    def __init__(
        self,
        *,
        key: Optional[str] = None,
        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)
        self.value_type = StaticRoutingEnrichmentType.STRING  # type: ignore


class StorageBlobDeadLetterDestination(DeadLetterDestination, discriminator="StorageBlob"):
    """Information about the storage blob based dead letter destination.

    :ivar properties: The properties of the Storage Blob based deadletter destination.
    :vartype properties: ~azure.mgmt.eventgrid.models.StorageBlobDeadLetterDestinationProperties
    :ivar endpoint_type: Type of the endpoint for the dead letter destination. Required.
     StorageBlob.
    :vartype endpoint_type: str or ~azure.mgmt.eventgrid.models.STORAGE_BLOB
    """

    properties: Optional["_models.StorageBlobDeadLetterDestinationProperties"] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """The properties of the Storage Blob based deadletter destination."""
    endpoint_type: Literal[DeadLetterEndPointType.STORAGE_BLOB] = rest_discriminator(name="endpointType", visibility=["read", "create", "update", "delete", "query"])  # type: ignore
    """Type of the endpoint for the dead letter destination. Required. StorageBlob."""

    __flattened_items = ["resource_id", "blob_container_name"]

    @overload
    def __init__(
        self,
        *,
        properties: Optional["_models.StorageBlobDeadLetterDestinationProperties"] = 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:
        _flattened_input = {k: kwargs.pop(k) for k in kwargs.keys() & self.__flattened_items}
        super().__init__(*args, **kwargs)
        for k, v in _flattened_input.items():
            setattr(self, k, v)

    def __getattr__(self, name: str) -> Any:
        if name in self.__flattened_items:
            if self.properties is None:
                return None
            return getattr(self.properties, name)
        raise AttributeError(f"'{self.__class__.__name__}' object has no attribute '{name}'")

    def __setattr__(self, key: str, value: Any) -> None:
        if key in self.__flattened_items:
            if self.properties is None:
                self.properties = self._attr_to_rest_field["properties"]._class_type()
            setattr(self.properties, key, value)
        else:
            super().__setattr__(key, value)


class StorageBlobDeadLetterDestinationProperties(_Model):  # pylint: disable=name-too-long
    """Properties of the storage blob based dead letter destination.

    :ivar resource_id: The Azure Resource ID of the storage account that is the destination of the
     deadletter events.
    :vartype resource_id: str
    :ivar blob_container_name: The name of the Storage blob container that is the destination of
     the deadletter events.
    :vartype blob_container_name: str
    """

    resource_id: Optional[str] = rest_field(
        name="resourceId", visibility=["read", "create", "update", "delete", "query"]
    )
    """The Azure Resource ID of the storage account that is the destination of the deadletter events."""
    blob_container_name: Optional[str] = rest_field(
        name="blobContainerName", visibility=["read", "create", "update", "delete", "query"]
    )
    """The name of the Storage blob container that is the destination of the deadletter events."""

    @overload
    def __init__(
        self,
        *,
        resource_id: Optional[str] = None,
        blob_container_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 StorageQueueEventSubscriptionDestination(EventSubscriptionDestination, discriminator="StorageQueue"):
    """Information about the storage queue destination for an event subscription.

    :ivar properties: Storage Queue Properties of the event subscription destination.
    :vartype properties:
     ~azure.mgmt.eventgrid.models.StorageQueueEventSubscriptionDestinationProperties
    :ivar endpoint_type: Type of the endpoint for the event subscription destination. Required.
     StorageQueue.
    :vartype endpoint_type: str or ~azure.mgmt.eventgrid.models.STORAGE_QUEUE
    """

    properties: Optional["_models.StorageQueueEventSubscriptionDestinationProperties"] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """Storage Queue Properties of the event subscription destination."""
    endpoint_type: Literal[EndpointType.STORAGE_QUEUE] = rest_discriminator(name="endpointType", visibility=["read", "create", "update", "delete", "query"])  # type: ignore
    """Type of the endpoint for the event subscription destination. Required. StorageQueue."""

    __flattened_items = ["resource_id", "queue_name", "queue_message_time_to_live_in_seconds"]

    @overload
    def __init__(
        self,
        *,
        properties: Optional["_models.StorageQueueEventSubscriptionDestinationProperties"] = 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:
        _flattened_input = {k: kwargs.pop(k) for k in kwargs.keys() & self.__flattened_items}
        super().__init__(*args, **kwargs)
        for k, v in _flattened_input.items():
            setattr(self, k, v)

    def __getattr__(self, name: str) -> Any:
        if name in self.__flattened_items:
            if self.properties is None:
                return None
            return getattr(self.properties, name)
        raise AttributeError(f"'{self.__class__.__name__}' object has no attribute '{name}'")

    def __setattr__(self, key: str, value: Any) -> None:
        if key in self.__flattened_items:
            if self.properties is None:
                self.properties = self._attr_to_rest_field["properties"]._class_type()
            setattr(self.properties, key, value)
        else:
            super().__setattr__(key, value)


class StorageQueueEventSubscriptionDestinationProperties(_Model):  # pylint: disable=name-too-long
    """The properties for a storage queue destination.

    :ivar resource_id: The Azure Resource ID of the storage account that contains the queue that is
     the destination of an event subscription.
    :vartype resource_id: str
    :ivar queue_name: The name of the Storage queue under a storage account that is the destination
     of an event subscription.
    :vartype queue_name: str
    :ivar queue_message_time_to_live_in_seconds: Storage queue message time to live in seconds.
     This value cannot be zero or negative with the exception of using -1 to indicate that the Time
     To Live of the message is Infinite.
    :vartype queue_message_time_to_live_in_seconds: int
    """

    resource_id: Optional[str] = rest_field(
        name="resourceId", visibility=["read", "create", "update", "delete", "query"]
    )
    """The Azure Resource ID of the storage account that contains the queue that is the destination of
     an event subscription."""
    queue_name: Optional[str] = rest_field(name="queueName", visibility=["read", "create", "update", "delete", "query"])
    """The name of the Storage queue under a storage account that is the destination of an event
     subscription."""
    queue_message_time_to_live_in_seconds: Optional[int] = rest_field(
        name="queueMessageTimeToLiveInSeconds", visibility=["read", "create", "update", "delete", "query"]
    )
    """Storage queue message time to live in seconds. This value cannot be zero or negative with the
     exception of using -1 to indicate that the Time To Live of the message is Infinite."""

    @overload
    def __init__(
        self,
        *,
        resource_id: Optional[str] = None,
        queue_name: Optional[str] = None,
        queue_message_time_to_live_in_seconds: 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 StringBeginsWithAdvancedFilter(AdvancedFilter, discriminator="StringBeginsWith"):
    """StringBeginsWith Advanced Filter.

    :ivar key: The field/property in the event based on which you want to filter.
    :vartype key: str
    :ivar values_property: The set of filter values.
    :vartype values_property: list[str]
    :ivar operator_type: The operator type used for filtering, e.g., NumberIn, StringContains,
     BoolEquals and others. Required. StringBeginsWith.
    :vartype operator_type: str or ~azure.mgmt.eventgrid.models.STRING_BEGINS_WITH
    """

    values_property: Optional[list[str]] = rest_field(
        name="values", visibility=["read", "create", "update", "delete", "query"], original_tsp_name="values"
    )
    """The set of filter values."""
    operator_type: Literal[AdvancedFilterOperatorType.STRING_BEGINS_WITH] = rest_discriminator(name="operatorType", visibility=["read", "create", "update", "delete", "query"])  # type: ignore
    """The operator type used for filtering, e.g., NumberIn, StringContains, BoolEquals and others.
     Required. StringBeginsWith."""

    @overload
    def __init__(
        self,
        *,
        key: Optional[str] = None,
        values_property: 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)
        self.operator_type = AdvancedFilterOperatorType.STRING_BEGINS_WITH  # type: ignore


class StringBeginsWithFilter(Filter, discriminator="StringBeginsWith"):
    """StringBeginsWith Filter.

    :ivar key: The field/property in the event based on which you want to filter.
    :vartype key: str
    :ivar values_property: The set of filter values.
    :vartype values_property: list[str]
    :ivar operator_type: The operator type used for filtering, e.g., NumberIn, StringContains,
     BoolEquals and others. Required. StringBeginsWith.
    :vartype operator_type: str or ~azure.mgmt.eventgrid.models.STRING_BEGINS_WITH
    """

    values_property: Optional[list[str]] = rest_field(
        name="values", visibility=["read", "create", "update", "delete", "query"], original_tsp_name="values"
    )
    """The set of filter values."""
    operator_type: Literal[FilterOperatorType.STRING_BEGINS_WITH] = rest_discriminator(name="operatorType", visibility=["read", "create", "update", "delete", "query"])  # type: ignore
    """The operator type used for filtering, e.g., NumberIn, StringContains, BoolEquals and others.
     Required. StringBeginsWith."""

    @overload
    def __init__(
        self,
        *,
        key: Optional[str] = None,
        values_property: 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)
        self.operator_type = FilterOperatorType.STRING_BEGINS_WITH  # type: ignore


class StringContainsAdvancedFilter(AdvancedFilter, discriminator="StringContains"):
    """StringContains Advanced Filter.

    :ivar key: The field/property in the event based on which you want to filter.
    :vartype key: str
    :ivar values_property: The set of filter values.
    :vartype values_property: list[str]
    :ivar operator_type: The operator type used for filtering, e.g., NumberIn, StringContains,
     BoolEquals and others. Required. StringContains.
    :vartype operator_type: str or ~azure.mgmt.eventgrid.models.STRING_CONTAINS
    """

    values_property: Optional[list[str]] = rest_field(
        name="values", visibility=["read", "create", "update", "delete", "query"], original_tsp_name="values"
    )
    """The set of filter values."""
    operator_type: Literal[AdvancedFilterOperatorType.STRING_CONTAINS] = rest_discriminator(name="operatorType", visibility=["read", "create", "update", "delete", "query"])  # type: ignore
    """The operator type used for filtering, e.g., NumberIn, StringContains, BoolEquals and others.
     Required. StringContains."""

    @overload
    def __init__(
        self,
        *,
        key: Optional[str] = None,
        values_property: 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)
        self.operator_type = AdvancedFilterOperatorType.STRING_CONTAINS  # type: ignore


class StringContainsFilter(Filter, discriminator="StringContains"):
    """StringContains Filter.

    :ivar key: The field/property in the event based on which you want to filter.
    :vartype key: str
    :ivar values_property: The set of filter values.
    :vartype values_property: list[str]
    :ivar operator_type: The operator type used for filtering, e.g., NumberIn, StringContains,
     BoolEquals and others. Required. StringContains.
    :vartype operator_type: str or ~azure.mgmt.eventgrid.models.STRING_CONTAINS
    """

    values_property: Optional[list[str]] = rest_field(
        name="values", visibility=["read", "create", "update", "delete", "query"], original_tsp_name="values"
    )
    """The set of filter values."""
    operator_type: Literal[FilterOperatorType.STRING_CONTAINS] = rest_discriminator(name="operatorType", visibility=["read", "create", "update", "delete", "query"])  # type: ignore
    """The operator type used for filtering, e.g., NumberIn, StringContains, BoolEquals and others.
     Required. StringContains."""

    @overload
    def __init__(
        self,
        *,
        key: Optional[str] = None,
        values_property: 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)
        self.operator_type = FilterOperatorType.STRING_CONTAINS  # type: ignore


class StringEndsWithAdvancedFilter(AdvancedFilter, discriminator="StringEndsWith"):
    """StringEndsWith Advanced Filter.

    :ivar key: The field/property in the event based on which you want to filter.
    :vartype key: str
    :ivar values_property: The set of filter values.
    :vartype values_property: list[str]
    :ivar operator_type: The operator type used for filtering, e.g., NumberIn, StringContains,
     BoolEquals and others. Required. StringEndsWith.
    :vartype operator_type: str or ~azure.mgmt.eventgrid.models.STRING_ENDS_WITH
    """

    values_property: Optional[list[str]] = rest_field(
        name="values", visibility=["read", "create", "update", "delete", "query"], original_tsp_name="values"
    )
    """The set of filter values."""
    operator_type: Literal[AdvancedFilterOperatorType.STRING_ENDS_WITH] = rest_discriminator(name="operatorType", visibility=["read", "create", "update", "delete", "query"])  # type: ignore
    """The operator type used for filtering, e.g., NumberIn, StringContains, BoolEquals and others.
     Required. StringEndsWith."""

    @overload
    def __init__(
        self,
        *,
        key: Optional[str] = None,
        values_property: 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)
        self.operator_type = AdvancedFilterOperatorType.STRING_ENDS_WITH  # type: ignore


class StringEndsWithFilter(Filter, discriminator="StringEndsWith"):
    """StringEndsWith Filter.

    :ivar key: The field/property in the event based on which you want to filter.
    :vartype key: str
    :ivar values_property: The set of filter values.
    :vartype values_property: list[str]
    :ivar operator_type: The operator type used for filtering, e.g., NumberIn, StringContains,
     BoolEquals and others. Required. StringEndsWith.
    :vartype operator_type: str or ~azure.mgmt.eventgrid.models.STRING_ENDS_WITH
    """

    values_property: Optional[list[str]] = rest_field(
        name="values", visibility=["read", "create", "update", "delete", "query"], original_tsp_name="values"
    )
    """The set of filter values."""
    operator_type: Literal[FilterOperatorType.STRING_ENDS_WITH] = rest_discriminator(name="operatorType", visibility=["read", "create", "update", "delete", "query"])  # type: ignore
    """The operator type used for filtering, e.g., NumberIn, StringContains, BoolEquals and others.
     Required. StringEndsWith."""

    @overload
    def __init__(
        self,
        *,
        key: Optional[str] = None,
        values_property: 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)
        self.operator_type = FilterOperatorType.STRING_ENDS_WITH  # type: ignore


class StringInAdvancedFilter(AdvancedFilter, discriminator="StringIn"):
    """StringIn Advanced Filter.

    :ivar key: The field/property in the event based on which you want to filter.
    :vartype key: str
    :ivar values_property: The set of filter values.
    :vartype values_property: list[str]
    :ivar operator_type: The operator type used for filtering, e.g., NumberIn, StringContains,
     BoolEquals and others. Required. StringIn.
    :vartype operator_type: str or ~azure.mgmt.eventgrid.models.STRING_IN
    """

    values_property: Optional[list[str]] = rest_field(
        name="values", visibility=["read", "create", "update", "delete", "query"], original_tsp_name="values"
    )
    """The set of filter values."""
    operator_type: Literal[AdvancedFilterOperatorType.STRING_IN] = rest_discriminator(name="operatorType", visibility=["read", "create", "update", "delete", "query"])  # type: ignore
    """The operator type used for filtering, e.g., NumberIn, StringContains, BoolEquals and others.
     Required. StringIn."""

    @overload
    def __init__(
        self,
        *,
        key: Optional[str] = None,
        values_property: 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)
        self.operator_type = AdvancedFilterOperatorType.STRING_IN  # type: ignore


class StringInFilter(Filter, discriminator="StringIn"):
    """StringIn Filter.

    :ivar key: The field/property in the event based on which you want to filter.
    :vartype key: str
    :ivar values_property: The set of filter values.
    :vartype values_property: list[str]
    :ivar operator_type: The operator type used for filtering, e.g., NumberIn, StringContains,
     BoolEquals and others. Required. StringIn.
    :vartype operator_type: str or ~azure.mgmt.eventgrid.models.STRING_IN
    """

    values_property: Optional[list[str]] = rest_field(
        name="values", visibility=["read", "create", "update", "delete", "query"], original_tsp_name="values"
    )
    """The set of filter values."""
    operator_type: Literal[FilterOperatorType.STRING_IN] = rest_discriminator(name="operatorType", visibility=["read", "create", "update", "delete", "query"])  # type: ignore
    """The operator type used for filtering, e.g., NumberIn, StringContains, BoolEquals and others.
     Required. StringIn."""

    @overload
    def __init__(
        self,
        *,
        key: Optional[str] = None,
        values_property: 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)
        self.operator_type = FilterOperatorType.STRING_IN  # type: ignore


class StringNotBeginsWithAdvancedFilter(AdvancedFilter, discriminator="StringNotBeginsWith"):
    """StringNotBeginsWith Advanced Filter.

    :ivar key: The field/property in the event based on which you want to filter.
    :vartype key: str
    :ivar values_property: The set of filter values.
    :vartype values_property: list[str]
    :ivar operator_type: The operator type used for filtering, e.g., NumberIn, StringContains,
     BoolEquals and others. Required. StringNotBeginsWith.
    :vartype operator_type: str or ~azure.mgmt.eventgrid.models.STRING_NOT_BEGINS_WITH
    """

    values_property: Optional[list[str]] = rest_field(
        name="values", visibility=["read", "create", "update", "delete", "query"], original_tsp_name="values"
    )
    """The set of filter values."""
    operator_type: Literal[AdvancedFilterOperatorType.STRING_NOT_BEGINS_WITH] = rest_discriminator(name="operatorType", visibility=["read", "create", "update", "delete", "query"])  # type: ignore
    """The operator type used for filtering, e.g., NumberIn, StringContains, BoolEquals and others.
     Required. StringNotBeginsWith."""

    @overload
    def __init__(
        self,
        *,
        key: Optional[str] = None,
        values_property: 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)
        self.operator_type = AdvancedFilterOperatorType.STRING_NOT_BEGINS_WITH  # type: ignore


class StringNotBeginsWithFilter(Filter, discriminator="StringNotBeginsWith"):
    """StringNotBeginsWith Filter.

    :ivar key: The field/property in the event based on which you want to filter.
    :vartype key: str
    :ivar values_property: The set of filter values.
    :vartype values_property: list[str]
    :ivar operator_type: The operator type used for filtering, e.g., NumberIn, StringContains,
     BoolEquals and others. Required. StringNotBeginsWith.
    :vartype operator_type: str or ~azure.mgmt.eventgrid.models.STRING_NOT_BEGINS_WITH
    """

    values_property: Optional[list[str]] = rest_field(
        name="values", visibility=["read", "create", "update", "delete", "query"], original_tsp_name="values"
    )
    """The set of filter values."""
    operator_type: Literal[FilterOperatorType.STRING_NOT_BEGINS_WITH] = rest_discriminator(name="operatorType", visibility=["read", "create", "update", "delete", "query"])  # type: ignore
    """The operator type used for filtering, e.g., NumberIn, StringContains, BoolEquals and others.
     Required. StringNotBeginsWith."""

    @overload
    def __init__(
        self,
        *,
        key: Optional[str] = None,
        values_property: 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)
        self.operator_type = FilterOperatorType.STRING_NOT_BEGINS_WITH  # type: ignore


class StringNotContainsAdvancedFilter(AdvancedFilter, discriminator="StringNotContains"):
    """StringNotContains Advanced Filter.

    :ivar key: The field/property in the event based on which you want to filter.
    :vartype key: str
    :ivar values_property: The set of filter values.
    :vartype values_property: list[str]
    :ivar operator_type: The operator type used for filtering, e.g., NumberIn, StringContains,
     BoolEquals and others. Required. StringNotContains.
    :vartype operator_type: str or ~azure.mgmt.eventgrid.models.STRING_NOT_CONTAINS
    """

    values_property: Optional[list[str]] = rest_field(
        name="values", visibility=["read", "create", "update", "delete", "query"], original_tsp_name="values"
    )
    """The set of filter values."""
    operator_type: Literal[AdvancedFilterOperatorType.STRING_NOT_CONTAINS] = rest_discriminator(name="operatorType", visibility=["read", "create", "update", "delete", "query"])  # type: ignore
    """The operator type used for filtering, e.g., NumberIn, StringContains, BoolEquals and others.
     Required. StringNotContains."""

    @overload
    def __init__(
        self,
        *,
        key: Optional[str] = None,
        values_property: 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)
        self.operator_type = AdvancedFilterOperatorType.STRING_NOT_CONTAINS  # type: ignore


class StringNotContainsFilter(Filter, discriminator="StringNotContains"):
    """StringNotContains Filter.

    :ivar key: The field/property in the event based on which you want to filter.
    :vartype key: str
    :ivar values_property: The set of filter values.
    :vartype values_property: list[str]
    :ivar operator_type: The operator type used for filtering, e.g., NumberIn, StringContains,
     BoolEquals and others. Required. StringNotContains.
    :vartype operator_type: str or ~azure.mgmt.eventgrid.models.STRING_NOT_CONTAINS
    """

    values_property: Optional[list[str]] = rest_field(
        name="values", visibility=["read", "create", "update", "delete", "query"], original_tsp_name="values"
    )
    """The set of filter values."""
    operator_type: Literal[FilterOperatorType.STRING_NOT_CONTAINS] = rest_discriminator(name="operatorType", visibility=["read", "create", "update", "delete", "query"])  # type: ignore
    """The operator type used for filtering, e.g., NumberIn, StringContains, BoolEquals and others.
     Required. StringNotContains."""

    @overload
    def __init__(
        self,
        *,
        key: Optional[str] = None,
        values_property: 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)
        self.operator_type = FilterOperatorType.STRING_NOT_CONTAINS  # type: ignore


class StringNotEndsWithAdvancedFilter(AdvancedFilter, discriminator="StringNotEndsWith"):
    """StringNotEndsWith Advanced Filter.

    :ivar key: The field/property in the event based on which you want to filter.
    :vartype key: str
    :ivar values_property: The set of filter values.
    :vartype values_property: list[str]
    :ivar operator_type: The operator type used for filtering, e.g., NumberIn, StringContains,
     BoolEquals and others. Required. StringNotEndsWith.
    :vartype operator_type: str or ~azure.mgmt.eventgrid.models.STRING_NOT_ENDS_WITH
    """

    values_property: Optional[list[str]] = rest_field(
        name="values", visibility=["read", "create", "update", "delete", "query"], original_tsp_name="values"
    )
    """The set of filter values."""
    operator_type: Literal[AdvancedFilterOperatorType.STRING_NOT_ENDS_WITH] = rest_discriminator(name="operatorType", visibility=["read", "create", "update", "delete", "query"])  # type: ignore
    """The operator type used for filtering, e.g., NumberIn, StringContains, BoolEquals and others.
     Required. StringNotEndsWith."""

    @overload
    def __init__(
        self,
        *,
        key: Optional[str] = None,
        values_property: 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)
        self.operator_type = AdvancedFilterOperatorType.STRING_NOT_ENDS_WITH  # type: ignore


class StringNotEndsWithFilter(Filter, discriminator="StringNotEndsWith"):
    """StringNotEndsWith Filter.

    :ivar key: The field/property in the event based on which you want to filter.
    :vartype key: str
    :ivar values_property: The set of filter values.
    :vartype values_property: list[str]
    :ivar operator_type: The operator type used for filtering, e.g., NumberIn, StringContains,
     BoolEquals and others. Required. StringNotEndsWith.
    :vartype operator_type: str or ~azure.mgmt.eventgrid.models.STRING_NOT_ENDS_WITH
    """

    values_property: Optional[list[str]] = rest_field(
        name="values", visibility=["read", "create", "update", "delete", "query"], original_tsp_name="values"
    )
    """The set of filter values."""
    operator_type: Literal[FilterOperatorType.STRING_NOT_ENDS_WITH] = rest_discriminator(name="operatorType", visibility=["read", "create", "update", "delete", "query"])  # type: ignore
    """The operator type used for filtering, e.g., NumberIn, StringContains, BoolEquals and others.
     Required. StringNotEndsWith."""

    @overload
    def __init__(
        self,
        *,
        key: Optional[str] = None,
        values_property: 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)
        self.operator_type = FilterOperatorType.STRING_NOT_ENDS_WITH  # type: ignore


class StringNotInAdvancedFilter(AdvancedFilter, discriminator="StringNotIn"):
    """StringNotIn Advanced Filter.

    :ivar key: The field/property in the event based on which you want to filter.
    :vartype key: str
    :ivar values_property: The set of filter values.
    :vartype values_property: list[str]
    :ivar operator_type: The operator type used for filtering, e.g., NumberIn, StringContains,
     BoolEquals and others. Required. StringNotIn.
    :vartype operator_type: str or ~azure.mgmt.eventgrid.models.STRING_NOT_IN
    """

    values_property: Optional[list[str]] = rest_field(
        name="values", visibility=["read", "create", "update", "delete", "query"], original_tsp_name="values"
    )
    """The set of filter values."""
    operator_type: Literal[AdvancedFilterOperatorType.STRING_NOT_IN] = rest_discriminator(name="operatorType", visibility=["read", "create", "update", "delete", "query"])  # type: ignore
    """The operator type used for filtering, e.g., NumberIn, StringContains, BoolEquals and others.
     Required. StringNotIn."""

    @overload
    def __init__(
        self,
        *,
        key: Optional[str] = None,
        values_property: 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)
        self.operator_type = AdvancedFilterOperatorType.STRING_NOT_IN  # type: ignore


class StringNotInFilter(Filter, discriminator="StringNotIn"):
    """StringNotIn Filter.

    :ivar key: The field/property in the event based on which you want to filter.
    :vartype key: str
    :ivar values_property: The set of filter values.
    :vartype values_property: list[str]
    :ivar operator_type: The operator type used for filtering, e.g., NumberIn, StringContains,
     BoolEquals and others. Required. StringNotIn.
    :vartype operator_type: str or ~azure.mgmt.eventgrid.models.STRING_NOT_IN
    """

    values_property: Optional[list[str]] = rest_field(
        name="values", visibility=["read", "create", "update", "delete", "query"], original_tsp_name="values"
    )
    """The set of filter values."""
    operator_type: Literal[FilterOperatorType.STRING_NOT_IN] = rest_discriminator(name="operatorType", visibility=["read", "create", "update", "delete", "query"])  # type: ignore
    """The operator type used for filtering, e.g., NumberIn, StringContains, BoolEquals and others.
     Required. StringNotIn."""

    @overload
    def __init__(
        self,
        *,
        key: Optional[str] = None,
        values_property: 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)
        self.operator_type = FilterOperatorType.STRING_NOT_IN  # type: ignore


class Subscription(ProxyResource):
    """Event Subscription.

    :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.eventgrid.models.SystemData
    :ivar properties: Properties of the event subscription.
    :vartype properties: ~azure.mgmt.eventgrid.models.SubscriptionProperties
    """

    properties: Optional["_models.SubscriptionProperties"] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """Properties of the event subscription."""

    __flattened_items = [
        "provisioning_state",
        "delivery_configuration",
        "event_delivery_schema",
        "filters_configuration",
        "expiration_time_utc",
        "tags",
    ]

    @overload
    def __init__(
        self,
        *,
        properties: Optional["_models.SubscriptionProperties"] = 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:
        _flattened_input = {k: kwargs.pop(k) for k in kwargs.keys() & self.__flattened_items}
        super().__init__(*args, **kwargs)
        for k, v in _flattened_input.items():
            setattr(self, k, v)

    def __getattr__(self, name: str) -> Any:
        if name in self.__flattened_items:
            if self.properties is None:
                return None
            return getattr(self.properties, name)
        raise AttributeError(f"'{self.__class__.__name__}' object has no attribute '{name}'")

    def __setattr__(self, key: str, value: Any) -> None:
        if key in self.__flattened_items:
            if self.properties is None:
                self.properties = self._attr_to_rest_field["properties"]._class_type()
            setattr(self.properties, key, value)
        else:
            super().__setattr__(key, value)


class SubscriptionFullUrl(_Model):
    """Full endpoint URL of an event subscription.

    :ivar endpoint_url: The URL that represents the endpoint of the destination of an event
     subscription.
    :vartype endpoint_url: str
    """

    endpoint_url: Optional[str] = rest_field(
        name="endpointUrl", visibility=["read", "create", "update", "delete", "query"]
    )
    """The URL that represents the endpoint of the destination of an event subscription."""

    @overload
    def __init__(
        self,
        *,
        endpoint_url: 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 SubscriptionProperties(_Model):
    """Properties of the event subscription.

    :ivar provisioning_state: Provisioning state of the event subscription. Known values are:
     "Creating", "Updating", "Deleting", "Succeeded", "Canceled", "Failed", "AwaitingManualAction",
     "Deleted", "DeleteFailed", "CreateFailed", and "UpdatedFailed".
    :vartype provisioning_state: str or ~azure.mgmt.eventgrid.models.SubscriptionProvisioningState
    :ivar delivery_configuration: Information about the delivery configuration of the event
     subscription.
    :vartype delivery_configuration: ~azure.mgmt.eventgrid.models.DeliveryConfiguration
    :ivar event_delivery_schema: The event delivery schema for the event subscription.
     "CloudEventSchemaV1_0"
    :vartype event_delivery_schema: str or ~azure.mgmt.eventgrid.models.DeliverySchema
    :ivar filters_configuration: Information about the filter for the event subscription.
    :vartype filters_configuration: ~azure.mgmt.eventgrid.models.FiltersConfiguration
    :ivar expiration_time_utc: Expiration time of the event subscription.
    :vartype expiration_time_utc: ~datetime.datetime
    :ivar tags: Tags relating to Event Subscription resource.
    :vartype tags: dict[str, str]
    """

    provisioning_state: Optional[Union[str, "_models.SubscriptionProvisioningState"]] = rest_field(
        name="provisioningState", visibility=["read"]
    )
    """Provisioning state of the event subscription. Known values are: \"Creating\", \"Updating\",
     \"Deleting\", \"Succeeded\", \"Canceled\", \"Failed\", \"AwaitingManualAction\", \"Deleted\",
     \"DeleteFailed\", \"CreateFailed\", and \"UpdatedFailed\"."""
    delivery_configuration: Optional["_models.DeliveryConfiguration"] = rest_field(
        name="deliveryConfiguration", visibility=["read", "create", "update", "delete", "query"]
    )
    """Information about the delivery configuration of the event subscription."""
    event_delivery_schema: Optional[Union[str, "_models.DeliverySchema"]] = rest_field(
        name="eventDeliverySchema", visibility=["read", "create", "update", "delete", "query"]
    )
    """The event delivery schema for the event subscription. \"CloudEventSchemaV1_0\""""
    filters_configuration: Optional["_models.FiltersConfiguration"] = rest_field(
        name="filtersConfiguration", visibility=["read", "create", "update", "delete", "query"]
    )
    """Information about the filter for the event subscription."""
    expiration_time_utc: Optional[datetime.datetime] = rest_field(
        name="expirationTimeUtc", visibility=["read", "create", "update", "delete", "query"], format="rfc3339"
    )
    """Expiration time of the event subscription."""
    tags: Optional[dict[str, str]] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """Tags relating to Event Subscription resource."""

    @overload
    def __init__(
        self,
        *,
        delivery_configuration: Optional["_models.DeliveryConfiguration"] = None,
        event_delivery_schema: Optional[Union[str, "_models.DeliverySchema"]] = None,
        filters_configuration: Optional["_models.FiltersConfiguration"] = None,
        expiration_time_utc: Optional[datetime.datetime] = None,
        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 SubscriptionUpdateParameters(_Model):
    """Properties of the Event Subscription update.

    :ivar properties: Properties of the Event Subscription update parameters.
    :vartype properties: ~azure.mgmt.eventgrid.models.SubscriptionUpdateParametersProperties
    """

    properties: Optional["_models.SubscriptionUpdateParametersProperties"] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """Properties of the Event Subscription update parameters."""

    __flattened_items = [
        "delivery_configuration",
        "event_delivery_schema",
        "filters_configuration",
        "expiration_time_utc",
        "tags",
    ]

    @overload
    def __init__(
        self,
        *,
        properties: Optional["_models.SubscriptionUpdateParametersProperties"] = 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:
        _flattened_input = {k: kwargs.pop(k) for k in kwargs.keys() & self.__flattened_items}
        super().__init__(*args, **kwargs)
        for k, v in _flattened_input.items():
            setattr(self, k, v)

    def __getattr__(self, name: str) -> Any:
        if name in self.__flattened_items:
            if self.properties is None:
                return None
            return getattr(self.properties, name)
        raise AttributeError(f"'{self.__class__.__name__}' object has no attribute '{name}'")

    def __setattr__(self, key: str, value: Any) -> None:
        if key in self.__flattened_items:
            if self.properties is None:
                self.properties = self._attr_to_rest_field["properties"]._class_type()
            setattr(self.properties, key, value)
        else:
            super().__setattr__(key, value)


class SubscriptionUpdateParametersProperties(_Model):
    """Properties of the Event Subscription update parameters.

    :ivar delivery_configuration: Information about the delivery configuration of the event
     subscription.
    :vartype delivery_configuration: ~azure.mgmt.eventgrid.models.DeliveryConfiguration
    :ivar event_delivery_schema: The event delivery schema for the event subscription.
     "CloudEventSchemaV1_0"
    :vartype event_delivery_schema: str or ~azure.mgmt.eventgrid.models.DeliverySchema
    :ivar filters_configuration: Information about the filter for the event subscription.
    :vartype filters_configuration: ~azure.mgmt.eventgrid.models.FiltersConfiguration
    :ivar expiration_time_utc: Expiration time of the event subscription.
    :vartype expiration_time_utc: ~datetime.datetime
    :ivar tags: Tags relating to Event Subscription resource.
    :vartype tags: dict[str, str]
    """

    delivery_configuration: Optional["_models.DeliveryConfiguration"] = rest_field(
        name="deliveryConfiguration", visibility=["read", "create", "update", "delete", "query"]
    )
    """Information about the delivery configuration of the event subscription."""
    event_delivery_schema: Optional[Union[str, "_models.DeliverySchema"]] = rest_field(
        name="eventDeliverySchema", visibility=["read", "create", "update", "delete", "query"]
    )
    """The event delivery schema for the event subscription. \"CloudEventSchemaV1_0\""""
    filters_configuration: Optional["_models.FiltersConfiguration"] = rest_field(
        name="filtersConfiguration", visibility=["read", "create", "update", "delete", "query"]
    )
    """Information about the filter for the event subscription."""
    expiration_time_utc: Optional[datetime.datetime] = rest_field(
        name="expirationTimeUtc", visibility=["read", "create", "update", "delete", "query"], format="rfc3339"
    )
    """Expiration time of the event subscription."""
    tags: Optional[dict[str, str]] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """Tags relating to Event Subscription resource."""

    @overload
    def __init__(
        self,
        *,
        delivery_configuration: Optional["_models.DeliveryConfiguration"] = None,
        event_delivery_schema: Optional[Union[str, "_models.DeliverySchema"]] = None,
        filters_configuration: Optional["_models.FiltersConfiguration"] = None,
        expiration_time_utc: Optional[datetime.datetime] = None,
        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 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.eventgrid.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.eventgrid.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 SystemTopic(TrackedResource):
    """EventGrid System Topic.

    :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.eventgrid.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: Properties of the system topic.
    :vartype properties: ~azure.mgmt.eventgrid.models.SystemTopicProperties
    :ivar identity: Identity information for the resource.
    :vartype identity: ~azure.mgmt.eventgrid.models.IdentityInfo
    """

    properties: Optional["_models.SystemTopicProperties"] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """Properties of the system topic."""
    identity: Optional["_models.IdentityInfo"] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """Identity information for the resource."""

    __flattened_items = [
        "provisioning_state",
        "source",
        "topic_type",
        "metric_resource_id",
        "encryption",
        "platform_capabilities",
    ]

    @overload
    def __init__(
        self,
        *,
        location: str,
        tags: Optional[dict[str, str]] = None,
        properties: Optional["_models.SystemTopicProperties"] = None,
        identity: Optional["_models.IdentityInfo"] = 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:
        _flattened_input = {k: kwargs.pop(k) for k in kwargs.keys() & self.__flattened_items}
        super().__init__(*args, **kwargs)
        for k, v in _flattened_input.items():
            setattr(self, k, v)

    def __getattr__(self, name: str) -> Any:
        if name in self.__flattened_items:
            if self.properties is None:
                return None
            return getattr(self.properties, name)
        raise AttributeError(f"'{self.__class__.__name__}' object has no attribute '{name}'")

    def __setattr__(self, key: str, value: Any) -> None:
        if key in self.__flattened_items:
            if self.properties is None:
                self.properties = self._attr_to_rest_field["properties"]._class_type()
            setattr(self.properties, key, value)
        else:
            super().__setattr__(key, value)


class SystemTopicProperties(_Model):
    """Properties of the System Topic.

    :ivar provisioning_state: Provisioning state of the system topic. Known values are: "Creating",
     "Updating", "Deleting", "Succeeded", "Canceled", and "Failed".
    :vartype provisioning_state: str or ~azure.mgmt.eventgrid.models.ResourceProvisioningState
    :ivar source: Source for the system topic.
    :vartype source: str
    :ivar topic_type: TopicType for the system topic.
    :vartype topic_type: str
    :ivar metric_resource_id: Metric resource id for the system topic.
    :vartype metric_resource_id: str
    :ivar encryption: Key encryption configuration properties of the system topic resource. This is
     an optional property. When not specified, no key encryption is used.
    :vartype encryption: ~azure.mgmt.eventgrid.models.KeyEncryption
    :ivar platform_capabilities: Represents the platform capabilities of the resource, including
     Azure Confidential Compute related properties.
    :vartype platform_capabilities: ~azure.mgmt.eventgrid.models.PlatformCapabilities
    """

    provisioning_state: Optional[Union[str, "_models.ResourceProvisioningState"]] = rest_field(
        name="provisioningState", visibility=["read"]
    )
    """Provisioning state of the system topic. Known values are: \"Creating\", \"Updating\",
     \"Deleting\", \"Succeeded\", \"Canceled\", and \"Failed\"."""
    source: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """Source for the system topic."""
    topic_type: Optional[str] = rest_field(name="topicType", visibility=["read", "create", "update", "delete", "query"])
    """TopicType for the system topic."""
    metric_resource_id: Optional[str] = rest_field(name="metricResourceId", visibility=["read"])
    """Metric resource id for the system topic."""
    encryption: Optional["_models.KeyEncryption"] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """Key encryption configuration properties of the system topic resource. This is an optional
     property. When not specified, no key encryption is used."""
    platform_capabilities: Optional["_models.PlatformCapabilities"] = rest_field(
        name="platformCapabilities", visibility=["read", "create", "update", "delete", "query"]
    )
    """Represents the platform capabilities of the resource, including Azure Confidential Compute
     related properties."""

    @overload
    def __init__(
        self,
        *,
        source: Optional[str] = None,
        topic_type: Optional[str] = None,
        encryption: Optional["_models.KeyEncryption"] = None,
        platform_capabilities: Optional["_models.PlatformCapabilities"] = 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 SystemTopicUpdateParameters(_Model):
    """Properties of the System Topic update.

    :ivar tags: Tags of the system topic.
    :vartype tags: dict[str, str]
    :ivar identity: Resource identity information.
    :vartype identity: ~azure.mgmt.eventgrid.models.IdentityInfo
    """

    tags: Optional[dict[str, str]] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """Tags of the system topic."""
    identity: Optional["_models.IdentityInfo"] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """Resource identity information."""

    @overload
    def __init__(
        self,
        *,
        tags: Optional[dict[str, str]] = None,
        identity: Optional["_models.IdentityInfo"] = 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 Topic(TrackedResource):
    """EventGrid Topic.

    :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.eventgrid.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: Properties of the topic.
    :vartype properties: ~azure.mgmt.eventgrid.models.TopicProperties
    :ivar sku: The Sku pricing tier for the topic.
    :vartype sku: ~azure.mgmt.eventgrid.models.ResourceSku
    :ivar identity: Identity information for the resource.
    :vartype identity: ~azure.mgmt.eventgrid.models.IdentityInfo
    :ivar kind: Kind of the resource. Known values are: "Azure" and "AzureArc".
    :vartype kind: str or ~azure.mgmt.eventgrid.models.ResourceKind
    :ivar extended_location: Extended location of the resource.
    :vartype extended_location: ~azure.mgmt.eventgrid.models.ExtendedLocation
    """

    properties: Optional["_models.TopicProperties"] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """Properties of the topic."""
    sku: Optional["_models.ResourceSku"] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """The Sku pricing tier for the topic."""
    identity: Optional["_models.IdentityInfo"] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """Identity information for the resource."""
    kind: Optional[Union[str, "_models.ResourceKind"]] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """Kind of the resource. Known values are: \"Azure\" and \"AzureArc\"."""
    extended_location: Optional["_models.ExtendedLocation"] = rest_field(
        name="extendedLocation", visibility=["read", "create", "update", "delete", "query"]
    )
    """Extended location of the resource."""

    __flattened_items = [
        "private_endpoint_connections",
        "provisioning_state",
        "endpoint",
        "event_type_info",
        "minimum_tls_version_allowed",
        "input_schema",
        "input_schema_mapping",
        "metric_resource_id",
        "public_network_access",
        "inbound_ip_rules",
        "disable_local_auth",
        "data_residency_boundary",
        "encryption",
        "platform_capabilities",
    ]

    @overload
    def __init__(
        self,
        *,
        location: str,
        tags: Optional[dict[str, str]] = None,
        properties: Optional["_models.TopicProperties"] = None,
        sku: Optional["_models.ResourceSku"] = None,
        identity: Optional["_models.IdentityInfo"] = None,
        kind: Optional[Union[str, "_models.ResourceKind"]] = None,
        extended_location: Optional["_models.ExtendedLocation"] = 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:
        _flattened_input = {k: kwargs.pop(k) for k in kwargs.keys() & self.__flattened_items}
        super().__init__(*args, **kwargs)
        for k, v in _flattened_input.items():
            setattr(self, k, v)

    def __getattr__(self, name: str) -> Any:
        if name in self.__flattened_items:
            if self.properties is None:
                return None
            return getattr(self.properties, name)
        raise AttributeError(f"'{self.__class__.__name__}' object has no attribute '{name}'")

    def __setattr__(self, key: str, value: Any) -> None:
        if key in self.__flattened_items:
            if self.properties is None:
                self.properties = self._attr_to_rest_field["properties"]._class_type()
            setattr(self.properties, key, value)
        else:
            super().__setattr__(key, value)


class TopicProperties(_Model):
    """Properties of the Topic.

    :ivar private_endpoint_connections: List of private endpoint connections.
    :vartype private_endpoint_connections:
     list[~azure.mgmt.eventgrid.models.PrivateEndpointConnection]
    :ivar provisioning_state: Provisioning state of the topic. Known values are: "Creating",
     "Updating", "Deleting", "Succeeded", "Canceled", and "Failed".
    :vartype provisioning_state: str or ~azure.mgmt.eventgrid.models.TopicProvisioningState
    :ivar endpoint: Endpoint for the topic.
    :vartype endpoint: str
    :ivar event_type_info: Event Type Information for the user topic. This information is provided
     by the publisher and can be used by the subscriber to view different types of events that are
     published.
    :vartype event_type_info: ~azure.mgmt.eventgrid.models.EventTypeInfo
    :ivar minimum_tls_version_allowed: Minimum TLS version of the publisher allowed to publish to
     this topic. Known values are: "1.0", "1.1", and "1.2".
    :vartype minimum_tls_version_allowed: str or ~azure.mgmt.eventgrid.models.TlsVersion
    :ivar input_schema: This determines the format that Event Grid should expect for incoming
     events published to the topic. Known values are: "EventGridSchema", "CustomEventSchema", and
     "CloudEventSchemaV1_0".
    :vartype input_schema: str or ~azure.mgmt.eventgrid.models.InputSchema
    :ivar input_schema_mapping: This enables publishing using custom event schemas. An
     InputSchemaMapping can be specified to map various properties of a source schema to various
     required properties of the EventGridEvent schema.
    :vartype input_schema_mapping: ~azure.mgmt.eventgrid.models.InputSchemaMapping
    :ivar metric_resource_id: Metric resource id for the topic.
    :vartype metric_resource_id: str
    :ivar public_network_access: This determines if traffic is allowed over public network. By
     default it is enabled. You can further restrict to specific IPs by configuring <seealso
     cref="P:Microsoft.Azure.Events.ResourceProvider.Common.Contracts.TopicProperties.InboundIpRules"
     />. Known values are: "Enabled", "Disabled", and "SecuredByPerimeter".
    :vartype public_network_access: str or ~azure.mgmt.eventgrid.models.PublicNetworkAccess
    :ivar inbound_ip_rules: This can be used to restrict traffic from specific IPs instead of all
     IPs. Note: These are considered only if PublicNetworkAccess is enabled.
    :vartype inbound_ip_rules: list[~azure.mgmt.eventgrid.models.InboundIpRule]
    :ivar disable_local_auth: This boolean is used to enable or disable local auth. Default value
     is false. When the property is set to true, only Microsoft Entra ID token will be used to
     authenticate if user is allowed to publish to the topic.
    :vartype disable_local_auth: bool
    :ivar data_residency_boundary: Data Residency Boundary of the resource. Known values are:
     "WithinGeopair" and "WithinRegion".
    :vartype data_residency_boundary: str or ~azure.mgmt.eventgrid.models.DataResidencyBoundary
    :ivar encryption: Key encryption configuration properties of the topic resource. This is an
     optional property. When not specified, no key encryption is used.
    :vartype encryption: ~azure.mgmt.eventgrid.models.KeyEncryption
    :ivar platform_capabilities: Represents the platform capabilities of the resource, including
     Azure Confidential Compute related properties.
    :vartype platform_capabilities: ~azure.mgmt.eventgrid.models.PlatformCapabilities
    """

    private_endpoint_connections: Optional[list["_models.PrivateEndpointConnection"]] = rest_field(
        name="privateEndpointConnections", visibility=["read"]
    )
    """List of private endpoint connections."""
    provisioning_state: Optional[Union[str, "_models.TopicProvisioningState"]] = rest_field(
        name="provisioningState", visibility=["read"]
    )
    """Provisioning state of the topic. Known values are: \"Creating\", \"Updating\", \"Deleting\",
     \"Succeeded\", \"Canceled\", and \"Failed\"."""
    endpoint: Optional[str] = rest_field(visibility=["read"])
    """Endpoint for the topic."""
    event_type_info: Optional["_models.EventTypeInfo"] = rest_field(
        name="eventTypeInfo", visibility=["read", "create", "update", "delete", "query"]
    )
    """Event Type Information for the user topic. This information is provided by the publisher and
     can be used by the subscriber to view different types of events that are published."""
    minimum_tls_version_allowed: Optional[Union[str, "_models.TlsVersion"]] = rest_field(
        name="minimumTlsVersionAllowed", visibility=["read", "create", "update", "delete", "query"]
    )
    """Minimum TLS version of the publisher allowed to publish to this topic. Known values are:
     \"1.0\", \"1.1\", and \"1.2\"."""
    input_schema: Optional[Union[str, "_models.InputSchema"]] = rest_field(
        name="inputSchema", visibility=["read", "create", "update", "delete", "query"]
    )
    """This determines the format that Event Grid should expect for incoming events published to the
     topic. Known values are: \"EventGridSchema\", \"CustomEventSchema\", and
     \"CloudEventSchemaV1_0\"."""
    input_schema_mapping: Optional["_models.InputSchemaMapping"] = rest_field(
        name="inputSchemaMapping", visibility=["read", "create", "update", "delete", "query"]
    )
    """This enables publishing using custom event schemas. An InputSchemaMapping can be specified to
     map various properties of a source schema to various required properties of the EventGridEvent
     schema."""
    metric_resource_id: Optional[str] = rest_field(name="metricResourceId", visibility=["read"])
    """Metric resource id for the topic."""
    public_network_access: Optional[Union[str, "_models.PublicNetworkAccess"]] = rest_field(
        name="publicNetworkAccess", visibility=["read", "create", "update", "delete", "query"]
    )
    """This determines if traffic is allowed over public network. By default it is enabled. You can
     further restrict to specific IPs by configuring <seealso
     cref=\"P:Microsoft.Azure.Events.ResourceProvider.Common.Contracts.TopicProperties.InboundIpRules\"
     />. Known values are: \"Enabled\", \"Disabled\", and \"SecuredByPerimeter\"."""
    inbound_ip_rules: Optional[list["_models.InboundIpRule"]] = rest_field(
        name="inboundIpRules", visibility=["read", "create", "update", "delete", "query"]
    )
    """This can be used to restrict traffic from specific IPs instead of all IPs. Note: These are
     considered only if PublicNetworkAccess is enabled."""
    disable_local_auth: Optional[bool] = rest_field(
        name="disableLocalAuth", visibility=["read", "create", "update", "delete", "query"]
    )
    """This boolean is used to enable or disable local auth. Default value is false. When the property
     is set to true, only Microsoft Entra ID token will be used to authenticate if user is allowed
     to publish to the topic."""
    data_residency_boundary: Optional[Union[str, "_models.DataResidencyBoundary"]] = rest_field(
        name="dataResidencyBoundary", visibility=["read", "create", "update", "delete", "query"]
    )
    """Data Residency Boundary of the resource. Known values are: \"WithinGeopair\" and
     \"WithinRegion\"."""
    encryption: Optional["_models.KeyEncryption"] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """Key encryption configuration properties of the topic resource. This is an optional property.
     When not specified, no key encryption is used."""
    platform_capabilities: Optional["_models.PlatformCapabilities"] = rest_field(
        name="platformCapabilities", visibility=["read", "create", "update", "delete", "query"]
    )
    """Represents the platform capabilities of the resource, including Azure Confidential Compute
     related properties."""

    @overload
    def __init__(
        self,
        *,
        event_type_info: Optional["_models.EventTypeInfo"] = None,
        minimum_tls_version_allowed: Optional[Union[str, "_models.TlsVersion"]] = None,
        input_schema: Optional[Union[str, "_models.InputSchema"]] = None,
        input_schema_mapping: Optional["_models.InputSchemaMapping"] = None,
        public_network_access: Optional[Union[str, "_models.PublicNetworkAccess"]] = None,
        inbound_ip_rules: Optional[list["_models.InboundIpRule"]] = None,
        disable_local_auth: Optional[bool] = None,
        data_residency_boundary: Optional[Union[str, "_models.DataResidencyBoundary"]] = None,
        encryption: Optional["_models.KeyEncryption"] = None,
        platform_capabilities: Optional["_models.PlatformCapabilities"] = 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 TopicRegenerateKeyRequest(_Model):
    """Topic regenerate share access key request.

    :ivar key_name: Key name to regenerate key1 or key2. Required.
    :vartype key_name: str
    """

    key_name: str = rest_field(name="keyName", visibility=["read", "create", "update", "delete", "query"])
    """Key name to regenerate key1 or key2. Required."""

    @overload
    def __init__(
        self,
        *,
        key_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 TopicsConfiguration(_Model):
    """Properties of the Topics Configuration.

    :ivar hostname: The hostname for the topics configuration. This is a read-only property.
    :vartype hostname: str
    :ivar custom_domains: List of custom domain configurations for the namespace.
    :vartype custom_domains: list[~azure.mgmt.eventgrid.models.CustomDomainConfiguration]
    """

    hostname: Optional[str] = rest_field(visibility=["read"])
    """The hostname for the topics configuration. This is a read-only property."""
    custom_domains: Optional[list["_models.CustomDomainConfiguration"]] = rest_field(
        name="customDomains", visibility=["read", "create", "update", "delete", "query"]
    )
    """List of custom domain configurations for the namespace."""

    @overload
    def __init__(
        self,
        *,
        custom_domains: Optional[list["_models.CustomDomainConfiguration"]] = 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 TopicSharedAccessKeys(_Model):
    """Shared access keys of the Topic.

    :ivar key1: Shared access key1 for the topic.
    :vartype key1: str
    :ivar key2: Shared access key2 for the topic.
    :vartype key2: str
    """

    key1: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """Shared access key1 for the topic."""
    key2: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """Shared access key2 for the topic."""

    @overload
    def __init__(
        self,
        *,
        key1: Optional[str] = None,
        key2: 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 TopicSpace(ProxyResource):
    """The Topic space 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.eventgrid.models.SystemData
    :ivar properties: The properties of topic space.
    :vartype properties: ~azure.mgmt.eventgrid.models.TopicSpaceProperties
    """

    properties: Optional["_models.TopicSpaceProperties"] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """The properties of topic space."""

    __flattened_items = ["description", "topic_templates", "provisioning_state"]

    @overload
    def __init__(
        self,
        *,
        properties: Optional["_models.TopicSpaceProperties"] = 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:
        _flattened_input = {k: kwargs.pop(k) for k in kwargs.keys() & self.__flattened_items}
        super().__init__(*args, **kwargs)
        for k, v in _flattened_input.items():
            setattr(self, k, v)

    def __getattr__(self, name: str) -> Any:
        if name in self.__flattened_items:
            if self.properties is None:
                return None
            return getattr(self.properties, name)
        raise AttributeError(f"'{self.__class__.__name__}' object has no attribute '{name}'")

    def __setattr__(self, key: str, value: Any) -> None:
        if key in self.__flattened_items:
            if self.properties is None:
                self.properties = self._attr_to_rest_field["properties"]._class_type()
            setattr(self.properties, key, value)
        else:
            super().__setattr__(key, value)


class TopicSpaceProperties(_Model):
    """The properties of topic space.

    :ivar description: Description for the Topic Space resource.
    :vartype description: str
    :ivar topic_templates: The topic filters in the topic space. Example: "topicTemplates": [
     "devices/foo/bar", "devices/topic1/+",
     "devices/${principal.name}/${principal.attributes.keyName}" ].
    :vartype topic_templates: list[str]
    :ivar provisioning_state: Provisioning state of the TopicSpace resource. Known values are:
     "Creating", "Updating", "Deleting", "Succeeded", "Canceled", "Failed", and "Deleted".
    :vartype provisioning_state: str or ~azure.mgmt.eventgrid.models.TopicSpaceProvisioningState
    """

    description: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """Description for the Topic Space resource."""
    topic_templates: Optional[list[str]] = rest_field(
        name="topicTemplates", visibility=["read", "create", "update", "delete", "query"]
    )
    """The topic filters in the topic space. Example: \"topicTemplates\": [ \"devices/foo/bar\",
     \"devices/topic1/+\", \"devices/${principal.name}/${principal.attributes.keyName}\" ]."""
    provisioning_state: Optional[Union[str, "_models.TopicSpaceProvisioningState"]] = rest_field(
        name="provisioningState", visibility=["read"]
    )
    """Provisioning state of the TopicSpace resource. Known values are: \"Creating\", \"Updating\",
     \"Deleting\", \"Succeeded\", \"Canceled\", \"Failed\", and \"Deleted\"."""

    @overload
    def __init__(
        self,
        *,
        description: Optional[str] = None,
        topic_templates: 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 TopicSpacesConfiguration(_Model):
    """Properties of the Topic Spaces Configuration.

    :ivar state: Indicate if Topic Spaces Configuration is enabled for the namespace. Default is
     Disabled. Known values are: "Disabled" and "Enabled".
    :vartype state: str or ~azure.mgmt.eventgrid.models.TopicSpacesConfigurationState
    :ivar route_topic_resource_id: Fully qualified Azure Resource Id for the Event Grid Topic to
     which events will be routed to from TopicSpaces under a namespace. This property should be in
     the following format
     '/subscriptions/{subId}/resourcegroups/{resourceGroupName}/providers/microsoft.EventGrid/topics/{topicName}'.
     This topic should reside in the same region where namespace is located.
    :vartype route_topic_resource_id: str
    :ivar hostname: The endpoint for the topic spaces configuration. This is a read-only property.
    :vartype hostname: str
    :ivar routing_enrichments: Routing enrichments for topic spaces configuration.
    :vartype routing_enrichments: ~azure.mgmt.eventgrid.models.RoutingEnrichments
    :ivar client_authentication: Client authentication settings for topic spaces configuration.
    :vartype client_authentication: ~azure.mgmt.eventgrid.models.ClientAuthenticationSettings
    :ivar maximum_session_expiry_in_hours: The maximum session expiry in hours. The property
     default value is 1 hour. Min allowed value is 1 hour and max allowed value is 8 hours.
    :vartype maximum_session_expiry_in_hours: int
    :ivar maximum_client_sessions_per_authentication_name: The maximum number of sessions per
     authentication name. The property default value is 1. Min allowed value is 1 and max allowed
     value is 100.
    :vartype maximum_client_sessions_per_authentication_name: int
    :ivar routing_identity_info: Routing identity info for topic spaces configuration.
    :vartype routing_identity_info: ~azure.mgmt.eventgrid.models.RoutingIdentityInfo
    :ivar custom_domains: List of custom domain configurations for the namespace.
    :vartype custom_domains: list[~azure.mgmt.eventgrid.models.CustomDomainConfiguration]
    """

    state: Optional[Union[str, "_models.TopicSpacesConfigurationState"]] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """Indicate if Topic Spaces Configuration is enabled for the namespace. Default is Disabled. Known
     values are: \"Disabled\" and \"Enabled\"."""
    route_topic_resource_id: Optional[str] = rest_field(
        name="routeTopicResourceId", visibility=["read", "create", "update", "delete", "query"]
    )
    """Fully qualified Azure Resource Id for the Event Grid Topic to which events will be routed to
     from TopicSpaces under a namespace. This property should be in the following format
     '/subscriptions/{subId}/resourcegroups/{resourceGroupName}/providers/microsoft.EventGrid/topics/{topicName}'.
     This topic should reside in the same region where namespace is located."""
    hostname: Optional[str] = rest_field(visibility=["read"])
    """The endpoint for the topic spaces configuration. This is a read-only property."""
    routing_enrichments: Optional["_models.RoutingEnrichments"] = rest_field(
        name="routingEnrichments", visibility=["read", "create", "update", "delete", "query"]
    )
    """Routing enrichments for topic spaces configuration."""
    client_authentication: Optional["_models.ClientAuthenticationSettings"] = rest_field(
        name="clientAuthentication", visibility=["read", "create", "update", "delete", "query"]
    )
    """Client authentication settings for topic spaces configuration."""
    maximum_session_expiry_in_hours: Optional[int] = rest_field(
        name="maximumSessionExpiryInHours", visibility=["read", "create", "update", "delete", "query"]
    )
    """The maximum session expiry in hours. The property default value is 1 hour. Min allowed value is
     1 hour and max allowed value is 8 hours."""
    maximum_client_sessions_per_authentication_name: Optional[int] = rest_field(
        name="maximumClientSessionsPerAuthenticationName", visibility=["read", "create", "update", "delete", "query"]
    )
    """The maximum number of sessions per authentication name. The property default value is 1. Min
     allowed value is 1 and max allowed value is 100."""
    routing_identity_info: Optional["_models.RoutingIdentityInfo"] = rest_field(
        name="routingIdentityInfo", visibility=["read", "create", "update", "delete", "query"]
    )
    """Routing identity info for topic spaces configuration."""
    custom_domains: Optional[list["_models.CustomDomainConfiguration"]] = rest_field(
        name="customDomains", visibility=["read", "create", "update", "delete", "query"]
    )
    """List of custom domain configurations for the namespace."""

    @overload
    def __init__(
        self,
        *,
        state: Optional[Union[str, "_models.TopicSpacesConfigurationState"]] = None,
        route_topic_resource_id: Optional[str] = None,
        routing_enrichments: Optional["_models.RoutingEnrichments"] = None,
        client_authentication: Optional["_models.ClientAuthenticationSettings"] = None,
        maximum_session_expiry_in_hours: Optional[int] = None,
        maximum_client_sessions_per_authentication_name: Optional[int] = None,
        routing_identity_info: Optional["_models.RoutingIdentityInfo"] = None,
        custom_domains: Optional[list["_models.CustomDomainConfiguration"]] = 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 TopicTypeAdditionalEnforcedPermission(_Model):
    """TopicTypeAdditionalEnforcedPermission.

    :ivar permission_name:
    :vartype permission_name: str
    :ivar is_data_action:
    :vartype is_data_action: bool
    """

    permission_name: Optional[str] = rest_field(
        name="permissionName", visibility=["read", "create", "update", "delete", "query"]
    )
    is_data_action: Optional[bool] = rest_field(
        name="isDataAction", visibility=["read", "create", "update", "delete", "query"]
    )

    @overload
    def __init__(
        self,
        *,
        permission_name: Optional[str] = None,
        is_data_action: 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 TopicTypeInfo(ProxyResource):
    """Properties of a topic type info.

    :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.eventgrid.models.SystemData
    :ivar properties: Properties of the topic type info.
    :vartype properties: ~azure.mgmt.eventgrid.models.TopicTypeProperties
    """

    properties: Optional["_models.TopicTypeProperties"] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """Properties of the topic type info."""

    __flattened_items = [
        "provider",
        "display_name",
        "description",
        "resource_region_type",
        "provisioning_state",
        "supported_locations",
        "source_resource_format",
        "supported_scopes_for_source",
        "are_regional_and_global_sources_supported",
        "additional_enforced_permissions",
    ]

    @overload
    def __init__(
        self,
        *,
        properties: Optional["_models.TopicTypeProperties"] = 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:
        _flattened_input = {k: kwargs.pop(k) for k in kwargs.keys() & self.__flattened_items}
        super().__init__(*args, **kwargs)
        for k, v in _flattened_input.items():
            setattr(self, k, v)

    def __getattr__(self, name: str) -> Any:
        if name in self.__flattened_items:
            if self.properties is None:
                return None
            return getattr(self.properties, name)
        raise AttributeError(f"'{self.__class__.__name__}' object has no attribute '{name}'")

    def __setattr__(self, key: str, value: Any) -> None:
        if key in self.__flattened_items:
            if self.properties is None:
                self.properties = self._attr_to_rest_field["properties"]._class_type()
            setattr(self.properties, key, value)
        else:
            super().__setattr__(key, value)


class TopicTypeProperties(_Model):
    """Properties of a topic type.

    :ivar provider: Namespace of the provider of the topic type.
    :vartype provider: str
    :ivar display_name: Display Name for the topic type.
    :vartype display_name: str
    :ivar description: Description of the topic type.
    :vartype description: str
    :ivar resource_region_type: Region type of the resource. Known values are: "RegionalResource"
     and "GlobalResource".
    :vartype resource_region_type: str or ~azure.mgmt.eventgrid.models.ResourceRegionType
    :ivar provisioning_state: Provisioning state of the topic type. Known values are: "Creating",
     "Updating", "Deleting", "Succeeded", "Canceled", and "Failed".
    :vartype provisioning_state: str or ~azure.mgmt.eventgrid.models.TopicTypeProvisioningState
    :ivar supported_locations: List of locations supported by this topic type.
    :vartype supported_locations: list[str]
    :ivar source_resource_format: Source resource format.
    :vartype source_resource_format: str
    :ivar supported_scopes_for_source: Supported source scopes.
    :vartype supported_scopes_for_source: list[str or
     ~azure.mgmt.eventgrid.models.TopicTypeSourceScope]
    :ivar are_regional_and_global_sources_supported: Flag to indicate that a topic type can support
     both regional or global system topics.
    :vartype are_regional_and_global_sources_supported: bool
    :ivar additional_enforced_permissions: Permissions which are enforced for creating and updating
     system topics of this this topic type.
    :vartype additional_enforced_permissions:
     list[~azure.mgmt.eventgrid.models.TopicTypeAdditionalEnforcedPermission]
    """

    provider: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """Namespace of the provider of the topic type."""
    display_name: Optional[str] = rest_field(
        name="displayName", visibility=["read", "create", "update", "delete", "query"]
    )
    """Display Name for the topic type."""
    description: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """Description of the topic type."""
    resource_region_type: Optional[Union[str, "_models.ResourceRegionType"]] = rest_field(
        name="resourceRegionType", visibility=["read", "create", "update", "delete", "query"]
    )
    """Region type of the resource. Known values are: \"RegionalResource\" and \"GlobalResource\"."""
    provisioning_state: Optional[Union[str, "_models.TopicTypeProvisioningState"]] = rest_field(
        name="provisioningState", visibility=["read", "create", "update", "delete", "query"]
    )
    """Provisioning state of the topic type. Known values are: \"Creating\", \"Updating\",
     \"Deleting\", \"Succeeded\", \"Canceled\", and \"Failed\"."""
    supported_locations: Optional[list[str]] = rest_field(
        name="supportedLocations", visibility=["read", "create", "update", "delete", "query"]
    )
    """List of locations supported by this topic type."""
    source_resource_format: Optional[str] = rest_field(
        name="sourceResourceFormat", visibility=["read", "create", "update", "delete", "query"]
    )
    """Source resource format."""
    supported_scopes_for_source: Optional[list[Union[str, "_models.TopicTypeSourceScope"]]] = rest_field(
        name="supportedScopesForSource", visibility=["read", "create", "update", "delete", "query"]
    )
    """Supported source scopes."""
    are_regional_and_global_sources_supported: Optional[bool] = rest_field(
        name="areRegionalAndGlobalSourcesSupported", visibility=["read", "create", "update", "delete", "query"]
    )
    """Flag to indicate that a topic type can support both regional or global system topics."""
    additional_enforced_permissions: Optional[list["_models.TopicTypeAdditionalEnforcedPermission"]] = rest_field(
        name="additionalEnforcedPermissions", visibility=["read", "create", "update", "delete", "query"]
    )
    """Permissions which are enforced for creating and updating system topics of this this topic type."""

    @overload
    def __init__(
        self,
        *,
        provider: Optional[str] = None,
        display_name: Optional[str] = None,
        description: Optional[str] = None,
        resource_region_type: Optional[Union[str, "_models.ResourceRegionType"]] = None,
        provisioning_state: Optional[Union[str, "_models.TopicTypeProvisioningState"]] = None,
        supported_locations: Optional[list[str]] = None,
        source_resource_format: Optional[str] = None,
        supported_scopes_for_source: Optional[list[Union[str, "_models.TopicTypeSourceScope"]]] = None,
        are_regional_and_global_sources_supported: Optional[bool] = None,
        additional_enforced_permissions: Optional[list["_models.TopicTypeAdditionalEnforcedPermission"]] = 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 TopicUpdateParameterProperties(_Model):
    """Information of topic update parameter properties.

    :ivar public_network_access: This determines if traffic is allowed over public network. By
     default it is enabled. You can further restrict to specific IPs by configuring <seealso
     cref="P:Microsoft.Azure.Events.ResourceProvider.Common.Contracts.TopicUpdateParameterProperties.InboundIpRules"
     />. Known values are: "Enabled", "Disabled", and "SecuredByPerimeter".
    :vartype public_network_access: str or ~azure.mgmt.eventgrid.models.PublicNetworkAccess
    :ivar inbound_ip_rules: This can be used to restrict traffic from specific IPs instead of all
     IPs. Note: These are considered only if PublicNetworkAccess is enabled.
    :vartype inbound_ip_rules: list[~azure.mgmt.eventgrid.models.InboundIpRule]
    :ivar minimum_tls_version_allowed: Minimum TLS version of the publisher allowed to publish to
     this domain. Known values are: "1.0", "1.1", and "1.2".
    :vartype minimum_tls_version_allowed: str or ~azure.mgmt.eventgrid.models.TlsVersion
    :ivar disable_local_auth: This boolean is used to enable or disable local auth. Default value
     is false. When the property is set to true, only Microsoft Entra ID token will be used to
     authenticate if user is allowed to publish to the topic.
    :vartype disable_local_auth: bool
    :ivar data_residency_boundary: The data residency boundary for the topic. Known values are:
     "WithinGeopair" and "WithinRegion".
    :vartype data_residency_boundary: str or ~azure.mgmt.eventgrid.models.DataResidencyBoundary
    :ivar event_type_info: The eventTypeInfo for the topic.
    :vartype event_type_info: ~azure.mgmt.eventgrid.models.EventTypeInfo
    """

    public_network_access: Optional[Union[str, "_models.PublicNetworkAccess"]] = rest_field(
        name="publicNetworkAccess", visibility=["read", "create", "update", "delete", "query"]
    )
    """This determines if traffic is allowed over public network. By default it is enabled. You can
     further restrict to specific IPs by configuring <seealso
     cref=\"P:Microsoft.Azure.Events.ResourceProvider.Common.Contracts.TopicUpdateParameterProperties.InboundIpRules\"
     />. Known values are: \"Enabled\", \"Disabled\", and \"SecuredByPerimeter\"."""
    inbound_ip_rules: Optional[list["_models.InboundIpRule"]] = rest_field(
        name="inboundIpRules", visibility=["read", "create", "update", "delete", "query"]
    )
    """This can be used to restrict traffic from specific IPs instead of all IPs. Note: These are
     considered only if PublicNetworkAccess is enabled."""
    minimum_tls_version_allowed: Optional[Union[str, "_models.TlsVersion"]] = rest_field(
        name="minimumTlsVersionAllowed", visibility=["read", "create", "update", "delete", "query"]
    )
    """Minimum TLS version of the publisher allowed to publish to this domain. Known values are:
     \"1.0\", \"1.1\", and \"1.2\"."""
    disable_local_auth: Optional[bool] = rest_field(
        name="disableLocalAuth", visibility=["read", "create", "update", "delete", "query"]
    )
    """This boolean is used to enable or disable local auth. Default value is false. When the property
     is set to true, only Microsoft Entra ID token will be used to authenticate if user is allowed
     to publish to the topic."""
    data_residency_boundary: Optional[Union[str, "_models.DataResidencyBoundary"]] = rest_field(
        name="dataResidencyBoundary", visibility=["read", "create", "update", "delete", "query"]
    )
    """The data residency boundary for the topic. Known values are: \"WithinGeopair\" and
     \"WithinRegion\"."""
    event_type_info: Optional["_models.EventTypeInfo"] = rest_field(
        name="eventTypeInfo", visibility=["read", "create", "update", "delete", "query"]
    )
    """The eventTypeInfo for the topic."""

    @overload
    def __init__(
        self,
        *,
        public_network_access: Optional[Union[str, "_models.PublicNetworkAccess"]] = None,
        inbound_ip_rules: Optional[list["_models.InboundIpRule"]] = None,
        minimum_tls_version_allowed: Optional[Union[str, "_models.TlsVersion"]] = None,
        disable_local_auth: Optional[bool] = None,
        data_residency_boundary: Optional[Union[str, "_models.DataResidencyBoundary"]] = None,
        event_type_info: Optional["_models.EventTypeInfo"] = 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 TopicUpdateParameters(_Model):
    """Properties of the Topic update.

    :ivar tags: Tags of the Topic resource.
    :vartype tags: dict[str, str]
    :ivar identity: Topic resource identity information.
    :vartype identity: ~azure.mgmt.eventgrid.models.IdentityInfo
    :ivar properties: Properties of the Topic resource.
    :vartype properties: ~azure.mgmt.eventgrid.models.TopicUpdateParameterProperties
    :ivar sku: The Sku pricing tier for the topic.
    :vartype sku: ~azure.mgmt.eventgrid.models.ResourceSku
    """

    tags: Optional[dict[str, str]] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """Tags of the Topic resource."""
    identity: Optional["_models.IdentityInfo"] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """Topic resource identity information."""
    properties: Optional["_models.TopicUpdateParameterProperties"] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """Properties of the Topic resource."""
    sku: Optional["_models.ResourceSku"] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """The Sku pricing tier for the topic."""

    __flattened_items = [
        "public_network_access",
        "inbound_ip_rules",
        "minimum_tls_version_allowed",
        "disable_local_auth",
        "data_residency_boundary",
        "event_type_info",
    ]

    @overload
    def __init__(
        self,
        *,
        tags: Optional[dict[str, str]] = None,
        identity: Optional["_models.IdentityInfo"] = None,
        properties: Optional["_models.TopicUpdateParameterProperties"] = None,
        sku: Optional["_models.ResourceSku"] = 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:
        _flattened_input = {k: kwargs.pop(k) for k in kwargs.keys() & self.__flattened_items}
        super().__init__(*args, **kwargs)
        for k, v in _flattened_input.items():
            setattr(self, k, v)

    def __getattr__(self, name: str) -> Any:
        if name in self.__flattened_items:
            if self.properties is None:
                return None
            return getattr(self.properties, name)
        raise AttributeError(f"'{self.__class__.__name__}' object has no attribute '{name}'")

    def __setattr__(self, key: str, value: Any) -> None:
        if key in self.__flattened_items:
            if self.properties is None:
                self.properties = self._attr_to_rest_field["properties"]._class_type()
            setattr(self.properties, key, value)
        else:
            super().__setattr__(key, value)


class UpdateTopicsConfigurationInfo(_Model):
    """Properties of the topics configuration info of a namespace.

    :ivar custom_domains: Custom domain info for topics configuration.
    :vartype custom_domains: list[~azure.mgmt.eventgrid.models.CustomDomainConfiguration]
    """

    custom_domains: Optional[list["_models.CustomDomainConfiguration"]] = rest_field(
        name="customDomains", visibility=["read", "create", "update", "delete", "query"]
    )
    """Custom domain info for topics configuration."""

    @overload
    def __init__(
        self,
        *,
        custom_domains: Optional[list["_models.CustomDomainConfiguration"]] = 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 UpdateTopicSpacesConfigurationInfo(_Model):
    """Properties of the topic spaces configuration info of a namespace.

    :ivar state: Indicate if Topic Spaces Configuration is enabled for the namespace. Default is
     Disabled. Known values are: "Disabled" and "Enabled".
    :vartype state: str or ~azure.mgmt.eventgrid.models.TopicSpacesConfigurationState
    :ivar route_topic_resource_id: This property is used to specify custom topic to which events
     will be routed to from topic spaces configuration under namespace.
    :vartype route_topic_resource_id: str
    :ivar routing_enrichments: Routing enrichments for topic spaces configuration.
    :vartype routing_enrichments: ~azure.mgmt.eventgrid.models.RoutingEnrichments
    :ivar client_authentication: Client authentication settings for topic spaces configuration.
    :vartype client_authentication: ~azure.mgmt.eventgrid.models.ClientAuthenticationSettings
    :ivar maximum_session_expiry_in_hours: The maximum session expiry in hours. The property
     default value is 1 hour. Min allowed value is 1 hour and max allowed value is 8 hours.
    :vartype maximum_session_expiry_in_hours: int
    :ivar maximum_client_sessions_per_authentication_name: The maximum number of sessions per
     authentication name. The property default value is 1. Min allowed value is 1 and max allowed
     value is 100.
    :vartype maximum_client_sessions_per_authentication_name: int
    :ivar routing_identity_info: Routing identity info for topic spaces configuration.
    :vartype routing_identity_info: ~azure.mgmt.eventgrid.models.RoutingIdentityInfo
    :ivar custom_domains: Custom domain info for topic spaces configuration.
    :vartype custom_domains: list[~azure.mgmt.eventgrid.models.CustomDomainConfiguration]
    """

    state: Optional[Union[str, "_models.TopicSpacesConfigurationState"]] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """Indicate if Topic Spaces Configuration is enabled for the namespace. Default is Disabled. Known
     values are: \"Disabled\" and \"Enabled\"."""
    route_topic_resource_id: Optional[str] = rest_field(
        name="routeTopicResourceId", visibility=["read", "create", "update", "delete", "query"]
    )
    """This property is used to specify custom topic to which events will be routed to from topic
     spaces configuration under namespace."""
    routing_enrichments: Optional["_models.RoutingEnrichments"] = rest_field(
        name="routingEnrichments", visibility=["read", "create", "update", "delete", "query"]
    )
    """Routing enrichments for topic spaces configuration."""
    client_authentication: Optional["_models.ClientAuthenticationSettings"] = rest_field(
        name="clientAuthentication", visibility=["read", "create", "update", "delete", "query"]
    )
    """Client authentication settings for topic spaces configuration."""
    maximum_session_expiry_in_hours: Optional[int] = rest_field(
        name="maximumSessionExpiryInHours", visibility=["read", "create", "update", "delete", "query"]
    )
    """The maximum session expiry in hours. The property default value is 1 hour. Min allowed value is
     1 hour and max allowed value is 8 hours."""
    maximum_client_sessions_per_authentication_name: Optional[int] = rest_field(
        name="maximumClientSessionsPerAuthenticationName", visibility=["read", "create", "update", "delete", "query"]
    )
    """The maximum number of sessions per authentication name. The property default value is 1. Min
     allowed value is 1 and max allowed value is 100."""
    routing_identity_info: Optional["_models.RoutingIdentityInfo"] = rest_field(
        name="routingIdentityInfo", visibility=["read", "create", "update", "delete", "query"]
    )
    """Routing identity info for topic spaces configuration."""
    custom_domains: Optional[list["_models.CustomDomainConfiguration"]] = rest_field(
        name="customDomains", visibility=["read", "create", "update", "delete", "query"]
    )
    """Custom domain info for topic spaces configuration."""

    @overload
    def __init__(
        self,
        *,
        state: Optional[Union[str, "_models.TopicSpacesConfigurationState"]] = None,
        route_topic_resource_id: Optional[str] = None,
        routing_enrichments: Optional["_models.RoutingEnrichments"] = None,
        client_authentication: Optional["_models.ClientAuthenticationSettings"] = None,
        maximum_session_expiry_in_hours: Optional[int] = None,
        maximum_client_sessions_per_authentication_name: Optional[int] = None,
        routing_identity_info: Optional["_models.RoutingIdentityInfo"] = None,
        custom_domains: Optional[list["_models.CustomDomainConfiguration"]] = 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 UserIdentityProperties(_Model):
    """The information about the user identity.

    :ivar principal_id: The principal id of user assigned identity.
    :vartype principal_id: str
    :ivar client_id: The client id of user assigned identity.
    :vartype client_id: str
    """

    principal_id: Optional[str] = rest_field(
        name="principalId", visibility=["read", "create", "update", "delete", "query"]
    )
    """The principal id of user assigned identity."""
    client_id: Optional[str] = rest_field(name="clientId", visibility=["read", "create", "update", "delete", "query"])
    """The client id of user assigned identity."""

    @overload
    def __init__(
        self,
        *,
        principal_id: Optional[str] = None,
        client_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 VerifiedPartner(ProxyResource):
    """Verified partner information.

    :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.eventgrid.models.SystemData
    :ivar properties: Properties of the verified partner.
    :vartype properties: ~azure.mgmt.eventgrid.models.VerifiedPartnerProperties
    """

    properties: Optional["_models.VerifiedPartnerProperties"] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """Properties of the verified partner."""

    __flattened_items = [
        "partner_registration_immutable_id",
        "organization_name",
        "partner_display_name",
        "partner_topic_details",
        "partner_destination_details",
        "provisioning_state",
    ]

    @overload
    def __init__(
        self,
        *,
        properties: Optional["_models.VerifiedPartnerProperties"] = 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:
        _flattened_input = {k: kwargs.pop(k) for k in kwargs.keys() & self.__flattened_items}
        super().__init__(*args, **kwargs)
        for k, v in _flattened_input.items():
            setattr(self, k, v)

    def __getattr__(self, name: str) -> Any:
        if name in self.__flattened_items:
            if self.properties is None:
                return None
            return getattr(self.properties, name)
        raise AttributeError(f"'{self.__class__.__name__}' object has no attribute '{name}'")

    def __setattr__(self, key: str, value: Any) -> None:
        if key in self.__flattened_items:
            if self.properties is None:
                self.properties = self._attr_to_rest_field["properties"]._class_type()
            setattr(self.properties, key, value)
        else:
            super().__setattr__(key, value)


class VerifiedPartnerProperties(_Model):
    """Properties of the verified partner.

    :ivar partner_registration_immutable_id: ImmutableId of the corresponding partner registration.
    :vartype partner_registration_immutable_id: str
    :ivar organization_name: Official name of the Partner.
    :vartype organization_name: str
    :ivar partner_display_name: Display name of the verified partner.
    :vartype partner_display_name: str
    :ivar partner_topic_details: Details of the partner topic scenario.
    :vartype partner_topic_details: ~azure.mgmt.eventgrid.models.PartnerDetails
    :ivar partner_destination_details: Details of the partner destination scenario.
    :vartype partner_destination_details: ~azure.mgmt.eventgrid.models.PartnerDetails
    :ivar provisioning_state: Provisioning state of the verified partner. Known values are:
     "Creating", "Updating", "Deleting", "Succeeded", "Canceled", and "Failed".
    :vartype provisioning_state: str or
     ~azure.mgmt.eventgrid.models.VerifiedPartnerProvisioningState
    """

    partner_registration_immutable_id: Optional[str] = rest_field(
        name="partnerRegistrationImmutableId", visibility=["read", "create", "update", "delete", "query"]
    )
    """ImmutableId of the corresponding partner registration."""
    organization_name: Optional[str] = rest_field(
        name="organizationName", visibility=["read", "create", "update", "delete", "query"]
    )
    """Official name of the Partner."""
    partner_display_name: Optional[str] = rest_field(
        name="partnerDisplayName", visibility=["read", "create", "update", "delete", "query"]
    )
    """Display name of the verified partner."""
    partner_topic_details: Optional["_models.PartnerDetails"] = rest_field(
        name="partnerTopicDetails", visibility=["read", "create", "update", "delete", "query"]
    )
    """Details of the partner topic scenario."""
    partner_destination_details: Optional["_models.PartnerDetails"] = rest_field(
        name="partnerDestinationDetails", visibility=["read", "create", "update", "delete", "query"]
    )
    """Details of the partner destination scenario."""
    provisioning_state: Optional[Union[str, "_models.VerifiedPartnerProvisioningState"]] = rest_field(
        name="provisioningState", visibility=["read", "create", "update", "delete", "query"]
    )
    """Provisioning state of the verified partner. Known values are: \"Creating\", \"Updating\",
     \"Deleting\", \"Succeeded\", \"Canceled\", and \"Failed\"."""

    @overload
    def __init__(
        self,
        *,
        partner_registration_immutable_id: Optional[str] = None,
        organization_name: Optional[str] = None,
        partner_display_name: Optional[str] = None,
        partner_topic_details: Optional["_models.PartnerDetails"] = None,
        partner_destination_details: Optional["_models.PartnerDetails"] = None,
        provisioning_state: Optional[Union[str, "_models.VerifiedPartnerProvisioningState"]] = 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 WebhookAuthenticationSettings(_Model):
    """Authentication settings for a webhook endpoint within a Namespace resource.

    :ivar identity: The identity configuration required for authenticating a custom webhook.
     Required.
    :vartype identity: ~azure.mgmt.eventgrid.models.CustomWebhookAuthenticationManagedIdentity
    :ivar endpoint_url: The URL endpoint where the Event Grid service sends authenticated webhook
     requests using the specified managed identity. Required.
    :vartype endpoint_url: str
    :ivar endpoint_base_url: The base URL endpoint where the Event Grid service sends authenticated
     webhook requests using the specified managed identity.
    :vartype endpoint_base_url: str
    :ivar azure_active_directory_application_id_or_uri: Microsoft Entra ID Application ID or URI to
     get the access token that will be included as the bearer token in delivery requests. Required.
    :vartype azure_active_directory_application_id_or_uri: str
    :ivar azure_active_directory_tenant_id: Microsoft Entra ID Tenant ID to get the access token
     that will be included as the bearer token in delivery requests. Required.
    :vartype azure_active_directory_tenant_id: str
    """

    identity: "_models.CustomWebhookAuthenticationManagedIdentity" = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """The identity configuration required for authenticating a custom webhook. Required."""
    endpoint_url: str = rest_field(name="endpointUrl", visibility=["read", "create", "update", "delete", "query"])
    """The URL endpoint where the Event Grid service sends authenticated webhook requests using the
     specified managed identity. Required."""
    endpoint_base_url: Optional[str] = rest_field(
        name="endpointBaseUrl", visibility=["read", "create", "update", "delete", "query"]
    )
    """The base URL endpoint where the Event Grid service sends authenticated webhook requests using
     the specified managed identity."""
    azure_active_directory_application_id_or_uri: str = rest_field(
        name="azureActiveDirectoryApplicationIdOrUri", visibility=["read", "create", "update", "delete", "query"]
    )
    """Microsoft Entra ID Application ID or URI to get the access token that will be included as the
     bearer token in delivery requests. Required."""
    azure_active_directory_tenant_id: str = rest_field(
        name="azureActiveDirectoryTenantId", visibility=["read", "create", "update", "delete", "query"]
    )
    """Microsoft Entra ID Tenant ID to get the access token that will be included as the bearer token
     in delivery requests. Required."""

    @overload
    def __init__(
        self,
        *,
        identity: "_models.CustomWebhookAuthenticationManagedIdentity",
        endpoint_url: str,
        azure_active_directory_application_id_or_uri: str,
        azure_active_directory_tenant_id: str,
        endpoint_base_url: 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 WebHookEventSubscriptionDestination(EventSubscriptionDestination, discriminator="WebHook"):
    """Information about the webhook destination for an event subscription.

    :ivar properties: WebHook Properties of the event subscription destination.
    :vartype properties: ~azure.mgmt.eventgrid.models.WebHookEventSubscriptionDestinationProperties
    :ivar endpoint_type: Type of the endpoint for the event subscription destination. Required.
     WebHook.
    :vartype endpoint_type: str or ~azure.mgmt.eventgrid.models.WEB_HOOK
    """

    properties: Optional["_models.WebHookEventSubscriptionDestinationProperties"] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """WebHook Properties of the event subscription destination."""
    endpoint_type: Literal[EndpointType.WEB_HOOK] = rest_discriminator(name="endpointType", visibility=["read", "create", "update", "delete", "query"])  # type: ignore
    """Type of the endpoint for the event subscription destination. Required. WebHook."""

    __flattened_items = [
        "endpoint_url",
        "endpoint_base_url",
        "max_events_per_batch",
        "preferred_batch_size_in_kilobytes",
        "azure_active_directory_tenant_id",
        "azure_active_directory_application_id_or_uri",
        "delivery_attribute_mappings",
        "minimum_tls_version_allowed",
    ]

    @overload
    def __init__(
        self,
        *,
        properties: Optional["_models.WebHookEventSubscriptionDestinationProperties"] = 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:
        _flattened_input = {k: kwargs.pop(k) for k in kwargs.keys() & self.__flattened_items}
        super().__init__(*args, **kwargs)
        for k, v in _flattened_input.items():
            setattr(self, k, v)

    def __getattr__(self, name: str) -> Any:
        if name in self.__flattened_items:
            if self.properties is None:
                return None
            return getattr(self.properties, name)
        raise AttributeError(f"'{self.__class__.__name__}' object has no attribute '{name}'")

    def __setattr__(self, key: str, value: Any) -> None:
        if key in self.__flattened_items:
            if self.properties is None:
                self.properties = self._attr_to_rest_field["properties"]._class_type()
            setattr(self.properties, key, value)
        else:
            super().__setattr__(key, value)


class WebHookEventSubscriptionDestinationProperties(_Model):  # pylint: disable=name-too-long
    """Information about the webhook destination properties for an event subscription.

    :ivar endpoint_url: The URL that represents the endpoint of the destination of an event
     subscription.
    :vartype endpoint_url: str
    :ivar endpoint_base_url: The base URL that represents the endpoint of the destination of an
     event subscription.
    :vartype endpoint_base_url: str
    :ivar max_events_per_batch: Maximum number of events per batch.
    :vartype max_events_per_batch: int
    :ivar preferred_batch_size_in_kilobytes: Preferred batch size in Kilobytes.
    :vartype preferred_batch_size_in_kilobytes: int
    :ivar azure_active_directory_tenant_id: The Microsoft Entra ID Tenant ID to get the access
     token that will be included as the bearer token in delivery requests.
    :vartype azure_active_directory_tenant_id: str
    :ivar azure_active_directory_application_id_or_uri: The Microsoft Entra ID Application ID or
     URI to get the access token that will be included as the bearer token in delivery requests.
    :vartype azure_active_directory_application_id_or_uri: str
    :ivar delivery_attribute_mappings: Delivery attribute details.
    :vartype delivery_attribute_mappings:
     list[~azure.mgmt.eventgrid.models.DeliveryAttributeMapping]
    :ivar minimum_tls_version_allowed: Minimum TLS version that should be supported by webhook
     endpoint. Known values are: "1.0", "1.1", and "1.2".
    :vartype minimum_tls_version_allowed: str or ~azure.mgmt.eventgrid.models.TlsVersion
    """

    endpoint_url: Optional[str] = rest_field(
        name="endpointUrl", visibility=["read", "create", "update", "delete", "query"]
    )
    """The URL that represents the endpoint of the destination of an event subscription."""
    endpoint_base_url: Optional[str] = rest_field(name="endpointBaseUrl", visibility=["read"])
    """The base URL that represents the endpoint of the destination of an event subscription."""
    max_events_per_batch: Optional[int] = rest_field(
        name="maxEventsPerBatch", visibility=["read", "create", "update", "delete", "query"]
    )
    """Maximum number of events per batch."""
    preferred_batch_size_in_kilobytes: Optional[int] = rest_field(
        name="preferredBatchSizeInKilobytes", visibility=["read", "create", "update", "delete", "query"]
    )
    """Preferred batch size in Kilobytes."""
    azure_active_directory_tenant_id: Optional[str] = rest_field(
        name="azureActiveDirectoryTenantId", visibility=["read", "create", "update", "delete", "query"]
    )
    """The Microsoft Entra ID Tenant ID to get the access token that will be included as the bearer
     token in delivery requests."""
    azure_active_directory_application_id_or_uri: Optional[str] = rest_field(
        name="azureActiveDirectoryApplicationIdOrUri", visibility=["read", "create", "update", "delete", "query"]
    )
    """The Microsoft Entra ID Application ID or URI to get the access token that will be included as
     the bearer token in delivery requests."""
    delivery_attribute_mappings: Optional[list["_models.DeliveryAttributeMapping"]] = rest_field(
        name="deliveryAttributeMappings", visibility=["read", "create", "update", "delete", "query"]
    )
    """Delivery attribute details."""
    minimum_tls_version_allowed: Optional[Union[str, "_models.TlsVersion"]] = rest_field(
        name="minimumTlsVersionAllowed", visibility=["read", "create", "update", "delete", "query"]
    )
    """Minimum TLS version that should be supported by webhook endpoint. Known values are: \"1.0\",
     \"1.1\", and \"1.2\"."""

    @overload
    def __init__(
        self,
        *,
        endpoint_url: Optional[str] = None,
        max_events_per_batch: Optional[int] = None,
        preferred_batch_size_in_kilobytes: Optional[int] = None,
        azure_active_directory_tenant_id: Optional[str] = None,
        azure_active_directory_application_id_or_uri: Optional[str] = None,
        delivery_attribute_mappings: Optional[list["_models.DeliveryAttributeMapping"]] = None,
        minimum_tls_version_allowed: Optional[Union[str, "_models.TlsVersion"]] = 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 WebhookPartnerDestinationInfo(PartnerDestinationInfo, discriminator="WebHook"):
    """Information about the WebHook of the partner destination.

    :ivar azure_subscription_id: Azure subscription ID of the subscriber. The partner destination
     associated with the channel will be created under this Azure subscription.
    :vartype azure_subscription_id: str
    :ivar resource_group_name: Azure Resource Group of the subscriber. The partner destination
     associated with the channel will be created under this resource group.
    :vartype resource_group_name: str
    :ivar name: Name of the partner destination associated with the channel.
    :vartype name: str
    :ivar endpoint_service_context: Additional context of the partner destination endpoint.
    :vartype endpoint_service_context: str
    :ivar properties: WebHook Properties of the partner destination.
    :vartype properties: ~azure.mgmt.eventgrid.models.WebhookPartnerDestinationProperties
    :ivar resource_move_change_history: Change history of the resource move.
    :vartype resource_move_change_history:
     list[~azure.mgmt.eventgrid.models.ResourceMoveChangeHistory]
    :ivar endpoint_type: Type of the endpoint for the partner destination. Required. WebHook.
    :vartype endpoint_type: str or ~azure.mgmt.eventgrid.models.WEB_HOOK
    """

    properties: Optional["_models.WebhookPartnerDestinationProperties"] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """WebHook Properties of the partner destination."""
    endpoint_type: Literal[PartnerEndpointType.WEB_HOOK] = rest_discriminator(name="endpointType", visibility=["read", "create", "update", "delete", "query"])  # type: ignore
    """Type of the endpoint for the partner destination. Required. WebHook."""

    __flattened_items = ["endpoint_url", "endpoint_base_url", "client_authentication"]

    @overload
    def __init__(
        self,
        *,
        azure_subscription_id: Optional[str] = None,
        resource_group_name: Optional[str] = None,
        name: Optional[str] = None,
        endpoint_service_context: Optional[str] = None,
        properties: Optional["_models.WebhookPartnerDestinationProperties"] = None,
        resource_move_change_history: Optional[list["_models.ResourceMoveChangeHistory"]] = 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:
        _flattened_input = {k: kwargs.pop(k) for k in kwargs.keys() & self.__flattened_items}
        super().__init__(*args, **kwargs)
        for k, v in _flattened_input.items():
            setattr(self, k, v)

    def __getattr__(self, name: str) -> Any:
        if name in self.__flattened_items:
            if self.properties is None:
                return None
            return getattr(self.properties, name)
        raise AttributeError(f"'{self.__class__.__name__}' object has no attribute '{name}'")

    def __setattr__(self, key: str, value: Any) -> None:
        if key in self.__flattened_items:
            if self.properties is None:
                self.properties = self._attr_to_rest_field["properties"]._class_type()
            setattr(self.properties, key, value)
        else:
            super().__setattr__(key, value)


class WebhookPartnerDestinationProperties(_Model):
    """Properties of a partner destination webhook.

    :ivar endpoint_url: The URL that represents the endpoint of the partner destination.
    :vartype endpoint_url: str
    :ivar endpoint_base_url: The base URL that represents the endpoint of the partner destination.
    :vartype endpoint_base_url: str
    :ivar client_authentication: Partner client authentication.
    :vartype client_authentication: ~azure.mgmt.eventgrid.models.PartnerClientAuthentication
    """

    endpoint_url: Optional[str] = rest_field(
        name="endpointUrl", visibility=["read", "create", "update", "delete", "query"]
    )
    """The URL that represents the endpoint of the partner destination."""
    endpoint_base_url: Optional[str] = rest_field(
        name="endpointBaseUrl", visibility=["read", "create", "update", "delete", "query"]
    )
    """The base URL that represents the endpoint of the partner destination."""
    client_authentication: Optional["_models.PartnerClientAuthentication"] = rest_field(
        name="clientAuthentication", visibility=["read", "create", "update", "delete", "query"]
    )
    """Partner client authentication."""

    @overload
    def __init__(
        self,
        *,
        endpoint_url: Optional[str] = None,
        endpoint_base_url: Optional[str] = None,
        client_authentication: Optional["_models.PartnerClientAuthentication"] = 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 WebhookUpdatePartnerDestinationInfo(PartnerUpdateDestinationInfo, discriminator="WebHook"):
    """Information about the update of the WebHook of the partner destination.

    :ivar properties: WebHook Properties of the partner destination.
    :vartype properties: ~azure.mgmt.eventgrid.models.WebhookPartnerDestinationProperties
    :ivar endpoint_type: Type of the endpoint for the partner destination. Required. WebHook.
    :vartype endpoint_type: str or ~azure.mgmt.eventgrid.models.WEB_HOOK
    """

    properties: Optional["_models.WebhookPartnerDestinationProperties"] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """WebHook Properties of the partner destination."""
    endpoint_type: Literal[PartnerEndpointType.WEB_HOOK] = rest_discriminator(name="endpointType", visibility=["read", "create", "update", "delete", "query"])  # type: ignore
    """Type of the endpoint for the partner destination. Required. WebHook."""

    __flattened_items = ["endpoint_url", "endpoint_base_url", "client_authentication"]

    @overload
    def __init__(
        self,
        *,
        properties: Optional["_models.WebhookPartnerDestinationProperties"] = 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:
        _flattened_input = {k: kwargs.pop(k) for k in kwargs.keys() & self.__flattened_items}
        super().__init__(*args, **kwargs)
        for k, v in _flattened_input.items():
            setattr(self, k, v)

    def __getattr__(self, name: str) -> Any:
        if name in self.__flattened_items:
            if self.properties is None:
                return None
            return getattr(self.properties, name)
        raise AttributeError(f"'{self.__class__.__name__}' object has no attribute '{name}'")

    def __setattr__(self, key: str, value: Any) -> None:
        if key in self.__flattened_items:
            if self.properties is None:
                self.properties = self._attr_to_rest_field["properties"]._class_type()
            setattr(self.properties, key, value)
        else:
            super().__setattr__(key, value)
