# 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 (
    CertificateSource,
    CertificateSourceParametersType,
    DeliveryRuleActionEnum,
    DeliveryRuleActionParametersType,
    DeliveryRuleConditionParametersType,
    MatchVariable,
    SecretType,
    SecurityPolicyType,
)

if TYPE_CHECKING:
    from .. import models as _models


class ActivatedResourceReference(_Model):
    """Reference to another resource along with its state.

    :ivar id: Resource ID.
    :vartype id: str
    :ivar is_active: Whether the resource is active or inactive.
    :vartype is_active: bool
    """

    id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """Resource ID."""
    is_active: Optional[bool] = rest_field(name="isActive", visibility=["read"])
    """Whether the resource is active or inactive."""

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


class AFDDomain(ProxyResource):
    """Friendly domain name mapping to the endpoint hostname that the customer provides for branding
    purposes, e.g. `www.contoso.com <http://www.contoso.com>`_.

    :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.cdn.models.SystemData
    :ivar properties: The JSON object that contains the properties of the domain to create.
    :vartype properties: ~azure.mgmt.cdn.models.AFDDomainProperties
    """

    properties: Optional["_models.AFDDomainProperties"] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """The JSON object that contains the properties of the domain to create."""

    __flattened_items = [
        "profile_name",
        "tls_settings",
        "azure_dns_zone",
        "pre_validated_custom_domain_resource_id",
        "provisioning_state",
        "deployment_status",
        "domain_validation_state",
        "host_name",
        "extended_properties",
        "validation_properties",
    ]

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

    @overload
    def __init__(self, mapping: Mapping[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 AFDDomainHttpsCustomizedCipherSuiteSet(_Model):
    """Customized cipher suite set object that will be used for Https when cipherSuiteSetType is
    Customized.

    :ivar cipher_suite_set_for_tls12: Cipher suites for TLS 1.2. Required at least one in
     minimumTlsVersion TLS 1.2.
    :vartype cipher_suite_set_for_tls12: list[str or
     ~azure.mgmt.cdn.models.AfdCustomizedCipherSuiteForTls12]
    :ivar cipher_suite_set_for_tls13: Cipher suites for TLS 1.3. Required at least one in
     minimumTlsVersion TLS 1.2, TLS 1.3.
    :vartype cipher_suite_set_for_tls13: list[str or
     ~azure.mgmt.cdn.models.AfdCustomizedCipherSuiteForTls13]
    """

    cipher_suite_set_for_tls12: Optional[list[Union[str, "_models.AfdCustomizedCipherSuiteForTls12"]]] = rest_field(
        name="cipherSuiteSetForTls12", visibility=["read", "create", "update", "delete", "query"]
    )
    """Cipher suites for TLS 1.2. Required at least one in minimumTlsVersion TLS 1.2."""
    cipher_suite_set_for_tls13: Optional[list[Union[str, "_models.AfdCustomizedCipherSuiteForTls13"]]] = rest_field(
        name="cipherSuiteSetForTls13", visibility=["read", "create", "update", "delete", "query"]
    )
    """Cipher suites for TLS 1.3. Required at least one in minimumTlsVersion TLS 1.2, TLS 1.3."""

    @overload
    def __init__(
        self,
        *,
        cipher_suite_set_for_tls12: Optional[list[Union[str, "_models.AfdCustomizedCipherSuiteForTls12"]]] = None,
        cipher_suite_set_for_tls13: Optional[list[Union[str, "_models.AfdCustomizedCipherSuiteForTls13"]]] = None,
    ) -> None: ...

    @overload
    def __init__(self, mapping: Mapping[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 AFDDomainHttpsParameters(_Model):
    """The JSON object that contains the properties to secure a domain.

    :ivar certificate_type: Defines the source of the SSL certificate. Required. Known values are:
     "CustomerCertificate", "ManagedCertificate", and "AzureFirstPartyManagedCertificate".
    :vartype certificate_type: str or ~azure.mgmt.cdn.models.AfdCertificateType
    :ivar cipher_suite_set_type: cipher suite set type that will be used for Https. Known values
     are: "Customized", "TLS10_2019", "TLS12_2022", and "TLS12_2023".
    :vartype cipher_suite_set_type: str or ~azure.mgmt.cdn.models.AfdCipherSuiteSetType
    :ivar minimum_tls_version: TLS protocol version that will be used for Https when
     cipherSuiteSetType is Customized. Known values are: "TLS10", "TLS12", and "TLS13".
    :vartype minimum_tls_version: str or ~azure.mgmt.cdn.models.AfdMinimumTlsVersion
    :ivar customized_cipher_suite_set: Customized cipher suites object that will be used for Https
     when cipherSuiteSetType is Customized.
    :vartype customized_cipher_suite_set:
     ~azure.mgmt.cdn.models.AFDDomainHttpsCustomizedCipherSuiteSet
    :ivar secret: Resource reference to the secret. ie. subs/rg/profile/secret.
    :vartype secret: ~azure.mgmt.cdn.models.ResourceReference
    """

    certificate_type: Union[str, "_models.AfdCertificateType"] = rest_field(
        name="certificateType", visibility=["read", "create", "update", "delete", "query"]
    )
    """Defines the source of the SSL certificate. Required. Known values are: \"CustomerCertificate\",
     \"ManagedCertificate\", and \"AzureFirstPartyManagedCertificate\"."""
    cipher_suite_set_type: Optional[Union[str, "_models.AfdCipherSuiteSetType"]] = rest_field(
        name="cipherSuiteSetType", visibility=["read", "create", "update", "delete", "query"]
    )
    """cipher suite set type that will be used for Https. Known values are: \"Customized\",
     \"TLS10_2019\", \"TLS12_2022\", and \"TLS12_2023\"."""
    minimum_tls_version: Optional[Union[str, "_models.AfdMinimumTlsVersion"]] = rest_field(
        name="minimumTlsVersion", visibility=["read", "create", "update", "delete", "query"]
    )
    """TLS protocol version that will be used for Https when cipherSuiteSetType is Customized. Known
     values are: \"TLS10\", \"TLS12\", and \"TLS13\"."""
    customized_cipher_suite_set: Optional["_models.AFDDomainHttpsCustomizedCipherSuiteSet"] = rest_field(
        name="customizedCipherSuiteSet", visibility=["read", "create", "update", "delete", "query"]
    )
    """Customized cipher suites object that will be used for Https when cipherSuiteSetType is
     Customized."""
    secret: Optional["_models.ResourceReference"] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """Resource reference to the secret. ie. subs/rg/profile/secret."""

    @overload
    def __init__(
        self,
        *,
        certificate_type: Union[str, "_models.AfdCertificateType"],
        cipher_suite_set_type: Optional[Union[str, "_models.AfdCipherSuiteSetType"]] = None,
        minimum_tls_version: Optional[Union[str, "_models.AfdMinimumTlsVersion"]] = None,
        customized_cipher_suite_set: Optional["_models.AFDDomainHttpsCustomizedCipherSuiteSet"] = None,
        secret: Optional["_models.ResourceReference"] = None,
    ) -> None: ...

    @overload
    def __init__(self, mapping: Mapping[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 AFDDomainProperties(_Model):
    """The JSON object that contains the properties of the domain to create.

    :ivar profile_name: The name of the profile which holds the domain.
    :vartype profile_name: str
    :ivar tls_settings: The configuration specifying how to enable HTTPS for the domain - using
     AzureFrontDoor managed certificate or user's own certificate. If not specified, enabling ssl
     uses AzureFrontDoor managed certificate by default.
    :vartype tls_settings: ~azure.mgmt.cdn.models.AFDDomainHttpsParameters
    :ivar azure_dns_zone: Resource reference to the Azure DNS zone.
    :vartype azure_dns_zone: ~azure.mgmt.cdn.models.ResourceReference
    :ivar pre_validated_custom_domain_resource_id: Resource reference to the Azure resource where
     custom domain ownership was prevalidated.
    :vartype pre_validated_custom_domain_resource_id: ~azure.mgmt.cdn.models.ResourceReference
    :ivar provisioning_state: Provisioning status. Known values are: "Succeeded", "Failed",
     "Updating", "Deleting", and "Creating".
    :vartype provisioning_state: str or ~azure.mgmt.cdn.models.AfdProvisioningState
    :ivar deployment_status: Known values are: "NotStarted", "InProgress", "Succeeded", and
     "Failed".
    :vartype deployment_status: str or ~azure.mgmt.cdn.models.DeploymentStatus
    :ivar domain_validation_state: Provisioning substate shows the progress of custom HTTPS
     enabling/disabling process step by step. DCV stands for DomainControlValidation. Known values
     are: "Unknown", "Submitting", "Pending", "Rejected", "TimedOut", "PendingRevalidation",
     "Approved", "RefreshingValidationToken", and "InternalError".
    :vartype domain_validation_state: str or ~azure.mgmt.cdn.models.DomainValidationState
    :ivar host_name: The host name of the domain. Must be a domain name. Required.
    :vartype host_name: str
    :ivar extended_properties: Key-Value pair representing migration properties for domains.
    :vartype extended_properties: dict[str, str]
    :ivar validation_properties: Values the customer needs to validate domain ownership.
    :vartype validation_properties: ~azure.mgmt.cdn.models.DomainValidationProperties
    """

    profile_name: Optional[str] = rest_field(name="profileName", visibility=["read"])
    """The name of the profile which holds the domain."""
    tls_settings: Optional["_models.AFDDomainHttpsParameters"] = rest_field(
        name="tlsSettings", visibility=["read", "create", "update", "delete", "query"]
    )
    """The configuration specifying how to enable HTTPS for the domain - using AzureFrontDoor managed
     certificate or user's own certificate. If not specified, enabling ssl uses AzureFrontDoor
     managed certificate by default."""
    azure_dns_zone: Optional["_models.ResourceReference"] = rest_field(
        name="azureDnsZone", visibility=["read", "create", "update", "delete", "query"]
    )
    """Resource reference to the Azure DNS zone."""
    pre_validated_custom_domain_resource_id: Optional["_models.ResourceReference"] = rest_field(
        name="preValidatedCustomDomainResourceId", visibility=["read", "create", "update", "delete", "query"]
    )
    """Resource reference to the Azure resource where custom domain ownership was prevalidated."""
    provisioning_state: Optional[Union[str, "_models.AfdProvisioningState"]] = rest_field(
        name="provisioningState", visibility=["read"]
    )
    """Provisioning status. Known values are: \"Succeeded\", \"Failed\", \"Updating\", \"Deleting\",
     and \"Creating\"."""
    deployment_status: Optional[Union[str, "_models.DeploymentStatus"]] = rest_field(
        name="deploymentStatus", visibility=["read"]
    )
    """Known values are: \"NotStarted\", \"InProgress\", \"Succeeded\", and \"Failed\"."""
    domain_validation_state: Optional[Union[str, "_models.DomainValidationState"]] = rest_field(
        name="domainValidationState", visibility=["read"]
    )
    """Provisioning substate shows the progress of custom HTTPS enabling/disabling process step by
     step. DCV stands for DomainControlValidation. Known values are: \"Unknown\", \"Submitting\",
     \"Pending\", \"Rejected\", \"TimedOut\", \"PendingRevalidation\", \"Approved\",
     \"RefreshingValidationToken\", and \"InternalError\"."""
    host_name: str = rest_field(name="hostName", visibility=["read", "create", "update", "delete", "query"])
    """The host name of the domain. Must be a domain name. Required."""
    extended_properties: Optional[dict[str, str]] = rest_field(
        name="extendedProperties", visibility=["read", "create", "update", "delete", "query"]
    )
    """Key-Value pair representing migration properties for domains."""
    validation_properties: Optional["_models.DomainValidationProperties"] = rest_field(
        name="validationProperties", visibility=["read"]
    )
    """Values the customer needs to validate domain ownership."""

    @overload
    def __init__(
        self,
        *,
        host_name: str,
        tls_settings: Optional["_models.AFDDomainHttpsParameters"] = None,
        azure_dns_zone: Optional["_models.ResourceReference"] = None,
        pre_validated_custom_domain_resource_id: Optional["_models.ResourceReference"] = None,
        extended_properties: Optional[dict[str, str]] = None,
    ) -> None: ...

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

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


class AFDDomainUpdateParameters(_Model):
    """The domain JSON object required for domain creation or update.

    :ivar properties: The JSON object that contains the properties of the domain to create.
    :vartype properties: ~azure.mgmt.cdn.models.AFDDomainUpdatePropertiesParameters
    """

    properties: Optional["_models.AFDDomainUpdatePropertiesParameters"] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """The JSON object that contains the properties of the domain to create."""

    __flattened_items = ["profile_name", "tls_settings", "azure_dns_zone", "pre_validated_custom_domain_resource_id"]

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

    @overload
    def __init__(self, mapping: Mapping[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 AFDDomainUpdatePropertiesParameters(_Model):
    """The JSON object that contains the properties of the domain to create.

    :ivar profile_name: The name of the profile which holds the domain.
    :vartype profile_name: str
    :ivar tls_settings: The configuration specifying how to enable HTTPS for the domain - using
     AzureFrontDoor managed certificate or user's own certificate. If not specified, enabling ssl
     uses AzureFrontDoor managed certificate by default.
    :vartype tls_settings: ~azure.mgmt.cdn.models.AFDDomainHttpsParameters
    :ivar azure_dns_zone: Resource reference to the Azure DNS zone.
    :vartype azure_dns_zone: ~azure.mgmt.cdn.models.ResourceReference
    :ivar pre_validated_custom_domain_resource_id: Resource reference to the Azure resource where
     custom domain ownership was prevalidated.
    :vartype pre_validated_custom_domain_resource_id: ~azure.mgmt.cdn.models.ResourceReference
    """

    profile_name: Optional[str] = rest_field(name="profileName", visibility=["read"])
    """The name of the profile which holds the domain."""
    tls_settings: Optional["_models.AFDDomainHttpsParameters"] = rest_field(
        name="tlsSettings", visibility=["read", "create", "update", "delete", "query"]
    )
    """The configuration specifying how to enable HTTPS for the domain - using AzureFrontDoor managed
     certificate or user's own certificate. If not specified, enabling ssl uses AzureFrontDoor
     managed certificate by default."""
    azure_dns_zone: Optional["_models.ResourceReference"] = rest_field(
        name="azureDnsZone", visibility=["read", "create", "update", "delete", "query"]
    )
    """Resource reference to the Azure DNS zone."""
    pre_validated_custom_domain_resource_id: Optional["_models.ResourceReference"] = rest_field(
        name="preValidatedCustomDomainResourceId", visibility=["read", "create", "update", "delete", "query"]
    )
    """Resource reference to the Azure resource where custom domain ownership was prevalidated."""

    @overload
    def __init__(
        self,
        *,
        tls_settings: Optional["_models.AFDDomainHttpsParameters"] = None,
        azure_dns_zone: Optional["_models.ResourceReference"] = None,
        pre_validated_custom_domain_resource_id: Optional["_models.ResourceReference"] = None,
    ) -> None: ...

    @overload
    def __init__(self, mapping: Mapping[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.cdn.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 AFDEndpoint(TrackedResource):
    """Azure Front Door endpoint is the entity within a Azure Front Door profile containing
    configuration information such as origin, protocol, content caching and delivery behavior. The
    AzureFrontDoor endpoint uses the URL format <endpointname>.azureedge.net.

    :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.cdn.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: The JSON object that contains the properties required to create an endpoint.
    :vartype properties: ~azure.mgmt.cdn.models.AFDEndpointProperties
    """

    properties: Optional["_models.AFDEndpointProperties"] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """The JSON object that contains the properties required to create an endpoint."""

    __flattened_items = [
        "profile_name",
        "enabled_state",
        "provisioning_state",
        "deployment_status",
        "host_name",
        "auto_generated_domain_name_label_scope",
    ]

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

    @overload
    def __init__(self, mapping: Mapping[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 AFDEndpointProperties(_Model):
    """The JSON object that contains the properties required to create an endpoint.

    :ivar profile_name: The name of the profile which holds the endpoint.
    :vartype profile_name: str
    :ivar enabled_state: Whether to enable use of this rule. Permitted values are 'Enabled' or
     'Disabled'. Known values are: "Enabled" and "Disabled".
    :vartype enabled_state: str or ~azure.mgmt.cdn.models.EnabledState
    :ivar provisioning_state: Provisioning status. Known values are: "Succeeded", "Failed",
     "Updating", "Deleting", and "Creating".
    :vartype provisioning_state: str or ~azure.mgmt.cdn.models.AfdProvisioningState
    :ivar deployment_status: Known values are: "NotStarted", "InProgress", "Succeeded", and
     "Failed".
    :vartype deployment_status: str or ~azure.mgmt.cdn.models.DeploymentStatus
    :ivar host_name: The host name of the endpoint structured as {endpointName}.{DNSZone}, e.g.
     contoso.azureedge.net.
    :vartype host_name: str
    :ivar auto_generated_domain_name_label_scope: Indicates the endpoint name reuse scope. The
     default value is TenantReuse. Known values are: "TenantReuse", "SubscriptionReuse",
     "ResourceGroupReuse", and "NoReuse".
    :vartype auto_generated_domain_name_label_scope: str or
     ~azure.mgmt.cdn.models.AutoGeneratedDomainNameLabelScope
    """

    profile_name: Optional[str] = rest_field(name="profileName", visibility=["read"])
    """The name of the profile which holds the endpoint."""
    enabled_state: Optional[Union[str, "_models.EnabledState"]] = rest_field(
        name="enabledState", visibility=["read", "create", "update", "delete", "query"]
    )
    """Whether to enable use of this rule. Permitted values are 'Enabled' or 'Disabled'. Known values
     are: \"Enabled\" and \"Disabled\"."""
    provisioning_state: Optional[Union[str, "_models.AfdProvisioningState"]] = rest_field(
        name="provisioningState", visibility=["read"]
    )
    """Provisioning status. Known values are: \"Succeeded\", \"Failed\", \"Updating\", \"Deleting\",
     and \"Creating\"."""
    deployment_status: Optional[Union[str, "_models.DeploymentStatus"]] = rest_field(
        name="deploymentStatus", visibility=["read"]
    )
    """Known values are: \"NotStarted\", \"InProgress\", \"Succeeded\", and \"Failed\"."""
    host_name: Optional[str] = rest_field(name="hostName", visibility=["read"])
    """The host name of the endpoint structured as {endpointName}.{DNSZone}, e.g.
     contoso.azureedge.net."""
    auto_generated_domain_name_label_scope: Optional[Union[str, "_models.AutoGeneratedDomainNameLabelScope"]] = (
        rest_field(name="autoGeneratedDomainNameLabelScope", visibility=["read", "create", "update", "delete", "query"])
    )
    """Indicates the endpoint name reuse scope. The default value is TenantReuse. Known values are:
     \"TenantReuse\", \"SubscriptionReuse\", \"ResourceGroupReuse\", and \"NoReuse\"."""

    @overload
    def __init__(
        self,
        *,
        enabled_state: Optional[Union[str, "_models.EnabledState"]] = None,
        auto_generated_domain_name_label_scope: Optional[
            Union[str, "_models.AutoGeneratedDomainNameLabelScope"]
        ] = None,
    ) -> None: ...

    @overload
    def __init__(self, mapping: Mapping[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 AFDEndpointPropertiesUpdateParameters(_Model):
    """The JSON object containing endpoint update parameters.

    :ivar profile_name: The name of the profile which holds the endpoint.
    :vartype profile_name: str
    :ivar enabled_state: Whether to enable use of this rule. Permitted values are 'Enabled' or
     'Disabled'. Known values are: "Enabled" and "Disabled".
    :vartype enabled_state: str or ~azure.mgmt.cdn.models.EnabledState
    """

    profile_name: Optional[str] = rest_field(name="profileName", visibility=["read"])
    """The name of the profile which holds the endpoint."""
    enabled_state: Optional[Union[str, "_models.EnabledState"]] = rest_field(
        name="enabledState", visibility=["read", "create", "update", "delete", "query"]
    )
    """Whether to enable use of this rule. Permitted values are 'Enabled' or 'Disabled'. Known values
     are: \"Enabled\" and \"Disabled\"."""

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

    @overload
    def __init__(self, mapping: Mapping[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 AFDEndpointUpdateParameters(_Model):
    """Properties required to create or update an endpoint.

    :ivar tags: Endpoint tags.
    :vartype tags: dict[str, str]
    :ivar properties: The JSON object containing endpoint update parameters.
    :vartype properties: ~azure.mgmt.cdn.models.AFDEndpointPropertiesUpdateParameters
    """

    tags: Optional[dict[str, str]] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """Endpoint tags."""
    properties: Optional["_models.AFDEndpointPropertiesUpdateParameters"] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """The JSON object containing endpoint update parameters."""

    __flattened_items = ["profile_name", "enabled_state"]

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

    @overload
    def __init__(self, mapping: Mapping[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 AFDOrigin(ProxyResource):
    """Azure Front Door origin is the source of the content being delivered via Azure Front Door. When
    the edge nodes represented by an endpoint do not have the requested content cached, they
    attempt to fetch it from one or more of the configured origins.

    :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.cdn.models.SystemData
    :ivar properties: The JSON object that contains the properties of the origin.
    :vartype properties: ~azure.mgmt.cdn.models.AFDOriginProperties
    """

    properties: Optional["_models.AFDOriginProperties"] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """The JSON object that contains the properties of the origin."""

    __flattened_items = [
        "origin_group_name",
        "azure_origin",
        "host_name",
        "http_port",
        "https_port",
        "origin_host_header",
        "priority",
        "weight",
        "shared_private_link_resource",
        "enabled_state",
        "enforce_certificate_name_check",
        "provisioning_state",
        "deployment_status",
    ]

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

    @overload
    def __init__(self, mapping: Mapping[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 AFDOriginGroup(ProxyResource):
    """AFDOrigin group comprising of origins is used for load balancing to origins when the content
    cannot be served from Azure Front Door.

    :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.cdn.models.SystemData
    :ivar properties: The JSON object that contains the properties of the origin group.
    :vartype properties: ~azure.mgmt.cdn.models.AFDOriginGroupProperties
    """

    properties: Optional["_models.AFDOriginGroupProperties"] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """The JSON object that contains the properties of the origin group."""

    __flattened_items = [
        "profile_name",
        "load_balancing_settings",
        "health_probe_settings",
        "traffic_restoration_time_to_healed_or_new_endpoints_in_minutes",
        "session_affinity_state",
        "authentication",
        "provisioning_state",
        "deployment_status",
    ]

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

    @overload
    def __init__(self, mapping: Mapping[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 AFDOriginGroupProperties(_Model):
    """The JSON object that contains the properties of the origin group.

    :ivar profile_name: The name of the profile which holds the origin group.
    :vartype profile_name: str
    :ivar load_balancing_settings: Load balancing settings for a backend pool.
    :vartype load_balancing_settings: ~azure.mgmt.cdn.models.LoadBalancingSettingsParameters
    :ivar health_probe_settings: Health probe settings to the origin that is used to determine the
     health of the origin.
    :vartype health_probe_settings: ~azure.mgmt.cdn.models.HealthProbeParameters
    :ivar traffic_restoration_time_to_healed_or_new_endpoints_in_minutes: Time in minutes to shift
     the traffic to the endpoint gradually when an unhealthy endpoint comes healthy or a new
     endpoint is added. Default is 10 mins. This property is currently not supported.
    :vartype traffic_restoration_time_to_healed_or_new_endpoints_in_minutes: int
    :ivar session_affinity_state: Whether to allow session affinity on this host. Valid options are
     'Enabled' or 'Disabled'. Known values are: "Enabled" and "Disabled".
    :vartype session_affinity_state: str or ~azure.mgmt.cdn.models.EnabledState
    :ivar authentication: Authentication settings for origin in origin group.
    :vartype authentication: ~azure.mgmt.cdn.models.OriginAuthenticationProperties
    :ivar provisioning_state: Provisioning status. Known values are: "Succeeded", "Failed",
     "Updating", "Deleting", and "Creating".
    :vartype provisioning_state: str or ~azure.mgmt.cdn.models.AfdProvisioningState
    :ivar deployment_status: Known values are: "NotStarted", "InProgress", "Succeeded", and
     "Failed".
    :vartype deployment_status: str or ~azure.mgmt.cdn.models.DeploymentStatus
    """

    profile_name: Optional[str] = rest_field(name="profileName", visibility=["read"])
    """The name of the profile which holds the origin group."""
    load_balancing_settings: Optional["_models.LoadBalancingSettingsParameters"] = rest_field(
        name="loadBalancingSettings", visibility=["read", "create", "update", "delete", "query"]
    )
    """Load balancing settings for a backend pool."""
    health_probe_settings: Optional["_models.HealthProbeParameters"] = rest_field(
        name="healthProbeSettings", visibility=["read", "create", "update", "delete", "query"]
    )
    """Health probe settings to the origin that is used to determine the health of the origin."""
    traffic_restoration_time_to_healed_or_new_endpoints_in_minutes: Optional[int] = rest_field(
        name="trafficRestorationTimeToHealedOrNewEndpointsInMinutes",
        visibility=["read", "create", "update", "delete", "query"],
    )
    """Time in minutes to shift the traffic to the endpoint gradually when an unhealthy endpoint comes
     healthy or a new endpoint is added. Default is 10 mins. This property is currently not
     supported."""
    session_affinity_state: Optional[Union[str, "_models.EnabledState"]] = rest_field(
        name="sessionAffinityState", visibility=["read", "create", "update", "delete", "query"]
    )
    """Whether to allow session affinity on this host. Valid options are 'Enabled' or 'Disabled'.
     Known values are: \"Enabled\" and \"Disabled\"."""
    authentication: Optional["_models.OriginAuthenticationProperties"] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """Authentication settings for origin in origin group."""
    provisioning_state: Optional[Union[str, "_models.AfdProvisioningState"]] = rest_field(
        name="provisioningState", visibility=["read"]
    )
    """Provisioning status. Known values are: \"Succeeded\", \"Failed\", \"Updating\", \"Deleting\",
     and \"Creating\"."""
    deployment_status: Optional[Union[str, "_models.DeploymentStatus"]] = rest_field(
        name="deploymentStatus", visibility=["read"]
    )
    """Known values are: \"NotStarted\", \"InProgress\", \"Succeeded\", and \"Failed\"."""

    @overload
    def __init__(
        self,
        *,
        load_balancing_settings: Optional["_models.LoadBalancingSettingsParameters"] = None,
        health_probe_settings: Optional["_models.HealthProbeParameters"] = None,
        traffic_restoration_time_to_healed_or_new_endpoints_in_minutes: Optional[int] = None,
        session_affinity_state: Optional[Union[str, "_models.EnabledState"]] = None,
        authentication: Optional["_models.OriginAuthenticationProperties"] = None,
    ) -> None: ...

    @overload
    def __init__(self, mapping: Mapping[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 AFDOriginGroupUpdateParameters(_Model):
    """AFDOrigin group properties needed for origin group creation or update.

    :ivar properties: The JSON object that contains the properties of the origin group.
    :vartype properties: ~azure.mgmt.cdn.models.AFDOriginGroupUpdatePropertiesParameters
    """

    properties: Optional["_models.AFDOriginGroupUpdatePropertiesParameters"] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """The JSON object that contains the properties of the origin group."""

    __flattened_items = [
        "profile_name",
        "load_balancing_settings",
        "health_probe_settings",
        "traffic_restoration_time_to_healed_or_new_endpoints_in_minutes",
        "session_affinity_state",
        "authentication",
    ]

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

    @overload
    def __init__(self, mapping: Mapping[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 AFDOriginGroupUpdatePropertiesParameters(_Model):
    """The JSON object that contains the properties of the origin group.

    :ivar profile_name: The name of the profile which holds the origin group.
    :vartype profile_name: str
    :ivar load_balancing_settings: Load balancing settings for a backend pool.
    :vartype load_balancing_settings: ~azure.mgmt.cdn.models.LoadBalancingSettingsParameters
    :ivar health_probe_settings: Health probe settings to the origin that is used to determine the
     health of the origin.
    :vartype health_probe_settings: ~azure.mgmt.cdn.models.HealthProbeParameters
    :ivar traffic_restoration_time_to_healed_or_new_endpoints_in_minutes: Time in minutes to shift
     the traffic to the endpoint gradually when an unhealthy endpoint comes healthy or a new
     endpoint is added. Default is 10 mins. This property is currently not supported.
    :vartype traffic_restoration_time_to_healed_or_new_endpoints_in_minutes: int
    :ivar session_affinity_state: Whether to allow session affinity on this host. Valid options are
     'Enabled' or 'Disabled'. Known values are: "Enabled" and "Disabled".
    :vartype session_affinity_state: str or ~azure.mgmt.cdn.models.EnabledState
    :ivar authentication: Authentication settings for origin in origin group.
    :vartype authentication: ~azure.mgmt.cdn.models.OriginAuthenticationProperties
    """

    profile_name: Optional[str] = rest_field(name="profileName", visibility=["read"])
    """The name of the profile which holds the origin group."""
    load_balancing_settings: Optional["_models.LoadBalancingSettingsParameters"] = rest_field(
        name="loadBalancingSettings", visibility=["read", "create", "update", "delete", "query"]
    )
    """Load balancing settings for a backend pool."""
    health_probe_settings: Optional["_models.HealthProbeParameters"] = rest_field(
        name="healthProbeSettings", visibility=["read", "create", "update", "delete", "query"]
    )
    """Health probe settings to the origin that is used to determine the health of the origin."""
    traffic_restoration_time_to_healed_or_new_endpoints_in_minutes: Optional[int] = rest_field(
        name="trafficRestorationTimeToHealedOrNewEndpointsInMinutes",
        visibility=["read", "create", "update", "delete", "query"],
    )
    """Time in minutes to shift the traffic to the endpoint gradually when an unhealthy endpoint comes
     healthy or a new endpoint is added. Default is 10 mins. This property is currently not
     supported."""
    session_affinity_state: Optional[Union[str, "_models.EnabledState"]] = rest_field(
        name="sessionAffinityState", visibility=["read", "create", "update", "delete", "query"]
    )
    """Whether to allow session affinity on this host. Valid options are 'Enabled' or 'Disabled'.
     Known values are: \"Enabled\" and \"Disabled\"."""
    authentication: Optional["_models.OriginAuthenticationProperties"] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """Authentication settings for origin in origin group."""

    @overload
    def __init__(
        self,
        *,
        load_balancing_settings: Optional["_models.LoadBalancingSettingsParameters"] = None,
        health_probe_settings: Optional["_models.HealthProbeParameters"] = None,
        traffic_restoration_time_to_healed_or_new_endpoints_in_minutes: Optional[int] = None,
        session_affinity_state: Optional[Union[str, "_models.EnabledState"]] = None,
        authentication: Optional["_models.OriginAuthenticationProperties"] = None,
    ) -> None: ...

    @overload
    def __init__(self, mapping: Mapping[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 AFDOriginProperties(_Model):
    """The JSON object that contains the properties of the origin.

    :ivar origin_group_name: The name of the origin group which contains this origin.
    :vartype origin_group_name: str
    :ivar azure_origin: Resource reference to the Azure origin resource.
    :vartype azure_origin: ~azure.mgmt.cdn.models.ResourceReference
    :ivar host_name: The address of the origin. Domain names, IPv4 addresses, and IPv6 addresses
     are supported.This should be unique across all origins in an endpoint.
    :vartype host_name: str
    :ivar http_port: The value of the HTTP port. Must be between 1 and 65535.
    :vartype http_port: int
    :ivar https_port: The value of the HTTPS port. Must be between 1 and 65535.
    :vartype https_port: int
    :ivar origin_host_header: The host header value sent to the origin with each request. If you
     leave this blank, the request hostname determines this value. Azure Front Door origins, such as
     Web Apps, Blob Storage, and Cloud Services require this host header value to match the origin
     hostname by default. This overrides the host header defined at Endpoint.
    :vartype origin_host_header: str
    :ivar priority: Priority of origin in given origin group for load balancing. Higher priorities
     will not be used for load balancing if any lower priority origin is healthy.Must be between 1
     and 5.
    :vartype priority: int
    :ivar weight: Weight of the origin in given origin group for load balancing. Must be between 1
     and 1000.
    :vartype weight: int
    :ivar shared_private_link_resource: The properties of the private link resource for private
     origin.
    :vartype shared_private_link_resource:
     ~azure.mgmt.cdn.models.SharedPrivateLinkResourceProperties
    :ivar enabled_state: Whether to enable health probes to be made against backends defined under
     backendPools. Health probes can only be disabled if there is a single enabled backend in single
     enabled backend pool. Known values are: "Enabled" and "Disabled".
    :vartype enabled_state: str or ~azure.mgmt.cdn.models.EnabledState
    :ivar enforce_certificate_name_check: Whether to enable certificate name check at origin level.
    :vartype enforce_certificate_name_check: bool
    :ivar provisioning_state: Provisioning status. Known values are: "Succeeded", "Failed",
     "Updating", "Deleting", and "Creating".
    :vartype provisioning_state: str or ~azure.mgmt.cdn.models.AfdProvisioningState
    :ivar deployment_status: Known values are: "NotStarted", "InProgress", "Succeeded", and
     "Failed".
    :vartype deployment_status: str or ~azure.mgmt.cdn.models.DeploymentStatus
    """

    origin_group_name: Optional[str] = rest_field(name="originGroupName", visibility=["read"])
    """The name of the origin group which contains this origin."""
    azure_origin: Optional["_models.ResourceReference"] = rest_field(
        name="azureOrigin", visibility=["read", "create", "update", "delete", "query"]
    )
    """Resource reference to the Azure origin resource."""
    host_name: Optional[str] = rest_field(name="hostName", visibility=["read", "create", "update", "delete", "query"])
    """The address of the origin. Domain names, IPv4 addresses, and IPv6 addresses are supported.This
     should be unique across all origins in an endpoint."""
    http_port: Optional[int] = rest_field(name="httpPort", visibility=["read", "create", "update", "delete", "query"])
    """The value of the HTTP port. Must be between 1 and 65535."""
    https_port: Optional[int] = rest_field(name="httpsPort", visibility=["read", "create", "update", "delete", "query"])
    """The value of the HTTPS port. Must be between 1 and 65535."""
    origin_host_header: Optional[str] = rest_field(
        name="originHostHeader", visibility=["read", "create", "update", "delete", "query"]
    )
    """The host header value sent to the origin with each request. If you leave this blank, the
     request hostname determines this value. Azure Front Door origins, such as Web Apps, Blob
     Storage, and Cloud Services require this host header value to match the origin hostname by
     default. This overrides the host header defined at Endpoint."""
    priority: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """Priority of origin in given origin group for load balancing. Higher priorities will not be used
     for load balancing if any lower priority origin is healthy.Must be between 1 and 5."""
    weight: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """Weight of the origin in given origin group for load balancing. Must be between 1 and 1000."""
    shared_private_link_resource: Optional["_models.SharedPrivateLinkResourceProperties"] = rest_field(
        name="sharedPrivateLinkResource", visibility=["read", "create", "update", "delete", "query"]
    )
    """The properties of the private link resource for private origin."""
    enabled_state: Optional[Union[str, "_models.EnabledState"]] = rest_field(
        name="enabledState", visibility=["read", "create", "update", "delete", "query"]
    )
    """Whether to enable health probes to be made against backends defined under backendPools. Health
     probes can only be disabled if there is a single enabled backend in single enabled backend
     pool. Known values are: \"Enabled\" and \"Disabled\"."""
    enforce_certificate_name_check: Optional[bool] = rest_field(
        name="enforceCertificateNameCheck", visibility=["read", "create", "update", "delete", "query"]
    )
    """Whether to enable certificate name check at origin level."""
    provisioning_state: Optional[Union[str, "_models.AfdProvisioningState"]] = rest_field(
        name="provisioningState", visibility=["read"]
    )
    """Provisioning status. Known values are: \"Succeeded\", \"Failed\", \"Updating\", \"Deleting\",
     and \"Creating\"."""
    deployment_status: Optional[Union[str, "_models.DeploymentStatus"]] = rest_field(
        name="deploymentStatus", visibility=["read"]
    )
    """Known values are: \"NotStarted\", \"InProgress\", \"Succeeded\", and \"Failed\"."""

    @overload
    def __init__(
        self,
        *,
        azure_origin: Optional["_models.ResourceReference"] = None,
        host_name: Optional[str] = None,
        http_port: Optional[int] = None,
        https_port: Optional[int] = None,
        origin_host_header: Optional[str] = None,
        priority: Optional[int] = None,
        weight: Optional[int] = None,
        shared_private_link_resource: Optional["_models.SharedPrivateLinkResourceProperties"] = None,
        enabled_state: Optional[Union[str, "_models.EnabledState"]] = None,
        enforce_certificate_name_check: 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 AFDOriginUpdateParameters(_Model):
    """AFDOrigin properties needed for origin update.

    :ivar properties: The JSON object that contains the properties of the origin.
    :vartype properties: ~azure.mgmt.cdn.models.AFDOriginUpdatePropertiesParameters
    """

    properties: Optional["_models.AFDOriginUpdatePropertiesParameters"] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """The JSON object that contains the properties of the origin."""

    __flattened_items = [
        "origin_group_name",
        "azure_origin",
        "host_name",
        "http_port",
        "https_port",
        "origin_host_header",
        "priority",
        "weight",
        "shared_private_link_resource",
        "enabled_state",
        "enforce_certificate_name_check",
    ]

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

    @overload
    def __init__(self, mapping: Mapping[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 AFDOriginUpdatePropertiesParameters(_Model):
    """The JSON object that contains the properties of the origin.

    :ivar origin_group_name: The name of the origin group which contains this origin.
    :vartype origin_group_name: str
    :ivar azure_origin: Resource reference to the Azure origin resource.
    :vartype azure_origin: ~azure.mgmt.cdn.models.ResourceReference
    :ivar host_name: The address of the origin. Domain names, IPv4 addresses, and IPv6 addresses
     are supported.This should be unique across all origins in an endpoint.
    :vartype host_name: str
    :ivar http_port: The value of the HTTP port. Must be between 1 and 65535.
    :vartype http_port: int
    :ivar https_port: The value of the HTTPS port. Must be between 1 and 65535.
    :vartype https_port: int
    :ivar origin_host_header: The host header value sent to the origin with each request. If you
     leave this blank, the request hostname determines this value. Azure Front Door origins, such as
     Web Apps, Blob Storage, and Cloud Services require this host header value to match the origin
     hostname by default. This overrides the host header defined at Endpoint.
    :vartype origin_host_header: str
    :ivar priority: Priority of origin in given origin group for load balancing. Higher priorities
     will not be used for load balancing if any lower priority origin is healthy.Must be between 1
     and 5.
    :vartype priority: int
    :ivar weight: Weight of the origin in given origin group for load balancing. Must be between 1
     and 1000.
    :vartype weight: int
    :ivar shared_private_link_resource: The properties of the private link resource for private
     origin.
    :vartype shared_private_link_resource:
     ~azure.mgmt.cdn.models.SharedPrivateLinkResourceProperties
    :ivar enabled_state: Whether to enable health probes to be made against backends defined under
     backendPools. Health probes can only be disabled if there is a single enabled backend in single
     enabled backend pool. Known values are: "Enabled" and "Disabled".
    :vartype enabled_state: str or ~azure.mgmt.cdn.models.EnabledState
    :ivar enforce_certificate_name_check: Whether to enable certificate name check at origin level.
    :vartype enforce_certificate_name_check: bool
    """

    origin_group_name: Optional[str] = rest_field(name="originGroupName", visibility=["read"])
    """The name of the origin group which contains this origin."""
    azure_origin: Optional["_models.ResourceReference"] = rest_field(
        name="azureOrigin", visibility=["read", "create", "update", "delete", "query"]
    )
    """Resource reference to the Azure origin resource."""
    host_name: Optional[str] = rest_field(name="hostName", visibility=["read", "create", "update", "delete", "query"])
    """The address of the origin. Domain names, IPv4 addresses, and IPv6 addresses are supported.This
     should be unique across all origins in an endpoint."""
    http_port: Optional[int] = rest_field(name="httpPort", visibility=["read", "create", "update", "delete", "query"])
    """The value of the HTTP port. Must be between 1 and 65535."""
    https_port: Optional[int] = rest_field(name="httpsPort", visibility=["read", "create", "update", "delete", "query"])
    """The value of the HTTPS port. Must be between 1 and 65535."""
    origin_host_header: Optional[str] = rest_field(
        name="originHostHeader", visibility=["read", "create", "update", "delete", "query"]
    )
    """The host header value sent to the origin with each request. If you leave this blank, the
     request hostname determines this value. Azure Front Door origins, such as Web Apps, Blob
     Storage, and Cloud Services require this host header value to match the origin hostname by
     default. This overrides the host header defined at Endpoint."""
    priority: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """Priority of origin in given origin group for load balancing. Higher priorities will not be used
     for load balancing if any lower priority origin is healthy.Must be between 1 and 5."""
    weight: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """Weight of the origin in given origin group for load balancing. Must be between 1 and 1000."""
    shared_private_link_resource: Optional["_models.SharedPrivateLinkResourceProperties"] = rest_field(
        name="sharedPrivateLinkResource", visibility=["read", "create", "update", "delete", "query"]
    )
    """The properties of the private link resource for private origin."""
    enabled_state: Optional[Union[str, "_models.EnabledState"]] = rest_field(
        name="enabledState", visibility=["read", "create", "update", "delete", "query"]
    )
    """Whether to enable health probes to be made against backends defined under backendPools. Health
     probes can only be disabled if there is a single enabled backend in single enabled backend
     pool. Known values are: \"Enabled\" and \"Disabled\"."""
    enforce_certificate_name_check: Optional[bool] = rest_field(
        name="enforceCertificateNameCheck", visibility=["read", "create", "update", "delete", "query"]
    )
    """Whether to enable certificate name check at origin level."""

    @overload
    def __init__(
        self,
        *,
        azure_origin: Optional["_models.ResourceReference"] = None,
        host_name: Optional[str] = None,
        http_port: Optional[int] = None,
        https_port: Optional[int] = None,
        origin_host_header: Optional[str] = None,
        priority: Optional[int] = None,
        weight: Optional[int] = None,
        shared_private_link_resource: Optional["_models.SharedPrivateLinkResourceProperties"] = None,
        enabled_state: Optional[Union[str, "_models.EnabledState"]] = None,
        enforce_certificate_name_check: 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 AfdPurgeParameters(_Model):
    """Parameters required for content purge.

    :ivar content_paths: The path to the content to be purged. Can describe a file path or a wild
     card directory. Required.
    :vartype content_paths: list[str]
    :ivar domains: List of domains.
    :vartype domains: list[str]
    """

    content_paths: list[str] = rest_field(
        name="contentPaths", visibility=["read", "create", "update", "delete", "query"]
    )
    """The path to the content to be purged. Can describe a file path or a wild card directory.
     Required."""
    domains: Optional[list[str]] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """List of domains."""

    @overload
    def __init__(
        self,
        *,
        content_paths: list[str],
        domains: 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 AfdRouteCacheConfiguration(_Model):
    """Caching settings for a caching-type route. To disable caching, do not provide a
    cacheConfiguration object.

    :ivar query_string_caching_behavior: Defines how Frontdoor caches requests that include query
     strings. You can ignore any query strings when caching, ignore specific query strings, cache
     every request with a unique URL, or cache specific query strings. Known values are:
     "IgnoreQueryString", "UseQueryString", "IgnoreSpecifiedQueryStrings", and
     "IncludeSpecifiedQueryStrings".
    :vartype query_string_caching_behavior: str or
     ~azure.mgmt.cdn.models.AfdQueryStringCachingBehavior
    :ivar query_parameters: query parameters to include or exclude (comma separated).
    :vartype query_parameters: str
    :ivar compression_settings: compression settings.
    :vartype compression_settings: ~azure.mgmt.cdn.models.CompressionSettings
    """

    query_string_caching_behavior: Optional[Union[str, "_models.AfdQueryStringCachingBehavior"]] = rest_field(
        name="queryStringCachingBehavior", visibility=["read", "create", "update", "delete", "query"]
    )
    """Defines how Frontdoor caches requests that include query strings. You can ignore any query
     strings when caching, ignore specific query strings, cache every request with a unique URL, or
     cache specific query strings. Known values are: \"IgnoreQueryString\", \"UseQueryString\",
     \"IgnoreSpecifiedQueryStrings\", and \"IncludeSpecifiedQueryStrings\"."""
    query_parameters: Optional[str] = rest_field(
        name="queryParameters", visibility=["read", "create", "update", "delete", "query"]
    )
    """query parameters to include or exclude (comma separated)."""
    compression_settings: Optional["_models.CompressionSettings"] = rest_field(
        name="compressionSettings", visibility=["read", "create", "update", "delete", "query"]
    )
    """compression settings."""

    @overload
    def __init__(
        self,
        *,
        query_string_caching_behavior: Optional[Union[str, "_models.AfdQueryStringCachingBehavior"]] = None,
        query_parameters: Optional[str] = None,
        compression_settings: Optional["_models.CompressionSettings"] = None,
    ) -> None: ...

    @overload
    def __init__(self, mapping: Mapping[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 AFDStateProperties(_Model):
    """The tracking states for afd resources.

    :ivar provisioning_state: Provisioning status. Known values are: "Succeeded", "Failed",
     "Updating", "Deleting", and "Creating".
    :vartype provisioning_state: str or ~azure.mgmt.cdn.models.AfdProvisioningState
    :ivar deployment_status: Known values are: "NotStarted", "InProgress", "Succeeded", and
     "Failed".
    :vartype deployment_status: str or ~azure.mgmt.cdn.models.DeploymentStatus
    """

    provisioning_state: Optional[Union[str, "_models.AfdProvisioningState"]] = rest_field(
        name="provisioningState", visibility=["read"]
    )
    """Provisioning status. Known values are: \"Succeeded\", \"Failed\", \"Updating\", \"Deleting\",
     and \"Creating\"."""
    deployment_status: Optional[Union[str, "_models.DeploymentStatus"]] = rest_field(
        name="deploymentStatus", visibility=["read"]
    )
    """Known values are: \"NotStarted\", \"InProgress\", \"Succeeded\", and \"Failed\"."""


class SecretParameters(_Model):
    """The json object containing secret parameters.

    You probably want to use the sub-classes and not this class directly. Known sub-classes are:
    AzureFirstPartyManagedCertificateParameters, CustomerCertificateParameters,
    ManagedCertificateParameters, UrlSigningKeyParameters

    :ivar type: The type of the secret resource. Required. Known values are: "UrlSigningKey",
     "CustomerCertificate", "ManagedCertificate", and "AzureFirstPartyManagedCertificate".
    :vartype type: str or ~azure.mgmt.cdn.models.SecretType
    """

    __mapping__: dict[str, _Model] = {}
    type: str = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"])
    """The type of the secret resource. Required. Known values are: \"UrlSigningKey\",
     \"CustomerCertificate\", \"ManagedCertificate\", and \"AzureFirstPartyManagedCertificate\"."""

    @overload
    def __init__(
        self,
        *,
        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 AzureFirstPartyManagedCertificateParameters(
    SecretParameters, discriminator="AzureFirstPartyManagedCertificate"
):  # pylint: disable=name-too-long
    """Azure FirstParty Managed Certificate provided by other first party resource providers to enable
    HTTPS.

    :ivar secret_source: Resource reference to the Azure Key Vault certificate. Expected to be in
     format of
     /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.KeyVault/vaults/{vaultName}/secrets/{certificateName}.
    :vartype secret_source: ~azure.mgmt.cdn.models.ResourceReference
    :ivar subject: Subject name in the certificate.
    :vartype subject: str
    :ivar expiration_date: Certificate expiration date.
    :vartype expiration_date: str
    :ivar certificate_authority: Certificate issuing authority.
    :vartype certificate_authority: str
    :ivar subject_alternative_names: The list of SANs.
    :vartype subject_alternative_names: list[str]
    :ivar thumbprint: Certificate thumbprint.
    :vartype thumbprint: str
    :ivar type: The type of the secret resource. Required. AZURE_FIRST_PARTY_MANAGED_CERTIFICATE.
    :vartype type: str or ~azure.mgmt.cdn.models.AZURE_FIRST_PARTY_MANAGED_CERTIFICATE
    """

    secret_source: Optional["_models.ResourceReference"] = rest_field(name="secretSource", visibility=["read"])
    """Resource reference to the Azure Key Vault certificate. Expected to be in format of
     /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.KeyVault/vaults/{vaultName}/secrets/{certificateName}."""
    subject: Optional[str] = rest_field(visibility=["read"])
    """Subject name in the certificate."""
    expiration_date: Optional[str] = rest_field(name="expirationDate", visibility=["read"])
    """Certificate expiration date."""
    certificate_authority: Optional[str] = rest_field(name="certificateAuthority", visibility=["read"])
    """Certificate issuing authority."""
    subject_alternative_names: Optional[list[str]] = rest_field(
        name="subjectAlternativeNames", visibility=["read", "create", "update", "delete", "query"]
    )
    """The list of SANs."""
    thumbprint: Optional[str] = rest_field(visibility=["read"])
    """Certificate thumbprint."""
    type: Literal[SecretType.AZURE_FIRST_PARTY_MANAGED_CERTIFICATE] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"])  # type: ignore
    """The type of the secret resource. Required. AZURE_FIRST_PARTY_MANAGED_CERTIFICATE."""

    @overload
    def __init__(
        self,
        *,
        subject_alternative_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)
        self.type = SecretType.AZURE_FIRST_PARTY_MANAGED_CERTIFICATE  # type: ignore


class BatchRuleProperties(_Model):
    """The JSON object that contains a rule with its name for batch mode operations.

    :ivar rule_name: Name of the rule. Required.
    :vartype rule_name: str
    :ivar rule_set_name: The name of the rule set containing the rule.
    :vartype rule_set_name: str
    :ivar order: The order in which the rules are applied for the endpoint. Possible values
     {0,1,2,3,………}. A rule with a lesser order will be applied before a rule with a greater order.
     Rule with order 0 is a special rule. It does not require any condition and actions listed in it
     will always be applied.
    :vartype order: int
    :ivar conditions: A list of conditions that must be matched for the actions to be executed.
    :vartype conditions: list[~azure.mgmt.cdn.models.DeliveryRuleCondition]
    :ivar actions: A list of actions that are executed when all the conditions of a rule are
     satisfied.
    :vartype actions: list[~azure.mgmt.cdn.models.DeliveryRuleAction]
    :ivar match_processing_behavior: If this rule is a match should the rules engine continue
     running the remaining rules or stop. If not present, defaults to Continue. Known values are:
     "Continue" and "Stop".
    :vartype match_processing_behavior: str or ~azure.mgmt.cdn.models.MatchProcessingBehavior
    """

    rule_name: str = rest_field(name="ruleName", visibility=["read", "create"])
    """Name of the rule. Required."""
    rule_set_name: Optional[str] = rest_field(name="ruleSetName", visibility=["read"])
    """The name of the rule set containing the rule."""
    order: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """The order in which the rules are applied for the endpoint. Possible values {0,1,2,3,………}. A
     rule with a lesser order will be applied before a rule with a greater order. Rule with order 0
     is a special rule. It does not require any condition and actions listed in it will always be
     applied."""
    conditions: Optional[list["_models.DeliveryRuleCondition"]] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """A list of conditions that must be matched for the actions to be executed."""
    actions: Optional[list["_models.DeliveryRuleAction"]] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """A list of actions that are executed when all the conditions of a rule are satisfied."""
    match_processing_behavior: Optional[Union[str, "_models.MatchProcessingBehavior"]] = rest_field(
        name="matchProcessingBehavior", visibility=["read", "create", "update", "delete", "query"]
    )
    """If this rule is a match should the rules engine continue running the remaining rules or stop.
     If not present, defaults to Continue. Known values are: \"Continue\" and \"Stop\"."""

    @overload
    def __init__(
        self,
        *,
        rule_name: str,
        order: Optional[int] = None,
        conditions: Optional[list["_models.DeliveryRuleCondition"]] = None,
        actions: Optional[list["_models.DeliveryRuleAction"]] = None,
        match_processing_behavior: Optional[Union[str, "_models.MatchProcessingBehavior"]] = None,
    ) -> None: ...

    @overload
    def __init__(self, mapping: Mapping[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 CacheConfiguration(_Model):
    """Caching settings for a caching-type route. To disable caching, do not provide a
    cacheConfiguration object.

    :ivar query_string_caching_behavior: Defines how Frontdoor caches requests that include query
     strings. You can ignore any query strings when caching, ignore specific query strings, cache
     every request with a unique URL, or cache specific query strings. Known values are:
     "IgnoreQueryString", "UseQueryString", "IgnoreSpecifiedQueryStrings", and
     "IncludeSpecifiedQueryStrings".
    :vartype query_string_caching_behavior: str or
     ~azure.mgmt.cdn.models.RuleQueryStringCachingBehavior
    :ivar query_parameters: query parameters to include or exclude (comma separated).
    :vartype query_parameters: str
    :ivar is_compression_enabled: Indicates whether content compression is enabled. If compression
     is enabled, content will be served as compressed if user requests for a compressed version.
     Content won't be compressed on AzureFrontDoor when requested content is smaller than 1 byte or
     larger than 1 MB. Known values are: "Enabled" and "Disabled".
    :vartype is_compression_enabled: str or ~azure.mgmt.cdn.models.RuleIsCompressionEnabled
    :ivar cache_behavior: Caching behavior for the requests. Known values are: "HonorOrigin",
     "OverrideAlways", and "OverrideIfOriginMissing".
    :vartype cache_behavior: str or ~azure.mgmt.cdn.models.RuleCacheBehavior
    :ivar cache_duration: The duration for which the content needs to be cached. Allowed format is
     [d.]hh:mm:ss.
    :vartype cache_duration: str
    """

    query_string_caching_behavior: Optional[Union[str, "_models.RuleQueryStringCachingBehavior"]] = rest_field(
        name="queryStringCachingBehavior", visibility=["read", "create", "update", "delete", "query"]
    )
    """Defines how Frontdoor caches requests that include query strings. You can ignore any query
     strings when caching, ignore specific query strings, cache every request with a unique URL, or
     cache specific query strings. Known values are: \"IgnoreQueryString\", \"UseQueryString\",
     \"IgnoreSpecifiedQueryStrings\", and \"IncludeSpecifiedQueryStrings\"."""
    query_parameters: Optional[str] = rest_field(
        name="queryParameters", visibility=["read", "create", "update", "delete", "query"]
    )
    """query parameters to include or exclude (comma separated)."""
    is_compression_enabled: Optional[Union[str, "_models.RuleIsCompressionEnabled"]] = rest_field(
        name="isCompressionEnabled", visibility=["read", "create", "update", "delete", "query"]
    )
    """Indicates whether content compression is enabled. If compression is enabled, content will be
     served as compressed if user requests for a compressed version. Content won't be compressed on
     AzureFrontDoor when requested content is smaller than 1 byte or larger than 1 MB. Known values
     are: \"Enabled\" and \"Disabled\"."""
    cache_behavior: Optional[Union[str, "_models.RuleCacheBehavior"]] = rest_field(
        name="cacheBehavior", visibility=["read", "create", "update", "delete", "query"]
    )
    """Caching behavior for the requests. Known values are: \"HonorOrigin\", \"OverrideAlways\", and
     \"OverrideIfOriginMissing\"."""
    cache_duration: Optional[str] = rest_field(
        name="cacheDuration", visibility=["read", "create", "update", "delete", "query"]
    )
    """The duration for which the content needs to be cached. Allowed format is [d.]hh:mm:ss."""

    @overload
    def __init__(
        self,
        *,
        query_string_caching_behavior: Optional[Union[str, "_models.RuleQueryStringCachingBehavior"]] = None,
        query_parameters: Optional[str] = None,
        is_compression_enabled: Optional[Union[str, "_models.RuleIsCompressionEnabled"]] = None,
        cache_behavior: Optional[Union[str, "_models.RuleCacheBehavior"]] = None,
        cache_duration: 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 DeliveryRuleActionParameters(_Model):
    """Defines the parameters for delivery rule actions.

    You probably want to use the sub-classes and not this class directly. Known sub-classes are:
    CacheExpirationActionParameters, CacheKeyQueryStringActionParameters, HeaderActionParameters,
    OriginGroupOverrideActionParameters, RouteConfigurationOverrideActionParameters,
    UrlRedirectActionParameters, UrlRewriteActionParameters, UrlSigningActionParameters

    :ivar type_name: Required. Known values are: "DeliveryRuleUrlRedirectActionParameters",
     "DeliveryRuleUrlSigningActionParameters", "DeliveryRuleOriginGroupOverrideActionParameters",
     "DeliveryRuleUrlRewriteActionParameters", "DeliveryRuleHeaderActionParameters",
     "DeliveryRuleCacheExpirationActionParameters",
     "DeliveryRuleCacheKeyQueryStringBehaviorActionParameters", and
     "DeliveryRuleRouteConfigurationOverrideActionParameters".
    :vartype type_name: str or ~azure.mgmt.cdn.models.DeliveryRuleActionParametersType
    """

    __mapping__: dict[str, _Model] = {}
    type_name: str = rest_discriminator(name="typeName", visibility=["read", "create", "update", "delete", "query"])
    """Required. Known values are: \"DeliveryRuleUrlRedirectActionParameters\",
     \"DeliveryRuleUrlSigningActionParameters\",
     \"DeliveryRuleOriginGroupOverrideActionParameters\",
     \"DeliveryRuleUrlRewriteActionParameters\", \"DeliveryRuleHeaderActionParameters\",
     \"DeliveryRuleCacheExpirationActionParameters\",
     \"DeliveryRuleCacheKeyQueryStringBehaviorActionParameters\", and
     \"DeliveryRuleRouteConfigurationOverrideActionParameters\"."""

    @overload
    def __init__(
        self,
        *,
        type_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 CacheExpirationActionParameters(
    DeliveryRuleActionParameters, discriminator="DeliveryRuleCacheExpirationActionParameters"
):
    """Defines the parameters for the cache expiration action.

    :ivar cache_behavior: Caching behavior for the requests. Required. Known values are:
     "BypassCache", "Override", and "SetIfMissing".
    :vartype cache_behavior: str or ~azure.mgmt.cdn.models.CacheBehavior
    :ivar cache_type: The level at which the content needs to be cached. Required. "All"
    :vartype cache_type: str or ~azure.mgmt.cdn.models.CacheType
    :ivar cache_duration: The duration for which the content needs to be cached. Allowed format is
     [d.]hh:mm:ss.
    :vartype cache_duration: str
    :ivar type_name: Required. DELIVERY_RULE_CACHE_EXPIRATION_ACTION_PARAMETERS.
    :vartype type_name: str or
     ~azure.mgmt.cdn.models.DELIVERY_RULE_CACHE_EXPIRATION_ACTION_PARAMETERS
    """

    cache_behavior: Union[str, "_models.CacheBehavior"] = rest_field(
        name="cacheBehavior", visibility=["read", "create", "update", "delete", "query"]
    )
    """Caching behavior for the requests. Required. Known values are: \"BypassCache\", \"Override\",
     and \"SetIfMissing\"."""
    cache_type: Union[str, "_models.CacheType"] = rest_field(
        name="cacheType", visibility=["read", "create", "update", "delete", "query"]
    )
    """The level at which the content needs to be cached. Required. \"All\""""
    cache_duration: Optional[str] = rest_field(
        name="cacheDuration", visibility=["read", "create", "update", "delete", "query"]
    )
    """The duration for which the content needs to be cached. Allowed format is [d.]hh:mm:ss."""
    type_name: Literal[DeliveryRuleActionParametersType.DELIVERY_RULE_CACHE_EXPIRATION_ACTION_PARAMETERS] = rest_discriminator(name="typeName", visibility=["read", "create", "update", "delete", "query"])  # type: ignore
    """Required. DELIVERY_RULE_CACHE_EXPIRATION_ACTION_PARAMETERS."""

    @overload
    def __init__(
        self,
        *,
        cache_behavior: Union[str, "_models.CacheBehavior"],
        cache_type: Union[str, "_models.CacheType"],
        cache_duration: 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.type_name = DeliveryRuleActionParametersType.DELIVERY_RULE_CACHE_EXPIRATION_ACTION_PARAMETERS  # type: ignore


class CacheKeyQueryStringActionParameters(
    DeliveryRuleActionParameters, discriminator="DeliveryRuleCacheKeyQueryStringBehaviorActionParameters"
):
    """Defines the parameters for the cache-key query string action.

    :ivar query_string_behavior: Caching behavior for the requests. Required. Known values are:
     "Include", "IncludeAll", "Exclude", and "ExcludeAll".
    :vartype query_string_behavior: str or ~azure.mgmt.cdn.models.QueryStringBehavior
    :ivar query_parameters: query parameters to include or exclude (comma separated).
    :vartype query_parameters: str
    :ivar type_name: Required. DELIVERY_RULE_CACHE_KEY_QUERY_STRING_BEHAVIOR_ACTION_PARAMETERS.
    :vartype type_name: str or
     ~azure.mgmt.cdn.models.DELIVERY_RULE_CACHE_KEY_QUERY_STRING_BEHAVIOR_ACTION_PARAMETERS
    """

    query_string_behavior: Union[str, "_models.QueryStringBehavior"] = rest_field(
        name="queryStringBehavior", visibility=["read", "create", "update", "delete", "query"]
    )
    """Caching behavior for the requests. Required. Known values are: \"Include\", \"IncludeAll\",
     \"Exclude\", and \"ExcludeAll\"."""
    query_parameters: Optional[str] = rest_field(
        name="queryParameters", visibility=["read", "create", "update", "delete", "query"]
    )
    """query parameters to include or exclude (comma separated)."""
    type_name: Literal[DeliveryRuleActionParametersType.DELIVERY_RULE_CACHE_KEY_QUERY_STRING_BEHAVIOR_ACTION_PARAMETERS] = rest_discriminator(name="typeName", visibility=["read", "create", "update", "delete", "query"])  # type: ignore
    """Required. DELIVERY_RULE_CACHE_KEY_QUERY_STRING_BEHAVIOR_ACTION_PARAMETERS."""

    @overload
    def __init__(
        self,
        *,
        query_string_behavior: Union[str, "_models.QueryStringBehavior"],
        query_parameters: 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.type_name = DeliveryRuleActionParametersType.DELIVERY_RULE_CACHE_KEY_QUERY_STRING_BEHAVIOR_ACTION_PARAMETERS  # type: ignore


class CanMigrateParameters(_Model):
    """Request body for CanMigrate operation.

    :ivar classic_resource_reference: Resource reference of the classic cdn profile or classic
     frontdoor that need to be migrated. Required.
    :vartype classic_resource_reference: ~azure.mgmt.cdn.models.ResourceReference
    """

    classic_resource_reference: "_models.ResourceReference" = rest_field(
        name="classicResourceReference", visibility=["read", "create", "update", "delete", "query"]
    )
    """Resource reference of the classic cdn profile or classic frontdoor that need to be migrated.
     Required."""

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

    @overload
    def __init__(self, mapping: Mapping[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 CanMigrateProperties(_Model):
    """CanMigrateProperties.

    :ivar can_migrate: Flag that says if the profile can be migrated.
    :vartype can_migrate: bool
    :ivar default_sku: Recommended sku for the migration. Known values are:
     "Standard_AzureFrontDoor" and "Premium_AzureFrontDoor".
    :vartype default_sku: str or ~azure.mgmt.cdn.models.CanMigrateDefaultSku
    :ivar errors:
    :vartype errors: list[~azure.mgmt.cdn.models.MigrationErrorType]
    """

    can_migrate: Optional[bool] = rest_field(name="canMigrate", visibility=["read"])
    """Flag that says if the profile can be migrated."""
    default_sku: Optional[Union[str, "_models.CanMigrateDefaultSku"]] = rest_field(
        name="defaultSku", visibility=["read"]
    )
    """Recommended sku for the migration. Known values are: \"Standard_AzureFrontDoor\" and
     \"Premium_AzureFrontDoor\"."""
    errors: Optional[list["_models.MigrationErrorType"]] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )

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

    @overload
    def __init__(self, mapping: Mapping[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 CanMigrateResult(_Model):
    """Result for canMigrate operation.

    :ivar id: Resource ID.
    :vartype id: str
    :ivar type: Resource type.
    :vartype type: str
    :ivar properties:
    :vartype properties: ~azure.mgmt.cdn.models.CanMigrateProperties
    """

    id: Optional[str] = rest_field(visibility=["read"])
    """Resource ID."""
    type: Optional[str] = rest_field(visibility=["read"])
    """Resource type."""
    properties: Optional["_models.CanMigrateProperties"] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )

    __flattened_items = ["can_migrate", "default_sku", "errors"]

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

    @overload
    def __init__(self, mapping: Mapping[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 CertificateSourceParameters(_Model):
    """Defines the parameters for certificate source.

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

    :ivar type_name: Required. Known values are: "CdnCertificateSourceParameters" and
     "KeyVaultCertificateSourceParameters".
    :vartype type_name: str or ~azure.mgmt.cdn.models.CertificateSourceParametersType
    """

    __mapping__: dict[str, _Model] = {}
    type_name: str = rest_discriminator(name="typeName", visibility=["read", "create", "update", "delete", "query"])
    """Required. Known values are: \"CdnCertificateSourceParameters\" and
     \"KeyVaultCertificateSourceParameters\"."""

    @overload
    def __init__(
        self,
        *,
        type_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 CdnCertificateSourceParameters(CertificateSourceParameters, discriminator="CdnCertificateSourceParameters"):
    """Defines the parameters for using CDN managed certificate for securing custom domain.

    :ivar certificate_type: Type of certificate used. Required. Known values are: "Shared" and
     "Dedicated".
    :vartype certificate_type: str or ~azure.mgmt.cdn.models.CertificateType
    :ivar type_name: Required. CDN_CERTIFICATE_SOURCE_PARAMETERS.
    :vartype type_name: str or ~azure.mgmt.cdn.models.CDN_CERTIFICATE_SOURCE_PARAMETERS
    """

    certificate_type: Union[str, "_models.CertificateType"] = rest_field(
        name="certificateType", visibility=["read", "create", "update", "delete", "query"]
    )
    """Type of certificate used. Required. Known values are: \"Shared\" and \"Dedicated\"."""
    type_name: Literal[CertificateSourceParametersType.CDN_CERTIFICATE_SOURCE_PARAMETERS] = rest_discriminator(name="typeName", visibility=["read", "create", "update", "delete", "query"])  # type: ignore
    """Required. CDN_CERTIFICATE_SOURCE_PARAMETERS."""

    @overload
    def __init__(
        self,
        *,
        certificate_type: Union[str, "_models.CertificateType"],
    ) -> None: ...

    @overload
    def __init__(self, mapping: Mapping[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.type_name = CertificateSourceParametersType.CDN_CERTIFICATE_SOURCE_PARAMETERS  # type: ignore


class CdnEndpoint(_Model):
    """Defines the ARM Resource ID for the linked endpoints.

    :ivar id: ARM Resource ID string.
    :vartype id: str
    """

    id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """ARM Resource ID string."""

    @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 CustomDomainHttpsParameters(_Model):
    """The JSON object that contains the properties to secure a custom domain.

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

    :ivar certificate_source: Defines the source of the SSL certificate. Required. Known values
     are: "AzureKeyVault" and "Cdn".
    :vartype certificate_source: str or ~azure.mgmt.cdn.models.CertificateSource
    :ivar protocol_type: Defines the TLS extension protocol that is used for secure delivery.
     Required. Known values are: "ServerNameIndication" and "IPBased".
    :vartype protocol_type: str or ~azure.mgmt.cdn.models.ProtocolType
    :ivar minimum_tls_version: TLS protocol version that will be used for Https. Known values are:
     "None", "TLS10", and "TLS12".
    :vartype minimum_tls_version: str or ~azure.mgmt.cdn.models.MinimumTlsVersion
    """

    __mapping__: dict[str, _Model] = {}
    certificate_source: str = rest_discriminator(
        name="certificateSource", visibility=["read", "create", "update", "delete", "query"]
    )
    """Defines the source of the SSL certificate. Required. Known values are: \"AzureKeyVault\" and
     \"Cdn\"."""
    protocol_type: Union[str, "_models.ProtocolType"] = rest_field(
        name="protocolType", visibility=["read", "create", "update", "delete", "query"]
    )
    """Defines the TLS extension protocol that is used for secure delivery. Required. Known values
     are: \"ServerNameIndication\" and \"IPBased\"."""
    minimum_tls_version: Optional[Union[str, "_models.MinimumTlsVersion"]] = rest_field(
        name="minimumTlsVersion", visibility=["read", "create", "update", "delete", "query"]
    )
    """TLS protocol version that will be used for Https. Known values are: \"None\", \"TLS10\", and
     \"TLS12\"."""

    @overload
    def __init__(
        self,
        *,
        certificate_source: str,
        protocol_type: Union[str, "_models.ProtocolType"],
        minimum_tls_version: Optional[Union[str, "_models.MinimumTlsVersion"]] = None,
    ) -> None: ...

    @overload
    def __init__(self, mapping: Mapping[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 CdnManagedHttpsParameters(CustomDomainHttpsParameters, discriminator="Cdn"):
    """Defines the certificate source parameters using CDN managed certificate for enabling SSL.

    :ivar protocol_type: Defines the TLS extension protocol that is used for secure delivery.
     Required. Known values are: "ServerNameIndication" and "IPBased".
    :vartype protocol_type: str or ~azure.mgmt.cdn.models.ProtocolType
    :ivar minimum_tls_version: TLS protocol version that will be used for Https. Known values are:
     "None", "TLS10", and "TLS12".
    :vartype minimum_tls_version: str or ~azure.mgmt.cdn.models.MinimumTlsVersion
    :ivar certificate_source_parameters: Defines the certificate source parameters using CDN
     managed certificate for enabling SSL. Required.
    :vartype certificate_source_parameters: ~azure.mgmt.cdn.models.CdnCertificateSourceParameters
    :ivar certificate_source: Defines the source of the SSL certificate. Required. CDN.
    :vartype certificate_source: str or ~azure.mgmt.cdn.models.CDN
    """

    certificate_source_parameters: "_models.CdnCertificateSourceParameters" = rest_field(
        name="certificateSourceParameters", visibility=["read", "create", "update", "delete", "query"]
    )
    """Defines the certificate source parameters using CDN managed certificate for enabling SSL.
     Required."""
    certificate_source: Literal[CertificateSource.CDN] = rest_discriminator(name="certificateSource", visibility=["read", "create", "update", "delete", "query"])  # type: ignore
    """Defines the source of the SSL certificate. Required. CDN."""

    @overload
    def __init__(
        self,
        *,
        protocol_type: Union[str, "_models.ProtocolType"],
        certificate_source_parameters: "_models.CdnCertificateSourceParameters",
        minimum_tls_version: Optional[Union[str, "_models.MinimumTlsVersion"]] = None,
    ) -> None: ...

    @overload
    def __init__(self, mapping: Mapping[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.certificate_source = CertificateSource.CDN  # type: ignore


class CdnMigrationToAfdParameters(_Model):
    """Request body for Migrate operation.

    :ivar sku: Sku for the migration. Required.
    :vartype sku: ~azure.mgmt.cdn.models.Sku
    :ivar migration_endpoint_mappings: A name map between classic CDN endpoints and AFD
     Premium/Standard endpoints.
    :vartype migration_endpoint_mappings: list[~azure.mgmt.cdn.models.MigrationEndpointMapping]
    """

    sku: "_models.Sku" = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """Sku for the migration. Required."""
    migration_endpoint_mappings: Optional[list["_models.MigrationEndpointMapping"]] = rest_field(
        name="migrationEndpointMappings", visibility=["read", "create", "update", "delete", "query"]
    )
    """A name map between classic CDN endpoints and AFD Premium/Standard endpoints."""

    @overload
    def __init__(
        self,
        *,
        sku: "_models.Sku",
        migration_endpoint_mappings: Optional[list["_models.MigrationEndpointMapping"]] = None,
    ) -> None: ...

    @overload
    def __init__(self, mapping: Mapping[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 CdnWebApplicationFirewallPolicy(TrackedResource):
    """Defines web application firewall policy for Azure CDN.

    :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.cdn.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 web application firewall policy.
    :vartype properties: ~azure.mgmt.cdn.models.CdnWebApplicationFirewallPolicyProperties
    :ivar etag: Gets a unique read-only string that changes whenever the resource is updated.
    :vartype etag: str
    :ivar sku: The pricing tier (defines a CDN provider, feature list and rate) of the
     CdnWebApplicationFirewallPolicy. Required.
    :vartype sku: ~azure.mgmt.cdn.models.Sku
    """

    properties: Optional["_models.CdnWebApplicationFirewallPolicyProperties"] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """Properties of the web application firewall policy."""
    etag: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """Gets a unique read-only string that changes whenever the resource is updated."""
    sku: "_models.Sku" = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """The pricing tier (defines a CDN provider, feature list and rate) of the
     CdnWebApplicationFirewallPolicy. Required."""

    __flattened_items = [
        "policy_settings",
        "rate_limit_rules",
        "custom_rules",
        "managed_rules",
        "endpoint_links",
        "extended_properties",
        "provisioning_state",
        "resource_state",
    ]

    @overload
    def __init__(
        self,
        *,
        location: str,
        sku: "_models.Sku",
        tags: Optional[dict[str, str]] = None,
        properties: Optional["_models.CdnWebApplicationFirewallPolicyProperties"] = None,
        etag: 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 CdnWebApplicationFirewallPolicyPatchParameters(_Model):  # pylint: disable=name-too-long
    """Properties required to update a CdnWebApplicationFirewallPolicy.

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

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

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

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

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


class CdnWebApplicationFirewallPolicyProperties(_Model):  # pylint: disable=name-too-long
    """Defines CDN web application firewall policy properties.

    :ivar policy_settings: Describes  policySettings for policy.
    :vartype policy_settings: ~azure.mgmt.cdn.models.PolicySettings
    :ivar rate_limit_rules: Describes rate limit rules inside the policy.
    :vartype rate_limit_rules: ~azure.mgmt.cdn.models.RateLimitRuleList
    :ivar custom_rules: Describes custom rules inside the policy.
    :vartype custom_rules: ~azure.mgmt.cdn.models.CustomRuleList
    :ivar managed_rules: Describes managed rules inside the policy.
    :vartype managed_rules: ~azure.mgmt.cdn.models.ManagedRuleSetList
    :ivar endpoint_links: Describes Azure CDN endpoints associated with this Web Application
     Firewall policy.
    :vartype endpoint_links: list[~azure.mgmt.cdn.models.CdnEndpoint]
    :ivar extended_properties: Key-Value pair representing additional properties for Web
     Application Firewall policy.
    :vartype extended_properties: dict[str, str]
    :ivar provisioning_state: Provisioning state of the WebApplicationFirewallPolicy. Known values
     are: "Creating", "Succeeded", and "Failed".
    :vartype provisioning_state: str or ~azure.mgmt.cdn.models.ProvisioningState
    :ivar resource_state: Resource status of the policy. Known values are: "Creating", "Enabling",
     "Enabled", "Disabling", "Disabled", and "Deleting".
    :vartype resource_state: str or ~azure.mgmt.cdn.models.PolicyResourceState
    """

    policy_settings: Optional["_models.PolicySettings"] = rest_field(
        name="policySettings", visibility=["read", "create", "update", "delete", "query"]
    )
    """Describes  policySettings for policy."""
    rate_limit_rules: Optional["_models.RateLimitRuleList"] = rest_field(
        name="rateLimitRules", visibility=["read", "create", "update", "delete", "query"]
    )
    """Describes rate limit rules inside the policy."""
    custom_rules: Optional["_models.CustomRuleList"] = rest_field(
        name="customRules", visibility=["read", "create", "update", "delete", "query"]
    )
    """Describes custom rules inside the policy."""
    managed_rules: Optional["_models.ManagedRuleSetList"] = rest_field(
        name="managedRules", visibility=["read", "create", "update", "delete", "query"]
    )
    """Describes managed rules inside the policy."""
    endpoint_links: Optional[list["_models.CdnEndpoint"]] = rest_field(name="endpointLinks", visibility=["read"])
    """Describes Azure CDN endpoints associated with this Web Application Firewall policy."""
    extended_properties: Optional[dict[str, str]] = rest_field(
        name="extendedProperties", visibility=["read", "create", "update", "delete", "query"]
    )
    """Key-Value pair representing additional properties for Web Application Firewall policy."""
    provisioning_state: Optional[Union[str, "_models.ProvisioningState"]] = rest_field(
        name="provisioningState", visibility=["read"]
    )
    """Provisioning state of the WebApplicationFirewallPolicy. Known values are: \"Creating\",
     \"Succeeded\", and \"Failed\"."""
    resource_state: Optional[Union[str, "_models.PolicyResourceState"]] = rest_field(
        name="resourceState", visibility=["read"]
    )
    """Resource status of the policy. Known values are: \"Creating\", \"Enabling\", \"Enabled\",
     \"Disabling\", \"Disabled\", and \"Deleting\"."""

    @overload
    def __init__(
        self,
        *,
        policy_settings: Optional["_models.PolicySettings"] = None,
        rate_limit_rules: Optional["_models.RateLimitRuleList"] = None,
        custom_rules: Optional["_models.CustomRuleList"] = None,
        managed_rules: Optional["_models.ManagedRuleSetList"] = None,
        extended_properties: Optional[dict[str, str]] = None,
    ) -> None: ...

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

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


class CheckEndpointNameAvailabilityInput(_Model):
    """Input of CheckNameAvailability API.

    :ivar name: The resource name to validate. Required.
    :vartype name: str
    :ivar type: The type of the resource whose name is to be validated. Required. Known values are:
     "Microsoft.Cdn/Profiles/Endpoints" and "Microsoft.Cdn/Profiles/AfdEndpoints".
    :vartype type: str or ~azure.mgmt.cdn.models.ResourceType
    :ivar auto_generated_domain_name_label_scope: Indicates the endpoint name reuse scope. The
     default value is TenantReuse. Known values are: "TenantReuse", "SubscriptionReuse",
     "ResourceGroupReuse", and "NoReuse".
    :vartype auto_generated_domain_name_label_scope: str or
     ~azure.mgmt.cdn.models.AutoGeneratedDomainNameLabelScope
    """

    name: str = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """The resource name to validate. Required."""
    type: Union[str, "_models.ResourceType"] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """The type of the resource whose name is to be validated. Required. Known values are:
     \"Microsoft.Cdn/Profiles/Endpoints\" and \"Microsoft.Cdn/Profiles/AfdEndpoints\"."""
    auto_generated_domain_name_label_scope: Optional[Union[str, "_models.AutoGeneratedDomainNameLabelScope"]] = (
        rest_field(name="autoGeneratedDomainNameLabelScope", visibility=["read", "create", "update", "delete", "query"])
    )
    """Indicates the endpoint name reuse scope. The default value is TenantReuse. Known values are:
     \"TenantReuse\", \"SubscriptionReuse\", \"ResourceGroupReuse\", and \"NoReuse\"."""

    @overload
    def __init__(
        self,
        *,
        name: str,
        type: Union[str, "_models.ResourceType"],
        auto_generated_domain_name_label_scope: Optional[
            Union[str, "_models.AutoGeneratedDomainNameLabelScope"]
        ] = None,
    ) -> None: ...

    @overload
    def __init__(self, mapping: Mapping[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 CheckEndpointNameAvailabilityOutput(_Model):
    """Output of check name availability API.

    :ivar name_available: Indicates whether the name is available.
    :vartype name_available: bool
    :ivar available_hostname: Returns the available hostname generated based on the
     AutoGeneratedDomainNameLabelScope when the name is available, otherwise it returns empty
     string.
    :vartype available_hostname: str
    :ivar reason: The reason why the name is not available.
    :vartype reason: str
    :ivar message: The detailed error message describing why the name is not available.
    :vartype message: str
    """

    name_available: Optional[bool] = rest_field(name="nameAvailable", visibility=["read"])
    """Indicates whether the name is available."""
    available_hostname: Optional[str] = rest_field(name="availableHostname", visibility=["read"])
    """Returns the available hostname generated based on the AutoGeneratedDomainNameLabelScope when
     the name is available, otherwise it returns empty string."""
    reason: Optional[str] = rest_field(visibility=["read"])
    """The reason why the name is not available."""
    message: Optional[str] = rest_field(visibility=["read"])
    """The detailed error message describing why the name is not available."""


class CheckHostNameAvailabilityInput(_Model):
    """Input of CheckHostNameAvailability API.

    :ivar host_name: The host name to validate. Required.
    :vartype host_name: str
    """

    host_name: str = rest_field(name="hostName", visibility=["read", "create", "update", "delete", "query"])
    """The host name to validate. Required."""

    @overload
    def __init__(
        self,
        *,
        host_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 CheckNameAvailabilityInput(_Model):
    """Input of CheckNameAvailability API.

    :ivar name: The resource name to validate. Required.
    :vartype name: str
    :ivar type: The type of the resource whose name is to be validated. Required. Known values are:
     "Microsoft.Cdn/Profiles/Endpoints" and "Microsoft.Cdn/Profiles/AfdEndpoints".
    :vartype type: str or ~azure.mgmt.cdn.models.ResourceType
    """

    name: str = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """The resource name to validate. Required."""
    type: Union[str, "_models.ResourceType"] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """The type of the resource whose name is to be validated. Required. Known values are:
     \"Microsoft.Cdn/Profiles/Endpoints\" and \"Microsoft.Cdn/Profiles/AfdEndpoints\"."""

    @overload
    def __init__(
        self,
        *,
        name: str,
        type: Union[str, "_models.ResourceType"],
    ) -> None: ...

    @overload
    def __init__(self, mapping: Mapping[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 CheckNameAvailabilityOutput(_Model):
    """Output of check name availability API.

    :ivar name_available: Indicates whether the name is available.
    :vartype name_available: bool
    :ivar reason: The reason why the name is not available.
    :vartype reason: str
    :ivar message: The detailed error message describing why the name is not available.
    :vartype message: str
    """

    name_available: Optional[bool] = rest_field(name="nameAvailable", visibility=["read"])
    """Indicates whether the name is available."""
    reason: Optional[str] = rest_field(visibility=["read"])
    """The reason why the name is not available."""
    message: Optional[str] = rest_field(visibility=["read"])
    """The detailed error message describing why the name is not available."""


class CidrIpAddress(_Model):
    """CIDR Ip address.

    :ivar base_ip_address: Ip address itself.
    :vartype base_ip_address: str
    :ivar prefix_length: The length of the prefix of the ip address.
    :vartype prefix_length: int
    """

    base_ip_address: Optional[str] = rest_field(
        name="baseIpAddress", visibility=["read", "create", "update", "delete", "query"]
    )
    """Ip address itself."""
    prefix_length: Optional[int] = rest_field(
        name="prefixLength", visibility=["read", "create", "update", "delete", "query"]
    )
    """The length of the prefix of the ip address."""

    @overload
    def __init__(
        self,
        *,
        base_ip_address: Optional[str] = None,
        prefix_length: 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 DeliveryRuleConditionParameters(_Model):
    """Defines the parameters for delivery rule match conditions.

    You probably want to use the sub-classes and not this class directly. Known sub-classes are:
    ClientPortMatchConditionParameters, CookiesMatchConditionParameters,
    HostNameMatchConditionParameters, HttpVersionMatchConditionParameters,
    IsDeviceMatchConditionParameters, PostArgsMatchConditionParameters,
    QueryStringMatchConditionParameters, RemoteAddressMatchConditionParameters,
    RequestBodyMatchConditionParameters, RequestHeaderMatchConditionParameters,
    RequestMethodMatchConditionParameters, RequestSchemeMatchConditionParameters,
    RequestUriMatchConditionParameters, ServerPortMatchConditionParameters,
    SocketAddrMatchConditionParameters, SslProtocolMatchConditionParameters,
    UrlFileExtensionMatchConditionParameters, UrlFileNameMatchConditionParameters,
    UrlPathMatchConditionParameters

    :ivar type_name: Required. Known values are: "DeliveryRuleRemoteAddressConditionParameters",
     "DeliveryRuleRequestMethodConditionParameters", "DeliveryRuleQueryStringConditionParameters",
     "DeliveryRulePostArgsConditionParameters", "DeliveryRuleRequestUriConditionParameters",
     "DeliveryRuleRequestHeaderConditionParameters", "DeliveryRuleRequestBodyConditionParameters",
     "DeliveryRuleRequestSchemeConditionParameters", "DeliveryRuleUrlPathMatchConditionParameters",
     "DeliveryRuleUrlFileExtensionMatchConditionParameters",
     "DeliveryRuleUrlFilenameConditionParameters", "DeliveryRuleHttpVersionConditionParameters",
     "DeliveryRuleCookiesConditionParameters", "DeliveryRuleIsDeviceConditionParameters",
     "DeliveryRuleSocketAddrConditionParameters", "DeliveryRuleClientPortConditionParameters",
     "DeliveryRuleServerPortConditionParameters", "DeliveryRuleHostNameConditionParameters", and
     "DeliveryRuleSslProtocolConditionParameters".
    :vartype type_name: str or ~azure.mgmt.cdn.models.DeliveryRuleConditionParametersType
    """

    __mapping__: dict[str, _Model] = {}
    type_name: str = rest_discriminator(name="typeName", visibility=["read", "create", "update", "delete", "query"])
    """Required. Known values are: \"DeliveryRuleRemoteAddressConditionParameters\",
     \"DeliveryRuleRequestMethodConditionParameters\",
     \"DeliveryRuleQueryStringConditionParameters\", \"DeliveryRulePostArgsConditionParameters\",
     \"DeliveryRuleRequestUriConditionParameters\",
     \"DeliveryRuleRequestHeaderConditionParameters\",
     \"DeliveryRuleRequestBodyConditionParameters\",
     \"DeliveryRuleRequestSchemeConditionParameters\",
     \"DeliveryRuleUrlPathMatchConditionParameters\",
     \"DeliveryRuleUrlFileExtensionMatchConditionParameters\",
     \"DeliveryRuleUrlFilenameConditionParameters\", \"DeliveryRuleHttpVersionConditionParameters\",
     \"DeliveryRuleCookiesConditionParameters\", \"DeliveryRuleIsDeviceConditionParameters\",
     \"DeliveryRuleSocketAddrConditionParameters\", \"DeliveryRuleClientPortConditionParameters\",
     \"DeliveryRuleServerPortConditionParameters\", \"DeliveryRuleHostNameConditionParameters\", and
     \"DeliveryRuleSslProtocolConditionParameters\"."""

    @overload
    def __init__(
        self,
        *,
        type_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 ClientPortMatchConditionParameters(
    DeliveryRuleConditionParameters, discriminator="DeliveryRuleClientPortConditionParameters"
):
    """Defines the parameters for ClientPort match conditions.

    :ivar operator: Describes operator to be matched. Required. Known values are: "Any", "Equal",
     "Contains", "BeginsWith", "EndsWith", "LessThan", "LessThanOrEqual", "GreaterThan",
     "GreaterThanOrEqual", and "RegEx".
    :vartype operator: str or ~azure.mgmt.cdn.models.ClientPortOperator
    :ivar negate_condition: Describes if this is negate condition or not.
    :vartype negate_condition: bool
    :ivar match_values: The match value for the condition of the delivery rule.
    :vartype match_values: list[str]
    :ivar transforms: List of transforms.
    :vartype transforms: list[str or ~azure.mgmt.cdn.models.Transform]
    :ivar type_name: Required. DELIVERY_RULE_CLIENT_PORT_CONDITION_PARAMETERS.
    :vartype type_name: str or
     ~azure.mgmt.cdn.models.DELIVERY_RULE_CLIENT_PORT_CONDITION_PARAMETERS
    """

    operator: Union[str, "_models.ClientPortOperator"] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """Describes operator to be matched. Required. Known values are: \"Any\", \"Equal\", \"Contains\",
     \"BeginsWith\", \"EndsWith\", \"LessThan\", \"LessThanOrEqual\", \"GreaterThan\",
     \"GreaterThanOrEqual\", and \"RegEx\"."""
    negate_condition: Optional[bool] = rest_field(
        name="negateCondition", visibility=["read", "create", "update", "delete", "query"]
    )
    """Describes if this is negate condition or not."""
    match_values: Optional[list[str]] = rest_field(
        name="matchValues", visibility=["read", "create", "update", "delete", "query"]
    )
    """The match value for the condition of the delivery rule."""
    transforms: Optional[list[Union[str, "_models.Transform"]]] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """List of transforms."""
    type_name: Literal[DeliveryRuleConditionParametersType.DELIVERY_RULE_CLIENT_PORT_CONDITION_PARAMETERS] = rest_discriminator(name="typeName", visibility=["read", "create", "update", "delete", "query"])  # type: ignore
    """Required. DELIVERY_RULE_CLIENT_PORT_CONDITION_PARAMETERS."""

    @overload
    def __init__(
        self,
        *,
        operator: Union[str, "_models.ClientPortOperator"],
        negate_condition: Optional[bool] = None,
        match_values: Optional[list[str]] = None,
        transforms: Optional[list[Union[str, "_models.Transform"]]] = None,
    ) -> None: ...

    @overload
    def __init__(self, mapping: Mapping[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.type_name = DeliveryRuleConditionParametersType.DELIVERY_RULE_CLIENT_PORT_CONDITION_PARAMETERS  # type: ignore


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

    :ivar date_time:
    :vartype date_time: ~datetime.datetime
    :ivar value:
    :vartype value: float
    """

    date_time: Optional[datetime.datetime] = rest_field(
        name="dateTime", visibility=["read", "create", "update", "delete", "query"], format="rfc3339"
    )
    value: Optional[float] = rest_field(visibility=["read", "create", "update", "delete", "query"])

    @overload
    def __init__(
        self,
        *,
        date_time: Optional[datetime.datetime] = 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)


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

    :ivar date_time:
    :vartype date_time: ~datetime.datetime
    :ivar value:
    :vartype value: float
    """

    date_time: Optional[datetime.datetime] = rest_field(
        name="dateTime", visibility=["read", "create", "update", "delete", "query"], format="rfc3339"
    )
    value: Optional[float] = rest_field(visibility=["read", "create", "update", "delete", "query"])

    @overload
    def __init__(
        self,
        *,
        date_time: Optional[datetime.datetime] = 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)


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

    :ivar metric:
    :vartype metric: str
    :ivar value:
    :vartype value: int
    :ivar percentage:
    :vartype percentage: float
    """

    metric: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    value: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    percentage: Optional[float] = rest_field(visibility=["read", "create", "update", "delete", "query"])

    @overload
    def __init__(
        self,
        *,
        metric: Optional[str] = None,
        value: Optional[int] = None,
        percentage: 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)


class CompressionSettings(_Model):
    """settings for compression.

    :ivar content_types_to_compress: List of content types on which compression applies. The value
     should be a valid MIME type.
    :vartype content_types_to_compress: list[str]
    :ivar is_compression_enabled: Indicates whether content compression is enabled on
     AzureFrontDoor. Default value is false. If compression is enabled, content will be served as
     compressed if user requests for a compressed version. Content won't be compressed on
     AzureFrontDoor when requested content is smaller than 1 byte or larger than 1 MB.
    :vartype is_compression_enabled: bool
    """

    content_types_to_compress: Optional[list[str]] = rest_field(
        name="contentTypesToCompress", visibility=["read", "create", "update", "delete", "query"]
    )
    """List of content types on which compression applies. The value should be a valid MIME type."""
    is_compression_enabled: Optional[bool] = rest_field(
        name="isCompressionEnabled", visibility=["read", "create", "update", "delete", "query"]
    )
    """Indicates whether content compression is enabled on AzureFrontDoor. Default value is false. If
     compression is enabled, content will be served as compressed if user requests for a compressed
     version. Content won't be compressed on AzureFrontDoor when requested content is smaller than 1
     byte or larger than 1 MB."""

    @overload
    def __init__(
        self,
        *,
        content_types_to_compress: Optional[list[str]] = None,
        is_compression_enabled: 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 ContinentsResponse(_Model):
    """Continents Response.

    :ivar continents:
    :vartype continents: list[~azure.mgmt.cdn.models.ContinentsResponseContinentsItem]
    :ivar country_or_regions:
    :vartype country_or_regions:
     list[~azure.mgmt.cdn.models.ContinentsResponseCountryOrRegionsItem]
    """

    continents: Optional[list["_models.ContinentsResponseContinentsItem"]] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    country_or_regions: Optional[list["_models.ContinentsResponseCountryOrRegionsItem"]] = rest_field(
        name="countryOrRegions", visibility=["read", "create", "update", "delete", "query"]
    )

    @overload
    def __init__(
        self,
        *,
        continents: Optional[list["_models.ContinentsResponseContinentsItem"]] = None,
        country_or_regions: Optional[list["_models.ContinentsResponseCountryOrRegionsItem"]] = None,
    ) -> None: ...

    @overload
    def __init__(self, mapping: Mapping[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 ContinentsResponseContinentsItem(_Model):
    """ContinentsResponseContinentsItem.

    :ivar id:
    :vartype id: str
    """

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

    @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 ContinentsResponseCountryOrRegionsItem(_Model):
    """ContinentsResponseCountryOrRegionsItem.

    :ivar id:
    :vartype id: str
    :ivar continent_id:
    :vartype continent_id: str
    """

    id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    continent_id: Optional[str] = rest_field(
        name="continentId", visibility=["read", "create", "update", "delete", "query"]
    )

    @overload
    def __init__(
        self,
        *,
        id: Optional[str] = None,  # pylint: disable=redefined-builtin
        continent_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 CookiesMatchConditionParameters(
    DeliveryRuleConditionParameters, discriminator="DeliveryRuleCookiesConditionParameters"
):
    """Defines the parameters for Cookies match conditions.

    :ivar selector: Name of Cookies to be matched.
    :vartype selector: str
    :ivar operator: Describes operator to be matched. Required. Known values are: "Any", "Equal",
     "Contains", "BeginsWith", "EndsWith", "LessThan", "LessThanOrEqual", "GreaterThan",
     "GreaterThanOrEqual", and "RegEx".
    :vartype operator: str or ~azure.mgmt.cdn.models.CookiesOperator
    :ivar negate_condition: Describes if this is negate condition or not.
    :vartype negate_condition: bool
    :ivar match_values: The match value for the condition of the delivery rule.
    :vartype match_values: list[str]
    :ivar transforms: List of transforms.
    :vartype transforms: list[str or ~azure.mgmt.cdn.models.Transform]
    :ivar type_name: Required. DELIVERY_RULE_COOKIES_CONDITION_PARAMETERS.
    :vartype type_name: str or ~azure.mgmt.cdn.models.DELIVERY_RULE_COOKIES_CONDITION_PARAMETERS
    """

    selector: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """Name of Cookies to be matched."""
    operator: Union[str, "_models.CookiesOperator"] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """Describes operator to be matched. Required. Known values are: \"Any\", \"Equal\", \"Contains\",
     \"BeginsWith\", \"EndsWith\", \"LessThan\", \"LessThanOrEqual\", \"GreaterThan\",
     \"GreaterThanOrEqual\", and \"RegEx\"."""
    negate_condition: Optional[bool] = rest_field(
        name="negateCondition", visibility=["read", "create", "update", "delete", "query"]
    )
    """Describes if this is negate condition or not."""
    match_values: Optional[list[str]] = rest_field(
        name="matchValues", visibility=["read", "create", "update", "delete", "query"]
    )
    """The match value for the condition of the delivery rule."""
    transforms: Optional[list[Union[str, "_models.Transform"]]] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """List of transforms."""
    type_name: Literal[DeliveryRuleConditionParametersType.DELIVERY_RULE_COOKIES_CONDITION_PARAMETERS] = rest_discriminator(name="typeName", visibility=["read", "create", "update", "delete", "query"])  # type: ignore
    """Required. DELIVERY_RULE_COOKIES_CONDITION_PARAMETERS."""

    @overload
    def __init__(
        self,
        *,
        operator: Union[str, "_models.CookiesOperator"],
        selector: Optional[str] = None,
        negate_condition: Optional[bool] = None,
        match_values: Optional[list[str]] = None,
        transforms: Optional[list[Union[str, "_models.Transform"]]] = None,
    ) -> None: ...

    @overload
    def __init__(self, mapping: Mapping[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.type_name = DeliveryRuleConditionParametersType.DELIVERY_RULE_COOKIES_CONDITION_PARAMETERS  # type: ignore


class CustomDomain(ProxyResource):
    """Friendly domain name mapping to the endpoint hostname that the customer provides for branding
    purposes, e.g. `www.contoso.com <http://www.contoso.com>`_.

    :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.cdn.models.SystemData
    :ivar properties: The JSON object that contains the properties of the custom domain to create.
    :vartype properties: ~azure.mgmt.cdn.models.CustomDomainProperties
    """

    properties: Optional["_models.CustomDomainProperties"] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """The JSON object that contains the properties of the custom domain to create."""

    __flattened_items = [
        "host_name",
        "resource_state",
        "custom_https_provisioning_state",
        "custom_https_provisioning_substate",
        "custom_https_parameters",
        "validation_data",
        "provisioning_state",
    ]

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

    @overload
    def __init__(self, mapping: Mapping[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 CustomDomainParameters(_Model):
    """The customDomain JSON object required for custom domain creation or update.

    :ivar properties: The JSON object that contains the properties of the custom domain to create.
    :vartype properties: ~azure.mgmt.cdn.models.CustomDomainPropertiesParameters
    """

    properties: Optional["_models.CustomDomainPropertiesParameters"] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """The JSON object that contains the properties of the custom domain to create."""

    __flattened_items = ["host_name"]

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

    @overload
    def __init__(self, mapping: Mapping[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 CustomDomainProperties(_Model):
    """The JSON object that contains the properties of the custom domain to create.

    :ivar host_name: The host name of the custom domain. Must be a domain name. Required.
    :vartype host_name: str
    :ivar resource_state: Resource status of the custom domain. Known values are: "Creating",
     "Active", and "Deleting".
    :vartype resource_state: str or ~azure.mgmt.cdn.models.CustomDomainResourceState
    :ivar custom_https_provisioning_state: Provisioning status of the custom domain. Known values
     are: "Enabling", "Enabled", "Disabling", "Disabled", and "Failed".
    :vartype custom_https_provisioning_state: str or
     ~azure.mgmt.cdn.models.CustomHttpsProvisioningState
    :ivar custom_https_provisioning_substate: Provisioning substate shows the progress of custom
     HTTPS enabling/disabling process step by step. Known values are:
     "SubmittingDomainControlValidationRequest", "PendingDomainControlValidationREquestApproval",
     "DomainControlValidationRequestApproved", "DomainControlValidationRequestRejected",
     "DomainControlValidationRequestTimedOut", "IssuingCertificate", "DeployingCertificate",
     "CertificateDeployed", "DeletingCertificate", and "CertificateDeleted".
    :vartype custom_https_provisioning_substate: str or
     ~azure.mgmt.cdn.models.CustomHttpsProvisioningSubstate
    :ivar custom_https_parameters: Certificate parameters for securing custom HTTPS.
    :vartype custom_https_parameters: ~azure.mgmt.cdn.models.CustomDomainHttpsParameters
    :ivar validation_data: Special validation or data may be required when delivering CDN to some
     regions due to local compliance reasons. E.g. ICP license number of a custom domain is required
     to deliver content in China.
    :vartype validation_data: str
    :ivar provisioning_state: Provisioning status of Custom Https of the custom domain. Known
     values are: "Enabling", "Enabled", "Disabling", "Disabled", and "Failed".
    :vartype provisioning_state: str or ~azure.mgmt.cdn.models.CustomHttpsProvisioningState
    """

    host_name: str = rest_field(name="hostName", visibility=["read", "create", "update", "delete", "query"])
    """The host name of the custom domain. Must be a domain name. Required."""
    resource_state: Optional[Union[str, "_models.CustomDomainResourceState"]] = rest_field(
        name="resourceState", visibility=["read"]
    )
    """Resource status of the custom domain. Known values are: \"Creating\", \"Active\", and
     \"Deleting\"."""
    custom_https_provisioning_state: Optional[Union[str, "_models.CustomHttpsProvisioningState"]] = rest_field(
        name="customHttpsProvisioningState", visibility=["read"]
    )
    """Provisioning status of the custom domain. Known values are: \"Enabling\", \"Enabled\",
     \"Disabling\", \"Disabled\", and \"Failed\"."""
    custom_https_provisioning_substate: Optional[Union[str, "_models.CustomHttpsProvisioningSubstate"]] = rest_field(
        name="customHttpsProvisioningSubstate", visibility=["read"]
    )
    """Provisioning substate shows the progress of custom HTTPS enabling/disabling process step by
     step. Known values are: \"SubmittingDomainControlValidationRequest\",
     \"PendingDomainControlValidationREquestApproval\", \"DomainControlValidationRequestApproved\",
     \"DomainControlValidationRequestRejected\", \"DomainControlValidationRequestTimedOut\",
     \"IssuingCertificate\", \"DeployingCertificate\", \"CertificateDeployed\",
     \"DeletingCertificate\", and \"CertificateDeleted\"."""
    custom_https_parameters: Optional["_models.CustomDomainHttpsParameters"] = rest_field(
        name="customHttpsParameters", visibility=["read", "create", "update", "delete", "query"]
    )
    """Certificate parameters for securing custom HTTPS."""
    validation_data: Optional[str] = rest_field(
        name="validationData", visibility=["read", "create", "update", "delete", "query"]
    )
    """Special validation or data may be required when delivering CDN to some regions due to local
     compliance reasons. E.g. ICP license number of a custom domain is required to deliver content
     in China."""
    provisioning_state: Optional[Union[str, "_models.CustomHttpsProvisioningState"]] = rest_field(
        name="provisioningState", visibility=["read"]
    )
    """Provisioning status of Custom Https of the custom domain. Known values are: \"Enabling\",
     \"Enabled\", \"Disabling\", \"Disabled\", and \"Failed\"."""

    @overload
    def __init__(
        self,
        *,
        host_name: str,
        custom_https_parameters: Optional["_models.CustomDomainHttpsParameters"] = None,
        validation_data: 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 CustomDomainPropertiesParameters(_Model):
    """The JSON object that contains the properties of the custom domain to create.

    :ivar host_name: The host name of the custom domain. Must be a domain name. Required.
    :vartype host_name: str
    """

    host_name: str = rest_field(name="hostName", visibility=["read", "create", "update", "delete", "query"])
    """The host name of the custom domain. Must be a domain name. Required."""

    @overload
    def __init__(
        self,
        *,
        host_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 CustomerCertificateParameters(SecretParameters, discriminator="CustomerCertificate"):
    """Customer Certificate used for https.

    :ivar secret_source: Resource reference to the Azure Key Vault certificate. Expected to be in
     format of
     /subscriptions/{​​​​​​​​​subscriptionId}​​​​​​​​​/resourceGroups/{​​​​​​​​​resourceGroupName}​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​/providers/Microsoft.KeyVault/vaults/{vaultName}​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​/secrets/{certificateName}​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​.
     Required.
    :vartype secret_source: ~azure.mgmt.cdn.models.ResourceReference
    :ivar secret_version: Version of the secret to be used.
    :vartype secret_version: str
    :ivar use_latest_version: Whether to use the latest version for the certificate.
    :vartype use_latest_version: bool
    :ivar subject: Subject name in the certificate.
    :vartype subject: str
    :ivar expiration_date: Certificate expiration date.
    :vartype expiration_date: str
    :ivar certificate_authority: Certificate issuing authority.
    :vartype certificate_authority: str
    :ivar subject_alternative_names: The list of SANs.
    :vartype subject_alternative_names: list[str]
    :ivar thumbprint: Certificate thumbprint.
    :vartype thumbprint: str
    :ivar type: The type of the secret resource. Required. CUSTOMER_CERTIFICATE.
    :vartype type: str or ~azure.mgmt.cdn.models.CUSTOMER_CERTIFICATE
    """

    secret_source: "_models.ResourceReference" = rest_field(
        name="secretSource", visibility=["read", "create", "update", "delete", "query"]
    )
    """Resource reference to the Azure Key Vault certificate. Expected to be in format of
     /subscriptions/{​​​​​​​​​subscriptionId}​​​​​​​​​/resourceGroups/{​​​​​​​​​resourceGroupName}​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​/providers/Microsoft.KeyVault/vaults/{vaultName}​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​/secrets/{certificateName}​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​.
     Required."""
    secret_version: Optional[str] = rest_field(
        name="secretVersion", visibility=["read", "create", "update", "delete", "query"]
    )
    """Version of the secret to be used."""
    use_latest_version: Optional[bool] = rest_field(
        name="useLatestVersion", visibility=["read", "create", "update", "delete", "query"]
    )
    """Whether to use the latest version for the certificate."""
    subject: Optional[str] = rest_field(visibility=["read"])
    """Subject name in the certificate."""
    expiration_date: Optional[str] = rest_field(name="expirationDate", visibility=["read"])
    """Certificate expiration date."""
    certificate_authority: Optional[str] = rest_field(name="certificateAuthority", visibility=["read"])
    """Certificate issuing authority."""
    subject_alternative_names: Optional[list[str]] = rest_field(name="subjectAlternativeNames", visibility=["read"])
    """The list of SANs."""
    thumbprint: Optional[str] = rest_field(visibility=["read"])
    """Certificate thumbprint."""
    type: Literal[SecretType.CUSTOMER_CERTIFICATE] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"])  # type: ignore
    """The type of the secret resource. Required. CUSTOMER_CERTIFICATE."""

    @overload
    def __init__(
        self,
        *,
        secret_source: "_models.ResourceReference",
        secret_version: Optional[str] = None,
        use_latest_version: 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.type = SecretType.CUSTOMER_CERTIFICATE  # type: ignore


class CustomRule(_Model):
    """Defines the common attributes for a custom rule that can be included in a waf policy.

    :ivar name: Defines the name of the custom rule. Required.
    :vartype name: str
    :ivar enabled_state: Describes if the custom rule is in enabled or disabled state. Defaults to
     Enabled if not specified. Known values are: "Disabled" and "Enabled".
    :vartype enabled_state: str or ~azure.mgmt.cdn.models.CustomRuleEnabledState
    :ivar priority: Defines in what order this rule be evaluated in the overall list of custom
     rules. Required.
    :vartype priority: int
    :ivar match_conditions: List of match conditions. Required.
    :vartype match_conditions: list[~azure.mgmt.cdn.models.MatchCondition]
    :ivar action: Describes what action to be applied when rule matches. Required. Known values
     are: "Allow", "Block", "Log", and "Redirect".
    :vartype action: str or ~azure.mgmt.cdn.models.ActionType
    """

    name: str = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """Defines the name of the custom rule. Required."""
    enabled_state: Optional[Union[str, "_models.CustomRuleEnabledState"]] = rest_field(
        name="enabledState", visibility=["read", "create", "update", "delete", "query"]
    )
    """Describes if the custom rule is in enabled or disabled state. Defaults to Enabled if not
     specified. Known values are: \"Disabled\" and \"Enabled\"."""
    priority: int = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """Defines in what order this rule be evaluated in the overall list of custom rules. Required."""
    match_conditions: list["_models.MatchCondition"] = rest_field(
        name="matchConditions", visibility=["read", "create", "update", "delete", "query"]
    )
    """List of match conditions. Required."""
    action: Union[str, "_models.ActionType"] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """Describes what action to be applied when rule matches. Required. Known values are: \"Allow\",
     \"Block\", \"Log\", and \"Redirect\"."""

    @overload
    def __init__(
        self,
        *,
        name: str,
        priority: int,
        match_conditions: list["_models.MatchCondition"],
        action: Union[str, "_models.ActionType"],
        enabled_state: Optional[Union[str, "_models.CustomRuleEnabledState"]] = None,
    ) -> None: ...

    @overload
    def __init__(self, mapping: Mapping[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 CustomRuleList(_Model):
    """Defines contents of custom rules.

    :ivar rules: List of rules.
    :vartype rules: list[~azure.mgmt.cdn.models.CustomRule]
    """

    rules: Optional[list["_models.CustomRule"]] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """List of rules."""

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

    @overload
    def __init__(self, mapping: Mapping[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 DeepCreatedCustomDomain(_Model):
    """Custom domains created on the CDN endpoint.

    :ivar name: Custom domain name. Required.
    :vartype name: str
    :ivar properties: Properties of the custom domain created on the CDN endpoint.
    :vartype properties: ~azure.mgmt.cdn.models.DeepCreatedCustomDomainProperties
    """

    name: str = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """Custom domain name. Required."""
    properties: Optional["_models.DeepCreatedCustomDomainProperties"] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """Properties of the custom domain created on the CDN endpoint."""

    __flattened_items = ["host_name", "validation_data"]

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

    @overload
    def __init__(self, mapping: Mapping[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 DeepCreatedCustomDomainProperties(_Model):
    """Properties of the custom domain created on the CDN endpoint.

    :ivar host_name: The host name of the custom domain. Must be a domain name. Required.
    :vartype host_name: str
    :ivar validation_data: Special validation or data may be required when delivering CDN to some
     regions due to local compliance reasons. E.g. ICP license number of a custom domain is required
     to deliver content in China.
    :vartype validation_data: str
    """

    host_name: str = rest_field(name="hostName", visibility=["read", "create", "update", "delete", "query"])
    """The host name of the custom domain. Must be a domain name. Required."""
    validation_data: Optional[str] = rest_field(
        name="validationData", visibility=["read", "create", "update", "delete", "query"]
    )
    """Special validation or data may be required when delivering CDN to some regions due to local
     compliance reasons. E.g. ICP license number of a custom domain is required to deliver content
     in China."""

    @overload
    def __init__(
        self,
        *,
        host_name: str,
        validation_data: 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 DeepCreatedOrigin(_Model):
    """The main origin of CDN content which is added when creating a CDN endpoint.

    :ivar name: Origin name which must be unique within the endpoint. Required.
    :vartype name: str
    :ivar properties: Properties of the origin created on the CDN endpoint.
    :vartype properties: ~azure.mgmt.cdn.models.DeepCreatedOriginProperties
    """

    name: str = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """Origin name which must be unique within the endpoint. Required."""
    properties: Optional["_models.DeepCreatedOriginProperties"] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """Properties of the origin created on the CDN endpoint."""

    __flattened_items = [
        "host_name",
        "http_port",
        "https_port",
        "origin_host_header",
        "priority",
        "weight",
        "enabled",
        "private_link_alias",
        "private_link_resource_id",
        "private_link_location",
        "private_link_approval_message",
        "private_endpoint_status",
    ]

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

    @overload
    def __init__(self, mapping: Mapping[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 DeepCreatedOriginGroup(_Model):
    """The origin group for CDN content which is added when creating a CDN endpoint. Traffic is sent
    to the origins within the origin group based on origin health.

    :ivar name: Origin group name which must be unique within the endpoint. Required.
    :vartype name: str
    :ivar properties: Properties of the origin group created on the CDN endpoint.
    :vartype properties: ~azure.mgmt.cdn.models.DeepCreatedOriginGroupProperties
    """

    name: str = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """Origin group name which must be unique within the endpoint. Required."""
    properties: Optional["_models.DeepCreatedOriginGroupProperties"] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """Properties of the origin group created on the CDN endpoint."""

    __flattened_items = [
        "health_probe_settings",
        "origins",
        "traffic_restoration_time_to_healed_or_new_endpoints_in_minutes",
        "response_based_origin_error_detection_settings",
    ]

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

    @overload
    def __init__(self, mapping: Mapping[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 DeepCreatedOriginGroupProperties(_Model):
    """Properties of the origin group created on the CDN endpoint.

    :ivar health_probe_settings: Health probe settings to the origin that is used to determine the
     health of the origin.
    :vartype health_probe_settings: ~azure.mgmt.cdn.models.HealthProbeParameters
    :ivar origins: The source of the content being delivered via CDN within given origin group.
     Required.
    :vartype origins: list[~azure.mgmt.cdn.models.ResourceReference]
    :ivar traffic_restoration_time_to_healed_or_new_endpoints_in_minutes: Time in minutes to shift
     the traffic to the endpoint gradually when an unhealthy endpoint comes healthy or a new
     endpoint is added. Default is 10 mins. This property is currently not supported.
    :vartype traffic_restoration_time_to_healed_or_new_endpoints_in_minutes: int
    :ivar response_based_origin_error_detection_settings: The JSON object that contains the
     properties to determine origin health using real requests/responses.This property is currently
     not supported.
    :vartype response_based_origin_error_detection_settings:
     ~azure.mgmt.cdn.models.ResponseBasedOriginErrorDetectionParameters
    """

    health_probe_settings: Optional["_models.HealthProbeParameters"] = rest_field(
        name="healthProbeSettings", visibility=["read", "create", "update", "delete", "query"]
    )
    """Health probe settings to the origin that is used to determine the health of the origin."""
    origins: list["_models.ResourceReference"] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """The source of the content being delivered via CDN within given origin group. Required."""
    traffic_restoration_time_to_healed_or_new_endpoints_in_minutes: Optional[int] = rest_field(
        name="trafficRestorationTimeToHealedOrNewEndpointsInMinutes",
        visibility=["read", "create", "update", "delete", "query"],
    )
    """Time in minutes to shift the traffic to the endpoint gradually when an unhealthy endpoint comes
     healthy or a new endpoint is added. Default is 10 mins. This property is currently not
     supported."""
    response_based_origin_error_detection_settings: Optional["_models.ResponseBasedOriginErrorDetectionParameters"] = (
        rest_field(
            name="responseBasedOriginErrorDetectionSettings", visibility=["read", "create", "update", "delete", "query"]
        )
    )
    """The JSON object that contains the properties to determine origin health using real
     requests/responses.This property is currently not supported."""

    @overload
    def __init__(
        self,
        *,
        origins: list["_models.ResourceReference"],
        health_probe_settings: Optional["_models.HealthProbeParameters"] = None,
        traffic_restoration_time_to_healed_or_new_endpoints_in_minutes: Optional[int] = None,
        response_based_origin_error_detection_settings: Optional[
            "_models.ResponseBasedOriginErrorDetectionParameters"
        ] = None,
    ) -> None: ...

    @overload
    def __init__(self, mapping: Mapping[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 DeepCreatedOriginProperties(_Model):
    """Properties of the origin created on the CDN endpoint.

    :ivar host_name: The address of the origin. It can be a domain name, IPv4 address, or IPv6
     address. This should be unique across all origins in an endpoint. Required.
    :vartype host_name: str
    :ivar http_port: The value of the HTTP port. Must be between 1 and 65535.
    :vartype http_port: int
    :ivar https_port: The value of the HTTPS port. Must be between 1 and 65535.
    :vartype https_port: int
    :ivar origin_host_header: The host header value sent to the origin with each request. If you
     leave this blank, the request hostname determines this value. Azure CDN origins, such as Web
     Apps, Blob Storage, and Cloud Services require this host header value to match the origin
     hostname by default.
    :vartype origin_host_header: str
    :ivar priority: Priority of origin in given origin group for load balancing. Higher priorities
     will not be used for load balancing if any lower priority origin is healthy.Must be between 1
     and 5.
    :vartype priority: int
    :ivar weight: Weight of the origin in given origin group for load balancing. Must be between 1
     and 1000.
    :vartype weight: int
    :ivar enabled: Origin is enabled for load balancing or not. By default, origin is always
     enabled.
    :vartype enabled: bool
    :ivar private_link_alias: The Alias of the Private Link resource. Populating this optional
     field indicates that this origin is 'Private'.
    :vartype private_link_alias: str
    :ivar private_link_resource_id: The Resource Id of the Private Link resource. Populating this
     optional field indicates that this backend is 'Private'.
    :vartype private_link_resource_id: str
    :ivar private_link_location: The location of the Private Link resource. Required only if
     'privateLinkResourceId' is populated.
    :vartype private_link_location: str
    :ivar private_link_approval_message: A custom message to be included in the approval request to
     connect to the Private Link.
    :vartype private_link_approval_message: str
    :ivar private_endpoint_status: The approval status for the connection to the Private Link.
     Known values are: "Pending", "Approved", "Rejected", "Disconnected", and "Timeout".
    :vartype private_endpoint_status: str or ~azure.mgmt.cdn.models.PrivateEndpointStatus
    """

    host_name: str = rest_field(name="hostName", visibility=["read", "create", "update", "delete", "query"])
    """The address of the origin. It can be a domain name, IPv4 address, or IPv6 address. This should
     be unique across all origins in an endpoint. Required."""
    http_port: Optional[int] = rest_field(name="httpPort", visibility=["read", "create", "update", "delete", "query"])
    """The value of the HTTP port. Must be between 1 and 65535."""
    https_port: Optional[int] = rest_field(name="httpsPort", visibility=["read", "create", "update", "delete", "query"])
    """The value of the HTTPS port. Must be between 1 and 65535."""
    origin_host_header: Optional[str] = rest_field(
        name="originHostHeader", visibility=["read", "create", "update", "delete", "query"]
    )
    """The host header value sent to the origin with each request. If you leave this blank, the
     request hostname determines this value. Azure CDN origins, such as Web Apps, Blob Storage, and
     Cloud Services require this host header value to match the origin hostname by default."""
    priority: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """Priority of origin in given origin group for load balancing. Higher priorities will not be used
     for load balancing if any lower priority origin is healthy.Must be between 1 and 5."""
    weight: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """Weight of the origin in given origin group for load balancing. Must be between 1 and 1000."""
    enabled: Optional[bool] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """Origin is enabled for load balancing or not. By default, origin is always enabled."""
    private_link_alias: Optional[str] = rest_field(
        name="privateLinkAlias", visibility=["read", "create", "update", "delete", "query"]
    )
    """The Alias of the Private Link resource. Populating this optional field indicates that this
     origin is 'Private'."""
    private_link_resource_id: Optional[str] = rest_field(
        name="privateLinkResourceId", visibility=["read", "create", "update", "delete", "query"]
    )
    """The Resource Id of the Private Link resource. Populating this optional field indicates that
     this backend is 'Private'."""
    private_link_location: Optional[str] = rest_field(
        name="privateLinkLocation", visibility=["read", "create", "update", "delete", "query"]
    )
    """The location of the Private Link resource. Required only if 'privateLinkResourceId' is
     populated."""
    private_link_approval_message: Optional[str] = rest_field(
        name="privateLinkApprovalMessage", visibility=["read", "create", "update", "delete", "query"]
    )
    """A custom message to be included in the approval request to connect to the Private Link."""
    private_endpoint_status: Optional[Union[str, "_models.PrivateEndpointStatus"]] = rest_field(
        name="privateEndpointStatus", visibility=["read"]
    )
    """The approval status for the connection to the Private Link. Known values are: \"Pending\",
     \"Approved\", \"Rejected\", \"Disconnected\", and \"Timeout\"."""

    @overload
    def __init__(
        self,
        *,
        host_name: str,
        http_port: Optional[int] = None,
        https_port: Optional[int] = None,
        origin_host_header: Optional[str] = None,
        priority: Optional[int] = None,
        weight: Optional[int] = None,
        enabled: Optional[bool] = None,
        private_link_alias: Optional[str] = None,
        private_link_resource_id: Optional[str] = None,
        private_link_location: Optional[str] = None,
        private_link_approval_message: Optional[str] = None,
    ) -> None: ...

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

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


class DeliveryRule(_Model):
    """A rule that specifies a set of actions and conditions.

    :ivar name: Name of the rule.
    :vartype name: str
    :ivar order: The order in which the rules are applied for the endpoint. Possible values
     {0,1,2,3,………}. A rule with a lesser order will be applied before a rule with a greater order.
     Rule with order 0 is a special rule. It does not require any condition and actions listed in it
     will always be applied. Required.
    :vartype order: int
    :ivar conditions: A list of conditions that must be matched for the actions to be executed.
    :vartype conditions: list[~azure.mgmt.cdn.models.DeliveryRuleCondition]
    :ivar actions: A list of actions that are executed when all the conditions of a rule are
     satisfied. Required.
    :vartype actions: list[~azure.mgmt.cdn.models.DeliveryRuleAction]
    """

    name: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """Name of the rule."""
    order: int = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """The order in which the rules are applied for the endpoint. Possible values {0,1,2,3,………}. A
     rule with a lesser order will be applied before a rule with a greater order. Rule with order 0
     is a special rule. It does not require any condition and actions listed in it will always be
     applied. Required."""
    conditions: Optional[list["_models.DeliveryRuleCondition"]] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """A list of conditions that must be matched for the actions to be executed."""
    actions: list["_models.DeliveryRuleAction"] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """A list of actions that are executed when all the conditions of a rule are satisfied. Required."""

    @overload
    def __init__(
        self,
        *,
        order: int,
        actions: list["_models.DeliveryRuleAction"],
        name: Optional[str] = None,
        conditions: Optional[list["_models.DeliveryRuleCondition"]] = None,
    ) -> None: ...

    @overload
    def __init__(self, mapping: Mapping[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 DeliveryRuleAction(_Model):
    """An action for the delivery rule.

    You probably want to use the sub-classes and not this class directly. Known sub-classes are:
    DeliveryRuleCacheExpirationAction, DeliveryRuleCacheKeyQueryStringAction,
    DeliveryRuleRequestHeaderAction, DeliveryRuleResponseHeaderAction, OriginGroupOverrideAction,
    DeliveryRuleRouteConfigurationOverrideAction, UrlRedirectAction, UrlRewriteAction,
    UrlSigningAction

    :ivar name: The name of the action for the delivery rule. Required. Known values are:
     "CacheExpiration", "CacheKeyQueryString", "ModifyRequestHeader", "ModifyResponseHeader",
     "UrlRedirect", "UrlRewrite", "UrlSigning", "OriginGroupOverride", and
     "RouteConfigurationOverride".
    :vartype name: str or ~azure.mgmt.cdn.models.DeliveryRuleActionEnum
    """

    __mapping__: dict[str, _Model] = {}
    name: str = rest_discriminator(name="name", visibility=["read", "create", "update", "delete", "query"])
    """The name of the action for the delivery rule. Required. Known values are: \"CacheExpiration\",
     \"CacheKeyQueryString\", \"ModifyRequestHeader\", \"ModifyResponseHeader\", \"UrlRedirect\",
     \"UrlRewrite\", \"UrlSigning\", \"OriginGroupOverride\", and \"RouteConfigurationOverride\"."""

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

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

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


class DeliveryRuleCacheExpirationAction(DeliveryRuleAction, discriminator="CacheExpiration"):
    """Defines the cache expiration action for the delivery rule.

    :ivar parameters: Defines the parameters for the action. Required.
    :vartype parameters: ~azure.mgmt.cdn.models.CacheExpirationActionParameters
    :ivar name: The name of the action for the delivery rule. Required. CACHE_EXPIRATION.
    :vartype name: str or ~azure.mgmt.cdn.models.CACHE_EXPIRATION
    """

    parameters: "_models.CacheExpirationActionParameters" = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """Defines the parameters for the action. Required."""
    name: Literal[DeliveryRuleActionEnum.CACHE_EXPIRATION] = rest_discriminator(name="name", visibility=["read", "create", "update", "delete", "query"])  # type: ignore
    """The name of the action for the delivery rule. Required. CACHE_EXPIRATION."""

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

    @overload
    def __init__(self, mapping: Mapping[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.name = DeliveryRuleActionEnum.CACHE_EXPIRATION  # type: ignore


class DeliveryRuleCacheKeyQueryStringAction(DeliveryRuleAction, discriminator="CacheKeyQueryString"):
    """Defines the cache-key query string action for the delivery rule.

    :ivar parameters: Defines the parameters for the action. Required.
    :vartype parameters: ~azure.mgmt.cdn.models.CacheKeyQueryStringActionParameters
    :ivar name: The name of the action for the delivery rule. Required. CACHE_KEY_QUERY_STRING.
    :vartype name: str or ~azure.mgmt.cdn.models.CACHE_KEY_QUERY_STRING
    """

    parameters: "_models.CacheKeyQueryStringActionParameters" = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """Defines the parameters for the action. Required."""
    name: Literal[DeliveryRuleActionEnum.CACHE_KEY_QUERY_STRING] = rest_discriminator(name="name", visibility=["read", "create", "update", "delete", "query"])  # type: ignore
    """The name of the action for the delivery rule. Required. CACHE_KEY_QUERY_STRING."""

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

    @overload
    def __init__(self, mapping: Mapping[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.name = DeliveryRuleActionEnum.CACHE_KEY_QUERY_STRING  # type: ignore


class DeliveryRuleCondition(_Model):
    """A condition for the delivery rule.

    You probably want to use the sub-classes and not this class directly. Known sub-classes are:
    DeliveryRuleClientPortCondition, DeliveryRuleCookiesCondition, DeliveryRuleHostNameCondition,
    DeliveryRuleHttpVersionCondition, DeliveryRuleIsDeviceCondition, DeliveryRulePostArgsCondition,
    DeliveryRuleQueryStringCondition, DeliveryRuleRemoteAddressCondition,
    DeliveryRuleRequestBodyCondition, DeliveryRuleRequestHeaderCondition,
    DeliveryRuleRequestMethodCondition, DeliveryRuleRequestSchemeCondition,
    DeliveryRuleRequestUriCondition, DeliveryRuleServerPortCondition,
    DeliveryRuleSocketAddrCondition, DeliveryRuleSslProtocolCondition,
    DeliveryRuleUrlFileExtensionCondition, DeliveryRuleUrlFileNameCondition,
    DeliveryRuleUrlPathCondition

    :ivar name: The name of the condition for the delivery rule. Required. Known values are:
     "RemoteAddress", "RequestMethod", "QueryString", "PostArgs", "RequestUri", "RequestHeader",
     "RequestBody", "RequestScheme", "UrlPath", "UrlFileExtension", "UrlFileName", "HttpVersion",
     "Cookies", "IsDevice", "SocketAddr", "ClientPort", "ServerPort", "HostName", and "SslProtocol".
    :vartype name: str or ~azure.mgmt.cdn.models.MatchVariable
    """

    __mapping__: dict[str, _Model] = {}
    name: str = rest_discriminator(name="name", visibility=["read", "create", "update", "delete", "query"])
    """The name of the condition for the delivery rule. Required. Known values are: \"RemoteAddress\",
     \"RequestMethod\", \"QueryString\", \"PostArgs\", \"RequestUri\", \"RequestHeader\",
     \"RequestBody\", \"RequestScheme\", \"UrlPath\", \"UrlFileExtension\", \"UrlFileName\",
     \"HttpVersion\", \"Cookies\", \"IsDevice\", \"SocketAddr\", \"ClientPort\", \"ServerPort\",
     \"HostName\", and \"SslProtocol\"."""

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

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

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


class DeliveryRuleClientPortCondition(DeliveryRuleCondition, discriminator="ClientPort"):
    """Defines the ClientPort condition for the delivery rule.

    :ivar parameters: Defines the parameters for the condition. Required.
    :vartype parameters: ~azure.mgmt.cdn.models.ClientPortMatchConditionParameters
    :ivar name: The name of the condition for the delivery rule. Required. CLIENT_PORT.
    :vartype name: str or ~azure.mgmt.cdn.models.CLIENT_PORT
    """

    parameters: "_models.ClientPortMatchConditionParameters" = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """Defines the parameters for the condition. Required."""
    name: Literal[MatchVariable.CLIENT_PORT] = rest_discriminator(name="name", visibility=["read", "create", "update", "delete", "query"])  # type: ignore
    """The name of the condition for the delivery rule. Required. CLIENT_PORT."""

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

    @overload
    def __init__(self, mapping: Mapping[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.name = MatchVariable.CLIENT_PORT  # type: ignore


class DeliveryRuleCookiesCondition(DeliveryRuleCondition, discriminator="Cookies"):
    """Defines the Cookies condition for the delivery rule.

    :ivar parameters: Defines the parameters for the condition. Required.
    :vartype parameters: ~azure.mgmt.cdn.models.CookiesMatchConditionParameters
    :ivar name: The name of the condition for the delivery rule. Required. COOKIES.
    :vartype name: str or ~azure.mgmt.cdn.models.COOKIES
    """

    parameters: "_models.CookiesMatchConditionParameters" = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """Defines the parameters for the condition. Required."""
    name: Literal[MatchVariable.COOKIES] = rest_discriminator(name="name", visibility=["read", "create", "update", "delete", "query"])  # type: ignore
    """The name of the condition for the delivery rule. Required. COOKIES."""

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

    @overload
    def __init__(self, mapping: Mapping[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.name = MatchVariable.COOKIES  # type: ignore


class DeliveryRuleHostNameCondition(DeliveryRuleCondition, discriminator="HostName"):
    """Defines the HostName condition for the delivery rule.

    :ivar parameters: Defines the parameters for the condition. Required.
    :vartype parameters: ~azure.mgmt.cdn.models.HostNameMatchConditionParameters
    :ivar name: The name of the condition for the delivery rule. Required. HOST_NAME.
    :vartype name: str or ~azure.mgmt.cdn.models.HOST_NAME
    """

    parameters: "_models.HostNameMatchConditionParameters" = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """Defines the parameters for the condition. Required."""
    name: Literal[MatchVariable.HOST_NAME] = rest_discriminator(name="name", visibility=["read", "create", "update", "delete", "query"])  # type: ignore
    """The name of the condition for the delivery rule. Required. HOST_NAME."""

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

    @overload
    def __init__(self, mapping: Mapping[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.name = MatchVariable.HOST_NAME  # type: ignore


class DeliveryRuleHttpVersionCondition(DeliveryRuleCondition, discriminator="HttpVersion"):
    """Defines the HttpVersion condition for the delivery rule.

    :ivar parameters: Defines the parameters for the condition. Required.
    :vartype parameters: ~azure.mgmt.cdn.models.HttpVersionMatchConditionParameters
    :ivar name: The name of the condition for the delivery rule. Required. HTTP_VERSION.
    :vartype name: str or ~azure.mgmt.cdn.models.HTTP_VERSION
    """

    parameters: "_models.HttpVersionMatchConditionParameters" = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """Defines the parameters for the condition. Required."""
    name: Literal[MatchVariable.HTTP_VERSION] = rest_discriminator(name="name", visibility=["read", "create", "update", "delete", "query"])  # type: ignore
    """The name of the condition for the delivery rule. Required. HTTP_VERSION."""

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

    @overload
    def __init__(self, mapping: Mapping[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.name = MatchVariable.HTTP_VERSION  # type: ignore


class DeliveryRuleIsDeviceCondition(DeliveryRuleCondition, discriminator="IsDevice"):
    """Defines the IsDevice condition for the delivery rule.

    :ivar parameters: Defines the parameters for the condition. Required.
    :vartype parameters: ~azure.mgmt.cdn.models.IsDeviceMatchConditionParameters
    :ivar name: The name of the condition for the delivery rule. Required. IS_DEVICE.
    :vartype name: str or ~azure.mgmt.cdn.models.IS_DEVICE
    """

    parameters: "_models.IsDeviceMatchConditionParameters" = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """Defines the parameters for the condition. Required."""
    name: Literal[MatchVariable.IS_DEVICE] = rest_discriminator(name="name", visibility=["read", "create", "update", "delete", "query"])  # type: ignore
    """The name of the condition for the delivery rule. Required. IS_DEVICE."""

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

    @overload
    def __init__(self, mapping: Mapping[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.name = MatchVariable.IS_DEVICE  # type: ignore


class DeliveryRulePostArgsCondition(DeliveryRuleCondition, discriminator="PostArgs"):
    """Defines the PostArgs condition for the delivery rule.

    :ivar parameters: Defines the parameters for the condition. Required.
    :vartype parameters: ~azure.mgmt.cdn.models.PostArgsMatchConditionParameters
    :ivar name: The name of the condition for the delivery rule. Required. POST_ARGS.
    :vartype name: str or ~azure.mgmt.cdn.models.POST_ARGS
    """

    parameters: "_models.PostArgsMatchConditionParameters" = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """Defines the parameters for the condition. Required."""
    name: Literal[MatchVariable.POST_ARGS] = rest_discriminator(name="name", visibility=["read", "create", "update", "delete", "query"])  # type: ignore
    """The name of the condition for the delivery rule. Required. POST_ARGS."""

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

    @overload
    def __init__(self, mapping: Mapping[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.name = MatchVariable.POST_ARGS  # type: ignore


class DeliveryRuleQueryStringCondition(DeliveryRuleCondition, discriminator="QueryString"):
    """Defines the QueryString condition for the delivery rule.

    :ivar parameters: Defines the parameters for the condition. Required.
    :vartype parameters: ~azure.mgmt.cdn.models.QueryStringMatchConditionParameters
    :ivar name: The name of the condition for the delivery rule. Required. QUERY_STRING.
    :vartype name: str or ~azure.mgmt.cdn.models.QUERY_STRING
    """

    parameters: "_models.QueryStringMatchConditionParameters" = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """Defines the parameters for the condition. Required."""
    name: Literal[MatchVariable.QUERY_STRING] = rest_discriminator(name="name", visibility=["read", "create", "update", "delete", "query"])  # type: ignore
    """The name of the condition for the delivery rule. Required. QUERY_STRING."""

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

    @overload
    def __init__(self, mapping: Mapping[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.name = MatchVariable.QUERY_STRING  # type: ignore


class DeliveryRuleRemoteAddressCondition(DeliveryRuleCondition, discriminator="RemoteAddress"):
    """Defines the RemoteAddress condition for the delivery rule.

    :ivar parameters: Defines the parameters for the condition. Required.
    :vartype parameters: ~azure.mgmt.cdn.models.RemoteAddressMatchConditionParameters
    :ivar name: The name of the condition for the delivery rule. Required. REMOTE_ADDRESS.
    :vartype name: str or ~azure.mgmt.cdn.models.REMOTE_ADDRESS
    """

    parameters: "_models.RemoteAddressMatchConditionParameters" = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """Defines the parameters for the condition. Required."""
    name: Literal[MatchVariable.REMOTE_ADDRESS] = rest_discriminator(name="name", visibility=["read", "create", "update", "delete", "query"])  # type: ignore
    """The name of the condition for the delivery rule. Required. REMOTE_ADDRESS."""

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

    @overload
    def __init__(self, mapping: Mapping[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.name = MatchVariable.REMOTE_ADDRESS  # type: ignore


class DeliveryRuleRequestBodyCondition(DeliveryRuleCondition, discriminator="RequestBody"):
    """Defines the RequestBody condition for the delivery rule.

    :ivar parameters: Defines the parameters for the condition. Required.
    :vartype parameters: ~azure.mgmt.cdn.models.RequestBodyMatchConditionParameters
    :ivar name: The name of the condition for the delivery rule. Required. REQUEST_BODY.
    :vartype name: str or ~azure.mgmt.cdn.models.REQUEST_BODY
    """

    parameters: "_models.RequestBodyMatchConditionParameters" = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """Defines the parameters for the condition. Required."""
    name: Literal[MatchVariable.REQUEST_BODY] = rest_discriminator(name="name", visibility=["read", "create", "update", "delete", "query"])  # type: ignore
    """The name of the condition for the delivery rule. Required. REQUEST_BODY."""

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

    @overload
    def __init__(self, mapping: Mapping[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.name = MatchVariable.REQUEST_BODY  # type: ignore


class DeliveryRuleRequestHeaderAction(DeliveryRuleAction, discriminator="ModifyRequestHeader"):
    """Defines the request header action for the delivery rule.

    :ivar parameters: Defines the parameters for the action. Required.
    :vartype parameters: ~azure.mgmt.cdn.models.HeaderActionParameters
    :ivar name: The name of the action for the delivery rule. Required. MODIFY_REQUEST_HEADER.
    :vartype name: str or ~azure.mgmt.cdn.models.MODIFY_REQUEST_HEADER
    """

    parameters: "_models.HeaderActionParameters" = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """Defines the parameters for the action. Required."""
    name: Literal[DeliveryRuleActionEnum.MODIFY_REQUEST_HEADER] = rest_discriminator(name="name", visibility=["read", "create", "update", "delete", "query"])  # type: ignore
    """The name of the action for the delivery rule. Required. MODIFY_REQUEST_HEADER."""

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

    @overload
    def __init__(self, mapping: Mapping[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.name = DeliveryRuleActionEnum.MODIFY_REQUEST_HEADER  # type: ignore


class DeliveryRuleRequestHeaderCondition(DeliveryRuleCondition, discriminator="RequestHeader"):
    """Defines the RequestHeader condition for the delivery rule.

    :ivar parameters: Defines the parameters for the condition. Required.
    :vartype parameters: ~azure.mgmt.cdn.models.RequestHeaderMatchConditionParameters
    :ivar name: The name of the condition for the delivery rule. Required. REQUEST_HEADER.
    :vartype name: str or ~azure.mgmt.cdn.models.REQUEST_HEADER
    """

    parameters: "_models.RequestHeaderMatchConditionParameters" = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """Defines the parameters for the condition. Required."""
    name: Literal[MatchVariable.REQUEST_HEADER] = rest_discriminator(name="name", visibility=["read", "create", "update", "delete", "query"])  # type: ignore
    """The name of the condition for the delivery rule. Required. REQUEST_HEADER."""

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

    @overload
    def __init__(self, mapping: Mapping[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.name = MatchVariable.REQUEST_HEADER  # type: ignore


class DeliveryRuleRequestMethodCondition(DeliveryRuleCondition, discriminator="RequestMethod"):
    """Defines the RequestMethod condition for the delivery rule.

    :ivar parameters: Defines the parameters for the condition. Required.
    :vartype parameters: ~azure.mgmt.cdn.models.RequestMethodMatchConditionParameters
    :ivar name: The name of the condition for the delivery rule. Required. REQUEST_METHOD.
    :vartype name: str or ~azure.mgmt.cdn.models.REQUEST_METHOD
    """

    parameters: "_models.RequestMethodMatchConditionParameters" = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """Defines the parameters for the condition. Required."""
    name: Literal[MatchVariable.REQUEST_METHOD] = rest_discriminator(name="name", visibility=["read", "create", "update", "delete", "query"])  # type: ignore
    """The name of the condition for the delivery rule. Required. REQUEST_METHOD."""

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

    @overload
    def __init__(self, mapping: Mapping[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.name = MatchVariable.REQUEST_METHOD  # type: ignore


class DeliveryRuleRequestSchemeCondition(DeliveryRuleCondition, discriminator="RequestScheme"):
    """Defines the RequestScheme condition for the delivery rule.

    :ivar parameters: Defines the parameters for the condition. Required.
    :vartype parameters: ~azure.mgmt.cdn.models.RequestSchemeMatchConditionParameters
    :ivar name: The name of the condition for the delivery rule. Required. REQUEST_SCHEME.
    :vartype name: str or ~azure.mgmt.cdn.models.REQUEST_SCHEME
    """

    parameters: "_models.RequestSchemeMatchConditionParameters" = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """Defines the parameters for the condition. Required."""
    name: Literal[MatchVariable.REQUEST_SCHEME] = rest_discriminator(name="name", visibility=["read", "create", "update", "delete", "query"])  # type: ignore
    """The name of the condition for the delivery rule. Required. REQUEST_SCHEME."""

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

    @overload
    def __init__(self, mapping: Mapping[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.name = MatchVariable.REQUEST_SCHEME  # type: ignore


class DeliveryRuleRequestUriCondition(DeliveryRuleCondition, discriminator="RequestUri"):
    """Defines the RequestUri condition for the delivery rule.

    :ivar parameters: Defines the parameters for the condition. Required.
    :vartype parameters: ~azure.mgmt.cdn.models.RequestUriMatchConditionParameters
    :ivar name: The name of the condition for the delivery rule. Required. REQUEST_URI.
    :vartype name: str or ~azure.mgmt.cdn.models.REQUEST_URI
    """

    parameters: "_models.RequestUriMatchConditionParameters" = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """Defines the parameters for the condition. Required."""
    name: Literal[MatchVariable.REQUEST_URI] = rest_discriminator(name="name", visibility=["read", "create", "update", "delete", "query"])  # type: ignore
    """The name of the condition for the delivery rule. Required. REQUEST_URI."""

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

    @overload
    def __init__(self, mapping: Mapping[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.name = MatchVariable.REQUEST_URI  # type: ignore


class DeliveryRuleResponseHeaderAction(DeliveryRuleAction, discriminator="ModifyResponseHeader"):
    """Defines the response header action for the delivery rule.

    :ivar parameters: Defines the parameters for the action. Required.
    :vartype parameters: ~azure.mgmt.cdn.models.HeaderActionParameters
    :ivar name: The name of the action for the delivery rule. Required. MODIFY_RESPONSE_HEADER.
    :vartype name: str or ~azure.mgmt.cdn.models.MODIFY_RESPONSE_HEADER
    """

    parameters: "_models.HeaderActionParameters" = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """Defines the parameters for the action. Required."""
    name: Literal[DeliveryRuleActionEnum.MODIFY_RESPONSE_HEADER] = rest_discriminator(name="name", visibility=["read", "create", "update", "delete", "query"])  # type: ignore
    """The name of the action for the delivery rule. Required. MODIFY_RESPONSE_HEADER."""

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

    @overload
    def __init__(self, mapping: Mapping[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.name = DeliveryRuleActionEnum.MODIFY_RESPONSE_HEADER  # type: ignore


class DeliveryRuleRouteConfigurationOverrideAction(
    DeliveryRuleAction, discriminator="RouteConfigurationOverride"
):  # pylint: disable=name-too-long
    """Defines the route configuration override action for the delivery rule. Only applicable to
    Frontdoor Standard/Premium Profiles.

    :ivar parameters: Defines the parameters for the action. Required.
    :vartype parameters: ~azure.mgmt.cdn.models.RouteConfigurationOverrideActionParameters
    :ivar name: The name of the action for the delivery rule. Required.
     ROUTE_CONFIGURATION_OVERRIDE.
    :vartype name: str or ~azure.mgmt.cdn.models.ROUTE_CONFIGURATION_OVERRIDE
    """

    parameters: "_models.RouteConfigurationOverrideActionParameters" = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """Defines the parameters for the action. Required."""
    name: Literal[DeliveryRuleActionEnum.ROUTE_CONFIGURATION_OVERRIDE] = rest_discriminator(name="name", visibility=["read", "create", "update", "delete", "query"])  # type: ignore
    """The name of the action for the delivery rule. Required. ROUTE_CONFIGURATION_OVERRIDE."""

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

    @overload
    def __init__(self, mapping: Mapping[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.name = DeliveryRuleActionEnum.ROUTE_CONFIGURATION_OVERRIDE  # type: ignore


class DeliveryRuleServerPortCondition(DeliveryRuleCondition, discriminator="ServerPort"):
    """Defines the ServerPort condition for the delivery rule.

    :ivar parameters: Defines the parameters for the condition. Required.
    :vartype parameters: ~azure.mgmt.cdn.models.ServerPortMatchConditionParameters
    :ivar name: The name of the condition for the delivery rule. Required. SERVER_PORT.
    :vartype name: str or ~azure.mgmt.cdn.models.SERVER_PORT
    """

    parameters: "_models.ServerPortMatchConditionParameters" = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """Defines the parameters for the condition. Required."""
    name: Literal[MatchVariable.SERVER_PORT] = rest_discriminator(name="name", visibility=["read", "create", "update", "delete", "query"])  # type: ignore
    """The name of the condition for the delivery rule. Required. SERVER_PORT."""

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

    @overload
    def __init__(self, mapping: Mapping[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.name = MatchVariable.SERVER_PORT  # type: ignore


class DeliveryRuleSocketAddrCondition(DeliveryRuleCondition, discriminator="SocketAddr"):
    """Defines the SocketAddress condition for the delivery rule.

    :ivar parameters: Defines the parameters for the condition. Required.
    :vartype parameters: ~azure.mgmt.cdn.models.SocketAddrMatchConditionParameters
    :ivar name: The name of the condition for the delivery rule. Required. SOCKET_ADDR.
    :vartype name: str or ~azure.mgmt.cdn.models.SOCKET_ADDR
    """

    parameters: "_models.SocketAddrMatchConditionParameters" = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """Defines the parameters for the condition. Required."""
    name: Literal[MatchVariable.SOCKET_ADDR] = rest_discriminator(name="name", visibility=["read", "create", "update", "delete", "query"])  # type: ignore
    """The name of the condition for the delivery rule. Required. SOCKET_ADDR."""

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

    @overload
    def __init__(self, mapping: Mapping[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.name = MatchVariable.SOCKET_ADDR  # type: ignore


class DeliveryRuleSslProtocolCondition(DeliveryRuleCondition, discriminator="SslProtocol"):
    """Defines the SslProtocol condition for the delivery rule.

    :ivar parameters: Defines the parameters for the condition. Required.
    :vartype parameters: ~azure.mgmt.cdn.models.SslProtocolMatchConditionParameters
    :ivar name: The name of the condition for the delivery rule. Required. SSL_PROTOCOL.
    :vartype name: str or ~azure.mgmt.cdn.models.SSL_PROTOCOL
    """

    parameters: "_models.SslProtocolMatchConditionParameters" = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """Defines the parameters for the condition. Required."""
    name: Literal[MatchVariable.SSL_PROTOCOL] = rest_discriminator(name="name", visibility=["read", "create", "update", "delete", "query"])  # type: ignore
    """The name of the condition for the delivery rule. Required. SSL_PROTOCOL."""

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

    @overload
    def __init__(self, mapping: Mapping[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.name = MatchVariable.SSL_PROTOCOL  # type: ignore


class DeliveryRuleUrlFileExtensionCondition(DeliveryRuleCondition, discriminator="UrlFileExtension"):
    """Defines the UrlFileExtension condition for the delivery rule.

    :ivar parameters: Defines the parameters for the condition. Required.
    :vartype parameters: ~azure.mgmt.cdn.models.UrlFileExtensionMatchConditionParameters
    :ivar name: The name of the condition for the delivery rule. Required. URL_FILE_EXTENSION.
    :vartype name: str or ~azure.mgmt.cdn.models.URL_FILE_EXTENSION
    """

    parameters: "_models.UrlFileExtensionMatchConditionParameters" = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """Defines the parameters for the condition. Required."""
    name: Literal[MatchVariable.URL_FILE_EXTENSION] = rest_discriminator(name="name", visibility=["read", "create", "update", "delete", "query"])  # type: ignore
    """The name of the condition for the delivery rule. Required. URL_FILE_EXTENSION."""

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

    @overload
    def __init__(self, mapping: Mapping[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.name = MatchVariable.URL_FILE_EXTENSION  # type: ignore


class DeliveryRuleUrlFileNameCondition(DeliveryRuleCondition, discriminator="UrlFileName"):
    """Defines the UrlFileName condition for the delivery rule.

    :ivar parameters: Defines the parameters for the condition. Required.
    :vartype parameters: ~azure.mgmt.cdn.models.UrlFileNameMatchConditionParameters
    :ivar name: The name of the condition for the delivery rule. Required. URL_FILE_NAME.
    :vartype name: str or ~azure.mgmt.cdn.models.URL_FILE_NAME
    """

    parameters: "_models.UrlFileNameMatchConditionParameters" = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """Defines the parameters for the condition. Required."""
    name: Literal[MatchVariable.URL_FILE_NAME] = rest_discriminator(name="name", visibility=["read", "create", "update", "delete", "query"])  # type: ignore
    """The name of the condition for the delivery rule. Required. URL_FILE_NAME."""

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

    @overload
    def __init__(self, mapping: Mapping[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.name = MatchVariable.URL_FILE_NAME  # type: ignore


class DeliveryRuleUrlPathCondition(DeliveryRuleCondition, discriminator="UrlPath"):
    """Defines the UrlPath condition for the delivery rule.

    :ivar parameters: Defines the parameters for the condition. Required.
    :vartype parameters: ~azure.mgmt.cdn.models.UrlPathMatchConditionParameters
    :ivar name: The name of the condition for the delivery rule. Required. URL_PATH.
    :vartype name: str or ~azure.mgmt.cdn.models.URL_PATH
    """

    parameters: "_models.UrlPathMatchConditionParameters" = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """Defines the parameters for the condition. Required."""
    name: Literal[MatchVariable.URL_PATH] = rest_discriminator(name="name", visibility=["read", "create", "update", "delete", "query"])  # type: ignore
    """The name of the condition for the delivery rule. Required. URL_PATH."""

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

    @overload
    def __init__(self, mapping: Mapping[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.name = MatchVariable.URL_PATH  # type: ignore


class DimensionProperties(_Model):
    """Type of operation: get, read, delete, etc.

    :ivar name: Name of dimension.
    :vartype name: str
    :ivar display_name: Display name of dimension.
    :vartype display_name: str
    :ivar internal_name: Internal name of dimension.
    :vartype internal_name: str
    """

    name: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """Name of dimension."""
    display_name: Optional[str] = rest_field(
        name="displayName", visibility=["read", "create", "update", "delete", "query"]
    )
    """Display name of dimension."""
    internal_name: Optional[str] = rest_field(
        name="internalName", visibility=["read", "create", "update", "delete", "query"]
    )
    """Internal name of dimension."""

    @overload
    def __init__(
        self,
        *,
        name: Optional[str] = None,
        display_name: Optional[str] = None,
        internal_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 DomainValidationProperties(_Model):
    """The JSON object that contains the properties to validate a domain.

    :ivar validation_token: Challenge used for DNS TXT record or file based validation.
    :vartype validation_token: str
    :ivar expiration_date: The date time that the token expires.
    :vartype expiration_date: str
    """

    validation_token: Optional[str] = rest_field(name="validationToken", visibility=["read"])
    """Challenge used for DNS TXT record or file based validation."""
    expiration_date: Optional[str] = rest_field(name="expirationDate", visibility=["read"])
    """The date time that the token expires."""


class EdgeNode(ProxyResource):
    """Edgenode is a global Point of Presence (POP) location used to deliver CDN content to end users.

    :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.cdn.models.SystemData
    :ivar properties: The JSON object that contains the properties required to create an edgenode.
    :vartype properties: ~azure.mgmt.cdn.models.EdgeNodeProperties
    """

    properties: Optional["_models.EdgeNodeProperties"] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """The JSON object that contains the properties required to create an edgenode."""

    __flattened_items = ["ip_address_groups"]

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

    @overload
    def __init__(self, mapping: Mapping[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 EdgeNodeProperties(_Model):
    """The JSON object that contains the properties required to create an edgenode.

    :ivar ip_address_groups: List of ip address groups. Required.
    :vartype ip_address_groups: list[~azure.mgmt.cdn.models.IpAddressGroup]
    """

    ip_address_groups: list["_models.IpAddressGroup"] = rest_field(
        name="ipAddressGroups", visibility=["read", "create", "update", "delete", "query"]
    )
    """List of ip address groups. Required."""

    @overload
    def __init__(
        self,
        *,
        ip_address_groups: list["_models.IpAddressGroup"],
    ) -> None: ...

    @overload
    def __init__(self, mapping: Mapping[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 Endpoint(TrackedResource):
    """CDN endpoint is the entity within a CDN profile containing configuration information such as
    origin, protocol, content caching and delivery behavior. The CDN endpoint uses the URL format
    <endpointname>.azureedge.net.

    :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.cdn.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: The JSON object that contains the properties required to create an endpoint.
    :vartype properties: ~azure.mgmt.cdn.models.EndpointProperties
    """

    properties: Optional["_models.EndpointProperties"] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """The JSON object that contains the properties required to create an endpoint."""

    __flattened_items = [
        "origin_path",
        "content_types_to_compress",
        "origin_host_header",
        "is_compression_enabled",
        "is_http_allowed",
        "is_https_allowed",
        "query_string_caching_behavior",
        "optimization_type",
        "probe_path",
        "geo_filters",
        "default_origin_group",
        "url_signing_keys",
        "delivery_policy",
        "web_application_firewall_policy_link",
        "host_name",
        "origins",
        "origin_groups",
        "custom_domains",
        "resource_state",
        "provisioning_state",
    ]

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

    @overload
    def __init__(self, mapping: Mapping[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 EndpointPropertiesUpdateParameters(_Model):
    """The JSON object containing endpoint update parameters.

    :ivar origin_path: A directory path on the origin that CDN can use to retrieve content from,
     e.g. contoso.cloudapp.net/originpath.
    :vartype origin_path: str
    :ivar content_types_to_compress: List of content types on which compression applies. The value
     should be a valid MIME type.
    :vartype content_types_to_compress: list[str]
    :ivar origin_host_header: The host header value sent to the origin with each request. This
     property at Endpoint is only allowed when endpoint uses single origin and can be overridden by
     the same property specified at origin.If you leave this blank, the request hostname determines
     this value. Azure CDN origins, such as Web Apps, Blob Storage, and Cloud Services require this
     host header value to match the origin hostname by default.
    :vartype origin_host_header: str
    :ivar is_compression_enabled: Indicates whether content compression is enabled on CDN. Default
     value is false. If compression is enabled, content will be served as compressed if user
     requests for a compressed version. Content won't be compressed on CDN when requested content is
     smaller than 1 byte or larger than 1 MB.
    :vartype is_compression_enabled: bool
    :ivar is_http_allowed: Indicates whether HTTP traffic is allowed on the endpoint. Default value
     is true. At least one protocol (HTTP or HTTPS) must be allowed.
    :vartype is_http_allowed: bool
    :ivar is_https_allowed: Indicates whether HTTPS traffic is allowed on the endpoint. Default
     value is true. At least one protocol (HTTP or HTTPS) must be allowed.
    :vartype is_https_allowed: bool
    :ivar query_string_caching_behavior: Defines how CDN caches requests that include query
     strings. You can ignore any query strings when caching, bypass caching to prevent requests that
     contain query strings from being cached, or cache every request with a unique URL. Known values
     are: "IgnoreQueryString", "BypassCaching", "UseQueryString", and "NotSet".
    :vartype query_string_caching_behavior: str or
     ~azure.mgmt.cdn.models.QueryStringCachingBehavior
    :ivar optimization_type: Specifies what scenario the customer wants this CDN endpoint to
     optimize for, e.g. Download, Media services. With this information, CDN can apply scenario
     driven optimization. Known values are: "GeneralWebDelivery", "GeneralMediaStreaming",
     "VideoOnDemandMediaStreaming", "LargeFileDownload", and "DynamicSiteAcceleration".
    :vartype optimization_type: str or ~azure.mgmt.cdn.models.OptimizationType
    :ivar probe_path: Path to a file hosted on the origin which helps accelerate delivery of the
     dynamic content and calculate the most optimal routes for the CDN. This is relative to the
     origin path. This property is only relevant when using a single origin.
    :vartype probe_path: str
    :ivar geo_filters: List of rules defining the user's geo access within a CDN endpoint. Each geo
     filter defines an access rule to a specified path or content, e.g. block APAC for path
     /pictures/.
    :vartype geo_filters: list[~azure.mgmt.cdn.models.GeoFilter]
    :ivar default_origin_group: A reference to the origin group.
    :vartype default_origin_group: ~azure.mgmt.cdn.models.ResourceReference
    :ivar url_signing_keys: List of keys used to validate the signed URL hashes.
    :vartype url_signing_keys: list[~azure.mgmt.cdn.models.UrlSigningKey]
    :ivar delivery_policy: A policy that specifies the delivery rules to be used for an endpoint.
    :vartype delivery_policy:
     ~azure.mgmt.cdn.models.EndpointPropertiesUpdateParametersDeliveryPolicy
    :ivar web_application_firewall_policy_link: Defines the Web Application Firewall policy for the
     endpoint (if applicable).
    :vartype web_application_firewall_policy_link:
     ~azure.mgmt.cdn.models.EndpointPropertiesUpdateParametersWebApplicationFirewallPolicyLink
    """

    origin_path: Optional[str] = rest_field(
        name="originPath", visibility=["read", "create", "update", "delete", "query"]
    )
    """A directory path on the origin that CDN can use to retrieve content from, e.g.
     contoso.cloudapp.net/originpath."""
    content_types_to_compress: Optional[list[str]] = rest_field(
        name="contentTypesToCompress", visibility=["read", "create", "update", "delete", "query"]
    )
    """List of content types on which compression applies. The value should be a valid MIME type."""
    origin_host_header: Optional[str] = rest_field(
        name="originHostHeader", visibility=["read", "create", "update", "delete", "query"]
    )
    """The host header value sent to the origin with each request. This property at Endpoint is only
     allowed when endpoint uses single origin and can be overridden by the same property specified
     at origin.If you leave this blank, the request hostname determines this value. Azure CDN
     origins, such as Web Apps, Blob Storage, and Cloud Services require this host header value to
     match the origin hostname by default."""
    is_compression_enabled: Optional[bool] = rest_field(
        name="isCompressionEnabled", visibility=["read", "create", "update", "delete", "query"]
    )
    """Indicates whether content compression is enabled on CDN. Default value is false. If compression
     is enabled, content will be served as compressed if user requests for a compressed version.
     Content won't be compressed on CDN when requested content is smaller than 1 byte or larger than
     1 MB."""
    is_http_allowed: Optional[bool] = rest_field(
        name="isHttpAllowed", visibility=["read", "create", "update", "delete", "query"]
    )
    """Indicates whether HTTP traffic is allowed on the endpoint. Default value is true. At least one
     protocol (HTTP or HTTPS) must be allowed."""
    is_https_allowed: Optional[bool] = rest_field(
        name="isHttpsAllowed", visibility=["read", "create", "update", "delete", "query"]
    )
    """Indicates whether HTTPS traffic is allowed on the endpoint. Default value is true. At least one
     protocol (HTTP or HTTPS) must be allowed."""
    query_string_caching_behavior: Optional[Union[str, "_models.QueryStringCachingBehavior"]] = rest_field(
        name="queryStringCachingBehavior", visibility=["read", "create", "update", "delete", "query"]
    )
    """Defines how CDN caches requests that include query strings. You can ignore any query strings
     when caching, bypass caching to prevent requests that contain query strings from being cached,
     or cache every request with a unique URL. Known values are: \"IgnoreQueryString\",
     \"BypassCaching\", \"UseQueryString\", and \"NotSet\"."""
    optimization_type: Optional[Union[str, "_models.OptimizationType"]] = rest_field(
        name="optimizationType", visibility=["read", "create", "update", "delete", "query"]
    )
    """Specifies what scenario the customer wants this CDN endpoint to optimize for, e.g. Download,
     Media services. With this information, CDN can apply scenario driven optimization. Known values
     are: \"GeneralWebDelivery\", \"GeneralMediaStreaming\", \"VideoOnDemandMediaStreaming\",
     \"LargeFileDownload\", and \"DynamicSiteAcceleration\"."""
    probe_path: Optional[str] = rest_field(name="probePath", visibility=["read", "create", "update", "delete", "query"])
    """Path to a file hosted on the origin which helps accelerate delivery of the dynamic content and
     calculate the most optimal routes for the CDN. This is relative to the origin path. This
     property is only relevant when using a single origin."""
    geo_filters: Optional[list["_models.GeoFilter"]] = rest_field(
        name="geoFilters", visibility=["read", "create", "update", "delete", "query"]
    )
    """List of rules defining the user's geo access within a CDN endpoint. Each geo filter defines an
     access rule to a specified path or content, e.g. block APAC for path /pictures/."""
    default_origin_group: Optional["_models.ResourceReference"] = rest_field(
        name="defaultOriginGroup", visibility=["read", "create", "update", "delete", "query"]
    )
    """A reference to the origin group."""
    url_signing_keys: Optional[list["_models.UrlSigningKey"]] = rest_field(
        name="urlSigningKeys", visibility=["read", "create", "update", "delete", "query"]
    )
    """List of keys used to validate the signed URL hashes."""
    delivery_policy: Optional["_models.EndpointPropertiesUpdateParametersDeliveryPolicy"] = rest_field(
        name="deliveryPolicy", visibility=["read", "create", "update", "delete", "query"]
    )
    """A policy that specifies the delivery rules to be used for an endpoint."""
    web_application_firewall_policy_link: Optional[
        "_models.EndpointPropertiesUpdateParametersWebApplicationFirewallPolicyLink"
    ] = rest_field(name="webApplicationFirewallPolicyLink", visibility=["read", "create", "update", "delete", "query"])
    """Defines the Web Application Firewall policy for the endpoint (if applicable)."""

    @overload
    def __init__(
        self,
        *,
        origin_path: Optional[str] = None,
        content_types_to_compress: Optional[list[str]] = None,
        origin_host_header: Optional[str] = None,
        is_compression_enabled: Optional[bool] = None,
        is_http_allowed: Optional[bool] = None,
        is_https_allowed: Optional[bool] = None,
        query_string_caching_behavior: Optional[Union[str, "_models.QueryStringCachingBehavior"]] = None,
        optimization_type: Optional[Union[str, "_models.OptimizationType"]] = None,
        probe_path: Optional[str] = None,
        geo_filters: Optional[list["_models.GeoFilter"]] = None,
        default_origin_group: Optional["_models.ResourceReference"] = None,
        url_signing_keys: Optional[list["_models.UrlSigningKey"]] = None,
        delivery_policy: Optional["_models.EndpointPropertiesUpdateParametersDeliveryPolicy"] = None,
        web_application_firewall_policy_link: Optional[
            "_models.EndpointPropertiesUpdateParametersWebApplicationFirewallPolicyLink"
        ] = None,
    ) -> None: ...

    @overload
    def __init__(self, mapping: Mapping[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 EndpointProperties(EndpointPropertiesUpdateParameters):
    """The JSON object that contains the properties required to create an endpoint.

    :ivar origin_path: A directory path on the origin that CDN can use to retrieve content from,
     e.g. contoso.cloudapp.net/originpath.
    :vartype origin_path: str
    :ivar content_types_to_compress: List of content types on which compression applies. The value
     should be a valid MIME type.
    :vartype content_types_to_compress: list[str]
    :ivar origin_host_header: The host header value sent to the origin with each request. This
     property at Endpoint is only allowed when endpoint uses single origin and can be overridden by
     the same property specified at origin.If you leave this blank, the request hostname determines
     this value. Azure CDN origins, such as Web Apps, Blob Storage, and Cloud Services require this
     host header value to match the origin hostname by default.
    :vartype origin_host_header: str
    :ivar is_compression_enabled: Indicates whether content compression is enabled on CDN. Default
     value is false. If compression is enabled, content will be served as compressed if user
     requests for a compressed version. Content won't be compressed on CDN when requested content is
     smaller than 1 byte or larger than 1 MB.
    :vartype is_compression_enabled: bool
    :ivar is_http_allowed: Indicates whether HTTP traffic is allowed on the endpoint. Default value
     is true. At least one protocol (HTTP or HTTPS) must be allowed.
    :vartype is_http_allowed: bool
    :ivar is_https_allowed: Indicates whether HTTPS traffic is allowed on the endpoint. Default
     value is true. At least one protocol (HTTP or HTTPS) must be allowed.
    :vartype is_https_allowed: bool
    :ivar query_string_caching_behavior: Defines how CDN caches requests that include query
     strings. You can ignore any query strings when caching, bypass caching to prevent requests that
     contain query strings from being cached, or cache every request with a unique URL. Known values
     are: "IgnoreQueryString", "BypassCaching", "UseQueryString", and "NotSet".
    :vartype query_string_caching_behavior: str or
     ~azure.mgmt.cdn.models.QueryStringCachingBehavior
    :ivar optimization_type: Specifies what scenario the customer wants this CDN endpoint to
     optimize for, e.g. Download, Media services. With this information, CDN can apply scenario
     driven optimization. Known values are: "GeneralWebDelivery", "GeneralMediaStreaming",
     "VideoOnDemandMediaStreaming", "LargeFileDownload", and "DynamicSiteAcceleration".
    :vartype optimization_type: str or ~azure.mgmt.cdn.models.OptimizationType
    :ivar probe_path: Path to a file hosted on the origin which helps accelerate delivery of the
     dynamic content and calculate the most optimal routes for the CDN. This is relative to the
     origin path. This property is only relevant when using a single origin.
    :vartype probe_path: str
    :ivar geo_filters: List of rules defining the user's geo access within a CDN endpoint. Each geo
     filter defines an access rule to a specified path or content, e.g. block APAC for path
     /pictures/.
    :vartype geo_filters: list[~azure.mgmt.cdn.models.GeoFilter]
    :ivar default_origin_group: A reference to the origin group.
    :vartype default_origin_group: ~azure.mgmt.cdn.models.ResourceReference
    :ivar url_signing_keys: List of keys used to validate the signed URL hashes.
    :vartype url_signing_keys: list[~azure.mgmt.cdn.models.UrlSigningKey]
    :ivar delivery_policy: A policy that specifies the delivery rules to be used for an endpoint.
    :vartype delivery_policy:
     ~azure.mgmt.cdn.models.EndpointPropertiesUpdateParametersDeliveryPolicy
    :ivar web_application_firewall_policy_link: Defines the Web Application Firewall policy for the
     endpoint (if applicable).
    :vartype web_application_firewall_policy_link:
     ~azure.mgmt.cdn.models.EndpointPropertiesUpdateParametersWebApplicationFirewallPolicyLink
    :ivar host_name: The host name of the endpoint structured as {endpointName}.{DNSZone}, e.g.
     contoso.azureedge.net.
    :vartype host_name: str
    :ivar origins: The source of the content being delivered via CDN. Required.
    :vartype origins: list[~azure.mgmt.cdn.models.DeepCreatedOrigin]
    :ivar origin_groups: The origin groups comprising of origins that are used for load balancing
     the traffic based on availability.
    :vartype origin_groups: list[~azure.mgmt.cdn.models.DeepCreatedOriginGroup]
    :ivar custom_domains: The custom domains under the endpoint.
    :vartype custom_domains: list[~azure.mgmt.cdn.models.DeepCreatedCustomDomain]
    :ivar resource_state: Resource status of the endpoint. Known values are: "Creating",
     "Deleting", "Running", "Starting", "Stopped", and "Stopping".
    :vartype resource_state: str or ~azure.mgmt.cdn.models.EndpointResourceState
    :ivar provisioning_state: Provisioning status of the endpoint. Known values are: "Succeeded",
     "Failed", "Updating", "Deleting", and "Creating".
    :vartype provisioning_state: str or ~azure.mgmt.cdn.models.EndpointProvisioningState
    """

    host_name: Optional[str] = rest_field(name="hostName", visibility=["read"])
    """The host name of the endpoint structured as {endpointName}.{DNSZone}, e.g.
     contoso.azureedge.net."""
    origins: list["_models.DeepCreatedOrigin"] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """The source of the content being delivered via CDN. Required."""
    origin_groups: Optional[list["_models.DeepCreatedOriginGroup"]] = rest_field(
        name="originGroups", visibility=["read", "create", "update", "delete", "query"]
    )
    """The origin groups comprising of origins that are used for load balancing the traffic based on
     availability."""
    custom_domains: Optional[list["_models.DeepCreatedCustomDomain"]] = rest_field(
        name="customDomains", visibility=["read"]
    )
    """The custom domains under the endpoint."""
    resource_state: Optional[Union[str, "_models.EndpointResourceState"]] = rest_field(
        name="resourceState", visibility=["read"]
    )
    """Resource status of the endpoint. Known values are: \"Creating\", \"Deleting\", \"Running\",
     \"Starting\", \"Stopped\", and \"Stopping\"."""
    provisioning_state: Optional[Union[str, "_models.EndpointProvisioningState"]] = rest_field(
        name="provisioningState", visibility=["read"]
    )
    """Provisioning status of the endpoint. Known values are: \"Succeeded\", \"Failed\", \"Updating\",
     \"Deleting\", and \"Creating\"."""

    @overload
    def __init__(
        self,
        *,
        origins: list["_models.DeepCreatedOrigin"],
        origin_path: Optional[str] = None,
        content_types_to_compress: Optional[list[str]] = None,
        origin_host_header: Optional[str] = None,
        is_compression_enabled: Optional[bool] = None,
        is_http_allowed: Optional[bool] = None,
        is_https_allowed: Optional[bool] = None,
        query_string_caching_behavior: Optional[Union[str, "_models.QueryStringCachingBehavior"]] = None,
        optimization_type: Optional[Union[str, "_models.OptimizationType"]] = None,
        probe_path: Optional[str] = None,
        geo_filters: Optional[list["_models.GeoFilter"]] = None,
        default_origin_group: Optional["_models.ResourceReference"] = None,
        url_signing_keys: Optional[list["_models.UrlSigningKey"]] = None,
        delivery_policy: Optional["_models.EndpointPropertiesUpdateParametersDeliveryPolicy"] = None,
        web_application_firewall_policy_link: Optional[
            "_models.EndpointPropertiesUpdateParametersWebApplicationFirewallPolicyLink"
        ] = None,
        origin_groups: Optional[list["_models.DeepCreatedOriginGroup"]] = None,
    ) -> None: ...

    @overload
    def __init__(self, mapping: Mapping[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 EndpointPropertiesUpdateParametersDeliveryPolicy(_Model):  # pylint: disable=name-too-long
    """A policy that specifies the delivery rules to be used for an endpoint.

    :ivar description: User-friendly description of the policy.
    :vartype description: str
    :ivar rules: A list of the delivery rules. Required.
    :vartype rules: list[~azure.mgmt.cdn.models.DeliveryRule]
    """

    description: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """User-friendly description of the policy."""
    rules: list["_models.DeliveryRule"] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """A list of the delivery rules. Required."""

    @overload
    def __init__(
        self,
        *,
        rules: list["_models.DeliveryRule"],
        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 EndpointPropertiesUpdateParametersWebApplicationFirewallPolicyLink(_Model):  # pylint: disable=name-too-long
    """Defines the Web Application Firewall policy for the endpoint (if applicable).

    :ivar id: Resource ID.
    :vartype id: str
    """

    id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """Resource 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 EndpointUpdateParameters(_Model):
    """Properties required to create or update an endpoint.

    :ivar tags: Endpoint tags.
    :vartype tags: dict[str, str]
    :ivar properties: The JSON object containing endpoint update parameters.
    :vartype properties: ~azure.mgmt.cdn.models.EndpointPropertiesUpdateParameters
    """

    tags: Optional[dict[str, str]] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """Endpoint tags."""
    properties: Optional["_models.EndpointPropertiesUpdateParameters"] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """The JSON object containing endpoint update parameters."""

    __flattened_items = [
        "origin_path",
        "content_types_to_compress",
        "origin_host_header",
        "is_compression_enabled",
        "is_http_allowed",
        "is_https_allowed",
        "query_string_caching_behavior",
        "optimization_type",
        "probe_path",
        "geo_filters",
        "default_origin_group",
        "url_signing_keys",
        "delivery_policy",
        "web_application_firewall_policy_link",
    ]

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

    @overload
    def __init__(self, mapping: Mapping[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 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.cdn.models.ErrorDetail]
    :ivar additional_info: The error additional info.
    :vartype additional_info: list[~azure.mgmt.cdn.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.cdn.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 GeoFilter(_Model):
    """Rules defining user's geo access within a CDN endpoint.

    :ivar relative_path: Relative path applicable to geo filter. (e.g. '/mypictures',
     '/mypicture/kitty.jpg', and etc.). Required.
    :vartype relative_path: str
    :ivar action: Action of the geo filter, i.e. allow or block access. Required. Known values are:
     "Block" and "Allow".
    :vartype action: str or ~azure.mgmt.cdn.models.GeoFilterActions
    :ivar country_codes: Two letter country or region codes defining user country or region access
     in a geo filter, e.g. AU, MX, US. Required.
    :vartype country_codes: list[str]
    """

    relative_path: str = rest_field(name="relativePath", visibility=["read", "create", "update", "delete", "query"])
    """Relative path applicable to geo filter. (e.g. '/mypictures', '/mypicture/kitty.jpg', and etc.).
     Required."""
    action: Union[str, "_models.GeoFilterActions"] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """Action of the geo filter, i.e. allow or block access. Required. Known values are: \"Block\" and
     \"Allow\"."""
    country_codes: list[str] = rest_field(
        name="countryCodes", visibility=["read", "create", "update", "delete", "query"]
    )
    """Two letter country or region codes defining user country or region access in a geo filter, e.g.
     AU, MX, US. Required."""

    @overload
    def __init__(
        self,
        *,
        relative_path: str,
        action: Union[str, "_models.GeoFilterActions"],
        country_codes: list[str],
    ) -> None: ...

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

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


class HeaderActionParameters(DeliveryRuleActionParameters, discriminator="DeliveryRuleHeaderActionParameters"):
    """Defines the parameters for the request header action.

    :ivar header_action: Action to perform. Required. Known values are: "Append", "Overwrite", and
     "Delete".
    :vartype header_action: str or ~azure.mgmt.cdn.models.HeaderAction
    :ivar header_name: Name of the header to modify. Required.
    :vartype header_name: str
    :ivar value: Value for the specified action.
    :vartype value: str
    :ivar type_name: Required. DELIVERY_RULE_HEADER_ACTION_PARAMETERS.
    :vartype type_name: str or ~azure.mgmt.cdn.models.DELIVERY_RULE_HEADER_ACTION_PARAMETERS
    """

    header_action: Union[str, "_models.HeaderAction"] = rest_field(
        name="headerAction", visibility=["read", "create", "update", "delete", "query"]
    )
    """Action to perform. Required. Known values are: \"Append\", \"Overwrite\", and \"Delete\"."""
    header_name: str = rest_field(name="headerName", visibility=["read", "create", "update", "delete", "query"])
    """Name of the header to modify. Required."""
    value: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """Value for the specified action."""
    type_name: Literal[DeliveryRuleActionParametersType.DELIVERY_RULE_HEADER_ACTION_PARAMETERS] = rest_discriminator(name="typeName", visibility=["read", "create", "update", "delete", "query"])  # type: ignore
    """Required. DELIVERY_RULE_HEADER_ACTION_PARAMETERS."""

    @overload
    def __init__(
        self,
        *,
        header_action: Union[str, "_models.HeaderAction"],
        header_name: str,
        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.type_name = DeliveryRuleActionParametersType.DELIVERY_RULE_HEADER_ACTION_PARAMETERS  # type: ignore


class HealthProbeParameters(_Model):
    """The JSON object that contains the properties to send health probes to origin.

    :ivar probe_path: The path relative to the origin that is used to determine the health of the
     origin.
    :vartype probe_path: str
    :ivar probe_request_type: The type of health probe request that is made. Known values are:
     "NotSet", "GET", and "HEAD".
    :vartype probe_request_type: str or ~azure.mgmt.cdn.models.HealthProbeRequestType
    :ivar probe_protocol: Protocol to use for health probe. Known values are: "NotSet", "Http", and
     "Https".
    :vartype probe_protocol: str or ~azure.mgmt.cdn.models.ProbeProtocol
    :ivar probe_interval_in_seconds: The number of seconds between health probes.Default is 240sec.
    :vartype probe_interval_in_seconds: int
    """

    probe_path: Optional[str] = rest_field(name="probePath", visibility=["read", "create", "update", "delete", "query"])
    """The path relative to the origin that is used to determine the health of the origin."""
    probe_request_type: Optional[Union[str, "_models.HealthProbeRequestType"]] = rest_field(
        name="probeRequestType", visibility=["read", "create", "update", "delete", "query"]
    )
    """The type of health probe request that is made. Known values are: \"NotSet\", \"GET\", and
     \"HEAD\"."""
    probe_protocol: Optional[Union[str, "_models.ProbeProtocol"]] = rest_field(
        name="probeProtocol", visibility=["read", "create", "update", "delete", "query"]
    )
    """Protocol to use for health probe. Known values are: \"NotSet\", \"Http\", and \"Https\"."""
    probe_interval_in_seconds: Optional[int] = rest_field(
        name="probeIntervalInSeconds", visibility=["read", "create", "update", "delete", "query"]
    )
    """The number of seconds between health probes.Default is 240sec."""

    @overload
    def __init__(
        self,
        *,
        probe_path: Optional[str] = None,
        probe_request_type: Optional[Union[str, "_models.HealthProbeRequestType"]] = None,
        probe_protocol: Optional[Union[str, "_models.ProbeProtocol"]] = None,
        probe_interval_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 HostNameMatchConditionParameters(
    DeliveryRuleConditionParameters, discriminator="DeliveryRuleHostNameConditionParameters"
):
    """Defines the parameters for HostName match conditions.

    :ivar operator: Describes operator to be matched. Required. Known values are: "Any", "Equal",
     "Contains", "BeginsWith", "EndsWith", "LessThan", "LessThanOrEqual", "GreaterThan",
     "GreaterThanOrEqual", and "RegEx".
    :vartype operator: str or ~azure.mgmt.cdn.models.HostNameOperator
    :ivar negate_condition: Describes if this is negate condition or not.
    :vartype negate_condition: bool
    :ivar match_values: The match value for the condition of the delivery rule.
    :vartype match_values: list[str]
    :ivar transforms: List of transforms.
    :vartype transforms: list[str or ~azure.mgmt.cdn.models.Transform]
    :ivar type_name: Required. DELIVERY_RULE_HOST_NAME_CONDITION_PARAMETERS.
    :vartype type_name: str or ~azure.mgmt.cdn.models.DELIVERY_RULE_HOST_NAME_CONDITION_PARAMETERS
    """

    operator: Union[str, "_models.HostNameOperator"] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """Describes operator to be matched. Required. Known values are: \"Any\", \"Equal\", \"Contains\",
     \"BeginsWith\", \"EndsWith\", \"LessThan\", \"LessThanOrEqual\", \"GreaterThan\",
     \"GreaterThanOrEqual\", and \"RegEx\"."""
    negate_condition: Optional[bool] = rest_field(
        name="negateCondition", visibility=["read", "create", "update", "delete", "query"]
    )
    """Describes if this is negate condition or not."""
    match_values: Optional[list[str]] = rest_field(
        name="matchValues", visibility=["read", "create", "update", "delete", "query"]
    )
    """The match value for the condition of the delivery rule."""
    transforms: Optional[list[Union[str, "_models.Transform"]]] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """List of transforms."""
    type_name: Literal[DeliveryRuleConditionParametersType.DELIVERY_RULE_HOST_NAME_CONDITION_PARAMETERS] = rest_discriminator(name="typeName", visibility=["read", "create", "update", "delete", "query"])  # type: ignore
    """Required. DELIVERY_RULE_HOST_NAME_CONDITION_PARAMETERS."""

    @overload
    def __init__(
        self,
        *,
        operator: Union[str, "_models.HostNameOperator"],
        negate_condition: Optional[bool] = None,
        match_values: Optional[list[str]] = None,
        transforms: Optional[list[Union[str, "_models.Transform"]]] = None,
    ) -> None: ...

    @overload
    def __init__(self, mapping: Mapping[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.type_name = DeliveryRuleConditionParametersType.DELIVERY_RULE_HOST_NAME_CONDITION_PARAMETERS  # type: ignore


class HttpErrorRangeParameters(_Model):
    """The JSON object that represents the range for http status codes.

    :ivar begin: The inclusive start of the http status code range.
    :vartype begin: int
    :ivar end: The inclusive end of the http status code range.
    :vartype end: int
    """

    begin: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """The inclusive start of the http status code range."""
    end: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """The inclusive end of the http status code range."""

    @overload
    def __init__(
        self,
        *,
        begin: Optional[int] = None,
        end: 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 HttpVersionMatchConditionParameters(
    DeliveryRuleConditionParameters, discriminator="DeliveryRuleHttpVersionConditionParameters"
):
    """Defines the parameters for HttpVersion match conditions.

    :ivar operator: Describes operator to be matched. Required. "Equal"
    :vartype operator: str or ~azure.mgmt.cdn.models.HttpVersionOperator
    :ivar negate_condition: Describes if this is negate condition or not.
    :vartype negate_condition: bool
    :ivar match_values: The match value for the condition of the delivery rule.
    :vartype match_values: list[str]
    :ivar transforms: List of transforms.
    :vartype transforms: list[str or ~azure.mgmt.cdn.models.Transform]
    :ivar type_name: Required. DELIVERY_RULE_HTTP_VERSION_CONDITION_PARAMETERS.
    :vartype type_name: str or
     ~azure.mgmt.cdn.models.DELIVERY_RULE_HTTP_VERSION_CONDITION_PARAMETERS
    """

    operator: Union[str, "_models.HttpVersionOperator"] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """Describes operator to be matched. Required. \"Equal\""""
    negate_condition: Optional[bool] = rest_field(
        name="negateCondition", visibility=["read", "create", "update", "delete", "query"]
    )
    """Describes if this is negate condition or not."""
    match_values: Optional[list[str]] = rest_field(
        name="matchValues", visibility=["read", "create", "update", "delete", "query"]
    )
    """The match value for the condition of the delivery rule."""
    transforms: Optional[list[Union[str, "_models.Transform"]]] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """List of transforms."""
    type_name: Literal[DeliveryRuleConditionParametersType.DELIVERY_RULE_HTTP_VERSION_CONDITION_PARAMETERS] = rest_discriminator(name="typeName", visibility=["read", "create", "update", "delete", "query"])  # type: ignore
    """Required. DELIVERY_RULE_HTTP_VERSION_CONDITION_PARAMETERS."""

    @overload
    def __init__(
        self,
        *,
        operator: Union[str, "_models.HttpVersionOperator"],
        negate_condition: Optional[bool] = None,
        match_values: Optional[list[str]] = None,
        transforms: Optional[list[Union[str, "_models.Transform"]]] = None,
    ) -> None: ...

    @overload
    def __init__(self, mapping: Mapping[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.type_name = DeliveryRuleConditionParametersType.DELIVERY_RULE_HTTP_VERSION_CONDITION_PARAMETERS  # type: ignore


class IpAddressGroup(_Model):
    """CDN Ip address group.

    :ivar delivery_region: The delivery region of the ip address group.
    :vartype delivery_region: str
    :ivar ipv4_addresses: The list of ip v4 addresses.
    :vartype ipv4_addresses: list[~azure.mgmt.cdn.models.CidrIpAddress]
    :ivar ipv6_addresses: The list of ip v6 addresses.
    :vartype ipv6_addresses: list[~azure.mgmt.cdn.models.CidrIpAddress]
    """

    delivery_region: Optional[str] = rest_field(
        name="deliveryRegion", visibility=["read", "create", "update", "delete", "query"]
    )
    """The delivery region of the ip address group."""
    ipv4_addresses: Optional[list["_models.CidrIpAddress"]] = rest_field(
        name="ipv4Addresses", visibility=["read", "create", "update", "delete", "query"]
    )
    """The list of ip v4 addresses."""
    ipv6_addresses: Optional[list["_models.CidrIpAddress"]] = rest_field(
        name="ipv6Addresses", visibility=["read", "create", "update", "delete", "query"]
    )
    """The list of ip v6 addresses."""

    @overload
    def __init__(
        self,
        *,
        delivery_region: Optional[str] = None,
        ipv4_addresses: Optional[list["_models.CidrIpAddress"]] = None,
        ipv6_addresses: Optional[list["_models.CidrIpAddress"]] = None,
    ) -> None: ...

    @overload
    def __init__(self, mapping: Mapping[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 IsDeviceMatchConditionParameters(
    DeliveryRuleConditionParameters, discriminator="DeliveryRuleIsDeviceConditionParameters"
):
    """Defines the parameters for IsDevice match conditions.

    :ivar operator: Describes operator to be matched. Required. "Equal"
    :vartype operator: str or ~azure.mgmt.cdn.models.IsDeviceOperator
    :ivar negate_condition: Describes if this is negate condition or not.
    :vartype negate_condition: bool
    :ivar match_values: The match value for the condition of the delivery rule.
    :vartype match_values: list[str or
     ~azure.mgmt.cdn.models.IsDeviceMatchConditionParametersMatchValuesItem]
    :ivar transforms: List of transforms.
    :vartype transforms: list[str or ~azure.mgmt.cdn.models.Transform]
    :ivar type_name: Required. DELIVERY_RULE_IS_DEVICE_CONDITION_PARAMETERS.
    :vartype type_name: str or ~azure.mgmt.cdn.models.DELIVERY_RULE_IS_DEVICE_CONDITION_PARAMETERS
    """

    operator: Union[str, "_models.IsDeviceOperator"] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """Describes operator to be matched. Required. \"Equal\""""
    negate_condition: Optional[bool] = rest_field(
        name="negateCondition", visibility=["read", "create", "update", "delete", "query"]
    )
    """Describes if this is negate condition or not."""
    match_values: Optional[list[Union[str, "_models.IsDeviceMatchConditionParametersMatchValuesItem"]]] = rest_field(
        name="matchValues", visibility=["read", "create", "update", "delete", "query"]
    )
    """The match value for the condition of the delivery rule."""
    transforms: Optional[list[Union[str, "_models.Transform"]]] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """List of transforms."""
    type_name: Literal[DeliveryRuleConditionParametersType.DELIVERY_RULE_IS_DEVICE_CONDITION_PARAMETERS] = rest_discriminator(name="typeName", visibility=["read", "create", "update", "delete", "query"])  # type: ignore
    """Required. DELIVERY_RULE_IS_DEVICE_CONDITION_PARAMETERS."""

    @overload
    def __init__(
        self,
        *,
        operator: Union[str, "_models.IsDeviceOperator"],
        negate_condition: Optional[bool] = None,
        match_values: Optional[list[Union[str, "_models.IsDeviceMatchConditionParametersMatchValuesItem"]]] = None,
        transforms: Optional[list[Union[str, "_models.Transform"]]] = None,
    ) -> None: ...

    @overload
    def __init__(self, mapping: Mapping[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.type_name = DeliveryRuleConditionParametersType.DELIVERY_RULE_IS_DEVICE_CONDITION_PARAMETERS  # type: ignore


class KeyVaultCertificateSourceParameters(
    CertificateSourceParameters, discriminator="KeyVaultCertificateSourceParameters"
):
    """Describes the parameters for using a user's KeyVault certificate for securing custom domain.

    :ivar subscription_id: Subscription Id of the user's Key Vault containing the SSL certificate.
     Required.
    :vartype subscription_id: str
    :ivar resource_group_name: Resource group of the user's Key Vault containing the SSL
     certificate. Required.
    :vartype resource_group_name: str
    :ivar vault_name: The name of the user's Key Vault containing the SSL certificate. Required.
    :vartype vault_name: str
    :ivar secret_name: The name of Key Vault Secret (representing the full certificate PFX) in Key
     Vault. Required.
    :vartype secret_name: str
    :ivar secret_version: The version(GUID) of Key Vault Secret in Key Vault.
    :vartype secret_version: str
    :ivar update_rule: Describes the action that shall be taken when the certificate is updated in
     Key Vault. Required. "NoAction"
    :vartype update_rule: str or ~azure.mgmt.cdn.models.UpdateRule
    :ivar delete_rule: Describes the action that shall be taken when the certificate is removed
     from Key Vault. Required. "NoAction"
    :vartype delete_rule: str or ~azure.mgmt.cdn.models.DeleteRule
    :ivar type_name: Required. KEY_VAULT_CERTIFICATE_SOURCE_PARAMETERS.
    :vartype type_name: str or ~azure.mgmt.cdn.models.KEY_VAULT_CERTIFICATE_SOURCE_PARAMETERS
    """

    subscription_id: str = rest_field(name="subscriptionId", visibility=["read", "create", "update", "delete", "query"])
    """Subscription Id of the user's Key Vault containing the SSL certificate. Required."""
    resource_group_name: str = rest_field(
        name="resourceGroupName", visibility=["read", "create", "update", "delete", "query"]
    )
    """Resource group of the user's Key Vault containing the SSL certificate. Required."""
    vault_name: str = rest_field(name="vaultName", visibility=["read", "create", "update", "delete", "query"])
    """The name of the user's Key Vault containing the SSL certificate. Required."""
    secret_name: str = rest_field(name="secretName", visibility=["read", "create", "update", "delete", "query"])
    """The name of Key Vault Secret (representing the full certificate PFX) in Key Vault. Required."""
    secret_version: Optional[str] = rest_field(
        name="secretVersion", visibility=["read", "create", "update", "delete", "query"]
    )
    """The version(GUID) of Key Vault Secret in Key Vault."""
    update_rule: Union[str, "_models.UpdateRule"] = rest_field(
        name="updateRule", visibility=["read", "create", "update", "delete", "query"]
    )
    """Describes the action that shall be taken when the certificate is updated in Key Vault.
     Required. \"NoAction\""""
    delete_rule: Union[str, "_models.DeleteRule"] = rest_field(
        name="deleteRule", visibility=["read", "create", "update", "delete", "query"]
    )
    """Describes the action that shall be taken when the certificate is removed from Key Vault.
     Required. \"NoAction\""""
    type_name: Literal[CertificateSourceParametersType.KEY_VAULT_CERTIFICATE_SOURCE_PARAMETERS] = rest_discriminator(name="typeName", visibility=["read", "create", "update", "delete", "query"])  # type: ignore
    """Required. KEY_VAULT_CERTIFICATE_SOURCE_PARAMETERS."""

    @overload
    def __init__(
        self,
        *,
        subscription_id: str,
        resource_group_name: str,
        vault_name: str,
        secret_name: str,
        update_rule: Union[str, "_models.UpdateRule"],
        delete_rule: Union[str, "_models.DeleteRule"],
        secret_version: 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.type_name = CertificateSourceParametersType.KEY_VAULT_CERTIFICATE_SOURCE_PARAMETERS  # type: ignore


class KeyVaultSigningKeyParameters(_Model):
    """Describes the parameters for using a user's KeyVault for URL Signing Key.

    :ivar type_name: Required. "KeyVaultSigningKeyParameters"
    :vartype type_name: str or ~azure.mgmt.cdn.models.KeyVaultSigningKeyParametersTypeName
    :ivar subscription_id: Subscription Id of the user's Key Vault containing the secret. Required.
    :vartype subscription_id: str
    :ivar resource_group_name: Resource group of the user's Key Vault containing the secret.
     Required.
    :vartype resource_group_name: str
    :ivar vault_name: The name of the user's Key Vault containing the secret. Required.
    :vartype vault_name: str
    :ivar secret_name: The name of secret in Key Vault. Required.
    :vartype secret_name: str
    :ivar secret_version: The version(GUID) of secret in Key Vault. Required.
    :vartype secret_version: str
    """

    type_name: Union[str, "_models.KeyVaultSigningKeyParametersTypeName"] = rest_field(
        name="typeName", visibility=["read", "create", "update", "delete", "query"]
    )
    """Required. \"KeyVaultSigningKeyParameters\""""
    subscription_id: str = rest_field(name="subscriptionId", visibility=["read", "create", "update", "delete", "query"])
    """Subscription Id of the user's Key Vault containing the secret. Required."""
    resource_group_name: str = rest_field(
        name="resourceGroupName", visibility=["read", "create", "update", "delete", "query"]
    )
    """Resource group of the user's Key Vault containing the secret. Required."""
    vault_name: str = rest_field(name="vaultName", visibility=["read", "create", "update", "delete", "query"])
    """The name of the user's Key Vault containing the secret. Required."""
    secret_name: str = rest_field(name="secretName", visibility=["read", "create", "update", "delete", "query"])
    """The name of secret in Key Vault. Required."""
    secret_version: str = rest_field(name="secretVersion", visibility=["read", "create", "update", "delete", "query"])
    """The version(GUID) of secret in Key Vault. Required."""

    @overload
    def __init__(
        self,
        *,
        type_name: Union[str, "_models.KeyVaultSigningKeyParametersTypeName"],
        subscription_id: str,
        resource_group_name: str,
        vault_name: str,
        secret_name: str,
        secret_version: 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 LoadBalancingSettingsParameters(_Model):
    """Round-Robin load balancing settings for a backend pool.

    :ivar sample_size: The number of samples to consider for load balancing decisions.
    :vartype sample_size: int
    :ivar successful_samples_required: The number of samples within the sample period that must
     succeed.
    :vartype successful_samples_required: int
    :ivar additional_latency_in_milliseconds: The additional latency in milliseconds for probes to
     fall into the lowest latency bucket.
    :vartype additional_latency_in_milliseconds: int
    """

    sample_size: Optional[int] = rest_field(
        name="sampleSize", visibility=["read", "create", "update", "delete", "query"]
    )
    """The number of samples to consider for load balancing decisions."""
    successful_samples_required: Optional[int] = rest_field(
        name="successfulSamplesRequired", visibility=["read", "create", "update", "delete", "query"]
    )
    """The number of samples within the sample period that must succeed."""
    additional_latency_in_milliseconds: Optional[int] = rest_field(
        name="additionalLatencyInMilliseconds", visibility=["read", "create", "update", "delete", "query"]
    )
    """The additional latency in milliseconds for probes to fall into the lowest latency bucket."""

    @overload
    def __init__(
        self,
        *,
        sample_size: Optional[int] = None,
        successful_samples_required: Optional[int] = None,
        additional_latency_in_milliseconds: 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 LoadParameters(_Model):
    """Parameters required for content load.

    :ivar content_paths: The path to the content to be loaded. Path should be a relative file URL
     of the origin. Required.
    :vartype content_paths: list[str]
    """

    content_paths: list[str] = rest_field(
        name="contentPaths", visibility=["read", "create", "update", "delete", "query"]
    )
    """The path to the content to be loaded. Path should be a relative file URL of the origin.
     Required."""

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

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

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


class LogSpecification(_Model):
    """Log specification of operation.

    :ivar name: Name of log specification.
    :vartype name: str
    :ivar display_name: Display name of log specification.
    :vartype display_name: str
    :ivar blob_duration: Blob duration of specification.
    :vartype blob_duration: str
    :ivar log_filter_pattern: Pattern to filter based on name.
    :vartype log_filter_pattern: str
    """

    name: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """Name of log specification."""
    display_name: Optional[str] = rest_field(
        name="displayName", visibility=["read", "create", "update", "delete", "query"]
    )
    """Display name of log specification."""
    blob_duration: Optional[str] = rest_field(
        name="blobDuration", visibility=["read", "create", "update", "delete", "query"]
    )
    """Blob duration of specification."""
    log_filter_pattern: Optional[str] = rest_field(
        name="logFilterPattern", visibility=["read", "create", "update", "delete", "query"]
    )
    """Pattern to filter based on name."""

    @overload
    def __init__(
        self,
        *,
        name: Optional[str] = None,
        display_name: Optional[str] = None,
        blob_duration: Optional[str] = None,
        log_filter_pattern: 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 ManagedCertificateParameters(SecretParameters, discriminator="ManagedCertificate"):
    """Managed Certificate used for https.

    :ivar subject: Subject name in the certificate.
    :vartype subject: str
    :ivar expiration_date: Certificate expiration date.
    :vartype expiration_date: str
    :ivar type: The type of the secret resource. Required. MANAGED_CERTIFICATE.
    :vartype type: str or ~azure.mgmt.cdn.models.MANAGED_CERTIFICATE
    """

    subject: Optional[str] = rest_field(visibility=["read"])
    """Subject name in the certificate."""
    expiration_date: Optional[str] = rest_field(name="expirationDate", visibility=["read"])
    """Certificate expiration date."""
    type: Literal[SecretType.MANAGED_CERTIFICATE] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"])  # type: ignore
    """The type of the secret resource. Required. MANAGED_CERTIFICATE."""

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

    @overload
    def __init__(self, mapping: Mapping[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.type = SecretType.MANAGED_CERTIFICATE  # type: ignore


class ManagedRuleDefinition(_Model):
    """Describes a managed rule definition.

    :ivar rule_id: Identifier for the managed rule.
    :vartype rule_id: str
    :ivar description: Describes the functionality of the managed rule.
    :vartype description: str
    """

    rule_id: Optional[str] = rest_field(name="ruleId", visibility=["read"])
    """Identifier for the managed rule."""
    description: Optional[str] = rest_field(visibility=["read"])
    """Describes the functionality of the managed rule."""


class ManagedRuleGroupDefinition(_Model):
    """Describes a managed rule group.

    :ivar rule_group_name: Name of the managed rule group.
    :vartype rule_group_name: str
    :ivar description: Description of the managed rule group.
    :vartype description: str
    :ivar rules: List of rules within the managed rule group.
    :vartype rules: list[~azure.mgmt.cdn.models.ManagedRuleDefinition]
    """

    rule_group_name: Optional[str] = rest_field(name="ruleGroupName", visibility=["read"])
    """Name of the managed rule group."""
    description: Optional[str] = rest_field(visibility=["read"])
    """Description of the managed rule group."""
    rules: Optional[list["_models.ManagedRuleDefinition"]] = rest_field(visibility=["read"])
    """List of rules within the managed rule group."""


class ManagedRuleGroupOverride(_Model):
    """Defines a managed rule group override setting.

    :ivar rule_group_name: Describes the managed rule group within the rule set to override.
     Required.
    :vartype rule_group_name: str
    :ivar rules: List of rules that will be enabled. If none specified, all rules in the group will
     be disabled.
    :vartype rules: list[~azure.mgmt.cdn.models.ManagedRuleOverride]
    """

    rule_group_name: str = rest_field(name="ruleGroupName", visibility=["read", "create", "update", "delete", "query"])
    """Describes the managed rule group within the rule set to override. Required."""
    rules: Optional[list["_models.ManagedRuleOverride"]] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """List of rules that will be enabled. If none specified, all rules in the group will be disabled."""

    @overload
    def __init__(
        self,
        *,
        rule_group_name: str,
        rules: Optional[list["_models.ManagedRuleOverride"]] = None,
    ) -> None: ...

    @overload
    def __init__(self, mapping: Mapping[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 ManagedRuleOverride(_Model):
    """Defines a managed rule group override setting.

    :ivar rule_id: Identifier for the managed rule. Required.
    :vartype rule_id: str
    :ivar enabled_state: Describes if the managed rule is in enabled or disabled state. Defaults to
     Disabled if not specified. Known values are: "Disabled" and "Enabled".
    :vartype enabled_state: str or ~azure.mgmt.cdn.models.ManagedRuleEnabledState
    :ivar action: Describes the override action to be applied when rule matches. Known values are:
     "Allow", "Block", "Log", and "Redirect".
    :vartype action: str or ~azure.mgmt.cdn.models.ActionType
    """

    rule_id: str = rest_field(name="ruleId", visibility=["read", "create", "update", "delete", "query"])
    """Identifier for the managed rule. Required."""
    enabled_state: Optional[Union[str, "_models.ManagedRuleEnabledState"]] = rest_field(
        name="enabledState", visibility=["read", "create", "update", "delete", "query"]
    )
    """Describes if the managed rule is in enabled or disabled state. Defaults to Disabled if not
     specified. Known values are: \"Disabled\" and \"Enabled\"."""
    action: Optional[Union[str, "_models.ActionType"]] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """Describes the override action to be applied when rule matches. Known values are: \"Allow\",
     \"Block\", \"Log\", and \"Redirect\"."""

    @overload
    def __init__(
        self,
        *,
        rule_id: str,
        enabled_state: Optional[Union[str, "_models.ManagedRuleEnabledState"]] = None,
        action: Optional[Union[str, "_models.ActionType"]] = None,
    ) -> None: ...

    @overload
    def __init__(self, mapping: Mapping[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 ManagedRuleSet(_Model):
    """Defines a managed rule set.

    :ivar rule_set_type: Defines the rule set type to use. Required.
    :vartype rule_set_type: str
    :ivar rule_set_version: Defines the version of the rule set to use. Required.
    :vartype rule_set_version: str
    :ivar anomaly_score: Verizon only : If the rule set supports anomaly detection mode, this
     describes the threshold for blocking requests.
    :vartype anomaly_score: int
    :ivar rule_group_overrides: Defines the rule overrides to apply to the rule set.
    :vartype rule_group_overrides: list[~azure.mgmt.cdn.models.ManagedRuleGroupOverride]
    """

    rule_set_type: str = rest_field(name="ruleSetType", visibility=["read", "create", "update", "delete", "query"])
    """Defines the rule set type to use. Required."""
    rule_set_version: str = rest_field(
        name="ruleSetVersion", visibility=["read", "create", "update", "delete", "query"]
    )
    """Defines the version of the rule set to use. Required."""
    anomaly_score: Optional[int] = rest_field(
        name="anomalyScore", visibility=["read", "create", "update", "delete", "query"]
    )
    """Verizon only : If the rule set supports anomaly detection mode, this describes the threshold
     for blocking requests."""
    rule_group_overrides: Optional[list["_models.ManagedRuleGroupOverride"]] = rest_field(
        name="ruleGroupOverrides", visibility=["read", "create", "update", "delete", "query"]
    )
    """Defines the rule overrides to apply to the rule set."""

    @overload
    def __init__(
        self,
        *,
        rule_set_type: str,
        rule_set_version: str,
        anomaly_score: Optional[int] = None,
        rule_group_overrides: Optional[list["_models.ManagedRuleGroupOverride"]] = None,
    ) -> None: ...

    @overload
    def __init__(self, mapping: Mapping[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 ManagedRuleSetDefinition(Resource):
    """Describes a managed rule set definition.

    :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.cdn.models.SystemData
    :ivar properties: Describes managed rule set definition properties.
    :vartype properties: ~azure.mgmt.cdn.models.ManagedRuleSetDefinitionProperties
    :ivar sku: The pricing tier (defines a CDN provider, feature list and rate) of the
     CdnWebApplicationFirewallPolicy.
    :vartype sku: ~azure.mgmt.cdn.models.Sku
    """

    properties: Optional["_models.ManagedRuleSetDefinitionProperties"] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """Describes managed rule set definition properties."""
    sku: Optional["_models.Sku"] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """The pricing tier (defines a CDN provider, feature list and rate) of the
     CdnWebApplicationFirewallPolicy."""

    __flattened_items = ["provisioning_state", "rule_set_type", "rule_set_version", "rule_groups"]

    @overload
    def __init__(
        self,
        *,
        properties: Optional["_models.ManagedRuleSetDefinitionProperties"] = None,
        sku: Optional["_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:
        _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 ManagedRuleSetDefinitionProperties(_Model):
    """Properties for a managed rule set definition.

    :ivar provisioning_state: Provisioning state of the managed rule set.
    :vartype provisioning_state: str
    :ivar rule_set_type: Type of the managed rule set.
    :vartype rule_set_type: str
    :ivar rule_set_version: Version of the managed rule set type.
    :vartype rule_set_version: str
    :ivar rule_groups: Rule groups of the managed rule set.
    :vartype rule_groups: list[~azure.mgmt.cdn.models.ManagedRuleGroupDefinition]
    """

    provisioning_state: Optional[str] = rest_field(name="provisioningState", visibility=["read"])
    """Provisioning state of the managed rule set."""
    rule_set_type: Optional[str] = rest_field(name="ruleSetType", visibility=["read"])
    """Type of the managed rule set."""
    rule_set_version: Optional[str] = rest_field(name="ruleSetVersion", visibility=["read"])
    """Version of the managed rule set type."""
    rule_groups: Optional[list["_models.ManagedRuleGroupDefinition"]] = rest_field(
        name="ruleGroups", visibility=["read"]
    )
    """Rule groups of the managed rule set."""


class ManagedRuleSetList(_Model):
    """Defines the list of managed rule sets for the policy.

    :ivar managed_rule_sets: List of rule sets.
    :vartype managed_rule_sets: list[~azure.mgmt.cdn.models.ManagedRuleSet]
    """

    managed_rule_sets: Optional[list["_models.ManagedRuleSet"]] = rest_field(
        name="managedRuleSets", visibility=["read", "create", "update", "delete", "query"]
    )
    """List of rule sets."""

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

    @overload
    def __init__(self, mapping: Mapping[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 ManagedServiceIdentity(_Model):
    """Managed service identity (system assigned and/or user assigned identities).

    :ivar principal_id: The service principal ID of the system assigned identity. This property
     will only be provided for a system assigned identity.
    :vartype principal_id: str
    :ivar tenant_id: The tenant ID of the system assigned identity. This property will only be
     provided for a system assigned identity.
    :vartype tenant_id: str
    :ivar type: The type of managed identity assigned to this resource. Required. Known values are:
     "None", "SystemAssigned", "UserAssigned", and "SystemAssigned,UserAssigned".
    :vartype type: str or ~azure.mgmt.cdn.models.ManagedServiceIdentityType
    :ivar user_assigned_identities: The identities assigned to this resource by the user.
    :vartype user_assigned_identities: dict[str, ~azure.mgmt.cdn.models.UserAssignedIdentity]
    """

    principal_id: Optional[str] = rest_field(name="principalId", visibility=["read"])
    """The service principal ID of the system assigned identity. This property will only be provided
     for a system assigned identity."""
    tenant_id: Optional[str] = rest_field(name="tenantId", visibility=["read"])
    """The tenant ID of the system assigned identity. This property will only be provided for a system
     assigned identity."""
    type: Union[str, "_models.ManagedServiceIdentityType"] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """The type of managed identity assigned to this resource. Required. Known values are: \"None\",
     \"SystemAssigned\", \"UserAssigned\", and \"SystemAssigned,UserAssigned\"."""
    user_assigned_identities: Optional[dict[str, "_models.UserAssignedIdentity"]] = rest_field(
        name="userAssignedIdentities", visibility=["read", "create", "update", "delete", "query"]
    )
    """The identities assigned to this resource by the user."""

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

    @overload
    def __init__(self, mapping: Mapping[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 MatchCondition(_Model):
    """Define match conditions.

    :ivar match_variable: Match variable to compare against. Required. Known values are:
     "RemoteAddr", "SocketAddr", "RequestMethod", "RequestHeader", "RequestUri", "QueryString",
     "RequestBody", "Cookies", and "PostArgs".
    :vartype match_variable: str or ~azure.mgmt.cdn.models.WafMatchVariable
    :ivar selector: Selector can used to match a specific key for QueryString, Cookies,
     RequestHeader or PostArgs.
    :vartype selector: str
    :ivar operator: Describes operator to be matched. Required. Known values are: "Any", "IPMatch",
     "GeoMatch", "Equal", "Contains", "LessThan", "GreaterThan", "LessThanOrEqual",
     "GreaterThanOrEqual", "BeginsWith", "EndsWith", and "RegEx".
    :vartype operator: str or ~azure.mgmt.cdn.models.Operator
    :ivar negate_condition: Describes if the result of this condition should be negated.
    :vartype negate_condition: bool
    :ivar match_value: List of possible match values. Required.
    :vartype match_value: list[str]
    :ivar transforms: List of transforms.
    :vartype transforms: list[str or ~azure.mgmt.cdn.models.TransformType]
    """

    match_variable: Union[str, "_models.WafMatchVariable"] = rest_field(
        name="matchVariable", visibility=["read", "create", "update", "delete", "query"]
    )
    """Match variable to compare against. Required. Known values are: \"RemoteAddr\", \"SocketAddr\",
     \"RequestMethod\", \"RequestHeader\", \"RequestUri\", \"QueryString\", \"RequestBody\",
     \"Cookies\", and \"PostArgs\"."""
    selector: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """Selector can used to match a specific key for QueryString, Cookies, RequestHeader or PostArgs."""
    operator: Union[str, "_models.Operator"] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """Describes operator to be matched. Required. Known values are: \"Any\", \"IPMatch\",
     \"GeoMatch\", \"Equal\", \"Contains\", \"LessThan\", \"GreaterThan\", \"LessThanOrEqual\",
     \"GreaterThanOrEqual\", \"BeginsWith\", \"EndsWith\", and \"RegEx\"."""
    negate_condition: Optional[bool] = rest_field(
        name="negateCondition", visibility=["read", "create", "update", "delete", "query"]
    )
    """Describes if the result of this condition should be negated."""
    match_value: list[str] = rest_field(name="matchValue", visibility=["read", "create", "update", "delete", "query"])
    """List of possible match values. Required."""
    transforms: Optional[list[Union[str, "_models.TransformType"]]] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """List of transforms."""

    @overload
    def __init__(
        self,
        *,
        match_variable: Union[str, "_models.WafMatchVariable"],
        operator: Union[str, "_models.Operator"],
        match_value: list[str],
        selector: Optional[str] = None,
        negate_condition: Optional[bool] = None,
        transforms: Optional[list[Union[str, "_models.TransformType"]]] = None,
    ) -> None: ...

    @overload
    def __init__(self, mapping: Mapping[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 MetricAvailability(_Model):
    """Retention policy of a resource metric.

    :ivar time_grain:
    :vartype time_grain: str
    :ivar blob_duration:
    :vartype blob_duration: str
    """

    time_grain: Optional[str] = rest_field(name="timeGrain", visibility=["read", "create", "update", "delete", "query"])
    blob_duration: Optional[str] = rest_field(
        name="blobDuration", visibility=["read", "create", "update", "delete", "query"]
    )

    @overload
    def __init__(
        self,
        *,
        time_grain: Optional[str] = None,
        blob_duration: 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 MetricSpecification(_Model):
    """Metric specification of operation.

    :ivar name: Name of metric specification.
    :vartype name: str
    :ivar display_name: Display name of metric specification.
    :vartype display_name: str
    :ivar display_description: Display description of metric specification.
    :vartype display_description: str
    :ivar unit: The metric unit. Possible values include: 'Bytes', 'Count', 'Milliseconds'.
    :vartype unit: str
    :ivar aggregation_type: The metric aggregation type. Possible values include: 'Average',
     'Count', 'Total'.
    :vartype aggregation_type: str
    :ivar availabilities: Retention policies of a resource metric.
    :vartype availabilities: list[~azure.mgmt.cdn.models.MetricAvailability]
    :ivar supported_time_grain_types: The supported time grain types for the metrics.
    :vartype supported_time_grain_types: list[str]
    :ivar dimensions: The dimensions of metric.
    :vartype dimensions: list[~azure.mgmt.cdn.models.DimensionProperties]
    :ivar fill_gap_with_zero: Property to specify whether to fill gap with zero.
    :vartype fill_gap_with_zero: bool
    :ivar metric_filter_pattern: Pattern to filter based on name.
    :vartype metric_filter_pattern: str
    :ivar is_internal: Property to specify metric is internal or not.
    :vartype is_internal: bool
    """

    name: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """Name of metric specification."""
    display_name: Optional[str] = rest_field(
        name="displayName", visibility=["read", "create", "update", "delete", "query"]
    )
    """Display name of metric specification."""
    display_description: Optional[str] = rest_field(
        name="displayDescription", visibility=["read", "create", "update", "delete", "query"]
    )
    """Display description of metric specification."""
    unit: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """The metric unit. Possible values include: 'Bytes', 'Count', 'Milliseconds'."""
    aggregation_type: Optional[str] = rest_field(
        name="aggregationType", visibility=["read", "create", "update", "delete", "query"]
    )
    """The metric aggregation type. Possible values include: 'Average', 'Count', 'Total'."""
    availabilities: Optional[list["_models.MetricAvailability"]] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """Retention policies of a resource metric."""
    supported_time_grain_types: Optional[list[str]] = rest_field(
        name="supportedTimeGrainTypes", visibility=["read", "create", "update", "delete", "query"]
    )
    """The supported time grain types for the metrics."""
    dimensions: Optional[list["_models.DimensionProperties"]] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """The dimensions of metric."""
    fill_gap_with_zero: Optional[bool] = rest_field(
        name="fillGapWithZero", visibility=["read", "create", "update", "delete", "query"]
    )
    """Property to specify whether to fill gap with zero."""
    metric_filter_pattern: Optional[str] = rest_field(
        name="metricFilterPattern", visibility=["read", "create", "update", "delete", "query"]
    )
    """Pattern to filter based on name."""
    is_internal: Optional[bool] = rest_field(
        name="isInternal", visibility=["read", "create", "update", "delete", "query"]
    )
    """Property to specify metric is internal or not."""

    @overload
    def __init__(
        self,
        *,
        name: Optional[str] = None,
        display_name: Optional[str] = None,
        display_description: Optional[str] = None,
        unit: Optional[str] = None,
        aggregation_type: Optional[str] = None,
        availabilities: Optional[list["_models.MetricAvailability"]] = None,
        supported_time_grain_types: Optional[list[str]] = None,
        dimensions: Optional[list["_models.DimensionProperties"]] = None,
        fill_gap_with_zero: Optional[bool] = None,
        metric_filter_pattern: Optional[str] = None,
        is_internal: 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 MetricsResponse(_Model):
    """Metrics Response.

    :ivar date_time_begin:
    :vartype date_time_begin: ~datetime.datetime
    :ivar date_time_end:
    :vartype date_time_end: ~datetime.datetime
    :ivar granularity: Known values are: "PT5M", "PT1H", and "P1D".
    :vartype granularity: str or ~azure.mgmt.cdn.models.MetricsGranularity
    :ivar series:
    :vartype series: list[~azure.mgmt.cdn.models.MetricsResponseSeriesItem]
    """

    date_time_begin: Optional[datetime.datetime] = rest_field(
        name="dateTimeBegin", visibility=["read", "create", "update", "delete", "query"], format="rfc3339"
    )
    date_time_end: Optional[datetime.datetime] = rest_field(
        name="dateTimeEnd", visibility=["read", "create", "update", "delete", "query"], format="rfc3339"
    )
    granularity: Optional[Union[str, "_models.MetricsGranularity"]] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """Known values are: \"PT5M\", \"PT1H\", and \"P1D\"."""
    series: Optional[list["_models.MetricsResponseSeriesItem"]] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )

    @overload
    def __init__(
        self,
        *,
        date_time_begin: Optional[datetime.datetime] = None,
        date_time_end: Optional[datetime.datetime] = None,
        granularity: Optional[Union[str, "_models.MetricsGranularity"]] = None,
        series: Optional[list["_models.MetricsResponseSeriesItem"]] = None,
    ) -> None: ...

    @overload
    def __init__(self, mapping: Mapping[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 MetricsResponseSeriesItem(_Model):
    """MetricsResponseSeriesItem.

    :ivar metric:
    :vartype metric: str
    :ivar unit: Known values are: "count", "bytes", "bitsPerSecond", and "milliSeconds".
    :vartype unit: str or ~azure.mgmt.cdn.models.MetricsSeriesUnit
    :ivar groups:
    :vartype groups: list[~azure.mgmt.cdn.models.MetricsResponseSeriesPropertiesItemsItem]
    :ivar data:
    :vartype data:
     list[~azure.mgmt.cdn.models.Components1Gs0LlpSchemasMetricsresponsePropertiesSeriesItemsPropertiesDataItems]
    """

    metric: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    unit: Optional[Union[str, "_models.MetricsSeriesUnit"]] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """Known values are: \"count\", \"bytes\", \"bitsPerSecond\", and \"milliSeconds\"."""
    groups: Optional[list["_models.MetricsResponseSeriesPropertiesItemsItem"]] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    data: Optional[list["_models.Components1Gs0LlpSchemasMetricsresponsePropertiesSeriesItemsPropertiesDataItems"]] = (
        rest_field(visibility=["read", "create", "update", "delete", "query"])
    )

    @overload
    def __init__(
        self,
        *,
        metric: Optional[str] = None,
        unit: Optional[Union[str, "_models.MetricsSeriesUnit"]] = None,
        groups: Optional[list["_models.MetricsResponseSeriesPropertiesItemsItem"]] = None,
        data: Optional[
            list["_models.Components1Gs0LlpSchemasMetricsresponsePropertiesSeriesItemsPropertiesDataItems"]
        ] = None,
    ) -> None: ...

    @overload
    def __init__(self, mapping: Mapping[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 MetricsResponseSeriesPropertiesItemsItem(_Model):
    """MetricsResponseSeriesPropertiesItemsItem.

    :ivar name:
    :vartype name: str
    :ivar value:
    :vartype value: str
    """

    name: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    value: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])

    @overload
    def __init__(
        self,
        *,
        name: 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 MigrateResult(_Model):
    """Result for migrate operation.

    :ivar id: Resource ID.
    :vartype id: str
    :ivar type: Resource type.
    :vartype type: str
    :ivar properties:
    :vartype properties: ~azure.mgmt.cdn.models.MigrateResultProperties
    """

    id: Optional[str] = rest_field(visibility=["read"])
    """Resource ID."""
    type: Optional[str] = rest_field(visibility=["read"])
    """Resource type."""
    properties: Optional["_models.MigrateResultProperties"] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )

    __flattened_items = ["migrated_profile_resource_id"]

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

    @overload
    def __init__(self, mapping: Mapping[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 MigrateResultProperties(_Model):
    """MigrateResultProperties.

    :ivar migrated_profile_resource_id: Arm resource id of the migrated profile.
    :vartype migrated_profile_resource_id: ~azure.mgmt.cdn.models.ResourceReference
    """

    migrated_profile_resource_id: Optional["_models.ResourceReference"] = rest_field(
        name="migratedProfileResourceId", visibility=["read"]
    )
    """Arm resource id of the migrated profile."""


class MigrationEndpointMapping(_Model):
    """CDN Endpoint Mapping.

    :ivar migrated_from: Name of the classic CDN profile endpoint.
    :vartype migrated_from: str
    :ivar migrated_to: Name of the newly created migrated Azure Frontdoor Standard/Premium profile
     endpoint. This name will replace the name of the classic CDN endpoint resource.
    :vartype migrated_to: str
    """

    migrated_from: Optional[str] = rest_field(
        name="migratedFrom", visibility=["read", "create", "update", "delete", "query"]
    )
    """Name of the classic CDN profile endpoint."""
    migrated_to: Optional[str] = rest_field(
        name="migratedTo", visibility=["read", "create", "update", "delete", "query"]
    )
    """Name of the newly created migrated Azure Frontdoor Standard/Premium profile endpoint. This name
     will replace the name of the classic CDN endpoint resource."""

    @overload
    def __init__(
        self,
        *,
        migrated_from: Optional[str] = None,
        migrated_to: 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 MigrationErrorType(_Model):
    """Error response indicates CDN service is not able to process the incoming request. The reason is
    provided in the error message.

    :ivar code: Error code.
    :vartype code: str
    :ivar resource_name: Resource which has the problem.
    :vartype resource_name: str
    :ivar error_message: Error message indicating why the operation failed.
    :vartype error_message: str
    :ivar next_steps: Describes what needs to be done to fix the problem.
    :vartype next_steps: str
    """

    code: Optional[str] = rest_field(visibility=["read"])
    """Error code."""
    resource_name: Optional[str] = rest_field(name="resourceName", visibility=["read"])
    """Resource which has the problem."""
    error_message: Optional[str] = rest_field(name="errorMessage", visibility=["read"])
    """Error message indicating why the operation failed."""
    next_steps: Optional[str] = rest_field(name="nextSteps", visibility=["read"])
    """Describes what needs to be done to fix the problem."""


class MigrationParameters(_Model):
    """Request body for Migrate operation.

    :ivar sku: Sku for the migration. Required.
    :vartype sku: ~azure.mgmt.cdn.models.Sku
    :ivar classic_resource_reference: Resource reference of the classic cdn profile or classic
     frontdoor that need to be migrated. Required.
    :vartype classic_resource_reference: ~azure.mgmt.cdn.models.ResourceReference
    :ivar profile_name: Name of the new profile that need to be created. Required.
    :vartype profile_name: str
    :ivar migration_web_application_firewall_mappings: Waf mapping for the migrated profile.
    :vartype migration_web_application_firewall_mappings:
     list[~azure.mgmt.cdn.models.MigrationWebApplicationFirewallMapping]
    """

    sku: "_models.Sku" = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """Sku for the migration. Required."""
    classic_resource_reference: "_models.ResourceReference" = rest_field(
        name="classicResourceReference", visibility=["read", "create", "update", "delete", "query"]
    )
    """Resource reference of the classic cdn profile or classic frontdoor that need to be migrated.
     Required."""
    profile_name: str = rest_field(name="profileName", visibility=["read", "create", "update", "delete", "query"])
    """Name of the new profile that need to be created. Required."""
    migration_web_application_firewall_mappings: Optional[list["_models.MigrationWebApplicationFirewallMapping"]] = (
        rest_field(
            name="migrationWebApplicationFirewallMappings", visibility=["read", "create", "update", "delete", "query"]
        )
    )
    """Waf mapping for the migrated profile."""

    @overload
    def __init__(
        self,
        *,
        sku: "_models.Sku",
        classic_resource_reference: "_models.ResourceReference",
        profile_name: str,
        migration_web_application_firewall_mappings: Optional[
            list["_models.MigrationWebApplicationFirewallMapping"]
        ] = None,
    ) -> None: ...

    @overload
    def __init__(self, mapping: Mapping[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 MigrationWebApplicationFirewallMapping(_Model):
    """Web Application Firewall Mapping.

    :ivar migrated_from: Migration From Waf policy.
    :vartype migrated_from: ~azure.mgmt.cdn.models.ResourceReference
    :ivar migrated_to: Migration to Waf policy.
    :vartype migrated_to: ~azure.mgmt.cdn.models.ResourceReference
    """

    migrated_from: Optional["_models.ResourceReference"] = rest_field(
        name="migratedFrom", visibility=["read", "create", "update", "delete", "query"]
    )
    """Migration From Waf policy."""
    migrated_to: Optional["_models.ResourceReference"] = rest_field(
        name="migratedTo", visibility=["read", "create", "update", "delete", "query"]
    )
    """Migration to Waf policy."""

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

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

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


class Operation(_Model):
    """CDN REST API operation.

    :ivar name: Operation name: {provider}/{resource}/{operation}.
    :vartype name: str
    :ivar is_data_action: Indicates whether the operation is a data action.
    :vartype is_data_action: bool
    :ivar display: The object that represents the operation.
    :vartype display: ~azure.mgmt.cdn.models.OperationDisplay
    :ivar origin: The origin of operations.
    :vartype origin: str
    :ivar operation_properties: Properties of operation, include metric specifications.
    :vartype operation_properties: ~azure.mgmt.cdn.models.OperationProperties
    """

    name: Optional[str] = rest_field(visibility=["read"])
    """Operation name: {provider}/{resource}/{operation}."""
    is_data_action: Optional[bool] = rest_field(
        name="isDataAction", visibility=["read", "create", "update", "delete", "query"]
    )
    """Indicates whether the operation is a data action."""
    display: Optional["_models.OperationDisplay"] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """The object that represents the operation."""
    origin: Optional[str] = rest_field(visibility=["read"])
    """The origin of operations."""
    operation_properties: Optional["_models.OperationProperties"] = rest_field(
        name="properties", visibility=["read", "create", "update", "delete", "query"]
    )
    """Properties of operation, include metric specifications."""

    __flattened_items = ["service_specification"]

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

    @overload
    def __init__(self, mapping: Mapping[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.operation_properties is None:
                return None
            return getattr(self.operation_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.operation_properties is None:
                self.operation_properties = self._attr_to_rest_field["operation_properties"]._class_type()
            setattr(self.operation_properties, key, value)
        else:
            super().__setattr__(key, value)


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

    :ivar provider: Service provider: Microsoft.Cdn.
    :vartype provider: str
    :ivar resource: Resource on which the operation is performed: Profile, endpoint, etc.
    :vartype resource: str
    :ivar operation: Operation type: Read, write, delete, etc.
    :vartype operation: str
    :ivar description: Description of operation.
    :vartype description: str
    """

    provider: Optional[str] = rest_field(visibility=["read"])
    """Service provider: Microsoft.Cdn."""
    resource: Optional[str] = rest_field(visibility=["read"])
    """Resource on which the operation is performed: Profile, endpoint, etc."""
    operation: Optional[str] = rest_field(visibility=["read"])
    """Operation type: Read, write, delete, etc."""
    description: Optional[str] = rest_field(visibility=["read"])
    """Description of operation."""


class OperationProperties(_Model):
    """Properties of operation, include metric specifications.

    :ivar service_specification: One property of operation, include metric specifications.
    :vartype service_specification: ~azure.mgmt.cdn.models.ServiceSpecification
    """

    service_specification: Optional["_models.ServiceSpecification"] = rest_field(
        name="serviceSpecification", visibility=["read", "create", "update", "delete", "query"]
    )
    """One property of operation, include metric specifications."""

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

    @overload
    def __init__(self, mapping: Mapping[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 Origin(ProxyResource):
    """CDN origin is the source of the content being delivered via CDN. When the edge nodes
    represented by an endpoint do not have the requested content cached, they attempt to fetch it
    from one or more of the configured origins.

    :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.cdn.models.SystemData
    :ivar properties: The JSON object that contains the properties of the origin.
    :vartype properties: ~azure.mgmt.cdn.models.OriginProperties
    """

    properties: Optional["_models.OriginProperties"] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """The JSON object that contains the properties of the origin."""

    __flattened_items = [
        "http_port",
        "https_port",
        "origin_host_header",
        "priority",
        "weight",
        "enabled",
        "private_link_alias",
        "private_link_resource_id",
        "private_link_location",
        "private_link_approval_message",
        "resource_state",
        "provisioning_state",
        "private_endpoint_status",
        "host_name",
    ]

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

    @overload
    def __init__(self, mapping: Mapping[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 OriginAuthenticationProperties(_Model):
    """The JSON object that contains the properties of the origin authentication settings.

    :ivar type: The type of the authentication for the origin. Known values are:
     "SystemAssignedIdentity" and "UserAssignedIdentity".
    :vartype type: str or ~azure.mgmt.cdn.models.OriginAuthenticationType
    :ivar user_assigned_identity: The user assigned managed identity to use for the origin
     authentication if type is UserAssignedIdentity.
    :vartype user_assigned_identity: ~azure.mgmt.cdn.models.ResourceReference
    :ivar scope: The scope used when requesting token from Microsoft Entra. For example, for Azure
     Blob Storage, scope could be "`https://storage.azure.com/.default
     <https://storage.azure.com/.default>`_".
    :vartype scope: str
    """

    type: Optional[Union[str, "_models.OriginAuthenticationType"]] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """The type of the authentication for the origin. Known values are: \"SystemAssignedIdentity\" and
     \"UserAssignedIdentity\"."""
    user_assigned_identity: Optional["_models.ResourceReference"] = rest_field(
        name="userAssignedIdentity", visibility=["read", "create", "update", "delete", "query"]
    )
    """The user assigned managed identity to use for the origin authentication if type is
     UserAssignedIdentity."""
    scope: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """The scope used when requesting token from Microsoft Entra. For example, for Azure Blob Storage,
     scope could be \"`https://storage.azure.com/.default <https://storage.azure.com/.default>`_\"."""

    @overload
    def __init__(
        self,
        *,
        type: Optional[Union[str, "_models.OriginAuthenticationType"]] = None,
        user_assigned_identity: Optional["_models.ResourceReference"] = None,
        scope: 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 OriginGroup(ProxyResource):
    """Origin group comprising of origins is used for load balancing to origins when the content
    cannot be served from CDN.

    :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.cdn.models.SystemData
    :ivar properties: The JSON object that contains the properties of the origin group.
    :vartype properties: ~azure.mgmt.cdn.models.OriginGroupProperties
    """

    properties: Optional["_models.OriginGroupProperties"] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """The JSON object that contains the properties of the origin group."""

    __flattened_items = [
        "health_probe_settings",
        "origins",
        "traffic_restoration_time_to_healed_or_new_endpoints_in_minutes",
        "response_based_origin_error_detection_settings",
        "resource_state",
        "provisioning_state",
    ]

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

    @overload
    def __init__(self, mapping: Mapping[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 OriginGroupOverride(_Model):
    """Defines the parameters for the origin group override configuration.

    :ivar origin_group: defines the OriginGroup that would override the DefaultOriginGroup on
     route.
    :vartype origin_group: ~azure.mgmt.cdn.models.ResourceReference
    :ivar forwarding_protocol: Protocol this rule will use when forwarding traffic to backends.
     Known values are: "HttpOnly", "HttpsOnly", and "MatchRequest".
    :vartype forwarding_protocol: str or ~azure.mgmt.cdn.models.ForwardingProtocol
    """

    origin_group: Optional["_models.ResourceReference"] = rest_field(
        name="originGroup", visibility=["read", "create", "update", "delete", "query"]
    )
    """defines the OriginGroup that would override the DefaultOriginGroup on route."""
    forwarding_protocol: Optional[Union[str, "_models.ForwardingProtocol"]] = rest_field(
        name="forwardingProtocol", visibility=["read", "create", "update", "delete", "query"]
    )
    """Protocol this rule will use when forwarding traffic to backends. Known values are:
     \"HttpOnly\", \"HttpsOnly\", and \"MatchRequest\"."""

    @overload
    def __init__(
        self,
        *,
        origin_group: Optional["_models.ResourceReference"] = None,
        forwarding_protocol: Optional[Union[str, "_models.ForwardingProtocol"]] = None,
    ) -> None: ...

    @overload
    def __init__(self, mapping: Mapping[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 OriginGroupOverrideAction(DeliveryRuleAction, discriminator="OriginGroupOverride"):
    """Defines the origin group override action for the delivery rule.

    :ivar parameters: Defines the parameters for the action. Required.
    :vartype parameters: ~azure.mgmt.cdn.models.OriginGroupOverrideActionParameters
    :ivar name: The name of the action for the delivery rule. Required. ORIGIN_GROUP_OVERRIDE.
    :vartype name: str or ~azure.mgmt.cdn.models.ORIGIN_GROUP_OVERRIDE
    """

    parameters: "_models.OriginGroupOverrideActionParameters" = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """Defines the parameters for the action. Required."""
    name: Literal[DeliveryRuleActionEnum.ORIGIN_GROUP_OVERRIDE] = rest_discriminator(name="name", visibility=["read", "create", "update", "delete", "query"])  # type: ignore
    """The name of the action for the delivery rule. Required. ORIGIN_GROUP_OVERRIDE."""

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

    @overload
    def __init__(self, mapping: Mapping[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.name = DeliveryRuleActionEnum.ORIGIN_GROUP_OVERRIDE  # type: ignore


class OriginGroupOverrideActionParameters(
    DeliveryRuleActionParameters, discriminator="DeliveryRuleOriginGroupOverrideActionParameters"
):
    """Defines the parameters for the origin group override action.

    :ivar origin_group: defines the OriginGroup that would override the DefaultOriginGroup.
     Required.
    :vartype origin_group: ~azure.mgmt.cdn.models.ResourceReference
    :ivar type_name: Required. DELIVERY_RULE_ORIGIN_GROUP_OVERRIDE_ACTION_PARAMETERS.
    :vartype type_name: str or
     ~azure.mgmt.cdn.models.DELIVERY_RULE_ORIGIN_GROUP_OVERRIDE_ACTION_PARAMETERS
    """

    origin_group: "_models.ResourceReference" = rest_field(
        name="originGroup", visibility=["read", "create", "update", "delete", "query"]
    )
    """defines the OriginGroup that would override the DefaultOriginGroup. Required."""
    type_name: Literal[DeliveryRuleActionParametersType.DELIVERY_RULE_ORIGIN_GROUP_OVERRIDE_ACTION_PARAMETERS] = rest_discriminator(name="typeName", visibility=["read", "create", "update", "delete", "query"])  # type: ignore
    """Required. DELIVERY_RULE_ORIGIN_GROUP_OVERRIDE_ACTION_PARAMETERS."""

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

    @overload
    def __init__(self, mapping: Mapping[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.type_name = DeliveryRuleActionParametersType.DELIVERY_RULE_ORIGIN_GROUP_OVERRIDE_ACTION_PARAMETERS  # type: ignore


class OriginGroupUpdatePropertiesParameters(_Model):
    """The JSON object that contains the properties of the origin group.

    :ivar health_probe_settings: Health probe settings to the origin that is used to determine the
     health of the origin.
    :vartype health_probe_settings: ~azure.mgmt.cdn.models.HealthProbeParameters
    :ivar origins: The source of the content being delivered via CDN within given origin group.
    :vartype origins: list[~azure.mgmt.cdn.models.ResourceReference]
    :ivar traffic_restoration_time_to_healed_or_new_endpoints_in_minutes: Time in minutes to shift
     the traffic to the endpoint gradually when an unhealthy endpoint comes healthy or a new
     endpoint is added. Default is 10 mins. This property is currently not supported.
    :vartype traffic_restoration_time_to_healed_or_new_endpoints_in_minutes: int
    :ivar response_based_origin_error_detection_settings: The JSON object that contains the
     properties to determine origin health using real requests/responses. This property is currently
     not supported.
    :vartype response_based_origin_error_detection_settings:
     ~azure.mgmt.cdn.models.ResponseBasedOriginErrorDetectionParameters
    """

    health_probe_settings: Optional["_models.HealthProbeParameters"] = rest_field(
        name="healthProbeSettings", visibility=["read", "create", "update", "delete", "query"]
    )
    """Health probe settings to the origin that is used to determine the health of the origin."""
    origins: Optional[list["_models.ResourceReference"]] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """The source of the content being delivered via CDN within given origin group."""
    traffic_restoration_time_to_healed_or_new_endpoints_in_minutes: Optional[int] = rest_field(
        name="trafficRestorationTimeToHealedOrNewEndpointsInMinutes",
        visibility=["read", "create", "update", "delete", "query"],
    )
    """Time in minutes to shift the traffic to the endpoint gradually when an unhealthy endpoint comes
     healthy or a new endpoint is added. Default is 10 mins. This property is currently not
     supported."""
    response_based_origin_error_detection_settings: Optional["_models.ResponseBasedOriginErrorDetectionParameters"] = (
        rest_field(
            name="responseBasedOriginErrorDetectionSettings", visibility=["read", "create", "update", "delete", "query"]
        )
    )
    """The JSON object that contains the properties to determine origin health using real
     requests/responses. This property is currently not supported."""

    @overload
    def __init__(
        self,
        *,
        health_probe_settings: Optional["_models.HealthProbeParameters"] = None,
        origins: Optional[list["_models.ResourceReference"]] = None,
        traffic_restoration_time_to_healed_or_new_endpoints_in_minutes: Optional[int] = None,
        response_based_origin_error_detection_settings: Optional[
            "_models.ResponseBasedOriginErrorDetectionParameters"
        ] = None,
    ) -> None: ...

    @overload
    def __init__(self, mapping: Mapping[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 OriginGroupProperties(OriginGroupUpdatePropertiesParameters):
    """The JSON object that contains the properties of the origin group.

    :ivar health_probe_settings: Health probe settings to the origin that is used to determine the
     health of the origin.
    :vartype health_probe_settings: ~azure.mgmt.cdn.models.HealthProbeParameters
    :ivar origins: The source of the content being delivered via CDN within given origin group.
    :vartype origins: list[~azure.mgmt.cdn.models.ResourceReference]
    :ivar traffic_restoration_time_to_healed_or_new_endpoints_in_minutes: Time in minutes to shift
     the traffic to the endpoint gradually when an unhealthy endpoint comes healthy or a new
     endpoint is added. Default is 10 mins. This property is currently not supported.
    :vartype traffic_restoration_time_to_healed_or_new_endpoints_in_minutes: int
    :ivar response_based_origin_error_detection_settings: The JSON object that contains the
     properties to determine origin health using real requests/responses. This property is currently
     not supported.
    :vartype response_based_origin_error_detection_settings:
     ~azure.mgmt.cdn.models.ResponseBasedOriginErrorDetectionParameters
    :ivar resource_state: Resource status of the origin group. Known values are: "Creating",
     "Active", and "Deleting".
    :vartype resource_state: str or ~azure.mgmt.cdn.models.OriginGroupResourceState
    :ivar provisioning_state: Provisioning status of the origin group. Known values are:
     "Succeeded", "Failed", "Updating", "Deleting", and "Creating".
    :vartype provisioning_state: str or ~azure.mgmt.cdn.models.OriginGroupProvisioningState
    """

    resource_state: Optional[Union[str, "_models.OriginGroupResourceState"]] = rest_field(
        name="resourceState", visibility=["read"]
    )
    """Resource status of the origin group. Known values are: \"Creating\", \"Active\", and
     \"Deleting\"."""
    provisioning_state: Optional[Union[str, "_models.OriginGroupProvisioningState"]] = rest_field(
        name="provisioningState", visibility=["read"]
    )
    """Provisioning status of the origin group. Known values are: \"Succeeded\", \"Failed\",
     \"Updating\", \"Deleting\", and \"Creating\"."""

    @overload
    def __init__(
        self,
        *,
        health_probe_settings: Optional["_models.HealthProbeParameters"] = None,
        origins: Optional[list["_models.ResourceReference"]] = None,
        traffic_restoration_time_to_healed_or_new_endpoints_in_minutes: Optional[int] = None,
        response_based_origin_error_detection_settings: Optional[
            "_models.ResponseBasedOriginErrorDetectionParameters"
        ] = None,
    ) -> None: ...

    @overload
    def __init__(self, mapping: Mapping[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 OriginGroupUpdateParameters(_Model):
    """Origin group properties needed for origin group creation or update.

    :ivar properties: The JSON object that contains the properties of the origin group.
    :vartype properties: ~azure.mgmt.cdn.models.OriginGroupUpdatePropertiesParameters
    """

    properties: Optional["_models.OriginGroupUpdatePropertiesParameters"] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """The JSON object that contains the properties of the origin group."""

    __flattened_items = [
        "health_probe_settings",
        "origins",
        "traffic_restoration_time_to_healed_or_new_endpoints_in_minutes",
        "response_based_origin_error_detection_settings",
    ]

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

    @overload
    def __init__(self, mapping: Mapping[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 OriginUpdatePropertiesParameters(_Model):
    """The JSON object that contains the properties of the origin.

    :ivar host_name: The address of the origin. Domain names, IPv4 addresses, and IPv6 addresses
     are supported.This should be unique across all origins in an endpoint.
    :vartype host_name: str
    :ivar http_port: The value of the HTTP port. Must be between 1 and 65535.
    :vartype http_port: int
    :ivar https_port: The value of the HTTPS port. Must be between 1 and 65535.
    :vartype https_port: int
    :ivar origin_host_header: The host header value sent to the origin with each request. If you
     leave this blank, the request hostname determines this value. Azure CDN origins, such as Web
     Apps, Blob Storage, and Cloud Services require this host header value to match the origin
     hostname by default. This overrides the host header defined at Endpoint.
    :vartype origin_host_header: str
    :ivar priority: Priority of origin in given origin group for load balancing. Higher priorities
     will not be used for load balancing if any lower priority origin is healthy.Must be between 1
     and 5.
    :vartype priority: int
    :ivar weight: Weight of the origin in given origin group for load balancing. Must be between 1
     and 1000.
    :vartype weight: int
    :ivar enabled: Origin is enabled for load balancing or not.
    :vartype enabled: bool
    :ivar private_link_alias: The Alias of the Private Link resource. Populating this optional
     field indicates that this origin is 'Private'.
    :vartype private_link_alias: str
    :ivar private_link_resource_id: The Resource Id of the Private Link resource. Populating this
     optional field indicates that this backend is 'Private'.
    :vartype private_link_resource_id: str
    :ivar private_link_location: The location of the Private Link resource. Required only if
     'privateLinkResourceId' is populated.
    :vartype private_link_location: str
    :ivar private_link_approval_message: A custom message to be included in the approval request to
     connect to the Private Link.
    :vartype private_link_approval_message: str
    """

    host_name: Optional[str] = rest_field(name="hostName", visibility=["read", "create", "update", "delete", "query"])
    """The address of the origin. Domain names, IPv4 addresses, and IPv6 addresses are supported.This
     should be unique across all origins in an endpoint."""
    http_port: Optional[int] = rest_field(name="httpPort", visibility=["read", "create", "update", "delete", "query"])
    """The value of the HTTP port. Must be between 1 and 65535."""
    https_port: Optional[int] = rest_field(name="httpsPort", visibility=["read", "create", "update", "delete", "query"])
    """The value of the HTTPS port. Must be between 1 and 65535."""
    origin_host_header: Optional[str] = rest_field(
        name="originHostHeader", visibility=["read", "create", "update", "delete", "query"]
    )
    """The host header value sent to the origin with each request. If you leave this blank, the
     request hostname determines this value. Azure CDN origins, such as Web Apps, Blob Storage, and
     Cloud Services require this host header value to match the origin hostname by default. This
     overrides the host header defined at Endpoint."""
    priority: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """Priority of origin in given origin group for load balancing. Higher priorities will not be used
     for load balancing if any lower priority origin is healthy.Must be between 1 and 5."""
    weight: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """Weight of the origin in given origin group for load balancing. Must be between 1 and 1000."""
    enabled: Optional[bool] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """Origin is enabled for load balancing or not."""
    private_link_alias: Optional[str] = rest_field(
        name="privateLinkAlias", visibility=["read", "create", "update", "delete", "query"]
    )
    """The Alias of the Private Link resource. Populating this optional field indicates that this
     origin is 'Private'."""
    private_link_resource_id: Optional[str] = rest_field(
        name="privateLinkResourceId", visibility=["read", "create", "update", "delete", "query"]
    )
    """The Resource Id of the Private Link resource. Populating this optional field indicates that
     this backend is 'Private'."""
    private_link_location: Optional[str] = rest_field(
        name="privateLinkLocation", visibility=["read", "create", "update", "delete", "query"]
    )
    """The location of the Private Link resource. Required only if 'privateLinkResourceId' is
     populated."""
    private_link_approval_message: Optional[str] = rest_field(
        name="privateLinkApprovalMessage", visibility=["read", "create", "update", "delete", "query"]
    )
    """A custom message to be included in the approval request to connect to the Private Link."""

    @overload
    def __init__(
        self,
        *,
        host_name: Optional[str] = None,
        http_port: Optional[int] = None,
        https_port: Optional[int] = None,
        origin_host_header: Optional[str] = None,
        priority: Optional[int] = None,
        weight: Optional[int] = None,
        enabled: Optional[bool] = None,
        private_link_alias: Optional[str] = None,
        private_link_resource_id: Optional[str] = None,
        private_link_location: Optional[str] = None,
        private_link_approval_message: Optional[str] = None,
    ) -> None: ...

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

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


class OriginProperties(OriginUpdatePropertiesParameters):
    """The JSON object that contains the properties of the origin.

    :ivar http_port: The value of the HTTP port. Must be between 1 and 65535.
    :vartype http_port: int
    :ivar https_port: The value of the HTTPS port. Must be between 1 and 65535.
    :vartype https_port: int
    :ivar origin_host_header: The host header value sent to the origin with each request. If you
     leave this blank, the request hostname determines this value. Azure CDN origins, such as Web
     Apps, Blob Storage, and Cloud Services require this host header value to match the origin
     hostname by default. This overrides the host header defined at Endpoint.
    :vartype origin_host_header: str
    :ivar priority: Priority of origin in given origin group for load balancing. Higher priorities
     will not be used for load balancing if any lower priority origin is healthy.Must be between 1
     and 5.
    :vartype priority: int
    :ivar weight: Weight of the origin in given origin group for load balancing. Must be between 1
     and 1000.
    :vartype weight: int
    :ivar enabled: Origin is enabled for load balancing or not.
    :vartype enabled: bool
    :ivar private_link_alias: The Alias of the Private Link resource. Populating this optional
     field indicates that this origin is 'Private'.
    :vartype private_link_alias: str
    :ivar private_link_resource_id: The Resource Id of the Private Link resource. Populating this
     optional field indicates that this backend is 'Private'.
    :vartype private_link_resource_id: str
    :ivar private_link_location: The location of the Private Link resource. Required only if
     'privateLinkResourceId' is populated.
    :vartype private_link_location: str
    :ivar private_link_approval_message: A custom message to be included in the approval request to
     connect to the Private Link.
    :vartype private_link_approval_message: str
    :ivar resource_state: Resource status of the origin. Known values are: "Creating", "Active",
     and "Deleting".
    :vartype resource_state: str or ~azure.mgmt.cdn.models.OriginResourceState
    :ivar provisioning_state: Provisioning status of the origin. Known values are: "Succeeded",
     "Failed", "Updating", "Deleting", and "Creating".
    :vartype provisioning_state: str or ~azure.mgmt.cdn.models.OriginProvisioningState
    :ivar private_endpoint_status: The approval status for the connection to the Private Link.
     Known values are: "Pending", "Approved", "Rejected", "Disconnected", and "Timeout".
    :vartype private_endpoint_status: str or ~azure.mgmt.cdn.models.PrivateEndpointStatus
    :ivar host_name: The address of the origin. Domain names, IPv4 addresses, and IPv6 addresses
     are supported.This should be unique across all origins in an endpoint. Required.
    :vartype host_name: str
    """

    resource_state: Optional[Union[str, "_models.OriginResourceState"]] = rest_field(
        name="resourceState", visibility=["read"]
    )
    """Resource status of the origin. Known values are: \"Creating\", \"Active\", and \"Deleting\"."""
    provisioning_state: Optional[Union[str, "_models.OriginProvisioningState"]] = rest_field(
        name="provisioningState", visibility=["read"]
    )
    """Provisioning status of the origin. Known values are: \"Succeeded\", \"Failed\", \"Updating\",
     \"Deleting\", and \"Creating\"."""
    private_endpoint_status: Optional[Union[str, "_models.PrivateEndpointStatus"]] = rest_field(
        name="privateEndpointStatus", visibility=["read"]
    )
    """The approval status for the connection to the Private Link. Known values are: \"Pending\",
     \"Approved\", \"Rejected\", \"Disconnected\", and \"Timeout\"."""
    host_name: str = rest_field(name="hostName", visibility=["read", "create", "update", "delete", "query"])
    """The address of the origin. Domain names, IPv4 addresses, and IPv6 addresses are supported.This
     should be unique across all origins in an endpoint. Required."""

    @overload
    def __init__(
        self,
        *,
        host_name: str,
        http_port: Optional[int] = None,
        https_port: Optional[int] = None,
        origin_host_header: Optional[str] = None,
        priority: Optional[int] = None,
        weight: Optional[int] = None,
        enabled: Optional[bool] = None,
        private_link_alias: Optional[str] = None,
        private_link_resource_id: Optional[str] = None,
        private_link_location: Optional[str] = None,
        private_link_approval_message: Optional[str] = None,
    ) -> None: ...

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

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


class OriginUpdateParameters(_Model):
    """Origin properties needed for origin update.

    :ivar properties: The JSON object that contains the properties of the origin.
    :vartype properties: ~azure.mgmt.cdn.models.OriginUpdatePropertiesParameters
    """

    properties: Optional["_models.OriginUpdatePropertiesParameters"] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """The JSON object that contains the properties of the origin."""

    __flattened_items = [
        "host_name",
        "http_port",
        "https_port",
        "origin_host_header",
        "priority",
        "weight",
        "enabled",
        "private_link_alias",
        "private_link_resource_id",
        "private_link_location",
        "private_link_approval_message",
    ]

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

    @overload
    def __init__(self, mapping: Mapping[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 PolicySettings(_Model):
    """Defines contents of a web application firewall global configuration.

    :ivar enabled_state: describes if the policy is in enabled state or disabled state. Known
     values are: "Disabled" and "Enabled".
    :vartype enabled_state: str or ~azure.mgmt.cdn.models.PolicyEnabledState
    :ivar mode: Describes if it is in detection mode or prevention mode at policy level. Known
     values are: "Prevention" and "Detection".
    :vartype mode: str or ~azure.mgmt.cdn.models.PolicyMode
    :ivar default_redirect_url: If action type is redirect, this field represents the default
     redirect URL for the client.
    :vartype default_redirect_url: str
    :ivar default_custom_block_response_status_code: If the action type is block, this field
     defines the default customer overridable http response status code. Known values are: 200, 403,
     405, 406, and 429.
    :vartype default_custom_block_response_status_code: int or
     ~azure.mgmt.cdn.models.PolicySettingsDefaultCustomBlockResponseStatusCode
    :ivar default_custom_block_response_body: If the action type is block, customer can override
     the response body. The body must be specified in base64 encoding.
    :vartype default_custom_block_response_body: str
    """

    enabled_state: Optional[Union[str, "_models.PolicyEnabledState"]] = rest_field(
        name="enabledState", visibility=["read", "create", "update", "delete", "query"]
    )
    """describes if the policy is in enabled state or disabled state. Known values are: \"Disabled\"
     and \"Enabled\"."""
    mode: Optional[Union[str, "_models.PolicyMode"]] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """Describes if it is in detection mode or prevention mode at policy level. Known values are:
     \"Prevention\" and \"Detection\"."""
    default_redirect_url: Optional[str] = rest_field(
        name="defaultRedirectUrl", visibility=["read", "create", "update", "delete", "query"]
    )
    """If action type is redirect, this field represents the default redirect URL for the client."""
    default_custom_block_response_status_code: Optional[
        Union[int, "_models.PolicySettingsDefaultCustomBlockResponseStatusCode"]
    ] = rest_field(
        name="defaultCustomBlockResponseStatusCode", visibility=["read", "create", "update", "delete", "query"]
    )
    """If the action type is block, this field defines the default customer overridable http response
     status code. Known values are: 200, 403, 405, 406, and 429."""
    default_custom_block_response_body: Optional[str] = rest_field(
        name="defaultCustomBlockResponseBody", visibility=["read", "create", "update", "delete", "query"]
    )
    """If the action type is block, customer can override the response body. The body must be
     specified in base64 encoding."""

    @overload
    def __init__(
        self,
        *,
        enabled_state: Optional[Union[str, "_models.PolicyEnabledState"]] = None,
        mode: Optional[Union[str, "_models.PolicyMode"]] = None,
        default_redirect_url: Optional[str] = None,
        default_custom_block_response_status_code: Optional[
            Union[int, "_models.PolicySettingsDefaultCustomBlockResponseStatusCode"]
        ] = None,
        default_custom_block_response_body: 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 PostArgsMatchConditionParameters(
    DeliveryRuleConditionParameters, discriminator="DeliveryRulePostArgsConditionParameters"
):
    """Defines the parameters for PostArgs match conditions.

    :ivar selector: Name of PostArg to be matched.
    :vartype selector: str
    :ivar operator: Describes operator to be matched. Required. Known values are: "Any", "Equal",
     "Contains", "BeginsWith", "EndsWith", "LessThan", "LessThanOrEqual", "GreaterThan",
     "GreaterThanOrEqual", and "RegEx".
    :vartype operator: str or ~azure.mgmt.cdn.models.PostArgsOperator
    :ivar negate_condition: Describes if this is negate condition or not.
    :vartype negate_condition: bool
    :ivar match_values: The match value for the condition of the delivery rule.
    :vartype match_values: list[str]
    :ivar transforms: List of transforms.
    :vartype transforms: list[str or ~azure.mgmt.cdn.models.Transform]
    :ivar type_name: Required. DELIVERY_RULE_POST_ARGS_CONDITION_PARAMETERS.
    :vartype type_name: str or ~azure.mgmt.cdn.models.DELIVERY_RULE_POST_ARGS_CONDITION_PARAMETERS
    """

    selector: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """Name of PostArg to be matched."""
    operator: Union[str, "_models.PostArgsOperator"] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """Describes operator to be matched. Required. Known values are: \"Any\", \"Equal\", \"Contains\",
     \"BeginsWith\", \"EndsWith\", \"LessThan\", \"LessThanOrEqual\", \"GreaterThan\",
     \"GreaterThanOrEqual\", and \"RegEx\"."""
    negate_condition: Optional[bool] = rest_field(
        name="negateCondition", visibility=["read", "create", "update", "delete", "query"]
    )
    """Describes if this is negate condition or not."""
    match_values: Optional[list[str]] = rest_field(
        name="matchValues", visibility=["read", "create", "update", "delete", "query"]
    )
    """The match value for the condition of the delivery rule."""
    transforms: Optional[list[Union[str, "_models.Transform"]]] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """List of transforms."""
    type_name: Literal[DeliveryRuleConditionParametersType.DELIVERY_RULE_POST_ARGS_CONDITION_PARAMETERS] = rest_discriminator(name="typeName", visibility=["read", "create", "update", "delete", "query"])  # type: ignore
    """Required. DELIVERY_RULE_POST_ARGS_CONDITION_PARAMETERS."""

    @overload
    def __init__(
        self,
        *,
        operator: Union[str, "_models.PostArgsOperator"],
        selector: Optional[str] = None,
        negate_condition: Optional[bool] = None,
        match_values: Optional[list[str]] = None,
        transforms: Optional[list[Union[str, "_models.Transform"]]] = None,
    ) -> None: ...

    @overload
    def __init__(self, mapping: Mapping[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.type_name = DeliveryRuleConditionParametersType.DELIVERY_RULE_POST_ARGS_CONDITION_PARAMETERS  # type: ignore


class Profile(TrackedResource):
    """A profile is a logical grouping of endpoints that share the same settings.

    :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.cdn.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: The JSON object that contains the properties required to create a profile.
    :vartype properties: ~azure.mgmt.cdn.models.ProfileProperties
    :ivar sku: The pricing tier (defines Azure Front Door Standard or Premium or a CDN provider,
     feature list and rate) of the profile. Required.
    :vartype sku: ~azure.mgmt.cdn.models.Sku
    :ivar kind: Kind of the profile. Used by portal to differentiate traditional CDN profile and
     new AFD profile.
    :vartype kind: str
    :ivar identity: The managed service identities assigned to this resource.
    :vartype identity: ~azure.mgmt.cdn.models.ManagedServiceIdentity
    """

    properties: Optional["_models.ProfileProperties"] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """The JSON object that contains the properties required to create a profile."""
    sku: "_models.Sku" = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """The pricing tier (defines Azure Front Door Standard or Premium or a CDN provider, feature list
     and rate) of the profile. Required."""
    kind: Optional[str] = rest_field(visibility=["read"])
    """Kind of the profile. Used by portal to differentiate traditional CDN profile and new AFD
     profile."""
    identity: Optional["_models.ManagedServiceIdentity"] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """The managed service identities assigned to this resource."""

    __flattened_items = [
        "resource_state",
        "provisioning_state",
        "extended_properties",
        "front_door_id",
        "origin_response_timeout_seconds",
        "log_scrubbing",
    ]

    @overload
    def __init__(
        self,
        *,
        location: str,
        sku: "_models.Sku",
        tags: Optional[dict[str, str]] = None,
        properties: Optional["_models.ProfileProperties"] = None,
        identity: Optional["_models.ManagedServiceIdentity"] = None,
    ) -> None: ...

    @overload
    def __init__(self, mapping: Mapping[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 ProfileChangeSkuWafMapping(_Model):
    """Parameters required for profile upgrade.

    :ivar security_policy_name: The security policy name. Required.
    :vartype security_policy_name: str
    :ivar change_to_waf_policy: The new waf resource for the security policy to use. Required.
    :vartype change_to_waf_policy: ~azure.mgmt.cdn.models.ResourceReference
    """

    security_policy_name: str = rest_field(
        name="securityPolicyName", visibility=["read", "create", "update", "delete", "query"]
    )
    """The security policy name. Required."""
    change_to_waf_policy: "_models.ResourceReference" = rest_field(
        name="changeToWafPolicy", visibility=["read", "create", "update", "delete", "query"]
    )
    """The new waf resource for the security policy to use. Required."""

    @overload
    def __init__(
        self,
        *,
        security_policy_name: str,
        change_to_waf_policy: "_models.ResourceReference",
    ) -> None: ...

    @overload
    def __init__(self, mapping: Mapping[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 ProfileLogScrubbing(_Model):
    """Defines rules that scrub sensitive fields in the Azure Front Door profile logs.

    :ivar state: State of the log scrubbing config. Default value is Enabled. Known values are:
     "Enabled" and "Disabled".
    :vartype state: str or ~azure.mgmt.cdn.models.ProfileScrubbingState
    :ivar scrubbing_rules: List of log scrubbing rules applied to the Azure Front Door profile
     logs.
    :vartype scrubbing_rules: list[~azure.mgmt.cdn.models.ProfileScrubbingRules]
    """

    state: Optional[Union[str, "_models.ProfileScrubbingState"]] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """State of the log scrubbing config. Default value is Enabled. Known values are: \"Enabled\" and
     \"Disabled\"."""
    scrubbing_rules: Optional[list["_models.ProfileScrubbingRules"]] = rest_field(
        name="scrubbingRules", visibility=["read", "create", "update", "delete", "query"]
    )
    """List of log scrubbing rules applied to the Azure Front Door profile logs."""

    @overload
    def __init__(
        self,
        *,
        state: Optional[Union[str, "_models.ProfileScrubbingState"]] = None,
        scrubbing_rules: Optional[list["_models.ProfileScrubbingRules"]] = None,
    ) -> None: ...

    @overload
    def __init__(self, mapping: Mapping[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 ProfileProperties(_Model):
    """The JSON object that contains the properties required to create a profile.

    :ivar resource_state: Resource status of the profile. Known values are: "Creating", "Active",
     "Deleting", "Disabled", "Migrating", "Migrated", "PendingMigrationCommit",
     "CommittingMigration", and "AbortingMigration".
    :vartype resource_state: str or ~azure.mgmt.cdn.models.ProfileResourceState
    :ivar provisioning_state: Provisioning status of the profile. Known values are: "Succeeded",
     "Failed", "Updating", "Deleting", and "Creating".
    :vartype provisioning_state: str or ~azure.mgmt.cdn.models.ProfileProvisioningState
    :ivar extended_properties: Key-Value pair representing additional properties for profiles.
    :vartype extended_properties: dict[str, str]
    :ivar front_door_id: The Id of the frontdoor.
    :vartype front_door_id: str
    :ivar origin_response_timeout_seconds: Send and receive timeout on forwarding request to the
     origin. When timeout is reached, the request fails and returns.
    :vartype origin_response_timeout_seconds: int
    :ivar log_scrubbing: Defines rules that scrub sensitive fields in the Azure Front Door profile
     logs.
    :vartype log_scrubbing: ~azure.mgmt.cdn.models.ProfileLogScrubbing
    """

    resource_state: Optional[Union[str, "_models.ProfileResourceState"]] = rest_field(
        name="resourceState", visibility=["read"]
    )
    """Resource status of the profile. Known values are: \"Creating\", \"Active\", \"Deleting\",
     \"Disabled\", \"Migrating\", \"Migrated\", \"PendingMigrationCommit\", \"CommittingMigration\",
     and \"AbortingMigration\"."""
    provisioning_state: Optional[Union[str, "_models.ProfileProvisioningState"]] = rest_field(
        name="provisioningState", visibility=["read"]
    )
    """Provisioning status of the profile. Known values are: \"Succeeded\", \"Failed\", \"Updating\",
     \"Deleting\", and \"Creating\"."""
    extended_properties: Optional[dict[str, str]] = rest_field(name="extendedProperties", visibility=["read"])
    """Key-Value pair representing additional properties for profiles."""
    front_door_id: Optional[str] = rest_field(name="frontDoorId", visibility=["read"])
    """The Id of the frontdoor."""
    origin_response_timeout_seconds: Optional[int] = rest_field(
        name="originResponseTimeoutSeconds", visibility=["read", "create", "update", "delete", "query"]
    )
    """Send and receive timeout on forwarding request to the origin. When timeout is reached, the
     request fails and returns."""
    log_scrubbing: Optional["_models.ProfileLogScrubbing"] = rest_field(
        name="logScrubbing", visibility=["read", "create", "update", "delete", "query"]
    )
    """Defines rules that scrub sensitive fields in the Azure Front Door profile logs."""

    @overload
    def __init__(
        self,
        *,
        origin_response_timeout_seconds: Optional[int] = None,
        log_scrubbing: Optional["_models.ProfileLogScrubbing"] = None,
    ) -> None: ...

    @overload
    def __init__(self, mapping: Mapping[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 ProfilePropertiesUpdateParameters(_Model):
    """The JSON object containing profile update parameters.

    :ivar origin_response_timeout_seconds: Send and receive timeout on forwarding request to the
     origin. When timeout is reached, the request fails and returns.
    :vartype origin_response_timeout_seconds: int
    :ivar log_scrubbing: Defines rules to scrub sensitive fields in logs.
    :vartype log_scrubbing: ~azure.mgmt.cdn.models.ProfileLogScrubbing
    """

    origin_response_timeout_seconds: Optional[int] = rest_field(
        name="originResponseTimeoutSeconds", visibility=["read", "create", "update", "delete", "query"]
    )
    """Send and receive timeout on forwarding request to the origin. When timeout is reached, the
     request fails and returns."""
    log_scrubbing: Optional["_models.ProfileLogScrubbing"] = rest_field(
        name="logScrubbing", visibility=["read", "create", "update", "delete", "query"]
    )
    """Defines rules to scrub sensitive fields in logs."""

    @overload
    def __init__(
        self,
        *,
        origin_response_timeout_seconds: Optional[int] = None,
        log_scrubbing: Optional["_models.ProfileLogScrubbing"] = None,
    ) -> None: ...

    @overload
    def __init__(self, mapping: Mapping[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 ProfileScrubbingRules(_Model):
    """Defines the contents of the log scrubbing rules.

    :ivar match_variable: The variable to be scrubbed from the logs. Required. Known values are:
     "RequestIPAddress", "RequestUri", and "QueryStringArgNames".
    :vartype match_variable: str or ~azure.mgmt.cdn.models.ScrubbingRuleEntryMatchVariable
    :ivar selector_match_operator: When matchVariable is a collection, operate on the selector to
     specify which elements in the collection this rule applies to. Required. "EqualsAny"
    :vartype selector_match_operator: str or ~azure.mgmt.cdn.models.ScrubbingRuleEntryMatchOperator
    :ivar selector: When matchVariable is a collection, operator used to specify which elements in
     the collection this rule applies to.
    :vartype selector: str
    :ivar state: Defines the state of a log scrubbing rule. Default value is enabled. Known values
     are: "Enabled" and "Disabled".
    :vartype state: str or ~azure.mgmt.cdn.models.ScrubbingRuleEntryState
    """

    match_variable: Union[str, "_models.ScrubbingRuleEntryMatchVariable"] = rest_field(
        name="matchVariable", visibility=["read", "create", "update", "delete", "query"]
    )
    """The variable to be scrubbed from the logs. Required. Known values are: \"RequestIPAddress\",
     \"RequestUri\", and \"QueryStringArgNames\"."""
    selector_match_operator: Union[str, "_models.ScrubbingRuleEntryMatchOperator"] = rest_field(
        name="selectorMatchOperator", visibility=["read", "create", "update", "delete", "query"]
    )
    """When matchVariable is a collection, operate on the selector to specify which elements in the
     collection this rule applies to. Required. \"EqualsAny\""""
    selector: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """When matchVariable is a collection, operator used to specify which elements in the collection
     this rule applies to."""
    state: Optional[Union[str, "_models.ScrubbingRuleEntryState"]] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """Defines the state of a log scrubbing rule. Default value is enabled. Known values are:
     \"Enabled\" and \"Disabled\"."""

    @overload
    def __init__(
        self,
        *,
        match_variable: Union[str, "_models.ScrubbingRuleEntryMatchVariable"],
        selector_match_operator: Union[str, "_models.ScrubbingRuleEntryMatchOperator"],
        selector: Optional[str] = None,
        state: Optional[Union[str, "_models.ScrubbingRuleEntryState"]] = None,
    ) -> None: ...

    @overload
    def __init__(self, mapping: Mapping[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 ProfileUpdateParameters(_Model):
    """Properties required to update a profile.

    :ivar tags: Profile tags.
    :vartype tags: dict[str, str]
    :ivar identity: Managed service identity (system assigned and/or user assigned identities).
    :vartype identity: ~azure.mgmt.cdn.models.ManagedServiceIdentity
    :ivar properties: The JSON object containing profile update parameters.
    :vartype properties: ~azure.mgmt.cdn.models.ProfilePropertiesUpdateParameters
    """

    tags: Optional[dict[str, str]] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """Profile tags."""
    identity: Optional["_models.ManagedServiceIdentity"] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """Managed service identity (system assigned and/or user assigned identities)."""
    properties: Optional["_models.ProfilePropertiesUpdateParameters"] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """The JSON object containing profile update parameters."""

    __flattened_items = ["origin_response_timeout_seconds", "log_scrubbing"]

    @overload
    def __init__(
        self,
        *,
        tags: Optional[dict[str, str]] = None,
        identity: Optional["_models.ManagedServiceIdentity"] = None,
        properties: Optional["_models.ProfilePropertiesUpdateParameters"] = None,
    ) -> None: ...

    @overload
    def __init__(self, mapping: Mapping[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 ProfileUpgradeParameters(_Model):
    """Parameters required for profile upgrade.

    :ivar waf_mapping_list: Web Application Firewall (WAF) and security policy mapping for the
     profile upgrade. Required.
    :vartype waf_mapping_list: list[~azure.mgmt.cdn.models.ProfileChangeSkuWafMapping]
    """

    waf_mapping_list: list["_models.ProfileChangeSkuWafMapping"] = rest_field(
        name="wafMappingList", visibility=["read", "create", "update", "delete", "query"]
    )
    """Web Application Firewall (WAF) and security policy mapping for the profile upgrade. Required."""

    @overload
    def __init__(
        self,
        *,
        waf_mapping_list: list["_models.ProfileChangeSkuWafMapping"],
    ) -> None: ...

    @overload
    def __init__(self, mapping: Mapping[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 PurgeParameters(_Model):
    """Parameters required for content purge.

    :ivar content_paths: The path to the content to be purged. Can describe a file path or a wild
     card directory. Required.
    :vartype content_paths: list[str]
    """

    content_paths: list[str] = rest_field(
        name="contentPaths", visibility=["read", "create", "update", "delete", "query"]
    )
    """The path to the content to be purged. Can describe a file path or a wild card directory.
     Required."""

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

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

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


class QueryStringMatchConditionParameters(
    DeliveryRuleConditionParameters, discriminator="DeliveryRuleQueryStringConditionParameters"
):
    """Defines the parameters for QueryString match conditions.

    :ivar operator: Describes operator to be matched. Required. Known values are: "Any", "Equal",
     "Contains", "BeginsWith", "EndsWith", "LessThan", "LessThanOrEqual", "GreaterThan",
     "GreaterThanOrEqual", and "RegEx".
    :vartype operator: str or ~azure.mgmt.cdn.models.QueryStringOperator
    :ivar negate_condition: Describes if this is negate condition or not.
    :vartype negate_condition: bool
    :ivar match_values: The match value for the condition of the delivery rule.
    :vartype match_values: list[str]
    :ivar transforms: List of transforms.
    :vartype transforms: list[str or ~azure.mgmt.cdn.models.Transform]
    :ivar type_name: Required. DELIVERY_RULE_QUERY_STRING_CONDITION_PARAMETERS.
    :vartype type_name: str or
     ~azure.mgmt.cdn.models.DELIVERY_RULE_QUERY_STRING_CONDITION_PARAMETERS
    """

    operator: Union[str, "_models.QueryStringOperator"] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """Describes operator to be matched. Required. Known values are: \"Any\", \"Equal\", \"Contains\",
     \"BeginsWith\", \"EndsWith\", \"LessThan\", \"LessThanOrEqual\", \"GreaterThan\",
     \"GreaterThanOrEqual\", and \"RegEx\"."""
    negate_condition: Optional[bool] = rest_field(
        name="negateCondition", visibility=["read", "create", "update", "delete", "query"]
    )
    """Describes if this is negate condition or not."""
    match_values: Optional[list[str]] = rest_field(
        name="matchValues", visibility=["read", "create", "update", "delete", "query"]
    )
    """The match value for the condition of the delivery rule."""
    transforms: Optional[list[Union[str, "_models.Transform"]]] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """List of transforms."""
    type_name: Literal[DeliveryRuleConditionParametersType.DELIVERY_RULE_QUERY_STRING_CONDITION_PARAMETERS] = rest_discriminator(name="typeName", visibility=["read", "create", "update", "delete", "query"])  # type: ignore
    """Required. DELIVERY_RULE_QUERY_STRING_CONDITION_PARAMETERS."""

    @overload
    def __init__(
        self,
        *,
        operator: Union[str, "_models.QueryStringOperator"],
        negate_condition: Optional[bool] = None,
        match_values: Optional[list[str]] = None,
        transforms: Optional[list[Union[str, "_models.Transform"]]] = None,
    ) -> None: ...

    @overload
    def __init__(self, mapping: Mapping[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.type_name = DeliveryRuleConditionParametersType.DELIVERY_RULE_QUERY_STRING_CONDITION_PARAMETERS  # type: ignore


class RankingsResponse(_Model):
    """Rankings Response.

    :ivar date_time_begin:
    :vartype date_time_begin: ~datetime.datetime
    :ivar date_time_end:
    :vartype date_time_end: ~datetime.datetime
    :ivar tables:
    :vartype tables: list[~azure.mgmt.cdn.models.RankingsResponseTablesItem]
    """

    date_time_begin: Optional[datetime.datetime] = rest_field(
        name="dateTimeBegin", visibility=["read", "create", "update", "delete", "query"], format="rfc3339"
    )
    date_time_end: Optional[datetime.datetime] = rest_field(
        name="dateTimeEnd", visibility=["read", "create", "update", "delete", "query"], format="rfc3339"
    )
    tables: Optional[list["_models.RankingsResponseTablesItem"]] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )

    @overload
    def __init__(
        self,
        *,
        date_time_begin: Optional[datetime.datetime] = None,
        date_time_end: Optional[datetime.datetime] = None,
        tables: Optional[list["_models.RankingsResponseTablesItem"]] = None,
    ) -> None: ...

    @overload
    def __init__(self, mapping: Mapping[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 RankingsResponseTablesItem(_Model):
    """RankingsResponseTablesItem.

    :ivar ranking:
    :vartype ranking: str
    :ivar data:
    :vartype data: list[~azure.mgmt.cdn.models.RankingsResponseTablesPropertiesItemsItem]
    """

    ranking: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    data: Optional[list["_models.RankingsResponseTablesPropertiesItemsItem"]] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )

    @overload
    def __init__(
        self,
        *,
        ranking: Optional[str] = None,
        data: Optional[list["_models.RankingsResponseTablesPropertiesItemsItem"]] = None,
    ) -> None: ...

    @overload
    def __init__(self, mapping: Mapping[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 RankingsResponseTablesPropertiesItemsItem(_Model):  # pylint: disable=name-too-long
    """RankingsResponseTablesPropertiesItemsItem.

    :ivar name:
    :vartype name: str
    :ivar metrics:
    :vartype metrics: list[~azure.mgmt.cdn.models.RankingsResponseTablesPropertiesItemsMetricsItem]
    """

    name: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    metrics: Optional[list["_models.RankingsResponseTablesPropertiesItemsMetricsItem"]] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )

    @overload
    def __init__(
        self,
        *,
        name: Optional[str] = None,
        metrics: Optional[list["_models.RankingsResponseTablesPropertiesItemsMetricsItem"]] = None,
    ) -> None: ...

    @overload
    def __init__(self, mapping: Mapping[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 RankingsResponseTablesPropertiesItemsMetricsItem(_Model):  # pylint: disable=name-too-long
    """RankingsResponseTablesPropertiesItemsMetricsItem.

    :ivar metric:
    :vartype metric: str
    :ivar value:
    :vartype value: int
    :ivar percentage:
    :vartype percentage: float
    """

    metric: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    value: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    percentage: Optional[float] = rest_field(visibility=["read", "create", "update", "delete", "query"])

    @overload
    def __init__(
        self,
        *,
        metric: Optional[str] = None,
        value: Optional[int] = None,
        percentage: 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)


class RateLimitRule(CustomRule):
    """Defines a rate limiting rule that can be included in a waf policy.

    :ivar name: Defines the name of the custom rule. Required.
    :vartype name: str
    :ivar enabled_state: Describes if the custom rule is in enabled or disabled state. Defaults to
     Enabled if not specified. Known values are: "Disabled" and "Enabled".
    :vartype enabled_state: str or ~azure.mgmt.cdn.models.CustomRuleEnabledState
    :ivar priority: Defines in what order this rule be evaluated in the overall list of custom
     rules. Required.
    :vartype priority: int
    :ivar match_conditions: List of match conditions. Required.
    :vartype match_conditions: list[~azure.mgmt.cdn.models.MatchCondition]
    :ivar action: Describes what action to be applied when rule matches. Required. Known values
     are: "Allow", "Block", "Log", and "Redirect".
    :vartype action: str or ~azure.mgmt.cdn.models.ActionType
    :ivar rate_limit_threshold: Defines rate limit threshold. Required.
    :vartype rate_limit_threshold: int
    :ivar rate_limit_duration_in_minutes: Defines rate limit duration. Default is 1 minute.
     Required.
    :vartype rate_limit_duration_in_minutes: int
    """

    rate_limit_threshold: int = rest_field(
        name="rateLimitThreshold", visibility=["read", "create", "update", "delete", "query"]
    )
    """Defines rate limit threshold. Required."""
    rate_limit_duration_in_minutes: int = rest_field(
        name="rateLimitDurationInMinutes", visibility=["read", "create", "update", "delete", "query"]
    )
    """Defines rate limit duration. Default is 1 minute. Required."""

    @overload
    def __init__(
        self,
        *,
        name: str,
        priority: int,
        match_conditions: list["_models.MatchCondition"],
        action: Union[str, "_models.ActionType"],
        rate_limit_threshold: int,
        rate_limit_duration_in_minutes: int,
        enabled_state: Optional[Union[str, "_models.CustomRuleEnabledState"]] = None,
    ) -> None: ...

    @overload
    def __init__(self, mapping: Mapping[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 RateLimitRuleList(_Model):
    """Defines contents of rate limit rules.

    :ivar rules: List of rules.
    :vartype rules: list[~azure.mgmt.cdn.models.RateLimitRule]
    """

    rules: Optional[list["_models.RateLimitRule"]] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """List of rules."""

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

    @overload
    def __init__(self, mapping: Mapping[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 RemoteAddressMatchConditionParameters(
    DeliveryRuleConditionParameters, discriminator="DeliveryRuleRemoteAddressConditionParameters"
):
    """Defines the parameters for RemoteAddress match conditions.

    :ivar operator: Describes operator to be matched. Required. Known values are: "Any", "IPMatch",
     and "GeoMatch".
    :vartype operator: str or ~azure.mgmt.cdn.models.RemoteAddressOperator
    :ivar negate_condition: Describes if this is negate condition or not.
    :vartype negate_condition: bool
    :ivar match_values: Match values to match against. The operator will apply to each value in
     here with OR semantics. If any of them match the variable with the given operator this match
     condition is considered a match.
    :vartype match_values: list[str]
    :ivar transforms: List of transforms.
    :vartype transforms: list[str or ~azure.mgmt.cdn.models.Transform]
    :ivar type_name: Required. DELIVERY_RULE_REMOTE_ADDRESS_CONDITION_PARAMETERS.
    :vartype type_name: str or
     ~azure.mgmt.cdn.models.DELIVERY_RULE_REMOTE_ADDRESS_CONDITION_PARAMETERS
    """

    operator: Union[str, "_models.RemoteAddressOperator"] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """Describes operator to be matched. Required. Known values are: \"Any\", \"IPMatch\", and
     \"GeoMatch\"."""
    negate_condition: Optional[bool] = rest_field(
        name="negateCondition", visibility=["read", "create", "update", "delete", "query"]
    )
    """Describes if this is negate condition or not."""
    match_values: Optional[list[str]] = rest_field(
        name="matchValues", visibility=["read", "create", "update", "delete", "query"]
    )
    """Match values to match against. The operator will apply to each value in here with OR semantics.
     If any of them match the variable with the given operator this match condition is considered a
     match."""
    transforms: Optional[list[Union[str, "_models.Transform"]]] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """List of transforms."""
    type_name: Literal[DeliveryRuleConditionParametersType.DELIVERY_RULE_REMOTE_ADDRESS_CONDITION_PARAMETERS] = rest_discriminator(name="typeName", visibility=["read", "create", "update", "delete", "query"])  # type: ignore
    """Required. DELIVERY_RULE_REMOTE_ADDRESS_CONDITION_PARAMETERS."""

    @overload
    def __init__(
        self,
        *,
        operator: Union[str, "_models.RemoteAddressOperator"],
        negate_condition: Optional[bool] = None,
        match_values: Optional[list[str]] = None,
        transforms: Optional[list[Union[str, "_models.Transform"]]] = None,
    ) -> None: ...

    @overload
    def __init__(self, mapping: Mapping[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.type_name = DeliveryRuleConditionParametersType.DELIVERY_RULE_REMOTE_ADDRESS_CONDITION_PARAMETERS  # type: ignore


class RequestBodyMatchConditionParameters(
    DeliveryRuleConditionParameters, discriminator="DeliveryRuleRequestBodyConditionParameters"
):
    """Defines the parameters for RequestBody match conditions.

    :ivar operator: Describes operator to be matched. Required. Known values are: "Any", "Equal",
     "Contains", "BeginsWith", "EndsWith", "LessThan", "LessThanOrEqual", "GreaterThan",
     "GreaterThanOrEqual", and "RegEx".
    :vartype operator: str or ~azure.mgmt.cdn.models.RequestBodyOperator
    :ivar negate_condition: Describes if this is negate condition or not.
    :vartype negate_condition: bool
    :ivar match_values: The match value for the condition of the delivery rule.
    :vartype match_values: list[str]
    :ivar transforms: List of transforms.
    :vartype transforms: list[str or ~azure.mgmt.cdn.models.Transform]
    :ivar type_name: Required. DELIVERY_RULE_REQUEST_BODY_CONDITION_PARAMETERS.
    :vartype type_name: str or
     ~azure.mgmt.cdn.models.DELIVERY_RULE_REQUEST_BODY_CONDITION_PARAMETERS
    """

    operator: Union[str, "_models.RequestBodyOperator"] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """Describes operator to be matched. Required. Known values are: \"Any\", \"Equal\", \"Contains\",
     \"BeginsWith\", \"EndsWith\", \"LessThan\", \"LessThanOrEqual\", \"GreaterThan\",
     \"GreaterThanOrEqual\", and \"RegEx\"."""
    negate_condition: Optional[bool] = rest_field(
        name="negateCondition", visibility=["read", "create", "update", "delete", "query"]
    )
    """Describes if this is negate condition or not."""
    match_values: Optional[list[str]] = rest_field(
        name="matchValues", visibility=["read", "create", "update", "delete", "query"]
    )
    """The match value for the condition of the delivery rule."""
    transforms: Optional[list[Union[str, "_models.Transform"]]] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """List of transforms."""
    type_name: Literal[DeliveryRuleConditionParametersType.DELIVERY_RULE_REQUEST_BODY_CONDITION_PARAMETERS] = rest_discriminator(name="typeName", visibility=["read", "create", "update", "delete", "query"])  # type: ignore
    """Required. DELIVERY_RULE_REQUEST_BODY_CONDITION_PARAMETERS."""

    @overload
    def __init__(
        self,
        *,
        operator: Union[str, "_models.RequestBodyOperator"],
        negate_condition: Optional[bool] = None,
        match_values: Optional[list[str]] = None,
        transforms: Optional[list[Union[str, "_models.Transform"]]] = None,
    ) -> None: ...

    @overload
    def __init__(self, mapping: Mapping[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.type_name = DeliveryRuleConditionParametersType.DELIVERY_RULE_REQUEST_BODY_CONDITION_PARAMETERS  # type: ignore


class RequestHeaderMatchConditionParameters(
    DeliveryRuleConditionParameters, discriminator="DeliveryRuleRequestHeaderConditionParameters"
):
    """Defines the parameters for RequestHeader match conditions.

    :ivar selector: Name of Header to be matched.
    :vartype selector: str
    :ivar operator: Describes operator to be matched. Required. Known values are: "Any", "Equal",
     "Contains", "BeginsWith", "EndsWith", "LessThan", "LessThanOrEqual", "GreaterThan",
     "GreaterThanOrEqual", and "RegEx".
    :vartype operator: str or ~azure.mgmt.cdn.models.RequestHeaderOperator
    :ivar negate_condition: Describes if this is negate condition or not.
    :vartype negate_condition: bool
    :ivar match_values: The match value for the condition of the delivery rule.
    :vartype match_values: list[str]
    :ivar transforms: List of transforms.
    :vartype transforms: list[str or ~azure.mgmt.cdn.models.Transform]
    :ivar type_name: Required. DELIVERY_RULE_REQUEST_HEADER_CONDITION_PARAMETERS.
    :vartype type_name: str or
     ~azure.mgmt.cdn.models.DELIVERY_RULE_REQUEST_HEADER_CONDITION_PARAMETERS
    """

    selector: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """Name of Header to be matched."""
    operator: Union[str, "_models.RequestHeaderOperator"] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """Describes operator to be matched. Required. Known values are: \"Any\", \"Equal\", \"Contains\",
     \"BeginsWith\", \"EndsWith\", \"LessThan\", \"LessThanOrEqual\", \"GreaterThan\",
     \"GreaterThanOrEqual\", and \"RegEx\"."""
    negate_condition: Optional[bool] = rest_field(
        name="negateCondition", visibility=["read", "create", "update", "delete", "query"]
    )
    """Describes if this is negate condition or not."""
    match_values: Optional[list[str]] = rest_field(
        name="matchValues", visibility=["read", "create", "update", "delete", "query"]
    )
    """The match value for the condition of the delivery rule."""
    transforms: Optional[list[Union[str, "_models.Transform"]]] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """List of transforms."""
    type_name: Literal[DeliveryRuleConditionParametersType.DELIVERY_RULE_REQUEST_HEADER_CONDITION_PARAMETERS] = rest_discriminator(name="typeName", visibility=["read", "create", "update", "delete", "query"])  # type: ignore
    """Required. DELIVERY_RULE_REQUEST_HEADER_CONDITION_PARAMETERS."""

    @overload
    def __init__(
        self,
        *,
        operator: Union[str, "_models.RequestHeaderOperator"],
        selector: Optional[str] = None,
        negate_condition: Optional[bool] = None,
        match_values: Optional[list[str]] = None,
        transforms: Optional[list[Union[str, "_models.Transform"]]] = None,
    ) -> None: ...

    @overload
    def __init__(self, mapping: Mapping[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.type_name = DeliveryRuleConditionParametersType.DELIVERY_RULE_REQUEST_HEADER_CONDITION_PARAMETERS  # type: ignore


class RequestMethodMatchConditionParameters(
    DeliveryRuleConditionParameters, discriminator="DeliveryRuleRequestMethodConditionParameters"
):
    """Defines the parameters for RequestMethod match conditions.

    :ivar operator: Describes operator to be matched. Required. "Equal"
    :vartype operator: str or ~azure.mgmt.cdn.models.RequestMethodOperator
    :ivar negate_condition: Describes if this is negate condition or not.
    :vartype negate_condition: bool
    :ivar transforms: List of transforms.
    :vartype transforms: list[str or ~azure.mgmt.cdn.models.Transform]
    :ivar match_values: The match value for the condition of the delivery rule.
    :vartype match_values: list[str or
     ~azure.mgmt.cdn.models.RequestMethodMatchConditionParametersMatchValuesItem]
    :ivar type_name: Required. DELIVERY_RULE_REQUEST_METHOD_CONDITION_PARAMETERS.
    :vartype type_name: str or
     ~azure.mgmt.cdn.models.DELIVERY_RULE_REQUEST_METHOD_CONDITION_PARAMETERS
    """

    operator: Union[str, "_models.RequestMethodOperator"] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """Describes operator to be matched. Required. \"Equal\""""
    negate_condition: Optional[bool] = rest_field(
        name="negateCondition", visibility=["read", "create", "update", "delete", "query"]
    )
    """Describes if this is negate condition or not."""
    transforms: Optional[list[Union[str, "_models.Transform"]]] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """List of transforms."""
    match_values: Optional[list[Union[str, "_models.RequestMethodMatchConditionParametersMatchValuesItem"]]] = (
        rest_field(name="matchValues", visibility=["read", "create", "update", "delete", "query"])
    )
    """The match value for the condition of the delivery rule."""
    type_name: Literal[DeliveryRuleConditionParametersType.DELIVERY_RULE_REQUEST_METHOD_CONDITION_PARAMETERS] = rest_discriminator(name="typeName", visibility=["read", "create", "update", "delete", "query"])  # type: ignore
    """Required. DELIVERY_RULE_REQUEST_METHOD_CONDITION_PARAMETERS."""

    @overload
    def __init__(
        self,
        *,
        operator: Union[str, "_models.RequestMethodOperator"],
        negate_condition: Optional[bool] = None,
        transforms: Optional[list[Union[str, "_models.Transform"]]] = None,
        match_values: Optional[list[Union[str, "_models.RequestMethodMatchConditionParametersMatchValuesItem"]]] = None,
    ) -> None: ...

    @overload
    def __init__(self, mapping: Mapping[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.type_name = DeliveryRuleConditionParametersType.DELIVERY_RULE_REQUEST_METHOD_CONDITION_PARAMETERS  # type: ignore


class RequestSchemeMatchConditionParameters(
    DeliveryRuleConditionParameters, discriminator="DeliveryRuleRequestSchemeConditionParameters"
):
    """Defines the parameters for RequestScheme match conditions.

    :ivar operator: Describes operator to be matched. Required. "Equal"
    :vartype operator: str or ~azure.mgmt.cdn.models.RequestSchemeMatchConditionParametersOperator
    :ivar negate_condition: Describes if this is negate condition or not.
    :vartype negate_condition: bool
    :ivar transforms: List of transforms.
    :vartype transforms: list[str or ~azure.mgmt.cdn.models.Transform]
    :ivar match_values: The match value for the condition of the delivery rule.
    :vartype match_values: list[str or
     ~azure.mgmt.cdn.models.RequestSchemeMatchConditionParametersMatchValuesItem]
    :ivar type_name: Required. DELIVERY_RULE_REQUEST_SCHEME_CONDITION_PARAMETERS.
    :vartype type_name: str or
     ~azure.mgmt.cdn.models.DELIVERY_RULE_REQUEST_SCHEME_CONDITION_PARAMETERS
    """

    operator: Union[str, "_models.RequestSchemeMatchConditionParametersOperator"] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """Describes operator to be matched. Required. \"Equal\""""
    negate_condition: Optional[bool] = rest_field(
        name="negateCondition", visibility=["read", "create", "update", "delete", "query"]
    )
    """Describes if this is negate condition or not."""
    transforms: Optional[list[Union[str, "_models.Transform"]]] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """List of transforms."""
    match_values: Optional[list[Union[str, "_models.RequestSchemeMatchConditionParametersMatchValuesItem"]]] = (
        rest_field(name="matchValues", visibility=["read", "create", "update", "delete", "query"])
    )
    """The match value for the condition of the delivery rule."""
    type_name: Literal[DeliveryRuleConditionParametersType.DELIVERY_RULE_REQUEST_SCHEME_CONDITION_PARAMETERS] = rest_discriminator(name="typeName", visibility=["read", "create", "update", "delete", "query"])  # type: ignore
    """Required. DELIVERY_RULE_REQUEST_SCHEME_CONDITION_PARAMETERS."""

    @overload
    def __init__(
        self,
        *,
        operator: Union[str, "_models.RequestSchemeMatchConditionParametersOperator"],
        negate_condition: Optional[bool] = None,
        transforms: Optional[list[Union[str, "_models.Transform"]]] = None,
        match_values: Optional[list[Union[str, "_models.RequestSchemeMatchConditionParametersMatchValuesItem"]]] = None,
    ) -> None: ...

    @overload
    def __init__(self, mapping: Mapping[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.type_name = DeliveryRuleConditionParametersType.DELIVERY_RULE_REQUEST_SCHEME_CONDITION_PARAMETERS  # type: ignore


class RequestUriMatchConditionParameters(
    DeliveryRuleConditionParameters, discriminator="DeliveryRuleRequestUriConditionParameters"
):
    """Defines the parameters for RequestUri match conditions.

    :ivar operator: Describes operator to be matched. Required. Known values are: "Any", "Equal",
     "Contains", "BeginsWith", "EndsWith", "LessThan", "LessThanOrEqual", "GreaterThan",
     "GreaterThanOrEqual", and "RegEx".
    :vartype operator: str or ~azure.mgmt.cdn.models.RequestUriOperator
    :ivar negate_condition: Describes if this is negate condition or not.
    :vartype negate_condition: bool
    :ivar match_values: The match value for the condition of the delivery rule.
    :vartype match_values: list[str]
    :ivar transforms: List of transforms.
    :vartype transforms: list[str or ~azure.mgmt.cdn.models.Transform]
    :ivar type_name: Required. DELIVERY_RULE_REQUEST_URI_CONDITION_PARAMETERS.
    :vartype type_name: str or
     ~azure.mgmt.cdn.models.DELIVERY_RULE_REQUEST_URI_CONDITION_PARAMETERS
    """

    operator: Union[str, "_models.RequestUriOperator"] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """Describes operator to be matched. Required. Known values are: \"Any\", \"Equal\", \"Contains\",
     \"BeginsWith\", \"EndsWith\", \"LessThan\", \"LessThanOrEqual\", \"GreaterThan\",
     \"GreaterThanOrEqual\", and \"RegEx\"."""
    negate_condition: Optional[bool] = rest_field(
        name="negateCondition", visibility=["read", "create", "update", "delete", "query"]
    )
    """Describes if this is negate condition or not."""
    match_values: Optional[list[str]] = rest_field(
        name="matchValues", visibility=["read", "create", "update", "delete", "query"]
    )
    """The match value for the condition of the delivery rule."""
    transforms: Optional[list[Union[str, "_models.Transform"]]] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """List of transforms."""
    type_name: Literal[DeliveryRuleConditionParametersType.DELIVERY_RULE_REQUEST_URI_CONDITION_PARAMETERS] = rest_discriminator(name="typeName", visibility=["read", "create", "update", "delete", "query"])  # type: ignore
    """Required. DELIVERY_RULE_REQUEST_URI_CONDITION_PARAMETERS."""

    @overload
    def __init__(
        self,
        *,
        operator: Union[str, "_models.RequestUriOperator"],
        negate_condition: Optional[bool] = None,
        match_values: Optional[list[str]] = None,
        transforms: Optional[list[Union[str, "_models.Transform"]]] = None,
    ) -> None: ...

    @overload
    def __init__(self, mapping: Mapping[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.type_name = DeliveryRuleConditionParametersType.DELIVERY_RULE_REQUEST_URI_CONDITION_PARAMETERS  # type: ignore


class ResourceReference(_Model):
    """Reference to another resource.

    :ivar id: Resource ID.
    :vartype id: str
    """

    id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """Resource 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 ResourcesResponse(_Model):
    """Resources Response.

    :ivar endpoints:
    :vartype endpoints: list[~azure.mgmt.cdn.models.ResourcesResponseEndpointsItem]
    :ivar custom_domains:
    :vartype custom_domains: list[~azure.mgmt.cdn.models.ResourcesResponseCustomDomainsItem]
    """

    endpoints: Optional[list["_models.ResourcesResponseEndpointsItem"]] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    custom_domains: Optional[list["_models.ResourcesResponseCustomDomainsItem"]] = rest_field(
        name="customDomains", visibility=["read", "create", "update", "delete", "query"]
    )

    @overload
    def __init__(
        self,
        *,
        endpoints: Optional[list["_models.ResourcesResponseEndpointsItem"]] = None,
        custom_domains: Optional[list["_models.ResourcesResponseCustomDomainsItem"]] = None,
    ) -> None: ...

    @overload
    def __init__(self, mapping: Mapping[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 ResourcesResponseCustomDomainsItem(_Model):
    """ResourcesResponseCustomDomainsItem.

    :ivar id:
    :vartype id: str
    :ivar name:
    :vartype name: str
    :ivar endpoint_id:
    :vartype endpoint_id: str
    :ivar history:
    :vartype history: bool
    """

    id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    name: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    endpoint_id: Optional[str] = rest_field(
        name="endpointId", visibility=["read", "create", "update", "delete", "query"]
    )
    history: Optional[bool] = rest_field(visibility=["read", "create", "update", "delete", "query"])

    @overload
    def __init__(
        self,
        *,
        id: Optional[str] = None,  # pylint: disable=redefined-builtin
        name: Optional[str] = None,
        endpoint_id: Optional[str] = None,
        history: 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 ResourcesResponseEndpointsItem(_Model):
    """ResourcesResponseEndpointsItem.

    :ivar id:
    :vartype id: str
    :ivar name:
    :vartype name: str
    :ivar history:
    :vartype history: bool
    :ivar custom_domains:
    :vartype custom_domains:
     list[~azure.mgmt.cdn.models.ResourcesResponseEndpointsPropertiesItemsItem]
    """

    id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    name: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    history: Optional[bool] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    custom_domains: Optional[list["_models.ResourcesResponseEndpointsPropertiesItemsItem"]] = rest_field(
        name="customDomains", visibility=["read", "create", "update", "delete", "query"]
    )

    @overload
    def __init__(
        self,
        *,
        id: Optional[str] = None,  # pylint: disable=redefined-builtin
        name: Optional[str] = None,
        history: Optional[bool] = None,
        custom_domains: Optional[list["_models.ResourcesResponseEndpointsPropertiesItemsItem"]] = None,
    ) -> None: ...

    @overload
    def __init__(self, mapping: Mapping[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 ResourcesResponseEndpointsPropertiesItemsItem(_Model):  # pylint: disable=name-too-long
    """ResourcesResponseEndpointsPropertiesItemsItem.

    :ivar id:
    :vartype id: str
    :ivar name:
    :vartype name: str
    :ivar endpoint_id:
    :vartype endpoint_id: str
    :ivar history:
    :vartype history: bool
    """

    id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    name: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    endpoint_id: Optional[str] = rest_field(
        name="endpointId", visibility=["read", "create", "update", "delete", "query"]
    )
    history: Optional[bool] = rest_field(visibility=["read", "create", "update", "delete", "query"])

    @overload
    def __init__(
        self,
        *,
        id: Optional[str] = None,  # pylint: disable=redefined-builtin
        name: Optional[str] = None,
        endpoint_id: Optional[str] = None,
        history: 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 ResourceUsage(_Model):
    """Output of check resource usage API.

    :ivar resource_type: Resource type for which the usage is provided.
    :vartype resource_type: str
    :ivar unit: Unit of the usage. e.g. count. "count"
    :vartype unit: str or ~azure.mgmt.cdn.models.ResourceUsageUnit
    :ivar current_value: Actual value of usage on the specified resource type.
    :vartype current_value: int
    :ivar limit: Quota of the specified resource type.
    :vartype limit: int
    """

    resource_type: Optional[str] = rest_field(name="resourceType", visibility=["read"])
    """Resource type for which the usage is provided."""
    unit: Optional[Union[str, "_models.ResourceUsageUnit"]] = rest_field(visibility=["read"])
    """Unit of the usage. e.g. count. \"count\""""
    current_value: Optional[int] = rest_field(name="currentValue", visibility=["read"])
    """Actual value of usage on the specified resource type."""
    limit: Optional[int] = rest_field(visibility=["read"])
    """Quota of the specified resource type."""


class ResponseBasedOriginErrorDetectionParameters(_Model):  # pylint: disable=name-too-long
    """The JSON object that contains the properties to determine origin health using real
    requests/responses.

    :ivar response_based_detected_error_types: Type of response errors for real user requests for
     which origin will be deemed unhealthy. Known values are: "None", "TcpErrorsOnly", and
     "TcpAndHttpErrors".
    :vartype response_based_detected_error_types: str or
     ~azure.mgmt.cdn.models.ResponseBasedDetectedErrorTypes
    :ivar response_based_failover_threshold_percentage: The percentage of failed requests in the
     sample where failover should trigger.
    :vartype response_based_failover_threshold_percentage: int
    :ivar http_error_ranges: The list of Http status code ranges that are considered as server
     errors for origin and it is marked as unhealthy.
    :vartype http_error_ranges: list[~azure.mgmt.cdn.models.HttpErrorRangeParameters]
    """

    response_based_detected_error_types: Optional[Union[str, "_models.ResponseBasedDetectedErrorTypes"]] = rest_field(
        name="responseBasedDetectedErrorTypes", visibility=["read", "create", "update", "delete", "query"]
    )
    """Type of response errors for real user requests for which origin will be deemed unhealthy. Known
     values are: \"None\", \"TcpErrorsOnly\", and \"TcpAndHttpErrors\"."""
    response_based_failover_threshold_percentage: Optional[int] = rest_field(
        name="responseBasedFailoverThresholdPercentage", visibility=["read", "create", "update", "delete", "query"]
    )
    """The percentage of failed requests in the sample where failover should trigger."""
    http_error_ranges: Optional[list["_models.HttpErrorRangeParameters"]] = rest_field(
        name="httpErrorRanges", visibility=["read", "create", "update", "delete", "query"]
    )
    """The list of Http status code ranges that are considered as server errors for origin and it is
     marked as unhealthy."""

    @overload
    def __init__(
        self,
        *,
        response_based_detected_error_types: Optional[Union[str, "_models.ResponseBasedDetectedErrorTypes"]] = None,
        response_based_failover_threshold_percentage: Optional[int] = None,
        http_error_ranges: Optional[list["_models.HttpErrorRangeParameters"]] = None,
    ) -> None: ...

    @overload
    def __init__(self, mapping: Mapping[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 Route(ProxyResource):
    """Friendly Routes name mapping to the any Routes or secret related 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.cdn.models.SystemData
    :ivar properties: The JSON object that contains the properties of the Routes to create.
    :vartype properties: ~azure.mgmt.cdn.models.RouteProperties
    """

    properties: Optional["_models.RouteProperties"] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """The JSON object that contains the properties of the Routes to create."""

    __flattened_items = [
        "endpoint_name",
        "custom_domains",
        "origin_group",
        "origin_path",
        "rule_sets",
        "supported_protocols",
        "patterns_to_match",
        "cache_configuration",
        "forwarding_protocol",
        "link_to_default_domain",
        "https_redirect",
        "enabled_state",
        "provisioning_state",
        "deployment_status",
    ]

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

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

    def __init__(self, *args: Any, **kwargs: Any) -> None:
        _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 RouteConfigurationOverrideActionParameters(
    DeliveryRuleActionParameters, discriminator="DeliveryRuleRouteConfigurationOverrideActionParameters"
):  # pylint: disable=name-too-long
    """Defines the parameters for the route configuration override action.

    :ivar origin_group_override: A reference to the origin group override configuration. Leave
     empty to use the default origin group on route.
    :vartype origin_group_override: ~azure.mgmt.cdn.models.OriginGroupOverride
    :ivar cache_configuration: The caching configuration associated with this rule. To disable
     caching, do not provide a cacheConfiguration object.
    :vartype cache_configuration: ~azure.mgmt.cdn.models.CacheConfiguration
    :ivar type_name: Required. DELIVERY_RULE_ROUTE_CONFIGURATION_OVERRIDE_ACTION_PARAMETERS.
    :vartype type_name: str or
     ~azure.mgmt.cdn.models.DELIVERY_RULE_ROUTE_CONFIGURATION_OVERRIDE_ACTION_PARAMETERS
    """

    origin_group_override: Optional["_models.OriginGroupOverride"] = rest_field(
        name="originGroupOverride", visibility=["read", "create", "update", "delete", "query"]
    )
    """A reference to the origin group override configuration. Leave empty to use the default origin
     group on route."""
    cache_configuration: Optional["_models.CacheConfiguration"] = rest_field(
        name="cacheConfiguration", visibility=["read", "create", "update", "delete", "query"]
    )
    """The caching configuration associated with this rule. To disable caching, do not provide a
     cacheConfiguration object."""
    type_name: Literal[DeliveryRuleActionParametersType.DELIVERY_RULE_ROUTE_CONFIGURATION_OVERRIDE_ACTION_PARAMETERS] = rest_discriminator(name="typeName", visibility=["read", "create", "update", "delete", "query"])  # type: ignore
    """Required. DELIVERY_RULE_ROUTE_CONFIGURATION_OVERRIDE_ACTION_PARAMETERS."""

    @overload
    def __init__(
        self,
        *,
        origin_group_override: Optional["_models.OriginGroupOverride"] = None,
        cache_configuration: Optional["_models.CacheConfiguration"] = None,
    ) -> None: ...

    @overload
    def __init__(self, mapping: Mapping[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.type_name = DeliveryRuleActionParametersType.DELIVERY_RULE_ROUTE_CONFIGURATION_OVERRIDE_ACTION_PARAMETERS  # type: ignore


class RouteProperties(_Model):
    """The JSON object that contains the properties of the Routes to create.

    :ivar endpoint_name: The name of the endpoint which holds the route.
    :vartype endpoint_name: str
    :ivar custom_domains: Domains referenced by this endpoint.
    :vartype custom_domains: list[~azure.mgmt.cdn.models.ActivatedResourceReference]
    :ivar origin_group: A reference to the origin group.
    :vartype origin_group: ~azure.mgmt.cdn.models.ResourceReference
    :ivar origin_path: A directory path on the origin that AzureFrontDoor can use to retrieve
     content from, e.g. contoso.cloudapp.net/originpath.
    :vartype origin_path: str
    :ivar rule_sets: rule sets referenced by this endpoint.
    :vartype rule_sets: list[~azure.mgmt.cdn.models.ResourceReference]
    :ivar supported_protocols: List of supported protocols for this route.
    :vartype supported_protocols: list[str or ~azure.mgmt.cdn.models.AFDEndpointProtocols]
    :ivar patterns_to_match: The route patterns of the rule.
    :vartype patterns_to_match: list[str]
    :ivar cache_configuration: The caching configuration for this route. To disable caching, do not
     provide a cacheConfiguration object.
    :vartype cache_configuration: ~azure.mgmt.cdn.models.AfdRouteCacheConfiguration
    :ivar forwarding_protocol: Protocol this rule will use when forwarding traffic to backends.
     Known values are: "HttpOnly", "HttpsOnly", and "MatchRequest".
    :vartype forwarding_protocol: str or ~azure.mgmt.cdn.models.ForwardingProtocol
    :ivar link_to_default_domain: whether this route will be linked to the default endpoint domain.
     Known values are: "Enabled" and "Disabled".
    :vartype link_to_default_domain: str or ~azure.mgmt.cdn.models.LinkToDefaultDomain
    :ivar https_redirect: Whether to automatically redirect HTTP traffic to HTTPS traffic. Note
     that this is a easy way to set up this rule and it will be the first rule that gets executed.
     Known values are: "Enabled" and "Disabled".
    :vartype https_redirect: str or ~azure.mgmt.cdn.models.HttpsRedirect
    :ivar enabled_state: Whether to enable use of this rule. Permitted values are 'Enabled' or
     'Disabled'. Known values are: "Enabled" and "Disabled".
    :vartype enabled_state: str or ~azure.mgmt.cdn.models.EnabledState
    :ivar provisioning_state: Provisioning status. Known values are: "Succeeded", "Failed",
     "Updating", "Deleting", and "Creating".
    :vartype provisioning_state: str or ~azure.mgmt.cdn.models.AfdProvisioningState
    :ivar deployment_status: Known values are: "NotStarted", "InProgress", "Succeeded", and
     "Failed".
    :vartype deployment_status: str or ~azure.mgmt.cdn.models.DeploymentStatus
    """

    endpoint_name: Optional[str] = rest_field(name="endpointName", visibility=["read"])
    """The name of the endpoint which holds the route."""
    custom_domains: Optional[list["_models.ActivatedResourceReference"]] = rest_field(
        name="customDomains", visibility=["read", "create", "update", "delete", "query"]
    )
    """Domains referenced by this endpoint."""
    origin_group: Optional["_models.ResourceReference"] = rest_field(
        name="originGroup", visibility=["read", "create", "update", "delete", "query"]
    )
    """A reference to the origin group."""
    origin_path: Optional[str] = rest_field(
        name="originPath", visibility=["read", "create", "update", "delete", "query"]
    )
    """A directory path on the origin that AzureFrontDoor can use to retrieve content from, e.g.
     contoso.cloudapp.net/originpath."""
    rule_sets: Optional[list["_models.ResourceReference"]] = rest_field(
        name="ruleSets", visibility=["read", "create", "update", "delete", "query"]
    )
    """rule sets referenced by this endpoint."""
    supported_protocols: Optional[list[Union[str, "_models.AFDEndpointProtocols"]]] = rest_field(
        name="supportedProtocols", visibility=["read", "create", "update", "delete", "query"]
    )
    """List of supported protocols for this route."""
    patterns_to_match: Optional[list[str]] = rest_field(
        name="patternsToMatch", visibility=["read", "create", "update", "delete", "query"]
    )
    """The route patterns of the rule."""
    cache_configuration: Optional["_models.AfdRouteCacheConfiguration"] = rest_field(
        name="cacheConfiguration", visibility=["read", "create", "update", "delete", "query"]
    )
    """The caching configuration for this route. To disable caching, do not provide a
     cacheConfiguration object."""
    forwarding_protocol: Optional[Union[str, "_models.ForwardingProtocol"]] = rest_field(
        name="forwardingProtocol", visibility=["read", "create", "update", "delete", "query"]
    )
    """Protocol this rule will use when forwarding traffic to backends. Known values are:
     \"HttpOnly\", \"HttpsOnly\", and \"MatchRequest\"."""
    link_to_default_domain: Optional[Union[str, "_models.LinkToDefaultDomain"]] = rest_field(
        name="linkToDefaultDomain", visibility=["read", "create", "update", "delete", "query"]
    )
    """whether this route will be linked to the default endpoint domain. Known values are: \"Enabled\"
     and \"Disabled\"."""
    https_redirect: Optional[Union[str, "_models.HttpsRedirect"]] = rest_field(
        name="httpsRedirect", visibility=["read", "create", "update", "delete", "query"]
    )
    """Whether to automatically redirect HTTP traffic to HTTPS traffic. Note that this is a easy way
     to set up this rule and it will be the first rule that gets executed. Known values are:
     \"Enabled\" and \"Disabled\"."""
    enabled_state: Optional[Union[str, "_models.EnabledState"]] = rest_field(
        name="enabledState", visibility=["read", "create", "update", "delete", "query"]
    )
    """Whether to enable use of this rule. Permitted values are 'Enabled' or 'Disabled'. Known values
     are: \"Enabled\" and \"Disabled\"."""
    provisioning_state: Optional[Union[str, "_models.AfdProvisioningState"]] = rest_field(
        name="provisioningState", visibility=["read"]
    )
    """Provisioning status. Known values are: \"Succeeded\", \"Failed\", \"Updating\", \"Deleting\",
     and \"Creating\"."""
    deployment_status: Optional[Union[str, "_models.DeploymentStatus"]] = rest_field(
        name="deploymentStatus", visibility=["read"]
    )
    """Known values are: \"NotStarted\", \"InProgress\", \"Succeeded\", and \"Failed\"."""

    @overload
    def __init__(
        self,
        *,
        custom_domains: Optional[list["_models.ActivatedResourceReference"]] = None,
        origin_group: Optional["_models.ResourceReference"] = None,
        origin_path: Optional[str] = None,
        rule_sets: Optional[list["_models.ResourceReference"]] = None,
        supported_protocols: Optional[list[Union[str, "_models.AFDEndpointProtocols"]]] = None,
        patterns_to_match: Optional[list[str]] = None,
        cache_configuration: Optional["_models.AfdRouteCacheConfiguration"] = None,
        forwarding_protocol: Optional[Union[str, "_models.ForwardingProtocol"]] = None,
        link_to_default_domain: Optional[Union[str, "_models.LinkToDefaultDomain"]] = None,
        https_redirect: Optional[Union[str, "_models.HttpsRedirect"]] = None,
        enabled_state: Optional[Union[str, "_models.EnabledState"]] = None,
    ) -> None: ...

    @overload
    def __init__(self, mapping: Mapping[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 RouteUpdateParameters(_Model):
    """The domain JSON object required for domain creation or update.

    :ivar properties: The JSON object that contains the properties of the domain to create.
    :vartype properties: ~azure.mgmt.cdn.models.RouteUpdatePropertiesParameters
    """

    properties: Optional["_models.RouteUpdatePropertiesParameters"] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """The JSON object that contains the properties of the domain to create."""

    __flattened_items = [
        "endpoint_name",
        "custom_domains",
        "origin_group",
        "origin_path",
        "rule_sets",
        "supported_protocols",
        "patterns_to_match",
        "cache_configuration",
        "forwarding_protocol",
        "link_to_default_domain",
        "https_redirect",
        "enabled_state",
    ]

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

    @overload
    def __init__(self, mapping: Mapping[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 RouteUpdatePropertiesParameters(_Model):
    """The JSON object that contains the properties of the domain to create.

    :ivar endpoint_name: The name of the endpoint which holds the route.
    :vartype endpoint_name: str
    :ivar custom_domains: Domains referenced by this endpoint.
    :vartype custom_domains: list[~azure.mgmt.cdn.models.ActivatedResourceReference]
    :ivar origin_group: A reference to the origin group.
    :vartype origin_group: ~azure.mgmt.cdn.models.ResourceReference
    :ivar origin_path: A directory path on the origin that AzureFrontDoor can use to retrieve
     content from, e.g. contoso.cloudapp.net/originpath.
    :vartype origin_path: str
    :ivar rule_sets: rule sets referenced by this endpoint.
    :vartype rule_sets: list[~azure.mgmt.cdn.models.ResourceReference]
    :ivar supported_protocols: List of supported protocols for this route.
    :vartype supported_protocols: list[str or ~azure.mgmt.cdn.models.AFDEndpointProtocols]
    :ivar patterns_to_match: The route patterns of the rule.
    :vartype patterns_to_match: list[str]
    :ivar cache_configuration: The caching configuration for this route. To disable caching, do not
     provide a cacheConfiguration object.
    :vartype cache_configuration: ~azure.mgmt.cdn.models.AfdRouteCacheConfiguration
    :ivar forwarding_protocol: Protocol this rule will use when forwarding traffic to backends.
     Known values are: "HttpOnly", "HttpsOnly", and "MatchRequest".
    :vartype forwarding_protocol: str or ~azure.mgmt.cdn.models.ForwardingProtocol
    :ivar link_to_default_domain: whether this route will be linked to the default endpoint domain.
     Known values are: "Enabled" and "Disabled".
    :vartype link_to_default_domain: str or ~azure.mgmt.cdn.models.LinkToDefaultDomain
    :ivar https_redirect: Whether to automatically redirect HTTP traffic to HTTPS traffic. Note
     that this is a easy way to set up this rule and it will be the first rule that gets executed.
     Known values are: "Enabled" and "Disabled".
    :vartype https_redirect: str or ~azure.mgmt.cdn.models.HttpsRedirect
    :ivar enabled_state: Whether to enable use of this rule. Permitted values are 'Enabled' or
     'Disabled'. Known values are: "Enabled" and "Disabled".
    :vartype enabled_state: str or ~azure.mgmt.cdn.models.EnabledState
    """

    endpoint_name: Optional[str] = rest_field(name="endpointName", visibility=["read"])
    """The name of the endpoint which holds the route."""
    custom_domains: Optional[list["_models.ActivatedResourceReference"]] = rest_field(
        name="customDomains", visibility=["read", "create", "update", "delete", "query"]
    )
    """Domains referenced by this endpoint."""
    origin_group: Optional["_models.ResourceReference"] = rest_field(
        name="originGroup", visibility=["read", "create", "update", "delete", "query"]
    )
    """A reference to the origin group."""
    origin_path: Optional[str] = rest_field(
        name="originPath", visibility=["read", "create", "update", "delete", "query"]
    )
    """A directory path on the origin that AzureFrontDoor can use to retrieve content from, e.g.
     contoso.cloudapp.net/originpath."""
    rule_sets: Optional[list["_models.ResourceReference"]] = rest_field(
        name="ruleSets", visibility=["read", "create", "update", "delete", "query"]
    )
    """rule sets referenced by this endpoint."""
    supported_protocols: Optional[list[Union[str, "_models.AFDEndpointProtocols"]]] = rest_field(
        name="supportedProtocols", visibility=["read", "create", "update", "delete", "query"]
    )
    """List of supported protocols for this route."""
    patterns_to_match: Optional[list[str]] = rest_field(
        name="patternsToMatch", visibility=["read", "create", "update", "delete", "query"]
    )
    """The route patterns of the rule."""
    cache_configuration: Optional["_models.AfdRouteCacheConfiguration"] = rest_field(
        name="cacheConfiguration", visibility=["read", "create", "update", "delete", "query"]
    )
    """The caching configuration for this route. To disable caching, do not provide a
     cacheConfiguration object."""
    forwarding_protocol: Optional[Union[str, "_models.ForwardingProtocol"]] = rest_field(
        name="forwardingProtocol", visibility=["read", "create", "update", "delete", "query"]
    )
    """Protocol this rule will use when forwarding traffic to backends. Known values are:
     \"HttpOnly\", \"HttpsOnly\", and \"MatchRequest\"."""
    link_to_default_domain: Optional[Union[str, "_models.LinkToDefaultDomain"]] = rest_field(
        name="linkToDefaultDomain", visibility=["read", "create", "update", "delete", "query"]
    )
    """whether this route will be linked to the default endpoint domain. Known values are: \"Enabled\"
     and \"Disabled\"."""
    https_redirect: Optional[Union[str, "_models.HttpsRedirect"]] = rest_field(
        name="httpsRedirect", visibility=["read", "create", "update", "delete", "query"]
    )
    """Whether to automatically redirect HTTP traffic to HTTPS traffic. Note that this is a easy way
     to set up this rule and it will be the first rule that gets executed. Known values are:
     \"Enabled\" and \"Disabled\"."""
    enabled_state: Optional[Union[str, "_models.EnabledState"]] = rest_field(
        name="enabledState", visibility=["read", "create", "update", "delete", "query"]
    )
    """Whether to enable use of this rule. Permitted values are 'Enabled' or 'Disabled'. Known values
     are: \"Enabled\" and \"Disabled\"."""

    @overload
    def __init__(
        self,
        *,
        custom_domains: Optional[list["_models.ActivatedResourceReference"]] = None,
        origin_group: Optional["_models.ResourceReference"] = None,
        origin_path: Optional[str] = None,
        rule_sets: Optional[list["_models.ResourceReference"]] = None,
        supported_protocols: Optional[list[Union[str, "_models.AFDEndpointProtocols"]]] = None,
        patterns_to_match: Optional[list[str]] = None,
        cache_configuration: Optional["_models.AfdRouteCacheConfiguration"] = None,
        forwarding_protocol: Optional[Union[str, "_models.ForwardingProtocol"]] = None,
        link_to_default_domain: Optional[Union[str, "_models.LinkToDefaultDomain"]] = None,
        https_redirect: Optional[Union[str, "_models.HttpsRedirect"]] = None,
        enabled_state: Optional[Union[str, "_models.EnabledState"]] = None,
    ) -> None: ...

    @overload
    def __init__(self, mapping: Mapping[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 Rule(ProxyResource):
    """Friendly Rules name mapping to the any Rules or secret related 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.cdn.models.SystemData
    :ivar properties: The JSON object that contains the properties of the Rules to create.
    :vartype properties: ~azure.mgmt.cdn.models.RuleProperties
    """

    properties: Optional["_models.RuleProperties"] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """The JSON object that contains the properties of the Rules to create."""

    __flattened_items = [
        "rule_set_name",
        "order",
        "conditions",
        "actions",
        "match_processing_behavior",
        "provisioning_state",
        "deployment_status",
    ]

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

    @overload
    def __init__(self, mapping: Mapping[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 RuleProperties(_Model):
    """The JSON object that contains the properties of the Rules to create.

    :ivar rule_set_name: The name of the rule set containing the rule.
    :vartype rule_set_name: str
    :ivar order: The order in which the rules are applied for the endpoint. Possible values
     {0,1,2,3,………}. A rule with a lesser order will be applied before a rule with a greater order.
     Rule with order 0 is a special rule. It does not require any condition and actions listed in it
     will always be applied.
    :vartype order: int
    :ivar conditions: A list of conditions that must be matched for the actions to be executed.
    :vartype conditions: list[~azure.mgmt.cdn.models.DeliveryRuleCondition]
    :ivar actions: A list of actions that are executed when all the conditions of a rule are
     satisfied.
    :vartype actions: list[~azure.mgmt.cdn.models.DeliveryRuleAction]
    :ivar match_processing_behavior: If this rule is a match should the rules engine continue
     running the remaining rules or stop. If not present, defaults to Continue. Known values are:
     "Continue" and "Stop".
    :vartype match_processing_behavior: str or ~azure.mgmt.cdn.models.MatchProcessingBehavior
    :ivar provisioning_state: Provisioning status. Known values are: "Succeeded", "Failed",
     "Updating", "Deleting", and "Creating".
    :vartype provisioning_state: str or ~azure.mgmt.cdn.models.AfdProvisioningState
    :ivar deployment_status: Known values are: "NotStarted", "InProgress", "Succeeded", and
     "Failed".
    :vartype deployment_status: str or ~azure.mgmt.cdn.models.DeploymentStatus
    """

    rule_set_name: Optional[str] = rest_field(name="ruleSetName", visibility=["read"])
    """The name of the rule set containing the rule."""
    order: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """The order in which the rules are applied for the endpoint. Possible values {0,1,2,3,………}. A
     rule with a lesser order will be applied before a rule with a greater order. Rule with order 0
     is a special rule. It does not require any condition and actions listed in it will always be
     applied."""
    conditions: Optional[list["_models.DeliveryRuleCondition"]] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """A list of conditions that must be matched for the actions to be executed."""
    actions: Optional[list["_models.DeliveryRuleAction"]] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """A list of actions that are executed when all the conditions of a rule are satisfied."""
    match_processing_behavior: Optional[Union[str, "_models.MatchProcessingBehavior"]] = rest_field(
        name="matchProcessingBehavior", visibility=["read", "create", "update", "delete", "query"]
    )
    """If this rule is a match should the rules engine continue running the remaining rules or stop.
     If not present, defaults to Continue. Known values are: \"Continue\" and \"Stop\"."""
    provisioning_state: Optional[Union[str, "_models.AfdProvisioningState"]] = rest_field(
        name="provisioningState", visibility=["read"]
    )
    """Provisioning status. Known values are: \"Succeeded\", \"Failed\", \"Updating\", \"Deleting\",
     and \"Creating\"."""
    deployment_status: Optional[Union[str, "_models.DeploymentStatus"]] = rest_field(
        name="deploymentStatus", visibility=["read"]
    )
    """Known values are: \"NotStarted\", \"InProgress\", \"Succeeded\", and \"Failed\"."""

    @overload
    def __init__(
        self,
        *,
        order: Optional[int] = None,
        conditions: Optional[list["_models.DeliveryRuleCondition"]] = None,
        actions: Optional[list["_models.DeliveryRuleAction"]] = None,
        match_processing_behavior: Optional[Union[str, "_models.MatchProcessingBehavior"]] = None,
    ) -> None: ...

    @overload
    def __init__(self, mapping: Mapping[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 RuleSet(ProxyResource):
    """Friendly RuleSet name mapping to the any RuleSet or secret related 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.cdn.models.SystemData
    :ivar properties: The JSON object that contains the properties of the Rule Set to create.
    :vartype properties: ~azure.mgmt.cdn.models.RuleSetProperties
    """

    properties: Optional["_models.RuleSetProperties"] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """The JSON object that contains the properties of the Rule Set to create."""

    __flattened_items = ["provisioning_state", "deployment_status", "profile_name", "batch_mode", "rules"]

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

    @overload
    def __init__(self, mapping: Mapping[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 RuleSetProperties(AFDStateProperties):
    """The JSON object that contains the properties of the Rule Set to create.

    :ivar provisioning_state: Provisioning status. Known values are: "Succeeded", "Failed",
     "Updating", "Deleting", and "Creating".
    :vartype provisioning_state: str or ~azure.mgmt.cdn.models.AfdProvisioningState
    :ivar deployment_status: Known values are: "NotStarted", "InProgress", "Succeeded", and
     "Failed".
    :vartype deployment_status: str or ~azure.mgmt.cdn.models.DeploymentStatus
    :ivar profile_name: The name of the profile which holds the rule set.
    :vartype profile_name: str
    :ivar batch_mode: Indicates whether rule set is in batch mode. When batch mode is enabled,
     rules will be processed in a batch along with the rule set. When batch mode is disabled, rules
     would need to be processed independently. This property can only be set during rule set
     creation and cannot be updated later. For switching modes, a new rule set needs to be created
     with the desired mode and rules need to be migrated to the new rule set.
    :vartype batch_mode: bool
    :ivar rules: A list of rules that are part of this rule set provided the rule set is in batch
     mode. This property will be ignored if the rule set is not in batch mode.
    :vartype rules: list[~azure.mgmt.cdn.models.BatchRuleProperties]
    """

    profile_name: Optional[str] = rest_field(name="profileName", visibility=["read"])
    """The name of the profile which holds the rule set."""
    batch_mode: Optional[bool] = rest_field(name="batchMode", visibility=["read", "create"])
    """Indicates whether rule set is in batch mode. When batch mode is enabled, rules will be
     processed in a batch along with the rule set. When batch mode is disabled, rules would need to
     be processed independently. This property can only be set during rule set creation and cannot
     be updated later. For switching modes, a new rule set needs to be created with the desired mode
     and rules need to be migrated to the new rule set."""
    rules: Optional[list["_models.BatchRuleProperties"]] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """A list of rules that are part of this rule set provided the rule set is in batch mode. This
     property will be ignored if the rule set is not in batch mode."""

    @overload
    def __init__(
        self,
        *,
        batch_mode: Optional[bool] = None,
        rules: Optional[list["_models.BatchRuleProperties"]] = None,
    ) -> None: ...

    @overload
    def __init__(self, mapping: Mapping[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 RuleUpdateParameters(_Model):
    """The domain JSON object required for domain creation or update.

    :ivar properties: The JSON object that contains the properties of the rule to update.
    :vartype properties: ~azure.mgmt.cdn.models.RuleUpdatePropertiesParameters
    """

    properties: Optional["_models.RuleUpdatePropertiesParameters"] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """The JSON object that contains the properties of the rule to update."""

    __flattened_items = ["rule_set_name", "order", "conditions", "actions", "match_processing_behavior"]

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

    @overload
    def __init__(self, mapping: Mapping[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 RuleUpdatePropertiesParameters(_Model):
    """The JSON object that contains the properties of the rule to update.

    :ivar rule_set_name: The name of the rule set containing the rule.
    :vartype rule_set_name: str
    :ivar order: The order in which the rules are applied for the endpoint. Possible values
     {0,1,2,3,………}. A rule with a lesser order will be applied before a rule with a greater order.
     Rule with order 0 is a special rule. It does not require any condition and actions listed in it
     will always be applied.
    :vartype order: int
    :ivar conditions: A list of conditions that must be matched for the actions to be executed.
    :vartype conditions: list[~azure.mgmt.cdn.models.DeliveryRuleCondition]
    :ivar actions: A list of actions that are executed when all the conditions of a rule are
     satisfied.
    :vartype actions: list[~azure.mgmt.cdn.models.DeliveryRuleAction]
    :ivar match_processing_behavior: If this rule is a match should the rules engine continue
     running the remaining rules or stop. If not present, defaults to Continue. Known values are:
     "Continue" and "Stop".
    :vartype match_processing_behavior: str or ~azure.mgmt.cdn.models.MatchProcessingBehavior
    """

    rule_set_name: Optional[str] = rest_field(name="ruleSetName", visibility=["read"])
    """The name of the rule set containing the rule."""
    order: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """The order in which the rules are applied for the endpoint. Possible values {0,1,2,3,………}. A
     rule with a lesser order will be applied before a rule with a greater order. Rule with order 0
     is a special rule. It does not require any condition and actions listed in it will always be
     applied."""
    conditions: Optional[list["_models.DeliveryRuleCondition"]] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """A list of conditions that must be matched for the actions to be executed."""
    actions: Optional[list["_models.DeliveryRuleAction"]] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """A list of actions that are executed when all the conditions of a rule are satisfied."""
    match_processing_behavior: Optional[Union[str, "_models.MatchProcessingBehavior"]] = rest_field(
        name="matchProcessingBehavior", visibility=["read", "create", "update", "delete", "query"]
    )
    """If this rule is a match should the rules engine continue running the remaining rules or stop.
     If not present, defaults to Continue. Known values are: \"Continue\" and \"Stop\"."""

    @overload
    def __init__(
        self,
        *,
        order: Optional[int] = None,
        conditions: Optional[list["_models.DeliveryRuleCondition"]] = None,
        actions: Optional[list["_models.DeliveryRuleAction"]] = None,
        match_processing_behavior: Optional[Union[str, "_models.MatchProcessingBehavior"]] = None,
    ) -> None: ...

    @overload
    def __init__(self, mapping: Mapping[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 Secret(ProxyResource):
    """Friendly Secret name mapping to the any Secret or secret related 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.cdn.models.SystemData
    :ivar properties: The JSON object that contains the properties of the Secret to create.
    :vartype properties: ~azure.mgmt.cdn.models.SecretProperties
    """

    properties: Optional["_models.SecretProperties"] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """The JSON object that contains the properties of the Secret to create."""

    __flattened_items = ["provisioning_state", "deployment_status", "profile_name", "parameters"]

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

    @overload
    def __init__(self, mapping: Mapping[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 SecretProperties(AFDStateProperties):
    """The JSON object that contains the properties of the Secret to create.

    :ivar provisioning_state: Provisioning status. Known values are: "Succeeded", "Failed",
     "Updating", "Deleting", and "Creating".
    :vartype provisioning_state: str or ~azure.mgmt.cdn.models.AfdProvisioningState
    :ivar deployment_status: Known values are: "NotStarted", "InProgress", "Succeeded", and
     "Failed".
    :vartype deployment_status: str or ~azure.mgmt.cdn.models.DeploymentStatus
    :ivar profile_name: The name of the profile which holds the secret.
    :vartype profile_name: str
    :ivar parameters: object which contains secret parameters.
    :vartype parameters: ~azure.mgmt.cdn.models.SecretParameters
    """

    profile_name: Optional[str] = rest_field(name="profileName", visibility=["read"])
    """The name of the profile which holds the secret."""
    parameters: Optional["_models.SecretParameters"] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """object which contains secret parameters."""

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

    @overload
    def __init__(self, mapping: Mapping[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 SecurityPolicy(ProxyResource):
    """SecurityPolicy association for AzureFrontDoor profile.

    :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.cdn.models.SystemData
    :ivar properties: The json object that contains properties required to create a security
     policy.
    :vartype properties: ~azure.mgmt.cdn.models.SecurityPolicyProperties
    """

    properties: Optional["_models.SecurityPolicyProperties"] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """The json object that contains properties required to create a security policy."""

    __flattened_items = ["provisioning_state", "deployment_status", "profile_name", "parameters"]

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

    @overload
    def __init__(self, mapping: Mapping[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 SecurityPolicyProperties(AFDStateProperties):
    """The json object that contains properties required to create a security policy.

    :ivar provisioning_state: Provisioning status. Known values are: "Succeeded", "Failed",
     "Updating", "Deleting", and "Creating".
    :vartype provisioning_state: str or ~azure.mgmt.cdn.models.AfdProvisioningState
    :ivar deployment_status: Known values are: "NotStarted", "InProgress", "Succeeded", and
     "Failed".
    :vartype deployment_status: str or ~azure.mgmt.cdn.models.DeploymentStatus
    :ivar profile_name: The name of the profile which holds the security policy.
    :vartype profile_name: str
    :ivar parameters: object which contains security policy parameters.
    :vartype parameters: ~azure.mgmt.cdn.models.SecurityPolicyPropertiesParameters
    """

    profile_name: Optional[str] = rest_field(name="profileName", visibility=["read"])
    """The name of the profile which holds the security policy."""
    parameters: Optional["_models.SecurityPolicyPropertiesParameters"] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """object which contains security policy parameters."""

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

    @overload
    def __init__(self, mapping: Mapping[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 SecurityPolicyPropertiesParameters(_Model):
    """The json object containing security policy parameters.

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

    :ivar type: The type of the Security policy to create. Required. "WebApplicationFirewall"
    :vartype type: str or ~azure.mgmt.cdn.models.SecurityPolicyType
    """

    __mapping__: dict[str, _Model] = {}
    type: str = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"])
    """The type of the Security policy to create. Required. \"WebApplicationFirewall\""""

    @overload
    def __init__(
        self,
        *,
        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 SecurityPolicyUpdateParameters(_Model):
    """The JSON object containing security policy update parameters.

    :ivar properties: The json object that contains properties required to update a security
     policy.
    :vartype properties: ~azure.mgmt.cdn.models.SecurityPolicyUpdateProperties
    """

    properties: Optional["_models.SecurityPolicyUpdateProperties"] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """The json object that contains properties required to update a security policy."""

    __flattened_items = ["parameters"]

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

    @overload
    def __init__(self, mapping: Mapping[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 SecurityPolicyUpdateProperties(_Model):
    """The json object that contains properties required to update a security policy.

    :ivar parameters: object which contains security policy parameters.
    :vartype parameters: ~azure.mgmt.cdn.models.SecurityPolicyPropertiesParameters
    """

    parameters: Optional["_models.SecurityPolicyPropertiesParameters"] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """object which contains security policy parameters."""

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

    @overload
    def __init__(self, mapping: Mapping[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 SecurityPolicyWebApplicationFirewallAssociation(_Model):  # pylint: disable=name-too-long
    """settings for security policy patterns to match.

    :ivar domains: List of domains.
    :vartype domains: list[~azure.mgmt.cdn.models.ActivatedResourceReference]
    :ivar patterns_to_match: List of paths.
    :vartype patterns_to_match: list[str]
    """

    domains: Optional[list["_models.ActivatedResourceReference"]] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """List of domains."""
    patterns_to_match: Optional[list[str]] = rest_field(
        name="patternsToMatch", visibility=["read", "create", "update", "delete", "query"]
    )
    """List of paths."""

    @overload
    def __init__(
        self,
        *,
        domains: Optional[list["_models.ActivatedResourceReference"]] = None,
        patterns_to_match: 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 SecurityPolicyWebApplicationFirewallParameters(
    SecurityPolicyPropertiesParameters, discriminator="WebApplicationFirewall"
):  # pylint: disable=name-too-long
    """The json object containing security policy waf parameters.

    :ivar waf_policy: Resource ID.
    :vartype waf_policy: ~azure.mgmt.cdn.models.ResourceReference
    :ivar associations: Waf associations.
    :vartype associations:
     list[~azure.mgmt.cdn.models.SecurityPolicyWebApplicationFirewallAssociation]
    :ivar type: The type of the Security policy to create. Required. WEB_APPLICATION_FIREWALL.
    :vartype type: str or ~azure.mgmt.cdn.models.WEB_APPLICATION_FIREWALL
    """

    waf_policy: Optional["_models.ResourceReference"] = rest_field(
        name="wafPolicy", visibility=["read", "create", "update", "delete", "query"]
    )
    """Resource ID."""
    associations: Optional[list["_models.SecurityPolicyWebApplicationFirewallAssociation"]] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """Waf associations."""
    type: Literal[SecurityPolicyType.WEB_APPLICATION_FIREWALL] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"])  # type: ignore
    """The type of the Security policy to create. Required. WEB_APPLICATION_FIREWALL."""

    @overload
    def __init__(
        self,
        *,
        waf_policy: Optional["_models.ResourceReference"] = None,
        associations: Optional[list["_models.SecurityPolicyWebApplicationFirewallAssociation"]] = None,
    ) -> None: ...

    @overload
    def __init__(self, mapping: Mapping[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.type = SecurityPolicyType.WEB_APPLICATION_FIREWALL  # type: ignore


class ServerPortMatchConditionParameters(
    DeliveryRuleConditionParameters, discriminator="DeliveryRuleServerPortConditionParameters"
):
    """Defines the parameters for ServerPort match conditions.

    :ivar operator: Describes operator to be matched. Required. Known values are: "Any", "Equal",
     "Contains", "BeginsWith", "EndsWith", "LessThan", "LessThanOrEqual", "GreaterThan",
     "GreaterThanOrEqual", and "RegEx".
    :vartype operator: str or ~azure.mgmt.cdn.models.ServerPortOperator
    :ivar negate_condition: Describes if this is negate condition or not.
    :vartype negate_condition: bool
    :ivar match_values: The match value for the condition of the delivery rule.
    :vartype match_values: list[str]
    :ivar transforms: List of transforms.
    :vartype transforms: list[str or ~azure.mgmt.cdn.models.Transform]
    :ivar type_name: Required. DELIVERY_RULE_SERVER_PORT_CONDITION_PARAMETERS.
    :vartype type_name: str or
     ~azure.mgmt.cdn.models.DELIVERY_RULE_SERVER_PORT_CONDITION_PARAMETERS
    """

    operator: Union[str, "_models.ServerPortOperator"] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """Describes operator to be matched. Required. Known values are: \"Any\", \"Equal\", \"Contains\",
     \"BeginsWith\", \"EndsWith\", \"LessThan\", \"LessThanOrEqual\", \"GreaterThan\",
     \"GreaterThanOrEqual\", and \"RegEx\"."""
    negate_condition: Optional[bool] = rest_field(
        name="negateCondition", visibility=["read", "create", "update", "delete", "query"]
    )
    """Describes if this is negate condition or not."""
    match_values: Optional[list[str]] = rest_field(
        name="matchValues", visibility=["read", "create", "update", "delete", "query"]
    )
    """The match value for the condition of the delivery rule."""
    transforms: Optional[list[Union[str, "_models.Transform"]]] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """List of transforms."""
    type_name: Literal[DeliveryRuleConditionParametersType.DELIVERY_RULE_SERVER_PORT_CONDITION_PARAMETERS] = rest_discriminator(name="typeName", visibility=["read", "create", "update", "delete", "query"])  # type: ignore
    """Required. DELIVERY_RULE_SERVER_PORT_CONDITION_PARAMETERS."""

    @overload
    def __init__(
        self,
        *,
        operator: Union[str, "_models.ServerPortOperator"],
        negate_condition: Optional[bool] = None,
        match_values: Optional[list[str]] = None,
        transforms: Optional[list[Union[str, "_models.Transform"]]] = None,
    ) -> None: ...

    @overload
    def __init__(self, mapping: Mapping[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.type_name = DeliveryRuleConditionParametersType.DELIVERY_RULE_SERVER_PORT_CONDITION_PARAMETERS  # type: ignore


class ServiceSpecification(_Model):
    """One property of operation, include log specifications.

    :ivar log_specifications: Log specifications of operation.
    :vartype log_specifications: list[~azure.mgmt.cdn.models.LogSpecification]
    :ivar metric_specifications: Metric specifications of operation.
    :vartype metric_specifications: list[~azure.mgmt.cdn.models.MetricSpecification]
    """

    log_specifications: Optional[list["_models.LogSpecification"]] = rest_field(
        name="logSpecifications", visibility=["read", "create", "update", "delete", "query"]
    )
    """Log specifications of operation."""
    metric_specifications: Optional[list["_models.MetricSpecification"]] = rest_field(
        name="metricSpecifications", visibility=["read", "create", "update", "delete", "query"]
    )
    """Metric specifications of operation."""

    @overload
    def __init__(
        self,
        *,
        log_specifications: Optional[list["_models.LogSpecification"]] = None,
        metric_specifications: Optional[list["_models.MetricSpecification"]] = None,
    ) -> None: ...

    @overload
    def __init__(self, mapping: Mapping[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 SharedPrivateLinkResourceProperties(_Model):
    """Describes the properties of an existing Shared Private Link Resource to use when connecting to
    a private origin.

    :ivar private_link: The resource id of the resource the shared private link resource is for.
    :vartype private_link: ~azure.mgmt.cdn.models.ResourceReference
    :ivar private_link_location: The location of the shared private link resource.
    :vartype private_link_location: str
    :ivar group_id: The group id from the provider of resource the shared private link resource is
     for.
    :vartype group_id: str
    :ivar request_message: The request message for requesting approval of the shared private link
     resource.
    :vartype request_message: str
    :ivar status: Status of the shared private link resource. Can be Pending, Approved, Rejected,
     Disconnected, or Timeout. Known values are: "Pending", "Approved", "Rejected", "Disconnected",
     and "Timeout".
    :vartype status: str or ~azure.mgmt.cdn.models.SharedPrivateLinkResourceStatus
    """

    private_link: Optional["_models.ResourceReference"] = rest_field(
        name="privateLink", visibility=["read", "create", "update", "delete", "query"]
    )
    """The resource id of the resource the shared private link resource is for."""
    private_link_location: Optional[str] = rest_field(
        name="privateLinkLocation", visibility=["read", "create", "update", "delete", "query"]
    )
    """The location of the shared private link resource."""
    group_id: Optional[str] = rest_field(name="groupId", visibility=["read", "create", "update", "delete", "query"])
    """The group id from the provider of resource the shared private link resource is for."""
    request_message: Optional[str] = rest_field(
        name="requestMessage", visibility=["read", "create", "update", "delete", "query"]
    )
    """The request message for requesting approval of the shared private link resource."""
    status: Optional[Union[str, "_models.SharedPrivateLinkResourceStatus"]] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """Status of the shared private link resource. Can be Pending, Approved, Rejected, Disconnected,
     or Timeout. Known values are: \"Pending\", \"Approved\", \"Rejected\", \"Disconnected\", and
     \"Timeout\"."""

    @overload
    def __init__(
        self,
        *,
        private_link: Optional["_models.ResourceReference"] = None,
        private_link_location: Optional[str] = None,
        group_id: Optional[str] = None,
        request_message: Optional[str] = None,
        status: Optional[Union[str, "_models.SharedPrivateLinkResourceStatus"]] = None,
    ) -> None: ...

    @overload
    def __init__(self, mapping: Mapping[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 Sku(_Model):
    """Standard_Verizon = The SKU name for a Standard Verizon CDN profile. Premium_Verizon = The SKU
    name for a Premium Verizon CDN profile. Custom_Verizon = The SKU name for a Custom Verizon CDN
    profile. Standard_Akamai = The SKU name for an Akamai CDN profile. Standard_ChinaCdn = The SKU
    name for a China CDN profile for VOD, Web and download scenarios using GB based billing model.
    Standard_Microsoft = The SKU name for a Standard Microsoft CDN profile. Standard_AzureFrontDoor
    =  The SKU name for an Azure Front Door Standard profile. Premium_AzureFrontDoor = The SKU name
    for an Azure Front Door Premium profile. Standard_955BandWidth_ChinaCdn = The SKU name for a
    China CDN profile for VOD, Web and download scenarios using 95-5 peak bandwidth billing model.
    Standard_AvgBandWidth_ChinaCdn = The SKU name for a China CDN profile for VOD, Web and download
    scenarios using monthly average peak bandwidth billing model. StandardPlus_ChinaCdn = The SKU
    name for a China CDN profile for live-streaming using GB based billing model.
    StandardPlus_955BandWidth_ChinaCdn = The SKU name for a China CDN live-streaming profile using
    95-5 peak bandwidth billing model. StandardPlus_AvgBandWidth_ChinaCdn = The SKU name for a
    China CDN live-streaming profile using monthly average peak bandwidth billing model.

    :ivar name: Name of the pricing tier. Known values are: "Standard_Verizon", "Premium_Verizon",
     "Custom_Verizon", "Standard_Akamai", "Standard_ChinaCdn", "Standard_Microsoft",
     "Standard_AzureFrontDoor", "Premium_AzureFrontDoor", "Standard_955BandWidth_ChinaCdn",
     "Standard_AvgBandWidth_ChinaCdn", "StandardPlus_ChinaCdn",
     "StandardPlus_955BandWidth_ChinaCdn", and "StandardPlus_AvgBandWidth_ChinaCdn".
    :vartype name: str or ~azure.mgmt.cdn.models.SkuName
    """

    name: Optional[Union[str, "_models.SkuName"]] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """Name of the pricing tier. Known values are: \"Standard_Verizon\", \"Premium_Verizon\",
     \"Custom_Verizon\", \"Standard_Akamai\", \"Standard_ChinaCdn\", \"Standard_Microsoft\",
     \"Standard_AzureFrontDoor\", \"Premium_AzureFrontDoor\", \"Standard_955BandWidth_ChinaCdn\",
     \"Standard_AvgBandWidth_ChinaCdn\", \"StandardPlus_ChinaCdn\",
     \"StandardPlus_955BandWidth_ChinaCdn\", and \"StandardPlus_AvgBandWidth_ChinaCdn\"."""

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

    @overload
    def __init__(self, mapping: Mapping[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 SocketAddrMatchConditionParameters(
    DeliveryRuleConditionParameters, discriminator="DeliveryRuleSocketAddrConditionParameters"
):
    """Defines the parameters for SocketAddress match conditions.

    :ivar operator: Describes operator to be matched. Required. Known values are: "Any" and
     "IPMatch".
    :vartype operator: str or ~azure.mgmt.cdn.models.SocketAddrOperator
    :ivar negate_condition: Describes if this is negate condition or not.
    :vartype negate_condition: bool
    :ivar match_values: The match value for the condition of the delivery rule.
    :vartype match_values: list[str]
    :ivar transforms: List of transforms.
    :vartype transforms: list[str or ~azure.mgmt.cdn.models.Transform]
    :ivar type_name: Required. DELIVERY_RULE_SOCKET_ADDR_CONDITION_PARAMETERS.
    :vartype type_name: str or
     ~azure.mgmt.cdn.models.DELIVERY_RULE_SOCKET_ADDR_CONDITION_PARAMETERS
    """

    operator: Union[str, "_models.SocketAddrOperator"] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """Describes operator to be matched. Required. Known values are: \"Any\" and \"IPMatch\"."""
    negate_condition: Optional[bool] = rest_field(
        name="negateCondition", visibility=["read", "create", "update", "delete", "query"]
    )
    """Describes if this is negate condition or not."""
    match_values: Optional[list[str]] = rest_field(
        name="matchValues", visibility=["read", "create", "update", "delete", "query"]
    )
    """The match value for the condition of the delivery rule."""
    transforms: Optional[list[Union[str, "_models.Transform"]]] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """List of transforms."""
    type_name: Literal[DeliveryRuleConditionParametersType.DELIVERY_RULE_SOCKET_ADDR_CONDITION_PARAMETERS] = rest_discriminator(name="typeName", visibility=["read", "create", "update", "delete", "query"])  # type: ignore
    """Required. DELIVERY_RULE_SOCKET_ADDR_CONDITION_PARAMETERS."""

    @overload
    def __init__(
        self,
        *,
        operator: Union[str, "_models.SocketAddrOperator"],
        negate_condition: Optional[bool] = None,
        match_values: Optional[list[str]] = None,
        transforms: Optional[list[Union[str, "_models.Transform"]]] = None,
    ) -> None: ...

    @overload
    def __init__(self, mapping: Mapping[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.type_name = DeliveryRuleConditionParametersType.DELIVERY_RULE_SOCKET_ADDR_CONDITION_PARAMETERS  # type: ignore


class SslProtocolMatchConditionParameters(
    DeliveryRuleConditionParameters, discriminator="DeliveryRuleSslProtocolConditionParameters"
):
    """Defines the parameters for SslProtocol match conditions.

    :ivar operator: Describes operator to be matched. Required. "Equal"
    :vartype operator: str or ~azure.mgmt.cdn.models.SslProtocolOperator
    :ivar negate_condition: Describes if this is negate condition or not.
    :vartype negate_condition: bool
    :ivar match_values: The match value for the condition of the delivery rule.
    :vartype match_values: list[str or ~azure.mgmt.cdn.models.SslProtocol]
    :ivar transforms: List of transforms.
    :vartype transforms: list[str or ~azure.mgmt.cdn.models.Transform]
    :ivar type_name: Required. DELIVERY_RULE_SSL_PROTOCOL_CONDITION_PARAMETERS.
    :vartype type_name: str or
     ~azure.mgmt.cdn.models.DELIVERY_RULE_SSL_PROTOCOL_CONDITION_PARAMETERS
    """

    operator: Union[str, "_models.SslProtocolOperator"] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """Describes operator to be matched. Required. \"Equal\""""
    negate_condition: Optional[bool] = rest_field(
        name="negateCondition", visibility=["read", "create", "update", "delete", "query"]
    )
    """Describes if this is negate condition or not."""
    match_values: Optional[list[Union[str, "_models.SslProtocol"]]] = rest_field(
        name="matchValues", visibility=["read", "create", "update", "delete", "query"]
    )
    """The match value for the condition of the delivery rule."""
    transforms: Optional[list[Union[str, "_models.Transform"]]] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """List of transforms."""
    type_name: Literal[DeliveryRuleConditionParametersType.DELIVERY_RULE_SSL_PROTOCOL_CONDITION_PARAMETERS] = rest_discriminator(name="typeName", visibility=["read", "create", "update", "delete", "query"])  # type: ignore
    """Required. DELIVERY_RULE_SSL_PROTOCOL_CONDITION_PARAMETERS."""

    @overload
    def __init__(
        self,
        *,
        operator: Union[str, "_models.SslProtocolOperator"],
        negate_condition: Optional[bool] = None,
        match_values: Optional[list[Union[str, "_models.SslProtocol"]]] = None,
        transforms: Optional[list[Union[str, "_models.Transform"]]] = None,
    ) -> None: ...

    @overload
    def __init__(self, mapping: Mapping[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.type_name = DeliveryRuleConditionParametersType.DELIVERY_RULE_SSL_PROTOCOL_CONDITION_PARAMETERS  # type: ignore


class SsoUri(_Model):
    """The URI required to login to the supplemental portal from the Azure portal.

    :ivar sso_uri_value: The URI used to login to the supplemental portal.
    :vartype sso_uri_value: str
    """

    sso_uri_value: Optional[str] = rest_field(name="ssoUriValue", visibility=["read"])
    """The URI used to login to the supplemental portal."""


class SupportedOptimizationTypesListResult(_Model):
    """The result of the GetSupportedOptimizationTypes API.

    :ivar supported_optimization_types: Supported optimization types for a profile.
    :vartype supported_optimization_types: list[str or ~azure.mgmt.cdn.models.OptimizationType]
    """

    supported_optimization_types: Optional[list[Union[str, "_models.OptimizationType"]]] = rest_field(
        name="supportedOptimizationTypes", visibility=["read"]
    )
    """Supported optimization types for a profile."""


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.cdn.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.cdn.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 UrlFileExtensionMatchConditionParameters(
    DeliveryRuleConditionParameters, discriminator="DeliveryRuleUrlFileExtensionMatchConditionParameters"
):
    """Defines the parameters for UrlFileExtension match conditions.

    :ivar operator: Describes operator to be matched. Required. Known values are: "Any", "Equal",
     "Contains", "BeginsWith", "EndsWith", "LessThan", "LessThanOrEqual", "GreaterThan",
     "GreaterThanOrEqual", and "RegEx".
    :vartype operator: str or ~azure.mgmt.cdn.models.UrlFileExtensionOperator
    :ivar negate_condition: Describes if this is negate condition or not.
    :vartype negate_condition: bool
    :ivar match_values: The match value for the condition of the delivery rule.
    :vartype match_values: list[str]
    :ivar transforms: List of transforms.
    :vartype transforms: list[str or ~azure.mgmt.cdn.models.Transform]
    :ivar type_name: Required. DELIVERY_RULE_URL_FILE_EXTENSION_MATCH_CONDITION_PARAMETERS.
    :vartype type_name: str or
     ~azure.mgmt.cdn.models.DELIVERY_RULE_URL_FILE_EXTENSION_MATCH_CONDITION_PARAMETERS
    """

    operator: Union[str, "_models.UrlFileExtensionOperator"] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """Describes operator to be matched. Required. Known values are: \"Any\", \"Equal\", \"Contains\",
     \"BeginsWith\", \"EndsWith\", \"LessThan\", \"LessThanOrEqual\", \"GreaterThan\",
     \"GreaterThanOrEqual\", and \"RegEx\"."""
    negate_condition: Optional[bool] = rest_field(
        name="negateCondition", visibility=["read", "create", "update", "delete", "query"]
    )
    """Describes if this is negate condition or not."""
    match_values: Optional[list[str]] = rest_field(
        name="matchValues", visibility=["read", "create", "update", "delete", "query"]
    )
    """The match value for the condition of the delivery rule."""
    transforms: Optional[list[Union[str, "_models.Transform"]]] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """List of transforms."""
    type_name: Literal[DeliveryRuleConditionParametersType.DELIVERY_RULE_URL_FILE_EXTENSION_MATCH_CONDITION_PARAMETERS] = rest_discriminator(name="typeName", visibility=["read", "create", "update", "delete", "query"])  # type: ignore
    """Required. DELIVERY_RULE_URL_FILE_EXTENSION_MATCH_CONDITION_PARAMETERS."""

    @overload
    def __init__(
        self,
        *,
        operator: Union[str, "_models.UrlFileExtensionOperator"],
        negate_condition: Optional[bool] = None,
        match_values: Optional[list[str]] = None,
        transforms: Optional[list[Union[str, "_models.Transform"]]] = None,
    ) -> None: ...

    @overload
    def __init__(self, mapping: Mapping[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.type_name = DeliveryRuleConditionParametersType.DELIVERY_RULE_URL_FILE_EXTENSION_MATCH_CONDITION_PARAMETERS  # type: ignore


class UrlFileNameMatchConditionParameters(
    DeliveryRuleConditionParameters, discriminator="DeliveryRuleUrlFilenameConditionParameters"
):
    """Defines the parameters for UrlFilename match conditions.

    :ivar operator: Describes operator to be matched. Required. Known values are: "Any", "Equal",
     "Contains", "BeginsWith", "EndsWith", "LessThan", "LessThanOrEqual", "GreaterThan",
     "GreaterThanOrEqual", and "RegEx".
    :vartype operator: str or ~azure.mgmt.cdn.models.UrlFileNameOperator
    :ivar negate_condition: Describes if this is negate condition or not.
    :vartype negate_condition: bool
    :ivar match_values: The match value for the condition of the delivery rule.
    :vartype match_values: list[str]
    :ivar transforms: List of transforms.
    :vartype transforms: list[str or ~azure.mgmt.cdn.models.Transform]
    :ivar type_name: Required. DELIVERY_RULE_URL_FILENAME_CONDITION_PARAMETERS.
    :vartype type_name: str or
     ~azure.mgmt.cdn.models.DELIVERY_RULE_URL_FILENAME_CONDITION_PARAMETERS
    """

    operator: Union[str, "_models.UrlFileNameOperator"] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """Describes operator to be matched. Required. Known values are: \"Any\", \"Equal\", \"Contains\",
     \"BeginsWith\", \"EndsWith\", \"LessThan\", \"LessThanOrEqual\", \"GreaterThan\",
     \"GreaterThanOrEqual\", and \"RegEx\"."""
    negate_condition: Optional[bool] = rest_field(
        name="negateCondition", visibility=["read", "create", "update", "delete", "query"]
    )
    """Describes if this is negate condition or not."""
    match_values: Optional[list[str]] = rest_field(
        name="matchValues", visibility=["read", "create", "update", "delete", "query"]
    )
    """The match value for the condition of the delivery rule."""
    transforms: Optional[list[Union[str, "_models.Transform"]]] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """List of transforms."""
    type_name: Literal[DeliveryRuleConditionParametersType.DELIVERY_RULE_URL_FILENAME_CONDITION_PARAMETERS] = rest_discriminator(name="typeName", visibility=["read", "create", "update", "delete", "query"])  # type: ignore
    """Required. DELIVERY_RULE_URL_FILENAME_CONDITION_PARAMETERS."""

    @overload
    def __init__(
        self,
        *,
        operator: Union[str, "_models.UrlFileNameOperator"],
        negate_condition: Optional[bool] = None,
        match_values: Optional[list[str]] = None,
        transforms: Optional[list[Union[str, "_models.Transform"]]] = None,
    ) -> None: ...

    @overload
    def __init__(self, mapping: Mapping[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.type_name = DeliveryRuleConditionParametersType.DELIVERY_RULE_URL_FILENAME_CONDITION_PARAMETERS  # type: ignore


class UrlPathMatchConditionParameters(
    DeliveryRuleConditionParameters, discriminator="DeliveryRuleUrlPathMatchConditionParameters"
):
    """Defines the parameters for UrlPath match conditions.

    :ivar operator: Describes operator to be matched. Required. Known values are: "Any", "Equal",
     "Contains", "BeginsWith", "EndsWith", "LessThan", "LessThanOrEqual", "GreaterThan",
     "GreaterThanOrEqual", "Wildcard", and "RegEx".
    :vartype operator: str or ~azure.mgmt.cdn.models.UrlPathOperator
    :ivar negate_condition: Describes if this is negate condition or not.
    :vartype negate_condition: bool
    :ivar match_values: The match value for the condition of the delivery rule.
    :vartype match_values: list[str]
    :ivar transforms: List of transforms.
    :vartype transforms: list[str or ~azure.mgmt.cdn.models.Transform]
    :ivar type_name: Required. DELIVERY_RULE_URL_PATH_MATCH_CONDITION_PARAMETERS.
    :vartype type_name: str or
     ~azure.mgmt.cdn.models.DELIVERY_RULE_URL_PATH_MATCH_CONDITION_PARAMETERS
    """

    operator: Union[str, "_models.UrlPathOperator"] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """Describes operator to be matched. Required. Known values are: \"Any\", \"Equal\", \"Contains\",
     \"BeginsWith\", \"EndsWith\", \"LessThan\", \"LessThanOrEqual\", \"GreaterThan\",
     \"GreaterThanOrEqual\", \"Wildcard\", and \"RegEx\"."""
    negate_condition: Optional[bool] = rest_field(
        name="negateCondition", visibility=["read", "create", "update", "delete", "query"]
    )
    """Describes if this is negate condition or not."""
    match_values: Optional[list[str]] = rest_field(
        name="matchValues", visibility=["read", "create", "update", "delete", "query"]
    )
    """The match value for the condition of the delivery rule."""
    transforms: Optional[list[Union[str, "_models.Transform"]]] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """List of transforms."""
    type_name: Literal[DeliveryRuleConditionParametersType.DELIVERY_RULE_URL_PATH_MATCH_CONDITION_PARAMETERS] = rest_discriminator(name="typeName", visibility=["read", "create", "update", "delete", "query"])  # type: ignore
    """Required. DELIVERY_RULE_URL_PATH_MATCH_CONDITION_PARAMETERS."""

    @overload
    def __init__(
        self,
        *,
        operator: Union[str, "_models.UrlPathOperator"],
        negate_condition: Optional[bool] = None,
        match_values: Optional[list[str]] = None,
        transforms: Optional[list[Union[str, "_models.Transform"]]] = None,
    ) -> None: ...

    @overload
    def __init__(self, mapping: Mapping[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.type_name = DeliveryRuleConditionParametersType.DELIVERY_RULE_URL_PATH_MATCH_CONDITION_PARAMETERS  # type: ignore


class UrlRedirectAction(DeliveryRuleAction, discriminator="UrlRedirect"):
    """Defines the url redirect action for the delivery rule.

    :ivar parameters: Defines the parameters for the action. Required.
    :vartype parameters: ~azure.mgmt.cdn.models.UrlRedirectActionParameters
    :ivar name: The name of the action for the delivery rule. Required. URL_REDIRECT.
    :vartype name: str or ~azure.mgmt.cdn.models.URL_REDIRECT
    """

    parameters: "_models.UrlRedirectActionParameters" = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """Defines the parameters for the action. Required."""
    name: Literal[DeliveryRuleActionEnum.URL_REDIRECT] = rest_discriminator(name="name", visibility=["read", "create", "update", "delete", "query"])  # type: ignore
    """The name of the action for the delivery rule. Required. URL_REDIRECT."""

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

    @overload
    def __init__(self, mapping: Mapping[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.name = DeliveryRuleActionEnum.URL_REDIRECT  # type: ignore


class UrlRedirectActionParameters(
    DeliveryRuleActionParameters, discriminator="DeliveryRuleUrlRedirectActionParameters"
):
    """Defines the parameters for the url redirect action.

    :ivar redirect_type: The redirect type the rule will use when redirecting traffic. Required.
     Known values are: "Moved", "Found", "TemporaryRedirect", and "PermanentRedirect".
    :vartype redirect_type: str or ~azure.mgmt.cdn.models.RedirectType
    :ivar destination_protocol: Protocol to use for the redirect. The default value is
     MatchRequest. Known values are: "MatchRequest", "Http", and "Https".
    :vartype destination_protocol: str or ~azure.mgmt.cdn.models.DestinationProtocol
    :ivar custom_path: The full path to redirect. Path cannot be empty and must start with /. Leave
     empty to use the incoming path as destination path.
    :vartype custom_path: str
    :ivar custom_hostname: Host to redirect. Leave empty to use the incoming host as the
     destination host.
    :vartype custom_hostname: str
    :ivar custom_query_string: The set of query strings to be placed in the redirect URL. Setting
     this value would replace any existing query string; leave empty to preserve the incoming query
     string. Query string must be in <key>=<value> format. ? and & will be added automatically so do
     not include them.
    :vartype custom_query_string: str
    :ivar custom_fragment: Fragment to add to the redirect URL. Fragment is the part of the URL
     that comes after #. Do not include the #.
    :vartype custom_fragment: str
    :ivar type_name: Required. DELIVERY_RULE_URL_REDIRECT_ACTION_PARAMETERS.
    :vartype type_name: str or ~azure.mgmt.cdn.models.DELIVERY_RULE_URL_REDIRECT_ACTION_PARAMETERS
    """

    redirect_type: Union[str, "_models.RedirectType"] = rest_field(
        name="redirectType", visibility=["read", "create", "update", "delete", "query"]
    )
    """The redirect type the rule will use when redirecting traffic. Required. Known values are:
     \"Moved\", \"Found\", \"TemporaryRedirect\", and \"PermanentRedirect\"."""
    destination_protocol: Optional[Union[str, "_models.DestinationProtocol"]] = rest_field(
        name="destinationProtocol", visibility=["read", "create", "update", "delete", "query"]
    )
    """Protocol to use for the redirect. The default value is MatchRequest. Known values are:
     \"MatchRequest\", \"Http\", and \"Https\"."""
    custom_path: Optional[str] = rest_field(
        name="customPath", visibility=["read", "create", "update", "delete", "query"]
    )
    """The full path to redirect. Path cannot be empty and must start with /. Leave empty to use the
     incoming path as destination path."""
    custom_hostname: Optional[str] = rest_field(
        name="customHostname", visibility=["read", "create", "update", "delete", "query"]
    )
    """Host to redirect. Leave empty to use the incoming host as the destination host."""
    custom_query_string: Optional[str] = rest_field(
        name="customQueryString", visibility=["read", "create", "update", "delete", "query"]
    )
    """The set of query strings to be placed in the redirect URL. Setting this value would replace any
     existing query string; leave empty to preserve the incoming query string. Query string must be
     in <key>=<value> format. ? and & will be added automatically so do not include them."""
    custom_fragment: Optional[str] = rest_field(
        name="customFragment", visibility=["read", "create", "update", "delete", "query"]
    )
    """Fragment to add to the redirect URL. Fragment is the part of the URL that comes after #. Do not
     include the #."""
    type_name: Literal[DeliveryRuleActionParametersType.DELIVERY_RULE_URL_REDIRECT_ACTION_PARAMETERS] = rest_discriminator(name="typeName", visibility=["read", "create", "update", "delete", "query"])  # type: ignore
    """Required. DELIVERY_RULE_URL_REDIRECT_ACTION_PARAMETERS."""

    @overload
    def __init__(
        self,
        *,
        redirect_type: Union[str, "_models.RedirectType"],
        destination_protocol: Optional[Union[str, "_models.DestinationProtocol"]] = None,
        custom_path: Optional[str] = None,
        custom_hostname: Optional[str] = None,
        custom_query_string: Optional[str] = None,
        custom_fragment: 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.type_name = DeliveryRuleActionParametersType.DELIVERY_RULE_URL_REDIRECT_ACTION_PARAMETERS  # type: ignore


class UrlRewriteAction(DeliveryRuleAction, discriminator="UrlRewrite"):
    """Defines the url rewrite action for the delivery rule.

    :ivar parameters: Defines the parameters for the action. Required.
    :vartype parameters: ~azure.mgmt.cdn.models.UrlRewriteActionParameters
    :ivar name: The name of the action for the delivery rule. Required. URL_REWRITE.
    :vartype name: str or ~azure.mgmt.cdn.models.URL_REWRITE
    """

    parameters: "_models.UrlRewriteActionParameters" = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """Defines the parameters for the action. Required."""
    name: Literal[DeliveryRuleActionEnum.URL_REWRITE] = rest_discriminator(name="name", visibility=["read", "create", "update", "delete", "query"])  # type: ignore
    """The name of the action for the delivery rule. Required. URL_REWRITE."""

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

    @overload
    def __init__(self, mapping: Mapping[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.name = DeliveryRuleActionEnum.URL_REWRITE  # type: ignore


class UrlRewriteActionParameters(DeliveryRuleActionParameters, discriminator="DeliveryRuleUrlRewriteActionParameters"):
    """Defines the parameters for the url rewrite action.

    :ivar source_pattern: define a request URI pattern that identifies the type of requests that
     may be rewritten. If value is blank, all strings are matched. Required.
    :vartype source_pattern: str
    :ivar destination: Define the relative URL to which the above requests will be rewritten by.
     Required.
    :vartype destination: str
    :ivar preserve_unmatched_path: Whether to preserve unmatched path. Default value is true.
    :vartype preserve_unmatched_path: bool
    :ivar type_name: Required. DELIVERY_RULE_URL_REWRITE_ACTION_PARAMETERS.
    :vartype type_name: str or ~azure.mgmt.cdn.models.DELIVERY_RULE_URL_REWRITE_ACTION_PARAMETERS
    """

    source_pattern: str = rest_field(name="sourcePattern", visibility=["read", "create", "update", "delete", "query"])
    """define a request URI pattern that identifies the type of requests that may be rewritten. If
     value is blank, all strings are matched. Required."""
    destination: str = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """Define the relative URL to which the above requests will be rewritten by. Required."""
    preserve_unmatched_path: Optional[bool] = rest_field(
        name="preserveUnmatchedPath", visibility=["read", "create", "update", "delete", "query"]
    )
    """Whether to preserve unmatched path. Default value is true."""
    type_name: Literal[DeliveryRuleActionParametersType.DELIVERY_RULE_URL_REWRITE_ACTION_PARAMETERS] = rest_discriminator(name="typeName", visibility=["read", "create", "update", "delete", "query"])  # type: ignore
    """Required. DELIVERY_RULE_URL_REWRITE_ACTION_PARAMETERS."""

    @overload
    def __init__(
        self,
        *,
        source_pattern: str,
        destination: str,
        preserve_unmatched_path: 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.type_name = DeliveryRuleActionParametersType.DELIVERY_RULE_URL_REWRITE_ACTION_PARAMETERS  # type: ignore


class UrlSigningAction(DeliveryRuleAction, discriminator="UrlSigning"):
    """Defines the url signing action for the delivery rule.

    :ivar parameters: Defines the parameters for the action. Required.
    :vartype parameters: ~azure.mgmt.cdn.models.UrlSigningActionParameters
    :ivar name: The name of the action for the delivery rule. Required. URL_SIGNING.
    :vartype name: str or ~azure.mgmt.cdn.models.URL_SIGNING
    """

    parameters: "_models.UrlSigningActionParameters" = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """Defines the parameters for the action. Required."""
    name: Literal[DeliveryRuleActionEnum.URL_SIGNING] = rest_discriminator(name="name", visibility=["read", "create", "update", "delete", "query"])  # type: ignore
    """The name of the action for the delivery rule. Required. URL_SIGNING."""

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

    @overload
    def __init__(self, mapping: Mapping[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.name = DeliveryRuleActionEnum.URL_SIGNING  # type: ignore


class UrlSigningActionParameters(DeliveryRuleActionParameters, discriminator="DeliveryRuleUrlSigningActionParameters"):
    """Defines the parameters for the Url Signing action.

    :ivar algorithm: Algorithm to use for URL signing. "SHA256"
    :vartype algorithm: str or ~azure.mgmt.cdn.models.Algorithm
    :ivar parameter_name_override: Defines which query string parameters in the url to be
     considered for expires, key id etc.
    :vartype parameter_name_override: list[~azure.mgmt.cdn.models.UrlSigningParamIdentifier]
    :ivar type_name: Required. DELIVERY_RULE_URL_SIGNING_ACTION_PARAMETERS.
    :vartype type_name: str or ~azure.mgmt.cdn.models.DELIVERY_RULE_URL_SIGNING_ACTION_PARAMETERS
    """

    algorithm: Optional[Union[str, "_models.Algorithm"]] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """Algorithm to use for URL signing. \"SHA256\""""
    parameter_name_override: Optional[list["_models.UrlSigningParamIdentifier"]] = rest_field(
        name="parameterNameOverride", visibility=["read", "create", "update", "delete", "query"]
    )
    """Defines which query string parameters in the url to be considered for expires, key id etc."""
    type_name: Literal[DeliveryRuleActionParametersType.DELIVERY_RULE_URL_SIGNING_ACTION_PARAMETERS] = rest_discriminator(name="typeName", visibility=["read", "create", "update", "delete", "query"])  # type: ignore
    """Required. DELIVERY_RULE_URL_SIGNING_ACTION_PARAMETERS."""

    @overload
    def __init__(
        self,
        *,
        algorithm: Optional[Union[str, "_models.Algorithm"]] = None,
        parameter_name_override: Optional[list["_models.UrlSigningParamIdentifier"]] = None,
    ) -> None: ...

    @overload
    def __init__(self, mapping: Mapping[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.type_name = DeliveryRuleActionParametersType.DELIVERY_RULE_URL_SIGNING_ACTION_PARAMETERS  # type: ignore


class UrlSigningKey(_Model):
    """Url signing key.

    :ivar key_id: Defines the customer defined key Id. This id will exist in the incoming request
     to indicate the key used to form the hash. Required.
    :vartype key_id: str
    :ivar key_source_parameters: Defines the parameters for using customer key vault for Url
     Signing Key. Required.
    :vartype key_source_parameters: ~azure.mgmt.cdn.models.KeyVaultSigningKeyParameters
    """

    key_id: str = rest_field(name="keyId", visibility=["read", "create", "update", "delete", "query"])
    """Defines the customer defined key Id. This id will exist in the incoming request to indicate the
     key used to form the hash. Required."""
    key_source_parameters: "_models.KeyVaultSigningKeyParameters" = rest_field(
        name="keySourceParameters", visibility=["read", "create", "update", "delete", "query"]
    )
    """Defines the parameters for using customer key vault for Url Signing Key. Required."""

    @overload
    def __init__(
        self,
        *,
        key_id: str,
        key_source_parameters: "_models.KeyVaultSigningKeyParameters",
    ) -> None: ...

    @overload
    def __init__(self, mapping: Mapping[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 UrlSigningKeyParameters(SecretParameters, discriminator="UrlSigningKey"):
    """Url signing key parameters.

    :ivar key_id: Defines the customer defined key Id. This id will exist in the incoming request
     to indicate the key used to form the hash. Required.
    :vartype key_id: str
    :ivar secret_source: Resource reference to the Azure Key Vault secret. Expected to be in format
     of
     /subscriptions/{​​​​​​​​​subscriptionId}​​​​​​​​​/resourceGroups/{​​​​​​​​​resourceGroupName}​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​/providers/Microsoft.KeyVault/vaults/{vaultName}​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​/secrets/{secretName}​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​.
     Required.
    :vartype secret_source: ~azure.mgmt.cdn.models.ResourceReference
    :ivar secret_version: Version of the secret to be used. Required.
    :vartype secret_version: str
    :ivar type: The type of the secret resource. Required. URL_SIGNING_KEY.
    :vartype type: str or ~azure.mgmt.cdn.models.URL_SIGNING_KEY
    """

    key_id: str = rest_field(name="keyId", visibility=["read", "create", "update", "delete", "query"])
    """Defines the customer defined key Id. This id will exist in the incoming request to indicate the
     key used to form the hash. Required."""
    secret_source: "_models.ResourceReference" = rest_field(
        name="secretSource", visibility=["read", "create", "update", "delete", "query"]
    )
    """Resource reference to the Azure Key Vault secret. Expected to be in format of
     /subscriptions/{​​​​​​​​​subscriptionId}​​​​​​​​​/resourceGroups/{​​​​​​​​​resourceGroupName}​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​/providers/Microsoft.KeyVault/vaults/{vaultName}​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​/secrets/{secretName}​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​.
     Required."""
    secret_version: str = rest_field(name="secretVersion", visibility=["read", "create", "update", "delete", "query"])
    """Version of the secret to be used. Required."""
    type: Literal[SecretType.URL_SIGNING_KEY] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"])  # type: ignore
    """The type of the secret resource. Required. URL_SIGNING_KEY."""

    @overload
    def __init__(
        self,
        *,
        key_id: str,
        secret_source: "_models.ResourceReference",
        secret_version: 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)
        self.type = SecretType.URL_SIGNING_KEY  # type: ignore


class UrlSigningParamIdentifier(_Model):
    """Defines how to identify a parameter for a specific purpose e.g. expires.

    :ivar param_indicator: Indicates the purpose of the parameter. Required. Known values are:
     "Expires", "KeyId", and "Signature".
    :vartype param_indicator: str or ~azure.mgmt.cdn.models.ParamIndicator
    :ivar param_name: Parameter name. Required.
    :vartype param_name: str
    """

    param_indicator: Union[str, "_models.ParamIndicator"] = rest_field(
        name="paramIndicator", visibility=["read", "create", "update", "delete", "query"]
    )
    """Indicates the purpose of the parameter. Required. Known values are: \"Expires\", \"KeyId\", and
     \"Signature\"."""
    param_name: str = rest_field(name="paramName", visibility=["read", "create", "update", "delete", "query"])
    """Parameter name. Required."""

    @overload
    def __init__(
        self,
        *,
        param_indicator: Union[str, "_models.ParamIndicator"],
        param_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 Usage(_Model):
    """Describes resource usage.

    :ivar id: Resource identifier.
    :vartype id: str
    :ivar unit: An enum describing the unit of measurement. Required. "Count"
    :vartype unit: str or ~azure.mgmt.cdn.models.UsageUnit
    :ivar current_value: The current value of the usage. Required.
    :vartype current_value: int
    :ivar limit: The limit of usage. Required.
    :vartype limit: int
    :ivar name: The name of the type of usage. Required.
    :vartype name: ~azure.mgmt.cdn.models.UsageName
    """

    id: Optional[str] = rest_field(visibility=["read"])
    """Resource identifier."""
    unit: Union[str, "_models.UsageUnit"] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """An enum describing the unit of measurement. Required. \"Count\""""
    current_value: int = rest_field(name="currentValue", visibility=["read", "create", "update", "delete", "query"])
    """The current value of the usage. Required."""
    limit: int = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """The limit of usage. Required."""
    name: "_models.UsageName" = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """The name of the type of usage. Required."""

    @overload
    def __init__(
        self,
        *,
        unit: Union[str, "_models.UsageUnit"],
        current_value: int,
        limit: int,
        name: "_models.UsageName",
    ) -> None: ...

    @overload
    def __init__(self, mapping: Mapping[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 UsageName(_Model):
    """The usage names.

    :ivar value: A string describing the resource name.
    :vartype value: str
    :ivar localized_value: A localized string describing the resource name.
    :vartype localized_value: str
    """

    value: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """A string describing the resource name."""
    localized_value: Optional[str] = rest_field(
        name="localizedValue", visibility=["read", "create", "update", "delete", "query"]
    )
    """A localized string describing the resource name."""

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

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

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


class UserAssignedIdentity(_Model):
    """User assigned identity properties.

    :ivar principal_id: The principal ID of the assigned identity.
    :vartype principal_id: str
    :ivar client_id: The client ID of the assigned identity.
    :vartype client_id: str
    """

    principal_id: Optional[str] = rest_field(name="principalId", visibility=["read"])
    """The principal ID of the assigned identity."""
    client_id: Optional[str] = rest_field(name="clientId", visibility=["read"])
    """The client ID of the assigned identity."""


class UserManagedHttpsParameters(CustomDomainHttpsParameters, discriminator="AzureKeyVault"):
    """Defines the certificate source parameters using user's keyvault certificate for enabling SSL.

    :ivar protocol_type: Defines the TLS extension protocol that is used for secure delivery.
     Required. Known values are: "ServerNameIndication" and "IPBased".
    :vartype protocol_type: str or ~azure.mgmt.cdn.models.ProtocolType
    :ivar minimum_tls_version: TLS protocol version that will be used for Https. Known values are:
     "None", "TLS10", and "TLS12".
    :vartype minimum_tls_version: str or ~azure.mgmt.cdn.models.MinimumTlsVersion
    :ivar certificate_source_parameters: Defines the certificate source parameters using user's
     keyvault certificate for enabling SSL. Required.
    :vartype certificate_source_parameters:
     ~azure.mgmt.cdn.models.KeyVaultCertificateSourceParameters
    :ivar certificate_source: Defines the source of the SSL certificate. Required. AZURE_KEY_VAULT.
    :vartype certificate_source: str or ~azure.mgmt.cdn.models.AZURE_KEY_VAULT
    """

    certificate_source_parameters: "_models.KeyVaultCertificateSourceParameters" = rest_field(
        name="certificateSourceParameters", visibility=["read", "create", "update", "delete", "query"]
    )
    """Defines the certificate source parameters using user's keyvault certificate for enabling SSL.
     Required."""
    certificate_source: Literal[CertificateSource.AZURE_KEY_VAULT] = rest_discriminator(name="certificateSource", visibility=["read", "create", "update", "delete", "query"])  # type: ignore
    """Defines the source of the SSL certificate. Required. AZURE_KEY_VAULT."""

    @overload
    def __init__(
        self,
        *,
        protocol_type: Union[str, "_models.ProtocolType"],
        certificate_source_parameters: "_models.KeyVaultCertificateSourceParameters",
        minimum_tls_version: Optional[Union[str, "_models.MinimumTlsVersion"]] = None,
    ) -> None: ...

    @overload
    def __init__(self, mapping: Mapping[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.certificate_source = CertificateSource.AZURE_KEY_VAULT  # type: ignore


class ValidateCustomDomainInput(_Model):
    """Input of the custom domain to be validated for DNS mapping.

    :ivar host_name: The host name of the custom domain. Must be a domain name. Required.
    :vartype host_name: str
    """

    host_name: str = rest_field(name="hostName", visibility=["read", "create", "update", "delete", "query"])
    """The host name of the custom domain. Must be a domain name. Required."""

    @overload
    def __init__(
        self,
        *,
        host_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 ValidateCustomDomainOutput(_Model):
    """Output of custom domain validation.

    :ivar custom_domain_validated: Indicates whether the custom domain is valid or not.
    :vartype custom_domain_validated: bool
    :ivar reason: The reason why the custom domain is not valid.
    :vartype reason: str
    :ivar message: Error message describing why the custom domain is not valid.
    :vartype message: str
    """

    custom_domain_validated: Optional[bool] = rest_field(name="customDomainValidated", visibility=["read"])
    """Indicates whether the custom domain is valid or not."""
    reason: Optional[str] = rest_field(visibility=["read"])
    """The reason why the custom domain is not valid."""
    message: Optional[str] = rest_field(visibility=["read"])
    """Error message describing why the custom domain is not valid."""


class ValidateProbeInput(_Model):
    """Input of the validate probe API.

    :ivar probe_url: The probe URL to validate. Required.
    :vartype probe_url: str
    """

    probe_url: str = rest_field(name="probeURL", visibility=["read", "create", "update", "delete", "query"])
    """The probe URL to validate. Required."""

    @overload
    def __init__(
        self,
        *,
        probe_url: 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 ValidateProbeOutput(_Model):
    """Output of the validate probe API.

    :ivar is_valid: Indicates whether the probe URL is accepted or not.
    :vartype is_valid: bool
    :ivar error_code: Specifies the error code when the probe url is not accepted.
    :vartype error_code: str
    :ivar message: The detailed error message describing why the probe URL is not accepted.
    :vartype message: str
    """

    is_valid: Optional[bool] = rest_field(name="isValid", visibility=["read"])
    """Indicates whether the probe URL is accepted or not."""
    error_code: Optional[str] = rest_field(name="errorCode", visibility=["read"])
    """Specifies the error code when the probe url is not accepted."""
    message: Optional[str] = rest_field(visibility=["read"])
    """The detailed error message describing why the probe URL is not accepted."""


class ValidateSecretInput(_Model):
    """Input of the secret to be validated.

    :ivar secret_type: The secret type. Required. Known values are: "UrlSigningKey",
     "CustomerCertificate", "ManagedCertificate", and "AzureFirstPartyManagedCertificate".
    :vartype secret_type: str or ~azure.mgmt.cdn.models.SecretType
    :ivar secret_source: Resource reference to the Azure Key Vault secret. Expected to be in format
     of
     /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.KeyVault/vaults/{vaultName}/secrets/{secretName}.
     Required.
    :vartype secret_source: ~azure.mgmt.cdn.models.ResourceReference
    :ivar secret_version: Secret version, if customer is using a specific version.
    :vartype secret_version: str
    """

    secret_type: Union[str, "_models.SecretType"] = rest_field(
        name="secretType", visibility=["read", "create", "update", "delete", "query"]
    )
    """The secret type. Required. Known values are: \"UrlSigningKey\", \"CustomerCertificate\",
     \"ManagedCertificate\", and \"AzureFirstPartyManagedCertificate\"."""
    secret_source: "_models.ResourceReference" = rest_field(
        name="secretSource", visibility=["read", "create", "update", "delete", "query"]
    )
    """Resource reference to the Azure Key Vault secret. Expected to be in format of
     /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.KeyVault/vaults/{vaultName}/secrets/{secretName}.
     Required."""
    secret_version: Optional[str] = rest_field(
        name="secretVersion", visibility=["read", "create", "update", "delete", "query"]
    )
    """Secret version, if customer is using a specific version."""

    @overload
    def __init__(
        self,
        *,
        secret_type: Union[str, "_models.SecretType"],
        secret_source: "_models.ResourceReference",
        secret_version: 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 ValidateSecretOutput(_Model):
    """Output of the validated secret.

    :ivar status: The validation status. Known values are: "Valid", "Invalid", "AccessDenied", and
     "CertificateExpired".
    :vartype status: str or ~azure.mgmt.cdn.models.Status
    :ivar message: Detailed error message.
    :vartype message: str
    """

    status: Optional[Union[str, "_models.Status"]] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """The validation status. Known values are: \"Valid\", \"Invalid\", \"AccessDenied\", and
     \"CertificateExpired\"."""
    message: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """Detailed error message."""

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

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

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


class WafMetricsResponse(_Model):
    """Waf Metrics Response.

    :ivar date_time_begin:
    :vartype date_time_begin: ~datetime.datetime
    :ivar date_time_end:
    :vartype date_time_end: ~datetime.datetime
    :ivar granularity: Known values are: "PT5M", "PT1H", and "P1D".
    :vartype granularity: str or ~azure.mgmt.cdn.models.WafMetricsGranularity
    :ivar series:
    :vartype series: list[~azure.mgmt.cdn.models.WafMetricsResponseSeriesItem]
    """

    date_time_begin: Optional[datetime.datetime] = rest_field(
        name="dateTimeBegin", visibility=["read", "create", "update", "delete", "query"], format="rfc3339"
    )
    date_time_end: Optional[datetime.datetime] = rest_field(
        name="dateTimeEnd", visibility=["read", "create", "update", "delete", "query"], format="rfc3339"
    )
    granularity: Optional[Union[str, "_models.WafMetricsGranularity"]] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """Known values are: \"PT5M\", \"PT1H\", and \"P1D\"."""
    series: Optional[list["_models.WafMetricsResponseSeriesItem"]] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )

    @overload
    def __init__(
        self,
        *,
        date_time_begin: Optional[datetime.datetime] = None,
        date_time_end: Optional[datetime.datetime] = None,
        granularity: Optional[Union[str, "_models.WafMetricsGranularity"]] = None,
        series: Optional[list["_models.WafMetricsResponseSeriesItem"]] = None,
    ) -> None: ...

    @overload
    def __init__(self, mapping: Mapping[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 WafMetricsResponseSeriesItem(_Model):
    """WafMetricsResponseSeriesItem.

    :ivar metric:
    :vartype metric: str
    :ivar unit: "count"
    :vartype unit: str or ~azure.mgmt.cdn.models.WafMetricsSeriesUnit
    :ivar groups:
    :vartype groups: list[~azure.mgmt.cdn.models.WafMetricsResponseSeriesPropertiesItemsItem]
    :ivar data:
    :vartype data:
     list[~azure.mgmt.cdn.models.Components18OrqelSchemasWafmetricsresponsePropertiesSeriesItemsPropertiesDataItems]
    """

    metric: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    unit: Optional[Union[str, "_models.WafMetricsSeriesUnit"]] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """\"count\""""
    groups: Optional[list["_models.WafMetricsResponseSeriesPropertiesItemsItem"]] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    data: Optional[
        list["_models.Components18OrqelSchemasWafmetricsresponsePropertiesSeriesItemsPropertiesDataItems"]
    ] = rest_field(visibility=["read", "create", "update", "delete", "query"])

    @overload
    def __init__(
        self,
        *,
        metric: Optional[str] = None,
        unit: Optional[Union[str, "_models.WafMetricsSeriesUnit"]] = None,
        groups: Optional[list["_models.WafMetricsResponseSeriesPropertiesItemsItem"]] = None,
        data: Optional[
            list["_models.Components18OrqelSchemasWafmetricsresponsePropertiesSeriesItemsPropertiesDataItems"]
        ] = None,
    ) -> None: ...

    @overload
    def __init__(self, mapping: Mapping[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 WafMetricsResponseSeriesPropertiesItemsItem(_Model):  # pylint: disable=name-too-long
    """WafMetricsResponseSeriesPropertiesItemsItem.

    :ivar name:
    :vartype name: str
    :ivar value:
    :vartype value: str
    """

    name: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    value: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])

    @overload
    def __init__(
        self,
        *,
        name: 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 WafRankingsResponse(_Model):
    """Waf Rankings Response.

    :ivar date_time_begin:
    :vartype date_time_begin: ~datetime.datetime
    :ivar date_time_end:
    :vartype date_time_end: ~datetime.datetime
    :ivar groups:
    :vartype groups: list[str]
    :ivar data:
    :vartype data: list[~azure.mgmt.cdn.models.WafRankingsResponseDataItem]
    """

    date_time_begin: Optional[datetime.datetime] = rest_field(
        name="dateTimeBegin", visibility=["read", "create", "update", "delete", "query"], format="rfc3339"
    )
    date_time_end: Optional[datetime.datetime] = rest_field(
        name="dateTimeEnd", visibility=["read", "create", "update", "delete", "query"], format="rfc3339"
    )
    groups: Optional[list[str]] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    data: Optional[list["_models.WafRankingsResponseDataItem"]] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )

    @overload
    def __init__(
        self,
        *,
        date_time_begin: Optional[datetime.datetime] = None,
        date_time_end: Optional[datetime.datetime] = None,
        groups: Optional[list[str]] = None,
        data: Optional[list["_models.WafRankingsResponseDataItem"]] = None,
    ) -> None: ...

    @overload
    def __init__(self, mapping: Mapping[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 WafRankingsResponseDataItem(_Model):
    """WafRankingsResponseDataItem.

    :ivar group_values:
    :vartype group_values: list[str]
    :ivar metrics:
    :vartype metrics:
     list[~azure.mgmt.cdn.models.ComponentsKpo1PjSchemasWafrankingsresponsePropertiesDataItemsPropertiesMetricsItems]
    """

    group_values: Optional[list[str]] = rest_field(
        name="groupValues", visibility=["read", "create", "update", "delete", "query"]
    )
    metrics: Optional[
        list["_models.ComponentsKpo1PjSchemasWafrankingsresponsePropertiesDataItemsPropertiesMetricsItems"]
    ] = rest_field(visibility=["read", "create", "update", "delete", "query"])

    @overload
    def __init__(
        self,
        *,
        group_values: Optional[list[str]] = None,
        metrics: Optional[
            list["_models.ComponentsKpo1PjSchemasWafrankingsresponsePropertiesDataItemsPropertiesMetricsItems"]
        ] = None,
    ) -> None: ...

    @overload
    def __init__(self, mapping: Mapping[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)
