# 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 CommandType, MongoDbProgressResultType, ResourceType, TaskType

if TYPE_CHECKING:
    from .. import models as _models


class ApiError(_Model):
    """Error information.

    :ivar error: Error information in OData format.
    :vartype error: ~azure.mgmt.datamigration.models.ODataError
    :ivar system_data: Metadata pertaining to creation and last modification of the resource.
    :vartype system_data: ~azure.mgmt.datamigration.models.SystemData
    """

    error: Optional["_models.ODataError"] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """Error information in OData format."""
    system_data: Optional["_models.SystemData"] = rest_field(name="systemData", visibility=["read"])
    """Metadata pertaining to creation and last modification of the resource."""

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

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

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


class AuthenticationKeys(_Model):
    """An authentication key.

    :ivar auth_key1: The first authentication key.
    :vartype auth_key1: str
    :ivar auth_key2: The second authentication key.
    :vartype auth_key2: str
    """

    auth_key1: Optional[str] = rest_field(name="authKey1", visibility=["read", "create"])
    """The first authentication key."""
    auth_key2: Optional[str] = rest_field(name="authKey2", visibility=["read", "create"])
    """The second authentication key."""

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

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

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


class AvailableServiceSku(_Model):
    """Describes the available service SKU.

    :ivar resource_type: The resource type, including the provider namespace.
    :vartype resource_type: str
    :ivar sku: SKU name, tier, etc.
    :vartype sku: ~azure.mgmt.datamigration.models.AvailableServiceSkuSku
    :ivar capacity: A description of the scaling capacities of the SKU.
    :vartype capacity: ~azure.mgmt.datamigration.models.AvailableServiceSkuCapacity
    """

    resource_type: Optional[str] = rest_field(
        name="resourceType", visibility=["read", "create", "update", "delete", "query"]
    )
    """The resource type, including the provider namespace."""
    sku: Optional["_models.AvailableServiceSkuSku"] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """SKU name, tier, etc."""
    capacity: Optional["_models.AvailableServiceSkuCapacity"] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """A description of the scaling capacities of the SKU."""

    @overload
    def __init__(
        self,
        *,
        resource_type: Optional[str] = None,
        sku: Optional["_models.AvailableServiceSkuSku"] = None,
        capacity: Optional["_models.AvailableServiceSkuCapacity"] = None,
    ) -> None: ...

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

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


class AvailableServiceSkuCapacity(_Model):
    """A description of the scaling capacities of the SKU.

    :ivar minimum: The minimum capacity, usually 0 or 1.
    :vartype minimum: int
    :ivar maximum: The maximum capacity.
    :vartype maximum: int
    :ivar default: The default capacity.
    :vartype default: int
    :ivar scale_type: The scalability approach. Known values are: "none", "manual", and
     "automatic".
    :vartype scale_type: str or ~azure.mgmt.datamigration.models.ServiceScalability
    """

    minimum: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """The minimum capacity, usually 0 or 1."""
    maximum: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """The maximum capacity."""
    default: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """The default capacity."""
    scale_type: Optional[Union[str, "_models.ServiceScalability"]] = rest_field(
        name="scaleType", visibility=["read", "create", "update", "delete", "query"]
    )
    """The scalability approach. Known values are: \"none\", \"manual\", and \"automatic\"."""

    @overload
    def __init__(
        self,
        *,
        minimum: Optional[int] = None,
        maximum: Optional[int] = None,
        default: Optional[int] = None,
        scale_type: Optional[Union[str, "_models.ServiceScalability"]] = None,
    ) -> None: ...

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

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


class AvailableServiceSkuSku(_Model):
    """SKU name, tier, etc.

    :ivar name: The name of the SKU.
    :vartype name: str
    :ivar family: SKU family.
    :vartype family: str
    :ivar size: SKU size.
    :vartype size: str
    :ivar tier: The tier of the SKU, such as "Basic", "General Purpose", or "Business Critical".
    :vartype tier: str
    """

    name: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """The name of the SKU."""
    family: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """SKU family."""
    size: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """SKU size."""
    tier: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """The tier of the SKU, such as \"Basic\", \"General Purpose\", or \"Business Critical\"."""

    @overload
    def __init__(
        self,
        *,
        name: Optional[str] = None,
        family: Optional[str] = None,
        size: Optional[str] = None,
        tier: 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 AzureActiveDirectoryApp(_Model):
    """Azure Active Directory Application.

    :ivar application_id: Application ID of the Azure Active Directory Application.
    :vartype application_id: str
    :ivar app_key: Key used to authenticate to the Azure Active Directory Application.
    :vartype app_key: str
    :ivar tenant_id: Tenant id of the customer.
    :vartype tenant_id: str
    :ivar ignore_azure_permissions: Ignore checking azure permissions on the AAD app.
    :vartype ignore_azure_permissions: bool
    """

    application_id: Optional[str] = rest_field(
        name="applicationId", visibility=["read", "create", "update", "delete", "query"]
    )
    """Application ID of the Azure Active Directory Application."""
    app_key: Optional[str] = rest_field(name="appKey", visibility=["read", "create", "update", "delete", "query"])
    """Key used to authenticate to the Azure Active Directory Application."""
    tenant_id: Optional[str] = rest_field(name="tenantId", visibility=["read", "create", "update", "delete", "query"])
    """Tenant id of the customer."""
    ignore_azure_permissions: Optional[bool] = rest_field(
        name="ignoreAzurePermissions", visibility=["read", "create", "update", "delete", "query"]
    )
    """Ignore checking azure permissions on the AAD app."""

    @overload
    def __init__(
        self,
        *,
        application_id: Optional[str] = None,
        app_key: Optional[str] = None,
        tenant_id: Optional[str] = None,
        ignore_azure_permissions: Optional[bool] = None,
    ) -> None: ...

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

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


class AzureBlob(_Model):
    """Azure Blob Details.

    :ivar auth_type: Authentication type used for accessing Azure Blob Storage. Known values are:
     "AccountKey" and "ManagedIdentity".
    :vartype auth_type: str or ~azure.mgmt.datamigration.models.AuthType
    :ivar identity: Identity details for authentication using a Managed Identity.
    :vartype identity: ~azure.mgmt.datamigration.models.ManagedServiceIdentity
    :ivar storage_account_resource_id: Resource Id of the storage account where backups are stored.
    :vartype storage_account_resource_id: str
    :ivar account_key: Storage Account Key.
    :vartype account_key: str
    :ivar blob_container_name: Blob container name where backups are stored.
    :vartype blob_container_name: str
    """

    auth_type: Optional[Union[str, "_models.AuthType"]] = rest_field(
        name="authType", visibility=["read", "create", "update", "delete", "query"]
    )
    """Authentication type used for accessing Azure Blob Storage. Known values are: \"AccountKey\" and
     \"ManagedIdentity\"."""
    identity: Optional["_models.ManagedServiceIdentity"] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """Identity details for authentication using a Managed Identity."""
    storage_account_resource_id: Optional[str] = rest_field(
        name="storageAccountResourceId", visibility=["read", "create", "update", "delete", "query"]
    )
    """Resource Id of the storage account where backups are stored."""
    account_key: Optional[str] = rest_field(
        name="accountKey", visibility=["read", "create", "update", "delete", "query"]
    )
    """Storage Account Key."""
    blob_container_name: Optional[str] = rest_field(
        name="blobContainerName", visibility=["read", "create", "update", "delete", "query"]
    )
    """Blob container name where backups are stored."""

    @overload
    def __init__(
        self,
        *,
        auth_type: Optional[Union[str, "_models.AuthType"]] = None,
        identity: Optional["_models.ManagedServiceIdentity"] = None,
        storage_account_resource_id: Optional[str] = None,
        account_key: Optional[str] = None,
        blob_container_name: Optional[str] = None,
    ) -> None: ...

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

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


class BackupConfiguration(_Model):
    """Backup Configuration.

    :ivar source_location: Source location of backups.
    :vartype source_location: ~azure.mgmt.datamigration.models.SourceLocation
    :ivar target_location: Target location for copying backups.
    :vartype target_location: ~azure.mgmt.datamigration.models.TargetLocation
    """

    source_location: Optional["_models.SourceLocation"] = rest_field(
        name="sourceLocation", visibility=["read", "create", "update", "delete", "query"]
    )
    """Source location of backups."""
    target_location: Optional["_models.TargetLocation"] = rest_field(
        name="targetLocation", visibility=["read", "create", "update", "delete", "query"]
    )
    """Target location for copying backups."""

    @overload
    def __init__(
        self,
        *,
        source_location: Optional["_models.SourceLocation"] = None,
        target_location: Optional["_models.TargetLocation"] = None,
    ) -> None: ...

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

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


class BackupFileInfo(_Model):
    """Information of the backup file.

    :ivar file_location: Location of the backup file in shared folder.
    :vartype file_location: str
    :ivar family_sequence_number: Sequence number of the backup file in the backup set.
    :vartype family_sequence_number: int
    :ivar status: Status of the backup file during migration. Known values are: "Arrived",
     "Queued", "Uploading", "Uploaded", "Restoring", "Restored", and "Cancelled".
    :vartype status: str or ~azure.mgmt.datamigration.models.BackupFileStatus
    """

    file_location: Optional[str] = rest_field(
        name="fileLocation", visibility=["read", "create", "update", "delete", "query"]
    )
    """Location of the backup file in shared folder."""
    family_sequence_number: Optional[int] = rest_field(
        name="familySequenceNumber", visibility=["read", "create", "update", "delete", "query"]
    )
    """Sequence number of the backup file in the backup set."""
    status: Optional[Union[str, "_models.BackupFileStatus"]] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """Status of the backup file during migration. Known values are: \"Arrived\", \"Queued\",
     \"Uploading\", \"Uploaded\", \"Restoring\", \"Restored\", and \"Cancelled\"."""

    @overload
    def __init__(
        self,
        *,
        file_location: Optional[str] = None,
        family_sequence_number: Optional[int] = None,
        status: Optional[Union[str, "_models.BackupFileStatus"]] = None,
    ) -> None: ...

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

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


class BackupSetInfo(_Model):
    """Information of backup set.

    :ivar backup_set_id: Id for the set of backup files.
    :vartype backup_set_id: str
    :ivar first_lsn: First log sequence number of the backup file.
    :vartype first_lsn: str
    :ivar last_lsn: Last log sequence number of the backup file.
    :vartype last_lsn: str
    :ivar last_modified_time: Last modified time of the backup file in share location.
    :vartype last_modified_time: ~datetime.datetime
    :ivar backup_type: Enum of the different backup types. Known values are: "Database",
     "TransactionLog", "File", "DifferentialDatabase", "DifferentialFile", "Partial", and
     "DifferentialPartial".
    :vartype backup_type: str or ~azure.mgmt.datamigration.models.BackupType
    :ivar list_of_backup_files: List of files in the backup set.
    :vartype list_of_backup_files: list[~azure.mgmt.datamigration.models.BackupFileInfo]
    :ivar database_name: Name of the database to which the backup set belongs.
    :vartype database_name: str
    :ivar backup_start_date: Date and time that the backup operation began.
    :vartype backup_start_date: ~datetime.datetime
    :ivar backup_finished_date: Date and time that the backup operation finished.
    :vartype backup_finished_date: ~datetime.datetime
    :ivar is_backup_restored: Whether the backup set is restored or not.
    :vartype is_backup_restored: bool
    """

    backup_set_id: Optional[str] = rest_field(
        name="backupSetId", visibility=["read", "create", "update", "delete", "query"]
    )
    """Id for the set of backup files."""
    first_lsn: Optional[str] = rest_field(name="firstLsn", visibility=["read", "create", "update", "delete", "query"])
    """First log sequence number of the backup file."""
    last_lsn: Optional[str] = rest_field(name="lastLsn", visibility=["read", "create", "update", "delete", "query"])
    """Last log sequence number of the backup file."""
    last_modified_time: Optional[datetime.datetime] = rest_field(
        name="lastModifiedTime", visibility=["read", "create", "update", "delete", "query"], format="rfc3339"
    )
    """Last modified time of the backup file in share location."""
    backup_type: Optional[Union[str, "_models.BackupType"]] = rest_field(
        name="backupType", visibility=["read", "create", "update", "delete", "query"]
    )
    """Enum of the different backup types. Known values are: \"Database\", \"TransactionLog\",
     \"File\", \"DifferentialDatabase\", \"DifferentialFile\", \"Partial\", and
     \"DifferentialPartial\"."""
    list_of_backup_files: Optional[list["_models.BackupFileInfo"]] = rest_field(
        name="listOfBackupFiles", visibility=["read", "create", "update", "delete", "query"]
    )
    """List of files in the backup set."""
    database_name: Optional[str] = rest_field(
        name="databaseName", visibility=["read", "create", "update", "delete", "query"]
    )
    """Name of the database to which the backup set belongs."""
    backup_start_date: Optional[datetime.datetime] = rest_field(
        name="backupStartDate", visibility=["read", "create", "update", "delete", "query"], format="rfc3339"
    )
    """Date and time that the backup operation began."""
    backup_finished_date: Optional[datetime.datetime] = rest_field(
        name="backupFinishedDate", visibility=["read", "create", "update", "delete", "query"], format="rfc3339"
    )
    """Date and time that the backup operation finished."""
    is_backup_restored: Optional[bool] = rest_field(
        name="isBackupRestored", visibility=["read", "create", "update", "delete", "query"]
    )
    """Whether the backup set is restored or not."""

    @overload
    def __init__(
        self,
        *,
        backup_set_id: Optional[str] = None,
        first_lsn: Optional[str] = None,
        last_lsn: Optional[str] = None,
        last_modified_time: Optional[datetime.datetime] = None,
        backup_type: Optional[Union[str, "_models.BackupType"]] = None,
        list_of_backup_files: Optional[list["_models.BackupFileInfo"]] = None,
        database_name: Optional[str] = None,
        backup_start_date: Optional[datetime.datetime] = None,
        backup_finished_date: Optional[datetime.datetime] = None,
        is_backup_restored: Optional[bool] = None,
    ) -> None: ...

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

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


class BlobShare(_Model):
    """Blob container storage information.

    :ivar sas_uri: SAS URI of Azure Storage Account Container.
    :vartype sas_uri: str
    """

    sas_uri: Optional[str] = rest_field(name="sasUri", visibility=["read", "create", "update", "delete", "query"])
    """SAS URI of Azure Storage Account Container."""

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

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

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


class CheckOCIDriverTaskInput(_Model):
    """Input for the service task to check for OCI drivers.

    :ivar server_version: Version of the source server to check against.  Optional.
    :vartype server_version: str
    """

    server_version: Optional[str] = rest_field(
        name="serverVersion", visibility=["read", "create", "update", "delete", "query"]
    )
    """Version of the source server to check against.  Optional."""

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

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

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


class CheckOCIDriverTaskOutput(_Model):
    """Output for the service task to check for OCI drivers.

    :ivar installed_driver: Information about the installed driver if found and valid.
    :vartype installed_driver: ~azure.mgmt.datamigration.models.OracleOCIDriverInfo
    :ivar validation_errors: Validation errors.
    :vartype validation_errors: list[~azure.mgmt.datamigration.models.ReportableException]
    """

    installed_driver: Optional["_models.OracleOCIDriverInfo"] = rest_field(
        name="installedDriver", visibility=["read", "create", "update", "delete", "query"]
    )
    """Information about the installed driver if found and valid."""
    validation_errors: Optional[list["_models.ReportableException"]] = rest_field(
        name="validationErrors", visibility=["read"]
    )
    """Validation errors."""

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

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

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


class ProjectTaskProperties(_Model):
    """Base class for all types of DMS (classic) task properties. If task is not supported by current
    client, this object is returned.

    You probably want to use the sub-classes and not this class directly. Known sub-classes are:
    ConnectToMongoDbTaskProperties, ConnectToSourceMySqlTaskProperties,
    ConnectToSourceOracleSyncTaskProperties, ConnectToSourcePostgreSqlSyncTaskProperties,
    ConnectToSourceSqlServerTaskProperties, ConnectToSourceSqlServerSyncTaskProperties,
    ConnectToTargetAzureDbForMySqlTaskProperties,
    ConnectToTargetAzureDbForPostgreSqlSyncTaskProperties, ConnectToTargetSqlMITaskProperties,
    ConnectToTargetSqlMISyncTaskProperties,
    ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskProperties,
    ConnectToTargetSqlDbTaskProperties, ConnectToTargetSqlDbSyncTaskProperties,
    GetTdeCertificatesSqlTaskProperties, GetUserTablesSqlSyncTaskProperties,
    GetUserTablesSqlTaskProperties, GetUserTablesMySqlTaskProperties,
    GetUserTablesOracleTaskProperties, GetUserTablesPostgreSqlTaskProperties,
    MigrateMongoDbTaskProperties, MigrateMySqlAzureDbForMySqlOfflineTaskProperties,
    MigrateMySqlAzureDbForMySqlSyncTaskProperties,
    MigrateOracleAzureDbForPostgreSqlSyncTaskProperties,
    MigratePostgreSqlAzureDbForPostgreSqlSyncTaskProperties,
    MigrateSqlServerSqlDbSyncTaskProperties, MigrateSqlServerSqlMITaskProperties,
    MigrateSqlServerSqlMISyncTaskProperties, MigrateSqlServerSqlDbTaskProperties,
    MigrateSsisTaskProperties, MigrateSchemaSqlServerSqlDbTaskProperties,
    CheckOCIDriverTaskProperties, InstallOCIDriverTaskProperties, UploadOCIDriverTaskProperties,
    ValidateMongoDbTaskProperties, ValidateOracleAzureDbForPostgreSqlSyncTaskProperties,
    ValidateMigrationInputSqlServerSqlMITaskProperties,
    ValidateMigrationInputSqlServerSqlMISyncTaskProperties,
    ValidateMigrationInputSqlServerSqlDbSyncTaskProperties

    :ivar task_type: Task type. Required. Known values are: "Connect.MongoDb",
     "ConnectToSource.SqlServer", "ConnectToSource.SqlServer.Sync",
     "ConnectToSource.PostgreSql.Sync", "ConnectToSource.MySql", "ConnectToSource.Oracle.Sync",
     "ConnectToTarget.SqlDb", "ConnectToTarget.SqlDb.Sync",
     "ConnectToTarget.AzureDbForPostgreSql.Sync",
     "ConnectToTarget.Oracle.AzureDbForPostgreSql.Sync", "ConnectToTarget.AzureSqlDbMI",
     "ConnectToTarget.AzureSqlDbMI.Sync.LRS", "ConnectToTarget.AzureDbForMySql",
     "GetUserTables.Sql", "GetUserTables.AzureSqlDb.Sync", "GetUserTablesOracle",
     "GetUserTablesPostgreSql", "GetUserTablesMySql", "Migrate.MongoDb",
     "Migrate.SqlServer.AzureSqlDbMI", "Migrate.SqlServer.AzureSqlDbMI.Sync.LRS",
     "Migrate.SqlServer.SqlDb", "Migrate.SqlServer.AzureSqlDb.Sync",
     "Migrate.MySql.AzureDbForMySql.Sync", "Migrate.MySql.AzureDbForMySql",
     "Migrate.PostgreSql.AzureDbForPostgreSql.SyncV2", "Migrate.Oracle.AzureDbForPostgreSql.Sync",
     "ValidateMigrationInput.SqlServer.SqlDb.Sync", "ValidateMigrationInput.SqlServer.AzureSqlDbMI",
     "ValidateMigrationInput.SqlServer.AzureSqlDbMI.Sync.LRS", "Validate.MongoDb",
     "Validate.Oracle.AzureDbPostgreSql.Sync", "GetTDECertificates.Sql", "Migrate.Ssis",
     "Service.Check.OCI", "Service.Upload.OCI", "Service.Install.OCI", and
     "MigrateSchemaSqlServerSqlDb".
    :vartype task_type: str or ~azure.mgmt.datamigration.models.TaskType
    :ivar errors: Array of errors. This is ignored if submitted.
    :vartype errors: list[~azure.mgmt.datamigration.models.ODataError]
    :ivar state: The state of the task. This is ignored if submitted. Known values are: "Unknown",
     "Queued", "Running", "Canceled", "Succeeded", "Failed", "FailedInputValidation", and "Faulted".
    :vartype state: str or ~azure.mgmt.datamigration.models.TaskState
    :ivar commands: Array of command properties.
    :vartype commands: list[~azure.mgmt.datamigration.models.CommandProperties]
    :ivar client_data: Key value pairs of client data to attach meta data information to task.
    :vartype client_data: dict[str, str]
    """

    __mapping__: dict[str, _Model] = {}
    task_type: str = rest_discriminator(name="taskType", visibility=["read", "create", "update", "delete", "query"])
    """Task type. Required. Known values are: \"Connect.MongoDb\", \"ConnectToSource.SqlServer\",
     \"ConnectToSource.SqlServer.Sync\", \"ConnectToSource.PostgreSql.Sync\",
     \"ConnectToSource.MySql\", \"ConnectToSource.Oracle.Sync\", \"ConnectToTarget.SqlDb\",
     \"ConnectToTarget.SqlDb.Sync\", \"ConnectToTarget.AzureDbForPostgreSql.Sync\",
     \"ConnectToTarget.Oracle.AzureDbForPostgreSql.Sync\", \"ConnectToTarget.AzureSqlDbMI\",
     \"ConnectToTarget.AzureSqlDbMI.Sync.LRS\", \"ConnectToTarget.AzureDbForMySql\",
     \"GetUserTables.Sql\", \"GetUserTables.AzureSqlDb.Sync\", \"GetUserTablesOracle\",
     \"GetUserTablesPostgreSql\", \"GetUserTablesMySql\", \"Migrate.MongoDb\",
     \"Migrate.SqlServer.AzureSqlDbMI\", \"Migrate.SqlServer.AzureSqlDbMI.Sync.LRS\",
     \"Migrate.SqlServer.SqlDb\", \"Migrate.SqlServer.AzureSqlDb.Sync\",
     \"Migrate.MySql.AzureDbForMySql.Sync\", \"Migrate.MySql.AzureDbForMySql\",
     \"Migrate.PostgreSql.AzureDbForPostgreSql.SyncV2\",
     \"Migrate.Oracle.AzureDbForPostgreSql.Sync\", \"ValidateMigrationInput.SqlServer.SqlDb.Sync\",
     \"ValidateMigrationInput.SqlServer.AzureSqlDbMI\",
     \"ValidateMigrationInput.SqlServer.AzureSqlDbMI.Sync.LRS\", \"Validate.MongoDb\",
     \"Validate.Oracle.AzureDbPostgreSql.Sync\", \"GetTDECertificates.Sql\", \"Migrate.Ssis\",
     \"Service.Check.OCI\", \"Service.Upload.OCI\", \"Service.Install.OCI\", and
     \"MigrateSchemaSqlServerSqlDb\"."""
    errors: Optional[list["_models.ODataError"]] = rest_field(visibility=["read"])
    """Array of errors. This is ignored if submitted."""
    state: Optional[Union[str, "_models.TaskState"]] = rest_field(visibility=["read"])
    """The state of the task. This is ignored if submitted. Known values are: \"Unknown\", \"Queued\",
     \"Running\", \"Canceled\", \"Succeeded\", \"Failed\", \"FailedInputValidation\", and
     \"Faulted\"."""
    commands: Optional[list["_models.CommandProperties"]] = rest_field(visibility=["read"])
    """Array of command properties."""
    client_data: Optional[dict[str, str]] = rest_field(
        name="clientData", visibility=["read", "create", "update", "delete", "query"]
    )
    """Key value pairs of client data to attach meta data information to task."""

    @overload
    def __init__(
        self,
        *,
        task_type: str,
        client_data: 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 CheckOCIDriverTaskProperties(ProjectTaskProperties, discriminator="Service.Check.OCI"):
    """Properties for the task that checks for OCI drivers.

    :ivar errors: Array of errors. This is ignored if submitted.
    :vartype errors: list[~azure.mgmt.datamigration.models.ODataError]
    :ivar state: The state of the task. This is ignored if submitted. Known values are: "Unknown",
     "Queued", "Running", "Canceled", "Succeeded", "Failed", "FailedInputValidation", and "Faulted".
    :vartype state: str or ~azure.mgmt.datamigration.models.TaskState
    :ivar commands: Array of command properties.
    :vartype commands: list[~azure.mgmt.datamigration.models.CommandProperties]
    :ivar client_data: Key value pairs of client data to attach meta data information to task.
    :vartype client_data: dict[str, str]
    :ivar input: Input for the service task to check for OCI drivers.
    :vartype input: ~azure.mgmt.datamigration.models.CheckOCIDriverTaskInput
    :ivar output: Task output. This is ignored if submitted.
    :vartype output: list[~azure.mgmt.datamigration.models.CheckOCIDriverTaskOutput]
    :ivar task_type: Task type. Required. Service.Check.OCI.
    :vartype task_type: str or ~azure.mgmt.datamigration.models.SERVICE_CHECK_OCI
    """

    input: Optional["_models.CheckOCIDriverTaskInput"] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """Input for the service task to check for OCI drivers."""
    output: Optional[list["_models.CheckOCIDriverTaskOutput"]] = rest_field(visibility=["read"])
    """Task output. This is ignored if submitted."""
    task_type: Literal[TaskType.SERVICE_CHECK_OCI] = rest_discriminator(name="taskType", visibility=["read", "create", "update", "delete", "query"])  # type: ignore
    """Task type. Required. Service.Check.OCI."""

    @overload
    def __init__(
        self,
        *,
        client_data: Optional[dict[str, str]] = None,
        input: Optional["_models.CheckOCIDriverTaskInput"] = None,
    ) -> None: ...

    @overload
    def __init__(self, mapping: Mapping[str, Any]) -> None:
        """
        :param 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.task_type = TaskType.SERVICE_CHECK_OCI  # type: ignore


class CommandProperties(_Model):
    """Base class for all types of DMS (classic) command properties. If command is not supported by
    current client, this object is returned.

    You probably want to use the sub-classes and not this class directly. Known sub-classes are:
    MigrateMISyncCompleteCommandProperties, MigrateSyncCompleteCommandProperties,
    MongoDbCancelCommand, MongoDbFinishCommand, MongoDbRestartCommand

    :ivar command_type: Command type. Required. Known values are: "Migrate.Sync.Complete.Database",
     "Migrate.SqlServer.AzureDbSqlMi.Complete", "cancel", "finish", and "restart".
    :vartype command_type: str or ~azure.mgmt.datamigration.models.CommandType
    :ivar errors: Array of errors. This is ignored if submitted.
    :vartype errors: list[~azure.mgmt.datamigration.models.ODataError]
    :ivar state: The state of the command. This is ignored if submitted. Known values are:
     "Unknown", "Accepted", "Running", "Succeeded", and "Failed".
    :vartype state: str or ~azure.mgmt.datamigration.models.CommandState
    """

    __mapping__: dict[str, _Model] = {}
    command_type: str = rest_discriminator(
        name="commandType", visibility=["read", "create", "update", "delete", "query"]
    )
    """Command type. Required. Known values are: \"Migrate.Sync.Complete.Database\",
     \"Migrate.SqlServer.AzureDbSqlMi.Complete\", \"cancel\", \"finish\", and \"restart\"."""
    errors: Optional[list["_models.ODataError"]] = rest_field(visibility=["read"])
    """Array of errors. This is ignored if submitted."""
    state: Optional[Union[str, "_models.CommandState"]] = rest_field(visibility=["read"])
    """The state of the command. This is ignored if submitted. Known values are: \"Unknown\",
     \"Accepted\", \"Running\", \"Succeeded\", and \"Failed\"."""

    @overload
    def __init__(
        self,
        *,
        command_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 ConnectionInfo(_Model):
    """Defines the connection properties of a server.

    You probably want to use the sub-classes and not this class directly. Known sub-classes are:
    MiSqlConnectionInfo, MongoDbConnectionInfo, MySqlConnectionInfo, OracleConnectionInfo,
    PostgreSqlConnectionInfo, SqlConnectionInfo

    :ivar type: Type of connection info. Required. Default value is None.
    :vartype type: str
    :ivar user_name: User name.
    :vartype user_name: str
    :ivar password: Password credential.
    :vartype password: str
    """

    __mapping__: dict[str, _Model] = {}
    type: str = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"])
    """Type of connection info. Required. Default value is None."""
    user_name: Optional[str] = rest_field(name="userName", visibility=["read", "create", "update", "delete", "query"])
    """User name."""
    password: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """Password credential."""

    @overload
    def __init__(
        self,
        *,
        type: str,
        user_name: Optional[str] = None,
        password: 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 ConnectToMongoDbTaskProperties(ProjectTaskProperties, discriminator="Connect.MongoDb"):
    """Properties for the task that validates the connection to and provides information about a
    MongoDB server.

    :ivar errors: Array of errors. This is ignored if submitted.
    :vartype errors: list[~azure.mgmt.datamigration.models.ODataError]
    :ivar state: The state of the task. This is ignored if submitted. Known values are: "Unknown",
     "Queued", "Running", "Canceled", "Succeeded", "Failed", "FailedInputValidation", and "Faulted".
    :vartype state: str or ~azure.mgmt.datamigration.models.TaskState
    :ivar commands: Array of command properties.
    :vartype commands: list[~azure.mgmt.datamigration.models.CommandProperties]
    :ivar client_data: Key value pairs of client data to attach meta data information to task.
    :vartype client_data: dict[str, str]
    :ivar input: Describes a connection to a MongoDB data source.
    :vartype input: ~azure.mgmt.datamigration.models.MongoDbConnectionInfo
    :ivar output: An array containing a single MongoDbClusterInfo object.
    :vartype output: list[~azure.mgmt.datamigration.models.MongoDbClusterInfo]
    :ivar task_type: Task type. Required. Connect.MongoDb.
    :vartype task_type: str or ~azure.mgmt.datamigration.models.CONNECT_MONGO_DB
    """

    input: Optional["_models.MongoDbConnectionInfo"] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """Describes a connection to a MongoDB data source."""
    output: Optional[list["_models.MongoDbClusterInfo"]] = rest_field(visibility=["read"])
    """An array containing a single MongoDbClusterInfo object."""
    task_type: Literal[TaskType.CONNECT_MONGO_DB] = rest_discriminator(name="taskType", visibility=["read", "create", "update", "delete", "query"])  # type: ignore
    """Task type. Required. Connect.MongoDb."""

    @overload
    def __init__(
        self,
        *,
        client_data: Optional[dict[str, str]] = None,
        input: Optional["_models.MongoDbConnectionInfo"] = None,
    ) -> None: ...

    @overload
    def __init__(self, mapping: Mapping[str, Any]) -> None:
        """
        :param 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.task_type = TaskType.CONNECT_MONGO_DB  # type: ignore


class ConnectToSourceMySqlTaskInput(_Model):
    """Input for the task that validates MySQL database connection.

    :ivar source_connection_info: Information for connecting to MySQL source. Required.
    :vartype source_connection_info: ~azure.mgmt.datamigration.models.MySqlConnectionInfo
    :ivar target_platform: Target Platform for the migration. Known values are: "SqlServer" and
     "AzureDbForMySQL".
    :vartype target_platform: str or ~azure.mgmt.datamigration.models.MySqlTargetPlatformType
    :ivar check_permissions_group: Permission group for validations. Known values are: "Default",
     "MigrationFromSqlServerToAzureDB", "MigrationFromSqlServerToAzureMI",
     "MigrationFromMySQLToAzureDBForMySQL", and "MigrationFromSqlServerToAzureVM".
    :vartype check_permissions_group: str or
     ~azure.mgmt.datamigration.models.ServerLevelPermissionsGroup
    :ivar is_offline_migration: Flag for whether or not the migration is offline.
    :vartype is_offline_migration: bool
    """

    source_connection_info: "_models.MySqlConnectionInfo" = rest_field(
        name="sourceConnectionInfo", visibility=["read", "create", "update", "delete", "query"]
    )
    """Information for connecting to MySQL source. Required."""
    target_platform: Optional[Union[str, "_models.MySqlTargetPlatformType"]] = rest_field(
        name="targetPlatform", visibility=["read", "create", "update", "delete", "query"]
    )
    """Target Platform for the migration. Known values are: \"SqlServer\" and \"AzureDbForMySQL\"."""
    check_permissions_group: Optional[Union[str, "_models.ServerLevelPermissionsGroup"]] = rest_field(
        name="checkPermissionsGroup", visibility=["read", "create", "update", "delete", "query"]
    )
    """Permission group for validations. Known values are: \"Default\",
     \"MigrationFromSqlServerToAzureDB\", \"MigrationFromSqlServerToAzureMI\",
     \"MigrationFromMySQLToAzureDBForMySQL\", and \"MigrationFromSqlServerToAzureVM\"."""
    is_offline_migration: Optional[bool] = rest_field(
        name="isOfflineMigration", visibility=["read", "create", "update", "delete", "query"]
    )
    """Flag for whether or not the migration is offline."""

    @overload
    def __init__(
        self,
        *,
        source_connection_info: "_models.MySqlConnectionInfo",
        target_platform: Optional[Union[str, "_models.MySqlTargetPlatformType"]] = None,
        check_permissions_group: Optional[Union[str, "_models.ServerLevelPermissionsGroup"]] = None,
        is_offline_migration: Optional[bool] = None,
    ) -> None: ...

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

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


class ConnectToSourceMySqlTaskProperties(ProjectTaskProperties, discriminator="ConnectToSource.MySql"):
    """Properties for the task that validates MySQL database connection.

    :ivar errors: Array of errors. This is ignored if submitted.
    :vartype errors: list[~azure.mgmt.datamigration.models.ODataError]
    :ivar state: The state of the task. This is ignored if submitted. Known values are: "Unknown",
     "Queued", "Running", "Canceled", "Succeeded", "Failed", "FailedInputValidation", and "Faulted".
    :vartype state: str or ~azure.mgmt.datamigration.models.TaskState
    :ivar commands: Array of command properties.
    :vartype commands: list[~azure.mgmt.datamigration.models.CommandProperties]
    :ivar client_data: Key value pairs of client data to attach meta data information to task.
    :vartype client_data: dict[str, str]
    :ivar input: Task input.
    :vartype input: ~azure.mgmt.datamigration.models.ConnectToSourceMySqlTaskInput
    :ivar output: Task output. This is ignored if submitted.
    :vartype output: list[~azure.mgmt.datamigration.models.ConnectToSourceNonSqlTaskOutput]
    :ivar task_type: Task type. Required. ConnectToSource.MySql.
    :vartype task_type: str or ~azure.mgmt.datamigration.models.CONNECT_TO_SOURCE_MY_SQL
    """

    input: Optional["_models.ConnectToSourceMySqlTaskInput"] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """Task input."""
    output: Optional[list["_models.ConnectToSourceNonSqlTaskOutput"]] = rest_field(visibility=["read"])
    """Task output. This is ignored if submitted."""
    task_type: Literal[TaskType.CONNECT_TO_SOURCE_MY_SQL] = rest_discriminator(name="taskType", visibility=["read", "create", "update", "delete", "query"])  # type: ignore
    """Task type. Required. ConnectToSource.MySql."""

    @overload
    def __init__(
        self,
        *,
        client_data: Optional[dict[str, str]] = None,
        input: Optional["_models.ConnectToSourceMySqlTaskInput"] = None,
    ) -> None: ...

    @overload
    def __init__(self, mapping: Mapping[str, Any]) -> None:
        """
        :param 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.task_type = TaskType.CONNECT_TO_SOURCE_MY_SQL  # type: ignore


class ConnectToSourceNonSqlTaskOutput(_Model):
    """Output for connect to MySQL type source.

    :ivar id: Result identifier.
    :vartype id: str
    :ivar source_server_brand_version: Server brand version.
    :vartype source_server_brand_version: str
    :ivar server_properties: Server properties.
    :vartype server_properties: ~azure.mgmt.datamigration.models.ServerProperties
    :ivar databases: List of databases on the server.
    :vartype databases: list[str]
    :ivar validation_errors: Validation errors associated with the task.
    :vartype validation_errors: list[~azure.mgmt.datamigration.models.ReportableException]
    """

    id: Optional[str] = rest_field(visibility=["read"])
    """Result identifier."""
    source_server_brand_version: Optional[str] = rest_field(name="sourceServerBrandVersion", visibility=["read"])
    """Server brand version."""
    server_properties: Optional["_models.ServerProperties"] = rest_field(name="serverProperties", visibility=["read"])
    """Server properties."""
    databases: Optional[list[str]] = rest_field(visibility=["read"])
    """List of databases on the server."""
    validation_errors: Optional[list["_models.ReportableException"]] = rest_field(
        name="validationErrors", visibility=["read"]
    )
    """Validation errors associated with the task."""


class ConnectToSourceOracleSyncTaskInput(_Model):
    """Input for the task that validates Oracle database connection.

    :ivar source_connection_info: Information for connecting to Oracle source. Required.
    :vartype source_connection_info: ~azure.mgmt.datamigration.models.OracleConnectionInfo
    """

    source_connection_info: "_models.OracleConnectionInfo" = rest_field(
        name="sourceConnectionInfo", visibility=["read", "create", "update", "delete", "query"]
    )
    """Information for connecting to Oracle source. Required."""

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

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

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


class ConnectToSourceOracleSyncTaskOutput(_Model):
    """Output for the task that validates Oracle database connection.

    :ivar source_server_version: Version of the source server.
    :vartype source_server_version: str
    :ivar databases: List of schemas on source server.
    :vartype databases: list[str]
    :ivar source_server_brand_version: Source server brand version.
    :vartype source_server_brand_version: str
    :ivar validation_errors: Validation errors associated with the task.
    :vartype validation_errors: list[~azure.mgmt.datamigration.models.ReportableException]
    """

    source_server_version: Optional[str] = rest_field(name="sourceServerVersion", visibility=["read"])
    """Version of the source server."""
    databases: Optional[list[str]] = rest_field(visibility=["read"])
    """List of schemas on source server."""
    source_server_brand_version: Optional[str] = rest_field(name="sourceServerBrandVersion", visibility=["read"])
    """Source server brand version."""
    validation_errors: Optional[list["_models.ReportableException"]] = rest_field(
        name="validationErrors", visibility=["read"]
    )
    """Validation errors associated with the task."""


class ConnectToSourceOracleSyncTaskProperties(ProjectTaskProperties, discriminator="ConnectToSource.Oracle.Sync"):
    """Properties for the task that validates Oracle database connection.

    :ivar errors: Array of errors. This is ignored if submitted.
    :vartype errors: list[~azure.mgmt.datamigration.models.ODataError]
    :ivar state: The state of the task. This is ignored if submitted. Known values are: "Unknown",
     "Queued", "Running", "Canceled", "Succeeded", "Failed", "FailedInputValidation", and "Faulted".
    :vartype state: str or ~azure.mgmt.datamigration.models.TaskState
    :ivar commands: Array of command properties.
    :vartype commands: list[~azure.mgmt.datamigration.models.CommandProperties]
    :ivar client_data: Key value pairs of client data to attach meta data information to task.
    :vartype client_data: dict[str, str]
    :ivar input: Task input.
    :vartype input: ~azure.mgmt.datamigration.models.ConnectToSourceOracleSyncTaskInput
    :ivar output: Task output. This is ignored if submitted.
    :vartype output: list[~azure.mgmt.datamigration.models.ConnectToSourceOracleSyncTaskOutput]
    :ivar task_type: Task type. Required. ConnectToSource.Oracle.Sync.
    :vartype task_type: str or ~azure.mgmt.datamigration.models.CONNECT_TO_SOURCE_ORACLE_SYNC
    """

    input: Optional["_models.ConnectToSourceOracleSyncTaskInput"] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """Task input."""
    output: Optional[list["_models.ConnectToSourceOracleSyncTaskOutput"]] = rest_field(visibility=["read"])
    """Task output. This is ignored if submitted."""
    task_type: Literal[TaskType.CONNECT_TO_SOURCE_ORACLE_SYNC] = rest_discriminator(name="taskType", visibility=["read", "create", "update", "delete", "query"])  # type: ignore
    """Task type. Required. ConnectToSource.Oracle.Sync."""

    @overload
    def __init__(
        self,
        *,
        client_data: Optional[dict[str, str]] = None,
        input: Optional["_models.ConnectToSourceOracleSyncTaskInput"] = None,
    ) -> None: ...

    @overload
    def __init__(self, mapping: Mapping[str, Any]) -> None:
        """
        :param 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.task_type = TaskType.CONNECT_TO_SOURCE_ORACLE_SYNC  # type: ignore


class ConnectToSourcePostgreSqlSyncTaskInput(_Model):
    """Input for the task that validates connection to PostgreSQL and source server requirements.

    :ivar source_connection_info: Connection information for source PostgreSQL server. Required.
    :vartype source_connection_info: ~azure.mgmt.datamigration.models.PostgreSqlConnectionInfo
    """

    source_connection_info: "_models.PostgreSqlConnectionInfo" = rest_field(
        name="sourceConnectionInfo", visibility=["read", "create", "update", "delete", "query"]
    )
    """Connection information for source PostgreSQL server. Required."""

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

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

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


class ConnectToSourcePostgreSqlSyncTaskOutput(_Model):
    """Output for the task that validates connection to PostgreSQL and source server requirements.

    :ivar id: Result identifier.
    :vartype id: str
    :ivar source_server_version: Version of the source server.
    :vartype source_server_version: str
    :ivar databases: List of databases on source server.
    :vartype databases: list[str]
    :ivar source_server_brand_version: Source server brand version.
    :vartype source_server_brand_version: str
    :ivar validation_errors: Validation errors associated with the task.
    :vartype validation_errors: list[~azure.mgmt.datamigration.models.ReportableException]
    """

    id: Optional[str] = rest_field(visibility=["read"])
    """Result identifier."""
    source_server_version: Optional[str] = rest_field(name="sourceServerVersion", visibility=["read"])
    """Version of the source server."""
    databases: Optional[list[str]] = rest_field(visibility=["read"])
    """List of databases on source server."""
    source_server_brand_version: Optional[str] = rest_field(name="sourceServerBrandVersion", visibility=["read"])
    """Source server brand version."""
    validation_errors: Optional[list["_models.ReportableException"]] = rest_field(
        name="validationErrors", visibility=["read"]
    )
    """Validation errors associated with the task."""


class ConnectToSourcePostgreSqlSyncTaskProperties(
    ProjectTaskProperties, discriminator="ConnectToSource.PostgreSql.Sync"
):  # pylint: disable=name-too-long
    """Properties for the task that validates connection to PostgreSQL server and source server
    requirements for online migration.

    :ivar errors: Array of errors. This is ignored if submitted.
    :vartype errors: list[~azure.mgmt.datamigration.models.ODataError]
    :ivar state: The state of the task. This is ignored if submitted. Known values are: "Unknown",
     "Queued", "Running", "Canceled", "Succeeded", "Failed", "FailedInputValidation", and "Faulted".
    :vartype state: str or ~azure.mgmt.datamigration.models.TaskState
    :ivar commands: Array of command properties.
    :vartype commands: list[~azure.mgmt.datamigration.models.CommandProperties]
    :ivar client_data: Key value pairs of client data to attach meta data information to task.
    :vartype client_data: dict[str, str]
    :ivar input: Task input.
    :vartype input: ~azure.mgmt.datamigration.models.ConnectToSourcePostgreSqlSyncTaskInput
    :ivar output: Task output. This is ignored if submitted.
    :vartype output: list[~azure.mgmt.datamigration.models.ConnectToSourcePostgreSqlSyncTaskOutput]
    :ivar task_type: Task type. Required. ConnectToSource.PostgreSql.Sync.
    :vartype task_type: str or ~azure.mgmt.datamigration.models.CONNECT_TO_SOURCE_POSTGRE_SQL_SYNC
    """

    input: Optional["_models.ConnectToSourcePostgreSqlSyncTaskInput"] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """Task input."""
    output: Optional[list["_models.ConnectToSourcePostgreSqlSyncTaskOutput"]] = rest_field(visibility=["read"])
    """Task output. This is ignored if submitted."""
    task_type: Literal[TaskType.CONNECT_TO_SOURCE_POSTGRE_SQL_SYNC] = rest_discriminator(name="taskType", visibility=["read", "create", "update", "delete", "query"])  # type: ignore
    """Task type. Required. ConnectToSource.PostgreSql.Sync."""

    @overload
    def __init__(
        self,
        *,
        client_data: Optional[dict[str, str]] = None,
        input: Optional["_models.ConnectToSourcePostgreSqlSyncTaskInput"] = None,
    ) -> None: ...

    @overload
    def __init__(self, mapping: Mapping[str, Any]) -> None:
        """
        :param 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.task_type = TaskType.CONNECT_TO_SOURCE_POSTGRE_SQL_SYNC  # type: ignore


class ConnectToSourceSqlServerSyncTaskProperties(
    ProjectTaskProperties, discriminator="ConnectToSource.SqlServer.Sync"
):  # pylint: disable=name-too-long
    """Properties for the task that validates connection to SQL Server and source server requirements
    for online migration.

    :ivar errors: Array of errors. This is ignored if submitted.
    :vartype errors: list[~azure.mgmt.datamigration.models.ODataError]
    :ivar state: The state of the task. This is ignored if submitted. Known values are: "Unknown",
     "Queued", "Running", "Canceled", "Succeeded", "Failed", "FailedInputValidation", and "Faulted".
    :vartype state: str or ~azure.mgmt.datamigration.models.TaskState
    :ivar commands: Array of command properties.
    :vartype commands: list[~azure.mgmt.datamigration.models.CommandProperties]
    :ivar client_data: Key value pairs of client data to attach meta data information to task.
    :vartype client_data: dict[str, str]
    :ivar input: Task input.
    :vartype input: ~azure.mgmt.datamigration.models.ConnectToSourceSqlServerTaskInput
    :ivar output: Task output. This is ignored if submitted.
    :vartype output: list[~azure.mgmt.datamigration.models.ConnectToSourceSqlServerTaskOutput]
    :ivar task_type: Task type. Required. ConnectToSource.SqlServer.Sync.
    :vartype task_type: str or ~azure.mgmt.datamigration.models.CONNECT_TO_SOURCE_SQL_SERVER_SYNC
    """

    input: Optional["_models.ConnectToSourceSqlServerTaskInput"] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """Task input."""
    output: Optional[list["_models.ConnectToSourceSqlServerTaskOutput"]] = rest_field(visibility=["read"])
    """Task output. This is ignored if submitted."""
    task_type: Literal[TaskType.CONNECT_TO_SOURCE_SQL_SERVER_SYNC] = rest_discriminator(name="taskType", visibility=["read", "create", "update", "delete", "query"])  # type: ignore
    """Task type. Required. ConnectToSource.SqlServer.Sync."""

    @overload
    def __init__(
        self,
        *,
        client_data: Optional[dict[str, str]] = None,
        input: Optional["_models.ConnectToSourceSqlServerTaskInput"] = None,
    ) -> None: ...

    @overload
    def __init__(self, mapping: Mapping[str, Any]) -> None:
        """
        :param 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.task_type = TaskType.CONNECT_TO_SOURCE_SQL_SERVER_SYNC  # type: ignore


class ConnectToSourceSqlServerTaskInput(_Model):
    """Input for the task that validates connection to SQL Server and also validates source server
    requirements.

    :ivar source_connection_info: Connection information for Source SQL Server. Required.
    :vartype source_connection_info: ~azure.mgmt.datamigration.models.SqlConnectionInfo
    :ivar check_permissions_group: Permission group for validations. Known values are: "Default",
     "MigrationFromSqlServerToAzureDB", "MigrationFromSqlServerToAzureMI",
     "MigrationFromMySQLToAzureDBForMySQL", and "MigrationFromSqlServerToAzureVM".
    :vartype check_permissions_group: str or
     ~azure.mgmt.datamigration.models.ServerLevelPermissionsGroup
    :ivar collect_databases: Flag for whether to collect databases from source server.
    :vartype collect_databases: bool
    :ivar collect_logins: Flag for whether to collect logins from source server.
    :vartype collect_logins: bool
    :ivar collect_agent_jobs: Flag for whether to collect agent jobs from source server.
    :vartype collect_agent_jobs: bool
    :ivar collect_tde_certificate_info: Flag for whether to collect TDE Certificate names from
     source server.
    :vartype collect_tde_certificate_info: bool
    :ivar validate_ssis_catalog_only: Flag for whether to validate SSIS catalog is reachable on the
     source server.
    :vartype validate_ssis_catalog_only: bool
    :ivar encrypted_key_for_secure_fields: encrypted key for secure fields.
    :vartype encrypted_key_for_secure_fields: str
    """

    source_connection_info: "_models.SqlConnectionInfo" = rest_field(
        name="sourceConnectionInfo", visibility=["read", "create", "update", "delete", "query"]
    )
    """Connection information for Source SQL Server. Required."""
    check_permissions_group: Optional[Union[str, "_models.ServerLevelPermissionsGroup"]] = rest_field(
        name="checkPermissionsGroup", visibility=["read", "create", "update", "delete", "query"]
    )
    """Permission group for validations. Known values are: \"Default\",
     \"MigrationFromSqlServerToAzureDB\", \"MigrationFromSqlServerToAzureMI\",
     \"MigrationFromMySQLToAzureDBForMySQL\", and \"MigrationFromSqlServerToAzureVM\"."""
    collect_databases: Optional[bool] = rest_field(
        name="collectDatabases", visibility=["read", "create", "update", "delete", "query"]
    )
    """Flag for whether to collect databases from source server."""
    collect_logins: Optional[bool] = rest_field(
        name="collectLogins", visibility=["read", "create", "update", "delete", "query"]
    )
    """Flag for whether to collect logins from source server."""
    collect_agent_jobs: Optional[bool] = rest_field(
        name="collectAgentJobs", visibility=["read", "create", "update", "delete", "query"]
    )
    """Flag for whether to collect agent jobs from source server."""
    collect_tde_certificate_info: Optional[bool] = rest_field(
        name="collectTdeCertificateInfo", visibility=["read", "create", "update", "delete", "query"]
    )
    """Flag for whether to collect TDE Certificate names from source server."""
    validate_ssis_catalog_only: Optional[bool] = rest_field(
        name="validateSsisCatalogOnly", visibility=["read", "create", "update", "delete", "query"]
    )
    """Flag for whether to validate SSIS catalog is reachable on the source server."""
    encrypted_key_for_secure_fields: Optional[str] = rest_field(
        name="encryptedKeyForSecureFields", visibility=["read", "create", "update", "delete", "query"]
    )
    """encrypted key for secure fields."""

    @overload
    def __init__(
        self,
        *,
        source_connection_info: "_models.SqlConnectionInfo",
        check_permissions_group: Optional[Union[str, "_models.ServerLevelPermissionsGroup"]] = None,
        collect_databases: Optional[bool] = None,
        collect_logins: Optional[bool] = None,
        collect_agent_jobs: Optional[bool] = None,
        collect_tde_certificate_info: Optional[bool] = None,
        validate_ssis_catalog_only: Optional[bool] = None,
        encrypted_key_for_secure_fields: 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 ConnectToSourceSqlServerTaskOutput(_Model):
    """Output for the task that validates connection to SQL Server and also validates source server
    requirements.

    You probably want to use the sub-classes and not this class directly. Known sub-classes are:
    ConnectToSourceSqlServerTaskOutputAgentJobLevel,
    ConnectToSourceSqlServerTaskOutputDatabaseLevel, ConnectToSourceSqlServerTaskOutputLoginLevel,
    ConnectToSourceSqlServerTaskOutputTaskLevel

    :ivar id: Result identifier.
    :vartype id: str
    :ivar result_type: Type of result - database level or task level. Required. Default value is
     None.
    :vartype result_type: str
    """

    __mapping__: dict[str, _Model] = {}
    id: Optional[str] = rest_field(visibility=["read"])
    """Result identifier."""
    result_type: str = rest_discriminator(name="resultType", visibility=["read", "create", "update", "delete", "query"])
    """Type of result - database level or task level. Required. Default value is None."""

    @overload
    def __init__(
        self,
        *,
        result_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 ConnectToSourceSqlServerTaskOutputAgentJobLevel(
    ConnectToSourceSqlServerTaskOutput, discriminator="AgentJobLevelOutput"
):  # pylint: disable=name-too-long
    """Agent Job level output for the task that validates connection to SQL Server and also validates
    source server requirements.

    :ivar id: Result identifier.
    :vartype id: str
    :ivar name: Agent Job name.
    :vartype name: str
    :ivar job_category: The type of Agent Job.
    :vartype job_category: str
    :ivar is_enabled: The state of the original Agent Job.
    :vartype is_enabled: bool
    :ivar job_owner: The owner of the Agent Job.
    :vartype job_owner: str
    :ivar last_executed_on: UTC Date and time when the Agent Job was last executed.
    :vartype last_executed_on: ~datetime.datetime
    :ivar validation_errors: Validation errors.
    :vartype validation_errors: list[~azure.mgmt.datamigration.models.ReportableException]
    :ivar migration_eligibility: Information about eligibility of agent job for migration.
    :vartype migration_eligibility: ~azure.mgmt.datamigration.models.MigrationEligibilityInfo
    :ivar result_type: Type of result - database level or task level. Required. Default value is
     "AgentJobLevelOutput".
    :vartype result_type: str
    """

    name: Optional[str] = rest_field(visibility=["read"])
    """Agent Job name."""
    job_category: Optional[str] = rest_field(name="jobCategory", visibility=["read"])
    """The type of Agent Job."""
    is_enabled: Optional[bool] = rest_field(name="isEnabled", visibility=["read"])
    """The state of the original Agent Job."""
    job_owner: Optional[str] = rest_field(name="jobOwner", visibility=["read"])
    """The owner of the Agent Job."""
    last_executed_on: Optional[datetime.datetime] = rest_field(
        name="lastExecutedOn", visibility=["read"], format="rfc3339"
    )
    """UTC Date and time when the Agent Job was last executed."""
    validation_errors: Optional[list["_models.ReportableException"]] = rest_field(
        name="validationErrors", visibility=["read"]
    )
    """Validation errors."""
    migration_eligibility: Optional["_models.MigrationEligibilityInfo"] = rest_field(
        name="migrationEligibility", visibility=["read"]
    )
    """Information about eligibility of agent job for migration."""
    result_type: Literal["AgentJobLevelOutput"] = rest_discriminator(name="resultType", visibility=["read", "create", "update", "delete", "query"])  # type: ignore
    """Type of result - database level or task level. Required. Default value is
     \"AgentJobLevelOutput\"."""

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

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

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


class ConnectToSourceSqlServerTaskOutputDatabaseLevel(
    ConnectToSourceSqlServerTaskOutput, discriminator="DatabaseLevelOutput"
):  # pylint: disable=name-too-long
    """Database level output for the task that validates connection to SQL Server and also validates
    source server requirements.

    :ivar id: Result identifier.
    :vartype id: str
    :ivar name: Database name.
    :vartype name: str
    :ivar size_mb: Size of the file in megabytes.
    :vartype size_mb: float
    :ivar database_files: The list of database files.
    :vartype database_files: list[~azure.mgmt.datamigration.models.DatabaseFileInfo]
    :ivar compatibility_level: SQL Server compatibility level of database. Known values are:
     "CompatLevel80", "CompatLevel90", "CompatLevel100", "CompatLevel110", "CompatLevel120",
     "CompatLevel130", and "CompatLevel140".
    :vartype compatibility_level: str or ~azure.mgmt.datamigration.models.DatabaseCompatLevel
    :ivar database_state: State of the database. Known values are: "Online", "Restoring",
     "Recovering", "RecoveryPending", "Suspect", "Emergency", "Offline", "Copying", and
     "OfflineSecondary".
    :vartype database_state: str or ~azure.mgmt.datamigration.models.DatabaseState
    :ivar result_type: Type of result - database level or task level. Required. Default value is
     "DatabaseLevelOutput".
    :vartype result_type: str
    """

    name: Optional[str] = rest_field(visibility=["read"])
    """Database name."""
    size_mb: Optional[float] = rest_field(name="sizeMB", visibility=["read"])
    """Size of the file in megabytes."""
    database_files: Optional[list["_models.DatabaseFileInfo"]] = rest_field(name="databaseFiles", visibility=["read"])
    """The list of database files."""
    compatibility_level: Optional[Union[str, "_models.DatabaseCompatLevel"]] = rest_field(
        name="compatibilityLevel", visibility=["read"]
    )
    """SQL Server compatibility level of database. Known values are: \"CompatLevel80\",
     \"CompatLevel90\", \"CompatLevel100\", \"CompatLevel110\", \"CompatLevel120\",
     \"CompatLevel130\", and \"CompatLevel140\"."""
    database_state: Optional[Union[str, "_models.DatabaseState"]] = rest_field(
        name="databaseState", visibility=["read"]
    )
    """State of the database. Known values are: \"Online\", \"Restoring\", \"Recovering\",
     \"RecoveryPending\", \"Suspect\", \"Emergency\", \"Offline\", \"Copying\", and
     \"OfflineSecondary\"."""
    result_type: Literal["DatabaseLevelOutput"] = rest_discriminator(name="resultType", visibility=["read", "create", "update", "delete", "query"])  # type: ignore
    """Type of result - database level or task level. Required. Default value is
     \"DatabaseLevelOutput\"."""

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

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

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


class ConnectToSourceSqlServerTaskOutputLoginLevel(
    ConnectToSourceSqlServerTaskOutput, discriminator="LoginLevelOutput"
):  # pylint: disable=name-too-long
    """Login level output for the task that validates connection to SQL Server and also validates
    source server requirements.

    :ivar id: Result identifier.
    :vartype id: str
    :ivar name: Login name.
    :vartype name: str
    :ivar login_type: The type of login. Known values are: "WindowsUser", "WindowsGroup",
     "SqlLogin", "Certificate", "AsymmetricKey", "ExternalUser", and "ExternalGroup".
    :vartype login_type: str or ~azure.mgmt.datamigration.models.LoginType
    :ivar default_database: The default database for the login.
    :vartype default_database: str
    :ivar is_enabled: The state of the login.
    :vartype is_enabled: bool
    :ivar migration_eligibility: Information about eligibility of login for migration.
    :vartype migration_eligibility: ~azure.mgmt.datamigration.models.MigrationEligibilityInfo
    :ivar result_type: Type of result - database level or task level. Required. Default value is
     "LoginLevelOutput".
    :vartype result_type: str
    """

    name: Optional[str] = rest_field(visibility=["read"])
    """Login name."""
    login_type: Optional[Union[str, "_models.LoginType"]] = rest_field(name="loginType", visibility=["read"])
    """The type of login. Known values are: \"WindowsUser\", \"WindowsGroup\", \"SqlLogin\",
     \"Certificate\", \"AsymmetricKey\", \"ExternalUser\", and \"ExternalGroup\"."""
    default_database: Optional[str] = rest_field(name="defaultDatabase", visibility=["read"])
    """The default database for the login."""
    is_enabled: Optional[bool] = rest_field(name="isEnabled", visibility=["read"])
    """The state of the login."""
    migration_eligibility: Optional["_models.MigrationEligibilityInfo"] = rest_field(
        name="migrationEligibility", visibility=["read"]
    )
    """Information about eligibility of login for migration."""
    result_type: Literal["LoginLevelOutput"] = rest_discriminator(name="resultType", visibility=["read", "create", "update", "delete", "query"])  # type: ignore
    """Type of result - database level or task level. Required. Default value is \"LoginLevelOutput\"."""

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

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

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


class ConnectToSourceSqlServerTaskOutputTaskLevel(
    ConnectToSourceSqlServerTaskOutput, discriminator="TaskLevelOutput"
):  # pylint: disable=name-too-long
    """Task level output for the task that validates connection to SQL Server and also validates
    source server requirements.

    :ivar id: Result identifier.
    :vartype id: str
    :ivar databases: Source databases as a map from database name to database id.
    :vartype databases: str
    :ivar logins: Source logins as a map from login name to login id.
    :vartype logins: str
    :ivar agent_jobs: Source agent jobs as a map from agent job name to id.
    :vartype agent_jobs: str
    :ivar database_tde_certificate_mapping: Mapping from database name to TDE certificate name, if
     applicable.
    :vartype database_tde_certificate_mapping: str
    :ivar source_server_version: Source server version.
    :vartype source_server_version: str
    :ivar source_server_brand_version: Source server brand version.
    :vartype source_server_brand_version: str
    :ivar validation_errors: Validation errors.
    :vartype validation_errors: list[~azure.mgmt.datamigration.models.ReportableException]
    :ivar result_type: Type of result - database level or task level. Required. Default value is
     "TaskLevelOutput".
    :vartype result_type: str
    """

    databases: Optional[str] = rest_field(visibility=["read"])
    """Source databases as a map from database name to database id."""
    logins: Optional[str] = rest_field(visibility=["read"])
    """Source logins as a map from login name to login id."""
    agent_jobs: Optional[str] = rest_field(name="agentJobs", visibility=["read"])
    """Source agent jobs as a map from agent job name to id."""
    database_tde_certificate_mapping: Optional[str] = rest_field(
        name="databaseTdeCertificateMapping", visibility=["read"]
    )
    """Mapping from database name to TDE certificate name, if applicable."""
    source_server_version: Optional[str] = rest_field(name="sourceServerVersion", visibility=["read"])
    """Source server version."""
    source_server_brand_version: Optional[str] = rest_field(name="sourceServerBrandVersion", visibility=["read"])
    """Source server brand version."""
    validation_errors: Optional[list["_models.ReportableException"]] = rest_field(
        name="validationErrors", visibility=["read"]
    )
    """Validation errors."""
    result_type: Literal["TaskLevelOutput"] = rest_discriminator(name="resultType", visibility=["read", "create", "update", "delete", "query"])  # type: ignore
    """Type of result - database level or task level. Required. Default value is \"TaskLevelOutput\"."""

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

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

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


class ConnectToSourceSqlServerTaskProperties(ProjectTaskProperties, discriminator="ConnectToSource.SqlServer"):
    """Properties for the task that validates connection to SQL Server and also validates source
    server requirements.

    :ivar errors: Array of errors. This is ignored if submitted.
    :vartype errors: list[~azure.mgmt.datamigration.models.ODataError]
    :ivar state: The state of the task. This is ignored if submitted. Known values are: "Unknown",
     "Queued", "Running", "Canceled", "Succeeded", "Failed", "FailedInputValidation", and "Faulted".
    :vartype state: str or ~azure.mgmt.datamigration.models.TaskState
    :ivar commands: Array of command properties.
    :vartype commands: list[~azure.mgmt.datamigration.models.CommandProperties]
    :ivar client_data: Key value pairs of client data to attach meta data information to task.
    :vartype client_data: dict[str, str]
    :ivar input: Task input.
    :vartype input: ~azure.mgmt.datamigration.models.ConnectToSourceSqlServerTaskInput
    :ivar output: Task output. This is ignored if submitted.
    :vartype output: list[~azure.mgmt.datamigration.models.ConnectToSourceSqlServerTaskOutput]
    :ivar task_id: Task id.
    :vartype task_id: str
    :ivar task_type: Task type. Required. ConnectToSource.SqlServer.
    :vartype task_type: str or ~azure.mgmt.datamigration.models.CONNECT_TO_SOURCE_SQL_SERVER
    """

    input: Optional["_models.ConnectToSourceSqlServerTaskInput"] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """Task input."""
    output: Optional[list["_models.ConnectToSourceSqlServerTaskOutput"]] = rest_field(visibility=["read"])
    """Task output. This is ignored if submitted."""
    task_id: Optional[str] = rest_field(name="taskId", visibility=["read", "create", "update", "delete", "query"])
    """Task id."""
    task_type: Literal[TaskType.CONNECT_TO_SOURCE_SQL_SERVER] = rest_discriminator(name="taskType", visibility=["read", "create", "update", "delete", "query"])  # type: ignore
    """Task type. Required. ConnectToSource.SqlServer."""

    @overload
    def __init__(
        self,
        *,
        client_data: Optional[dict[str, str]] = None,
        input: Optional["_models.ConnectToSourceSqlServerTaskInput"] = None,
        task_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)
        self.task_type = TaskType.CONNECT_TO_SOURCE_SQL_SERVER  # type: ignore


class ConnectToTargetAzureDbForMySqlTaskInput(_Model):
    """Input for the task that validates connection to Azure Database for MySQL and target server
    requirements.

    :ivar source_connection_info: Connection information for source MySQL server. Required.
    :vartype source_connection_info: ~azure.mgmt.datamigration.models.MySqlConnectionInfo
    :ivar target_connection_info: Connection information for target Azure Database for MySQL
     server. Required.
    :vartype target_connection_info: ~azure.mgmt.datamigration.models.MySqlConnectionInfo
    :ivar is_offline_migration: Flag for whether or not the migration is offline.
    :vartype is_offline_migration: bool
    """

    source_connection_info: "_models.MySqlConnectionInfo" = rest_field(
        name="sourceConnectionInfo", visibility=["read", "create", "update", "delete", "query"]
    )
    """Connection information for source MySQL server. Required."""
    target_connection_info: "_models.MySqlConnectionInfo" = rest_field(
        name="targetConnectionInfo", visibility=["read", "create", "update", "delete", "query"]
    )
    """Connection information for target Azure Database for MySQL server. Required."""
    is_offline_migration: Optional[bool] = rest_field(
        name="isOfflineMigration", visibility=["read", "create", "update", "delete", "query"]
    )
    """Flag for whether or not the migration is offline."""

    @overload
    def __init__(
        self,
        *,
        source_connection_info: "_models.MySqlConnectionInfo",
        target_connection_info: "_models.MySqlConnectionInfo",
        is_offline_migration: Optional[bool] = None,
    ) -> None: ...

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

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


class ConnectToTargetAzureDbForMySqlTaskOutput(_Model):
    """Output for the task that validates connection to Azure Database for MySQL and target server
    requirements.

    :ivar id: Result identifier.
    :vartype id: str
    :ivar server_version: Version of the target server.
    :vartype server_version: str
    :ivar databases: List of databases on target server.
    :vartype databases: list[str]
    :ivar target_server_brand_version: Target server brand version.
    :vartype target_server_brand_version: str
    :ivar validation_errors: Validation errors associated with the task.
    :vartype validation_errors: list[~azure.mgmt.datamigration.models.ReportableException]
    """

    id: Optional[str] = rest_field(visibility=["read"])
    """Result identifier."""
    server_version: Optional[str] = rest_field(name="serverVersion", visibility=["read"])
    """Version of the target server."""
    databases: Optional[list[str]] = rest_field(visibility=["read"])
    """List of databases on target server."""
    target_server_brand_version: Optional[str] = rest_field(name="targetServerBrandVersion", visibility=["read"])
    """Target server brand version."""
    validation_errors: Optional[list["_models.ReportableException"]] = rest_field(
        name="validationErrors", visibility=["read"]
    )
    """Validation errors associated with the task."""


class ConnectToTargetAzureDbForMySqlTaskProperties(
    ProjectTaskProperties, discriminator="ConnectToTarget.AzureDbForMySql"
):  # pylint: disable=name-too-long
    """Properties for the task that validates connection to Azure Database for MySQL and target server
    requirements.

    :ivar errors: Array of errors. This is ignored if submitted.
    :vartype errors: list[~azure.mgmt.datamigration.models.ODataError]
    :ivar state: The state of the task. This is ignored if submitted. Known values are: "Unknown",
     "Queued", "Running", "Canceled", "Succeeded", "Failed", "FailedInputValidation", and "Faulted".
    :vartype state: str or ~azure.mgmt.datamigration.models.TaskState
    :ivar commands: Array of command properties.
    :vartype commands: list[~azure.mgmt.datamigration.models.CommandProperties]
    :ivar client_data: Key value pairs of client data to attach meta data information to task.
    :vartype client_data: dict[str, str]
    :ivar input: Task input.
    :vartype input: ~azure.mgmt.datamigration.models.ConnectToTargetAzureDbForMySqlTaskInput
    :ivar output: Task output. This is ignored if submitted.
    :vartype output:
     list[~azure.mgmt.datamigration.models.ConnectToTargetAzureDbForMySqlTaskOutput]
    :ivar task_type: Task type. Required. ConnectToTarget.AzureDbForMySql.
    :vartype task_type: str or
     ~azure.mgmt.datamigration.models.CONNECT_TO_TARGET_AZURE_DB_FOR_MY_SQL
    """

    input: Optional["_models.ConnectToTargetAzureDbForMySqlTaskInput"] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """Task input."""
    output: Optional[list["_models.ConnectToTargetAzureDbForMySqlTaskOutput"]] = rest_field(visibility=["read"])
    """Task output. This is ignored if submitted."""
    task_type: Literal[TaskType.CONNECT_TO_TARGET_AZURE_DB_FOR_MY_SQL] = rest_discriminator(name="taskType", visibility=["read", "create", "update", "delete", "query"])  # type: ignore
    """Task type. Required. ConnectToTarget.AzureDbForMySql."""

    @overload
    def __init__(
        self,
        *,
        client_data: Optional[dict[str, str]] = None,
        input: Optional["_models.ConnectToTargetAzureDbForMySqlTaskInput"] = None,
    ) -> None: ...

    @overload
    def __init__(self, mapping: Mapping[str, Any]) -> None:
        """
        :param 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.task_type = TaskType.CONNECT_TO_TARGET_AZURE_DB_FOR_MY_SQL  # type: ignore


class ConnectToTargetAzureDbForPostgreSqlSyncTaskInput(_Model):  # pylint: disable=name-too-long
    """Input for the task that validates connection to Azure Database for PostgreSQL and target server
    requirements.

    :ivar source_connection_info: Connection information for source PostgreSQL server. Required.
    :vartype source_connection_info: ~azure.mgmt.datamigration.models.PostgreSqlConnectionInfo
    :ivar target_connection_info: Connection information for target Azure Database for PostgreSQL
     server. Required.
    :vartype target_connection_info: ~azure.mgmt.datamigration.models.PostgreSqlConnectionInfo
    """

    source_connection_info: "_models.PostgreSqlConnectionInfo" = rest_field(
        name="sourceConnectionInfo", visibility=["read", "create", "update", "delete", "query"]
    )
    """Connection information for source PostgreSQL server. Required."""
    target_connection_info: "_models.PostgreSqlConnectionInfo" = rest_field(
        name="targetConnectionInfo", visibility=["read", "create", "update", "delete", "query"]
    )
    """Connection information for target Azure Database for PostgreSQL server. Required."""

    @overload
    def __init__(
        self,
        *,
        source_connection_info: "_models.PostgreSqlConnectionInfo",
        target_connection_info: "_models.PostgreSqlConnectionInfo",
    ) -> None: ...

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

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


class ConnectToTargetAzureDbForPostgreSqlSyncTaskOutput(_Model):  # pylint: disable=name-too-long
    """Output for the task that validates connection to Azure Database for PostgreSQL and target
    server requirements.

    :ivar id: Result identifier.
    :vartype id: str
    :ivar target_server_version: Version of the target server.
    :vartype target_server_version: str
    :ivar databases: List of databases on target server.
    :vartype databases: list[str]
    :ivar target_server_brand_version: Target server brand version.
    :vartype target_server_brand_version: str
    :ivar validation_errors: Validation errors associated with the task.
    :vartype validation_errors: list[~azure.mgmt.datamigration.models.ReportableException]
    """

    id: Optional[str] = rest_field(visibility=["read"])
    """Result identifier."""
    target_server_version: Optional[str] = rest_field(name="targetServerVersion", visibility=["read"])
    """Version of the target server."""
    databases: Optional[list[str]] = rest_field(visibility=["read"])
    """List of databases on target server."""
    target_server_brand_version: Optional[str] = rest_field(name="targetServerBrandVersion", visibility=["read"])
    """Target server brand version."""
    validation_errors: Optional[list["_models.ReportableException"]] = rest_field(
        name="validationErrors", visibility=["read"]
    )
    """Validation errors associated with the task."""


class ConnectToTargetAzureDbForPostgreSqlSyncTaskProperties(
    ProjectTaskProperties, discriminator="ConnectToTarget.AzureDbForPostgreSql.Sync"
):  # pylint: disable=name-too-long
    """Properties for the task that validates connection to Azure Database For PostgreSQL server and
    target server requirements for online migration.

    :ivar errors: Array of errors. This is ignored if submitted.
    :vartype errors: list[~azure.mgmt.datamigration.models.ODataError]
    :ivar state: The state of the task. This is ignored if submitted. Known values are: "Unknown",
     "Queued", "Running", "Canceled", "Succeeded", "Failed", "FailedInputValidation", and "Faulted".
    :vartype state: str or ~azure.mgmt.datamigration.models.TaskState
    :ivar commands: Array of command properties.
    :vartype commands: list[~azure.mgmt.datamigration.models.CommandProperties]
    :ivar client_data: Key value pairs of client data to attach meta data information to task.
    :vartype client_data: dict[str, str]
    :ivar input: Task input.
    :vartype input:
     ~azure.mgmt.datamigration.models.ConnectToTargetAzureDbForPostgreSqlSyncTaskInput
    :ivar output: Task output. This is ignored if submitted.
    :vartype output:
     list[~azure.mgmt.datamigration.models.ConnectToTargetAzureDbForPostgreSqlSyncTaskOutput]
    :ivar task_type: Task type. Required. ConnectToTarget.AzureDbForPostgreSql.Sync.
    :vartype task_type: str or
     ~azure.mgmt.datamigration.models.CONNECT_TO_TARGET_AZURE_DB_FOR_POSTGRE_SQL_SYNC
    """

    input: Optional["_models.ConnectToTargetAzureDbForPostgreSqlSyncTaskInput"] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """Task input."""
    output: Optional[list["_models.ConnectToTargetAzureDbForPostgreSqlSyncTaskOutput"]] = rest_field(
        visibility=["read"]
    )
    """Task output. This is ignored if submitted."""
    task_type: Literal[TaskType.CONNECT_TO_TARGET_AZURE_DB_FOR_POSTGRE_SQL_SYNC] = rest_discriminator(name="taskType", visibility=["read", "create", "update", "delete", "query"])  # type: ignore
    """Task type. Required. ConnectToTarget.AzureDbForPostgreSql.Sync."""

    @overload
    def __init__(
        self,
        *,
        client_data: Optional[dict[str, str]] = None,
        input: Optional["_models.ConnectToTargetAzureDbForPostgreSqlSyncTaskInput"] = None,
    ) -> None: ...

    @overload
    def __init__(self, mapping: Mapping[str, Any]) -> None:
        """
        :param 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.task_type = TaskType.CONNECT_TO_TARGET_AZURE_DB_FOR_POSTGRE_SQL_SYNC  # type: ignore


class ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskInput(_Model):  # pylint: disable=name-too-long
    """Input for the task that validates connection to Azure Database for PostgreSQL and target server
    requirements for Oracle source.

    :ivar target_connection_info: Connection information for target Azure Database for PostgreSQL
     server. Required.
    :vartype target_connection_info: ~azure.mgmt.datamigration.models.PostgreSqlConnectionInfo
    """

    target_connection_info: "_models.PostgreSqlConnectionInfo" = rest_field(
        name="targetConnectionInfo", visibility=["read", "create", "update", "delete", "query"]
    )
    """Connection information for target Azure Database for PostgreSQL server. Required."""

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

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

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


class ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskOutput(_Model):  # pylint: disable=name-too-long
    """Output for the task that validates connection to Azure Database for PostgreSQL and target
    server requirements for Oracle source.

    :ivar target_server_version: Version of the target server.
    :vartype target_server_version: str
    :ivar databases: List of databases on target server.
    :vartype databases: list[str]
    :ivar target_server_brand_version: Target server brand version.
    :vartype target_server_brand_version: str
    :ivar validation_errors: Validation errors associated with the task.
    :vartype validation_errors: list[~azure.mgmt.datamigration.models.ReportableException]
    :ivar database_schema_map: Mapping of schemas per database.
    :vartype database_schema_map:
     list[~azure.mgmt.datamigration.models.ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskOutputDatabaseSchemaMapItem]
    """

    target_server_version: Optional[str] = rest_field(name="targetServerVersion", visibility=["read"])
    """Version of the target server."""
    databases: Optional[list[str]] = rest_field(visibility=["read"])
    """List of databases on target server."""
    target_server_brand_version: Optional[str] = rest_field(name="targetServerBrandVersion", visibility=["read"])
    """Target server brand version."""
    validation_errors: Optional[list["_models.ReportableException"]] = rest_field(
        name="validationErrors", visibility=["read"]
    )
    """Validation errors associated with the task."""
    database_schema_map: Optional[
        list["_models.ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskOutputDatabaseSchemaMapItem"]
    ] = rest_field(name="databaseSchemaMap", visibility=["read", "create", "update", "delete", "query"])
    """Mapping of schemas per database."""

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

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

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


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

    :ivar database:
    :vartype database: str
    :ivar schemas:
    :vartype schemas: list[str]
    """

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

    @overload
    def __init__(
        self,
        *,
        database: Optional[str] = None,
        schemas: 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 ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskProperties(
    ProjectTaskProperties, discriminator="ConnectToTarget.Oracle.AzureDbForPostgreSql.Sync"
):  # pylint: disable=name-too-long
    """Properties for the task that validates connection to Azure Database For PostgreSQL server and
    target server requirements for online migration for Oracle source.

    :ivar errors: Array of errors. This is ignored if submitted.
    :vartype errors: list[~azure.mgmt.datamigration.models.ODataError]
    :ivar state: The state of the task. This is ignored if submitted. Known values are: "Unknown",
     "Queued", "Running", "Canceled", "Succeeded", "Failed", "FailedInputValidation", and "Faulted".
    :vartype state: str or ~azure.mgmt.datamigration.models.TaskState
    :ivar commands: Array of command properties.
    :vartype commands: list[~azure.mgmt.datamigration.models.CommandProperties]
    :ivar client_data: Key value pairs of client data to attach meta data information to task.
    :vartype client_data: dict[str, str]
    :ivar input: Task input.
    :vartype input:
     ~azure.mgmt.datamigration.models.ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskInput
    :ivar output: Task output. This is ignored if submitted.
    :vartype output:
     list[~azure.mgmt.datamigration.models.ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskOutput]
    :ivar task_type: Task type. Required. ConnectToTarget.Oracle.AzureDbForPostgreSql.Sync.
    :vartype task_type: str or
     ~azure.mgmt.datamigration.models.CONNECT_TO_TARGET_ORACLE_AZURE_DB_FOR_POSTGRE_SQL_SYNC
    """

    input: Optional["_models.ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskInput"] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """Task input."""
    output: Optional[list["_models.ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskOutput"]] = rest_field(
        visibility=["read"]
    )
    """Task output. This is ignored if submitted."""
    task_type: Literal[TaskType.CONNECT_TO_TARGET_ORACLE_AZURE_DB_FOR_POSTGRE_SQL_SYNC] = rest_discriminator(name="taskType", visibility=["read", "create", "update", "delete", "query"])  # type: ignore
    """Task type. Required. ConnectToTarget.Oracle.AzureDbForPostgreSql.Sync."""

    @overload
    def __init__(
        self,
        *,
        client_data: Optional[dict[str, str]] = None,
        input: Optional["_models.ConnectToTargetOracleAzureDbForPostgreSqlSyncTaskInput"] = None,
    ) -> None: ...

    @overload
    def __init__(self, mapping: Mapping[str, Any]) -> None:
        """
        :param 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.task_type = TaskType.CONNECT_TO_TARGET_ORACLE_AZURE_DB_FOR_POSTGRE_SQL_SYNC  # type: ignore


class ConnectToTargetSqlDbSyncTaskInput(_Model):
    """Input for the task that validates connection to Azure SQL DB and target server requirements.

    :ivar source_connection_info: Connection information for source SQL Server. Required.
    :vartype source_connection_info: ~azure.mgmt.datamigration.models.SqlConnectionInfo
    :ivar target_connection_info: Connection information for target SQL DB. Required.
    :vartype target_connection_info: ~azure.mgmt.datamigration.models.SqlConnectionInfo
    """

    source_connection_info: "_models.SqlConnectionInfo" = rest_field(
        name="sourceConnectionInfo", visibility=["read", "create", "update", "delete", "query"]
    )
    """Connection information for source SQL Server. Required."""
    target_connection_info: "_models.SqlConnectionInfo" = rest_field(
        name="targetConnectionInfo", visibility=["read", "create", "update", "delete", "query"]
    )
    """Connection information for target SQL DB. Required."""

    @overload
    def __init__(
        self,
        *,
        source_connection_info: "_models.SqlConnectionInfo",
        target_connection_info: "_models.SqlConnectionInfo",
    ) -> None: ...

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

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


class ConnectToTargetSqlDbSyncTaskProperties(ProjectTaskProperties, discriminator="ConnectToTarget.SqlDb.Sync"):
    """Properties for the task that validates connection to SQL DB and target server requirements for
    online migration.

    :ivar errors: Array of errors. This is ignored if submitted.
    :vartype errors: list[~azure.mgmt.datamigration.models.ODataError]
    :ivar state: The state of the task. This is ignored if submitted. Known values are: "Unknown",
     "Queued", "Running", "Canceled", "Succeeded", "Failed", "FailedInputValidation", and "Faulted".
    :vartype state: str or ~azure.mgmt.datamigration.models.TaskState
    :ivar commands: Array of command properties.
    :vartype commands: list[~azure.mgmt.datamigration.models.CommandProperties]
    :ivar client_data: Key value pairs of client data to attach meta data information to task.
    :vartype client_data: dict[str, str]
    :ivar input: Task input.
    :vartype input: ~azure.mgmt.datamigration.models.ConnectToTargetSqlDbSyncTaskInput
    :ivar output: Task output. This is ignored if submitted.
    :vartype output: list[~azure.mgmt.datamigration.models.ConnectToTargetSqlDbTaskOutput]
    :ivar task_type: Task type. Required. ConnectToTarget.SqlDb.Sync.
    :vartype task_type: str or ~azure.mgmt.datamigration.models.CONNECT_TO_TARGET_SQL_DB_SYNC
    """

    input: Optional["_models.ConnectToTargetSqlDbSyncTaskInput"] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """Task input."""
    output: Optional[list["_models.ConnectToTargetSqlDbTaskOutput"]] = rest_field(visibility=["read"])
    """Task output. This is ignored if submitted."""
    task_type: Literal[TaskType.CONNECT_TO_TARGET_SQL_DB_SYNC] = rest_discriminator(name="taskType", visibility=["read", "create", "update", "delete", "query"])  # type: ignore
    """Task type. Required. ConnectToTarget.SqlDb.Sync."""

    @overload
    def __init__(
        self,
        *,
        client_data: Optional[dict[str, str]] = None,
        input: Optional["_models.ConnectToTargetSqlDbSyncTaskInput"] = None,
    ) -> None: ...

    @overload
    def __init__(self, mapping: Mapping[str, Any]) -> None:
        """
        :param 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.task_type = TaskType.CONNECT_TO_TARGET_SQL_DB_SYNC  # type: ignore


class ConnectToTargetSqlDbTaskInput(_Model):
    """Input for the task that validates connection to SQL DB and target server requirements.

    :ivar target_connection_info: Connection information for target SQL DB. Required.
    :vartype target_connection_info: ~azure.mgmt.datamigration.models.SqlConnectionInfo
    :ivar query_object_counts: Boolean flag indicating whether to query object counts for each
     database on the target server.
    :vartype query_object_counts: bool
    """

    target_connection_info: "_models.SqlConnectionInfo" = rest_field(
        name="targetConnectionInfo", visibility=["read", "create", "update", "delete", "query"]
    )
    """Connection information for target SQL DB. Required."""
    query_object_counts: Optional[bool] = rest_field(
        name="queryObjectCounts", visibility=["read", "create", "update", "delete", "query"]
    )
    """Boolean flag indicating whether to query object counts for each database on the target server."""

    @overload
    def __init__(
        self,
        *,
        target_connection_info: "_models.SqlConnectionInfo",
        query_object_counts: Optional[bool] = None,
    ) -> None: ...

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

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


class ConnectToTargetSqlDbTaskOutput(_Model):
    """Output for the task that validates connection to SQL DB and target server requirements.

    :ivar id: Result identifier.
    :vartype id: str
    :ivar databases: Source databases as a map from database name to database id.
    :vartype databases: str
    :ivar target_server_version: Version of the target server.
    :vartype target_server_version: str
    :ivar target_server_brand_version: Target server brand version.
    :vartype target_server_brand_version: str
    """

    id: Optional[str] = rest_field(visibility=["read"])
    """Result identifier."""
    databases: Optional[str] = rest_field(visibility=["read"])
    """Source databases as a map from database name to database id."""
    target_server_version: Optional[str] = rest_field(name="targetServerVersion", visibility=["read"])
    """Version of the target server."""
    target_server_brand_version: Optional[str] = rest_field(name="targetServerBrandVersion", visibility=["read"])
    """Target server brand version."""


class ConnectToTargetSqlDbTaskProperties(ProjectTaskProperties, discriminator="ConnectToTarget.SqlDb"):
    """Properties for the task that validates connection to SQL DB and target server requirements.

    :ivar errors: Array of errors. This is ignored if submitted.
    :vartype errors: list[~azure.mgmt.datamigration.models.ODataError]
    :ivar state: The state of the task. This is ignored if submitted. Known values are: "Unknown",
     "Queued", "Running", "Canceled", "Succeeded", "Failed", "FailedInputValidation", and "Faulted".
    :vartype state: str or ~azure.mgmt.datamigration.models.TaskState
    :ivar commands: Array of command properties.
    :vartype commands: list[~azure.mgmt.datamigration.models.CommandProperties]
    :ivar client_data: Key value pairs of client data to attach meta data information to task.
    :vartype client_data: dict[str, str]
    :ivar input: Task input.
    :vartype input: ~azure.mgmt.datamigration.models.ConnectToTargetSqlDbTaskInput
    :ivar output: Task output. This is ignored if submitted.
    :vartype output: list[~azure.mgmt.datamigration.models.ConnectToTargetSqlDbTaskOutput]
    :ivar created_on: DateTime in UTC when the task was created.
    :vartype created_on: str
    :ivar task_type: Task type. Required. ConnectToTarget.SqlDb.
    :vartype task_type: str or ~azure.mgmt.datamigration.models.CONNECT_TO_TARGET_SQL_DB
    """

    input: Optional["_models.ConnectToTargetSqlDbTaskInput"] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """Task input."""
    output: Optional[list["_models.ConnectToTargetSqlDbTaskOutput"]] = rest_field(visibility=["read"])
    """Task output. This is ignored if submitted."""
    created_on: Optional[str] = rest_field(name="createdOn", visibility=["read", "create", "update", "delete", "query"])
    """DateTime in UTC when the task was created."""
    task_type: Literal[TaskType.CONNECT_TO_TARGET_SQL_DB] = rest_discriminator(name="taskType", visibility=["read", "create", "update", "delete", "query"])  # type: ignore
    """Task type. Required. ConnectToTarget.SqlDb."""

    @overload
    def __init__(
        self,
        *,
        client_data: Optional[dict[str, str]] = None,
        input: Optional["_models.ConnectToTargetSqlDbTaskInput"] = None,
        created_on: 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.task_type = TaskType.CONNECT_TO_TARGET_SQL_DB  # type: ignore


class ConnectToTargetSqlMISyncTaskInput(_Model):
    """Input for the task that validates connection to Azure SQL Database Managed Instance online
    scenario.

    :ivar target_connection_info: Connection information for Azure SQL Database Managed Instance.
     Required.
    :vartype target_connection_info: ~azure.mgmt.datamigration.models.MiSqlConnectionInfo
    :ivar azure_app: Azure Active Directory Application the DMS (classic) instance will use to
     connect to the target instance of Azure SQL Database Managed Instance and the Azure Storage
     Account. Required.
    :vartype azure_app: ~azure.mgmt.datamigration.models.AzureActiveDirectoryApp
    """

    target_connection_info: "_models.MiSqlConnectionInfo" = rest_field(
        name="targetConnectionInfo", visibility=["read", "create", "update", "delete", "query"]
    )
    """Connection information for Azure SQL Database Managed Instance. Required."""
    azure_app: "_models.AzureActiveDirectoryApp" = rest_field(
        name="azureApp", visibility=["read", "create", "update", "delete", "query"]
    )
    """Azure Active Directory Application the DMS (classic) instance will use to connect to the target
     instance of Azure SQL Database Managed Instance and the Azure Storage Account. Required."""

    @overload
    def __init__(
        self,
        *,
        target_connection_info: "_models.MiSqlConnectionInfo",
        azure_app: "_models.AzureActiveDirectoryApp",
    ) -> None: ...

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

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


class ConnectToTargetSqlMISyncTaskOutput(_Model):
    """Output for the task that validates connection to Azure SQL Database Managed Instance.

    :ivar target_server_version: Target server version.
    :vartype target_server_version: str
    :ivar target_server_brand_version: Target server brand version.
    :vartype target_server_brand_version: str
    :ivar validation_errors: Validation errors.
    :vartype validation_errors: list[~azure.mgmt.datamigration.models.ReportableException]
    """

    target_server_version: Optional[str] = rest_field(name="targetServerVersion", visibility=["read"])
    """Target server version."""
    target_server_brand_version: Optional[str] = rest_field(name="targetServerBrandVersion", visibility=["read"])
    """Target server brand version."""
    validation_errors: Optional[list["_models.ReportableException"]] = rest_field(
        name="validationErrors", visibility=["read"]
    )
    """Validation errors."""


class ConnectToTargetSqlMISyncTaskProperties(
    ProjectTaskProperties, discriminator="ConnectToTarget.AzureSqlDbMI.Sync.LRS"
):
    """Properties for the task that validates connection to Azure SQL Database Managed Instance.

    :ivar errors: Array of errors. This is ignored if submitted.
    :vartype errors: list[~azure.mgmt.datamigration.models.ODataError]
    :ivar state: The state of the task. This is ignored if submitted. Known values are: "Unknown",
     "Queued", "Running", "Canceled", "Succeeded", "Failed", "FailedInputValidation", and "Faulted".
    :vartype state: str or ~azure.mgmt.datamigration.models.TaskState
    :ivar commands: Array of command properties.
    :vartype commands: list[~azure.mgmt.datamigration.models.CommandProperties]
    :ivar client_data: Key value pairs of client data to attach meta data information to task.
    :vartype client_data: dict[str, str]
    :ivar input: Task input.
    :vartype input: ~azure.mgmt.datamigration.models.ConnectToTargetSqlMISyncTaskInput
    :ivar output: Task output. This is ignored if submitted.
    :vartype output: list[~azure.mgmt.datamigration.models.ConnectToTargetSqlMISyncTaskOutput]
    :ivar task_type: Task type. Required. ConnectToTarget.AzureSqlDbMI.Sync.LRS.
    :vartype task_type: str or
     ~azure.mgmt.datamigration.models.CONNECT_TO_TARGET_AZURE_SQL_DB_MI_SYNC_LRS
    """

    input: Optional["_models.ConnectToTargetSqlMISyncTaskInput"] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """Task input."""
    output: Optional[list["_models.ConnectToTargetSqlMISyncTaskOutput"]] = rest_field(visibility=["read"])
    """Task output. This is ignored if submitted."""
    task_type: Literal[TaskType.CONNECT_TO_TARGET_AZURE_SQL_DB_MI_SYNC_LRS] = rest_discriminator(name="taskType", visibility=["read", "create", "update", "delete", "query"])  # type: ignore
    """Task type. Required. ConnectToTarget.AzureSqlDbMI.Sync.LRS."""

    @overload
    def __init__(
        self,
        *,
        client_data: Optional[dict[str, str]] = None,
        input: Optional["_models.ConnectToTargetSqlMISyncTaskInput"] = None,
    ) -> None: ...

    @overload
    def __init__(self, mapping: Mapping[str, Any]) -> None:
        """
        :param 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.task_type = TaskType.CONNECT_TO_TARGET_AZURE_SQL_DB_MI_SYNC_LRS  # type: ignore


class ConnectToTargetSqlMITaskInput(_Model):
    """Input for the task that validates connection to Azure SQL Database Managed Instance.

    :ivar target_connection_info: Connection information for target SQL Server. Required.
    :vartype target_connection_info: ~azure.mgmt.datamigration.models.SqlConnectionInfo
    :ivar collect_logins: Flag for whether to collect logins from target SQL MI server.
    :vartype collect_logins: bool
    :ivar collect_agent_jobs: Flag for whether to collect agent jobs from target SQL MI server.
    :vartype collect_agent_jobs: bool
    :ivar validate_ssis_catalog_only: Flag for whether to validate SSIS catalog is reachable on the
     target SQL MI server.
    :vartype validate_ssis_catalog_only: bool
    """

    target_connection_info: "_models.SqlConnectionInfo" = rest_field(
        name="targetConnectionInfo", visibility=["read", "create", "update", "delete", "query"]
    )
    """Connection information for target SQL Server. Required."""
    collect_logins: Optional[bool] = rest_field(
        name="collectLogins", visibility=["read", "create", "update", "delete", "query"]
    )
    """Flag for whether to collect logins from target SQL MI server."""
    collect_agent_jobs: Optional[bool] = rest_field(
        name="collectAgentJobs", visibility=["read", "create", "update", "delete", "query"]
    )
    """Flag for whether to collect agent jobs from target SQL MI server."""
    validate_ssis_catalog_only: Optional[bool] = rest_field(
        name="validateSsisCatalogOnly", visibility=["read", "create", "update", "delete", "query"]
    )
    """Flag for whether to validate SSIS catalog is reachable on the target SQL MI server."""

    @overload
    def __init__(
        self,
        *,
        target_connection_info: "_models.SqlConnectionInfo",
        collect_logins: Optional[bool] = None,
        collect_agent_jobs: Optional[bool] = None,
        validate_ssis_catalog_only: Optional[bool] = None,
    ) -> None: ...

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

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


class ConnectToTargetSqlMITaskOutput(_Model):
    """Output for the task that validates connection to Azure SQL Database Managed Instance.

    :ivar id: Result identifier.
    :vartype id: str
    :ivar target_server_version: Target server version.
    :vartype target_server_version: str
    :ivar target_server_brand_version: Target server brand version.
    :vartype target_server_brand_version: str
    :ivar logins: List of logins on the target server.
    :vartype logins: list[str]
    :ivar agent_jobs: List of agent jobs on the target server.
    :vartype agent_jobs: list[str]
    :ivar validation_errors: Validation errors.
    :vartype validation_errors: list[~azure.mgmt.datamigration.models.ReportableException]
    """

    id: Optional[str] = rest_field(visibility=["read"])
    """Result identifier."""
    target_server_version: Optional[str] = rest_field(name="targetServerVersion", visibility=["read"])
    """Target server version."""
    target_server_brand_version: Optional[str] = rest_field(name="targetServerBrandVersion", visibility=["read"])
    """Target server brand version."""
    logins: Optional[list[str]] = rest_field(visibility=["read"])
    """List of logins on the target server."""
    agent_jobs: Optional[list[str]] = rest_field(name="agentJobs", visibility=["read"])
    """List of agent jobs on the target server."""
    validation_errors: Optional[list["_models.ReportableException"]] = rest_field(
        name="validationErrors", visibility=["read"]
    )
    """Validation errors."""


class ConnectToTargetSqlMITaskProperties(ProjectTaskProperties, discriminator="ConnectToTarget.AzureSqlDbMI"):
    """Properties for the task that validates connection to Azure SQL Database Managed Instance.

    :ivar errors: Array of errors. This is ignored if submitted.
    :vartype errors: list[~azure.mgmt.datamigration.models.ODataError]
    :ivar state: The state of the task. This is ignored if submitted. Known values are: "Unknown",
     "Queued", "Running", "Canceled", "Succeeded", "Failed", "FailedInputValidation", and "Faulted".
    :vartype state: str or ~azure.mgmt.datamigration.models.TaskState
    :ivar commands: Array of command properties.
    :vartype commands: list[~azure.mgmt.datamigration.models.CommandProperties]
    :ivar client_data: Key value pairs of client data to attach meta data information to task.
    :vartype client_data: dict[str, str]
    :ivar input: Task input.
    :vartype input: ~azure.mgmt.datamigration.models.ConnectToTargetSqlMITaskInput
    :ivar output: Task output. This is ignored if submitted.
    :vartype output: list[~azure.mgmt.datamigration.models.ConnectToTargetSqlMITaskOutput]
    :ivar task_type: Task type. Required. ConnectToTarget.AzureSqlDbMI.
    :vartype task_type: str or ~azure.mgmt.datamigration.models.CONNECT_TO_TARGET_AZURE_SQL_DB_MI
    """

    input: Optional["_models.ConnectToTargetSqlMITaskInput"] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """Task input."""
    output: Optional[list["_models.ConnectToTargetSqlMITaskOutput"]] = rest_field(visibility=["read"])
    """Task output. This is ignored if submitted."""
    task_type: Literal[TaskType.CONNECT_TO_TARGET_AZURE_SQL_DB_MI] = rest_discriminator(name="taskType", visibility=["read", "create", "update", "delete", "query"])  # type: ignore
    """Task type. Required. ConnectToTarget.AzureSqlDbMI."""

    @overload
    def __init__(
        self,
        *,
        client_data: Optional[dict[str, str]] = None,
        input: Optional["_models.ConnectToTargetSqlMITaskInput"] = None,
    ) -> None: ...

    @overload
    def __init__(self, mapping: Mapping[str, Any]) -> None:
        """
        :param 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.task_type = TaskType.CONNECT_TO_TARGET_AZURE_SQL_DB_MI  # type: ignore


class CopyProgressDetails(_Model):
    """Details on progress of ADF copy activity.

    :ivar table_name: Table Name.
    :vartype table_name: str
    :ivar status: Status of the Copy activity (InProgress, Succeeded, Failed, Canceled).
    :vartype status: str
    :ivar parallel_copy_type: Type of parallel copy (Dynamic range, Physical partition, none).
    :vartype parallel_copy_type: str
    :ivar used_parallel_copies: The degree of parallelization.
    :vartype used_parallel_copies: int
    :ivar data_read: Bytes read.
    :vartype data_read: int
    :ivar data_written: Bytes written.
    :vartype data_written: int
    :ivar rows_read: Rows read.
    :vartype rows_read: int
    :ivar rows_copied: Rows Copied.
    :vartype rows_copied: int
    :ivar copy_start: Copy Start.
    :vartype copy_start: ~datetime.datetime
    :ivar copy_throughput: Copy throughput in KBps.
    :vartype copy_throughput: float
    :ivar copy_duration: Copy Duration in seconds.
    :vartype copy_duration: int
    """

    table_name: Optional[str] = rest_field(name="tableName", visibility=["read"])
    """Table Name."""
    status: Optional[str] = rest_field(visibility=["read"])
    """Status of the Copy activity (InProgress, Succeeded, Failed, Canceled)."""
    parallel_copy_type: Optional[str] = rest_field(name="parallelCopyType", visibility=["read"])
    """Type of parallel copy (Dynamic range, Physical partition, none)."""
    used_parallel_copies: Optional[int] = rest_field(name="usedParallelCopies", visibility=["read"])
    """The degree of parallelization."""
    data_read: Optional[int] = rest_field(name="dataRead", visibility=["read"])
    """Bytes read."""
    data_written: Optional[int] = rest_field(name="dataWritten", visibility=["read"])
    """Bytes written."""
    rows_read: Optional[int] = rest_field(name="rowsRead", visibility=["read"])
    """Rows read."""
    rows_copied: Optional[int] = rest_field(name="rowsCopied", visibility=["read"])
    """Rows Copied."""
    copy_start: Optional[datetime.datetime] = rest_field(name="copyStart", visibility=["read"], format="rfc3339")
    """Copy Start."""
    copy_throughput: Optional[float] = rest_field(name="copyThroughput", visibility=["read"])
    """Copy throughput in KBps."""
    copy_duration: Optional[int] = rest_field(name="copyDuration", visibility=["read"])
    """Copy Duration in seconds."""


class DatabaseBackupInfo(_Model):
    """Information about backup files when existing backup mode is used.

    :ivar database_name: Database name.
    :vartype database_name: str
    :ivar backup_type: Backup Type. Known values are: "Database", "TransactionLog", "File",
     "DifferentialDatabase", "DifferentialFile", "Partial", and "DifferentialPartial".
    :vartype backup_type: str or ~azure.mgmt.datamigration.models.BackupType
    :ivar backup_files: The list of backup files for the current database.
    :vartype backup_files: list[str]
    :ivar position: Position of current database backup in the file.
    :vartype position: int
    :ivar is_damaged: Database was damaged when backed up, but the backup operation was requested
     to continue despite errors.
    :vartype is_damaged: bool
    :ivar is_compressed: Whether the backup set is compressed.
    :vartype is_compressed: bool
    :ivar family_count: Number of files in the backup set.
    :vartype family_count: int
    :ivar backup_finish_date: Date and time when the backup operation finished.
    :vartype backup_finish_date: ~datetime.datetime
    """

    database_name: Optional[str] = rest_field(name="databaseName", visibility=["read"])
    """Database name."""
    backup_type: Optional[Union[str, "_models.BackupType"]] = rest_field(name="backupType", visibility=["read"])
    """Backup Type. Known values are: \"Database\", \"TransactionLog\", \"File\",
     \"DifferentialDatabase\", \"DifferentialFile\", \"Partial\", and \"DifferentialPartial\"."""
    backup_files: Optional[list[str]] = rest_field(name="backupFiles", visibility=["read"])
    """The list of backup files for the current database."""
    position: Optional[int] = rest_field(visibility=["read"])
    """Position of current database backup in the file."""
    is_damaged: Optional[bool] = rest_field(name="isDamaged", visibility=["read"])
    """Database was damaged when backed up, but the backup operation was requested to continue despite
     errors."""
    is_compressed: Optional[bool] = rest_field(name="isCompressed", visibility=["read"])
    """Whether the backup set is compressed."""
    family_count: Optional[int] = rest_field(name="familyCount", visibility=["read"])
    """Number of files in the backup set."""
    backup_finish_date: Optional[datetime.datetime] = rest_field(
        name="backupFinishDate", visibility=["read"], format="rfc3339"
    )
    """Date and time when the backup operation finished."""


class DatabaseFileInfo(_Model):
    """Database file specific information.

    :ivar database_name: Name of the database.
    :vartype database_name: str
    :ivar id: Unique identifier for database file.
    :vartype id: str
    :ivar logical_name: Logical name of the file.
    :vartype logical_name: str
    :ivar physical_full_name: Operating-system full path of the file.
    :vartype physical_full_name: str
    :ivar restore_full_name: Suggested full path of the file for restoring.
    :vartype restore_full_name: str
    :ivar file_type: Database file type. Known values are: "Rows", "Log", "Filestream",
     "NotSupported", and "Fulltext".
    :vartype file_type: str or ~azure.mgmt.datamigration.models.DatabaseFileType
    :ivar size_mb: Size of the file in megabytes.
    :vartype size_mb: float
    """

    database_name: Optional[str] = rest_field(
        name="databaseName", visibility=["read", "create", "update", "delete", "query"]
    )
    """Name of the database."""
    id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """Unique identifier for database file."""
    logical_name: Optional[str] = rest_field(
        name="logicalName", visibility=["read", "create", "update", "delete", "query"]
    )
    """Logical name of the file."""
    physical_full_name: Optional[str] = rest_field(
        name="physicalFullName", visibility=["read", "create", "update", "delete", "query"]
    )
    """Operating-system full path of the file."""
    restore_full_name: Optional[str] = rest_field(
        name="restoreFullName", visibility=["read", "create", "update", "delete", "query"]
    )
    """Suggested full path of the file for restoring."""
    file_type: Optional[Union[str, "_models.DatabaseFileType"]] = rest_field(
        name="fileType", visibility=["read", "create", "update", "delete", "query"]
    )
    """Database file type. Known values are: \"Rows\", \"Log\", \"Filestream\", \"NotSupported\", and
     \"Fulltext\"."""
    size_mb: Optional[float] = rest_field(name="sizeMB", visibility=["read", "create", "update", "delete", "query"])
    """Size of the file in megabytes."""

    @overload
    def __init__(
        self,
        *,
        database_name: Optional[str] = None,
        id: Optional[str] = None,  # pylint: disable=redefined-builtin
        logical_name: Optional[str] = None,
        physical_full_name: Optional[str] = None,
        restore_full_name: Optional[str] = None,
        file_type: Optional[Union[str, "_models.DatabaseFileType"]] = None,
        size_mb: Optional[float] = None,
    ) -> None: ...

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

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


class DatabaseInfo(_Model):
    """Project Database Details.

    :ivar source_database_name: Name of the database. Required.
    :vartype source_database_name: str
    """

    source_database_name: str = rest_field(
        name="sourceDatabaseName", visibility=["read", "create", "update", "delete", "query"]
    )
    """Name of the database. Required."""

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

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

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


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


class DatabaseMigration(ProxyResource):
    """Database Migration 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.datamigration.models.SystemData
    :ivar properties: Database Migration Resource properties.
    :vartype properties: ~azure.mgmt.datamigration.models.DatabaseMigrationProperties
    """

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

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

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

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


class DatabaseMigrationBase(ProxyResource):
    """Database Migration 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.datamigration.models.SystemData
    :ivar properties: Database Migration Base Resource properties.
    :vartype properties: ~azure.mgmt.datamigration.models.DatabaseMigrationBaseProperties
    """

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

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

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

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


class DatabaseMigrationBaseProperties(_Model):
    """Database Migration Base Resource properties.

    You probably want to use the sub-classes and not this class directly. Known sub-classes are:
    DatabaseMigrationProperties, DatabaseMigrationPropertiesCosmosDbMongo,
    DatabaseMigrationPropertiesSqlDb, DatabaseMigrationPropertiesSqlMi,
    DatabaseMigrationPropertiesSqlVm

    :ivar kind: Required. Known values are: "SqlMi", "SqlVm", "SqlDb", "MongoToCosmosDbMongo", and
     "DatabaseMigrationProperties".
    :vartype kind: str or ~azure.mgmt.datamigration.models.ResourceType
    :ivar scope: Resource Id of the target resource.
    :vartype scope: str
    :ivar provisioning_state: Provisioning State of migration. ProvisioningState as Succeeded
     implies that validations have been performed and migration has started. Known values are:
     "Provisioning", "Updating", "Succeeded", "Failed", and "Canceled".
    :vartype provisioning_state: str or ~azure.mgmt.datamigration.models.ProvisioningState
    :ivar migration_status: Migration status.
    :vartype migration_status: str
    :ivar started_on: Database migration start time.
    :vartype started_on: ~datetime.datetime
    :ivar ended_on: Database migration end time.
    :vartype ended_on: ~datetime.datetime
    :ivar migration_service: Resource Id of the Migration Service.
    :vartype migration_service: str
    :ivar migration_operation_id: ID for current migration operation.
    :vartype migration_operation_id: str
    :ivar migration_failure_error: Error details in case of migration failure.
    :vartype migration_failure_error: ~azure.mgmt.datamigration.models.ErrorInfo
    :ivar provisioning_error: Error message for migration provisioning failure, if any.
    :vartype provisioning_error: str
    """

    __mapping__: dict[str, _Model] = {}
    kind: str = rest_discriminator(name="kind", visibility=["read", "create", "update", "delete", "query"])
    """Required. Known values are: \"SqlMi\", \"SqlVm\", \"SqlDb\", \"MongoToCosmosDbMongo\", and
     \"DatabaseMigrationProperties\"."""
    scope: Optional[str] = rest_field(visibility=["read", "create"])
    """Resource Id of the target resource."""
    provisioning_state: Optional[Union[str, "_models.ProvisioningState"]] = rest_field(
        name="provisioningState", visibility=["read"]
    )
    """Provisioning State of migration. ProvisioningState as Succeeded implies that validations have
     been performed and migration has started. Known values are: \"Provisioning\", \"Updating\",
     \"Succeeded\", \"Failed\", and \"Canceled\"."""
    migration_status: Optional[str] = rest_field(name="migrationStatus", visibility=["read"])
    """Migration status."""
    started_on: Optional[datetime.datetime] = rest_field(name="startedOn", visibility=["read"], format="rfc3339")
    """Database migration start time."""
    ended_on: Optional[datetime.datetime] = rest_field(name="endedOn", visibility=["read"], format="rfc3339")
    """Database migration end time."""
    migration_service: Optional[str] = rest_field(
        name="migrationService", visibility=["read", "create", "update", "delete", "query"]
    )
    """Resource Id of the Migration Service."""
    migration_operation_id: Optional[str] = rest_field(
        name="migrationOperationId", visibility=["read", "create", "update", "delete", "query"]
    )
    """ID for current migration operation."""
    migration_failure_error: Optional["_models.ErrorInfo"] = rest_field(
        name="migrationFailureError", visibility=["read"]
    )
    """Error details in case of migration failure."""
    provisioning_error: Optional[str] = rest_field(
        name="provisioningError", visibility=["read", "create", "update", "delete", "query"]
    )
    """Error message for migration provisioning failure, if any."""

    @overload
    def __init__(
        self,
        *,
        kind: str,
        scope: Optional[str] = None,
        migration_service: Optional[str] = None,
        migration_operation_id: Optional[str] = None,
        provisioning_error: 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 DatabaseMigrationCosmosDbMongo(ProxyResource):
    """Database Migration Resource for Mongo to CosmosDb.

    :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.datamigration.models.SystemData
    :ivar properties: Database Migration Resource properties for CosmosDb for Mongo.
    :vartype properties: ~azure.mgmt.datamigration.models.DatabaseMigrationPropertiesCosmosDbMongo
    """

    properties: Optional["_models.DatabaseMigrationPropertiesCosmosDbMongo"] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """Database Migration Resource properties for CosmosDb for Mongo."""

    __flattened_items = [
        "scope",
        "provisioning_state",
        "migration_status",
        "started_on",
        "ended_on",
        "migration_service",
        "migration_operation_id",
        "migration_failure_error",
        "provisioning_error",
        "source_mongo_connection",
        "target_mongo_connection",
        "collection_list",
        "kind",
    ]

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

    @overload
    def __init__(self, mapping: Mapping[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 DatabaseMigrationProperties(DatabaseMigrationBaseProperties, discriminator="DatabaseMigrationProperties"):
    """Database Migration Resource properties.

    You probably want to use the sub-classes and not this class directly. Known sub-classes are:
    DatabaseMigrationPropertiesSqlDb, DatabaseMigrationPropertiesSqlMi,
    DatabaseMigrationPropertiesSqlVm

    :ivar scope: Resource Id of the target resource.
    :vartype scope: str
    :ivar provisioning_state: Provisioning State of migration. ProvisioningState as Succeeded
     implies that validations have been performed and migration has started. Known values are:
     "Provisioning", "Updating", "Succeeded", "Failed", and "Canceled".
    :vartype provisioning_state: str or ~azure.mgmt.datamigration.models.ProvisioningState
    :ivar migration_status: Migration status.
    :vartype migration_status: str
    :ivar started_on: Database migration start time.
    :vartype started_on: ~datetime.datetime
    :ivar ended_on: Database migration end time.
    :vartype ended_on: ~datetime.datetime
    :ivar migration_service: Resource Id of the Migration Service.
    :vartype migration_service: str
    :ivar migration_operation_id: ID for current migration operation.
    :vartype migration_operation_id: str
    :ivar migration_failure_error: Error details in case of migration failure.
    :vartype migration_failure_error: ~azure.mgmt.datamigration.models.ErrorInfo
    :ivar provisioning_error: Error message for migration provisioning failure, if any.
    :vartype provisioning_error: str
    :ivar kind: Required. DatabaseMigrationProperties.
    :vartype kind: str or ~azure.mgmt.datamigration.models.DATABASE_MIGRATION_PROPERTIES
    :ivar source_sql_connection: Source SQL Server connection details.
    :vartype source_sql_connection: ~azure.mgmt.datamigration.models.SqlConnectionInformation
    :ivar source_database_name: Name of the source database.
    :vartype source_database_name: str
    :ivar source_server_name: Name of the source sql server.
    :vartype source_server_name: str
    :ivar target_database_collation: Database collation to be used for the target database.
    :vartype target_database_collation: str
    :ivar sql_server_instance_id: Optional property - Resource Id for the source Sql server
     instance. Validations are performed on this property to ensure that it follows the correct
     format.
    :vartype sql_server_instance_id: str
    """

    __mapping__: dict[str, _Model] = {}
    kind: Literal[ResourceType.DATABASE_MIGRATION_PROPERTIES] = rest_discriminator(name="kind", visibility=["read", "create", "update", "delete", "query"])  # type: ignore
    """Required. DatabaseMigrationProperties."""
    source_sql_connection: Optional["_models.SqlConnectionInformation"] = rest_field(
        name="sourceSqlConnection", visibility=["read", "create", "update", "delete", "query"]
    )
    """Source SQL Server connection details."""
    source_database_name: Optional[str] = rest_field(
        name="sourceDatabaseName", visibility=["read", "create", "update", "delete", "query"]
    )
    """Name of the source database."""
    source_server_name: Optional[str] = rest_field(name="sourceServerName", visibility=["read"])
    """Name of the source sql server."""
    target_database_collation: Optional[str] = rest_field(
        name="targetDatabaseCollation", visibility=["read", "create", "update", "delete", "query"]
    )
    """Database collation to be used for the target database."""
    sql_server_instance_id: Optional[str] = rest_field(name="sqlServerInstanceId", visibility=["read", "create"])
    """Optional property - Resource Id for the source Sql server instance. Validations are performed
     on this property to ensure that it follows the correct format."""

    @overload
    def __init__(
        self,
        *,
        scope: Optional[str] = None,
        migration_service: Optional[str] = None,
        migration_operation_id: Optional[str] = None,
        provisioning_error: Optional[str] = None,
        source_sql_connection: Optional["_models.SqlConnectionInformation"] = None,
        source_database_name: Optional[str] = None,
        target_database_collation: Optional[str] = None,
        sql_server_instance_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)
        self.kind = ResourceType.DATABASE_MIGRATION_PROPERTIES  # type: ignore


class DatabaseMigrationPropertiesCosmosDbMongo(DatabaseMigrationBaseProperties, discriminator="MongoToCosmosDbMongo"):
    """Database Migration Resource properties for CosmosDb for Mongo.

    :ivar scope: Resource Id of the target resource.
    :vartype scope: str
    :ivar provisioning_state: Provisioning State of migration. ProvisioningState as Succeeded
     implies that validations have been performed and migration has started. Known values are:
     "Provisioning", "Updating", "Succeeded", "Failed", and "Canceled".
    :vartype provisioning_state: str or ~azure.mgmt.datamigration.models.ProvisioningState
    :ivar migration_status: Migration status.
    :vartype migration_status: str
    :ivar started_on: Database migration start time.
    :vartype started_on: ~datetime.datetime
    :ivar ended_on: Database migration end time.
    :vartype ended_on: ~datetime.datetime
    :ivar migration_service: Resource Id of the Migration Service.
    :vartype migration_service: str
    :ivar migration_operation_id: ID for current migration operation.
    :vartype migration_operation_id: str
    :ivar migration_failure_error: Error details in case of migration failure.
    :vartype migration_failure_error: ~azure.mgmt.datamigration.models.ErrorInfo
    :ivar provisioning_error: Error message for migration provisioning failure, if any.
    :vartype provisioning_error: str
    :ivar source_mongo_connection: Source Mongo connection details.
    :vartype source_mongo_connection: ~azure.mgmt.datamigration.models.MongoConnectionInformation
    :ivar target_mongo_connection: Target Cosmos DB Mongo connection details.
    :vartype target_mongo_connection: ~azure.mgmt.datamigration.models.MongoConnectionInformation
    :ivar collection_list: List of Mongo Collections to be migrated.
    :vartype collection_list: list[~azure.mgmt.datamigration.models.MongoMigrationCollection]
    :ivar kind: Required. MongoToCosmosDbMongo.
    :vartype kind: str or ~azure.mgmt.datamigration.models.MONGO_TO_COSMOS_DB_MONGO
    """

    source_mongo_connection: Optional["_models.MongoConnectionInformation"] = rest_field(
        name="sourceMongoConnection", visibility=["read", "create", "update", "delete", "query"]
    )
    """Source Mongo connection details."""
    target_mongo_connection: Optional["_models.MongoConnectionInformation"] = rest_field(
        name="targetMongoConnection", visibility=["read", "create", "update", "delete", "query"]
    )
    """Target Cosmos DB Mongo connection details."""
    collection_list: Optional[list["_models.MongoMigrationCollection"]] = rest_field(
        name="collectionList", visibility=["read", "create", "update", "delete", "query"]
    )
    """List of Mongo Collections to be migrated."""
    kind: Literal[ResourceType.MONGO_TO_COSMOS_DB_MONGO] = rest_discriminator(name="kind", visibility=["read", "create", "update", "delete", "query"])  # type: ignore
    """Required. MongoToCosmosDbMongo."""

    @overload
    def __init__(
        self,
        *,
        scope: Optional[str] = None,
        migration_service: Optional[str] = None,
        migration_operation_id: Optional[str] = None,
        provisioning_error: Optional[str] = None,
        source_mongo_connection: Optional["_models.MongoConnectionInformation"] = None,
        target_mongo_connection: Optional["_models.MongoConnectionInformation"] = None,
        collection_list: Optional[list["_models.MongoMigrationCollection"]] = None,
    ) -> None: ...

    @overload
    def __init__(self, mapping: Mapping[str, Any]) -> None:
        """
        :param 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.kind = ResourceType.MONGO_TO_COSMOS_DB_MONGO  # type: ignore


class DatabaseMigrationPropertiesSqlDb(DatabaseMigrationProperties, discriminator="SqlDb"):
    """Database Migration Resource properties for SQL database.

    :ivar scope: Resource Id of the target resource.
    :vartype scope: str
    :ivar provisioning_state: Provisioning State of migration. ProvisioningState as Succeeded
     implies that validations have been performed and migration has started. Known values are:
     "Provisioning", "Updating", "Succeeded", "Failed", and "Canceled".
    :vartype provisioning_state: str or ~azure.mgmt.datamigration.models.ProvisioningState
    :ivar migration_status: Migration status.
    :vartype migration_status: str
    :ivar started_on: Database migration start time.
    :vartype started_on: ~datetime.datetime
    :ivar ended_on: Database migration end time.
    :vartype ended_on: ~datetime.datetime
    :ivar migration_service: Resource Id of the Migration Service.
    :vartype migration_service: str
    :ivar migration_operation_id: ID for current migration operation.
    :vartype migration_operation_id: str
    :ivar migration_failure_error: Error details in case of migration failure.
    :vartype migration_failure_error: ~azure.mgmt.datamigration.models.ErrorInfo
    :ivar provisioning_error: Error message for migration provisioning failure, if any.
    :vartype provisioning_error: str
    :ivar source_sql_connection: Source SQL Server connection details.
    :vartype source_sql_connection: ~azure.mgmt.datamigration.models.SqlConnectionInformation
    :ivar source_database_name: Name of the source database.
    :vartype source_database_name: str
    :ivar source_server_name: Name of the source sql server.
    :vartype source_server_name: str
    :ivar target_database_collation: Database collation to be used for the target database.
    :vartype target_database_collation: str
    :ivar sql_server_instance_id: Optional property - Resource Id for the source Sql server
     instance. Validations are performed on this property to ensure that it follows the correct
     format.
    :vartype sql_server_instance_id: str
    :ivar migration_status_details: Detailed migration status. Not included by default.
    :vartype migration_status_details: ~azure.mgmt.datamigration.models.SqlDbMigrationStatusDetails
    :ivar target_sql_connection: Target SQL DB connection details.
    :vartype target_sql_connection: ~azure.mgmt.datamigration.models.SqlConnectionInformation
    :ivar offline_configuration: Offline configuration.
    :vartype offline_configuration: ~azure.mgmt.datamigration.models.SqlDbOfflineConfiguration
    :ivar table_list: List of tables to copy.
    :vartype table_list: list[str]
    :ivar kind: Required. SqlDb.
    :vartype kind: str or ~azure.mgmt.datamigration.models.SQL_DB
    """

    migration_status_details: Optional["_models.SqlDbMigrationStatusDetails"] = rest_field(
        name="migrationStatusDetails", visibility=["read"]
    )
    """Detailed migration status. Not included by default."""
    target_sql_connection: Optional["_models.SqlConnectionInformation"] = rest_field(
        name="targetSqlConnection", visibility=["read", "create", "update", "delete", "query"]
    )
    """Target SQL DB connection details."""
    offline_configuration: Optional["_models.SqlDbOfflineConfiguration"] = rest_field(
        name="offlineConfiguration", visibility=["read"]
    )
    """Offline configuration."""
    table_list: Optional[list[str]] = rest_field(
        name="tableList", visibility=["read", "create", "update", "delete", "query"]
    )
    """List of tables to copy."""
    kind: Literal[ResourceType.SQL_DB] = rest_discriminator(name="kind", visibility=["read", "create", "update", "delete", "query"])  # type: ignore
    """Required. SqlDb."""

    @overload
    def __init__(
        self,
        *,
        scope: Optional[str] = None,
        migration_service: Optional[str] = None,
        migration_operation_id: Optional[str] = None,
        provisioning_error: Optional[str] = None,
        source_sql_connection: Optional["_models.SqlConnectionInformation"] = None,
        source_database_name: Optional[str] = None,
        target_database_collation: Optional[str] = None,
        sql_server_instance_id: Optional[str] = None,
        target_sql_connection: Optional["_models.SqlConnectionInformation"] = None,
        table_list: Optional[list[str]] = None,
    ) -> None: ...

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

    def __init__(self, *args: Any, **kwargs: Any) -> None:
        super().__init__(*args, **kwargs)
        self.kind = ResourceType.SQL_DB  # type: ignore


class DatabaseMigrationPropertiesSqlMi(DatabaseMigrationProperties, discriminator="SqlMi"):
    """Database Migration Resource properties for SQL Managed Instance.

    :ivar scope: Resource Id of the target resource.
    :vartype scope: str
    :ivar provisioning_state: Provisioning State of migration. ProvisioningState as Succeeded
     implies that validations have been performed and migration has started. Known values are:
     "Provisioning", "Updating", "Succeeded", "Failed", and "Canceled".
    :vartype provisioning_state: str or ~azure.mgmt.datamigration.models.ProvisioningState
    :ivar migration_status: Migration status.
    :vartype migration_status: str
    :ivar started_on: Database migration start time.
    :vartype started_on: ~datetime.datetime
    :ivar ended_on: Database migration end time.
    :vartype ended_on: ~datetime.datetime
    :ivar migration_service: Resource Id of the Migration Service.
    :vartype migration_service: str
    :ivar migration_operation_id: ID for current migration operation.
    :vartype migration_operation_id: str
    :ivar migration_failure_error: Error details in case of migration failure.
    :vartype migration_failure_error: ~azure.mgmt.datamigration.models.ErrorInfo
    :ivar provisioning_error: Error message for migration provisioning failure, if any.
    :vartype provisioning_error: str
    :ivar source_sql_connection: Source SQL Server connection details.
    :vartype source_sql_connection: ~azure.mgmt.datamigration.models.SqlConnectionInformation
    :ivar source_database_name: Name of the source database.
    :vartype source_database_name: str
    :ivar source_server_name: Name of the source sql server.
    :vartype source_server_name: str
    :ivar target_database_collation: Database collation to be used for the target database.
    :vartype target_database_collation: str
    :ivar sql_server_instance_id: Optional property - Resource Id for the source Sql server
     instance. Validations are performed on this property to ensure that it follows the correct
     format.
    :vartype sql_server_instance_id: str
    :ivar migration_status_details: Detailed migration status. Not included by default.
    :vartype migration_status_details: ~azure.mgmt.datamigration.models.MigrationStatusDetails
    :ivar backup_configuration: Backup configuration info.
    :vartype backup_configuration: ~azure.mgmt.datamigration.models.BackupConfiguration
    :ivar offline_configuration: Offline configuration.
    :vartype offline_configuration: ~azure.mgmt.datamigration.models.OfflineConfiguration
    :ivar kind: Required. SqlMi.
    :vartype kind: str or ~azure.mgmt.datamigration.models.SQL_MI
    """

    migration_status_details: Optional["_models.MigrationStatusDetails"] = rest_field(
        name="migrationStatusDetails", visibility=["read"]
    )
    """Detailed migration status. Not included by default."""
    backup_configuration: Optional["_models.BackupConfiguration"] = rest_field(
        name="backupConfiguration", visibility=["read", "create", "update", "delete", "query"]
    )
    """Backup configuration info."""
    offline_configuration: Optional["_models.OfflineConfiguration"] = rest_field(
        name="offlineConfiguration", visibility=["read", "create", "update", "delete", "query"]
    )
    """Offline configuration."""
    kind: Literal[ResourceType.SQL_MI] = rest_discriminator(name="kind", visibility=["read", "create", "update", "delete", "query"])  # type: ignore
    """Required. SqlMi."""

    @overload
    def __init__(
        self,
        *,
        scope: Optional[str] = None,
        migration_service: Optional[str] = None,
        migration_operation_id: Optional[str] = None,
        provisioning_error: Optional[str] = None,
        source_sql_connection: Optional["_models.SqlConnectionInformation"] = None,
        source_database_name: Optional[str] = None,
        target_database_collation: Optional[str] = None,
        sql_server_instance_id: Optional[str] = None,
        backup_configuration: Optional["_models.BackupConfiguration"] = None,
        offline_configuration: Optional["_models.OfflineConfiguration"] = None,
    ) -> None: ...

    @overload
    def __init__(self, mapping: Mapping[str, Any]) -> None:
        """
        :param 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.kind = ResourceType.SQL_MI  # type: ignore


class DatabaseMigrationPropertiesSqlVm(DatabaseMigrationProperties, discriminator="SqlVm"):
    """Database Migration Resource properties for SQL Virtual Machine.

    :ivar scope: Resource Id of the target resource.
    :vartype scope: str
    :ivar provisioning_state: Provisioning State of migration. ProvisioningState as Succeeded
     implies that validations have been performed and migration has started. Known values are:
     "Provisioning", "Updating", "Succeeded", "Failed", and "Canceled".
    :vartype provisioning_state: str or ~azure.mgmt.datamigration.models.ProvisioningState
    :ivar migration_status: Migration status.
    :vartype migration_status: str
    :ivar started_on: Database migration start time.
    :vartype started_on: ~datetime.datetime
    :ivar ended_on: Database migration end time.
    :vartype ended_on: ~datetime.datetime
    :ivar migration_service: Resource Id of the Migration Service.
    :vartype migration_service: str
    :ivar migration_operation_id: ID for current migration operation.
    :vartype migration_operation_id: str
    :ivar migration_failure_error: Error details in case of migration failure.
    :vartype migration_failure_error: ~azure.mgmt.datamigration.models.ErrorInfo
    :ivar provisioning_error: Error message for migration provisioning failure, if any.
    :vartype provisioning_error: str
    :ivar source_sql_connection: Source SQL Server connection details.
    :vartype source_sql_connection: ~azure.mgmt.datamigration.models.SqlConnectionInformation
    :ivar source_database_name: Name of the source database.
    :vartype source_database_name: str
    :ivar source_server_name: Name of the source sql server.
    :vartype source_server_name: str
    :ivar target_database_collation: Database collation to be used for the target database.
    :vartype target_database_collation: str
    :ivar sql_server_instance_id: Optional property - Resource Id for the source Sql server
     instance. Validations are performed on this property to ensure that it follows the correct
     format.
    :vartype sql_server_instance_id: str
    :ivar migration_status_details: Detailed migration status. Not included by default.
    :vartype migration_status_details: ~azure.mgmt.datamigration.models.MigrationStatusDetails
    :ivar backup_configuration: Backup configuration info.
    :vartype backup_configuration: ~azure.mgmt.datamigration.models.BackupConfiguration
    :ivar offline_configuration: Offline configuration.
    :vartype offline_configuration: ~azure.mgmt.datamigration.models.OfflineConfiguration
    :ivar kind: Required. SqlVm.
    :vartype kind: str or ~azure.mgmt.datamigration.models.SQL_VM
    """

    migration_status_details: Optional["_models.MigrationStatusDetails"] = rest_field(
        name="migrationStatusDetails", visibility=["read"]
    )
    """Detailed migration status. Not included by default."""
    backup_configuration: Optional["_models.BackupConfiguration"] = rest_field(
        name="backupConfiguration", visibility=["read", "create", "update", "delete", "query"]
    )
    """Backup configuration info."""
    offline_configuration: Optional["_models.OfflineConfiguration"] = rest_field(
        name="offlineConfiguration", visibility=["read", "create", "update", "delete", "query"]
    )
    """Offline configuration."""
    kind: Literal[ResourceType.SQL_VM] = rest_discriminator(name="kind", visibility=["read", "create", "update", "delete", "query"])  # type: ignore
    """Required. SqlVm."""

    @overload
    def __init__(
        self,
        *,
        scope: Optional[str] = None,
        migration_service: Optional[str] = None,
        migration_operation_id: Optional[str] = None,
        provisioning_error: Optional[str] = None,
        source_sql_connection: Optional["_models.SqlConnectionInformation"] = None,
        source_database_name: Optional[str] = None,
        target_database_collation: Optional[str] = None,
        sql_server_instance_id: Optional[str] = None,
        backup_configuration: Optional["_models.BackupConfiguration"] = None,
        offline_configuration: Optional["_models.OfflineConfiguration"] = None,
    ) -> None: ...

    @overload
    def __init__(self, mapping: Mapping[str, Any]) -> None:
        """
        :param 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.kind = ResourceType.SQL_VM  # type: ignore


class DatabaseMigrationSqlDb(ProxyResource):
    """Database Migration Resource for SQL 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.datamigration.models.SystemData
    :ivar properties: Database Migration Resource properties for SQL database.
    :vartype properties: ~azure.mgmt.datamigration.models.DatabaseMigrationPropertiesSqlDb
    """

    properties: Optional["_models.DatabaseMigrationPropertiesSqlDb"] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """Database Migration Resource properties for SQL database."""

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

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

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


class DatabaseMigrationSqlMi(ProxyResource):
    """Database Migration Resource for SQL Managed Instance.

    :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.datamigration.models.SystemData
    :ivar properties: Database Migration Resource properties for SQL Managed Instance.
    :vartype properties: ~azure.mgmt.datamigration.models.DatabaseMigrationPropertiesSqlMi
    """

    properties: Optional["_models.DatabaseMigrationPropertiesSqlMi"] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """Database Migration Resource properties for SQL Managed Instance."""

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

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

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


class DatabaseMigrationSqlVm(ProxyResource):
    """Database Migration Resource for SQL Virtual Machine.

    :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.datamigration.models.SystemData
    :ivar properties: Database Migration Resource properties for SQL Virtual Machine.
    :vartype properties: ~azure.mgmt.datamigration.models.DatabaseMigrationPropertiesSqlVm
    """

    properties: Optional["_models.DatabaseMigrationPropertiesSqlVm"] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """Database Migration Resource properties for SQL Virtual Machine."""

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

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

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


class DatabaseTable(_Model):
    """Table properties.

    :ivar has_rows: Indicates whether table is empty or not.
    :vartype has_rows: bool
    :ivar name: Schema-qualified name of the table.
    :vartype name: str
    """

    has_rows: Optional[bool] = rest_field(name="hasRows", visibility=["read"])
    """Indicates whether table is empty or not."""
    name: Optional[str] = rest_field(visibility=["read"])
    """Schema-qualified name of the table."""


class DataIntegrityValidationResult(_Model):
    """Results for checksum based Data Integrity validation results.

    :ivar failed_objects: List of failed table names of source and target pair.
    :vartype failed_objects: dict[str, str]
    :ivar validation_errors: List of errors that happened while performing data integrity
     validation.
    :vartype validation_errors: ~azure.mgmt.datamigration.models.ValidationError
    """

    failed_objects: Optional[dict[str, str]] = rest_field(
        name="failedObjects", visibility=["read", "create", "update", "delete", "query"]
    )
    """List of failed table names of source and target pair."""
    validation_errors: Optional["_models.ValidationError"] = rest_field(
        name="validationErrors", visibility=["read", "create", "update", "delete", "query"]
    )
    """List of errors that happened while performing data integrity validation."""

    @overload
    def __init__(
        self,
        *,
        failed_objects: Optional[dict[str, str]] = None,
        validation_errors: Optional["_models.ValidationError"] = None,
    ) -> None: ...

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

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


class DataMigrationService(ProxyResource):
    """An Azure Database Migration Service (classic) 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.datamigration.models.SystemData
    :ivar properties: Custom service properties.
    :vartype properties: ~azure.mgmt.datamigration.models.DataMigrationServiceProperties
    :ivar etag: HTTP strong entity tag value. Ignored if submitted.
    :vartype etag: str
    :ivar kind: The resource kind. Only 'vm' (the default) is supported.
    :vartype kind: str
    :ivar sku: Service SKU.
    :vartype sku: ~azure.mgmt.datamigration.models.ServiceSku
    :ivar location:
    :vartype location: str
    :ivar tags:
    :vartype tags: dict[str, str]
    """

    properties: Optional["_models.DataMigrationServiceProperties"] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """Custom service properties."""
    etag: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """HTTP strong entity tag value. Ignored if submitted."""
    kind: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """The resource kind. Only 'vm' (the default) is supported."""
    sku: Optional["_models.ServiceSku"] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """Service SKU."""
    location: Optional[str] = rest_field(visibility=["read", "create"])
    tags: Optional[dict[str, str]] = rest_field(visibility=["read", "create", "update", "delete", "query"])

    __flattened_items = [
        "provisioning_state",
        "public_key",
        "virtual_subnet_id",
        "virtual_nic_id",
        "auto_stop_delay",
        "delete_resources_on_stop",
    ]

    @overload
    def __init__(
        self,
        *,
        properties: Optional["_models.DataMigrationServiceProperties"] = None,
        etag: Optional[str] = None,
        kind: Optional[str] = None,
        sku: Optional["_models.ServiceSku"] = None,
        location: Optional[str] = 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 DataMigrationServiceProperties(_Model):
    """Properties of the Azure Database Migration Service (classic) instance.

    :ivar provisioning_state: The resource's provisioning state. Known values are: "Accepted",
     "Deleting", "Deploying", "Stopped", "Stopping", "Starting", "FailedToStart", "FailedToStop",
     "Succeeded", and "Failed".
    :vartype provisioning_state: str or ~azure.mgmt.datamigration.models.ServiceProvisioningState
    :ivar public_key: The public key of the service, used to encrypt secrets sent to the service.
    :vartype public_key: str
    :ivar virtual_subnet_id: The ID of the Microsoft.Network/virtualNetworks/subnets resource to
     which the service should be joined.
    :vartype virtual_subnet_id: str
    :ivar virtual_nic_id: The ID of the Microsoft.Network/networkInterfaces resource which the
     service have.
    :vartype virtual_nic_id: str
    :ivar auto_stop_delay: The time delay before the service is auto-stopped when idle.
    :vartype auto_stop_delay: str
    :ivar delete_resources_on_stop: Whether service resources should be deleted when stopped.
     (Turned on by default).
    :vartype delete_resources_on_stop: bool
    """

    provisioning_state: Optional[Union[str, "_models.ServiceProvisioningState"]] = rest_field(
        name="provisioningState", visibility=["read"]
    )
    """The resource's provisioning state. Known values are: \"Accepted\", \"Deleting\", \"Deploying\",
     \"Stopped\", \"Stopping\", \"Starting\", \"FailedToStart\", \"FailedToStop\", \"Succeeded\",
     and \"Failed\"."""
    public_key: Optional[str] = rest_field(name="publicKey", visibility=["read", "create", "update", "delete", "query"])
    """The public key of the service, used to encrypt secrets sent to the service."""
    virtual_subnet_id: Optional[str] = rest_field(
        name="virtualSubnetId", visibility=["read", "create", "update", "delete", "query"]
    )
    """The ID of the Microsoft.Network/virtualNetworks/subnets resource to which the service should be
     joined."""
    virtual_nic_id: Optional[str] = rest_field(
        name="virtualNicId", visibility=["read", "create", "update", "delete", "query"]
    )
    """The ID of the Microsoft.Network/networkInterfaces resource which the service have."""
    auto_stop_delay: Optional[str] = rest_field(
        name="autoStopDelay", visibility=["read", "create", "update", "delete", "query"]
    )
    """The time delay before the service is auto-stopped when idle."""
    delete_resources_on_stop: Optional[bool] = rest_field(
        name="deleteResourcesOnStop", visibility=["read", "create", "update", "delete", "query"]
    )
    """Whether service resources should be deleted when stopped. (Turned on by default)."""

    @overload
    def __init__(
        self,
        *,
        public_key: Optional[str] = None,
        virtual_subnet_id: Optional[str] = None,
        virtual_nic_id: Optional[str] = None,
        auto_stop_delay: Optional[str] = None,
        delete_resources_on_stop: Optional[bool] = None,
    ) -> None: ...

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

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


class DataMigrationServiceStatusResponse(_Model):
    """Service health status.

    :ivar agent_version: The DMS instance agent version.
    :vartype agent_version: str
    :ivar agent_configuration: Agent Configuration.
    :vartype agent_configuration: any
    :ivar status: The machine-readable status, such as 'Initializing', 'Offline', 'Online',
     'Deploying', 'Deleting', 'Stopped', 'Stopping', 'Starting', 'FailedToStart', 'FailedToStop' or
     'Failed'.
    :vartype status: str
    :ivar vm_size: The services virtual machine size, such as 'Standard_D2_v2'.
    :vartype vm_size: str
    :ivar supported_task_types: The list of supported task types.
    :vartype supported_task_types: list[str]
    """

    agent_version: Optional[str] = rest_field(
        name="agentVersion", visibility=["read", "create", "update", "delete", "query"]
    )
    """The DMS instance agent version."""
    agent_configuration: Optional[Any] = rest_field(
        name="agentConfiguration", visibility=["read", "create", "update", "delete", "query"]
    )
    """Agent Configuration."""
    status: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """The machine-readable status, such as 'Initializing', 'Offline', 'Online', 'Deploying',
     'Deleting', 'Stopped', 'Stopping', 'Starting', 'FailedToStart', 'FailedToStop' or 'Failed'."""
    vm_size: Optional[str] = rest_field(name="vmSize", visibility=["read", "create", "update", "delete", "query"])
    """The services virtual machine size, such as 'Standard_D2_v2'."""
    supported_task_types: Optional[list[str]] = rest_field(
        name="supportedTaskTypes", visibility=["read", "create", "update", "delete", "query"]
    )
    """The list of supported task types."""

    @overload
    def __init__(
        self,
        *,
        agent_version: Optional[str] = None,
        agent_configuration: Optional[Any] = None,
        status: Optional[str] = None,
        vm_size: Optional[str] = None,
        supported_task_types: 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 DeleteNode(_Model):
    """Details of node to be deleted.

    :ivar node_name: The name of node to delete.
    :vartype node_name: str
    :ivar integration_runtime_name: The name of integration runtime.
    :vartype integration_runtime_name: str
    """

    node_name: Optional[str] = rest_field(name="nodeName", visibility=["read", "create"])
    """The name of node to delete."""
    integration_runtime_name: Optional[str] = rest_field(name="integrationRuntimeName", visibility=["read", "create"])
    """The name of integration runtime."""

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

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

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


class 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.datamigration.models.ErrorDetail]
    :ivar additional_info: The error additional info.
    :vartype additional_info: list[~azure.mgmt.datamigration.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 ErrorInfo(_Model):
    """Error details.

    :ivar code: Error code.
    :vartype code: str
    :ivar message: Error message.
    :vartype message: str
    """

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


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

    :ivar error: The error object.
    :vartype error: ~azure.mgmt.datamigration.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 ExecutionStatistics(_Model):
    """Description about the errors happen while performing migration validation.

    :ivar execution_count: No. of query executions.
    :vartype execution_count: int
    :ivar cpu_time_ms: CPU Time in millisecond(s) for the query execution.
    :vartype cpu_time_ms: float
    :ivar elapsed_time_ms: Time taken in millisecond(s) for executing the query.
    :vartype elapsed_time_ms: float
    :ivar wait_stats: Dictionary of sql query execution wait types and the respective statistics.
    :vartype wait_stats: dict[str, ~azure.mgmt.datamigration.models.WaitStatistics]
    :ivar has_errors: Indicates whether the query resulted in an error.
    :vartype has_errors: bool
    :ivar sql_errors: List of sql Errors.
    :vartype sql_errors: list[str]
    """

    execution_count: Optional[int] = rest_field(
        name="executionCount", visibility=["read", "create", "update", "delete", "query"]
    )
    """No. of query executions."""
    cpu_time_ms: Optional[float] = rest_field(
        name="cpuTimeMs", visibility=["read", "create", "update", "delete", "query"]
    )
    """CPU Time in millisecond(s) for the query execution."""
    elapsed_time_ms: Optional[float] = rest_field(
        name="elapsedTimeMs", visibility=["read", "create", "update", "delete", "query"]
    )
    """Time taken in millisecond(s) for executing the query."""
    wait_stats: Optional[dict[str, "_models.WaitStatistics"]] = rest_field(
        name="waitStats", visibility=["read", "create", "update", "delete", "query"]
    )
    """Dictionary of sql query execution wait types and the respective statistics."""
    has_errors: Optional[bool] = rest_field(
        name="hasErrors", visibility=["read", "create", "update", "delete", "query"]
    )
    """Indicates whether the query resulted in an error."""
    sql_errors: Optional[list[str]] = rest_field(
        name="sqlErrors", visibility=["read", "create", "update", "delete", "query"]
    )
    """List of sql Errors."""

    @overload
    def __init__(
        self,
        *,
        execution_count: Optional[int] = None,
        cpu_time_ms: Optional[float] = None,
        elapsed_time_ms: Optional[float] = None,
        wait_stats: Optional[dict[str, "_models.WaitStatistics"]] = None,
        has_errors: Optional[bool] = None,
        sql_errors: 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 FileShare(_Model):
    """File share information with Path, Username, and Password.

    :ivar user_name: User name credential to connect to the share location.
    :vartype user_name: str
    :ivar password: Password credential used to connect to the share location.
    :vartype password: str
    :ivar path: The folder path for this share. Required.
    :vartype path: str
    """

    user_name: Optional[str] = rest_field(name="userName", visibility=["read", "create", "update", "delete", "query"])
    """User name credential to connect to the share location."""
    password: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """Password credential used to connect to the share location."""
    path: str = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """The folder path for this share. Required."""

    @overload
    def __init__(
        self,
        *,
        path: str,
        user_name: Optional[str] = None,
        password: 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 FileStorageInfo(_Model):
    """File storage information.

    :ivar uri: A URI that can be used to access the file content.
    :vartype uri: str
    :ivar headers: Dictionary of <string>.
    :vartype headers: dict[str, str]
    """

    uri: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """A URI that can be used to access the file content."""
    headers: Optional[dict[str, str]] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """Dictionary of <string>."""

    @overload
    def __init__(
        self,
        *,
        uri: Optional[str] = None,
        headers: 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 GetTdeCertificatesSqlTaskInput(_Model):
    """Input for the task that gets TDE certificates in Base64 encoded format.

    :ivar connection_info: Connection information for SQL Server. Required.
    :vartype connection_info: ~azure.mgmt.datamigration.models.SqlConnectionInfo
    :ivar backup_file_share: Backup file share information for file share to be used for
     temporarily storing files. Required.
    :vartype backup_file_share: ~azure.mgmt.datamigration.models.FileShare
    :ivar selected_certificates: List containing certificate names and corresponding password to
     use for encrypting the exported certificate. Required.
    :vartype selected_certificates: list[~azure.mgmt.datamigration.models.SelectedCertificateInput]
    """

    connection_info: "_models.SqlConnectionInfo" = rest_field(
        name="connectionInfo", visibility=["read", "create", "update", "delete", "query"]
    )
    """Connection information for SQL Server. Required."""
    backup_file_share: "_models.FileShare" = rest_field(
        name="backupFileShare", visibility=["read", "create", "update", "delete", "query"]
    )
    """Backup file share information for file share to be used for temporarily storing files.
     Required."""
    selected_certificates: list["_models.SelectedCertificateInput"] = rest_field(
        name="selectedCertificates", visibility=["read", "create", "update", "delete", "query"]
    )
    """List containing certificate names and corresponding password to use for encrypting the exported
     certificate. Required."""

    @overload
    def __init__(
        self,
        *,
        connection_info: "_models.SqlConnectionInfo",
        backup_file_share: "_models.FileShare",
        selected_certificates: list["_models.SelectedCertificateInput"],
    ) -> None: ...

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

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


class GetTdeCertificatesSqlTaskOutput(_Model):
    """Output of the task that gets TDE certificates in Base64 encoded format.

    :ivar base64_encoded_certificates: Mapping from certificate name to base 64 encoded format.
    :vartype base64_encoded_certificates: str
    :ivar validation_errors: Validation errors.
    :vartype validation_errors: list[~azure.mgmt.datamigration.models.ReportableException]
    """

    base64_encoded_certificates: Optional[str] = rest_field(name="base64EncodedCertificates", visibility=["read"])
    """Mapping from certificate name to base 64 encoded format."""
    validation_errors: Optional[list["_models.ReportableException"]] = rest_field(
        name="validationErrors", visibility=["read"]
    )
    """Validation errors."""


class GetTdeCertificatesSqlTaskProperties(ProjectTaskProperties, discriminator="GetTDECertificates.Sql"):
    """Properties for the task that gets TDE certificates in Base64 encoded format.

    :ivar errors: Array of errors. This is ignored if submitted.
    :vartype errors: list[~azure.mgmt.datamigration.models.ODataError]
    :ivar state: The state of the task. This is ignored if submitted. Known values are: "Unknown",
     "Queued", "Running", "Canceled", "Succeeded", "Failed", "FailedInputValidation", and "Faulted".
    :vartype state: str or ~azure.mgmt.datamigration.models.TaskState
    :ivar commands: Array of command properties.
    :vartype commands: list[~azure.mgmt.datamigration.models.CommandProperties]
    :ivar client_data: Key value pairs of client data to attach meta data information to task.
    :vartype client_data: dict[str, str]
    :ivar input: Task input.
    :vartype input: ~azure.mgmt.datamigration.models.GetTdeCertificatesSqlTaskInput
    :ivar output: Task output. This is ignored if submitted.
    :vartype output: list[~azure.mgmt.datamigration.models.GetTdeCertificatesSqlTaskOutput]
    :ivar task_type: Task type. Required. GetTDECertificates.Sql.
    :vartype task_type: str or ~azure.mgmt.datamigration.models.GET_TDE_CERTIFICATES_SQL
    """

    input: Optional["_models.GetTdeCertificatesSqlTaskInput"] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """Task input."""
    output: Optional[list["_models.GetTdeCertificatesSqlTaskOutput"]] = rest_field(visibility=["read"])
    """Task output. This is ignored if submitted."""
    task_type: Literal[TaskType.GET_TDE_CERTIFICATES_SQL] = rest_discriminator(name="taskType", visibility=["read", "create", "update", "delete", "query"])  # type: ignore
    """Task type. Required. GetTDECertificates.Sql."""

    @overload
    def __init__(
        self,
        *,
        client_data: Optional[dict[str, str]] = None,
        input: Optional["_models.GetTdeCertificatesSqlTaskInput"] = None,
    ) -> None: ...

    @overload
    def __init__(self, mapping: Mapping[str, Any]) -> None:
        """
        :param 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.task_type = TaskType.GET_TDE_CERTIFICATES_SQL  # type: ignore


class GetUserTablesMySqlTaskInput(_Model):
    """Input for the task that collects user tables for the given list of databases.

    :ivar connection_info: Connection information for SQL Server. Required.
    :vartype connection_info: ~azure.mgmt.datamigration.models.MySqlConnectionInfo
    :ivar selected_databases: List of database names to collect tables for. Required.
    :vartype selected_databases: list[str]
    """

    connection_info: "_models.MySqlConnectionInfo" = rest_field(
        name="connectionInfo", visibility=["read", "create", "update", "delete", "query"]
    )
    """Connection information for SQL Server. Required."""
    selected_databases: list[str] = rest_field(
        name="selectedDatabases", visibility=["read", "create", "update", "delete", "query"]
    )
    """List of database names to collect tables for. Required."""

    @overload
    def __init__(
        self,
        *,
        connection_info: "_models.MySqlConnectionInfo",
        selected_databases: list[str],
    ) -> None: ...

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

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


class GetUserTablesMySqlTaskOutput(_Model):
    """Output of the task that collects user tables for the given list of databases.

    :ivar id: Result identifier.
    :vartype id: str
    :ivar databases_to_tables: Mapping from database name to list of tables.
    :vartype databases_to_tables: str
    :ivar validation_errors: Validation errors.
    :vartype validation_errors: list[~azure.mgmt.datamigration.models.ReportableException]
    """

    id: Optional[str] = rest_field(visibility=["read"])
    """Result identifier."""
    databases_to_tables: Optional[str] = rest_field(name="databasesToTables", visibility=["read"])
    """Mapping from database name to list of tables."""
    validation_errors: Optional[list["_models.ReportableException"]] = rest_field(
        name="validationErrors", visibility=["read"]
    )
    """Validation errors."""


class GetUserTablesMySqlTaskProperties(ProjectTaskProperties, discriminator="GetUserTablesMySql"):
    """Properties for the task that collects user tables for the given list of databases.

    :ivar errors: Array of errors. This is ignored if submitted.
    :vartype errors: list[~azure.mgmt.datamigration.models.ODataError]
    :ivar state: The state of the task. This is ignored if submitted. Known values are: "Unknown",
     "Queued", "Running", "Canceled", "Succeeded", "Failed", "FailedInputValidation", and "Faulted".
    :vartype state: str or ~azure.mgmt.datamigration.models.TaskState
    :ivar commands: Array of command properties.
    :vartype commands: list[~azure.mgmt.datamigration.models.CommandProperties]
    :ivar client_data: Key value pairs of client data to attach meta data information to task.
    :vartype client_data: dict[str, str]
    :ivar input: Task input.
    :vartype input: ~azure.mgmt.datamigration.models.GetUserTablesMySqlTaskInput
    :ivar output: Task output. This is ignored if submitted.
    :vartype output: list[~azure.mgmt.datamigration.models.GetUserTablesMySqlTaskOutput]
    :ivar task_type: Task type. Required. GetUserTablesMySql.
    :vartype task_type: str or ~azure.mgmt.datamigration.models.GET_USER_TABLES_MY_SQL
    """

    input: Optional["_models.GetUserTablesMySqlTaskInput"] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """Task input."""
    output: Optional[list["_models.GetUserTablesMySqlTaskOutput"]] = rest_field(visibility=["read"])
    """Task output. This is ignored if submitted."""
    task_type: Literal[TaskType.GET_USER_TABLES_MY_SQL] = rest_discriminator(name="taskType", visibility=["read", "create", "update", "delete", "query"])  # type: ignore
    """Task type. Required. GetUserTablesMySql."""

    @overload
    def __init__(
        self,
        *,
        client_data: Optional[dict[str, str]] = None,
        input: Optional["_models.GetUserTablesMySqlTaskInput"] = None,
    ) -> None: ...

    @overload
    def __init__(self, mapping: Mapping[str, Any]) -> None:
        """
        :param 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.task_type = TaskType.GET_USER_TABLES_MY_SQL  # type: ignore


class GetUserTablesOracleTaskInput(_Model):
    """Input for the task that gets the list of tables contained within a provided list of Oracle
    schemas.

    :ivar connection_info: Information for connecting to Oracle source. Required.
    :vartype connection_info: ~azure.mgmt.datamigration.models.OracleConnectionInfo
    :ivar selected_schemas: List of Oracle schemas for which to collect tables. Required.
    :vartype selected_schemas: list[str]
    """

    connection_info: "_models.OracleConnectionInfo" = rest_field(
        name="connectionInfo", visibility=["read", "create", "update", "delete", "query"]
    )
    """Information for connecting to Oracle source. Required."""
    selected_schemas: list[str] = rest_field(
        name="selectedSchemas", visibility=["read", "create", "update", "delete", "query"]
    )
    """List of Oracle schemas for which to collect tables. Required."""

    @overload
    def __init__(
        self,
        *,
        connection_info: "_models.OracleConnectionInfo",
        selected_schemas: list[str],
    ) -> None: ...

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

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


class GetUserTablesOracleTaskOutput(_Model):
    """Output for the task that gets the list of tables contained within a provided list of Oracle
    schemas.

    :ivar schema_name: The schema this result is for.
    :vartype schema_name: str
    :ivar tables: List of valid tables found for this schema.
    :vartype tables: list[~azure.mgmt.datamigration.models.DatabaseTable]
    :ivar validation_errors: Validation errors associated with the task.
    :vartype validation_errors: list[~azure.mgmt.datamigration.models.ReportableException]
    """

    schema_name: Optional[str] = rest_field(name="schemaName", visibility=["read"])
    """The schema this result is for."""
    tables: Optional[list["_models.DatabaseTable"]] = rest_field(visibility=["read"])
    """List of valid tables found for this schema."""
    validation_errors: Optional[list["_models.ReportableException"]] = rest_field(
        name="validationErrors", visibility=["read"]
    )
    """Validation errors associated with the task."""


class GetUserTablesOracleTaskProperties(ProjectTaskProperties, discriminator="GetUserTablesOracle"):
    """Properties for the task that collects user tables for the given list of Oracle schemas.

    :ivar errors: Array of errors. This is ignored if submitted.
    :vartype errors: list[~azure.mgmt.datamigration.models.ODataError]
    :ivar state: The state of the task. This is ignored if submitted. Known values are: "Unknown",
     "Queued", "Running", "Canceled", "Succeeded", "Failed", "FailedInputValidation", and "Faulted".
    :vartype state: str or ~azure.mgmt.datamigration.models.TaskState
    :ivar commands: Array of command properties.
    :vartype commands: list[~azure.mgmt.datamigration.models.CommandProperties]
    :ivar client_data: Key value pairs of client data to attach meta data information to task.
    :vartype client_data: dict[str, str]
    :ivar input: Task input.
    :vartype input: ~azure.mgmt.datamigration.models.GetUserTablesOracleTaskInput
    :ivar output: Task output. This is ignored if submitted.
    :vartype output: list[~azure.mgmt.datamigration.models.GetUserTablesOracleTaskOutput]
    :ivar task_type: Task type. Required. GetUserTablesOracle.
    :vartype task_type: str or ~azure.mgmt.datamigration.models.GET_USER_TABLES_ORACLE
    """

    input: Optional["_models.GetUserTablesOracleTaskInput"] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """Task input."""
    output: Optional[list["_models.GetUserTablesOracleTaskOutput"]] = rest_field(visibility=["read"])
    """Task output. This is ignored if submitted."""
    task_type: Literal[TaskType.GET_USER_TABLES_ORACLE] = rest_discriminator(name="taskType", visibility=["read", "create", "update", "delete", "query"])  # type: ignore
    """Task type. Required. GetUserTablesOracle."""

    @overload
    def __init__(
        self,
        *,
        client_data: Optional[dict[str, str]] = None,
        input: Optional["_models.GetUserTablesOracleTaskInput"] = None,
    ) -> None: ...

    @overload
    def __init__(self, mapping: Mapping[str, Any]) -> None:
        """
        :param 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.task_type = TaskType.GET_USER_TABLES_ORACLE  # type: ignore


class GetUserTablesPostgreSqlTaskInput(_Model):
    """Input for the task that gets the list of tables for a provided list of PostgreSQL databases.

    :ivar connection_info: Information for connecting to PostgreSQL source. Required.
    :vartype connection_info: ~azure.mgmt.datamigration.models.PostgreSqlConnectionInfo
    :ivar selected_databases: List of PostgreSQL databases for which to collect tables. Required.
    :vartype selected_databases: list[str]
    """

    connection_info: "_models.PostgreSqlConnectionInfo" = rest_field(
        name="connectionInfo", visibility=["read", "create", "update", "delete", "query"]
    )
    """Information for connecting to PostgreSQL source. Required."""
    selected_databases: list[str] = rest_field(
        name="selectedDatabases", visibility=["read", "create", "update", "delete", "query"]
    )
    """List of PostgreSQL databases for which to collect tables. Required."""

    @overload
    def __init__(
        self,
        *,
        connection_info: "_models.PostgreSqlConnectionInfo",
        selected_databases: list[str],
    ) -> None: ...

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

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


class GetUserTablesPostgreSqlTaskOutput(_Model):
    """Output for the task that gets the list of tables for a provided list of PostgreSQL databases.

    :ivar database_name: The database this result is for.
    :vartype database_name: str
    :ivar tables: List of valid tables found for this database.
    :vartype tables: list[~azure.mgmt.datamigration.models.DatabaseTable]
    :ivar validation_errors: Validation errors associated with the task.
    :vartype validation_errors: list[~azure.mgmt.datamigration.models.ReportableException]
    """

    database_name: Optional[str] = rest_field(name="databaseName", visibility=["read"])
    """The database this result is for."""
    tables: Optional[list["_models.DatabaseTable"]] = rest_field(visibility=["read"])
    """List of valid tables found for this database."""
    validation_errors: Optional[list["_models.ReportableException"]] = rest_field(
        name="validationErrors", visibility=["read"]
    )
    """Validation errors associated with the task."""


class GetUserTablesPostgreSqlTaskProperties(ProjectTaskProperties, discriminator="GetUserTablesPostgreSql"):
    """Properties for the task that collects user tables for the given list of databases.

    :ivar errors: Array of errors. This is ignored if submitted.
    :vartype errors: list[~azure.mgmt.datamigration.models.ODataError]
    :ivar state: The state of the task. This is ignored if submitted. Known values are: "Unknown",
     "Queued", "Running", "Canceled", "Succeeded", "Failed", "FailedInputValidation", and "Faulted".
    :vartype state: str or ~azure.mgmt.datamigration.models.TaskState
    :ivar commands: Array of command properties.
    :vartype commands: list[~azure.mgmt.datamigration.models.CommandProperties]
    :ivar client_data: Key value pairs of client data to attach meta data information to task.
    :vartype client_data: dict[str, str]
    :ivar input: Task input.
    :vartype input: ~azure.mgmt.datamigration.models.GetUserTablesPostgreSqlTaskInput
    :ivar output: Task output. This is ignored if submitted.
    :vartype output: list[~azure.mgmt.datamigration.models.GetUserTablesPostgreSqlTaskOutput]
    :ivar task_type: Task type. Required. GetUserTablesPostgreSql.
    :vartype task_type: str or ~azure.mgmt.datamigration.models.GET_USER_TABLES_POSTGRE_SQL
    """

    input: Optional["_models.GetUserTablesPostgreSqlTaskInput"] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """Task input."""
    output: Optional[list["_models.GetUserTablesPostgreSqlTaskOutput"]] = rest_field(visibility=["read"])
    """Task output. This is ignored if submitted."""
    task_type: Literal[TaskType.GET_USER_TABLES_POSTGRE_SQL] = rest_discriminator(name="taskType", visibility=["read", "create", "update", "delete", "query"])  # type: ignore
    """Task type. Required. GetUserTablesPostgreSql."""

    @overload
    def __init__(
        self,
        *,
        client_data: Optional[dict[str, str]] = None,
        input: Optional["_models.GetUserTablesPostgreSqlTaskInput"] = None,
    ) -> None: ...

    @overload
    def __init__(self, mapping: Mapping[str, Any]) -> None:
        """
        :param 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.task_type = TaskType.GET_USER_TABLES_POSTGRE_SQL  # type: ignore


class GetUserTablesSqlSyncTaskInput(_Model):
    """Input for the task that collects user tables for the given list of databases.

    :ivar source_connection_info: Connection information for SQL Server. Required.
    :vartype source_connection_info: ~azure.mgmt.datamigration.models.SqlConnectionInfo
    :ivar target_connection_info: Connection information for SQL DB. Required.
    :vartype target_connection_info: ~azure.mgmt.datamigration.models.SqlConnectionInfo
    :ivar selected_source_databases: List of source database names to collect tables for. Required.
    :vartype selected_source_databases: list[str]
    :ivar selected_target_databases: List of target database names to collect tables for. Required.
    :vartype selected_target_databases: list[str]
    """

    source_connection_info: "_models.SqlConnectionInfo" = rest_field(
        name="sourceConnectionInfo", visibility=["read", "create", "update", "delete", "query"]
    )
    """Connection information for SQL Server. Required."""
    target_connection_info: "_models.SqlConnectionInfo" = rest_field(
        name="targetConnectionInfo", visibility=["read", "create", "update", "delete", "query"]
    )
    """Connection information for SQL DB. Required."""
    selected_source_databases: list[str] = rest_field(
        name="selectedSourceDatabases", visibility=["read", "create", "update", "delete", "query"]
    )
    """List of source database names to collect tables for. Required."""
    selected_target_databases: list[str] = rest_field(
        name="selectedTargetDatabases", visibility=["read", "create", "update", "delete", "query"]
    )
    """List of target database names to collect tables for. Required."""

    @overload
    def __init__(
        self,
        *,
        source_connection_info: "_models.SqlConnectionInfo",
        target_connection_info: "_models.SqlConnectionInfo",
        selected_source_databases: list[str],
        selected_target_databases: list[str],
    ) -> None: ...

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

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


class GetUserTablesSqlSyncTaskOutput(_Model):
    """Output of the task that collects user tables for the given list of databases.

    :ivar databases_to_source_tables: Mapping from database name to list of source tables.
    :vartype databases_to_source_tables: str
    :ivar databases_to_target_tables: Mapping from database name to list of target tables.
    :vartype databases_to_target_tables: str
    :ivar table_validation_errors: Mapping from database name to list of validation errors.
    :vartype table_validation_errors: str
    :ivar validation_errors: Validation errors.
    :vartype validation_errors: list[~azure.mgmt.datamigration.models.ReportableException]
    """

    databases_to_source_tables: Optional[str] = rest_field(name="databasesToSourceTables", visibility=["read"])
    """Mapping from database name to list of source tables."""
    databases_to_target_tables: Optional[str] = rest_field(name="databasesToTargetTables", visibility=["read"])
    """Mapping from database name to list of target tables."""
    table_validation_errors: Optional[str] = rest_field(name="tableValidationErrors", visibility=["read"])
    """Mapping from database name to list of validation errors."""
    validation_errors: Optional[list["_models.ReportableException"]] = rest_field(
        name="validationErrors", visibility=["read"]
    )
    """Validation errors."""


class GetUserTablesSqlSyncTaskProperties(ProjectTaskProperties, discriminator="GetUserTables.AzureSqlDb.Sync"):
    """Properties for the task that collects user tables for the given list of databases.

    :ivar errors: Array of errors. This is ignored if submitted.
    :vartype errors: list[~azure.mgmt.datamigration.models.ODataError]
    :ivar state: The state of the task. This is ignored if submitted. Known values are: "Unknown",
     "Queued", "Running", "Canceled", "Succeeded", "Failed", "FailedInputValidation", and "Faulted".
    :vartype state: str or ~azure.mgmt.datamigration.models.TaskState
    :ivar commands: Array of command properties.
    :vartype commands: list[~azure.mgmt.datamigration.models.CommandProperties]
    :ivar client_data: Key value pairs of client data to attach meta data information to task.
    :vartype client_data: dict[str, str]
    :ivar input: Task input.
    :vartype input: ~azure.mgmt.datamigration.models.GetUserTablesSqlSyncTaskInput
    :ivar output: Task output. This is ignored if submitted.
    :vartype output: list[~azure.mgmt.datamigration.models.GetUserTablesSqlSyncTaskOutput]
    :ivar task_type: Task type. Required. GetUserTables.AzureSqlDb.Sync.
    :vartype task_type: str or ~azure.mgmt.datamigration.models.GET_USER_TABLES_AZURE_SQL_DB_SYNC
    """

    input: Optional["_models.GetUserTablesSqlSyncTaskInput"] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """Task input."""
    output: Optional[list["_models.GetUserTablesSqlSyncTaskOutput"]] = rest_field(visibility=["read"])
    """Task output. This is ignored if submitted."""
    task_type: Literal[TaskType.GET_USER_TABLES_AZURE_SQL_DB_SYNC] = rest_discriminator(name="taskType", visibility=["read", "create", "update", "delete", "query"])  # type: ignore
    """Task type. Required. GetUserTables.AzureSqlDb.Sync."""

    @overload
    def __init__(
        self,
        *,
        client_data: Optional[dict[str, str]] = None,
        input: Optional["_models.GetUserTablesSqlSyncTaskInput"] = None,
    ) -> None: ...

    @overload
    def __init__(self, mapping: Mapping[str, Any]) -> None:
        """
        :param 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.task_type = TaskType.GET_USER_TABLES_AZURE_SQL_DB_SYNC  # type: ignore


class GetUserTablesSqlTaskInput(_Model):
    """Input for the task that collects user tables for the given list of databases.

    :ivar connection_info: Connection information for SQL Server. Required.
    :vartype connection_info: ~azure.mgmt.datamigration.models.SqlConnectionInfo
    :ivar selected_databases: List of database names to collect tables for. Required.
    :vartype selected_databases: list[str]
    :ivar encrypted_key_for_secure_fields: encrypted key for secure fields.
    :vartype encrypted_key_for_secure_fields: str
    """

    connection_info: "_models.SqlConnectionInfo" = rest_field(
        name="connectionInfo", visibility=["read", "create", "update", "delete", "query"]
    )
    """Connection information for SQL Server. Required."""
    selected_databases: list[str] = rest_field(
        name="selectedDatabases", visibility=["read", "create", "update", "delete", "query"]
    )
    """List of database names to collect tables for. Required."""
    encrypted_key_for_secure_fields: Optional[str] = rest_field(
        name="encryptedKeyForSecureFields", visibility=["read", "create", "update", "delete", "query"]
    )
    """encrypted key for secure fields."""

    @overload
    def __init__(
        self,
        *,
        connection_info: "_models.SqlConnectionInfo",
        selected_databases: list[str],
        encrypted_key_for_secure_fields: 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 GetUserTablesSqlTaskOutput(_Model):
    """Output of the task that collects user tables for the given list of databases.

    :ivar id: Result identifier.
    :vartype id: str
    :ivar databases_to_tables: Mapping from database name to list of tables.
    :vartype databases_to_tables: str
    :ivar validation_errors: Validation errors.
    :vartype validation_errors: list[~azure.mgmt.datamigration.models.ReportableException]
    """

    id: Optional[str] = rest_field(visibility=["read"])
    """Result identifier."""
    databases_to_tables: Optional[str] = rest_field(name="databasesToTables", visibility=["read"])
    """Mapping from database name to list of tables."""
    validation_errors: Optional[list["_models.ReportableException"]] = rest_field(
        name="validationErrors", visibility=["read"]
    )
    """Validation errors."""


class GetUserTablesSqlTaskProperties(ProjectTaskProperties, discriminator="GetUserTables.Sql"):
    """Properties for the task that collects user tables for the given list of databases.

    :ivar errors: Array of errors. This is ignored if submitted.
    :vartype errors: list[~azure.mgmt.datamigration.models.ODataError]
    :ivar state: The state of the task. This is ignored if submitted. Known values are: "Unknown",
     "Queued", "Running", "Canceled", "Succeeded", "Failed", "FailedInputValidation", and "Faulted".
    :vartype state: str or ~azure.mgmt.datamigration.models.TaskState
    :ivar commands: Array of command properties.
    :vartype commands: list[~azure.mgmt.datamigration.models.CommandProperties]
    :ivar client_data: Key value pairs of client data to attach meta data information to task.
    :vartype client_data: dict[str, str]
    :ivar input: Task input.
    :vartype input: ~azure.mgmt.datamigration.models.GetUserTablesSqlTaskInput
    :ivar output: Task output. This is ignored if submitted.
    :vartype output: list[~azure.mgmt.datamigration.models.GetUserTablesSqlTaskOutput]
    :ivar task_id: Task id.
    :vartype task_id: str
    :ivar task_type: Task type. Required. GetUserTables.Sql.
    :vartype task_type: str or ~azure.mgmt.datamigration.models.GET_USER_TABLES_SQL
    """

    input: Optional["_models.GetUserTablesSqlTaskInput"] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """Task input."""
    output: Optional[list["_models.GetUserTablesSqlTaskOutput"]] = rest_field(visibility=["read"])
    """Task output. This is ignored if submitted."""
    task_id: Optional[str] = rest_field(name="taskId", visibility=["read", "create", "update", "delete", "query"])
    """Task id."""
    task_type: Literal[TaskType.GET_USER_TABLES_SQL] = rest_discriminator(name="taskType", visibility=["read", "create", "update", "delete", "query"])  # type: ignore
    """Task type. Required. GetUserTables.Sql."""

    @overload
    def __init__(
        self,
        *,
        client_data: Optional[dict[str, str]] = None,
        input: Optional["_models.GetUserTablesSqlTaskInput"] = None,
        task_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)
        self.task_type = TaskType.GET_USER_TABLES_SQL  # type: ignore


class InstallOCIDriverTaskInput(_Model):
    """Input for the service task to install an OCI driver.

    :ivar driver_package_name: Name of the uploaded driver package to install.
    :vartype driver_package_name: str
    """

    driver_package_name: Optional[str] = rest_field(
        name="driverPackageName", visibility=["read", "create", "update", "delete", "query"]
    )
    """Name of the uploaded driver package to install."""

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

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

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


class InstallOCIDriverTaskOutput(_Model):
    """Output for the service task to install an OCI driver.

    :ivar validation_errors: Validation errors.
    :vartype validation_errors: list[~azure.mgmt.datamigration.models.ReportableException]
    """

    validation_errors: Optional[list["_models.ReportableException"]] = rest_field(
        name="validationErrors", visibility=["read"]
    )
    """Validation errors."""


class InstallOCIDriverTaskProperties(ProjectTaskProperties, discriminator="Service.Install.OCI"):
    """Properties for the task that installs an OCI driver.

    :ivar errors: Array of errors. This is ignored if submitted.
    :vartype errors: list[~azure.mgmt.datamigration.models.ODataError]
    :ivar state: The state of the task. This is ignored if submitted. Known values are: "Unknown",
     "Queued", "Running", "Canceled", "Succeeded", "Failed", "FailedInputValidation", and "Faulted".
    :vartype state: str or ~azure.mgmt.datamigration.models.TaskState
    :ivar commands: Array of command properties.
    :vartype commands: list[~azure.mgmt.datamigration.models.CommandProperties]
    :ivar client_data: Key value pairs of client data to attach meta data information to task.
    :vartype client_data: dict[str, str]
    :ivar input: Input for the service task to install an OCI driver.
    :vartype input: ~azure.mgmt.datamigration.models.InstallOCIDriverTaskInput
    :ivar output: Task output. This is ignored if submitted.
    :vartype output: list[~azure.mgmt.datamigration.models.InstallOCIDriverTaskOutput]
    :ivar task_type: Task type. Required. Service.Install.OCI.
    :vartype task_type: str or ~azure.mgmt.datamigration.models.SERVICE_INSTALL_OCI
    """

    input: Optional["_models.InstallOCIDriverTaskInput"] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """Input for the service task to install an OCI driver."""
    output: Optional[list["_models.InstallOCIDriverTaskOutput"]] = rest_field(visibility=["read"])
    """Task output. This is ignored if submitted."""
    task_type: Literal[TaskType.SERVICE_INSTALL_OCI] = rest_discriminator(name="taskType", visibility=["read", "create", "update", "delete", "query"])  # type: ignore
    """Task type. Required. Service.Install.OCI."""

    @overload
    def __init__(
        self,
        *,
        client_data: Optional[dict[str, str]] = None,
        input: Optional["_models.InstallOCIDriverTaskInput"] = None,
    ) -> None: ...

    @overload
    def __init__(self, mapping: Mapping[str, Any]) -> None:
        """
        :param 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.task_type = TaskType.SERVICE_INSTALL_OCI  # type: ignore


class IntegrationRuntimeMonitoringData(_Model):
    """Integration Runtime Monitoring Data.

    :ivar name: The name of Integration Runtime.
    :vartype name: str
    :ivar nodes: Integration Runtime node monitoring data.
    :vartype nodes: list[~azure.mgmt.datamigration.models.NodeMonitoringData]
    """

    name: Optional[str] = rest_field(visibility=["read"])
    """The name of Integration Runtime."""
    nodes: Optional[list["_models.NodeMonitoringData"]] = rest_field(visibility=["read"])
    """Integration Runtime node monitoring data."""


class ManagedServiceIdentity(_Model):
    """Managed service identity (system assigned and/or user assigned identities).

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

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

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

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

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


class MigrateMISyncCompleteCommandInput(_Model):
    """Input for command that completes online migration for an Azure SQL Database Managed Instance.

    :ivar source_database_name: Name of managed instance database. Required.
    :vartype source_database_name: str
    """

    source_database_name: str = rest_field(
        name="sourceDatabaseName", visibility=["read", "create", "update", "delete", "query"]
    )
    """Name of managed instance database. Required."""

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

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

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


class MigrateMISyncCompleteCommandOutput(_Model):
    """Output for command that completes online migration for an Azure SQL Database Managed Instance.

    :ivar errors: List of errors that happened during the command execution.
    :vartype errors: list[~azure.mgmt.datamigration.models.ReportableException]
    """

    errors: Optional[list["_models.ReportableException"]] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """List of errors that happened during the command execution."""

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

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

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


class MigrateMISyncCompleteCommandProperties(
    CommandProperties, discriminator="Migrate.SqlServer.AzureDbSqlMi.Complete"
):
    """Properties for the command that completes online migration for an Azure SQL Database Managed
    Instance.

    :ivar errors: Array of errors. This is ignored if submitted.
    :vartype errors: list[~azure.mgmt.datamigration.models.ODataError]
    :ivar state: The state of the command. This is ignored if submitted. Known values are:
     "Unknown", "Accepted", "Running", "Succeeded", and "Failed".
    :vartype state: str or ~azure.mgmt.datamigration.models.CommandState
    :ivar input: Command input.
    :vartype input: ~azure.mgmt.datamigration.models.MigrateMISyncCompleteCommandInput
    :ivar output: Command output. This is ignored if submitted.
    :vartype output: ~azure.mgmt.datamigration.models.MigrateMISyncCompleteCommandOutput
    :ivar command_type: Command type. Required. Migrate.SqlServer.AzureDbSqlMi.Complete.
    :vartype command_type: str or
     ~azure.mgmt.datamigration.models.MIGRATE_SQL_SERVER_AZURE_DB_SQL_MI_COMPLETE
    """

    input: Optional["_models.MigrateMISyncCompleteCommandInput"] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """Command input."""
    output: Optional["_models.MigrateMISyncCompleteCommandOutput"] = rest_field(visibility=["read"])
    """Command output. This is ignored if submitted."""
    command_type: Literal[CommandType.MIGRATE_SQL_SERVER_AZURE_DB_SQL_MI_COMPLETE] = rest_discriminator(name="commandType", visibility=["read", "create", "update", "delete", "query"])  # type: ignore
    """Command type. Required. Migrate.SqlServer.AzureDbSqlMi.Complete."""

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

    @overload
    def __init__(self, mapping: Mapping[str, Any]) -> None:
        """
        :param 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.command_type = CommandType.MIGRATE_SQL_SERVER_AZURE_DB_SQL_MI_COMPLETE  # type: ignore


class MigrateMongoDbTaskProperties(ProjectTaskProperties, discriminator="Migrate.MongoDb"):
    """Properties for the task that migrates data between MongoDB data sources.

    :ivar errors: Array of errors. This is ignored if submitted.
    :vartype errors: list[~azure.mgmt.datamigration.models.ODataError]
    :ivar state: The state of the task. This is ignored if submitted. Known values are: "Unknown",
     "Queued", "Running", "Canceled", "Succeeded", "Failed", "FailedInputValidation", and "Faulted".
    :vartype state: str or ~azure.mgmt.datamigration.models.TaskState
    :ivar commands: Array of command properties.
    :vartype commands: list[~azure.mgmt.datamigration.models.CommandProperties]
    :ivar client_data: Key value pairs of client data to attach meta data information to task.
    :vartype client_data: dict[str, str]
    :ivar input: Describes how a MongoDB data migration should be performed.
    :vartype input: ~azure.mgmt.datamigration.models.MongoDbMigrationSettings
    :ivar output:
    :vartype output: list[~azure.mgmt.datamigration.models.MongoDbProgress]
    :ivar task_type: Task type. Required. Migrate.MongoDb.
    :vartype task_type: str or ~azure.mgmt.datamigration.models.MIGRATE_MONGO_DB
    """

    input: Optional["_models.MongoDbMigrationSettings"] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """Describes how a MongoDB data migration should be performed."""
    output: Optional[list["_models.MongoDbProgress"]] = rest_field(visibility=["read"])
    task_type: Literal[TaskType.MIGRATE_MONGO_DB] = rest_discriminator(name="taskType", visibility=["read", "create", "update", "delete", "query"])  # type: ignore
    """Task type. Required. Migrate.MongoDb."""

    @overload
    def __init__(
        self,
        *,
        client_data: Optional[dict[str, str]] = None,
        input: Optional["_models.MongoDbMigrationSettings"] = None,
    ) -> None: ...

    @overload
    def __init__(self, mapping: Mapping[str, Any]) -> None:
        """
        :param 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.task_type = TaskType.MIGRATE_MONGO_DB  # type: ignore


class MigrateMySqlAzureDbForMySqlOfflineDatabaseInput(_Model):  # pylint: disable=name-too-long
    """Database specific information for offline MySQL to Azure Database for MySQL migration task
    inputs.

    :ivar name: Name of the database.
    :vartype name: str
    :ivar target_database_name: Name of target database. Note: Target database will be truncated
     before starting migration.
    :vartype target_database_name: str
    :ivar table_map: Mapping of source to target tables.
    :vartype table_map: dict[str, str]
    """

    name: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """Name of the database."""
    target_database_name: Optional[str] = rest_field(
        name="targetDatabaseName", visibility=["read", "create", "update", "delete", "query"]
    )
    """Name of target database. Note: Target database will be truncated before starting migration."""
    table_map: Optional[dict[str, str]] = rest_field(
        name="tableMap", visibility=["read", "create", "update", "delete", "query"]
    )
    """Mapping of source to target tables."""

    @overload
    def __init__(
        self,
        *,
        name: Optional[str] = None,
        target_database_name: Optional[str] = None,
        table_map: 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 MigrateMySqlAzureDbForMySqlOfflineTaskInput(_Model):  # pylint: disable=name-too-long
    """Input for the task that migrates MySQL databases to Azure Database for MySQL for offline
    migrations.

    :ivar source_connection_info: Connection information for source MySQL. Required.
    :vartype source_connection_info: ~azure.mgmt.datamigration.models.MySqlConnectionInfo
    :ivar target_connection_info: Connection information for target Azure Database for MySQL.
     Required.
    :vartype target_connection_info: ~azure.mgmt.datamigration.models.MySqlConnectionInfo
    :ivar selected_databases: Databases to migrate. Required.
    :vartype selected_databases:
     list[~azure.mgmt.datamigration.models.MigrateMySqlAzureDbForMySqlOfflineDatabaseInput]
    :ivar make_source_server_read_only: Setting to set the source server read only.
    :vartype make_source_server_read_only: bool
    :ivar started_on: Parameter to specify when the migration started.
    :vartype started_on: ~datetime.datetime
    :ivar optional_agent_settings: Optional parameters for fine tuning the data transfer rate
     during migration.
    :vartype optional_agent_settings: dict[str, str]
    :ivar encrypted_key_for_secure_fields: encrypted key for secure fields.
    :vartype encrypted_key_for_secure_fields: str
    """

    source_connection_info: "_models.MySqlConnectionInfo" = rest_field(
        name="sourceConnectionInfo", visibility=["read", "create", "update", "delete", "query"]
    )
    """Connection information for source MySQL. Required."""
    target_connection_info: "_models.MySqlConnectionInfo" = rest_field(
        name="targetConnectionInfo", visibility=["read", "create", "update", "delete", "query"]
    )
    """Connection information for target Azure Database for MySQL. Required."""
    selected_databases: list["_models.MigrateMySqlAzureDbForMySqlOfflineDatabaseInput"] = rest_field(
        name="selectedDatabases", visibility=["read", "create", "update", "delete", "query"]
    )
    """Databases to migrate. Required."""
    make_source_server_read_only: Optional[bool] = rest_field(
        name="makeSourceServerReadOnly", visibility=["read", "create", "update", "delete", "query"]
    )
    """Setting to set the source server read only."""
    started_on: Optional[datetime.datetime] = rest_field(
        name="startedOn", visibility=["read", "create", "update", "delete", "query"], format="rfc3339"
    )
    """Parameter to specify when the migration started."""
    optional_agent_settings: Optional[dict[str, str]] = rest_field(
        name="optionalAgentSettings", visibility=["read", "create", "update", "delete", "query"]
    )
    """Optional parameters for fine tuning the data transfer rate during migration."""
    encrypted_key_for_secure_fields: Optional[str] = rest_field(
        name="encryptedKeyForSecureFields", visibility=["read", "create", "update", "delete", "query"]
    )
    """encrypted key for secure fields."""

    @overload
    def __init__(
        self,
        *,
        source_connection_info: "_models.MySqlConnectionInfo",
        target_connection_info: "_models.MySqlConnectionInfo",
        selected_databases: list["_models.MigrateMySqlAzureDbForMySqlOfflineDatabaseInput"],
        make_source_server_read_only: Optional[bool] = None,
        started_on: Optional[datetime.datetime] = None,
        optional_agent_settings: Optional[dict[str, str]] = None,
        encrypted_key_for_secure_fields: 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 MigrateMySqlAzureDbForMySqlOfflineTaskOutput(_Model):  # pylint: disable=name-too-long
    """Output for the task that migrates MySQL databases to Azure Database for MySQL for offline
    migrations.

    You probably want to use the sub-classes and not this class directly. Known sub-classes are:
    MigrateMySqlAzureDbForMySqlOfflineTaskOutputDatabaseLevel,
    MigrateMySqlAzureDbForMySqlOfflineTaskOutputError,
    MigrateMySqlAzureDbForMySqlOfflineTaskOutputMigrationLevel,
    MigrateMySqlAzureDbForMySqlOfflineTaskOutputTableLevel

    :ivar id: Result identifier.
    :vartype id: str
    :ivar result_type: Result type. Required. Default value is None.
    :vartype result_type: str
    """

    __mapping__: dict[str, _Model] = {}
    id: Optional[str] = rest_field(visibility=["read"])
    """Result identifier."""
    result_type: str = rest_discriminator(name="resultType", visibility=["read", "create", "update", "delete", "query"])
    """Result type. Required. Default value is None."""

    @overload
    def __init__(
        self,
        *,
        result_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 MigrateMySqlAzureDbForMySqlOfflineTaskOutputDatabaseLevel(
    MigrateMySqlAzureDbForMySqlOfflineTaskOutput, discriminator="DatabaseLevelOutput"
):  # pylint: disable=name-too-long
    """MigrateMySqlAzureDbForMySqlOfflineTaskOutputDatabaseLevel.

    :ivar id: Result identifier.
    :vartype id: str
    :ivar database_name: Name of the database.
    :vartype database_name: str
    :ivar started_on: Migration start time.
    :vartype started_on: ~datetime.datetime
    :ivar ended_on: Migration end time.
    :vartype ended_on: ~datetime.datetime
    :ivar state: Current state of migration. Known values are: "None", "InProgress", "Failed",
     "Warning", "Completed", "Skipped", and "Stopped".
    :vartype state: str or ~azure.mgmt.datamigration.models.MigrationState
    :ivar stage: Migration stage that this database is in. Known values are: "None", "Initialize",
     "Backup", "FileCopy", "Restore", and "Completed".
    :vartype stage: str or ~azure.mgmt.datamigration.models.DatabaseMigrationStage
    :ivar status_message: Status message.
    :vartype status_message: str
    :ivar message: Migration progress message.
    :vartype message: str
    :ivar number_of_objects: Number of objects.
    :vartype number_of_objects: int
    :ivar number_of_objects_completed: Number of successfully completed objects.
    :vartype number_of_objects_completed: int
    :ivar error_count: Number of database/object errors.
    :vartype error_count: int
    :ivar error_prefix: Wildcard string prefix to use for querying all errors of the item.
    :vartype error_prefix: str
    :ivar result_prefix: Wildcard string prefix to use for querying all sub-tem results of the
     item.
    :vartype result_prefix: str
    :ivar exceptions_and_warnings: Migration exceptions and warnings.
    :vartype exceptions_and_warnings: list[~azure.mgmt.datamigration.models.ReportableException]
    :ivar last_storage_update: Last time the storage was updated.
    :vartype last_storage_update: ~datetime.datetime
    :ivar object_summary: Summary of object results in the migration.
    :vartype object_summary: str
    :ivar result_type: Result type. Required. Default value is "DatabaseLevelOutput".
    :vartype result_type: str
    """

    database_name: Optional[str] = rest_field(name="databaseName", visibility=["read"])
    """Name of the database."""
    started_on: Optional[datetime.datetime] = rest_field(name="startedOn", visibility=["read"], format="rfc3339")
    """Migration start time."""
    ended_on: Optional[datetime.datetime] = rest_field(name="endedOn", visibility=["read"], format="rfc3339")
    """Migration end time."""
    state: Optional[Union[str, "_models.MigrationState"]] = rest_field(visibility=["read"])
    """Current state of migration. Known values are: \"None\", \"InProgress\", \"Failed\",
     \"Warning\", \"Completed\", \"Skipped\", and \"Stopped\"."""
    stage: Optional[Union[str, "_models.DatabaseMigrationStage"]] = rest_field(visibility=["read"])
    """Migration stage that this database is in. Known values are: \"None\", \"Initialize\",
     \"Backup\", \"FileCopy\", \"Restore\", and \"Completed\"."""
    status_message: Optional[str] = rest_field(name="statusMessage", visibility=["read"])
    """Status message."""
    message: Optional[str] = rest_field(visibility=["read"])
    """Migration progress message."""
    number_of_objects: Optional[int] = rest_field(name="numberOfObjects", visibility=["read"])
    """Number of objects."""
    number_of_objects_completed: Optional[int] = rest_field(name="numberOfObjectsCompleted", visibility=["read"])
    """Number of successfully completed objects."""
    error_count: Optional[int] = rest_field(name="errorCount", visibility=["read"])
    """Number of database/object errors."""
    error_prefix: Optional[str] = rest_field(name="errorPrefix", visibility=["read"])
    """Wildcard string prefix to use for querying all errors of the item."""
    result_prefix: Optional[str] = rest_field(name="resultPrefix", visibility=["read"])
    """Wildcard string prefix to use for querying all sub-tem results of the item."""
    exceptions_and_warnings: Optional[list["_models.ReportableException"]] = rest_field(
        name="exceptionsAndWarnings", visibility=["read"]
    )
    """Migration exceptions and warnings."""
    last_storage_update: Optional[datetime.datetime] = rest_field(
        name="lastStorageUpdate", visibility=["read"], format="rfc3339"
    )
    """Last time the storage was updated."""
    object_summary: Optional[str] = rest_field(name="objectSummary", visibility=["read"])
    """Summary of object results in the migration."""
    result_type: Literal["DatabaseLevelOutput"] = rest_discriminator(name="resultType", visibility=["read", "create", "update", "delete", "query"])  # type: ignore
    """Result type. Required. Default value is \"DatabaseLevelOutput\"."""

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

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

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


class MigrateMySqlAzureDbForMySqlOfflineTaskOutputError(
    MigrateMySqlAzureDbForMySqlOfflineTaskOutput, discriminator="ErrorOutput"
):  # pylint: disable=name-too-long
    """MigrateMySqlAzureDbForMySqlOfflineTaskOutputError.

    :ivar id: Result identifier.
    :vartype id: str
    :ivar error: Migration error.
    :vartype error: ~azure.mgmt.datamigration.models.ReportableException
    :ivar result_type: Result type. Required. Default value is "ErrorOutput".
    :vartype result_type: str
    """

    error: Optional["_models.ReportableException"] = rest_field(visibility=["read"])
    """Migration error."""
    result_type: Literal["ErrorOutput"] = rest_discriminator(name="resultType", visibility=["read", "create", "update", "delete", "query"])  # type: ignore
    """Result type. Required. Default value is \"ErrorOutput\"."""

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

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

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


class MigrateMySqlAzureDbForMySqlOfflineTaskOutputMigrationLevel(
    MigrateMySqlAzureDbForMySqlOfflineTaskOutput, discriminator="MigrationLevelOutput"
):  # pylint: disable=name-too-long
    """MigrateMySqlAzureDbForMySqlOfflineTaskOutputMigrationLevel.

    :ivar id: Result identifier.
    :vartype id: str
    :ivar started_on: Migration start time.
    :vartype started_on: ~datetime.datetime
    :ivar ended_on: Migration end time.
    :vartype ended_on: ~datetime.datetime
    :ivar duration_in_seconds: Duration of task execution in seconds.
    :vartype duration_in_seconds: int
    :ivar status: Current status of migration. Known values are: "Default", "Connecting",
     "SourceAndTargetSelected", "SelectLogins", "Configured", "Running", "Error", "Stopped",
     "Completed", and "CompletedWithWarnings".
    :vartype status: str or ~azure.mgmt.datamigration.models.MigrationStatus
    :ivar status_message: Migration status message.
    :vartype status_message: str
    :ivar message: Migration progress message.
    :vartype message: str
    :ivar databases: Selected databases as a map from database name to database id.
    :vartype databases: str
    :ivar database_summary: Summary of database results in the migration.
    :vartype database_summary: str
    :ivar migration_report_result: Migration Report Result, provides unique url for downloading
     your migration report.
    :vartype migration_report_result: ~azure.mgmt.datamigration.models.MigrationReportResult
    :ivar source_server_version: Source server version.
    :vartype source_server_version: str
    :ivar source_server_brand_version: Source server brand version.
    :vartype source_server_brand_version: str
    :ivar target_server_version: Target server version.
    :vartype target_server_version: str
    :ivar target_server_brand_version: Target server brand version.
    :vartype target_server_brand_version: str
    :ivar exceptions_and_warnings: Migration exceptions and warnings.
    :vartype exceptions_and_warnings: list[~azure.mgmt.datamigration.models.ReportableException]
    :ivar last_storage_update: Last time the storage was updated.
    :vartype last_storage_update: ~datetime.datetime
    :ivar result_type: Result type. Required. Default value is "MigrationLevelOutput".
    :vartype result_type: str
    """

    started_on: Optional[datetime.datetime] = rest_field(name="startedOn", visibility=["read"], format="rfc3339")
    """Migration start time."""
    ended_on: Optional[datetime.datetime] = rest_field(name="endedOn", visibility=["read"], format="rfc3339")
    """Migration end time."""
    duration_in_seconds: Optional[int] = rest_field(name="durationInSeconds", visibility=["read"])
    """Duration of task execution in seconds."""
    status: Optional[Union[str, "_models.MigrationStatus"]] = rest_field(visibility=["read"])
    """Current status of migration. Known values are: \"Default\", \"Connecting\",
     \"SourceAndTargetSelected\", \"SelectLogins\", \"Configured\", \"Running\", \"Error\",
     \"Stopped\", \"Completed\", and \"CompletedWithWarnings\"."""
    status_message: Optional[str] = rest_field(name="statusMessage", visibility=["read"])
    """Migration status message."""
    message: Optional[str] = rest_field(visibility=["read"])
    """Migration progress message."""
    databases: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """Selected databases as a map from database name to database id."""
    database_summary: Optional[str] = rest_field(name="databaseSummary", visibility=["read"])
    """Summary of database results in the migration."""
    migration_report_result: Optional["_models.MigrationReportResult"] = rest_field(
        name="migrationReportResult", visibility=["read", "create", "update", "delete", "query"]
    )
    """Migration Report Result, provides unique url for downloading your migration report."""
    source_server_version: Optional[str] = rest_field(name="sourceServerVersion", visibility=["read"])
    """Source server version."""
    source_server_brand_version: Optional[str] = rest_field(name="sourceServerBrandVersion", visibility=["read"])
    """Source server brand version."""
    target_server_version: Optional[str] = rest_field(name="targetServerVersion", visibility=["read"])
    """Target server version."""
    target_server_brand_version: Optional[str] = rest_field(name="targetServerBrandVersion", visibility=["read"])
    """Target server brand version."""
    exceptions_and_warnings: Optional[list["_models.ReportableException"]] = rest_field(
        name="exceptionsAndWarnings", visibility=["read"]
    )
    """Migration exceptions and warnings."""
    last_storage_update: Optional[datetime.datetime] = rest_field(
        name="lastStorageUpdate", visibility=["read"], format="rfc3339"
    )
    """Last time the storage was updated."""
    result_type: Literal["MigrationLevelOutput"] = rest_discriminator(name="resultType", visibility=["read", "create", "update", "delete", "query"])  # type: ignore
    """Result type. Required. Default value is \"MigrationLevelOutput\"."""

    @overload
    def __init__(
        self,
        *,
        databases: Optional[str] = None,
        migration_report_result: Optional["_models.MigrationReportResult"] = None,
    ) -> None: ...

    @overload
    def __init__(self, mapping: Mapping[str, Any]) -> None:
        """
        :param 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.result_type = "MigrationLevelOutput"  # type: ignore


class MigrateMySqlAzureDbForMySqlOfflineTaskOutputTableLevel(
    MigrateMySqlAzureDbForMySqlOfflineTaskOutput, discriminator="TableLevelOutput"
):  # pylint: disable=name-too-long
    """MigrateMySqlAzureDbForMySqlOfflineTaskOutputTableLevel.

    :ivar id: Result identifier.
    :vartype id: str
    :ivar object_name: Name of the item.
    :vartype object_name: str
    :ivar started_on: Migration start time.
    :vartype started_on: ~datetime.datetime
    :ivar ended_on: Migration end time.
    :vartype ended_on: ~datetime.datetime
    :ivar state: Current state of migration. Known values are: "None", "InProgress", "Failed",
     "Warning", "Completed", "Skipped", and "Stopped".
    :vartype state: str or ~azure.mgmt.datamigration.models.MigrationState
    :ivar status_message: Status message.
    :vartype status_message: str
    :ivar items_count: Number of items.
    :vartype items_count: int
    :ivar items_completed_count: Number of successfully completed items.
    :vartype items_completed_count: int
    :ivar error_prefix: Wildcard string prefix to use for querying all errors of the item.
    :vartype error_prefix: str
    :ivar result_prefix: Wildcard string prefix to use for querying all sub-tem results of the
     item.
    :vartype result_prefix: str
    :ivar last_storage_update: Last time the storage was updated.
    :vartype last_storage_update: ~datetime.datetime
    :ivar result_type: Result type. Required. Default value is "TableLevelOutput".
    :vartype result_type: str
    """

    object_name: Optional[str] = rest_field(name="objectName", visibility=["read"])
    """Name of the item."""
    started_on: Optional[datetime.datetime] = rest_field(name="startedOn", visibility=["read"], format="rfc3339")
    """Migration start time."""
    ended_on: Optional[datetime.datetime] = rest_field(name="endedOn", visibility=["read"], format="rfc3339")
    """Migration end time."""
    state: Optional[Union[str, "_models.MigrationState"]] = rest_field(visibility=["read"])
    """Current state of migration. Known values are: \"None\", \"InProgress\", \"Failed\",
     \"Warning\", \"Completed\", \"Skipped\", and \"Stopped\"."""
    status_message: Optional[str] = rest_field(name="statusMessage", visibility=["read"])
    """Status message."""
    items_count: Optional[int] = rest_field(name="itemsCount", visibility=["read"])
    """Number of items."""
    items_completed_count: Optional[int] = rest_field(name="itemsCompletedCount", visibility=["read"])
    """Number of successfully completed items."""
    error_prefix: Optional[str] = rest_field(name="errorPrefix", visibility=["read"])
    """Wildcard string prefix to use for querying all errors of the item."""
    result_prefix: Optional[str] = rest_field(name="resultPrefix", visibility=["read"])
    """Wildcard string prefix to use for querying all sub-tem results of the item."""
    last_storage_update: Optional[datetime.datetime] = rest_field(
        name="lastStorageUpdate", visibility=["read"], format="rfc3339"
    )
    """Last time the storage was updated."""
    result_type: Literal["TableLevelOutput"] = rest_discriminator(name="resultType", visibility=["read", "create", "update", "delete", "query"])  # type: ignore
    """Result type. Required. Default value is \"TableLevelOutput\"."""

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

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

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


class MigrateMySqlAzureDbForMySqlOfflineTaskProperties(
    ProjectTaskProperties, discriminator="Migrate.MySql.AzureDbForMySql"
):  # pylint: disable=name-too-long
    """Properties for the task that migrates MySQL databases to Azure Database for MySQL for offline
    migrations.

    :ivar errors: Array of errors. This is ignored if submitted.
    :vartype errors: list[~azure.mgmt.datamigration.models.ODataError]
    :ivar state: The state of the task. This is ignored if submitted. Known values are: "Unknown",
     "Queued", "Running", "Canceled", "Succeeded", "Failed", "FailedInputValidation", and "Faulted".
    :vartype state: str or ~azure.mgmt.datamigration.models.TaskState
    :ivar commands: Array of command properties.
    :vartype commands: list[~azure.mgmt.datamigration.models.CommandProperties]
    :ivar client_data: Key value pairs of client data to attach meta data information to task.
    :vartype client_data: dict[str, str]
    :ivar input: Task input.
    :vartype input: ~azure.mgmt.datamigration.models.MigrateMySqlAzureDbForMySqlOfflineTaskInput
    :ivar output: Task output. This is ignored if submitted.
    :vartype output:
     list[~azure.mgmt.datamigration.models.MigrateMySqlAzureDbForMySqlOfflineTaskOutput]
    :ivar is_cloneable: whether the task can be cloned or not.
    :vartype is_cloneable: bool
    :ivar task_id: Task id.
    :vartype task_id: str
    :ivar task_type: Task type. Required. Migrate.MySql.AzureDbForMySql.
    :vartype task_type: str or ~azure.mgmt.datamigration.models.MIGRATE_MY_SQL_AZURE_DB_FOR_MY_SQL
    """

    input: Optional["_models.MigrateMySqlAzureDbForMySqlOfflineTaskInput"] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """Task input."""
    output: Optional[list["_models.MigrateMySqlAzureDbForMySqlOfflineTaskOutput"]] = rest_field(visibility=["read"])
    """Task output. This is ignored if submitted."""
    is_cloneable: Optional[bool] = rest_field(
        name="isCloneable", visibility=["read", "create", "update", "delete", "query"]
    )
    """whether the task can be cloned or not."""
    task_id: Optional[str] = rest_field(name="taskId", visibility=["read", "create", "update", "delete", "query"])
    """Task id."""
    task_type: Literal[TaskType.MIGRATE_MY_SQL_AZURE_DB_FOR_MY_SQL] = rest_discriminator(name="taskType", visibility=["read", "create", "update", "delete", "query"])  # type: ignore
    """Task type. Required. Migrate.MySql.AzureDbForMySql."""

    @overload
    def __init__(
        self,
        *,
        client_data: Optional[dict[str, str]] = None,
        input: Optional["_models.MigrateMySqlAzureDbForMySqlOfflineTaskInput"] = None,
        is_cloneable: Optional[bool] = None,
        task_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)
        self.task_type = TaskType.MIGRATE_MY_SQL_AZURE_DB_FOR_MY_SQL  # type: ignore


class MigrateMySqlAzureDbForMySqlSyncDatabaseInput(_Model):  # pylint: disable=name-too-long
    """Database specific information for MySQL to Azure Database for MySQL migration task inputs.

    :ivar name: Name of the database.
    :vartype name: str
    :ivar target_database_name: Name of target database. Note: Target database will be truncated
     before starting migration.
    :vartype target_database_name: str
    :ivar migration_setting: Migration settings which tune the migration behavior.
    :vartype migration_setting: dict[str, str]
    :ivar source_setting: Source settings to tune source endpoint migration behavior.
    :vartype source_setting: dict[str, str]
    :ivar target_setting: Target settings to tune target endpoint migration behavior.
    :vartype target_setting: dict[str, str]
    :ivar table_map: Mapping of source to target tables.
    :vartype table_map: dict[str, str]
    """

    name: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """Name of the database."""
    target_database_name: Optional[str] = rest_field(
        name="targetDatabaseName", visibility=["read", "create", "update", "delete", "query"]
    )
    """Name of target database. Note: Target database will be truncated before starting migration."""
    migration_setting: Optional[dict[str, str]] = rest_field(
        name="migrationSetting", visibility=["read", "create", "update", "delete", "query"]
    )
    """Migration settings which tune the migration behavior."""
    source_setting: Optional[dict[str, str]] = rest_field(
        name="sourceSetting", visibility=["read", "create", "update", "delete", "query"]
    )
    """Source settings to tune source endpoint migration behavior."""
    target_setting: Optional[dict[str, str]] = rest_field(
        name="targetSetting", visibility=["read", "create", "update", "delete", "query"]
    )
    """Target settings to tune target endpoint migration behavior."""
    table_map: Optional[dict[str, str]] = rest_field(
        name="tableMap", visibility=["read", "create", "update", "delete", "query"]
    )
    """Mapping of source to target tables."""

    @overload
    def __init__(
        self,
        *,
        name: Optional[str] = None,
        target_database_name: Optional[str] = None,
        migration_setting: Optional[dict[str, str]] = None,
        source_setting: Optional[dict[str, str]] = None,
        target_setting: Optional[dict[str, str]] = None,
        table_map: 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 MigrateMySqlAzureDbForMySqlSyncTaskInput(_Model):
    """Input for the task that migrates MySQL databases to Azure Database for MySQL for online
    migrations.

    :ivar source_connection_info: Connection information for source MySQL. Required.
    :vartype source_connection_info: ~azure.mgmt.datamigration.models.MySqlConnectionInfo
    :ivar target_connection_info: Connection information for target Azure Database for MySQL.
     Required.
    :vartype target_connection_info: ~azure.mgmt.datamigration.models.MySqlConnectionInfo
    :ivar selected_databases: Databases to migrate. Required.
    :vartype selected_databases:
     list[~azure.mgmt.datamigration.models.MigrateMySqlAzureDbForMySqlSyncDatabaseInput]
    """

    source_connection_info: "_models.MySqlConnectionInfo" = rest_field(
        name="sourceConnectionInfo", visibility=["read", "create", "update", "delete", "query"]
    )
    """Connection information for source MySQL. Required."""
    target_connection_info: "_models.MySqlConnectionInfo" = rest_field(
        name="targetConnectionInfo", visibility=["read", "create", "update", "delete", "query"]
    )
    """Connection information for target Azure Database for MySQL. Required."""
    selected_databases: list["_models.MigrateMySqlAzureDbForMySqlSyncDatabaseInput"] = rest_field(
        name="selectedDatabases", visibility=["read", "create", "update", "delete", "query"]
    )
    """Databases to migrate. Required."""

    @overload
    def __init__(
        self,
        *,
        source_connection_info: "_models.MySqlConnectionInfo",
        target_connection_info: "_models.MySqlConnectionInfo",
        selected_databases: list["_models.MigrateMySqlAzureDbForMySqlSyncDatabaseInput"],
    ) -> None: ...

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

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


class MigrateMySqlAzureDbForMySqlSyncTaskOutput(_Model):  # pylint: disable=name-too-long
    """Output for the task that migrates MySQL databases to Azure Database for MySQL for online
    migrations.

    You probably want to use the sub-classes and not this class directly. Known sub-classes are:
    MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseError,
    MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseLevel,
    MigrateMySqlAzureDbForMySqlSyncTaskOutputError,
    MigrateMySqlAzureDbForMySqlSyncTaskOutputMigrationLevel,
    MigrateMySqlAzureDbForMySqlSyncTaskOutputTableLevel

    :ivar id: Result identifier.
    :vartype id: str
    :ivar result_type: Result type. Required. Default value is None.
    :vartype result_type: str
    """

    __mapping__: dict[str, _Model] = {}
    id: Optional[str] = rest_field(visibility=["read"])
    """Result identifier."""
    result_type: str = rest_discriminator(name="resultType", visibility=["read", "create", "update", "delete", "query"])
    """Result type. Required. Default value is None."""

    @overload
    def __init__(
        self,
        *,
        result_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 MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseError(
    MigrateMySqlAzureDbForMySqlSyncTaskOutput, discriminator="DatabaseLevelErrorOutput"
):  # pylint: disable=name-too-long
    """MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseError.

    :ivar id: Result identifier.
    :vartype id: str
    :ivar error_message: Error message.
    :vartype error_message: str
    :ivar events: List of error events.
    :vartype events: list[~azure.mgmt.datamigration.models.SyncMigrationDatabaseErrorEvent]
    :ivar result_type: Result type. Required. Default value is "DatabaseLevelErrorOutput".
    :vartype result_type: str
    """

    error_message: Optional[str] = rest_field(
        name="errorMessage", visibility=["read", "create", "update", "delete", "query"]
    )
    """Error message."""
    events: Optional[list["_models.SyncMigrationDatabaseErrorEvent"]] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """List of error events."""
    result_type: Literal["DatabaseLevelErrorOutput"] = rest_discriminator(name="resultType", visibility=["read", "create", "update", "delete", "query"])  # type: ignore
    """Result type. Required. Default value is \"DatabaseLevelErrorOutput\"."""

    @overload
    def __init__(
        self,
        *,
        error_message: Optional[str] = None,
        events: Optional[list["_models.SyncMigrationDatabaseErrorEvent"]] = None,
    ) -> None: ...

    @overload
    def __init__(self, mapping: Mapping[str, Any]) -> None:
        """
        :param 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.result_type = "DatabaseLevelErrorOutput"  # type: ignore


class MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseLevel(
    MigrateMySqlAzureDbForMySqlSyncTaskOutput, discriminator="DatabaseLevelOutput"
):  # pylint: disable=name-too-long
    """MigrateMySqlAzureDbForMySqlSyncTaskOutputDatabaseLevel.

    :ivar id: Result identifier.
    :vartype id: str
    :ivar database_name: Name of the database.
    :vartype database_name: str
    :ivar started_on: Migration start time.
    :vartype started_on: ~datetime.datetime
    :ivar ended_on: Migration end time.
    :vartype ended_on: ~datetime.datetime
    :ivar migration_state: Migration state that this database is in. Known values are: "UNDEFINED",
     "CONFIGURING", "INITIALIAZING", "STARTING", "RUNNING", "READY_TO_COMPLETE", "COMPLETING",
     "COMPLETE", "CANCELLING", "CANCELLED", "FAILED", "VALIDATING", "VALIDATION_COMPLETE",
     "VALIDATION_FAILED", "RESTORE_IN_PROGRESS", "RESTORE_COMPLETED", "BACKUP_IN_PROGRESS", and
     "BACKUP_COMPLETED".
    :vartype migration_state: str or
     ~azure.mgmt.datamigration.models.SyncDatabaseMigrationReportingState
    :ivar incoming_changes: Number of incoming changes.
    :vartype incoming_changes: int
    :ivar applied_changes: Number of applied changes.
    :vartype applied_changes: int
    :ivar cdc_insert_counter: Number of cdc inserts.
    :vartype cdc_insert_counter: int
    :ivar cdc_delete_counter: Number of cdc deletes.
    :vartype cdc_delete_counter: int
    :ivar cdc_update_counter: Number of cdc updates.
    :vartype cdc_update_counter: int
    :ivar full_load_completed_tables: Number of tables completed in full load.
    :vartype full_load_completed_tables: int
    :ivar full_load_loading_tables: Number of tables loading in full load.
    :vartype full_load_loading_tables: int
    :ivar full_load_queued_tables: Number of tables queued in full load.
    :vartype full_load_queued_tables: int
    :ivar full_load_errored_tables: Number of tables errored in full load.
    :vartype full_load_errored_tables: int
    :ivar initialization_completed: Indicates if initial load (full load) has been completed.
    :vartype initialization_completed: bool
    :ivar latency: CDC apply latency.
    :vartype latency: int
    :ivar result_type: Result type. Required. Default value is "DatabaseLevelOutput".
    :vartype result_type: str
    """

    database_name: Optional[str] = rest_field(name="databaseName", visibility=["read"])
    """Name of the database."""
    started_on: Optional[datetime.datetime] = rest_field(name="startedOn", visibility=["read"], format="rfc3339")
    """Migration start time."""
    ended_on: Optional[datetime.datetime] = rest_field(name="endedOn", visibility=["read"], format="rfc3339")
    """Migration end time."""
    migration_state: Optional[Union[str, "_models.SyncDatabaseMigrationReportingState"]] = rest_field(
        name="migrationState", visibility=["read"]
    )
    """Migration state that this database is in. Known values are: \"UNDEFINED\", \"CONFIGURING\",
     \"INITIALIAZING\", \"STARTING\", \"RUNNING\", \"READY_TO_COMPLETE\", \"COMPLETING\",
     \"COMPLETE\", \"CANCELLING\", \"CANCELLED\", \"FAILED\", \"VALIDATING\",
     \"VALIDATION_COMPLETE\", \"VALIDATION_FAILED\", \"RESTORE_IN_PROGRESS\", \"RESTORE_COMPLETED\",
     \"BACKUP_IN_PROGRESS\", and \"BACKUP_COMPLETED\"."""
    incoming_changes: Optional[int] = rest_field(name="incomingChanges", visibility=["read"])
    """Number of incoming changes."""
    applied_changes: Optional[int] = rest_field(name="appliedChanges", visibility=["read"])
    """Number of applied changes."""
    cdc_insert_counter: Optional[int] = rest_field(name="cdcInsertCounter", visibility=["read"])
    """Number of cdc inserts."""
    cdc_delete_counter: Optional[int] = rest_field(name="cdcDeleteCounter", visibility=["read"])
    """Number of cdc deletes."""
    cdc_update_counter: Optional[int] = rest_field(name="cdcUpdateCounter", visibility=["read"])
    """Number of cdc updates."""
    full_load_completed_tables: Optional[int] = rest_field(name="fullLoadCompletedTables", visibility=["read"])
    """Number of tables completed in full load."""
    full_load_loading_tables: Optional[int] = rest_field(name="fullLoadLoadingTables", visibility=["read"])
    """Number of tables loading in full load."""
    full_load_queued_tables: Optional[int] = rest_field(name="fullLoadQueuedTables", visibility=["read"])
    """Number of tables queued in full load."""
    full_load_errored_tables: Optional[int] = rest_field(name="fullLoadErroredTables", visibility=["read"])
    """Number of tables errored in full load."""
    initialization_completed: Optional[bool] = rest_field(name="initializationCompleted", visibility=["read"])
    """Indicates if initial load (full load) has been completed."""
    latency: Optional[int] = rest_field(visibility=["read"])
    """CDC apply latency."""
    result_type: Literal["DatabaseLevelOutput"] = rest_discriminator(name="resultType", visibility=["read", "create", "update", "delete", "query"])  # type: ignore
    """Result type. Required. Default value is \"DatabaseLevelOutput\"."""

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

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

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


class MigrateMySqlAzureDbForMySqlSyncTaskOutputError(
    MigrateMySqlAzureDbForMySqlSyncTaskOutput, discriminator="ErrorOutput"
):  # pylint: disable=name-too-long
    """MigrateMySqlAzureDbForMySqlSyncTaskOutputError.

    :ivar id: Result identifier.
    :vartype id: str
    :ivar error: Migration error.
    :vartype error: ~azure.mgmt.datamigration.models.ReportableException
    :ivar result_type: Result type. Required. Default value is "ErrorOutput".
    :vartype result_type: str
    """

    error: Optional["_models.ReportableException"] = rest_field(visibility=["read"])
    """Migration error."""
    result_type: Literal["ErrorOutput"] = rest_discriminator(name="resultType", visibility=["read", "create", "update", "delete", "query"])  # type: ignore
    """Result type. Required. Default value is \"ErrorOutput\"."""

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

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

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


class MigrateMySqlAzureDbForMySqlSyncTaskOutputMigrationLevel(
    MigrateMySqlAzureDbForMySqlSyncTaskOutput, discriminator="MigrationLevelOutput"
):  # pylint: disable=name-too-long
    """MigrateMySqlAzureDbForMySqlSyncTaskOutputMigrationLevel.

    :ivar id: Result identifier.
    :vartype id: str
    :ivar started_on: Migration start time.
    :vartype started_on: ~datetime.datetime
    :ivar ended_on: Migration end time.
    :vartype ended_on: ~datetime.datetime
    :ivar source_server_version: Source server version.
    :vartype source_server_version: str
    :ivar source_server: Source server name.
    :vartype source_server: str
    :ivar target_server_version: Target server version.
    :vartype target_server_version: str
    :ivar target_server: Target server name.
    :vartype target_server: str
    :ivar result_type: Result type. Required. Default value is "MigrationLevelOutput".
    :vartype result_type: str
    """

    started_on: Optional[datetime.datetime] = rest_field(name="startedOn", visibility=["read"], format="rfc3339")
    """Migration start time."""
    ended_on: Optional[datetime.datetime] = rest_field(name="endedOn", visibility=["read"], format="rfc3339")
    """Migration end time."""
    source_server_version: Optional[str] = rest_field(name="sourceServerVersion", visibility=["read"])
    """Source server version."""
    source_server: Optional[str] = rest_field(name="sourceServer", visibility=["read"])
    """Source server name."""
    target_server_version: Optional[str] = rest_field(name="targetServerVersion", visibility=["read"])
    """Target server version."""
    target_server: Optional[str] = rest_field(name="targetServer", visibility=["read"])
    """Target server name."""
    result_type: Literal["MigrationLevelOutput"] = rest_discriminator(name="resultType", visibility=["read", "create", "update", "delete", "query"])  # type: ignore
    """Result type. Required. Default value is \"MigrationLevelOutput\"."""

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

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

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


class MigrateMySqlAzureDbForMySqlSyncTaskOutputTableLevel(
    MigrateMySqlAzureDbForMySqlSyncTaskOutput, discriminator="TableLevelOutput"
):  # pylint: disable=name-too-long
    """MigrateMySqlAzureDbForMySqlSyncTaskOutputTableLevel.

    :ivar id: Result identifier.
    :vartype id: str
    :ivar table_name: Name of the table.
    :vartype table_name: str
    :ivar database_name: Name of the database.
    :vartype database_name: str
    :ivar cdc_insert_counter: Number of applied inserts.
    :vartype cdc_insert_counter: str
    :ivar cdc_update_counter: Number of applied updates.
    :vartype cdc_update_counter: str
    :ivar cdc_delete_counter: Number of applied deletes.
    :vartype cdc_delete_counter: str
    :ivar full_load_est_finish_time: Estimate to finish full load.
    :vartype full_load_est_finish_time: ~datetime.datetime
    :ivar full_load_started_on: Full load start time.
    :vartype full_load_started_on: ~datetime.datetime
    :ivar full_load_ended_on: Full load end time.
    :vartype full_load_ended_on: ~datetime.datetime
    :ivar full_load_total_rows: Number of rows applied in full load.
    :vartype full_load_total_rows: int
    :ivar state: Current state of the table migration. Known values are: "BEFORE_LOAD",
     "FULL_LOAD", "COMPLETED", "CANCELED", "ERROR", and "FAILED".
    :vartype state: str or ~azure.mgmt.datamigration.models.SyncTableMigrationState
    :ivar total_changes_applied: Total number of applied changes.
    :vartype total_changes_applied: int
    :ivar data_errors_counter: Number of data errors occurred.
    :vartype data_errors_counter: int
    :ivar last_modified_time: Last modified time on target.
    :vartype last_modified_time: ~datetime.datetime
    :ivar result_type: Result type. Required. Default value is "TableLevelOutput".
    :vartype result_type: str
    """

    table_name: Optional[str] = rest_field(name="tableName", visibility=["read"])
    """Name of the table."""
    database_name: Optional[str] = rest_field(name="databaseName", visibility=["read"])
    """Name of the database."""
    cdc_insert_counter: Optional[str] = rest_field(name="cdcInsertCounter", visibility=["read"])
    """Number of applied inserts."""
    cdc_update_counter: Optional[str] = rest_field(name="cdcUpdateCounter", visibility=["read"])
    """Number of applied updates."""
    cdc_delete_counter: Optional[str] = rest_field(name="cdcDeleteCounter", visibility=["read"])
    """Number of applied deletes."""
    full_load_est_finish_time: Optional[datetime.datetime] = rest_field(
        name="fullLoadEstFinishTime", visibility=["read"], format="rfc3339"
    )
    """Estimate to finish full load."""
    full_load_started_on: Optional[datetime.datetime] = rest_field(
        name="fullLoadStartedOn", visibility=["read"], format="rfc3339"
    )
    """Full load start time."""
    full_load_ended_on: Optional[datetime.datetime] = rest_field(
        name="fullLoadEndedOn", visibility=["read"], format="rfc3339"
    )
    """Full load end time."""
    full_load_total_rows: Optional[int] = rest_field(name="fullLoadTotalRows", visibility=["read"])
    """Number of rows applied in full load."""
    state: Optional[Union[str, "_models.SyncTableMigrationState"]] = rest_field(visibility=["read"])
    """Current state of the table migration. Known values are: \"BEFORE_LOAD\", \"FULL_LOAD\",
     \"COMPLETED\", \"CANCELED\", \"ERROR\", and \"FAILED\"."""
    total_changes_applied: Optional[int] = rest_field(name="totalChangesApplied", visibility=["read"])
    """Total number of applied changes."""
    data_errors_counter: Optional[int] = rest_field(name="dataErrorsCounter", visibility=["read"])
    """Number of data errors occurred."""
    last_modified_time: Optional[datetime.datetime] = rest_field(
        name="lastModifiedTime", visibility=["read"], format="rfc3339"
    )
    """Last modified time on target."""
    result_type: Literal["TableLevelOutput"] = rest_discriminator(name="resultType", visibility=["read", "create", "update", "delete", "query"])  # type: ignore
    """Result type. Required. Default value is \"TableLevelOutput\"."""

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

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

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


class MigrateMySqlAzureDbForMySqlSyncTaskProperties(
    ProjectTaskProperties, discriminator="Migrate.MySql.AzureDbForMySql.Sync"
):  # pylint: disable=name-too-long
    """Properties for the task that migrates MySQL databases to Azure Database for MySQL for online
    migrations.

    :ivar errors: Array of errors. This is ignored if submitted.
    :vartype errors: list[~azure.mgmt.datamigration.models.ODataError]
    :ivar state: The state of the task. This is ignored if submitted. Known values are: "Unknown",
     "Queued", "Running", "Canceled", "Succeeded", "Failed", "FailedInputValidation", and "Faulted".
    :vartype state: str or ~azure.mgmt.datamigration.models.TaskState
    :ivar commands: Array of command properties.
    :vartype commands: list[~azure.mgmt.datamigration.models.CommandProperties]
    :ivar client_data: Key value pairs of client data to attach meta data information to task.
    :vartype client_data: dict[str, str]
    :ivar input: Task input.
    :vartype input: ~azure.mgmt.datamigration.models.MigrateMySqlAzureDbForMySqlSyncTaskInput
    :ivar output: Task output. This is ignored if submitted.
    :vartype output:
     list[~azure.mgmt.datamigration.models.MigrateMySqlAzureDbForMySqlSyncTaskOutput]
    :ivar task_type: Task type. Required. Migrate.MySql.AzureDbForMySql.Sync.
    :vartype task_type: str or
     ~azure.mgmt.datamigration.models.MIGRATE_MY_SQL_AZURE_DB_FOR_MY_SQL_SYNC
    """

    input: Optional["_models.MigrateMySqlAzureDbForMySqlSyncTaskInput"] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """Task input."""
    output: Optional[list["_models.MigrateMySqlAzureDbForMySqlSyncTaskOutput"]] = rest_field(visibility=["read"])
    """Task output. This is ignored if submitted."""
    task_type: Literal[TaskType.MIGRATE_MY_SQL_AZURE_DB_FOR_MY_SQL_SYNC] = rest_discriminator(name="taskType", visibility=["read", "create", "update", "delete", "query"])  # type: ignore
    """Task type. Required. Migrate.MySql.AzureDbForMySql.Sync."""

    @overload
    def __init__(
        self,
        *,
        client_data: Optional[dict[str, str]] = None,
        input: Optional["_models.MigrateMySqlAzureDbForMySqlSyncTaskInput"] = None,
    ) -> None: ...

    @overload
    def __init__(self, mapping: Mapping[str, Any]) -> None:
        """
        :param 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.task_type = TaskType.MIGRATE_MY_SQL_AZURE_DB_FOR_MY_SQL_SYNC  # type: ignore


class MigrateOracleAzureDbForPostgreSqlSyncTaskProperties(
    ProjectTaskProperties, discriminator="Migrate.Oracle.AzureDbForPostgreSql.Sync"
):  # pylint: disable=name-too-long
    """Properties for the task that migrates Oracle to Azure Database for PostgreSQL for online
    migrations.

    :ivar errors: Array of errors. This is ignored if submitted.
    :vartype errors: list[~azure.mgmt.datamigration.models.ODataError]
    :ivar state: The state of the task. This is ignored if submitted. Known values are: "Unknown",
     "Queued", "Running", "Canceled", "Succeeded", "Failed", "FailedInputValidation", and "Faulted".
    :vartype state: str or ~azure.mgmt.datamigration.models.TaskState
    :ivar commands: Array of command properties.
    :vartype commands: list[~azure.mgmt.datamigration.models.CommandProperties]
    :ivar client_data: Key value pairs of client data to attach meta data information to task.
    :vartype client_data: dict[str, str]
    :ivar input: Task input.
    :vartype input: ~azure.mgmt.datamigration.models.MigrateOracleAzureDbPostgreSqlSyncTaskInput
    :ivar output: Task output. This is ignored if submitted.
    :vartype output:
     list[~azure.mgmt.datamigration.models.MigrateOracleAzureDbPostgreSqlSyncTaskOutput]
    :ivar task_type: Task type. Required. Migrate.Oracle.AzureDbForPostgreSql.Sync.
    :vartype task_type: str or
     ~azure.mgmt.datamigration.models.MIGRATE_ORACLE_AZURE_DB_FOR_POSTGRE_SQL_SYNC
    """

    input: Optional["_models.MigrateOracleAzureDbPostgreSqlSyncTaskInput"] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """Task input."""
    output: Optional[list["_models.MigrateOracleAzureDbPostgreSqlSyncTaskOutput"]] = rest_field(visibility=["read"])
    """Task output. This is ignored if submitted."""
    task_type: Literal[TaskType.MIGRATE_ORACLE_AZURE_DB_FOR_POSTGRE_SQL_SYNC] = rest_discriminator(name="taskType", visibility=["read", "create", "update", "delete", "query"])  # type: ignore
    """Task type. Required. Migrate.Oracle.AzureDbForPostgreSql.Sync."""

    @overload
    def __init__(
        self,
        *,
        client_data: Optional[dict[str, str]] = None,
        input: Optional["_models.MigrateOracleAzureDbPostgreSqlSyncTaskInput"] = None,
    ) -> None: ...

    @overload
    def __init__(self, mapping: Mapping[str, Any]) -> None:
        """
        :param 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.task_type = TaskType.MIGRATE_ORACLE_AZURE_DB_FOR_POSTGRE_SQL_SYNC  # type: ignore


class MigrateOracleAzureDbPostgreSqlSyncDatabaseInput(_Model):  # pylint: disable=name-too-long
    """Database specific information for Oracle to Azure Database for PostgreSQL migration task
    inputs.

    :ivar case_manipulation: How to handle object name casing: either Preserve or ToLower.
    :vartype case_manipulation: str
    :ivar name: Name of the migration pipeline.
    :vartype name: str
    :ivar schema_name: Name of the source schema.
    :vartype schema_name: str
    :ivar table_map: Mapping of source to target tables.
    :vartype table_map: dict[str, str]
    :ivar target_database_name: Name of target database. Note: Target database will be truncated
     before starting migration.
    :vartype target_database_name: str
    :ivar migration_setting: Migration settings which tune the migration behavior.
    :vartype migration_setting: dict[str, str]
    :ivar source_setting: Source settings to tune source endpoint migration behavior.
    :vartype source_setting: dict[str, str]
    :ivar target_setting: Target settings to tune target endpoint migration behavior.
    :vartype target_setting: dict[str, str]
    """

    case_manipulation: Optional[str] = rest_field(
        name="caseManipulation", visibility=["read", "create", "update", "delete", "query"]
    )
    """How to handle object name casing: either Preserve or ToLower."""
    name: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """Name of the migration pipeline."""
    schema_name: Optional[str] = rest_field(
        name="schemaName", visibility=["read", "create", "update", "delete", "query"]
    )
    """Name of the source schema."""
    table_map: Optional[dict[str, str]] = rest_field(
        name="tableMap", visibility=["read", "create", "update", "delete", "query"]
    )
    """Mapping of source to target tables."""
    target_database_name: Optional[str] = rest_field(
        name="targetDatabaseName", visibility=["read", "create", "update", "delete", "query"]
    )
    """Name of target database. Note: Target database will be truncated before starting migration."""
    migration_setting: Optional[dict[str, str]] = rest_field(
        name="migrationSetting", visibility=["read", "create", "update", "delete", "query"]
    )
    """Migration settings which tune the migration behavior."""
    source_setting: Optional[dict[str, str]] = rest_field(
        name="sourceSetting", visibility=["read", "create", "update", "delete", "query"]
    )
    """Source settings to tune source endpoint migration behavior."""
    target_setting: Optional[dict[str, str]] = rest_field(
        name="targetSetting", visibility=["read", "create", "update", "delete", "query"]
    )
    """Target settings to tune target endpoint migration behavior."""

    @overload
    def __init__(
        self,
        *,
        case_manipulation: Optional[str] = None,
        name: Optional[str] = None,
        schema_name: Optional[str] = None,
        table_map: Optional[dict[str, str]] = None,
        target_database_name: Optional[str] = None,
        migration_setting: Optional[dict[str, str]] = None,
        source_setting: Optional[dict[str, str]] = None,
        target_setting: 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 MigrateOracleAzureDbPostgreSqlSyncTaskInput(_Model):  # pylint: disable=name-too-long
    """Input for the task that migrates Oracle databases to Azure Database for PostgreSQL for online
    migrations.

    :ivar selected_databases: Databases to migrate. Required.
    :vartype selected_databases:
     list[~azure.mgmt.datamigration.models.MigrateOracleAzureDbPostgreSqlSyncDatabaseInput]
    :ivar target_connection_info: Connection information for target Azure Database for PostgreSQL.
     Required.
    :vartype target_connection_info: ~azure.mgmt.datamigration.models.PostgreSqlConnectionInfo
    :ivar source_connection_info: Connection information for source Oracle. Required.
    :vartype source_connection_info: ~azure.mgmt.datamigration.models.OracleConnectionInfo
    """

    selected_databases: list["_models.MigrateOracleAzureDbPostgreSqlSyncDatabaseInput"] = rest_field(
        name="selectedDatabases", visibility=["read", "create", "update", "delete", "query"]
    )
    """Databases to migrate. Required."""
    target_connection_info: "_models.PostgreSqlConnectionInfo" = rest_field(
        name="targetConnectionInfo", visibility=["read", "create", "update", "delete", "query"]
    )
    """Connection information for target Azure Database for PostgreSQL. Required."""
    source_connection_info: "_models.OracleConnectionInfo" = rest_field(
        name="sourceConnectionInfo", visibility=["read", "create", "update", "delete", "query"]
    )
    """Connection information for source Oracle. Required."""

    @overload
    def __init__(
        self,
        *,
        selected_databases: list["_models.MigrateOracleAzureDbPostgreSqlSyncDatabaseInput"],
        target_connection_info: "_models.PostgreSqlConnectionInfo",
        source_connection_info: "_models.OracleConnectionInfo",
    ) -> None: ...

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

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


class MigrateOracleAzureDbPostgreSqlSyncTaskOutput(_Model):  # pylint: disable=name-too-long
    """Output for the task that migrates Oracle databases to Azure Database for PostgreSQL for online
    migrations.

    You probably want to use the sub-classes and not this class directly. Known sub-classes are:
    MigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseError,
    MigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseLevel,
    MigrateOracleAzureDbPostgreSqlSyncTaskOutputError,
    MigrateOracleAzureDbPostgreSqlSyncTaskOutputMigrationLevel,
    MigrateOracleAzureDbPostgreSqlSyncTaskOutputTableLevel

    :ivar id: Result identifier.
    :vartype id: str
    :ivar result_type: Result type. Required. Default value is None.
    :vartype result_type: str
    """

    __mapping__: dict[str, _Model] = {}
    id: Optional[str] = rest_field(visibility=["read"])
    """Result identifier."""
    result_type: str = rest_discriminator(name="resultType", visibility=["read", "create", "update", "delete", "query"])
    """Result type. Required. Default value is None."""

    @overload
    def __init__(
        self,
        *,
        result_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 MigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseError(
    MigrateOracleAzureDbPostgreSqlSyncTaskOutput, discriminator="DatabaseLevelErrorOutput"
):  # pylint: disable=name-too-long
    """MigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseError.

    :ivar id: Result identifier.
    :vartype id: str
    :ivar error_message: Error message.
    :vartype error_message: str
    :ivar events: List of error events.
    :vartype events: list[~azure.mgmt.datamigration.models.SyncMigrationDatabaseErrorEvent]
    :ivar result_type: Result type. Required. Default value is "DatabaseLevelErrorOutput".
    :vartype result_type: str
    """

    error_message: Optional[str] = rest_field(
        name="errorMessage", visibility=["read", "create", "update", "delete", "query"]
    )
    """Error message."""
    events: Optional[list["_models.SyncMigrationDatabaseErrorEvent"]] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """List of error events."""
    result_type: Literal["DatabaseLevelErrorOutput"] = rest_discriminator(name="resultType", visibility=["read", "create", "update", "delete", "query"])  # type: ignore
    """Result type. Required. Default value is \"DatabaseLevelErrorOutput\"."""

    @overload
    def __init__(
        self,
        *,
        error_message: Optional[str] = None,
        events: Optional[list["_models.SyncMigrationDatabaseErrorEvent"]] = None,
    ) -> None: ...

    @overload
    def __init__(self, mapping: Mapping[str, Any]) -> None:
        """
        :param 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.result_type = "DatabaseLevelErrorOutput"  # type: ignore


class MigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseLevel(
    MigrateOracleAzureDbPostgreSqlSyncTaskOutput, discriminator="DatabaseLevelOutput"
):  # pylint: disable=name-too-long
    """MigrateOracleAzureDbPostgreSqlSyncTaskOutputDatabaseLevel.

    :ivar id: Result identifier.
    :vartype id: str
    :ivar database_name: Name of the database.
    :vartype database_name: str
    :ivar started_on: Migration start time.
    :vartype started_on: ~datetime.datetime
    :ivar ended_on: Migration end time.
    :vartype ended_on: ~datetime.datetime
    :ivar migration_state: Migration state that this database is in. Known values are: "UNDEFINED",
     "CONFIGURING", "INITIALIAZING", "STARTING", "RUNNING", "READY_TO_COMPLETE", "COMPLETING",
     "COMPLETE", "CANCELLING", "CANCELLED", "FAILED", "VALIDATING", "VALIDATION_COMPLETE",
     "VALIDATION_FAILED", "RESTORE_IN_PROGRESS", "RESTORE_COMPLETED", "BACKUP_IN_PROGRESS", and
     "BACKUP_COMPLETED".
    :vartype migration_state: str or
     ~azure.mgmt.datamigration.models.SyncDatabaseMigrationReportingState
    :ivar incoming_changes: Number of incoming changes.
    :vartype incoming_changes: int
    :ivar applied_changes: Number of applied changes.
    :vartype applied_changes: int
    :ivar cdc_insert_counter: Number of cdc inserts.
    :vartype cdc_insert_counter: int
    :ivar cdc_delete_counter: Number of cdc deletes.
    :vartype cdc_delete_counter: int
    :ivar cdc_update_counter: Number of cdc updates.
    :vartype cdc_update_counter: int
    :ivar full_load_completed_tables: Number of tables completed in full load.
    :vartype full_load_completed_tables: int
    :ivar full_load_loading_tables: Number of tables loading in full load.
    :vartype full_load_loading_tables: int
    :ivar full_load_queued_tables: Number of tables queued in full load.
    :vartype full_load_queued_tables: int
    :ivar full_load_errored_tables: Number of tables errored in full load.
    :vartype full_load_errored_tables: int
    :ivar initialization_completed: Indicates if initial load (full load) has been completed.
    :vartype initialization_completed: bool
    :ivar latency: CDC apply latency.
    :vartype latency: int
    :ivar result_type: Result type. Required. Default value is "DatabaseLevelOutput".
    :vartype result_type: str
    """

    database_name: Optional[str] = rest_field(name="databaseName", visibility=["read"])
    """Name of the database."""
    started_on: Optional[datetime.datetime] = rest_field(name="startedOn", visibility=["read"], format="rfc3339")
    """Migration start time."""
    ended_on: Optional[datetime.datetime] = rest_field(name="endedOn", visibility=["read"], format="rfc3339")
    """Migration end time."""
    migration_state: Optional[Union[str, "_models.SyncDatabaseMigrationReportingState"]] = rest_field(
        name="migrationState", visibility=["read"]
    )
    """Migration state that this database is in. Known values are: \"UNDEFINED\", \"CONFIGURING\",
     \"INITIALIAZING\", \"STARTING\", \"RUNNING\", \"READY_TO_COMPLETE\", \"COMPLETING\",
     \"COMPLETE\", \"CANCELLING\", \"CANCELLED\", \"FAILED\", \"VALIDATING\",
     \"VALIDATION_COMPLETE\", \"VALIDATION_FAILED\", \"RESTORE_IN_PROGRESS\", \"RESTORE_COMPLETED\",
     \"BACKUP_IN_PROGRESS\", and \"BACKUP_COMPLETED\"."""
    incoming_changes: Optional[int] = rest_field(name="incomingChanges", visibility=["read"])
    """Number of incoming changes."""
    applied_changes: Optional[int] = rest_field(name="appliedChanges", visibility=["read"])
    """Number of applied changes."""
    cdc_insert_counter: Optional[int] = rest_field(name="cdcInsertCounter", visibility=["read"])
    """Number of cdc inserts."""
    cdc_delete_counter: Optional[int] = rest_field(name="cdcDeleteCounter", visibility=["read"])
    """Number of cdc deletes."""
    cdc_update_counter: Optional[int] = rest_field(name="cdcUpdateCounter", visibility=["read"])
    """Number of cdc updates."""
    full_load_completed_tables: Optional[int] = rest_field(name="fullLoadCompletedTables", visibility=["read"])
    """Number of tables completed in full load."""
    full_load_loading_tables: Optional[int] = rest_field(name="fullLoadLoadingTables", visibility=["read"])
    """Number of tables loading in full load."""
    full_load_queued_tables: Optional[int] = rest_field(name="fullLoadQueuedTables", visibility=["read"])
    """Number of tables queued in full load."""
    full_load_errored_tables: Optional[int] = rest_field(name="fullLoadErroredTables", visibility=["read"])
    """Number of tables errored in full load."""
    initialization_completed: Optional[bool] = rest_field(name="initializationCompleted", visibility=["read"])
    """Indicates if initial load (full load) has been completed."""
    latency: Optional[int] = rest_field(visibility=["read"])
    """CDC apply latency."""
    result_type: Literal["DatabaseLevelOutput"] = rest_discriminator(name="resultType", visibility=["read", "create", "update", "delete", "query"])  # type: ignore
    """Result type. Required. Default value is \"DatabaseLevelOutput\"."""

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

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

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


class MigrateOracleAzureDbPostgreSqlSyncTaskOutputError(
    MigrateOracleAzureDbPostgreSqlSyncTaskOutput, discriminator="ErrorOutput"
):  # pylint: disable=name-too-long
    """MigrateOracleAzureDbPostgreSqlSyncTaskOutputError.

    :ivar id: Result identifier.
    :vartype id: str
    :ivar error: Migration error.
    :vartype error: ~azure.mgmt.datamigration.models.ReportableException
    :ivar result_type: Result type. Required. Default value is "ErrorOutput".
    :vartype result_type: str
    """

    error: Optional["_models.ReportableException"] = rest_field(visibility=["read"])
    """Migration error."""
    result_type: Literal["ErrorOutput"] = rest_discriminator(name="resultType", visibility=["read", "create", "update", "delete", "query"])  # type: ignore
    """Result type. Required. Default value is \"ErrorOutput\"."""

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

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

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


class MigrateOracleAzureDbPostgreSqlSyncTaskOutputMigrationLevel(
    MigrateOracleAzureDbPostgreSqlSyncTaskOutput, discriminator="MigrationLevelOutput"
):  # pylint: disable=name-too-long
    """MigrateOracleAzureDbPostgreSqlSyncTaskOutputMigrationLevel.

    :ivar id: Result identifier.
    :vartype id: str
    :ivar started_on: Migration start time.
    :vartype started_on: ~datetime.datetime
    :ivar ended_on: Migration end time.
    :vartype ended_on: ~datetime.datetime
    :ivar source_server_version: Source server version.
    :vartype source_server_version: str
    :ivar source_server: Source server name.
    :vartype source_server: str
    :ivar target_server_version: Target server version.
    :vartype target_server_version: str
    :ivar target_server: Target server name.
    :vartype target_server: str
    :ivar result_type: Result type. Required. Default value is "MigrationLevelOutput".
    :vartype result_type: str
    """

    started_on: Optional[datetime.datetime] = rest_field(name="startedOn", visibility=["read"], format="rfc3339")
    """Migration start time."""
    ended_on: Optional[datetime.datetime] = rest_field(name="endedOn", visibility=["read"], format="rfc3339")
    """Migration end time."""
    source_server_version: Optional[str] = rest_field(name="sourceServerVersion", visibility=["read"])
    """Source server version."""
    source_server: Optional[str] = rest_field(name="sourceServer", visibility=["read"])
    """Source server name."""
    target_server_version: Optional[str] = rest_field(name="targetServerVersion", visibility=["read"])
    """Target server version."""
    target_server: Optional[str] = rest_field(name="targetServer", visibility=["read"])
    """Target server name."""
    result_type: Literal["MigrationLevelOutput"] = rest_discriminator(name="resultType", visibility=["read", "create", "update", "delete", "query"])  # type: ignore
    """Result type. Required. Default value is \"MigrationLevelOutput\"."""

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

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

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


class MigrateOracleAzureDbPostgreSqlSyncTaskOutputTableLevel(
    MigrateOracleAzureDbPostgreSqlSyncTaskOutput, discriminator="TableLevelOutput"
):  # pylint: disable=name-too-long
    """MigrateOracleAzureDbPostgreSqlSyncTaskOutputTableLevel.

    :ivar id: Result identifier.
    :vartype id: str
    :ivar table_name: Name of the table.
    :vartype table_name: str
    :ivar database_name: Name of the database.
    :vartype database_name: str
    :ivar cdc_insert_counter: Number of applied inserts.
    :vartype cdc_insert_counter: int
    :ivar cdc_update_counter: Number of applied updates.
    :vartype cdc_update_counter: int
    :ivar cdc_delete_counter: Number of applied deletes.
    :vartype cdc_delete_counter: int
    :ivar full_load_est_finish_time: Estimate to finish full load.
    :vartype full_load_est_finish_time: ~datetime.datetime
    :ivar full_load_started_on: Full load start time.
    :vartype full_load_started_on: ~datetime.datetime
    :ivar full_load_ended_on: Full load end time.
    :vartype full_load_ended_on: ~datetime.datetime
    :ivar full_load_total_rows: Number of rows applied in full load.
    :vartype full_load_total_rows: int
    :ivar state: Current state of the table migration. Known values are: "BEFORE_LOAD",
     "FULL_LOAD", "COMPLETED", "CANCELED", "ERROR", and "FAILED".
    :vartype state: str or ~azure.mgmt.datamigration.models.SyncTableMigrationState
    :ivar total_changes_applied: Total number of applied changes.
    :vartype total_changes_applied: int
    :ivar data_errors_counter: Number of data errors occurred.
    :vartype data_errors_counter: int
    :ivar last_modified_time: Last modified time on target.
    :vartype last_modified_time: ~datetime.datetime
    :ivar result_type: Result type. Required. Default value is "TableLevelOutput".
    :vartype result_type: str
    """

    table_name: Optional[str] = rest_field(name="tableName", visibility=["read"])
    """Name of the table."""
    database_name: Optional[str] = rest_field(name="databaseName", visibility=["read"])
    """Name of the database."""
    cdc_insert_counter: Optional[int] = rest_field(name="cdcInsertCounter", visibility=["read"])
    """Number of applied inserts."""
    cdc_update_counter: Optional[int] = rest_field(name="cdcUpdateCounter", visibility=["read"])
    """Number of applied updates."""
    cdc_delete_counter: Optional[int] = rest_field(name="cdcDeleteCounter", visibility=["read"])
    """Number of applied deletes."""
    full_load_est_finish_time: Optional[datetime.datetime] = rest_field(
        name="fullLoadEstFinishTime", visibility=["read"], format="rfc3339"
    )
    """Estimate to finish full load."""
    full_load_started_on: Optional[datetime.datetime] = rest_field(
        name="fullLoadStartedOn", visibility=["read"], format="rfc3339"
    )
    """Full load start time."""
    full_load_ended_on: Optional[datetime.datetime] = rest_field(
        name="fullLoadEndedOn", visibility=["read"], format="rfc3339"
    )
    """Full load end time."""
    full_load_total_rows: Optional[int] = rest_field(name="fullLoadTotalRows", visibility=["read"])
    """Number of rows applied in full load."""
    state: Optional[Union[str, "_models.SyncTableMigrationState"]] = rest_field(visibility=["read"])
    """Current state of the table migration. Known values are: \"BEFORE_LOAD\", \"FULL_LOAD\",
     \"COMPLETED\", \"CANCELED\", \"ERROR\", and \"FAILED\"."""
    total_changes_applied: Optional[int] = rest_field(name="totalChangesApplied", visibility=["read"])
    """Total number of applied changes."""
    data_errors_counter: Optional[int] = rest_field(name="dataErrorsCounter", visibility=["read"])
    """Number of data errors occurred."""
    last_modified_time: Optional[datetime.datetime] = rest_field(
        name="lastModifiedTime", visibility=["read"], format="rfc3339"
    )
    """Last modified time on target."""
    result_type: Literal["TableLevelOutput"] = rest_discriminator(name="resultType", visibility=["read", "create", "update", "delete", "query"])  # type: ignore
    """Result type. Required. Default value is \"TableLevelOutput\"."""

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

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

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


class MigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseInput(_Model):  # pylint: disable=name-too-long
    """Database specific information for PostgreSQL to Azure Database for PostgreSQL migration task
    inputs.

    :ivar name: Name of the database.
    :vartype name: str
    :ivar id: Result identifier.
    :vartype id: str
    :ivar target_database_name: Name of target database. Note: Target database will be truncated
     before starting migration.
    :vartype target_database_name: str
    :ivar migration_setting: Migration settings which tune the migration behavior.
    :vartype migration_setting: dict[str, any]
    :ivar source_setting: Source settings to tune source endpoint migration behavior.
    :vartype source_setting: dict[str, str]
    :ivar target_setting: Target settings to tune target endpoint migration behavior.
    :vartype target_setting: dict[str, str]
    :ivar selected_tables: Tables selected for migration.
    :vartype selected_tables:
     list[~azure.mgmt.datamigration.models.MigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseTableInput]
    """

    name: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """Name of the database."""
    id: Optional[str] = rest_field(visibility=["read"])
    """Result identifier."""
    target_database_name: Optional[str] = rest_field(
        name="targetDatabaseName", visibility=["read", "create", "update", "delete", "query"]
    )
    """Name of target database. Note: Target database will be truncated before starting migration."""
    migration_setting: Optional[dict[str, Any]] = rest_field(
        name="migrationSetting", visibility=["read", "create", "update", "delete", "query"]
    )
    """Migration settings which tune the migration behavior."""
    source_setting: Optional[dict[str, str]] = rest_field(
        name="sourceSetting", visibility=["read", "create", "update", "delete", "query"]
    )
    """Source settings to tune source endpoint migration behavior."""
    target_setting: Optional[dict[str, str]] = rest_field(
        name="targetSetting", visibility=["read", "create", "update", "delete", "query"]
    )
    """Target settings to tune target endpoint migration behavior."""
    selected_tables: Optional[list["_models.MigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseTableInput"]] = rest_field(
        name="selectedTables", visibility=["read", "create", "update", "delete", "query"]
    )
    """Tables selected for migration."""

    @overload
    def __init__(
        self,
        *,
        name: Optional[str] = None,
        target_database_name: Optional[str] = None,
        migration_setting: Optional[dict[str, Any]] = None,
        source_setting: Optional[dict[str, str]] = None,
        target_setting: Optional[dict[str, str]] = None,
        selected_tables: Optional[list["_models.MigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseTableInput"]] = None,
    ) -> None: ...

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

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


class MigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseTableInput(_Model):  # pylint: disable=name-too-long
    """Selected tables for the migration.

    :ivar name: Name of the table to migrate.
    :vartype name: str
    """

    name: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """Name of the table to migrate."""

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

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

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


class MigratePostgreSqlAzureDbForPostgreSqlSyncTaskInput(_Model):  # pylint: disable=name-too-long
    """Input for the task that migrates PostgreSQL databases to Azure Database for PostgreSQL for
    online migrations.

    :ivar selected_databases: Databases to migrate. Required.
    :vartype selected_databases:
     list[~azure.mgmt.datamigration.models.MigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseInput]
    :ivar target_connection_info: Connection information for target Azure Database for PostgreSQL.
     Required.
    :vartype target_connection_info: ~azure.mgmt.datamigration.models.PostgreSqlConnectionInfo
    :ivar source_connection_info: Connection information for source PostgreSQL. Required.
    :vartype source_connection_info: ~azure.mgmt.datamigration.models.PostgreSqlConnectionInfo
    :ivar encrypted_key_for_secure_fields: encrypted key for secure fields.
    :vartype encrypted_key_for_secure_fields: str
    :ivar started_on: Migration start time.
    :vartype started_on: ~datetime.datetime
    """

    selected_databases: list["_models.MigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseInput"] = rest_field(
        name="selectedDatabases", visibility=["read", "create", "update", "delete", "query"]
    )
    """Databases to migrate. Required."""
    target_connection_info: "_models.PostgreSqlConnectionInfo" = rest_field(
        name="targetConnectionInfo", visibility=["read", "create", "update", "delete", "query"]
    )
    """Connection information for target Azure Database for PostgreSQL. Required."""
    source_connection_info: "_models.PostgreSqlConnectionInfo" = rest_field(
        name="sourceConnectionInfo", visibility=["read", "create", "update", "delete", "query"]
    )
    """Connection information for source PostgreSQL. Required."""
    encrypted_key_for_secure_fields: Optional[str] = rest_field(
        name="encryptedKeyForSecureFields", visibility=["read", "create", "update", "delete", "query"]
    )
    """encrypted key for secure fields."""
    started_on: Optional[datetime.datetime] = rest_field(name="startedOn", visibility=["read"], format="rfc3339")
    """Migration start time."""

    @overload
    def __init__(
        self,
        *,
        selected_databases: list["_models.MigratePostgreSqlAzureDbForPostgreSqlSyncDatabaseInput"],
        target_connection_info: "_models.PostgreSqlConnectionInfo",
        source_connection_info: "_models.PostgreSqlConnectionInfo",
        encrypted_key_for_secure_fields: 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 MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput(_Model):  # pylint: disable=name-too-long
    """Output for the task that migrates PostgreSQL databases to Azure Database for PostgreSQL for
    online migrations.

    You probably want to use the sub-classes and not this class directly. Known sub-classes are:
    MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseError,
    MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseLevel,
    MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputError,
    MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputMigrationLevel,
    MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputTableLevel

    :ivar id: Result identifier.
    :vartype id: str
    :ivar result_type: Result type. Required. Default value is None.
    :vartype result_type: str
    """

    __mapping__: dict[str, _Model] = {}
    id: Optional[str] = rest_field(visibility=["read"])
    """Result identifier."""
    result_type: str = rest_discriminator(name="resultType", visibility=["read", "create", "update", "delete", "query"])
    """Result type. Required. Default value is None."""

    @overload
    def __init__(
        self,
        *,
        result_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 MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseError(
    MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput, discriminator="DatabaseLevelErrorOutput"
):  # pylint: disable=name-too-long
    """MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseError.

    :ivar id: Result identifier.
    :vartype id: str
    :ivar error_message: Error message.
    :vartype error_message: str
    :ivar events: List of error events.
    :vartype events: list[~azure.mgmt.datamigration.models.SyncMigrationDatabaseErrorEvent]
    :ivar result_type: Result type. Required. Default value is "DatabaseLevelErrorOutput".
    :vartype result_type: str
    """

    error_message: Optional[str] = rest_field(
        name="errorMessage", visibility=["read", "create", "update", "delete", "query"]
    )
    """Error message."""
    events: Optional[list["_models.SyncMigrationDatabaseErrorEvent"]] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """List of error events."""
    result_type: Literal["DatabaseLevelErrorOutput"] = rest_discriminator(name="resultType", visibility=["read", "create", "update", "delete", "query"])  # type: ignore
    """Result type. Required. Default value is \"DatabaseLevelErrorOutput\"."""

    @overload
    def __init__(
        self,
        *,
        error_message: Optional[str] = None,
        events: Optional[list["_models.SyncMigrationDatabaseErrorEvent"]] = None,
    ) -> None: ...

    @overload
    def __init__(self, mapping: Mapping[str, Any]) -> None:
        """
        :param 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.result_type = "DatabaseLevelErrorOutput"  # type: ignore


class MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseLevel(
    MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput, discriminator="DatabaseLevelOutput"
):  # pylint: disable=name-too-long
    """MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputDatabaseLevel.

    :ivar id: Result identifier.
    :vartype id: str
    :ivar database_name: Name of the database.
    :vartype database_name: str
    :ivar started_on: Migration start time.
    :vartype started_on: ~datetime.datetime
    :ivar ended_on: Migration end time.
    :vartype ended_on: ~datetime.datetime
    :ivar migration_state: Migration state that this database is in. Known values are: "UNDEFINED",
     "CONFIGURING", "INITIALIAZING", "STARTING", "RUNNING", "READY_TO_COMPLETE", "COMPLETING",
     "COMPLETE", "CANCELLING", "CANCELLED", "FAILED", "VALIDATING", "VALIDATION_COMPLETE",
     "VALIDATION_FAILED", "RESTORE_IN_PROGRESS", "RESTORE_COMPLETED", "BACKUP_IN_PROGRESS", and
     "BACKUP_COMPLETED".
    :vartype migration_state: str or
     ~azure.mgmt.datamigration.models.SyncDatabaseMigrationReportingState
    :ivar incoming_changes: Number of incoming changes.
    :vartype incoming_changes: int
    :ivar applied_changes: Number of applied changes.
    :vartype applied_changes: int
    :ivar cdc_insert_counter: Number of cdc inserts.
    :vartype cdc_insert_counter: int
    :ivar cdc_delete_counter: Number of cdc deletes.
    :vartype cdc_delete_counter: int
    :ivar cdc_update_counter: Number of cdc updates.
    :vartype cdc_update_counter: int
    :ivar full_load_completed_tables: Number of tables completed in full load.
    :vartype full_load_completed_tables: int
    :ivar full_load_loading_tables: Number of tables loading in full load.
    :vartype full_load_loading_tables: int
    :ivar full_load_queued_tables: Number of tables queued in full load.
    :vartype full_load_queued_tables: int
    :ivar full_load_errored_tables: Number of tables errored in full load.
    :vartype full_load_errored_tables: int
    :ivar initialization_completed: Indicates if initial load (full load) has been completed.
    :vartype initialization_completed: bool
    :ivar latency: CDC apply latency.
    :vartype latency: int
    :ivar result_type: Result type. Required. Default value is "DatabaseLevelOutput".
    :vartype result_type: str
    """

    database_name: Optional[str] = rest_field(name="databaseName", visibility=["read"])
    """Name of the database."""
    started_on: Optional[datetime.datetime] = rest_field(name="startedOn", visibility=["read"], format="rfc3339")
    """Migration start time."""
    ended_on: Optional[datetime.datetime] = rest_field(name="endedOn", visibility=["read"], format="rfc3339")
    """Migration end time."""
    migration_state: Optional[Union[str, "_models.SyncDatabaseMigrationReportingState"]] = rest_field(
        name="migrationState", visibility=["read"]
    )
    """Migration state that this database is in. Known values are: \"UNDEFINED\", \"CONFIGURING\",
     \"INITIALIAZING\", \"STARTING\", \"RUNNING\", \"READY_TO_COMPLETE\", \"COMPLETING\",
     \"COMPLETE\", \"CANCELLING\", \"CANCELLED\", \"FAILED\", \"VALIDATING\",
     \"VALIDATION_COMPLETE\", \"VALIDATION_FAILED\", \"RESTORE_IN_PROGRESS\", \"RESTORE_COMPLETED\",
     \"BACKUP_IN_PROGRESS\", and \"BACKUP_COMPLETED\"."""
    incoming_changes: Optional[int] = rest_field(name="incomingChanges", visibility=["read"])
    """Number of incoming changes."""
    applied_changes: Optional[int] = rest_field(name="appliedChanges", visibility=["read"])
    """Number of applied changes."""
    cdc_insert_counter: Optional[int] = rest_field(name="cdcInsertCounter", visibility=["read"])
    """Number of cdc inserts."""
    cdc_delete_counter: Optional[int] = rest_field(name="cdcDeleteCounter", visibility=["read"])
    """Number of cdc deletes."""
    cdc_update_counter: Optional[int] = rest_field(name="cdcUpdateCounter", visibility=["read"])
    """Number of cdc updates."""
    full_load_completed_tables: Optional[int] = rest_field(name="fullLoadCompletedTables", visibility=["read"])
    """Number of tables completed in full load."""
    full_load_loading_tables: Optional[int] = rest_field(name="fullLoadLoadingTables", visibility=["read"])
    """Number of tables loading in full load."""
    full_load_queued_tables: Optional[int] = rest_field(name="fullLoadQueuedTables", visibility=["read"])
    """Number of tables queued in full load."""
    full_load_errored_tables: Optional[int] = rest_field(name="fullLoadErroredTables", visibility=["read"])
    """Number of tables errored in full load."""
    initialization_completed: Optional[bool] = rest_field(name="initializationCompleted", visibility=["read"])
    """Indicates if initial load (full load) has been completed."""
    latency: Optional[int] = rest_field(visibility=["read"])
    """CDC apply latency."""
    result_type: Literal["DatabaseLevelOutput"] = rest_discriminator(name="resultType", visibility=["read", "create", "update", "delete", "query"])  # type: ignore
    """Result type. Required. Default value is \"DatabaseLevelOutput\"."""

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

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

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


class MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputError(
    MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput, discriminator="ErrorOutput"
):  # pylint: disable=name-too-long
    """MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputError.

    :ivar id: Result identifier.
    :vartype id: str
    :ivar error: Migration error.
    :vartype error: ~azure.mgmt.datamigration.models.ReportableException
    :ivar events: List of error events.
    :vartype events: list[~azure.mgmt.datamigration.models.SyncMigrationDatabaseErrorEvent]
    :ivar result_type: Result type. Required. Default value is "ErrorOutput".
    :vartype result_type: str
    """

    error: Optional["_models.ReportableException"] = rest_field(visibility=["read"])
    """Migration error."""
    events: Optional[list["_models.SyncMigrationDatabaseErrorEvent"]] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """List of error events."""
    result_type: Literal["ErrorOutput"] = rest_discriminator(name="resultType", visibility=["read", "create", "update", "delete", "query"])  # type: ignore
    """Result type. Required. Default value is \"ErrorOutput\"."""

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

    @overload
    def __init__(self, mapping: Mapping[str, Any]) -> None:
        """
        :param 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.result_type = "ErrorOutput"  # type: ignore


class MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputMigrationLevel(
    MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput, discriminator="MigrationLevelOutput"
):  # pylint: disable=name-too-long
    """MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputMigrationLevel.

    :ivar id: Result identifier.
    :vartype id: str
    :ivar started_on: Migration start time.
    :vartype started_on: ~datetime.datetime
    :ivar ended_on: Migration end time.
    :vartype ended_on: ~datetime.datetime
    :ivar source_server_version: Source server version.
    :vartype source_server_version: str
    :ivar source_server: Source server name.
    :vartype source_server: str
    :ivar target_server_version: Target server version.
    :vartype target_server_version: str
    :ivar target_server: Target server name.
    :vartype target_server: str
    :ivar source_server_type: Source server type. Known values are: "Access", "DB2", "MySQL",
     "Oracle", "SQL", "Sybase", "PostgreSQL", "MongoDB", "SQLRDS", "MySQLRDS", and "PostgreSQLRDS".
    :vartype source_server_type: str or ~azure.mgmt.datamigration.models.ScenarioSource
    :ivar target_server_type: Target server type. Known values are: "SQLServer", "SQLDB", "SQLDW",
     "SQLMI", "AzureDBForMySql", "AzureDBForPostgresSQL", and "MongoDB".
    :vartype target_server_type: str or ~azure.mgmt.datamigration.models.ScenarioTarget
    :ivar state: Migration status. Known values are: "UNDEFINED", "VALIDATING", "PENDING",
     "COMPLETE", "ACTION_REQUIRED", and "FAILED".
    :vartype state: str or ~azure.mgmt.datamigration.models.ReplicateMigrationState
    :ivar database_count: Number of databases to include.
    :vartype database_count: float
    :ivar result_type: Result type. Required. Default value is "MigrationLevelOutput".
    :vartype result_type: str
    """

    started_on: Optional[datetime.datetime] = rest_field(name="startedOn", visibility=["read"], format="rfc3339")
    """Migration start time."""
    ended_on: Optional[datetime.datetime] = rest_field(name="endedOn", visibility=["read"], format="rfc3339")
    """Migration end time."""
    source_server_version: Optional[str] = rest_field(name="sourceServerVersion", visibility=["read"])
    """Source server version."""
    source_server: Optional[str] = rest_field(name="sourceServer", visibility=["read"])
    """Source server name."""
    target_server_version: Optional[str] = rest_field(name="targetServerVersion", visibility=["read"])
    """Target server version."""
    target_server: Optional[str] = rest_field(name="targetServer", visibility=["read"])
    """Target server name."""
    source_server_type: Optional[Union[str, "_models.ScenarioSource"]] = rest_field(
        name="sourceServerType", visibility=["read"]
    )
    """Source server type. Known values are: \"Access\", \"DB2\", \"MySQL\", \"Oracle\", \"SQL\",
     \"Sybase\", \"PostgreSQL\", \"MongoDB\", \"SQLRDS\", \"MySQLRDS\", and \"PostgreSQLRDS\"."""
    target_server_type: Optional[Union[str, "_models.ScenarioTarget"]] = rest_field(
        name="targetServerType", visibility=["read"]
    )
    """Target server type. Known values are: \"SQLServer\", \"SQLDB\", \"SQLDW\", \"SQLMI\",
     \"AzureDBForMySql\", \"AzureDBForPostgresSQL\", and \"MongoDB\"."""
    state: Optional[Union[str, "_models.ReplicateMigrationState"]] = rest_field(visibility=["read"])
    """Migration status. Known values are: \"UNDEFINED\", \"VALIDATING\", \"PENDING\", \"COMPLETE\",
     \"ACTION_REQUIRED\", and \"FAILED\"."""
    database_count: Optional[float] = rest_field(
        name="databaseCount", visibility=["read", "create", "update", "delete", "query"]
    )
    """Number of databases to include."""
    result_type: Literal["MigrationLevelOutput"] = rest_discriminator(name="resultType", visibility=["read", "create", "update", "delete", "query"])  # type: ignore
    """Result type. Required. Default value is \"MigrationLevelOutput\"."""

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

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

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


class MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputTableLevel(
    MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput, discriminator="TableLevelOutput"
):  # pylint: disable=name-too-long
    """MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutputTableLevel.

    :ivar id: Result identifier.
    :vartype id: str
    :ivar table_name: Name of the table.
    :vartype table_name: str
    :ivar database_name: Name of the database.
    :vartype database_name: str
    :ivar cdc_insert_counter: Number of applied inserts.
    :vartype cdc_insert_counter: int
    :ivar cdc_update_counter: Number of applied updates.
    :vartype cdc_update_counter: int
    :ivar cdc_delete_counter: Number of applied deletes.
    :vartype cdc_delete_counter: int
    :ivar full_load_est_finish_time: Estimate to finish full load.
    :vartype full_load_est_finish_time: ~datetime.datetime
    :ivar full_load_started_on: Full load start time.
    :vartype full_load_started_on: ~datetime.datetime
    :ivar full_load_ended_on: Full load end time.
    :vartype full_load_ended_on: ~datetime.datetime
    :ivar full_load_total_rows: Number of rows applied in full load.
    :vartype full_load_total_rows: int
    :ivar state: Current state of the table migration. Known values are: "BEFORE_LOAD",
     "FULL_LOAD", "COMPLETED", "CANCELED", "ERROR", and "FAILED".
    :vartype state: str or ~azure.mgmt.datamigration.models.SyncTableMigrationState
    :ivar total_changes_applied: Total number of applied changes.
    :vartype total_changes_applied: int
    :ivar data_errors_counter: Number of data errors occurred.
    :vartype data_errors_counter: int
    :ivar last_modified_time: Last modified time on target.
    :vartype last_modified_time: ~datetime.datetime
    :ivar result_type: Result type. Required. Default value is "TableLevelOutput".
    :vartype result_type: str
    """

    table_name: Optional[str] = rest_field(name="tableName", visibility=["read"])
    """Name of the table."""
    database_name: Optional[str] = rest_field(name="databaseName", visibility=["read"])
    """Name of the database."""
    cdc_insert_counter: Optional[int] = rest_field(name="cdcInsertCounter", visibility=["read"])
    """Number of applied inserts."""
    cdc_update_counter: Optional[int] = rest_field(name="cdcUpdateCounter", visibility=["read"])
    """Number of applied updates."""
    cdc_delete_counter: Optional[int] = rest_field(name="cdcDeleteCounter", visibility=["read"])
    """Number of applied deletes."""
    full_load_est_finish_time: Optional[datetime.datetime] = rest_field(
        name="fullLoadEstFinishTime", visibility=["read"], format="rfc3339"
    )
    """Estimate to finish full load."""
    full_load_started_on: Optional[datetime.datetime] = rest_field(
        name="fullLoadStartedOn", visibility=["read"], format="rfc3339"
    )
    """Full load start time."""
    full_load_ended_on: Optional[datetime.datetime] = rest_field(
        name="fullLoadEndedOn", visibility=["read"], format="rfc3339"
    )
    """Full load end time."""
    full_load_total_rows: Optional[int] = rest_field(name="fullLoadTotalRows", visibility=["read"])
    """Number of rows applied in full load."""
    state: Optional[Union[str, "_models.SyncTableMigrationState"]] = rest_field(visibility=["read"])
    """Current state of the table migration. Known values are: \"BEFORE_LOAD\", \"FULL_LOAD\",
     \"COMPLETED\", \"CANCELED\", \"ERROR\", and \"FAILED\"."""
    total_changes_applied: Optional[int] = rest_field(name="totalChangesApplied", visibility=["read"])
    """Total number of applied changes."""
    data_errors_counter: Optional[int] = rest_field(name="dataErrorsCounter", visibility=["read"])
    """Number of data errors occurred."""
    last_modified_time: Optional[datetime.datetime] = rest_field(
        name="lastModifiedTime", visibility=["read"], format="rfc3339"
    )
    """Last modified time on target."""
    result_type: Literal["TableLevelOutput"] = rest_discriminator(name="resultType", visibility=["read", "create", "update", "delete", "query"])  # type: ignore
    """Result type. Required. Default value is \"TableLevelOutput\"."""

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

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

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


class MigratePostgreSqlAzureDbForPostgreSqlSyncTaskProperties(
    ProjectTaskProperties, discriminator="Migrate.PostgreSql.AzureDbForPostgreSql.SyncV2"
):  # pylint: disable=name-too-long
    """Properties for the task that migrates PostgreSQL databases to Azure Database for PostgreSQL for
    online migrations.

    :ivar errors: Array of errors. This is ignored if submitted.
    :vartype errors: list[~azure.mgmt.datamigration.models.ODataError]
    :ivar state: The state of the task. This is ignored if submitted. Known values are: "Unknown",
     "Queued", "Running", "Canceled", "Succeeded", "Failed", "FailedInputValidation", and "Faulted".
    :vartype state: str or ~azure.mgmt.datamigration.models.TaskState
    :ivar commands: Array of command properties.
    :vartype commands: list[~azure.mgmt.datamigration.models.CommandProperties]
    :ivar client_data: Key value pairs of client data to attach meta data information to task.
    :vartype client_data: dict[str, str]
    :ivar input: Task input.
    :vartype input:
     ~azure.mgmt.datamigration.models.MigratePostgreSqlAzureDbForPostgreSqlSyncTaskInput
    :ivar output: Task output. This is ignored if submitted.
    :vartype output:
     list[~azure.mgmt.datamigration.models.MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput]
    :ivar task_id: task id.
    :vartype task_id: str
    :ivar created_on: DateTime in UTC when the task was created.
    :vartype created_on: str
    :ivar is_cloneable: whether the task can be cloned or not.
    :vartype is_cloneable: bool
    :ivar task_type: Task type. Required. Migrate.PostgreSql.AzureDbForPostgreSql.SyncV2.
    :vartype task_type: str or
     ~azure.mgmt.datamigration.models.MIGRATE_POSTGRE_SQL_AZURE_DB_FOR_POSTGRE_SQL_SYNC_V2
    """

    input: Optional["_models.MigratePostgreSqlAzureDbForPostgreSqlSyncTaskInput"] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """Task input."""
    output: Optional[list["_models.MigratePostgreSqlAzureDbForPostgreSqlSyncTaskOutput"]] = rest_field(
        visibility=["read"]
    )
    """Task output. This is ignored if submitted."""
    task_id: Optional[str] = rest_field(name="taskId", visibility=["read", "create", "update", "delete", "query"])
    """task id."""
    created_on: Optional[str] = rest_field(name="createdOn", visibility=["read", "create", "update", "delete", "query"])
    """DateTime in UTC when the task was created."""
    is_cloneable: Optional[bool] = rest_field(
        name="isCloneable", visibility=["read", "create", "update", "delete", "query"]
    )
    """whether the task can be cloned or not."""
    task_type: Literal[TaskType.MIGRATE_POSTGRE_SQL_AZURE_DB_FOR_POSTGRE_SQL_SYNC_V2] = rest_discriminator(name="taskType", visibility=["read", "create", "update", "delete", "query"])  # type: ignore
    """Task type. Required. Migrate.PostgreSql.AzureDbForPostgreSql.SyncV2."""

    @overload
    def __init__(
        self,
        *,
        client_data: Optional[dict[str, str]] = None,
        input: Optional["_models.MigratePostgreSqlAzureDbForPostgreSqlSyncTaskInput"] = None,
        task_id: Optional[str] = None,
        created_on: Optional[str] = None,
        is_cloneable: Optional[bool] = None,
    ) -> None: ...

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

    def __init__(self, *args: Any, **kwargs: Any) -> None:
        super().__init__(*args, **kwargs)
        self.task_type = TaskType.MIGRATE_POSTGRE_SQL_AZURE_DB_FOR_POSTGRE_SQL_SYNC_V2  # type: ignore


class MigrateSchemaSqlServerSqlDbDatabaseInput(_Model):
    """Database input for migrate schema Sql Server to Azure SQL Server scenario.

    :ivar name: Name of source database.
    :vartype name: str
    :ivar id: Id of the source database.
    :vartype id: str
    :ivar target_database_name: Name of target database.
    :vartype target_database_name: str
    :ivar schema_setting: Database schema migration settings.
    :vartype schema_setting: ~azure.mgmt.datamigration.models.SchemaMigrationSetting
    """

    name: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """Name of source database."""
    id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """Id of the source database."""
    target_database_name: Optional[str] = rest_field(
        name="targetDatabaseName", visibility=["read", "create", "update", "delete", "query"]
    )
    """Name of target database."""
    schema_setting: Optional["_models.SchemaMigrationSetting"] = rest_field(
        name="schemaSetting", visibility=["read", "create", "update", "delete", "query"]
    )
    """Database schema migration settings."""

    @overload
    def __init__(
        self,
        *,
        name: Optional[str] = None,
        id: Optional[str] = None,  # pylint: disable=redefined-builtin
        target_database_name: Optional[str] = None,
        schema_setting: Optional["_models.SchemaMigrationSetting"] = None,
    ) -> None: ...

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

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


class SqlMigrationTaskInput(_Model):
    """Base class for migration task input.

    :ivar source_connection_info: Information for connecting to source. Required.
    :vartype source_connection_info: ~azure.mgmt.datamigration.models.SqlConnectionInfo
    :ivar target_connection_info: Information for connecting to target. Required.
    :vartype target_connection_info: ~azure.mgmt.datamigration.models.SqlConnectionInfo
    """

    source_connection_info: "_models.SqlConnectionInfo" = rest_field(
        name="sourceConnectionInfo", visibility=["read", "create", "update", "delete", "query"]
    )
    """Information for connecting to source. Required."""
    target_connection_info: "_models.SqlConnectionInfo" = rest_field(
        name="targetConnectionInfo", visibility=["read", "create", "update", "delete", "query"]
    )
    """Information for connecting to target. Required."""

    @overload
    def __init__(
        self,
        *,
        source_connection_info: "_models.SqlConnectionInfo",
        target_connection_info: "_models.SqlConnectionInfo",
    ) -> None: ...

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

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


class MigrateSchemaSqlServerSqlDbTaskInput(SqlMigrationTaskInput):
    """Input for task that migrates Schema for SQL Server databases to Azure SQL databases.

    :ivar source_connection_info: Information for connecting to source. Required.
    :vartype source_connection_info: ~azure.mgmt.datamigration.models.SqlConnectionInfo
    :ivar target_connection_info: Information for connecting to target. Required.
    :vartype target_connection_info: ~azure.mgmt.datamigration.models.SqlConnectionInfo
    :ivar selected_databases: Databases to migrate. Required.
    :vartype selected_databases:
     list[~azure.mgmt.datamigration.models.MigrateSchemaSqlServerSqlDbDatabaseInput]
    :ivar encrypted_key_for_secure_fields: encrypted key for secure fields.
    :vartype encrypted_key_for_secure_fields: str
    :ivar started_on: Migration start time.
    :vartype started_on: str
    """

    selected_databases: list["_models.MigrateSchemaSqlServerSqlDbDatabaseInput"] = rest_field(
        name="selectedDatabases", visibility=["read", "create", "update", "delete", "query"]
    )
    """Databases to migrate. Required."""
    encrypted_key_for_secure_fields: Optional[str] = rest_field(
        name="encryptedKeyForSecureFields", visibility=["read", "create", "update", "delete", "query"]
    )
    """encrypted key for secure fields."""
    started_on: Optional[str] = rest_field(name="startedOn", visibility=["read", "create", "update", "delete", "query"])
    """Migration start time."""

    @overload
    def __init__(
        self,
        *,
        source_connection_info: "_models.SqlConnectionInfo",
        target_connection_info: "_models.SqlConnectionInfo",
        selected_databases: list["_models.MigrateSchemaSqlServerSqlDbDatabaseInput"],
        encrypted_key_for_secure_fields: Optional[str] = None,
        started_on: 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 MigrateSchemaSqlServerSqlDbTaskOutput(_Model):
    """Output for the task that migrates Schema for SQL Server databases to Azure SQL databases.

    You probably want to use the sub-classes and not this class directly. Known sub-classes are:
    MigrateSchemaSqlServerSqlDbTaskOutputDatabaseLevel, MigrateSchemaSqlTaskOutputError,
    MigrateSchemaSqlServerSqlDbTaskOutputMigrationLevel, MigrateSchemaSqlServerSqlDbTaskOutputError

    :ivar id: Result identifier.
    :vartype id: str
    :ivar result_type: Result type. Required. Default value is None.
    :vartype result_type: str
    """

    __mapping__: dict[str, _Model] = {}
    id: Optional[str] = rest_field(visibility=["read"])
    """Result identifier."""
    result_type: str = rest_discriminator(name="resultType", visibility=["read", "create", "update", "delete", "query"])
    """Result type. Required. Default value is None."""

    @overload
    def __init__(
        self,
        *,
        result_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 MigrateSchemaSqlServerSqlDbTaskOutputDatabaseLevel(
    MigrateSchemaSqlServerSqlDbTaskOutput, discriminator="DatabaseLevelOutput"
):  # pylint: disable=name-too-long
    """MigrateSchemaSqlServerSqlDbTaskOutputDatabaseLevel.

    :ivar id: Result identifier.
    :vartype id: str
    :ivar database_name: The name of the database.
    :vartype database_name: str
    :ivar state: State of the schema migration for this database. Known values are: "None",
     "InProgress", "Failed", "Warning", "Completed", "Skipped", and "Stopped".
    :vartype state: str or ~azure.mgmt.datamigration.models.MigrationState
    :ivar stage: Schema migration stage for this database. Known values are: "NotStarted",
     "ValidatingInputs", "CollectingObjects", "DownloadingScript", "GeneratingScript",
     "UploadingScript", "DeployingSchema", "Completed", "CompletedWithWarnings", and "Failed".
    :vartype stage: str or ~azure.mgmt.datamigration.models.SchemaMigrationStage
    :ivar started_on: Migration start time.
    :vartype started_on: ~datetime.datetime
    :ivar ended_on: Migration end time.
    :vartype ended_on: ~datetime.datetime
    :ivar database_error_result_prefix: Prefix string to use for querying errors for this database.
    :vartype database_error_result_prefix: str
    :ivar schema_error_result_prefix: Prefix string to use for querying schema errors for this
     database.
    :vartype schema_error_result_prefix: str
    :ivar number_of_successful_operations: Number of successful operations for this database.
    :vartype number_of_successful_operations: int
    :ivar number_of_failed_operations: Number of failed operations for this database.
    :vartype number_of_failed_operations: int
    :ivar file_id: Identifier for the file resource containing the schema of this database.
    :vartype file_id: str
    :ivar result_type: Result type. Required. Default value is "DatabaseLevelOutput".
    :vartype result_type: str
    """

    database_name: Optional[str] = rest_field(name="databaseName", visibility=["read"])
    """The name of the database."""
    state: Optional[Union[str, "_models.MigrationState"]] = rest_field(visibility=["read"])
    """State of the schema migration for this database. Known values are: \"None\", \"InProgress\",
     \"Failed\", \"Warning\", \"Completed\", \"Skipped\", and \"Stopped\"."""
    stage: Optional[Union[str, "_models.SchemaMigrationStage"]] = rest_field(visibility=["read"])
    """Schema migration stage for this database. Known values are: \"NotStarted\",
     \"ValidatingInputs\", \"CollectingObjects\", \"DownloadingScript\", \"GeneratingScript\",
     \"UploadingScript\", \"DeployingSchema\", \"Completed\", \"CompletedWithWarnings\", and
     \"Failed\"."""
    started_on: Optional[datetime.datetime] = rest_field(name="startedOn", visibility=["read"], format="rfc3339")
    """Migration start time."""
    ended_on: Optional[datetime.datetime] = rest_field(name="endedOn", visibility=["read"], format="rfc3339")
    """Migration end time."""
    database_error_result_prefix: Optional[str] = rest_field(name="databaseErrorResultPrefix", visibility=["read"])
    """Prefix string to use for querying errors for this database."""
    schema_error_result_prefix: Optional[str] = rest_field(name="schemaErrorResultPrefix", visibility=["read"])
    """Prefix string to use for querying schema errors for this database."""
    number_of_successful_operations: Optional[int] = rest_field(
        name="numberOfSuccessfulOperations", visibility=["read"]
    )
    """Number of successful operations for this database."""
    number_of_failed_operations: Optional[int] = rest_field(name="numberOfFailedOperations", visibility=["read"])
    """Number of failed operations for this database."""
    file_id: Optional[str] = rest_field(name="fileId", visibility=["read"])
    """Identifier for the file resource containing the schema of this database."""
    result_type: Literal["DatabaseLevelOutput"] = rest_discriminator(name="resultType", visibility=["read", "create", "update", "delete", "query"])  # type: ignore
    """Result type. Required. Default value is \"DatabaseLevelOutput\"."""

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

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

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


class MigrateSchemaSqlServerSqlDbTaskOutputError(
    MigrateSchemaSqlServerSqlDbTaskOutput, discriminator="SchemaErrorOutput"
):  # pylint: disable=name-too-long
    """MigrateSchemaSqlServerSqlDbTaskOutputError.

    :ivar id: Result identifier.
    :vartype id: str
    :ivar command_text: Schema command which failed.
    :vartype command_text: str
    :ivar error_text: Reason of failure.
    :vartype error_text: str
    :ivar result_type: Result type. Required. Default value is "SchemaErrorOutput".
    :vartype result_type: str
    """

    command_text: Optional[str] = rest_field(name="commandText", visibility=["read"])
    """Schema command which failed."""
    error_text: Optional[str] = rest_field(name="errorText", visibility=["read"])
    """Reason of failure."""
    result_type: Literal["SchemaErrorOutput"] = rest_discriminator(name="resultType", visibility=["read", "create", "update", "delete", "query"])  # type: ignore
    """Result type. Required. Default value is \"SchemaErrorOutput\"."""

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

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

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


class MigrateSchemaSqlServerSqlDbTaskOutputMigrationLevel(
    MigrateSchemaSqlServerSqlDbTaskOutput, discriminator="MigrationLevelOutput"
):  # pylint: disable=name-too-long
    """MigrateSchemaSqlServerSqlDbTaskOutputMigrationLevel.

    :ivar id: Result identifier.
    :vartype id: str
    :ivar state: Overall state of the schema migration. Known values are: "None", "InProgress",
     "Failed", "Warning", "Completed", "Skipped", and "Stopped".
    :vartype state: str or ~azure.mgmt.datamigration.models.MigrationState
    :ivar started_on: Migration start time.
    :vartype started_on: ~datetime.datetime
    :ivar ended_on: Migration end time.
    :vartype ended_on: ~datetime.datetime
    :ivar source_server_version: Source server version.
    :vartype source_server_version: str
    :ivar source_server_brand_version: Source server brand version.
    :vartype source_server_brand_version: str
    :ivar target_server_version: Target server version.
    :vartype target_server_version: str
    :ivar target_server_brand_version: Target server brand version.
    :vartype target_server_brand_version: str
    :ivar result_type: Result type. Required. Default value is "MigrationLevelOutput".
    :vartype result_type: str
    """

    state: Optional[Union[str, "_models.MigrationState"]] = rest_field(visibility=["read"])
    """Overall state of the schema migration. Known values are: \"None\", \"InProgress\", \"Failed\",
     \"Warning\", \"Completed\", \"Skipped\", and \"Stopped\"."""
    started_on: Optional[datetime.datetime] = rest_field(name="startedOn", visibility=["read"], format="rfc3339")
    """Migration start time."""
    ended_on: Optional[datetime.datetime] = rest_field(name="endedOn", visibility=["read"], format="rfc3339")
    """Migration end time."""
    source_server_version: Optional[str] = rest_field(name="sourceServerVersion", visibility=["read"])
    """Source server version."""
    source_server_brand_version: Optional[str] = rest_field(name="sourceServerBrandVersion", visibility=["read"])
    """Source server brand version."""
    target_server_version: Optional[str] = rest_field(name="targetServerVersion", visibility=["read"])
    """Target server version."""
    target_server_brand_version: Optional[str] = rest_field(name="targetServerBrandVersion", visibility=["read"])
    """Target server brand version."""
    result_type: Literal["MigrationLevelOutput"] = rest_discriminator(name="resultType", visibility=["read", "create", "update", "delete", "query"])  # type: ignore
    """Result type. Required. Default value is \"MigrationLevelOutput\"."""

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

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

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


class MigrateSchemaSqlServerSqlDbTaskProperties(
    ProjectTaskProperties, discriminator="MigrateSchemaSqlServerSqlDb"
):  # pylint: disable=name-too-long
    """Properties for task that migrates Schema for SQL Server databases to Azure SQL databases.

    :ivar errors: Array of errors. This is ignored if submitted.
    :vartype errors: list[~azure.mgmt.datamigration.models.ODataError]
    :ivar state: The state of the task. This is ignored if submitted. Known values are: "Unknown",
     "Queued", "Running", "Canceled", "Succeeded", "Failed", "FailedInputValidation", and "Faulted".
    :vartype state: str or ~azure.mgmt.datamigration.models.TaskState
    :ivar commands: Array of command properties.
    :vartype commands: list[~azure.mgmt.datamigration.models.CommandProperties]
    :ivar client_data: Key value pairs of client data to attach meta data information to task.
    :vartype client_data: dict[str, str]
    :ivar input: Task input.
    :vartype input: ~azure.mgmt.datamigration.models.MigrateSchemaSqlServerSqlDbTaskInput
    :ivar output: Task output. This is ignored if submitted.
    :vartype output: list[~azure.mgmt.datamigration.models.MigrateSchemaSqlServerSqlDbTaskOutput]
    :ivar created_on: DateTime in UTC when the task was created.
    :vartype created_on: str
    :ivar task_id: Task id.
    :vartype task_id: str
    :ivar is_cloneable: whether the task can be cloned or not.
    :vartype is_cloneable: bool
    :ivar task_type: Task type. Required. MigrateSchemaSqlServerSqlDb.
    :vartype task_type: str or ~azure.mgmt.datamigration.models.MIGRATE_SCHEMA_SQL_SERVER_SQL_DB
    """

    input: Optional["_models.MigrateSchemaSqlServerSqlDbTaskInput"] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """Task input."""
    output: Optional[list["_models.MigrateSchemaSqlServerSqlDbTaskOutput"]] = rest_field(visibility=["read"])
    """Task output. This is ignored if submitted."""
    created_on: Optional[str] = rest_field(name="createdOn", visibility=["read", "create", "update", "delete", "query"])
    """DateTime in UTC when the task was created."""
    task_id: Optional[str] = rest_field(name="taskId", visibility=["read", "create", "update", "delete", "query"])
    """Task id."""
    is_cloneable: Optional[bool] = rest_field(
        name="isCloneable", visibility=["read", "create", "update", "delete", "query"]
    )
    """whether the task can be cloned or not."""
    task_type: Literal[TaskType.MIGRATE_SCHEMA_SQL_SERVER_SQL_DB] = rest_discriminator(name="taskType", visibility=["read", "create", "update", "delete", "query"])  # type: ignore
    """Task type. Required. MigrateSchemaSqlServerSqlDb."""

    @overload
    def __init__(
        self,
        *,
        client_data: Optional[dict[str, str]] = None,
        input: Optional["_models.MigrateSchemaSqlServerSqlDbTaskInput"] = None,
        created_on: Optional[str] = None,
        task_id: Optional[str] = None,
        is_cloneable: Optional[bool] = None,
    ) -> None: ...

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

    def __init__(self, *args: Any, **kwargs: Any) -> None:
        super().__init__(*args, **kwargs)
        self.task_type = TaskType.MIGRATE_SCHEMA_SQL_SERVER_SQL_DB  # type: ignore


class MigrateSchemaSqlTaskOutputError(MigrateSchemaSqlServerSqlDbTaskOutput, discriminator="ErrorOutput"):
    """MigrateSchemaSqlTaskOutputError.

    :ivar id: Result identifier.
    :vartype id: str
    :ivar error: Migration error.
    :vartype error: ~azure.mgmt.datamigration.models.ReportableException
    :ivar result_type: Result type. Required. Default value is "ErrorOutput".
    :vartype result_type: str
    """

    error: Optional["_models.ReportableException"] = rest_field(visibility=["read"])
    """Migration error."""
    result_type: Literal["ErrorOutput"] = rest_discriminator(name="resultType", visibility=["read", "create", "update", "delete", "query"])  # type: ignore
    """Result type. Required. Default value is \"ErrorOutput\"."""

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

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

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


class MigrateSqlServerSqlDbDatabaseInput(_Model):
    """Database specific information for SQL to Azure SQL DB migration task inputs.

    :ivar name: Name of the database.
    :vartype name: str
    :ivar target_database_name: Name of target database. Note: Target database will be truncated
     before starting migration.
    :vartype target_database_name: str
    :ivar make_source_db_read_only: Whether to set database read only before migration.
    :vartype make_source_db_read_only: bool
    :ivar table_map: Mapping of source to target tables.
    :vartype table_map: dict[str, str]
    :ivar schema_setting: Settings selected for DB schema migration.
    :vartype schema_setting: any
    :ivar id: id of the database.
    :vartype id: str
    """

    name: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """Name of the database."""
    target_database_name: Optional[str] = rest_field(
        name="targetDatabaseName", visibility=["read", "create", "update", "delete", "query"]
    )
    """Name of target database. Note: Target database will be truncated before starting migration."""
    make_source_db_read_only: Optional[bool] = rest_field(
        name="makeSourceDbReadOnly", visibility=["read", "create", "update", "delete", "query"]
    )
    """Whether to set database read only before migration."""
    table_map: Optional[dict[str, str]] = rest_field(
        name="tableMap", visibility=["read", "create", "update", "delete", "query"]
    )
    """Mapping of source to target tables."""
    schema_setting: Optional[Any] = rest_field(
        name="schemaSetting", visibility=["read", "create", "update", "delete", "query"]
    )
    """Settings selected for DB schema migration."""
    id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """id of the database."""

    @overload
    def __init__(
        self,
        *,
        name: Optional[str] = None,
        target_database_name: Optional[str] = None,
        make_source_db_read_only: Optional[bool] = None,
        table_map: Optional[dict[str, str]] = None,
        schema_setting: Optional[Any] = None,
        id: Optional[str] = None,  # pylint: disable=redefined-builtin
    ) -> None: ...

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

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


class MigrateSqlServerSqlDbSyncDatabaseInput(_Model):
    """Database specific information for SQL to Azure SQL DB sync migration task inputs.

    :ivar id: Unique identifier for database.
    :vartype id: str
    :ivar name: Name of database.
    :vartype name: str
    :ivar target_database_name: Target database name.
    :vartype target_database_name: str
    :ivar schema_name: Schema name to be migrated.
    :vartype schema_name: str
    :ivar table_map: Mapping of source to target tables.
    :vartype table_map: dict[str, str]
    :ivar migration_setting: Migration settings which tune the migration behavior.
    :vartype migration_setting: dict[str, str]
    :ivar source_setting: Source settings to tune source endpoint migration behavior.
    :vartype source_setting: dict[str, str]
    :ivar target_setting: Target settings to tune target endpoint migration behavior.
    :vartype target_setting: dict[str, str]
    """

    id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """Unique identifier for database."""
    name: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """Name of database."""
    target_database_name: Optional[str] = rest_field(
        name="targetDatabaseName", visibility=["read", "create", "update", "delete", "query"]
    )
    """Target database name."""
    schema_name: Optional[str] = rest_field(
        name="schemaName", visibility=["read", "create", "update", "delete", "query"]
    )
    """Schema name to be migrated."""
    table_map: Optional[dict[str, str]] = rest_field(
        name="tableMap", visibility=["read", "create", "update", "delete", "query"]
    )
    """Mapping of source to target tables."""
    migration_setting: Optional[dict[str, str]] = rest_field(
        name="migrationSetting", visibility=["read", "create", "update", "delete", "query"]
    )
    """Migration settings which tune the migration behavior."""
    source_setting: Optional[dict[str, str]] = rest_field(
        name="sourceSetting", visibility=["read", "create", "update", "delete", "query"]
    )
    """Source settings to tune source endpoint migration behavior."""
    target_setting: Optional[dict[str, str]] = rest_field(
        name="targetSetting", visibility=["read", "create", "update", "delete", "query"]
    )
    """Target settings to tune target endpoint migration behavior."""

    @overload
    def __init__(
        self,
        *,
        id: Optional[str] = None,  # pylint: disable=redefined-builtin
        name: Optional[str] = None,
        target_database_name: Optional[str] = None,
        schema_name: Optional[str] = None,
        table_map: Optional[dict[str, str]] = None,
        migration_setting: Optional[dict[str, str]] = None,
        source_setting: Optional[dict[str, str]] = None,
        target_setting: 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 MigrateSqlServerSqlDbSyncTaskInput(SqlMigrationTaskInput):
    """Input for the task that migrates on-prem SQL Server databases to Azure SQL Database for online
    migrations.

    :ivar source_connection_info: Information for connecting to source. Required.
    :vartype source_connection_info: ~azure.mgmt.datamigration.models.SqlConnectionInfo
    :ivar target_connection_info: Information for connecting to target. Required.
    :vartype target_connection_info: ~azure.mgmt.datamigration.models.SqlConnectionInfo
    :ivar selected_databases: Databases to migrate. Required.
    :vartype selected_databases:
     list[~azure.mgmt.datamigration.models.MigrateSqlServerSqlDbSyncDatabaseInput]
    :ivar validation_options: Validation options.
    :vartype validation_options: ~azure.mgmt.datamigration.models.MigrationValidationOptions
    """

    selected_databases: list["_models.MigrateSqlServerSqlDbSyncDatabaseInput"] = rest_field(
        name="selectedDatabases", visibility=["read", "create", "update", "delete", "query"]
    )
    """Databases to migrate. Required."""
    validation_options: Optional["_models.MigrationValidationOptions"] = rest_field(
        name="validationOptions", visibility=["read", "create", "update", "delete", "query"]
    )
    """Validation options."""

    @overload
    def __init__(
        self,
        *,
        source_connection_info: "_models.SqlConnectionInfo",
        target_connection_info: "_models.SqlConnectionInfo",
        selected_databases: list["_models.MigrateSqlServerSqlDbSyncDatabaseInput"],
        validation_options: Optional["_models.MigrationValidationOptions"] = None,
    ) -> None: ...

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

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


class MigrateSqlServerSqlDbSyncTaskOutput(_Model):
    """Output for the task that migrates on-prem SQL Server databases to Azure SQL Database for online
    migrations.

    You probably want to use the sub-classes and not this class directly. Known sub-classes are:
    MigrateSqlServerSqlDbSyncTaskOutputDatabaseError,
    MigrateSqlServerSqlDbSyncTaskOutputDatabaseLevel, MigrateSqlServerSqlDbSyncTaskOutputError,
    MigrateSqlServerSqlDbSyncTaskOutputMigrationLevel,
    MigrateSqlServerSqlDbSyncTaskOutputTableLevel

    :ivar id: Result identifier.
    :vartype id: str
    :ivar result_type: Result type. Required. Default value is None.
    :vartype result_type: str
    """

    __mapping__: dict[str, _Model] = {}
    id: Optional[str] = rest_field(visibility=["read"])
    """Result identifier."""
    result_type: str = rest_discriminator(name="resultType", visibility=["read", "create", "update", "delete", "query"])
    """Result type. Required. Default value is None."""

    @overload
    def __init__(
        self,
        *,
        result_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 MigrateSqlServerSqlDbSyncTaskOutputDatabaseError(
    MigrateSqlServerSqlDbSyncTaskOutput, discriminator="DatabaseLevelErrorOutput"
):  # pylint: disable=name-too-long
    """MigrateSqlServerSqlDbSyncTaskOutputDatabaseError.

    :ivar id: Result identifier.
    :vartype id: str
    :ivar error_message: Error message.
    :vartype error_message: str
    :ivar events: List of error events.
    :vartype events: list[~azure.mgmt.datamigration.models.SyncMigrationDatabaseErrorEvent]
    :ivar result_type: Result type. Required. Default value is "DatabaseLevelErrorOutput".
    :vartype result_type: str
    """

    error_message: Optional[str] = rest_field(
        name="errorMessage", visibility=["read", "create", "update", "delete", "query"]
    )
    """Error message."""
    events: Optional[list["_models.SyncMigrationDatabaseErrorEvent"]] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """List of error events."""
    result_type: Literal["DatabaseLevelErrorOutput"] = rest_discriminator(name="resultType", visibility=["read", "create", "update", "delete", "query"])  # type: ignore
    """Result type. Required. Default value is \"DatabaseLevelErrorOutput\"."""

    @overload
    def __init__(
        self,
        *,
        error_message: Optional[str] = None,
        events: Optional[list["_models.SyncMigrationDatabaseErrorEvent"]] = None,
    ) -> None: ...

    @overload
    def __init__(self, mapping: Mapping[str, Any]) -> None:
        """
        :param 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.result_type = "DatabaseLevelErrorOutput"  # type: ignore


class MigrateSqlServerSqlDbSyncTaskOutputDatabaseLevel(
    MigrateSqlServerSqlDbSyncTaskOutput, discriminator="DatabaseLevelOutput"
):  # pylint: disable=name-too-long
    """MigrateSqlServerSqlDbSyncTaskOutputDatabaseLevel.

    :ivar id: Result identifier.
    :vartype id: str
    :ivar database_name: Name of the database.
    :vartype database_name: str
    :ivar started_on: Migration start time.
    :vartype started_on: ~datetime.datetime
    :ivar ended_on: Migration end time.
    :vartype ended_on: ~datetime.datetime
    :ivar migration_state: Migration state that this database is in. Known values are: "UNDEFINED",
     "CONFIGURING", "INITIALIAZING", "STARTING", "RUNNING", "READY_TO_COMPLETE", "COMPLETING",
     "COMPLETE", "CANCELLING", "CANCELLED", "FAILED", "VALIDATING", "VALIDATION_COMPLETE",
     "VALIDATION_FAILED", "RESTORE_IN_PROGRESS", "RESTORE_COMPLETED", "BACKUP_IN_PROGRESS", and
     "BACKUP_COMPLETED".
    :vartype migration_state: str or
     ~azure.mgmt.datamigration.models.SyncDatabaseMigrationReportingState
    :ivar incoming_changes: Number of incoming changes.
    :vartype incoming_changes: int
    :ivar applied_changes: Number of applied changes.
    :vartype applied_changes: int
    :ivar cdc_insert_counter: Number of cdc inserts.
    :vartype cdc_insert_counter: int
    :ivar cdc_delete_counter: Number of cdc deletes.
    :vartype cdc_delete_counter: int
    :ivar cdc_update_counter: Number of cdc updates.
    :vartype cdc_update_counter: int
    :ivar full_load_completed_tables: Number of tables completed in full load.
    :vartype full_load_completed_tables: int
    :ivar full_load_loading_tables: Number of tables loading in full load.
    :vartype full_load_loading_tables: int
    :ivar full_load_queued_tables: Number of tables queued in full load.
    :vartype full_load_queued_tables: int
    :ivar full_load_errored_tables: Number of tables errored in full load.
    :vartype full_load_errored_tables: int
    :ivar initialization_completed: Indicates if initial load (full load) has been completed.
    :vartype initialization_completed: bool
    :ivar latency: CDC apply latency.
    :vartype latency: int
    :ivar result_type: Result type. Required. Default value is "DatabaseLevelOutput".
    :vartype result_type: str
    """

    database_name: Optional[str] = rest_field(name="databaseName", visibility=["read"])
    """Name of the database."""
    started_on: Optional[datetime.datetime] = rest_field(name="startedOn", visibility=["read"], format="rfc3339")
    """Migration start time."""
    ended_on: Optional[datetime.datetime] = rest_field(name="endedOn", visibility=["read"], format="rfc3339")
    """Migration end time."""
    migration_state: Optional[Union[str, "_models.SyncDatabaseMigrationReportingState"]] = rest_field(
        name="migrationState", visibility=["read"]
    )
    """Migration state that this database is in. Known values are: \"UNDEFINED\", \"CONFIGURING\",
     \"INITIALIAZING\", \"STARTING\", \"RUNNING\", \"READY_TO_COMPLETE\", \"COMPLETING\",
     \"COMPLETE\", \"CANCELLING\", \"CANCELLED\", \"FAILED\", \"VALIDATING\",
     \"VALIDATION_COMPLETE\", \"VALIDATION_FAILED\", \"RESTORE_IN_PROGRESS\", \"RESTORE_COMPLETED\",
     \"BACKUP_IN_PROGRESS\", and \"BACKUP_COMPLETED\"."""
    incoming_changes: Optional[int] = rest_field(name="incomingChanges", visibility=["read"])
    """Number of incoming changes."""
    applied_changes: Optional[int] = rest_field(name="appliedChanges", visibility=["read"])
    """Number of applied changes."""
    cdc_insert_counter: Optional[int] = rest_field(name="cdcInsertCounter", visibility=["read"])
    """Number of cdc inserts."""
    cdc_delete_counter: Optional[int] = rest_field(name="cdcDeleteCounter", visibility=["read"])
    """Number of cdc deletes."""
    cdc_update_counter: Optional[int] = rest_field(name="cdcUpdateCounter", visibility=["read"])
    """Number of cdc updates."""
    full_load_completed_tables: Optional[int] = rest_field(name="fullLoadCompletedTables", visibility=["read"])
    """Number of tables completed in full load."""
    full_load_loading_tables: Optional[int] = rest_field(name="fullLoadLoadingTables", visibility=["read"])
    """Number of tables loading in full load."""
    full_load_queued_tables: Optional[int] = rest_field(name="fullLoadQueuedTables", visibility=["read"])
    """Number of tables queued in full load."""
    full_load_errored_tables: Optional[int] = rest_field(name="fullLoadErroredTables", visibility=["read"])
    """Number of tables errored in full load."""
    initialization_completed: Optional[bool] = rest_field(name="initializationCompleted", visibility=["read"])
    """Indicates if initial load (full load) has been completed."""
    latency: Optional[int] = rest_field(visibility=["read"])
    """CDC apply latency."""
    result_type: Literal["DatabaseLevelOutput"] = rest_discriminator(name="resultType", visibility=["read", "create", "update", "delete", "query"])  # type: ignore
    """Result type. Required. Default value is \"DatabaseLevelOutput\"."""

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

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

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


class MigrateSqlServerSqlDbSyncTaskOutputError(MigrateSqlServerSqlDbSyncTaskOutput, discriminator="ErrorOutput"):
    """MigrateSqlServerSqlDbSyncTaskOutputError.

    :ivar id: Result identifier.
    :vartype id: str
    :ivar error: Migration error.
    :vartype error: ~azure.mgmt.datamigration.models.ReportableException
    :ivar result_type: Result type. Required. Default value is "ErrorOutput".
    :vartype result_type: str
    """

    error: Optional["_models.ReportableException"] = rest_field(visibility=["read"])
    """Migration error."""
    result_type: Literal["ErrorOutput"] = rest_discriminator(name="resultType", visibility=["read", "create", "update", "delete", "query"])  # type: ignore
    """Result type. Required. Default value is \"ErrorOutput\"."""

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

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

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


class MigrateSqlServerSqlDbSyncTaskOutputMigrationLevel(
    MigrateSqlServerSqlDbSyncTaskOutput, discriminator="MigrationLevelOutput"
):  # pylint: disable=name-too-long
    """MigrateSqlServerSqlDbSyncTaskOutputMigrationLevel.

    :ivar id: Result identifier.
    :vartype id: str
    :ivar started_on: Migration start time.
    :vartype started_on: ~datetime.datetime
    :ivar ended_on: Migration end time.
    :vartype ended_on: ~datetime.datetime
    :ivar source_server_version: Source server version.
    :vartype source_server_version: str
    :ivar source_server: Source server name.
    :vartype source_server: str
    :ivar target_server_version: Target server version.
    :vartype target_server_version: str
    :ivar target_server: Target server name.
    :vartype target_server: str
    :ivar database_count: Count of databases.
    :vartype database_count: int
    :ivar result_type: Result type. Required. Default value is "MigrationLevelOutput".
    :vartype result_type: str
    """

    started_on: Optional[datetime.datetime] = rest_field(name="startedOn", visibility=["read"], format="rfc3339")
    """Migration start time."""
    ended_on: Optional[datetime.datetime] = rest_field(name="endedOn", visibility=["read"], format="rfc3339")
    """Migration end time."""
    source_server_version: Optional[str] = rest_field(name="sourceServerVersion", visibility=["read"])
    """Source server version."""
    source_server: Optional[str] = rest_field(name="sourceServer", visibility=["read"])
    """Source server name."""
    target_server_version: Optional[str] = rest_field(name="targetServerVersion", visibility=["read"])
    """Target server version."""
    target_server: Optional[str] = rest_field(name="targetServer", visibility=["read"])
    """Target server name."""
    database_count: Optional[int] = rest_field(name="databaseCount", visibility=["read"])
    """Count of databases."""
    result_type: Literal["MigrationLevelOutput"] = rest_discriminator(name="resultType", visibility=["read", "create", "update", "delete", "query"])  # type: ignore
    """Result type. Required. Default value is \"MigrationLevelOutput\"."""

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

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

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


class MigrateSqlServerSqlDbSyncTaskOutputTableLevel(
    MigrateSqlServerSqlDbSyncTaskOutput, discriminator="TableLevelOutput"
):  # pylint: disable=name-too-long
    """MigrateSqlServerSqlDbSyncTaskOutputTableLevel.

    :ivar id: Result identifier.
    :vartype id: str
    :ivar table_name: Name of the table.
    :vartype table_name: str
    :ivar database_name: Name of the database.
    :vartype database_name: str
    :ivar cdc_insert_counter: Number of applied inserts.
    :vartype cdc_insert_counter: int
    :ivar cdc_update_counter: Number of applied updates.
    :vartype cdc_update_counter: int
    :ivar cdc_delete_counter: Number of applied deletes.
    :vartype cdc_delete_counter: int
    :ivar full_load_est_finish_time: Estimate to finish full load.
    :vartype full_load_est_finish_time: ~datetime.datetime
    :ivar full_load_started_on: Full load start time.
    :vartype full_load_started_on: ~datetime.datetime
    :ivar full_load_ended_on: Full load end time.
    :vartype full_load_ended_on: ~datetime.datetime
    :ivar full_load_total_rows: Number of rows applied in full load.
    :vartype full_load_total_rows: int
    :ivar state: Current state of the table migration. Known values are: "BEFORE_LOAD",
     "FULL_LOAD", "COMPLETED", "CANCELED", "ERROR", and "FAILED".
    :vartype state: str or ~azure.mgmt.datamigration.models.SyncTableMigrationState
    :ivar total_changes_applied: Total number of applied changes.
    :vartype total_changes_applied: int
    :ivar data_errors_counter: Number of data errors occurred.
    :vartype data_errors_counter: int
    :ivar last_modified_time: Last modified time on target.
    :vartype last_modified_time: ~datetime.datetime
    :ivar result_type: Result type. Required. Default value is "TableLevelOutput".
    :vartype result_type: str
    """

    table_name: Optional[str] = rest_field(name="tableName", visibility=["read"])
    """Name of the table."""
    database_name: Optional[str] = rest_field(name="databaseName", visibility=["read"])
    """Name of the database."""
    cdc_insert_counter: Optional[int] = rest_field(name="cdcInsertCounter", visibility=["read"])
    """Number of applied inserts."""
    cdc_update_counter: Optional[int] = rest_field(name="cdcUpdateCounter", visibility=["read"])
    """Number of applied updates."""
    cdc_delete_counter: Optional[int] = rest_field(name="cdcDeleteCounter", visibility=["read"])
    """Number of applied deletes."""
    full_load_est_finish_time: Optional[datetime.datetime] = rest_field(
        name="fullLoadEstFinishTime", visibility=["read"], format="rfc3339"
    )
    """Estimate to finish full load."""
    full_load_started_on: Optional[datetime.datetime] = rest_field(
        name="fullLoadStartedOn", visibility=["read"], format="rfc3339"
    )
    """Full load start time."""
    full_load_ended_on: Optional[datetime.datetime] = rest_field(
        name="fullLoadEndedOn", visibility=["read"], format="rfc3339"
    )
    """Full load end time."""
    full_load_total_rows: Optional[int] = rest_field(name="fullLoadTotalRows", visibility=["read"])
    """Number of rows applied in full load."""
    state: Optional[Union[str, "_models.SyncTableMigrationState"]] = rest_field(visibility=["read"])
    """Current state of the table migration. Known values are: \"BEFORE_LOAD\", \"FULL_LOAD\",
     \"COMPLETED\", \"CANCELED\", \"ERROR\", and \"FAILED\"."""
    total_changes_applied: Optional[int] = rest_field(name="totalChangesApplied", visibility=["read"])
    """Total number of applied changes."""
    data_errors_counter: Optional[int] = rest_field(name="dataErrorsCounter", visibility=["read"])
    """Number of data errors occurred."""
    last_modified_time: Optional[datetime.datetime] = rest_field(
        name="lastModifiedTime", visibility=["read"], format="rfc3339"
    )
    """Last modified time on target."""
    result_type: Literal["TableLevelOutput"] = rest_discriminator(name="resultType", visibility=["read", "create", "update", "delete", "query"])  # type: ignore
    """Result type. Required. Default value is \"TableLevelOutput\"."""

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

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

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


class MigrateSqlServerSqlDbSyncTaskProperties(ProjectTaskProperties, discriminator="Migrate.SqlServer.AzureSqlDb.Sync"):
    """Properties for the task that migrates on-prem SQL Server databases to Azure SQL Database for
    online migrations.

    :ivar errors: Array of errors. This is ignored if submitted.
    :vartype errors: list[~azure.mgmt.datamigration.models.ODataError]
    :ivar state: The state of the task. This is ignored if submitted. Known values are: "Unknown",
     "Queued", "Running", "Canceled", "Succeeded", "Failed", "FailedInputValidation", and "Faulted".
    :vartype state: str or ~azure.mgmt.datamigration.models.TaskState
    :ivar commands: Array of command properties.
    :vartype commands: list[~azure.mgmt.datamigration.models.CommandProperties]
    :ivar client_data: Key value pairs of client data to attach meta data information to task.
    :vartype client_data: dict[str, str]
    :ivar input: Task input.
    :vartype input: ~azure.mgmt.datamigration.models.MigrateSqlServerSqlDbSyncTaskInput
    :ivar output: Task output. This is ignored if submitted.
    :vartype output: list[~azure.mgmt.datamigration.models.MigrateSqlServerSqlDbSyncTaskOutput]
    :ivar task_type: Task type. Required. Migrate.SqlServer.AzureSqlDb.Sync.
    :vartype task_type: str or
     ~azure.mgmt.datamigration.models.MIGRATE_SQL_SERVER_AZURE_SQL_DB_SYNC
    """

    input: Optional["_models.MigrateSqlServerSqlDbSyncTaskInput"] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """Task input."""
    output: Optional[list["_models.MigrateSqlServerSqlDbSyncTaskOutput"]] = rest_field(visibility=["read"])
    """Task output. This is ignored if submitted."""
    task_type: Literal[TaskType.MIGRATE_SQL_SERVER_AZURE_SQL_DB_SYNC] = rest_discriminator(name="taskType", visibility=["read", "create", "update", "delete", "query"])  # type: ignore
    """Task type. Required. Migrate.SqlServer.AzureSqlDb.Sync."""

    @overload
    def __init__(
        self,
        *,
        client_data: Optional[dict[str, str]] = None,
        input: Optional["_models.MigrateSqlServerSqlDbSyncTaskInput"] = None,
    ) -> None: ...

    @overload
    def __init__(self, mapping: Mapping[str, Any]) -> None:
        """
        :param 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.task_type = TaskType.MIGRATE_SQL_SERVER_AZURE_SQL_DB_SYNC  # type: ignore


class MigrateSqlServerSqlDbTaskInput(SqlMigrationTaskInput):
    """Input for the task that migrates on-prem SQL Server databases to Azure SQL Database.

    :ivar source_connection_info: Information for connecting to source. Required.
    :vartype source_connection_info: ~azure.mgmt.datamigration.models.SqlConnectionInfo
    :ivar target_connection_info: Information for connecting to target. Required.
    :vartype target_connection_info: ~azure.mgmt.datamigration.models.SqlConnectionInfo
    :ivar selected_databases: Databases to migrate. Required.
    :vartype selected_databases:
     list[~azure.mgmt.datamigration.models.MigrateSqlServerSqlDbDatabaseInput]
    :ivar validation_options: Options for enabling various post migration validations. Available
     options, 1.) Data Integrity Check: Performs a checksum based comparison on source and target
     tables after the migration to ensure the correctness of the data. 2.) Schema Validation:
     Performs a thorough schema comparison between the source and target tables and provides a list
     of differences between the source and target database, 3.) Query Analysis: Executes a set of
     queries picked up automatically either from the Query Plan Cache or Query Store and execute
     them and compares the execution time between the source and target database.
    :vartype validation_options: ~azure.mgmt.datamigration.models.MigrationValidationOptions
    :ivar started_on: Date and time relative to UTC when the migration was started on.
    :vartype started_on: str
    :ivar encrypted_key_for_secure_fields: encrypted key for secure fields.
    :vartype encrypted_key_for_secure_fields: str
    """

    selected_databases: list["_models.MigrateSqlServerSqlDbDatabaseInput"] = rest_field(
        name="selectedDatabases", visibility=["read", "create", "update", "delete", "query"]
    )
    """Databases to migrate. Required."""
    validation_options: Optional["_models.MigrationValidationOptions"] = rest_field(
        name="validationOptions", visibility=["read", "create", "update", "delete", "query"]
    )
    """Options for enabling various post migration validations. Available options, 1.) Data Integrity
     Check: Performs a checksum based comparison on source and target tables after the migration to
     ensure the correctness of the data. 2.) Schema Validation: Performs a thorough schema
     comparison between the source and target tables and provides a list of differences between the
     source and target database, 3.) Query Analysis: Executes a set of queries picked up
     automatically either from the Query Plan Cache or Query Store and execute them and compares the
     execution time between the source and target database."""
    started_on: Optional[str] = rest_field(name="startedOn", visibility=["read", "create", "update", "delete", "query"])
    """Date and time relative to UTC when the migration was started on."""
    encrypted_key_for_secure_fields: Optional[str] = rest_field(
        name="encryptedKeyForSecureFields", visibility=["read", "create", "update", "delete", "query"]
    )
    """encrypted key for secure fields."""

    @overload
    def __init__(
        self,
        *,
        source_connection_info: "_models.SqlConnectionInfo",
        target_connection_info: "_models.SqlConnectionInfo",
        selected_databases: list["_models.MigrateSqlServerSqlDbDatabaseInput"],
        validation_options: Optional["_models.MigrationValidationOptions"] = None,
        started_on: Optional[str] = None,
        encrypted_key_for_secure_fields: 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 MigrateSqlServerSqlDbTaskOutput(_Model):
    """Output for the task that migrates on-prem SQL Server databases to Azure SQL Database.

    You probably want to use the sub-classes and not this class directly. Known sub-classes are:
    MigrateSqlServerSqlDbTaskOutputDatabaseLevel, MigrateSqlServerSqlDbTaskOutputError,
    MigrateSqlServerSqlDbTaskOutputDatabaseLevelValidationResult,
    MigrateSqlServerSqlDbTaskOutputMigrationLevel, MigrateSqlServerSqlDbTaskOutputValidationResult,
    MigrateSqlServerSqlDbTaskOutputTableLevel

    :ivar id: Result identifier.
    :vartype id: str
    :ivar result_type: Result type. Required. Default value is None.
    :vartype result_type: str
    """

    __mapping__: dict[str, _Model] = {}
    id: Optional[str] = rest_field(visibility=["read"])
    """Result identifier."""
    result_type: str = rest_discriminator(name="resultType", visibility=["read", "create", "update", "delete", "query"])
    """Result type. Required. Default value is None."""

    @overload
    def __init__(
        self,
        *,
        result_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 MigrateSqlServerSqlDbTaskOutputDatabaseLevel(
    MigrateSqlServerSqlDbTaskOutput, discriminator="DatabaseLevelOutput"
):  # pylint: disable=name-too-long
    """MigrateSqlServerSqlDbTaskOutputDatabaseLevel.

    :ivar id: Result identifier.
    :vartype id: str
    :ivar database_name: Name of the item.
    :vartype database_name: str
    :ivar started_on: Migration start time.
    :vartype started_on: ~datetime.datetime
    :ivar ended_on: Migration end time.
    :vartype ended_on: ~datetime.datetime
    :ivar state: Current state of migration. Known values are: "None", "InProgress", "Failed",
     "Warning", "Completed", "Skipped", and "Stopped".
    :vartype state: str or ~azure.mgmt.datamigration.models.MigrationState
    :ivar stage: Migration stage that this database is in. Known values are: "None", "Initialize",
     "Backup", "FileCopy", "Restore", and "Completed".
    :vartype stage: str or ~azure.mgmt.datamigration.models.DatabaseMigrationStage
    :ivar status_message: Status message.
    :vartype status_message: str
    :ivar message: Migration progress message.
    :vartype message: str
    :ivar number_of_objects: Number of objects.
    :vartype number_of_objects: int
    :ivar number_of_objects_completed: Number of successfully completed objects.
    :vartype number_of_objects_completed: int
    :ivar error_count: Number of database/object errors.
    :vartype error_count: int
    :ivar error_prefix: Wildcard string prefix to use for querying all errors of the item.
    :vartype error_prefix: str
    :ivar result_prefix: Wildcard string prefix to use for querying all sub-tem results of the
     item.
    :vartype result_prefix: str
    :ivar exceptions_and_warnings: Migration exceptions and warnings.
    :vartype exceptions_and_warnings: list[~azure.mgmt.datamigration.models.ReportableException]
    :ivar object_summary: Summary of object results in the migration.
    :vartype object_summary: str
    :ivar result_type: Result type. Required. Default value is "DatabaseLevelOutput".
    :vartype result_type: str
    """

    database_name: Optional[str] = rest_field(name="databaseName", visibility=["read"])
    """Name of the item."""
    started_on: Optional[datetime.datetime] = rest_field(name="startedOn", visibility=["read"], format="rfc3339")
    """Migration start time."""
    ended_on: Optional[datetime.datetime] = rest_field(name="endedOn", visibility=["read"], format="rfc3339")
    """Migration end time."""
    state: Optional[Union[str, "_models.MigrationState"]] = rest_field(visibility=["read"])
    """Current state of migration. Known values are: \"None\", \"InProgress\", \"Failed\",
     \"Warning\", \"Completed\", \"Skipped\", and \"Stopped\"."""
    stage: Optional[Union[str, "_models.DatabaseMigrationStage"]] = rest_field(visibility=["read"])
    """Migration stage that this database is in. Known values are: \"None\", \"Initialize\",
     \"Backup\", \"FileCopy\", \"Restore\", and \"Completed\"."""
    status_message: Optional[str] = rest_field(name="statusMessage", visibility=["read"])
    """Status message."""
    message: Optional[str] = rest_field(visibility=["read"])
    """Migration progress message."""
    number_of_objects: Optional[int] = rest_field(name="numberOfObjects", visibility=["read"])
    """Number of objects."""
    number_of_objects_completed: Optional[int] = rest_field(name="numberOfObjectsCompleted", visibility=["read"])
    """Number of successfully completed objects."""
    error_count: Optional[int] = rest_field(name="errorCount", visibility=["read"])
    """Number of database/object errors."""
    error_prefix: Optional[str] = rest_field(name="errorPrefix", visibility=["read"])
    """Wildcard string prefix to use for querying all errors of the item."""
    result_prefix: Optional[str] = rest_field(name="resultPrefix", visibility=["read"])
    """Wildcard string prefix to use for querying all sub-tem results of the item."""
    exceptions_and_warnings: Optional[list["_models.ReportableException"]] = rest_field(
        name="exceptionsAndWarnings", visibility=["read"]
    )
    """Migration exceptions and warnings."""
    object_summary: Optional[str] = rest_field(name="objectSummary", visibility=["read"])
    """Summary of object results in the migration."""
    result_type: Literal["DatabaseLevelOutput"] = rest_discriminator(name="resultType", visibility=["read", "create", "update", "delete", "query"])  # type: ignore
    """Result type. Required. Default value is \"DatabaseLevelOutput\"."""

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

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

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


class MigrateSqlServerSqlDbTaskOutputDatabaseLevelValidationResult(
    MigrateSqlServerSqlDbTaskOutput, discriminator="MigrationDatabaseLevelValidationOutput"
):  # pylint: disable=name-too-long
    """MigrateSqlServerSqlDbTaskOutputDatabaseLevelValidationResult.

    :ivar id: Result identifier.
    :vartype id: str
    :ivar migration_id: Migration Identifier.
    :vartype migration_id: str
    :ivar source_database_name: Name of the source database.
    :vartype source_database_name: str
    :ivar target_database_name: Name of the target database.
    :vartype target_database_name: str
    :ivar started_on: Validation start time.
    :vartype started_on: ~datetime.datetime
    :ivar ended_on: Validation end time.
    :vartype ended_on: ~datetime.datetime
    :ivar data_integrity_validation_result: Provides data integrity validation result between the
     source and target tables that are migrated.
    :vartype data_integrity_validation_result:
     ~azure.mgmt.datamigration.models.DataIntegrityValidationResult
    :ivar schema_validation_result: Provides schema comparison result between source and target
     database.
    :vartype schema_validation_result:
     ~azure.mgmt.datamigration.models.SchemaComparisonValidationResult
    :ivar query_analysis_validation_result: Results of some of the query execution result between
     source and target database.
    :vartype query_analysis_validation_result:
     ~azure.mgmt.datamigration.models.QueryAnalysisValidationResult
    :ivar status: Current status of validation at the database level. Known values are: "Default",
     "NotStarted", "Initialized", "InProgress", "Completed", "CompletedWithIssues", "Stopped", and
     "Failed".
    :vartype status: str or ~azure.mgmt.datamigration.models.ValidationStatus
    :ivar result_type: Result type. Required. Default value is
     "MigrationDatabaseLevelValidationOutput".
    :vartype result_type: str
    """

    migration_id: Optional[str] = rest_field(name="migrationId", visibility=["read"])
    """Migration Identifier."""
    source_database_name: Optional[str] = rest_field(name="sourceDatabaseName", visibility=["read"])
    """Name of the source database."""
    target_database_name: Optional[str] = rest_field(name="targetDatabaseName", visibility=["read"])
    """Name of the target database."""
    started_on: Optional[datetime.datetime] = rest_field(name="startedOn", visibility=["read"], format="rfc3339")
    """Validation start time."""
    ended_on: Optional[datetime.datetime] = rest_field(name="endedOn", visibility=["read"], format="rfc3339")
    """Validation end time."""
    data_integrity_validation_result: Optional["_models.DataIntegrityValidationResult"] = rest_field(
        name="dataIntegrityValidationResult", visibility=["read"]
    )
    """Provides data integrity validation result between the source and target tables that are
     migrated."""
    schema_validation_result: Optional["_models.SchemaComparisonValidationResult"] = rest_field(
        name="schemaValidationResult", visibility=["read"]
    )
    """Provides schema comparison result between source and target database."""
    query_analysis_validation_result: Optional["_models.QueryAnalysisValidationResult"] = rest_field(
        name="queryAnalysisValidationResult", visibility=["read"]
    )
    """Results of some of the query execution result between source and target database."""
    status: Optional[Union[str, "_models.ValidationStatus"]] = rest_field(visibility=["read"])
    """Current status of validation at the database level. Known values are: \"Default\",
     \"NotStarted\", \"Initialized\", \"InProgress\", \"Completed\", \"CompletedWithIssues\",
     \"Stopped\", and \"Failed\"."""
    result_type: Literal["MigrationDatabaseLevelValidationOutput"] = rest_discriminator(name="resultType", visibility=["read", "create", "update", "delete", "query"])  # type: ignore
    """Result type. Required. Default value is \"MigrationDatabaseLevelValidationOutput\"."""

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

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

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


class MigrateSqlServerSqlDbTaskOutputError(MigrateSqlServerSqlDbTaskOutput, discriminator="ErrorOutput"):
    """MigrateSqlServerSqlDbTaskOutputError.

    :ivar id: Result identifier.
    :vartype id: str
    :ivar error: Migration error.
    :vartype error: ~azure.mgmt.datamigration.models.ReportableException
    :ivar result_type: Result type. Required. Default value is "ErrorOutput".
    :vartype result_type: str
    """

    error: Optional["_models.ReportableException"] = rest_field(visibility=["read"])
    """Migration error."""
    result_type: Literal["ErrorOutput"] = rest_discriminator(name="resultType", visibility=["read", "create", "update", "delete", "query"])  # type: ignore
    """Result type. Required. Default value is \"ErrorOutput\"."""

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

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

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


class MigrateSqlServerSqlDbTaskOutputMigrationLevel(
    MigrateSqlServerSqlDbTaskOutput, discriminator="MigrationLevelOutput"
):  # pylint: disable=name-too-long
    """MigrateSqlServerSqlDbTaskOutputMigrationLevel.

    :ivar id: Result identifier.
    :vartype id: str
    :ivar started_on: Migration start time.
    :vartype started_on: ~datetime.datetime
    :ivar ended_on: Migration end time.
    :vartype ended_on: ~datetime.datetime
    :ivar duration_in_seconds: Duration of task execution in seconds.
    :vartype duration_in_seconds: int
    :ivar status: Current status of migration. Known values are: "Default", "Connecting",
     "SourceAndTargetSelected", "SelectLogins", "Configured", "Running", "Error", "Stopped",
     "Completed", and "CompletedWithWarnings".
    :vartype status: str or ~azure.mgmt.datamigration.models.MigrationStatus
    :ivar status_message: Migration status message.
    :vartype status_message: str
    :ivar message: Migration progress message.
    :vartype message: str
    :ivar databases: Selected databases as a map from database name to database id.
    :vartype databases: str
    :ivar database_summary: Summary of database results in the migration.
    :vartype database_summary: str
    :ivar migration_validation_result: Migration Validation Results.
    :vartype migration_validation_result:
     ~azure.mgmt.datamigration.models.MigrationValidationResult
    :ivar migration_report_result: Migration Report Result, provides unique url for downloading
     your migration report.
    :vartype migration_report_result: ~azure.mgmt.datamigration.models.MigrationReportResult
    :ivar source_server_version: Source server version.
    :vartype source_server_version: str
    :ivar source_server_brand_version: Source server brand version.
    :vartype source_server_brand_version: str
    :ivar target_server_version: Target server version.
    :vartype target_server_version: str
    :ivar target_server_brand_version: Target server brand version.
    :vartype target_server_brand_version: str
    :ivar exceptions_and_warnings: Migration exceptions and warnings.
    :vartype exceptions_and_warnings: list[~azure.mgmt.datamigration.models.ReportableException]
    :ivar result_type: Result type. Required. Default value is "MigrationLevelOutput".
    :vartype result_type: str
    """

    started_on: Optional[datetime.datetime] = rest_field(name="startedOn", visibility=["read"], format="rfc3339")
    """Migration start time."""
    ended_on: Optional[datetime.datetime] = rest_field(name="endedOn", visibility=["read"], format="rfc3339")
    """Migration end time."""
    duration_in_seconds: Optional[int] = rest_field(name="durationInSeconds", visibility=["read"])
    """Duration of task execution in seconds."""
    status: Optional[Union[str, "_models.MigrationStatus"]] = rest_field(visibility=["read"])
    """Current status of migration. Known values are: \"Default\", \"Connecting\",
     \"SourceAndTargetSelected\", \"SelectLogins\", \"Configured\", \"Running\", \"Error\",
     \"Stopped\", \"Completed\", and \"CompletedWithWarnings\"."""
    status_message: Optional[str] = rest_field(name="statusMessage", visibility=["read"])
    """Migration status message."""
    message: Optional[str] = rest_field(visibility=["read"])
    """Migration progress message."""
    databases: Optional[str] = rest_field(visibility=["read"])
    """Selected databases as a map from database name to database id."""
    database_summary: Optional[str] = rest_field(name="databaseSummary", visibility=["read"])
    """Summary of database results in the migration."""
    migration_validation_result: Optional["_models.MigrationValidationResult"] = rest_field(
        name="migrationValidationResult", visibility=["read", "create", "update", "delete", "query"]
    )
    """Migration Validation Results."""
    migration_report_result: Optional["_models.MigrationReportResult"] = rest_field(
        name="migrationReportResult", visibility=["read", "create", "update", "delete", "query"]
    )
    """Migration Report Result, provides unique url for downloading your migration report."""
    source_server_version: Optional[str] = rest_field(name="sourceServerVersion", visibility=["read"])
    """Source server version."""
    source_server_brand_version: Optional[str] = rest_field(name="sourceServerBrandVersion", visibility=["read"])
    """Source server brand version."""
    target_server_version: Optional[str] = rest_field(name="targetServerVersion", visibility=["read"])
    """Target server version."""
    target_server_brand_version: Optional[str] = rest_field(name="targetServerBrandVersion", visibility=["read"])
    """Target server brand version."""
    exceptions_and_warnings: Optional[list["_models.ReportableException"]] = rest_field(
        name="exceptionsAndWarnings", visibility=["read"]
    )
    """Migration exceptions and warnings."""
    result_type: Literal["MigrationLevelOutput"] = rest_discriminator(name="resultType", visibility=["read", "create", "update", "delete", "query"])  # type: ignore
    """Result type. Required. Default value is \"MigrationLevelOutput\"."""

    @overload
    def __init__(
        self,
        *,
        migration_validation_result: Optional["_models.MigrationValidationResult"] = None,
        migration_report_result: Optional["_models.MigrationReportResult"] = None,
    ) -> None: ...

    @overload
    def __init__(self, mapping: Mapping[str, Any]) -> None:
        """
        :param 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.result_type = "MigrationLevelOutput"  # type: ignore


class MigrateSqlServerSqlDbTaskOutputTableLevel(
    MigrateSqlServerSqlDbTaskOutput, discriminator="TableLevelOutput"
):  # pylint: disable=name-too-long
    """MigrateSqlServerSqlDbTaskOutputTableLevel.

    :ivar id: Result identifier.
    :vartype id: str
    :ivar object_name: Name of the item.
    :vartype object_name: str
    :ivar started_on: Migration start time.
    :vartype started_on: ~datetime.datetime
    :ivar ended_on: Migration end time.
    :vartype ended_on: ~datetime.datetime
    :ivar state: Current state of migration. Known values are: "None", "InProgress", "Failed",
     "Warning", "Completed", "Skipped", and "Stopped".
    :vartype state: str or ~azure.mgmt.datamigration.models.MigrationState
    :ivar status_message: Status message.
    :vartype status_message: str
    :ivar items_count: Number of items.
    :vartype items_count: int
    :ivar items_completed_count: Number of successfully completed items.
    :vartype items_completed_count: int
    :ivar error_prefix: Wildcard string prefix to use for querying all errors of the item.
    :vartype error_prefix: str
    :ivar result_prefix: Wildcard string prefix to use for querying all sub-tem results of the
     item.
    :vartype result_prefix: str
    :ivar result_type: Result type. Required. Default value is "TableLevelOutput".
    :vartype result_type: str
    """

    object_name: Optional[str] = rest_field(name="objectName", visibility=["read"])
    """Name of the item."""
    started_on: Optional[datetime.datetime] = rest_field(name="startedOn", visibility=["read"], format="rfc3339")
    """Migration start time."""
    ended_on: Optional[datetime.datetime] = rest_field(name="endedOn", visibility=["read"], format="rfc3339")
    """Migration end time."""
    state: Optional[Union[str, "_models.MigrationState"]] = rest_field(visibility=["read"])
    """Current state of migration. Known values are: \"None\", \"InProgress\", \"Failed\",
     \"Warning\", \"Completed\", \"Skipped\", and \"Stopped\"."""
    status_message: Optional[str] = rest_field(name="statusMessage", visibility=["read"])
    """Status message."""
    items_count: Optional[int] = rest_field(name="itemsCount", visibility=["read"])
    """Number of items."""
    items_completed_count: Optional[int] = rest_field(name="itemsCompletedCount", visibility=["read"])
    """Number of successfully completed items."""
    error_prefix: Optional[str] = rest_field(name="errorPrefix", visibility=["read"])
    """Wildcard string prefix to use for querying all errors of the item."""
    result_prefix: Optional[str] = rest_field(name="resultPrefix", visibility=["read"])
    """Wildcard string prefix to use for querying all sub-tem results of the item."""
    result_type: Literal["TableLevelOutput"] = rest_discriminator(name="resultType", visibility=["read", "create", "update", "delete", "query"])  # type: ignore
    """Result type. Required. Default value is \"TableLevelOutput\"."""

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

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

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


class MigrateSqlServerSqlDbTaskOutputValidationResult(
    MigrateSqlServerSqlDbTaskOutput, discriminator="MigrationValidationOutput"
):  # pylint: disable=name-too-long
    """MigrateSqlServerSqlDbTaskOutputValidationResult.

    :ivar id: Migration validation result identifier.
    :vartype id: str
    :ivar migration_id: Migration Identifier.
    :vartype migration_id: str
    :ivar summary_results: Validation summary results for each database.
    :vartype summary_results: dict[str,
     ~azure.mgmt.datamigration.models.MigrationValidationDatabaseSummaryResult]
    :ivar status: Current status of validation at the migration level. Status from the database
     validation result status will be aggregated here. Known values are: "Default", "NotStarted",
     "Initialized", "InProgress", "Completed", "CompletedWithIssues", "Stopped", and "Failed".
    :vartype status: str or ~azure.mgmt.datamigration.models.ValidationStatus
    :ivar result_type: Result type. Required. Default value is "MigrationValidationOutput".
    :vartype result_type: str
    """

    migration_id: Optional[str] = rest_field(name="migrationId", visibility=["read"])
    """Migration Identifier."""
    summary_results: Optional[dict[str, "_models.MigrationValidationDatabaseSummaryResult"]] = rest_field(
        name="summaryResults", visibility=["read", "create", "update", "delete", "query"]
    )
    """Validation summary results for each database."""
    status: Optional[Union[str, "_models.ValidationStatus"]] = rest_field(visibility=["read"])
    """Current status of validation at the migration level. Status from the database validation result
     status will be aggregated here. Known values are: \"Default\", \"NotStarted\", \"Initialized\",
     \"InProgress\", \"Completed\", \"CompletedWithIssues\", \"Stopped\", and \"Failed\"."""
    result_type: Literal["MigrationValidationOutput"] = rest_discriminator(name="resultType", visibility=["read", "create", "update", "delete", "query"])  # type: ignore
    """Result type. Required. Default value is \"MigrationValidationOutput\"."""

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

    @overload
    def __init__(self, mapping: Mapping[str, Any]) -> None:
        """
        :param 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.result_type = "MigrationValidationOutput"  # type: ignore


class MigrateSqlServerSqlDbTaskProperties(ProjectTaskProperties, discriminator="Migrate.SqlServer.SqlDb"):
    """Properties for the task that migrates on-prem SQL Server databases to Azure SQL Database.

    :ivar errors: Array of errors. This is ignored if submitted.
    :vartype errors: list[~azure.mgmt.datamigration.models.ODataError]
    :ivar state: The state of the task. This is ignored if submitted. Known values are: "Unknown",
     "Queued", "Running", "Canceled", "Succeeded", "Failed", "FailedInputValidation", and "Faulted".
    :vartype state: str or ~azure.mgmt.datamigration.models.TaskState
    :ivar commands: Array of command properties.
    :vartype commands: list[~azure.mgmt.datamigration.models.CommandProperties]
    :ivar client_data: Key value pairs of client data to attach meta data information to task.
    :vartype client_data: dict[str, str]
    :ivar input: Task input.
    :vartype input: ~azure.mgmt.datamigration.models.MigrateSqlServerSqlDbTaskInput
    :ivar output: Task output. This is ignored if submitted.
    :vartype output: list[~azure.mgmt.datamigration.models.MigrateSqlServerSqlDbTaskOutput]
    :ivar task_id: task id.
    :vartype task_id: str
    :ivar is_cloneable: whether the task can be cloned or not.
    :vartype is_cloneable: bool
    :ivar created_on: DateTime in UTC when the task was created.
    :vartype created_on: str
    :ivar task_type: Task type. Required. Migrate.SqlServer.SqlDb.
    :vartype task_type: str or ~azure.mgmt.datamigration.models.MIGRATE_SQL_SERVER_SQL_DB
    """

    input: Optional["_models.MigrateSqlServerSqlDbTaskInput"] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """Task input."""
    output: Optional[list["_models.MigrateSqlServerSqlDbTaskOutput"]] = rest_field(visibility=["read"])
    """Task output. This is ignored if submitted."""
    task_id: Optional[str] = rest_field(name="taskId", visibility=["read", "create", "update", "delete", "query"])
    """task id."""
    is_cloneable: Optional[bool] = rest_field(
        name="isCloneable", visibility=["read", "create", "update", "delete", "query"]
    )
    """whether the task can be cloned or not."""
    created_on: Optional[str] = rest_field(name="createdOn", visibility=["read", "create", "update", "delete", "query"])
    """DateTime in UTC when the task was created."""
    task_type: Literal[TaskType.MIGRATE_SQL_SERVER_SQL_DB] = rest_discriminator(name="taskType", visibility=["read", "create", "update", "delete", "query"])  # type: ignore
    """Task type. Required. Migrate.SqlServer.SqlDb."""

    @overload
    def __init__(
        self,
        *,
        client_data: Optional[dict[str, str]] = None,
        input: Optional["_models.MigrateSqlServerSqlDbTaskInput"] = None,
        task_id: Optional[str] = None,
        is_cloneable: Optional[bool] = None,
        created_on: 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.task_type = TaskType.MIGRATE_SQL_SERVER_SQL_DB  # type: ignore


class MigrateSqlServerSqlMIDatabaseInput(_Model):
    """Database specific information for SQL to Azure SQL DB Managed Instance migration task inputs.

    :ivar name: Name of the database. Required.
    :vartype name: str
    :ivar restore_database_name: Name of the database at destination. Required.
    :vartype restore_database_name: str
    :ivar backup_file_share: Backup file share information for backing up this database.
    :vartype backup_file_share: ~azure.mgmt.datamigration.models.FileShare
    :ivar backup_file_paths: The list of backup files to be used in case of existing backups.
    :vartype backup_file_paths: list[str]
    :ivar id: id of the database.
    :vartype id: str
    """

    name: str = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """Name of the database. Required."""
    restore_database_name: str = rest_field(
        name="restoreDatabaseName", visibility=["read", "create", "update", "delete", "query"]
    )
    """Name of the database at destination. Required."""
    backup_file_share: Optional["_models.FileShare"] = rest_field(
        name="backupFileShare", visibility=["read", "create", "update", "delete", "query"]
    )
    """Backup file share information for backing up this database."""
    backup_file_paths: Optional[list[str]] = rest_field(
        name="backupFilePaths", visibility=["read", "create", "update", "delete", "query"]
    )
    """The list of backup files to be used in case of existing backups."""
    id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """id of the database."""

    @overload
    def __init__(
        self,
        *,
        name: str,
        restore_database_name: str,
        backup_file_share: Optional["_models.FileShare"] = None,
        backup_file_paths: Optional[list[str]] = None,
        id: Optional[str] = None,  # pylint: disable=redefined-builtin
    ) -> None: ...

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

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


class SqlServerSqlMISyncTaskInput(_Model):
    """Input for task that migrates SQL Server databases to Azure SQL Database Managed Instance online
    scenario.

    :ivar selected_databases: Databases to migrate. Required.
    :vartype selected_databases:
     list[~azure.mgmt.datamigration.models.MigrateSqlServerSqlMIDatabaseInput]
    :ivar backup_file_share: Backup file share information for all selected databases.
    :vartype backup_file_share: ~azure.mgmt.datamigration.models.FileShare
    :ivar storage_resource_id: Fully qualified resourceId of storage. Required.
    :vartype storage_resource_id: str
    :ivar source_connection_info: Connection information for source SQL Server. Required.
    :vartype source_connection_info: ~azure.mgmt.datamigration.models.SqlConnectionInfo
    :ivar target_connection_info: Connection information for Azure SQL Database Managed Instance.
     Required.
    :vartype target_connection_info: ~azure.mgmt.datamigration.models.MiSqlConnectionInfo
    :ivar azure_app: Azure Active Directory Application the DMS (classic) instance will use to
     connect to the target instance of Azure SQL Database Managed Instance and the Azure Storage
     Account. Required.
    :vartype azure_app: ~azure.mgmt.datamigration.models.AzureActiveDirectoryApp
    """

    selected_databases: list["_models.MigrateSqlServerSqlMIDatabaseInput"] = rest_field(
        name="selectedDatabases", visibility=["read", "create", "update", "delete", "query"]
    )
    """Databases to migrate. Required."""
    backup_file_share: Optional["_models.FileShare"] = rest_field(
        name="backupFileShare", visibility=["read", "create", "update", "delete", "query"]
    )
    """Backup file share information for all selected databases."""
    storage_resource_id: str = rest_field(
        name="storageResourceId", visibility=["read", "create", "update", "delete", "query"]
    )
    """Fully qualified resourceId of storage. Required."""
    source_connection_info: "_models.SqlConnectionInfo" = rest_field(
        name="sourceConnectionInfo", visibility=["read", "create", "update", "delete", "query"]
    )
    """Connection information for source SQL Server. Required."""
    target_connection_info: "_models.MiSqlConnectionInfo" = rest_field(
        name="targetConnectionInfo", visibility=["read", "create", "update", "delete", "query"]
    )
    """Connection information for Azure SQL Database Managed Instance. Required."""
    azure_app: "_models.AzureActiveDirectoryApp" = rest_field(
        name="azureApp", visibility=["read", "create", "update", "delete", "query"]
    )
    """Azure Active Directory Application the DMS (classic) instance will use to connect to the target
     instance of Azure SQL Database Managed Instance and the Azure Storage Account. Required."""

    @overload
    def __init__(
        self,
        *,
        selected_databases: list["_models.MigrateSqlServerSqlMIDatabaseInput"],
        storage_resource_id: str,
        source_connection_info: "_models.SqlConnectionInfo",
        target_connection_info: "_models.MiSqlConnectionInfo",
        azure_app: "_models.AzureActiveDirectoryApp",
        backup_file_share: Optional["_models.FileShare"] = None,
    ) -> None: ...

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

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


class MigrateSqlServerSqlMISyncTaskInput(SqlServerSqlMISyncTaskInput):
    """Input for task that migrates SQL Server databases to Azure SQL Database Managed Instance online
    scenario.

    :ivar selected_databases: Databases to migrate. Required.
    :vartype selected_databases:
     list[~azure.mgmt.datamigration.models.MigrateSqlServerSqlMIDatabaseInput]
    :ivar backup_file_share: Backup file share information for all selected databases.
    :vartype backup_file_share: ~azure.mgmt.datamigration.models.FileShare
    :ivar storage_resource_id: Fully qualified resourceId of storage. Required.
    :vartype storage_resource_id: str
    :ivar source_connection_info: Connection information for source SQL Server. Required.
    :vartype source_connection_info: ~azure.mgmt.datamigration.models.SqlConnectionInfo
    :ivar target_connection_info: Connection information for Azure SQL Database Managed Instance.
     Required.
    :vartype target_connection_info: ~azure.mgmt.datamigration.models.MiSqlConnectionInfo
    :ivar azure_app: Azure Active Directory Application the DMS (classic) instance will use to
     connect to the target instance of Azure SQL Database Managed Instance and the Azure Storage
     Account. Required.
    :vartype azure_app: ~azure.mgmt.datamigration.models.AzureActiveDirectoryApp
    :ivar number_of_parallel_database_migrations: Number of database migrations to start in
     parallel.
    :vartype number_of_parallel_database_migrations: float
    """

    number_of_parallel_database_migrations: Optional[float] = rest_field(
        name="numberOfParallelDatabaseMigrations", visibility=["read", "create", "update", "delete", "query"]
    )
    """Number of database migrations to start in parallel."""

    @overload
    def __init__(
        self,
        *,
        selected_databases: list["_models.MigrateSqlServerSqlMIDatabaseInput"],
        storage_resource_id: str,
        source_connection_info: "_models.SqlConnectionInfo",
        target_connection_info: "_models.MiSqlConnectionInfo",
        azure_app: "_models.AzureActiveDirectoryApp",
        backup_file_share: Optional["_models.FileShare"] = None,
        number_of_parallel_database_migrations: Optional[float] = None,
    ) -> None: ...

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

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


class MigrateSqlServerSqlMISyncTaskOutput(_Model):
    """Output for task that migrates SQL Server databases to Azure SQL Database Managed Instance using
    Log Replay Service.

    You probably want to use the sub-classes and not this class directly. Known sub-classes are:
    MigrateSqlServerSqlMISyncTaskOutputDatabaseLevel, MigrateSqlServerSqlMISyncTaskOutputError,
    MigrateSqlServerSqlMISyncTaskOutputMigrationLevel

    :ivar id: Result identifier.
    :vartype id: str
    :ivar result_type: Result type. Required. Default value is None.
    :vartype result_type: str
    """

    __mapping__: dict[str, _Model] = {}
    id: Optional[str] = rest_field(visibility=["read"])
    """Result identifier."""
    result_type: str = rest_discriminator(name="resultType", visibility=["read", "create", "update", "delete", "query"])
    """Result type. Required. Default value is None."""

    @overload
    def __init__(
        self,
        *,
        result_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 MigrateSqlServerSqlMISyncTaskOutputDatabaseLevel(
    MigrateSqlServerSqlMISyncTaskOutput, discriminator="DatabaseLevelOutput"
):  # pylint: disable=name-too-long
    """MigrateSqlServerSqlMISyncTaskOutputDatabaseLevel.

    :ivar id: Result identifier.
    :vartype id: str
    :ivar source_database_name: Name of the database.
    :vartype source_database_name: str
    :ivar migration_state: Current state of database. Known values are: "UNDEFINED", "INITIAL",
     "FULL_BACKUP_UPLOAD_START", "LOG_SHIPPING_START", "UPLOAD_LOG_FILES_START", "CUTOVER_START",
     "POST_CUTOVER_COMPLETE", "COMPLETED", "CANCELLED", and "FAILED".
    :vartype migration_state: str or ~azure.mgmt.datamigration.models.DatabaseMigrationState
    :ivar started_on: Database migration start time.
    :vartype started_on: ~datetime.datetime
    :ivar ended_on: Database migration end time.
    :vartype ended_on: ~datetime.datetime
    :ivar full_backup_set_info: Details of full backup set.
    :vartype full_backup_set_info: ~azure.mgmt.datamigration.models.BackupSetInfo
    :ivar last_restored_backup_set_info: Last applied backup set information.
    :vartype last_restored_backup_set_info: ~azure.mgmt.datamigration.models.BackupSetInfo
    :ivar active_backup_sets: Backup sets that are currently active (Either being uploaded or
     getting restored).
    :vartype active_backup_sets: list[~azure.mgmt.datamigration.models.BackupSetInfo]
    :ivar container_name: Name of container created in the Azure Storage account where backups are
     copied to.
    :vartype container_name: str
    :ivar error_prefix: prefix string to use for querying errors for this database.
    :vartype error_prefix: str
    :ivar is_full_backup_restored: Whether full backup has been applied to the target database or
     not.
    :vartype is_full_backup_restored: bool
    :ivar exceptions_and_warnings: Migration exceptions and warnings.
    :vartype exceptions_and_warnings: list[~azure.mgmt.datamigration.models.ReportableException]
    :ivar result_type: Result type. Required. Default value is "DatabaseLevelOutput".
    :vartype result_type: str
    """

    source_database_name: Optional[str] = rest_field(name="sourceDatabaseName", visibility=["read"])
    """Name of the database."""
    migration_state: Optional[Union[str, "_models.DatabaseMigrationState"]] = rest_field(
        name="migrationState", visibility=["read"]
    )
    """Current state of database. Known values are: \"UNDEFINED\", \"INITIAL\",
     \"FULL_BACKUP_UPLOAD_START\", \"LOG_SHIPPING_START\", \"UPLOAD_LOG_FILES_START\",
     \"CUTOVER_START\", \"POST_CUTOVER_COMPLETE\", \"COMPLETED\", \"CANCELLED\", and \"FAILED\"."""
    started_on: Optional[datetime.datetime] = rest_field(name="startedOn", visibility=["read"], format="rfc3339")
    """Database migration start time."""
    ended_on: Optional[datetime.datetime] = rest_field(name="endedOn", visibility=["read"], format="rfc3339")
    """Database migration end time."""
    full_backup_set_info: Optional["_models.BackupSetInfo"] = rest_field(name="fullBackupSetInfo", visibility=["read"])
    """Details of full backup set."""
    last_restored_backup_set_info: Optional["_models.BackupSetInfo"] = rest_field(
        name="lastRestoredBackupSetInfo", visibility=["read"]
    )
    """Last applied backup set information."""
    active_backup_sets: Optional[list["_models.BackupSetInfo"]] = rest_field(
        name="activeBackupSets", visibility=["read"]
    )
    """Backup sets that are currently active (Either being uploaded or getting restored)."""
    container_name: Optional[str] = rest_field(name="containerName", visibility=["read"])
    """Name of container created in the Azure Storage account where backups are copied to."""
    error_prefix: Optional[str] = rest_field(name="errorPrefix", visibility=["read"])
    """prefix string to use for querying errors for this database."""
    is_full_backup_restored: Optional[bool] = rest_field(name="isFullBackupRestored", visibility=["read"])
    """Whether full backup has been applied to the target database or not."""
    exceptions_and_warnings: Optional[list["_models.ReportableException"]] = rest_field(
        name="exceptionsAndWarnings", visibility=["read"]
    )
    """Migration exceptions and warnings."""
    result_type: Literal["DatabaseLevelOutput"] = rest_discriminator(name="resultType", visibility=["read", "create", "update", "delete", "query"])  # type: ignore
    """Result type. Required. Default value is \"DatabaseLevelOutput\"."""

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

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

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


class MigrateSqlServerSqlMISyncTaskOutputError(MigrateSqlServerSqlMISyncTaskOutput, discriminator="ErrorOutput"):
    """MigrateSqlServerSqlMISyncTaskOutputError.

    :ivar id: Result identifier.
    :vartype id: str
    :ivar error: Migration error.
    :vartype error: ~azure.mgmt.datamigration.models.ReportableException
    :ivar result_type: Result type. Required. Default value is "ErrorOutput".
    :vartype result_type: str
    """

    error: Optional["_models.ReportableException"] = rest_field(visibility=["read"])
    """Migration error."""
    result_type: Literal["ErrorOutput"] = rest_discriminator(name="resultType", visibility=["read", "create", "update", "delete", "query"])  # type: ignore
    """Result type. Required. Default value is \"ErrorOutput\"."""

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

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

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


class MigrateSqlServerSqlMISyncTaskOutputMigrationLevel(
    MigrateSqlServerSqlMISyncTaskOutput, discriminator="MigrationLevelOutput"
):  # pylint: disable=name-too-long
    """MigrateSqlServerSqlMISyncTaskOutputMigrationLevel.

    :ivar id: Result identifier.
    :vartype id: str
    :ivar database_count: Count of databases.
    :vartype database_count: int
    :ivar state: Current state of migration. Known values are: "None", "InProgress", "Failed",
     "Warning", "Completed", "Skipped", and "Stopped".
    :vartype state: str or ~azure.mgmt.datamigration.models.MigrationState
    :ivar started_on: Migration start time.
    :vartype started_on: ~datetime.datetime
    :ivar ended_on: Migration end time.
    :vartype ended_on: ~datetime.datetime
    :ivar source_server_name: Source server name.
    :vartype source_server_name: str
    :ivar source_server_version: Source server version.
    :vartype source_server_version: str
    :ivar source_server_brand_version: Source server brand version.
    :vartype source_server_brand_version: str
    :ivar target_server_name: Target server name.
    :vartype target_server_name: str
    :ivar target_server_version: Target server version.
    :vartype target_server_version: str
    :ivar target_server_brand_version: Target server brand version.
    :vartype target_server_brand_version: str
    :ivar database_error_count: Number of database level errors.
    :vartype database_error_count: int
    :ivar result_type: Result type. Required. Default value is "MigrationLevelOutput".
    :vartype result_type: str
    """

    database_count: Optional[int] = rest_field(name="databaseCount", visibility=["read"])
    """Count of databases."""
    state: Optional[Union[str, "_models.MigrationState"]] = rest_field(visibility=["read"])
    """Current state of migration. Known values are: \"None\", \"InProgress\", \"Failed\",
     \"Warning\", \"Completed\", \"Skipped\", and \"Stopped\"."""
    started_on: Optional[datetime.datetime] = rest_field(name="startedOn", visibility=["read"], format="rfc3339")
    """Migration start time."""
    ended_on: Optional[datetime.datetime] = rest_field(name="endedOn", visibility=["read"], format="rfc3339")
    """Migration end time."""
    source_server_name: Optional[str] = rest_field(name="sourceServerName", visibility=["read"])
    """Source server name."""
    source_server_version: Optional[str] = rest_field(name="sourceServerVersion", visibility=["read"])
    """Source server version."""
    source_server_brand_version: Optional[str] = rest_field(name="sourceServerBrandVersion", visibility=["read"])
    """Source server brand version."""
    target_server_name: Optional[str] = rest_field(name="targetServerName", visibility=["read"])
    """Target server name."""
    target_server_version: Optional[str] = rest_field(name="targetServerVersion", visibility=["read"])
    """Target server version."""
    target_server_brand_version: Optional[str] = rest_field(name="targetServerBrandVersion", visibility=["read"])
    """Target server brand version."""
    database_error_count: Optional[int] = rest_field(name="databaseErrorCount", visibility=["read"])
    """Number of database level errors."""
    result_type: Literal["MigrationLevelOutput"] = rest_discriminator(name="resultType", visibility=["read", "create", "update", "delete", "query"])  # type: ignore
    """Result type. Required. Default value is \"MigrationLevelOutput\"."""

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

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

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


class MigrateSqlServerSqlMISyncTaskProperties(
    ProjectTaskProperties, discriminator="Migrate.SqlServer.AzureSqlDbMI.Sync.LRS"
):
    """Properties for task that migrates SQL Server databases to Azure SQL Database Managed Instance
    sync scenario.

    :ivar errors: Array of errors. This is ignored if submitted.
    :vartype errors: list[~azure.mgmt.datamigration.models.ODataError]
    :ivar state: The state of the task. This is ignored if submitted. Known values are: "Unknown",
     "Queued", "Running", "Canceled", "Succeeded", "Failed", "FailedInputValidation", and "Faulted".
    :vartype state: str or ~azure.mgmt.datamigration.models.TaskState
    :ivar commands: Array of command properties.
    :vartype commands: list[~azure.mgmt.datamigration.models.CommandProperties]
    :ivar client_data: Key value pairs of client data to attach meta data information to task.
    :vartype client_data: dict[str, str]
    :ivar input: Task input.
    :vartype input: ~azure.mgmt.datamigration.models.MigrateSqlServerSqlMISyncTaskInput
    :ivar output: Task output. This is ignored if submitted.
    :vartype output: list[~azure.mgmt.datamigration.models.MigrateSqlServerSqlMISyncTaskOutput]
    :ivar created_on: DateTime in UTC when the task was created.
    :vartype created_on: str
    :ivar task_type: Task type. Required. Migrate.SqlServer.AzureSqlDbMI.Sync.LRS.
    :vartype task_type: str or
     ~azure.mgmt.datamigration.models.MIGRATE_SQL_SERVER_AZURE_SQL_DB_MI_SYNC_LRS
    """

    input: Optional["_models.MigrateSqlServerSqlMISyncTaskInput"] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """Task input."""
    output: Optional[list["_models.MigrateSqlServerSqlMISyncTaskOutput"]] = rest_field(visibility=["read"])
    """Task output. This is ignored if submitted."""
    created_on: Optional[str] = rest_field(name="createdOn", visibility=["read", "create", "update", "delete", "query"])
    """DateTime in UTC when the task was created."""
    task_type: Literal[TaskType.MIGRATE_SQL_SERVER_AZURE_SQL_DB_MI_SYNC_LRS] = rest_discriminator(name="taskType", visibility=["read", "create", "update", "delete", "query"])  # type: ignore
    """Task type. Required. Migrate.SqlServer.AzureSqlDbMI.Sync.LRS."""

    @overload
    def __init__(
        self,
        *,
        client_data: Optional[dict[str, str]] = None,
        input: Optional["_models.MigrateSqlServerSqlMISyncTaskInput"] = None,
        created_on: 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.task_type = TaskType.MIGRATE_SQL_SERVER_AZURE_SQL_DB_MI_SYNC_LRS  # type: ignore


class MigrateSqlServerSqlMITaskInput(SqlMigrationTaskInput):
    """Input for task that migrates SQL Server databases to Azure SQL Database Managed Instance.

    :ivar source_connection_info: Information for connecting to source. Required.
    :vartype source_connection_info: ~azure.mgmt.datamigration.models.SqlConnectionInfo
    :ivar target_connection_info: Information for connecting to target. Required.
    :vartype target_connection_info: ~azure.mgmt.datamigration.models.SqlConnectionInfo
    :ivar selected_databases: Databases to migrate. Required.
    :vartype selected_databases:
     list[~azure.mgmt.datamigration.models.MigrateSqlServerSqlMIDatabaseInput]
    :ivar started_on: Date and time relative to UTC when the migration was started on.
    :vartype started_on: str
    :ivar selected_logins: Logins to migrate.
    :vartype selected_logins: list[str]
    :ivar selected_agent_jobs: Agent Jobs to migrate.
    :vartype selected_agent_jobs: list[str]
    :ivar backup_file_share: Backup file share information for all selected databases.
    :vartype backup_file_share: ~azure.mgmt.datamigration.models.FileShare
    :ivar backup_blob_share: SAS URI of Azure Storage Account Container to be used for storing
     backup files. Required.
    :vartype backup_blob_share: ~azure.mgmt.datamigration.models.BlobShare
    :ivar backup_mode: Backup Mode to specify whether to use existing backup or create new backup.
     If using existing backups, backup file paths are required to be provided in selectedDatabases.
     Known values are: "CreateBackup" and "ExistingBackup".
    :vartype backup_mode: str or ~azure.mgmt.datamigration.models.BackupMode
    :ivar aad_domain_name: Azure Active Directory domain name in the format of 'contoso.com' for
     federated Azure AD or 'contoso.onmicrosoft.com' for managed domain, required if and only if
     Windows logins are selected.
    :vartype aad_domain_name: str
    :ivar encrypted_key_for_secure_fields: encrypted key for secure fields.
    :vartype encrypted_key_for_secure_fields: str
    """

    selected_databases: list["_models.MigrateSqlServerSqlMIDatabaseInput"] = rest_field(
        name="selectedDatabases", visibility=["read", "create", "update", "delete", "query"]
    )
    """Databases to migrate. Required."""
    started_on: Optional[str] = rest_field(name="startedOn", visibility=["read", "create", "update", "delete", "query"])
    """Date and time relative to UTC when the migration was started on."""
    selected_logins: Optional[list[str]] = rest_field(
        name="selectedLogins", visibility=["read", "create", "update", "delete", "query"]
    )
    """Logins to migrate."""
    selected_agent_jobs: Optional[list[str]] = rest_field(
        name="selectedAgentJobs", visibility=["read", "create", "update", "delete", "query"]
    )
    """Agent Jobs to migrate."""
    backup_file_share: Optional["_models.FileShare"] = rest_field(
        name="backupFileShare", visibility=["read", "create", "update", "delete", "query"]
    )
    """Backup file share information for all selected databases."""
    backup_blob_share: "_models.BlobShare" = rest_field(
        name="backupBlobShare", visibility=["read", "create", "update", "delete", "query"]
    )
    """SAS URI of Azure Storage Account Container to be used for storing backup files. Required."""
    backup_mode: Optional[Union[str, "_models.BackupMode"]] = rest_field(
        name="backupMode", visibility=["read", "create", "update", "delete", "query"]
    )
    """Backup Mode to specify whether to use existing backup or create new backup. If using existing
     backups, backup file paths are required to be provided in selectedDatabases. Known values are:
     \"CreateBackup\" and \"ExistingBackup\"."""
    aad_domain_name: Optional[str] = rest_field(
        name="aadDomainName", visibility=["read", "create", "update", "delete", "query"]
    )
    """Azure Active Directory domain name in the format of 'contoso.com' for federated Azure AD or
     'contoso.onmicrosoft.com' for managed domain, required if and only if Windows logins are
     selected."""
    encrypted_key_for_secure_fields: Optional[str] = rest_field(
        name="encryptedKeyForSecureFields", visibility=["read", "create", "update", "delete", "query"]
    )
    """encrypted key for secure fields."""

    @overload
    def __init__(
        self,
        *,
        source_connection_info: "_models.SqlConnectionInfo",
        target_connection_info: "_models.SqlConnectionInfo",
        selected_databases: list["_models.MigrateSqlServerSqlMIDatabaseInput"],
        backup_blob_share: "_models.BlobShare",
        started_on: Optional[str] = None,
        selected_logins: Optional[list[str]] = None,
        selected_agent_jobs: Optional[list[str]] = None,
        backup_file_share: Optional["_models.FileShare"] = None,
        backup_mode: Optional[Union[str, "_models.BackupMode"]] = None,
        aad_domain_name: Optional[str] = None,
        encrypted_key_for_secure_fields: 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 MigrateSqlServerSqlMITaskOutput(_Model):
    """Output for task that migrates SQL Server databases to Azure SQL Database Managed Instance.

    You probably want to use the sub-classes and not this class directly. Known sub-classes are:
    MigrateSqlServerSqlMITaskOutputAgentJobLevel, MigrateSqlServerSqlMITaskOutputDatabaseLevel,
    MigrateSqlServerSqlMITaskOutputError, MigrateSqlServerSqlMITaskOutputLoginLevel,
    MigrateSqlServerSqlMITaskOutputMigrationLevel

    :ivar id: Result identifier.
    :vartype id: str
    :ivar result_type: Result type. Required. Default value is None.
    :vartype result_type: str
    """

    __mapping__: dict[str, _Model] = {}
    id: Optional[str] = rest_field(visibility=["read"])
    """Result identifier."""
    result_type: str = rest_discriminator(name="resultType", visibility=["read", "create", "update", "delete", "query"])
    """Result type. Required. Default value is None."""

    @overload
    def __init__(
        self,
        *,
        result_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 MigrateSqlServerSqlMITaskOutputAgentJobLevel(
    MigrateSqlServerSqlMITaskOutput, discriminator="AgentJobLevelOutput"
):  # pylint: disable=name-too-long
    """MigrateSqlServerSqlMITaskOutputAgentJobLevel.

    :ivar id: Result identifier.
    :vartype id: str
    :ivar name: Agent Job name.
    :vartype name: str
    :ivar is_enabled: The state of the original Agent Job.
    :vartype is_enabled: bool
    :ivar state: Current state of migration. Known values are: "None", "InProgress", "Failed",
     "Warning", "Completed", "Skipped", and "Stopped".
    :vartype state: str or ~azure.mgmt.datamigration.models.MigrationState
    :ivar started_on: Migration start time.
    :vartype started_on: ~datetime.datetime
    :ivar ended_on: Migration end time.
    :vartype ended_on: ~datetime.datetime
    :ivar message: Migration progress message.
    :vartype message: str
    :ivar exceptions_and_warnings: Migration errors and warnings per job.
    :vartype exceptions_and_warnings: list[~azure.mgmt.datamigration.models.ReportableException]
    :ivar result_type: Result type. Required. Default value is "AgentJobLevelOutput".
    :vartype result_type: str
    """

    name: Optional[str] = rest_field(visibility=["read"])
    """Agent Job name."""
    is_enabled: Optional[bool] = rest_field(name="isEnabled", visibility=["read"])
    """The state of the original Agent Job."""
    state: Optional[Union[str, "_models.MigrationState"]] = rest_field(visibility=["read"])
    """Current state of migration. Known values are: \"None\", \"InProgress\", \"Failed\",
     \"Warning\", \"Completed\", \"Skipped\", and \"Stopped\"."""
    started_on: Optional[datetime.datetime] = rest_field(name="startedOn", visibility=["read"], format="rfc3339")
    """Migration start time."""
    ended_on: Optional[datetime.datetime] = rest_field(name="endedOn", visibility=["read"], format="rfc3339")
    """Migration end time."""
    message: Optional[str] = rest_field(visibility=["read"])
    """Migration progress message."""
    exceptions_and_warnings: Optional[list["_models.ReportableException"]] = rest_field(
        name="exceptionsAndWarnings", visibility=["read"]
    )
    """Migration errors and warnings per job."""
    result_type: Literal["AgentJobLevelOutput"] = rest_discriminator(name="resultType", visibility=["read", "create", "update", "delete", "query"])  # type: ignore
    """Result type. Required. Default value is \"AgentJobLevelOutput\"."""

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

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

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


class MigrateSqlServerSqlMITaskOutputDatabaseLevel(
    MigrateSqlServerSqlMITaskOutput, discriminator="DatabaseLevelOutput"
):  # pylint: disable=name-too-long
    """MigrateSqlServerSqlMITaskOutputDatabaseLevel.

    :ivar id: Result identifier.
    :vartype id: str
    :ivar database_name: Name of the database.
    :vartype database_name: str
    :ivar size_mb: Size of the database in megabytes.
    :vartype size_mb: float
    :ivar state: Current state of migration. Known values are: "None", "InProgress", "Failed",
     "Warning", "Completed", "Skipped", and "Stopped".
    :vartype state: str or ~azure.mgmt.datamigration.models.MigrationState
    :ivar stage: Current stage of migration. Known values are: "None", "Initialize", "Backup",
     "FileCopy", "Restore", and "Completed".
    :vartype stage: str or ~azure.mgmt.datamigration.models.DatabaseMigrationStage
    :ivar started_on: Migration start time.
    :vartype started_on: ~datetime.datetime
    :ivar ended_on: Migration end time.
    :vartype ended_on: ~datetime.datetime
    :ivar message: Migration progress message.
    :vartype message: str
    :ivar exceptions_and_warnings: Migration exceptions and warnings.
    :vartype exceptions_and_warnings: list[~azure.mgmt.datamigration.models.ReportableException]
    :ivar result_type: Result type. Required. Default value is "DatabaseLevelOutput".
    :vartype result_type: str
    """

    database_name: Optional[str] = rest_field(name="databaseName", visibility=["read"])
    """Name of the database."""
    size_mb: Optional[float] = rest_field(name="sizeMB", visibility=["read"])
    """Size of the database in megabytes."""
    state: Optional[Union[str, "_models.MigrationState"]] = rest_field(visibility=["read"])
    """Current state of migration. Known values are: \"None\", \"InProgress\", \"Failed\",
     \"Warning\", \"Completed\", \"Skipped\", and \"Stopped\"."""
    stage: Optional[Union[str, "_models.DatabaseMigrationStage"]] = rest_field(visibility=["read"])
    """Current stage of migration. Known values are: \"None\", \"Initialize\", \"Backup\",
     \"FileCopy\", \"Restore\", and \"Completed\"."""
    started_on: Optional[datetime.datetime] = rest_field(name="startedOn", visibility=["read"], format="rfc3339")
    """Migration start time."""
    ended_on: Optional[datetime.datetime] = rest_field(name="endedOn", visibility=["read"], format="rfc3339")
    """Migration end time."""
    message: Optional[str] = rest_field(visibility=["read"])
    """Migration progress message."""
    exceptions_and_warnings: Optional[list["_models.ReportableException"]] = rest_field(
        name="exceptionsAndWarnings", visibility=["read"]
    )
    """Migration exceptions and warnings."""
    result_type: Literal["DatabaseLevelOutput"] = rest_discriminator(name="resultType", visibility=["read", "create", "update", "delete", "query"])  # type: ignore
    """Result type. Required. Default value is \"DatabaseLevelOutput\"."""

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

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

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


class MigrateSqlServerSqlMITaskOutputError(MigrateSqlServerSqlMITaskOutput, discriminator="ErrorOutput"):
    """MigrateSqlServerSqlMITaskOutputError.

    :ivar id: Result identifier.
    :vartype id: str
    :ivar error: Migration error.
    :vartype error: ~azure.mgmt.datamigration.models.ReportableException
    :ivar result_type: Result type. Required. Default value is "ErrorOutput".
    :vartype result_type: str
    """

    error: Optional["_models.ReportableException"] = rest_field(visibility=["read"])
    """Migration error."""
    result_type: Literal["ErrorOutput"] = rest_discriminator(name="resultType", visibility=["read", "create", "update", "delete", "query"])  # type: ignore
    """Result type. Required. Default value is \"ErrorOutput\"."""

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

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

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


class MigrateSqlServerSqlMITaskOutputLoginLevel(
    MigrateSqlServerSqlMITaskOutput, discriminator="LoginLevelOutput"
):  # pylint: disable=name-too-long
    """MigrateSqlServerSqlMITaskOutputLoginLevel.

    :ivar id: Result identifier.
    :vartype id: str
    :ivar login_name: Login name.
    :vartype login_name: str
    :ivar state: Current state of login. Known values are: "None", "InProgress", "Failed",
     "Warning", "Completed", "Skipped", and "Stopped".
    :vartype state: str or ~azure.mgmt.datamigration.models.MigrationState
    :ivar stage: Current stage of login. Known values are: "None", "Initialize", "LoginMigration",
     "EstablishUserMapping", "AssignRoleMembership", "AssignRoleOwnership",
     "EstablishServerPermissions", "EstablishObjectPermissions", and "Completed".
    :vartype stage: str or ~azure.mgmt.datamigration.models.LoginMigrationStage
    :ivar started_on: Login migration start time.
    :vartype started_on: ~datetime.datetime
    :ivar ended_on: Login migration end time.
    :vartype ended_on: ~datetime.datetime
    :ivar message: Login migration progress message.
    :vartype message: str
    :ivar exceptions_and_warnings: Login migration errors and warnings per login.
    :vartype exceptions_and_warnings: list[~azure.mgmt.datamigration.models.ReportableException]
    :ivar result_type: Result type. Required. Default value is "LoginLevelOutput".
    :vartype result_type: str
    """

    login_name: Optional[str] = rest_field(name="loginName", visibility=["read"])
    """Login name."""
    state: Optional[Union[str, "_models.MigrationState"]] = rest_field(visibility=["read"])
    """Current state of login. Known values are: \"None\", \"InProgress\", \"Failed\", \"Warning\",
     \"Completed\", \"Skipped\", and \"Stopped\"."""
    stage: Optional[Union[str, "_models.LoginMigrationStage"]] = rest_field(visibility=["read"])
    """Current stage of login. Known values are: \"None\", \"Initialize\", \"LoginMigration\",
     \"EstablishUserMapping\", \"AssignRoleMembership\", \"AssignRoleOwnership\",
     \"EstablishServerPermissions\", \"EstablishObjectPermissions\", and \"Completed\"."""
    started_on: Optional[datetime.datetime] = rest_field(name="startedOn", visibility=["read"], format="rfc3339")
    """Login migration start time."""
    ended_on: Optional[datetime.datetime] = rest_field(name="endedOn", visibility=["read"], format="rfc3339")
    """Login migration end time."""
    message: Optional[str] = rest_field(visibility=["read"])
    """Login migration progress message."""
    exceptions_and_warnings: Optional[list["_models.ReportableException"]] = rest_field(
        name="exceptionsAndWarnings", visibility=["read"]
    )
    """Login migration errors and warnings per login."""
    result_type: Literal["LoginLevelOutput"] = rest_discriminator(name="resultType", visibility=["read", "create", "update", "delete", "query"])  # type: ignore
    """Result type. Required. Default value is \"LoginLevelOutput\"."""

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

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

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


class MigrateSqlServerSqlMITaskOutputMigrationLevel(
    MigrateSqlServerSqlMITaskOutput, discriminator="MigrationLevelOutput"
):  # pylint: disable=name-too-long
    """MigrateSqlServerSqlMITaskOutputMigrationLevel.

    :ivar id: Result identifier.
    :vartype id: str
    :ivar started_on: Migration start time.
    :vartype started_on: ~datetime.datetime
    :ivar ended_on: Migration end time.
    :vartype ended_on: ~datetime.datetime
    :ivar status: Current status of migration. Known values are: "Default", "Connecting",
     "SourceAndTargetSelected", "SelectLogins", "Configured", "Running", "Error", "Stopped",
     "Completed", and "CompletedWithWarnings".
    :vartype status: str or ~azure.mgmt.datamigration.models.MigrationStatus
    :ivar state: Current state of migration. Known values are: "None", "InProgress", "Failed",
     "Warning", "Completed", "Skipped", and "Stopped".
    :vartype state: str or ~azure.mgmt.datamigration.models.MigrationState
    :ivar agent_jobs: Selected agent jobs as a map from name to id.
    :vartype agent_jobs: str
    :ivar logins: Selected logins as a map from name to id.
    :vartype logins: str
    :ivar message: Migration progress message.
    :vartype message: str
    :ivar server_role_results: Map of server role migration results.
    :vartype server_role_results: str
    :ivar orphaned_users_info: List of orphaned users.
    :vartype orphaned_users_info: list[~azure.mgmt.datamigration.models.OrphanedUserInfo]
    :ivar databases: Selected databases as a map from database name to database id.
    :vartype databases: str
    :ivar source_server_version: Source server version.
    :vartype source_server_version: str
    :ivar source_server_brand_version: Source server brand version.
    :vartype source_server_brand_version: str
    :ivar target_server_version: Target server version.
    :vartype target_server_version: str
    :ivar target_server_brand_version: Target server brand version.
    :vartype target_server_brand_version: str
    :ivar exceptions_and_warnings: Migration exceptions and warnings.
    :vartype exceptions_and_warnings: list[~azure.mgmt.datamigration.models.ReportableException]
    :ivar result_type: Result type. Required. Default value is "MigrationLevelOutput".
    :vartype result_type: str
    """

    started_on: Optional[datetime.datetime] = rest_field(name="startedOn", visibility=["read"], format="rfc3339")
    """Migration start time."""
    ended_on: Optional[datetime.datetime] = rest_field(name="endedOn", visibility=["read"], format="rfc3339")
    """Migration end time."""
    status: Optional[Union[str, "_models.MigrationStatus"]] = rest_field(visibility=["read"])
    """Current status of migration. Known values are: \"Default\", \"Connecting\",
     \"SourceAndTargetSelected\", \"SelectLogins\", \"Configured\", \"Running\", \"Error\",
     \"Stopped\", \"Completed\", and \"CompletedWithWarnings\"."""
    state: Optional[Union[str, "_models.MigrationState"]] = rest_field(visibility=["read"])
    """Current state of migration. Known values are: \"None\", \"InProgress\", \"Failed\",
     \"Warning\", \"Completed\", \"Skipped\", and \"Stopped\"."""
    agent_jobs: Optional[str] = rest_field(name="agentJobs", visibility=["read"])
    """Selected agent jobs as a map from name to id."""
    logins: Optional[str] = rest_field(visibility=["read"])
    """Selected logins as a map from name to id."""
    message: Optional[str] = rest_field(visibility=["read"])
    """Migration progress message."""
    server_role_results: Optional[str] = rest_field(name="serverRoleResults", visibility=["read"])
    """Map of server role migration results."""
    orphaned_users_info: Optional[list["_models.OrphanedUserInfo"]] = rest_field(
        name="orphanedUsersInfo", visibility=["read"]
    )
    """List of orphaned users."""
    databases: Optional[str] = rest_field(visibility=["read"])
    """Selected databases as a map from database name to database id."""
    source_server_version: Optional[str] = rest_field(name="sourceServerVersion", visibility=["read"])
    """Source server version."""
    source_server_brand_version: Optional[str] = rest_field(name="sourceServerBrandVersion", visibility=["read"])
    """Source server brand version."""
    target_server_version: Optional[str] = rest_field(name="targetServerVersion", visibility=["read"])
    """Target server version."""
    target_server_brand_version: Optional[str] = rest_field(name="targetServerBrandVersion", visibility=["read"])
    """Target server brand version."""
    exceptions_and_warnings: Optional[list["_models.ReportableException"]] = rest_field(
        name="exceptionsAndWarnings", visibility=["read"]
    )
    """Migration exceptions and warnings."""
    result_type: Literal["MigrationLevelOutput"] = rest_discriminator(name="resultType", visibility=["read", "create", "update", "delete", "query"])  # type: ignore
    """Result type. Required. Default value is \"MigrationLevelOutput\"."""

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

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

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


class MigrateSqlServerSqlMITaskProperties(ProjectTaskProperties, discriminator="Migrate.SqlServer.AzureSqlDbMI"):
    """Properties for task that migrates SQL Server databases to Azure SQL Database Managed Instance.

    :ivar errors: Array of errors. This is ignored if submitted.
    :vartype errors: list[~azure.mgmt.datamigration.models.ODataError]
    :ivar state: The state of the task. This is ignored if submitted. Known values are: "Unknown",
     "Queued", "Running", "Canceled", "Succeeded", "Failed", "FailedInputValidation", and "Faulted".
    :vartype state: str or ~azure.mgmt.datamigration.models.TaskState
    :ivar commands: Array of command properties.
    :vartype commands: list[~azure.mgmt.datamigration.models.CommandProperties]
    :ivar client_data: Key value pairs of client data to attach meta data information to task.
    :vartype client_data: dict[str, str]
    :ivar input: Task input.
    :vartype input: ~azure.mgmt.datamigration.models.MigrateSqlServerSqlMITaskInput
    :ivar output: Task output. This is ignored if submitted.
    :vartype output: list[~azure.mgmt.datamigration.models.MigrateSqlServerSqlMITaskOutput]
    :ivar task_id: task id.
    :vartype task_id: str
    :ivar created_on: DateTime in UTC when the task was created.
    :vartype created_on: str
    :ivar parent_task_id: parent task id.
    :vartype parent_task_id: str
    :ivar is_cloneable: whether the task can be cloned or not.
    :vartype is_cloneable: bool
    :ivar task_type: Task type. Required. Migrate.SqlServer.AzureSqlDbMI.
    :vartype task_type: str or ~azure.mgmt.datamigration.models.MIGRATE_SQL_SERVER_AZURE_SQL_DB_MI
    """

    input: Optional["_models.MigrateSqlServerSqlMITaskInput"] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """Task input."""
    output: Optional[list["_models.MigrateSqlServerSqlMITaskOutput"]] = rest_field(visibility=["read"])
    """Task output. This is ignored if submitted."""
    task_id: Optional[str] = rest_field(name="taskId", visibility=["read", "create", "update", "delete", "query"])
    """task id."""
    created_on: Optional[str] = rest_field(name="createdOn", visibility=["read", "create", "update", "delete", "query"])
    """DateTime in UTC when the task was created."""
    parent_task_id: Optional[str] = rest_field(
        name="parentTaskId", visibility=["read", "create", "update", "delete", "query"]
    )
    """parent task id."""
    is_cloneable: Optional[bool] = rest_field(
        name="isCloneable", visibility=["read", "create", "update", "delete", "query"]
    )
    """whether the task can be cloned or not."""
    task_type: Literal[TaskType.MIGRATE_SQL_SERVER_AZURE_SQL_DB_MI] = rest_discriminator(name="taskType", visibility=["read", "create", "update", "delete", "query"])  # type: ignore
    """Task type. Required. Migrate.SqlServer.AzureSqlDbMI."""

    @overload
    def __init__(
        self,
        *,
        client_data: Optional[dict[str, str]] = None,
        input: Optional["_models.MigrateSqlServerSqlMITaskInput"] = None,
        task_id: Optional[str] = None,
        created_on: Optional[str] = None,
        parent_task_id: Optional[str] = None,
        is_cloneable: Optional[bool] = None,
    ) -> None: ...

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

    def __init__(self, *args: Any, **kwargs: Any) -> None:
        super().__init__(*args, **kwargs)
        self.task_type = TaskType.MIGRATE_SQL_SERVER_AZURE_SQL_DB_MI  # type: ignore


class MigrateSsisTaskInput(SqlMigrationTaskInput):
    """Input for task that migrates SSIS packages from SQL Server to Azure SQL Database Managed
    Instance.

    :ivar source_connection_info: Information for connecting to source. Required.
    :vartype source_connection_info: ~azure.mgmt.datamigration.models.SqlConnectionInfo
    :ivar target_connection_info: Information for connecting to target. Required.
    :vartype target_connection_info: ~azure.mgmt.datamigration.models.SqlConnectionInfo
    :ivar ssis_migration_info: SSIS package migration information. Required.
    :vartype ssis_migration_info: ~azure.mgmt.datamigration.models.SsisMigrationInfo
    """

    ssis_migration_info: "_models.SsisMigrationInfo" = rest_field(
        name="ssisMigrationInfo", visibility=["read", "create", "update", "delete", "query"]
    )
    """SSIS package migration information. Required."""

    @overload
    def __init__(
        self,
        *,
        source_connection_info: "_models.SqlConnectionInfo",
        target_connection_info: "_models.SqlConnectionInfo",
        ssis_migration_info: "_models.SsisMigrationInfo",
    ) -> None: ...

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

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


class MigrateSsisTaskOutput(_Model):
    """Output for task that migrates SSIS packages from SQL Server to Azure SQL Database Managed
    Instance.

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

    :ivar id: Result identifier.
    :vartype id: str
    :ivar result_type: Result type. Required. Default value is None.
    :vartype result_type: str
    """

    __mapping__: dict[str, _Model] = {}
    id: Optional[str] = rest_field(visibility=["read"])
    """Result identifier."""
    result_type: str = rest_discriminator(name="resultType", visibility=["read", "create", "update", "delete", "query"])
    """Result type. Required. Default value is None."""

    @overload
    def __init__(
        self,
        *,
        result_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 MigrateSsisTaskOutputMigrationLevel(MigrateSsisTaskOutput, discriminator="MigrationLevelOutput"):
    """MigrateSsisTaskOutputMigrationLevel.

    :ivar id: Result identifier.
    :vartype id: str
    :ivar started_on: Migration start time.
    :vartype started_on: ~datetime.datetime
    :ivar ended_on: Migration end time.
    :vartype ended_on: ~datetime.datetime
    :ivar status: Current status of migration. Known values are: "Default", "Connecting",
     "SourceAndTargetSelected", "SelectLogins", "Configured", "Running", "Error", "Stopped",
     "Completed", and "CompletedWithWarnings".
    :vartype status: str or ~azure.mgmt.datamigration.models.MigrationStatus
    :ivar message: Migration progress message.
    :vartype message: str
    :ivar source_server_version: Source server version.
    :vartype source_server_version: str
    :ivar source_server_brand_version: Source server brand version.
    :vartype source_server_brand_version: str
    :ivar target_server_version: Target server version.
    :vartype target_server_version: str
    :ivar target_server_brand_version: Target server brand version.
    :vartype target_server_brand_version: str
    :ivar exceptions_and_warnings: Migration exceptions and warnings.
    :vartype exceptions_and_warnings: list[~azure.mgmt.datamigration.models.ReportableException]
    :ivar stage: Stage of SSIS migration. Known values are: "None", "Initialize", "InProgress", and
     "Completed".
    :vartype stage: str or ~azure.mgmt.datamigration.models.SsisMigrationStage
    :ivar result_type: Result type. Required. Default value is "MigrationLevelOutput".
    :vartype result_type: str
    """

    started_on: Optional[datetime.datetime] = rest_field(name="startedOn", visibility=["read"], format="rfc3339")
    """Migration start time."""
    ended_on: Optional[datetime.datetime] = rest_field(name="endedOn", visibility=["read"], format="rfc3339")
    """Migration end time."""
    status: Optional[Union[str, "_models.MigrationStatus"]] = rest_field(visibility=["read"])
    """Current status of migration. Known values are: \"Default\", \"Connecting\",
     \"SourceAndTargetSelected\", \"SelectLogins\", \"Configured\", \"Running\", \"Error\",
     \"Stopped\", \"Completed\", and \"CompletedWithWarnings\"."""
    message: Optional[str] = rest_field(visibility=["read"])
    """Migration progress message."""
    source_server_version: Optional[str] = rest_field(name="sourceServerVersion", visibility=["read"])
    """Source server version."""
    source_server_brand_version: Optional[str] = rest_field(name="sourceServerBrandVersion", visibility=["read"])
    """Source server brand version."""
    target_server_version: Optional[str] = rest_field(name="targetServerVersion", visibility=["read"])
    """Target server version."""
    target_server_brand_version: Optional[str] = rest_field(name="targetServerBrandVersion", visibility=["read"])
    """Target server brand version."""
    exceptions_and_warnings: Optional[list["_models.ReportableException"]] = rest_field(
        name="exceptionsAndWarnings", visibility=["read"]
    )
    """Migration exceptions and warnings."""
    stage: Optional[Union[str, "_models.SsisMigrationStage"]] = rest_field(visibility=["read"])
    """Stage of SSIS migration. Known values are: \"None\", \"Initialize\", \"InProgress\", and
     \"Completed\"."""
    result_type: Literal["MigrationLevelOutput"] = rest_discriminator(name="resultType", visibility=["read", "create", "update", "delete", "query"])  # type: ignore
    """Result type. Required. Default value is \"MigrationLevelOutput\"."""

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

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

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


class MigrateSsisTaskOutputProjectLevel(MigrateSsisTaskOutput, discriminator="SsisProjectLevelOutput"):
    """MigrateSsisTaskOutputProjectLevel.

    :ivar id: Result identifier.
    :vartype id: str
    :ivar folder_name: Name of the folder.
    :vartype folder_name: str
    :ivar project_name: Name of the project.
    :vartype project_name: str
    :ivar state: Current state of migration. Known values are: "None", "InProgress", "Failed",
     "Warning", "Completed", "Skipped", and "Stopped".
    :vartype state: str or ~azure.mgmt.datamigration.models.MigrationState
    :ivar stage: Stage of SSIS migration. Known values are: "None", "Initialize", "InProgress", and
     "Completed".
    :vartype stage: str or ~azure.mgmt.datamigration.models.SsisMigrationStage
    :ivar started_on: Migration start time.
    :vartype started_on: ~datetime.datetime
    :ivar ended_on: Migration end time.
    :vartype ended_on: ~datetime.datetime
    :ivar message: Migration progress message.
    :vartype message: str
    :ivar exceptions_and_warnings: Migration exceptions and warnings.
    :vartype exceptions_and_warnings: list[~azure.mgmt.datamigration.models.ReportableException]
    :ivar result_type: Result type. Required. Default value is "SsisProjectLevelOutput".
    :vartype result_type: str
    """

    folder_name: Optional[str] = rest_field(name="folderName", visibility=["read"])
    """Name of the folder."""
    project_name: Optional[str] = rest_field(name="projectName", visibility=["read"])
    """Name of the project."""
    state: Optional[Union[str, "_models.MigrationState"]] = rest_field(visibility=["read"])
    """Current state of migration. Known values are: \"None\", \"InProgress\", \"Failed\",
     \"Warning\", \"Completed\", \"Skipped\", and \"Stopped\"."""
    stage: Optional[Union[str, "_models.SsisMigrationStage"]] = rest_field(visibility=["read"])
    """Stage of SSIS migration. Known values are: \"None\", \"Initialize\", \"InProgress\", and
     \"Completed\"."""
    started_on: Optional[datetime.datetime] = rest_field(name="startedOn", visibility=["read"], format="rfc3339")
    """Migration start time."""
    ended_on: Optional[datetime.datetime] = rest_field(name="endedOn", visibility=["read"], format="rfc3339")
    """Migration end time."""
    message: Optional[str] = rest_field(visibility=["read"])
    """Migration progress message."""
    exceptions_and_warnings: Optional[list["_models.ReportableException"]] = rest_field(
        name="exceptionsAndWarnings", visibility=["read"]
    )
    """Migration exceptions and warnings."""
    result_type: Literal["SsisProjectLevelOutput"] = rest_discriminator(name="resultType", visibility=["read", "create", "update", "delete", "query"])  # type: ignore
    """Result type. Required. Default value is \"SsisProjectLevelOutput\"."""

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

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

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


class MigrateSsisTaskProperties(ProjectTaskProperties, discriminator="Migrate.Ssis"):
    """Properties for task that migrates SSIS packages from SQL Server databases to Azure SQL Database
    Managed Instance.

    :ivar errors: Array of errors. This is ignored if submitted.
    :vartype errors: list[~azure.mgmt.datamigration.models.ODataError]
    :ivar state: The state of the task. This is ignored if submitted. Known values are: "Unknown",
     "Queued", "Running", "Canceled", "Succeeded", "Failed", "FailedInputValidation", and "Faulted".
    :vartype state: str or ~azure.mgmt.datamigration.models.TaskState
    :ivar commands: Array of command properties.
    :vartype commands: list[~azure.mgmt.datamigration.models.CommandProperties]
    :ivar client_data: Key value pairs of client data to attach meta data information to task.
    :vartype client_data: dict[str, str]
    :ivar input: Task input.
    :vartype input: ~azure.mgmt.datamigration.models.MigrateSsisTaskInput
    :ivar output: Task output. This is ignored if submitted.
    :vartype output: list[~azure.mgmt.datamigration.models.MigrateSsisTaskOutput]
    :ivar task_type: Task type. Required. Migrate.Ssis.
    :vartype task_type: str or ~azure.mgmt.datamigration.models.MIGRATE_SSIS
    """

    input: Optional["_models.MigrateSsisTaskInput"] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """Task input."""
    output: Optional[list["_models.MigrateSsisTaskOutput"]] = rest_field(visibility=["read"])
    """Task output. This is ignored if submitted."""
    task_type: Literal[TaskType.MIGRATE_SSIS] = rest_discriminator(name="taskType", visibility=["read", "create", "update", "delete", "query"])  # type: ignore
    """Task type. Required. Migrate.Ssis."""

    @overload
    def __init__(
        self,
        *,
        client_data: Optional[dict[str, str]] = None,
        input: Optional["_models.MigrateSsisTaskInput"] = None,
    ) -> None: ...

    @overload
    def __init__(self, mapping: Mapping[str, Any]) -> None:
        """
        :param 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.task_type = TaskType.MIGRATE_SSIS  # type: ignore


class MigrateSyncCompleteCommandInput(_Model):
    """Input for command that completes sync migration for a database.

    :ivar database_name: Name of database. Required.
    :vartype database_name: str
    :ivar commit_time_stamp: Time stamp to complete.
    :vartype commit_time_stamp: ~datetime.datetime
    """

    database_name: str = rest_field(name="databaseName", visibility=["read", "create", "update", "delete", "query"])
    """Name of database. Required."""
    commit_time_stamp: Optional[datetime.datetime] = rest_field(
        name="commitTimeStamp", visibility=["read", "create", "update", "delete", "query"], format="rfc3339"
    )
    """Time stamp to complete."""

    @overload
    def __init__(
        self,
        *,
        database_name: str,
        commit_time_stamp: 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 MigrateSyncCompleteCommandOutput(_Model):
    """Output for command that completes sync migration for a database.

    :ivar id: Result identifier.
    :vartype id: str
    :ivar errors: List of errors that happened during the command execution.
    :vartype errors: list[~azure.mgmt.datamigration.models.ReportableException]
    """

    id: Optional[str] = rest_field(visibility=["read"])
    """Result identifier."""
    errors: Optional[list["_models.ReportableException"]] = rest_field(visibility=["read"])
    """List of errors that happened during the command execution."""


class MigrateSyncCompleteCommandProperties(CommandProperties, discriminator="Migrate.Sync.Complete.Database"):
    """Properties for the command that completes sync migration for a database.

    :ivar errors: Array of errors. This is ignored if submitted.
    :vartype errors: list[~azure.mgmt.datamigration.models.ODataError]
    :ivar state: The state of the command. This is ignored if submitted. Known values are:
     "Unknown", "Accepted", "Running", "Succeeded", and "Failed".
    :vartype state: str or ~azure.mgmt.datamigration.models.CommandState
    :ivar input: Command input.
    :vartype input: ~azure.mgmt.datamigration.models.MigrateSyncCompleteCommandInput
    :ivar output: Command output. This is ignored if submitted.
    :vartype output: ~azure.mgmt.datamigration.models.MigrateSyncCompleteCommandOutput
    :ivar command_id: Command id.
    :vartype command_id: str
    :ivar command_type: Command type. Required. Migrate.Sync.Complete.Database.
    :vartype command_type: str or ~azure.mgmt.datamigration.models.MIGRATE_SYNC_COMPLETE_DATABASE
    """

    input: Optional["_models.MigrateSyncCompleteCommandInput"] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """Command input."""
    output: Optional["_models.MigrateSyncCompleteCommandOutput"] = rest_field(visibility=["read"])
    """Command output. This is ignored if submitted."""
    command_id: Optional[str] = rest_field(name="commandId", visibility=["read", "create", "update", "delete", "query"])
    """Command id."""
    command_type: Literal[CommandType.MIGRATE_SYNC_COMPLETE_DATABASE] = rest_discriminator(name="commandType", visibility=["read", "create", "update", "delete", "query"])  # type: ignore
    """Command type. Required. Migrate.Sync.Complete.Database."""

    @overload
    def __init__(
        self,
        *,
        input: Optional["_models.MigrateSyncCompleteCommandInput"] = None,
        command_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)
        self.command_type = CommandType.MIGRATE_SYNC_COMPLETE_DATABASE  # type: ignore


class MigrationEligibilityInfo(_Model):
    """Information about migration eligibility of a server object.

    :ivar is_eligible_for_migration: Whether object is eligible for migration or not.
    :vartype is_eligible_for_migration: bool
    :ivar validation_messages: Information about eligibility failure for the server object.
    :vartype validation_messages: list[str]
    """

    is_eligible_for_migration: Optional[bool] = rest_field(name="isEligibleForMigration", visibility=["read"])
    """Whether object is eligible for migration or not."""
    validation_messages: Optional[list[str]] = rest_field(name="validationMessages", visibility=["read"])
    """Information about eligibility failure for the server object."""


class MigrationOperationInput(_Model):
    """Migration Operation Input.

    :ivar migration_operation_id: ID tracking migration operation.
    :vartype migration_operation_id: str
    """

    migration_operation_id: Optional[str] = rest_field(
        name="migrationOperationId", visibility=["read", "create", "update", "delete", "query"]
    )
    """ID tracking migration operation."""

    @overload
    def __init__(
        self,
        *,
        migration_operation_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 MigrationReportResult(_Model):
    """Migration validation report result, contains the url for downloading the generated report.

    :ivar id: Migration validation result identifier.
    :vartype id: str
    :ivar report_url: The url of the report.
    :vartype report_url: str
    """

    id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """Migration validation result identifier."""
    report_url: Optional[str] = rest_field(name="reportUrl", visibility=["read", "create", "update", "delete", "query"])
    """The url of the report."""

    @overload
    def __init__(
        self,
        *,
        id: Optional[str] = None,  # pylint: disable=redefined-builtin
        report_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 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.datamigration.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 MigrationService(TrackedResource):
    """A Migration Service.

    :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.datamigration.models.SystemData
    :ivar tags: Resource tags.
    :vartype tags: dict[str, str]
    :ivar location: The geo-location where the resource lives. Required.
    :vartype location: str
    :ivar properties: The Migration Service properties.
    :vartype properties: ~azure.mgmt.datamigration.models.MigrationServiceProperties
    """

    properties: Optional["_models.MigrationServiceProperties"] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """The Migration Service properties."""

    __flattened_items = ["provisioning_state", "integration_runtime_state"]

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

    @overload
    def __init__(self, mapping: Mapping[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 MigrationServiceProperties(_Model):
    """The Migration Service properties.

    :ivar provisioning_state: Provisioning state to track the async operation status. Known values
     are: "Provisioning", "Updating", "Succeeded", "Failed", and "Canceled".
    :vartype provisioning_state: str or ~azure.mgmt.datamigration.models.ProvisioningState
    :ivar integration_runtime_state: Current state of the Integration runtime.
    :vartype integration_runtime_state: str
    """

    provisioning_state: Optional[Union[str, "_models.ProvisioningState"]] = rest_field(
        name="provisioningState", visibility=["read"]
    )
    """Provisioning state to track the async operation status. Known values are: \"Provisioning\",
     \"Updating\", \"Succeeded\", \"Failed\", and \"Canceled\"."""
    integration_runtime_state: Optional[str] = rest_field(name="integrationRuntimeState", visibility=["read"])
    """Current state of the Integration runtime."""


class MigrationServiceUpdate(_Model):
    """An update to a Migration Service.

    :ivar tags: Dictionary of <string>.
    :vartype tags: dict[str, str]
    """

    tags: Optional[dict[str, str]] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """Dictionary of <string>."""

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

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

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


class MigrationStatusDetails(_Model):
    """Detailed status of current migration.

    :ivar migration_state: Current State of Migration.
    :vartype migration_state: str
    :ivar full_backup_set_info: Details of full backup set.
    :vartype full_backup_set_info: ~azure.mgmt.datamigration.models.SqlBackupSetInfo
    :ivar last_restored_backup_set_info: Last applied backup set information.
    :vartype last_restored_backup_set_info: ~azure.mgmt.datamigration.models.SqlBackupSetInfo
    :ivar active_backup_sets: Backup sets that are currently active.
    :vartype active_backup_sets: list[~azure.mgmt.datamigration.models.SqlBackupSetInfo]
    :ivar invalid_files: Files that are not valid backup files.
    :vartype invalid_files: list[str]
    :ivar blob_container_name: Name of blob container.
    :vartype blob_container_name: str
    :ivar is_full_backup_restored: Whether full backup has been applied to the target database or
     not.
    :vartype is_full_backup_restored: bool
    :ivar restore_blocking_reason: Restore blocking reason, if any.
    :vartype restore_blocking_reason: str
    :ivar complete_restore_error_message: Complete restore error message, if any.
    :vartype complete_restore_error_message: str
    :ivar file_upload_blocking_errors: File upload blocking errors, if any.
    :vartype file_upload_blocking_errors: list[str]
    :ivar current_restoring_filename: File name that is currently being restored.
    :vartype current_restoring_filename: str
    :ivar last_restored_filename: Last restored file name.
    :vartype last_restored_filename: str
    :ivar pending_log_backups_count: Total pending log backups.
    :vartype pending_log_backups_count: int
    """

    migration_state: Optional[str] = rest_field(name="migrationState", visibility=["read"])
    """Current State of Migration."""
    full_backup_set_info: Optional["_models.SqlBackupSetInfo"] = rest_field(
        name="fullBackupSetInfo", visibility=["read"]
    )
    """Details of full backup set."""
    last_restored_backup_set_info: Optional["_models.SqlBackupSetInfo"] = rest_field(
        name="lastRestoredBackupSetInfo", visibility=["read"]
    )
    """Last applied backup set information."""
    active_backup_sets: Optional[list["_models.SqlBackupSetInfo"]] = rest_field(
        name="activeBackupSets", visibility=["read"]
    )
    """Backup sets that are currently active."""
    invalid_files: Optional[list[str]] = rest_field(name="invalidFiles", visibility=["read"])
    """Files that are not valid backup files."""
    blob_container_name: Optional[str] = rest_field(name="blobContainerName", visibility=["read"])
    """Name of blob container."""
    is_full_backup_restored: Optional[bool] = rest_field(name="isFullBackupRestored", visibility=["read"])
    """Whether full backup has been applied to the target database or not."""
    restore_blocking_reason: Optional[str] = rest_field(name="restoreBlockingReason", visibility=["read"])
    """Restore blocking reason, if any."""
    complete_restore_error_message: Optional[str] = rest_field(name="completeRestoreErrorMessage", visibility=["read"])
    """Complete restore error message, if any."""
    file_upload_blocking_errors: Optional[list[str]] = rest_field(name="fileUploadBlockingErrors", visibility=["read"])
    """File upload blocking errors, if any."""
    current_restoring_filename: Optional[str] = rest_field(name="currentRestoringFilename", visibility=["read"])
    """File name that is currently being restored."""
    last_restored_filename: Optional[str] = rest_field(name="lastRestoredFilename", visibility=["read"])
    """Last restored file name."""
    pending_log_backups_count: Optional[int] = rest_field(name="pendingLogBackupsCount", visibility=["read"])
    """Total pending log backups."""


class MigrationValidationDatabaseSummaryResult(_Model):
    """Migration Validation Database level summary result.

    :ivar id: Result identifier.
    :vartype id: str
    :ivar migration_id: Migration Identifier.
    :vartype migration_id: str
    :ivar source_database_name: Name of the source database.
    :vartype source_database_name: str
    :ivar target_database_name: Name of the target database.
    :vartype target_database_name: str
    :ivar started_on: Validation start time.
    :vartype started_on: ~datetime.datetime
    :ivar ended_on: Validation end time.
    :vartype ended_on: ~datetime.datetime
    :ivar status: Current status of validation at the database level. Known values are: "Default",
     "NotStarted", "Initialized", "InProgress", "Completed", "CompletedWithIssues", "Stopped", and
     "Failed".
    :vartype status: str or ~azure.mgmt.datamigration.models.ValidationStatus
    """

    id: Optional[str] = rest_field(visibility=["read"])
    """Result identifier."""
    migration_id: Optional[str] = rest_field(name="migrationId", visibility=["read"])
    """Migration Identifier."""
    source_database_name: Optional[str] = rest_field(name="sourceDatabaseName", visibility=["read"])
    """Name of the source database."""
    target_database_name: Optional[str] = rest_field(name="targetDatabaseName", visibility=["read"])
    """Name of the target database."""
    started_on: Optional[datetime.datetime] = rest_field(name="startedOn", visibility=["read"], format="rfc3339")
    """Validation start time."""
    ended_on: Optional[datetime.datetime] = rest_field(name="endedOn", visibility=["read"], format="rfc3339")
    """Validation end time."""
    status: Optional[Union[str, "_models.ValidationStatus"]] = rest_field(visibility=["read"])
    """Current status of validation at the database level. Known values are: \"Default\",
     \"NotStarted\", \"Initialized\", \"InProgress\", \"Completed\", \"CompletedWithIssues\",
     \"Stopped\", and \"Failed\"."""


class MigrationValidationOptions(_Model):
    """Types of validations to run after the migration.

    :ivar enable_schema_validation: Allows to compare the schema information between source and
     target.
    :vartype enable_schema_validation: bool
    :ivar enable_data_integrity_validation: Allows to perform a checksum based data integrity
     validation between source and target for the selected database / tables .
    :vartype enable_data_integrity_validation: bool
    :ivar enable_query_analysis_validation: Allows to perform a quick and intelligent query
     analysis by retrieving queries from the source database and executes them in the target. The
     result will have execution statistics for executions in source and target databases for the
     extracted queries.
    :vartype enable_query_analysis_validation: bool
    """

    enable_schema_validation: Optional[bool] = rest_field(
        name="enableSchemaValidation", visibility=["read", "create", "update", "delete", "query"]
    )
    """Allows to compare the schema information between source and target."""
    enable_data_integrity_validation: Optional[bool] = rest_field(
        name="enableDataIntegrityValidation", visibility=["read", "create", "update", "delete", "query"]
    )
    """Allows to perform a checksum based data integrity validation between source and target for the
     selected database / tables ."""
    enable_query_analysis_validation: Optional[bool] = rest_field(
        name="enableQueryAnalysisValidation", visibility=["read", "create", "update", "delete", "query"]
    )
    """Allows to perform a quick and intelligent query analysis by retrieving queries from the source
     database and executes them in the target. The result will have execution statistics for
     executions in source and target databases for the extracted queries."""

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

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

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


class MigrationValidationResult(_Model):
    """Migration Validation Result.

    :ivar id: Migration validation result identifier.
    :vartype id: str
    :ivar migration_id: Migration Identifier.
    :vartype migration_id: str
    :ivar summary_results: Validation summary results for each database.
    :vartype summary_results: dict[str,
     ~azure.mgmt.datamigration.models.MigrationValidationDatabaseSummaryResult]
    :ivar status: Current status of validation at the migration level. Status from the database
     validation result status will be aggregated here. Known values are: "Default", "NotStarted",
     "Initialized", "InProgress", "Completed", "CompletedWithIssues", "Stopped", and "Failed".
    :vartype status: str or ~azure.mgmt.datamigration.models.ValidationStatus
    """

    id: Optional[str] = rest_field(visibility=["read"])
    """Migration validation result identifier."""
    migration_id: Optional[str] = rest_field(name="migrationId", visibility=["read"])
    """Migration Identifier."""
    summary_results: Optional[dict[str, "_models.MigrationValidationDatabaseSummaryResult"]] = rest_field(
        name="summaryResults", visibility=["read", "create", "update", "delete", "query"]
    )
    """Validation summary results for each database."""
    status: Optional[Union[str, "_models.ValidationStatus"]] = rest_field(visibility=["read"])
    """Current status of validation at the migration level. Status from the database validation result
     status will be aggregated here. Known values are: \"Default\", \"NotStarted\", \"Initialized\",
     \"InProgress\", \"Completed\", \"CompletedWithIssues\", \"Stopped\", and \"Failed\"."""

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

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

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


class MiSqlConnectionInfo(ConnectionInfo, discriminator="MiSqlConnectionInfo"):
    """Properties required to create a connection to Azure SQL database Managed instance.

    :ivar user_name: User name.
    :vartype user_name: str
    :ivar password: Password credential.
    :vartype password: str
    :ivar managed_instance_resource_id: Resource id for Azure SQL database Managed instance.
     Required.
    :vartype managed_instance_resource_id: str
    :ivar type: Type of connection info. Required. Default value is "MiSqlConnectionInfo".
    :vartype type: str
    """

    managed_instance_resource_id: str = rest_field(
        name="managedInstanceResourceId", visibility=["read", "create", "update", "delete", "query"]
    )
    """Resource id for Azure SQL database Managed instance. Required."""
    type: Literal["MiSqlConnectionInfo"] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"])  # type: ignore
    """Type of connection info. Required. Default value is \"MiSqlConnectionInfo\"."""

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

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

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


class MongoConnectionInformation(_Model):
    """Mongo Connection.

    :ivar host: Host of mongo connection.
    :vartype host: str
    :ivar port: Port of mongo connection.
    :vartype port: int
    :ivar user_name: User name to connect to Mongo.
    :vartype user_name: str
    :ivar password: Password to connect to Mongo.
    :vartype password: str
    :ivar use_ssl: Whether to UseSsl or UseTls to connect to Mongo. Default is true.
    :vartype use_ssl: bool
    :ivar connection_string: ConnectionString to connect to Mongo.
    :vartype connection_string: str
    """

    host: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """Host of mongo connection."""
    port: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """Port of mongo connection."""
    user_name: Optional[str] = rest_field(name="userName", visibility=["create", "update"])
    """User name to connect to Mongo."""
    password: Optional[str] = rest_field(visibility=["create", "update"])
    """Password to connect to Mongo."""
    use_ssl: Optional[bool] = rest_field(name="useSsl", visibility=["create", "update"])
    """Whether to UseSsl or UseTls to connect to Mongo. Default is true."""
    connection_string: Optional[str] = rest_field(name="connectionString", visibility=["create", "update"])
    """ConnectionString to connect to Mongo."""

    @overload
    def __init__(
        self,
        *,
        host: Optional[str] = None,
        port: Optional[int] = None,
        user_name: Optional[str] = None,
        password: Optional[str] = None,
        use_ssl: Optional[bool] = None,
        connection_string: 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 MongoDbCancelCommand(CommandProperties, discriminator="cancel"):
    """Properties for the command that cancels a migration in whole or in part.

    :ivar errors: Array of errors. This is ignored if submitted.
    :vartype errors: list[~azure.mgmt.datamigration.models.ODataError]
    :ivar state: The state of the command. This is ignored if submitted. Known values are:
     "Unknown", "Accepted", "Running", "Succeeded", and "Failed".
    :vartype state: str or ~azure.mgmt.datamigration.models.CommandState
    :ivar input: Command input.
    :vartype input: ~azure.mgmt.datamigration.models.MongoDbCommandInput
    :ivar command_type: Command type. Required. cancel.
    :vartype command_type: str or ~azure.mgmt.datamigration.models.CANCEL
    """

    input: Optional["_models.MongoDbCommandInput"] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """Command input."""
    command_type: Literal[CommandType.CANCEL] = rest_discriminator(name="commandType", visibility=["read", "create", "update", "delete", "query"])  # type: ignore
    """Command type. Required. cancel."""

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

    @overload
    def __init__(self, mapping: Mapping[str, Any]) -> None:
        """
        :param 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.command_type = CommandType.CANCEL  # type: ignore


class MongoDbClusterInfo(_Model):
    """Describes a MongoDB data source.

    :ivar databases: A list of non-system databases in the cluster. Required.
    :vartype databases: list[~azure.mgmt.datamigration.models.MongoDbDatabaseInfo]
    :ivar supports_sharding: Whether the cluster supports sharded collections. Required.
    :vartype supports_sharding: bool
    :ivar type: The type of data source. Required. Known values are: "BlobContainer", "CosmosDb",
     and "MongoDb".
    :vartype type: str or ~azure.mgmt.datamigration.models.MongoDbClusterType
    :ivar version: The version of the data source in the form x.y.z (e.g. 3.6.7). Not used if Type
     is BlobContainer. Required.
    :vartype version: str
    """

    databases: list["_models.MongoDbDatabaseInfo"] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """A list of non-system databases in the cluster. Required."""
    supports_sharding: bool = rest_field(
        name="supportsSharding", visibility=["read", "create", "update", "delete", "query"]
    )
    """Whether the cluster supports sharded collections. Required."""
    type: Union[str, "_models.MongoDbClusterType"] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """The type of data source. Required. Known values are: \"BlobContainer\", \"CosmosDb\", and
     \"MongoDb\"."""
    version: str = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """The version of the data source in the form x.y.z (e.g. 3.6.7). Not used if Type is
     BlobContainer. Required."""

    @overload
    def __init__(
        self,
        *,
        databases: list["_models.MongoDbDatabaseInfo"],
        supports_sharding: bool,
        type: Union[str, "_models.MongoDbClusterType"],
        version: str,
    ) -> None: ...

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

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


class MongoDbObjectInfo(_Model):
    """Describes a database or collection within a MongoDB data source.

    :ivar average_document_size: The average document size, or -1 if the average size is unknown.
     Required.
    :vartype average_document_size: int
    :ivar data_size: The estimated total data size, in bytes, or -1 if the size is unknown.
     Required.
    :vartype data_size: int
    :ivar document_count: The estimated total number of documents, or -1 if the document count is
     unknown. Required.
    :vartype document_count: int
    :ivar name: The unqualified name of the database or collection. Required.
    :vartype name: str
    :ivar qualified_name: The qualified name of the database or collection. For a collection, this
     is the database-qualified name. Required.
    :vartype qualified_name: str
    """

    average_document_size: int = rest_field(
        name="averageDocumentSize", visibility=["read", "create", "update", "delete", "query"]
    )
    """The average document size, or -1 if the average size is unknown. Required."""
    data_size: int = rest_field(name="dataSize", visibility=["read", "create", "update", "delete", "query"])
    """The estimated total data size, in bytes, or -1 if the size is unknown. Required."""
    document_count: int = rest_field(name="documentCount", visibility=["read", "create", "update", "delete", "query"])
    """The estimated total number of documents, or -1 if the document count is unknown. Required."""
    name: str = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """The unqualified name of the database or collection. Required."""
    qualified_name: str = rest_field(name="qualifiedName", visibility=["read", "create", "update", "delete", "query"])
    """The qualified name of the database or collection. For a collection, this is the
     database-qualified name. Required."""

    @overload
    def __init__(
        self,
        *,
        average_document_size: int,
        data_size: int,
        document_count: int,
        name: str,
        qualified_name: str,
    ) -> None: ...

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

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


class MongoDbCollectionInfo(MongoDbObjectInfo):
    """Describes a supported collection within a MongoDB database.

    :ivar average_document_size: The average document size, or -1 if the average size is unknown.
     Required.
    :vartype average_document_size: int
    :ivar data_size: The estimated total data size, in bytes, or -1 if the size is unknown.
     Required.
    :vartype data_size: int
    :ivar document_count: The estimated total number of documents, or -1 if the document count is
     unknown. Required.
    :vartype document_count: int
    :ivar name: The unqualified name of the database or collection. Required.
    :vartype name: str
    :ivar qualified_name: The qualified name of the database or collection. For a collection, this
     is the database-qualified name. Required.
    :vartype qualified_name: str
    :ivar database_name: The name of the database containing the collection. Required.
    :vartype database_name: str
    :ivar is_capped: Whether the collection is a capped collection (i.e. whether it has a fixed
     size and acts like a circular buffer). Required.
    :vartype is_capped: bool
    :ivar is_system_collection: Whether the collection is system collection. Required.
    :vartype is_system_collection: bool
    :ivar is_view: Whether the collection is a view of another collection. Required.
    :vartype is_view: bool
    :ivar shard_key: The shard key on the collection, or null if the collection is not sharded.
    :vartype shard_key: ~azure.mgmt.datamigration.models.MongoDbShardKeyInfo
    :ivar supports_sharding: Whether the database has sharding enabled. Note that the migration
     task will enable sharding on the target if necessary. Required.
    :vartype supports_sharding: bool
    :ivar view_of: The name of the collection that this is a view of, if IsView is true.
    :vartype view_of: str
    """

    database_name: str = rest_field(name="databaseName", visibility=["read", "create", "update", "delete", "query"])
    """The name of the database containing the collection. Required."""
    is_capped: bool = rest_field(name="isCapped", visibility=["read", "create", "update", "delete", "query"])
    """Whether the collection is a capped collection (i.e. whether it has a fixed size and acts like a
     circular buffer). Required."""
    is_system_collection: bool = rest_field(
        name="isSystemCollection", visibility=["read", "create", "update", "delete", "query"]
    )
    """Whether the collection is system collection. Required."""
    is_view: bool = rest_field(name="isView", visibility=["read", "create", "update", "delete", "query"])
    """Whether the collection is a view of another collection. Required."""
    shard_key: Optional["_models.MongoDbShardKeyInfo"] = rest_field(
        name="shardKey", visibility=["read", "create", "update", "delete", "query"]
    )
    """The shard key on the collection, or null if the collection is not sharded."""
    supports_sharding: bool = rest_field(
        name="supportsSharding", visibility=["read", "create", "update", "delete", "query"]
    )
    """Whether the database has sharding enabled. Note that the migration task will enable sharding on
     the target if necessary. Required."""
    view_of: Optional[str] = rest_field(name="viewOf", visibility=["read", "create", "update", "delete", "query"])
    """The name of the collection that this is a view of, if IsView is true."""

    @overload
    def __init__(
        self,
        *,
        average_document_size: int,
        data_size: int,
        document_count: int,
        name: str,
        qualified_name: str,
        database_name: str,
        is_capped: bool,
        is_system_collection: bool,
        is_view: bool,
        supports_sharding: bool,
        shard_key: Optional["_models.MongoDbShardKeyInfo"] = None,
        view_of: 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 MongoDbProgress(_Model):
    """Base class for MongoDB migration outputs.

    You probably want to use the sub-classes and not this class directly. Known sub-classes are:
    MongoDbCollectionProgress, MongoDbDatabaseProgress, MongoDbMigrationProgress

    :ivar bytes_copied: The number of document bytes copied during the Copying stage. Required.
    :vartype bytes_copied: int
    :ivar documents_copied: The number of documents copied during the Copying stage. Required.
    :vartype documents_copied: int
    :ivar elapsed_time: The elapsed time in the format [ddd.]hh:mm:ss[.fffffff] (i.e. TimeSpan
     format). Required.
    :vartype elapsed_time: str
    :ivar errors: The errors and warnings that have occurred for the current object. The keys are
     the error codes. Required.
    :vartype errors: dict[str, ~azure.mgmt.datamigration.models.MongoDbError]
    :ivar events_pending: The number of oplog events awaiting replay. Required.
    :vartype events_pending: int
    :ivar events_replayed: The number of oplog events replayed so far. Required.
    :vartype events_replayed: int
    :ivar last_event_time: The timestamp of the last oplog event received, or null if no oplog
     event has been received yet.
    :vartype last_event_time: ~datetime.datetime
    :ivar last_replay_time: The timestamp of the last oplog event replayed, or null if no oplog
     event has been replayed yet.
    :vartype last_replay_time: ~datetime.datetime
    :ivar name: The name of the progress object. For a collection, this is the unqualified
     collection name. For a database, this is the database name. For the overall migration, this is
     null.
    :vartype name: str
    :ivar qualified_name: The qualified name of the progress object. For a collection, this is the
     database-qualified name. For a database, this is the database name. For the overall migration,
     this is null.
    :vartype qualified_name: str
    :ivar result_type: The type of progress object. Required. Known values are: "Migration",
     "Database", and "Collection".
    :vartype result_type: str or ~azure.mgmt.datamigration.models.MongoDbProgressResultType
    :ivar state: Required. Known values are: "NotStarted", "ValidatingInput", "Initializing",
     "Restarting", "Copying", "InitialReplay", "Replaying", "Finalizing", "Complete", "Canceled",
     and "Failed".
    :vartype state: str or ~azure.mgmt.datamigration.models.MongoDbMigrationState
    :ivar total_bytes: The total number of document bytes on the source at the beginning of the
     Copying stage, or -1 if the total size was unknown. Required.
    :vartype total_bytes: int
    :ivar total_documents: The total number of documents on the source at the beginning of the
     Copying stage, or -1 if the total count was unknown. Required.
    :vartype total_documents: int
    """

    __mapping__: dict[str, _Model] = {}
    bytes_copied: int = rest_field(name="bytesCopied", visibility=["read", "create", "update", "delete", "query"])
    """The number of document bytes copied during the Copying stage. Required."""
    documents_copied: int = rest_field(
        name="documentsCopied", visibility=["read", "create", "update", "delete", "query"]
    )
    """The number of documents copied during the Copying stage. Required."""
    elapsed_time: str = rest_field(name="elapsedTime", visibility=["read", "create", "update", "delete", "query"])
    """The elapsed time in the format [ddd.]hh:mm:ss[.fffffff] (i.e. TimeSpan format). Required."""
    errors: dict[str, "_models.MongoDbError"] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """The errors and warnings that have occurred for the current object. The keys are the error
     codes. Required."""
    events_pending: int = rest_field(name="eventsPending", visibility=["read", "create", "update", "delete", "query"])
    """The number of oplog events awaiting replay. Required."""
    events_replayed: int = rest_field(name="eventsReplayed", visibility=["read", "create", "update", "delete", "query"])
    """The number of oplog events replayed so far. Required."""
    last_event_time: Optional[datetime.datetime] = rest_field(
        name="lastEventTime", visibility=["read", "create", "update", "delete", "query"], format="rfc3339"
    )
    """The timestamp of the last oplog event received, or null if no oplog event has been received
     yet."""
    last_replay_time: Optional[datetime.datetime] = rest_field(
        name="lastReplayTime", visibility=["read", "create", "update", "delete", "query"], format="rfc3339"
    )
    """The timestamp of the last oplog event replayed, or null if no oplog event has been replayed
     yet."""
    name: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """The name of the progress object. For a collection, this is the unqualified collection name. For
     a database, this is the database name. For the overall migration, this is null."""
    qualified_name: Optional[str] = rest_field(
        name="qualifiedName", visibility=["read", "create", "update", "delete", "query"]
    )
    """The qualified name of the progress object. For a collection, this is the database-qualified
     name. For a database, this is the database name. For the overall migration, this is null."""
    result_type: str = rest_discriminator(name="resultType", visibility=["read", "create", "update", "delete", "query"])
    """The type of progress object. Required. Known values are: \"Migration\", \"Database\", and
     \"Collection\"."""
    state: Union[str, "_models.MongoDbMigrationState"] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """Required. Known values are: \"NotStarted\", \"ValidatingInput\", \"Initializing\",
     \"Restarting\", \"Copying\", \"InitialReplay\", \"Replaying\", \"Finalizing\", \"Complete\",
     \"Canceled\", and \"Failed\"."""
    total_bytes: int = rest_field(name="totalBytes", visibility=["read", "create", "update", "delete", "query"])
    """The total number of document bytes on the source at the beginning of the Copying stage, or -1
     if the total size was unknown. Required."""
    total_documents: int = rest_field(name="totalDocuments", visibility=["read", "create", "update", "delete", "query"])
    """The total number of documents on the source at the beginning of the Copying stage, or -1 if the
     total count was unknown. Required."""

    @overload
    def __init__(
        self,
        *,
        bytes_copied: int,
        documents_copied: int,
        elapsed_time: str,
        errors: dict[str, "_models.MongoDbError"],
        events_pending: int,
        events_replayed: int,
        result_type: str,
        state: Union[str, "_models.MongoDbMigrationState"],
        total_bytes: int,
        total_documents: int,
        last_event_time: Optional[datetime.datetime] = None,
        last_replay_time: Optional[datetime.datetime] = None,
        name: Optional[str] = None,
        qualified_name: Optional[str] = None,
    ) -> None: ...

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

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


class MongoDbCollectionProgress(MongoDbProgress, discriminator="Collection"):
    """Describes the progress of a collection.

    :ivar bytes_copied: The number of document bytes copied during the Copying stage. Required.
    :vartype bytes_copied: int
    :ivar documents_copied: The number of documents copied during the Copying stage. Required.
    :vartype documents_copied: int
    :ivar elapsed_time: The elapsed time in the format [ddd.]hh:mm:ss[.fffffff] (i.e. TimeSpan
     format). Required.
    :vartype elapsed_time: str
    :ivar errors: The errors and warnings that have occurred for the current object. The keys are
     the error codes. Required.
    :vartype errors: dict[str, ~azure.mgmt.datamigration.models.MongoDbError]
    :ivar events_pending: The number of oplog events awaiting replay. Required.
    :vartype events_pending: int
    :ivar events_replayed: The number of oplog events replayed so far. Required.
    :vartype events_replayed: int
    :ivar last_event_time: The timestamp of the last oplog event received, or null if no oplog
     event has been received yet.
    :vartype last_event_time: ~datetime.datetime
    :ivar last_replay_time: The timestamp of the last oplog event replayed, or null if no oplog
     event has been replayed yet.
    :vartype last_replay_time: ~datetime.datetime
    :ivar name: The name of the progress object. For a collection, this is the unqualified
     collection name. For a database, this is the database name. For the overall migration, this is
     null.
    :vartype name: str
    :ivar qualified_name: The qualified name of the progress object. For a collection, this is the
     database-qualified name. For a database, this is the database name. For the overall migration,
     this is null.
    :vartype qualified_name: str
    :ivar state: Required. Known values are: "NotStarted", "ValidatingInput", "Initializing",
     "Restarting", "Copying", "InitialReplay", "Replaying", "Finalizing", "Complete", "Canceled",
     and "Failed".
    :vartype state: str or ~azure.mgmt.datamigration.models.MongoDbMigrationState
    :ivar total_bytes: The total number of document bytes on the source at the beginning of the
     Copying stage, or -1 if the total size was unknown. Required.
    :vartype total_bytes: int
    :ivar total_documents: The total number of documents on the source at the beginning of the
     Copying stage, or -1 if the total count was unknown. Required.
    :vartype total_documents: int
    :ivar result_type: The type of progress object. Required. Collection.
    :vartype result_type: str or ~azure.mgmt.datamigration.models.COLLECTION
    """

    result_type: Literal[MongoDbProgressResultType.COLLECTION] = rest_discriminator(name="resultType", visibility=["read", "create", "update", "delete", "query"])  # type: ignore
    """The type of progress object. Required. Collection."""

    @overload
    def __init__(
        self,
        *,
        bytes_copied: int,
        documents_copied: int,
        elapsed_time: str,
        errors: dict[str, "_models.MongoDbError"],
        events_pending: int,
        events_replayed: int,
        state: Union[str, "_models.MongoDbMigrationState"],
        total_bytes: int,
        total_documents: int,
        last_event_time: Optional[datetime.datetime] = None,
        last_replay_time: Optional[datetime.datetime] = None,
        name: Optional[str] = None,
        qualified_name: Optional[str] = None,
    ) -> None: ...

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

    def __init__(self, *args: Any, **kwargs: Any) -> None:
        super().__init__(*args, **kwargs)
        self.result_type = MongoDbProgressResultType.COLLECTION  # type: ignore


class MongoDbCollectionSettings(_Model):
    """Describes how an individual MongoDB collection should be migrated.

    :ivar can_delete: Whether the migrator is allowed to drop the target collection in the course
     of performing a migration. The default is true.
    :vartype can_delete: bool
    :ivar shard_key: Describes a MongoDB shard key.
    :vartype shard_key: ~azure.mgmt.datamigration.models.MongoDbShardKeySetting
    :ivar target_r_us: The RUs that should be configured on a CosmosDB target, or null to use the
     default. This has no effect on non-CosmosDB targets.
    :vartype target_r_us: int
    """

    can_delete: Optional[bool] = rest_field(
        name="canDelete", visibility=["read", "create", "update", "delete", "query"]
    )
    """Whether the migrator is allowed to drop the target collection in the course of performing a
     migration. The default is true."""
    shard_key: Optional["_models.MongoDbShardKeySetting"] = rest_field(
        name="shardKey", visibility=["read", "create", "update", "delete", "query"]
    )
    """Describes a MongoDB shard key."""
    target_r_us: Optional[int] = rest_field(
        name="targetRUs", visibility=["read", "create", "update", "delete", "query"]
    )
    """The RUs that should be configured on a CosmosDB target, or null to use the default. This has no
     effect on non-CosmosDB targets."""

    @overload
    def __init__(
        self,
        *,
        can_delete: Optional[bool] = None,
        shard_key: Optional["_models.MongoDbShardKeySetting"] = None,
        target_r_us: 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 MongoDbCommandInput(_Model):
    """Describes the input to the 'cancel' and 'restart' MongoDB migration commands.

    :ivar object_name: The qualified name of a database or collection to act upon, or null to act
     upon the entire migration.
    :vartype object_name: str
    """

    object_name: Optional[str] = rest_field(
        name="objectName", visibility=["read", "create", "update", "delete", "query"]
    )
    """The qualified name of a database or collection to act upon, or null to act upon the entire
     migration."""

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

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

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


class MongoDbConnectionInfo(ConnectionInfo, discriminator="MongoDbConnectionInfo"):
    """Describes a connection to a MongoDB data source.

    :ivar user_name: User name.
    :vartype user_name: str
    :ivar password: Password credential.
    :vartype password: str
    :ivar connection_string: A MongoDB connection string or blob container URL. The user name and
     password can be specified here or in the userName and password properties. Required.
    :vartype connection_string: str
    :ivar data_source: Data source.
    :vartype data_source: str
    :ivar encrypt_connection: Whether to encrypt the connection.
    :vartype encrypt_connection: bool
    :ivar server_brand_version: server brand version.
    :vartype server_brand_version: str
    :ivar server_version: server version.
    :vartype server_version: str
    :ivar server_name: name of the server.
    :vartype server_name: str
    :ivar trust_server_certificate: Whether to trust the server certificate.
    :vartype trust_server_certificate: bool
    :ivar enforce_ssl:
    :vartype enforce_ssl: bool
    :ivar port: port for server.
    :vartype port: int
    :ivar additional_settings: Additional connection settings.
    :vartype additional_settings: str
    :ivar authentication: Authentication type to use for connection. Known values are: "None",
     "WindowsAuthentication", "SqlAuthentication", "ActiveDirectoryIntegrated", and
     "ActiveDirectoryPassword".
    :vartype authentication: str or ~azure.mgmt.datamigration.models.AuthenticationType
    :ivar type: Type of connection info. Required. Default value is "MongoDbConnectionInfo".
    :vartype type: str
    """

    connection_string: str = rest_field(
        name="connectionString", visibility=["read", "create", "update", "delete", "query"]
    )
    """A MongoDB connection string or blob container URL. The user name and password can be specified
     here or in the userName and password properties. Required."""
    data_source: Optional[str] = rest_field(
        name="dataSource", visibility=["read", "create", "update", "delete", "query"]
    )
    """Data source."""
    encrypt_connection: Optional[bool] = rest_field(
        name="encryptConnection", visibility=["read", "create", "update", "delete", "query"]
    )
    """Whether to encrypt the connection."""
    server_brand_version: Optional[str] = rest_field(
        name="serverBrandVersion", visibility=["read", "create", "update", "delete", "query"]
    )
    """server brand version."""
    server_version: Optional[str] = rest_field(
        name="serverVersion", visibility=["read", "create", "update", "delete", "query"]
    )
    """server version."""
    server_name: Optional[str] = rest_field(
        name="serverName", visibility=["read", "create", "update", "delete", "query"]
    )
    """name of the server."""
    trust_server_certificate: Optional[bool] = rest_field(
        name="trustServerCertificate", visibility=["read", "create", "update", "delete", "query"]
    )
    """Whether to trust the server certificate."""
    enforce_ssl: Optional[bool] = rest_field(
        name="enforceSSL", visibility=["read", "create", "update", "delete", "query"]
    )
    port: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """port for server."""
    additional_settings: Optional[str] = rest_field(
        name="additionalSettings", visibility=["read", "create", "update", "delete", "query"]
    )
    """Additional connection settings."""
    authentication: Optional[Union[str, "_models.AuthenticationType"]] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """Authentication type to use for connection. Known values are: \"None\",
     \"WindowsAuthentication\", \"SqlAuthentication\", \"ActiveDirectoryIntegrated\", and
     \"ActiveDirectoryPassword\"."""
    type: Literal["MongoDbConnectionInfo"] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"])  # type: ignore
    """Type of connection info. Required. Default value is \"MongoDbConnectionInfo\"."""

    @overload
    def __init__(
        self,
        *,
        connection_string: str,
        user_name: Optional[str] = None,
        password: Optional[str] = None,
        data_source: Optional[str] = None,
        encrypt_connection: Optional[bool] = None,
        server_brand_version: Optional[str] = None,
        server_version: Optional[str] = None,
        server_name: Optional[str] = None,
        trust_server_certificate: Optional[bool] = None,
        enforce_ssl: Optional[bool] = None,
        port: Optional[int] = None,
        additional_settings: Optional[str] = None,
        authentication: Optional[Union[str, "_models.AuthenticationType"]] = None,
    ) -> None: ...

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

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


class MongoDbDatabaseInfo(MongoDbObjectInfo):
    """Describes a database within a MongoDB data source.

    :ivar average_document_size: The average document size, or -1 if the average size is unknown.
     Required.
    :vartype average_document_size: int
    :ivar data_size: The estimated total data size, in bytes, or -1 if the size is unknown.
     Required.
    :vartype data_size: int
    :ivar document_count: The estimated total number of documents, or -1 if the document count is
     unknown. Required.
    :vartype document_count: int
    :ivar name: The unqualified name of the database or collection. Required.
    :vartype name: str
    :ivar qualified_name: The qualified name of the database or collection. For a collection, this
     is the database-qualified name. Required.
    :vartype qualified_name: str
    :ivar collections: A list of supported collections in a MongoDB database. Required.
    :vartype collections: list[~azure.mgmt.datamigration.models.MongoDbCollectionInfo]
    :ivar supports_sharding: Whether the database has sharding enabled. Note that the migration
     task will enable sharding on the target if necessary. Required.
    :vartype supports_sharding: bool
    """

    collections: list["_models.MongoDbCollectionInfo"] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """A list of supported collections in a MongoDB database. Required."""
    supports_sharding: bool = rest_field(
        name="supportsSharding", visibility=["read", "create", "update", "delete", "query"]
    )
    """Whether the database has sharding enabled. Note that the migration task will enable sharding on
     the target if necessary. Required."""

    @overload
    def __init__(
        self,
        *,
        average_document_size: int,
        data_size: int,
        document_count: int,
        name: str,
        qualified_name: str,
        collections: list["_models.MongoDbCollectionInfo"],
        supports_sharding: bool,
    ) -> None: ...

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

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


class MongoDbDatabaseProgress(MongoDbProgress, discriminator="Database"):
    """Describes the progress of a database.

    :ivar bytes_copied: The number of document bytes copied during the Copying stage. Required.
    :vartype bytes_copied: int
    :ivar documents_copied: The number of documents copied during the Copying stage. Required.
    :vartype documents_copied: int
    :ivar elapsed_time: The elapsed time in the format [ddd.]hh:mm:ss[.fffffff] (i.e. TimeSpan
     format). Required.
    :vartype elapsed_time: str
    :ivar errors: The errors and warnings that have occurred for the current object. The keys are
     the error codes. Required.
    :vartype errors: dict[str, ~azure.mgmt.datamigration.models.MongoDbError]
    :ivar events_pending: The number of oplog events awaiting replay. Required.
    :vartype events_pending: int
    :ivar events_replayed: The number of oplog events replayed so far. Required.
    :vartype events_replayed: int
    :ivar last_event_time: The timestamp of the last oplog event received, or null if no oplog
     event has been received yet.
    :vartype last_event_time: ~datetime.datetime
    :ivar last_replay_time: The timestamp of the last oplog event replayed, or null if no oplog
     event has been replayed yet.
    :vartype last_replay_time: ~datetime.datetime
    :ivar name: The name of the progress object. For a collection, this is the unqualified
     collection name. For a database, this is the database name. For the overall migration, this is
     null.
    :vartype name: str
    :ivar qualified_name: The qualified name of the progress object. For a collection, this is the
     database-qualified name. For a database, this is the database name. For the overall migration,
     this is null.
    :vartype qualified_name: str
    :ivar state: Required. Known values are: "NotStarted", "ValidatingInput", "Initializing",
     "Restarting", "Copying", "InitialReplay", "Replaying", "Finalizing", "Complete", "Canceled",
     and "Failed".
    :vartype state: str or ~azure.mgmt.datamigration.models.MongoDbMigrationState
    :ivar total_bytes: The total number of document bytes on the source at the beginning of the
     Copying stage, or -1 if the total size was unknown. Required.
    :vartype total_bytes: int
    :ivar total_documents: The total number of documents on the source at the beginning of the
     Copying stage, or -1 if the total count was unknown. Required.
    :vartype total_documents: int
    :ivar collections: The progress of the collections in the database. The keys are the
     unqualified names of the collections.
    :vartype collections: dict[str, ~azure.mgmt.datamigration.models.MongoDbCollectionProgress]
    :ivar result_type: The type of progress object. Required. Database.
    :vartype result_type: str or ~azure.mgmt.datamigration.models.DATABASE
    """

    collections: Optional[dict[str, "_models.MongoDbCollectionProgress"]] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """The progress of the collections in the database. The keys are the unqualified names of the
     collections."""
    result_type: Literal[MongoDbProgressResultType.DATABASE] = rest_discriminator(name="resultType", visibility=["read", "create", "update", "delete", "query"])  # type: ignore
    """The type of progress object. Required. Database."""

    @overload
    def __init__(
        self,
        *,
        bytes_copied: int,
        documents_copied: int,
        elapsed_time: str,
        errors: dict[str, "_models.MongoDbError"],
        events_pending: int,
        events_replayed: int,
        state: Union[str, "_models.MongoDbMigrationState"],
        total_bytes: int,
        total_documents: int,
        last_event_time: Optional[datetime.datetime] = None,
        last_replay_time: Optional[datetime.datetime] = None,
        name: Optional[str] = None,
        qualified_name: Optional[str] = None,
        collections: Optional[dict[str, "_models.MongoDbCollectionProgress"]] = None,
    ) -> None: ...

    @overload
    def __init__(self, mapping: Mapping[str, Any]) -> None:
        """
        :param 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.result_type = MongoDbProgressResultType.DATABASE  # type: ignore


class MongoDbDatabaseSettings(_Model):
    """Describes how an individual MongoDB database should be migrated.

    :ivar collections: The collections on the source database to migrate to the target. The keys
     are the unqualified names of the collections. Required.
    :vartype collections: dict[str, ~azure.mgmt.datamigration.models.MongoDbCollectionSettings]
    :ivar target_r_us: The RUs that should be configured on a CosmosDB target, or null to use the
     default, or 0 if throughput should not be provisioned for the database. This has no effect on
     non-CosmosDB targets.
    :vartype target_r_us: int
    """

    collections: dict[str, "_models.MongoDbCollectionSettings"] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """The collections on the source database to migrate to the target. The keys are the unqualified
     names of the collections. Required."""
    target_r_us: Optional[int] = rest_field(
        name="targetRUs", visibility=["read", "create", "update", "delete", "query"]
    )
    """The RUs that should be configured on a CosmosDB target, or null to use the default, or 0 if
     throughput should not be provisioned for the database. This has no effect on non-CosmosDB
     targets."""

    @overload
    def __init__(
        self,
        *,
        collections: dict[str, "_models.MongoDbCollectionSettings"],
        target_r_us: 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 MongoDbError(_Model):
    """Describes an error or warning that occurred during a MongoDB migration.

    :ivar code: The non-localized, machine-readable code that describes the error or warning.
    :vartype code: str
    :ivar count: The number of times the error or warning has occurred.
    :vartype count: int
    :ivar message: The localized, human-readable message that describes the error or warning.
    :vartype message: str
    :ivar type: The type of error or warning. Known values are: "Error", "ValidationError", and
     "Warning".
    :vartype type: str or ~azure.mgmt.datamigration.models.MongoDbErrorType
    """

    code: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """The non-localized, machine-readable code that describes the error or warning."""
    count: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """The number of times the error or warning has occurred."""
    message: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """The localized, human-readable message that describes the error or warning."""
    type: Optional[Union[str, "_models.MongoDbErrorType"]] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """The type of error or warning. Known values are: \"Error\", \"ValidationError\", and
     \"Warning\"."""

    @overload
    def __init__(
        self,
        *,
        code: Optional[str] = None,
        count: Optional[int] = None,
        message: Optional[str] = None,
        type: Optional[Union[str, "_models.MongoDbErrorType"]] = None,
    ) -> None: ...

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

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


class MongoDbFinishCommand(CommandProperties, discriminator="finish"):
    """Properties for the command that finishes a migration in whole or in part.

    :ivar errors: Array of errors. This is ignored if submitted.
    :vartype errors: list[~azure.mgmt.datamigration.models.ODataError]
    :ivar state: The state of the command. This is ignored if submitted. Known values are:
     "Unknown", "Accepted", "Running", "Succeeded", and "Failed".
    :vartype state: str or ~azure.mgmt.datamigration.models.CommandState
    :ivar input: Command input.
    :vartype input: ~azure.mgmt.datamigration.models.MongoDbFinishCommandInput
    :ivar command_type: Command type. Required. finish.
    :vartype command_type: str or ~azure.mgmt.datamigration.models.FINISH
    """

    input: Optional["_models.MongoDbFinishCommandInput"] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """Command input."""
    command_type: Literal[CommandType.FINISH] = rest_discriminator(name="commandType", visibility=["read", "create", "update", "delete", "query"])  # type: ignore
    """Command type. Required. finish."""

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

    @overload
    def __init__(self, mapping: Mapping[str, Any]) -> None:
        """
        :param 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.command_type = CommandType.FINISH  # type: ignore


class MongoDbFinishCommandInput(MongoDbCommandInput):
    """Describes the input to the 'finish' MongoDB migration command.

    :ivar object_name: The qualified name of a database or collection to act upon, or null to act
     upon the entire migration.
    :vartype object_name: str
    :ivar immediate: If true, replication for the affected objects will be stopped immediately. If
     false, the migrator will finish replaying queued events before finishing the replication.
     Required.
    :vartype immediate: bool
    """

    immediate: bool = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """If true, replication for the affected objects will be stopped immediately. If false, the
     migrator will finish replaying queued events before finishing the replication. Required."""

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

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

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


class MongoDbMigrationProgress(MongoDbProgress, discriminator="Migration"):
    """Describes the progress of the overall migration.

    :ivar bytes_copied: The number of document bytes copied during the Copying stage. Required.
    :vartype bytes_copied: int
    :ivar documents_copied: The number of documents copied during the Copying stage. Required.
    :vartype documents_copied: int
    :ivar elapsed_time: The elapsed time in the format [ddd.]hh:mm:ss[.fffffff] (i.e. TimeSpan
     format). Required.
    :vartype elapsed_time: str
    :ivar errors: The errors and warnings that have occurred for the current object. The keys are
     the error codes. Required.
    :vartype errors: dict[str, ~azure.mgmt.datamigration.models.MongoDbError]
    :ivar events_pending: The number of oplog events awaiting replay. Required.
    :vartype events_pending: int
    :ivar events_replayed: The number of oplog events replayed so far. Required.
    :vartype events_replayed: int
    :ivar last_event_time: The timestamp of the last oplog event received, or null if no oplog
     event has been received yet.
    :vartype last_event_time: ~datetime.datetime
    :ivar last_replay_time: The timestamp of the last oplog event replayed, or null if no oplog
     event has been replayed yet.
    :vartype last_replay_time: ~datetime.datetime
    :ivar name: The name of the progress object. For a collection, this is the unqualified
     collection name. For a database, this is the database name. For the overall migration, this is
     null.
    :vartype name: str
    :ivar qualified_name: The qualified name of the progress object. For a collection, this is the
     database-qualified name. For a database, this is the database name. For the overall migration,
     this is null.
    :vartype qualified_name: str
    :ivar state: Required. Known values are: "NotStarted", "ValidatingInput", "Initializing",
     "Restarting", "Copying", "InitialReplay", "Replaying", "Finalizing", "Complete", "Canceled",
     and "Failed".
    :vartype state: str or ~azure.mgmt.datamigration.models.MongoDbMigrationState
    :ivar total_bytes: The total number of document bytes on the source at the beginning of the
     Copying stage, or -1 if the total size was unknown. Required.
    :vartype total_bytes: int
    :ivar total_documents: The total number of documents on the source at the beginning of the
     Copying stage, or -1 if the total count was unknown. Required.
    :vartype total_documents: int
    :ivar databases: The progress of the databases in the migration. The keys are the names of the
     databases.
    :vartype databases: dict[str, ~azure.mgmt.datamigration.models.MongoDbDatabaseProgress]
    :ivar result_type: The type of progress object. Required. Migration.
    :vartype result_type: str or ~azure.mgmt.datamigration.models.MIGRATION
    """

    databases: Optional[dict[str, "_models.MongoDbDatabaseProgress"]] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """The progress of the databases in the migration. The keys are the names of the databases."""
    result_type: Literal[MongoDbProgressResultType.MIGRATION] = rest_discriminator(name="resultType", visibility=["read", "create", "update", "delete", "query"])  # type: ignore
    """The type of progress object. Required. Migration."""

    @overload
    def __init__(
        self,
        *,
        bytes_copied: int,
        documents_copied: int,
        elapsed_time: str,
        errors: dict[str, "_models.MongoDbError"],
        events_pending: int,
        events_replayed: int,
        state: Union[str, "_models.MongoDbMigrationState"],
        total_bytes: int,
        total_documents: int,
        last_event_time: Optional[datetime.datetime] = None,
        last_replay_time: Optional[datetime.datetime] = None,
        name: Optional[str] = None,
        qualified_name: Optional[str] = None,
        databases: Optional[dict[str, "_models.MongoDbDatabaseProgress"]] = None,
    ) -> None: ...

    @overload
    def __init__(self, mapping: Mapping[str, Any]) -> None:
        """
        :param 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.result_type = MongoDbProgressResultType.MIGRATION  # type: ignore


class MongoDbMigrationSettings(_Model):
    """Describes how a MongoDB data migration should be performed.

    :ivar boost_r_us: The RU limit on a CosmosDB target that collections will be temporarily
     increased to (if lower) during the initial copy of a migration, from 10,000 to 1,000,000, or 0
     to use the default boost (which is generally the maximum), or null to not boost the RUs. This
     setting has no effect on non-CosmosDB targets.
    :vartype boost_r_us: int
    :ivar databases: The databases on the source cluster to migrate to the target. The keys are the
     names of the databases. Required.
    :vartype databases: dict[str, ~azure.mgmt.datamigration.models.MongoDbDatabaseSettings]
    :ivar replication: Describes how changes will be replicated from the source to the target. The
     default is OneTime. Known values are: "Disabled", "OneTime", and "Continuous".
    :vartype replication: str or ~azure.mgmt.datamigration.models.MongoDbReplication
    :ivar source: Settings used to connect to the source cluster. Required.
    :vartype source: ~azure.mgmt.datamigration.models.MongoDbConnectionInfo
    :ivar target: Settings used to connect to the target cluster. Required.
    :vartype target: ~azure.mgmt.datamigration.models.MongoDbConnectionInfo
    :ivar throttling: Settings used to limit the resource usage of the migration.
    :vartype throttling: ~azure.mgmt.datamigration.models.MongoDbThrottlingSettings
    """

    boost_r_us: Optional[int] = rest_field(name="boostRUs", visibility=["read", "create", "update", "delete", "query"])
    """The RU limit on a CosmosDB target that collections will be temporarily increased to (if lower)
     during the initial copy of a migration, from 10,000 to 1,000,000, or 0 to use the default boost
     (which is generally the maximum), or null to not boost the RUs. This setting has no effect on
     non-CosmosDB targets."""
    databases: dict[str, "_models.MongoDbDatabaseSettings"] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """The databases on the source cluster to migrate to the target. The keys are the names of the
     databases. Required."""
    replication: Optional[Union[str, "_models.MongoDbReplication"]] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """Describes how changes will be replicated from the source to the target. The default is OneTime.
     Known values are: \"Disabled\", \"OneTime\", and \"Continuous\"."""
    source: "_models.MongoDbConnectionInfo" = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """Settings used to connect to the source cluster. Required."""
    target: "_models.MongoDbConnectionInfo" = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """Settings used to connect to the target cluster. Required."""
    throttling: Optional["_models.MongoDbThrottlingSettings"] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """Settings used to limit the resource usage of the migration."""

    @overload
    def __init__(
        self,
        *,
        databases: dict[str, "_models.MongoDbDatabaseSettings"],
        source: "_models.MongoDbConnectionInfo",
        target: "_models.MongoDbConnectionInfo",
        boost_r_us: Optional[int] = None,
        replication: Optional[Union[str, "_models.MongoDbReplication"]] = None,
        throttling: Optional["_models.MongoDbThrottlingSettings"] = None,
    ) -> None: ...

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

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


class MongoDbRestartCommand(CommandProperties, discriminator="restart"):
    """Properties for the command that restarts a migration in whole or in part.

    :ivar errors: Array of errors. This is ignored if submitted.
    :vartype errors: list[~azure.mgmt.datamigration.models.ODataError]
    :ivar state: The state of the command. This is ignored if submitted. Known values are:
     "Unknown", "Accepted", "Running", "Succeeded", and "Failed".
    :vartype state: str or ~azure.mgmt.datamigration.models.CommandState
    :ivar input: Command input.
    :vartype input: ~azure.mgmt.datamigration.models.MongoDbCommandInput
    :ivar command_type: Command type. Required. restart.
    :vartype command_type: str or ~azure.mgmt.datamigration.models.RESTART
    """

    input: Optional["_models.MongoDbCommandInput"] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """Command input."""
    command_type: Literal[CommandType.RESTART] = rest_discriminator(name="commandType", visibility=["read", "create", "update", "delete", "query"])  # type: ignore
    """Command type. Required. restart."""

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

    @overload
    def __init__(self, mapping: Mapping[str, Any]) -> None:
        """
        :param 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.command_type = CommandType.RESTART  # type: ignore


class MongoDbShardKeyField(_Model):
    """Describes a field reference within a MongoDB shard key.

    :ivar name: The name of the field. Required.
    :vartype name: str
    :ivar order: The field ordering. Required. Known values are: "Forward", "Reverse", and
     "Hashed".
    :vartype order: str or ~azure.mgmt.datamigration.models.MongoDbShardKeyOrder
    """

    name: str = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """The name of the field. Required."""
    order: Union[str, "_models.MongoDbShardKeyOrder"] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """The field ordering. Required. Known values are: \"Forward\", \"Reverse\", and \"Hashed\"."""

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

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

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


class MongoDbShardKeyInfo(_Model):
    """Describes a MongoDB shard key.

    :ivar fields: The fields within the shard key. Required.
    :vartype fields: list[~azure.mgmt.datamigration.models.MongoDbShardKeyField]
    :ivar is_unique: Whether the shard key is unique. Required.
    :vartype is_unique: bool
    """

    fields: list["_models.MongoDbShardKeyField"] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """The fields within the shard key. Required."""
    is_unique: bool = rest_field(name="isUnique", visibility=["read", "create", "update", "delete", "query"])
    """Whether the shard key is unique. Required."""

    @overload
    def __init__(
        self,
        *,
        fields: list["_models.MongoDbShardKeyField"],
        is_unique: bool,
    ) -> None: ...

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

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


class MongoDbShardKeySetting(_Model):
    """Describes a MongoDB shard key.

    :ivar fields: The fields within the shard key. Required.
    :vartype fields: list[~azure.mgmt.datamigration.models.MongoDbShardKeyField]
    :ivar is_unique: Whether the shard key is unique.
    :vartype is_unique: bool
    """

    fields: list["_models.MongoDbShardKeyField"] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """The fields within the shard key. Required."""
    is_unique: Optional[bool] = rest_field(name="isUnique", visibility=["read", "create", "update", "delete", "query"])
    """Whether the shard key is unique."""

    @overload
    def __init__(
        self,
        *,
        fields: list["_models.MongoDbShardKeyField"],
        is_unique: Optional[bool] = None,
    ) -> None: ...

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

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


class MongoDbThrottlingSettings(_Model):
    """Specifies resource limits for the migration.

    :ivar min_free_cpu: The percentage of CPU time that the migrator will try to avoid using, from
     0 to 100.
    :vartype min_free_cpu: int
    :ivar min_free_memory_mb: The number of megabytes of RAM that the migrator will try to avoid
     using.
    :vartype min_free_memory_mb: int
    :ivar max_parallelism: The maximum number of work items (e.g. collection copies) that will be
     processed in parallel.
    :vartype max_parallelism: int
    """

    min_free_cpu: Optional[int] = rest_field(
        name="minFreeCpu", visibility=["read", "create", "update", "delete", "query"]
    )
    """The percentage of CPU time that the migrator will try to avoid using, from 0 to 100."""
    min_free_memory_mb: Optional[int] = rest_field(
        name="minFreeMemoryMb", visibility=["read", "create", "update", "delete", "query"]
    )
    """The number of megabytes of RAM that the migrator will try to avoid using."""
    max_parallelism: Optional[int] = rest_field(
        name="maxParallelism", visibility=["read", "create", "update", "delete", "query"]
    )
    """The maximum number of work items (e.g. collection copies) that will be processed in parallel."""

    @overload
    def __init__(
        self,
        *,
        min_free_cpu: Optional[int] = None,
        min_free_memory_mb: Optional[int] = None,
        max_parallelism: 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 MongoMigrationCollection(_Model):
    """Mongo source and target database and collection details.

    :ivar source_database: Source database name.
    :vartype source_database: str
    :ivar source_collection: Source collection name.
    :vartype source_collection: str
    :ivar target_database: Target database name.
    :vartype target_database: str
    :ivar target_collection: Target collection name.
    :vartype target_collection: str
    :ivar migration_progress_details: Detailed migration status. Not included by default.
    :vartype migration_progress_details:
     ~azure.mgmt.datamigration.models.MongoMigrationProgressDetails
    """

    source_database: Optional[str] = rest_field(
        name="sourceDatabase", visibility=["read", "create", "update", "delete", "query"]
    )
    """Source database name."""
    source_collection: Optional[str] = rest_field(
        name="sourceCollection", visibility=["read", "create", "update", "delete", "query"]
    )
    """Source collection name."""
    target_database: Optional[str] = rest_field(
        name="targetDatabase", visibility=["read", "create", "update", "delete", "query"]
    )
    """Target database name."""
    target_collection: Optional[str] = rest_field(
        name="targetCollection", visibility=["read", "create", "update", "delete", "query"]
    )
    """Target collection name."""
    migration_progress_details: Optional["_models.MongoMigrationProgressDetails"] = rest_field(
        name="migrationProgressDetails", visibility=["read"]
    )
    """Detailed migration status. Not included by default."""

    @overload
    def __init__(
        self,
        *,
        source_database: Optional[str] = None,
        source_collection: Optional[str] = None,
        target_database: Optional[str] = None,
        target_collection: 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 MongoMigrationProgressDetails(_Model):
    """Detailed status of collection migration.

    :ivar migration_status: Migration Status. Known values are: "NotStarted", "InProgress",
     "Completed", "Failed", and "Canceled".
    :vartype migration_status: str or ~azure.mgmt.datamigration.models.MongoMigrationStatus
    :ivar migration_error: Migration Error.
    :vartype migration_error: str
    :ivar source_document_count: Source Document Count.
    :vartype source_document_count: int
    :ivar processed_document_count: Processed Document Count.
    :vartype processed_document_count: int
    :ivar duration_in_seconds: Migration duration.
    :vartype duration_in_seconds: int
    """

    migration_status: Optional[Union[str, "_models.MongoMigrationStatus"]] = rest_field(
        name="migrationStatus", visibility=["read"]
    )
    """Migration Status. Known values are: \"NotStarted\", \"InProgress\", \"Completed\", \"Failed\",
     and \"Canceled\"."""
    migration_error: Optional[str] = rest_field(name="migrationError", visibility=["read"])
    """Migration Error."""
    source_document_count: Optional[int] = rest_field(name="sourceDocumentCount", visibility=["read"])
    """Source Document Count."""
    processed_document_count: Optional[int] = rest_field(name="processedDocumentCount", visibility=["read"])
    """Processed Document Count."""
    duration_in_seconds: Optional[int] = rest_field(name="durationInSeconds", visibility=["read"])
    """Migration duration."""


class MySqlConnectionInfo(ConnectionInfo, discriminator="MySqlConnectionInfo"):
    """Information for connecting to MySQL server.

    :ivar user_name: User name.
    :vartype user_name: str
    :ivar password: Password credential.
    :vartype password: str
    :ivar server_name: Name of the server. Required.
    :vartype server_name: str
    :ivar data_source: Data source.
    :vartype data_source: str
    :ivar port: Port for Server. Required.
    :vartype port: int
    :ivar encrypt_connection: Whether to encrypt the connection.
    :vartype encrypt_connection: bool
    :ivar authentication: Authentication type to use for connection. Known values are: "None",
     "WindowsAuthentication", "SqlAuthentication", "ActiveDirectoryIntegrated", and
     "ActiveDirectoryPassword".
    :vartype authentication: str or ~azure.mgmt.datamigration.models.AuthenticationType
    :ivar additional_settings: Additional connection settings.
    :vartype additional_settings: str
    :ivar type: Type of connection info. Required. Default value is "MySqlConnectionInfo".
    :vartype type: str
    """

    server_name: str = rest_field(name="serverName", visibility=["read", "create", "update", "delete", "query"])
    """Name of the server. Required."""
    data_source: Optional[str] = rest_field(
        name="dataSource", visibility=["read", "create", "update", "delete", "query"]
    )
    """Data source."""
    port: int = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """Port for Server. Required."""
    encrypt_connection: Optional[bool] = rest_field(
        name="encryptConnection", visibility=["read", "create", "update", "delete", "query"]
    )
    """Whether to encrypt the connection."""
    authentication: Optional[Union[str, "_models.AuthenticationType"]] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """Authentication type to use for connection. Known values are: \"None\",
     \"WindowsAuthentication\", \"SqlAuthentication\", \"ActiveDirectoryIntegrated\", and
     \"ActiveDirectoryPassword\"."""
    additional_settings: Optional[str] = rest_field(
        name="additionalSettings", visibility=["read", "create", "update", "delete", "query"]
    )
    """Additional connection settings."""
    type: Literal["MySqlConnectionInfo"] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"])  # type: ignore
    """Type of connection info. Required. Default value is \"MySqlConnectionInfo\"."""

    @overload
    def __init__(
        self,
        *,
        server_name: str,
        port: int,
        user_name: Optional[str] = None,
        password: Optional[str] = None,
        data_source: Optional[str] = None,
        encrypt_connection: Optional[bool] = None,
        authentication: Optional[Union[str, "_models.AuthenticationType"]] = None,
        additional_settings: Optional[str] = None,
    ) -> None: ...

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

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


class NameAvailabilityRequest(_Model):
    """A resource type and proposed name.

    :ivar name: The proposed resource name.
    :vartype name: str
    :ivar type: The resource type chain (e.g. virtualMachines/extensions).
    :vartype type: str
    """

    name: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """The proposed resource name."""
    type: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """The resource type chain (e.g. virtualMachines/extensions)."""

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

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

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


class NameAvailabilityResponse(_Model):
    """Indicates whether a proposed resource name is available.

    :ivar name_available: If true, the name is valid and available. If false, 'reason' describes
     why not.
    :vartype name_available: bool
    :ivar reason: The reason why the name is not available, if nameAvailable is false. Known values
     are: "AlreadyExists" and "Invalid".
    :vartype reason: str or ~azure.mgmt.datamigration.models.NameCheckFailureReason
    :ivar message: The localized reason why the name is not available, if nameAvailable is false.
    :vartype message: str
    """

    name_available: Optional[bool] = rest_field(
        name="nameAvailable", visibility=["read", "create", "update", "delete", "query"]
    )
    """If true, the name is valid and available. If false, 'reason' describes why not."""
    reason: Optional[Union[str, "_models.NameCheckFailureReason"]] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """The reason why the name is not available, if nameAvailable is false. Known values are:
     \"AlreadyExists\" and \"Invalid\"."""
    message: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """The localized reason why the name is not available, if nameAvailable is false."""

    @overload
    def __init__(
        self,
        *,
        name_available: Optional[bool] = None,
        reason: Optional[Union[str, "_models.NameCheckFailureReason"]] = None,
        message: Optional[str] = None,
    ) -> None: ...

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

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


class NodeMonitoringData(_Model):
    """NodeMonitoringData.

    :ivar additional_properties: Unmatched properties from the message are deserialized in this
     collection.
    :vartype additional_properties: dict[str, any]
    :ivar node_name: Name of the integration runtime node.
    :vartype node_name: str
    :ivar available_memory_in_mb: Available memory (MB) on the integration runtime node.
    :vartype available_memory_in_mb: int
    :ivar cpu_utilization: CPU percentage on the integration runtime node.
    :vartype cpu_utilization: int
    :ivar concurrent_jobs_limit: Maximum concurrent jobs on the integration runtime node.
    :vartype concurrent_jobs_limit: int
    :ivar concurrent_jobs_running: The number of jobs currently running on the integration runtime
     node.
    :vartype concurrent_jobs_running: int
    :ivar max_concurrent_jobs: The maximum concurrent jobs in this integration runtime.
    :vartype max_concurrent_jobs: int
    :ivar sent_bytes: Sent bytes on the integration runtime node.
    :vartype sent_bytes: float
    :ivar received_bytes: Received bytes on the integration runtime node.
    :vartype received_bytes: float
    """

    additional_properties: Optional[dict[str, Any]] = rest_field(name="additionalProperties", visibility=["read"])
    """Unmatched properties from the message are deserialized in this collection."""
    node_name: Optional[str] = rest_field(name="nodeName", visibility=["read"])
    """Name of the integration runtime node."""
    available_memory_in_mb: Optional[int] = rest_field(name="availableMemoryInMB", visibility=["read"])
    """Available memory (MB) on the integration runtime node."""
    cpu_utilization: Optional[int] = rest_field(name="cpuUtilization", visibility=["read"])
    """CPU percentage on the integration runtime node."""
    concurrent_jobs_limit: Optional[int] = rest_field(name="concurrentJobsLimit", visibility=["read"])
    """Maximum concurrent jobs on the integration runtime node."""
    concurrent_jobs_running: Optional[int] = rest_field(name="concurrentJobsRunning", visibility=["read"])
    """The number of jobs currently running on the integration runtime node."""
    max_concurrent_jobs: Optional[int] = rest_field(name="maxConcurrentJobs", visibility=["read"])
    """The maximum concurrent jobs in this integration runtime."""
    sent_bytes: Optional[float] = rest_field(name="sentBytes", visibility=["read"])
    """Sent bytes on the integration runtime node."""
    received_bytes: Optional[float] = rest_field(name="receivedBytes", visibility=["read"])
    """Received bytes on the integration runtime node."""


class ODataError(_Model):
    """Error information in OData format.

    :ivar code: The machine-readable description of the error, such as 'InvalidRequest' or
     'InternalServerError'.
    :vartype code: str
    :ivar message: The human-readable description of the error.
    :vartype message: str
    :ivar details: Inner errors that caused this error.
    :vartype details: list[~azure.mgmt.datamigration.models.ODataError]
    """

    code: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """The machine-readable description of the error, such as 'InvalidRequest' or
     'InternalServerError'."""
    message: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """The human-readable description of the error."""
    details: Optional[list["_models.ODataError"]] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """Inner errors that caused this error."""

    @overload
    def __init__(
        self,
        *,
        code: Optional[str] = None,
        message: Optional[str] = None,
        details: Optional[list["_models.ODataError"]] = None,
    ) -> None: ...

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

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


class OfflineConfiguration(_Model):
    """Offline configuration.

    :ivar offline: Offline migration.
    :vartype offline: bool
    :ivar last_backup_name: Last backup name for offline migration. This is optional for migrations
     from file share. If it is not provided, then the service will determine the last backup file
     name based on latest backup files present in file share.
    :vartype last_backup_name: str
    """

    offline: Optional[bool] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """Offline migration."""
    last_backup_name: Optional[str] = rest_field(
        name="lastBackupName", visibility=["read", "create", "update", "delete", "query"]
    )
    """Last backup name for offline migration. This is optional for migrations from file share. If it
     is not provided, then the service will determine the last backup file name based on latest
     backup files present in file share."""

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

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

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


class OperationsDefinition(_Model):
    """OperationsDefinition.

    :ivar name:
    :vartype name: str
    :ivar is_data_action: Indicates whether the operation is a data action.
    :vartype is_data_action: bool
    :ivar display:
    :vartype display: ~azure.mgmt.datamigration.models.OperationsDisplayDefinition
    :ivar origin: Known values are: "user" and "system".
    :vartype origin: str or ~azure.mgmt.datamigration.models.OperationOrigin
    :ivar properties: Dictionary of <AnyObject>.
    :vartype properties: dict[str, any]
    """

    name: Optional[str] = rest_field(visibility=["read"])
    is_data_action: Optional[bool] = rest_field(
        name="isDataAction", visibility=["read", "create", "update", "delete", "query"]
    )
    """Indicates whether the operation is a data action."""
    display: Optional["_models.OperationsDisplayDefinition"] = rest_field(visibility=["read"])
    origin: Optional[Union[str, "_models.OperationOrigin"]] = rest_field(visibility=["read"])
    """Known values are: \"user\" and \"system\"."""
    properties: Optional[dict[str, Any]] = rest_field(visibility=["read"])
    """Dictionary of <AnyObject>."""

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

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

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


class OperationsDisplayDefinition(_Model):
    """OperationsDisplayDefinition.

    :ivar provider:
    :vartype provider: str
    :ivar resource:
    :vartype resource: str
    :ivar operation:
    :vartype operation: str
    :ivar description:
    :vartype description: str
    """

    provider: Optional[str] = rest_field(visibility=["read"])
    resource: Optional[str] = rest_field(visibility=["read"])
    operation: Optional[str] = rest_field(visibility=["read"])
    description: Optional[str] = rest_field(visibility=["read"])


class OracleConnectionInfo(ConnectionInfo, discriminator="OracleConnectionInfo"):
    """Information for connecting to Oracle server.

    :ivar user_name: User name.
    :vartype user_name: str
    :ivar password: Password credential.
    :vartype password: str
    :ivar data_source: EZConnect or TNSName connection string. Required.
    :vartype data_source: str
    :ivar server_name: name of the server.
    :vartype server_name: str
    :ivar server_version: server version.
    :vartype server_version: str
    :ivar port: port for server.
    :vartype port: int
    :ivar authentication: Authentication type to use for connection. Known values are: "None",
     "WindowsAuthentication", "SqlAuthentication", "ActiveDirectoryIntegrated", and
     "ActiveDirectoryPassword".
    :vartype authentication: str or ~azure.mgmt.datamigration.models.AuthenticationType
    :ivar type: Type of connection info. Required. Default value is "OracleConnectionInfo".
    :vartype type: str
    """

    data_source: str = rest_field(name="dataSource", visibility=["read", "create", "update", "delete", "query"])
    """EZConnect or TNSName connection string. Required."""
    server_name: Optional[str] = rest_field(
        name="serverName", visibility=["read", "create", "update", "delete", "query"]
    )
    """name of the server."""
    server_version: Optional[str] = rest_field(
        name="serverVersion", visibility=["read", "create", "update", "delete", "query"]
    )
    """server version."""
    port: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """port for server."""
    authentication: Optional[Union[str, "_models.AuthenticationType"]] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """Authentication type to use for connection. Known values are: \"None\",
     \"WindowsAuthentication\", \"SqlAuthentication\", \"ActiveDirectoryIntegrated\", and
     \"ActiveDirectoryPassword\"."""
    type: Literal["OracleConnectionInfo"] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"])  # type: ignore
    """Type of connection info. Required. Default value is \"OracleConnectionInfo\"."""

    @overload
    def __init__(
        self,
        *,
        data_source: str,
        user_name: Optional[str] = None,
        password: Optional[str] = None,
        server_name: Optional[str] = None,
        server_version: Optional[str] = None,
        port: Optional[int] = None,
        authentication: Optional[Union[str, "_models.AuthenticationType"]] = None,
    ) -> None: ...

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

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


class OracleOCIDriverInfo(_Model):
    """Information about an Oracle OCI driver.

    :ivar driver_name: The name of the driver package.
    :vartype driver_name: str
    :ivar driver_size: The size in bytes of the driver package.
    :vartype driver_size: str
    :ivar archive_checksum: The MD5 Base64 encoded checksum for the driver package.
    :vartype archive_checksum: str
    :ivar oracle_checksum: The checksum for the driver package provided by Oracle.
    :vartype oracle_checksum: str
    :ivar assembly_version: Version listed in the OCI assembly 'oci.dll'.
    :vartype assembly_version: str
    :ivar supported_oracle_versions: List of Oracle database versions supported by this driver.
     Only major minor of the version is listed.
    :vartype supported_oracle_versions: list[str]
    """

    driver_name: Optional[str] = rest_field(name="driverName", visibility=["read"])
    """The name of the driver package."""
    driver_size: Optional[str] = rest_field(name="driverSize", visibility=["read"])
    """The size in bytes of the driver package."""
    archive_checksum: Optional[str] = rest_field(name="archiveChecksum", visibility=["read"])
    """The MD5 Base64 encoded checksum for the driver package."""
    oracle_checksum: Optional[str] = rest_field(name="oracleChecksum", visibility=["read"])
    """The checksum for the driver package provided by Oracle."""
    assembly_version: Optional[str] = rest_field(name="assemblyVersion", visibility=["read"])
    """Version listed in the OCI assembly 'oci.dll'."""
    supported_oracle_versions: Optional[list[str]] = rest_field(name="supportedOracleVersions", visibility=["read"])
    """List of Oracle database versions supported by this driver. Only major minor of the version is
     listed."""


class OrphanedUserInfo(_Model):
    """Information of orphaned users on the SQL server database.

    :ivar name: Name of the orphaned user.
    :vartype name: str
    :ivar database_name: Parent database of the user.
    :vartype database_name: str
    """

    name: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """Name of the orphaned user."""
    database_name: Optional[str] = rest_field(
        name="databaseName", visibility=["read", "create", "update", "delete", "query"]
    )
    """Parent database of the user."""

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

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

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


class PostgreSqlConnectionInfo(ConnectionInfo, discriminator="PostgreSqlConnectionInfo"):
    """Information for connecting to PostgreSQL server.

    :ivar user_name: User name.
    :vartype user_name: str
    :ivar password: Password credential.
    :vartype password: str
    :ivar server_name: Name of the server. Required.
    :vartype server_name: str
    :ivar data_source: Data source.
    :vartype data_source: str
    :ivar server_version: server version.
    :vartype server_version: str
    :ivar database_name: Name of the database.
    :vartype database_name: str
    :ivar port: Port for Server. Required.
    :vartype port: int
    :ivar encrypt_connection: Whether to encrypt the connection.
    :vartype encrypt_connection: bool
    :ivar trust_server_certificate: Whether to trust the server certificate.
    :vartype trust_server_certificate: bool
    :ivar additional_settings: Additional connection settings.
    :vartype additional_settings: str
    :ivar server_brand_version: server brand version.
    :vartype server_brand_version: str
    :ivar authentication: Authentication type to use for connection. Known values are: "None",
     "WindowsAuthentication", "SqlAuthentication", "ActiveDirectoryIntegrated", and
     "ActiveDirectoryPassword".
    :vartype authentication: str or ~azure.mgmt.datamigration.models.AuthenticationType
    :ivar type: Type of connection info. Required. Default value is "PostgreSqlConnectionInfo".
    :vartype type: str
    """

    server_name: str = rest_field(name="serverName", visibility=["read", "create", "update", "delete", "query"])
    """Name of the server. Required."""
    data_source: Optional[str] = rest_field(
        name="dataSource", visibility=["read", "create", "update", "delete", "query"]
    )
    """Data source."""
    server_version: Optional[str] = rest_field(
        name="serverVersion", visibility=["read", "create", "update", "delete", "query"]
    )
    """server version."""
    database_name: Optional[str] = rest_field(
        name="databaseName", visibility=["read", "create", "update", "delete", "query"]
    )
    """Name of the database."""
    port: int = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """Port for Server. Required."""
    encrypt_connection: Optional[bool] = rest_field(
        name="encryptConnection", visibility=["read", "create", "update", "delete", "query"]
    )
    """Whether to encrypt the connection."""
    trust_server_certificate: Optional[bool] = rest_field(
        name="trustServerCertificate", visibility=["read", "create", "update", "delete", "query"]
    )
    """Whether to trust the server certificate."""
    additional_settings: Optional[str] = rest_field(
        name="additionalSettings", visibility=["read", "create", "update", "delete", "query"]
    )
    """Additional connection settings."""
    server_brand_version: Optional[str] = rest_field(
        name="serverBrandVersion", visibility=["read", "create", "update", "delete", "query"]
    )
    """server brand version."""
    authentication: Optional[Union[str, "_models.AuthenticationType"]] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """Authentication type to use for connection. Known values are: \"None\",
     \"WindowsAuthentication\", \"SqlAuthentication\", \"ActiveDirectoryIntegrated\", and
     \"ActiveDirectoryPassword\"."""
    type: Literal["PostgreSqlConnectionInfo"] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"])  # type: ignore
    """Type of connection info. Required. Default value is \"PostgreSqlConnectionInfo\"."""

    @overload
    def __init__(
        self,
        *,
        server_name: str,
        port: int,
        user_name: Optional[str] = None,
        password: Optional[str] = None,
        data_source: Optional[str] = None,
        server_version: Optional[str] = None,
        database_name: Optional[str] = None,
        encrypt_connection: Optional[bool] = None,
        trust_server_certificate: Optional[bool] = None,
        additional_settings: Optional[str] = None,
        server_brand_version: Optional[str] = None,
        authentication: Optional[Union[str, "_models.AuthenticationType"]] = None,
    ) -> None: ...

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

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


class Project(ProxyResource):
    """A project 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.datamigration.models.SystemData
    :ivar properties: Project properties.
    :vartype properties: ~azure.mgmt.datamigration.models.ProjectProperties
    :ivar etag: HTTP strong entity tag value. This is ignored if submitted.
    :vartype etag: str
    :ivar location:
    :vartype location: str
    :ivar tags:
    :vartype tags: dict[str, str]
    """

    properties: Optional["_models.ProjectProperties"] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """Project properties."""
    etag: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """HTTP strong entity tag value. This is ignored if submitted."""
    location: Optional[str] = rest_field(visibility=["read", "create"])
    tags: Optional[dict[str, str]] = rest_field(visibility=["read", "create", "update", "delete", "query"])

    __flattened_items = [
        "source_platform",
        "azure_authentication_info",
        "target_platform",
        "creation_time",
        "source_connection_info",
        "target_connection_info",
        "databases_info",
        "provisioning_state",
    ]

    @overload
    def __init__(
        self,
        *,
        properties: Optional["_models.ProjectProperties"] = None,
        etag: Optional[str] = None,
        location: Optional[str] = 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 ProjectFile(ProxyResource):
    """A file 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.datamigration.models.SystemData
    :ivar properties: Custom file properties.
    :vartype properties: ~azure.mgmt.datamigration.models.ProjectFileProperties
    :ivar etag: HTTP strong entity tag value. This is ignored if submitted.
    :vartype etag: str
    """

    properties: Optional["_models.ProjectFileProperties"] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """Custom file properties."""
    etag: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """HTTP strong entity tag value. This is ignored if submitted."""

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

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

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


class ProjectFileProperties(_Model):
    """Base class for file properties.

    :ivar extension: Optional File extension. If submitted it should not have a leading period and
     must match the extension from filePath.
    :vartype extension: str
    :ivar file_path: Relative path of this file resource. This property can be set when creating or
     updating the file resource.
    :vartype file_path: str
    :ivar last_modified: Modification DateTime.
    :vartype last_modified: ~datetime.datetime
    :ivar media_type: File content type. This property can be modified to reflect the file content
     type.
    :vartype media_type: str
    :ivar size: File size.
    :vartype size: int
    """

    extension: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """Optional File extension. If submitted it should not have a leading period and must match the
     extension from filePath."""
    file_path: Optional[str] = rest_field(name="filePath", visibility=["read", "create", "update", "delete", "query"])
    """Relative path of this file resource. This property can be set when creating or updating the
     file resource."""
    last_modified: Optional[datetime.datetime] = rest_field(name="lastModified", visibility=["read"], format="rfc3339")
    """Modification DateTime."""
    media_type: Optional[str] = rest_field(name="mediaType", visibility=["read", "create", "update", "delete", "query"])
    """File content type. This property can be modified to reflect the file content type."""
    size: Optional[int] = rest_field(visibility=["read"])
    """File size."""

    @overload
    def __init__(
        self,
        *,
        extension: Optional[str] = None,
        file_path: Optional[str] = None,
        media_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 ProjectProperties(_Model):
    """Project-specific properties.

    :ivar source_platform: Source platform for the project. Required. Known values are: "SQL",
     "MySQL", "PostgreSql", "MongoDb", and "Unknown".
    :vartype source_platform: str or ~azure.mgmt.datamigration.models.ProjectSourcePlatform
    :ivar azure_authentication_info: Field that defines the Azure active directory application
     info, used to connect to the target Azure resource.
    :vartype azure_authentication_info: ~azure.mgmt.datamigration.models.AzureActiveDirectoryApp
    :ivar target_platform: Target platform for the project. Required. Known values are: "SQLDB",
     "SQLMI", "AzureDbForMySql", "AzureDbForPostgreSql", "MongoDb", and "Unknown".
    :vartype target_platform: str or ~azure.mgmt.datamigration.models.ProjectTargetPlatform
    :ivar creation_time: UTC Date and time when project was created.
    :vartype creation_time: ~datetime.datetime
    :ivar source_connection_info: Information for connecting to source.
    :vartype source_connection_info: ~azure.mgmt.datamigration.models.ConnectionInfo
    :ivar target_connection_info: Information for connecting to target.
    :vartype target_connection_info: ~azure.mgmt.datamigration.models.ConnectionInfo
    :ivar databases_info: List of DatabaseInfo.
    :vartype databases_info: list[~azure.mgmt.datamigration.models.DatabaseInfo]
    :ivar provisioning_state: The project's provisioning state. Known values are: "Deleting" and
     "Succeeded".
    :vartype provisioning_state: str or ~azure.mgmt.datamigration.models.ProjectProvisioningState
    """

    source_platform: Union[str, "_models.ProjectSourcePlatform"] = rest_field(
        name="sourcePlatform", visibility=["read", "create", "update", "delete", "query"]
    )
    """Source platform for the project. Required. Known values are: \"SQL\", \"MySQL\",
     \"PostgreSql\", \"MongoDb\", and \"Unknown\"."""
    azure_authentication_info: Optional["_models.AzureActiveDirectoryApp"] = rest_field(
        name="azureAuthenticationInfo", visibility=["read", "create", "update", "delete", "query"]
    )
    """Field that defines the Azure active directory application info, used to connect to the target
     Azure resource."""
    target_platform: Union[str, "_models.ProjectTargetPlatform"] = rest_field(
        name="targetPlatform", visibility=["read", "create", "update", "delete", "query"]
    )
    """Target platform for the project. Required. Known values are: \"SQLDB\", \"SQLMI\",
     \"AzureDbForMySql\", \"AzureDbForPostgreSql\", \"MongoDb\", and \"Unknown\"."""
    creation_time: Optional[datetime.datetime] = rest_field(name="creationTime", visibility=["read"], format="rfc3339")
    """UTC Date and time when project was created."""
    source_connection_info: Optional["_models.ConnectionInfo"] = rest_field(
        name="sourceConnectionInfo", visibility=["read", "create", "update", "delete", "query"]
    )
    """Information for connecting to source."""
    target_connection_info: Optional["_models.ConnectionInfo"] = rest_field(
        name="targetConnectionInfo", visibility=["read", "create", "update", "delete", "query"]
    )
    """Information for connecting to target."""
    databases_info: Optional[list["_models.DatabaseInfo"]] = rest_field(
        name="databasesInfo", visibility=["read", "create", "update", "delete", "query"]
    )
    """List of DatabaseInfo."""
    provisioning_state: Optional[Union[str, "_models.ProjectProvisioningState"]] = rest_field(
        name="provisioningState", visibility=["read"]
    )
    """The project's provisioning state. Known values are: \"Deleting\" and \"Succeeded\"."""

    @overload
    def __init__(
        self,
        *,
        source_platform: Union[str, "_models.ProjectSourcePlatform"],
        target_platform: Union[str, "_models.ProjectTargetPlatform"],
        azure_authentication_info: Optional["_models.AzureActiveDirectoryApp"] = None,
        source_connection_info: Optional["_models.ConnectionInfo"] = None,
        target_connection_info: Optional["_models.ConnectionInfo"] = None,
        databases_info: Optional[list["_models.DatabaseInfo"]] = None,
    ) -> None: ...

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

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


class ProjectTask(ProxyResource):
    """A task 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.datamigration.models.SystemData
    :ivar properties: Custom task properties.
    :vartype properties: ~azure.mgmt.datamigration.models.ProjectTaskProperties
    :ivar etag: HTTP strong entity tag value. This is ignored if submitted.
    :vartype etag: str
    """

    properties: Optional["_models.ProjectTaskProperties"] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """Custom task properties."""
    etag: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """HTTP strong entity tag value. This is ignored if submitted."""

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

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

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


class QueryAnalysisValidationResult(_Model):
    """Results for query analysis comparison between the source and target.

    :ivar query_results: List of queries executed and it's execution results in source and target.
    :vartype query_results: ~azure.mgmt.datamigration.models.QueryExecutionResult
    :ivar validation_errors: Errors that are part of the execution.
    :vartype validation_errors: ~azure.mgmt.datamigration.models.ValidationError
    """

    query_results: Optional["_models.QueryExecutionResult"] = rest_field(
        name="queryResults", visibility=["read", "create", "update", "delete", "query"]
    )
    """List of queries executed and it's execution results in source and target."""
    validation_errors: Optional["_models.ValidationError"] = rest_field(
        name="validationErrors", visibility=["read", "create", "update", "delete", "query"]
    )
    """Errors that are part of the execution."""

    @overload
    def __init__(
        self,
        *,
        query_results: Optional["_models.QueryExecutionResult"] = None,
        validation_errors: Optional["_models.ValidationError"] = None,
    ) -> None: ...

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

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


class QueryExecutionResult(_Model):
    """Describes query analysis results for execution in source and target.

    :ivar query_text: Query text retrieved from the source server.
    :vartype query_text: str
    :ivar statements_in_batch: Total no. of statements in the batch.
    :vartype statements_in_batch: int
    :ivar source_result: Query analysis result from the source.
    :vartype source_result: ~azure.mgmt.datamigration.models.ExecutionStatistics
    :ivar target_result: Query analysis result from the target.
    :vartype target_result: ~azure.mgmt.datamigration.models.ExecutionStatistics
    """

    query_text: Optional[str] = rest_field(name="queryText", visibility=["read", "create", "update", "delete", "query"])
    """Query text retrieved from the source server."""
    statements_in_batch: Optional[int] = rest_field(
        name="statementsInBatch", visibility=["read", "create", "update", "delete", "query"]
    )
    """Total no. of statements in the batch."""
    source_result: Optional["_models.ExecutionStatistics"] = rest_field(
        name="sourceResult", visibility=["read", "create", "update", "delete", "query"]
    )
    """Query analysis result from the source."""
    target_result: Optional["_models.ExecutionStatistics"] = rest_field(
        name="targetResult", visibility=["read", "create", "update", "delete", "query"]
    )
    """Query analysis result from the target."""

    @overload
    def __init__(
        self,
        *,
        query_text: Optional[str] = None,
        statements_in_batch: Optional[int] = None,
        source_result: Optional["_models.ExecutionStatistics"] = None,
        target_result: Optional["_models.ExecutionStatistics"] = None,
    ) -> None: ...

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

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


class Quota(_Model):
    """Describes a quota for or usage details about a resource.

    :ivar current_value: The current value of the quota. If null or missing, the current value
     cannot be determined in the context of the request.
    :vartype current_value: float
    :ivar id: The resource ID of the quota object.
    :vartype id: str
    :ivar limit: The maximum value of the quota. If null or missing, the quota has no maximum, in
     which case it merely tracks usage.
    :vartype limit: float
    :ivar name: The name of the quota.
    :vartype name: ~azure.mgmt.datamigration.models.QuotaName
    :ivar unit: The unit for the quota, such as Count, Bytes, BytesPerSecond, etc.
    :vartype unit: str
    """

    current_value: Optional[float] = rest_field(
        name="currentValue", visibility=["read", "create", "update", "delete", "query"]
    )
    """The current value of the quota. If null or missing, the current value cannot be determined in
     the context of the request."""
    id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """The resource ID of the quota object."""
    limit: Optional[float] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """The maximum value of the quota. If null or missing, the quota has no maximum, in which case it
     merely tracks usage."""
    name: Optional["_models.QuotaName"] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """The name of the quota."""
    unit: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """The unit for the quota, such as Count, Bytes, BytesPerSecond, etc."""

    @overload
    def __init__(
        self,
        *,
        current_value: Optional[float] = None,
        id: Optional[str] = None,  # pylint: disable=redefined-builtin
        limit: Optional[float] = None,
        name: Optional["_models.QuotaName"] = None,
        unit: 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 QuotaName(_Model):
    """The name of the quota.

    :ivar localized_value: The localized name of the quota.
    :vartype localized_value: str
    :ivar value: The unlocalized name (or ID) of the quota.
    :vartype value: str
    """

    localized_value: Optional[str] = rest_field(
        name="localizedValue", visibility=["read", "create", "update", "delete", "query"]
    )
    """The localized name of the quota."""
    value: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """The unlocalized name (or ID) of the quota."""

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

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

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


class RegenAuthKeys(_Model):
    """An authentication key to regenerate.

    :ivar key_name: The name of authentication key to generate.
    :vartype key_name: str
    :ivar auth_key1: The first authentication key.
    :vartype auth_key1: str
    :ivar auth_key2: The second authentication key.
    :vartype auth_key2: str
    """

    key_name: Optional[str] = rest_field(name="keyName", visibility=["read", "create"])
    """The name of authentication key to generate."""
    auth_key1: Optional[str] = rest_field(name="authKey1", visibility=["read", "create"])
    """The first authentication key."""
    auth_key2: Optional[str] = rest_field(name="authKey2", visibility=["read", "create"])
    """The second authentication key."""

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

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

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


class ReportableException(_Model):
    """Exception object for all custom exceptions.

    :ivar message: Error message.
    :vartype message: str
    :ivar actionable_message: Actionable steps for this exception.
    :vartype actionable_message: str
    :ivar file_path: The path to the file where exception occurred.
    :vartype file_path: str
    :ivar line_number: The line number where exception occurred.
    :vartype line_number: str
    :ivar h_result: Coded numerical value that is assigned to a specific exception.
    :vartype h_result: int
    :ivar stack_trace: Stack trace.
    :vartype stack_trace: str
    """

    message: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """Error message."""
    actionable_message: Optional[str] = rest_field(
        name="actionableMessage", visibility=["read", "create", "update", "delete", "query"]
    )
    """Actionable steps for this exception."""
    file_path: Optional[str] = rest_field(name="filePath", visibility=["read", "create", "update", "delete", "query"])
    """The path to the file where exception occurred."""
    line_number: Optional[str] = rest_field(
        name="lineNumber", visibility=["read", "create", "update", "delete", "query"]
    )
    """The line number where exception occurred."""
    h_result: Optional[int] = rest_field(name="hResult", visibility=["read", "create", "update", "delete", "query"])
    """Coded numerical value that is assigned to a specific exception."""
    stack_trace: Optional[str] = rest_field(
        name="stackTrace", visibility=["read", "create", "update", "delete", "query"]
    )
    """Stack trace."""

    @overload
    def __init__(
        self,
        *,
        message: Optional[str] = None,
        actionable_message: Optional[str] = None,
        file_path: Optional[str] = None,
        line_number: Optional[str] = None,
        h_result: Optional[int] = None,
        stack_trace: 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 ResourceSku(_Model):
    """Describes an available DMS (classic) SKU.

    :ivar resource_type: The type of resource the SKU applies to.
    :vartype resource_type: str
    :ivar name: The name of SKU.
    :vartype name: str
    :ivar tier: Specifies the tier of DMS (classic) in a scale set.
    :vartype tier: str
    :ivar size: The Size of the SKU.
    :vartype size: str
    :ivar family: The Family of this particular SKU.
    :vartype family: str
    :ivar kind: The Kind of resources that are supported in this SKU.
    :vartype kind: str
    :ivar capacity: Not used.
    :vartype capacity: ~azure.mgmt.datamigration.models.ResourceSkuCapacity
    :ivar locations: The set of locations that the SKU is available.
    :vartype locations: list[str]
    :ivar api_versions: The api versions that support this SKU.
    :vartype api_versions: list[str]
    :ivar costs: Metadata for retrieving price info.
    :vartype costs: list[~azure.mgmt.datamigration.models.ResourceSkuCosts]
    :ivar capabilities: A name value pair to describe the capability.
    :vartype capabilities: list[~azure.mgmt.datamigration.models.ResourceSkuCapabilities]
    :ivar restrictions: The restrictions because of which SKU cannot be used. This is empty if
     there are no restrictions.
    :vartype restrictions: list[~azure.mgmt.datamigration.models.ResourceSkuRestrictions]
    """

    resource_type: Optional[str] = rest_field(name="resourceType", visibility=["read"])
    """The type of resource the SKU applies to."""
    name: Optional[str] = rest_field(visibility=["read"])
    """The name of SKU."""
    tier: Optional[str] = rest_field(visibility=["read"])
    """Specifies the tier of DMS (classic) in a scale set."""
    size: Optional[str] = rest_field(visibility=["read"])
    """The Size of the SKU."""
    family: Optional[str] = rest_field(visibility=["read"])
    """The Family of this particular SKU."""
    kind: Optional[str] = rest_field(visibility=["read"])
    """The Kind of resources that are supported in this SKU."""
    capacity: Optional["_models.ResourceSkuCapacity"] = rest_field(visibility=["read"])
    """Not used."""
    locations: Optional[list[str]] = rest_field(visibility=["read"])
    """The set of locations that the SKU is available."""
    api_versions: Optional[list[str]] = rest_field(name="apiVersions", visibility=["read"])
    """The api versions that support this SKU."""
    costs: Optional[list["_models.ResourceSkuCosts"]] = rest_field(visibility=["read"])
    """Metadata for retrieving price info."""
    capabilities: Optional[list["_models.ResourceSkuCapabilities"]] = rest_field(visibility=["read"])
    """A name value pair to describe the capability."""
    restrictions: Optional[list["_models.ResourceSkuRestrictions"]] = rest_field(visibility=["read"])
    """The restrictions because of which SKU cannot be used. This is empty if there are no
     restrictions."""


class ResourceSkuCapabilities(_Model):
    """Describes The SKU capabilities object.

    :ivar name: An invariant to describe the feature.
    :vartype name: str
    :ivar value: An invariant if the feature is measured by quantity.
    :vartype value: str
    """

    name: Optional[str] = rest_field(visibility=["read"])
    """An invariant to describe the feature."""
    value: Optional[str] = rest_field(visibility=["read"])
    """An invariant if the feature is measured by quantity."""


class ResourceSkuCapacity(_Model):
    """Describes scaling information of a SKU.

    :ivar minimum: The minimum capacity.
    :vartype minimum: int
    :ivar maximum: The maximum capacity.
    :vartype maximum: int
    :ivar default: The default capacity.
    :vartype default: int
    :ivar scale_type: The scale type applicable to the SKU. Known values are: "Automatic",
     "Manual", and "None".
    :vartype scale_type: str or ~azure.mgmt.datamigration.models.ResourceSkuCapacityScaleType
    """

    minimum: Optional[int] = rest_field(visibility=["read"])
    """The minimum capacity."""
    maximum: Optional[int] = rest_field(visibility=["read"])
    """The maximum capacity."""
    default: Optional[int] = rest_field(visibility=["read"])
    """The default capacity."""
    scale_type: Optional[Union[str, "_models.ResourceSkuCapacityScaleType"]] = rest_field(
        name="scaleType", visibility=["read"]
    )
    """The scale type applicable to the SKU. Known values are: \"Automatic\", \"Manual\", and
     \"None\"."""


class ResourceSkuCosts(_Model):
    """Describes metadata for retrieving price info.

    :ivar meter_id: Used for querying price from commerce.
    :vartype meter_id: str
    :ivar quantity: The multiplier is needed to extend the base metered cost.
    :vartype quantity: int
    :ivar extended_unit: An invariant to show the extended unit.
    :vartype extended_unit: str
    """

    meter_id: Optional[str] = rest_field(name="meterID", visibility=["read"])
    """Used for querying price from commerce."""
    quantity: Optional[int] = rest_field(visibility=["read"])
    """The multiplier is needed to extend the base metered cost."""
    extended_unit: Optional[str] = rest_field(name="extendedUnit", visibility=["read"])
    """An invariant to show the extended unit."""


class ResourceSkuRestrictions(_Model):
    """Describes scaling information of a SKU.

    :ivar type: The type of restrictions. "location"
    :vartype type: str or ~azure.mgmt.datamigration.models.ResourceSkuRestrictionsType
    :ivar values_property: The value of restrictions. If the restriction type is set to location.
     This would be different locations where the SKU is restricted.
    :vartype values_property: list[str]
    :ivar reason_code: The reason code for restriction. Known values are: "QuotaId" and
     "NotAvailableForSubscription".
    :vartype reason_code: str or ~azure.mgmt.datamigration.models.ResourceSkuRestrictionsReasonCode
    """

    type: Optional[Union[str, "_models.ResourceSkuRestrictionsType"]] = rest_field(visibility=["read"])
    """The type of restrictions. \"location\""""
    values_property: Optional[list[str]] = rest_field(name="values", visibility=["read"], original_tsp_name="values")
    """The value of restrictions. If the restriction type is set to location. This would be different
     locations where the SKU is restricted."""
    reason_code: Optional[Union[str, "_models.ResourceSkuRestrictionsReasonCode"]] = rest_field(
        name="reasonCode", visibility=["read"]
    )
    """The reason code for restriction. Known values are: \"QuotaId\" and
     \"NotAvailableForSubscription\"."""


class SchemaComparisonValidationResult(_Model):
    """Results for schema comparison between the source and target.

    :ivar schema_differences: List of schema differences between the source and target databases.
    :vartype schema_differences:
     ~azure.mgmt.datamigration.models.SchemaComparisonValidationResultType
    :ivar validation_errors: List of errors that happened while performing schema compare
     validation.
    :vartype validation_errors: ~azure.mgmt.datamigration.models.ValidationError
    :ivar source_database_object_count: Count of source database objects.
    :vartype source_database_object_count: dict[str, int]
    :ivar target_database_object_count: Count of target database objects.
    :vartype target_database_object_count: dict[str, int]
    """

    schema_differences: Optional["_models.SchemaComparisonValidationResultType"] = rest_field(
        name="schemaDifferences", visibility=["read", "create", "update", "delete", "query"]
    )
    """List of schema differences between the source and target databases."""
    validation_errors: Optional["_models.ValidationError"] = rest_field(
        name="validationErrors", visibility=["read", "create", "update", "delete", "query"]
    )
    """List of errors that happened while performing schema compare validation."""
    source_database_object_count: Optional[dict[str, int]] = rest_field(
        name="sourceDatabaseObjectCount", visibility=["read", "create", "update", "delete", "query"]
    )
    """Count of source database objects."""
    target_database_object_count: Optional[dict[str, int]] = rest_field(
        name="targetDatabaseObjectCount", visibility=["read", "create", "update", "delete", "query"]
    )
    """Count of target database objects."""

    @overload
    def __init__(
        self,
        *,
        schema_differences: Optional["_models.SchemaComparisonValidationResultType"] = None,
        validation_errors: Optional["_models.ValidationError"] = None,
        source_database_object_count: Optional[dict[str, int]] = None,
        target_database_object_count: Optional[dict[str, 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 SchemaComparisonValidationResultType(_Model):
    """Description about the errors happen while performing migration validation.

    :ivar object_name: Name of the object that has the difference.
    :vartype object_name: str
    :ivar object_type: Type of the object that has the difference. e.g
     (Table/View/StoredProcedure). Known values are: "StoredProcedures", "Table", "User", "View",
     and "Function".
    :vartype object_type: str or ~azure.mgmt.datamigration.models.ObjectType
    :ivar update_action: Update action type with respect to target. Known values are:
     "DeletedOnTarget", "ChangedOnTarget", and "AddedOnTarget".
    :vartype update_action: str or ~azure.mgmt.datamigration.models.UpdateActionType
    """

    object_name: Optional[str] = rest_field(
        name="objectName", visibility=["read", "create", "update", "delete", "query"]
    )
    """Name of the object that has the difference."""
    object_type: Optional[Union[str, "_models.ObjectType"]] = rest_field(
        name="objectType", visibility=["read", "create", "update", "delete", "query"]
    )
    """Type of the object that has the difference. e.g (Table/View/StoredProcedure). Known values are:
     \"StoredProcedures\", \"Table\", \"User\", \"View\", and \"Function\"."""
    update_action: Optional[Union[str, "_models.UpdateActionType"]] = rest_field(
        name="updateAction", visibility=["read", "create", "update", "delete", "query"]
    )
    """Update action type with respect to target. Known values are: \"DeletedOnTarget\",
     \"ChangedOnTarget\", and \"AddedOnTarget\"."""

    @overload
    def __init__(
        self,
        *,
        object_name: Optional[str] = None,
        object_type: Optional[Union[str, "_models.ObjectType"]] = None,
        update_action: Optional[Union[str, "_models.UpdateActionType"]] = None,
    ) -> None: ...

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

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


class SchemaMigrationSetting(_Model):
    """Settings for migrating schema from source to target.

    :ivar schema_option: Option on how to migrate the schema. Known values are: "None",
     "ExtractFromSource", and "UseStorageFile".
    :vartype schema_option: str or ~azure.mgmt.datamigration.models.SchemaMigrationOption
    :ivar file_id: Resource Identifier of a file resource containing the uploaded schema file.
    :vartype file_id: str
    :ivar file_name: Name of the file resource containing the uploaded schema file.
    :vartype file_name: str
    """

    schema_option: Optional[Union[str, "_models.SchemaMigrationOption"]] = rest_field(
        name="schemaOption", visibility=["read", "create", "update", "delete", "query"]
    )
    """Option on how to migrate the schema. Known values are: \"None\", \"ExtractFromSource\", and
     \"UseStorageFile\"."""
    file_id: Optional[str] = rest_field(name="fileId", visibility=["read", "create", "update", "delete", "query"])
    """Resource Identifier of a file resource containing the uploaded schema file."""
    file_name: Optional[str] = rest_field(name="fileName", visibility=["read", "create", "update", "delete", "query"])
    """Name of the file resource containing the uploaded schema file."""

    @overload
    def __init__(
        self,
        *,
        schema_option: Optional[Union[str, "_models.SchemaMigrationOption"]] = None,
        file_id: Optional[str] = None,
        file_name: Optional[str] = None,
    ) -> None: ...

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

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


class SelectedCertificateInput(_Model):
    """Info for certificate to be exported for TDE enabled databases.

    :ivar certificate_name: Name of certificate to be exported. Required.
    :vartype certificate_name: str
    :ivar password: Password to use for encrypting the exported certificate. Required.
    :vartype password: str
    """

    certificate_name: str = rest_field(
        name="certificateName", visibility=["read", "create", "update", "delete", "query"]
    )
    """Name of certificate to be exported. Required."""
    password: str = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """Password to use for encrypting the exported certificate. Required."""

    @overload
    def __init__(
        self,
        *,
        certificate_name: str,
        password: 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 ServerProperties(_Model):
    """Server properties for MySQL type source.

    :ivar server_platform: Name of the server platform.
    :vartype server_platform: str
    :ivar server_name: Name of the server.
    :vartype server_name: str
    :ivar server_version: Version of the database server.
    :vartype server_version: str
    :ivar server_edition: Edition of the database server.
    :vartype server_edition: str
    :ivar server_operating_system_version: Version of the operating system.
    :vartype server_operating_system_version: str
    :ivar server_database_count: Number of databases in the server.
    :vartype server_database_count: int
    """

    server_platform: Optional[str] = rest_field(name="serverPlatform", visibility=["read"])
    """Name of the server platform."""
    server_name: Optional[str] = rest_field(name="serverName", visibility=["read"])
    """Name of the server."""
    server_version: Optional[str] = rest_field(name="serverVersion", visibility=["read"])
    """Version of the database server."""
    server_edition: Optional[str] = rest_field(name="serverEdition", visibility=["read"])
    """Edition of the database server."""
    server_operating_system_version: Optional[str] = rest_field(
        name="serverOperatingSystemVersion", visibility=["read"]
    )
    """Version of the operating system."""
    server_database_count: Optional[int] = rest_field(name="serverDatabaseCount", visibility=["read"])
    """Number of databases in the server."""


class ServiceSku(_Model):
    """An Azure SKU instance.

    :ivar name: The unique name of the SKU, such as 'P3'.
    :vartype name: str
    :ivar tier: The tier of the SKU, such as 'Basic', 'General Purpose', or 'Business Critical'.
    :vartype tier: str
    :ivar family: The SKU family, used when the service has multiple performance classes within a
     tier, such as 'A', 'D', etc. for virtual machines.
    :vartype family: str
    :ivar size: The size of the SKU, used when the name alone does not denote a service size or
     when a SKU has multiple performance classes within a family, e.g. 'A1' for virtual machines.
    :vartype size: str
    :ivar capacity: The capacity of the SKU, if it supports scaling.
    :vartype capacity: int
    """

    name: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """The unique name of the SKU, such as 'P3'."""
    tier: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """The tier of the SKU, such as 'Basic', 'General Purpose', or 'Business Critical'."""
    family: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """The SKU family, used when the service has multiple performance classes within a tier, such as
     'A', 'D', etc. for virtual machines."""
    size: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """The size of the SKU, used when the name alone does not denote a service size or when a SKU has
     multiple performance classes within a family, e.g. 'A1' for virtual machines."""
    capacity: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """The capacity of the SKU, if it supports scaling."""

    @overload
    def __init__(
        self,
        *,
        name: Optional[str] = None,
        tier: Optional[str] = None,
        family: Optional[str] = None,
        size: Optional[str] = None,
        capacity: Optional[int] = None,
    ) -> None: ...

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

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


class SourceLocation(_Model):
    """Source Location details of backups.

    :ivar file_share: Source File share.
    :vartype file_share: ~azure.mgmt.datamigration.models.SqlFileShare
    :ivar azure_blob: Source Azure Blob.
    :vartype azure_blob: ~azure.mgmt.datamigration.models.AzureBlob
    :ivar file_storage_type: Backup storage Type.
    :vartype file_storage_type: str
    """

    file_share: Optional["_models.SqlFileShare"] = rest_field(
        name="fileShare", visibility=["read", "create", "update", "delete", "query"]
    )
    """Source File share."""
    azure_blob: Optional["_models.AzureBlob"] = rest_field(
        name="azureBlob", visibility=["read", "create", "update", "delete", "query"]
    )
    """Source Azure Blob."""
    file_storage_type: Optional[str] = rest_field(name="fileStorageType", visibility=["read"])
    """Backup storage Type."""

    @overload
    def __init__(
        self,
        *,
        file_share: Optional["_models.SqlFileShare"] = None,
        azure_blob: Optional["_models.AzureBlob"] = None,
    ) -> None: ...

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

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


class SqlBackupFileInfo(_Model):
    """Information of backup file.

    :ivar file_name: File name.
    :vartype file_name: str
    :ivar status: Status of the file. (Initial, Uploading, Uploaded, Restoring, Restored or
     Skipped).
    :vartype status: str
    :ivar total_size: File size in bytes.
    :vartype total_size: int
    :ivar data_read: Bytes read.
    :vartype data_read: int
    :ivar data_written: Bytes written.
    :vartype data_written: int
    :ivar copy_throughput: Copy throughput in KBps.
    :vartype copy_throughput: float
    :ivar copy_duration: Copy Duration in seconds.
    :vartype copy_duration: int
    :ivar family_sequence_number: Media family sequence number.
    :vartype family_sequence_number: int
    """

    file_name: Optional[str] = rest_field(name="fileName", visibility=["read"])
    """File name."""
    status: Optional[str] = rest_field(visibility=["read"])
    """Status of the file. (Initial, Uploading, Uploaded, Restoring, Restored or Skipped)."""
    total_size: Optional[int] = rest_field(name="totalSize", visibility=["read"])
    """File size in bytes."""
    data_read: Optional[int] = rest_field(name="dataRead", visibility=["read"])
    """Bytes read."""
    data_written: Optional[int] = rest_field(name="dataWritten", visibility=["read"])
    """Bytes written."""
    copy_throughput: Optional[float] = rest_field(name="copyThroughput", visibility=["read"])
    """Copy throughput in KBps."""
    copy_duration: Optional[int] = rest_field(name="copyDuration", visibility=["read"])
    """Copy Duration in seconds."""
    family_sequence_number: Optional[int] = rest_field(name="familySequenceNumber", visibility=["read"])
    """Media family sequence number."""


class SqlBackupSetInfo(_Model):
    """Information of backup set.

    :ivar backup_set_id: Backup set id.
    :vartype backup_set_id: str
    :ivar first_lsn: First LSN of the backup set.
    :vartype first_lsn: str
    :ivar last_lsn: Last LSN of the backup set.
    :vartype last_lsn: str
    :ivar backup_type: Backup type.
    :vartype backup_type: str
    :ivar list_of_backup_files: List of files in the backup set.
    :vartype list_of_backup_files: list[~azure.mgmt.datamigration.models.SqlBackupFileInfo]
    :ivar backup_start_date: Backup start date.
    :vartype backup_start_date: ~datetime.datetime
    :ivar backup_finish_date: Backup end time.
    :vartype backup_finish_date: ~datetime.datetime
    :ivar is_backup_restored: Whether this backup set has been restored or not.
    :vartype is_backup_restored: bool
    :ivar has_backup_checksums: Has Backup Checksums.
    :vartype has_backup_checksums: bool
    :ivar family_count: Media family count.
    :vartype family_count: int
    :ivar ignore_reasons: The reasons why the backup set is ignored.
    :vartype ignore_reasons: list[str]
    """

    backup_set_id: Optional[str] = rest_field(name="backupSetId", visibility=["read"])
    """Backup set id."""
    first_lsn: Optional[str] = rest_field(name="firstLSN", visibility=["read"])
    """First LSN of the backup set."""
    last_lsn: Optional[str] = rest_field(name="lastLSN", visibility=["read"])
    """Last LSN of the backup set."""
    backup_type: Optional[str] = rest_field(name="backupType", visibility=["read"])
    """Backup type."""
    list_of_backup_files: Optional[list["_models.SqlBackupFileInfo"]] = rest_field(
        name="listOfBackupFiles", visibility=["read"]
    )
    """List of files in the backup set."""
    backup_start_date: Optional[datetime.datetime] = rest_field(
        name="backupStartDate", visibility=["read"], format="rfc3339"
    )
    """Backup start date."""
    backup_finish_date: Optional[datetime.datetime] = rest_field(
        name="backupFinishDate", visibility=["read"], format="rfc3339"
    )
    """Backup end time."""
    is_backup_restored: Optional[bool] = rest_field(name="isBackupRestored", visibility=["read"])
    """Whether this backup set has been restored or not."""
    has_backup_checksums: Optional[bool] = rest_field(name="hasBackupChecksums", visibility=["read"])
    """Has Backup Checksums."""
    family_count: Optional[int] = rest_field(name="familyCount", visibility=["read"])
    """Media family count."""
    ignore_reasons: Optional[list[str]] = rest_field(name="ignoreReasons", visibility=["read"])
    """The reasons why the backup set is ignored."""


class SqlConnectionInfo(ConnectionInfo, discriminator="SqlConnectionInfo"):
    """Information for connecting to SQL database server.

    :ivar user_name: User name.
    :vartype user_name: str
    :ivar password: Password credential.
    :vartype password: str
    :ivar data_source: Data source in the format
     Protocol:MachineName\\SQLServerInstanceName,PortNumber. Required.
    :vartype data_source: str
    :ivar server_name: name of the server.
    :vartype server_name: str
    :ivar port: Port for Server.
    :vartype port: int
    :ivar server_version: server version.
    :vartype server_version: str
    :ivar server_brand_version: server brand version.
    :vartype server_brand_version: str
    :ivar resource_id: Represents the ID of an HTTP resource represented by an Azure resource
     provider.
    :vartype resource_id: str
    :ivar authentication: Authentication type to use for connection. Known values are: "None",
     "WindowsAuthentication", "SqlAuthentication", "ActiveDirectoryIntegrated", and
     "ActiveDirectoryPassword".
    :vartype authentication: str or ~azure.mgmt.datamigration.models.AuthenticationType
    :ivar encrypt_connection: Whether to encrypt the connection.
    :vartype encrypt_connection: bool
    :ivar additional_settings: Additional connection settings.
    :vartype additional_settings: str
    :ivar trust_server_certificate: Whether to trust the server certificate.
    :vartype trust_server_certificate: bool
    :ivar platform: Server platform type for connection. "SqlOnPrem"
    :vartype platform: str or ~azure.mgmt.datamigration.models.SqlSourcePlatform
    :ivar type: Type of connection info. Required. Default value is "SqlConnectionInfo".
    :vartype type: str
    """

    data_source: str = rest_field(name="dataSource", visibility=["read", "create", "update", "delete", "query"])
    """Data source in the format Protocol:MachineName\\SQLServerInstanceName,PortNumber. Required."""
    server_name: Optional[str] = rest_field(
        name="serverName", visibility=["read", "create", "update", "delete", "query"]
    )
    """name of the server."""
    port: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """Port for Server."""
    server_version: Optional[str] = rest_field(
        name="serverVersion", visibility=["read", "create", "update", "delete", "query"]
    )
    """server version."""
    server_brand_version: Optional[str] = rest_field(
        name="serverBrandVersion", visibility=["read", "create", "update", "delete", "query"]
    )
    """server brand version."""
    resource_id: Optional[str] = rest_field(
        name="resourceId", visibility=["read", "create", "update", "delete", "query"]
    )
    """Represents the ID of an HTTP resource represented by an Azure resource provider."""
    authentication: Optional[Union[str, "_models.AuthenticationType"]] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """Authentication type to use for connection. Known values are: \"None\",
     \"WindowsAuthentication\", \"SqlAuthentication\", \"ActiveDirectoryIntegrated\", and
     \"ActiveDirectoryPassword\"."""
    encrypt_connection: Optional[bool] = rest_field(
        name="encryptConnection", visibility=["read", "create", "update", "delete", "query"]
    )
    """Whether to encrypt the connection."""
    additional_settings: Optional[str] = rest_field(
        name="additionalSettings", visibility=["read", "create", "update", "delete", "query"]
    )
    """Additional connection settings."""
    trust_server_certificate: Optional[bool] = rest_field(
        name="trustServerCertificate", visibility=["read", "create", "update", "delete", "query"]
    )
    """Whether to trust the server certificate."""
    platform: Optional[Union[str, "_models.SqlSourcePlatform"]] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """Server platform type for connection. \"SqlOnPrem\""""
    type: Literal["SqlConnectionInfo"] = rest_discriminator(name="type", visibility=["read", "create", "update", "delete", "query"])  # type: ignore
    """Type of connection info. Required. Default value is \"SqlConnectionInfo\"."""

    @overload
    def __init__(
        self,
        *,
        data_source: str,
        user_name: Optional[str] = None,
        password: Optional[str] = None,
        server_name: Optional[str] = None,
        port: Optional[int] = None,
        server_version: Optional[str] = None,
        server_brand_version: Optional[str] = None,
        resource_id: Optional[str] = None,
        authentication: Optional[Union[str, "_models.AuthenticationType"]] = None,
        encrypt_connection: Optional[bool] = None,
        additional_settings: Optional[str] = None,
        trust_server_certificate: Optional[bool] = None,
        platform: Optional[Union[str, "_models.SqlSourcePlatform"]] = None,
    ) -> None: ...

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

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


class SqlConnectionInformation(_Model):
    """Source SQL Connection.

    :ivar data_source: Data source.
    :vartype data_source: str
    :ivar authentication: Authentication type.
    :vartype authentication: str
    :ivar user_name: User name to connect to source SQL.
    :vartype user_name: str
    :ivar password: Password to connect to source SQL.
    :vartype password: str
    :ivar encrypt_connection: Whether to encrypt connection or not.
    :vartype encrypt_connection: bool
    :ivar trust_server_certificate: Whether to trust server certificate or not.
    :vartype trust_server_certificate: bool
    """

    data_source: Optional[str] = rest_field(
        name="dataSource", visibility=["read", "create", "update", "delete", "query"]
    )
    """Data source."""
    authentication: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """Authentication type."""
    user_name: Optional[str] = rest_field(name="userName", visibility=["read", "create", "update", "delete", "query"])
    """User name to connect to source SQL."""
    password: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """Password to connect to source SQL."""
    encrypt_connection: Optional[bool] = rest_field(
        name="encryptConnection", visibility=["read", "create", "update", "delete", "query"]
    )
    """Whether to encrypt connection or not."""
    trust_server_certificate: Optional[bool] = rest_field(
        name="trustServerCertificate", visibility=["read", "create", "update", "delete", "query"]
    )
    """Whether to trust server certificate or not."""

    @overload
    def __init__(
        self,
        *,
        data_source: Optional[str] = None,
        authentication: Optional[str] = None,
        user_name: Optional[str] = None,
        password: Optional[str] = None,
        encrypt_connection: Optional[bool] = None,
        trust_server_certificate: Optional[bool] = None,
    ) -> None: ...

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

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


class SqlDbMigrationStatusDetails(_Model):
    """Detailed status of current Sql Db migration.

    :ivar migration_state: Current State of Migration.
    :vartype migration_state: str
    :ivar sql_data_copy_errors: Sql Data Copy errors, if any.
    :vartype sql_data_copy_errors: list[str]
    :ivar list_of_copy_progress_details: Details on progress of ADF copy activities.
    :vartype list_of_copy_progress_details:
     list[~azure.mgmt.datamigration.models.CopyProgressDetails]
    """

    migration_state: Optional[str] = rest_field(name="migrationState", visibility=["read"])
    """Current State of Migration."""
    sql_data_copy_errors: Optional[list[str]] = rest_field(name="sqlDataCopyErrors", visibility=["read"])
    """Sql Data Copy errors, if any."""
    list_of_copy_progress_details: Optional[list["_models.CopyProgressDetails"]] = rest_field(
        name="listOfCopyProgressDetails", visibility=["read"]
    )
    """Details on progress of ADF copy activities."""


class SqlDbOfflineConfiguration(_Model):
    """Offline configuration.

    :ivar offline: Offline migration.
    :vartype offline: bool
    """

    offline: Optional[bool] = rest_field(visibility=["read"])
    """Offline migration."""


class SqlFileShare(_Model):
    """File share.

    :ivar path: Location as SMB share or local drive where backups are placed.
    :vartype path: str
    :ivar username: Username to access the file share location for backups.
    :vartype username: str
    :ivar password: Password for username to access file share location.
    :vartype password: str
    """

    path: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """Location as SMB share or local drive where backups are placed."""
    username: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """Username to access the file share location for backups."""
    password: Optional[str] = rest_field(visibility=["create", "update"])
    """Password for username to access file share location."""

    @overload
    def __init__(
        self,
        *,
        path: Optional[str] = None,
        username: Optional[str] = None,
        password: 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 SqlMigrationService(ProxyResource):
    """A SQL Migration Service.

    :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.datamigration.models.SystemData
    :ivar properties: The SQL Migration Service properties.
    :vartype properties: ~azure.mgmt.datamigration.models.SqlMigrationServiceProperties
    :ivar location:
    :vartype location: str
    :ivar tags:
    :vartype tags: dict[str, str]
    """

    properties: Optional["_models.SqlMigrationServiceProperties"] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """The SQL Migration Service properties."""
    location: Optional[str] = rest_field(visibility=["read", "create"])
    tags: Optional[dict[str, str]] = rest_field(visibility=["read", "create", "update", "delete", "query"])

    __flattened_items = ["provisioning_state", "integration_runtime_state"]

    @overload
    def __init__(
        self,
        *,
        properties: Optional["_models.SqlMigrationServiceProperties"] = None,
        location: Optional[str] = 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 SqlMigrationServiceProperties(_Model):
    """The SQL Migration Service properties.

    :ivar provisioning_state: Provisioning state to track the async operation status.
    :vartype provisioning_state: str
    :ivar integration_runtime_state: Current state of the Integration runtime.
    :vartype integration_runtime_state: str
    """

    provisioning_state: Optional[str] = rest_field(name="provisioningState", visibility=["read"])
    """Provisioning state to track the async operation status."""
    integration_runtime_state: Optional[str] = rest_field(name="integrationRuntimeState", visibility=["read"])
    """Current state of the Integration runtime."""


class SqlMigrationServiceUpdate(_Model):
    """An update to a SQL Migration Service.

    :ivar tags: Dictionary of <string>.
    :vartype tags: dict[str, str]
    """

    tags: Optional[dict[str, str]] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """Dictionary of <string>."""

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

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

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


class SsisMigrationInfo(_Model):
    """SSIS migration info with SSIS store type, overwrite policy.

    :ivar ssis_store_type: The SSIS store type of source, only SSIS catalog is supported now in DMS
     (classic). "SsisCatalog"
    :vartype ssis_store_type: str or ~azure.mgmt.datamigration.models.SsisStoreType
    :ivar project_overwrite_option: The overwrite option for the SSIS project migration. Known
     values are: "Ignore" and "Overwrite".
    :vartype project_overwrite_option: str or
     ~azure.mgmt.datamigration.models.SsisMigrationOverwriteOption
    :ivar environment_overwrite_option: The overwrite option for the SSIS environment migration.
     Known values are: "Ignore" and "Overwrite".
    :vartype environment_overwrite_option: str or
     ~azure.mgmt.datamigration.models.SsisMigrationOverwriteOption
    """

    ssis_store_type: Optional[Union[str, "_models.SsisStoreType"]] = rest_field(
        name="ssisStoreType", visibility=["read", "create", "update", "delete", "query"]
    )
    """The SSIS store type of source, only SSIS catalog is supported now in DMS (classic).
     \"SsisCatalog\""""
    project_overwrite_option: Optional[Union[str, "_models.SsisMigrationOverwriteOption"]] = rest_field(
        name="projectOverwriteOption", visibility=["read", "create", "update", "delete", "query"]
    )
    """The overwrite option for the SSIS project migration. Known values are: \"Ignore\" and
     \"Overwrite\"."""
    environment_overwrite_option: Optional[Union[str, "_models.SsisMigrationOverwriteOption"]] = rest_field(
        name="environmentOverwriteOption", visibility=["read", "create", "update", "delete", "query"]
    )
    """The overwrite option for the SSIS environment migration. Known values are: \"Ignore\" and
     \"Overwrite\"."""

    @overload
    def __init__(
        self,
        *,
        ssis_store_type: Optional[Union[str, "_models.SsisStoreType"]] = None,
        project_overwrite_option: Optional[Union[str, "_models.SsisMigrationOverwriteOption"]] = None,
        environment_overwrite_option: Optional[Union[str, "_models.SsisMigrationOverwriteOption"]] = None,
    ) -> None: ...

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

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


class SyncMigrationDatabaseErrorEvent(_Model):
    """Database migration errors for online migration.

    :ivar timestamp_string: String value of timestamp.
    :vartype timestamp_string: str
    :ivar event_type_string: Event type.
    :vartype event_type_string: str
    :ivar event_text: Event text.
    :vartype event_text: str
    """

    timestamp_string: Optional[str] = rest_field(name="timestampString", visibility=["read"])
    """String value of timestamp."""
    event_type_string: Optional[str] = rest_field(name="eventTypeString", visibility=["read"])
    """Event type."""
    event_text: Optional[str] = rest_field(name="eventText", visibility=["read"])
    """Event text."""


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.datamigration.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.datamigration.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 TargetLocation(_Model):
    """Target Location details for optional copy of backups.

    :ivar storage_account_resource_id: Resource Id of the storage account copying backups.
    :vartype storage_account_resource_id: str
    :ivar account_key: Storage Account Key.
    :vartype account_key: str
    """

    storage_account_resource_id: Optional[str] = rest_field(
        name="storageAccountResourceId", visibility=["read", "create", "update", "delete", "query"]
    )
    """Resource Id of the storage account copying backups."""
    account_key: Optional[str] = rest_field(
        name="accountKey", visibility=["read", "create", "update", "delete", "query"]
    )
    """Storage Account Key."""

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

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

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


class UploadOCIDriverTaskInput(_Model):
    """Input for the service task to upload an OCI driver.

    :ivar driver_share: File share information for the OCI driver archive.
    :vartype driver_share: ~azure.mgmt.datamigration.models.FileShare
    """

    driver_share: Optional["_models.FileShare"] = rest_field(
        name="driverShare", visibility=["read", "create", "update", "delete", "query"]
    )
    """File share information for the OCI driver archive."""

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

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

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


class UploadOCIDriverTaskOutput(_Model):
    """Output for the service task to upload an OCI driver.

    :ivar driver_package_name: The name of the driver package that was validated and uploaded.
    :vartype driver_package_name: str
    :ivar validation_errors: Validation errors.
    :vartype validation_errors: list[~azure.mgmt.datamigration.models.ReportableException]
    """

    driver_package_name: Optional[str] = rest_field(name="driverPackageName", visibility=["read"])
    """The name of the driver package that was validated and uploaded."""
    validation_errors: Optional[list["_models.ReportableException"]] = rest_field(
        name="validationErrors", visibility=["read"]
    )
    """Validation errors."""


class UploadOCIDriverTaskProperties(ProjectTaskProperties, discriminator="Service.Upload.OCI"):
    """Properties for the task that uploads an OCI driver.

    :ivar errors: Array of errors. This is ignored if submitted.
    :vartype errors: list[~azure.mgmt.datamigration.models.ODataError]
    :ivar state: The state of the task. This is ignored if submitted. Known values are: "Unknown",
     "Queued", "Running", "Canceled", "Succeeded", "Failed", "FailedInputValidation", and "Faulted".
    :vartype state: str or ~azure.mgmt.datamigration.models.TaskState
    :ivar commands: Array of command properties.
    :vartype commands: list[~azure.mgmt.datamigration.models.CommandProperties]
    :ivar client_data: Key value pairs of client data to attach meta data information to task.
    :vartype client_data: dict[str, str]
    :ivar input: Input for the service task to upload an OCI driver.
    :vartype input: ~azure.mgmt.datamigration.models.UploadOCIDriverTaskInput
    :ivar output: Task output. This is ignored if submitted.
    :vartype output: list[~azure.mgmt.datamigration.models.UploadOCIDriverTaskOutput]
    :ivar task_type: Task type. Required. Service.Upload.OCI.
    :vartype task_type: str or ~azure.mgmt.datamigration.models.SERVICE_UPLOAD_OCI
    """

    input: Optional["_models.UploadOCIDriverTaskInput"] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """Input for the service task to upload an OCI driver."""
    output: Optional[list["_models.UploadOCIDriverTaskOutput"]] = rest_field(visibility=["read"])
    """Task output. This is ignored if submitted."""
    task_type: Literal[TaskType.SERVICE_UPLOAD_OCI] = rest_discriminator(name="taskType", visibility=["read", "create", "update", "delete", "query"])  # type: ignore
    """Task type. Required. Service.Upload.OCI."""

    @overload
    def __init__(
        self,
        *,
        client_data: Optional[dict[str, str]] = None,
        input: Optional["_models.UploadOCIDriverTaskInput"] = None,
    ) -> None: ...

    @overload
    def __init__(self, mapping: Mapping[str, Any]) -> None:
        """
        :param 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.task_type = TaskType.SERVICE_UPLOAD_OCI  # type: ignore


class UserAssignedIdentity(_Model):
    """User assigned identity properties.

    :ivar principal_id: The principal ID of the assigned identity.
    :vartype principal_id: str
    :ivar client_id: The client ID of the assigned identity.
    :vartype client_id: str
    """

    principal_id: Optional[str] = rest_field(name="principalId", visibility=["read"])
    """The principal ID of the assigned identity."""
    client_id: Optional[str] = rest_field(name="clientId", visibility=["read"])
    """The client ID of the assigned identity."""


class ValidateMigrationInputSqlServerSqlDbSyncTaskProperties(
    ProjectTaskProperties, discriminator="ValidateMigrationInput.SqlServer.SqlDb.Sync"
):  # pylint: disable=name-too-long
    """Properties for task that validates migration input for SQL to Azure SQL DB sync migrations.

    :ivar errors: Array of errors. This is ignored if submitted.
    :vartype errors: list[~azure.mgmt.datamigration.models.ODataError]
    :ivar state: The state of the task. This is ignored if submitted. Known values are: "Unknown",
     "Queued", "Running", "Canceled", "Succeeded", "Failed", "FailedInputValidation", and "Faulted".
    :vartype state: str or ~azure.mgmt.datamigration.models.TaskState
    :ivar commands: Array of command properties.
    :vartype commands: list[~azure.mgmt.datamigration.models.CommandProperties]
    :ivar client_data: Key value pairs of client data to attach meta data information to task.
    :vartype client_data: dict[str, str]
    :ivar input: Task input.
    :vartype input: ~azure.mgmt.datamigration.models.ValidateSyncMigrationInputSqlServerTaskInput
    :ivar output: Task output. This is ignored if submitted.
    :vartype output:
     list[~azure.mgmt.datamigration.models.ValidateSyncMigrationInputSqlServerTaskOutput]
    :ivar task_type: Task type. Required. ValidateMigrationInput.SqlServer.SqlDb.Sync.
    :vartype task_type: str or
     ~azure.mgmt.datamigration.models.VALIDATE_MIGRATION_INPUT_SQL_SERVER_SQL_DB_SYNC
    """

    input: Optional["_models.ValidateSyncMigrationInputSqlServerTaskInput"] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """Task input."""
    output: Optional[list["_models.ValidateSyncMigrationInputSqlServerTaskOutput"]] = rest_field(visibility=["read"])
    """Task output. This is ignored if submitted."""
    task_type: Literal[TaskType.VALIDATE_MIGRATION_INPUT_SQL_SERVER_SQL_DB_SYNC] = rest_discriminator(name="taskType", visibility=["read", "create", "update", "delete", "query"])  # type: ignore
    """Task type. Required. ValidateMigrationInput.SqlServer.SqlDb.Sync."""

    @overload
    def __init__(
        self,
        *,
        client_data: Optional[dict[str, str]] = None,
        input: Optional["_models.ValidateSyncMigrationInputSqlServerTaskInput"] = None,
    ) -> None: ...

    @overload
    def __init__(self, mapping: Mapping[str, Any]) -> None:
        """
        :param 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.task_type = TaskType.VALIDATE_MIGRATION_INPUT_SQL_SERVER_SQL_DB_SYNC  # type: ignore


class ValidateMigrationInputSqlServerSqlMISyncTaskInput(SqlServerSqlMISyncTaskInput):  # pylint: disable=name-too-long
    """Input for task that migrates SQL Server databases to Azure SQL Database Managed Instance online
    scenario.

    :ivar selected_databases: Databases to migrate. Required.
    :vartype selected_databases:
     list[~azure.mgmt.datamigration.models.MigrateSqlServerSqlMIDatabaseInput]
    :ivar backup_file_share: Backup file share information for all selected databases.
    :vartype backup_file_share: ~azure.mgmt.datamigration.models.FileShare
    :ivar storage_resource_id: Fully qualified resourceId of storage. Required.
    :vartype storage_resource_id: str
    :ivar source_connection_info: Connection information for source SQL Server. Required.
    :vartype source_connection_info: ~azure.mgmt.datamigration.models.SqlConnectionInfo
    :ivar target_connection_info: Connection information for Azure SQL Database Managed Instance.
     Required.
    :vartype target_connection_info: ~azure.mgmt.datamigration.models.MiSqlConnectionInfo
    :ivar azure_app: Azure Active Directory Application the DMS (classic) instance will use to
     connect to the target instance of Azure SQL Database Managed Instance and the Azure Storage
     Account. Required.
    :vartype azure_app: ~azure.mgmt.datamigration.models.AzureActiveDirectoryApp
    """

    @overload
    def __init__(
        self,
        *,
        selected_databases: list["_models.MigrateSqlServerSqlMIDatabaseInput"],
        storage_resource_id: str,
        source_connection_info: "_models.SqlConnectionInfo",
        target_connection_info: "_models.MiSqlConnectionInfo",
        azure_app: "_models.AzureActiveDirectoryApp",
        backup_file_share: Optional["_models.FileShare"] = None,
    ) -> None: ...

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

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


class ValidateMigrationInputSqlServerSqlMISyncTaskOutput(_Model):  # pylint: disable=name-too-long
    """Output for task that validates migration input for Azure SQL Database Managed Instance online
    migration.

    :ivar id: Database identifier.
    :vartype id: str
    :ivar name: Name of database.
    :vartype name: str
    :ivar validation_errors: Errors associated with a selected database object.
    :vartype validation_errors: list[~azure.mgmt.datamigration.models.ReportableException]
    """

    id: Optional[str] = rest_field(visibility=["read"])
    """Database identifier."""
    name: Optional[str] = rest_field(visibility=["read"])
    """Name of database."""
    validation_errors: Optional[list["_models.ReportableException"]] = rest_field(
        name="validationErrors", visibility=["read"]
    )
    """Errors associated with a selected database object."""


class ValidateMigrationInputSqlServerSqlMISyncTaskProperties(
    ProjectTaskProperties, discriminator="ValidateMigrationInput.SqlServer.AzureSqlDbMI.Sync.LRS"
):  # pylint: disable=name-too-long
    """Properties for task that validates migration input for SQL to Azure SQL Database Managed
    Instance sync scenario.

    :ivar errors: Array of errors. This is ignored if submitted.
    :vartype errors: list[~azure.mgmt.datamigration.models.ODataError]
    :ivar state: The state of the task. This is ignored if submitted. Known values are: "Unknown",
     "Queued", "Running", "Canceled", "Succeeded", "Failed", "FailedInputValidation", and "Faulted".
    :vartype state: str or ~azure.mgmt.datamigration.models.TaskState
    :ivar commands: Array of command properties.
    :vartype commands: list[~azure.mgmt.datamigration.models.CommandProperties]
    :ivar client_data: Key value pairs of client data to attach meta data information to task.
    :vartype client_data: dict[str, str]
    :ivar input: Task input.
    :vartype input:
     ~azure.mgmt.datamigration.models.ValidateMigrationInputSqlServerSqlMISyncTaskInput
    :ivar output: Task output. This is ignored if submitted.
    :vartype output:
     list[~azure.mgmt.datamigration.models.ValidateMigrationInputSqlServerSqlMISyncTaskOutput]
    :ivar task_type: Task type. Required. ValidateMigrationInput.SqlServer.AzureSqlDbMI.Sync.LRS.
    :vartype task_type: str or
     ~azure.mgmt.datamigration.models.VALIDATE_MIGRATION_INPUT_SQL_SERVER_AZURE_SQL_DB_MI_SYNC_LRS
    """

    input: Optional["_models.ValidateMigrationInputSqlServerSqlMISyncTaskInput"] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """Task input."""
    output: Optional[list["_models.ValidateMigrationInputSqlServerSqlMISyncTaskOutput"]] = rest_field(
        visibility=["read"]
    )
    """Task output. This is ignored if submitted."""
    task_type: Literal[TaskType.VALIDATE_MIGRATION_INPUT_SQL_SERVER_AZURE_SQL_DB_MI_SYNC_LRS] = rest_discriminator(name="taskType", visibility=["read", "create", "update", "delete", "query"])  # type: ignore
    """Task type. Required. ValidateMigrationInput.SqlServer.AzureSqlDbMI.Sync.LRS."""

    @overload
    def __init__(
        self,
        *,
        client_data: Optional[dict[str, str]] = None,
        input: Optional["_models.ValidateMigrationInputSqlServerSqlMISyncTaskInput"] = None,
    ) -> None: ...

    @overload
    def __init__(self, mapping: Mapping[str, Any]) -> None:
        """
        :param 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.task_type = TaskType.VALIDATE_MIGRATION_INPUT_SQL_SERVER_AZURE_SQL_DB_MI_SYNC_LRS  # type: ignore


class ValidateMigrationInputSqlServerSqlMITaskInput(_Model):  # pylint: disable=name-too-long
    """Input for task that validates migration input for SQL to Azure SQL Managed Instance.

    :ivar source_connection_info: Information for connecting to source. Required.
    :vartype source_connection_info: ~azure.mgmt.datamigration.models.SqlConnectionInfo
    :ivar target_connection_info: Information for connecting to target. Required.
    :vartype target_connection_info: ~azure.mgmt.datamigration.models.SqlConnectionInfo
    :ivar selected_databases: Databases to migrate. Required.
    :vartype selected_databases:
     list[~azure.mgmt.datamigration.models.MigrateSqlServerSqlMIDatabaseInput]
    :ivar selected_logins: Logins to migrate.
    :vartype selected_logins: list[str]
    :ivar backup_file_share: Backup file share information for all selected databases.
    :vartype backup_file_share: ~azure.mgmt.datamigration.models.FileShare
    :ivar backup_blob_share: SAS URI of Azure Storage Account Container to be used for storing
     backup files. Required.
    :vartype backup_blob_share: ~azure.mgmt.datamigration.models.BlobShare
    :ivar backup_mode: Backup Mode to specify whether to use existing backup or create new backup.
     Known values are: "CreateBackup" and "ExistingBackup".
    :vartype backup_mode: str or ~azure.mgmt.datamigration.models.BackupMode
    """

    source_connection_info: "_models.SqlConnectionInfo" = rest_field(
        name="sourceConnectionInfo", visibility=["read", "create", "update", "delete", "query"]
    )
    """Information for connecting to source. Required."""
    target_connection_info: "_models.SqlConnectionInfo" = rest_field(
        name="targetConnectionInfo", visibility=["read", "create", "update", "delete", "query"]
    )
    """Information for connecting to target. Required."""
    selected_databases: list["_models.MigrateSqlServerSqlMIDatabaseInput"] = rest_field(
        name="selectedDatabases", visibility=["read", "create", "update", "delete", "query"]
    )
    """Databases to migrate. Required."""
    selected_logins: Optional[list[str]] = rest_field(
        name="selectedLogins", visibility=["read", "create", "update", "delete", "query"]
    )
    """Logins to migrate."""
    backup_file_share: Optional["_models.FileShare"] = rest_field(
        name="backupFileShare", visibility=["read", "create", "update", "delete", "query"]
    )
    """Backup file share information for all selected databases."""
    backup_blob_share: "_models.BlobShare" = rest_field(
        name="backupBlobShare", visibility=["read", "create", "update", "delete", "query"]
    )
    """SAS URI of Azure Storage Account Container to be used for storing backup files. Required."""
    backup_mode: Optional[Union[str, "_models.BackupMode"]] = rest_field(
        name="backupMode", visibility=["read", "create", "update", "delete", "query"]
    )
    """Backup Mode to specify whether to use existing backup or create new backup. Known values are:
     \"CreateBackup\" and \"ExistingBackup\"."""

    @overload
    def __init__(
        self,
        *,
        source_connection_info: "_models.SqlConnectionInfo",
        target_connection_info: "_models.SqlConnectionInfo",
        selected_databases: list["_models.MigrateSqlServerSqlMIDatabaseInput"],
        backup_blob_share: "_models.BlobShare",
        selected_logins: Optional[list[str]] = None,
        backup_file_share: Optional["_models.FileShare"] = None,
        backup_mode: Optional[Union[str, "_models.BackupMode"]] = None,
    ) -> None: ...

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

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


class ValidateMigrationInputSqlServerSqlMITaskOutput(_Model):  # pylint: disable=name-too-long
    """Output for task that validates migration input for SQL to Azure SQL Managed Instance
    migrations.

    :ivar id: Result identifier.
    :vartype id: str
    :ivar name: Name of database.
    :vartype name: str
    :ivar restore_database_name_errors: Errors associated with the RestoreDatabaseName.
    :vartype restore_database_name_errors:
     list[~azure.mgmt.datamigration.models.ReportableException]
    :ivar backup_folder_errors: Errors associated with the BackupFolder path.
    :vartype backup_folder_errors: list[~azure.mgmt.datamigration.models.ReportableException]
    :ivar backup_share_credentials_errors: Errors associated with backup share user name and
     password credentials.
    :vartype backup_share_credentials_errors:
     list[~azure.mgmt.datamigration.models.ReportableException]
    :ivar backup_storage_account_errors: Errors associated with the storage account provided.
    :vartype backup_storage_account_errors:
     list[~azure.mgmt.datamigration.models.ReportableException]
    :ivar existing_backup_errors: Errors associated with existing backup files.
    :vartype existing_backup_errors: list[~azure.mgmt.datamigration.models.ReportableException]
    :ivar database_backup_info: Information about backup files when existing backup mode is used.
    :vartype database_backup_info: ~azure.mgmt.datamigration.models.DatabaseBackupInfo
    """

    id: Optional[str] = rest_field(visibility=["read"])
    """Result identifier."""
    name: Optional[str] = rest_field(visibility=["read"])
    """Name of database."""
    restore_database_name_errors: Optional[list["_models.ReportableException"]] = rest_field(
        name="restoreDatabaseNameErrors", visibility=["read"]
    )
    """Errors associated with the RestoreDatabaseName."""
    backup_folder_errors: Optional[list["_models.ReportableException"]] = rest_field(
        name="backupFolderErrors", visibility=["read"]
    )
    """Errors associated with the BackupFolder path."""
    backup_share_credentials_errors: Optional[list["_models.ReportableException"]] = rest_field(
        name="backupShareCredentialsErrors", visibility=["read"]
    )
    """Errors associated with backup share user name and password credentials."""
    backup_storage_account_errors: Optional[list["_models.ReportableException"]] = rest_field(
        name="backupStorageAccountErrors", visibility=["read"]
    )
    """Errors associated with the storage account provided."""
    existing_backup_errors: Optional[list["_models.ReportableException"]] = rest_field(
        name="existingBackupErrors", visibility=["read"]
    )
    """Errors associated with existing backup files."""
    database_backup_info: Optional["_models.DatabaseBackupInfo"] = rest_field(
        name="databaseBackupInfo", visibility=["read", "create", "update", "delete", "query"]
    )
    """Information about backup files when existing backup mode is used."""

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

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

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


class ValidateMigrationInputSqlServerSqlMITaskProperties(
    ProjectTaskProperties, discriminator="ValidateMigrationInput.SqlServer.AzureSqlDbMI"
):  # pylint: disable=name-too-long
    """Properties for task that validates migration input for SQL to Azure SQL Database Managed
    Instance.

    :ivar errors: Array of errors. This is ignored if submitted.
    :vartype errors: list[~azure.mgmt.datamigration.models.ODataError]
    :ivar state: The state of the task. This is ignored if submitted. Known values are: "Unknown",
     "Queued", "Running", "Canceled", "Succeeded", "Failed", "FailedInputValidation", and "Faulted".
    :vartype state: str or ~azure.mgmt.datamigration.models.TaskState
    :ivar commands: Array of command properties.
    :vartype commands: list[~azure.mgmt.datamigration.models.CommandProperties]
    :ivar client_data: Key value pairs of client data to attach meta data information to task.
    :vartype client_data: dict[str, str]
    :ivar input: Task input.
    :vartype input: ~azure.mgmt.datamigration.models.ValidateMigrationInputSqlServerSqlMITaskInput
    :ivar output: Task output. This is ignored if submitted.
    :vartype output:
     list[~azure.mgmt.datamigration.models.ValidateMigrationInputSqlServerSqlMITaskOutput]
    :ivar task_type: Task type. Required. ValidateMigrationInput.SqlServer.AzureSqlDbMI.
    :vartype task_type: str or
     ~azure.mgmt.datamigration.models.VALIDATE_MIGRATION_INPUT_SQL_SERVER_AZURE_SQL_DB_MI
    """

    input: Optional["_models.ValidateMigrationInputSqlServerSqlMITaskInput"] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """Task input."""
    output: Optional[list["_models.ValidateMigrationInputSqlServerSqlMITaskOutput"]] = rest_field(visibility=["read"])
    """Task output. This is ignored if submitted."""
    task_type: Literal[TaskType.VALIDATE_MIGRATION_INPUT_SQL_SERVER_AZURE_SQL_DB_MI] = rest_discriminator(name="taskType", visibility=["read", "create", "update", "delete", "query"])  # type: ignore
    """Task type. Required. ValidateMigrationInput.SqlServer.AzureSqlDbMI."""

    @overload
    def __init__(
        self,
        *,
        client_data: Optional[dict[str, str]] = None,
        input: Optional["_models.ValidateMigrationInputSqlServerSqlMITaskInput"] = None,
    ) -> None: ...

    @overload
    def __init__(self, mapping: Mapping[str, Any]) -> None:
        """
        :param 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.task_type = TaskType.VALIDATE_MIGRATION_INPUT_SQL_SERVER_AZURE_SQL_DB_MI  # type: ignore


class ValidateMongoDbTaskProperties(ProjectTaskProperties, discriminator="Validate.MongoDb"):
    """Properties for the task that validates a migration between MongoDB data sources.

    :ivar errors: Array of errors. This is ignored if submitted.
    :vartype errors: list[~azure.mgmt.datamigration.models.ODataError]
    :ivar state: The state of the task. This is ignored if submitted. Known values are: "Unknown",
     "Queued", "Running", "Canceled", "Succeeded", "Failed", "FailedInputValidation", and "Faulted".
    :vartype state: str or ~azure.mgmt.datamigration.models.TaskState
    :ivar commands: Array of command properties.
    :vartype commands: list[~azure.mgmt.datamigration.models.CommandProperties]
    :ivar client_data: Key value pairs of client data to attach meta data information to task.
    :vartype client_data: dict[str, str]
    :ivar input: Describes how a MongoDB data migration should be performed.
    :vartype input: ~azure.mgmt.datamigration.models.MongoDbMigrationSettings
    :ivar output: An array containing a single MongoDbMigrationProgress object.
    :vartype output: list[~azure.mgmt.datamigration.models.MongoDbMigrationProgress]
    :ivar task_type: Task type. Required. Validate.MongoDb.
    :vartype task_type: str or ~azure.mgmt.datamigration.models.VALIDATE_MONGO_DB
    """

    input: Optional["_models.MongoDbMigrationSettings"] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """Describes how a MongoDB data migration should be performed."""
    output: Optional[list["_models.MongoDbMigrationProgress"]] = rest_field(visibility=["read"])
    """An array containing a single MongoDbMigrationProgress object."""
    task_type: Literal[TaskType.VALIDATE_MONGO_DB] = rest_discriminator(name="taskType", visibility=["read", "create", "update", "delete", "query"])  # type: ignore
    """Task type. Required. Validate.MongoDb."""

    @overload
    def __init__(
        self,
        *,
        client_data: Optional[dict[str, str]] = None,
        input: Optional["_models.MongoDbMigrationSettings"] = None,
    ) -> None: ...

    @overload
    def __init__(self, mapping: Mapping[str, Any]) -> None:
        """
        :param 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.task_type = TaskType.VALIDATE_MONGO_DB  # type: ignore


class ValidateOracleAzureDbForPostgreSqlSyncTaskProperties(
    ProjectTaskProperties, discriminator="Validate.Oracle.AzureDbPostgreSql.Sync"
):  # pylint: disable=name-too-long
    """Properties for the task that validates a migration for Oracle to Azure Database for PostgreSQL
    for online migrations.

    :ivar errors: Array of errors. This is ignored if submitted.
    :vartype errors: list[~azure.mgmt.datamigration.models.ODataError]
    :ivar state: The state of the task. This is ignored if submitted. Known values are: "Unknown",
     "Queued", "Running", "Canceled", "Succeeded", "Failed", "FailedInputValidation", and "Faulted".
    :vartype state: str or ~azure.mgmt.datamigration.models.TaskState
    :ivar commands: Array of command properties.
    :vartype commands: list[~azure.mgmt.datamigration.models.CommandProperties]
    :ivar client_data: Key value pairs of client data to attach meta data information to task.
    :vartype client_data: dict[str, str]
    :ivar input: Input for the task that migrates Oracle databases to Azure Database for PostgreSQL
     for online migrations.
    :vartype input: ~azure.mgmt.datamigration.models.MigrateOracleAzureDbPostgreSqlSyncTaskInput
    :ivar output: An array containing a single validation error response object.
    :vartype output:
     list[~azure.mgmt.datamigration.models.ValidateOracleAzureDbPostgreSqlSyncTaskOutput]
    :ivar task_type: Task type. Required. Validate.Oracle.AzureDbPostgreSql.Sync.
    :vartype task_type: str or
     ~azure.mgmt.datamigration.models.VALIDATE_ORACLE_AZURE_DB_POSTGRE_SQL_SYNC
    """

    input: Optional["_models.MigrateOracleAzureDbPostgreSqlSyncTaskInput"] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """Input for the task that migrates Oracle databases to Azure Database for PostgreSQL for online
     migrations."""
    output: Optional[list["_models.ValidateOracleAzureDbPostgreSqlSyncTaskOutput"]] = rest_field(visibility=["read"])
    """An array containing a single validation error response object."""
    task_type: Literal[TaskType.VALIDATE_ORACLE_AZURE_DB_POSTGRE_SQL_SYNC] = rest_discriminator(name="taskType", visibility=["read", "create", "update", "delete", "query"])  # type: ignore
    """Task type. Required. Validate.Oracle.AzureDbPostgreSql.Sync."""

    @overload
    def __init__(
        self,
        *,
        client_data: Optional[dict[str, str]] = None,
        input: Optional["_models.MigrateOracleAzureDbPostgreSqlSyncTaskInput"] = None,
    ) -> None: ...

    @overload
    def __init__(self, mapping: Mapping[str, Any]) -> None:
        """
        :param 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.task_type = TaskType.VALIDATE_ORACLE_AZURE_DB_POSTGRE_SQL_SYNC  # type: ignore


class ValidateOracleAzureDbPostgreSqlSyncTaskOutput(_Model):  # pylint: disable=name-too-long
    """Output for task that validates migration input for Oracle to Azure Database for PostgreSQL for
    online migrations.

    :ivar validation_errors: Errors associated with a selected database object.
    :vartype validation_errors: list[~azure.mgmt.datamigration.models.ReportableException]
    """

    validation_errors: Optional[list["_models.ReportableException"]] = rest_field(
        name="validationErrors", visibility=["read"]
    )
    """Errors associated with a selected database object."""


class ValidateSyncMigrationInputSqlServerTaskInput(_Model):  # pylint: disable=name-too-long
    """Input for task that validates migration input for SQL sync migrations.

    :ivar source_connection_info: Information for connecting to source SQL server. Required.
    :vartype source_connection_info: ~azure.mgmt.datamigration.models.SqlConnectionInfo
    :ivar target_connection_info: Information for connecting to target. Required.
    :vartype target_connection_info: ~azure.mgmt.datamigration.models.SqlConnectionInfo
    :ivar selected_databases: Databases to migrate. Required.
    :vartype selected_databases:
     list[~azure.mgmt.datamigration.models.MigrateSqlServerSqlDbSyncDatabaseInput]
    """

    source_connection_info: "_models.SqlConnectionInfo" = rest_field(
        name="sourceConnectionInfo", visibility=["read", "create", "update", "delete", "query"]
    )
    """Information for connecting to source SQL server. Required."""
    target_connection_info: "_models.SqlConnectionInfo" = rest_field(
        name="targetConnectionInfo", visibility=["read", "create", "update", "delete", "query"]
    )
    """Information for connecting to target. Required."""
    selected_databases: list["_models.MigrateSqlServerSqlDbSyncDatabaseInput"] = rest_field(
        name="selectedDatabases", visibility=["read", "create", "update", "delete", "query"]
    )
    """Databases to migrate. Required."""

    @overload
    def __init__(
        self,
        *,
        source_connection_info: "_models.SqlConnectionInfo",
        target_connection_info: "_models.SqlConnectionInfo",
        selected_databases: list["_models.MigrateSqlServerSqlDbSyncDatabaseInput"],
    ) -> None: ...

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

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


class ValidateSyncMigrationInputSqlServerTaskOutput(_Model):  # pylint: disable=name-too-long
    """Output for task that validates migration input for SQL sync migrations.

    :ivar id: Database identifier.
    :vartype id: str
    :ivar name: Name of database.
    :vartype name: str
    :ivar validation_errors: Errors associated with a selected database object.
    :vartype validation_errors: list[~azure.mgmt.datamigration.models.ReportableException]
    """

    id: Optional[str] = rest_field(visibility=["read"])
    """Database identifier."""
    name: Optional[str] = rest_field(visibility=["read"])
    """Name of database."""
    validation_errors: Optional[list["_models.ReportableException"]] = rest_field(
        name="validationErrors", visibility=["read"]
    )
    """Errors associated with a selected database object."""


class ValidationError(_Model):
    """Description about the errors happen while performing migration validation.

    :ivar text: Error Text.
    :vartype text: str
    :ivar severity: Severity of the error. Known values are: "Message", "Warning", and "Error".
    :vartype severity: str or ~azure.mgmt.datamigration.models.Severity
    """

    text: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"])
    """Error Text."""
    severity: Optional[Union[str, "_models.Severity"]] = rest_field(
        visibility=["read", "create", "update", "delete", "query"]
    )
    """Severity of the error. Known values are: \"Message\", \"Warning\", and \"Error\"."""

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

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

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


class WaitStatistics(_Model):
    """Wait statistics gathered during query batch execution.

    :ivar wait_type: Type of the Wait.
    :vartype wait_type: str
    :ivar wait_time_ms: Total wait time in millisecond(s).
    :vartype wait_time_ms: float
    :ivar wait_count: Total no. of waits.
    :vartype wait_count: int
    """

    wait_type: Optional[str] = rest_field(name="waitType", visibility=["read", "create", "update", "delete", "query"])
    """Type of the Wait."""
    wait_time_ms: Optional[float] = rest_field(
        name="waitTimeMs", visibility=["read", "create", "update", "delete", "query"]
    )
    """Total wait time in millisecond(s)."""
    wait_count: Optional[int] = rest_field(name="waitCount", visibility=["read", "create", "update", "delete", "query"])
    """Total no. of waits."""

    @overload
    def __init__(
        self,
        *,
        wait_type: Optional[str] = None,
        wait_time_ms: Optional[float] = None,
        wait_count: Optional[int] = None,
    ) -> None: ...

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

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