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

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

from .._utils.model_base import Model as _Model, rest_discriminator, rest_field
from ._enums import ObjectType

if TYPE_CHECKING:
    from .. import models as _models


class AdministratorProperties(_Model):
    """The properties of an administrator.

    :ivar administrator_type: Type of the sever administrator. "ActiveDirectory"
    :vartype administrator_type: str or ~azure.mgmt.mysqlflexibleservers.models.AdministratorType
    :ivar login: Login name of the server administrator.
    :vartype login: str
    :ivar sid: SID (object ID) of the server administrator.
    :vartype sid: str
    :ivar tenant_id: Tenant ID of the administrator.
    :vartype tenant_id: str
    :ivar identity_resource_id: The resource id of the identity used for AAD Authentication.
    :vartype identity_resource_id: str
    """

    administrator_type: Optional[Union[str, "_models.AdministratorType"]] = rest_field(
        name="administratorType", visibility=["read", "create", "update", "delete", "query"]
    )
    """Type of the sever administrator. \"ActiveDirectory\""""
    login: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """Login name of the server administrator."""
    sid: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """SID (object ID) of the server administrator."""
    tenant_id: Optional[str] = rest_field(name="tenantId", visibility=["read", "create", "update", "delete", "query"])
    """Tenant ID of the administrator."""
    identity_resource_id: Optional[str] = rest_field(
        name="identityResourceId", visibility=["read", "create", "update", "delete", "query"]
    )
    """The resource id of the identity used for AAD Authentication."""

    @overload
    def __init__(
        self,
        *,
        administrator_type: Optional[Union[str, "_models.AdministratorType"]] = None,
        login: Optional[str] = None,
        sid: Optional[str] = None,
        tenant_id: Optional[str] = None,
        identity_resource_id: Optional[str] = None,
    ) -> None: ...

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

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


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

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


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

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


class AdvancedThreatProtection(ProxyResource):
    """A server's Advanced Threat Protection.

    :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.mysqlflexibleservers.models.SystemData
    :ivar properties: Resource properties.
    :vartype properties: ~azure.mgmt.mysqlflexibleservers.models.AdvancedThreatProtectionProperties
    """

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

    __flattened_items = ["creation_time", "state", "provisioning_state"]

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

    @overload
    def __init__(self, mapping: Mapping[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 AdvancedThreatProtectionForUpdate(_Model):
    """Parameters allowed to update advanced threat protection for a server.

    :ivar properties: Resource update properties.
    :vartype properties:
     ~azure.mgmt.mysqlflexibleservers.models.AdvancedThreatProtectionUpdateProperties
    """

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

    __flattened_items = ["state"]

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

    @overload
    def __init__(self, mapping: Mapping[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 AdvancedThreatProtectionProperties(_Model):
    """Properties of an Advanced Threat Protection setting.

    :ivar creation_time: Specifies the UTC creation time of the policy.
    :vartype creation_time: ~datetime.datetime
    :ivar state: Specifies the state of the Advanced Threat Protection, whether it is enabled or
     disabled or a state has not been applied yet on the specific database or server. Known values
     are: "Enabled" and "Disabled".
    :vartype state: str or ~azure.mgmt.mysqlflexibleservers.models.AdvancedThreatProtectionState
    :ivar provisioning_state: Provisioning state of the Threat Protection. Known values are:
     "Succeeded", "Updating", "Canceled", and "Failed".
    :vartype provisioning_state: str or
     ~azure.mgmt.mysqlflexibleservers.models.AdvancedThreatProtectionProvisioningState
    """

    creation_time: Optional[datetime.datetime] = rest_field(name="creationTime", visibility=["read"], format="rfc3339")
    """Specifies the UTC creation time of the policy."""
    state: Optional[Union[str, "_models.AdvancedThreatProtectionState"]] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """Specifies the state of the Advanced Threat Protection, whether it is enabled or disabled or a
     state has not been applied yet on the specific database or server. Known values are:
     \"Enabled\" and \"Disabled\"."""
    provisioning_state: Optional[Union[str, "_models.AdvancedThreatProtectionProvisioningState"]] = rest_field(
        name="provisioningState", visibility=["read"]
    )
    """Provisioning state of the Threat Protection. Known values are: \"Succeeded\", \"Updating\",
     \"Canceled\", and \"Failed\"."""

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

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

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


class AdvancedThreatProtectionUpdateProperties(_Model):
    """Properties of Advanced Threat Protection that can be updated.

    :ivar state: Specifies the state of the Advanced Threat Protection, whether it is enabled or
     disabled or a state has not been applied yet on the specific database or server. Required.
     Known values are: "Enabled" and "Disabled".
    :vartype state: str or ~azure.mgmt.mysqlflexibleservers.models.AdvancedThreatProtectionState
    """

    state: Union[str, "_models.AdvancedThreatProtectionState"] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """Specifies the state of the Advanced Threat Protection, whether it is enabled or disabled or a
     state has not been applied yet on the specific database or server. Required. Known values are:
     \"Enabled\" and \"Disabled\"."""

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

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

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


class AzureADAdministrator(ProxyResource):
    """Represents a Administrator.

    :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.mysqlflexibleservers.models.SystemData
    :ivar properties: The properties of an administrator.
    :vartype properties: ~azure.mgmt.mysqlflexibleservers.models.AdministratorProperties
    """

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

    __flattened_items = ["administrator_type", "login", "sid", "tenant_id", "identity_resource_id"]

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

    @overload
    def __init__(self, mapping: Mapping[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 Backup(_Model):
    """Storage Profile properties of a server.

    :ivar backup_retention_days: Backup retention days for the server.
    :vartype backup_retention_days: int
    :ivar backup_interval_hours: Backup interval hours for the server.
    :vartype backup_interval_hours: int
    :ivar geo_redundant_backup: Whether or not geo redundant backup is enabled. Known values are:
     "Enabled" and "Disabled".
    :vartype geo_redundant_backup: str or ~azure.mgmt.mysqlflexibleservers.models.EnableStatusEnum
    :ivar earliest_restore_date: Earliest restore point creation time (ISO8601 format).
    :vartype earliest_restore_date: ~datetime.datetime
    """

    backup_retention_days: Optional[int] = rest_field(
        name="backupRetentionDays", visibility=["read", "create", "update", "delete", "query"]
    )
    """Backup retention days for the server."""
    backup_interval_hours: Optional[int] = rest_field(
        name="backupIntervalHours", visibility=["read", "create", "update", "delete", "query"]
    )
    """Backup interval hours for the server."""
    geo_redundant_backup: Optional[Union[str, "_models.EnableStatusEnum"]] = rest_field(
        name="geoRedundantBackup", visibility=["read", "create", "update", "delete", "query"]
    )
    """Whether or not geo redundant backup is enabled. Known values are: \"Enabled\" and \"Disabled\"."""
    earliest_restore_date: Optional[datetime.datetime] = rest_field(
        name="earliestRestoreDate", visibility=["read"], format="rfc3339"
    )
    """Earliest restore point creation time (ISO8601 format)."""

    @overload
    def __init__(
        self,
        *,
        backup_retention_days: Optional[int] = None,
        backup_interval_hours: Optional[int] = None,
        geo_redundant_backup: Optional[Union[str, "_models.EnableStatusEnum"]] = None,
    ) -> None: ...

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

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


class BackupRequestBase(_Model):
    """BackupRequestBase is the base for all backup request.

    :ivar backup_settings: Backup Settings. Required.
    :vartype backup_settings: ~azure.mgmt.mysqlflexibleservers.models.BackupSettings
    """

    backup_settings: "_models.BackupSettings" = rest_field(
        name="backupSettings", visibility=["read", "create", "update", "delete", "query"]
    )
    """Backup Settings. Required."""

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

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

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


class BackupAndExportRequest(BackupRequestBase):
    """BackupAndExport API Request.

    :ivar backup_settings: Backup Settings. Required.
    :vartype backup_settings: ~azure.mgmt.mysqlflexibleservers.models.BackupSettings
    :ivar target_details: Backup Target Store Details. Required.
    :vartype target_details: ~azure.mgmt.mysqlflexibleservers.models.BackupStoreDetails
    """

    target_details: "_models.BackupStoreDetails" = rest_field(
        name="targetDetails", visibility=["read", "create", "update", "delete", "query"]
    )
    """Backup Target Store Details. Required."""

    @overload
    def __init__(
        self,
        *,
        backup_settings: "_models.BackupSettings",
        target_details: "_models.BackupStoreDetails",
    ) -> None: ...

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

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


class BackupAndExportResponse(ProxyResource):
    """Represents BackupAndExportAPI Response.

    :ivar id: Fully qualified resource ID for the resource. Ex -
     /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}.
    :vartype id: 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.mysqlflexibleservers.models.SystemData
    :ivar properties: The resource-specific properties for this resource.
    :vartype properties: ~azure.mgmt.mysqlflexibleservers.models.BackupAndExportResponseProperties
    :ivar error: The error object.
    :vartype error: ~azure.mgmt.mysqlflexibleservers.models.ErrorDetail
    :ivar name: The name of the backup and export response. Required.
    :vartype name: str
    :ivar status: The operation status. Known values are: "Pending", "InProgress", "Succeeded",
     "Failed", "CancelInProgress", and "Canceled".
    :vartype status: str or ~azure.mgmt.mysqlflexibleservers.models.OperationStatus
    :ivar start_time: Start time.
    :vartype start_time: ~datetime.datetime
    :ivar end_time: End time.
    :vartype end_time: ~datetime.datetime
    :ivar percent_complete: Operation progress (0-100).
    :vartype percent_complete: float
    """

    properties: Optional["_models.BackupAndExportResponseProperties"] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """The resource-specific properties for this resource."""
    error: Optional["_models.ErrorDetail"] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """The error object."""
    name: str = rest_field(visibility=["read"])
    """The name of the backup and export response. Required."""
    status: Optional[Union[str, "_models.OperationStatus"]] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """The operation status. Known values are: \"Pending\", \"InProgress\", \"Succeeded\", \"Failed\",
     \"CancelInProgress\", and \"Canceled\"."""
    start_time: Optional[datetime.datetime] = rest_field(
        name="startTime", visibility=["read", "create", "update", "delete", "query"], format="rfc3339"
    )
    """Start time."""
    end_time: Optional[datetime.datetime] = rest_field(
        name="endTime", visibility=["read", "create", "update", "delete", "query"], format="rfc3339"
    )
    """End time."""
    percent_complete: Optional[float] = rest_field(
        name="percentComplete", visibility=["read", "create", "update", "delete", "query"]
    )
    """Operation progress (0-100)."""

    __flattened_items = ["datasource_size_in_bytes", "data_transferred_in_bytes", "backup_metadata"]

    @overload
    def __init__(
        self,
        *,
        properties: Optional["_models.BackupAndExportResponseProperties"] = None,
        error: Optional["_models.ErrorDetail"] = None,
        status: Optional[Union[str, "_models.OperationStatus"]] = None,
        start_time: Optional[datetime.datetime] = None,
        end_time: Optional[datetime.datetime] = None,
        percent_complete: Optional[float] = None,
    ) -> None: ...

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

    def __init__(self, *args: Any, **kwargs: Any) -> None:
        _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 BackupAndExportResponseProperties(_Model):
    """BackupAndExport Response Properties.

    :ivar datasource_size_in_bytes: Size of datasource in bytes.
    :vartype datasource_size_in_bytes: int
    :ivar data_transferred_in_bytes: Data transferred in bytes.
    :vartype data_transferred_in_bytes: int
    :ivar backup_metadata: Metadata related to backup to be stored for restoring resource in
     key-value pairs.
    :vartype backup_metadata: str
    """

    datasource_size_in_bytes: Optional[int] = rest_field(
        name="datasourceSizeInBytes", visibility=["read", "create", "update", "delete", "query"]
    )
    """Size of datasource in bytes."""
    data_transferred_in_bytes: Optional[int] = rest_field(
        name="dataTransferredInBytes", visibility=["read", "create", "update", "delete", "query"]
    )
    """Data transferred in bytes."""
    backup_metadata: Optional[str] = rest_field(
        name="backupMetadata", visibility=["read", "create", "update", "delete", "query"]
    )
    """Metadata related to backup to be stored for restoring resource in key-value pairs."""

    @overload
    def __init__(
        self,
        *,
        datasource_size_in_bytes: Optional[int] = None,
        data_transferred_in_bytes: Optional[int] = None,
        backup_metadata: 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 OperationProgressResponseType(_Model):
    """Represents the response properties specific to the operation.

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

    :ivar object_type: Identifies the type of source operation. Required. Known values are:
     "BackupAndExportResponse" and "ImportFromStorageResponse".
    :vartype object_type: str or ~azure.mgmt.mysqlflexibleservers.models.ObjectType
    """

    __mapping__: dict[str, _Model] = {}
    object_type: str = rest_discriminator(name="objectType", visibility=["read", "create", "update", "delete", "query"])
    """Identifies the type of source operation. Required. Known values are:
     \"BackupAndExportResponse\" and \"ImportFromStorageResponse\"."""

    @overload
    def __init__(
        self,
        *,
        object_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 BackupAndExportResponseType(OperationProgressResponseType, discriminator="BackupAndExportResponse"):
    """BackupAndExport Response Properties.

    :ivar datasource_size_in_bytes: Size of datasource in bytes.
    :vartype datasource_size_in_bytes: int
    :ivar data_transferred_in_bytes: Data transferred in bytes.
    :vartype data_transferred_in_bytes: int
    :ivar backup_metadata: Metadata related to backup to be stored for restoring resource in
     key-value pairs.
    :vartype backup_metadata: str
    :ivar object_type: Identifies the type of source operation. Required.
     BACKUP_AND_EXPORT_RESPONSE.
    :vartype object_type: str or ~azure.mgmt.mysqlflexibleservers.models.BACKUP_AND_EXPORT_RESPONSE
    """

    datasource_size_in_bytes: Optional[int] = rest_field(
        name="datasourceSizeInBytes", visibility=["read", "create", "update", "delete", "query"]
    )
    """Size of datasource in bytes."""
    data_transferred_in_bytes: Optional[int] = rest_field(
        name="dataTransferredInBytes", visibility=["read", "create", "update", "delete", "query"]
    )
    """Data transferred in bytes."""
    backup_metadata: Optional[str] = rest_field(
        name="backupMetadata", visibility=["read", "create", "update", "delete", "query"]
    )
    """Metadata related to backup to be stored for restoring resource in key-value pairs."""
    object_type: Literal[ObjectType.BACKUP_AND_EXPORT_RESPONSE] = rest_discriminator(name="objectType", visibility=["read", "create", "update", "delete", "query"])  # type: ignore
    """Identifies the type of source operation. Required. BACKUP_AND_EXPORT_RESPONSE."""

    @overload
    def __init__(
        self,
        *,
        datasource_size_in_bytes: Optional[int] = None,
        data_transferred_in_bytes: Optional[int] = None,
        backup_metadata: Optional[str] = None,
    ) -> None: ...

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

    def __init__(self, *args: Any, **kwargs: Any) -> None:
        super().__init__(*args, **kwargs)
        self.object_type = ObjectType.BACKUP_AND_EXPORT_RESPONSE  # type: ignore


class BackupSettings(_Model):
    """Backup Settings.

    :ivar backup_name: The name of the backup. Required.
    :vartype backup_name: str
    :ivar backup_format: Backup Format for the current backup. (CollatedFormat is INTERNAL – DO NOT
     USE). Known values are: "CollatedFormat" and "Raw".
    :vartype backup_format: str or ~azure.mgmt.mysqlflexibleservers.models.BackupFormat
    """

    backup_name: str = rest_field(name="backupName", visibility=["read", "create", "update", "delete", "query"])
    """The name of the backup. Required."""
    backup_format: Optional[Union[str, "_models.BackupFormat"]] = rest_field(
        name="backupFormat", visibility=["read", "create", "update", "delete", "query"]
    )
    """Backup Format for the current backup. (CollatedFormat is INTERNAL – DO NOT USE). Known values
     are: \"CollatedFormat\" and \"Raw\"."""

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

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

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


class BackupStoreDetails(_Model):
    """Details about the target where the backup content will be stored.

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

    :ivar object_type: Type of the specific object - used for deserializing. Required. Default
     value is None.
    :vartype object_type: str
    """

    __mapping__: dict[str, _Model] = {}
    object_type: str = rest_discriminator(name="objectType", visibility=["read", "create", "update", "delete", "query"])
    """Type of the specific object - used for deserializing. Required. Default value is None."""

    @overload
    def __init__(
        self,
        *,
        object_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 Capability(ProxyResource):
    """Represents a location capability set.

    :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.mysqlflexibleservers.models.SystemData
    :ivar properties: The properties of a location capability set.
    :vartype properties: ~azure.mgmt.mysqlflexibleservers.models.CapabilityPropertiesV2
    """

    properties: Optional["_models.CapabilityPropertiesV2"] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """The properties of a location capability set."""

    __flattened_items = [
        "supported_geo_backup_regions",
        "supported_flexible_server_editions",
        "supported_server_versions",
        "supported_features",
    ]

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

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

    :ivar zone: zone name.
    :vartype zone: str
    :ivar supported_ha_mode: Supported high availability mode.
    :vartype supported_ha_mode: list[str]
    :ivar supported_geo_backup_regions: supported geo backup regions.
    :vartype supported_geo_backup_regions: list[str]
    :ivar supported_flexible_server_editions: A list of supported flexible server editions.
    :vartype supported_flexible_server_editions:
     list[~azure.mgmt.mysqlflexibleservers.models.ServerEditionCapability]
    """

    zone: Optional[str] = rest_field(visibility=["read"])
    """zone name."""
    supported_ha_mode: Optional[list[str]] = rest_field(name="supportedHAMode", visibility=["read"])
    """Supported high availability mode."""
    supported_geo_backup_regions: Optional[list[str]] = rest_field(
        name="supportedGeoBackupRegions", visibility=["read"]
    )
    """supported geo backup regions."""
    supported_flexible_server_editions: Optional[list["_models.ServerEditionCapability"]] = rest_field(
        name="supportedFlexibleServerEditions", visibility=["read"]
    )
    """A list of supported flexible server editions."""


class CapabilityPropertiesV2(_Model):
    """Location capability.

    :ivar supported_geo_backup_regions: supported geo backup regions.
    :vartype supported_geo_backup_regions: list[str]
    :ivar supported_flexible_server_editions: A list of supported flexible server editions.
    :vartype supported_flexible_server_editions:
     list[~azure.mgmt.mysqlflexibleservers.models.ServerEditionCapabilityV2]
    :ivar supported_server_versions: A list of supported server versions.
    :vartype supported_server_versions:
     list[~azure.mgmt.mysqlflexibleservers.models.ServerVersionCapabilityV2]
    :ivar supported_features: A list of supported features.
    :vartype supported_features: list[~azure.mgmt.mysqlflexibleservers.models.FeatureProperty]
    """

    supported_geo_backup_regions: Optional[list[str]] = rest_field(
        name="supportedGeoBackupRegions", visibility=["read"]
    )
    """supported geo backup regions."""
    supported_flexible_server_editions: Optional[list["_models.ServerEditionCapabilityV2"]] = rest_field(
        name="supportedFlexibleServerEditions", visibility=["read"]
    )
    """A list of supported flexible server editions."""
    supported_server_versions: Optional[list["_models.ServerVersionCapabilityV2"]] = rest_field(
        name="supportedServerVersions", visibility=["read"]
    )
    """A list of supported server versions."""
    supported_features: Optional[list["_models.FeatureProperty"]] = rest_field(
        name="supportedFeatures", visibility=["read"]
    )
    """A list of supported features."""


class Configuration(ProxyResource):
    """Represents a Configuration.

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

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

    __flattened_items = [
        "value",
        "current_value",
        "description",
        "documentation_link",
        "default_value",
        "data_type",
        "allowed_values",
        "source",
        "is_read_only",
        "is_config_pending_restart",
        "is_dynamic_config",
    ]

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

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

    :ivar name: Name of the configuration.
    :vartype name: str
    :ivar properties: The properties can be updated for a configuration.
    :vartype properties:
     ~azure.mgmt.mysqlflexibleservers.models.ConfigurationForBatchUpdateProperties
    """

    name: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """Name of the configuration."""
    properties: Optional["_models.ConfigurationForBatchUpdateProperties"] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """The properties can be updated for a configuration."""

    __flattened_items = ["value", "source"]

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

    @overload
    def __init__(self, mapping: Mapping[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 ConfigurationForBatchUpdateProperties(_Model):
    """The properties can be updated for a configuration.

    :ivar value: Value of the configuration.
    :vartype value: str
    :ivar source: Source of the configuration.
    :vartype source: str
    """

    value: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """Value of the configuration."""
    source: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """Source of the configuration."""

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

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

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


class ConfigurationListForBatchUpdate(_Model):
    """A list of server configurations to update.

    :ivar value: The list of server configurations.
    :vartype value: list[~azure.mgmt.mysqlflexibleservers.models.ConfigurationForBatchUpdate]
    :ivar reset_all_to_default: Whether to reset all server parameters to default. Known values
     are: "True" and "False".
    :vartype reset_all_to_default: str or ~azure.mgmt.mysqlflexibleservers.models.ResetAllToDefault
    """

    value: Optional[list["_models.ConfigurationForBatchUpdate"]] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """The list of server configurations."""
    reset_all_to_default: Optional[Union[str, "_models.ResetAllToDefault"]] = rest_field(
        name="resetAllToDefault", visibility=["read", "create", "update", "delete", "query"]
    )
    """Whether to reset all server parameters to default. Known values are: \"True\" and \"False\"."""

    @overload
    def __init__(
        self,
        *,
        value: Optional[list["_models.ConfigurationForBatchUpdate"]] = None,
        reset_all_to_default: Optional[Union[str, "_models.ResetAllToDefault"]] = None,
    ) -> None: ...

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

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


class ConfigurationListResult(_Model):
    """The response of a Configuration list operation.

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

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

    @overload
    def __init__(
        self,
        *,
        value: Optional[list["_models.Configuration"]] = None,
        next_link: 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 ConfigurationProperties(_Model):
    """The properties of a configuration.

    :ivar value: Value of the configuration.
    :vartype value: str
    :ivar current_value: Current value of the configuration.
    :vartype current_value: str
    :ivar description: Description of the configuration.
    :vartype description: str
    :ivar documentation_link: The link used to get the document from community or Azure site.
    :vartype documentation_link: str
    :ivar default_value: Default value of the configuration.
    :vartype default_value: str
    :ivar data_type: Data type of the configuration.
    :vartype data_type: str
    :ivar allowed_values: Allowed values of the configuration.
    :vartype allowed_values: str
    :ivar source: Source of the configuration. Known values are: "system-default" and
     "user-override".
    :vartype source: str or ~azure.mgmt.mysqlflexibleservers.models.ConfigurationSource
    :ivar is_read_only: If is the configuration read only. Known values are: "True" and "False".
    :vartype is_read_only: str or ~azure.mgmt.mysqlflexibleservers.models.IsReadOnly
    :ivar is_config_pending_restart: If is the configuration pending restart or not. Known values
     are: "True" and "False".
    :vartype is_config_pending_restart: str or
     ~azure.mgmt.mysqlflexibleservers.models.IsConfigPendingRestart
    :ivar is_dynamic_config: If is the configuration dynamic. Known values are: "True" and "False".
    :vartype is_dynamic_config: str or ~azure.mgmt.mysqlflexibleservers.models.IsDynamicConfig
    """

    value: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """Value of the configuration."""
    current_value: Optional[str] = rest_field(
        name="currentValue", visibility=["read", "create", "update", "delete", "query"]
    )
    """Current value of the configuration."""
    description: Optional[str] = rest_field(visibility=["read"])
    """Description of the configuration."""
    documentation_link: Optional[str] = rest_field(name="documentationLink", visibility=["read"])
    """The link used to get the document from community or Azure site."""
    default_value: Optional[str] = rest_field(name="defaultValue", visibility=["read"])
    """Default value of the configuration."""
    data_type: Optional[str] = rest_field(name="dataType", visibility=["read"])
    """Data type of the configuration."""
    allowed_values: Optional[str] = rest_field(name="allowedValues", visibility=["read"])
    """Allowed values of the configuration."""
    source: Optional[Union[str, "_models.ConfigurationSource"]] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """Source of the configuration. Known values are: \"system-default\" and \"user-override\"."""
    is_read_only: Optional[Union[str, "_models.IsReadOnly"]] = rest_field(name="isReadOnly", visibility=["read"])
    """If is the configuration read only. Known values are: \"True\" and \"False\"."""
    is_config_pending_restart: Optional[Union[str, "_models.IsConfigPendingRestart"]] = rest_field(
        name="isConfigPendingRestart", visibility=["read"]
    )
    """If is the configuration pending restart or not. Known values are: \"True\" and \"False\"."""
    is_dynamic_config: Optional[Union[str, "_models.IsDynamicConfig"]] = rest_field(
        name="isDynamicConfig", visibility=["read"]
    )
    """If is the configuration dynamic. Known values are: \"True\" and \"False\"."""

    @overload
    def __init__(
        self,
        *,
        value: Optional[str] = None,
        current_value: Optional[str] = None,
        source: Optional[Union[str, "_models.ConfigurationSource"]] = None,
    ) -> None: ...

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

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


class Database(ProxyResource):
    """Represents a Database.

    :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.mysqlflexibleservers.models.SystemData
    :ivar properties: The properties of a database.
    :vartype properties: ~azure.mgmt.mysqlflexibleservers.models.DatabaseProperties
    """

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

    __flattened_items = ["charset", "collation"]

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

    @overload
    def __init__(self, mapping: Mapping[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 DatabaseProperties(_Model):
    """The properties of a database.

    :ivar charset: The charset of the database.
    :vartype charset: str
    :ivar collation: The collation of the database.
    :vartype collation: str
    """

    charset: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """The charset of the database."""
    collation: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """The collation of the database."""

    @overload
    def __init__(
        self,
        *,
        charset: Optional[str] = None,
        collation: 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 DataEncryption(_Model):
    """The date encryption for cmk.

    :ivar primary_user_assigned_identity_id: Primary user identity resource id.
    :vartype primary_user_assigned_identity_id: str
    :ivar primary_key_uri: Primary key uri.
    :vartype primary_key_uri: str
    :ivar geo_backup_user_assigned_identity_id: Geo backup user identity resource id as identity
     can't cross region, need identity in same region as geo backup.
    :vartype geo_backup_user_assigned_identity_id: str
    :ivar geo_backup_key_uri: Geo backup key uri as key vault can't cross region, need cmk in same
     region as geo backup.
    :vartype geo_backup_key_uri: str
    :ivar type: The key type, AzureKeyVault for enable cmk, SystemManaged for disable cmk. Known
     values are: "AzureKeyVault" and "SystemManaged".
    :vartype type: str or ~azure.mgmt.mysqlflexibleservers.models.DataEncryptionType
    """

    primary_user_assigned_identity_id: Optional[str] = rest_field(
        name="primaryUserAssignedIdentityId", visibility=["read", "create", "update", "delete", "query"]
    )
    """Primary user identity resource id."""
    primary_key_uri: Optional[str] = rest_field(
        name="primaryKeyURI", visibility=["read", "create", "update", "delete", "query"]
    )
    """Primary key uri."""
    geo_backup_user_assigned_identity_id: Optional[str] = rest_field(
        name="geoBackupUserAssignedIdentityId", visibility=["read", "create", "update", "delete", "query"]
    )
    """Geo backup user identity resource id as identity can't cross region, need identity in same
     region as geo backup."""
    geo_backup_key_uri: Optional[str] = rest_field(
        name="geoBackupKeyURI", visibility=["read", "create", "update", "delete", "query"]
    )
    """Geo backup key uri as key vault can't cross region, need cmk in same region as geo backup."""
    type: Optional[Union[str, "_models.DataEncryptionType"]] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """The key type, AzureKeyVault for enable cmk, SystemManaged for disable cmk. Known values are:
     \"AzureKeyVault\" and \"SystemManaged\"."""

    @overload
    def __init__(
        self,
        *,
        primary_user_assigned_identity_id: Optional[str] = None,
        primary_key_uri: Optional[str] = None,
        geo_backup_user_assigned_identity_id: Optional[str] = None,
        geo_backup_key_uri: Optional[str] = None,
        type: Optional[Union[str, "_models.DataEncryptionType"]] = None,
    ) -> None: ...

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

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


class DelegatedSubnetUsage(_Model):
    """Delegated subnet usage data.

    :ivar subnet_name: name of the subnet.
    :vartype subnet_name: str
    :ivar usage: Number of used delegated subnets.
    :vartype usage: int
    """

    subnet_name: Optional[str] = rest_field(name="subnetName", visibility=["read"])
    """name of the subnet."""
    usage: Optional[int] = rest_field(visibility=["read"])
    """Number of used delegated subnets."""


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.mysqlflexibleservers.models.ErrorDetail]
    :ivar additional_info: The error additional info.
    :vartype additional_info: list[~azure.mgmt.mysqlflexibleservers.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.mysqlflexibleservers.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 FabricMirroringSetting(ProxyResource):
    """Fabric Mirroring settings 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.mysqlflexibleservers.models.SystemData
    :ivar properties: The resource-specific properties for this resource.
    :vartype properties: ~azure.mgmt.mysqlflexibleservers.models.FabricMirroringSettingsProperties
    """

    properties: Optional["_models.FabricMirroringSettingsProperties"] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """The resource-specific properties for this resource."""

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

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

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


class FabricMirroringSettingListResult(_Model):
    """The response of a FabricMirroringSetting list operation.

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

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

    @overload
    def __init__(
        self,
        *,
        value: list["_models.FabricMirroringSetting"],
        next_link: 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 FabricMirroringSettingsProperties(_Model):
    """Properties of the Fabric Mirroring settings resource.

    :ivar state: State of Fabric Mirroring (Enabled or Disabled). Known values are: "Enabled" and
     "Disabled".
    :vartype state: str or ~azure.mgmt.mysqlflexibleservers.models.FabricMirroringState
    :ivar identity_resource_id: Resource ID of the user-assigned managed identity used for Fabric
     Mirroring. Required when state is Enabled.
    :vartype identity_resource_id: str
    :ivar provisioning_state: Provisioning state of Fabric Mirroring. Known values are:
     "Succeeded", "Failed", "Canceled", and "Updating".
    :vartype provisioning_state: str or
     ~azure.mgmt.mysqlflexibleservers.models.FabricMirroringProvisioningState
    """

    state: Optional[Union[str, "_models.FabricMirroringState"]] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """State of Fabric Mirroring (Enabled or Disabled). Known values are: \"Enabled\" and
     \"Disabled\"."""
    identity_resource_id: Optional[str] = rest_field(
        name="identityResourceId", visibility=["read", "create", "update", "delete", "query"]
    )
    """Resource ID of the user-assigned managed identity used for Fabric Mirroring. Required when
     state is Enabled."""
    provisioning_state: Optional[Union[str, "_models.FabricMirroringProvisioningState"]] = rest_field(
        name="provisioningState", visibility=["read"]
    )
    """Provisioning state of Fabric Mirroring. Known values are: \"Succeeded\", \"Failed\",
     \"Canceled\", and \"Updating\"."""

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

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

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


class FeatureProperty(_Model):
    """Server version capabilities.

    :ivar feature_name: feature name.
    :vartype feature_name: str
    :ivar feature_value: feature value.
    :vartype feature_value: str
    """

    feature_name: Optional[str] = rest_field(name="featureName", visibility=["read"])
    """feature name."""
    feature_value: Optional[str] = rest_field(name="featureValue", visibility=["read"])
    """feature value."""


class FirewallRule(ProxyResource):
    """Represents a server firewall rule.

    :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.mysqlflexibleservers.models.SystemData
    :ivar properties: The properties of a firewall rule. Required.
    :vartype properties: ~azure.mgmt.mysqlflexibleservers.models.FirewallRuleProperties
    """

    properties: "_models.FirewallRuleProperties" = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """The properties of a firewall rule. Required."""

    __flattened_items = ["start_ip_address", "end_ip_address"]

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

    @overload
    def __init__(self, mapping: Mapping[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 FirewallRuleProperties(_Model):
    """The properties of a server firewall rule.

    :ivar start_ip_address: The start IP address of the server firewall rule. Must be IPv4 format.
     Required.
    :vartype start_ip_address: str
    :ivar end_ip_address: The end IP address of the server firewall rule. Must be IPv4 format.
     Required.
    :vartype end_ip_address: str
    """

    start_ip_address: str = rest_field(
        name="startIpAddress", visibility=["read", "create", "update", "delete", "query"]
    )
    """The start IP address of the server firewall rule. Must be IPv4 format. Required."""
    end_ip_address: str = rest_field(name="endIpAddress", visibility=["read", "create", "update", "delete", "query"])
    """The end IP address of the server firewall rule. Must be IPv4 format. Required."""

    @overload
    def __init__(
        self,
        *,
        start_ip_address: str,
        end_ip_address: 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 FullBackupStoreDetails(BackupStoreDetails, discriminator="FullBackupStoreDetails"):
    """FullBackupStoreDetails is used for scenarios where backup data is streamed/copied over to a
    storage destination.

    :ivar sas_uri_list: SASUriList of storage containers where backup data is to be
     streamed/copied. Required.
    :vartype sas_uri_list: list[str]
    :ivar object_type: Type of the specific object - used for deserializing. Required. Default
     value is "FullBackupStoreDetails".
    :vartype object_type: str
    """

    sas_uri_list: list[str] = rest_field(name="sasUriList", visibility=["read", "create", "update", "delete", "query"])
    """SASUriList of storage containers where backup data is to be streamed/copied. Required."""
    object_type: Literal["FullBackupStoreDetails"] = rest_discriminator(name="objectType", visibility=["read", "create", "update", "delete", "query"])  # type: ignore
    """Type of the specific object - used for deserializing. Required. Default value is
     \"FullBackupStoreDetails\"."""

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

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

    def __init__(self, *args: Any, **kwargs: Any) -> None:
        super().__init__(*args, **kwargs)
        self.object_type = "FullBackupStoreDetails"  # type: ignore


class GetPrivateDnsZoneSuffixResponse(_Model):
    """The response of get private dns zone suffix.

    :ivar private_dns_zone_suffix: Represents the private DNS zone suffix.
    :vartype private_dns_zone_suffix: str
    """

    private_dns_zone_suffix: Optional[str] = rest_field(
        name="privateDnsZoneSuffix", visibility=["read", "create", "update", "delete", "query"]
    )
    """Represents the private DNS zone suffix."""

    @overload
    def __init__(
        self,
        *,
        private_dns_zone_suffix: 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 HighAvailability(_Model):
    """High availability properties of a server.

    :ivar mode: High availability mode for a server. Known values are: "Disabled", "ZoneRedundant",
     and "SameZone".
    :vartype mode: str or ~azure.mgmt.mysqlflexibleservers.models.HighAvailabilityMode
    :ivar state: The state of server high availability. Known values are: "NotEnabled",
     "CreatingStandby", "Healthy", "FailingOver", and "RemovingStandby".
    :vartype state: str or ~azure.mgmt.mysqlflexibleservers.models.HighAvailabilityState
    :ivar standby_availability_zone: Availability zone of the standby server.
    :vartype standby_availability_zone: str
    :ivar replication_mode: HA Replication mode for a server. Known values are: "BinaryLog" and
     "RedoLog".
    :vartype replication_mode: str or ~azure.mgmt.mysqlflexibleservers.models.ReplicationMode
    """

    mode: Optional[Union[str, "_models.HighAvailabilityMode"]] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """High availability mode for a server. Known values are: \"Disabled\", \"ZoneRedundant\", and
     \"SameZone\"."""
    state: Optional[Union[str, "_models.HighAvailabilityState"]] = rest_field(visibility=["read"])
    """The state of server high availability. Known values are: \"NotEnabled\", \"CreatingStandby\",
     \"Healthy\", \"FailingOver\", and \"RemovingStandby\"."""
    standby_availability_zone: Optional[str] = rest_field(
        name="standbyAvailabilityZone", visibility=["read", "create", "update", "delete", "query"]
    )
    """Availability zone of the standby server."""
    replication_mode: Optional[Union[str, "_models.ReplicationMode"]] = rest_field(
        name="replicationMode", visibility=["read", "create", "update", "delete", "query"]
    )
    """HA Replication mode for a server. Known values are: \"BinaryLog\" and \"RedoLog\"."""

    @overload
    def __init__(
        self,
        *,
        mode: Optional[Union[str, "_models.HighAvailabilityMode"]] = None,
        standby_availability_zone: Optional[str] = None,
        replication_mode: Optional[Union[str, "_models.ReplicationMode"]] = None,
    ) -> None: ...

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

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


class HighAvailabilityValidationEstimation(_Model):
    """High availability validation properties of a server.

    :ivar estimated_downtime: Estimated seconds of downtime for the deployment.
    :vartype estimated_downtime: int
    :ivar scheduled_standby_availability_zone: Scheduled Availability zone of the standby server.
    :vartype scheduled_standby_availability_zone: str
    :ivar expected_standby_availability_zone: Expected Availability zone of the standby server.
    :vartype expected_standby_availability_zone: str
    """

    estimated_downtime: Optional[int] = rest_field(name="estimatedDowntime", visibility=["read"])
    """Estimated seconds of downtime for the deployment."""
    scheduled_standby_availability_zone: Optional[str] = rest_field(
        name="scheduledStandbyAvailabilityZone", visibility=["read"]
    )
    """Scheduled Availability zone of the standby server."""
    expected_standby_availability_zone: Optional[str] = rest_field(
        name="expectedStandbyAvailabilityZone", visibility=["read", "create", "update", "delete", "query"]
    )
    """Expected Availability zone of the standby server."""

    @overload
    def __init__(
        self,
        *,
        expected_standby_availability_zone: 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 ImportFromStorageResponseType(OperationProgressResponseType, discriminator="ImportFromStorageResponse"):
    """ImportFromStorage Response Properties.

    :ivar estimated_completion_time: The estimated time of operation completion.
    :vartype estimated_completion_time: ~datetime.datetime
    :ivar object_type: Identifies the type of source operation. Required.
     IMPORT_FROM_STORAGE_RESPONSE.
    :vartype object_type: str or
     ~azure.mgmt.mysqlflexibleservers.models.IMPORT_FROM_STORAGE_RESPONSE
    """

    estimated_completion_time: Optional[datetime.datetime] = rest_field(
        name="estimatedCompletionTime", visibility=["read", "create", "update", "delete", "query"], format="rfc3339"
    )
    """The estimated time of operation completion."""
    object_type: Literal[ObjectType.IMPORT_FROM_STORAGE_RESPONSE] = rest_discriminator(name="objectType", visibility=["read", "create", "update", "delete", "query"])  # type: ignore
    """Identifies the type of source operation. Required. IMPORT_FROM_STORAGE_RESPONSE."""

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

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

    def __init__(self, *args: Any, **kwargs: Any) -> None:
        super().__init__(*args, **kwargs)
        self.object_type = ObjectType.IMPORT_FROM_STORAGE_RESPONSE  # type: ignore


class ImportSourceProperties(_Model):
    """Import source related properties.

    :ivar storage_type: Storage type of import source. "AzureBlob"
    :vartype storage_type: str or ~azure.mgmt.mysqlflexibleservers.models.ImportSourceStorageType
    :ivar storage_url: Uri of the import source storage.
    :vartype storage_url: str
    :ivar sas_token: Sas token for accessing source storage. Read and list permissions are required
     for sas token.
    :vartype sas_token: str
    :ivar data_dir_path: Relative path of data directory in storage.
    :vartype data_dir_path: str
    """

    storage_type: Optional[Union[str, "_models.ImportSourceStorageType"]] = rest_field(
        name="storageType", visibility=["read", "create"]
    )
    """Storage type of import source. \"AzureBlob\""""
    storage_url: Optional[str] = rest_field(name="storageUrl", visibility=["read", "create"])
    """Uri of the import source storage."""
    sas_token: Optional[str] = rest_field(name="sasToken", visibility=["create"])
    """Sas token for accessing source storage. Read and list permissions are required for sas token."""
    data_dir_path: Optional[str] = rest_field(name="dataDirPath", visibility=["read", "create"])
    """Relative path of data directory in storage."""

    @overload
    def __init__(
        self,
        *,
        storage_type: Optional[Union[str, "_models.ImportSourceStorageType"]] = None,
        storage_url: Optional[str] = None,
        sas_token: Optional[str] = None,
        data_dir_path: 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 LogFile(ProxyResource):
    """Represents a logFile.

    :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.mysqlflexibleservers.models.SystemData
    :ivar properties: The properties of a logFile.
    :vartype properties: ~azure.mgmt.mysqlflexibleservers.models.LogFileProperties
    """

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

    __flattened_items = ["size_in_kb", "created_time", "type", "last_modified_time", "url"]

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

    @overload
    def __init__(self, mapping: Mapping[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 LogFileProperties(_Model):
    """The properties of a logFile.

    :ivar size_in_kb: The size in kb of the logFile.
    :vartype size_in_kb: int
    :ivar created_time: Creation timestamp of the log file.
    :vartype created_time: ~datetime.datetime
    :ivar type: Type of the log file.
    :vartype type: str
    :ivar last_modified_time: Last modified timestamp of the log file.
    :vartype last_modified_time: ~datetime.datetime
    :ivar url: The url to download the log file from.
    :vartype url: str
    """

    size_in_kb: Optional[int] = rest_field(name="sizeInKB", visibility=["read", "create", "update", "delete", "query"])
    """The size in kb of the logFile."""
    created_time: Optional[datetime.datetime] = rest_field(
        name="createdTime", visibility=["read", "create", "update", "delete", "query"], format="rfc3339"
    )
    """Creation timestamp of the log file."""
    type: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """Type of the log file."""
    last_modified_time: Optional[datetime.datetime] = rest_field(
        name="lastModifiedTime", visibility=["read", "create", "update", "delete", "query"], format="rfc3339"
    )
    """Last modified timestamp of the log file."""
    url: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """The url to download the log file from."""

    @overload
    def __init__(
        self,
        *,
        size_in_kb: Optional[int] = None,
        created_time: Optional[datetime.datetime] = None,
        type: Optional[str] = None,
        last_modified_time: Optional[datetime.datetime] = None,
        url: Optional[str] = None,
    ) -> None: ...

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

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


class Maintenance(ProxyResource):
    """Represents a maintenance.

    :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.mysqlflexibleservers.models.SystemData
    :ivar properties: The properties of a maintenance. Required.
    :vartype properties: ~azure.mgmt.mysqlflexibleservers.models.MaintenanceProperties
    """

    properties: "_models.MaintenanceProperties" = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """The properties of a maintenance. Required."""

    __flattened_items = [
        "maintenance_type",
        "maintenance_state",
        "maintenance_start_time",
        "maintenance_end_time",
        "maintenance_execution_start_time",
        "maintenance_execution_end_time",
        "maintenance_available_schedule_min_time",
        "maintenance_available_schedule_max_time",
        "maintenance_title",
        "maintenance_description",
        "provisioning_state",
    ]

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

    @overload
    def __init__(self, mapping: Mapping[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 MaintenancePolicy(_Model):
    """Maintenance policy of a server.

    :ivar patch_strategy: The patch strategy of this server. Known values are: "Regular" and
     "VirtualCanary".
    :vartype patch_strategy: str or ~azure.mgmt.mysqlflexibleservers.models.PatchStrategy
    """

    patch_strategy: Optional[Union[str, "_models.PatchStrategy"]] = rest_field(
        name="patchStrategy", visibility=["read", "create", "update", "delete", "query"]
    )
    """The patch strategy of this server. Known values are: \"Regular\" and \"VirtualCanary\"."""

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

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

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


class MaintenanceProperties(_Model):
    """The properties of a maintenance resource.

    :ivar maintenance_type: A string defines maintenance type. Known values are:
     "RoutineMaintenance", "MinorVersionUpgrade", "SecurityPatches", and "HotFixes".
    :vartype maintenance_type: str or ~azure.mgmt.mysqlflexibleservers.models.MaintenanceType
    :ivar maintenance_state: A string describes the maintenance status. Known values are:
     "Scheduled", "ReScheduled", "InPreparation", "Processing", "Completed", and "Canceled".
    :vartype maintenance_state: str or ~azure.mgmt.mysqlflexibleservers.models.MaintenanceState
    :ivar maintenance_start_time: The start time for a maintenance.
    :vartype maintenance_start_time: ~datetime.datetime
    :ivar maintenance_end_time: The end time for a maintenance.
    :vartype maintenance_end_time: ~datetime.datetime
    :ivar maintenance_execution_start_time: The start time for a maintenance execution.
    :vartype maintenance_execution_start_time: ~datetime.datetime
    :ivar maintenance_execution_end_time: The end time for a maintenance execution.
    :vartype maintenance_execution_end_time: ~datetime.datetime
    :ivar maintenance_available_schedule_min_time: The min time the maintenance can be rescheduled.
    :vartype maintenance_available_schedule_min_time: ~datetime.datetime
    :ivar maintenance_available_schedule_max_time: The max time the maintenance can be rescheduled.
    :vartype maintenance_available_schedule_max_time: ~datetime.datetime
    :ivar maintenance_title: The maintenance title.
    :vartype maintenance_title: str
    :ivar maintenance_description: The maintenance description.
    :vartype maintenance_description: str
    :ivar provisioning_state: Provisioning state of the Maintenance. Known values are: "Succeeded",
     "Creating", "Deleting", and "Failed".
    :vartype provisioning_state: str or
     ~azure.mgmt.mysqlflexibleservers.models.MaintenanceProvisioningState
    """

    maintenance_type: Optional[Union[str, "_models.MaintenanceType"]] = rest_field(
        name="maintenanceType", visibility=["read"]
    )
    """A string defines maintenance type. Known values are: \"RoutineMaintenance\",
     \"MinorVersionUpgrade\", \"SecurityPatches\", and \"HotFixes\"."""
    maintenance_state: Optional[Union[str, "_models.MaintenanceState"]] = rest_field(
        name="maintenanceState", visibility=["read"]
    )
    """A string describes the maintenance status. Known values are: \"Scheduled\", \"ReScheduled\",
     \"InPreparation\", \"Processing\", \"Completed\", and \"Canceled\"."""
    maintenance_start_time: Optional[datetime.datetime] = rest_field(
        name="maintenanceStartTime", visibility=["read", "create", "update", "delete", "query"], format="rfc3339"
    )
    """The start time for a maintenance."""
    maintenance_end_time: Optional[datetime.datetime] = rest_field(
        name="maintenanceEndTime", visibility=["read"], format="rfc3339"
    )
    """The end time for a maintenance."""
    maintenance_execution_start_time: Optional[datetime.datetime] = rest_field(
        name="maintenanceExecutionStartTime", visibility=["read"], format="rfc3339"
    )
    """The start time for a maintenance execution."""
    maintenance_execution_end_time: Optional[datetime.datetime] = rest_field(
        name="maintenanceExecutionEndTime", visibility=["read"], format="rfc3339"
    )
    """The end time for a maintenance execution."""
    maintenance_available_schedule_min_time: Optional[datetime.datetime] = rest_field(
        name="maintenanceAvailableScheduleMinTime", visibility=["read"], format="rfc3339"
    )
    """The min time the maintenance can be rescheduled."""
    maintenance_available_schedule_max_time: Optional[datetime.datetime] = rest_field(
        name="maintenanceAvailableScheduleMaxTime", visibility=["read"], format="rfc3339"
    )
    """The max time the maintenance can be rescheduled."""
    maintenance_title: Optional[str] = rest_field(name="maintenanceTitle", visibility=["read"])
    """The maintenance title."""
    maintenance_description: Optional[str] = rest_field(name="maintenanceDescription", visibility=["read"])
    """The maintenance description."""
    provisioning_state: Optional[Union[str, "_models.MaintenanceProvisioningState"]] = rest_field(
        name="provisioningState", visibility=["read"]
    )
    """Provisioning state of the Maintenance. Known values are: \"Succeeded\", \"Creating\",
     \"Deleting\", and \"Failed\"."""

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

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

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


class MaintenancePropertiesForUpdate(_Model):
    """The properties of a maintenance update parameter.

    :ivar maintenance_start_time: The start time for a maintenance.
    :vartype maintenance_start_time: ~datetime.datetime
    """

    maintenance_start_time: Optional[datetime.datetime] = rest_field(
        name="maintenanceStartTime", visibility=["read", "create", "update", "delete", "query"], format="rfc3339"
    )
    """The start time for a maintenance."""

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

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

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


class MaintenanceUpdate(_Model):
    """Represents a maintenance update parameter.

    :ivar properties: The properties of a maintenance update parameter.
    :vartype properties: ~azure.mgmt.mysqlflexibleservers.models.MaintenancePropertiesForUpdate
    """

    properties: Optional["_models.MaintenancePropertiesForUpdate"] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """The properties of a maintenance update parameter."""

    __flattened_items = ["maintenance_start_time"]

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

    @overload
    def __init__(self, mapping: Mapping[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 MaintenanceWindow(_Model):
    """Maintenance window of a server.

    :ivar custom_window: indicates whether custom window is enabled or disabled.
    :vartype custom_window: str
    :ivar start_hour: start hour for maintenance window.
    :vartype start_hour: int
    :ivar start_minute: start minute for maintenance window.
    :vartype start_minute: int
    :ivar day_of_week: day of week for maintenance window.
    :vartype day_of_week: int
    :ivar batch_of_maintenance: The batch of maintenance when enabled the custom managed
     maintenance window of a server. Known values are: "Default", "Batch1", and "Batch2".
    :vartype batch_of_maintenance: str or
     ~azure.mgmt.mysqlflexibleservers.models.BatchOfMaintenance
    """

    custom_window: Optional[str] = rest_field(
        name="customWindow", visibility=["read", "create", "update", "delete", "query"]
    )
    """indicates whether custom window is enabled or disabled."""
    start_hour: Optional[int] = rest_field(name="startHour", visibility=["read", "create", "update", "delete", "query"])
    """start hour for maintenance window."""
    start_minute: Optional[int] = rest_field(
        name="startMinute", visibility=["read", "create", "update", "delete", "query"]
    )
    """start minute for maintenance window."""
    day_of_week: Optional[int] = rest_field(
        name="dayOfWeek", visibility=["read", "create", "update", "delete", "query"]
    )
    """day of week for maintenance window."""
    batch_of_maintenance: Optional[Union[str, "_models.BatchOfMaintenance"]] = rest_field(
        name="batchOfMaintenance", visibility=["read", "create", "update", "delete", "query"]
    )
    """The batch of maintenance when enabled the custom managed maintenance window of a server. Known
     values are: \"Default\", \"Batch1\", and \"Batch2\"."""

    @overload
    def __init__(
        self,
        *,
        custom_window: Optional[str] = None,
        start_hour: Optional[int] = None,
        start_minute: Optional[int] = None,
        day_of_week: Optional[int] = None,
        batch_of_maintenance: Optional[Union[str, "_models.BatchOfMaintenance"]] = None,
    ) -> None: ...

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

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


class MySQLServerIdentity(_Model):
    """Properties to configure Identity for Bring your Own Keys.

    :ivar principal_id: ObjectId from the KeyVault.
    :vartype principal_id: str
    :ivar tenant_id: TenantId from the KeyVault.
    :vartype tenant_id: str
    :ivar type: Type of managed service identity. "UserAssigned"
    :vartype type: str or ~azure.mgmt.mysqlflexibleservers.models.ManagedServiceIdentityType
    :ivar user_assigned_identities: Metadata of user assigned identity.
    :vartype user_assigned_identities: dict[str,
     ~azure.mgmt.mysqlflexibleservers.models.UserAssignedIdentity]
    """

    principal_id: Optional[str] = rest_field(name="principalId", visibility=["read"])
    """ObjectId from the KeyVault."""
    tenant_id: Optional[str] = rest_field(name="tenantId", visibility=["read"])
    """TenantId from the KeyVault."""
    type: Optional[Union[str, "_models.ManagedServiceIdentityType"]] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """Type of managed service identity. \"UserAssigned\""""
    user_assigned_identities: Optional[dict[str, "_models.UserAssignedIdentity"]] = rest_field(
        name="userAssignedIdentities", visibility=["read", "create", "update", "delete", "query"]
    )
    """Metadata of user assigned identity."""

    @overload
    def __init__(
        self,
        *,
        type: Optional[Union[str, "_models.ManagedServiceIdentityType"]] = None,
        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 MySQLServerSku(_Model):
    """Billing information related properties of a server.

    :ivar name: The name of the sku, e.g. Standard_D32s_v3. Required.
    :vartype name: str
    :ivar tier: The tier of the particular SKU, e.g. GeneralPurpose. Required. Known values are:
     "Burstable", "GeneralPurpose", and "MemoryOptimized".
    :vartype tier: str or ~azure.mgmt.mysqlflexibleservers.models.ServerSkuTier
    """

    name: str = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """The name of the sku, e.g. Standard_D32s_v3. Required."""
    tier: Union[str, "_models.ServerSkuTier"] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """The tier of the particular SKU, e.g. GeneralPurpose. Required. Known values are: \"Burstable\",
     \"GeneralPurpose\", and \"MemoryOptimized\"."""

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

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

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


class NameAvailability(_Model):
    """Represents a resource name availability.

    :ivar message: Error Message.
    :vartype message: str
    :ivar name_available: Indicates whether the resource name is available.
    :vartype name_available: bool
    :ivar reason: Reason for name being unavailable.
    :vartype reason: str
    """

    message: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """Error Message."""
    name_available: Optional[bool] = rest_field(
        name="nameAvailable", visibility=["read", "create", "update", "delete", "query"]
    )
    """Indicates whether the resource name is available."""
    reason: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """Reason for name being unavailable."""

    @overload
    def __init__(
        self,
        *,
        message: Optional[str] = None,
        name_available: Optional[bool] = None,
        reason: 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 NameAvailabilityRequest(_Model):
    """Request from client to check resource name availability.

    :ivar name: Resource name to verify. Required.
    :vartype name: str
    :ivar type: Resource type used for verification.
    :vartype type: str
    """

    name: str = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """Resource name to verify. Required."""
    type: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """Resource type used for verification."""

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

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

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


class Network(_Model):
    """Network related properties of a server.

    :ivar public_network_access: Whether or not public network access is allowed for this server.
     Value is 'Disabled' when server has VNet integration. Known values are: "Enabled" and
     "Disabled".
    :vartype public_network_access: str or ~azure.mgmt.mysqlflexibleservers.models.EnableStatusEnum
    :ivar delegated_subnet_resource_id: Delegated subnet resource id used to setup vnet for a
     server.
    :vartype delegated_subnet_resource_id: str
    :ivar private_dns_zone_resource_id: Private DNS zone resource id.
    :vartype private_dns_zone_resource_id: str
    """

    public_network_access: Optional[Union[str, "_models.EnableStatusEnum"]] = rest_field(
        name="publicNetworkAccess", visibility=["read", "create", "update", "delete", "query"]
    )
    """Whether or not public network access is allowed for this server. Value is 'Disabled' when
     server has VNet integration. Known values are: \"Enabled\" and \"Disabled\"."""
    delegated_subnet_resource_id: Optional[str] = rest_field(
        name="delegatedSubnetResourceId", visibility=["read", "create", "update", "delete", "query"]
    )
    """Delegated subnet resource id used to setup vnet for a server."""
    private_dns_zone_resource_id: Optional[str] = rest_field(
        name="privateDnsZoneResourceId", visibility=["read", "create", "update", "delete", "query"]
    )
    """Private DNS zone resource id."""

    @overload
    def __init__(
        self,
        *,
        public_network_access: Optional[Union[str, "_models.EnableStatusEnum"]] = None,
        delegated_subnet_resource_id: Optional[str] = None,
        private_dns_zone_resource_id: Optional[str] = None,
    ) -> None: ...

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

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


class Operation(_Model):
    """Details of a REST API operation, returned from the Resource Provider Operations API.

    :ivar name: The name of the operation, as per Resource-Based Access Control (RBAC). Examples:
     "Microsoft.Compute/virtualMachines/write", "Microsoft.Compute/virtualMachines/capture/action".
    :vartype name: str
    :ivar display: Localized display information for this particular operation.
    :vartype display: ~azure.mgmt.mysqlflexibleservers.models.OperationDisplay
    :ivar origin: The intended executor of the operation; as in Resource Based Access Control
     (RBAC) and audit logs UX. Default value is "user,system". Known values are: "user", "system",
     and "user,system".
    :vartype origin: str or ~azure.mgmt.mysqlflexibleservers.models.Origin
    :ivar properties: Additional descriptions for the operation.
    :vartype properties: dict[str, any]
    """

    name: Optional[str] = rest_field(visibility=["read"])
    """The name of the operation, as per Resource-Based Access Control (RBAC). Examples:
     \"Microsoft.Compute/virtualMachines/write\",
     \"Microsoft.Compute/virtualMachines/capture/action\"."""
    display: Optional["_models.OperationDisplay"] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """Localized display information for this particular operation."""
    origin: Optional[Union[str, "_models.Origin"]] = rest_field(visibility=["read"])
    """The intended executor of the operation; as in Resource Based Access Control (RBAC) and audit
     logs UX. Default value is \"user,system\". Known values are: \"user\", \"system\", and
     \"user,system\"."""
    properties: Optional[dict[str, Any]] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """Additional descriptions for the operation."""

    @overload
    def __init__(
        self,
        *,
        display: Optional["_models.OperationDisplay"] = 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 OperationDisplay(_Model):
    """Display metadata associated with the operation.

    :ivar provider: The localized friendly form of the resource provider name, e.g. "Microsoft
     Monitoring Insights" or "Microsoft Compute".
    :vartype provider: str
    :ivar resource: The localized friendly name of the resource type related to this operation.
     E.g. "Virtual Machines" or "Job Schedule Collections".
    :vartype resource: str
    :ivar operation: The concise, localized friendly name for the operation; suitable for
     dropdowns. E.g. "Create or Update Virtual Machine", "Restart Virtual Machine".
    :vartype operation: str
    :ivar description: The short, localized friendly description of the operation; suitable for
     tool tips and detailed views.
    :vartype description: str
    """

    provider: Optional[str] = rest_field(visibility=["read"])
    """The localized friendly form of the resource provider name, e.g. \"Microsoft Monitoring
     Insights\" or \"Microsoft Compute\"."""
    resource: Optional[str] = rest_field(visibility=["read"])
    """The localized friendly name of the resource type related to this operation. E.g. \"Virtual
     Machines\" or \"Job Schedule Collections\"."""
    operation: Optional[str] = rest_field(visibility=["read"])
    """The concise, localized friendly name for the operation; suitable for dropdowns. E.g. \"Create
     or Update Virtual Machine\", \"Restart Virtual Machine\"."""
    description: Optional[str] = rest_field(visibility=["read"])
    """The short, localized friendly description of the operation; suitable for tool tips and detailed
     views."""


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.mysqlflexibleservers.models.OperationStatusResult]
    :ivar error: If present, details of the operation error.
    :vartype error: ~azure.mgmt.mysqlflexibleservers.models.ErrorDetail
    :ivar resource_id: Fully qualified ID of the resource against which the original async
     operation was started.
    :vartype resource_id: str
    """

    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."""
    resource_id: Optional[str] = rest_field(name="resourceId", visibility=["read"])
    """Fully qualified ID of the resource against which the original async operation was started."""

    @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 OperationProgressResult(OperationStatusResult):
    """Represents Operation Results API Response.

    :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.mysqlflexibleservers.models.OperationStatusResult]
    :ivar error: If present, details of the operation error.
    :vartype error: ~azure.mgmt.mysqlflexibleservers.models.ErrorDetail
    :ivar resource_id: Fully qualified ID of the resource against which the original async
     operation was started.
    :vartype resource_id: str
    :ivar properties: The response properties specific to the operation.
    :vartype properties: ~azure.mgmt.mysqlflexibleservers.models.OperationProgressResponseType
    """

    properties: Optional["_models.OperationProgressResponseType"] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """The response properties specific to the operation."""

    @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["_models.OperationProgressResponseType"] = None,
    ) -> None: ...

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

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


class OperationStatusExtendedResult(OperationStatusResult):
    """Represents Operation Results API Response.

    :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.mysqlflexibleservers.models.OperationStatusResult]
    :ivar error: If present, details of the operation error.
    :vartype error: ~azure.mgmt.mysqlflexibleservers.models.ErrorDetail
    :ivar resource_id: Fully qualified ID of the resource against which the original async
     operation was started.
    :vartype resource_id: str
    :ivar properties: The extended properties of Operation Results.
    :vartype properties: dict[str, any]
    """

    properties: Optional[dict[str, Any]] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """The extended properties of Operation Results."""

    @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 PrivateEndpointConnection(Resource):
    """A 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.mysqlflexibleservers.models.SystemData
    :ivar properties: Resource properties.
    :vartype properties:
     ~azure.mgmt.mysqlflexibleservers.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 PrivateEndpointConnectionListResult(_Model):
    """The response of a PrivateEndpointConnection list operation.

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

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

    @overload
    def __init__(
        self,
        *,
        value: list["_models.PrivateEndpointConnection"],
        next_link: 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 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.mysqlflexibleservers.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.mysqlflexibleservers.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.mysqlflexibleservers.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.mysqlflexibleservers.models.SystemData
    :ivar properties: Resource properties.
    :vartype properties: ~azure.mgmt.mysqlflexibleservers.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.mysqlflexibleservers.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 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.mysqlflexibleservers.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 Server(TrackedResource):
    """Represents a server.

    :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.mysqlflexibleservers.models.SystemData
    :ivar tags: Resource tags.
    :vartype tags: dict[str, str]
    :ivar location: The geo-location where the resource lives. Required.
    :vartype location: str
    :ivar properties: Properties of the server.
    :vartype properties: ~azure.mgmt.mysqlflexibleservers.models.ServerProperties
    :ivar identity: The cmk identity for the server.
    :vartype identity: ~azure.mgmt.mysqlflexibleservers.models.MySQLServerIdentity
    :ivar sku: The SKU (pricing tier) of the server.
    :vartype sku: ~azure.mgmt.mysqlflexibleservers.models.MySQLServerSku
    """

    properties: Optional["_models.ServerProperties"] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """Properties of the server."""
    identity: Optional["_models.MySQLServerIdentity"] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """The cmk identity for the server."""
    sku: Optional["_models.MySQLServerSku"] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """The SKU (pricing tier) of the server."""

    __flattened_items = [
        "administrator_login",
        "administrator_login_password",
        "version",
        "full_version",
        "availability_zone",
        "create_mode",
        "source_server_resource_id",
        "restore_point_in_time",
        "replication_role",
        "replica_capacity",
        "data_encryption",
        "state",
        "fully_qualified_domain_name",
        "database_port",
        "storage",
        "backup",
        "high_availability",
        "network",
        "private_endpoint_connections",
        "maintenance_policy",
        "maintenance_window",
        "import_source_properties",
        "lower_case_table_names",
    ]

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

    @overload
    def __init__(self, mapping: Mapping[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 ServerBackup(ProxyResource):
    """Server backup properties.

    :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.mysqlflexibleservers.models.SystemData
    :ivar properties: The properties of a server backup.
    :vartype properties: ~azure.mgmt.mysqlflexibleservers.models.ServerBackupProperties
    """

    properties: Optional["_models.ServerBackupProperties"] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """The properties of a server backup."""

    __flattened_items = ["backup_type", "completed_time", "source"]

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

    @overload
    def __init__(self, mapping: Mapping[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 ServerBackupProperties(_Model):
    """The properties of a server backup.

    :ivar backup_type: Backup type.
    :vartype backup_type: str
    :ivar completed_time: Backup completed time (ISO8601 format).
    :vartype completed_time: ~datetime.datetime
    :ivar source: Backup source.
    :vartype source: str
    """

    backup_type: Optional[str] = rest_field(
        name="backupType", visibility=["read", "create", "update", "delete", "query"]
    )
    """Backup type."""
    completed_time: Optional[datetime.datetime] = rest_field(
        name="completedTime", visibility=["read", "create", "update", "delete", "query"], format="rfc3339"
    )
    """Backup completed time (ISO8601 format)."""
    source: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """Backup source."""

    @overload
    def __init__(
        self,
        *,
        backup_type: Optional[str] = None,
        completed_time: Optional[datetime.datetime] = None,
        source: Optional[str] = None,
    ) -> None: ...

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

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


class ServerBackupPropertiesV2(_Model):
    """The properties of a server backup.

    :ivar backup_name_v2: Backup name.
    :vartype backup_name_v2: str
    :ivar backup_type: "FULL"
    :vartype backup_type: str or ~azure.mgmt.mysqlflexibleservers.models.BackupType
    :ivar completed_time: Backup completed time (ISO8601 format).
    :vartype completed_time: ~datetime.datetime
    :ivar source: Backup source.
    :vartype source: str
    :ivar provisioning_state: The provisioning state of backup resource. Known values are:
     "Succeeded", "Creating", "Deleting", "Failed", and "Canceled".
    :vartype provisioning_state: str or ~azure.mgmt.mysqlflexibleservers.models.ProvisioningState
    """

    backup_name_v2: Optional[str] = rest_field(
        name="backupNameV2", visibility=["read", "create", "update", "delete", "query"]
    )
    """Backup name."""
    backup_type: Optional[Union[str, "_models.BackupType"]] = rest_field(
        name="backupType", visibility=["read", "create", "update", "delete", "query"]
    )
    """\"FULL\""""
    completed_time: Optional[datetime.datetime] = rest_field(
        name="completedTime", visibility=["read", "create", "update", "delete", "query"], format="rfc3339"
    )
    """Backup completed time (ISO8601 format)."""
    source: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """Backup source."""
    provisioning_state: Optional[Union[str, "_models.ProvisioningState"]] = rest_field(
        name="provisioningState", visibility=["read"]
    )
    """The provisioning state of backup resource. Known values are: \"Succeeded\", \"Creating\",
     \"Deleting\", \"Failed\", and \"Canceled\"."""

    @overload
    def __init__(
        self,
        *,
        backup_name_v2: Optional[str] = None,
        backup_type: Optional[Union[str, "_models.BackupType"]] = None,
        completed_time: Optional[datetime.datetime] = None,
        source: Optional[str] = None,
    ) -> None: ...

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

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


class ServerBackupV2(ProxyResource):
    """Server backup properties.

    :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.mysqlflexibleservers.models.SystemData
    :ivar properties: The properties of a server backup.
    :vartype properties: ~azure.mgmt.mysqlflexibleservers.models.ServerBackupPropertiesV2
    """

    properties: Optional["_models.ServerBackupPropertiesV2"] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """The properties of a server backup."""

    __flattened_items = ["backup_name_v2", "backup_type", "completed_time", "source", "provisioning_state"]

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

    @overload
    def __init__(self, mapping: Mapping[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 ServerDetachVNetParameter(_Model):
    """Parameters to detach Vnet.

    :ivar public_network_access: Whether or not public network access is allowed for this server.
     Value is 'Disabled' when server has VNet integration. Known values are: "Enabled" and
     "Disabled".
    :vartype public_network_access: str or ~azure.mgmt.mysqlflexibleservers.models.EnableStatusEnum
    """

    public_network_access: Optional[Union[str, "_models.EnableStatusEnum"]] = rest_field(
        name="publicNetworkAccess", visibility=["read", "create", "update", "delete", "query"]
    )
    """Whether or not public network access is allowed for this server. Value is 'Disabled' when
     server has VNet integration. Known values are: \"Enabled\" and \"Disabled\"."""

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

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

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


class ServerEditionCapability(_Model):
    """Server edition capabilities.

    :ivar name: Server edition name.
    :vartype name: str
    :ivar supported_storage_editions: A list of supported storage editions.
    :vartype supported_storage_editions:
     list[~azure.mgmt.mysqlflexibleservers.models.StorageEditionCapability]
    :ivar supported_server_versions: A list of supported server versions.
    :vartype supported_server_versions:
     list[~azure.mgmt.mysqlflexibleservers.models.ServerVersionCapability]
    """

    name: Optional[str] = rest_field(visibility=["read"])
    """Server edition name."""
    supported_storage_editions: Optional[list["_models.StorageEditionCapability"]] = rest_field(
        name="supportedStorageEditions", visibility=["read"]
    )
    """A list of supported storage editions."""
    supported_server_versions: Optional[list["_models.ServerVersionCapability"]] = rest_field(
        name="supportedServerVersions", visibility=["read"]
    )
    """A list of supported server versions."""


class ServerEditionCapabilityV2(_Model):
    """Server edition capabilities.

    :ivar name: Server edition name.
    :vartype name: str
    :ivar default_sku: Default Sku name.
    :vartype default_sku: str
    :ivar default_storage_size: Default storage size.
    :vartype default_storage_size: int
    :ivar supported_storage_editions: A list of supported storage editions.
    :vartype supported_storage_editions:
     list[~azure.mgmt.mysqlflexibleservers.models.StorageEditionCapability]
    :ivar supported_skus: A list of supported Skus.
    :vartype supported_skus: list[~azure.mgmt.mysqlflexibleservers.models.SkuCapabilityV2]
    """

    name: Optional[str] = rest_field(visibility=["read"])
    """Server edition name."""
    default_sku: Optional[str] = rest_field(name="defaultSku", visibility=["read"])
    """Default Sku name."""
    default_storage_size: Optional[int] = rest_field(name="defaultStorageSize", visibility=["read"])
    """Default storage size."""
    supported_storage_editions: Optional[list["_models.StorageEditionCapability"]] = rest_field(
        name="supportedStorageEditions", visibility=["read"]
    )
    """A list of supported storage editions."""
    supported_skus: Optional[list["_models.SkuCapabilityV2"]] = rest_field(name="supportedSkus", visibility=["read"])
    """A list of supported Skus."""


class ServerForUpdate(_Model):
    """Parameters allowed to update for a server.

    :ivar identity: The cmk identity for the server.
    :vartype identity: ~azure.mgmt.mysqlflexibleservers.models.MySQLServerIdentity
    :ivar sku: The SKU (pricing tier) of the server.
    :vartype sku: ~azure.mgmt.mysqlflexibleservers.models.MySQLServerSku
    :ivar properties: The properties that can be updated for a server.
    :vartype properties: ~azure.mgmt.mysqlflexibleservers.models.ServerPropertiesForUpdate
    :ivar tags: Application-specific metadata in the form of key-value pairs.
    :vartype tags: dict[str, str]
    """

    identity: Optional["_models.MySQLServerIdentity"] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """The cmk identity for the server."""
    sku: Optional["_models.MySQLServerSku"] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """The SKU (pricing tier) of the server."""
    properties: Optional["_models.ServerPropertiesForUpdate"] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """The properties that can be updated for a server."""
    tags: Optional[dict[str, str]] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """Application-specific metadata in the form of key-value pairs."""

    __flattened_items = [
        "administrator_login_password",
        "version",
        "storage",
        "backup",
        "high_availability",
        "maintenance_policy",
        "maintenance_window",
        "replication_role",
        "data_encryption",
        "network",
    ]

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

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

    def __init__(self, *args: Any, **kwargs: Any) -> None:
        _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 ServerGtidSetParameter(_Model):
    """Server Gtid set parameters: Replication with Global Transaction Identifiers.

    :ivar gtid_set: The Gtid set of server.
    :vartype gtid_set: str
    """

    gtid_set: Optional[str] = rest_field(name="gtidSet", visibility=["read", "create", "update", "delete", "query"])
    """The Gtid set of server."""

    @overload
    def __init__(
        self,
        *,
        gtid_set: 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 ServerProperties(_Model):
    """The properties of a server.

    :ivar administrator_login: The administrator's login name of a server. Can only be specified
     when the server is being created (and is required for creation).
    :vartype administrator_login: str
    :ivar administrator_login_password: The password of the administrator login (required for
     server creation).
    :vartype administrator_login_password: str
    :ivar version: Major version of MySQL. 8.0.21 stands for MySQL 8.0, 5.7.44 stands for MySQL
     5.7. Known values are: "5.7", "8.0.21", and "8.4".
    :vartype version: str or ~azure.mgmt.mysqlflexibleservers.models.ServerVersion
    :ivar full_version: Major version and actual engine version.
    :vartype full_version: str
    :ivar availability_zone: availability Zone information of the server.
    :vartype availability_zone: str
    :ivar create_mode: The mode to create a new MySQL server. Known values are: "Default",
     "PointInTimeRestore", "Replica", "GeoRestore", and "Rename".
    :vartype create_mode: str or ~azure.mgmt.mysqlflexibleservers.models.CreateMode
    :ivar source_server_resource_id: The source MySQL server id.
    :vartype source_server_resource_id: str
    :ivar restore_point_in_time: Restore point creation time (ISO8601 format), specifying the time
     to restore from.
    :vartype restore_point_in_time: ~datetime.datetime
    :ivar replication_role: The replication role. Known values are: "None", "Source", and
     "Replica".
    :vartype replication_role: str or ~azure.mgmt.mysqlflexibleservers.models.ReplicationRole
    :ivar replica_capacity: The maximum number of replicas that a primary server can have.
    :vartype replica_capacity: int
    :ivar data_encryption: The Data Encryption for CMK.
    :vartype data_encryption: ~azure.mgmt.mysqlflexibleservers.models.DataEncryption
    :ivar state: The state of a server. Known values are: "Ready", "Dropping", "Disabled",
     "Starting", "Stopping", "Stopped", and "Updating".
    :vartype state: str or ~azure.mgmt.mysqlflexibleservers.models.ServerState
    :ivar fully_qualified_domain_name: The fully qualified domain name of a server.
    :vartype fully_qualified_domain_name: str
    :ivar database_port: The server database port. Can only be specified when the server is being
     created.
    :vartype database_port: int
    :ivar storage: Storage related properties of a server.
    :vartype storage: ~azure.mgmt.mysqlflexibleservers.models.Storage
    :ivar backup: Backup related properties of a server.
    :vartype backup: ~azure.mgmt.mysqlflexibleservers.models.Backup
    :ivar high_availability: High availability related properties of a server.
    :vartype high_availability: ~azure.mgmt.mysqlflexibleservers.models.HighAvailability
    :ivar network: Network related properties of a server.
    :vartype network: ~azure.mgmt.mysqlflexibleservers.models.Network
    :ivar private_endpoint_connections: PrivateEndpointConnections related properties of a server.
    :vartype private_endpoint_connections:
     list[~azure.mgmt.mysqlflexibleservers.models.PrivateEndpointConnection]
    :ivar maintenance_policy: Maintenance policy of a server.
    :vartype maintenance_policy: ~azure.mgmt.mysqlflexibleservers.models.MaintenancePolicy
    :ivar maintenance_window: Maintenance window of a server. Known issue: cannot be set during
     server creation or updated with other properties during server update; must be updated
     separately.
    :vartype maintenance_window: ~azure.mgmt.mysqlflexibleservers.models.MaintenanceWindow
    :ivar import_source_properties: Source properties for import from storage.
    :vartype import_source_properties:
     ~azure.mgmt.mysqlflexibleservers.models.ImportSourceProperties
    :ivar lower_case_table_names: The mysql parameter lower_case_table_names. Can only be specified
     when the server is being created. Allowed values 1 or 2.
    :vartype lower_case_table_names: int
    """

    administrator_login: Optional[str] = rest_field(name="administratorLogin", visibility=["read", "create"])
    """The administrator's login name of a server. Can only be specified when the server is being
     created (and is required for creation)."""
    administrator_login_password: Optional[str] = rest_field(
        name="administratorLoginPassword", visibility=["create", "update"]
    )
    """The password of the administrator login (required for server creation)."""
    version: Optional[Union[str, "_models.ServerVersion"]] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """Major version of MySQL. 8.0.21 stands for MySQL 8.0, 5.7.44 stands for MySQL 5.7. Known values
     are: \"5.7\", \"8.0.21\", and \"8.4\"."""
    full_version: Optional[str] = rest_field(name="fullVersion", visibility=["read"])
    """Major version and actual engine version."""
    availability_zone: Optional[str] = rest_field(name="availabilityZone", visibility=["read", "create"])
    """availability Zone information of the server."""
    create_mode: Optional[Union[str, "_models.CreateMode"]] = rest_field(name="createMode", visibility=["create"])
    """The mode to create a new MySQL server. Known values are: \"Default\", \"PointInTimeRestore\",
     \"Replica\", \"GeoRestore\", and \"Rename\"."""
    source_server_resource_id: Optional[str] = rest_field(name="sourceServerResourceId", visibility=["read", "create"])
    """The source MySQL server id."""
    restore_point_in_time: Optional[datetime.datetime] = rest_field(
        name="restorePointInTime", visibility=["create"], format="rfc3339"
    )
    """Restore point creation time (ISO8601 format), specifying the time to restore from."""
    replication_role: Optional[Union[str, "_models.ReplicationRole"]] = rest_field(
        name="replicationRole", visibility=["read", "create", "update", "delete", "query"]
    )
    """The replication role. Known values are: \"None\", \"Source\", and \"Replica\"."""
    replica_capacity: Optional[int] = rest_field(name="replicaCapacity", visibility=["read"])
    """The maximum number of replicas that a primary server can have."""
    data_encryption: Optional["_models.DataEncryption"] = rest_field(
        name="dataEncryption", visibility=["read", "create", "update", "delete", "query"]
    )
    """The Data Encryption for CMK."""
    state: Optional[Union[str, "_models.ServerState"]] = rest_field(visibility=["read"])
    """The state of a server. Known values are: \"Ready\", \"Dropping\", \"Disabled\", \"Starting\",
     \"Stopping\", \"Stopped\", and \"Updating\"."""
    fully_qualified_domain_name: Optional[str] = rest_field(name="fullyQualifiedDomainName", visibility=["read"])
    """The fully qualified domain name of a server."""
    database_port: Optional[int] = rest_field(name="databasePort", visibility=["read", "create"])
    """The server database port. Can only be specified when the server is being created."""
    storage: Optional["_models.Storage"] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """Storage related properties of a server."""
    backup: Optional["_models.Backup"] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """Backup related properties of a server."""
    high_availability: Optional["_models.HighAvailability"] = rest_field(
        name="highAvailability", visibility=["read", "create", "update", "delete", "query"]
    )
    """High availability related properties of a server."""
    network: Optional["_models.Network"] = rest_field(visibility=["read", "create"])
    """Network related properties of a server."""
    private_endpoint_connections: Optional[list["_models.PrivateEndpointConnection"]] = rest_field(
        name="privateEndpointConnections", visibility=["read"]
    )
    """PrivateEndpointConnections related properties of a server."""
    maintenance_policy: Optional["_models.MaintenancePolicy"] = rest_field(
        name="maintenancePolicy", visibility=["read", "create", "update", "delete", "query"]
    )
    """Maintenance policy of a server."""
    maintenance_window: Optional["_models.MaintenanceWindow"] = rest_field(
        name="maintenanceWindow", visibility=["read", "update"]
    )
    """Maintenance window of a server. Known issue: cannot be set during server creation or updated
     with other properties during server update; must be updated separately."""
    import_source_properties: Optional["_models.ImportSourceProperties"] = rest_field(
        name="importSourceProperties", visibility=["read", "create", "update", "delete", "query"]
    )
    """Source properties for import from storage."""
    lower_case_table_names: Optional[int] = rest_field(name="lowerCaseTableNames", visibility=["read", "create"])
    """The mysql parameter lower_case_table_names. Can only be specified when the server is being
     created. Allowed values 1 or 2."""

    @overload
    def __init__(
        self,
        *,
        administrator_login: Optional[str] = None,
        administrator_login_password: Optional[str] = None,
        version: Optional[Union[str, "_models.ServerVersion"]] = None,
        availability_zone: Optional[str] = None,
        create_mode: Optional[Union[str, "_models.CreateMode"]] = None,
        source_server_resource_id: Optional[str] = None,
        restore_point_in_time: Optional[datetime.datetime] = None,
        replication_role: Optional[Union[str, "_models.ReplicationRole"]] = None,
        data_encryption: Optional["_models.DataEncryption"] = None,
        database_port: Optional[int] = None,
        storage: Optional["_models.Storage"] = None,
        backup: Optional["_models.Backup"] = None,
        high_availability: Optional["_models.HighAvailability"] = None,
        network: Optional["_models.Network"] = None,
        maintenance_policy: Optional["_models.MaintenancePolicy"] = None,
        maintenance_window: Optional["_models.MaintenanceWindow"] = None,
        import_source_properties: Optional["_models.ImportSourceProperties"] = None,
        lower_case_table_names: Optional[int] = None,
    ) -> None: ...

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

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


class ServerPropertiesForUpdate(_Model):
    """The properties that can be updated for a server.

    :ivar administrator_login_password: The password of the administrator login.
    :vartype administrator_login_password: str
    :ivar version: Server version. Known values are: "5.7", "8.0.21", and "8.4".
    :vartype version: str or ~azure.mgmt.mysqlflexibleservers.models.ServerVersion
    :ivar storage: Storage related properties of a server.
    :vartype storage: ~azure.mgmt.mysqlflexibleservers.models.Storage
    :ivar backup: Backup related properties of a server.
    :vartype backup: ~azure.mgmt.mysqlflexibleservers.models.Backup
    :ivar high_availability: High availability related properties of a server.
    :vartype high_availability: ~azure.mgmt.mysqlflexibleservers.models.HighAvailability
    :ivar maintenance_policy: Maintenance policy of a server.
    :vartype maintenance_policy: ~azure.mgmt.mysqlflexibleservers.models.MaintenancePolicy
    :ivar maintenance_window: Maintenance window of a server.
    :vartype maintenance_window: ~azure.mgmt.mysqlflexibleservers.models.MaintenanceWindow
    :ivar replication_role: The replication role of the server. Known values are: "None", "Source",
     and "Replica".
    :vartype replication_role: str or ~azure.mgmt.mysqlflexibleservers.models.ReplicationRole
    :ivar data_encryption: The Data Encryption for CMK.
    :vartype data_encryption: ~azure.mgmt.mysqlflexibleservers.models.DataEncryption
    :ivar network: Network related properties of a server.
    :vartype network: ~azure.mgmt.mysqlflexibleservers.models.Network
    """

    administrator_login_password: Optional[str] = rest_field(
        name="administratorLoginPassword", visibility=["read", "create", "update", "delete", "query"]
    )
    """The password of the administrator login."""
    version: Optional[Union[str, "_models.ServerVersion"]] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """Server version. Known values are: \"5.7\", \"8.0.21\", and \"8.4\"."""
    storage: Optional["_models.Storage"] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """Storage related properties of a server."""
    backup: Optional["_models.Backup"] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """Backup related properties of a server."""
    high_availability: Optional["_models.HighAvailability"] = rest_field(
        name="highAvailability", visibility=["read", "create", "update", "delete", "query"]
    )
    """High availability related properties of a server."""
    maintenance_policy: Optional["_models.MaintenancePolicy"] = rest_field(
        name="maintenancePolicy", visibility=["read", "create", "update", "delete", "query"]
    )
    """Maintenance policy of a server."""
    maintenance_window: Optional["_models.MaintenanceWindow"] = rest_field(
        name="maintenanceWindow", visibility=["read", "create", "update", "delete", "query"]
    )
    """Maintenance window of a server."""
    replication_role: Optional[Union[str, "_models.ReplicationRole"]] = rest_field(
        name="replicationRole", visibility=["read", "create", "update", "delete", "query"]
    )
    """The replication role of the server. Known values are: \"None\", \"Source\", and \"Replica\"."""
    data_encryption: Optional["_models.DataEncryption"] = rest_field(
        name="dataEncryption", visibility=["read", "create", "update", "delete", "query"]
    )
    """The Data Encryption for CMK."""
    network: Optional["_models.Network"] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """Network related properties of a server."""

    @overload
    def __init__(
        self,
        *,
        administrator_login_password: Optional[str] = None,
        version: Optional[Union[str, "_models.ServerVersion"]] = None,
        storage: Optional["_models.Storage"] = None,
        backup: Optional["_models.Backup"] = None,
        high_availability: Optional["_models.HighAvailability"] = None,
        maintenance_policy: Optional["_models.MaintenancePolicy"] = None,
        maintenance_window: Optional["_models.MaintenanceWindow"] = None,
        replication_role: Optional[Union[str, "_models.ReplicationRole"]] = None,
        data_encryption: Optional["_models.DataEncryption"] = None,
        network: Optional["_models.Network"] = None,
    ) -> None: ...

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

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


class ServerRestartParameter(_Model):
    """Server restart parameters.

    :ivar restart_with_failover: Whether or not failover to standby server when restarting a server
     with high availability enabled. Known values are: "Enabled" and "Disabled".
    :vartype restart_with_failover: str or ~azure.mgmt.mysqlflexibleservers.models.EnableStatusEnum
    :ivar max_failover_seconds: The maximum allowed failover time in seconds.
    :vartype max_failover_seconds: int
    """

    restart_with_failover: Optional[Union[str, "_models.EnableStatusEnum"]] = rest_field(
        name="restartWithFailover", visibility=["read", "create", "update", "delete", "query"]
    )
    """Whether or not failover to standby server when restarting a server with high availability
     enabled. Known values are: \"Enabled\" and \"Disabled\"."""
    max_failover_seconds: Optional[int] = rest_field(
        name="maxFailoverSeconds", visibility=["read", "create", "update", "delete", "query"]
    )
    """The maximum allowed failover time in seconds."""

    @overload
    def __init__(
        self,
        *,
        restart_with_failover: Optional[Union[str, "_models.EnableStatusEnum"]] = None,
        max_failover_seconds: Optional[int] = None,
    ) -> None: ...

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

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


class ServerVersionCapability(_Model):
    """Server version capabilities.

    :ivar name: server version.
    :vartype name: str
    :ivar supported_skus: A list of supported Skus.
    :vartype supported_skus: list[~azure.mgmt.mysqlflexibleservers.models.SkuCapability]
    """

    name: Optional[str] = rest_field(visibility=["read"])
    """server version."""
    supported_skus: Optional[list["_models.SkuCapability"]] = rest_field(name="supportedSkus", visibility=["read"])
    """A list of supported Skus."""


class ServerVersionCapabilityV2(_Model):
    """Server version capabilities.

    :ivar name: server version.
    :vartype name: str
    """

    name: Optional[str] = rest_field(visibility=["read"])
    """server version."""


class SkuCapability(_Model):
    """Sku capability.

    :ivar name: vCore name.
    :vartype name: str
    :ivar v_cores: supported vCores.
    :vartype v_cores: int
    :ivar supported_iops: supported IOPS.
    :vartype supported_iops: int
    :ivar supported_memory_per_v_core_mb: supported memory per vCore in MB.
    :vartype supported_memory_per_v_core_mb: int
    """

    name: Optional[str] = rest_field(visibility=["read"])
    """vCore name."""
    v_cores: Optional[int] = rest_field(name="vCores", visibility=["read"])
    """supported vCores."""
    supported_iops: Optional[int] = rest_field(name="supportedIops", visibility=["read"])
    """supported IOPS."""
    supported_memory_per_v_core_mb: Optional[int] = rest_field(name="supportedMemoryPerVCoreMB", visibility=["read"])
    """supported memory per vCore in MB."""


class SkuCapabilityV2(_Model):
    """Sku capability.

    :ivar name: vCore name.
    :vartype name: str
    :ivar v_cores: supported vCores.
    :vartype v_cores: int
    :ivar supported_iops: supported IOPS.
    :vartype supported_iops: int
    :ivar supported_memory_per_v_core_mb: supported memory per vCore in MB.
    :vartype supported_memory_per_v_core_mb: int
    :ivar supported_zones: Supported zones.
    :vartype supported_zones: list[str]
    :ivar supported_ha_mode: Supported high availability mode.
    :vartype supported_ha_mode: list[str]
    """

    name: Optional[str] = rest_field(visibility=["read"])
    """vCore name."""
    v_cores: Optional[int] = rest_field(name="vCores", visibility=["read"])
    """supported vCores."""
    supported_iops: Optional[int] = rest_field(name="supportedIops", visibility=["read"])
    """supported IOPS."""
    supported_memory_per_v_core_mb: Optional[int] = rest_field(name="supportedMemoryPerVCoreMB", visibility=["read"])
    """supported memory per vCore in MB."""
    supported_zones: Optional[list[str]] = rest_field(name="supportedZones", visibility=["read"])
    """Supported zones."""
    supported_ha_mode: Optional[list[str]] = rest_field(name="supportedHAMode", visibility=["read"])
    """Supported high availability mode."""


class Storage(_Model):
    """Storage Profile properties of a server.

    :ivar storage_size_gb: Max storage size allowed for a server.
    :vartype storage_size_gb: int
    :ivar iops: Storage IOPS for a server.
    :vartype iops: int
    :ivar auto_grow: Enable Storage Auto Grow or not. Known values are: "Enabled" and "Disabled".
    :vartype auto_grow: str or ~azure.mgmt.mysqlflexibleservers.models.EnableStatusEnum
    :ivar log_on_disk: Enable Log On Disk or not. Known values are: "Enabled" and "Disabled".
    :vartype log_on_disk: str or ~azure.mgmt.mysqlflexibleservers.models.EnableStatusEnum
    :ivar storage_sku: The sku name of the server storage.
    :vartype storage_sku: str
    :ivar auto_io_scaling: Enable IO Auto Scaling or not. Known values are: "Enabled" and
     "Disabled".
    :vartype auto_io_scaling: str or ~azure.mgmt.mysqlflexibleservers.models.EnableStatusEnum
    :ivar storage_redundancy: The redundant type of the server storage. The parameter is used for
     server creation. Known values are: "LocalRedundancy" and "ZoneRedundancy".
    :vartype storage_redundancy: str or
     ~azure.mgmt.mysqlflexibleservers.models.StorageRedundancyEnum
    """

    storage_size_gb: Optional[int] = rest_field(
        name="storageSizeGB", visibility=["read", "create", "update", "delete", "query"]
    )
    """Max storage size allowed for a server."""
    iops: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """Storage IOPS for a server."""
    auto_grow: Optional[Union[str, "_models.EnableStatusEnum"]] = rest_field(
        name="autoGrow", visibility=["read", "create", "update", "delete", "query"]
    )
    """Enable Storage Auto Grow or not. Known values are: \"Enabled\" and \"Disabled\"."""
    log_on_disk: Optional[Union[str, "_models.EnableStatusEnum"]] = rest_field(
        name="logOnDisk", visibility=["read", "create", "update", "delete", "query"]
    )
    """Enable Log On Disk or not. Known values are: \"Enabled\" and \"Disabled\"."""
    storage_sku: Optional[str] = rest_field(name="storageSku", visibility=["read"])
    """The sku name of the server storage."""
    auto_io_scaling: Optional[Union[str, "_models.EnableStatusEnum"]] = rest_field(
        name="autoIoScaling", visibility=["read", "create", "update", "delete", "query"]
    )
    """Enable IO Auto Scaling or not. Known values are: \"Enabled\" and \"Disabled\"."""
    storage_redundancy: Optional[Union[str, "_models.StorageRedundancyEnum"]] = rest_field(
        name="storageRedundancy", visibility=["read", "create"]
    )
    """The redundant type of the server storage. The parameter is used for server creation. Known
     values are: \"LocalRedundancy\" and \"ZoneRedundancy\"."""

    @overload
    def __init__(
        self,
        *,
        storage_size_gb: Optional[int] = None,
        iops: Optional[int] = None,
        auto_grow: Optional[Union[str, "_models.EnableStatusEnum"]] = None,
        log_on_disk: Optional[Union[str, "_models.EnableStatusEnum"]] = None,
        auto_io_scaling: Optional[Union[str, "_models.EnableStatusEnum"]] = None,
        storage_redundancy: Optional[Union[str, "_models.StorageRedundancyEnum"]] = None,
    ) -> None: ...

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

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


class StorageEditionCapability(_Model):
    """storage edition capability.

    :ivar name: storage edition name.
    :vartype name: str
    :ivar min_storage_size: The minimal supported storage size.
    :vartype min_storage_size: int
    :ivar max_storage_size: The maximum supported storage size.
    :vartype max_storage_size: int
    :ivar min_backup_retention_days: Minimal backup retention days.
    :vartype min_backup_retention_days: int
    :ivar max_backup_retention_days: Maximum backup retention days.
    :vartype max_backup_retention_days: int
    :ivar min_backup_interval_hours: Minimal backup interval hours.
    :vartype min_backup_interval_hours: int
    :ivar max_backup_interval_hours: Maximum backup interval hours.
    :vartype max_backup_interval_hours: int
    """

    name: Optional[str] = rest_field(visibility=["read"])
    """storage edition name."""
    min_storage_size: Optional[int] = rest_field(name="minStorageSize", visibility=["read"])
    """The minimal supported storage size."""
    max_storage_size: Optional[int] = rest_field(name="maxStorageSize", visibility=["read"])
    """The maximum supported storage size."""
    min_backup_retention_days: Optional[int] = rest_field(name="minBackupRetentionDays", visibility=["read"])
    """Minimal backup retention days."""
    max_backup_retention_days: Optional[int] = rest_field(name="maxBackupRetentionDays", visibility=["read"])
    """Maximum backup retention days."""
    min_backup_interval_hours: Optional[int] = rest_field(name="minBackupIntervalHours", visibility=["read"])
    """Minimal backup interval hours."""
    max_backup_interval_hours: Optional[int] = rest_field(name="maxBackupIntervalHours", visibility=["read"])
    """Maximum backup interval hours."""


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.mysqlflexibleservers.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.mysqlflexibleservers.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 UserAssignedIdentity(_Model):
    """Metadata of user assigned identity.

    :ivar principal_id: Principal Id of user assigned identity.
    :vartype principal_id: str
    :ivar client_id: Client Id of user assigned identity.
    :vartype client_id: str
    """

    principal_id: Optional[str] = rest_field(name="principalId", visibility=["read"])
    """Principal Id of user assigned identity."""
    client_id: Optional[str] = rest_field(name="clientId", visibility=["read"])
    """Client Id of user assigned identity."""


class ValidateBackupResponse(_Model):
    """Represents ValidateBackup API Response.

    :ivar properties: The response properties of a pre backup operation.
    :vartype properties: ~azure.mgmt.mysqlflexibleservers.models.ValidateBackupResponseProperties
    """

    properties: Optional["_models.ValidateBackupResponseProperties"] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """The response properties of a pre backup operation."""

    __flattened_items = ["number_of_containers"]

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

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

    :ivar number_of_containers: Estimated no of storage containers required for resource data to be
     backed up.
    :vartype number_of_containers: int
    """

    number_of_containers: Optional[int] = rest_field(
        name="numberOfContainers", visibility=["read", "create", "update", "delete", "query"]
    )
    """Estimated no of storage containers required for resource data to be backed up."""

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

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

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


class VirtualNetworkSubnetUsageParameter(_Model):
    """Virtual network subnet usage parameter.

    :ivar virtual_network_resource_id: Virtual network resource id.
    :vartype virtual_network_resource_id: str
    """

    virtual_network_resource_id: Optional[str] = rest_field(
        name="virtualNetworkResourceId", visibility=["read", "create", "update", "delete", "query"]
    )
    """Virtual network resource id."""

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

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

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


class VirtualNetworkSubnetUsageResult(_Model):
    """Virtual network subnet usage data.

    :ivar location: The location name.
    :vartype location: str
    :ivar subscription_id: The subscription id.
    :vartype subscription_id: str
    :ivar delegated_subnets_usage: A list of delegated subnet usage.
    :vartype delegated_subnets_usage:
     list[~azure.mgmt.mysqlflexibleservers.models.DelegatedSubnetUsage]
    """

    location: Optional[str] = rest_field(visibility=["read"])
    """The location name."""
    subscription_id: Optional[str] = rest_field(name="subscriptionId", visibility=["read"])
    """The subscription id."""
    delegated_subnets_usage: Optional[list["_models.DelegatedSubnetUsage"]] = rest_field(
        name="delegatedSubnetsUsage", visibility=["read"]
    )
    """A list of delegated subnet usage."""
