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

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

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

if TYPE_CHECKING:
    from .. import models as _models


class CheckNameAvailabilityParameters(_Model):
    """Parameters body to pass for resource name availability check.

    :ivar name: Resource name. Required.
    :vartype name: str
    :ivar type: Resource type. The only legal value of this property for checking redis cache name
     availability is 'Microsoft.Cache/redis'. Required.
    :vartype type: str
    """

    name: str = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """Resource name. Required."""
    type: str = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """Resource type. The only legal value of this property for checking redis cache name availability
     is 'Microsoft.Cache/redis'. Required."""

    @overload
    def __init__(
        self,
        *,
        name: str,
        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 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.redis.models.ErrorDetail]
    :ivar additional_info: The error additional info.
    :vartype additional_info: list[~azure.mgmt.redis.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.redis.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 ExportRDBParameters(_Model):
    """Parameters for Redis export operation.

    :ivar format: File format.
    :vartype format: str
    :ivar prefix: Prefix to use for exported files. Required.
    :vartype prefix: str
    :ivar container: Container name to export to. Required.
    :vartype container: str
    :ivar preferred_data_archive_auth_method: Preferred auth method to communicate to storage
     account used for data archive, specify SAS or ManagedIdentity, default value is SAS.
    :vartype preferred_data_archive_auth_method: str
    :ivar storage_subscription_id: Subscription id of the storage container for data to be exported
     using ManagedIdentity.
    :vartype storage_subscription_id: str
    """

    format: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """File format."""
    prefix: str = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """Prefix to use for exported files. Required."""
    container: str = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """Container name to export to. Required."""
    preferred_data_archive_auth_method: Optional[str] = rest_field(
        name="preferred-data-archive-auth-method", visibility=["read", "create", "update", "delete", "query"]
    )
    """Preferred auth method to communicate to storage account used for data archive, specify SAS or
     ManagedIdentity, default value is SAS."""
    storage_subscription_id: Optional[str] = rest_field(
        name="storage-subscription-id", visibility=["read", "create", "update", "delete", "query"]
    )
    """Subscription id of the storage container for data to be exported using ManagedIdentity."""

    @overload
    def __init__(
        self,
        *,
        prefix: str,
        container: str,
        format: Optional[str] = None,
        preferred_data_archive_auth_method: Optional[str] = None,
        storage_subscription_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 ImportRDBParameters(_Model):
    """Parameters for Redis import operation.

    :ivar format: File format.
    :vartype format: str
    :ivar files: files to import. Required.
    :vartype files: list[str]
    :ivar preferred_data_archive_auth_method: Preferred auth method to communicate to storage
     account used for data archive, specify SAS or ManagedIdentity, default value is SAS.
    :vartype preferred_data_archive_auth_method: str
    :ivar storage_subscription_id: Subscription id of the storage container containing files to
     import using Managed Identity.
    :vartype storage_subscription_id: str
    """

    format: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """File format."""
    files: list[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """files to import. Required."""
    preferred_data_archive_auth_method: Optional[str] = rest_field(
        name="preferred-data-archive-auth-method", visibility=["read", "create", "update", "delete", "query"]
    )
    """Preferred auth method to communicate to storage account used for data archive, specify SAS or
     ManagedIdentity, default value is SAS."""
    storage_subscription_id: Optional[str] = rest_field(
        name="storage-subscription-id", visibility=["read", "create", "update", "delete", "query"]
    )
    """Subscription id of the storage container containing files to import using Managed Identity."""

    @overload
    def __init__(
        self,
        *,
        files: list[str],
        format: Optional[str] = None,
        preferred_data_archive_auth_method: Optional[str] = None,
        storage_subscription_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 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.redis.models.ManagedServiceIdentityType
    :ivar user_assigned_identities: The identities assigned to this resource by the user.
    :vartype user_assigned_identities: dict[str, ~azure.mgmt.redis.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 Operation(_Model):
    """REST API operation.

    :ivar name: Operation name: {provider}/{resource}/{operation}.
    :vartype name: str
    :ivar display: The object that describes the operation.
    :vartype display: ~azure.mgmt.redis.models.OperationDisplay
    """

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

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

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

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


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

    :ivar provider: Friendly name of the resource provider.
    :vartype provider: str
    :ivar operation: Operation type: read, write, delete, listKeys/action, etc.
    :vartype operation: str
    :ivar resource: Resource type on which the operation is performed.
    :vartype resource: str
    :ivar description: Friendly name of the operation.
    :vartype description: str
    """

    provider: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """Friendly name of the resource provider."""
    operation: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """Operation type: read, write, delete, listKeys/action, etc."""
    resource: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """Resource type on which the operation is performed."""
    description: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """Friendly name of the operation."""

    @overload
    def __init__(
        self,
        *,
        provider: Optional[str] = None,
        operation: Optional[str] = None,
        resource: Optional[str] = None,
        description: Optional[str] = None,
    ) -> None: ...

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

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


class OperationStatusResult(_Model):
    """The current status of an async operation.

    :ivar id: Fully qualified ID for the async operation.
    :vartype id: str
    :ivar name: Name of the async operation.
    :vartype name: str
    :ivar status: Operation status. Required.
    :vartype status: str
    :ivar percent_complete: Percent of the operation that is complete.
    :vartype percent_complete: float
    :ivar start_time: The start time of the operation.
    :vartype start_time: ~datetime.datetime
    :ivar end_time: The end time of the operation.
    :vartype end_time: ~datetime.datetime
    :ivar operations: The operations list.
    :vartype operations: list[~azure.mgmt.redis.models.OperationStatusResult]
    :ivar error: If present, details of the operation error.
    :vartype error: ~azure.mgmt.redis.models.ErrorDetail
    """

    id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """Fully qualified ID for the async operation."""
    name: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """Name of the async operation."""
    status: str = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """Operation status. Required."""
    percent_complete: Optional[float] = rest_field(
        name="percentComplete", visibility=["read", "create", "update", "delete", "query"]
    )
    """Percent of the operation that is complete."""
    start_time: Optional[datetime.datetime] = rest_field(
        name="startTime", visibility=["read", "create", "update", "delete", "query"], format="rfc3339"
    )
    """The start time of the operation."""
    end_time: Optional[datetime.datetime] = rest_field(
        name="endTime", visibility=["read", "create", "update", "delete", "query"], format="rfc3339"
    )
    """The end time of the operation."""
    operations: Optional[list["_models.OperationStatusResult"]] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """The operations list."""
    error: Optional["_models.ErrorDetail"] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """If present, details of the operation error."""

    @overload
    def __init__(
        self,
        *,
        status: str,
        id: Optional[str] = None,  # pylint: disable=redefined-builtin
        name: Optional[str] = None,
        percent_complete: Optional[float] = None,
        start_time: Optional[datetime.datetime] = None,
        end_time: Optional[datetime.datetime] = None,
        operations: Optional[list["_models.OperationStatusResult"]] = None,
        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 OperationStatus(OperationStatusResult):
    """Asynchronous operation status.

    :ivar id: Fully qualified ID for the async operation.
    :vartype id: str
    :ivar name: Name of the async operation.
    :vartype name: str
    :ivar status: Operation status. Required.
    :vartype status: str
    :ivar percent_complete: Percent of the operation that is complete.
    :vartype percent_complete: float
    :ivar start_time: The start time of the operation.
    :vartype start_time: ~datetime.datetime
    :ivar end_time: The end time of the operation.
    :vartype end_time: ~datetime.datetime
    :ivar operations: The operations list.
    :vartype operations: list[~azure.mgmt.redis.models.OperationStatusResult]
    :ivar error: If present, details of the operation error.
    :vartype error: ~azure.mgmt.redis.models.ErrorDetail
    :ivar properties: Additional properties from RP, only when operation is successful.
    :vartype properties: dict[str, any]
    """

    properties: Optional[dict[str, Any]] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """Additional properties from RP, only when operation is successful."""

    @overload
    def __init__(
        self,
        *,
        status: str,
        id: Optional[str] = None,  # pylint: disable=redefined-builtin
        name: Optional[str] = None,
        percent_complete: Optional[float] = None,
        start_time: Optional[datetime.datetime] = None,
        end_time: Optional[datetime.datetime] = None,
        operations: Optional[list["_models.OperationStatusResult"]] = None,
        error: Optional["_models.ErrorDetail"] = None,
        properties: Optional[dict[str, Any]] = None,
    ) -> None: ...

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

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


class PrivateEndpoint(_Model):
    """The private endpoint resource.

    :ivar id: The resource identifier of the private endpoint.
    :vartype id: str
    """

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


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.redis.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 PrivateEndpointConnection(Resource):
    """The Private Endpoint Connection 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.redis.models.SystemData
    :ivar properties: Resource properties.
    :vartype properties: ~azure.mgmt.redis.models.PrivateEndpointConnectionProperties
    """

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

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

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

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

    def __init__(self, *args: Any, **kwargs: Any) -> None:
        _flattened_input = {k: kwargs.pop(k) for k in kwargs.keys() & self.__flattened_items}
        super().__init__(*args, **kwargs)
        for k, v in _flattened_input.items():
            setattr(self, k, v)

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

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


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

    :ivar group_ids: The group ids for the private endpoint resource.
    :vartype group_ids: list[str]
    :ivar private_endpoint: The private endpoint resource.
    :vartype private_endpoint: ~azure.mgmt.redis.models.PrivateEndpoint
    :ivar private_link_service_connection_state: A collection of information about the state of the
     connection between service consumer and provider. Required.
    :vartype private_link_service_connection_state:
     ~azure.mgmt.redis.models.PrivateLinkServiceConnectionState
    :ivar provisioning_state: The provisioning state of the private endpoint connection resource.
     Known values are: "Succeeded", "Creating", "Deleting", and "Failed".
    :vartype provisioning_state: str or
     ~azure.mgmt.redis.models.PrivateEndpointConnectionProvisioningState
    """

    group_ids: Optional[list[str]] = rest_field(name="groupIds", visibility=["read"])
    """The group ids for the private endpoint resource."""
    private_endpoint: Optional["_models.PrivateEndpoint"] = rest_field(
        name="privateEndpoint", visibility=["read", "create", "update", "delete", "query"]
    )
    """The private endpoint resource."""
    private_link_service_connection_state: "_models.PrivateLinkServiceConnectionState" = rest_field(
        name="privateLinkServiceConnectionState", visibility=["read", "create", "update", "delete", "query"]
    )
    """A collection of information about the state of the connection between service consumer and
     provider. Required."""
    provisioning_state: Optional[Union[str, "_models.PrivateEndpointConnectionProvisioningState"]] = rest_field(
        name="provisioningState", visibility=["read"]
    )
    """The provisioning state of the private endpoint connection resource. Known values are:
     \"Succeeded\", \"Creating\", \"Deleting\", and \"Failed\"."""

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

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

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


class PrivateLinkResource(Resource):
    """A private link 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.redis.models.SystemData
    :ivar properties: Resource properties.
    :vartype properties: ~azure.mgmt.redis.models.PrivateLinkResourceProperties
    """

    properties: Optional["_models.PrivateLinkResourceProperties"] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """Resource properties."""

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

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

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


class PrivateLinkResourceProperties(_Model):
    """Properties of a private link resource.

    :ivar group_id: The private link resource group id.
    :vartype group_id: str
    :ivar required_members: The private link resource required member names.
    :vartype required_members: list[str]
    :ivar required_zone_names: The private link resource private link DNS zone name.
    :vartype required_zone_names: list[str]
    """

    group_id: Optional[str] = rest_field(name="groupId", visibility=["read"])
    """The private link resource group id."""
    required_members: Optional[list[str]] = rest_field(name="requiredMembers", visibility=["read"])
    """The private link resource required member names."""
    required_zone_names: Optional[list[str]] = rest_field(
        name="requiredZoneNames", visibility=["read", "create", "update", "delete", "query"]
    )
    """The private link resource private link DNS zone name."""

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

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

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


class PrivateLinkServiceConnectionState(_Model):
    """A collection of information about the state of the connection between service consumer and
    provider.

    :ivar status: Indicates whether the connection has been Approved/Rejected/Removed by the owner
     of the service. Known values are: "Pending", "Approved", and "Rejected".
    :vartype status: str or ~azure.mgmt.redis.models.PrivateEndpointServiceConnectionStatus
    :ivar description: The reason for approval/rejection of the connection.
    :vartype description: str
    :ivar actions_required: A message indicating if changes on the service provider require any
     updates on the consumer.
    :vartype actions_required: str
    """

    status: Optional[Union[str, "_models.PrivateEndpointServiceConnectionStatus"]] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """Indicates whether the connection has been Approved/Rejected/Removed by the owner of the
     service. Known values are: \"Pending\", \"Approved\", and \"Rejected\"."""
    description: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """The reason for approval/rejection of the connection."""
    actions_required: Optional[str] = rest_field(
        name="actionsRequired", visibility=["read", "create", "update", "delete", "query"]
    )
    """A message indicating if changes on the service provider require any updates on the consumer."""

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

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

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


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


class RedisAccessKeys(_Model):
    """Redis cache access keys.

    :ivar primary_key: The current primary key that clients can use to authenticate with Redis
     cache.
    :vartype primary_key: str
    :ivar secondary_key: The current secondary key that clients can use to authenticate with Redis
     cache.
    :vartype secondary_key: str
    """

    primary_key: Optional[str] = rest_field(name="primaryKey", visibility=["read"])
    """The current primary key that clients can use to authenticate with Redis cache."""
    secondary_key: Optional[str] = rest_field(name="secondaryKey", visibility=["read"])
    """The current secondary key that clients can use to authenticate with Redis cache."""


class RedisCacheAccessPolicy(ProxyResource):
    """Response to get/put access policy.

    :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.redis.models.SystemData
    :ivar properties: Properties of an access policy.
    :vartype properties: ~azure.mgmt.redis.models.RedisCacheAccessPolicyProperties
    """

    properties: Optional["_models.RedisCacheAccessPolicyProperties"] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """Properties of an access policy."""

    __flattened_items = ["provisioning_state", "type", "permissions"]

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

    @overload
    def __init__(self, mapping: Mapping[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 RedisCacheAccessPolicyAssignment(ProxyResource):
    """Response to an operation on access policy assignment.

    :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.redis.models.SystemData
    :ivar properties: Properties of an access policy assignment.
    :vartype properties: ~azure.mgmt.redis.models.RedisCacheAccessPolicyAssignmentProperties
    """

    properties: Optional["_models.RedisCacheAccessPolicyAssignmentProperties"] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """Properties of an access policy assignment."""

    __flattened_items = ["provisioning_state", "object_id", "object_id_alias", "access_policy_name"]

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

    @overload
    def __init__(self, mapping: Mapping[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 RedisCacheAccessPolicyAssignmentProperties(_Model):  # pylint: disable=name-too-long
    """Properties for an access policy assignment.

    :ivar provisioning_state: Provisioning state of an access policy assignment set. Known values
     are: "Updating", "Succeeded", "Deleting", "Deleted", "Canceled", and "Failed".
    :vartype provisioning_state: str or
     ~azure.mgmt.redis.models.AccessPolicyAssignmentProvisioningState
    :ivar object_id: Object Id to assign access policy to. Required.
    :vartype object_id: str
    :ivar object_id_alias: User friendly name for object id. Also represents username for token
     based authentication. Required.
    :vartype object_id_alias: str
    :ivar access_policy_name: The name of the access policy that is being assigned. Required.
    :vartype access_policy_name: str
    """

    provisioning_state: Optional[Union[str, "_models.AccessPolicyAssignmentProvisioningState"]] = rest_field(
        name="provisioningState", visibility=["read"]
    )
    """Provisioning state of an access policy assignment set. Known values are: \"Updating\",
     \"Succeeded\", \"Deleting\", \"Deleted\", \"Canceled\", and \"Failed\"."""
    object_id: str = rest_field(name="objectId", visibility=["read", "create", "update", "delete", "query"])
    """Object Id to assign access policy to. Required."""
    object_id_alias: str = rest_field(name="objectIdAlias", visibility=["read", "create", "update", "delete", "query"])
    """User friendly name for object id. Also represents username for token based authentication.
     Required."""
    access_policy_name: str = rest_field(
        name="accessPolicyName", visibility=["read", "create", "update", "delete", "query"]
    )
    """The name of the access policy that is being assigned. Required."""

    @overload
    def __init__(
        self,
        *,
        object_id: str,
        object_id_alias: str,
        access_policy_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 RedisCacheAccessPolicyProperties(_Model):
    """All properties of an access policy.

    :ivar provisioning_state: Provisioning state of access policy. Known values are: "Updating",
     "Succeeded", "Deleting", "Deleted", "Canceled", and "Failed".
    :vartype provisioning_state: str or ~azure.mgmt.redis.models.AccessPolicyProvisioningState
    :ivar type: Built-In or Custom access policy. Known values are: "Custom" and "BuiltIn".
    :vartype type: str or ~azure.mgmt.redis.models.AccessPolicyType
    :ivar permissions: Permissions for the access policy. Learn how to configure permissions at
     `https://aka.ms/redis/AADPreRequisites <https://aka.ms/redis/AADPreRequisites>`_. Required.
    :vartype permissions: str
    """

    provisioning_state: Optional[Union[str, "_models.AccessPolicyProvisioningState"]] = rest_field(
        name="provisioningState", visibility=["read"]
    )
    """Provisioning state of access policy. Known values are: \"Updating\", \"Succeeded\",
     \"Deleting\", \"Deleted\", \"Canceled\", and \"Failed\"."""
    type: Optional[Union[str, "_models.AccessPolicyType"]] = rest_field(visibility=["read"])
    """Built-In or Custom access policy. Known values are: \"Custom\" and \"BuiltIn\"."""
    permissions: str = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """Permissions for the access policy. Learn how to configure permissions at
     `https://aka.ms/redis/AADPreRequisites <https://aka.ms/redis/AADPreRequisites>`_. Required."""

    @overload
    def __init__(
        self,
        *,
        permissions: 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 RedisCommonProperties(_Model):
    """Create/Update/Get common properties of the redis cache.

    :ivar redis_configuration: All Redis Settings. Few possible keys:
     rdb-backup-enabled,rdb-storage-connection-string,rdb-backup-frequency,maxmemory-delta,
     maxmemory-policy,notify-keyspace-events, aof-backup-enabled, aof-storage-connection-string-0,
     aof-storage-connection-string-1 etc.
    :vartype redis_configuration: ~azure.mgmt.redis.models.RedisCommonPropertiesRedisConfiguration
    :ivar redis_version: Redis version. This should be in the form 'major[.minor]' (only 'major' is
     required) or the value 'latest' which refers to the latest stable Redis version that is
     available. Supported versions: 4.0, 6.0 (latest). Default value is 'latest'.
    :vartype redis_version: str
    :ivar enable_non_ssl_port: Specifies whether the non-ssl Redis server port (6379) is enabled.
    :vartype enable_non_ssl_port: bool
    :ivar replicas_per_master: The number of replicas to be created per primary.
    :vartype replicas_per_master: int
    :ivar replicas_per_primary: The number of replicas to be created per primary.
    :vartype replicas_per_primary: int
    :ivar tenant_settings: A dictionary of tenant settings.
    :vartype tenant_settings: dict[str, str]
    :ivar shard_count: The number of shards to be created on a Premium Cluster Cache.
    :vartype shard_count: int
    :ivar minimum_tls_version: Optional: requires clients to use a specified TLS version (or
     higher) to connect (e,g, '1.0', '1.1', '1.2'). Known values are: "1.0", "1.1", and "1.2".
    :vartype minimum_tls_version: str or ~azure.mgmt.redis.models.TlsVersion
    :ivar public_network_access: Whether or not public endpoint access is allowed for this cache.
     Value is optional but if passed in, must be 'Enabled' or 'Disabled'. If 'Disabled', private
     endpoints are the exclusive access method. Known values are: "Enabled" and "Disabled".
    :vartype public_network_access: str or ~azure.mgmt.redis.models.PublicNetworkAccess
    :ivar update_channel: Optional: Specifies the update channel for the monthly Redis updates your
     Redis Cache will receive. Caches using 'Preview' update channel get latest Redis updates at
     least 4 weeks ahead of 'Stable' channel caches. Default value is 'Stable'. Known values are:
     "Stable" and "Preview".
    :vartype update_channel: str or ~azure.mgmt.redis.models.UpdateChannel
    :ivar disable_access_key_authentication: Authentication to Redis through access keys is
     disabled when set as true. Default value is false.
    :vartype disable_access_key_authentication: bool
    :ivar zonal_allocation_policy: Optional: Specifies how availability zones are allocated to the
     Redis cache. 'Automatic' enables zone redundancy and Azure will automatically select zones
     based on regional availability and capacity. 'UserDefined' will select availability zones
     passed in by you using the 'zones' parameter. 'NoZones' will produce a non-zonal cache. If
     'zonalAllocationPolicy' is not passed, it will be set to 'UserDefined' when zones are passed
     in, otherwise, it will be set to 'Automatic' in regions where zones are supported and 'NoZones'
     in regions where zones are not supported. Known values are: "Automatic", "UserDefined", and
     "NoZones".
    :vartype zonal_allocation_policy: str or ~azure.mgmt.redis.models.ZonalAllocationPolicy
    """

    redis_configuration: Optional["_models.RedisCommonPropertiesRedisConfiguration"] = rest_field(
        name="redisConfiguration", visibility=["read", "create", "update", "delete", "query"]
    )
    """All Redis Settings. Few possible keys:
     rdb-backup-enabled,rdb-storage-connection-string,rdb-backup-frequency,maxmemory-delta,
     maxmemory-policy,notify-keyspace-events, aof-backup-enabled, aof-storage-connection-string-0,
     aof-storage-connection-string-1 etc."""
    redis_version: Optional[str] = rest_field(
        name="redisVersion", visibility=["read", "create", "update", "delete", "query"]
    )
    """Redis version. This should be in the form 'major[.minor]' (only 'major' is required) or the
     value 'latest' which refers to the latest stable Redis version that is available. Supported
     versions: 4.0, 6.0 (latest). Default value is 'latest'."""
    enable_non_ssl_port: Optional[bool] = rest_field(
        name="enableNonSslPort", visibility=["read", "create", "update", "delete", "query"]
    )
    """Specifies whether the non-ssl Redis server port (6379) is enabled."""
    replicas_per_master: Optional[int] = rest_field(
        name="replicasPerMaster", visibility=["read", "create", "update", "delete", "query"]
    )
    """The number of replicas to be created per primary."""
    replicas_per_primary: Optional[int] = rest_field(
        name="replicasPerPrimary", visibility=["read", "create", "update", "delete", "query"]
    )
    """The number of replicas to be created per primary."""
    tenant_settings: Optional[dict[str, str]] = rest_field(
        name="tenantSettings", visibility=["read", "create", "update", "delete", "query"]
    )
    """A dictionary of tenant settings."""
    shard_count: Optional[int] = rest_field(
        name="shardCount", visibility=["read", "create", "update", "delete", "query"]
    )
    """The number of shards to be created on a Premium Cluster Cache."""
    minimum_tls_version: Optional[Union[str, "_models.TlsVersion"]] = rest_field(
        name="minimumTlsVersion", visibility=["read", "create", "update", "delete", "query"]
    )
    """Optional: requires clients to use a specified TLS version (or higher) to connect (e,g, '1.0',
     '1.1', '1.2'). Known values are: \"1.0\", \"1.1\", and \"1.2\"."""
    public_network_access: Optional[Union[str, "_models.PublicNetworkAccess"]] = rest_field(
        name="publicNetworkAccess", visibility=["read", "create", "update", "delete", "query"]
    )
    """Whether or not public endpoint access is allowed for this cache.  Value is optional but if
     passed in, must be 'Enabled' or 'Disabled'. If 'Disabled', private endpoints are the exclusive
     access method. Known values are: \"Enabled\" and \"Disabled\"."""
    update_channel: Optional[Union[str, "_models.UpdateChannel"]] = rest_field(
        name="updateChannel", visibility=["read", "create", "update", "delete", "query"]
    )
    """Optional: Specifies the update channel for the monthly Redis updates your Redis Cache will
     receive. Caches using 'Preview' update channel get latest Redis updates at least 4 weeks ahead
     of 'Stable' channel caches. Default value is 'Stable'. Known values are: \"Stable\" and
     \"Preview\"."""
    disable_access_key_authentication: Optional[bool] = rest_field(
        name="disableAccessKeyAuthentication", visibility=["read", "create", "update", "delete", "query"]
    )
    """Authentication to Redis through access keys is disabled when set as true. Default value is
     false."""
    zonal_allocation_policy: Optional[Union[str, "_models.ZonalAllocationPolicy"]] = rest_field(
        name="zonalAllocationPolicy", visibility=["read", "create", "update", "delete", "query"]
    )
    """Optional: Specifies how availability zones are allocated to the Redis cache. 'Automatic'
     enables zone redundancy and Azure will automatically select zones based on regional
     availability and capacity. 'UserDefined' will select availability zones passed in by you using
     the 'zones' parameter. 'NoZones' will produce a non-zonal cache. If 'zonalAllocationPolicy' is
     not passed, it will be set to 'UserDefined' when zones are passed in, otherwise, it will be set
     to 'Automatic' in regions where zones are supported and 'NoZones' in regions where zones are
     not supported. Known values are: \"Automatic\", \"UserDefined\", and \"NoZones\"."""

    @overload
    def __init__(
        self,
        *,
        redis_configuration: Optional["_models.RedisCommonPropertiesRedisConfiguration"] = None,
        redis_version: Optional[str] = None,
        enable_non_ssl_port: Optional[bool] = None,
        replicas_per_master: Optional[int] = None,
        replicas_per_primary: Optional[int] = None,
        tenant_settings: Optional[dict[str, str]] = None,
        shard_count: Optional[int] = None,
        minimum_tls_version: Optional[Union[str, "_models.TlsVersion"]] = None,
        public_network_access: Optional[Union[str, "_models.PublicNetworkAccess"]] = None,
        update_channel: Optional[Union[str, "_models.UpdateChannel"]] = None,
        disable_access_key_authentication: Optional[bool] = None,
        zonal_allocation_policy: Optional[Union[str, "_models.ZonalAllocationPolicy"]] = None,
    ) -> None: ...

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

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


class RedisCommonPropertiesRedisConfiguration(_Model):
    """All Redis Settings. Few possible keys:
    rdb-backup-enabled,rdb-storage-connection-string,rdb-backup-frequency,maxmemory-delta,
    maxmemory-policy,notify-keyspace-events, aof-backup-enabled, aof-storage-connection-string-0,
    aof-storage-connection-string-1 etc.

    :ivar rdb_backup_enabled: Specifies whether the RDB backup is enabled.
    :vartype rdb_backup_enabled: str
    :ivar rdb_backup_frequency: Specifies the frequency for creating rdb backup in minutes. Valid
     values: (15, 30, 60, 360, 720, 1440).
    :vartype rdb_backup_frequency: str
    :ivar rdb_backup_max_snapshot_count: Specifies the maximum number of snapshots for rdb backup.
    :vartype rdb_backup_max_snapshot_count: str
    :ivar rdb_storage_connection_string: The storage account connection string for storing rdb
     file.
    :vartype rdb_storage_connection_string: str
    :ivar aof_backup_enabled: Specifies whether the aof backup is enabled.
    :vartype aof_backup_enabled: str
    :ivar aof_storage_connection_string0: First storage account connection string.
    :vartype aof_storage_connection_string0: str
    :ivar aof_storage_connection_string1: Second storage account connection string.
    :vartype aof_storage_connection_string1: str
    :ivar maxfragmentationmemory_reserved: Value in megabytes reserved for fragmentation per shard.
    :vartype maxfragmentationmemory_reserved: str
    :ivar maxmemory_policy: The eviction strategy used when your data won't fit within its memory
     limit.
    :vartype maxmemory_policy: str
    :ivar maxmemory_reserved: Value in megabytes reserved for non-cache usage per shard e.g.
     failover.
    :vartype maxmemory_reserved: str
    :ivar maxmemory_delta: Value in megabytes reserved for non-cache usage per shard e.g. failover.
    :vartype maxmemory_delta: str
    :ivar maxclients: The max clients config.
    :vartype maxclients: str
    :ivar notify_keyspace_events: The keyspace events which should be monitored.
    :vartype notify_keyspace_events: str
    :ivar preferred_data_archive_auth_method: Preferred auth method to communicate to storage
     account used for data archive, specify SAS or ManagedIdentity, default value is SAS.
    :vartype preferred_data_archive_auth_method: str
    :ivar preferred_data_persistence_auth_method: Preferred auth method to communicate to storage
     account used for data persistence, specify SAS or ManagedIdentity, default value is SAS.
    :vartype preferred_data_persistence_auth_method: str
    :ivar zonal_configuration: Zonal Configuration.
    :vartype zonal_configuration: str
    :ivar authnotrequired: Specifies whether the authentication is disabled. Setting this property
     is highly discouraged from security point of view; you should never disable authentication
     using this property!.
    :vartype authnotrequired: str
    :ivar storage_subscription_id: SubscriptionId of the storage account for persistence (aof/rdb)
     using ManagedIdentity.
    :vartype storage_subscription_id: str
    :ivar aad_enabled: Specifies whether AAD based authentication has been enabled or disabled for
     the cache.
    :vartype aad_enabled: str
    """

    rdb_backup_enabled: Optional[str] = rest_field(
        name="rdb-backup-enabled", visibility=["read", "create", "update", "delete", "query"]
    )
    """Specifies whether the RDB backup is enabled."""
    rdb_backup_frequency: Optional[str] = rest_field(
        name="rdb-backup-frequency", visibility=["read", "create", "update", "delete", "query"]
    )
    """Specifies the frequency for creating rdb backup in minutes. Valid values: (15, 30, 60, 360,
     720, 1440)."""
    rdb_backup_max_snapshot_count: Optional[str] = rest_field(
        name="rdb-backup-max-snapshot-count", visibility=["read", "create", "update", "delete", "query"]
    )
    """Specifies the maximum number of snapshots for rdb backup."""
    rdb_storage_connection_string: Optional[str] = rest_field(
        name="rdb-storage-connection-string", visibility=["read", "create", "update", "delete", "query"]
    )
    """The storage account connection string for storing rdb file."""
    aof_backup_enabled: Optional[str] = rest_field(
        name="aof-backup-enabled", visibility=["read", "create", "update", "delete", "query"]
    )
    """Specifies whether the aof backup is enabled."""
    aof_storage_connection_string0: Optional[str] = rest_field(
        name="aof-storage-connection-string-0", visibility=["read", "create", "update", "delete", "query"]
    )
    """First storage account connection string."""
    aof_storage_connection_string1: Optional[str] = rest_field(
        name="aof-storage-connection-string-1", visibility=["read", "create", "update", "delete", "query"]
    )
    """Second storage account connection string."""
    maxfragmentationmemory_reserved: Optional[str] = rest_field(
        name="maxfragmentationmemory-reserved", visibility=["read", "create", "update", "delete", "query"]
    )
    """Value in megabytes reserved for fragmentation per shard."""
    maxmemory_policy: Optional[str] = rest_field(
        name="maxmemory-policy", visibility=["read", "create", "update", "delete", "query"]
    )
    """The eviction strategy used when your data won't fit within its memory limit."""
    maxmemory_reserved: Optional[str] = rest_field(
        name="maxmemory-reserved", visibility=["read", "create", "update", "delete", "query"]
    )
    """Value in megabytes reserved for non-cache usage per shard e.g. failover."""
    maxmemory_delta: Optional[str] = rest_field(
        name="maxmemory-delta", visibility=["read", "create", "update", "delete", "query"]
    )
    """Value in megabytes reserved for non-cache usage per shard e.g. failover."""
    maxclients: Optional[str] = rest_field(visibility=["read"])
    """The max clients config."""
    notify_keyspace_events: Optional[str] = rest_field(
        name="notify-keyspace-events", visibility=["read", "create", "update", "delete", "query"]
    )
    """The keyspace events which should be monitored."""
    preferred_data_archive_auth_method: Optional[str] = rest_field(
        name="preferred-data-archive-auth-method", visibility=["read"]
    )
    """Preferred auth method to communicate to storage account used for data archive, specify SAS or
     ManagedIdentity, default value is SAS."""
    preferred_data_persistence_auth_method: Optional[str] = rest_field(
        name="preferred-data-persistence-auth-method", visibility=["read", "create", "update", "delete", "query"]
    )
    """Preferred auth method to communicate to storage account used for data persistence, specify SAS
     or ManagedIdentity, default value is SAS."""
    zonal_configuration: Optional[str] = rest_field(name="zonal-configuration", visibility=["read"])
    """Zonal Configuration."""
    authnotrequired: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """Specifies whether the authentication is disabled. Setting this property is highly discouraged
     from security point of view; you should never disable authentication using this property!."""
    storage_subscription_id: Optional[str] = rest_field(
        name="storage-subscription-id", visibility=["read", "create", "update", "delete", "query"]
    )
    """SubscriptionId of the storage account for persistence (aof/rdb) using ManagedIdentity."""
    aad_enabled: Optional[str] = rest_field(
        name="aad-enabled", visibility=["read", "create", "update", "delete", "query"]
    )
    """Specifies whether AAD based authentication has been enabled or disabled for the cache."""

    @overload
    def __init__(
        self,
        *,
        rdb_backup_enabled: Optional[str] = None,
        rdb_backup_frequency: Optional[str] = None,
        rdb_backup_max_snapshot_count: Optional[str] = None,
        rdb_storage_connection_string: Optional[str] = None,
        aof_backup_enabled: Optional[str] = None,
        aof_storage_connection_string0: Optional[str] = None,
        aof_storage_connection_string1: Optional[str] = None,
        maxfragmentationmemory_reserved: Optional[str] = None,
        maxmemory_policy: Optional[str] = None,
        maxmemory_reserved: Optional[str] = None,
        maxmemory_delta: Optional[str] = None,
        notify_keyspace_events: Optional[str] = None,
        preferred_data_persistence_auth_method: Optional[str] = None,
        authnotrequired: Optional[str] = None,
        storage_subscription_id: Optional[str] = None,
        aad_enabled: 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 RedisCreateParameters(_Model):
    """Parameters supplied to the Create Redis operation.

    :ivar properties: Redis cache properties. Required.
    :vartype properties: ~azure.mgmt.redis.models.RedisCreateProperties
    :ivar zones: A list of availability zones denoting where the resource needs to come from.
    :vartype zones: list[str]
    :ivar location: The geo-location where the resource lives. Required.
    :vartype location: str
    :ivar tags: Resource tags.
    :vartype tags: dict[str, str]
    :ivar identity: The identity of the resource.
    :vartype identity: ~azure.mgmt.redis.models.ManagedServiceIdentity
    """

    properties: "_models.RedisCreateProperties" = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """Redis cache properties. Required."""
    zones: Optional[list[str]] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """A list of availability zones denoting where the resource needs to come from."""
    location: str = rest_field(visibility=["read", "create"])
    """The geo-location where the resource lives. Required."""
    tags: Optional[dict[str, str]] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """Resource tags."""
    identity: Optional["_models.ManagedServiceIdentity"] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """The identity of the resource."""

    __flattened_items = [
        "redis_configuration",
        "redis_version",
        "enable_non_ssl_port",
        "replicas_per_master",
        "replicas_per_primary",
        "tenant_settings",
        "shard_count",
        "minimum_tls_version",
        "public_network_access",
        "update_channel",
        "disable_access_key_authentication",
        "zonal_allocation_policy",
        "sku",
        "subnet_id",
        "static_ip",
    ]

    @overload
    def __init__(
        self,
        *,
        properties: "_models.RedisCreateProperties",
        location: str,
        zones: Optional[list[str]] = None,
        tags: Optional[dict[str, str]] = 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 RedisCreateProperties(RedisCommonProperties):
    """Properties supplied to Create Redis operation.

    :ivar redis_configuration: All Redis Settings. Few possible keys:
     rdb-backup-enabled,rdb-storage-connection-string,rdb-backup-frequency,maxmemory-delta,
     maxmemory-policy,notify-keyspace-events, aof-backup-enabled, aof-storage-connection-string-0,
     aof-storage-connection-string-1 etc.
    :vartype redis_configuration: ~azure.mgmt.redis.models.RedisCommonPropertiesRedisConfiguration
    :ivar redis_version: Redis version. This should be in the form 'major[.minor]' (only 'major' is
     required) or the value 'latest' which refers to the latest stable Redis version that is
     available. Supported versions: 4.0, 6.0 (latest). Default value is 'latest'.
    :vartype redis_version: str
    :ivar enable_non_ssl_port: Specifies whether the non-ssl Redis server port (6379) is enabled.
    :vartype enable_non_ssl_port: bool
    :ivar replicas_per_master: The number of replicas to be created per primary.
    :vartype replicas_per_master: int
    :ivar replicas_per_primary: The number of replicas to be created per primary.
    :vartype replicas_per_primary: int
    :ivar tenant_settings: A dictionary of tenant settings.
    :vartype tenant_settings: dict[str, str]
    :ivar shard_count: The number of shards to be created on a Premium Cluster Cache.
    :vartype shard_count: int
    :ivar minimum_tls_version: Optional: requires clients to use a specified TLS version (or
     higher) to connect (e,g, '1.0', '1.1', '1.2'). Known values are: "1.0", "1.1", and "1.2".
    :vartype minimum_tls_version: str or ~azure.mgmt.redis.models.TlsVersion
    :ivar public_network_access: Whether or not public endpoint access is allowed for this cache.
     Value is optional but if passed in, must be 'Enabled' or 'Disabled'. If 'Disabled', private
     endpoints are the exclusive access method. Known values are: "Enabled" and "Disabled".
    :vartype public_network_access: str or ~azure.mgmt.redis.models.PublicNetworkAccess
    :ivar update_channel: Optional: Specifies the update channel for the monthly Redis updates your
     Redis Cache will receive. Caches using 'Preview' update channel get latest Redis updates at
     least 4 weeks ahead of 'Stable' channel caches. Default value is 'Stable'. Known values are:
     "Stable" and "Preview".
    :vartype update_channel: str or ~azure.mgmt.redis.models.UpdateChannel
    :ivar disable_access_key_authentication: Authentication to Redis through access keys is
     disabled when set as true. Default value is false.
    :vartype disable_access_key_authentication: bool
    :ivar zonal_allocation_policy: Optional: Specifies how availability zones are allocated to the
     Redis cache. 'Automatic' enables zone redundancy and Azure will automatically select zones
     based on regional availability and capacity. 'UserDefined' will select availability zones
     passed in by you using the 'zones' parameter. 'NoZones' will produce a non-zonal cache. If
     'zonalAllocationPolicy' is not passed, it will be set to 'UserDefined' when zones are passed
     in, otherwise, it will be set to 'Automatic' in regions where zones are supported and 'NoZones'
     in regions where zones are not supported. Known values are: "Automatic", "UserDefined", and
     "NoZones".
    :vartype zonal_allocation_policy: str or ~azure.mgmt.redis.models.ZonalAllocationPolicy
    :ivar sku: The SKU of the Redis cache to deploy. Required.
    :vartype sku: ~azure.mgmt.redis.models.Sku
    :ivar subnet_id: The full resource ID of a subnet in a virtual network to deploy the Redis
     cache in. Example format:
     /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/Microsoft.{Network|ClassicNetwork}/VirtualNetworks/vnet1/subnets/subnet1.
    :vartype subnet_id: str
    :ivar static_ip: Static IP address. Optionally, may be specified when deploying a Redis cache
     inside an existing Azure Virtual Network; auto assigned by default.
    :vartype static_ip: str
    """

    sku: "_models.Sku" = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """The SKU of the Redis cache to deploy. Required."""
    subnet_id: Optional[str] = rest_field(name="subnetId", visibility=["read", "create", "update", "delete", "query"])
    """The full resource ID of a subnet in a virtual network to deploy the Redis cache in. Example
     format:
     /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/Microsoft.{Network|ClassicNetwork}/VirtualNetworks/vnet1/subnets/subnet1."""
    static_ip: Optional[str] = rest_field(name="staticIP", visibility=["read", "create"])
    """Static IP address. Optionally, may be specified when deploying a Redis cache inside an existing
     Azure Virtual Network; auto assigned by default."""

    @overload
    def __init__(
        self,
        *,
        sku: "_models.Sku",
        redis_configuration: Optional["_models.RedisCommonPropertiesRedisConfiguration"] = None,
        redis_version: Optional[str] = None,
        enable_non_ssl_port: Optional[bool] = None,
        replicas_per_master: Optional[int] = None,
        replicas_per_primary: Optional[int] = None,
        tenant_settings: Optional[dict[str, str]] = None,
        shard_count: Optional[int] = None,
        minimum_tls_version: Optional[Union[str, "_models.TlsVersion"]] = None,
        public_network_access: Optional[Union[str, "_models.PublicNetworkAccess"]] = None,
        update_channel: Optional[Union[str, "_models.UpdateChannel"]] = None,
        disable_access_key_authentication: Optional[bool] = None,
        zonal_allocation_policy: Optional[Union[str, "_models.ZonalAllocationPolicy"]] = None,
        subnet_id: Optional[str] = None,
        static_ip: 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 RedisFirewallRule(ProxyResource):
    """A firewall rule on a redis cache has a name, and describes a contiguous range of IP addresses
    permitted to connect.

    :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.redis.models.SystemData
    :ivar properties: redis cache firewall rule properties. Required.
    :vartype properties: ~azure.mgmt.redis.models.RedisFirewallRuleProperties
    """

    properties: "_models.RedisFirewallRuleProperties" = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """redis cache firewall rule properties. Required."""

    __flattened_items = ["start_ip", "end_ip"]

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

    @overload
    def __init__(self, mapping: Mapping[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 RedisFirewallRuleProperties(_Model):
    """Specifies a range of IP addresses permitted to connect to the cache.

    :ivar start_ip: lowest IP address included in the range. Required.
    :vartype start_ip: str
    :ivar end_ip: highest IP address included in the range. Required.
    :vartype end_ip: str
    """

    start_ip: str = rest_field(name="startIP", visibility=["read", "create", "update", "delete", "query"])
    """lowest IP address included in the range. Required."""
    end_ip: str = rest_field(name="endIP", visibility=["read", "create", "update", "delete", "query"])
    """highest IP address included in the range. Required."""

    @overload
    def __init__(
        self,
        *,
        start_ip: str,
        end_ip: 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 RedisForceRebootResponse(_Model):
    """Response to force reboot for Redis cache.

    :ivar message: Status message.
    :vartype message: str
    """

    message: Optional[str] = rest_field(visibility=["read"])
    """Status message."""


class RedisInstanceDetails(_Model):
    """Details of single instance of redis.

    :ivar ssl_port: Redis instance SSL port.
    :vartype ssl_port: int
    :ivar non_ssl_port: If enableNonSslPort is true, provides Redis instance Non-SSL port.
    :vartype non_ssl_port: int
    :ivar zone: If the Cache uses availability zones, specifies availability zone where this
     instance is located.
    :vartype zone: str
    :ivar shard_id: If clustering is enabled, the Shard ID of Redis Instance.
    :vartype shard_id: int
    :ivar is_master: Specifies whether the instance is a primary node.
    :vartype is_master: bool
    :ivar is_primary: Specifies whether the instance is a primary node.
    :vartype is_primary: bool
    """

    ssl_port: Optional[int] = rest_field(name="sslPort", visibility=["read"])
    """Redis instance SSL port."""
    non_ssl_port: Optional[int] = rest_field(name="nonSslPort", visibility=["read"])
    """If enableNonSslPort is true, provides Redis instance Non-SSL port."""
    zone: Optional[str] = rest_field(visibility=["read"])
    """If the Cache uses availability zones, specifies availability zone where this instance is
     located."""
    shard_id: Optional[int] = rest_field(name="shardId", visibility=["read"])
    """If clustering is enabled, the Shard ID of Redis Instance."""
    is_master: Optional[bool] = rest_field(name="isMaster", visibility=["read"])
    """Specifies whether the instance is a primary node."""
    is_primary: Optional[bool] = rest_field(name="isPrimary", visibility=["read"])
    """Specifies whether the instance is a primary node."""


class RedisLinkedServer(_Model):
    """Linked server Id.

    :ivar id: Linked server Id.
    :vartype id: str
    """

    id: Optional[str] = rest_field(visibility=["read"])
    """Linked server Id."""


class RedisLinkedServerCreateParameters(_Model):
    """Parameter required for creating a linked server to redis cache.

    :ivar properties: Properties required to create a linked server. Required.
    :vartype properties: ~azure.mgmt.redis.models.RedisLinkedServerCreateProperties
    """

    properties: "_models.RedisLinkedServerCreateProperties" = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """Properties required to create a linked server. Required."""

    __flattened_items = [
        "linked_redis_cache_id",
        "linked_redis_cache_location",
        "server_role",
        "geo_replicated_primary_host_name",
        "primary_host_name",
    ]

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

    @overload
    def __init__(self, mapping: Mapping[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 RedisLinkedServerCreateProperties(_Model):
    """Create properties for a linked server.

    :ivar linked_redis_cache_id: Fully qualified resourceId of the linked redis cache. Required.
    :vartype linked_redis_cache_id: str
    :ivar linked_redis_cache_location: Location of the linked redis cache. Required.
    :vartype linked_redis_cache_location: str
    :ivar server_role: Role of the linked server. Required. Known values are: "Primary" and
     "Secondary".
    :vartype server_role: str or ~azure.mgmt.redis.models.ReplicationRole
    :ivar geo_replicated_primary_host_name: The unchanging DNS name which will always point to
     current geo-primary cache among the linked redis caches for seamless Geo Failover experience.
    :vartype geo_replicated_primary_host_name: str
    :ivar primary_host_name: The changing DNS name that resolves to the current geo-primary cache
     among the linked redis caches before or after the Geo Failover.
    :vartype primary_host_name: str
    """

    linked_redis_cache_id: str = rest_field(
        name="linkedRedisCacheId", visibility=["read", "create", "update", "delete", "query"]
    )
    """Fully qualified resourceId of the linked redis cache. Required."""
    linked_redis_cache_location: str = rest_field(name="linkedRedisCacheLocation", visibility=["read", "create"])
    """Location of the linked redis cache. Required."""
    server_role: Union[str, "_models.ReplicationRole"] = rest_field(
        name="serverRole", visibility=["read", "create", "update", "delete", "query"]
    )
    """Role of the linked server. Required. Known values are: \"Primary\" and \"Secondary\"."""
    geo_replicated_primary_host_name: Optional[str] = rest_field(
        name="geoReplicatedPrimaryHostName", visibility=["read"]
    )
    """The unchanging DNS name which will always point to current geo-primary cache among the linked
     redis caches for seamless Geo Failover experience."""
    primary_host_name: Optional[str] = rest_field(name="primaryHostName", visibility=["read"])
    """The changing DNS name that resolves to the current geo-primary cache among the linked redis
     caches before or after the Geo Failover."""

    @overload
    def __init__(
        self,
        *,
        linked_redis_cache_id: str,
        linked_redis_cache_location: str,
        server_role: Union[str, "_models.ReplicationRole"],
    ) -> None: ...

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

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


class RedisLinkedServerProperties(RedisLinkedServerCreateProperties):
    """Properties of a linked server to be returned in get/put response.

    :ivar linked_redis_cache_id: Fully qualified resourceId of the linked redis cache. Required.
    :vartype linked_redis_cache_id: str
    :ivar linked_redis_cache_location: Location of the linked redis cache. Required.
    :vartype linked_redis_cache_location: str
    :ivar server_role: Role of the linked server. Required. Known values are: "Primary" and
     "Secondary".
    :vartype server_role: str or ~azure.mgmt.redis.models.ReplicationRole
    :ivar geo_replicated_primary_host_name: The unchanging DNS name which will always point to
     current geo-primary cache among the linked redis caches for seamless Geo Failover experience.
    :vartype geo_replicated_primary_host_name: str
    :ivar primary_host_name: The changing DNS name that resolves to the current geo-primary cache
     among the linked redis caches before or after the Geo Failover.
    :vartype primary_host_name: str
    :ivar provisioning_state: Terminal state of the link between primary and secondary redis cache.
    :vartype provisioning_state: str
    """

    provisioning_state: Optional[str] = rest_field(name="provisioningState", visibility=["read"])
    """Terminal state of the link between primary and secondary redis cache."""

    @overload
    def __init__(
        self,
        *,
        linked_redis_cache_id: str,
        linked_redis_cache_location: str,
        server_role: Union[str, "_models.ReplicationRole"],
    ) -> None: ...

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

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


class RedisLinkedServerWithProperties(ProxyResource):
    """Response to put/get linked server (with properties) for Redis cache.

    :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.redis.models.SystemData
    :ivar properties: Properties of the linked server.
    :vartype properties: ~azure.mgmt.redis.models.RedisLinkedServerProperties
    """

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

    __flattened_items = [
        "linked_redis_cache_id",
        "linked_redis_cache_location",
        "server_role",
        "geo_replicated_primary_host_name",
        "primary_host_name",
        "provisioning_state",
    ]

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

    @overload
    def __init__(self, mapping: Mapping[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 RedisPatchSchedule(ProxyResource):
    """Response to put/get patch schedules for Redis cache.

    :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.redis.models.SystemData
    :ivar properties: List of patch schedules for a Redis cache. Required.
    :vartype properties: ~azure.mgmt.redis.models.ScheduleEntries
    :ivar location: The geo-location where the resource lives.
    :vartype location: str
    """

    properties: "_models.ScheduleEntries" = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """List of patch schedules for a Redis cache. Required."""
    location: Optional[str] = rest_field(visibility=["read"])
    """The geo-location where the resource lives."""

    __flattened_items = ["schedule_entries"]

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

    @overload
    def __init__(self, mapping: Mapping[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 RedisProperties(RedisCreateProperties):
    """Properties of the redis cache.

    :ivar redis_configuration: All Redis Settings. Few possible keys:
     rdb-backup-enabled,rdb-storage-connection-string,rdb-backup-frequency,maxmemory-delta,
     maxmemory-policy,notify-keyspace-events, aof-backup-enabled, aof-storage-connection-string-0,
     aof-storage-connection-string-1 etc.
    :vartype redis_configuration: ~azure.mgmt.redis.models.RedisCommonPropertiesRedisConfiguration
    :ivar redis_version: Redis version. This should be in the form 'major[.minor]' (only 'major' is
     required) or the value 'latest' which refers to the latest stable Redis version that is
     available. Supported versions: 4.0, 6.0 (latest). Default value is 'latest'.
    :vartype redis_version: str
    :ivar enable_non_ssl_port: Specifies whether the non-ssl Redis server port (6379) is enabled.
    :vartype enable_non_ssl_port: bool
    :ivar replicas_per_master: The number of replicas to be created per primary.
    :vartype replicas_per_master: int
    :ivar replicas_per_primary: The number of replicas to be created per primary.
    :vartype replicas_per_primary: int
    :ivar tenant_settings: A dictionary of tenant settings.
    :vartype tenant_settings: dict[str, str]
    :ivar shard_count: The number of shards to be created on a Premium Cluster Cache.
    :vartype shard_count: int
    :ivar minimum_tls_version: Optional: requires clients to use a specified TLS version (or
     higher) to connect (e,g, '1.0', '1.1', '1.2'). Known values are: "1.0", "1.1", and "1.2".
    :vartype minimum_tls_version: str or ~azure.mgmt.redis.models.TlsVersion
    :ivar public_network_access: Whether or not public endpoint access is allowed for this cache.
     Value is optional but if passed in, must be 'Enabled' or 'Disabled'. If 'Disabled', private
     endpoints are the exclusive access method. Known values are: "Enabled" and "Disabled".
    :vartype public_network_access: str or ~azure.mgmt.redis.models.PublicNetworkAccess
    :ivar update_channel: Optional: Specifies the update channel for the monthly Redis updates your
     Redis Cache will receive. Caches using 'Preview' update channel get latest Redis updates at
     least 4 weeks ahead of 'Stable' channel caches. Default value is 'Stable'. Known values are:
     "Stable" and "Preview".
    :vartype update_channel: str or ~azure.mgmt.redis.models.UpdateChannel
    :ivar disable_access_key_authentication: Authentication to Redis through access keys is
     disabled when set as true. Default value is false.
    :vartype disable_access_key_authentication: bool
    :ivar zonal_allocation_policy: Optional: Specifies how availability zones are allocated to the
     Redis cache. 'Automatic' enables zone redundancy and Azure will automatically select zones
     based on regional availability and capacity. 'UserDefined' will select availability zones
     passed in by you using the 'zones' parameter. 'NoZones' will produce a non-zonal cache. If
     'zonalAllocationPolicy' is not passed, it will be set to 'UserDefined' when zones are passed
     in, otherwise, it will be set to 'Automatic' in regions where zones are supported and 'NoZones'
     in regions where zones are not supported. Known values are: "Automatic", "UserDefined", and
     "NoZones".
    :vartype zonal_allocation_policy: str or ~azure.mgmt.redis.models.ZonalAllocationPolicy
    :ivar sku: The SKU of the Redis cache to deploy. Required.
    :vartype sku: ~azure.mgmt.redis.models.Sku
    :ivar subnet_id: The full resource ID of a subnet in a virtual network to deploy the Redis
     cache in. Example format:
     /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/Microsoft.{Network|ClassicNetwork}/VirtualNetworks/vnet1/subnets/subnet1.
    :vartype subnet_id: str
    :ivar static_ip: Static IP address. Optionally, may be specified when deploying a Redis cache
     inside an existing Azure Virtual Network; auto assigned by default.
    :vartype static_ip: str
    :ivar provisioning_state: Redis instance provisioning status. Known values are: "Creating",
     "Deleting", "Disabled", "Failed", "Linking", "Provisioning", "RecoveringScaleFailure",
     "Scaling", "Succeeded", "Unlinking", "Unprovisioning", "Updating", "ConfiguringAAD",
     "Migrating", "MigrationFailed", "MigrationSucceeded", "MigrationCancelling", and
     "MigrationCancellationFailed".
    :vartype provisioning_state: str or ~azure.mgmt.redis.models.ProvisioningState
    :ivar host_name: Redis host name.
    :vartype host_name: str
    :ivar port: Redis non-SSL port.
    :vartype port: int
    :ivar ssl_port: Redis SSL port.
    :vartype ssl_port: int
    :ivar access_keys: The keys of the Redis cache - not set if this object is not the response to
     Create or Update redis cache.
    :vartype access_keys: ~azure.mgmt.redis.models.RedisAccessKeys
    :ivar linked_servers: List of the linked servers associated with the cache.
    :vartype linked_servers: list[~azure.mgmt.redis.models.RedisLinkedServer]
    :ivar instances: List of the Redis instances associated with the cache.
    :vartype instances: list[~azure.mgmt.redis.models.RedisInstanceDetails]
    :ivar private_endpoint_connections: List of private endpoint connection associated with the
     specified redis cache.
    :vartype private_endpoint_connections: list[~azure.mgmt.redis.models.PrivateEndpointConnection]
    :ivar target_amr_resource_id: The resource ID of the target Azure Managed Redis resource that
     this Azure Cache for Redis resource is being migrated to.
    :vartype target_amr_resource_id: str
    """

    provisioning_state: Optional[Union[str, "_models.ProvisioningState"]] = rest_field(
        name="provisioningState", visibility=["read"]
    )
    """Redis instance provisioning status. Known values are: \"Creating\", \"Deleting\", \"Disabled\",
     \"Failed\", \"Linking\", \"Provisioning\", \"RecoveringScaleFailure\", \"Scaling\",
     \"Succeeded\", \"Unlinking\", \"Unprovisioning\", \"Updating\", \"ConfiguringAAD\",
     \"Migrating\", \"MigrationFailed\", \"MigrationSucceeded\", \"MigrationCancelling\", and
     \"MigrationCancellationFailed\"."""
    host_name: Optional[str] = rest_field(name="hostName", visibility=["read"])
    """Redis host name."""
    port: Optional[int] = rest_field(visibility=["read"])
    """Redis non-SSL port."""
    ssl_port: Optional[int] = rest_field(name="sslPort", visibility=["read"])
    """Redis SSL port."""
    access_keys: Optional["_models.RedisAccessKeys"] = rest_field(name="accessKeys", visibility=["read"])
    """The keys of the Redis cache - not set if this object is not the response to Create or Update
     redis cache."""
    linked_servers: Optional[list["_models.RedisLinkedServer"]] = rest_field(name="linkedServers", visibility=["read"])
    """List of the linked servers associated with the cache."""
    instances: Optional[list["_models.RedisInstanceDetails"]] = rest_field(visibility=["read"])
    """List of the Redis instances associated with the cache."""
    private_endpoint_connections: Optional[list["_models.PrivateEndpointConnection"]] = rest_field(
        name="privateEndpointConnections", visibility=["read"]
    )
    """List of private endpoint connection associated with the specified redis cache."""
    target_amr_resource_id: Optional[str] = rest_field(name="targetAmrResourceId", visibility=["read"])
    """The resource ID of the target Azure Managed Redis resource that this Azure Cache for Redis
     resource is being migrated to."""

    @overload
    def __init__(
        self,
        *,
        sku: "_models.Sku",
        redis_configuration: Optional["_models.RedisCommonPropertiesRedisConfiguration"] = None,
        redis_version: Optional[str] = None,
        enable_non_ssl_port: Optional[bool] = None,
        replicas_per_master: Optional[int] = None,
        replicas_per_primary: Optional[int] = None,
        tenant_settings: Optional[dict[str, str]] = None,
        shard_count: Optional[int] = None,
        minimum_tls_version: Optional[Union[str, "_models.TlsVersion"]] = None,
        public_network_access: Optional[Union[str, "_models.PublicNetworkAccess"]] = None,
        update_channel: Optional[Union[str, "_models.UpdateChannel"]] = None,
        disable_access_key_authentication: Optional[bool] = None,
        zonal_allocation_policy: Optional[Union[str, "_models.ZonalAllocationPolicy"]] = None,
        subnet_id: Optional[str] = None,
        static_ip: 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 RedisRebootParameters(_Model):
    """Specifies which Redis node(s) to reboot.

    :ivar reboot_type: Which Redis node(s) to reboot. Depending on this value data loss is
     possible. Known values are: "PrimaryNode", "SecondaryNode", and "AllNodes".
    :vartype reboot_type: str or ~azure.mgmt.redis.models.RebootType
    :ivar shard_id: If clustering is enabled, the ID of the shard to be rebooted.
    :vartype shard_id: int
    :ivar ports: A list of redis instances to reboot, specified by per-instance SSL ports or
     non-SSL ports.
    :vartype ports: list[int]
    """

    reboot_type: Optional[Union[str, "_models.RebootType"]] = rest_field(
        name="rebootType", visibility=["read", "create", "update", "delete", "query"]
    )
    """Which Redis node(s) to reboot. Depending on this value data loss is possible. Known values are:
     \"PrimaryNode\", \"SecondaryNode\", and \"AllNodes\"."""
    shard_id: Optional[int] = rest_field(name="shardId", visibility=["read", "create", "update", "delete", "query"])
    """If clustering is enabled, the ID of the shard to be rebooted."""
    ports: Optional[list[int]] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """A list of redis instances to reboot, specified by per-instance SSL ports or non-SSL ports."""

    @overload
    def __init__(
        self,
        *,
        reboot_type: Optional[Union[str, "_models.RebootType"]] = None,
        shard_id: Optional[int] = None,
        ports: Optional[list[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 RedisRegenerateKeyParameters(_Model):
    """Specifies which Redis access keys to reset.

    :ivar key_type: The Redis access key to regenerate. Required. Known values are: "Primary" and
     "Secondary".
    :vartype key_type: str or ~azure.mgmt.redis.models.RedisKeyType
    """

    key_type: Union[str, "_models.RedisKeyType"] = rest_field(
        name="keyType", visibility=["read", "create", "update", "delete", "query"]
    )
    """The Redis access key to regenerate. Required. Known values are: \"Primary\" and \"Secondary\"."""

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

    @overload
    def __init__(self, mapping: Mapping[str, Any]) -> None:
        """
        :param mapping: 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.redis.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 RedisResource(TrackedResource):
    """A single Redis item in List or Get Operation.

    :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.redis.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: Redis cache properties. Required.
    :vartype properties: ~azure.mgmt.redis.models.RedisProperties
    :ivar zones: The availability zones.
    :vartype zones: list[str]
    :ivar identity: The managed service identities assigned to this resource.
    :vartype identity: ~azure.mgmt.redis.models.ManagedServiceIdentity
    """

    properties: "_models.RedisProperties" = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """Redis cache properties. Required."""
    zones: Optional[list[str]] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """The availability zones."""
    identity: Optional["_models.ManagedServiceIdentity"] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """The managed service identities assigned to this resource."""

    __flattened_items = [
        "redis_configuration",
        "redis_version",
        "enable_non_ssl_port",
        "replicas_per_master",
        "replicas_per_primary",
        "tenant_settings",
        "shard_count",
        "minimum_tls_version",
        "public_network_access",
        "update_channel",
        "disable_access_key_authentication",
        "zonal_allocation_policy",
        "sku",
        "subnet_id",
        "static_ip",
        "provisioning_state",
        "host_name",
        "port",
        "ssl_port",
        "access_keys",
        "linked_servers",
        "instances",
        "private_endpoint_connections",
        "target_amr_resource_id",
    ]

    @overload
    def __init__(
        self,
        *,
        location: str,
        properties: "_models.RedisProperties",
        tags: Optional[dict[str, str]] = None,
        zones: Optional[list[str]] = 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 RedisUpdateParameters(_Model):
    """Parameters supplied to the Update Redis operation.

    :ivar properties: Redis cache properties.
    :vartype properties: ~azure.mgmt.redis.models.RedisUpdateProperties
    :ivar tags: Resource tags.
    :vartype tags: dict[str, str]
    :ivar identity: The identity of the resource.
    :vartype identity: ~azure.mgmt.redis.models.ManagedServiceIdentity
    """

    properties: Optional["_models.RedisUpdateProperties"] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """Redis cache properties."""
    tags: Optional[dict[str, str]] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """Resource tags."""
    identity: Optional["_models.ManagedServiceIdentity"] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """The identity of the resource."""

    __flattened_items = [
        "redis_configuration",
        "redis_version",
        "enable_non_ssl_port",
        "replicas_per_master",
        "replicas_per_primary",
        "tenant_settings",
        "shard_count",
        "minimum_tls_version",
        "public_network_access",
        "update_channel",
        "disable_access_key_authentication",
        "zonal_allocation_policy",
        "sku",
    ]

    @overload
    def __init__(
        self,
        *,
        properties: Optional["_models.RedisUpdateProperties"] = None,
        tags: Optional[dict[str, str]] = 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 RedisUpdateProperties(RedisCommonProperties):
    """Patchable properties of the redis cache.

    :ivar redis_configuration: All Redis Settings. Few possible keys:
     rdb-backup-enabled,rdb-storage-connection-string,rdb-backup-frequency,maxmemory-delta,
     maxmemory-policy,notify-keyspace-events, aof-backup-enabled, aof-storage-connection-string-0,
     aof-storage-connection-string-1 etc.
    :vartype redis_configuration: ~azure.mgmt.redis.models.RedisCommonPropertiesRedisConfiguration
    :ivar redis_version: Redis version. This should be in the form 'major[.minor]' (only 'major' is
     required) or the value 'latest' which refers to the latest stable Redis version that is
     available. Supported versions: 4.0, 6.0 (latest). Default value is 'latest'.
    :vartype redis_version: str
    :ivar enable_non_ssl_port: Specifies whether the non-ssl Redis server port (6379) is enabled.
    :vartype enable_non_ssl_port: bool
    :ivar replicas_per_master: The number of replicas to be created per primary.
    :vartype replicas_per_master: int
    :ivar replicas_per_primary: The number of replicas to be created per primary.
    :vartype replicas_per_primary: int
    :ivar tenant_settings: A dictionary of tenant settings.
    :vartype tenant_settings: dict[str, str]
    :ivar shard_count: The number of shards to be created on a Premium Cluster Cache.
    :vartype shard_count: int
    :ivar minimum_tls_version: Optional: requires clients to use a specified TLS version (or
     higher) to connect (e,g, '1.0', '1.1', '1.2'). Known values are: "1.0", "1.1", and "1.2".
    :vartype minimum_tls_version: str or ~azure.mgmt.redis.models.TlsVersion
    :ivar public_network_access: Whether or not public endpoint access is allowed for this cache.
     Value is optional but if passed in, must be 'Enabled' or 'Disabled'. If 'Disabled', private
     endpoints are the exclusive access method. Known values are: "Enabled" and "Disabled".
    :vartype public_network_access: str or ~azure.mgmt.redis.models.PublicNetworkAccess
    :ivar update_channel: Optional: Specifies the update channel for the monthly Redis updates your
     Redis Cache will receive. Caches using 'Preview' update channel get latest Redis updates at
     least 4 weeks ahead of 'Stable' channel caches. Default value is 'Stable'. Known values are:
     "Stable" and "Preview".
    :vartype update_channel: str or ~azure.mgmt.redis.models.UpdateChannel
    :ivar disable_access_key_authentication: Authentication to Redis through access keys is
     disabled when set as true. Default value is false.
    :vartype disable_access_key_authentication: bool
    :ivar zonal_allocation_policy: Optional: Specifies how availability zones are allocated to the
     Redis cache. 'Automatic' enables zone redundancy and Azure will automatically select zones
     based on regional availability and capacity. 'UserDefined' will select availability zones
     passed in by you using the 'zones' parameter. 'NoZones' will produce a non-zonal cache. If
     'zonalAllocationPolicy' is not passed, it will be set to 'UserDefined' when zones are passed
     in, otherwise, it will be set to 'Automatic' in regions where zones are supported and 'NoZones'
     in regions where zones are not supported. Known values are: "Automatic", "UserDefined", and
     "NoZones".
    :vartype zonal_allocation_policy: str or ~azure.mgmt.redis.models.ZonalAllocationPolicy
    :ivar sku: The SKU of the Redis cache to deploy.
    :vartype sku: ~azure.mgmt.redis.models.Sku
    """

    sku: Optional["_models.Sku"] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """The SKU of the Redis cache to deploy."""

    @overload
    def __init__(
        self,
        *,
        redis_configuration: Optional["_models.RedisCommonPropertiesRedisConfiguration"] = None,
        redis_version: Optional[str] = None,
        enable_non_ssl_port: Optional[bool] = None,
        replicas_per_master: Optional[int] = None,
        replicas_per_primary: Optional[int] = None,
        tenant_settings: Optional[dict[str, str]] = None,
        shard_count: Optional[int] = None,
        minimum_tls_version: Optional[Union[str, "_models.TlsVersion"]] = None,
        public_network_access: Optional[Union[str, "_models.PublicNetworkAccess"]] = None,
        update_channel: Optional[Union[str, "_models.UpdateChannel"]] = None,
        disable_access_key_authentication: Optional[bool] = None,
        zonal_allocation_policy: Optional[Union[str, "_models.ZonalAllocationPolicy"]] = 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:
        super().__init__(*args, **kwargs)


class ScheduleEntries(_Model):
    """List of patch schedules for a Redis cache.

    :ivar schedule_entries: List of patch schedules for a Redis cache. Required.
    :vartype schedule_entries: list[~azure.mgmt.redis.models.ScheduleEntry]
    """

    schedule_entries: list["_models.ScheduleEntry"] = rest_field(
        name="scheduleEntries", visibility=["read", "create", "update", "delete", "query"]
    )
    """List of patch schedules for a Redis cache. Required."""

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

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

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


class ScheduleEntry(_Model):
    """Patch schedule entry for a Premium Redis Cache.

    :ivar day_of_week: Day of the week when a cache can be patched. Required. Known values are:
     "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday", "Everyday", and
     "Weekend".
    :vartype day_of_week: str or ~azure.mgmt.redis.models.DayOfWeek
    :ivar start_hour_utc: Start hour after which cache patching can start. Required.
    :vartype start_hour_utc: int
    :ivar maintenance_window: ISO8601 timespan specifying how much time cache patching can take.
    :vartype maintenance_window: ~datetime.timedelta
    """

    day_of_week: Union[str, "_models.DayOfWeek"] = rest_field(
        name="dayOfWeek", visibility=["read", "create", "update", "delete", "query"]
    )
    """Day of the week when a cache can be patched. Required. Known values are: \"Monday\",
     \"Tuesday\", \"Wednesday\", \"Thursday\", \"Friday\", \"Saturday\", \"Sunday\", \"Everyday\",
     and \"Weekend\"."""
    start_hour_utc: int = rest_field(name="startHourUtc", visibility=["read", "create", "update", "delete", "query"])
    """Start hour after which cache patching can start. Required."""
    maintenance_window: Optional[datetime.timedelta] = rest_field(
        name="maintenanceWindow", visibility=["read", "create", "update", "delete", "query"]
    )
    """ISO8601 timespan specifying how much time cache patching can take."""

    @overload
    def __init__(
        self,
        *,
        day_of_week: Union[str, "_models.DayOfWeek"],
        start_hour_utc: int,
        maintenance_window: Optional[datetime.timedelta] = None,
    ) -> None: ...

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

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


class Sku(_Model):
    """SKU parameters supplied to the create Redis operation.

    :ivar name: The type of Redis cache to deploy. Valid values: (Basic, Standard, Premium).
     Required. Known values are: "Basic", "Standard", and "Premium".
    :vartype name: str or ~azure.mgmt.redis.models.SkuName
    :ivar family: The SKU family to use. Valid values: (C, P). (C = Basic/Standard, P = Premium).
     Required. Known values are: "C" and "P".
    :vartype family: str or ~azure.mgmt.redis.models.SkuFamily
    :ivar capacity: The size of the Redis cache to deploy. Valid values: for C (Basic/Standard)
     family (0, 1, 2, 3, 4, 5, 6), for P (Premium) family (1, 2, 3, 4). Required.
    :vartype capacity: int
    """

    name: Union[str, "_models.SkuName"] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """The type of Redis cache to deploy. Valid values: (Basic, Standard, Premium). Required. Known
     values are: \"Basic\", \"Standard\", and \"Premium\"."""
    family: Union[str, "_models.SkuFamily"] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """The SKU family to use. Valid values: (C, P). (C = Basic/Standard, P = Premium). Required. Known
     values are: \"C\" and \"P\"."""
    capacity: int = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """The size of the Redis cache to deploy. Valid values: for C (Basic/Standard) family (0, 1, 2, 3,
     4, 5, 6), for P (Premium) family (1, 2, 3, 4). Required."""

    @overload
    def __init__(
        self,
        *,
        name: Union[str, "_models.SkuName"],
        family: Union[str, "_models.SkuFamily"],
        capacity: int,
    ) -> None: ...

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

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


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

    :ivar created_by: The identity that created the resource.
    :vartype created_by: str
    :ivar created_by_type: The type of identity that created the resource. Known values are:
     "User", "Application", "ManagedIdentity", and "Key".
    :vartype created_by_type: str or ~azure.mgmt.redis.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.redis.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 UpgradeNotification(_Model):
    """Properties of upgrade notification.

    :ivar name: Name of upgrade notification.
    :vartype name: str
    :ivar timestamp: Timestamp when upgrade notification occurred.
    :vartype timestamp: ~datetime.datetime
    :ivar upsell_notification: Details about this upgrade notification.
    :vartype upsell_notification: dict[str, str]
    """

    name: Optional[str] = rest_field(visibility=["read"])
    """Name of upgrade notification."""
    timestamp: Optional[datetime.datetime] = rest_field(visibility=["read"], format="rfc3339")
    """Timestamp when upgrade notification occurred."""
    upsell_notification: Optional[dict[str, str]] = rest_field(name="upsellNotification", visibility=["read"])
    """Details about this upgrade notification."""


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